@dcodegroup-au/dsg-vue
Version:
Front-end Vue/Tailwind DSG for UntitledUI.
1,687 lines • 758 kB
JavaScript
import { _ as ge, D as dt, a as yo, b as Ai, c as pn, k as wo, d as Ot, e as ki, u as mo, f as Da, g as Ao, h as Eo, i as bo, j as _o } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-BoJ6hpYL.js";
import { defineComponent as ve, openBlock as E, createElementBlock as O, normalizeClass as Q, unref as je, createVNode as Y, normalizeProps as Na, guardReactiveProps as Co, ref as re, renderSlot as X, createCommentVNode as P, createElementVNode as M, Fragment as Te, renderList as Ke, Transition as Qn, withCtx as Pe, useTemplateRef as wt, toDisplayString as j, createBlock as K, reactive as Ht, mergeProps as ke, toRaw as ot, createApp as So, nextTick as Br, computed as xe, onMounted as fr, onUnmounted as Ei, h as jr, isVNode as Ra, cloneVNode as Io, watchEffect as Nr, useAttrs as Oo, onBeforeUnmount as bi, withKeys as ft, withModifiers as Ae, withDirectives as qt, vShow as br, normalizeStyle as tr, createTextVNode as Zt, Teleport as Pa, watch as Mr, useModel as gn, mergeModels as xn, vModelSelect as To, resolveDynamicComponent as Do } from "vue";
import { C as No } from "./DsgColoursConfig-BseFo6-R.js";
import { _ as Ba } from "./DsgLabel.vue_vue_type_style_index_0_lang-BYL1w85l.js";
const Ro = /* @__PURE__ */ ve({
__name: "DsgMiscIcon",
props: {
theme: { default: "brand" },
type: { default: "light-outline" },
size: { default: "lg" },
icon: {},
classes: { default: "" }
},
setup(t) {
const e = ["dsg-misc-icon", `dsg-misc-icon--${t.theme}`, `dsg-misc-icon--${t.type}`, `dsg-misc-icon--${t.size}`, t.classes].join(" ").replace(/\s+/g, " ").trim();
return (r, n) => (E(), O("div", {
class: Q(je(e))
}, [
Y(ge, Na(Co(t.icon)), null, 16)
], 2));
}
}), cr = (t, e) => {
const r = t.__vccOpts || t;
for (const [n, i] of e)
r[n] = i;
return r;
}, Qt = /* @__PURE__ */ cr(Ro, [["__scopeId", "data-v-6f50208c"]]), Po = {
key: 0,
class: "dsg-accordion--header"
}, Bo = { class: "dsg-accordion--row-content" }, Mo = {
key: 0,
class: "dsg-accordion--expanded"
}, Lo = /* @__PURE__ */ ve({
__name: "DsgAccordion",
props: {
rows: {},
class: {},
rowKey: { type: Function }
},
setup(t) {
const e = t, r = re(null), n = (a) => {
r.value = r.value === a ? null : a;
}, i = e.rowKey ?? ((a, o) => o);
return (a, o) => (E(), O("div", {
class: Q(["dsg-accordion", t.class])
}, [
a.$slots.header ? (E(), O("div", Po, [
X(a.$slots, "header", {}, void 0, !0)
])) : P("", !0),
M("div", null, [
(E(!0), O(Te, null, Ke(t.rows, (s, u) => (E(), O("div", {
key: je(i)(s, u),
class: "dsg-accordion--row"
}, [
M("div", Bo, [
X(a.$slots, "row", {
row: s,
index: u,
isExpanded: r.value === u,
toggle: () => n(u)
}, void 0, !0)
]),
Y(Qn, { name: "accordion" }, {
default: Pe(() => [
r.value === u ? (E(), O("div", Mo, [
X(a.$slots, "expanded", {
row: s,
index: u
}, void 0, !0)
])) : P("", !0)
]),
_: 2
}, 1024)
]))), 128))
])
], 2));
}
}), ko = /* @__PURE__ */ cr(Lo, [["__scopeId", "data-v-d17346aa"]]), Fo = `<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Size=4xl" clip-path="url(#clip0_3302_422487)">
<path id="Vector" d="M24.711 5.66721C25.0149 6.40224 25.5983 6.98649 26.3328 7.29151L28.9086 8.35843C29.6437 8.66292 30.2277 9.24694 30.5322 9.98202C30.8367 10.7171 30.8367 11.543 30.5322 12.2781L29.466 14.8521C29.1614 15.5875 29.161 16.4142 29.467 17.1493L30.5313 19.7224C30.6822 20.0865 30.76 20.4768 30.76 20.8709C30.7601 21.265 30.6825 21.6553 30.5317 22.0194C30.3808 22.3836 30.1597 22.7144 29.881 22.993C29.6023 23.2717 29.2714 23.4927 28.9072 23.6434L26.3333 24.7096C25.5982 25.0135 25.014 25.5968 24.709 26.3314L23.642 28.9072C23.3376 29.6423 22.7535 30.2263 22.0185 30.5308C21.2834 30.8353 20.4574 30.8353 19.7224 30.5308L17.1484 29.4646C16.4133 29.1609 15.5877 29.1615 14.853 29.4663L12.2773 30.5317C11.5426 30.8355 10.7174 30.8353 9.98289 30.531C9.2484 30.2268 8.6647 29.6435 8.36001 28.9092L7.29277 26.3326C6.98885 25.5976 6.40548 25.0133 5.67091 24.7083L3.09514 23.6414C2.36037 23.337 1.77652 22.7534 1.47193 22.0187C1.16734 21.2841 1.16692 20.4585 1.47078 19.7236L2.53694 17.1496C2.84067 16.4145 2.84005 15.5889 2.53521 14.8542L1.47059 12.2766C1.31964 11.9125 1.24192 11.5223 1.24186 11.1282C1.24179 10.734 1.31939 10.3438 1.47022 9.97962C1.62104 9.6155 1.84214 9.28466 2.12088 9.00601C2.39961 8.72737 2.73052 8.50638 3.09469 8.35567L5.66862 7.28951C6.40301 6.98586 6.98691 6.40322 7.29216 5.6695L8.35908 3.09372C8.66357 2.35864 9.24759 1.77461 9.98267 1.47013C10.7178 1.16565 11.5437 1.16565 12.2788 1.47013L14.8527 2.53629C15.5878 2.84002 16.4134 2.8394 17.1481 2.53456L19.7249 1.47178C20.4599 1.16747 21.2857 1.16754 22.0206 1.47196C22.7556 1.77638 23.3395 2.36023 23.644 3.09513L24.7113 5.67167L24.711 5.66721Z" fill="#0788F5"/>
<path id="Vector_2" fill-rule="evenodd" clip-rule="evenodd" d="M22.2665 11.8058C22.4803 11.4701 22.5519 11.0631 22.4656 10.6746C22.3794 10.286 22.1423 9.94759 21.8065 9.73383C21.4708 9.52006 21.0638 9.44843 20.6753 9.5347C20.2867 9.62097 19.9483 9.85806 19.7345 10.1938L13.8605 19.4238L11.1725 16.0638C10.924 15.753 10.5622 15.5536 10.1667 15.5095C9.77118 15.4655 9.37436 15.5803 9.06352 15.8288C8.75269 16.0773 8.55331 16.4391 8.50923 16.8347C8.46516 17.2302 8.58001 17.627 8.82852 17.9378L12.8285 22.9378C12.9776 23.1244 13.1691 23.2727 13.387 23.3703C13.6049 23.468 13.843 23.5122 14.0815 23.4993C14.32 23.4864 14.5519 23.4167 14.758 23.2961C14.9641 23.1755 15.1385 23.0074 15.2665 22.8058L22.2665 11.8058Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_3302_422487">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>
`, Uo = ["href", "title"], Vo = {
class: "dsg-avatar--image-wrapper",
tabindex: "0",
ref: "avatarImageWrapperEl"
}, $o = ["src", "alt"], Ho = {
key: 1,
class: "dsg-avatar--initials"
}, Go = { class: "dsg-avatar--status" }, zo = {
key: 0,
class: "dsg-avatar--activity"
}, Wo = ["innerHTML"], Xo = {
key: 2,
class: "dsg-avatar--logo"
}, jo = ["src", "alt"], Ko = {
key: 0,
class: "dsg-avatar--info"
}, Yo = { class: "dsg-avatar--title" }, Zo = { class: "dsg-avatar--subtext" }, Lr = /* @__PURE__ */ ve({
__name: "DsgAvatar",
props: {
profileUri: { default: "" },
fullName: { default: "" },
size: { default: "md" },
theme: { default: "activity" },
isOnline: { type: Boolean, default: !1 },
uri: { default: () => {
} },
classes: { default: "" },
companyLogoUri: { default: () => {
} },
preventDefault: { type: Boolean, default: !1 },
title: { default: "" },
subText: { default: "" },
noFocus: { type: Boolean, default: !1 }
},
emits: ["avatar-clicked", "before-change-status", "after-change-status"],
setup(t, { expose: e, emit: r }) {
const n = [
"dsg-avatar",
`dsg-avatar--${t.size}`,
`dsg-avatar--${t.theme}`,
`dsg-avatar--${t.isOnline ? "online" : "offline"}`,
`dsg-avatar--${t.title?.length ? "has-info" : "no-info"}`,
`dsg-avatar--${t.uri ? "has-link" : "no-link"}`,
`dsg-avatar--${t.noFocus ? "no-focus" : "focus"}`,
`dsg-avatar--${["profile-photo", "profile-photo-verified"].indexOf(t.theme) !== -1 ? "profile-photo" : "non-profile-photo"}`,
t.classes
].join(" ");
["profile-photo", "profile-photo-verified"].indexOf(t.theme) !== -1 && (["sm", "md", "lg"].indexOf(t.size) === -1 && new dt("DsgAvatar: The 'profile-photo' theme only supports the 'sm', 'md', and 'lg' sizes."), (t.fullName || t.title || t.subText) && new yo("DsgAvatar: The 'profile-photo' theme will not display the 'title' or 'subText' props.")), t.theme === "logo" && !t.companyLogoUri && new dt("DsgAvatar: The 'logo' theme requires a 'companyLogoUri' prop."), ["activity", "verified", "logo"].indexOf(t.theme) !== -1 && t.title?.length && t.subText?.length && ["xs", "sm", "md", "lg", "xl", "2xl"].indexOf(t.size) === -1 && new dt(
"DsgAvatar: The 'activity', 'verified', and 'logo' themes only support the 'xs', 'sm', 'md', 'lg', and 'xl' sizes when 'title' and 'subText' are provided."
), t.theme === "tile" && !t.title?.length && !t.fullName && new dt("DsgAvatar: The 'tile' theme requires either 'title' or 'fullName' prop."), t.size === "xxs" && (t.title?.length || t.subText?.length) && new dt("DsgAvatar: The 'xxs' size does not support the 'title' or 'subText' props.");
const i = (h) => {
const d = h.split(" ");
return (d[0].charAt(0) + d[d.length - 1].charAt(0)).toUpperCase();
}, a = () => t.fullName ? "Avatar of " + t.fullName : "Avatar", o = r, s = re(!1), u = (h) => {
o("before-change-status", s.value, h), s.value = h, o("after-change-status", s.value);
}, l = wt("avatarImageWrapperEl"), f = (h) => {
t.preventDefault || (o("avatar-clicked", h), l.value && !t.uri && l.value.focus());
};
return e({
setUserActiveStatus: u,
toggleFocus: (h) => {
l.value && (h ? l.value.focus() : l.value.blur());
}
}), (h, d) => (E(), O("div", {
class: Q(je(n))
}, [
M("a", {
class: "dsg-avatar--link",
href: t.uri,
title: a(),
target: "_blank",
ref: "avatarLink",
onClick: f
}, [
M("div", Vo, [
X(h.$slots, "dsg-avatar--background", {}, () => [
t.profileUri ? (E(), O("img", {
key: 0,
class: "dsg-avatar--profile-image",
src: t.profileUri,
alt: a()
}, null, 8, $o)) : P("", !0),
!t.profileUri && t.fullName ? (E(), O("span", Ho, j(i(t.fullName)), 1)) : P("", !0),
!t.profileUri && !t.fullName ? (E(), K(ge, {
key: 2,
class: "dsg-avatar--user-icon",
icon: "user-01",
color: je(No).gray[600],
size: t.size
}, null, 8, ["color", "size"])) : P("", !0)
]),
["tile"].indexOf(t.theme) === -1 ? X(h.$slots, "dsg-avatar--status", { key: 0 }, () => [
M("div", Go, [
t.theme === "activity" && t.isOnline ? (E(), O("span", zo)) : P("", !0),
["verified", "profile-photo-verified"].indexOf(t.theme) !== -1 ? (E(), O("span", {
key: 1,
class: "dsg-avatar--verified",
innerHTML: je(Fo)
}, null, 8, Wo)) : P("", !0),
t.theme === "logo" ? (E(), O("span", Xo, [
M("img", {
src: t.companyLogoUri,
alt: a(),
class: "dsg-avatar--company-logo"
}, null, 8, jo)
])) : P("", !0)
])
]) : P("", !0)
], 512),
t.title?.length || t.theme === "tile" && (t.title?.length || t.fullName) ? (E(), O("div", Ko, [
t.title?.length || t.theme === "tile" && (t.title?.length || t.fullName) ? X(h.$slots, "dsg-avatar--title", { key: 0 }, () => [
M("h3", Yo, j(t.title?.length ? t.title : t.fullName), 1)
]) : P("", !0),
t.subText?.length ? X(h.$slots, "dsg-avatar--subtext", { key: 1 }, () => [
M("p", Zo, j(t.subText), 1)
]) : P("", !0)
])) : P("", !0)
], 8, Uo)
], 2));
}
}), $r = {
TOP_LEFT: "top-left",
TOP_RIGHT: "top-right",
TOP_CENTER: "top-center",
BOTTOM_LEFT: "bottom-left",
BOTTOM_RIGHT: "bottom-right",
BOTTOM_CENTER: "bottom-center"
}, nr = {
LIGHT: "light",
DARK: "dark",
COLORED: "colored",
AUTO: "auto"
}, $e = {
INFO: "info",
SUCCESS: "success",
WARNING: "warning",
ERROR: "error",
DEFAULT: "default"
}, qo = {
BOUNCE: "bounce",
SLIDE: "slide",
FLIP: "flip",
ZOOM: "zoom",
NONE: "none"
}, Qo = {
dangerouslyHTMLString: !1,
multiple: !0,
position: $r.TOP_RIGHT,
autoClose: 5e3,
transition: "bounce",
hideProgressBar: !1,
pauseOnHover: !0,
pauseOnFocusLoss: !0,
closeOnClick: !0,
className: "",
bodyClassName: "",
style: {},
progressClassName: "",
progressStyle: {},
role: "alert",
theme: "light"
}, Jo = {
rtl: !1,
newestOnTop: !1,
toastClassName: ""
}, Ma = {
...Qo,
...Jo
};
$e.DEFAULT;
var ee = /* @__PURE__ */ ((t) => (t[t.COLLAPSE_DURATION = 300] = "COLLAPSE_DURATION", t[t.DEBOUNCE_DURATION = 50] = "DEBOUNCE_DURATION", t.CSS_NAMESPACE = "Toastify", t))(ee || {}), Jn = /* @__PURE__ */ ((t) => (t.ENTRANCE_ANIMATION_END = "d", t))(Jn || {});
const es = {
enter: "Toastify--animate Toastify__bounce-enter",
exit: "Toastify--animate Toastify__bounce-exit",
appendPosition: !0
}, ts = {
enter: "Toastify--animate Toastify__slide-enter",
exit: "Toastify--animate Toastify__slide-exit",
appendPosition: !0
}, rs = {
enter: "Toastify--animate Toastify__zoom-enter",
exit: "Toastify--animate Toastify__zoom-exit"
}, ns = {
enter: "Toastify--animate Toastify__flip-enter",
exit: "Toastify--animate Toastify__flip-exit"
}, Fi = "Toastify--animate Toastify__none-enter";
function La(t, e = !1) {
var r;
let n = es;
if (!t || typeof t == "string")
switch (t) {
case "flip":
n = ns;
break;
case "zoom":
n = rs;
break;
case "slide":
n = ts;
break;
}
else
n = t;
if (e)
n.enter = Fi;
else if (n.enter === Fi) {
const i = (r = n.exit.split("__")[1]) == null ? void 0 : r.split("-")[0];
n.enter = `Toastify--animate Toastify__${i}-enter`;
}
return n;
}
function is(t) {
return t.containerId || String(t.position);
}
const _n = "will-unmount";
function as(t = $r.TOP_RIGHT) {
return !!document.querySelector(`.${ee.CSS_NAMESPACE}__toast-container--${t}`);
}
function os(t = $r.TOP_RIGHT) {
return `${ee.CSS_NAMESPACE}__toast-container--${t}`;
}
function ss(t, e, r = !1) {
const n = [
`${ee.CSS_NAMESPACE}__toast-container`,
`${ee.CSS_NAMESPACE}__toast-container--${t}`,
r ? `${ee.CSS_NAMESPACE}__toast-container--rtl` : null
].filter(Boolean).join(" ");
return rr(e) ? e({
position: t,
rtl: r,
defaultClassName: n
}) : `${n} ${e || ""}`;
}
function us(t) {
var e;
const { position: r, containerClassName: n, rtl: i = !1, style: a = {} } = t, o = ee.CSS_NAMESPACE, s = os(r), u = document.querySelector(`.${o}`), l = document.querySelector(`.${s}`), f = !!l && !((e = l.className) != null && e.includes(_n)), c = u || document.createElement("div"), h = document.createElement("div");
h.className = ss(
r,
n,
i
), h.dataset.testid = `${ee.CSS_NAMESPACE}__toast-container--${r}`, h.id = is(t);
for (const d in a)
if (Object.prototype.hasOwnProperty.call(a, d)) {
const v = a[d];
h.style[d] = v;
}
return u || (c.className = ee.CSS_NAMESPACE, document.body.appendChild(c)), f || c.appendChild(h), h;
}
function ei(t) {
var e, r, n;
const i = typeof t == "string" ? t : ((e = t.currentTarget) == null ? void 0 : e.id) || ((r = t.target) == null ? void 0 : r.id), a = document.getElementById(i);
a && a.removeEventListener("animationend", ei, !1);
try {
kr[i].unmount(), (n = document.getElementById(i)) == null || n.remove(), delete kr[i], delete Oe[i];
} catch {
}
}
const kr = Ht({});
function ls(t, e) {
const r = document.getElementById(String(e));
r && (kr[r.id] = t);
}
function ti(t, e = !0) {
const r = String(t);
if (!kr[r]) return;
const n = document.getElementById(r);
n && n.classList.add(_n), e ? (cs(t), n && n.addEventListener("animationend", ei, !1)) : ei(r), rt.items = rt.items.filter((i) => i.containerId !== t);
}
function fs(t) {
for (const e in kr)
ti(e, t);
rt.items = [];
}
function ka(t, e) {
const r = document.getElementById(t.toastId);
if (r) {
let n = t;
n = {
...n,
...La(n.transition)
};
const i = n.appendPosition ? `${n.exit}--${n.position}` : n.exit;
r.className += ` ${i}`, e && e(r);
}
}
function cs(t) {
for (const e in Oe)
if (e === t)
for (const r of Oe[e] || [])
ka(r);
}
function ds(t) {
const e = ir().find((r) => r.toastId === t);
return e?.containerId;
}
function _i(t) {
return document.getElementById(t);
}
function hs(t) {
const e = _i(t.containerId);
return e && e.classList.contains(_n);
}
function Ui(t) {
var e;
const r = Ra(t.content) ? ot(t.content.props) : null;
return r ?? ot((e = t.data) != null ? e : {});
}
function vs(t) {
return t ? rt.items.filter((e) => e.containerId === t).length > 0 : rt.items.length > 0;
}
function ps() {
if (rt.items.length > 0) {
const t = rt.items.shift();
on(t?.toastContent, t?.toastProps);
}
}
const Oe = Ht({}), rt = Ht({ items: [] });
function ir() {
const t = ot(Oe);
return Object.values(t).reduce((e, r) => [...e, ...r], []);
}
function gs(t) {
return ir().find((e) => e.toastId === t);
}
function on(t, e = {}) {
if (hs(e)) {
const r = _i(e.containerId);
r && r.addEventListener("animationend", ri.bind(null, t, e), !1);
} else
ri(t, e);
}
function ri(t, e = {}) {
const r = _i(e.containerId);
r && r.removeEventListener("animationend", ri.bind(null, t, e), !1);
const n = Oe[e.containerId] || [], i = n.length > 0;
if (!i && !as(e.position)) {
const a = us(e), o = So(Vs, e);
e.useHandler && e.useHandler(o), o.mount(a), ls(o, a.id);
}
i && !e.updateId && (e.position = n[0].position), Br(() => {
e.updateId ? Qe.update(e) : Qe.add(t, e);
});
}
const Qe = {
/**
* add a toast
* @param _ ..
* @param opts toast props
*/
add(t, e) {
const { containerId: r = "" } = e;
r && (Oe[r] = Oe[r] || [], Oe[r].find((n) => n.toastId === e.toastId) || setTimeout(() => {
var n, i;
e.newestOnTop ? (n = Oe[r]) == null || n.unshift(e) : (i = Oe[r]) == null || i.push(e), e.onOpen && e.onOpen(Ui(e));
}, e.delay || 0));
},
/**
* remove a toast
* @param id toastId
*/
remove(t) {
if (t) {
const e = ds(t);
if (e) {
const r = Oe[e];
let n = r.find((i) => i.toastId === t);
Oe[e] = r.filter((i) => i.toastId !== t), !Oe[e].length && !vs(e) && ti(e, !1), ps(), Br(() => {
n != null && n.onClose && (n.onClose(Ui(n)), n = void 0);
});
}
}
},
/**
* update the toast
* @param opts toast props
*/
update(t = {}) {
const { containerId: e = "" } = t;
if (e && t.updateId) {
Oe[e] = Oe[e] || [];
const r = Oe[e].find((a) => a.toastId === t.toastId), n = r?.position !== t.position || r?.transition !== t.transition, i = {
...t,
disabledEnterTransition: !n,
updateId: void 0
};
Qe.dismissForce(t?.toastId), setTimeout(() => {
le(i.content, i);
}, t.delay || 0);
}
},
/**
* clear all toasts in container.
* @param containerId container id
*/
clear(t, e = !0) {
t ? ti(t, e) : fs(e);
},
dismissCallback(t) {
var e;
const r = (e = t.currentTarget) == null ? void 0 : e.id, n = document.getElementById(r);
n && (n.removeEventListener("animationend", Qe.dismissCallback, !1), setTimeout(() => {
Qe.remove(r);
}));
},
dismiss(t) {
if (t) {
const e = ir();
for (const r of e)
if (r.toastId === t) {
ka(r, (n) => {
n.addEventListener("animationend", Qe.dismissCallback, !1);
});
break;
}
}
},
dismissForce(t) {
if (t) {
const e = ir();
for (const r of e)
if (r.toastId === t) {
const n = document.getElementById(t);
n && (n.remove(), n.removeEventListener("animationend", Qe.dismissCallback, !1), Qe.remove(t));
break;
}
}
}
}, xs = Ht({ useHandler: void 0 }), Fa = Ht({}), yn = Ht({});
function Ua() {
return Math.random().toString(36).substring(2, 9);
}
function ys(t) {
return typeof t == "number" && !isNaN(t);
}
function ni(t) {
return typeof t == "string";
}
function rr(t) {
return typeof t == "function";
}
function Cn(...t) {
return ke(...t);
}
function sn(t) {
return typeof t == "object" && (!!(t != null && t.render) || !!(t != null && t.setup) || typeof t?.type == "object");
}
function ws(t = {}) {
Fa[`${ee.CSS_NAMESPACE}-default-options`] = t;
}
function Va() {
return Fa[`${ee.CSS_NAMESPACE}-default-options`] || Ma;
}
function ms() {
const t = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
return document.documentElement.classList.contains("dark") || t ? "dark" : "light";
}
var un = /* @__PURE__ */ ((t) => (t[t.Enter = 0] = "Enter", t[t.Exit = 1] = "Exit", t))(un || {});
const $a = {
containerId: {
type: [String, Number],
required: !1,
default: ""
},
clearOnUrlChange: {
type: Boolean,
required: !1,
default: !0
},
disabledEnterTransition: {
type: Boolean,
required: !1,
default: !1
},
dangerouslyHTMLString: {
type: Boolean,
required: !1,
default: !1
},
multiple: {
type: Boolean,
required: !1,
default: !0
},
limit: {
type: Number,
required: !1,
default: void 0
},
position: {
type: String,
required: !1,
default: $r.TOP_LEFT
},
bodyClassName: {
type: String,
required: !1,
default: ""
},
autoClose: {
type: [Number, Boolean],
required: !1,
default: !1
},
closeButton: {
type: [Boolean, Function, Object],
required: !1,
default: void 0
},
transition: {
type: [String, Object],
required: !1,
default: "bounce"
},
hideProgressBar: {
type: Boolean,
required: !1,
default: !1
},
pauseOnHover: {
type: Boolean,
required: !1,
default: !0
},
pauseOnFocusLoss: {
type: Boolean,
required: !1,
default: !0
},
closeOnClick: {
type: Boolean,
required: !1,
default: !0
},
progress: {
type: Number,
required: !1,
default: void 0
},
progressClassName: {
type: String,
required: !1,
default: ""
},
toastStyle: {
type: Object,
required: !1,
default() {
return {};
}
},
progressStyle: {
type: Object,
required: !1,
default() {
return {};
}
},
role: {
type: String,
required: !1,
default: "alert"
},
theme: {
type: String,
required: !1,
default: nr.AUTO
},
content: {
type: [String, Object, Function],
required: !1,
default: ""
},
toastId: {
type: [String, Number],
required: !1,
default: ""
},
data: {
type: [Object, String],
required: !1,
default() {
return {};
}
},
type: {
type: String,
required: !1,
default: $e.DEFAULT
},
icon: {
type: [Boolean, String, Number, Object, Function],
required: !1,
default: void 0
},
delay: {
type: Number,
required: !1,
default: void 0
},
onOpen: {
type: Function,
required: !1,
default: void 0
},
onClose: {
type: Function,
required: !1,
default: void 0
},
onClick: {
type: Function,
required: !1,
default: void 0
},
isLoading: {
type: Boolean,
required: !1,
default: void 0
},
rtl: {
type: Boolean,
required: !1,
default: !1
},
toastClassName: {
type: String,
required: !1,
default: ""
},
updateId: {
type: [String, Number],
required: !1,
default: ""
},
contentProps: {
type: Object,
required: !1,
default: null
},
expandCustomProps: {
type: Boolean,
required: !1,
default: !1
}
}, As = {
autoClose: {
type: [Number, Boolean],
required: !0
},
isRunning: {
type: Boolean,
required: !1,
default: void 0
},
type: {
type: String,
required: !1,
default: $e.DEFAULT
},
theme: {
type: String,
required: !1,
default: nr.AUTO
},
hide: {
type: Boolean,
required: !1,
default: void 0
},
className: {
type: [String, Function],
required: !1,
default: ""
},
controlledProgress: {
type: Boolean,
required: !1,
default: void 0
},
rtl: {
type: Boolean,
required: !1,
default: void 0
},
isIn: {
type: Boolean,
required: !1,
default: void 0
},
progress: {
type: Number,
required: !1,
default: void 0
},
closeToast: {
type: Function,
required: !1,
default: void 0
}
}, Es = /* @__PURE__ */ ve({
name: "ProgressBar",
props: As,
// @ts-ignore
setup(t, {
attrs: e
}) {
const r = re(), n = xe(() => t.hide ? "true" : "false"), i = xe(() => ({
...e.style || {},
animationDuration: `${t.autoClose === !0 ? 5e3 : t.autoClose}ms`,
animationPlayState: t.isRunning ? "running" : "paused",
opacity: t.hide || t.autoClose === !1 ? 0 : 1,
transform: t.controlledProgress ? `scaleX(${t.progress})` : "none"
})), a = xe(() => [`${ee.CSS_NAMESPACE}__progress-bar`, t.controlledProgress ? `${ee.CSS_NAMESPACE}__progress-bar--controlled` : `${ee.CSS_NAMESPACE}__progress-bar--animated`, `${ee.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`, `${ee.CSS_NAMESPACE}__progress-bar--${t.type}`, t.rtl ? `${ee.CSS_NAMESPACE}__progress-bar--rtl` : null].filter(Boolean).join(" ")), o = xe(() => `${a.value} ${e?.class || ""}`), s = () => {
r.value && (r.value.onanimationend = null, r.value.ontransitionend = null);
}, u = () => {
t.isIn && t.closeToast && t.autoClose !== !1 && (t.closeToast(), s());
}, l = xe(() => t.controlledProgress ? null : u), f = xe(() => t.controlledProgress ? u : null);
return Nr(() => {
r.value && (s(), r.value.onanimationend = l.value, r.value.ontransitionend = f.value);
}), () => Y("div", {
ref: r,
role: "progressbar",
"aria-hidden": n.value,
"aria-label": "notification timer",
class: o.value,
style: i.value
}, null);
}
}), bs = /* @__PURE__ */ ve({
name: "CloseButton",
inheritAttrs: !1,
props: {
theme: {
type: String,
required: !1,
default: nr.AUTO
},
type: {
type: String,
required: !1,
default: nr.LIGHT
},
ariaLabel: {
type: String,
required: !1,
default: "close"
},
closeToast: {
type: Function,
required: !1,
default: void 0
}
},
setup(t) {
return () => Y("button", {
class: `${ee.CSS_NAMESPACE}__close-button ${ee.CSS_NAMESPACE}__close-button--${t.theme}`,
type: "button",
onClick: (e) => {
e.stopPropagation(), t.closeToast && t.closeToast(e);
},
"aria-label": t.ariaLabel
}, [Y("svg", {
"aria-hidden": "true",
viewBox: "0 0 14 16"
}, [Y("path", {
"fill-rule": "evenodd",
d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"
}, null)])]);
}
}), Sn = ({
theme: t,
type: e,
path: r,
...n
}) => Y("svg", ke({
viewBox: "0 0 24 24",
width: "100%",
height: "100%",
style: {
fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${e})`
}
}, n), [Y("path", {
d: r
}, null)]);
function _s(t) {
return Y(Sn, ke(t, {
path: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"
}), null);
}
function Cs(t) {
return Y(Sn, ke(t, {
path: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"
}), null);
}
function Ss(t) {
return Y(Sn, ke(t, {
path: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"
}), null);
}
function Is(t) {
return Y(Sn, ke(t, {
path: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"
}), null);
}
function Os() {
return Y("div", {
class: `${ee.CSS_NAMESPACE}__spinner`
}, null);
}
const ln = {
info: Cs,
warning: _s,
success: Ss,
error: Is,
spinner: Os
}, Ts = (t) => t in ln;
function Ds({
theme: t,
type: e,
isLoading: r,
icon: n
}) {
let i;
const a = !!r || e === "loading", o = {
theme: t,
type: e
};
if (a && (n === void 0 || typeof n == "boolean")) return ln.spinner();
if (n !== !1) {
if (sn(n))
i = ot(n);
else if (rr(n)) {
const s = n;
o.type = a ? "loading" : e, i = s(o), i = !i && a ? ln.spinner() : i;
} else Ra(n) ? i = Io(n, o) : ni(n) || ys(n) ? i = n : Ts(e) && (i = ln[e](o));
return i;
}
}
const Ns = () => {
};
function Rs(t, e, r = ee.COLLAPSE_DURATION) {
const { scrollHeight: n, style: i } = t, a = r;
requestAnimationFrame(() => {
i.minHeight = "initial", i.height = n + "px", i.transition = `all ${a}ms`, requestAnimationFrame(() => {
i.height = "0", i.padding = "0", i.margin = "0", setTimeout(e, a);
});
});
}
function Ps(t) {
const e = re(!1), r = re(!1), n = re(!1), i = re(un.Enter), a = Ht({
...t,
appendPosition: t.appendPosition || !1,
collapse: typeof t.collapse > "u" ? !0 : t.collapse,
collapseDuration: t.collapseDuration || ee.COLLAPSE_DURATION
}), o = a.done || Ns, s = xe(() => a.appendPosition ? `${a.enter}--${a.position}` : a.enter), u = xe(() => a.appendPosition ? `${a.exit}--${a.position}` : a.exit), l = xe(() => t.pauseOnHover ? {
onMouseenter: x,
onMouseleave: p
} : {});
function f() {
const y = s.value.split(" ");
h().addEventListener(
Jn.ENTRANCE_ANIMATION_END,
p,
{ once: !0 }
);
const m = (S) => {
const B = h();
S.target === B && (B.dispatchEvent(new Event(Jn.ENTRANCE_ANIMATION_END)), B.removeEventListener("animationend", m), B.removeEventListener("animationcancel", m), i.value === un.Enter && S.type !== "animationcancel" && B.classList.remove(...y));
}, b = () => {
const S = h();
S.classList.add(...y), S.addEventListener("animationend", m), S.addEventListener("animationcancel", m);
};
t.pauseOnFocusLoss && d(), b();
}
function c() {
if (!h()) return;
const y = () => {
const b = h();
b.removeEventListener("animationend", y), a.collapse ? Rs(b, o, a.collapseDuration) : o();
}, m = () => {
const b = h();
i.value = un.Exit, b && (b.className += ` ${u.value}`, b.addEventListener("animationend", y));
};
r.value || (n.value ? y() : setTimeout(m));
}
function h() {
return t.toastRef.value;
}
function d() {
document.hasFocus() || x(), window.addEventListener("focus", p), window.addEventListener("blur", x);
}
function v() {
window.removeEventListener("focus", p), window.removeEventListener("blur", x);
}
function p() {
(!t.loading.value || t.isLoading === void 0) && (e.value = !0);
}
function x() {
e.value = !1;
}
function w(y) {
y && (y.stopPropagation(), y.preventDefault()), r.value = !1;
}
return Nr(c), Nr(() => {
const y = ir();
r.value = y.findIndex((m) => m.toastId === a.toastId) > -1;
}), Nr(() => {
t.isLoading !== void 0 && (t.loading.value ? x() : p());
}), fr(f), Ei(() => {
t.pauseOnFocusLoss && v();
}), {
isIn: r,
isRunning: e,
hideToast: w,
eventHandlers: l
};
}
function Bs(t) {
if (!t || typeof t != "object" || Array.isArray(t) || t.__v_isVNode)
return !1;
const e = t;
return ["title", "content"].some((r) => r in e);
}
const Ms = /* @__PURE__ */ ve({
name: "ToastItem",
inheritAttrs: !1,
props: $a,
// @ts-ignore
setup(t) {
const e = re(), r = xe(() => !!t.isLoading), n = xe(() => t.progress !== void 0 && t.progress !== null), i = xe(() => Ds(t)), a = xe(() => [`${ee.CSS_NAMESPACE}__toast`, `${ee.CSS_NAMESPACE}__toast-theme--${t.theme}`, `${ee.CSS_NAMESPACE}__toast--${t.type}`, t.rtl ? `${ee.CSS_NAMESPACE}__toast--rtl` : void 0, t.toastClassName || ""].filter(Boolean).join(" ")), {
isRunning: o,
isIn: s,
hideToast: u,
eventHandlers: l
} = Ps({
toastRef: e,
loading: r,
done: () => {
Qe.remove(t.toastId);
},
...La(t.transition, t.disabledEnterTransition),
...t
});
function f() {
const c = t.content;
if (Bs(c)) {
const h = [];
return c.title !== void 0 && h.push(Y("div", {
"data-testid": "toast-text-title",
class: `${ee.CSS_NAMESPACE}__toast-text-title`
}, [c.title])), c.content !== void 0 && h.push(Y("div", {
"data-testid": "toast-text-content",
class: `${ee.CSS_NAMESPACE}__toast-text-content`
}, [c.content])), Y("div", {
"data-testid": "toast-text-content-wrapper",
class: `${ee.CSS_NAMESPACE}__toast-text`
}, [h]);
}
return sn(c) ? jr(ot(c), {
toastProps: ot(t),
closeToast: u,
data: t.data,
...t.expandCustomProps ? t.contentProps : {
contentProps: t.contentProps || {}
}
}) : rr(c) ? c({
toastProps: ot(t),
closeToast: u,
data: t.data
}) : t.dangerouslyHTMLString ? jr("div", {
innerHTML: c
}) : c;
}
return () => Y("div", ke({
id: t.toastId,
class: a.value,
style: t.toastStyle || {},
ref: e,
"data-testid": `toast-item-${t.toastId}`,
onClick: (c) => {
t.closeOnClick && u(), t.onClick && t.onClick(c);
}
}, l.value), [Y("div", {
role: t.role,
"data-testid": "toast-body",
class: `${ee.CSS_NAMESPACE}__toast-body ${t.bodyClassName || ""}`
}, [i.value != null && Y("div", {
"data-testid": `toast-icon-${t.type}`,
class: [`${ee.CSS_NAMESPACE}__toast-icon`, t.isLoading ? "" : `${ee.CSS_NAMESPACE}--animate-icon ${ee.CSS_NAMESPACE}__zoom-enter`].join(" ")
}, [sn(i.value) ? jr(ot(i.value), {
theme: t.theme,
type: t.type
}) : rr(i.value) ? i.value({
theme: t.theme,
type: t.type
}) : i.value]), Y("div", {
"data-testid": "toast-content"
}, [f()])]), (t.closeButton === void 0 || t.closeButton === !0) && Y(bs, {
theme: t.theme,
closeToast: (c) => {
c.stopPropagation(), c.preventDefault(), u();
}
}, null), sn(t.closeButton) ? jr(ot(t.closeButton), {
closeToast: u,
type: t.type,
theme: t.theme
}) : rr(t.closeButton) ? t.closeButton({
closeToast: u,
type: t.type,
theme: t.theme
}) : null, Y(Es, {
className: t.progressClassName,
style: t.progressStyle,
rtl: t.rtl,
theme: t.theme,
isIn: s.value,
type: t.type,
hide: t.hideProgressBar,
isRunning: o.value,
autoClose: t.autoClose,
controlledProgress: n.value,
progress: t.progress,
closeToast: t.isLoading ? void 0 : u
}, null)]);
}
}), wn = "vue3-toastify:url-change";
let Kr = 0, Rr;
function Ls() {
if (!(typeof window > "u") && yn.lastUrl !== window.location.href) {
yn.lastUrl = window.location.href;
const t = (r) => typeof r.clearOnUrlChange == "boolean" ? r.clearOnUrlChange : Va().clearOnUrlChange !== !1, e = Object.values(Oe).reduce((r, n) => (Array.isArray(n) && r.push(...n), r), []);
for (const r of e)
r.toastId && t(r) && Qe.dismiss(r.toastId);
rt.items = rt.items.filter((r) => !t(r.toastProps));
}
}
function ks() {
const {
history: t
} = window, e = t.pushState, r = t.replaceState;
return t.pushState = function(...n) {
const i = e.apply(this, n);
return window.dispatchEvent(new Event(wn)), i;
}, t.replaceState = function(...n) {
const i = r.apply(this, n);
return window.dispatchEvent(new Event(wn)), i;
}, () => {
t.pushState = e, t.replaceState = r;
};
}
function Fs() {
if (typeof window > "u" || Rr)
return;
const t = ks(), e = () => Ls();
window.addEventListener(wn, e), window.addEventListener("popstate", e), window.addEventListener("hashchange", e), Rr = () => {
t(), window.removeEventListener(wn, e), window.removeEventListener("popstate", e), window.removeEventListener("hashchange", e), Rr = void 0;
};
}
function Us() {
Rr && (Rr(), yn.lastUrl = "");
}
const Vs = /* @__PURE__ */ ve({
name: "ToastifyContainer",
inheritAttrs: !1,
props: $a,
// @ts-ignore
setup(t) {
const e = xe(() => t.containerId), r = xe(() => Oe[e.value] || []), n = xe(() => r.value.filter((i) => i.position === t.position));
return fr(() => {
typeof window < "u" && (Kr += 1, Fs());
}), Ei(() => {
typeof window < "u" && Kr > 0 && (Kr -= 1, Kr === 0 && Us());
}), () => Y(Te, null, [n.value.map((i) => {
const {
toastId: a = ""
} = i;
return Y(Ms, ke({
key: a
}, i), null);
})]);
}
});
let Rn = !1;
const Ha = {
isLoading: !0,
autoClose: !1,
closeOnClick: !1,
closeButton: !1,
draggable: !1
};
function Ga() {
const t = [];
return ir().forEach((e) => {
const r = document.getElementById(e.containerId);
r && !r.classList.contains(_n) && t.push(e);
}), t;
}
function $s(t) {
const e = Ga().length, r = t ?? 0;
return r > 0 && e + rt.items.length >= r;
}
function Hs(t) {
$s(t.limit) && !t.updateId && rt.items.push({
toastId: t.toastId,
containerId: t.containerId,
toastContent: t.content,
toastProps: t
});
}
function Rt(t, e, r = {}) {
if (Rn) return;
r = Cn(Va(), {
type: e
}, ot(r)), (!r.toastId || typeof r.toastId != "string" && typeof r.toastId != "number") && (r.toastId = Ua()), r = {
...r,
...r.type === "loading" ? Ha : {},
content: t,
containerId: r.containerId || String(r.position)
};
const n = Number(r?.progress);
return !isNaN(n) && n < 0 && (r.progress = 0), n > 1 && (r.progress = 1), r.theme === "auto" && (r.theme = ms()), Hs(r), yn.lastUrl = window.location.href, r.multiple ? rt.items.length ? r.updateId && on(t, r) : on(t, r) : (Rn = !0, le.clearAll(void 0, !1), setTimeout(() => {
on(t, r);
}, 0), setTimeout(() => {
Rn = !1;
}, 390)), r.toastId;
}
const le = (t, e) => Rt(t, $e.DEFAULT, e);
le.info = (t, e) => Rt(t, $e.DEFAULT, {
...e,
type: $e.INFO
});
le.error = (t, e) => Rt(t, $e.DEFAULT, {
...e,
type: $e.ERROR
});
le.warning = (t, e) => Rt(t, $e.DEFAULT, {
...e,
type: $e.WARNING
});
le.warn = le.warning;
le.success = (t, e) => Rt(t, $e.DEFAULT, {
...e,
type: $e.SUCCESS
});
le.loading = (t, e) => Rt(t, $e.DEFAULT, Cn(e, Ha));
le.dark = (t, e) => Rt(t, $e.DEFAULT, Cn(e, {
theme: nr.DARK
}));
le.remove = (t) => {
t ? Qe.dismiss(t) : Qe.clear();
};
le.clearAll = (t, e) => {
Br(() => {
Qe.clear(t, e);
});
};
le.isActive = (t) => {
let e = !1;
return e = Ga().findIndex((r) => r.toastId === t) > -1, e;
};
le.update = (t, e = {}) => {
setTimeout(() => {
const r = gs(t);
if (r) {
const n = ot(r), {
content: i
} = n, a = {
...n,
...e,
toastId: e.toastId || t,
updateId: Ua()
}, o = a.render || i;
delete a.render, Rt(o, a.type, a);
}
}, 0);
};
le.done = (t) => {
le.update(t, {
isLoading: !1,
progress: 1
});
};
le.promise = Gs;
function Gs(t, {
pending: e,
error: r,
success: n
}, i) {
var a, o, s;
let u;
const l = {
...i || {},
autoClose: !1
};
e && (u = ni(e) ? le.loading(e, l) : le.loading(e.render, {
...l,
...e
}));
const f = {
autoClose: (a = i?.autoClose) != null ? a : !0,
closeOnClick: (o = i?.closeOnClick) != null ? o : !0,
closeButton: (s = i?.autoClose) != null ? s : null,
isLoading: void 0,
draggable: null,
delay: 100
}, c = (d, v, p) => {
if (v == null) {
le.remove(u);
return;
}
const x = {
type: d,
...f,
...i,
data: p
}, w = ni(v) ? {
render: v
} : v;
return u ? le.update(u, {
...x,
...w,
isLoading: !1
}) : le(w.render, {
...x,
...w,
isLoading: !1
}), p;
}, h = rr(t) ? t() : t;
return h.then((d) => {
c("success", n, d);
}).catch((d) => {
c("error", r, d);
}), h;
}
le.POSITION = $r;
le.THEME = nr;
le.TYPE = $e;
le.TRANSITIONS = qo;
const zs = {
install(t, e = {}) {
xs.useHandler = e.useHandler || (() => {
}), Ws(e);
}
};
typeof window < "u" && (window.Vue3Toastify = zs);
function Ws(t = {}) {
const e = Cn(Ma, t);
ws(e);
}
const Xs = { class: "dsg-alert__wrapper" }, js = ["innerHTML"], za = /* @__PURE__ */ ve({
__name: "DsgAlertComponent",
props: {
contentProps: { default: () => ({ title: "", message: "", type: "gray", hasCloseButton: !0, useToast: !0, timeout: !1 }) }
},
setup(t) {
const e = ["dsg-alert", "dsg-alert--" + t.contentProps.type, t.contentProps.hasCloseButton ? "dsg-alert--has-close" : "dsg-alert--no-close"], n = Oo().closeToast, i = re(!1);
let a = null;
const o = () => {
t.contentProps.useToast ? n() : i.value = !0;
};
return fr(() => {
t.contentProps.timeout && t.contentProps.timeout > 0 && (a = setTimeout(() => {
o();
}, t.contentProps.timeout));
}), bi(() => {
a && (clearTimeout(a), a = null);
}), (s, u) => i.value ? P("", !0) : (E(), O("div", {
key: 0,
class: Q(e)
}, [
t.contentProps.type === "gray" ? (E(), K(Qt, {
key: 0,
icon: { icon: "info-circle" },
type: "outline",
theme: "gray",
size: "lg"
})) : P("", !0),
t.contentProps.type === "error" ? (E(), K(Qt, {
key: 1,
icon: { icon: "alert-circle" },
type: "outline",
theme: "error",
size: "lg"
})) : P("", !0),
t.contentProps.type === "warning" ? (E(), K(Qt, {
key: 2,
icon: { icon: "alert-circle" },
type: "outline",
theme: "warning",
size: "lg"
})) : P("", !0),
t.contentProps.type === "success" ? (E(), K(Qt, {
key: 3,
icon: { icon: "check-circle" },
type: "outline",
theme: "success",
size: "lg"
})) : P("", !0),
M("div", Xs, [
M("p", {
class: Q(["dsg-alert__title", { "dsg-alert__title--with-close-button": t.contentProps.hasCloseButton }])
}, j(t.contentProps.title), 3),
t.contentProps.message ? (E(), O("p", {
key: 0,
innerHTML: t.contentProps.message,
class: "dsg-alert__message"
}, null, 8, js)) : P("", !0)
]),
t.contentProps.hasCloseButton ? (E(), O("button", {
key: 4,
onClick: o,
class: "dsg-alert__close-button"
}, [
Y(ge, {
icon: "x-close",
size: "sm"
})
])) : P("", !0)
]));
}
}), Ks = new class _r {
info(e = "", r = "", n = {}) {
_r.showToast("gray", e, r, n);
}
error(e = "", r = "", n = {}) {
_r.showToast("error", e, r, n);
}
warning(e = "", r = "", n = {}) {
_r.showToast("warning", e, r, n);
}
success(e = "", r = "", n = {}) {
_r.showToast("success", e, r, n);
}
static showToast(e, r, n, i) {
const a = {
hasCloseButton: !1,
timeout: 3e3,
position: "top-right",
maxWidthClass: "",
...i
};
le(za, {
autoClose: a.hasCloseButton ? !1 : a.timeout,
closeButton: !1,
hideProgressBar: !0,
closeOnClick: !a.hasCloseButton,
position: a.position,
containerClassName: `dsg-alert-container ${a.maxWidthClass}`,
toastClassName: "dsg-alert",
bodyClassName: "dsg-alert--body",
contentProps: {
title: r,
message: n,
type: e,
hasCloseButton: a.hasCloseButton,
useToast: !0,
timeout: a.timeout
},
onClick: () => {
}
});
}
}();
function Pn(t) {
return t === 0 ? !1 : Array.isArray(t) && t.length === 0 ? !0 : !t;
}
function Ys(t) {
return (...e) => !t(...e);
}
function Zs(t, e) {
return t === void 0 && (t = "undefined"), t === null && (t = "null"), t === !1 && (t = "false"), t.toString().toLowerCase().indexOf(e.trim()) !== -1;
}
function qs(t) {
return t.filter((e) => !e.$isLabel);
}
function Bn(t, e) {
return (r) => r.reduce((n, i) => i[t] && i[t].length ? (n.push({
$groupLabel: i[e],
$isLabel: !0
}), n.concat(i[t])) : n, []);
}
const Vi = (...t) => (e) => t.reduce((r, n) => n(r), e);
var Qs = {
data() {
return {
search: "",
isOpen: !1,
preferredOpenDirection: "below",
optimizedHeight: this.maxHeight
};
},
props: {
/**
* Decide whether to filter the results based on search query.
* Useful for async filtering, where we search through more complex data.
* @type {Boolean}
*/
internalSearch: {
type: Boolean,
default: !0
},
/**
* Array of available options: Objects, Strings or Integers.
* If array of objects, visible label will default to option.label.
* If `labal` prop is passed, label will equal option['label']
* @type {Array}
*/
options: {
type: Array,
required: !0
},
/**
* Equivalent to the `multiple` attribute on a `<select>` input.
* @default false
* @type {Boolean}
*/
multiple: {
type: Boolean,
default: !1
},
/**
* Key to compare objects
* @default 'id'
* @type {String}
*/
trackBy: {
type: String
},
/**
* Label to look for in option Object
* @default 'label'
* @type {String}
*/
label: {
type: String
},
/**
* Enable/disable search in options
* @default true
* @type {Boolean}
*/
searchable: {
type: Boolean,
default: !0
},
/**
* Clear the search input after `)
* @default true
* @type {Boolean}
*/
clearOnSelect: {
type: Boolean,
default: !0
},
/**
* Hide already selected options
* @default false
* @type {Boolean}
*/
hideSelected: {
type: Boolean,
default: !1
},
/**
* Equivalent to the `placeholder` attribute on a `<select>` input.
* @default 'Select option'
* @type {String}
*/
placeholder: {
type: String,
default: "Select option"
},
/**
* Allow to remove all selected values
* @default true
* @type {Boolean}
*/
allowEmpty: {
type: Boolean,
default: !0
},
/**
* Reset this.internalValue, this.search after this.internalValue changes.
* Useful if want to create a stateless dropdown.
* @default false
* @type {Boolean}
*/
resetAfter: {
type: Boolean,
default: !1
},
/**
* Enable/disable closing after selecting an option
* @default true
* @type {Boolean}
*/
closeOnSelect: {
type: Boolean,
default: !0
},
/**
* Function to interpolate the custom label
* @default false
* @type {Function}
*/
customLabel: {
type: Function,
default(t, e) {
return Pn(t) ? "" : e ? t[e] : t;
}
},
/**
* Disable / Enable tagging
* @default false
* @type {Boolean}
*/
taggable: {
type: Boolean,
default: !1
},
/**
* String to show when highlighting a potential tag
* @default 'Press enter to create a tag'
* @type {String}
*/
tagPlaceholder: {
type: String,
default: "Press enter to create a tag"
},
/**
* By default new tags will appear above the search results.
* Changing to 'bottom' will revert this behaviour
* and will proritize the search results
* @default 'top'
* @type {String}
*/
tagPosition: {
type: String,
default: "top"
},
/**
* Number of allowed selected options. No limit if 0.
* @default 0
* @type {Number}
*/
max: {
type: [Number, Boolean],
default: !1
},
/**
* Will be passed with all events as second param.
* Useful for identifying events origin.
* @default null
* @type {String|Integer}
*/
id: {
default: null
},
/**
* Limits the options displayed in the dropdown
* to the first X options.
* @default 1000
* @type {Integer}
*/
optionsLimit: {
type: Number,
default: 1e3
},
/**
* Name of the property containing
* the group values
* @default 1000
* @type {String}
*/
groupValues: {
type: String
},
/**
* Name of the property containing
* the group label
* @default 1000
* @type {String}
*/
groupLabel: {
type: String
},
/**
* Allow to select all group values
* by selecting the group label
* @default false
* @type {Boolean}
*/
groupSelect: {
type: Boolean,
default: !1
},
/**
* Array of keyboard keys to block
* when s