import e from "../PlTooltip/PlTooltip.js";
import "../PlTooltip/index.js";
import './pl-chip.css';/* empty css        */
import { createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createSlots as a, defineComponent as o, normalizeClass as s, onMounted as c, openBlock as l, ref as u, renderSlot as d, unref as f, withCtx as p, withKeys as m, withModifiers as h } from "vue";
var g = { class: "pl-chip__text" }, _ = /* @__PURE__ */ o({
	__name: "PlChip",
	props: {
		closeable: { type: Boolean },
		small: { type: Boolean }
	},
	emits: ["close"],
	setup(o) {
		let _ = u(), v = u(!1);
		return c(() => {
			_.value && (v.value = _.value?.clientWidth >= 256);
		}), (c, u) => (l(), t(f(e), {
			position: "top",
			class: "pl-chip-tooltip",
			delay: 500
		}, a({
			default: p(() => [i("div", {
				ref_key: "chip",
				ref: _,
				class: s(["pl-chip", { small: o.small }])
			}, [i("div", g, [d(c.$slots, "default")]), o.closeable ? (l(), r("div", {
				key: 0,
				tabindex: "0",
				class: "pl-chip__close",
				onKeydown: u[0] ||= m((e) => c.$emit("close"), ["enter"]),
				onClick: u[1] ||= h((e) => c.$emit("close"), ["stop"])
			}, [...u[2] ||= [i("div", { class: "pl-chip__close--icon" }, null, -1)]], 32)) : n("", !0)], 2)]),
			_: 2
		}, [v.value ? {
			name: "tooltip",
			fn: p(() => [d(c.$slots, "default")]),
			key: "0"
		} : void 0]), 1024));
	}
});
export { _ as default };

//# sourceMappingURL=PlChip.vue2.js.map