import { computed as o, createElementBlock as i, openBlock as e, createCommentVNode as u, Fragment as y, createBlock as r, withCtx as C, createElementVNode as A, normalizeClass as p, unref as l } from "vue";
import I from "../../1_atoms/Tooltip/Tooltip.vue.js";
import f from "./icons/CommunicationPanelCheckIcon.vue.js";
import b from "./icons/CommunicationPanelConfirmSpinner.vue2.js";
import { isAttributeConfirming as S, shouldShowAttributeCheckmark as _, shouldShowBlockedIndicatorSlot as g, getAttributeCheckIndicatorClass as w, getAttributeIndicatorTooltipText as x } from "./composables/useCommunicationAttributes.js";
const B = { class: "attribute-indicator-slot" }, T = {
  key: 2,
  class: "blocked-indicator-mark",
  "aria-hidden": "true"
}, q = {
  key: 2,
  class: "blocked-indicator-mark",
  "aria-hidden": "true"
}, F = {
  __name: "CommunicationPanelAttributeIndicator",
  props: {
    attribute: {
      type: Object,
      required: !0
    },
    isSelected: {
      type: Boolean,
      required: !1,
      default: !1
    },
    confirmingAttributeId: {
      type: String,
      required: !1,
      default: null
    },
    blockedAttributeIds: {
      type: Array,
      required: !1,
      default: () => []
    },
    indicatorTooltips: {
      type: Object,
      required: !1,
      default: () => ({})
    }
  },
  setup(k) {
    const t = k, s = o(() => ({
      isSelected: t.isSelected,
      confirmingAttributeId: t.confirmingAttributeId,
      blockedAttributeIds: t.blockedAttributeIds ?? []
    })), a = o(
      () => S(t.attribute, t.confirmingAttributeId)
    ), c = o(
      () => _(t.attribute, t.isSelected)
    ), n = o(
      () => g(t.attribute, s.value)
    ), h = o(() => a.value || c.value), v = o(() => h.value || n.value), d = o(() => a.value ? "confirming-indicator" : n.value ? "blocked-indicator" : w(t.attribute, t.isSelected) ?? ""), m = o(
      () => x(
        t.attribute,
        t.indicatorTooltips,
        s.value
      )
    );
    return (P, j) => (e(), i("span", B, [
      v.value ? (e(), i(y, { key: 0 }, [
        m.value ? (e(), r(I, {
          key: 0,
          text: m.value,
          position: "bottom-left",
          offset: 8
        }, {
          default: C(() => [
            A("span", {
              class: p(d.value)
            }, [
              a.value ? (e(), r(l(b), { key: 0 })) : c.value ? (e(), r(l(f), { key: 1 })) : n.value ? (e(), i("span", T)) : u("", !0)
            ], 2)
          ]),
          _: 1
        }, 8, ["text"])) : (e(), i("span", {
          key: 1,
          class: p(d.value)
        }, [
          a.value ? (e(), r(l(b), { key: 0 })) : c.value ? (e(), r(l(f), { key: 1 })) : n.value ? (e(), i("span", q)) : u("", !0)
        ], 2))
      ], 64)) : u("", !0)
    ]));
  }
};
export {
  F as default
};
