import { n as e } from "./utils-DJ3DjJ60.js";
import { computed as t, createBlock as n, createElementBlock as r, defineComponent as i, inject as a, normalizeStyle as o, onActivated as s, onBeforeMount as c, onBeforeUpdate as l, onDeactivated as u, onMounted as d, onUnmounted as f, onUpdated as p, openBlock as m, provide as h, ref as g, renderSlot as _, useSlots as v, watch as y, withCtx as b } from "vue";
//#endregion
//#region ../components/Grid/Grid.vue
var x = /* @__PURE__ */ i({
	name: "Grid",
	__name: "Grid",
	props: {
		cols: { default: () => ({
			xs: 1,
			sm: 2,
			md: 2,
			lg: 4,
			xl: 4
		}) },
		collapsed: {
			type: Boolean,
			default: !1
		},
		collapsedRows: { default: 1 },
		gap: { default: 16 }
	},
	setup(e, { expose: n }) {
		let i = e;
		c(() => i.collapsed && E()), d(() => {
			b({ target: { innerWidth: window.innerWidth } }), window.addEventListener("resize", b);
		}), s(() => {
			b({ target: { innerWidth: window.innerWidth } }), window.addEventListener("resize", b);
		}), f(() => {
			window.removeEventListener("resize", b);
		}), u(() => {
			window.removeEventListener("resize", b);
		});
		let b = (e) => {
			let t = e.target.innerWidth;
			switch (!!t) {
				case t < 768:
					x.value = "xs";
					break;
				case t >= 768 && t < 992:
					x.value = "sm";
					break;
				case t >= 992 && t < 1200:
					x.value = "md";
					break;
				case t >= 1200 && t < 1920:
					x.value = "lg";
					break;
				case t >= 1920:
					x.value = "xl";
					break;
			}
		};
		h("gap", Array.isArray(i.gap) ? i.gap[0] : i.gap);
		let x = g("xl");
		h("breakPoint", x);
		let S = g(-1);
		h("shouldHiddenIndex", S);
		let C = t(() => typeof i.cols == "object" ? i.cols[x.value] ?? i.cols : i.cols);
		h("cols", C);
		let w = v(), T = () => {
			let e = w.default;
			return e ? e({}) : [];
		}, E = () => {
			let e = [], t = null;
			T().forEach((n) => {
				typeof n.type == "object" && n.type.name === "GridItem" && n.props?.suffix !== void 0 && (t = n), typeof n.type == "symbol" && Array.isArray(n.children) && e.push(...n.children);
			});
			let n = 0;
			t && (n = (t.props[x.value]?.span ?? t.props?.span ?? 1) + (t.props[x.value]?.offset ?? t.props?.offset ?? 0));
			try {
				let t = !1;
				e.reduce((e = 0, r, a) => {
					if (e += (r.props[x.value]?.span ?? r.props?.span ?? 1) + (r.props[x.value]?.offset ?? r.props?.offset ?? 0), Number(e) > i.collapsedRows * C.value - n) throw S.value = a, t = !0, "find it";
					return e;
				}, 0), t || (S.value = -1);
			} catch {}
		};
		y(() => x.value, () => {
			i.collapsed && E();
		}), y(() => i.collapsed, (e) => {
			if (e) return E();
			S.value = -1;
		});
		let D = t(() => typeof i.gap == "number" ? `${i.gap}px` : Array.isArray(i.gap) ? `${i.gap[1]}px ${i.gap[0]}px` : "unset"), O = t(() => ({
			display: "grid",
			gridGap: D.value,
			gridTemplateColumns: `repeat(${C.value}, minmax(0, 1fr))`
		})), k = a("clearGridItemData", () => {}), A = g(!1);
		return d(() => {
			A.value = !0;
		}), l(() => {
			A.value = !1, k();
		}), p(() => {
			A.value = !0;
		}), h("isRegistrationComplete", A), n({ breakPoint: x }), (e, t) => (m(), r("div", { style: o(O.value) }, [_(e.$slots, "default")], 4));
	}
}), S = e(/* @__PURE__ */ i({
	name: "ZhBaseInfo",
	__name: "BaseInfo",
	props: {
		contentWidth: { default: void 0 },
		labelWidth: { default: "70px" },
		infoDirection: { default: "horizontal" },
		cols: { default: 4 },
		gap: { default: 16 }
	},
	setup(e) {
		let t = e, r = g(), i = g(), a = g();
		h("infoLabelWidth", r), h("infoContentWidth", i), h("infoDirection", a);
		function o() {
			r.value = t.labelWidth;
		}
		function s() {
			i.value = t.contentWidth;
		}
		function c() {
			a.value = t.infoDirection;
		}
		return y(() => t.contentWidth, () => s(), { immediate: !0 }), y(() => t.labelWidth, () => o(), { immediate: !0 }), y(() => t.infoDirection, () => c(), { immediate: !0 }), (t, r) => (m(), n(x, {
			cols: e.cols,
			gap: e.gap
		}, {
			default: b(() => [_(t.$slots, "default")]),
			_: 3
		}, 8, ["cols", "gap"]));
	}
}));
//#endregion
export { x as n, S as t };
