import { A as e, M as t, b as n, d as r, f as i, h as a, l as o, m as s, ot as c, p as l, rt as u, st as d } from "./vue.runtime.esm-bundler-Bxqkjqhc.js";
import "./useEditorCore-DT3VrvZS.js";
import { t as f } from "./createLucideIcon-Di4mqmGn.js";
import { n as p } from "./useCloudI18n-BPUHj2CZ.js";
import { t as m } from "./readableTextColor-CXzrEnNb.js";
var h = f("wifi-off", [
	["path", {
		d: "M12 20h.01",
		key: "zekei9"
	}],
	["path", {
		d: "M8.5 16.429a5 5 0 0 1 7 0",
		key: "1bycff"
	}],
	["path", {
		d: "M5 12.859a10 10 0 0 1 5.17-2.69",
		key: "1dl1wf"
	}],
	["path", {
		d: "M19 12.859a10 10 0 0 0-2.007-1.523",
		key: "4k23kn"
	}],
	["path", {
		d: "M2 8.82a15 15 0 0 1 4.177-2.643",
		key: "1grhjp"
	}],
	["path", {
		d: "M22 8.82a15 15 0 0 0-11.288-3.764",
		key: "z3jwby"
	}],
	["path", {
		d: "m2 2 20 20",
		key: "1ooewy"
	}]
]), g = f("wifi", [
	["path", {
		d: "M12 20h.01",
		key: "zekei9"
	}],
	["path", {
		d: "M2 8.82a15 15 0 0 1 20 0",
		key: "dnpr2z"
	}],
	["path", {
		d: "M5 12.859a10 10 0 0 1 14 0",
		key: "1x1e6c"
	}],
	["path", {
		d: "M8.5 16.429a5 5 0 0 1 7 0",
		key: "1bycff"
	}]
]), _ = { class: "tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2" }, v = ["title"], y = {
	key: 0,
	class: "tpl:flex tpl:items-center tpl:-space-x-1.5"
}, b = ["title"], x = ["title"], S = 3, C = /* @__PURE__ */ n({
	__name: "CollaboratorBar",
	props: {
		collaborators: {},
		isConnected: { type: Boolean }
	},
	setup(n) {
		let f = n, { t: C } = p(), w = r(() => f.collaborators.slice(0, S)), T = r(() => f.collaborators.slice(S)), E = r(() => T.value.length), D = r(() => 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 (r, f) => (e(), a("div", _, [i("div", {
			class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",
			style: c({ color: n.isConnected ? "var(--tpl-success)" : "var(--tpl-text-muted)" }),
			title: n.isConnected ? u(C).collaboration.connected : u(C).collaboration.disconnected
		}, [n.isConnected ? (e(), l(u(g), {
			key: 0,
			size: 12,
			"stroke-width": 2
		})) : (e(), l(u(h), {
			key: 1,
			size: 12,
			"stroke-width": 2
		}))], 12, v), n.collaborators.length > 0 ? (e(), a("div", y, [(e(!0), a(o, null, t(w.value, (t) => (e(), a("div", {
			key: t.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: c({
				backgroundColor: t.color,
				color: u(m)(t.color)
			}),
			title: t.name
		}, d(O(t.name)), 13, b))), 128)), E.value > 0 ? (e(), a("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
		}, " +" + d(E.value), 9, x)) : s("", !0)])) : s("", !0)]));
	}
});
//#endregion
export { C as default };
