antdv-pro-modal
Version:
Ant Design Vue Pro Modal dialog box, can be dragged and resized.
1,944 lines • 191 kB
JavaScript
import { Fragment as St, isVNode as jr, Comment as Wr, Text as _o, defineComponent as _, ref as W, computed as w, createVNode as b, Transition as Ct, withDirectives as Ro, vShow as No, nextTick as be, shallowRef as N, watch as le, onBeforeUnmount as Se, watchEffect as He, provide as xt, inject as J, onBeforeMount as Ur, onMounted as Ye, onUpdated as pn, Teleport as Bo, h as Oe, getCurrentInstance as $t, reactive as wt, unref as We, triggerRef as kr, render as Vt, mergeProps as Gr, createApp as Xr } from "vue";
import { Modal as Vr, Button as Rn } from "ant-design-vue";
import { createTypes as Kr } from "vue-types";
import { isEmpty as Lo } from "lodash-es";
import { FullscreenExitOutlined as Yr, FullscreenOutlined as qr, CloseOutlined as Qr } from "@ant-design/icons-vue";
const mt = function() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return t;
}, hn = (e) => {
const t = e;
return t.install = function(n) {
n.component(t.displayName || t.name, e);
}, e;
};
function Nn() {
return {
type: [Function, Array]
};
}
function ae(e) {
return {
type: Object,
default: e
};
}
function Te(e) {
return {
type: Boolean,
default: e
};
}
function Kt(e, t) {
const n = {
validator: () => !0,
default: e
};
return n;
}
function Bn(e) {
return {
type: Array,
default: e
};
}
function Ln(e) {
return {
type: String,
default: e
};
}
function Zr(e, t) {
return e ? {
type: e,
default: t
} : Kt(t);
}
function u() {
return u = Object.assign ? Object.assign.bind() : function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var o in n) ({}).hasOwnProperty.call(n, o) && (e[o] = n[o]);
}
return e;
}, u.apply(null, arguments);
}
function Ue(e) {
"@babel/helpers - typeof";
return Ue = 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;
}, Ue(e);
}
function Jr(e, t) {
if (Ue(e) != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var o = n.call(e, t || "default");
if (Ue(o) != "object") return o;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
function ea(e) {
var t = Jr(e, "string");
return Ue(t) == "symbol" ? t : t + "";
}
function ta(e, t, n) {
return (t = ea(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
function zn(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
t && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), n.push.apply(n, o);
}
return n;
}
function A(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? zn(Object(n), !0).forEach(function(o) {
ta(e, o, n[o]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : zn(Object(n)).forEach(function(o) {
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(n, o));
});
}
return e;
}
const na = Array.isArray, oa = (e) => typeof e == "string", ra = (e) => e !== null && typeof e == "object";
function de() {
const e = [];
for (let t = 0; t < arguments.length; t++) {
const n = t < 0 || arguments.length <= t ? void 0 : arguments[t];
if (n) {
if (oa(n))
e.push(n);
else if (na(n))
for (let o = 0; o < n.length; o++) {
const r = de(n[o]);
r && e.push(r);
}
else if (ra(n))
for (const o in n)
n[o] && e.push(o);
}
}
return e.join(" ");
}
function zo(e, t) {
return e && e.contains ? e.contains(t) : !1;
}
const M = {
/**
* MAC_ENTER
*/
MAC_ENTER: 3,
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: 12,
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* PAUSE
*/
PAUSE: 19,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33,
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34,
/**
* END
*/
END: 35,
/**
* HOME
*/
HOME: 36,
/**
* LEFT
*/
LEFT: 37,
/**
* UP
*/
UP: 38,
/**
* RIGHT
*/
RIGHT: 39,
/**
* DOWN
*/
DOWN: 40,
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: 44,
/**
* INSERT
*/
INSERT: 45,
/**
* DELETE
*/
DELETE: 46,
/**
* ZERO
*/
ZERO: 48,
/**
* ONE
*/
ONE: 49,
/**
* TWO
*/
TWO: 50,
/**
* THREE
*/
THREE: 51,
/**
* FOUR
*/
FOUR: 52,
/**
* FIVE
*/
FIVE: 53,
/**
* SIX
*/
SIX: 54,
/**
* SEVEN
*/
SEVEN: 55,
/**
* EIGHT
*/
EIGHT: 56,
/**
* NINE
*/
NINE: 57,
/**
* QUESTION_MARK
*/
QUESTION_MARK: 63,
/**
* A
*/
A: 65,
/**
* B
*/
B: 66,
/**
* C
*/
C: 67,
/**
* D
*/
D: 68,
/**
* E
*/
E: 69,
/**
* F
*/
F: 70,
/**
* G
*/
G: 71,
/**
* H
*/
H: 72,
/**
* I
*/
I: 73,
/**
* J
*/
J: 74,
/**
* K
*/
K: 75,
/**
* L
*/
L: 76,
/**
* M
*/
M: 77,
/**
* N
*/
N: 78,
/**
* O
*/
O: 79,
/**
* P
*/
P: 80,
/**
* Q
*/
Q: 81,
/**
* R
*/
R: 82,
/**
* S
*/
S: 83,
/**
* T
*/
T: 84,
/**
* U
*/
U: 85,
/**
* V
*/
V: 86,
/**
* W
*/
W: 87,
/**
* X
*/
X: 88,
/**
* Y
*/
Y: 89,
/**
* Z
*/
Z: 90,
/**
* META
*/
META: 91,
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* NUM_ZERO
*/
NUM_ZERO: 96,
/**
* NUM_ONE
*/
NUM_ONE: 97,
/**
* NUM_TWO
*/
NUM_TWO: 98,
/**
* NUM_THREE
*/
NUM_THREE: 99,
/**
* NUM_FOUR
*/
NUM_FOUR: 100,
/**
* NUM_FIVE
*/
NUM_FIVE: 101,
/**
* NUM_SIX
*/
NUM_SIX: 102,
/**
* NUM_SEVEN
*/
NUM_SEVEN: 103,
/**
* NUM_EIGHT
*/
NUM_EIGHT: 104,
/**
* NUM_NINE
*/
NUM_NINE: 105,
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: 106,
/**
* NUM_PLUS
*/
NUM_PLUS: 107,
/**
* NUM_MINUS
*/
NUM_MINUS: 109,
/**
* NUM_PERIOD
*/
NUM_PERIOD: 110,
/**
* NUM_DIVISION
*/
NUM_DIVISION: 111,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* NUMLOCK
*/
NUMLOCK: 144,
/**
* SEMICOLON
*/
SEMICOLON: 186,
/**
* DASH
*/
DASH: 189,
/**
* EQUALS
*/
EQUALS: 187,
/**
* COMMA
*/
COMMA: 188,
/**
* PERIOD
*/
PERIOD: 190,
/**
* SLASH
*/
SLASH: 191,
/**
* APOSTROPHE
*/
APOSTROPHE: 192,
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: 222,
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: 219,
/**
* BACKSLASH
*/
BACKSLASH: 220,
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: 221,
/**
* WIN_KEY
*/
WIN_KEY: 224,
/**
* MAC_FF_META
*/
MAC_FF_META: 224,
/**
* WIN_IME
*/
WIN_IME: 229,
// ======================== Function ========================
/**
* whether text and modified key is entered at the same time.
*/
isTextModifyingKeyEvent: function(t) {
const {
keyCode: n
} = t;
if (t.altKey && !t.ctrlKey || t.metaKey || // Function keys don't generate text
n >= M.F1 && n <= M.F12)
return !1;
switch (n) {
case M.ALT:
case M.CAPS_LOCK:
case M.CONTEXT_MENU:
case M.CTRL:
case M.DOWN:
case M.END:
case M.ESC:
case M.HOME:
case M.INSERT:
case M.LEFT:
case M.MAC_FF_META:
case M.META:
case M.NUMLOCK:
case M.NUM_CENTER:
case M.PAGE_DOWN:
case M.PAGE_UP:
case M.PAUSE:
case M.PRINT_SCREEN:
case M.RIGHT:
case M.SHIFT:
case M.UP:
case M.WIN_KEY:
case M.WIN_KEY_RIGHT:
return !1;
default:
return !0;
}
},
/**
* whether character is entered.
*/
isCharacterKey: function(t) {
if (t >= M.ZERO && t <= M.NINE || t >= M.NUM_ZERO && t <= M.NUM_MULTIPLY || t >= M.A && t <= M.Z || window.navigator.userAgent.indexOf("WebKit") !== -1 && t === 0)
return !0;
switch (t) {
case M.SPACE:
case M.QUESTION_MARK:
case M.NUM_PLUS:
case M.NUM_MINUS:
case M.NUM_PERIOD:
case M.NUM_DIVISION:
case M.SEMICOLON:
case M.DASH:
case M.EQUALS:
case M.COMMA:
case M.PERIOD:
case M.SLASH:
case M.APOSTROPHE:
case M.SINGLE_QUOTE:
case M.OPEN_SQUARE_BRACKET:
case M.BACKSLASH:
case M.CLOSE_SQUARE_BRACKET:
return !0;
default:
return !1;
}
}
};
function aa(e, t) {
const n = u({}, e);
for (let o = 0; o < t.length; o += 1) {
const r = t[o];
delete n[r];
}
return n;
}
const ia = `accept acceptcharset accesskey action allowfullscreen allowtransparency
alt async autocomplete autofocus autoplay capture cellpadding cellspacing challenge
charset checked classid classname colspan cols content contenteditable contextmenu
controls coords crossorigin data datetime default defer dir disabled download draggable
enctype form formaction formenctype formmethod formnovalidate formtarget frameborder
headers height hidden high href hreflang htmlfor for httpequiv icon id inputmode integrity
is keyparams keytype kind label lang list loop low manifest marginheight marginwidth max maxlength media
mediagroup method min minlength multiple muted name novalidate nonce open
optimum pattern placeholder poster preload radiogroup readonly rel required
reversed role rowspan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellcheck src srcdoc srclang srcset start step style
summary tabindex target title type usemap value width wmode wrap`, la = `onCopy onCut onPaste onCompositionend onCompositionstart onCompositionupdate onKeydown
onKeypress onKeyup onFocus onBlur onChange onInput onSubmit onClick onContextmenu onDoubleclick onDblclick
onDrag onDragend onDragenter onDragexit onDragleave onDragover onDragstart onDrop onMousedown
onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel
onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough
onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata
onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`, Dn = `${ia} ${la}`.split(/[\s\n]+/), ca = "aria-", sa = "data-";
function Fn(e, t) {
return e.indexOf(t) === 0;
}
function ua(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n;
t === !1 ? n = {
aria: !0,
data: !0,
attr: !0
} : t === !0 ? n = {
aria: !0
} : n = u({}, t);
const o = {};
return Object.keys(e).forEach((r) => {
// Aria
(n.aria && (r === "role" || Fn(r, ca)) || // Data
n.data && Fn(r, sa) || // Attr
n.attr && (Dn.includes(r) || Dn.includes(r.toLowerCase()))) && (o[r] = e[r]);
}), o;
}
const da = (e) => e != null && e !== "", Tt = (e, t) => {
const n = u({}, e);
return Object.keys(t).forEach((o) => {
const r = n[o];
if (r)
r.type || r.default ? r.default = t[o] : r.def ? r.def(t[o]) : n[o] = {
type: r,
default: t[o]
};
else
throw new Error(`not have ${o} prop`);
}), n;
}, fa = Symbol("skipFlatten"), ke = function() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
const n = Array.isArray(e) ? e : [e], o = [];
return n.forEach((r) => {
Array.isArray(r) ? o.push(...ke(r, t)) : r && r.type === St ? r.key === fa ? o.push(r) : o.push(...ke(r.children, t)) : r && jr(r) ? t && !Do(r) ? o.push(r) : t || o.push(r) : da(r) && o.push(r);
}), o;
}, Yt = (e) => {
var t;
let n = ((t = e == null ? void 0 : e.vnode) === null || t === void 0 ? void 0 : t.el) || e && (e.$el || e);
for (; n && !n.tagName; )
n = n.nextSibling;
return n;
};
function Do(e) {
return e && (e.type === Wr || e.type === St && e.children.length === 0 || e.type === _o && e.children.trim() === "");
}
function Fo() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
const t = [];
return e.forEach((n) => {
Array.isArray(n) ? t.push(...n) : (n == null ? void 0 : n.type) === St ? t.push(...Fo(n.children)) : t.push(n);
}), t.filter((n) => !Do(n));
}
mt("bottomLeft", "bottomRight", "topLeft", "topRight");
const jo = function(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return u(e ? {
name: e,
appear: !0,
// type: 'animation',
// appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
// appearActiveClass: `antdv-base-transtion`,
// appearToClass: `${transitionName}-appear ${transitionName}-appear-active`,
enterFromClass: `${e}-enter ${e}-enter-prepare ${e}-enter-start`,
enterActiveClass: `${e}-enter ${e}-enter-prepare`,
enterToClass: `${e}-enter ${e}-enter-active`,
leaveFromClass: ` ${e}-leave`,
leaveActiveClass: `${e}-leave ${e}-leave-active`,
leaveToClass: `${e}-leave ${e}-leave-active`
} : {
css: !1
}, t);
}, jn = (e, t, n) => n !== void 0 ? n : `${e}-${t}`, H = Kr({
func: void 0,
bool: void 0,
string: void 0,
number: void 0,
array: void 0,
object: void 0,
integer: void 0
});
H.extend([{
name: "looseBool",
getter: !0,
type: Boolean,
default: void 0
}, {
name: "style",
getter: !0,
type: [String, Object],
default: void 0
}, {
name: "VueNode",
getter: !0,
type: null
}]);
function vn() {
return {
keyboard: {
type: Boolean,
default: void 0
},
mask: {
type: Boolean,
default: void 0
},
afterClose: Function,
closable: {
type: Boolean,
default: void 0
},
maskClosable: {
type: Boolean,
default: void 0
},
visible: {
type: Boolean,
default: void 0
},
destroyOnClose: {
type: Boolean,
default: void 0
},
mousePosition: H.shape({
x: Number,
y: Number
}).loose,
title: H.any,
footer: H.any,
transitionName: String,
maskTransitionName: String,
animation: H.any,
maskAnimation: H.any,
wrapStyle: {
type: Object,
default: void 0
},
bodyStyle: {
type: Object,
default: void 0
},
maskStyle: {
type: Object,
default: void 0
},
prefixCls: String,
wrapClassName: String,
rootClassName: String,
width: [String, Number],
height: [String, Number],
zIndex: Number,
bodyProps: H.any,
maskProps: H.any,
wrapProps: H.any,
getContainer: H.any,
dialogStyle: {
type: Object,
default: void 0
},
dialogClass: String,
closeIcon: H.any,
forceRender: {
type: Boolean,
default: void 0
},
getOpenCount: Function,
// https://github.com/ant-design/ant-design/issues/19771
// https://github.com/react-component/dialog/issues/95
focusTriggerAfterClose: {
type: Boolean,
default: void 0
},
onClose: Function,
modalRender: Function
};
}
function Wn(e, t, n) {
let o = t;
return !o && n && (o = `${e}-${n}`), o;
}
let Un = -1;
function ma() {
return Un += 1, Un;
}
function kn(e, t) {
let n = e[`page${t ? "Y" : "X"}Offset`];
const o = `scroll${t ? "Top" : "Left"}`;
if (typeof n != "number") {
const r = e.document;
n = r.documentElement[o], typeof n != "number" && (n = r.body[o]);
}
return n;
}
function ga(e) {
const t = e.getBoundingClientRect(), n = {
left: t.left,
top: t.top
}, o = e.ownerDocument, r = o.defaultView || o.parentWindow;
return n.left += kn(r), n.top += kn(r, !0), n;
}
const pa = {
width: 0,
height: 0,
overflow: "hidden",
outline: "none"
}, ha = {
outline: "none"
}, va = _({
compatConfig: {
MODE: 3
},
name: "DialogContent",
inheritAttrs: !1,
props: u(u({}, vn()), {
motionName: String,
ariaId: String,
onVisibleChanged: Function,
onMousedown: Function,
onMouseup: Function
}),
setup(e, t) {
let {
expose: n,
slots: o,
attrs: r
} = t;
const a = W(), i = W(), l = W();
n({
focus: () => {
var g;
(g = a.value) === null || g === void 0 || g.focus({
preventScroll: !0
});
},
changeActive: (g) => {
const {
activeElement: p
} = document;
g && p === i.value ? a.value.focus({
preventScroll: !0
}) : !g && p === a.value && i.value.focus({
preventScroll: !0
});
}
});
const c = W(), s = w(() => {
const {
width: g,
height: p
} = e, y = {};
return g !== void 0 && (y.width = typeof g == "number" ? `${g}px` : g), p !== void 0 && (y.height = typeof p == "number" ? `${p}px` : p), c.value && (y.transformOrigin = c.value), y;
}), d = () => {
be(() => {
if (l.value) {
const g = ga(l.value);
c.value = e.mousePosition ? `${e.mousePosition.x - g.left}px ${e.mousePosition.y - g.top}px` : "";
}
});
}, f = (g) => {
e.onVisibleChanged(g);
};
return () => {
var g, p, y, v;
const {
prefixCls: C,
footer: h = (g = o.footer) === null || g === void 0 ? void 0 : g.call(o),
title: S = (p = o.title) === null || p === void 0 ? void 0 : p.call(o),
ariaId: $,
closable: E,
closeIcon: T = (y = o.closeIcon) === null || y === void 0 ? void 0 : y.call(o),
onClose: O,
bodyStyle: m,
bodyProps: x,
onMousedown: P,
onMouseup: R,
visible: D,
modalRender: j = o.modalRender,
destroyOnClose: ce,
motionName: ee
} = e;
let I;
h && (I = b("div", {
class: `${C}-footer`
}, [h]));
let z;
S && (z = b("div", {
class: `${C}-header`
}, [b("div", {
class: `${C}-title`,
id: $
}, [S])]));
let k;
E && (k = b("button", {
type: "button",
onClick: O,
"aria-label": "Close",
class: `${C}-close`
}, [T || b("span", {
class: `${C}-close-x`
}, null)]));
const U = b("div", {
class: `${C}-content`
}, [k, z, b("div", A({
class: `${C}-body`,
style: m
}, x), [(v = o.default) === null || v === void 0 ? void 0 : v.call(o)]), I]), Ne = jo(ee);
return b(Ct, A(A({}, Ne), {}, {
onBeforeEnter: d,
onAfterEnter: () => f(!0),
onAfterLeave: () => f(!1)
}), {
default: () => [D || !ce ? Ro(b("div", A(A({}, r), {}, {
ref: l,
key: "dialog-element",
role: "document",
style: [s.value, r.style],
class: [C, r.class],
onMousedown: P,
onMouseup: R
}), [b("div", {
tabindex: 0,
ref: a,
style: ha
}, [j ? j({
originVNode: U
}) : U]), b("div", {
tabindex: 0,
ref: i,
style: pa
}, null)]), [[No, D]]) : null]
});
};
}
}), ya = _({
compatConfig: {
MODE: 3
},
name: "DialogMask",
props: {
prefixCls: String,
visible: Boolean,
motionName: String,
maskProps: Object
},
setup(e, t) {
return () => {
const {
prefixCls: n,
visible: o,
maskProps: r,
motionName: a
} = e, i = jo(a);
return b(Ct, i, {
default: () => [Ro(b("div", A({
class: `${n}-mask`
}, r), null), [[No, o]])]
});
};
}
}), Gn = _({
compatConfig: {
MODE: 3
},
name: "VcDialog",
inheritAttrs: !1,
props: Tt(u(u({}, vn()), {
getOpenCount: Function,
scrollLocker: Object
}), {
mask: !0,
visible: !1,
keyboard: !0,
closable: !0,
maskClosable: !0,
destroyOnClose: !1,
prefixCls: "rc-dialog",
getOpenCount: () => null,
focusTriggerAfterClose: !0
}),
setup(e, t) {
let {
attrs: n,
slots: o
} = t;
const r = N(), a = N(), i = N(), l = N(e.visible), c = N(`vcDialogTitle${ma()}`), s = (h) => {
var S, $;
if (h)
zo(a.value, document.activeElement) || (r.value = document.activeElement, (S = i.value) === null || S === void 0 || S.focus());
else {
const E = l.value;
if (l.value = !1, e.mask && r.value && e.focusTriggerAfterClose) {
try {
r.value.focus({
preventScroll: !0
});
} catch {
}
r.value = null;
}
E && (($ = e.afterClose) === null || $ === void 0 || $.call(e));
}
}, d = (h) => {
var S;
(S = e.onClose) === null || S === void 0 || S.call(e, h);
}, f = N(!1), g = N(), p = () => {
clearTimeout(g.value), f.value = !0;
}, y = () => {
g.value = setTimeout(() => {
f.value = !1;
});
}, v = (h) => {
if (!e.maskClosable) return null;
f.value ? f.value = !1 : a.value === h.target && d(h);
}, C = (h) => {
if (e.keyboard && h.keyCode === M.ESC) {
h.stopPropagation(), d(h);
return;
}
e.visible && h.keyCode === M.TAB && i.value.changeActive(!h.shiftKey);
};
return le(() => e.visible, () => {
e.visible && (l.value = !0);
}, {
flush: "post"
}), Se(() => {
var h;
clearTimeout(g.value), (h = e.scrollLocker) === null || h === void 0 || h.unLock();
}), He(() => {
var h, S;
(h = e.scrollLocker) === null || h === void 0 || h.unLock(), l.value && ((S = e.scrollLocker) === null || S === void 0 || S.lock());
}), () => {
const {
prefixCls: h,
mask: S,
visible: $,
maskTransitionName: E,
maskAnimation: T,
zIndex: O,
wrapClassName: m,
rootClassName: x,
wrapStyle: P,
closable: R,
maskProps: D,
maskStyle: j,
transitionName: ce,
animation: ee,
wrapProps: I,
title: z = o.title
} = e, {
style: k,
class: U
} = n;
return b("div", A({
class: [`${h}-root`, x]
}, ua(e, {
data: !0
})), [b(ya, {
prefixCls: h,
visible: S && $,
motionName: Wn(h, E, T),
style: u({
zIndex: O
}, j),
maskProps: D
}, null), b("div", A({
tabIndex: -1,
onKeydown: C,
class: de(`${h}-wrap`, m),
ref: a,
onClick: v,
role: "dialog",
"aria-labelledby": z ? c.value : null,
style: u(u({
zIndex: O
}, P), {
display: l.value ? null : "none"
})
}, I), [b(va, A(A({}, aa(e, ["scrollLocker"])), {}, {
style: k,
class: U,
onMousedown: p,
onMouseup: y,
ref: i,
closable: R,
ariaId: c.value,
prefixCls: h,
visible: $,
onClose: d,
onVisibleChanged: s,
motionName: Wn(h, ce, ee)
}), o)])]);
};
}
}), Wo = Symbol("PortalContextKey"), Uo = function(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
inTriggerContext: !0
};
xt(Wo, {
inTriggerContext: t.inTriggerContext,
shouldRender: w(() => {
const {
sPopupVisible: n,
popupRef: o,
forceRender: r,
autoDestroy: a
} = e || {};
let i = !1;
return (n || o || r) && (i = !0), !n && a && (i = !1), i;
})
});
}, ba = () => {
Uo({}, {
inTriggerContext: !1
});
const e = J(Wo, {
shouldRender: w(() => !1),
inTriggerContext: !1
});
return {
shouldRender: w(() => e.shouldRender.value || e.inTriggerContext === !1)
};
}, Sa = _({
compatConfig: {
MODE: 3
},
name: "Portal",
inheritAttrs: !1,
props: {
getContainer: H.func.isRequired,
didUpdate: Function
},
setup(e, t) {
let {
slots: n
} = t, o = !0, r;
const {
shouldRender: a
} = ba();
function i() {
a.value && (r = e.getContainer());
}
Ur(() => {
o = !1, i();
}), Ye(() => {
r || i();
});
const l = le(a, () => {
a.value && !r && (r = e.getContainer()), r && l();
});
return pn(() => {
be(() => {
var c;
a.value && ((c = e.didUpdate) === null || c === void 0 || c.call(e, e));
});
}), () => {
var c;
return a.value ? o ? (c = n.default) === null || c === void 0 ? void 0 : c.call(n) : r ? b(Bo, {
to: r
}, n) : null : null;
};
}
});
function ne() {
return !!(typeof window < "u" && window.document && window.document.createElement);
}
let ko = (e) => setTimeout(e, 16), Go = (e) => clearTimeout(e);
typeof window < "u" && "requestAnimationFrame" in window && (ko = (e) => window.requestAnimationFrame(e), Go = (e) => window.cancelAnimationFrame(e));
let Xn = 0;
const yn = /* @__PURE__ */ new Map();
function Xo(e) {
yn.delete(e);
}
function Ge(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
Xn += 1;
const n = Xn;
function o(r) {
if (r === 0)
Xo(n), e();
else {
const a = ko(() => {
o(r - 1);
});
yn.set(n, a);
}
}
return o(t), n;
}
Ge.cancel = (e) => {
const t = yn.get(e);
return Xo(t), Go(t);
};
const Vn = "data-vc-order", Ca = "vc-util-key", qt = /* @__PURE__ */ new Map();
function Vo() {
let {
mark: e
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
return e ? e.startsWith("data-") ? e : `data-${e}` : Ca;
}
function Et(e) {
return e.attachTo ? e.attachTo : document.querySelector("head") || document.body;
}
function xa(e) {
return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
}
function Ko(e) {
return Array.from((qt.get(e) || e).children).filter((t) => t.tagName === "STYLE");
}
function Yo(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (!ne())
return null;
const {
csp: n,
prepend: o
} = t, r = document.createElement("style");
r.setAttribute(Vn, xa(o)), n != null && n.nonce && (r.nonce = n == null ? void 0 : n.nonce), r.innerHTML = e;
const a = Et(t), {
firstChild: i
} = a;
if (o) {
if (o === "queue") {
const l = Ko(a).filter((c) => ["prepend", "prependQueue"].includes(c.getAttribute(Vn)));
if (l.length)
return a.insertBefore(r, l[l.length - 1].nextSibling), r;
}
a.insertBefore(r, i);
} else
a.appendChild(r);
return r;
}
function qo(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const n = Et(t);
return Ko(n).find((o) => o.getAttribute(Vo(t)) === e);
}
function gt(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const n = qo(e, t);
n && Et(t).removeChild(n);
}
function $a(e, t) {
const n = qt.get(e);
if (!n || !zo(document, n)) {
const o = Yo("", t), {
parentNode: r
} = o;
qt.set(e, r), e.removeChild(o);
}
}
function pt(e, t) {
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var o, r, a;
const i = Et(n);
$a(i, n);
const l = qo(t, n);
if (l)
return !((o = n.csp) === null || o === void 0) && o.nonce && l.nonce !== ((r = n.csp) === null || r === void 0 ? void 0 : r.nonce) && (l.nonce = (a = n.csp) === null || a === void 0 ? void 0 : a.nonce), l.innerHTML !== e && (l.innerHTML = e), l;
const c = Yo(e, n);
return c.setAttribute(Vo(n), t), c;
}
let Nt;
function wa(e) {
if (typeof document > "u")
return 0;
if (Nt === void 0) {
const t = document.createElement("div");
t.style.width = "100%", t.style.height = "200px";
const n = document.createElement("div"), o = n.style;
o.position = "absolute", o.top = "0", o.left = "0", o.pointerEvents = "none", o.visibility = "hidden", o.width = "200px", o.height = "150px", o.overflow = "hidden", n.appendChild(t), document.body.appendChild(n);
const r = t.offsetWidth;
n.style.overflow = "scroll";
let a = t.offsetWidth;
r === a && (a = n.clientWidth), document.body.removeChild(n), Nt = r - a;
}
return Nt;
}
const Ta = `vc-util-locker-${Date.now()}`;
let Kn = 0;
function Ea() {
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
}
function Ma(e) {
const t = w(() => !!e && !!e.value);
Kn += 1;
const n = `${Ta}_${Kn}`;
He((o) => {
if (ne()) {
if (t.value) {
const r = wa(), a = Ea();
pt(`
html body {
overflow-y: hidden;
${a ? `width: calc(100% - ${r}px);` : ""}
}`, n);
} else
gt(n);
o(() => {
gt(n);
});
}
}, {
flush: "post"
});
}
let me = 0;
const lt = ne(), Yn = (e) => {
if (!lt)
return null;
if (e) {
if (typeof e == "string")
return document.querySelectorAll(e)[0];
if (typeof e == "function")
return e();
if (typeof e == "object" && e instanceof window.HTMLElement)
return e;
}
return document.body;
}, Oa = _({
compatConfig: {
MODE: 3
},
name: "PortalWrapper",
inheritAttrs: !1,
props: {
wrapperClassName: String,
forceRender: {
type: Boolean,
default: void 0
},
getContainer: H.any,
visible: {
type: Boolean,
default: void 0
},
autoLock: Te(),
didUpdate: Function
},
setup(e, t) {
let {
slots: n
} = t;
const o = N(), r = N(), a = N(), i = N(1), l = ne() && document.createElement("div"), c = () => {
var p, y;
o.value === l && ((y = (p = o.value) === null || p === void 0 ? void 0 : p.parentNode) === null || y === void 0 || y.removeChild(o.value)), o.value = null;
};
let s = null;
const d = function() {
return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1) || o.value && !o.value.parentNode ? (s = Yn(e.getContainer), s ? (s.appendChild(o.value), !0) : !1) : !0;
}, f = () => lt ? (o.value || (o.value = l, d(!0)), g(), o.value) : null, g = () => {
const {
wrapperClassName: p
} = e;
o.value && p && p !== o.value.className && (o.value.className = p);
};
return pn(() => {
g(), d();
}), Ma(w(() => e.autoLock && e.visible && ne() && (o.value === document.body || o.value === l))), Ye(() => {
let p = !1;
le([() => e.visible, () => e.getContainer], (y, v) => {
let [C, h] = y, [S, $] = v;
lt && (s = Yn(e.getContainer), s === document.body && (C && !S ? me += 1 : p && (me -= 1))), p && (typeof h == "function" && typeof $ == "function" ? h.toString() !== $.toString() : h !== $) && c(), p = !0;
}, {
immediate: !0,
flush: "post"
}), be(() => {
d() || (a.value = Ge(() => {
i.value += 1;
}));
});
}), Se(() => {
const {
visible: p
} = e;
lt && s === document.body && (me = p && me ? me - 1 : me), c(), Ge.cancel(a.value);
}), () => {
const {
forceRender: p,
visible: y
} = e;
let v = null;
const C = {
getOpenCount: () => me,
getContainer: f
};
return i.value && (p || y || r.value) && (v = b(Sa, {
getContainer: f,
ref: r,
didUpdate: e.didUpdate
}, {
default: () => {
var h;
return (h = n.default) === null || h === void 0 ? void 0 : h.call(n, C);
}
})), v;
};
}
}), Ia = vn(), Pa = _({
compatConfig: {
MODE: 3
},
name: "DialogWrap",
inheritAttrs: !1,
props: Tt(Ia, {
visible: !1
}),
setup(e, t) {
let {
attrs: n,
slots: o
} = t;
const r = W(e.visible);
return Uo({}, {
inTriggerContext: !1
}), le(() => e.visible, () => {
e.visible && (r.value = !0);
}, {
flush: "post"
}), () => {
const {
visible: a,
getContainer: i,
forceRender: l,
destroyOnClose: c = !1,
afterClose: s
} = e;
let d = u(u(u({}, e), n), {
ref: "_component",
key: "dialog"
});
return i === !1 ? b(Gn, A(A({}, d), {}, {
getOpenCount: () => 2
}), o) : !l && c && !r.value ? null : b(Oa, {
autoLock: !0,
visible: a,
forceRender: l,
getContainer: i
}, {
default: (f) => (d = u(u(u({}, d), f), {
afterClose: () => {
s == null || s(), r.value = !1;
}
}), b(Gn, d, o))
});
};
}
});
function Aa(e, t, n, o) {
if (e && e.addEventListener) {
let r = o;
e.addEventListener(t, n, r);
}
return {
remove: () => {
e && e.removeEventListener && e.removeEventListener(t, n);
}
};
}
var Ha = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, name: "close", theme: "outlined" };
function F(e, t) {
_a(e) && (e = "100%");
var n = Ra(e);
return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
}
function et(e) {
return Math.min(1, Math.max(0, e));
}
function _a(e) {
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
}
function Ra(e) {
return typeof e == "string" && e.indexOf("%") !== -1;
}
function Qo(e) {
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
}
function tt(e) {
return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
}
function he(e) {
return e.length === 1 ? "0" + e : String(e);
}
function Na(e, t, n) {
return {
r: F(e, 255) * 255,
g: F(t, 255) * 255,
b: F(n, 255) * 255
};
}
function qn(e, t, n) {
e = F(e, 255), t = F(t, 255), n = F(n, 255);
var o = Math.max(e, t, n), r = Math.min(e, t, n), a = 0, i = 0, l = (o + r) / 2;
if (o === r)
i = 0, a = 0;
else {
var c = o - r;
switch (i = l > 0.5 ? c / (2 - o - r) : c / (o + r), o) {
case e:
a = (t - n) / c + (t < n ? 6 : 0);
break;
case t:
a = (n - e) / c + 2;
break;
case n:
a = (e - t) / c + 4;
break;
}
a /= 6;
}
return { h: a, s: i, l };
}
function Bt(e, t, n) {
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
}
function Ba(e, t, n) {
var o, r, a;
if (e = F(e, 360), t = F(t, 100), n = F(n, 100), t === 0)
r = n, a = n, o = n;
else {
var i = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - i;
o = Bt(l, i, e + 1 / 3), r = Bt(l, i, e), a = Bt(l, i, e - 1 / 3);
}
return { r: o * 255, g: r * 255, b: a * 255 };
}
function Qt(e, t, n) {
e = F(e, 255), t = F(t, 255), n = F(n, 255);
var o = Math.max(e, t, n), r = Math.min(e, t, n), a = 0, i = o, l = o - r, c = o === 0 ? 0 : l / o;
if (o === r)
a = 0;
else {
switch (o) {
case e:
a = (t - n) / l + (t < n ? 6 : 0);
break;
case t:
a = (n - e) / l + 2;
break;
case n:
a = (e - t) / l + 4;
break;
}
a /= 6;
}
return { h: a, s: c, v: i };
}
function La(e, t, n) {
e = F(e, 360) * 6, t = F(t, 100), n = F(n, 100);
var o = Math.floor(e), r = e - o, a = n * (1 - t), i = n * (1 - r * t), l = n * (1 - (1 - r) * t), c = o % 6, s = [n, i, a, a, l, n][c], d = [l, n, n, i, a, a][c], f = [a, a, l, n, n, i][c];
return { r: s * 255, g: d * 255, b: f * 255 };
}
function Zt(e, t, n, o) {
var r = [
he(Math.round(e).toString(16)),
he(Math.round(t).toString(16)),
he(Math.round(n).toString(16))
];
return o && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) : r.join("");
}
function za(e, t, n, o, r) {
var a = [
he(Math.round(e).toString(16)),
he(Math.round(t).toString(16)),
he(Math.round(n).toString(16)),
he(Da(o))
];
return r && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
}
function Da(e) {
return Math.round(parseFloat(e) * 255).toString(16);
}
function Qn(e) {
return K(e) / 255;
}
function K(e) {
return parseInt(e, 16);
}
function Fa(e) {
return {
r: e >> 16,
g: (e & 65280) >> 8,
b: e & 255
};
}
var Jt = {
aliceblue: "#f0f8ff",
antiquewhite: "#faebd7",
aqua: "#00ffff",
aquamarine: "#7fffd4",
azure: "#f0ffff",
beige: "#f5f5dc",
bisque: "#ffe4c4",
black: "#000000",
blanchedalmond: "#ffebcd",
blue: "#0000ff",
blueviolet: "#8a2be2",
brown: "#a52a2a",
burlywood: "#deb887",
cadetblue: "#5f9ea0",
chartreuse: "#7fff00",
chocolate: "#d2691e",
coral: "#ff7f50",
cornflowerblue: "#6495ed",
cornsilk: "#fff8dc",
crimson: "#dc143c",
cyan: "#00ffff",
darkblue: "#00008b",
darkcyan: "#008b8b",
darkgoldenrod: "#b8860b",
darkgray: "#a9a9a9",
darkgreen: "#006400",
darkgrey: "#a9a9a9",
darkkhaki: "#bdb76b",
darkmagenta: "#8b008b",
darkolivegreen: "#556b2f",
darkorange: "#ff8c00",
darkorchid: "#9932cc",
darkred: "#8b0000",
darksalmon: "#e9967a",
darkseagreen: "#8fbc8f",
darkslateblue: "#483d8b",
darkslategray: "#2f4f4f",
darkslategrey: "#2f4f4f",
darkturquoise: "#00ced1",
darkviolet: "#9400d3",
deeppink: "#ff1493",
deepskyblue: "#00bfff",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1e90ff",
firebrick: "#b22222",
floralwhite: "#fffaf0",
forestgreen: "#228b22",
fuchsia: "#ff00ff",
gainsboro: "#dcdcdc",
ghostwhite: "#f8f8ff",
goldenrod: "#daa520",
gold: "#ffd700",
gray: "#808080",
green: "#008000",
greenyellow: "#adff2f",
grey: "#808080",
honeydew: "#f0fff0",
hotpink: "#ff69b4",
indianred: "#cd5c5c",
indigo: "#4b0082",
ivory: "#fffff0",
khaki: "#f0e68c",
lavenderblush: "#fff0f5",
lavender: "#e6e6fa",
lawngreen: "#7cfc00",
lemonchiffon: "#fffacd",
lightblue: "#add8e6",
lightcoral: "#f08080",
lightcyan: "#e0ffff",
lightgoldenrodyellow: "#fafad2",
lightgray: "#d3d3d3",
lightgreen: "#90ee90",
lightgrey: "#d3d3d3",
lightpink: "#ffb6c1",
lightsalmon: "#ffa07a",
lightseagreen: "#20b2aa",
lightskyblue: "#87cefa",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#b0c4de",
lightyellow: "#ffffe0",
lime: "#00ff00",
limegreen: "#32cd32",
linen: "#faf0e6",
magenta: "#ff00ff",
maroon: "#800000",
mediumaquamarine: "#66cdaa",
mediumblue: "#0000cd",
mediumorchid: "#ba55d3",
mediumpurple: "#9370db",
mediumseagreen: "#3cb371",
mediumslateblue: "#7b68ee",
mediumspringgreen: "#00fa9a",
mediumturquoise: "#48d1cc",
mediumvioletred: "#c71585",
midnightblue: "#191970",
mintcream: "#f5fffa",
mistyrose: "#ffe4e1",
moccasin: "#ffe4b5",
navajowhite: "#ffdead",
navy: "#000080",
oldlace: "#fdf5e6",
olive: "#808000",
olivedrab: "#6b8e23",
orange: "#ffa500",
orangered: "#ff4500",
orchid: "#da70d6",
palegoldenrod: "#eee8aa",
palegreen: "#98fb98",
paleturquoise: "#afeeee",
palevioletred: "#db7093",
papayawhip: "#ffefd5",
peachpuff: "#ffdab9",
peru: "#cd853f",
pink: "#ffc0cb",
plum: "#dda0dd",
powderblue: "#b0e0e6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#ff0000",
rosybrown: "#bc8f8f",
royalblue: "#4169e1",
saddlebrown: "#8b4513",
salmon: "#fa8072",
sandybrown: "#f4a460",
seagreen: "#2e8b57",
seashell: "#fff5ee",
sienna: "#a0522d",
silver: "#c0c0c0",
skyblue: "#87ceeb",
slateblue: "#6a5acd",
slategray: "#708090",
slategrey: "#708090",
snow: "#fffafa",
springgreen: "#00ff7f",
steelblue: "#4682b4",
tan: "#d2b48c",
teal: "#008080",
thistle: "#d8bfd8",
tomato: "#ff6347",
turquoise: "#40e0d0",
violet: "#ee82ee",
wheat: "#f5deb3",
white: "#ffffff",
whitesmoke: "#f5f5f5",
yellow: "#ffff00",
yellowgreen: "#9acd32"
};
function $e(e) {
var t = { r: 0, g: 0, b: 0 }, n = 1, o = null, r = null, a = null, i = !1, l = !1;
return typeof e == "string" && (e = Ua(e)), typeof e == "object" && (oe(e.r) && oe(e.g) && oe(e.b) ? (t = Na(e.r, e.g, e.b), i = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : oe(e.h) && oe(e.s) && oe(e.v) ? (o = tt(e.s), r = tt(e.v), t = La(e.h, o, r), i = !0, l = "hsv") : oe(e.h) && oe(e.s) && oe(e.l) && (o = tt(e.s), a = tt(e.l), t = Ba(e.h, o, a), i = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Qo(n), {
ok: i,
format: e.format || l,
r: Math.min(255, Math.max(t.r, 0)),
g: Math.min(255, Math.max(t.g, 0)),
b: Math.min(255, Math.max(t.b, 0)),
a: n
};
}
var ja = "[-\\+]?\\d+%?", Wa = "[-\\+]?\\d*\\.\\d+%?", se = "(?:".concat(Wa, ")|(?:").concat(ja, ")"), Lt = "[\\s|\\(]+(".concat(se, ")[,|\\s]+(").concat(se, ")[,|\\s]+(").concat(se, ")\\s*\\)?"), zt = "[\\s|\\(]+(".concat(se, ")[,|\\s]+(").concat(se, ")[,|\\s]+(").concat(se, ")[,|\\s]+(").concat(se, ")\\s*\\)?"), Q = {
CSS_UNIT: new RegExp(se),
rgb: new RegExp("rgb" + Lt),
rgba: new RegExp("rgba" + zt),
hsl: new RegExp("hsl" + Lt),
hsla: new RegExp("hsla" + zt),
hsv: new RegExp("hsv" + Lt),
hsva: new RegExp("hsva" + zt),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function Ua(e) {
if (e = e.trim().toLowerCase(), e.length === 0)
return !1;
var t = !1;
if (Jt[e])
e = Jt[e], t = !0;
else if (e === "transparent")
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
var n = Q.rgb.exec(e);
return n ? { r: n[1], g: n[2], b: n[3] } : (n = Q.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = Q.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = Q.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = Q.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = Q.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = Q.hex8.exec(e), n ? {
r: K(n[1]),
g: K(n[2]),
b: K(n[3]),
a: Qn(n[4]),
format: t ? "name" : "hex8"
} : (n = Q.hex6.exec(e), n ? {
r: K(n[1]),
g: K(n[2]),
b: K(n[3]),
format: t ? "name" : "hex"
} : (n = Q.hex4.exec(e), n ? {
r: K(n[1] + n[1]),
g: K(n[2] + n[2]),
b: K(n[3] + n[3]),
a: Qn(n[4] + n[4]),
format: t ? "name" : "hex8"
} : (n = Q.hex3.exec(e), n ? {
r: K(n[1] + n[1]),
g: K(n[2] + n[2]),
b: K(n[3] + n[3]),
format: t ? "name" : "hex"
} : !1)))))))));
}
function oe(e) {
return !!Q.CSS_UNIT.exec(String(e));
}
var G = (
/** @class */
function() {
function e(t, n) {
t === void 0 && (t = ""), n === void 0 && (n = {});
var o;
if (t instanceof e)
return t;
typeof t == "number" && (t = Fa(t)), this.originalInput = t;
var r = $e(t);
this.originalInput = t, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (o = n.format) !== null && o !== void 0 ? o : r.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok;
}
return e.prototype.isDark = function() {
return this.getBrightness() < 128;
}, e.prototype.isLight = function() {
return !this.isDark();
}, e.prototype.getBrightness = function() {
var t = this.toRgb();
return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
}, e.prototype.getLuminance = function() {
var t = this.toRgb(), n, o, r, a = t.r / 255, i = t.g / 255, l = t.b / 255;
return a <= 0.03928 ? n = a / 12.92 : n = Math.pow((a + 0.055) / 1.055, 2.4), i <= 0.03928 ? o = i / 12.92 : o = Math.pow((i + 0.055) / 1.055, 2.4), l <= 0.03928 ? r = l / 12.92 : r = Math.pow((l + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * o + 0.0722 * r;
}, e.prototype.getAlpha = function() {
return this.a;
}, e.prototype.setAlpha = function(t) {
return this.a = Qo(t), this.roundA = Math.round(100 * this.a) / 100, this;
}, e.prototype.isMonochrome = function() {
var t = this.toHsl().s;
return t === 0;
}, e.prototype.toHsv = function() {
var t = Qt(this.r, this.g, this.b);
return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
}, e.prototype.toHsvString = function() {
var t = Qt(this.r, this.g, this.b), n = Math.round(t.h * 360), o = Math.round(t.s * 100), r = Math.round(t.v * 100);
return this.a === 1 ? "hsv(".concat(n, ", ").concat(o, "%, ").concat(r, "%)") : "hsva(".concat(n, ", ").concat(o, "%, ").concat(r, "%, ").concat(this.roundA, ")");
}, e.prototype.toHsl = function() {
var t = qn(this.r, this.g, this.b);
return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
}, e.prototype.toHslString = function() {
var t = qn(this.r, this.g, this.b), n = Math.round(t.h * 360), o = Math.round(t.s * 100), r = Math.round(t.l * 100);
return this.a === 1 ? "hsl(".concat(n, ", ").concat(o, "%, ").concat(r, "%)") : "hsla(".concat(n, ", ").concat(o, "%, ").concat(r, "%, ").concat(this.roundA, ")");
}, e.prototype.toHex = function(t) {
return t === void 0 && (t = !1), Zt(this.r, this.g, this.b, t);
}, e.prototype.toHexString = function(t) {
return t === void 0 && (t = !1), "#" + this.toHex(t);
}, e.prototype.toHex8 = function(t) {
return t === void 0 && (t = !1), za(this.r, this.g, this.b, this.a, t);
}, e.prototype.toHex8String = function(t) {
return t === void 0 && (t = !1), "#" + this.toHex8(t);
}, e.prototype.toHexShortString = function(t) {
return t === void 0 && (t = !1), this.a === 1 ? this.toHexString(t) : this.toHex8String(t);
}, e.prototype.toRgb = function() {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a
};
}, e.prototype.toRgbString = function() {
var t = Math.round(this.r), n = Math.round(this.g), o = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(t, ", ").concat(n, ", ").concat(o, ")") : "rgba(".concat(t, ", ").concat(n, ", ").concat(o, ", ").concat(this.roundA, ")");
}, e.prototype.toPercentageRgb = function() {
var t = function(n) {
return "".concat(Math.round(F(n, 255) * 100), "%");
};
return {
r: t(this.r),
g: t(this.g),
b: t(this.b),
a: this.a
};
}, e.prototype.toPercentageRgbString = function() {
var t = function(n) {
return Math.round(F(n, 255) * 100);
};
return this.a === 1 ? "rgb(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%)") : "rgba(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%, ").concat(this.roundA, ")");
}, e.prototype.toName = function() {
if (this.a === 0)
return "transparent";
if (this.a < 1)
return !1;
for (var t = "#" + Zt(this.r, this.g, this.b, !1), n = 0, o = Object.entries(Jt); n < o.length; n++) {
var r = o[n], a = r[0], i = r[1];
if (t === i)
return a;
}
return !1;
}, e.prototype.toString = function(t) {
var n = !!t;
t = t ?? this.format;
var o = !1, r = this.a < 1 && this.a >= 0, a = !n && r && (t.startsWith("hex") || t === "name");
return a ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (o = this.toRgbString()), t === "prgb" && (o = this.toPercentageRgbString()), (t === "hex" || t === "hex6")