import { t as e } from "./wt-icon-y89gRcOs.js";
import { d as t, f as n, l as r } from "./enums-De8CDKZ1.js";
import { computed as i, createBlock as a, createCommentVNode as o, createElementVNode as s, createTextVNode as c, defineComponent as l, inject as u, mergeProps as d, normalizeClass as f, openBlock as p, ref as m, renderSlot as h, resolveComponent as g, toDisplayString as _, toRef as v, unref as y, useAttrs as b, watch as x, withCtx as S, withModifiers as C } from "vue";
//#endregion
//#region src/components/wt-badge-new/wt-badge.vue
var w = /* @__PURE__ */ l({
	__name: "wt-badge",
	props: {
		value: { default: "" },
		severity: { default: null },
		size: { default: r.MD }
	},
	setup(e) {
		let t = e;
		return (e, n) => {
			let r = g("p-badge");
			return p(), a(r, {
				value: t.value,
				class: f([[t.size && `p-badge--${t.size}`, t.severity && `p-badge--${t.severity}`], "wt-badge typo-caption"])
			}, {
				default: S(() => [h(e.$slots, "default")], void 0, !0),
				_: 3
			}, 8, ["value", "class"]);
		};
	}
}), T = { class: "wt-button__contents" }, E = /* @__PURE__ */ l({
	__name: "wt-button",
	props: {
		color: { default: n.PRIMARY },
		disabled: {
			type: Boolean,
			default: !1
		},
		loading: {
			type: Boolean,
			default: !1
		},
		size: { default: r.MD },
		wide: {
			type: Boolean,
			default: !1
		},
		widthByContent: {
			type: Boolean,
			default: !1
		},
		icon: { default: "" },
		iconPrefix: { default: "" },
		badge: {},
		badgeSeverity: {},
		badgeAbsolutePosition: { type: Boolean },
		variant: { default: t.ACTIVE }
	},
	emits: ["click"],
	setup(t, { emit: n }) {
		let l = {
			[r.XS]: "extra-small",
			[r.SM]: "small",
			[r.MD]: "medium"
		}, E = {
			[r.XS]: "sm",
			[r.SM]: "sm",
			[r.MD]: "md"
		}, D = t, O = n, k = b(), A = m(!1), j = i(() => ({ "wt-badge--absolute": D.badgeAbsolutePosition })), M = v(u("darkMode")), N = i(() => M.value ? "on-dark" : "on-light");
		return x(() => D.loading, (e) => {
			e ? A.value = !0 : setTimeout(() => {
				A.value = e;
			}, 1e3);
		}, { immediate: !0 }), (n, i) => {
			let u = g("wt-loader"), m = g("p-button");
			return p(), a(m, d(y(k), {
				class: [{
					"p-button--width-by-content": t.widthByContent || t.icon,
					"p-button--wide": t.wide,
					"p-button--with-badge": D.badge,
					"p-button--loading": A.value,
					"p-button--icon": t.icon,
					[`p-button--size-${t.size}`]: !0,
					[`p-button--icon-${t.variant} p-button--icon-${t.size}`]: t.icon,
					[`typo-button--${t.size}`]: t.size
				}, "wt-button typo-button"],
				disabled: t.disabled,
				loading: A.value,
				severity: t.color,
				size: l[t.size],
				variant: t.variant
			}, { onClick: i[0] ||= C((e) => O("click", e), ["prevent"]) }), {
				default: S(() => [A.value ? (p(), a(u, {
					key: 0,
					color: N.value,
					size: "sm"
				}, null, 8, ["color"])) : o("", !0), s("div", T, [
					t.icon ? o("", !0) : h(n.$slots, "default", { key: 0 }, () => [i[1] ||= c(" no content provided", -1)]),
					D.badge ? (p(), a(w, {
						key: 1,
						value: D.badge,
						severity: D.badgeSeverity,
						class: f(j.value),
						size: y(r).MD
					}, {
						default: S(() => [h(n.$slots, "badge", {}, () => [c(_(D.badge), 1)])]),
						_: 3
					}, 8, [
						"value",
						"severity",
						"class",
						"size"
					])) : o("", !0),
					t.icon ? (p(), a(e, {
						key: 2,
						class: f({ "wt-button__icon--hidden": A.value }),
						icon: t.icon,
						"icon-prefix": t.iconPrefix,
						size: E[t.size]
					}, null, 8, [
						"class",
						"icon",
						"icon-prefix",
						"size"
					])) : o("", !0)
				])], void 0, !0),
				_: 3
			}, 16, [
				"class",
				"disabled",
				"loading",
				"severity",
				"size",
				"variant"
			]);
		};
	}
});
//#endregion
export { w as n, E as t };
