import { F as e, N as t, S as n, _ as r, at as i, ct as a, d as o, g as s, h as c, lt as l, m as u, p as d } from "./draggable-Bcb86AsV.js";
import { $ as f } from "./features-BnG-dhzy.js";
import { n as p, t as m } from "./icons-B_185qj_.js";
import { t as h } from "./readableTextColor-Cd_cgWO_.js";
//#region src/cloud/components/CollaboratorBar.vue?vue&type=script&setup=true&lang.ts
var g = { class: "tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2" }, _ = ["title"], v = {
	key: 0,
	class: "tpl:flex tpl:items-center tpl:-space-x-1.5"
}, y = ["title"], b = ["title"], x = 3, S = /* @__PURE__ */ n({
	__name: "CollaboratorBar",
	props: {
		collaborators: {},
		isConnected: { type: Boolean }
	},
	setup(n) {
		let S = n, { t: C } = f(), w = d(() => S.collaborators.slice(0, x)), T = d(() => S.collaborators.slice(x)), E = d(() => T.value.length), D = d(() => T.value.map((e) => e.name).join("\n"));
		function O(e) {
			let t = e.trim().split(/\s+/);
			return t.length >= 2 ? (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase() : e.charAt(0).toUpperCase();
		}
		return (d, f) => (t(), r("div", g, [u("div", {
			class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",
			style: a({ color: n.isConnected ? "var(--tpl-success)" : "var(--tpl-text-muted)" }),
			title: n.isConnected ? i(C).collaboration.connected : i(C).collaboration.disconnected
		}, [n.isConnected ? (t(), c(i(m), {
			key: 0,
			size: 12,
			"stroke-width": 2
		})) : (t(), c(i(p), {
			key: 1,
			size: 12,
			"stroke-width": 2
		}))], 12, _), n.collaborators.length > 0 ? (t(), r("div", v, [(t(!0), r(o, null, e(w.value, (e) => (t(), r("div", {
			key: e.id,
			class: "tpl-collaborator-avatar tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[10px] tpl:font-bold tpl:transition-transform tpl:duration-150 tpl:hover:z-10 tpl:hover:scale-110 tpl:border-[var(--tpl-bg)]",
			style: a({
				backgroundColor: e.color,
				color: i(h)(e.color)
			}),
			title: e.name
		}, l(O(e.name)), 13, y))), 128)), E.value > 0 ? (t(), r("div", {
			key: 0,
			class: "tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[9px] tpl:font-bold tpl:border-[var(--tpl-bg)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]",
			title: D.value
		}, " +" + l(E.value), 9, b)) : s("", !0)])) : s("", !0)]));
	}
});
//#endregion
export { S as default };

//# sourceMappingURL=CollaboratorBar-CTFgLtUt.js.map