import { n as __exportAll } from "./chunk-B-1-B7_t.js";
import { r as Progress_default } from "./progress-C3R98kmG.js";
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref } from "vue";
//#region src/components/compositions/elements/display/ProgressBarDisplay.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = {
	key: 0,
	class: "flex items-center justify-between text-sm"
};
var _hoisted_2 = { key: 0 };
var _hoisted_3 = {
	class: "text-muted-foreground",
	"data-testid": "progress-bar-value"
};
var ProgressBarDisplay_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "ProgressBarDisplay",
	props: {
		progress: { default: 0 },
		label: {},
		hideLabel: { type: Boolean },
		classList: {}
	},
	setup(__props) {
		/**
		* Props-driven progress bar display.
		*
		* Wraps the shadcn-vue Progress primitive. The numeric `progress`
		* prop (0-100) is clamped before being passed to the underlying
		* indicator.
		*/
		const props = __props;
		function clamp(n) {
			if (n < 0) return 0;
			if (n > 100) return 100;
			return n;
		}
		const value = computed(() => {
			if (typeof props.progress !== "number" || !Number.isFinite(props.progress)) return 0;
			return clamp(props.progress);
		});
		const rootClass = computed(() => {
			const cl = props.classList;
			if (!cl) return "";
			return Array.isArray(cl) ? cl.join(" ") : cl;
		});
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("div", {
				class: normalizeClass(["flex flex-col gap-1.5", rootClass.value]),
				"data-testid": "progress-bar-display"
			}, [__props.label && !__props.hideLabel || !__props.hideLabel ? (openBlock(), createElementBlock("div", _hoisted_1, [__props.label && !__props.hideLabel ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.label), 1)) : createCommentVNode("", true), createElementVNode("span", _hoisted_3, toDisplayString(value.value) + "%", 1)])) : createCommentVNode("", true), createVNode(unref(Progress_default), {
				value: value.value,
				max: 100
			}, null, 8, ["value"])], 2);
		};
	}
});
//#endregion
//#region src/components/compositions/elements/display/ProgressBarDisplay.vue
var ProgressBarDisplay_exports = /* @__PURE__ */ __exportAll({ default: () => ProgressBarDisplay_default });
var ProgressBarDisplay_default = ProgressBarDisplay_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { ProgressBarDisplay_exports as n, ProgressBarDisplay_default as t };

//# sourceMappingURL=ProgressBarDisplay-DJ1inFVw.js.map