@luyinghao159/datav-vue3
Version:
Datav for vue3+vite
1,341 lines • 408 kB
JavaScript
import './style.css';
import { createElementBlock as se, openBlock as le, createElementVNode as ae, createStaticVNode as Tt, defineComponent as Le, useCssVars as pt, unref as i, computed as be, createBlock as ja, resolveDynamicComponent as Ea, renderSlot as Me, getCurrentScope as za, onScopeDispose as qa, watch as ke, ref as me, onMounted as De, onUnmounted as Ft, onActivated as Ia, onDeactivated as Ha, nextTick as Bt, reactive as Pe, Fragment as Ae, renderList as Oe, createCommentVNode as $e, toDisplayString as We, onBeforeUnmount as Va, normalizeStyle as Se, getCurrentInstance as Ca, createVNode as Z, normalizeClass as Ua, toRef as Ee, h as Xa } from "vue";
var $a = /* @__PURE__ */ ((e) => (e.transparent = "rgba(0,0,0,0)", e.black = "#000000", e.silver = "#C0C0C0", e.gray = "#808080", e.white = "#FFFFFF", e.maroon = "#800000", e.red = "#FF0000", e.purple = "#800080", e.fuchsia = "#FF00FF", e.green = "#008000", e.lime = "#00FF00", e.olive = "#808000", e.yellow = "#FFFF00", e.navy = "#000080", e.blue = "#0000FF", e.teal = "#008080", e.aqua = "#00FFFF", e.aliceblue = "#f0f8ff", e.antiquewhite = "#faebd7", e.aquamarine = "#7fffd4", e.azure = "#f0ffff", e.beige = "#f5f5dc", e.bisque = "#ffe4c4", e.blanchedalmond = "#ffebcd", e.blueviolet = "#8a2be2", e.brown = "#a52a2a", e.burlywood = "#deb887", e.cadetblue = "#5f9ea0", e.chartreuse = "#7fff00", e.chocolate = "#d2691e", e.coral = "#ff7f50", e.cornflowerblue = "#6495ed", e.cornsilk = "#fff8dc", e.crimson = "#dc143c", e.cyan = "#00ffff", e.darkblue = "#00008b", e.darkcyan = "#008b8b", e.darkgoldenrod = "#b8860b", e.darkgray = "#a9a9a9", e.darkgreen = "#006400", e.darkgrey = "#a9a9a9", e.darkkhaki = "#bdb76b", e.darkmagenta = "#8b008b", e.darkolivegreen = "#556b2f", e.darkorange = "#ff8c00", e.darkorchid = "#9932cc", e.darkred = "#8b0000", e.darksalmon = "#e9967a", e.darkseagreen = "#8fbc8f", e.darkslateblue = "#483d8b", e.darkslategray = "#2f4f4f", e.darkslategrey = "#2f4f4f", e.darkturquoise = "#00ced1", e.darkviolet = "#9400d3", e.deeppink = "#ff1493", e.deepskyblue = "#00bfff", e.dimgray = "#696969", e.dimgrey = "#696969", e.dodgerblue = "#1e90ff", e.firebrick = "#b22222", e.floralwhite = "#fffaf0", e.forestgreen = "#228b22", e.gainsboro = "#dcdcdc", e.ghostwhite = "#f8f8ff", e.gold = "#ffd700", e.goldenrod = "#daa520", e.greenyellow = "#adff2f", e.grey = "#808080", e.honeydew = "#f0fff0", e.hotpink = "#ff69b4", e.indianred = "#cd5c5c", e.indigo = "#4b0082", e.ivory = "#fffff0", e.khaki = "#f0e68c", e.lavender = "#e6e6fa", e.lavenderblush = "#fff0f5", e.lawngreen = "#7cfc00", e.lemonchiffon = "#fffacd", e.lightblue = "#add8e6", e.lightcoral = "#f08080", e.lightcyan = "#e0ffff", e.lightgoldenrodyellow = "#fafad2", e.lightgray = "#d3d3d3", e.lightgreen = "#90ee90", e.lightgrey = "#d3d3d3", e.lightpink = "#ffb6c1", e.lightsalmon = "#ffa07a", e.lightseagreen = "#20b2aa", e.lightskyblue = "#87cefa", e.lightslategray = "#778899", e.lightslategrey = "#778899", e.lightsteelblue = "#b0c4de", e.lightyellow = "#ffffe0", e.limegreen = "#32cd32", e.linen = "#faf0e6", e.magenta = "#ff00ff", e.mediumaquamarine = "#66cdaa", e.mediumblue = "#0000cd", e.mediumorchid = "#ba55d3", e.mediumpurple = "#9370db", e.mediumseagreen = "#3cb371", e.mediumslateblue = "#7b68ee", e.mediumspringgreen = "#00fa9a", e.mediumturquoise = "#48d1cc", e.mediumvioletred = "#c71585", e.midnightblue = "#191970", e.mintcream = "#f5fffa", e.mistyrose = "#ffe4e1", e.moccasin = "#ffe4b5", e.navajowhite = "#ffdead", e.oldlace = "#fdf5e6", e.olivedrab = "#6b8e23", e.orange = "#ffa500", e.orangered = "#ff4500", e.orchid = "#da70d6", e.palegoldenrod = "#eee8aa", e.palegreen = "#98fb98", e.paleturquoise = "#afeeee", e.palevioletred = "#db7093", e.papayawhip = "#ffefd5", e.peachpuff = "#ffdab9", e.peru = "#cd853f", e.pink = "#ffc0cb", e.plum = "#dda0dd", e.powderblue = "#b0e0e6", e.rosybrown = "#bc8f8f", e.royalblue = "#4169e1", e.saddlebrown = "#8b4513", e.salmon = "#fa8072", e.sandybrown = "#f4a460", e.seagreen = "#2e8b57", e.seashell = "#fff5ee", e.sienna = "#a0522d", e.skyblue = "#87ceeb", e.slateblue = "#6a5acd", e.slategray = "#708090", e.snow = "#fffafa", e.springgreen = "#00ff7f", e.steelblue = "#4682b4", e.tan = "#d2b48c", e.thistle = "#d8bfd8", e.tomato = "#ff6347", e.turquoise = "#40e0d0", e.violet = "#ee82ee", e.wheat = "#f5deb3", e.whitesmoke = "#f5f5f5", e.yellowgreen = "#9acd32", e))($a || {});
function Nt(e) {
return typeof e != "string" ? !1 : (e = e.toLowerCase(), /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e));
}
function Qa(e) {
return typeof e != "string" ? !1 : (e = e.toLowerCase(), /^(rgb\(|RGB\()/.test(e));
}
function _a(e) {
return typeof e != "string" ? !1 : (e = e.toLowerCase(), /^(rgba|RGBA)/.test(e));
}
function Pa(e) {
return /^(rgb|rgba|RGB|RGBA)/.test(e);
}
function Ya(e) {
return $a[e];
}
function wa(e) {
if (Nt(e) || Pa(e))
return e;
const r = Ya(e);
if (!r)
throw new Error(`Color: Invalid Input of ${e}`);
return r;
}
function Ka(e) {
e = e.replace("#", ""), e.length === 3 && (e = Array.from(e).map((a) => a + a).join(""));
const r = e.split("");
return new Array(3).fill(0).map((a, t) => parseInt(`0x${r[t * 2]}${r[t * 2 + 1]}`));
}
function Ja(e) {
return e.replace(/rgb\(|rgba\(|\)/g, "").split(",").slice(0, 3).map((r) => parseInt(r));
}
function gt(e) {
const r = wa(e).toLowerCase();
return Nt(r) ? Ka(r) : Ja(r);
}
function ka(e) {
const r = wa(e);
return _a(r) ? Number(
r.toLowerCase().split(",").slice(-1)[0].replace(/[)|\s]/g, "")
) : 1;
}
function un(e) {
const r = gt(e);
return r && [...r, ka(e)];
}
function Za(e, r) {
const a = gt(e);
return typeof r == "number" ? `rgba(${a.join(",")},${r})` : `rgb(${a.join(",")})`;
}
function ei(e) {
if (Nt(e))
return e;
const r = gt(e), a = (t) => Number(t).toString(16).padStart(2, "0");
return `#${r.map(a).join("")}`;
}
function Wt(e) {
if (!Array.isArray(e))
throw new Error(`getColorFromRgbValue: ${e} is not an array`);
const { length: r } = e;
if (r !== 3 && r !== 4)
throw new Error("getColorFromRgbValue: value length should be 3 or 4");
return (r === 3 ? "rgb(" : "rgba(") + e.join(",") + ")";
}
function ti(e, r = 0) {
let a = un(e);
return a = a.map((t, n) => n === 3 ? t : t - Math.ceil(2.55 * r)).map((t) => t < 0 ? 0 : t), Wt(a);
}
function ln(e, r = 0) {
let a = un(e);
return a = a.map((t, n) => n === 3 ? t : t + Math.ceil(2.55 * r)).map((t) => t > 255 ? 255 : t), Wt(a);
}
function Re(e, r = 100) {
const a = gt(e);
return Wt([...a, r / 100]);
}
const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
darken: ti,
fade: Re,
getColorFromRgbValue: Wt,
getOpacity: ka,
getRgbValue: gt,
getRgbaValue: un,
isHex: Nt,
isRgb: Qa,
isRgbOrRgba: Pa,
isRgba: _a,
lighten: ln,
toHex: ei,
toRgb: Za
}, Symbol.toStringTag, { value: "Module" })), Ke = (e, r) => {
const a = e.__vccOpts || e;
for (const [t, n] of r)
a[t] = n;
return a;
}, ni = {}, ai = {
viewBox: "0 0 187 38",
preserveAspectRatio: "none",
class: "dv-button-svg"
};
function ii(e, r) {
return le(), se("svg", ai, r[0] || (r[0] = [
ae("g", { style: { transform: "translate(2px, 2px)" } }, [
ae("g", null, [
ae("path", {
"data-type": "shape",
d: "M0,0 L0,34 L168,34 L183,19 L183,0",
class: "dv-button-svg-bg"
})
]),
ae("path", {
"data-type": "polyline",
d: "M0,34 L168,34 L183,19",
class: "dv-button-svg-line"
})
], -1)
]));
}
const oi = /* @__PURE__ */ Ke(ni, [["render", ii]]), li = {}, si = {
viewBox: "0 0 167 38",
preserveAspectRatio: "none",
class: "dv-button-svg"
};
function ui(e, r) {
return le(), se("svg", si, r[0] || (r[0] = [
Tt('<g style="transform:translate(2px, 2px);"><g><path data-type="shape" d="M0,0 L0,34 L163,34 L163,0" class="dv-button-svg-bg"></path></g><path data-type="polyline" d="M0,0 L164.1,0" class="dv-button-svg-line"></path><path data-type="polyline" d="M163,0 L163,34" class="dv-button-svg-line"></path><path data-type="polyline" d="M164.1,34 L0,34" class="dv-button-svg-line"></path><path data-type="polyline" d="M1.1,34 L1.1,0" class="dv-button-svg-line"></path></g>', 1)
]));
}
const ci = /* @__PURE__ */ Ke(li, [["render", ui]]), fi = {}, di = {
viewBox: "0 0 167 38",
preserveAspectRatio: "none",
class: "dv-button-svg"
};
function vi(e, r) {
return le(), se("svg", di, r[0] || (r[0] = [
Tt('<g style="transform:translate(2px, 2px);"><g><path data-type="shape" d="M1,1 L1,33 L162,33 L162,1" class="dv-button-svg-bg"></path></g><path data-type="polyline" d="M0,0 L0,10" class="dv-button-svg-line"></path><path data-type="polyline" d="M-1.1,0 L10,0" class="dv-button-svg-line"></path><path data-type="polyline" d="M164.1,0 L153,0" class="dv-button-svg-line"></path><path data-type="polyline" d="M163,0 L163,10" class="dv-button-svg-line"></path><path data-type="polyline" d="M164.1,34 L153,34" class="dv-button-svg-line"></path><path data-type="polyline" d="M163,34 L163,24" class="dv-button-svg-line"></path><path data-type="polyline" d="M0,34 L0,24" class="dv-button-svg-line"></path><path data-type="polyline" d="M-1.1,34 L10,34" class="dv-button-svg-line"></path></g>', 1)
]));
}
const hi = /* @__PURE__ */ Ke(fi, [["render", vi]]), pi = {}, gi = {
viewBox: "0 0 187 38",
preserveAspectRatio: "none",
class: "dv-button-svg"
};
function mi(e, r) {
return le(), se("svg", gi, r[0] || (r[0] = [
ae("g", { style: { transform: "translate(2px, 2px)" } }, [
ae("g", null, [
ae("path", {
"data-type": "shape",
d: "M0,34 L168,34 L183,19 L183,0 L0,0",
class: "dv-button-svg-bg"
})
]),
ae("path", {
"data-type": "polyline",
d: "M0,34 L168,34 L183,19 L183,0",
class: "dv-button-svg-line"
}),
ae("path", {
"data-type": "polyline",
d: "M184.1,0 L0,0 L0,34.7",
class: "dv-button-svg-line"
})
], -1)
]));
}
const yi = /* @__PURE__ */ Ke(pi, [["render", mi]]), bi = {}, xi = {
viewBox: "0 0 187 38",
preserveAspectRatio: "none",
class: "dv-button-svg"
};
function Ci(e, r) {
return le(), se("svg", xi, r[0] || (r[0] = [
ae("g", { style: { transform: "translate(2px, 2px)" } }, [
ae("g", null, [
ae("path", {
"data-type": "shape",
d: "M0,34 L168,34 L183,19 L183,0 L15,0 L0,15",
class: "dv-button-svg-bg"
})
]),
ae("path", {
"data-type": "polyline",
d: "M0,34 L168,34 L183,19 L183,0",
class: "dv-button-svg-line"
}),
ae("path", {
"data-type": "polyline",
d: "M183,0 L15,0 L0,15 L0,34",
class: "dv-button-svg-line"
})
], -1)
]));
}
const $i = /* @__PURE__ */ Ke(bi, [["render", Ci]]), _i = {}, Pi = {
viewBox: "0 0 167 38",
preserveAspectRatio: "none",
class: "dv-button-svg"
};
function wi(e, r) {
return le(), se("svg", Pi, r[0] || (r[0] = [
Tt('<g style="transform:translate(2px, 2px);"><g><path data-type="shape" d="M0,0 L0,34 L163,34 L163,0" class="dv-button-svg-bg"></path></g><path data-type="polyline" d="M0,0 L81.6,0" class="dv-button-svg-line"></path><path data-type="polyline" d="M163,0 L81.4,0" class="dv-button-svg-line"></path><path data-type="polyline" d="M0,34 L81.6,34" class="dv-button-svg-line"></path><path data-type="polyline" d="M163,34 L81.4,34" class="dv-button-svg-line"></path><path data-type="polyline" d="M0,1 L10,1" class="dv-button-svg-line"></path><path data-type="polyline" d="M163,1 L153,1" class="dv-button-svg-line"></path><path data-type="polyline" d="M0,33 L10,33" class="dv-button-svg-line"></path><path data-type="polyline" d="M163,33 L153,33" class="dv-button-svg-line"></path></g>', 1)
]));
}
const ki = /* @__PURE__ */ Ke(_i, [["render", wi]]), Ai = { class: "dv-button-wrapper" }, Li = { class: "dv-button" }, Si = { class: "dv-button-svg-container" }, Oi = { class: "dv-button-text" }, Gi = /* @__PURE__ */ Le({
components: {
Border1: oi,
Border2: ci,
Border3: hi,
Border4: yi,
Border5: $i,
Border6: ki
},
__name: "index",
props: {
color: { default: "#2058c7" },
fontColor: { default: "" },
bg: { type: Boolean, default: !0 },
border: { default: "Border1" },
fontSize: { default: 14 }
},
setup(e) {
pt((_) => ({
"3d5503d0": i(o),
abf4b98a: _.color,
"353d4ca1": i(t),
"22d70eaf": i(a),
"49fc34c0": i(n),
"0b0bf6d6": i(l)
}));
const r = e, a = be(() => ln(r.color, 40)), t = be(() => r.fontColor === "" ? r.color : r.fontColor), n = be(() => ln(t.value, 40)), l = be(() => r.bg ? 0.1 : 0), o = be(() => `${r.fontSize}px`);
return (_, x) => (le(), se("div", Ai, [
ae("button", Li, [
ae("div", Si, [
(le(), ja(Ea(_.border)))
]),
ae("div", Oi, [
Me(_.$slots, "default")
])
])
]));
}
}), zt = {
install(e) {
e.component("DvButton", Gi);
}
};
function Mi(e) {
return za() ? (qa(e), !0) : !1;
}
function Rt(e) {
return typeof e == "function" ? e() : i(e);
}
const Ri = typeof window < "u" && typeof document < "u";
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const Di = Object.prototype.toString, Ti = (e) => Di.call(e) === "[object Object]", sn = () => {
};
function Fi(e, r) {
function a(...t) {
return new Promise((n, l) => {
Promise.resolve(e(() => r.apply(this, t), { fn: r, thisArg: this, args: t })).then(n).catch(l);
});
}
return a;
}
function Bi(e, r = {}) {
let a, t, n = sn;
const l = (_) => {
clearTimeout(_), n(), n = sn;
};
return (_) => {
const x = Rt(e), z = Rt(r.maxWait);
return a && l(a), x <= 0 || z !== void 0 && z <= 0 ? (t && (l(t), t = null), Promise.resolve(_())) : new Promise((E, U) => {
n = r.rejectOnCancel ? U : E, z && !t && (t = setTimeout(() => {
a && l(a), t = null, E(_());
}, z)), a = setTimeout(() => {
t && l(t), t = null, E(_());
}, x);
});
};
}
function Ni(e, r = 200, a = {}) {
return Fi(
Bi(r, a),
e
);
}
function Wi(e) {
var r;
const a = Rt(e);
return (r = a == null ? void 0 : a.$el) != null ? r : a;
}
const ji = Ri ? window : void 0;
function Ei(...e) {
let r, a, t, n;
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([a, t, n] = e, r = ji) : [r, a, t, n] = e, !r)
return sn;
Array.isArray(a) || (a = [a]), Array.isArray(t) || (t = [t]);
const l = [], o = () => {
l.forEach((E) => E()), l.length = 0;
}, _ = (E, U, T, L) => (E.addEventListener(U, T, L), () => E.removeEventListener(U, T, L)), x = ke(
() => [Wi(r), Rt(n)],
([E, U]) => {
if (o(), !E)
return;
const T = Ti(U) ? { ...U } : U;
l.push(
...a.flatMap((L) => t.map((d) => _(E, L, d, T)))
);
},
{ immediate: !0, flush: "post" }
), z = () => {
x(), o();
};
return Mi(z), z;
}
function vt(e, r) {
return arguments.length === 1 ? Number.parseInt((Math.random() * e + 1).toString(), 10) : Number.parseInt((Math.random() * (r - e + 1) + e).toString(), 10);
}
function zi(e, r) {
const a = window.MutationObserver, t = new a(r);
return t.observe(e, { attributes: !0, attributeFilter: ["style"], attributeOldValue: !0 }), t;
}
function Dt(e, r) {
const a = Math.abs(e[0] - r[0]), t = Math.abs(e[1] - r[1]);
return Math.sqrt(a * a + t * t);
}
function et(e, r, a, t) {
return [e + Math.cos(t) * a, r + Math.sin(t) * a];
}
function qi(e) {
return e.filter((r) => typeof r == "number");
}
function Ii(e) {
return e = qi(e), e.reduce((r, a) => r + a, 0);
}
function Hi(e, r) {
const a = Math.abs(e.x - r.x), t = Math.abs(e.y - r.y);
return Math.sqrt(a * a + t * t);
}
function vn(e) {
const a = Array.from({ length: e.length - 1 }).fill(0).map((t, n) => [e[n], e[n + 1]]).map((t) => Hi(t[0], t[1]));
return Ii(a);
}
function Vi(e) {
return `${e.x},${e.y}`;
}
function hn(e) {
return e.map(Vi).join(" ");
}
function He(e) {
return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, (r) => {
const a = Math.random() * 16 | 0;
return (r === "x" ? a : a & 3 | 8).toString(16);
});
}
function Ce(e, r) {
for (const a in r) {
if (e[a] && typeof e[a] == "object") {
Ce(e[a], r[a]);
continue;
}
if (typeof r[a] == "object") {
e[a] = _e(r[a]);
continue;
}
e[a] = r[a];
}
return e;
}
function _e(e, r) {
if (!e)
return e;
const a = Array.isArray(e) ? [] : {};
if (e && typeof e == "object")
for (const t in e)
Object.prototype.hasOwnProperty.call(e, t) && (e[t] && typeof e[t] == "object" ? a[t] = _e(e[t]) : a[t] = e[t]);
return a;
}
function xe(e, r, a) {
const t = me(0), n = me(0);
let l, o = null, _ = null;
const x = (L = !0) => new Promise((d) => {
Bt(() => {
_ = e.value, t.value = e.value ? e.value.clientWidth : 0, n.value = e.value ? e.value.clientHeight : 0, e.value ? (!t.value || !n.value) && console.warn("DataV: Component width or height is 0px, rendering abnormality may occur!") : console.warn("DataV: Failed to get dom node, component rendering may be abnormal!"), typeof r == "function" && L && r(), d(!0);
});
}), z = () => {
l = Ni(x, 200);
}, E = () => {
o = zi(_, l), Ei(window, "resize", l);
}, U = () => {
o && (o.disconnect(), o.takeRecords(), o = null);
}, T = async () => {
await x(!1), z(), E(), typeof a == "function" && a();
};
return De(() => {
T();
}), Ft(() => {
U();
}), Ia(T), Ha(U), {
width: t,
height: n,
initWH: x
};
}
const Ui = ["width", "height"], Xi = ["d", "fill"], Qi = ["fill", "x", "y"], Yi = ["xlink:href", "width", "height", "x", "y"], Ki = ["fill", "x", "y"], Ji = {
__name: "index",
props: {
config: {
type: Object,
default: () => ({})
}
},
setup(e) {
pt((L) => ({
"0be443fc": i(o)
}));
const r = e, a = me(null), { width: t, height: n } = xe(a, x, _), l = Pe({
defaultConfig: {
/**
* @description Chart data
* @type {Array<object>}
* @default data = []
*/
data: [],
/**
* @description Chart img
* @type {Array<string>}
* @default img = []
*/
img: [],
/**
* @description Chart font size
* @type {number}
* @default fontSize = 12
*/
fontSize: 12,
/**
* @description Img side length
* @type {number}
* @default imgSideLength = 30
*/
imgSideLength: 30,
/**
* @description Column color
* @type {string}
* @default columnColor = 'rgba(0, 194, 255, 0.4)'
*/
columnColor: "rgba(0, 194, 255, 0.4)",
/**
* @description Text color
* @type {string}
* @default textColor = '#fff'
*/
textColor: "#fff",
/**
* @description Show value
* @type {boolean}
* @default showValue = false
*/
showValue: !1,
/**
* @description Auto sort by value
* @type {boolean}
* @default sort = true
*/
sort: !0
},
mergedConfig: null,
column: []
}), o = be(() => `${r.config.fontSize ? r.config.fontSize : l.defaultConfig.fontSize}px`);
ke(() => r.config, () => {
z();
}, {
deep: !0
});
function _() {
z();
}
function x() {
z();
}
function z() {
E(), U(), T();
}
function E() {
l.mergedConfig = Ce(_e(l.defaultConfig), r.config || {});
}
function U() {
let { data: L } = l.mergedConfig;
const { sort: d } = l.mergedConfig;
L = _e(L), d && L.sort(({ value: W }, { value: q }) => W > q ? -1 : W < q ? 1 : 0);
const B = Math.max(...L.map((W) => W.value));
L = L.map((W) => ({
...W,
percent: B === 0 ? 0 : W.value / B
})), l.mergedConfig.data = L;
}
function T() {
const { imgSideLength: L, fontSize: d, data: B } = l.mergedConfig, W = B.length, q = t.value / (W + 1), G = n.value - L - d - 5, y = n.value - d - 5;
l.column = B.map((g, f) => {
const { percent: D } = g, k = q * (f + 1), C = q * f, $ = q * (f + 2), c = y - G * D, M = G * D * 0.6 + c, A = `
M${C}, ${y}
Q${k}, ${M} ${k},${c}
M${k},${c}
Q${k}, ${M} ${$},${y}
L${C}, ${y}
Z
`, p = (y + c) / 2 + d / 2;
return {
...g,
d: A,
x: k,
y: c,
textY: p
};
});
}
return (L, d) => (le(), se("div", {
ref_key: "conicalColumnChart",
ref: a,
class: "dv-conical-column-chart"
}, [
(le(), se("svg", {
width: i(t),
height: i(n)
}, [
(le(!0), se(Ae, null, Oe(i(l).column, (B, W) => (le(), se("g", { key: W }, [
ae("path", {
d: B.d,
fill: i(l).mergedConfig.columnColor
}, null, 8, Xi),
ae("text", {
fill: i(l).mergedConfig.textColor,
x: B.x,
y: i(n) - 4
}, We(B.name), 9, Qi),
i(l).mergedConfig.img.length ? (le(), se("image", {
key: 0,
"xlink:href": i(l).mergedConfig.img[W % i(l).mergedConfig.img.length],
width: i(l).mergedConfig.imgSideLength,
height: i(l).mergedConfig.imgSideLength,
x: B.x - i(l).mergedConfig.imgSideLength / 2,
y: B.y - i(l).mergedConfig.imgSideLength
}, null, 8, Yi)) : $e("", !0),
i(l).mergedConfig.showValue ? (le(), se("text", {
key: 1,
fill: i(l).mergedConfig.textColor,
x: B.x,
y: B.textY
}, We(B.value), 9, Ki)) : $e("", !0)
]))), 128))
], 8, Ui))
], 512));
}
}, qt = {
install(e) {
e.component("DvConicalColumnChart", Ji);
}
}, Zi = ["id"], eo = ["offset", "stop-color"], to = ["id", "x2"], ro = ["offset", "stop-color"], no = ["x", "y", "rx", "ry", "stroke-width", "stroke", "width", "height"], ao = ["stroke-width", "stroke-dasharray", "stroke", "points"], io = ["stroke", "fill", "x", "y"], oo = {
__name: "index",
props: {
config: {
type: Object,
default: () => ({})
}
},
setup(e) {
const r = e, a = He(), t = me(null), n = Pe({
gradientId1: `percent-pond-gradientId1-${a}`,
gradientId2: `percent-pond-gradientId2-${a}`,
width: 0,
height: 0,
defaultConfig: {
/**
* @description Value
* @type {number}
* @default value = 0
*/
value: 0,
/**
* @description Colors (hex|rgb|rgba|color keywords)
* @type {Array<string>}
* @default colors = ['#00BAFF', '#3DE7C9']
* @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
*/
colors: ["#3DE7C9", "#00BAFF"],
/**
* @description Border width
* @type {number}
* @default borderWidth = 3
*/
borderWidth: 3,
/**
* @description Gap between border and pond
* @type {number}
* @default borderGap = 3
*/
borderGap: 3,
/**
* @description Line dash
* @type {Array<number>}
* @default lineDash = [5, 1]
*/
lineDash: [5, 1],
/**
* @description Text color
* @type {string}
* @default textColor = '#fff'
*/
textColor: "#fff",
/**
* @description Border radius
* @type {number}
* @default borderRadius = 5
*/
borderRadius: 5,
/**
* @description Local Gradient
* @type {boolean}
* @default localGradient = false
* @example localGradient = false | true
*/
localGradient: !1,
/**
* @description Formatter
* @type {string}
* @default formatter = '{value}%'
*/
formatter: "{value}%"
},
mergedConfig: null
}), l = be(() => {
if (!n.mergedConfig)
return 0;
const { borderWidth: W } = n.mergedConfig;
return n.width - W;
}), o = be(() => {
if (!n.mergedConfig)
return 0;
const { borderWidth: W } = n.mergedConfig;
return n.height - W;
}), _ = be(() => {
const W = n.height / 2;
if (!n.mergedConfig)
return `0, ${W} 0, ${W}`;
const { borderWidth: q, borderGap: G, value: y } = n.mergedConfig, g = (n.width - (q + G) * 2) / 100 * y;
return `
${q + G}, ${W}
${q + G + g}, ${W + 1e-3}
`;
}), x = be(() => {
if (!n.mergedConfig)
return 0;
const { borderWidth: W, borderGap: q } = n.mergedConfig;
return n.height - (W + q) * 2;
}), z = be(() => {
if (!n.mergedConfig)
return [];
const { colors: W } = n.mergedConfig, G = 100 / (W.length - 1);
return W.map((y, g) => [G * g, y]);
}), E = be(() => n.mergedConfig && n.mergedConfig.localGradient ? n.gradientId1 : n.gradientId2), U = be(() => {
if (!n.mergedConfig)
return "100%";
const { value: W } = n.mergedConfig;
return `${200 - W}%`;
}), T = be(() => {
if (!n.mergedConfig)
return "";
const { value: W, formatter: q } = n.mergedConfig;
return q.replace("{value}", W);
});
ke(() => r.config, () => {
B();
}, {
deep: !0
}), De(() => {
L();
});
async function L() {
await d(), r.config && B();
}
async function d() {
await Bt();
const { clientWidth: W, clientHeight: q } = t.value;
n.width = W, n.height = q;
}
function B() {
n.mergedConfig = Ce(_e(n.defaultConfig), r.config || {});
}
return (W, q) => (le(), se("div", {
ref_key: "percentPond",
ref: t,
class: "dv-percent-pond"
}, [
(le(), se("svg", null, [
ae("defs", null, [
ae("linearGradient", {
id: i(n).gradientId1,
x1: "0%",
y1: "0%",
x2: "100%",
y2: "0%"
}, [
(le(!0), se(Ae, null, Oe(i(z), (G) => (le(), se("stop", {
key: G[0],
offset: `${G[0]}%`,
"stop-color": G[1]
}, null, 8, eo))), 128))
], 8, Zi),
ae("linearGradient", {
id: i(n).gradientId2,
x1: "0%",
y1: "0%",
x2: i(U),
y2: "0%"
}, [
(le(!0), se(Ae, null, Oe(i(z), (G) => (le(), se("stop", {
key: G[0],
offset: `${G[0]}%`,
"stop-color": G[1]
}, null, 8, ro))), 128))
], 8, to)
]),
ae("rect", {
x: i(n).mergedConfig ? i(n).mergedConfig.borderWidth / 2 : "0",
y: i(n).mergedConfig ? i(n).mergedConfig.borderWidth / 2 : "0",
rx: i(n).mergedConfig ? i(n).mergedConfig.borderRadius : "0",
ry: i(n).mergedConfig ? i(n).mergedConfig.borderRadius : "0",
fill: "transparent",
"stroke-width": i(n).mergedConfig ? i(n).mergedConfig.borderWidth : "0",
stroke: `url(#${i(n).gradientId1})`,
width: i(l) > 0 ? i(l) : 0,
height: i(o) > 0 ? i(o) : 0
}, null, 8, no),
ae("polyline", {
"stroke-width": i(x),
"stroke-dasharray": i(n).mergedConfig ? i(n).mergedConfig.lineDash.join(",") : "0",
stroke: `url(#${i(E)})`,
points: i(_)
}, null, 8, ao),
ae("text", {
stroke: i(n).mergedConfig ? i(n).mergedConfig.textColor : "#fff",
fill: i(n).mergedConfig ? i(n).mergedConfig.textColor : "#fff",
x: i(n).width / 2,
y: i(n).height / 2
}, We(i(T)), 9, io)
]))
], 512));
}
}, It = {
install(e) {
e.component("DvPercentPond", oo);
}
};
function Aa(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function lo(e) {
if (e.__esModule) return e;
var r = e.default;
if (typeof r == "function") {
var a = function t() {
return this instanceof t ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
};
a.prototype = r.prototype;
} else a = {};
return Object.defineProperty(a, "__esModule", { value: !0 }), Object.keys(e).forEach(function(t) {
var n = Object.getOwnPropertyDescriptor(e, t);
Object.defineProperty(a, t, n.get ? n : {
enumerable: !0,
get: function() {
return e[t];
}
});
}), a;
}
var jt = {}, La = { exports: {} };
(function(e) {
function r(a) {
return a && a.__esModule ? a : {
default: a
};
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
})(La);
var we = La.exports, Ht = {}, Vt = { exports: {} }, Ut = { exports: {} }, Xt = { exports: {} }, pn;
function Be() {
return pn || (pn = 1, function(e) {
function r(a) {
"@babel/helpers - typeof";
return e.exports = r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, e.exports.__esModule = !0, e.exports.default = e.exports, r(a);
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
}(Xt)), Xt.exports;
}
var Qt = { exports: {} }, gn;
function so() {
return gn || (gn = 1, function(e) {
var r = Be().default;
function a(t, n) {
if (r(t) != "object" || !t) return t;
var l = t[Symbol.toPrimitive];
if (l !== void 0) {
var o = l.call(t, n || "default");
if (r(o) != "object") return o;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (n === "string" ? String : Number)(t);
}
e.exports = a, e.exports.__esModule = !0, e.exports.default = e.exports;
}(Qt)), Qt.exports;
}
var mn;
function uo() {
return mn || (mn = 1, function(e) {
var r = Be().default, a = so();
function t(n) {
var l = a(n, "string");
return r(l) == "symbol" ? l : l + "";
}
e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
}(Ut)), Ut.exports;
}
var yn;
function Ve() {
return yn || (yn = 1, function(e) {
var r = uo();
function a(t, n, l) {
return (n = r(n)) in t ? Object.defineProperty(t, n, {
value: l,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[n] = l, t;
}
e.exports = a, e.exports.__esModule = !0, e.exports.default = e.exports;
}(Vt)), Vt.exports;
}
var Yt = { exports: {} }, Kt = { exports: {} }, Jt = { exports: {} }, bn;
function Sa() {
return bn || (bn = 1, function(e) {
function r(a, t) {
(t == null || t > a.length) && (t = a.length);
for (var n = 0, l = Array(t); n < t; n++) l[n] = a[n];
return l;
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
}(Jt)), Jt.exports;
}
var xn;
function co() {
return xn || (xn = 1, function(e) {
var r = Sa();
function a(t) {
if (Array.isArray(t)) return r(t);
}
e.exports = a, e.exports.__esModule = !0, e.exports.default = e.exports;
}(Kt)), Kt.exports;
}
var Zt = { exports: {} }, Cn;
function fo() {
return Cn || (Cn = 1, function(e) {
function r(a) {
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
}(Zt)), Zt.exports;
}
var er = { exports: {} }, $n;
function Oa() {
return $n || ($n = 1, function(e) {
var r = Sa();
function a(t, n) {
if (t) {
if (typeof t == "string") return r(t, n);
var l = {}.toString.call(t).slice(8, -1);
return l === "Object" && t.constructor && (l = t.constructor.name), l === "Map" || l === "Set" ? Array.from(t) : l === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l) ? r(t, n) : void 0;
}
}
e.exports = a, e.exports.__esModule = !0, e.exports.default = e.exports;
}(er)), er.exports;
}
var tr = { exports: {} }, _n;
function vo() {
return _n || (_n = 1, function(e) {
function r() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
}(tr)), tr.exports;
}
var Pn;
function Te() {
return Pn || (Pn = 1, function(e) {
var r = co(), a = fo(), t = Oa(), n = vo();
function l(o) {
return r(o) || a(o) || t(o) || n();
}
e.exports = l, e.exports.__esModule = !0, e.exports.default = e.exports;
}(Yt)), Yt.exports;
}
var rr = { exports: {} }, wn;
function mt() {
return wn || (wn = 1, function(e) {
function r(a, t) {
if (!(a instanceof t)) throw new TypeError("Cannot call a class as a function");
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
}(rr)), rr.exports;
}
const yt = /* @__PURE__ */ lo(ri);
var nr = {}, ar = {}, ir = { exports: {} }, or = { exports: {} }, kn;
function ho() {
return kn || (kn = 1, function(e) {
function r(a) {
if (Array.isArray(a)) return a;
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
}(or)), or.exports;
}
var lr = { exports: {} }, An;
function po() {
return An || (An = 1, function(e) {
function r(a, t) {
var n = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
if (n != null) {
var l, o, _, x, z = [], E = !0, U = !1;
try {
if (_ = (n = n.call(a)).next, t === 0) {
if (Object(n) !== n) return;
E = !1;
} else for (; !(E = (l = _.call(n)).done) && (z.push(l.value), z.length !== t); E = !0) ;
} catch (T) {
U = !0, o = T;
} finally {
try {
if (!E && n.return != null && (x = n.return(), Object(x) !== x)) return;
} finally {
if (U) throw o;
}
}
return z;
}
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
}(lr)), lr.exports;
}
var sr = { exports: {} }, Ln;
function go() {
return Ln || (Ln = 1, function(e) {
function r() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
}(sr)), sr.exports;
}
var Sn;
function Ne() {
return Sn || (Sn = 1, function(e) {
var r = ho(), a = po(), t = Oa(), n = go();
function l(o, _) {
return r(o) || a(o, _) || t(o, _) || n();
}
e.exports = l, e.exports.__esModule = !0, e.exports.default = e.exports;
}(ir)), ir.exports;
}
var On;
function mo() {
return On || (On = 1, function(e) {
var r = we;
Object.defineProperty(e, "__esModule", {
value: !0
}), e.bezierCurveToPolyline = q, e.getBezierCurveLength = G, e.default = void 0;
var a = r(Ne()), t = r(Te()), n = Math.sqrt, l = Math.pow, o = Math.ceil, _ = Math.abs, x = 50;
function z(g) {
var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 5, D = g.length - 1, k = g[0], C = g[D][2], $ = g.slice(1), c = $.map(function(V, X) {
var ee = X === 0 ? k : $[X - 1][2];
return E.apply(void 0, [ee].concat((0, t.default)(V)));
}), M = new Array(D).fill(x), A = d(c, M), p = W(A, c, $, f);
return p.segmentPoints.push(C), p;
}
function E(g, f, D, k) {
return function(C) {
var $ = 1 - C, c = l($, 3), M = l($, 2), A = l(C, 3), p = l(C, 2);
return [g[0] * c + 3 * f[0] * C * M + 3 * D[0] * p * $ + k[0] * A, g[1] * c + 3 * f[1] * C * M + 3 * D[1] * p * $ + k[1] * A];
};
}
function U(g, f) {
var D = (0, a.default)(g, 2), k = D[0], C = D[1], $ = (0, a.default)(f, 2), c = $[0], M = $[1];
return n(l(k - c, 2) + l(C - M, 2));
}
function T(g) {
return g.reduce(function(f, D) {
return f + D;
}, 0);
}
function L(g) {
return g.map(function(f, D) {
return new Array(f.length - 1).fill(0).map(function(k, C) {
return U(f[C], f[C + 1]);
});
});
}
function d(g, f) {
return g.map(function(D, k) {
var C = 1 / f[k];
return new Array(f[k]).fill("").map(function($, c) {
return D(c * C);
});
});
}
function B(g, f) {
return g.map(function(D) {
return D.map(function(k) {
return _(k - f);
});
}).map(function(D) {
return T(D);
}).reduce(function(D, k) {
return D + k;
}, 0);
}
function W(g, f, D, k) {
var C = 4, $ = 1, c = function() {
var p = g.reduce(function(Q, te) {
return Q + te.length;
}, 0);
g.forEach(function(Q, te) {
return Q.push(D[te][2]);
});
var V = L(g), X = V.reduce(function(Q, te) {
return Q + te.length;
}, 0), ee = V.map(function(Q) {
return T(Q);
}), u = T(ee), I = u / X, m = B(V, I);
if (m <= k) return "break";
p = o(I / k * p * 1.1);
var h = ee.map(function(Q) {
return o(Q / u * p);
});
g = d(f, h), p = g.reduce(function(Q, te) {
return Q + te.length;
}, 0);
var S = JSON.parse(JSON.stringify(g));
S.forEach(function(Q, te) {
return Q.push(D[te][2]);
}), V = L(S), X = V.reduce(function(Q, te) {
return Q + te.length;
}, 0), ee = V.map(function(Q) {
return T(Q);
}), u = T(ee), I = u / X;
var J = 1 / p / 10;
f.forEach(function(Q, te) {
for (var oe = h[te], he = new Array(oe).fill("").map(function(w, O) {
return O / h[te];
}), Y = 0; Y < C; Y++)
for (var ie = L([g[te]])[0], ce = ie.map(function(w) {
return w - I;
}), fe = 0, N = 0; N < oe; N++) {
if (N === 0) return;
fe += ce[N - 1], he[N] -= J * fe, he[N] > 1 && (he[N] = 1), he[N] < 0 && (he[N] = 0), g[te][N] = Q(he[N]);
}
}), C *= 4, $++;
};
do {
var M = c();
if (M === "break") break;
} while (C <= 1025);
return g = g.reduce(function(A, p) {
return A.concat(p);
}, []), {
segmentPoints: g,
cycles: $,
rounds: C
};
}
function q(g) {
var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 5;
if (!g)
return console.error("bezierCurveToPolyline: Missing parameters!"), !1;
if (!(g instanceof Array))
return console.error("bezierCurveToPolyline: Parameter bezierCurve must be an array!"), !1;
if (typeof f != "number")
return console.error("bezierCurveToPolyline: Parameter precision must be a number!"), !1;
var D = z(g, f), k = D.segmentPoints;
return k;
}
function G(g) {
var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 5;
if (!g)
return console.error("getBezierCurveLength: Missing parameters!"), !1;
if (!(g instanceof Array))
return console.error("getBezierCurveLength: Parameter bezierCurve must be an array!"), !1;
if (typeof f != "number")
return console.error("getBezierCurveLength: Parameter precision must be a number!"), !1;
var D = z(g, f), k = D.segmentPoints, C = L([k])[0], $ = T(C);
return $;
}
var y = q;
e.default = y;
}(ar)), ar;
}
var ur = {}, Gn;
function yo() {
return Gn || (Gn = 1, function(e) {
var r = we;
Object.defineProperty(e, "__esModule", {
value: !0
}), e.default = void 0;
var a = r(Ne()), t = r(Te());
function n(z) {
var E = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, U = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0.25, T = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0.25;
if (!(z instanceof Array))
return console.error("polylineToBezierCurve: Parameter polyline must be an array!"), !1;
if (z.length <= 2)
return console.error("polylineToBezierCurve: Converting to a curve requires at least 3 points!"), !1;
var L = z[0], d = z.length - 1, B = new Array(d).fill(0).map(function(W, q) {
return [].concat((0, t.default)(l(z, q, E, U, T)), [z[q + 1]]);
});
return E && o(B, L), B.unshift(z[0]), B;
}
function l(z, E) {
var U = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, T = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0.25, L = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0.25, d = z.length;
if (!(d < 3 || E >= d)) {
var B = E - 1;
B < 0 && (B = U ? d + B : 0);
var W = E + 1;
W >= d && (W = U ? W - d : d - 1);
var q = E + 2;
q >= d && (q = U ? q - d : d - 1);
var G = z[B], y = z[E], g = z[W], f = z[q];
return [[y[0] + T * (g[0] - G[0]), y[1] + T * (g[1] - G[1])], [g[0] - L * (f[0] - y[0]), g[1] - L * (f[1] - y[1])]];
}
}
function o(z, E) {
var U = z[0], T = z.slice(-1)[0];
return z.push([_(T[1], T[2]), _(U[0], E), E]), z;
}
function _(z, E) {
var U = (0, a.default)(z, 2), T = U[0], L = U[1], d = (0, a.default)(E, 2), B = d[0], W = d[1], q = B - T, G = W - L;
return [B + q, W + G];
}
var x = n;
e.default = x;
}(ur)), ur;
}
var Mn;
function cn() {
return Mn || (Mn = 1, function(e) {
var r = we;
Object.defineProperty(e, "__esModule", {
value: !0
}), Object.defineProperty(e, "bezierCurveToPolyline", {
enumerable: !0,
get: function() {
return a.bezierCurveToPolyline;
}
}), Object.defineProperty(e, "getBezierCurveLength", {
enumerable: !0,
get: function() {
return a.getBezierCurveLength;
}
}), Object.defineProperty(e, "polylineToBezierCurve", {
enumerable: !0,
get: function() {
return t.default;
}
}), e.default = void 0;
var a = mo(), t = r(yo()), n = {
bezierCurveToPolyline: a.bezierCurveToPolyline,
getBezierCurveLength: a.getBezierCurveLength,
polylineToBezierCurve: t.default
};
e.default = n;
}(nr)), nr;
}
var cr = {}, Rn;
function Fe() {
return Rn || (Rn = 1, function(e) {
var r = we;
Object.defineProperty(e, "__esModule", {
value: !0
}), e.deepClone = T, e.eliminateBlur = L, e.checkPointIsInCircle = d, e.getTwoPointDistance = B, e.checkPointIsInPolygon = W, e.checkPointIsInSector = q, e.checkPointIsNearPolyline = y, e.checkPointIsInRect = g, e.getRotatePointPos = f, e.getScalePointPos = D, e.getTranslatePointPos = k, e.getDistanceBetweenPointAndLine = C, e.getCircleRadianPoint = $, e.getRegularPolygonPoints = c, e.default = void 0;
var a = r(Te()), t = r(Ne()), n = r(Be()), l = Math.abs, o = Math.sqrt, _ = Math.sin, x = Math.cos, z = Math.max, E = Math.min, U = Math.PI;
function T(A) {
var p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
if (!A) return A;
var V = JSON.parse, X = JSON.stringify;
if (!p) return V(X(A));
var ee = A instanceof Array ? [] : {};
if (A && (0, n.default)(A) === "object")
for (var u in A)
A.hasOwnProperty(u) && (A[u] && (0, n.default)(A[u]) === "object" ? ee[u] = T(A[u], !0) : ee[u] = A[u]);
return ee;
}
function L(A) {
return A.map(function(p) {
var V = (0, t.default)(p, 2), X = V[0], ee = V[1];
return [parseInt(X) + 0.5, parseInt(ee) + 0.5];
});
}
function d(A, p, V, X) {
return B(A, [p, V]) <= X;
}
function B(A, p) {
var V = (0, t.default)(A, 2), X = V[0], ee = V[1], u = (0, t.default)(p, 2), I = u[0], m = u[1], h = l(X - I), S = l(ee - m);
return o(h * h + S * S);
}
function W(A, p) {
for (var V = 0, X = (0, t.default)(A, 2), ee = X[0], u = X[1], I = p.length, m = 1, h = p[0]; m <= I; m++) {
var S = p[m % I];
if (ee > E(h[0], S[0]) && ee <= z(h[0], S[0]) && u <= z(h[1], S[1]) && h[0] !== S[0]) {
var J = (ee - h[0]) * (S[1] - h[1]) / (S[0] - h[0]) + h[1];
(h[1] === S[1] || u <= J) && V++;
}
h = S;
}
return V % 2 === 1;
}
function q(A, p, V, X, ee, u, I) {
if (!A || B(A, [p, V]) > X) return !1;
if (!I) {
var m = T([u, ee]), h = (0, t.default)(m, 2);
ee = h[0], u = h[1];
}
var S = ee > u;
if (S) {
var J = [u, ee];
ee = J[0], u = J[1];
}
var Q = u - ee;
if (Q >= U * 2) return !0;
var te = (0, t.default)(A, 2), oe = te[0], he = te[1], Y = $(p, V, X, ee), ie = (0, t.default)(Y, 2), ce = ie[0], fe = ie[1], N = $(p, V, X, u), w = (0, t.default)(N, 2), O = w[0], F = w[1], H = [oe - p, he - V], re = [ce - p, fe - V], v = [O - p, F - V], j = Q > U;
if (j) {
var s = T([v, re]), b = (0, t.default)(s, 2);
re = b[0], v = b[1];
}
var P = G(re, H) && !G(v, H);
return j && (P = !P), S && (P = !P), P;
}
function G(A, p) {
var V = (0, t.default)(A, 2), X = V[0], ee = V[1], u = (0, t.default)(p, 2), I = u[0], m = u[1];
return -ee * I + X * m > 0;
}
function y(A, p, V) {
var X = V / 2, ee = p.map(function(m) {
var h = (0, t.default)(m, 2), S = h[0], J = h[1];
return [S, J - X];
}), u = p.map(function(m) {
var h = (0, t.default)(m, 2), S = h[0], J = h[1];
return [S, J + X];
}), I = [].concat((0, a.default)(ee), (0, a.default)(u.reverse()));
return W(A, I);
}
function g(A, p, V, X, ee) {
var u = (0, t.default)(A, 2), I = u[0], m = u[1];
return !(I < p || m < V || I > p + X || m > V + ee);
}
function f() {
var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, p = arguments.length > 1 ? arguments[1] : void 0, V = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [0, 0];
if (!p) return !1;
if (A % 360 === 0) return p;
var X = (0, t.default)(p, 2), ee = X[0], u = X[1], I = (0, t.default)(V, 2), m = I[0], h = I[1];
return A *= U / 180, [(ee - m) * x(A) - (u - h) * _(A) + m, (ee - m) * _(A) + (u - h) * x(A) + h];
}
function D() {
var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [1, 1], p = arguments.length > 1 ? arguments[1] : void 0, V = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [0, 0];
if (!p) return !1;
if (A === 1) return p;
var X = (0, t.default)(p, 2), ee = X[0], u = X[1], I = (0, t.default)(V, 2), m = I[0], h = I[1], S = (0, t.default)(A, 2), J = S[0], Q = S[1], te = ee - m, oe = u - h;
return [te * J + m, oe * Q + h];
}
function k(A, p) {
if (!A || !p) return !1;
var V = (0, t.default)(p, 2), X = V[0], ee = V[1], u = (0, t.default)(A, 2), I = u[0], m = u[1];
return [X + I, ee + m];
}
function C(A, p, V) {
if (!A || !p || !V) return !1;
var X = (0, t.default)(A, 2), ee = X[0], u = X[1], I = (0, t.default)(p, 2), m = I[0], h = I[1], S = (0, t.default)(V, 2), J = S[0], Q = S[1], te = Q - h, oe = m - J, he = h * (J - m) - m * (Q - h), Y = l(te * ee + oe * u + he), ie = o(te * te + oe * oe);
return Y / ie;
}
function $(A, p, V, X) {
return [A + x(X) * V, p + _(X) * V];
}
function c(A, p, V, X) {
var ee = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : U * -0.5, u = U * 2 / X, I = new Array(X).fill("").map(function(m, h) {
return h * u + ee;
});
return I.map(function(m) {
return $(A, p, V, m);
});
}
var M = {
deepClone: T,
eliminateBlur: L,
checkPointIsInCircle: d,
checkPointIsInPolygon: W,
checkPointIsInSector: q,
checkPointIsNearPolyline: y,
getTwoPointDistance: B,
getRotatePointPos: f,
getScalePointPos: D,
getTranslatePointPos: k,
getCircleRadianPoint: $,
getRegularPolygonPoints: c,
getDistanceBetweenPointAndLine: C
};
e.default = M;
}(cr)), cr;
}
var fr = {}, dr = {}, Dn;
function bo() {
return Dn || (Dn = 1, function(e) {
var r = we;
Object.defineProperty(e, "__esModule", {
value: !0
}), e.drawPolylinePath = t, e.drawBezierCurvePath = n, e.default = void 0;
var a = r(Te());
function t(o, _) {
var x = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, z = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
if (!o || _.length < 2) return !1;
x && o.beginPath(), _.forEach(function(E, U) {
return E && (U === 0 ? o.moveTo.apply(o, (0, a.default)(E)) : o.lineTo.apply(o, (0, a.default)(E)));
}), z && o.closePath();
}
function n(o, _) {
var x = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, z = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, E = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1;
if (!o || !_) return !1;
z && o.beginPath(), x && o.moveTo.apply(o, (0, a.default)(x)), _.forEach(function(U) {
return U && o.bezierCur