(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.pl-chip-tooltip{display:inline-flex}.pl-chip{--chip-color: var(--txt-01);position:relative;display:inline-flex;align-items:center;gap:4px;padding:0 8px;height:32px;background:var(--chip-bg);border:var(--chip-border);border-radius:6px;max-width:256px;font-family:var(--font-family-base);font-size:var(--font-size-base);font-weight:var(--font-weigh-base);line-height:calc(var(--line-height-base) + 2px);letter-spacing:-.2px;color:var(--chip-color)}.pl-chip.small{height:24px;padding:0 6px;border-radius:4px}.pl-chip.large{height:40px;padding:0 12px;border-radius:6px}[data-theme=dark] .pl-chip{color:#fff}.pl-chip__text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.pl-chip__close{cursor:pointer;--mask-color: var(--chip-close-ic-color)}.pl-chip__close:hover{--mask-color: var(--chip-close-ic-hover-color)}.pl-chip__close:focus-visible{--mask-color: var(--chip-close-ic-hover-color);box-shadow:0 0 0 2px var(--border-color-focus);border-radius:1px;outline:none}.pl-chip__close--icon{background:var(--mask-color);mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.00001%202.93933L8.00001%206.93933L12%202.93933L13.0607%203.99999L9.06067%207.99999L13.0607%2012L12%2013.0607L8.00001%209.06065L4.00001%2013.0607L2.93935%2012L6.93935%207.99999L2.93935%203.99999L4.00001%202.93933Z'%20fill='%23110529'/%3e%3c/svg%3e");-webkit-mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.00001%202.93933L8.00001%206.93933L12%202.93933L13.0607%203.99999L9.06067%207.99999L13.0607%2012L12%2013.0607L8.00001%209.06065L4.00001%2013.0607L2.93935%2012L6.93935%207.99999L2.93935%203.99999L4.00001%202.93933Z'%20fill='%23110529'/%3e%3c/svg%3e");mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center;mask-size:16px;-webkit-mask-size:16px;width:16px;height:16px}`)),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
import { defineComponent as c, ref as i, onMounted as m, createBlock as d, openBlock as n, unref as f, createSlots as u, withCtx as p, createElementVNode as t, normalizeClass as v, createElementBlock as h, createCommentVNode as y, renderSlot as a, withModifiers as _, withKeys as k } from "vue";

import $ from "../PlTooltip/PlTooltip.vue.js";
const C = { class: "pl-chip__text" }, E = /* @__PURE__ */ c({
  __name: "PlChip",
  props: {
    closeable: { type: Boolean },
    small: { type: Boolean }
  },
  emits: ["close"],
  setup(w) {
    const l = i(), s = i(!1);
    return m(() => {
      var e;
      l.value && (s.value = ((e = l.value) == null ? void 0 : e.clientWidth) >= 256);
    }), (e, o) => (n(), d(f($), {
      position: "top",
      class: "pl-chip-tooltip",
      delay: 500
    }, u({
      default: p(() => [
        t("div", {
          ref_key: "chip",
          ref: l,
          class: v(["pl-chip", { small: e.small }])
        }, [
          t("div", C, [
            a(e.$slots, "default")
          ]),
          e.closeable ? (n(), h("div", {
            key: 0,
            tabindex: "0",
            class: "pl-chip__close",
            onKeydown: o[0] || (o[0] = k((r) => e.$emit("close"), ["enter"])),
            onClick: o[1] || (o[1] = _((r) => e.$emit("close"), ["stop"]))
          }, o[2] || (o[2] = [
            t("div", { class: "pl-chip__close--icon" }, null, -1)
          ]), 32)) : y("", !0)
        ], 2)
      ]),
      _: 2
    }, [
      s.value ? {
        name: "tooltip",
        fn: p(() => [
          a(e.$slots, "default")
        ]),
        key: "0"
      } : void 0
    ]), 1024));
  }
});
export {
  E as default
};
//# sourceMappingURL=PlChip.vue.js.map
