import { onBeforeUnmount as a } from "vue";
import { tapIf as l, tap as m } from "../helpers/functions.js";
import { onChanged as p } from "../composition/utils.js";
import { call as u } from "../helpers/utils.js";
import { stopResizeObserving as c, startResizeObserving as b } from "../global/resizeObserver.js";
const g = 8, n = 4;
function N(r, i = "label") {
  const o = /* @__PURE__ */ new Set();
  p(() => {
    l(r == null ? void 0 : r.value, (e) => {
      const t = e.querySelector(i);
      t && (o.add(t), b(t, () => {
        const s = u(() => t.getBoundingClientRect().width + m(g, (f) => Number.isNaN(f) ? n : f + n));
        e.style.getPropertyValue("--label-offset-right-x") !== `${s}px` && e.style.setProperty("--label-offset-right-x", `${s}px`);
      }));
    });
  }), a(() => {
    Array.from(o.values()).map((e) => c(e));
  });
}
export {
  N as useLabelNotch
};
//# sourceMappingURL=useLabelNotch.js.map
