'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-85d13173.js');

const klevuChipCss = ":host{display:inline-flex;padding:var(--klevu-spacing-02) var(--klevu-spacing-05);border-radius:var(--klevu-chip-radius, var(--klevu-border-radius-xxl));align-items:center;border:1px solid var(--klevu-chip-border, var(--klevu-color-neutral-5))}:host(.removable){display:inline-flex}:host(.selected){background-color:var(\n    --klevu-chip-selected-background,\n    color-mix(in srgb, var(--klevu-color-primary), transparent 80%)\n  );border-color:var(--klevu-chip-selected-border, var(--klevu-color-primary))}klevu-icon{position:relative;top:2px;left:-4px;font-size:0.7em;padding:2px;margin-right:var(--klevu-spacing-01);cursor:pointer;user-select:none}klevu-typography{line-height:1}";

var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _KlevuChip_instances, _KlevuChip_close;
const KlevuChip = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.klevuChipRemove = index.createEvent(this, "klevuChipRemove", 7);
    _KlevuChip_instances.add(this);
    this.selected = false;
    this.removable = false;
  }
  render() {
    return (index.h(index.Host, { class: { removable: Boolean(this.removable), selected: Boolean(this.selected) } }, index.h("div", { part: "chip-base" }, this.removable && index.h("klevu-icon", { part: "chip-icon", name: "close", onClick: __classPrivateFieldGet(this, _KlevuChip_instances, "m", _KlevuChip_close).bind(this) }), index.h("klevu-typography", { variant: "body-xs", part: "chip-content" }, index.h("slot", null)))));
  }
};
_KlevuChip_instances = new WeakSet(), _KlevuChip_close = function _KlevuChip_close(event) {
  if (this.removable) {
    const emittedEvent = this.klevuChipRemove.emit();
    if (emittedEvent.defaultPrevented) {
      event.stopPropagation();
      return false;
    }
  }
};
KlevuChip.style = klevuChipCss;

exports.klevu_chip = KlevuChip;

//# sourceMappingURL=klevu-chip.cjs.entry.js.map