@opengis/bi 1.2.4 → 1.2.6

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,3509 +0,0 @@
1
- import { createElementBlock as _, openBlock as x, createElementVNode as m, Fragment as F, renderList as P, normalizeStyle as Re, normalizeClass as J, createCommentVNode as $, toDisplayString as E, ref as be, computed as Le, onUnmounted as vt, createTextVNode as Ze, defineAsyncComponent as T, defineComponent as Et, mergeModels as Pe, useModel as Ct, withDirectives as Rt, vModelCheckbox as Ot, resolveComponent as j, createBlock as I, createVNode as Oe, resolveDynamicComponent as Tt, createStaticVNode as Ye, withCtx as $t } from "vue";
2
- function V(e, t) {
3
- return e != null && e.value ? isNaN(e == null ? void 0 : e.value) ? e == null ? void 0 : e.value : new Intl.NumberFormat("en", t || {
4
- notation: "compact"
5
- }).format(e == null ? void 0 : e.value) : isNaN(e) ? e : new Intl.NumberFormat("en", t || {
6
- notation: "compact"
7
- }).format(e);
8
- }
9
- function Te(e) {
10
- if (!(e != null && e.includes("T")))
11
- return e;
12
- const [t, r, s] = e.split("T")[0].split("-");
13
- return `${s}.${r}.${t}`;
14
- }
15
- function Uo(e) {
16
- return Intl.NumberFormat("en").format(e);
17
- }
18
- function et(e, t) {
19
- return function() {
20
- return e.apply(t, arguments);
21
- };
22
- }
23
- const { toString: Nt } = Object.prototype, { getPrototypeOf: $e } = Object, { iterator: de, toStringTag: tt } = Symbol, fe = /* @__PURE__ */ ((e) => (t) => {
24
- const r = Nt.call(t);
25
- return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
26
- })(/* @__PURE__ */ Object.create(null)), B = (e) => (e = e.toLowerCase(), (t) => fe(t) === e), he = (e) => (t) => typeof t === e, { isArray: X } = Array, Z = he("undefined");
27
- function ee(e) {
28
- return e !== null && !Z(e) && e.constructor !== null && !Z(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
29
- }
30
- const rt = B("ArrayBuffer");
31
- function At(e) {
32
- let t;
33
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && rt(e.buffer), t;
34
- }
35
- const Ft = he("string"), N = he("function"), st = he("number"), te = (e) => e !== null && typeof e == "object", Lt = (e) => e === !0 || e === !1, oe = (e) => {
36
- if (fe(e) !== "object")
37
- return !1;
38
- const t = $e(e);
39
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(tt in e) && !(de in e);
40
- }, Pt = (e) => {
41
- if (!te(e) || ee(e))
42
- return !1;
43
- try {
44
- return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
45
- } catch {
46
- return !1;
47
- }
48
- }, Bt = B("Date"), Ut = B("File"), jt = B("Blob"), Vt = B("FileList"), It = (e) => te(e) && N(e.pipe), zt = (e) => {
49
- let t;
50
- return e && (typeof FormData == "function" && e instanceof FormData || N(e.append) && ((t = fe(e)) === "formdata" || // detect form-data instance
51
- t === "object" && N(e.toString) && e.toString() === "[object FormData]"));
52
- }, Mt = B("URLSearchParams"), [qt, Ht, Wt, Jt] = ["ReadableStream", "Request", "Response", "Headers"].map(B), Kt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
53
- function re(e, t, { allOwnKeys: r = !1 } = {}) {
54
- if (e === null || typeof e > "u")
55
- return;
56
- let s, n;
57
- if (typeof e != "object" && (e = [e]), X(e))
58
- for (s = 0, n = e.length; s < n; s++)
59
- t.call(null, e[s], s, e);
60
- else {
61
- if (ee(e))
62
- return;
63
- const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
64
- let a;
65
- for (s = 0; s < i; s++)
66
- a = o[s], t.call(null, e[a], a, e);
67
- }
68
- }
69
- function nt(e, t) {
70
- if (ee(e))
71
- return null;
72
- t = t.toLowerCase();
73
- const r = Object.keys(e);
74
- let s = r.length, n;
75
- for (; s-- > 0; )
76
- if (n = r[s], t === n.toLowerCase())
77
- return n;
78
- return null;
79
- }
80
- const H = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ot = (e) => !Z(e) && e !== H;
81
- function De() {
82
- const { caseless: e } = ot(this) && this || {}, t = {}, r = (s, n) => {
83
- const o = e && nt(t, n) || n;
84
- oe(t[o]) && oe(s) ? t[o] = De(t[o], s) : oe(s) ? t[o] = De({}, s) : X(s) ? t[o] = s.slice() : t[o] = s;
85
- };
86
- for (let s = 0, n = arguments.length; s < n; s++)
87
- arguments[s] && re(arguments[s], r);
88
- return t;
89
- }
90
- const Xt = (e, t, r, { allOwnKeys: s } = {}) => (re(t, (n, o) => {
91
- r && N(n) ? e[o] = et(n, r) : e[o] = n;
92
- }, { allOwnKeys: s }), e), Gt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Qt = (e, t, r, s) => {
93
- e.prototype = Object.create(t.prototype, s), e.prototype.constructor = e, Object.defineProperty(e, "super", {
94
- value: t.prototype
95
- }), r && Object.assign(e.prototype, r);
96
- }, Zt = (e, t, r, s) => {
97
- let n, o, i;
98
- const a = {};
99
- if (t = t || {}, e == null) return t;
100
- do {
101
- for (n = Object.getOwnPropertyNames(e), o = n.length; o-- > 0; )
102
- i = n[o], (!s || s(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
103
- e = r !== !1 && $e(e);
104
- } while (e && (!r || r(e, t)) && e !== Object.prototype);
105
- return t;
106
- }, Yt = (e, t, r) => {
107
- e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
108
- const s = e.indexOf(t, r);
109
- return s !== -1 && s === r;
110
- }, er = (e) => {
111
- if (!e) return null;
112
- if (X(e)) return e;
113
- let t = e.length;
114
- if (!st(t)) return null;
115
- const r = new Array(t);
116
- for (; t-- > 0; )
117
- r[t] = e[t];
118
- return r;
119
- }, tr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && $e(Uint8Array)), rr = (e, t) => {
120
- const s = (e && e[de]).call(e);
121
- let n;
122
- for (; (n = s.next()) && !n.done; ) {
123
- const o = n.value;
124
- t.call(e, o[0], o[1]);
125
- }
126
- }, sr = (e, t) => {
127
- let r;
128
- const s = [];
129
- for (; (r = e.exec(t)) !== null; )
130
- s.push(r);
131
- return s;
132
- }, nr = B("HTMLFormElement"), or = (e) => e.toLowerCase().replace(
133
- /[-_\s]([a-z\d])(\w*)/g,
134
- function(r, s, n) {
135
- return s.toUpperCase() + n;
136
- }
137
- ), Be = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), ir = B("RegExp"), it = (e, t) => {
138
- const r = Object.getOwnPropertyDescriptors(e), s = {};
139
- re(r, (n, o) => {
140
- let i;
141
- (i = t(n, o, e)) !== !1 && (s[o] = i || n);
142
- }), Object.defineProperties(e, s);
143
- }, ar = (e) => {
144
- it(e, (t, r) => {
145
- if (N(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
146
- return !1;
147
- const s = e[r];
148
- if (N(s)) {
149
- if (t.enumerable = !1, "writable" in t) {
150
- t.writable = !1;
151
- return;
152
- }
153
- t.set || (t.set = () => {
154
- throw Error("Can not rewrite read-only method '" + r + "'");
155
- });
156
- }
157
- });
158
- }, lr = (e, t) => {
159
- const r = {}, s = (n) => {
160
- n.forEach((o) => {
161
- r[o] = !0;
162
- });
163
- };
164
- return X(e) ? s(e) : s(String(e).split(t)), r;
165
- }, cr = () => {
166
- }, ur = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
167
- function dr(e) {
168
- return !!(e && N(e.append) && e[tt] === "FormData" && e[de]);
169
- }
170
- const fr = (e) => {
171
- const t = new Array(10), r = (s, n) => {
172
- if (te(s)) {
173
- if (t.indexOf(s) >= 0)
174
- return;
175
- if (ee(s))
176
- return s;
177
- if (!("toJSON" in s)) {
178
- t[n] = s;
179
- const o = X(s) ? [] : {};
180
- return re(s, (i, a) => {
181
- const f = r(i, n + 1);
182
- !Z(f) && (o[a] = f);
183
- }), t[n] = void 0, o;
184
- }
185
- }
186
- return s;
187
- };
188
- return r(e, 0);
189
- }, hr = B("AsyncFunction"), pr = (e) => e && (te(e) || N(e)) && N(e.then) && N(e.catch), at = ((e, t) => e ? setImmediate : t ? ((r, s) => (H.addEventListener("message", ({ source: n, data: o }) => {
190
- n === H && o === r && s.length && s.shift()();
191
- }, !1), (n) => {
192
- s.push(n), H.postMessage(r, "*");
193
- }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
194
- typeof setImmediate == "function",
195
- N(H.postMessage)
196
- ), mr = typeof queueMicrotask < "u" ? queueMicrotask.bind(H) : typeof process < "u" && process.nextTick || at, gr = (e) => e != null && N(e[de]), l = {
197
- isArray: X,
198
- isArrayBuffer: rt,
199
- isBuffer: ee,
200
- isFormData: zt,
201
- isArrayBufferView: At,
202
- isString: Ft,
203
- isNumber: st,
204
- isBoolean: Lt,
205
- isObject: te,
206
- isPlainObject: oe,
207
- isEmptyObject: Pt,
208
- isReadableStream: qt,
209
- isRequest: Ht,
210
- isResponse: Wt,
211
- isHeaders: Jt,
212
- isUndefined: Z,
213
- isDate: Bt,
214
- isFile: Ut,
215
- isBlob: jt,
216
- isRegExp: ir,
217
- isFunction: N,
218
- isStream: It,
219
- isURLSearchParams: Mt,
220
- isTypedArray: tr,
221
- isFileList: Vt,
222
- forEach: re,
223
- merge: De,
224
- extend: Xt,
225
- trim: Kt,
226
- stripBOM: Gt,
227
- inherits: Qt,
228
- toFlatObject: Zt,
229
- kindOf: fe,
230
- kindOfTest: B,
231
- endsWith: Yt,
232
- toArray: er,
233
- forEachEntry: rr,
234
- matchAll: sr,
235
- isHTMLForm: nr,
236
- hasOwnProperty: Be,
237
- hasOwnProp: Be,
238
- // an alias to avoid ESLint no-prototype-builtins detection
239
- reduceDescriptors: it,
240
- freezeMethods: ar,
241
- toObjectSet: lr,
242
- toCamelCase: or,
243
- noop: cr,
244
- toFiniteNumber: ur,
245
- findKey: nt,
246
- global: H,
247
- isContextDefined: ot,
248
- isSpecCompliantForm: dr,
249
- toJSONObject: fr,
250
- isAsyncFn: hr,
251
- isThenable: pr,
252
- setImmediate: at,
253
- asap: mr,
254
- isIterable: gr
255
- };
256
- function D(e, t, r, s, n) {
257
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), r && (this.config = r), s && (this.request = s), n && (this.response = n, this.status = n.status ? n.status : null);
258
- }
259
- l.inherits(D, Error, {
260
- toJSON: function() {
261
- return {
262
- // Standard
263
- message: this.message,
264
- name: this.name,
265
- // Microsoft
266
- description: this.description,
267
- number: this.number,
268
- // Mozilla
269
- fileName: this.fileName,
270
- lineNumber: this.lineNumber,
271
- columnNumber: this.columnNumber,
272
- stack: this.stack,
273
- // Axios
274
- config: l.toJSONObject(this.config),
275
- code: this.code,
276
- status: this.status
277
- };
278
- }
279
- });
280
- const lt = D.prototype, ct = {};
281
- [
282
- "ERR_BAD_OPTION_VALUE",
283
- "ERR_BAD_OPTION",
284
- "ECONNABORTED",
285
- "ETIMEDOUT",
286
- "ERR_NETWORK",
287
- "ERR_FR_TOO_MANY_REDIRECTS",
288
- "ERR_DEPRECATED",
289
- "ERR_BAD_RESPONSE",
290
- "ERR_BAD_REQUEST",
291
- "ERR_CANCELED",
292
- "ERR_NOT_SUPPORT",
293
- "ERR_INVALID_URL"
294
- // eslint-disable-next-line func-names
295
- ].forEach((e) => {
296
- ct[e] = { value: e };
297
- });
298
- Object.defineProperties(D, ct);
299
- Object.defineProperty(lt, "isAxiosError", { value: !0 });
300
- D.from = (e, t, r, s, n, o) => {
301
- const i = Object.create(lt);
302
- return l.toFlatObject(e, i, function(f) {
303
- return f !== Error.prototype;
304
- }, (a) => a !== "isAxiosError"), D.call(i, e.message, t, r, s, n), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
305
- };
306
- const br = null;
307
- function ke(e) {
308
- return l.isPlainObject(e) || l.isArray(e);
309
- }
310
- function ut(e) {
311
- return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
312
- }
313
- function Ue(e, t, r) {
314
- return e ? e.concat(t).map(function(n, o) {
315
- return n = ut(n), !r && o ? "[" + n + "]" : n;
316
- }).join(r ? "." : "") : t;
317
- }
318
- function wr(e) {
319
- return l.isArray(e) && !e.some(ke);
320
- }
321
- const yr = l.toFlatObject(l, {}, null, function(t) {
322
- return /^is[A-Z]/.test(t);
323
- });
324
- function pe(e, t, r) {
325
- if (!l.isObject(e))
326
- throw new TypeError("target must be an object");
327
- t = t || new FormData(), r = l.toFlatObject(r, {
328
- metaTokens: !0,
329
- dots: !1,
330
- indexes: !1
331
- }, !1, function(p, b) {
332
- return !l.isUndefined(b[p]);
333
- });
334
- const s = r.metaTokens, n = r.visitor || c, o = r.dots, i = r.indexes, f = (r.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(t);
335
- if (!l.isFunction(n))
336
- throw new TypeError("visitor must be a function");
337
- function u(d) {
338
- if (d === null) return "";
339
- if (l.isDate(d))
340
- return d.toISOString();
341
- if (l.isBoolean(d))
342
- return d.toString();
343
- if (!f && l.isBlob(d))
344
- throw new D("Blob is not supported. Use a Buffer instead.");
345
- return l.isArrayBuffer(d) || l.isTypedArray(d) ? f && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
346
- }
347
- function c(d, p, b) {
348
- let S = d;
349
- if (d && !b && typeof d == "object") {
350
- if (l.endsWith(p, "{}"))
351
- p = s ? p : p.slice(0, -2), d = JSON.stringify(d);
352
- else if (l.isArray(d) && wr(d) || (l.isFileList(d) || l.endsWith(p, "[]")) && (S = l.toArray(d)))
353
- return p = ut(p), S.forEach(function(y, L) {
354
- !(l.isUndefined(y) || y === null) && t.append(
355
- // eslint-disable-next-line no-nested-ternary
356
- i === !0 ? Ue([p], L, o) : i === null ? p : p + "[]",
357
- u(y)
358
- );
359
- }), !1;
360
- }
361
- return ke(d) ? !0 : (t.append(Ue(b, p, o), u(d)), !1);
362
- }
363
- const h = [], w = Object.assign(yr, {
364
- defaultVisitor: c,
365
- convertValue: u,
366
- isVisitable: ke
367
- });
368
- function g(d, p) {
369
- if (!l.isUndefined(d)) {
370
- if (h.indexOf(d) !== -1)
371
- throw Error("Circular reference detected in " + p.join("."));
372
- h.push(d), l.forEach(d, function(S, k) {
373
- (!(l.isUndefined(S) || S === null) && n.call(
374
- t,
375
- S,
376
- l.isString(k) ? k.trim() : k,
377
- p,
378
- w
379
- )) === !0 && g(S, p ? p.concat(k) : [k]);
380
- }), h.pop();
381
- }
382
- }
383
- if (!l.isObject(e))
384
- throw new TypeError("data must be an object");
385
- return g(e), t;
386
- }
387
- function je(e) {
388
- const t = {
389
- "!": "%21",
390
- "'": "%27",
391
- "(": "%28",
392
- ")": "%29",
393
- "~": "%7E",
394
- "%20": "+",
395
- "%00": "\0"
396
- };
397
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(s) {
398
- return t[s];
399
- });
400
- }
401
- function Ne(e, t) {
402
- this._pairs = [], e && pe(e, this, t);
403
- }
404
- const dt = Ne.prototype;
405
- dt.append = function(t, r) {
406
- this._pairs.push([t, r]);
407
- };
408
- dt.toString = function(t) {
409
- const r = t ? function(s) {
410
- return t.call(this, s, je);
411
- } : je;
412
- return this._pairs.map(function(n) {
413
- return r(n[0]) + "=" + r(n[1]);
414
- }, "").join("&");
415
- };
416
- function xr(e) {
417
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
418
- }
419
- function ft(e, t, r) {
420
- if (!t)
421
- return e;
422
- const s = r && r.encode || xr;
423
- l.isFunction(r) && (r = {
424
- serialize: r
425
- });
426
- const n = r && r.serialize;
427
- let o;
428
- if (n ? o = n(t, r) : o = l.isURLSearchParams(t) ? t.toString() : new Ne(t, r).toString(s), o) {
429
- const i = e.indexOf("#");
430
- i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
431
- }
432
- return e;
433
- }
434
- class Ve {
435
- constructor() {
436
- this.handlers = [];
437
- }
438
- /**
439
- * Add a new interceptor to the stack
440
- *
441
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
442
- * @param {Function} rejected The function to handle `reject` for a `Promise`
443
- *
444
- * @return {Number} An ID used to remove interceptor later
445
- */
446
- use(t, r, s) {
447
- return this.handlers.push({
448
- fulfilled: t,
449
- rejected: r,
450
- synchronous: s ? s.synchronous : !1,
451
- runWhen: s ? s.runWhen : null
452
- }), this.handlers.length - 1;
453
- }
454
- /**
455
- * Remove an interceptor from the stack
456
- *
457
- * @param {Number} id The ID that was returned by `use`
458
- *
459
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
460
- */
461
- eject(t) {
462
- this.handlers[t] && (this.handlers[t] = null);
463
- }
464
- /**
465
- * Clear all interceptors from the stack
466
- *
467
- * @returns {void}
468
- */
469
- clear() {
470
- this.handlers && (this.handlers = []);
471
- }
472
- /**
473
- * Iterate over all the registered interceptors
474
- *
475
- * This method is particularly useful for skipping over any
476
- * interceptors that may have become `null` calling `eject`.
477
- *
478
- * @param {Function} fn The function to call for each interceptor
479
- *
480
- * @returns {void}
481
- */
482
- forEach(t) {
483
- l.forEach(this.handlers, function(s) {
484
- s !== null && t(s);
485
- });
486
- }
487
- }
488
- const ht = {
489
- silentJSONParsing: !0,
490
- forcedJSONParsing: !0,
491
- clarifyTimeoutError: !1
492
- }, _r = typeof URLSearchParams < "u" ? URLSearchParams : Ne, Dr = typeof FormData < "u" ? FormData : null, kr = typeof Blob < "u" ? Blob : null, Sr = {
493
- isBrowser: !0,
494
- classes: {
495
- URLSearchParams: _r,
496
- FormData: Dr,
497
- Blob: kr
498
- },
499
- protocols: ["http", "https", "file", "blob", "url", "data"]
500
- }, Ae = typeof window < "u" && typeof document < "u", Se = typeof navigator == "object" && navigator || void 0, vr = Ae && (!Se || ["ReactNative", "NativeScript", "NS"].indexOf(Se.product) < 0), Er = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
501
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Cr = Ae && window.location.href || "http://localhost", Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
502
- __proto__: null,
503
- hasBrowserEnv: Ae,
504
- hasStandardBrowserEnv: vr,
505
- hasStandardBrowserWebWorkerEnv: Er,
506
- navigator: Se,
507
- origin: Cr
508
- }, Symbol.toStringTag, { value: "Module" })), O = {
509
- ...Rr,
510
- ...Sr
511
- };
512
- function Or(e, t) {
513
- return pe(e, new O.classes.URLSearchParams(), {
514
- visitor: function(r, s, n, o) {
515
- return O.isNode && l.isBuffer(r) ? (this.append(s, r.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
516
- },
517
- ...t
518
- });
519
- }
520
- function Tr(e) {
521
- return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
522
- }
523
- function $r(e) {
524
- const t = {}, r = Object.keys(e);
525
- let s;
526
- const n = r.length;
527
- let o;
528
- for (s = 0; s < n; s++)
529
- o = r[s], t[o] = e[o];
530
- return t;
531
- }
532
- function pt(e) {
533
- function t(r, s, n, o) {
534
- let i = r[o++];
535
- if (i === "__proto__") return !0;
536
- const a = Number.isFinite(+i), f = o >= r.length;
537
- return i = !i && l.isArray(n) ? n.length : i, f ? (l.hasOwnProp(n, i) ? n[i] = [n[i], s] : n[i] = s, !a) : ((!n[i] || !l.isObject(n[i])) && (n[i] = []), t(r, s, n[i], o) && l.isArray(n[i]) && (n[i] = $r(n[i])), !a);
538
- }
539
- if (l.isFormData(e) && l.isFunction(e.entries)) {
540
- const r = {};
541
- return l.forEachEntry(e, (s, n) => {
542
- t(Tr(s), n, r, 0);
543
- }), r;
544
- }
545
- return null;
546
- }
547
- function Nr(e, t, r) {
548
- if (l.isString(e))
549
- try {
550
- return (t || JSON.parse)(e), l.trim(e);
551
- } catch (s) {
552
- if (s.name !== "SyntaxError")
553
- throw s;
554
- }
555
- return (r || JSON.stringify)(e);
556
- }
557
- const se = {
558
- transitional: ht,
559
- adapter: ["xhr", "http", "fetch"],
560
- transformRequest: [function(t, r) {
561
- const s = r.getContentType() || "", n = s.indexOf("application/json") > -1, o = l.isObject(t);
562
- if (o && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t))
563
- return n ? JSON.stringify(pt(t)) : t;
564
- if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t))
565
- return t;
566
- if (l.isArrayBufferView(t))
567
- return t.buffer;
568
- if (l.isURLSearchParams(t))
569
- return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
570
- let a;
571
- if (o) {
572
- if (s.indexOf("application/x-www-form-urlencoded") > -1)
573
- return Or(t, this.formSerializer).toString();
574
- if ((a = l.isFileList(t)) || s.indexOf("multipart/form-data") > -1) {
575
- const f = this.env && this.env.FormData;
576
- return pe(
577
- a ? { "files[]": t } : t,
578
- f && new f(),
579
- this.formSerializer
580
- );
581
- }
582
- }
583
- return o || n ? (r.setContentType("application/json", !1), Nr(t)) : t;
584
- }],
585
- transformResponse: [function(t) {
586
- const r = this.transitional || se.transitional, s = r && r.forcedJSONParsing, n = this.responseType === "json";
587
- if (l.isResponse(t) || l.isReadableStream(t))
588
- return t;
589
- if (t && l.isString(t) && (s && !this.responseType || n)) {
590
- const i = !(r && r.silentJSONParsing) && n;
591
- try {
592
- return JSON.parse(t);
593
- } catch (a) {
594
- if (i)
595
- throw a.name === "SyntaxError" ? D.from(a, D.ERR_BAD_RESPONSE, this, null, this.response) : a;
596
- }
597
- }
598
- return t;
599
- }],
600
- /**
601
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
602
- * timeout is not created.
603
- */
604
- timeout: 0,
605
- xsrfCookieName: "XSRF-TOKEN",
606
- xsrfHeaderName: "X-XSRF-TOKEN",
607
- maxContentLength: -1,
608
- maxBodyLength: -1,
609
- env: {
610
- FormData: O.classes.FormData,
611
- Blob: O.classes.Blob
612
- },
613
- validateStatus: function(t) {
614
- return t >= 200 && t < 300;
615
- },
616
- headers: {
617
- common: {
618
- Accept: "application/json, text/plain, */*",
619
- "Content-Type": void 0
620
- }
621
- }
622
- };
623
- l.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
624
- se.headers[e] = {};
625
- });
626
- const Ar = l.toObjectSet([
627
- "age",
628
- "authorization",
629
- "content-length",
630
- "content-type",
631
- "etag",
632
- "expires",
633
- "from",
634
- "host",
635
- "if-modified-since",
636
- "if-unmodified-since",
637
- "last-modified",
638
- "location",
639
- "max-forwards",
640
- "proxy-authorization",
641
- "referer",
642
- "retry-after",
643
- "user-agent"
644
- ]), Fr = (e) => {
645
- const t = {};
646
- let r, s, n;
647
- return e && e.split(`
648
- `).forEach(function(i) {
649
- n = i.indexOf(":"), r = i.substring(0, n).trim().toLowerCase(), s = i.substring(n + 1).trim(), !(!r || t[r] && Ar[r]) && (r === "set-cookie" ? t[r] ? t[r].push(s) : t[r] = [s] : t[r] = t[r] ? t[r] + ", " + s : s);
650
- }), t;
651
- }, Ie = Symbol("internals");
652
- function Q(e) {
653
- return e && String(e).trim().toLowerCase();
654
- }
655
- function ie(e) {
656
- return e === !1 || e == null ? e : l.isArray(e) ? e.map(ie) : String(e);
657
- }
658
- function Lr(e) {
659
- const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
660
- let s;
661
- for (; s = r.exec(e); )
662
- t[s[1]] = s[2];
663
- return t;
664
- }
665
- const Pr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
666
- function we(e, t, r, s, n) {
667
- if (l.isFunction(s))
668
- return s.call(this, t, r);
669
- if (n && (t = r), !!l.isString(t)) {
670
- if (l.isString(s))
671
- return t.indexOf(s) !== -1;
672
- if (l.isRegExp(s))
673
- return s.test(t);
674
- }
675
- }
676
- function Br(e) {
677
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, s) => r.toUpperCase() + s);
678
- }
679
- function Ur(e, t) {
680
- const r = l.toCamelCase(" " + t);
681
- ["get", "set", "has"].forEach((s) => {
682
- Object.defineProperty(e, s + r, {
683
- value: function(n, o, i) {
684
- return this[s].call(this, t, n, o, i);
685
- },
686
- configurable: !0
687
- });
688
- });
689
- }
690
- let A = class {
691
- constructor(t) {
692
- t && this.set(t);
693
- }
694
- set(t, r, s) {
695
- const n = this;
696
- function o(a, f, u) {
697
- const c = Q(f);
698
- if (!c)
699
- throw new Error("header name must be a non-empty string");
700
- const h = l.findKey(n, c);
701
- (!h || n[h] === void 0 || u === !0 || u === void 0 && n[h] !== !1) && (n[h || f] = ie(a));
702
- }
703
- const i = (a, f) => l.forEach(a, (u, c) => o(u, c, f));
704
- if (l.isPlainObject(t) || t instanceof this.constructor)
705
- i(t, r);
706
- else if (l.isString(t) && (t = t.trim()) && !Pr(t))
707
- i(Fr(t), r);
708
- else if (l.isObject(t) && l.isIterable(t)) {
709
- let a = {}, f, u;
710
- for (const c of t) {
711
- if (!l.isArray(c))
712
- throw TypeError("Object iterator must return a key-value pair");
713
- a[u = c[0]] = (f = a[u]) ? l.isArray(f) ? [...f, c[1]] : [f, c[1]] : c[1];
714
- }
715
- i(a, r);
716
- } else
717
- t != null && o(r, t, s);
718
- return this;
719
- }
720
- get(t, r) {
721
- if (t = Q(t), t) {
722
- const s = l.findKey(this, t);
723
- if (s) {
724
- const n = this[s];
725
- if (!r)
726
- return n;
727
- if (r === !0)
728
- return Lr(n);
729
- if (l.isFunction(r))
730
- return r.call(this, n, s);
731
- if (l.isRegExp(r))
732
- return r.exec(n);
733
- throw new TypeError("parser must be boolean|regexp|function");
734
- }
735
- }
736
- }
737
- has(t, r) {
738
- if (t = Q(t), t) {
739
- const s = l.findKey(this, t);
740
- return !!(s && this[s] !== void 0 && (!r || we(this, this[s], s, r)));
741
- }
742
- return !1;
743
- }
744
- delete(t, r) {
745
- const s = this;
746
- let n = !1;
747
- function o(i) {
748
- if (i = Q(i), i) {
749
- const a = l.findKey(s, i);
750
- a && (!r || we(s, s[a], a, r)) && (delete s[a], n = !0);
751
- }
752
- }
753
- return l.isArray(t) ? t.forEach(o) : o(t), n;
754
- }
755
- clear(t) {
756
- const r = Object.keys(this);
757
- let s = r.length, n = !1;
758
- for (; s--; ) {
759
- const o = r[s];
760
- (!t || we(this, this[o], o, t, !0)) && (delete this[o], n = !0);
761
- }
762
- return n;
763
- }
764
- normalize(t) {
765
- const r = this, s = {};
766
- return l.forEach(this, (n, o) => {
767
- const i = l.findKey(s, o);
768
- if (i) {
769
- r[i] = ie(n), delete r[o];
770
- return;
771
- }
772
- const a = t ? Br(o) : String(o).trim();
773
- a !== o && delete r[o], r[a] = ie(n), s[a] = !0;
774
- }), this;
775
- }
776
- concat(...t) {
777
- return this.constructor.concat(this, ...t);
778
- }
779
- toJSON(t) {
780
- const r = /* @__PURE__ */ Object.create(null);
781
- return l.forEach(this, (s, n) => {
782
- s != null && s !== !1 && (r[n] = t && l.isArray(s) ? s.join(", ") : s);
783
- }), r;
784
- }
785
- [Symbol.iterator]() {
786
- return Object.entries(this.toJSON())[Symbol.iterator]();
787
- }
788
- toString() {
789
- return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).join(`
790
- `);
791
- }
792
- getSetCookie() {
793
- return this.get("set-cookie") || [];
794
- }
795
- get [Symbol.toStringTag]() {
796
- return "AxiosHeaders";
797
- }
798
- static from(t) {
799
- return t instanceof this ? t : new this(t);
800
- }
801
- static concat(t, ...r) {
802
- const s = new this(t);
803
- return r.forEach((n) => s.set(n)), s;
804
- }
805
- static accessor(t) {
806
- const s = (this[Ie] = this[Ie] = {
807
- accessors: {}
808
- }).accessors, n = this.prototype;
809
- function o(i) {
810
- const a = Q(i);
811
- s[a] || (Ur(n, i), s[a] = !0);
812
- }
813
- return l.isArray(t) ? t.forEach(o) : o(t), this;
814
- }
815
- };
816
- A.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
817
- l.reduceDescriptors(A.prototype, ({ value: e }, t) => {
818
- let r = t[0].toUpperCase() + t.slice(1);
819
- return {
820
- get: () => e,
821
- set(s) {
822
- this[r] = s;
823
- }
824
- };
825
- });
826
- l.freezeMethods(A);
827
- function ye(e, t) {
828
- const r = this || se, s = t || r, n = A.from(s.headers);
829
- let o = s.data;
830
- return l.forEach(e, function(a) {
831
- o = a.call(r, o, n.normalize(), t ? t.status : void 0);
832
- }), n.normalize(), o;
833
- }
834
- function mt(e) {
835
- return !!(e && e.__CANCEL__);
836
- }
837
- function G(e, t, r) {
838
- D.call(this, e ?? "canceled", D.ERR_CANCELED, t, r), this.name = "CanceledError";
839
- }
840
- l.inherits(G, D, {
841
- __CANCEL__: !0
842
- });
843
- function gt(e, t, r) {
844
- const s = r.config.validateStatus;
845
- !r.status || !s || s(r.status) ? e(r) : t(new D(
846
- "Request failed with status code " + r.status,
847
- [D.ERR_BAD_REQUEST, D.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
848
- r.config,
849
- r.request,
850
- r
851
- ));
852
- }
853
- function jr(e) {
854
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
855
- return t && t[1] || "";
856
- }
857
- function Vr(e, t) {
858
- e = e || 10;
859
- const r = new Array(e), s = new Array(e);
860
- let n = 0, o = 0, i;
861
- return t = t !== void 0 ? t : 1e3, function(f) {
862
- const u = Date.now(), c = s[o];
863
- i || (i = u), r[n] = f, s[n] = u;
864
- let h = o, w = 0;
865
- for (; h !== n; )
866
- w += r[h++], h = h % e;
867
- if (n = (n + 1) % e, n === o && (o = (o + 1) % e), u - i < t)
868
- return;
869
- const g = c && u - c;
870
- return g ? Math.round(w * 1e3 / g) : void 0;
871
- };
872
- }
873
- function Ir(e, t) {
874
- let r = 0, s = 1e3 / t, n, o;
875
- const i = (u, c = Date.now()) => {
876
- r = c, n = null, o && (clearTimeout(o), o = null), e(...u);
877
- };
878
- return [(...u) => {
879
- const c = Date.now(), h = c - r;
880
- h >= s ? i(u, c) : (n = u, o || (o = setTimeout(() => {
881
- o = null, i(n);
882
- }, s - h)));
883
- }, () => n && i(n)];
884
- }
885
- const le = (e, t, r = 3) => {
886
- let s = 0;
887
- const n = Vr(50, 250);
888
- return Ir((o) => {
889
- const i = o.loaded, a = o.lengthComputable ? o.total : void 0, f = i - s, u = n(f), c = i <= a;
890
- s = i;
891
- const h = {
892
- loaded: i,
893
- total: a,
894
- progress: a ? i / a : void 0,
895
- bytes: f,
896
- rate: u || void 0,
897
- estimated: u && a && c ? (a - i) / u : void 0,
898
- event: o,
899
- lengthComputable: a != null,
900
- [t ? "download" : "upload"]: !0
901
- };
902
- e(h);
903
- }, r);
904
- }, ze = (e, t) => {
905
- const r = e != null;
906
- return [(s) => t[0]({
907
- lengthComputable: r,
908
- total: e,
909
- loaded: s
910
- }), t[1]];
911
- }, Me = (e) => (...t) => l.asap(() => e(...t)), zr = O.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, O.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
912
- new URL(O.origin),
913
- O.navigator && /(msie|trident)/i.test(O.navigator.userAgent)
914
- ) : () => !0, Mr = O.hasStandardBrowserEnv ? (
915
- // Standard browser envs support document.cookie
916
- {
917
- write(e, t, r, s, n, o) {
918
- const i = [e + "=" + encodeURIComponent(t)];
919
- l.isNumber(r) && i.push("expires=" + new Date(r).toGMTString()), l.isString(s) && i.push("path=" + s), l.isString(n) && i.push("domain=" + n), o === !0 && i.push("secure"), document.cookie = i.join("; ");
920
- },
921
- read(e) {
922
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
923
- return t ? decodeURIComponent(t[3]) : null;
924
- },
925
- remove(e) {
926
- this.write(e, "", Date.now() - 864e5);
927
- }
928
- }
929
- ) : (
930
- // Non-standard browser env (web workers, react-native) lack needed support.
931
- {
932
- write() {
933
- },
934
- read() {
935
- return null;
936
- },
937
- remove() {
938
- }
939
- }
940
- );
941
- function qr(e) {
942
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
943
- }
944
- function Hr(e, t) {
945
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
946
- }
947
- function bt(e, t, r) {
948
- let s = !qr(t);
949
- return e && (s || r == !1) ? Hr(e, t) : t;
950
- }
951
- const qe = (e) => e instanceof A ? { ...e } : e;
952
- function K(e, t) {
953
- t = t || {};
954
- const r = {};
955
- function s(u, c, h, w) {
956
- return l.isPlainObject(u) && l.isPlainObject(c) ? l.merge.call({ caseless: w }, u, c) : l.isPlainObject(c) ? l.merge({}, c) : l.isArray(c) ? c.slice() : c;
957
- }
958
- function n(u, c, h, w) {
959
- if (l.isUndefined(c)) {
960
- if (!l.isUndefined(u))
961
- return s(void 0, u, h, w);
962
- } else return s(u, c, h, w);
963
- }
964
- function o(u, c) {
965
- if (!l.isUndefined(c))
966
- return s(void 0, c);
967
- }
968
- function i(u, c) {
969
- if (l.isUndefined(c)) {
970
- if (!l.isUndefined(u))
971
- return s(void 0, u);
972
- } else return s(void 0, c);
973
- }
974
- function a(u, c, h) {
975
- if (h in t)
976
- return s(u, c);
977
- if (h in e)
978
- return s(void 0, u);
979
- }
980
- const f = {
981
- url: o,
982
- method: o,
983
- data: o,
984
- baseURL: i,
985
- transformRequest: i,
986
- transformResponse: i,
987
- paramsSerializer: i,
988
- timeout: i,
989
- timeoutMessage: i,
990
- withCredentials: i,
991
- withXSRFToken: i,
992
- adapter: i,
993
- responseType: i,
994
- xsrfCookieName: i,
995
- xsrfHeaderName: i,
996
- onUploadProgress: i,
997
- onDownloadProgress: i,
998
- decompress: i,
999
- maxContentLength: i,
1000
- maxBodyLength: i,
1001
- beforeRedirect: i,
1002
- transport: i,
1003
- httpAgent: i,
1004
- httpsAgent: i,
1005
- cancelToken: i,
1006
- socketPath: i,
1007
- responseEncoding: i,
1008
- validateStatus: a,
1009
- headers: (u, c, h) => n(qe(u), qe(c), h, !0)
1010
- };
1011
- return l.forEach(Object.keys({ ...e, ...t }), function(c) {
1012
- const h = f[c] || n, w = h(e[c], t[c], c);
1013
- l.isUndefined(w) && h !== a || (r[c] = w);
1014
- }), r;
1015
- }
1016
- const wt = (e) => {
1017
- const t = K({}, e);
1018
- let { data: r, withXSRFToken: s, xsrfHeaderName: n, xsrfCookieName: o, headers: i, auth: a } = t;
1019
- t.headers = i = A.from(i), t.url = ft(bt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1020
- "Authorization",
1021
- "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1022
- );
1023
- let f;
1024
- if (l.isFormData(r)) {
1025
- if (O.hasStandardBrowserEnv || O.hasStandardBrowserWebWorkerEnv)
1026
- i.setContentType(void 0);
1027
- else if ((f = i.getContentType()) !== !1) {
1028
- const [u, ...c] = f ? f.split(";").map((h) => h.trim()).filter(Boolean) : [];
1029
- i.setContentType([u || "multipart/form-data", ...c].join("; "));
1030
- }
1031
- }
1032
- if (O.hasStandardBrowserEnv && (s && l.isFunction(s) && (s = s(t)), s || s !== !1 && zr(t.url))) {
1033
- const u = n && o && Mr.read(o);
1034
- u && i.set(n, u);
1035
- }
1036
- return t;
1037
- }, Wr = typeof XMLHttpRequest < "u", Jr = Wr && function(e) {
1038
- return new Promise(function(r, s) {
1039
- const n = wt(e);
1040
- let o = n.data;
1041
- const i = A.from(n.headers).normalize();
1042
- let { responseType: a, onUploadProgress: f, onDownloadProgress: u } = n, c, h, w, g, d;
1043
- function p() {
1044
- g && g(), d && d(), n.cancelToken && n.cancelToken.unsubscribe(c), n.signal && n.signal.removeEventListener("abort", c);
1045
- }
1046
- let b = new XMLHttpRequest();
1047
- b.open(n.method.toUpperCase(), n.url, !0), b.timeout = n.timeout;
1048
- function S() {
1049
- if (!b)
1050
- return;
1051
- const y = A.from(
1052
- "getAllResponseHeaders" in b && b.getAllResponseHeaders()
1053
- ), C = {
1054
- data: !a || a === "text" || a === "json" ? b.responseText : b.response,
1055
- status: b.status,
1056
- statusText: b.statusText,
1057
- headers: y,
1058
- config: e,
1059
- request: b
1060
- };
1061
- gt(function(q) {
1062
- r(q), p();
1063
- }, function(q) {
1064
- s(q), p();
1065
- }, C), b = null;
1066
- }
1067
- "onloadend" in b ? b.onloadend = S : b.onreadystatechange = function() {
1068
- !b || b.readyState !== 4 || b.status === 0 && !(b.responseURL && b.responseURL.indexOf("file:") === 0) || setTimeout(S);
1069
- }, b.onabort = function() {
1070
- b && (s(new D("Request aborted", D.ECONNABORTED, e, b)), b = null);
1071
- }, b.onerror = function() {
1072
- s(new D("Network Error", D.ERR_NETWORK, e, b)), b = null;
1073
- }, b.ontimeout = function() {
1074
- let L = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded";
1075
- const C = n.transitional || ht;
1076
- n.timeoutErrorMessage && (L = n.timeoutErrorMessage), s(new D(
1077
- L,
1078
- C.clarifyTimeoutError ? D.ETIMEDOUT : D.ECONNABORTED,
1079
- e,
1080
- b
1081
- )), b = null;
1082
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in b && l.forEach(i.toJSON(), function(L, C) {
1083
- b.setRequestHeader(C, L);
1084
- }), l.isUndefined(n.withCredentials) || (b.withCredentials = !!n.withCredentials), a && a !== "json" && (b.responseType = n.responseType), u && ([w, d] = le(u, !0), b.addEventListener("progress", w)), f && b.upload && ([h, g] = le(f), b.upload.addEventListener("progress", h), b.upload.addEventListener("loadend", g)), (n.cancelToken || n.signal) && (c = (y) => {
1085
- b && (s(!y || y.type ? new G(null, e, b) : y), b.abort(), b = null);
1086
- }, n.cancelToken && n.cancelToken.subscribe(c), n.signal && (n.signal.aborted ? c() : n.signal.addEventListener("abort", c)));
1087
- const k = jr(n.url);
1088
- if (k && O.protocols.indexOf(k) === -1) {
1089
- s(new D("Unsupported protocol " + k + ":", D.ERR_BAD_REQUEST, e));
1090
- return;
1091
- }
1092
- b.send(o || null);
1093
- });
1094
- }, Kr = (e, t) => {
1095
- const { length: r } = e = e ? e.filter(Boolean) : [];
1096
- if (t || r) {
1097
- let s = new AbortController(), n;
1098
- const o = function(u) {
1099
- if (!n) {
1100
- n = !0, a();
1101
- const c = u instanceof Error ? u : this.reason;
1102
- s.abort(c instanceof D ? c : new G(c instanceof Error ? c.message : c));
1103
- }
1104
- };
1105
- let i = t && setTimeout(() => {
1106
- i = null, o(new D(`timeout ${t} of ms exceeded`, D.ETIMEDOUT));
1107
- }, t);
1108
- const a = () => {
1109
- e && (i && clearTimeout(i), i = null, e.forEach((u) => {
1110
- u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
1111
- }), e = null);
1112
- };
1113
- e.forEach((u) => u.addEventListener("abort", o));
1114
- const { signal: f } = s;
1115
- return f.unsubscribe = () => l.asap(a), f;
1116
- }
1117
- }, Xr = function* (e, t) {
1118
- let r = e.byteLength;
1119
- if (r < t) {
1120
- yield e;
1121
- return;
1122
- }
1123
- let s = 0, n;
1124
- for (; s < r; )
1125
- n = s + t, yield e.slice(s, n), s = n;
1126
- }, Gr = async function* (e, t) {
1127
- for await (const r of Qr(e))
1128
- yield* Xr(r, t);
1129
- }, Qr = async function* (e) {
1130
- if (e[Symbol.asyncIterator]) {
1131
- yield* e;
1132
- return;
1133
- }
1134
- const t = e.getReader();
1135
- try {
1136
- for (; ; ) {
1137
- const { done: r, value: s } = await t.read();
1138
- if (r)
1139
- break;
1140
- yield s;
1141
- }
1142
- } finally {
1143
- await t.cancel();
1144
- }
1145
- }, He = (e, t, r, s) => {
1146
- const n = Gr(e, t);
1147
- let o = 0, i, a = (f) => {
1148
- i || (i = !0, s && s(f));
1149
- };
1150
- return new ReadableStream({
1151
- async pull(f) {
1152
- try {
1153
- const { done: u, value: c } = await n.next();
1154
- if (u) {
1155
- a(), f.close();
1156
- return;
1157
- }
1158
- let h = c.byteLength;
1159
- if (r) {
1160
- let w = o += h;
1161
- r(w);
1162
- }
1163
- f.enqueue(new Uint8Array(c));
1164
- } catch (u) {
1165
- throw a(u), u;
1166
- }
1167
- },
1168
- cancel(f) {
1169
- return a(f), n.return();
1170
- }
1171
- }, {
1172
- highWaterMark: 2
1173
- });
1174
- }, me = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", yt = me && typeof ReadableStream == "function", Zr = me && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), xt = (e, ...t) => {
1175
- try {
1176
- return !!e(...t);
1177
- } catch {
1178
- return !1;
1179
- }
1180
- }, Yr = yt && xt(() => {
1181
- let e = !1;
1182
- const t = new Request(O.origin, {
1183
- body: new ReadableStream(),
1184
- method: "POST",
1185
- get duplex() {
1186
- return e = !0, "half";
1187
- }
1188
- }).headers.has("Content-Type");
1189
- return e && !t;
1190
- }), We = 64 * 1024, ve = yt && xt(() => l.isReadableStream(new Response("").body)), ce = {
1191
- stream: ve && ((e) => e.body)
1192
- };
1193
- me && ((e) => {
1194
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
1195
- !ce[t] && (ce[t] = l.isFunction(e[t]) ? (r) => r[t]() : (r, s) => {
1196
- throw new D(`Response type '${t}' is not supported`, D.ERR_NOT_SUPPORT, s);
1197
- });
1198
- });
1199
- })(new Response());
1200
- const es = async (e) => {
1201
- if (e == null)
1202
- return 0;
1203
- if (l.isBlob(e))
1204
- return e.size;
1205
- if (l.isSpecCompliantForm(e))
1206
- return (await new Request(O.origin, {
1207
- method: "POST",
1208
- body: e
1209
- }).arrayBuffer()).byteLength;
1210
- if (l.isArrayBufferView(e) || l.isArrayBuffer(e))
1211
- return e.byteLength;
1212
- if (l.isURLSearchParams(e) && (e = e + ""), l.isString(e))
1213
- return (await Zr(e)).byteLength;
1214
- }, ts = async (e, t) => {
1215
- const r = l.toFiniteNumber(e.getContentLength());
1216
- return r ?? es(t);
1217
- }, rs = me && (async (e) => {
1218
- let {
1219
- url: t,
1220
- method: r,
1221
- data: s,
1222
- signal: n,
1223
- cancelToken: o,
1224
- timeout: i,
1225
- onDownloadProgress: a,
1226
- onUploadProgress: f,
1227
- responseType: u,
1228
- headers: c,
1229
- withCredentials: h = "same-origin",
1230
- fetchOptions: w
1231
- } = wt(e);
1232
- u = u ? (u + "").toLowerCase() : "text";
1233
- let g = Kr([n, o && o.toAbortSignal()], i), d;
1234
- const p = g && g.unsubscribe && (() => {
1235
- g.unsubscribe();
1236
- });
1237
- let b;
1238
- try {
1239
- if (f && Yr && r !== "get" && r !== "head" && (b = await ts(c, s)) !== 0) {
1240
- let C = new Request(t, {
1241
- method: "POST",
1242
- body: s,
1243
- duplex: "half"
1244
- }), z;
1245
- if (l.isFormData(s) && (z = C.headers.get("content-type")) && c.setContentType(z), C.body) {
1246
- const [q, ne] = ze(
1247
- b,
1248
- le(Me(f))
1249
- );
1250
- s = He(C.body, We, q, ne);
1251
- }
1252
- }
1253
- l.isString(h) || (h = h ? "include" : "omit");
1254
- const S = "credentials" in Request.prototype;
1255
- d = new Request(t, {
1256
- ...w,
1257
- signal: g,
1258
- method: r.toUpperCase(),
1259
- headers: c.normalize().toJSON(),
1260
- body: s,
1261
- duplex: "half",
1262
- credentials: S ? h : void 0
1263
- });
1264
- let k = await fetch(d, w);
1265
- const y = ve && (u === "stream" || u === "response");
1266
- if (ve && (a || y && p)) {
1267
- const C = {};
1268
- ["status", "statusText", "headers"].forEach((Fe) => {
1269
- C[Fe] = k[Fe];
1270
- });
1271
- const z = l.toFiniteNumber(k.headers.get("content-length")), [q, ne] = a && ze(
1272
- z,
1273
- le(Me(a), !0)
1274
- ) || [];
1275
- k = new Response(
1276
- He(k.body, We, q, () => {
1277
- ne && ne(), p && p();
1278
- }),
1279
- C
1280
- );
1281
- }
1282
- u = u || "text";
1283
- let L = await ce[l.findKey(ce, u) || "text"](k, e);
1284
- return !y && p && p(), await new Promise((C, z) => {
1285
- gt(C, z, {
1286
- data: L,
1287
- headers: A.from(k.headers),
1288
- status: k.status,
1289
- statusText: k.statusText,
1290
- config: e,
1291
- request: d
1292
- });
1293
- });
1294
- } catch (S) {
1295
- throw p && p(), S && S.name === "TypeError" && /Load failed|fetch/i.test(S.message) ? Object.assign(
1296
- new D("Network Error", D.ERR_NETWORK, e, d),
1297
- {
1298
- cause: S.cause || S
1299
- }
1300
- ) : D.from(S, S && S.code, e, d);
1301
- }
1302
- }), Ee = {
1303
- http: br,
1304
- xhr: Jr,
1305
- fetch: rs
1306
- };
1307
- l.forEach(Ee, (e, t) => {
1308
- if (e) {
1309
- try {
1310
- Object.defineProperty(e, "name", { value: t });
1311
- } catch {
1312
- }
1313
- Object.defineProperty(e, "adapterName", { value: t });
1314
- }
1315
- });
1316
- const Je = (e) => `- ${e}`, ss = (e) => l.isFunction(e) || e === null || e === !1, _t = {
1317
- getAdapter: (e) => {
1318
- e = l.isArray(e) ? e : [e];
1319
- const { length: t } = e;
1320
- let r, s;
1321
- const n = {};
1322
- for (let o = 0; o < t; o++) {
1323
- r = e[o];
1324
- let i;
1325
- if (s = r, !ss(r) && (s = Ee[(i = String(r)).toLowerCase()], s === void 0))
1326
- throw new D(`Unknown adapter '${i}'`);
1327
- if (s)
1328
- break;
1329
- n[i || "#" + o] = s;
1330
- }
1331
- if (!s) {
1332
- const o = Object.entries(n).map(
1333
- ([a, f]) => `adapter ${a} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1334
- );
1335
- let i = t ? o.length > 1 ? `since :
1336
- ` + o.map(Je).join(`
1337
- `) : " " + Je(o[0]) : "as no adapter specified";
1338
- throw new D(
1339
- "There is no suitable adapter to dispatch the request " + i,
1340
- "ERR_NOT_SUPPORT"
1341
- );
1342
- }
1343
- return s;
1344
- },
1345
- adapters: Ee
1346
- };
1347
- function xe(e) {
1348
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1349
- throw new G(null, e);
1350
- }
1351
- function Ke(e) {
1352
- return xe(e), e.headers = A.from(e.headers), e.data = ye.call(
1353
- e,
1354
- e.transformRequest
1355
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), _t.getAdapter(e.adapter || se.adapter)(e).then(function(s) {
1356
- return xe(e), s.data = ye.call(
1357
- e,
1358
- e.transformResponse,
1359
- s
1360
- ), s.headers = A.from(s.headers), s;
1361
- }, function(s) {
1362
- return mt(s) || (xe(e), s && s.response && (s.response.data = ye.call(
1363
- e,
1364
- e.transformResponse,
1365
- s.response
1366
- ), s.response.headers = A.from(s.response.headers))), Promise.reject(s);
1367
- });
1368
- }
1369
- const Dt = "1.11.0", ge = {};
1370
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1371
- ge[e] = function(s) {
1372
- return typeof s === e || "a" + (t < 1 ? "n " : " ") + e;
1373
- };
1374
- });
1375
- const Xe = {};
1376
- ge.transitional = function(t, r, s) {
1377
- function n(o, i) {
1378
- return "[Axios v" + Dt + "] Transitional option '" + o + "'" + i + (s ? ". " + s : "");
1379
- }
1380
- return (o, i, a) => {
1381
- if (t === !1)
1382
- throw new D(
1383
- n(i, " has been removed" + (r ? " in " + r : "")),
1384
- D.ERR_DEPRECATED
1385
- );
1386
- return r && !Xe[i] && (Xe[i] = !0, console.warn(
1387
- n(
1388
- i,
1389
- " has been deprecated since v" + r + " and will be removed in the near future"
1390
- )
1391
- )), t ? t(o, i, a) : !0;
1392
- };
1393
- };
1394
- ge.spelling = function(t) {
1395
- return (r, s) => (console.warn(`${s} is likely a misspelling of ${t}`), !0);
1396
- };
1397
- function ns(e, t, r) {
1398
- if (typeof e != "object")
1399
- throw new D("options must be an object", D.ERR_BAD_OPTION_VALUE);
1400
- const s = Object.keys(e);
1401
- let n = s.length;
1402
- for (; n-- > 0; ) {
1403
- const o = s[n], i = t[o];
1404
- if (i) {
1405
- const a = e[o], f = a === void 0 || i(a, o, e);
1406
- if (f !== !0)
1407
- throw new D("option " + o + " must be " + f, D.ERR_BAD_OPTION_VALUE);
1408
- continue;
1409
- }
1410
- if (r !== !0)
1411
- throw new D("Unknown option " + o, D.ERR_BAD_OPTION);
1412
- }
1413
- }
1414
- const ae = {
1415
- assertOptions: ns,
1416
- validators: ge
1417
- }, U = ae.validators;
1418
- let W = class {
1419
- constructor(t) {
1420
- this.defaults = t || {}, this.interceptors = {
1421
- request: new Ve(),
1422
- response: new Ve()
1423
- };
1424
- }
1425
- /**
1426
- * Dispatch a request
1427
- *
1428
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1429
- * @param {?Object} config
1430
- *
1431
- * @returns {Promise} The Promise to be fulfilled
1432
- */
1433
- async request(t, r) {
1434
- try {
1435
- return await this._request(t, r);
1436
- } catch (s) {
1437
- if (s instanceof Error) {
1438
- let n = {};
1439
- Error.captureStackTrace ? Error.captureStackTrace(n) : n = new Error();
1440
- const o = n.stack ? n.stack.replace(/^.+\n/, "") : "";
1441
- try {
1442
- s.stack ? o && !String(s.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (s.stack += `
1443
- ` + o) : s.stack = o;
1444
- } catch {
1445
- }
1446
- }
1447
- throw s;
1448
- }
1449
- }
1450
- _request(t, r) {
1451
- typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = K(this.defaults, r);
1452
- const { transitional: s, paramsSerializer: n, headers: o } = r;
1453
- s !== void 0 && ae.assertOptions(s, {
1454
- silentJSONParsing: U.transitional(U.boolean),
1455
- forcedJSONParsing: U.transitional(U.boolean),
1456
- clarifyTimeoutError: U.transitional(U.boolean)
1457
- }, !1), n != null && (l.isFunction(n) ? r.paramsSerializer = {
1458
- serialize: n
1459
- } : ae.assertOptions(n, {
1460
- encode: U.function,
1461
- serialize: U.function
1462
- }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), ae.assertOptions(r, {
1463
- baseUrl: U.spelling("baseURL"),
1464
- withXsrfToken: U.spelling("withXSRFToken")
1465
- }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
1466
- let i = o && l.merge(
1467
- o.common,
1468
- o[r.method]
1469
- );
1470
- o && l.forEach(
1471
- ["delete", "get", "head", "post", "put", "patch", "common"],
1472
- (d) => {
1473
- delete o[d];
1474
- }
1475
- ), r.headers = A.concat(i, o);
1476
- const a = [];
1477
- let f = !0;
1478
- this.interceptors.request.forEach(function(p) {
1479
- typeof p.runWhen == "function" && p.runWhen(r) === !1 || (f = f && p.synchronous, a.unshift(p.fulfilled, p.rejected));
1480
- });
1481
- const u = [];
1482
- this.interceptors.response.forEach(function(p) {
1483
- u.push(p.fulfilled, p.rejected);
1484
- });
1485
- let c, h = 0, w;
1486
- if (!f) {
1487
- const d = [Ke.bind(this), void 0];
1488
- for (d.unshift(...a), d.push(...u), w = d.length, c = Promise.resolve(r); h < w; )
1489
- c = c.then(d[h++], d[h++]);
1490
- return c;
1491
- }
1492
- w = a.length;
1493
- let g = r;
1494
- for (h = 0; h < w; ) {
1495
- const d = a[h++], p = a[h++];
1496
- try {
1497
- g = d(g);
1498
- } catch (b) {
1499
- p.call(this, b);
1500
- break;
1501
- }
1502
- }
1503
- try {
1504
- c = Ke.call(this, g);
1505
- } catch (d) {
1506
- return Promise.reject(d);
1507
- }
1508
- for (h = 0, w = u.length; h < w; )
1509
- c = c.then(u[h++], u[h++]);
1510
- return c;
1511
- }
1512
- getUri(t) {
1513
- t = K(this.defaults, t);
1514
- const r = bt(t.baseURL, t.url, t.allowAbsoluteUrls);
1515
- return ft(r, t.params, t.paramsSerializer);
1516
- }
1517
- };
1518
- l.forEach(["delete", "get", "head", "options"], function(t) {
1519
- W.prototype[t] = function(r, s) {
1520
- return this.request(K(s || {}, {
1521
- method: t,
1522
- url: r,
1523
- data: (s || {}).data
1524
- }));
1525
- };
1526
- });
1527
- l.forEach(["post", "put", "patch"], function(t) {
1528
- function r(s) {
1529
- return function(o, i, a) {
1530
- return this.request(K(a || {}, {
1531
- method: t,
1532
- headers: s ? {
1533
- "Content-Type": "multipart/form-data"
1534
- } : {},
1535
- url: o,
1536
- data: i
1537
- }));
1538
- };
1539
- }
1540
- W.prototype[t] = r(), W.prototype[t + "Form"] = r(!0);
1541
- });
1542
- let os = class kt {
1543
- constructor(t) {
1544
- if (typeof t != "function")
1545
- throw new TypeError("executor must be a function.");
1546
- let r;
1547
- this.promise = new Promise(function(o) {
1548
- r = o;
1549
- });
1550
- const s = this;
1551
- this.promise.then((n) => {
1552
- if (!s._listeners) return;
1553
- let o = s._listeners.length;
1554
- for (; o-- > 0; )
1555
- s._listeners[o](n);
1556
- s._listeners = null;
1557
- }), this.promise.then = (n) => {
1558
- let o;
1559
- const i = new Promise((a) => {
1560
- s.subscribe(a), o = a;
1561
- }).then(n);
1562
- return i.cancel = function() {
1563
- s.unsubscribe(o);
1564
- }, i;
1565
- }, t(function(o, i, a) {
1566
- s.reason || (s.reason = new G(o, i, a), r(s.reason));
1567
- });
1568
- }
1569
- /**
1570
- * Throws a `CanceledError` if cancellation has been requested.
1571
- */
1572
- throwIfRequested() {
1573
- if (this.reason)
1574
- throw this.reason;
1575
- }
1576
- /**
1577
- * Subscribe to the cancel signal
1578
- */
1579
- subscribe(t) {
1580
- if (this.reason) {
1581
- t(this.reason);
1582
- return;
1583
- }
1584
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1585
- }
1586
- /**
1587
- * Unsubscribe from the cancel signal
1588
- */
1589
- unsubscribe(t) {
1590
- if (!this._listeners)
1591
- return;
1592
- const r = this._listeners.indexOf(t);
1593
- r !== -1 && this._listeners.splice(r, 1);
1594
- }
1595
- toAbortSignal() {
1596
- const t = new AbortController(), r = (s) => {
1597
- t.abort(s);
1598
- };
1599
- return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), t.signal;
1600
- }
1601
- /**
1602
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1603
- * cancels the `CancelToken`.
1604
- */
1605
- static source() {
1606
- let t;
1607
- return {
1608
- token: new kt(function(n) {
1609
- t = n;
1610
- }),
1611
- cancel: t
1612
- };
1613
- }
1614
- };
1615
- function is(e) {
1616
- return function(r) {
1617
- return e.apply(null, r);
1618
- };
1619
- }
1620
- function as(e) {
1621
- return l.isObject(e) && e.isAxiosError === !0;
1622
- }
1623
- const Ce = {
1624
- Continue: 100,
1625
- SwitchingProtocols: 101,
1626
- Processing: 102,
1627
- EarlyHints: 103,
1628
- Ok: 200,
1629
- Created: 201,
1630
- Accepted: 202,
1631
- NonAuthoritativeInformation: 203,
1632
- NoContent: 204,
1633
- ResetContent: 205,
1634
- PartialContent: 206,
1635
- MultiStatus: 207,
1636
- AlreadyReported: 208,
1637
- ImUsed: 226,
1638
- MultipleChoices: 300,
1639
- MovedPermanently: 301,
1640
- Found: 302,
1641
- SeeOther: 303,
1642
- NotModified: 304,
1643
- UseProxy: 305,
1644
- Unused: 306,
1645
- TemporaryRedirect: 307,
1646
- PermanentRedirect: 308,
1647
- BadRequest: 400,
1648
- Unauthorized: 401,
1649
- PaymentRequired: 402,
1650
- Forbidden: 403,
1651
- NotFound: 404,
1652
- MethodNotAllowed: 405,
1653
- NotAcceptable: 406,
1654
- ProxyAuthenticationRequired: 407,
1655
- RequestTimeout: 408,
1656
- Conflict: 409,
1657
- Gone: 410,
1658
- LengthRequired: 411,
1659
- PreconditionFailed: 412,
1660
- PayloadTooLarge: 413,
1661
- UriTooLong: 414,
1662
- UnsupportedMediaType: 415,
1663
- RangeNotSatisfiable: 416,
1664
- ExpectationFailed: 417,
1665
- ImATeapot: 418,
1666
- MisdirectedRequest: 421,
1667
- UnprocessableEntity: 422,
1668
- Locked: 423,
1669
- FailedDependency: 424,
1670
- TooEarly: 425,
1671
- UpgradeRequired: 426,
1672
- PreconditionRequired: 428,
1673
- TooManyRequests: 429,
1674
- RequestHeaderFieldsTooLarge: 431,
1675
- UnavailableForLegalReasons: 451,
1676
- InternalServerError: 500,
1677
- NotImplemented: 501,
1678
- BadGateway: 502,
1679
- ServiceUnavailable: 503,
1680
- GatewayTimeout: 504,
1681
- HttpVersionNotSupported: 505,
1682
- VariantAlsoNegotiates: 506,
1683
- InsufficientStorage: 507,
1684
- LoopDetected: 508,
1685
- NotExtended: 510,
1686
- NetworkAuthenticationRequired: 511
1687
- };
1688
- Object.entries(Ce).forEach(([e, t]) => {
1689
- Ce[t] = e;
1690
- });
1691
- function St(e) {
1692
- const t = new W(e), r = et(W.prototype.request, t);
1693
- return l.extend(r, W.prototype, t, { allOwnKeys: !0 }), l.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(n) {
1694
- return St(K(e, n));
1695
- }, r;
1696
- }
1697
- const v = St(se);
1698
- v.Axios = W;
1699
- v.CanceledError = G;
1700
- v.CancelToken = os;
1701
- v.isCancel = mt;
1702
- v.VERSION = Dt;
1703
- v.toFormData = pe;
1704
- v.AxiosError = D;
1705
- v.Cancel = v.CanceledError;
1706
- v.all = function(t) {
1707
- return Promise.all(t);
1708
- };
1709
- v.spread = is;
1710
- v.isAxiosError = as;
1711
- v.mergeConfig = K;
1712
- v.AxiosHeaders = A;
1713
- v.formToJSON = (e) => pt(l.isHTMLForm(e) ? new FormData(e) : e);
1714
- v.getAdapter = _t.getAdapter;
1715
- v.HttpStatusCode = Ce;
1716
- v.default = v;
1717
- const {
1718
- Axios: Io,
1719
- AxiosError: zo,
1720
- CanceledError: Mo,
1721
- isCancel: qo,
1722
- CancelToken: Ho,
1723
- VERSION: Wo,
1724
- all: Jo,
1725
- Cancel: Ko,
1726
- isAxiosError: Xo,
1727
- spread: Go,
1728
- toFormData: Qo,
1729
- AxiosHeaders: Zo,
1730
- HttpStatusCode: Yo,
1731
- formToJSON: ei,
1732
- getAdapter: ti,
1733
- mergeConfig: ri
1734
- } = v;
1735
- class ls {
1736
- static getTooltipOptions(t = !0) {
1737
- return {
1738
- show: t,
1739
- axisPointer: {
1740
- type: "cross",
1741
- label: {
1742
- backgroundColor: "#6a7985"
1743
- }
1744
- }
1745
- };
1746
- }
1747
- }
1748
- class ue {
1749
- static getLabelOptions(t = {}) {
1750
- return {
1751
- show: (t == null ? void 0 : t.show_label) || (t == null ? void 0 : t.show) || !1,
1752
- fontSize: "10",
1753
- position: (t == null ? void 0 : t.position) || "inside",
1754
- formatter: (t == null ? void 0 : t.formatter) || "{d}%",
1755
- ...t
1756
- };
1757
- }
1758
- static getLegendOpions(t = {}) {
1759
- return {
1760
- ...t,
1761
- position: (t == null ? void 0 : t.position) || "bottom"
1762
- };
1763
- }
1764
- }
1765
- const cs = {
1766
- show_label: !1,
1767
- show_legend: !1,
1768
- label: null,
1769
- legend: { position: null },
1770
- colors: null,
1771
- color: null,
1772
- title: null
1773
- };
1774
- function us() {
1775
- const e = "0123456789ABCDEF";
1776
- let t = "#";
1777
- for (let r = 0; r < 6; r += 1)
1778
- t += e[Math.floor(Math.random() * 16)];
1779
- return t;
1780
- }
1781
- function Y(e = cs) {
1782
- var r;
1783
- const t = {
1784
- label: {
1785
- show: e == null ? void 0 : e.show_label,
1786
- formatter: (e == null ? void 0 : e.formatter) || ((s) => V(s)),
1787
- ...(e == null ? void 0 : e.label) || {}
1788
- },
1789
- legend: {
1790
- ...(e == null ? void 0 : e.legend) || {},
1791
- [((r = e == null ? void 0 : e.legend) == null ? void 0 : r.position) || "bottom"]: "0",
1792
- show: (e == null ? void 0 : e.show_legend) || !1
1793
- },
1794
- barWidth: "70%",
1795
- grid: {
1796
- borderColor: "#e5e7eb"
1797
- },
1798
- title: { ...(e == null ? void 0 : e.title) || {} }
1799
- };
1800
- return (e != null && e.colors || e != null && e.color) && (t.color = (e == null ? void 0 : e.colors) || (e == null ? void 0 : e.color) || null), t;
1801
- }
1802
- function Ge(e) {
1803
- return {
1804
- color: "#9ca3af",
1805
- fontSize: 10,
1806
- fontFamily: "Inter, ui-sans-serif, system-ui",
1807
- fontWeight: 400,
1808
- label: e == null ? void 0 : e.label,
1809
- show: !0,
1810
- formatter: (e == null ? void 0 : e.formatter) || ((r) => V(r)),
1811
- margin: (e == null ? void 0 : e.margin) || 7,
1812
- interval: (e == null ? void 0 : e.interval) || "auto",
1813
- rotate: (e == null ? void 0 : e.rotate) || 0
1814
- };
1815
- }
1816
- const Qe = [
1817
- "#d3c7e6",
1818
- "#bedae3",
1819
- "#f8e9cb",
1820
- "#ff8c8c",
1821
- "#c5d8be",
1822
- "#ffc6c6",
1823
- "#ffc39a",
1824
- "#fff7c5",
1825
- "#d8ffc0",
1826
- "#d4f7ff"
1827
- ], M = {
1828
- props: [
1829
- "source",
1830
- "style",
1831
- "widget",
1832
- "dashboard",
1833
- "title",
1834
- "currentWidget",
1835
- "widgetData",
1836
- "prefix"
1837
- ],
1838
- data() {
1839
- return {
1840
- sourceData: null,
1841
- styleData: null,
1842
- widgetName: "",
1843
- dimensions: [],
1844
- dashboardName: "",
1845
- titleCharts: "",
1846
- widgetInstance: null
1847
- };
1848
- },
1849
- mounted() {
1850
- window.addEventListener("resize", this.handleResize), window.addEventListener(`update-data-${this.widget}`, this.checkCustomEvent), window.addEventListener(`update-style-${this.widget}`, this.checkCustomStyleEvent);
1851
- },
1852
- unmounted() {
1853
- window.removeEventListener(`update-data-${this.widget}`, this.checkCustomEvent), window.removeEventListener(`update-style-${this.widget}`, this.checkCustomStyleEvent);
1854
- },
1855
- watch: {
1856
- sourceData: {
1857
- async handler() {
1858
- setTimeout(() => {
1859
- this == null || this.onChangedData();
1860
- }, 0);
1861
- }
1862
- }
1863
- },
1864
- methods: {
1865
- checkCustomStyleEvent(e) {
1866
- this.changeOptionsByName(e.chartId, e.options);
1867
- },
1868
- checkCustomEvent({ filterUrl: e }) {
1869
- this.getDataFromURL(e);
1870
- },
1871
- handleResize() {
1872
- this.widgetInstance && this.widgetInstance.resize();
1873
- },
1874
- async getDataFromURL(e) {
1875
- var t, r, s, n;
1876
- try {
1877
- const o = await v.get(e);
1878
- this.sourceData = ((t = o.data) == null ? void 0 : t.source) || [], this.$emit("update:widgetData", o.data), this.dimensions = Object.keys(((r = this.sourceData) == null ? void 0 : r[0]) || {}), this.titleCharts = this.style ? this.style : ((s = o.data) == null ? void 0 : s.title) || "", this.styleData = ((n = o.data) == null ? void 0 : n.style) || {};
1879
- } catch (o) {
1880
- const i = { message: "Дані не знайдено", title: "Помилка!", type: "error", status: 400, id: this.widgetName };
1881
- (o == null ? void 0 : o.status) == "404" && (i.status = 404, i.message = "Дані не знайдено"), (o == null ? void 0 : o.status) == "400" && (i.message = "Перевірте налаштування або зверніться до адміністратора"), (o == null ? void 0 : o.status) == "500" && (i.message = "Сталася помилка сервера"), this.$emit("update:widgetData", i);
1882
- }
1883
- },
1884
- getValues() {
1885
- return this.sourceData.map((e) => {
1886
- var t;
1887
- return parseFloat(e[(t = this.columns) == null ? void 0 : t[1]]);
1888
- });
1889
- },
1890
- formatDate(e) {
1891
- const t = new Date(e);
1892
- if (isNaN(t)) return e;
1893
- const r = String(t.getDate()).padStart(2, "0"), n = [
1894
- "січня",
1895
- "лютого",
1896
- "березня",
1897
- "квітня",
1898
- "травня",
1899
- "червня",
1900
- "липня",
1901
- "серпня",
1902
- "вересня",
1903
- "жовтня",
1904
- "листопада",
1905
- "грудня"
1906
- ][t.getMonth()], o = t.getFullYear();
1907
- return `${r} ${n} ${o}`;
1908
- },
1909
- async getData() {
1910
- var e;
1911
- try {
1912
- if (this.source)
1913
- this.sourceData = [...this.source], this.styleData = this.style, this.titleCharts = this.title, this.dimensions = Object.keys(((e = this.sourceData) == null ? void 0 : e[0]) || {});
1914
- else {
1915
- this.widgetName = this.widget, this.dashboardName = this.dashboard;
1916
- const t = this.dashboardName ? `${this.prefix || ""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}` : `${this.prefix || ""}/bi-data?&widget=${this.widgetName}`;
1917
- await this.getDataFromURL(t);
1918
- }
1919
- } catch (t) {
1920
- console.error(t);
1921
- }
1922
- },
1923
- async initChart(e, t, r) {
1924
- var s, n, o, i, a, f, u;
1925
- this.widgetInstance && this.widgetInstance.clear();
1926
- try {
1927
- const c = this.$refs.chart, h = echarts == null ? void 0 : echarts.init(c), w = {
1928
- tooltip: {
1929
- trigger: "axis",
1930
- axisPointer: { type: "shadow" },
1931
- backgroundColor: "transparent",
1932
- shadowColor: "transparent",
1933
- padding: [0, 0, 0, 0],
1934
- borderWidth: 0,
1935
- formatter: (g) => {
1936
- var S;
1937
- const d = (S = g[0]) == null ? void 0 : S.axisValue;
1938
- let b = `
1939
- <div style="background-color: rgba(255, 255, 255, 0.7)" class="border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700 min-w-28">
1940
- <div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200 px-2 py-1">
1941
- ${d ? this.formatDate(d) : "N/A"}
1942
- </div>
1943
- `;
1944
- return g.forEach((k) => {
1945
- b += `
1946
- <div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 dark:text-neutral-400">
1947
- <span class="flex items-center">
1948
- <span class="w-2.5 h-2.5 me-1.5 rounded-sm" style="background-color: ${k.color};"></span>
1949
- <span class="font-medium mr-[6px]">${(k == null ? void 0 : k.seriesName) === "metric" ? "Значення" : k == null ? void 0 : k.seriesName}</span>
1950
- </span>
1951
- <span>${this.getMetricValue(k == null ? void 0 : k.data)}</span>
1952
- </div>
1953
- `;
1954
- }), b += "</div>", b;
1955
- }
1956
- },
1957
- xAxis: {
1958
- data: t != null && t.length ? t : null,
1959
- type: t ? "category" : "value",
1960
- name: ((n = (s = this.styleData) == null ? void 0 : s.x_axis) == null ? void 0 : n.name) || "",
1961
- axisLabel: {
1962
- ...Ge((o = this.styleData) == null ? void 0 : o.x_axis),
1963
- formatter: (g) => {
1964
- var p, b;
1965
- const d = this.formatDate(g);
1966
- return ((b = (p = this.styleData) == null ? void 0 : p.x_axis) == null ? void 0 : b.overflow) === "ellipsis" && d.length > 10 ? `${d.slice(0, 10)}...` : d;
1967
- }
1968
- }
1969
- },
1970
- yAxis: {
1971
- data: r != null && r.length ? r : null,
1972
- type: r ? "category" : "value",
1973
- name: ((a = (i = this.styleData) == null ? void 0 : i.y_axis) == null ? void 0 : a.name) || "",
1974
- axisLabel: Ge((f = this.styleData) == null ? void 0 : f.y_axis)
1975
- },
1976
- series: e != null && e.length ? e : null,
1977
- ...Y(this.styleData),
1978
- grid: {
1979
- bottom: "0%",
1980
- right: "0%",
1981
- left: "0%",
1982
- top: "20px",
1983
- containLabel: !0,
1984
- ...((u = this.styleData) == null ? void 0 : u.grid) || {}
1985
- }
1986
- };
1987
- await h.setOption(w), h.resize(), this.widgetInstance = h, this.$emit("update:currentWidget", h);
1988
- } catch (c) {
1989
- console.error(c);
1990
- }
1991
- },
1992
- async setSeriesOption(e, t) {
1993
- const r = e.getOption(), { series: s = [] } = r, n = s.map((o) => ({
1994
- ...o,
1995
- ...t
1996
- }));
1997
- e.setOption({
1998
- ...r,
1999
- series: n
2000
- });
2001
- },
2002
- async changeOptionsByName(e, t) {
2003
- const r = document.getElementById(e);
2004
- if (!r) return null;
2005
- const s = echarts.getInstanceByDom(r);
2006
- if (!s) return null;
2007
- const n = s.getOption();
2008
- t.seriesOptions && this.setSeriesOption(s, t.seriesOptions), s.setOption({
2009
- ...n,
2010
- ...t.options,
2011
- tooltip: {
2012
- ...ls.getTooltipOptions(t.options.tooltip.show)
2013
- }
2014
- });
2015
- },
2016
- async changeData(e) {
2017
- var t;
2018
- try {
2019
- let r = this.dashboard ? `${this.prefix || ""}/bi-data?dashboard=${this.dashboard}&widget=${this.widget}` : `${this.prefix || ""}/bi-data?&widget=${this.widget}`;
2020
- (t = e == null ? void 0 : e.granularity) != null && t.length && (r += `&granularity=${e.granularity}`), e != null && e.metrics && (r += `&metrics=${e.metrics}`), this.getDataFromURL(r);
2021
- } catch (r) {
2022
- console.error(r);
2023
- }
2024
- },
2025
- async setFilter(e) {
2026
- const t = `${this.prefix || ""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}${e || ""}`;
2027
- await this.getDataFromURL(t);
2028
- },
2029
- async changeStyle(e, t) {
2030
- this.styleData[e] = t, this.onChangedData();
2031
- },
2032
- getMetricValue(e) {
2033
- var s;
2034
- const t = (e == null ? void 0 : e.metric) || e;
2035
- return parseFloat(t) ? (s = V(t, { notation: "standard" })) == null ? void 0 : s.replaceAll(
2036
- ",",
2037
- " "
2038
- ) : t;
2039
- }
2040
- }
2041
- }, ds = {
2042
- name: "VsBar",
2043
- mixins: [M],
2044
- data() {
2045
- return {
2046
- resizeObserver: null
2047
- };
2048
- },
2049
- computed: {
2050
- uniqueID() {
2051
- return this.widget;
2052
- }
2053
- },
2054
- async mounted() {
2055
- var t;
2056
- this.getData(), this.onChangedData();
2057
- const e = (t = this.$refs) == null ? void 0 : t.chart;
2058
- e && (this.resizeObserver = new ResizeObserver(() => {
2059
- var r;
2060
- this.widgetInstance && ((r = this.widgetInstance) == null || r.resize());
2061
- }), this.resizeObserver.observe(e));
2062
- },
2063
- unmounted() {
2064
- this.resizeObserver.disconnect();
2065
- },
2066
- methods: {
2067
- async onChangedData() {
2068
- try {
2069
- if (this.sourceData) {
2070
- await this.$nextTick();
2071
- const { series: e, xs: t, ys: r } = this.prepareData();
2072
- e && (this == null || this.initChart(e, t, r));
2073
- }
2074
- } catch (e) {
2075
- console.error(e);
2076
- }
2077
- },
2078
- prepareData() {
2079
- var e, t, r, s, n, o;
2080
- try {
2081
- if (!((e = this.sourceData) != null && e.length))
2082
- return { series: [], xs: [], ys: void 0 };
2083
- const i = Array.from(
2084
- new Set(
2085
- this.sourceData.filter((w) => w[this.dimensions[0]]).map((w) => w[this.dimensions[0]])
2086
- )
2087
- );
2088
- let a;
2089
- this.dimensions[0].includes("date") ? a = i.map((w) => Te(w)) : a = [...i];
2090
- let f, u;
2091
- ((t = this.styleData) == null ? void 0 : t.horizontal) === !0 ? u = [...a] : f = [...a];
2092
- const c = this.sourceData.filter(
2093
- (w) => parseFloat(w[this.dimensions[1]]) && w[this.dimensions[0]]
2094
- ).map((w) => parseFloat(w[this.dimensions[1]]));
2095
- let h;
2096
- return ((r = this.styleData) == null ? void 0 : r.stack) !== !1 ? h = this.prepareStackData() : ((s = this.styleData) == null ? void 0 : s.negative_waterfall) === !0 ? h = this.prepareNegativeWaterfall() : ((n = this.styleData) == null ? void 0 : n.waterfall) === !0 ? h = this.prepareWaterfallData(c) : ((o = this.styleData) == null ? void 0 : o.accumulative) === !0 ? h = this.prepareAccumulative(c) : h = this.dimensions.slice(1).map((g, d) => ({
2097
- name: g,
2098
- type: "bar",
2099
- stack: `a${d}`,
2100
- data: this.sourceData.filter((p) => parseFloat(p[g]) && g).map((p) => parseFloat(p[g]))
2101
- })), { series: h, xs: f, ys: u };
2102
- } catch (i) {
2103
- return console.error(i), { series: [], xs: [], ys: [] };
2104
- }
2105
- },
2106
- prepareWaterfallData(e) {
2107
- let t = e.reduce((o, i) => o + i, 0);
2108
- const r = [t, ...e], s = r.map((o, i) => {
2109
- if (i === 0) return 0;
2110
- const a = t - o;
2111
- return t -= o, a >= 0 ? a : 0;
2112
- });
2113
- return [
2114
- {
2115
- type: "bar",
2116
- stack: "Total",
2117
- itemStyle: {
2118
- borderColor: "transparent",
2119
- color: "transparent"
2120
- },
2121
- data: s,
2122
- tooltip: {
2123
- show: !1
2124
- }
2125
- },
2126
- {
2127
- name: this.title ? this.title : this.dimensions[0],
2128
- type: "bar",
2129
- stack: "Total",
2130
- data: r
2131
- }
2132
- ];
2133
- },
2134
- prepareStackData() {
2135
- return this.dimensions.slice(1).map((r) => ({
2136
- name: r,
2137
- type: "bar",
2138
- stack: "a",
2139
- data: this.sourceData.filter((s) => parseFloat(s[r]) && r).map((s) => parseFloat(s[r]))
2140
- }));
2141
- },
2142
- prepareNegativeWaterfall() {
2143
- const e = this.sourceData.map(
2144
- (o) => Number.isNaN(o[this.dimensions[1]]) ? 0 : Number(o[this.dimensions[1]])
2145
- ), t = this.sourceData.map(
2146
- (o) => Number.isNaN(o[this.dimensions[2]]) ? 0 : Number(o[this.dimensions[2]])
2147
- );
2148
- let r = 0;
2149
- const s = e.map((o, i) => {
2150
- const a = r;
2151
- return r += Number.isNaN(o) ? 0 : o, i === 0 && (r -= Number.isNaN(t[i]) ? 0 : t[i]), r -= Number.isNaN(t[i + 1]) ? 0 : t[i + 1], a >= 0 ? a : 0;
2152
- });
2153
- return [
2154
- {
2155
- type: "bar",
2156
- stack: "a",
2157
- itemStyle: {
2158
- borderColor: "transparent",
2159
- color: "transparent"
2160
- },
2161
- data: s,
2162
- tooltip: {
2163
- show: !1
2164
- }
2165
- },
2166
- {
2167
- name: this.dimensions[1],
2168
- type: "bar",
2169
- stack: "a",
2170
- data: e
2171
- },
2172
- {
2173
- name: this.dimensions[2],
2174
- type: "bar",
2175
- stack: "a",
2176
- data: t
2177
- }
2178
- ];
2179
- },
2180
- prepareAccumulative(e) {
2181
- let t = 0;
2182
- const r = e.map((n) => (t += n, t));
2183
- return [
2184
- {
2185
- name: this.titleCharts,
2186
- type: "bar",
2187
- stack: "Total",
2188
- data: r
2189
- }
2190
- ];
2191
- }
2192
- }
2193
- }, R = (e, t) => {
2194
- const r = e.__vccOpts || e;
2195
- for (const [s, n] of t)
2196
- r[s] = n;
2197
- return r;
2198
- }, fs = ["id"];
2199
- function hs(e, t, r, s, n, o) {
2200
- return x(), _("div", {
2201
- id: o.uniqueID,
2202
- ref: "chart",
2203
- class: "h-full w-full min-h-[200px]"
2204
- }, null, 8, fs);
2205
- }
2206
- const ps = /* @__PURE__ */ R(ds, [["render", hs]]), ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2207
- __proto__: null,
2208
- default: ps
2209
- }, Symbol.toStringTag, { value: "Module" })), gs = {
2210
- name: "VsPie",
2211
- props: ["currentWidget"],
2212
- mixins: [M],
2213
- data() {
2214
- return {
2215
- chartInstance: null,
2216
- // Unused variable – оставлен для потенциального будущего использования
2217
- resizeObserver: null
2218
- };
2219
- },
2220
- computed: {
2221
- // Генерируем уникальный ID на основе свойства widget из миксина
2222
- uniqueID() {
2223
- return this.widget;
2224
- }
2225
- },
2226
- async mounted() {
2227
- var r;
2228
- await this.$nextTick(), await this.getData();
2229
- const { series: e } = this.prepareData() || {};
2230
- e && this.initChart(e);
2231
- const t = (r = this.$refs) == null ? void 0 : r.chart;
2232
- t && (this.resizeObserver = new ResizeObserver(() => {
2233
- this.chartInstance && this.chartInstance.resize();
2234
- }), this.resizeObserver.observe(t));
2235
- },
2236
- beforeUnmount() {
2237
- var e;
2238
- (e = this.resizeObserver) == null || e.disconnect();
2239
- },
2240
- methods: {
2241
- // Не используется, оставлен для потенциального будущего применения
2242
- onChangedData() {
2243
- try {
2244
- if (this.sourceData) {
2245
- const { series: e, xs: t, ys: r } = this.prepareData();
2246
- e && this.initChart(e, t, r);
2247
- }
2248
- } catch (e) {
2249
- console.error(e);
2250
- }
2251
- },
2252
- buildTooltipForDonut(e, t) {
2253
- const { name: r, value: s, percent: n } = e;
2254
- return `
2255
- <div style="background-color:${t[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
2256
- ${r == null ? void 0 : r.replace("null", "Не визначено")}: ${V(s)} (${n}%)
2257
- </div>`;
2258
- },
2259
- prepareData() {
2260
- var e, t, r, s, n, o;
2261
- try {
2262
- if (this.styleData = this.styleData || {}, !((e = this.sourceData) != null && e.length))
2263
- return console.warn("No source data available"), null;
2264
- const i = Array.from(
2265
- new Set(
2266
- (this.sourceData || []).map((d) => d[this.dimensions[0]])
2267
- )
2268
- ), a = Array.from(
2269
- new Set(
2270
- (this.sourceData || []).map((d) => d[this.dimensions[1]])
2271
- )
2272
- ), f = parseInt(
2273
- (this.sourceData || []).reduce(
2274
- (d, p) => d + parseFloat((p == null ? void 0 : p.metric) || 0),
2275
- 0
2276
- ),
2277
- 10
2278
- ), u = i.map((d, p) => {
2279
- const b = (a[p] / f * 100).toFixed(2);
2280
- return {
2281
- name: `${d} (${b}%)`,
2282
- value: a[p]
2283
- };
2284
- }), c = ((t = this.styleData) == null ? void 0 : t.innerRadius) || "80%", h = ((r = this.styleData) == null ? void 0 : r.outerRadius) || "100%", w = [c, h];
2285
- return this.styleData.legend = ue.getLegendOpions({
2286
- borderRadius: 10,
2287
- height: "100%",
2288
- padding: 10,
2289
- bottom: "0",
2290
- type: "scroll",
2291
- itemWidth: 14,
2292
- itemHeight: 14,
2293
- formatter: (d) => {
2294
- var p;
2295
- return (p = d == null ? void 0 : d.replace("null", "Не визначено")) == null ? void 0 : p.replace("NaN", "0.00");
2296
- },
2297
- ...((s = this.styleData) == null ? void 0 : s.legend) || {}
2298
- }), this.styleData.label = ue.getLabelOptions(
2299
- (n = this.styleData) == null ? void 0 : n.label
2300
- ), this.styleData.show_legend = ((o = this.styleData) == null ? void 0 : o.show_legend) ?? !0, { series: [
2301
- {
2302
- name: this.titleCharts ? this.titleCharts : this.dimensions[0],
2303
- type: "pie",
2304
- radius: w,
2305
- center: ["50%", "60%"],
2306
- height: "75%",
2307
- ...Y(this.styleData),
2308
- data: u
2309
- }
2310
- ] };
2311
- } catch (i) {
2312
- return console.error("Error in prepareData:", i), null;
2313
- }
2314
- },
2315
- async initChart(e) {
2316
- try {
2317
- if (!e) {
2318
- console.warn("No series data available for chart initialization");
2319
- return;
2320
- }
2321
- const t = this.$refs.chart;
2322
- if (!t) {
2323
- console.warn("Chart DOM element not found");
2324
- return;
2325
- }
2326
- this.chartInstance = echarts.init(t);
2327
- const r = parseInt(
2328
- (this.sourceData || []).reduce(
2329
- (n, o) => n + parseFloat((o == null ? void 0 : o.metric) || 0),
2330
- 0
2331
- ),
2332
- 10
2333
- ), s = {
2334
- tooltip: {
2335
- trigger: "item",
2336
- formatter: (n) => this.buildTooltipForDonut(n, [n.color]),
2337
- borderWidth: 0,
2338
- appendToBody: !0,
2339
- borderColor: "transparent",
2340
- textStyle: { color: "#000" },
2341
- padding: [15, 15],
2342
- shadowColor: "transparent",
2343
- backgroundColor: "transparent"
2344
- },
2345
- series: e,
2346
- ...Y(this.styleData || {}),
2347
- title: {
2348
- text: V(r),
2349
- left: "center",
2350
- top: "41%",
2351
- textStyle: {
2352
- color: "black",
2353
- fontWeight: 400,
2354
- fontSize: "22px"
2355
- }
2356
- }
2357
- };
2358
- this.chartInstance.setOption(s), this.$emit("update:currentWidget", this.chartInstance), this.chartInstance.resize(), window.addEventListener("resize", () => {
2359
- var n;
2360
- (n = this.chartInstance) == null || n.resize();
2361
- });
2362
- } catch (t) {
2363
- console.error("Error in initChart:", t);
2364
- }
2365
- }
2366
- }
2367
- }, bs = ["id"];
2368
- function ws(e, t, r, s, n, o) {
2369
- return x(), _("div", {
2370
- id: o.uniqueID,
2371
- ref: "chart",
2372
- class: "h-full min-h-[200px] flex items-center"
2373
- }, null, 8, bs);
2374
- }
2375
- const ys = /* @__PURE__ */ R(gs, [["render", ws]]), xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2376
- __proto__: null,
2377
- default: ys
2378
- }, Symbol.toStringTag, { value: "Module" })), _s = {
2379
- name: "VsPie",
2380
- props: ["currentWidget"],
2381
- mixins: [M],
2382
- data() {
2383
- return {
2384
- chartInstance: null,
2385
- // Unused переменная, оставлена для возможного будущего использования
2386
- resizeObserver: null
2387
- };
2388
- },
2389
- computed: {
2390
- // Используем computed для генерации уникального ID на основе виджета
2391
- uniqueID() {
2392
- return this.widget;
2393
- }
2394
- },
2395
- async mounted() {
2396
- var r;
2397
- await this.$nextTick(), await this.getData();
2398
- const { series: e } = this.prepareData() || {};
2399
- e && this.initChart(e);
2400
- const t = (r = this.$refs) == null ? void 0 : r.chart;
2401
- t && (this.resizeObserver = new ResizeObserver(() => {
2402
- this.chartInstance && this.chartInstance.resize();
2403
- }), this.resizeObserver.observe(t));
2404
- },
2405
- unmounted() {
2406
- var e;
2407
- (e = this.resizeObserver) == null || e.disconnect();
2408
- },
2409
- methods: {
2410
- // Метод не вызывается в компоненте, но оставлен для возможного будущего использования
2411
- onChangedData() {
2412
- try {
2413
- if (this.sourceData) {
2414
- const { series: e, xs: t, ys: r } = this.prepareData();
2415
- e && this.initChart(e, t, r);
2416
- }
2417
- } catch (e) {
2418
- console.error(e);
2419
- }
2420
- },
2421
- buildTooltipForDonut(e, t) {
2422
- const { name: r, value: s, percent: n } = e;
2423
- return `
2424
- <div style="background-color:${t[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
2425
- ${r == null ? void 0 : r.replace("null", "Не визначено")}: ${V(s)} (${n}%)
2426
- </div>`;
2427
- },
2428
- prepareData() {
2429
- var e, t, r, s, n;
2430
- try {
2431
- this.styleData = this.styleData || {};
2432
- const o = Array.from(
2433
- new Set(
2434
- (this.sourceData || []).map((g) => g[this.dimensions[0]])
2435
- )
2436
- ), i = Array.from(
2437
- new Set(
2438
- (this.sourceData || []).map((g) => g[this.dimensions[1]])
2439
- )
2440
- ), a = parseInt(
2441
- (this.sourceData || []).reduce(
2442
- (g, d) => g + parseFloat(d == null ? void 0 : d.metric),
2443
- 0
2444
- ),
2445
- 10
2446
- ), f = o.map((g, d) => {
2447
- const p = (i[d] / a * 100).toFixed(2);
2448
- return {
2449
- name: `${g} (${p}%)`,
2450
- value: i[d]
2451
- };
2452
- }), u = ((e = this.styleData) == null ? void 0 : e.innerRadius) || "0%", c = ((t = this.styleData) == null ? void 0 : t.outerRadius) || "100%", h = [u, c];
2453
- return this.styleData.legend = ue.getLegendOpions({
2454
- borderRadius: 10,
2455
- height: "100%",
2456
- padding: 10,
2457
- type: "scroll",
2458
- itemWidth: 14,
2459
- itemHeight: 14,
2460
- formatter: (g) => g == null ? void 0 : g.replace("null", "Не визначено"),
2461
- textStyle: { fontSize: "14px" },
2462
- ...((r = this.styleData) == null ? void 0 : r.legend) || {}
2463
- }), this.styleData.label = ue.getLabelOptions(
2464
- (s = this.styleData) == null ? void 0 : s.label
2465
- ), this.styleData.show_legend = ((n = this.styleData) == null ? void 0 : n.show_legend) ?? !0, { series: [
2466
- {
2467
- name: this.titleCharts ? this.titleCharts : this.dimensions[0],
2468
- type: "pie",
2469
- radius: h,
2470
- center: ["50%", "60%"],
2471
- height: "75%",
2472
- ...Y(this.styleData),
2473
- data: f
2474
- }
2475
- ] };
2476
- } catch (o) {
2477
- return console.error("Error in prepareData:", o), null;
2478
- }
2479
- },
2480
- async initChart(e) {
2481
- try {
2482
- if (!e) {
2483
- console.warn("No series data available for chart initialization");
2484
- return;
2485
- }
2486
- const t = this.$refs.chart;
2487
- if (!t) {
2488
- console.warn("Chart DOM element not found");
2489
- return;
2490
- }
2491
- this.chartInstance = echarts.init(t);
2492
- const r = {
2493
- tooltip: {
2494
- trigger: "item",
2495
- formatter: (s) => this.buildTooltipForDonut(s, [s.color]),
2496
- borderWidth: 0,
2497
- appendToBody: !0,
2498
- borderColor: "transparent",
2499
- textStyle: { color: "#000" },
2500
- padding: [15, 15],
2501
- shadowColor: "transparent",
2502
- backgroundColor: "transparent"
2503
- },
2504
- series: e,
2505
- ...Y(this.styleData || {})
2506
- };
2507
- this.chartInstance.setOption(r), this.$emit("update:currentWidget", this.chartInstance), this.chartInstance.resize(), window.addEventListener("resize", () => {
2508
- var s;
2509
- (s = this.chartInstance) == null || s.resize();
2510
- });
2511
- } catch (t) {
2512
- console.error("Error in initChart:", t);
2513
- }
2514
- }
2515
- }
2516
- }, Ds = ["id"];
2517
- function ks(e, t, r, s, n, o) {
2518
- return x(), _("div", {
2519
- id: o.uniqueID,
2520
- ref: "chart",
2521
- class: "h-full min-h-[200px] flex items-center"
2522
- }, null, 8, Ds);
2523
- }
2524
- const Ss = /* @__PURE__ */ R(_s, [["render", ks]]), vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2525
- __proto__: null,
2526
- default: Ss
2527
- }, Symbol.toStringTag, { value: "Module" })), Es = {
2528
- name: "VsLine",
2529
- mixins: [M],
2530
- data() {
2531
- return {
2532
- chartInstance: null,
2533
- uniqueID: null
2534
- };
2535
- },
2536
- async mounted() {
2537
- this.uniqueID = this.widget, await this.$nextTick(), await this.getData();
2538
- const { series: e, xs: t } = this.prepareData();
2539
- e && this.initChart(e, t);
2540
- },
2541
- methods: {
2542
- onChangedData() {
2543
- try {
2544
- if (this.sourceData) {
2545
- const { series: e, xs: t, ys: r } = this.prepareData();
2546
- e && (this == null || this.initChart(e, t, r));
2547
- }
2548
- } catch (e) {
2549
- console.error(e);
2550
- }
2551
- },
2552
- prepareData() {
2553
- var e, t;
2554
- try {
2555
- const r = Array.from(
2556
- new Set(this.sourceData.map((i) => i[this.dimensions[0]]))
2557
- );
2558
- let s;
2559
- this.dimensions[0].includes("date") ? s = r.map((i) => Te(i)) : s = [...r];
2560
- const n = this.sourceData.map(
2561
- (i) => parseFloat(i[this.dimensions[1]])
2562
- );
2563
- let o;
2564
- return (e = this.styleData) != null && e.stack ? o = this.dimensions.slice(1).map((a) => ({
2565
- name: a,
2566
- type: "line",
2567
- stack: "a",
2568
- areaStyle: this.styleData.area ? {} : null,
2569
- data: this.sourceData.filter((f) => parseFloat(f[a])).map((f) => parseFloat(f[a]))
2570
- })) : o = [
2571
- {
2572
- name: this.title,
2573
- type: "line",
2574
- areaStyle: (t = this.styleData) != null && t.area ? {} : null,
2575
- data: n,
2576
- stack: "a"
2577
- }
2578
- ], { series: o, xs: s };
2579
- } catch (r) {
2580
- return console.error(r), null;
2581
- }
2582
- }
2583
- }
2584
- }, Cs = ["id"];
2585
- function Rs(e, t, r, s, n, o) {
2586
- return x(), _("div", {
2587
- id: n.uniqueID,
2588
- ref: "chart",
2589
- style: { height: "400px" }
2590
- }, null, 8, Cs);
2591
- }
2592
- const Os = /* @__PURE__ */ R(Es, [["render", Rs]]), Ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2593
- __proto__: null,
2594
- default: Os
2595
- }, Symbol.toStringTag, { value: "Module" })), $s = {
2596
- name: "VsStat",
2597
- mixins: [M],
2598
- data() {
2599
- return {
2600
- restDimensions: [],
2601
- sumValue: 0,
2602
- columns: null,
2603
- showTooltip: -1
2604
- };
2605
- },
2606
- async mounted() {
2607
- await this.getData(), this.prepareData();
2608
- },
2609
- methods: {
2610
- onChangedData() {
2611
- try {
2612
- this.sourceData && this.prepareData();
2613
- } catch {
2614
- }
2615
- },
2616
- prepareData() {
2617
- this.columns = Object.keys(this.sourceData[0]);
2618
- const e = this.getValues();
2619
- this.sumValue = e.reduce((t, r) => t + r, 0), this.sourceData.forEach((t, r) => {
2620
- t.color = r < Qe.length - 1 ? Qe[r] : us();
2621
- });
2622
- },
2623
- formattedValue(e) {
2624
- const t = parseFloat(e);
2625
- return V(t);
2626
- }
2627
- }
2628
- }, Ns = { class: "flex flex-col w-full h-full pt-[16px] rounded-xl" }, As = { class: "flex flex-col justify-between w-full h-full" }, Fs = { class: "w-full h-full pb-6 space-y-4" }, Ls = { class: "flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar" }, Ps = ["onMouseover"], Bs = {
2629
- key: 0,
2630
- class: "absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"
2631
- }, Us = { class: "h-[calc(100%-20px)] w-full custom-scrollbar" }, js = { class: "grid items-center justify-between grid-cols-2 py-2 gap-x-4" }, Vs = { class: "flex items-center" }, Is = { class: "text-sm text-gray-800" }, zs = { class: "text-end" }, Ms = { class: "text-sm text-gray-500" };
2632
- function qs(e, t, r, s, n, o) {
2633
- return x(), _("div", Ns, [
2634
- m("div", As, [
2635
- m("div", Fs, [
2636
- m("div", Ls, [
2637
- (x(!0), _(F, null, P(e.sourceData, (i, a) => {
2638
- var f, u, c, h;
2639
- return x(), _("div", {
2640
- class: J(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap", `bg-[${i.color}]`]),
2641
- style: Re({
2642
- width: `${parseFloat(i == null ? void 0 : i[(f = n.columns) == null ? void 0 : f[1]]) / n.sumValue * 100}%`
2643
- }),
2644
- role: "progressbar",
2645
- "aria-valuenow": "42",
2646
- "aria-valuemin": "0",
2647
- "aria-valuemax": "100",
2648
- onMouseover: (w) => n.showTooltip = a,
2649
- onMouseleave: t[0] || (t[0] = (w) => n.showTooltip = -1)
2650
- }, [
2651
- n.showTooltip > -1 ? (x(), _("div", Bs, E(e.sourceData[n.showTooltip][n.columns[0]]) + " " + E((parseFloat((h = (u = e.sourceData) == null ? void 0 : u[n.showTooltip]) == null ? void 0 : h[(c = n.columns) == null ? void 0 : c[1]]) / n.sumValue * 100).toFixed(2)) + "% ", 1)) : $("", !0)
2652
- ], 46, Ps);
2653
- }), 256))
2654
- ]),
2655
- m("ul", Us, [
2656
- (x(!0), _(F, null, P(e.sourceData, (i) => {
2657
- var a, f;
2658
- return x(), _("li", js, [
2659
- m("div", Vs, [
2660
- m("span", {
2661
- class: J(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]", `bg-[${i.color}]`])
2662
- }, null, 2),
2663
- m("span", Is, E((i == null ? void 0 : i[(a = n.columns) == null ? void 0 : a[0]]) || "Не визначено"), 1)
2664
- ]),
2665
- m("div", zs, [
2666
- m("span", Ms, E(o.formattedValue(i == null ? void 0 : i[(f = n.columns) == null ? void 0 : f[1]]) || "-"), 1)
2667
- ])
2668
- ]);
2669
- }), 256))
2670
- ])
2671
- ])
2672
- ])
2673
- ]);
2674
- }
2675
- const Hs = /* @__PURE__ */ R($s, [["render", qs]]), Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2676
- __proto__: null,
2677
- default: Hs
2678
- }, Symbol.toStringTag, { value: "Module" })), Js = {
2679
- name: "VsProgressBar",
2680
- mixins: [M],
2681
- data() {
2682
- return {
2683
- restDimensions: [],
2684
- maxValue: 0,
2685
- columns: null
2686
- };
2687
- },
2688
- async mounted() {
2689
- await this.getData(), this.prepareData();
2690
- },
2691
- methods: {
2692
- onChangedData() {
2693
- try {
2694
- this.sourceData && this.prepareData();
2695
- } catch {
2696
- }
2697
- },
2698
- prepareData() {
2699
- var t;
2700
- this.columns = Object.keys((t = this.sourceData) == null ? void 0 : t[0]) || null;
2701
- const e = this.getValues();
2702
- this.maxValue = Math.max(...e);
2703
- },
2704
- formattedValue(e) {
2705
- return V(e);
2706
- }
2707
- }
2708
- }, Ks = {
2709
- key: 0,
2710
- class: "flex flex-col h-full pt-[16px] rounded-xl"
2711
- }, Xs = { class: "h-full pt-0 pb-6 space-y-4" }, Gs = { class: "h-full space-y-4 custom-scrollbar" }, Qs = { class: "flex items-center justify-between mr-2 gap-x-2" }, Zs = { class: "grid items-center w-full grid-cols-2 gap-x-2" }, Ys = { class: "text-sm text-gray-800" }, en = {
2712
- class: "flex justify-end",
2713
- role: "progressbar",
2714
- "aria-valuenow": "100",
2715
- "aria-valuemin": "0",
2716
- "aria-valuemax": "100"
2717
- }, tn = { class: "min-w-[60px] text-end" }, rn = { class: "text-sm text-gray-500" };
2718
- function sn(e, t, r, s, n, o) {
2719
- return n.columns ? (x(), _("div", Ks, [
2720
- m("div", Xs, [
2721
- m("ul", Gs, [
2722
- (x(!0), _(F, null, P(e.sourceData, (i, a) => (x(), _("li", Qs, [
2723
- m("div", Zs, [
2724
- m("span", Ys, E(i[n.columns[0]]), 1),
2725
- m("div", en, [
2726
- m("div", {
2727
- class: "h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",
2728
- style: Re({
2729
- width: `${parseFloat(i[n.columns[1]]) / n.maxValue * 100}%`
2730
- })
2731
- }, null, 4)
2732
- ])
2733
- ]),
2734
- m("div", tn, [
2735
- m("span", rn, E(o.formattedValue(i[n.columns[1]])), 1)
2736
- ])
2737
- ]))), 256))
2738
- ])
2739
- ])
2740
- ])) : $("", !0);
2741
- }
2742
- const nn = /* @__PURE__ */ R(Js, [["render", sn]]), on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2743
- __proto__: null,
2744
- default: nn
2745
- }, Symbol.toStringTag, { value: "Module" })), an = {
2746
- name: "VsListbar",
2747
- mixins: [M],
2748
- props: ["source"],
2749
- data() {
2750
- return {
2751
- restDimensions: [],
2752
- maxValue: 0,
2753
- columns: null
2754
- };
2755
- },
2756
- async mounted() {
2757
- await this.getData(), this.prepareData();
2758
- },
2759
- methods: {
2760
- onChangedData() {
2761
- try {
2762
- this.sourceData && this.prepareData();
2763
- } catch (e) {
2764
- console.error(e);
2765
- }
2766
- },
2767
- prepareData() {
2768
- var t, r, s;
2769
- this.columns = Object.keys(((t = this.sourceData) == null ? void 0 : t[0]) || {});
2770
- const e = (r = this.sourceData) == null ? void 0 : r.map((n) => {
2771
- var o;
2772
- return n == null ? void 0 : n[(o = this.columns) == null ? void 0 : o[1]];
2773
- });
2774
- this.maxValue = Math.max(...e || []), this.restDimensions = (s = this.columns) == null ? void 0 : s.filter((n, o) => o !== 0);
2775
- },
2776
- formattedValue(e) {
2777
- return V(e);
2778
- },
2779
- getWidth(e) {
2780
- return `${e / this.maxValue * 100}%`;
2781
- }
2782
- }
2783
- }, ln = { class: "h-full pt-[20px] list-bar" }, cn = { class: "space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]" }, un = { class: "relative w-full truncate" }, dn = { class: "relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800" }, fn = { class: "text-[14px] text-gray-500" };
2784
- function hn(e, t, r, s, n, o) {
2785
- return x(), _("div", ln, [
2786
- m("ul", cn, [
2787
- (x(!0), _(F, null, P(e.sourceData, (i, a) => {
2788
- var f, u, c;
2789
- return x(), _("li", {
2790
- key: a,
2791
- class: "flex items-center justify-between w-full gap-x-2"
2792
- }, [
2793
- m("div", un, [
2794
- m("span", dn, E((i == null ? void 0 : i[(f = n.columns) == null ? void 0 : f[0]]) || "Без категорії"), 1),
2795
- m("div", {
2796
- class: J(["absolute inset-y-0 h-full rounded start-0", i != null && i[(u = n.columns) == null ? void 0 : u[0]] ? "bg-indigo-100" : "bg-gray-100"]),
2797
- style: Re({ width: o.getWidth(i == null ? void 0 : i[(c = n.columns) == null ? void 0 : c[1]]) })
2798
- }, null, 6)
2799
- ]),
2800
- (x(!0), _(F, null, P(n.restDimensions, (h, w) => (x(), _("div", {
2801
- key: w,
2802
- class: "w-20 mr-2 text-end"
2803
- }, [
2804
- m("span", fn, E(o.formattedValue(i == null ? void 0 : i[h])), 1)
2805
- ]))), 128))
2806
- ]);
2807
- }), 128))
2808
- ])
2809
- ]);
2810
- }
2811
- const pn = /* @__PURE__ */ R(an, [["render", hn]]), mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2812
- __proto__: null,
2813
- default: pn
2814
- }, Symbol.toStringTag, { value: "Module" })), _e = {
2815
- week: "Тиждень",
2816
- month: "Місяць",
2817
- quarter: "Квартал",
2818
- year: "Рік"
2819
- }, gn = ["onClick"], bn = { class: "flex items-center justify-between w-full" }, wn = { key: 0 }, yn = {
2820
- __name: "vs-bi-dropdown",
2821
- props: {
2822
- title: String,
2823
- options: [Array, String],
2824
- value: { type: String }
2825
- },
2826
- emits: ["selected"],
2827
- setup(e, { emit: t }) {
2828
- const r = e, s = t, n = be(!1), o = be(r.value || null), i = be(null), a = Le(() => typeof r.options == "string" ? r.options.split(",").map((g, d) => ({ id: d, text: g.trim() })) : r.options), f = Le(() => {
2829
- const g = a.value.find(
2830
- (d) => (d.id || d) === o.value
2831
- );
2832
- return g ? g.text || g : r.title;
2833
- }), u = (g) => {
2834
- o.value = g.id || g, n.value = !1, s("selected", (g == null ? void 0 : g.id) || g), document.removeEventListener("click", c);
2835
- }, c = (g) => {
2836
- i.value && !i.value.contains(g.target) && (n.value = !1, document.removeEventListener("click", c));
2837
- }, h = () => {
2838
- n.value = !n.value, n.value ? setTimeout(() => {
2839
- document.addEventListener("click", c);
2840
- }, 200) : document.removeEventListener("click", c);
2841
- }, w = (g) => (_e == null ? void 0 : _e[g]) || g;
2842
- return vt(() => {
2843
- document.removeEventListener("click", c);
2844
- }), (g, d) => (x(), _(F, null, [
2845
- m("button", {
2846
- type: "button",
2847
- "aria-expanded": "true",
2848
- class: "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",
2849
- onClick: h
2850
- }, [
2851
- Ze(E(w(f.value)) + " ", 1),
2852
- d[0] || (d[0] = m("svg", {
2853
- class: "shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",
2854
- xmlns: "http://www.w3.org/2000/svg",
2855
- width: "16",
2856
- height: "16",
2857
- viewBox: "0 0 24 24",
2858
- fill: "none",
2859
- stroke: "currentColor",
2860
- "stroke-width": "2",
2861
- "stroke-linecap": "round",
2862
- "stroke-linejoin": "round"
2863
- }, [
2864
- m("path", { d: "m6 9 6 6 6-6" })
2865
- ], -1))
2866
- ]),
2867
- n.value ? (x(), _("div", {
2868
- key: 0,
2869
- ref_key: "biDropdown",
2870
- ref: i,
2871
- "data-hs-select-dropdown": "",
2872
- class: "absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",
2873
- role: "listbox",
2874
- tabindex: "-1",
2875
- "aria-orientation": "vertical",
2876
- style: { "margin-top": "10px" }
2877
- }, [
2878
- (x(!0), _(F, null, P(a.value, (p) => (x(), _("div", {
2879
- key: p.id || p,
2880
- class: "cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
2881
- onClick: (b) => u(p)
2882
- }, [
2883
- m("div", bn, [
2884
- m("span", null, E(w(p.text || p)), 1),
2885
- o.value === (p.id || p) ? (x(), _("span", wn, [...d[1] || (d[1] = [
2886
- m("svg", {
2887
- class: "shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",
2888
- xmlns: "http:.w3.org/2000/svg",
2889
- width: "24",
2890
- height: "24",
2891
- viewBox: "0 0 24 24",
2892
- fill: "none",
2893
- stroke: "currentColor",
2894
- "stroke-width": "2",
2895
- "stroke-linecap": "round",
2896
- "stroke-linejoin": "round"
2897
- }, [
2898
- m("polyline", { points: "20 6 9 17 4 12" })
2899
- ], -1)
2900
- ])])) : $("", !0)
2901
- ])
2902
- ], 8, gn))), 128))
2903
- ], 512)) : $("", !0)
2904
- ], 64));
2905
- }
2906
- }, xn = {
2907
- "bi-bar": T(() => Promise.resolve().then(() => ms)),
2908
- "bi-number": T(() => import("./vs-number-Dke5ThxE.js")),
2909
- "bi-text": T(() => import("./vs-text-DAq6rCjJ.js")),
2910
- "bi-listbar": T(() => Promise.resolve().then(() => mn)),
2911
- "bi-pie": T(() => Promise.resolve().then(() => vs)),
2912
- "bi-donut": T(() => Promise.resolve().then(() => xs)),
2913
- "bi-line": T(() => Promise.resolve().then(() => Ts)),
2914
- "bi-stat": T(() => Promise.resolve().then(() => Ws)),
2915
- "bi-pivot": T(() => Promise.resolve().then(() => Po)),
2916
- "bi-progress": T(() => Promise.resolve().then(() => on)),
2917
- "bi-funnel": T(() => import("./vs-funnel-bar-BdVcgrYG.js")),
2918
- "bi-map": T(() => import("./vs-map-BQwf_Vmm.js")),
2919
- "bi-cluster": T(() => import("./vs-map-cluster-Bu0fgucv.js")),
2920
- "bi-table": T(() => import("./vs-table-C95epuWz.js"))
2921
- }, _n = { class: "flex items-center space-x-2" }, Dn = /* @__PURE__ */ Et({
2922
- __name: "vs-bi-switch",
2923
- props: /* @__PURE__ */ Pe({
2924
- leftLabel: {},
2925
- rightLabel: {},
2926
- modelValue: { type: Boolean }
2927
- }, {
2928
- modelValue: {
2929
- default: () => !1,
2930
- type: Boolean
2931
- },
2932
- modelModifiers: {}
2933
- }),
2934
- emits: /* @__PURE__ */ Pe(["update:is-enabled"], ["update:modelValue"]),
2935
- setup(e, { emit: t }) {
2936
- const r = t, s = Ct(e, "modelValue"), n = () => {
2937
- r("update:is-enabled", s);
2938
- };
2939
- return (o, i) => (x(), _("div", _n, [
2940
- o.leftLabel ? (x(), _("div", {
2941
- key: 0,
2942
- class: J(["transition-colors", { "text-blue-500": !s.value }])
2943
- }, E(o.leftLabel), 3)) : $("", !0),
2944
- Rt(m("input", {
2945
- "onUpdate:modelValue": i[0] || (i[0] = (a) => s.value = a),
2946
- type: "checkbox",
2947
- class: "relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",
2948
- onChange: n
2949
- }, null, 544), [
2950
- [Ot, s.value]
2951
- ]),
2952
- o.rightLabel ? (x(), _("div", {
2953
- key: 1,
2954
- class: J(["transition-colors", { "text-blue-500": s.value }])
2955
- }, E(o.rightLabel), 3)) : $("", !0)
2956
- ]));
2957
- }
2958
- }), kn = {}, Sn = { class: "flex items-center justify-center h-full" };
2959
- function vn(e, t) {
2960
- return x(), _("div", Sn, [...t[0] || (t[0] = [
2961
- m("div", { class: "text-center text-gray-500" }, [
2962
- m("h2", { class: "text-2xl font-bold" }, "No data available")
2963
- ], -1)
2964
- ])]);
2965
- }
2966
- const En = /* @__PURE__ */ R(kn, [["render", vn]]), Cn = {}, Rn = {
2967
- xmlns: "http://www.w3.org/2000/svg",
2968
- viewBox: "0 0 24 24",
2969
- fill: "none",
2970
- stroke: "currentColor",
2971
- "stroke-width": "2",
2972
- "stroke-linecap": "round",
2973
- "stroke-linejoin": "round",
2974
- class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
2975
- };
2976
- function On(e, t, r, s, n, o) {
2977
- return x(), _("svg", Rn, [...t[0] || (t[0] = [
2978
- m("path", {
2979
- stroke: "none",
2980
- d: "M0 0h24v24H0z",
2981
- fill: "none"
2982
- }, null, -1),
2983
- m("path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" }, null, -1),
2984
- m("path", { d: "M7 11l5 5l5 -5" }, null, -1),
2985
- m("path", { d: "M12 4l0 12" }, null, -1)
2986
- ])]);
2987
- }
2988
- const Tn = /* @__PURE__ */ R(Cn, [["render", On]]), $n = {
2989
- components: {
2990
- VsBiDropdown: yn,
2991
- VsBiSwitch: Dn,
2992
- VsNoDataChart: En,
2993
- IconDownload: Tn,
2994
- ...xn
2995
- },
2996
- props: {
2997
- dashboard: { type: String },
2998
- prefix: { type: String, default: "" },
2999
- widget: { type: String },
3000
- filterURl: { type: String },
3001
- dashboardWidgets: { type: Object },
3002
- selectedWidget: { type: String }
3003
- },
3004
- data() {
3005
- return {
3006
- checked: [],
3007
- selected: [],
3008
- currentWidget: null,
3009
- widgetData: []
3010
- };
3011
- },
3012
- computed: {
3013
- computedTitle() {
3014
- var t, r;
3015
- const e = (t = this.dashboardWidgets) == null ? void 0 : t.find(
3016
- (s) => s.name === this.widget
3017
- );
3018
- return ((r = e == null ? void 0 : e.data) == null ? void 0 : r.title) || (e == null ? void 0 : e.title) || "";
3019
- },
3020
- computedType() {
3021
- var t;
3022
- const e = (t = this.dashboardWidgets) == null ? void 0 : t.find(
3023
- (r) => r.name === this.widget
3024
- );
3025
- return (e == null ? void 0 : e.type) || "text";
3026
- },
3027
- controls() {
3028
- var t;
3029
- return Object.keys(((t = this.widgetData) == null ? void 0 : t.controls) || {}).map(
3030
- (r) => {
3031
- var s, n, o;
3032
- return {
3033
- name: r,
3034
- options: typeof ((s = this.widgetData) == null ? void 0 : s.controls) == "boolean" ? !1 : (o = (n = this.widgetData) == null ? void 0 : n.controls) == null ? void 0 : o[r]
3035
- };
3036
- }
3037
- );
3038
- }
3039
- },
3040
- mounted() {
3041
- this.prefix && (v.defaults.baseURL = this.prefix);
3042
- },
3043
- watch: {
3044
- filterURl(e) {
3045
- var t, r;
3046
- (r = (t = this.$refs) == null ? void 0 : t.chart) == null || r.setFilter(e);
3047
- },
3048
- selectedWidget(e, t) {
3049
- var r;
3050
- e !== t && e === ((r = this.widgetData) == null ? void 0 : r.id) && this.$emit("update:current-widget-data", this.widgetData);
3051
- },
3052
- widgetData(e, t) {
3053
- if ((e == null ? void 0 : e.id) === (t == null ? void 0 : t.id)) return;
3054
- const s = new URLSearchParams(window.top.location.search).get("widget");
3055
- s && s === (e == null ? void 0 : e.id) && this.$emit("update:current-widget-data", e);
3056
- }
3057
- },
3058
- methods: {
3059
- changeStyleHandler(e, t) {
3060
- var r;
3061
- (r = this.$refs.chart) == null || r.changeStyle(e, t);
3062
- },
3063
- selectedOptionHandler(e, t) {
3064
- let r = !0;
3065
- this.selected.forEach((s) => {
3066
- s.name === t && (s.option = e, r = !1);
3067
- }), r && this.selected.push({ name: t, option: e }), this.makeUpUrl();
3068
- },
3069
- makeUpUrl() {
3070
- var t;
3071
- let e = `/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`;
3072
- this.selected.forEach((r, s) => {
3073
- e += `&${r.name}=${r.option}`;
3074
- }), (t = this.$refs.chart) == null || t.getDataFromURL(e);
3075
- },
3076
- exportChart() {
3077
- if (this.currentWidget) {
3078
- const e = this.currentWidget.getDataURL({
3079
- type: "png",
3080
- pixelRatio: 2,
3081
- backgroundColor: "#ffffff"
3082
- }), t = document.createElement("a");
3083
- t.href = e, t.download = "chart.png", document.body.appendChild(t), t.click(), document.body.removeChild(t);
3084
- }
3085
- }
3086
- }
3087
- }, Nn = {
3088
- key: 0,
3089
- class: "text-[16px] flex max-w-full items-center min-h-0 flex justify-between max-h-[50px] h-fit shrink-0"
3090
- }, An = { class: "flex items-center justify-between w-full" }, Fn = { class: "grid" }, Ln = { class: "text-gray-800 max-h-[30px] inline-block text-nowrap font-semibold" }, Pn = { class: "flex flex-col justify-end" }, Bn = {
3091
- key: 0,
3092
- class: "flex items-center justify-end w-full gap-2"
3093
- }, Un = { class: "w-full h-full" };
3094
- function jn(e, t, r, s, n, o) {
3095
- var c, h, w, g, d, p, b, S, k;
3096
- const i = j("VsBiDropdown"), a = j("VsBiSwitch"), f = j("IconDownload"), u = j("VsNoDataChart");
3097
- return x(), _("div", {
3098
- ref: "widget",
3099
- class: J(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl", [
3100
- (h = (c = n.widgetData) == null ? void 0 : c.style) != null && h.height ? `max-h-[${(g = (w = n.widgetData) == null ? void 0 : w.style) == null ? void 0 : g.height}px] h-[${(p = (d = n.widgetData) == null ? void 0 : d.style) == null ? void 0 : p.height}px]` : "max-h-[460px]"
3101
- ]])
3102
- }, [
3103
- ["text", "cluster", "map"].includes(o.computedType) ? $("", !0) : (x(), _("div", Nn, [
3104
- m("div", An, [
3105
- m("div", Fn, [
3106
- m("span", Ln, E(o.computedTitle), 1)
3107
- ]),
3108
- m("div", Pn, [
3109
- (b = o.controls) != null && b.length ? (x(), _("span", Bn, [
3110
- (x(!0), _(F, null, P((S = o.controls) == null ? void 0 : S.filter(
3111
- (y) => (y == null ? void 0 : y.options) && (y == null ? void 0 : y.name) !== "export"
3112
- ), (y) => {
3113
- var L;
3114
- return x(), _("div", null, [
3115
- Array.isArray(y == null ? void 0 : y.options) ? (x(), I(i, {
3116
- key: 0,
3117
- title: y == null ? void 0 : y.name,
3118
- options: y == null ? void 0 : y.options,
3119
- value: (L = n.widgetData) == null ? void 0 : L.data[y == null ? void 0 : y.name],
3120
- onSelected: (C) => o.selectedOptionHandler(C, y == null ? void 0 : y.name)
3121
- }, null, 8, ["title", "options", "value", "onSelected"])) : typeof y.options == "boolean" ? (x(), I(a, {
3122
- key: 1,
3123
- "left-label": y == null ? void 0 : y.name,
3124
- "is-enabled": y == null ? void 0 : y.options,
3125
- "onUpdate:isEnabled": (C) => o.changeStyleHandler(y == null ? void 0 : y.name, C)
3126
- }, null, 8, ["left-label", "is-enabled", "onUpdate:isEnabled"])) : $("", !0)
3127
- ]);
3128
- }), 256)),
3129
- (k = o.controls) != null && k.some((y) => (y == null ? void 0 : y.name) === "export") ? (x(), _("button", {
3130
- key: 0,
3131
- onClick: t[0] || (t[0] = (...y) => o.exportChart && o.exportChart(...y)),
3132
- class: "h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center"
3133
- }, [
3134
- Oe(f, {
3135
- height: "16",
3136
- width: "16",
3137
- class: "text-gray-800"
3138
- })
3139
- ])) : $("", !0)
3140
- ])) : $("", !0)
3141
- ])
3142
- ])
3143
- ])),
3144
- m("div", Un, [
3145
- n.widgetData ? (x(), I(Tt("bi-" + o.computedType), {
3146
- key: 0,
3147
- currentWidget: n.currentWidget,
3148
- "onUpdate:currentWidget": t[1] || (t[1] = (y) => n.currentWidget = y),
3149
- widgetData: n.widgetData,
3150
- "onUpdate:widgetData": t[2] || (t[2] = (y) => n.widgetData = y),
3151
- ref: "chart",
3152
- dashboard: r.dashboard,
3153
- title: o.computedTitle,
3154
- widget: r.widget
3155
- }, null, 40, ["currentWidget", "widgetData", "dashboard", "title", "widget"])) : (x(), I(u, {
3156
- key: 1,
3157
- class: "w-full h-full"
3158
- }))
3159
- ])
3160
- ], 2);
3161
- }
3162
- const Vn = /* @__PURE__ */ R($n, [["render", jn]]), In = {
3163
- props: {
3164
- title: { type: String, default: () => "Дані для відображення відсутні" },
3165
- text: {
3166
- type: String,
3167
- default: () => "Змініть параметри пошуку або спробуйте пізніше"
3168
- }
3169
- }
3170
- }, zn = { class: "w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit" }, Mn = { class: "p-5 min-h-[500px] flex flex-col justify-center items-center text-center" }, qn = { class: "max-w-sm mx-auto mt-6" }, Hn = { class: "font-medium text-gray-800 dark:text-neutral-200" }, Wn = { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" };
3171
- function Jn(e, t, r, s, n, o) {
3172
- return x(), _("div", zn, [
3173
- m("div", null, [
3174
- m("div", Mn, [
3175
- t[0] || (t[0] = Ye('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>', 1)),
3176
- m("div", qn, [
3177
- m("p", Hn, E(r.title), 1),
3178
- m("p", Wn, E(r.text), 1)
3179
- ])
3180
- ])
3181
- ])
3182
- ]);
3183
- }
3184
- const Kn = /* @__PURE__ */ R(In, [["render", Jn]]), Xn = {}, Gn = {
3185
- class: "flex-shrink-0 size-3.5",
3186
- xmlns: "http://www.w3.org/2000/svg",
3187
- width: "22",
3188
- height: "22",
3189
- viewBox: "0 0 24 24",
3190
- fill: "none",
3191
- stroke: "currentColor",
3192
- "stroke-width": "2",
3193
- "stroke-linecap": "round",
3194
- "stroke-linejoin": "round"
3195
- };
3196
- function Qn(e, t) {
3197
- return x(), _("svg", Gn, [...t[0] || (t[0] = [
3198
- Ye('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>', 9)
3199
- ])]);
3200
- }
3201
- const Zn = /* @__PURE__ */ R(Xn, [["render", Qn]]), Yn = {}, eo = {
3202
- xmlns: "http://www.w3.org/2000/svg",
3203
- viewBox: "0 0 24 24",
3204
- fill: "none",
3205
- stroke: "currentColor",
3206
- "stroke-width": "1",
3207
- "stroke-linecap": "round",
3208
- "stroke-linejoin": "round",
3209
- class: "icon icon-tabler icons-tabler-outline icon-tabler-refresh"
3210
- };
3211
- function to(e, t) {
3212
- return x(), _("svg", eo, [...t[0] || (t[0] = [
3213
- m("path", {
3214
- stroke: "none",
3215
- d: "M0 0h24v24H0z",
3216
- fill: "none"
3217
- }, null, -1),
3218
- m("path", { d: "M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" }, null, -1),
3219
- m("path", { d: "M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" }, null, -1)
3220
- ])]);
3221
- }
3222
- const ro = /* @__PURE__ */ R(Yn, [["render", to]]), so = {
3223
- components: { filterIcon: Zn, refreshIcon: ro },
3224
- props: ["filterScheme"],
3225
- emits: ["filters:changed"],
3226
- data() {
3227
- return {
3228
- rows: [],
3229
- isFilterVisible: !1,
3230
- rowList: [],
3231
- activeFilters: "",
3232
- filters: {}
3233
- };
3234
- },
3235
- async mounted() {
3236
- const t = await (await new URLSearchParams(window.top.location.search)).get("filter");
3237
- this.filters.url = t || "";
3238
- },
3239
- computed: {
3240
- activeFiltersCount() {
3241
- var e, t;
3242
- return (e = this.filters) != null && e.url ? ((t = this.filters) == null ? void 0 : t.url.split("=").length) - 1 : 0;
3243
- }
3244
- },
3245
- methods: {
3246
- toggleFilterShown() {
3247
- this.isFilterVisible = !this.isFilterVisible;
3248
- },
3249
- handleFilterChange(e) {
3250
- var t, r;
3251
- this.filters = e, this.activeFilters = (r = (t = this.$refs) == null ? void 0 : t.filter) == null ? void 0 : r.activeFilters, this.$emit("filters:changed", this.filters);
3252
- },
3253
- resetFilters() {
3254
- this.$refs.filter && this.$refs.filter.clearAll(), this.isFilterVisible = !1, this.$emit("filters:changed", ""), this.activeFilters = null;
3255
- },
3256
- closeFilter({ target: e }) {
3257
- this.isFilterVisible && e.classList.contains("filter-container") && (this.isFilterVisible = !1);
3258
- }
3259
- }
3260
- }, no = { class: "flex items-center" }, oo = {
3261
- key: 0,
3262
- class: "font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"
3263
- };
3264
- function io(e, t, r, s, n, o) {
3265
- const i = j("filterIcon"), a = j("VsFilterList");
3266
- return x(), _("div", no, [
3267
- r.filterScheme ? (x(), I(a, {
3268
- key: 0,
3269
- ref: "filter",
3270
- scheme: r.filterScheme,
3271
- closeFilterBtn: !0,
3272
- onFilterClose: t[1] || (t[1] = (f) => n.isFilterVisible = !1),
3273
- layout: "default",
3274
- "apply-vue-router": "",
3275
- history: "",
3276
- view: "plain",
3277
- token: e.table,
3278
- name: "filter",
3279
- footer: !0,
3280
- background: !0,
3281
- onFilterChange: o.handleFilterChange
3282
- }, {
3283
- button: $t(() => [
3284
- m("button", {
3285
- type: "button",
3286
- class: "py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",
3287
- onClick: t[0] || (t[0] = (...f) => o.toggleFilterShown && o.toggleFilterShown(...f))
3288
- }, [
3289
- Oe(i),
3290
- t[2] || (t[2] = Ze(" Фільтри ", -1)),
3291
- o.activeFiltersCount >= 1 ? (x(), _("span", oo, E(o.activeFiltersCount), 1)) : $("", !0)
3292
- ])
3293
- ]),
3294
- _: 1
3295
- }, 8, ["scheme", "token", "onFilterChange"])) : $("", !0)
3296
- ]);
3297
- }
3298
- const ao = /* @__PURE__ */ R(so, [["render", io]]), lo = {
3299
- props: ["dashboardData", "filters"],
3300
- components: { VsFilterHeader: ao }
3301
- }, co = { class: "bg-white px-5 flex gap-4 h-[90px] border border-gray-200 mt-2 rounded-xl mb-2 pt-[3px] justify-between items-center" }, uo = { class: "grow" }, fo = { class: "text-lg font-semibold text-stone-800 dark:text-neutral-200" }, ho = {
3302
- type: "button",
3303
- class: "inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400",
3304
- "data-clipboard-target": "#hs-erc",
3305
- "data-clipboard-action": "copy",
3306
- "data-clipboard-success-text": "Copied"
3307
- };
3308
- function po(e, t, r, s, n, o) {
3309
- var a, f;
3310
- const i = j("VsFilterHeader");
3311
- return x(), _("div", co, [
3312
- m("div", uo, [
3313
- m("h1", fo, E((a = r.dashboardData) == null ? void 0 : a.title), 1),
3314
- m("button", ho, E((f = r.dashboardData) == null ? void 0 : f.description), 1)
3315
- ]),
3316
- Oe(i, {
3317
- filterScheme: r.filters,
3318
- "onFilters:changed": t[0] || (t[0] = (u) => e.$emit("filters:changed", u))
3319
- }, null, 8, ["filterScheme"])
3320
- ]);
3321
- }
3322
- const mo = /* @__PURE__ */ R(lo, [["render", po]]), go = {
3323
- components: { VsWidget: Vn, VsNewNodata: Kn, VsHeader: mo },
3324
- props: ["id", "prefix"],
3325
- data() {
3326
- return {
3327
- widgets: [],
3328
- panels: [],
3329
- error: !1,
3330
- selectedPanel: "",
3331
- filterURl: null,
3332
- dashboardData: null
3333
- };
3334
- },
3335
- async mounted() {
3336
- v.defaults.baseURL = this.prefix || "/api", await this.fetchData();
3337
- },
3338
- methods: {
3339
- async fetchData() {
3340
- if (this.id)
3341
- try {
3342
- const { data: e } = await v.get(`/bi-dashboard/${this.id}`);
3343
- this.dashboardData = e;
3344
- } catch (e) {
3345
- console.error(e);
3346
- }
3347
- },
3348
- columnClass(e) {
3349
- const t = e != null && e.col ? e == null ? void 0 : e.col : 12;
3350
- return {
3351
- 1: "md:w-1/12 sm:w-full",
3352
- 2: "md:w-1/6 sm:w-full",
3353
- 3: "md:w-1/4 sm:w-full",
3354
- 4: "md:w-1/3 sm:w-full",
3355
- 6: "md:w-1/2 sm:w-full",
3356
- 8: "md:w-2/3 sm:w-full",
3357
- 10: "md:w-5/6 sm:w-full",
3358
- 12: "w-full"
3359
- }[t] || "w-full";
3360
- },
3361
- async filterHandler(e) {
3362
- var r;
3363
- this.filterURl = "";
3364
- let t = "&filter=";
3365
- (r = e == null ? void 0 : e.url) != null && r.length && (e.url.split("|").forEach((n) => {
3366
- const o = n.split("=");
3367
- t += `${o[0]}=${o[1]}`;
3368
- }), this.filterURl += t);
3369
- }
3370
- }
3371
- }, bo = { class: "w-full pb-8 overflow-y-auto" }, wo = { class: "grid flex-grow w-full grid-cols-12 gap-4 h-fit" };
3372
- function yo(e, t, r, s, n, o) {
3373
- var u, c, h;
3374
- const i = j("VsHeader"), a = j("VsNewNodata"), f = j("VsWidget");
3375
- return x(), _("div", bo, [
3376
- m("div", null, [
3377
- (u = n.dashboardData) != null && u.filters ? (x(), I(i, {
3378
- key: 0,
3379
- filters: (c = n.dashboardData) == null ? void 0 : c.filters,
3380
- dashboardData: n.dashboardData,
3381
- "onFilters:changed": t[0] || (t[0] = (w) => o.filterHandler(w))
3382
- }, null, 8, ["filters", "dashboardData"])) : $("", !0)
3383
- ]),
3384
- m("div", wo, [
3385
- n.error || !n.dashboardData ? (x(), I(a, {
3386
- key: 0,
3387
- class: "col-span-12"
3388
- })) : $("", !0),
3389
- (x(!0), _(F, null, P(((h = n.dashboardData) == null ? void 0 : h.panels) || [], (w, g) => {
3390
- var d;
3391
- return x(), _("div", {
3392
- key: g,
3393
- class: J([`col-span-${w.col || 12}`, "flex flex-col gap-[10px]"])
3394
- }, [
3395
- (d = w.widgets) != null && d.length ? (x(!0), _(F, { key: 0 }, P(w.widgets, (p) => (x(), I(f, {
3396
- key: p,
3397
- dashboard: r.id,
3398
- widget: p,
3399
- "dashboard-widgets": n.dashboardData.widgets,
3400
- "filter-u-rl": n.filterURl
3401
- }, null, 8, ["dashboard", "widget", "dashboard-widgets", "filter-u-rl"]))), 128)) : (x(), I(f, {
3402
- key: 1,
3403
- class: "flex flex-col",
3404
- dashboard: r.id,
3405
- widget: w.widget,
3406
- "dashboard-widgets": n.dashboardData.widgets,
3407
- "filter-u-rl": n.filterURl
3408
- }, null, 8, ["dashboard", "widget", "dashboard-widgets", "filter-u-rl"]))
3409
- ], 2);
3410
- }), 128))
3411
- ])
3412
- ]);
3413
- }
3414
- const si = /* @__PURE__ */ R(go, [["render", yo]]), xo = {
3415
- name: "VsPivotTable",
3416
- mixins: [M],
3417
- data() {
3418
- return {
3419
- values: null,
3420
- xs: null,
3421
- products: null
3422
- };
3423
- },
3424
- async mounted() {
3425
- await this.getData(), this.prepareData();
3426
- },
3427
- methods: {
3428
- onChangedData() {
3429
- try {
3430
- this.sourceData && this.prepareData();
3431
- } catch {
3432
- }
3433
- },
3434
- prepareData() {
3435
- try {
3436
- const e = Array.from(
3437
- new Set(this.sourceData.map((t) => t[this.dimensions[0]]))
3438
- );
3439
- this.dimensions[0].includes("date") ? this.xs = e.map((t) => Te(t)) : this.xs = [...e], this.products = this.dimensions.filter((t, r) => r != 0), this.values = this.products.map((t, r) => ({
3440
- name: t,
3441
- data: this.sourceData.filter((s) => parseFloat(s[t])).map((s) => V(parseFloat(s[t])))
3442
- }));
3443
- } catch (e) {
3444
- console.error(e);
3445
- }
3446
- }
3447
- }
3448
- }, _o = { class: "flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar" }, Do = { class: "overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar" }, ko = { class: "inline-block min-w-full align-middle" }, So = { class: "min-w-full divide-y divide-gray-200" }, vo = { class: "space-x-2" }, Eo = {
3449
- scope: "col",
3450
- class: "xl:min-w-[120px] min-w-48"
3451
- }, Co = { class: "py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500" }, Ro = { class: "divide-y divide-gray-200 text-[12px]" }, Oo = { class: "py-3 size-px whitespace-nowrap" }, To = { class: "flex items-center gap-x-3" }, $o = { class: "font-medium text-gray-800" }, No = { class: "py-3 size-px whitespace-nowrap" }, Ao = { class: "text-gray-600" };
3452
- function Fo(e, t, r, s, n, o) {
3453
- return x(), _("div", _o, [
3454
- m("div", Do, [
3455
- m("div", ko, [
3456
- m("table", So, [
3457
- m("thead", null, [
3458
- m("tr", vo, [
3459
- t[0] || (t[0] = m("th", {
3460
- scope: "col",
3461
- class: "min-w-[200px]"
3462
- }, [
3463
- m("div", { class: "py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500" })
3464
- ], -1)),
3465
- (x(!0), _(F, null, P(n.xs, (i) => (x(), _("th", Eo, [
3466
- m("div", Co, E(i), 1)
3467
- ]))), 256))
3468
- ])
3469
- ]),
3470
- (x(!0), _(F, null, P(n.values, (i) => (x(), _("tbody", Ro, [
3471
- m("tr", null, [
3472
- m("td", Oo, [
3473
- m("div", To, [
3474
- m("span", $o, E(i.name), 1)
3475
- ])
3476
- ]),
3477
- (x(!0), _(F, null, P(n.xs, (a, f) => (x(), _("td", No, [
3478
- m("span", Ao, E(i.data[f]), 1)
3479
- ]))), 256))
3480
- ])
3481
- ]))), 256))
3482
- ])
3483
- ])
3484
- ])
3485
- ]);
3486
- }
3487
- const Lo = /* @__PURE__ */ R(xo, [["render", Fo]]), Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3488
- __proto__: null,
3489
- default: Lo
3490
- }, Symbol.toStringTag, { value: "Module" }));
3491
- export {
3492
- ps as V,
3493
- R as _,
3494
- Y as a,
3495
- Te as b,
3496
- M as c,
3497
- V as d,
3498
- v as e,
3499
- Uo as f,
3500
- Ss as g,
3501
- Os as h,
3502
- Hs as i,
3503
- nn as j,
3504
- pn as k,
3505
- Lo as l,
3506
- si as m,
3507
- Vn as n,
3508
- ys as v
3509
- };