import { tap as e, tapIf as t } from "../helpers/functions.js";
import { call as n } from "../helpers/utils.js";
import { onChanged as r } from "../composition/utils.js";
import { startResizeObserving as i, stopResizeObserving as a } from "../global/resizeObserver.js";
import { onBeforeUnmount as o } from "vue";
var s = 8, c = 4;
/**
* Adjust the width of the cutout on the clip path for the notched label (TextField, Dropdown)
*/
function l(l, u = "label") {
	let d = /* @__PURE__ */ new Set();
	r(() => {
		t(l?.value, (t) => {
			let r = t.querySelector(u);
			r && (d.add(r), i(r, () => {
				let i = n(() => r.getBoundingClientRect().width + e(s, (e) => Number.isNaN(e) ? c : e + c));
				t.style.getPropertyValue("--label-offset-right-x") !== `${i}px` && t.style.setProperty("--label-offset-right-x", `${i}px`);
			}));
		});
	}), o(() => {
		Array.from(d.values()).map((e) => a(e));
	});
}
export { l as useLabelNotch };

//# sourceMappingURL=useLabelNotch.js.map