import { o as e } from "./enums-De8CDKZ1.js";
import { t } from "./vue-i18n-Db_oYfO8.js";
import { t as n } from "./sortQueryAdapters-CyYXvnDN.js";
import { computed as r, createBlock as i, openBlock as a, resolveComponent as o, resolveDirective as s, unref as c, withDirectives as l } from "vue";
//#region src/components/wt-icon-action/iconMappings.js
var u = Object.freeze({
	[e.ADD]: "plus",
	[e.DELETE]: "bucket",
	[e.DOWNLOAD]: "download",
	[e.EDIT]: "edit",
	[e.HISTORY]: "history",
	[e.REFRESH]: "refresh",
	[e.EXPAND]: "expand",
	[e.COLLAPSE]: "collapse",
	[e.FILTERS]: "filter",
	[e.COLUMNS]: "column-select",
	[e.VARIABLES]: "variable-select",
	[e.CLOSE]: "close--filled",
	[e.CANCEL]: "close",
	[e.CLEAR]: "clear",
	[e.ADD_FILTER]: "add-filter",
	[e.SAVE]: "save",
	[e.SAVE_PRESET]: "save",
	[e.APPLY_PRESET]: "load-preset",
	[e.ADD_CONTACT]: "add-contact",
	[e.DOWNLOAD_PDF]: "download-pdf",
	[e.CHAT]: "chat",
	[e.UPLOAD]: "upload",
	[e.LOGOUT]: "logout"
}), d = {
	__name: "wt-icon-action",
	props: {
		action: {
			type: String,
			required: !0,
			validator: (t) => Object.values([
				e.DELETE,
				e.EDIT,
				e.ADD,
				e.HISTORY,
				e.DOWNLOAD,
				e.REFRESH,
				e.SAVE,
				e.CANCEL,
				e.SAVE_PRESET,
				e.APPLY_PRESET,
				e.ADD_CONTACT,
				e.DOWNLOAD_PDF,
				e.CHAT,
				e.SORT,
				e.UPLOAD,
				e.LOGOUT
			]).includes(t)
		},
		disabled: {
			type: Boolean,
			default: !1
		},
		size: {
			type: String,
			default: "md",
			required: !1
		},
		"sort:order": {
			type: String,
			default: null,
			validator: (e) => Object.values(n).includes(e)
		}
	},
	emits: ["click", "mousedown"],
	setup(d, { emit: f }) {
		let p = d, m = f, { t: h } = t(), g = r(() => {
			if (p.action === e.SORT) return {
				icon: p["sort:order"] === n.DESC ? "sort-desc" : "sort-asc",
				hint: "webitelUI.iconAction.hints.sort",
				hintParams: { order: p["sort:order"] }
			};
			let t = u[p.action];
			return t ? {
				icon: t,
				hint: `webitelUI.iconAction.hints.${p.action}`
			} : (console.error(`Unknown action for wt-icon-action component: ${p.action}`), {
				icon: "edit",
				hint: p.action
			});
		});
		return (e, t) => {
			let n = o("wt-icon-btn"), r = s("tooltip");
			return l((a(), i(n, {
				disabled: d.disabled,
				icon: g.value.icon,
				size: d.size,
				onClick: t[0] ||= (e) => m("click", e),
				onMousedown: t[1] ||= (e) => m("mousedown", e)
			}, null, 8, [
				"disabled",
				"icon",
				"size"
			])), [[r, c(h)(g.value.hint, g.value.hintParams)]]);
		};
	}
};
//#endregion
export { d as t };
