(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 m, ref as n, onMounted as d, createBlock as f, openBlock as a, unref as u, createSlots as v, withCtx as p, createElementVNode as t, normalizeClass as h, createElementBlock as y, createCommentVNode as k, renderSlot as r, withModifiers as $, withKeys as C } from "vue";

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