import { n as e } from "./button-BU2kRzwu.js";
import { r as t } from "./grid-dI94AAbi.js";
import { n } from "./input-Bp6_Ucgr.js";
import { i as r, n as i, r as a } from "./modal-paexEF0j.js";
import { t as o } from "./check-box-Dd3YFuxd.js";
import { n as s } from "./radio-group-CM9Lg_nc.js";
import { a as c, i as l, n as u, r as d, t as f } from "./types-CxXyru6U.js";
import { useCallback as p, useEffect as m, useEffectEvent as h, useMemo as g, useRef as _, useState as v } from "react";
import { cn as y } from "@ryuzaki13/react-foundation-lib/utils";
import { AlignCenter as b, AlignJustify as x, AlignLeft as S, AlignRight as C, AtSign as w, BookType as T, BrushCleaning as E, Clock as D, ExternalLink as O, Languages as ee, Link as te, MessageSquareQuote as ne, Phone as re, PictureInPicture as ie, Redo as ae, Shredder as oe, Undo as se } from "lucide-react";
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
import { formatPhone as ce } from "@ryuzaki13/react-foundation-lib/formatters";
import { isSafe as M, validateUrl as le } from "@ryuzaki13/react-foundation-lib/validators";
import { $generateHtmlFromNodes as ue, $generateNodesFromDOM as de } from "@lexical/html";
import { $isListItemNode as fe, $isListNode as N, INSERT_ORDERED_LIST_COMMAND as pe, INSERT_UNORDERED_LIST_COMMAND as me, ListItemNode as he, ListNode as ge, REMOVE_LIST_COMMAND as P } from "@lexical/list";
import { LexicalComposer as _e } from "@lexical/react/LexicalComposer";
import { ContentEditable as ve } from "@lexical/react/LexicalContentEditable";
import { LexicalErrorBoundary as ye } from "@lexical/react/LexicalErrorBoundary";
import { HistoryPlugin as be } from "@lexical/react/LexicalHistoryPlugin";
import { ListPlugin as xe } from "@lexical/react/LexicalListPlugin";
import { OnChangePlugin as Se } from "@lexical/react/LexicalOnChangePlugin";
import { RichTextPlugin as Ce } from "@lexical/react/LexicalRichTextPlugin";
import { $createHeadingNode as we, $createQuoteNode as Te, $isHeadingNode as Ee, $isQuoteNode as De, HeadingNode as Oe, QuoteNode as ke } from "@lexical/rich-text";
import { useLexicalComposerContext as F } from "@lexical/react/LexicalComposerContext";
import { $applyNodeReplacement as I, $createParagraphNode as L, $createTextNode as R, $getRoot as Ae, $getSelection as z, $isRangeSelection as B, ElementNode as je, FORMAT_ELEMENT_COMMAND as Me, FORMAT_TEXT_COMMAND as Ne, REDO_COMMAND as Pe, UNDO_COMMAND as Fe } from "lexical";
import { $isLinkNode as V, LinkNode as Ie } from "@lexical/link";
import { $setBlocksType as H } from "@lexical/selection";
import { $findMatchingParent as Le } from "@lexical/utils";
var U = {
	toolbar: "shIOqq",
	groupControls: "YM-4Dq"
};
//#endregion
//#region src/text-editor/toolbar/ToolbarControl.tsx
function W({ isActive: t, disabled: n, style: r, title: i, icon: a, onClick: o }) {
	return /* @__PURE__ */ A(e, {
		title: i,
		disabled: n,
		appearance: "outline",
		tone: t ? "info" : void 0,
		onMouseDown: (e) => {
			e.preventDefault(), o?.(r || "");
		},
		icon: a
	});
}
//#endregion
//#region src/text-editor/toolbar/AlignmentControls.tsx
function Re({ onAlignmentChange: e, activeAlignment: t }) {
	return /* @__PURE__ */ j("div", {
		className: U.groupControls,
		children: [
			/* @__PURE__ */ A(W, {
				title: "По левому краю",
				icon: /* @__PURE__ */ A(S, {}),
				isActive: t === "left",
				onClick: () => e("left")
			}),
			/* @__PURE__ */ A(W, {
				title: "По центру",
				icon: /* @__PURE__ */ A(b, {}),
				isActive: t === "center",
				onClick: () => e("center")
			}),
			/* @__PURE__ */ A(W, {
				title: "По правому краю",
				icon: /* @__PURE__ */ A(C, {}),
				isActive: t === "right",
				onClick: () => e("right")
			}),
			/* @__PURE__ */ A(W, {
				title: "По ширине",
				icon: /* @__PURE__ */ A(x, {}),
				isActive: t === "justify",
				onClick: () => e("justify")
			})
		]
	});
}
//#endregion
//#region src/text-editor/toolbar/HistoryControls.tsx
function ze({ onUndo: e, onRedo: t }) {
	return /* @__PURE__ */ j("div", {
		className: U.groupControls,
		children: [/* @__PURE__ */ A(W, {
			title: "Отменить последнее действие",
			icon: /* @__PURE__ */ A(se, {}),
			onClick: e
		}), /* @__PURE__ */ A(W, {
			title: "Повторить предыдущее действие",
			icon: /* @__PURE__ */ A(ae, {}),
			onClick: t
		})]
	});
}
//#endregion
//#region src/text-editor/toolbar/LinkButtons.tsx
function Be({ disabled: e, onClick: t }) {
	return /* @__PURE__ */ j("div", {
		className: U.groupControls,
		children: [
			/* @__PURE__ */ A(W, {
				title: "Добавить ссылку на статью",
				icon: /* @__PURE__ */ A(te, {}),
				onClick: () => t(f.LOCAL_LINK)
			}),
			/* @__PURE__ */ A(W, {
				title: "Добавить ссылку",
				disabled: e,
				icon: /* @__PURE__ */ A(O, {}),
				onClick: () => t(f.LINK)
			}),
			/* @__PURE__ */ A(W, {
				title: "Добавить телефон",
				disabled: e,
				icon: /* @__PURE__ */ A(re, {}),
				onClick: () => t(f.PHONE)
			}),
			/* @__PURE__ */ A(W, {
				title: "Добавить email",
				disabled: e,
				icon: /* @__PURE__ */ A(w, {}),
				onClick: () => t(f.EMAIL)
			})
		]
	});
}
//#endregion
//#region src/text-editor/toolbar/TagButtons.tsx
function Ve({ onClick: e }) {
	return /* @__PURE__ */ j("div", {
		className: U.groupControls,
		children: [
			/* @__PURE__ */ A(W, {
				title: "Вставить Аббревиатуру",
				icon: /* @__PURE__ */ A(T, {}),
				onClick: () => e(u.abbr)
			}),
			/* @__PURE__ */ A(W, {
				title: "Вставить Код языка",
				icon: /* @__PURE__ */ A(ee, {}),
				onClick: () => e(u.lang)
			}),
			/* @__PURE__ */ A(W, {
				title: "Вставить Дату/время",
				icon: /* @__PURE__ */ A(D, {}),
				onClick: () => e(u.time)
			}),
			/* @__PURE__ */ A(W, {
				title: "Вставить Ссылку на источник",
				icon: /* @__PURE__ */ A(ne, {}),
				onClick: () => e(u.cite)
			}),
			/* @__PURE__ */ A(W, {
				title: "Вставить Удалённый фрагмент",
				icon: /* @__PURE__ */ A(oe, {}),
				onClick: () => e(u.del)
			}),
			/* @__PURE__ */ A(W, {
				title: "Вставить Добавленный фрагмент",
				icon: /* @__PURE__ */ A(ie, {}),
				onClick: () => e(u.ins)
			})
		]
	});
}
//#endregion
//#region src/text-editor/toolbar/TextEditorToolbarLexical.tsx
function He({ toolbarComponents: e, state: t, onBlockStyleToggle: n, onInlineStyleToggle: r, onAlignmentChange: i, onLinkClick: a, onTagClick: o, onUndo: s, onRedo: c, onCleanTag: u }) {
	let f = {
		history: !0,
		...e || {}
	};
	return /* @__PURE__ */ j("div", {
		className: U.toolbar,
		children: [
			f.blocks && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("div", {
				className: U.groupControls,
				children: d.map((e) => /* @__PURE__ */ A(W, {
					isActive: e.style === t.blockType,
					style: e.style,
					title: e.label,
					icon: e.icon,
					onClick: n
				}, e.style))
			}), /* @__PURE__ */ A("hr", {})] }),
			f.inline && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("div", {
				className: U.groupControls,
				children: l.map((e) => /* @__PURE__ */ A(W, {
					isActive: !!t.activeInlineStyles[e.style],
					title: e.label,
					style: e.style,
					icon: e.icon,
					disabled: t.isTextUnselected,
					onClick: r
				}, e.style))
			}), /* @__PURE__ */ A("hr", {})] }),
			f.alignment && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(Re, {
				activeAlignment: t.activeAlignment,
				onAlignmentChange: i
			}), /* @__PURE__ */ A("hr", {})] }),
			f.links && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(Be, {
				disabled: t.isTextUnselected,
				onClick: a
			}), /* @__PURE__ */ A("hr", {})] }),
			f.tags && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(Ve, { onClick: o }), /* @__PURE__ */ A("hr", {})] }),
			f.history && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(ze, {
				onUndo: s,
				onRedo: c
			}), /* @__PURE__ */ A("hr", {})] }),
			/* @__PURE__ */ A(W, {
				disabled: t.isTextUnselected,
				title: "Очистить выбранный тег",
				icon: /* @__PURE__ */ A(E, {}),
				onClick: u
			})
		]
	});
}
//#endregion
//#region src/text-editor/lexical/plugins/InitialHtmlPlugin.tsx
function Ue({ initialHTML: e, shouldSkip: t }) {
	let [n] = F(), r = _(!1);
	return m(() => {
		t || !e || r.current || typeof window > "u" || (r.current = !0, n.update(() => {
			let t = Ae(), r = new DOMParser().parseFromString(e, "text/html"), i = de(n, r);
			if (t.clear(), i.length === 0) {
				t.append(L());
				return;
			}
			t.append(...i);
		}));
	}, [
		n,
		e,
		t
	]), null;
}
//#endregion
//#region src/text-editor/model/textEditorTypes.ts
var G = {
	blockType: "unstyled",
	isTextUnselected: !0,
	activeInlineStyles: {
		BOLD: !1,
		ITALIC: !1,
		UNDERLINE: !1,
		STRIKETHROUGH: !1,
		HIGHLIGHT: !1,
		CODE: !1
	},
	activeAlignment: null
}, We = (e) => {
	switch (e) {
		case "h3": return "header-three";
		case "h4": return "header-four";
		case "h5": return "header-five";
		case "h6": return "header-six";
		default: return "unstyled";
	}
}, Ge = (e) => {
	switch (e) {
		case "header-three": return "h3";
		case "header-four": return "h4";
		case "header-five": return "h5";
		case "header-six": return "h6";
		default: return null;
	}
}, Ke = (e) => {
	switch (e) {
		case "BOLD": return "bold";
		case "ITALIC": return "italic";
		case "UNDERLINE": return "underline";
		case "STRIKETHROUGH": return "strikethrough";
		case "HIGHLIGHT": return "highlight";
		case "CODE": return "code";
		default: return null;
	}
}, qe = () => {
	let e = z();
	if (!B(e)) return "unstyled";
	let t = e.anchor.getNode().getTopLevelElementOrThrow();
	if (fe(t)) {
		let e = t.getParent();
		if (N(e)) return e.getListType() === "bullet" ? "unordered-list-item" : "ordered-list-item";
	}
	return N(t) ? t.getListType() === "bullet" ? "unordered-list-item" : "ordered-list-item" : Ee(t) ? We(t.getTag()) : De(t) ? "blockquote" : t.getType() === "paragraph" ? "unstyled" : t.getType();
}, Je = () => {
	let e = z();
	if (!B(e)) return null;
	let t = e.anchor.getNode().getTopLevelElementOrThrow().getFormatType();
	switch (t) {
		case "left":
		case "center":
		case "right":
		case "justify": return t;
		default: return null;
	}
}, Ye = () => {
	let e = z();
	return B(e) ? {
		blockType: qe(),
		isTextUnselected: e.isCollapsed(),
		activeInlineStyles: {
			BOLD: e.hasFormat("bold"),
			ITALIC: e.hasFormat("italic"),
			UNDERLINE: e.hasFormat("underline"),
			STRIKETHROUGH: e.hasFormat("strikethrough"),
			HIGHLIGHT: e.hasFormat("highlight"),
			CODE: e.hasFormat("code")
		},
		activeAlignment: Je()
	} : G;
};
//#endregion
//#region src/text-editor/lexical/plugins/SelectionStatePlugin.tsx
function Xe({ onEditorReady: e, onStateChange: t }) {
	let [n] = F();
	return m(() => (e(n), n.registerUpdateListener(({ editorState: e }) => {
		e.read(() => {
			t(Ye());
		});
	})), [
		n,
		e,
		t
	]), null;
}
//#endregion
//#region src/text-editor/lib/serialization/createLexicalRaw.ts
var Ze = (e) => ({
	format: "lexical",
	version: 1,
	editorState: e.toJSON()
}), K = (e) => {
	let t = 0, n = e;
	for (; n;) t += 1, n = n.getParent();
	return t;
}, Qe = (e) => {
	if (!(e instanceof HTMLAnchorElement)) return { node: null };
	let t = e.textContent;
	return (t === null || t === "") && e.children.length === 0 ? { node: null } : { node: J(e.getAttribute("href") || "", {
		rel: e.getAttribute("rel"),
		target: e.getAttribute("target"),
		title: e.getAttribute("title"),
		ariaLabel: e.getAttribute("aria-label"),
		qrCode: e.getAttribute("data-qr-code") === "true",
		add: null,
		text: t
	}) };
}, q = class e extends Ie {
	__ariaLabel;
	__qrCode;
	__add;
	__text;
	static getType() {
		return "accessible-link";
	}
	static clone(t) {
		return new e(t.__url, {
			rel: t.__rel,
			target: t.__target,
			title: t.__title,
			ariaLabel: t.__ariaLabel,
			qrCode: t.__qrCode,
			add: t.__add,
			text: t.__text
		}, t.__key);
	}
	constructor(e = "", t = {}, n) {
		super(e, t, n);
		let { ariaLabel: r = null, qrCode: i = !1, add: a = null, text: o = null } = t;
		this.__ariaLabel = r, this.__qrCode = i, this.__add = a, this.__text = o;
	}
	static importDOM() {
		return { a: () => ({
			conversion: Qe,
			priority: 2
		}) };
	}
	static importJSON(e) {
		return J().updateFromJSON(e);
	}
	updateFromJSON(e) {
		return super.updateFromJSON(e).setAriaLabel(e.ariaLabel || null).setQrCode(!!e.qrCode).setAdd(e.add || null).setText(e.text || null);
	}
	exportJSON() {
		return {
			...super.exportJSON(),
			type: "accessible-link",
			version: 1,
			ariaLabel: this.getAriaLabel(),
			qrCode: this.getQrCode(),
			add: this.getAdd(),
			text: this.getText()
		};
	}
	createDOM(e) {
		let t = super.createDOM(e);
		return this.applyAccessibleAttributes(null, t), t;
	}
	updateDOM(e, t, n) {
		let r = super.updateDOM(e, t, n);
		return this.applyAccessibleAttributes(e, t), r;
	}
	applyAccessibleAttributes(e, t) {
		t instanceof HTMLAnchorElement && ((!e || e.__ariaLabel !== this.__ariaLabel) && (this.__ariaLabel ? t.setAttribute("aria-label", this.__ariaLabel) : t.removeAttribute("aria-label")), (!e || e.__qrCode !== this.__qrCode) && t.setAttribute("data-qr-code", this.__qrCode ? "true" : "false"));
	}
	insertNewAfter(e, t = !0) {
		let n = J(this.__url, {
			rel: this.__rel,
			target: this.__target,
			title: this.__title,
			ariaLabel: this.__ariaLabel,
			qrCode: this.__qrCode,
			add: this.__add,
			text: this.__text
		});
		return this.insertAfter(n, t), n;
	}
	getAriaLabel() {
		return this.getLatest().__ariaLabel;
	}
	setAriaLabel(e) {
		let t = this.getWritable();
		return t.__ariaLabel = e, this;
	}
	getQrCode() {
		return this.getLatest().__qrCode;
	}
	setQrCode(e) {
		let t = this.getWritable();
		return t.__qrCode = e, this;
	}
	getAdd() {
		return this.getLatest().__add;
	}
	setAdd(e) {
		let t = this.getWritable();
		return t.__add = e, this;
	}
	getText() {
		return this.getLatest().__text;
	}
	setText(e) {
		let t = this.getWritable();
		return t.__text = e, this;
	}
}, J = (e = "", t) => I(new q(e, t)), Y = (e) => e instanceof q, $e = (e) => {
	let t = {};
	return Array.from(e.attributes).forEach((e) => {
		e.name !== "class" && (t[e.name] = e.value);
	}), t;
}, X = (e) => {
	if (!(e instanceof HTMLElement)) return { node: null };
	let t = e.tagName.toLowerCase();
	if (![
		"abbr",
		"span",
		"time",
		"cite",
		"del",
		"ins"
	].includes(t)) return { node: null };
	let n = e.textContent;
	return (n === null || n === "") && e.children.length === 0 ? { node: null } : { node: Q(t, $e(e), n) };
}, Z = class e extends je {
	__tag;
	__attributes;
	__text;
	static getType() {
		return "semantic-tag";
	}
	static clone(t) {
		return new e(t.__tag, t.__attributes, t.__text, t.__key);
	}
	constructor(e = "span", t = {}, n = null, r) {
		super(r), this.__tag = e, this.__attributes = t, this.__text = n;
	}
	static importDOM() {
		return {
			abbr: () => ({
				conversion: X,
				priority: 2
			}),
			span: () => ({
				conversion: X,
				priority: 2
			}),
			time: () => ({
				conversion: X,
				priority: 2
			}),
			cite: () => ({
				conversion: X,
				priority: 2
			}),
			del: () => ({
				conversion: X,
				priority: 2
			}),
			ins: () => ({
				conversion: X,
				priority: 2
			})
		};
	}
	static importJSON(e) {
		return Q(e.tag, e.attributes, e.text).updateFromJSON(e);
	}
	updateFromJSON(e) {
		return super.updateFromJSON(e).setTag(e.tag).setAttributes(e.attributes || {}).setText(e.text || null);
	}
	exportJSON() {
		return {
			...super.exportJSON(),
			type: "semantic-tag",
			version: 1,
			tag: this.getTag(),
			attributes: this.getAttributes(),
			text: this.getText()
		};
	}
	createDOM(e) {
		let t = document.createElement(this.__tag);
		return this.applyEditorAttributes(t), t;
	}
	updateDOM(e, t) {
		return e.__tag !== this.__tag || (this.applyEditorAttributes(t), !1);
	}
	exportDOM() {
		let e = document.createElement(this.__tag);
		return Object.entries(this.__attributes).forEach(([t, n]) => {
			e.setAttribute(t, n);
		}), { element: e };
	}
	applyEditorAttributes(e) {
		e.classList.add("custom-tag-highlight"), Array.from(e.attributes).forEach((t) => {
			t.name !== "class" && e.removeAttribute(t.name);
		}), Object.entries(this.__attributes).forEach(([t, n]) => {
			e.setAttribute(t, n);
		});
	}
	insertNewAfter(e, t = !0) {
		let n = Q(this.__tag, this.__attributes, this.__text);
		return this.insertAfter(n, t), n;
	}
	canInsertTextBefore() {
		return !1;
	}
	canInsertTextAfter() {
		return !1;
	}
	canBeEmpty() {
		return !1;
	}
	isInline() {
		return !0;
	}
	getTag() {
		return this.getLatest().__tag;
	}
	setTag(e) {
		let t = this.getWritable();
		return t.__tag = e, this;
	}
	getAttributes() {
		return this.getLatest().__attributes;
	}
	setAttributes(e) {
		let t = this.getWritable();
		return t.__attributes = e, this;
	}
	getText() {
		return this.getLatest().__text;
	}
	setText(e) {
		let t = this.getWritable();
		return t.__text = e, this;
	}
}, Q = (e, t = {}, n = null) => I(new Z(e, t, n)), et = (e) => e instanceof Z;
//#endregion
//#region src/text-editor/model/hooks/useTextEditorLexicalActions.ts
function tt({ editor: e, toolbarState: t, hasLocalLinkDialog: n, onOpenLinkDialog: r, onOpenTagDialog: i }) {
	let a = p((n) => {
		if (e) {
			if (n === "unordered-list-item") {
				if (t.blockType === "unordered-list-item") {
					e.dispatchCommand(P, void 0);
					return;
				}
				e.dispatchCommand(me, void 0);
				return;
			}
			if (n === "ordered-list-item") {
				if (t.blockType === "ordered-list-item") {
					e.dispatchCommand(P, void 0);
					return;
				}
				e.dispatchCommand(pe, void 0);
				return;
			}
			e.update(() => {
				let e = z();
				if (!B(e)) return;
				if (n === "unstyled" || n === "paragraph") {
					H(e, () => L());
					return;
				}
				if (n === "blockquote") {
					H(e, () => Te());
					return;
				}
				let t = Ge(n);
				t && H(e, () => we(t));
			});
		}
	}, [e, t.blockType]), o = p((t) => {
		if (!e) return;
		let n = Ke(t);
		n && e.dispatchCommand(Ne, n);
	}, [e]), s = p((t) => {
		e && e.dispatchCommand(Me, t);
	}, [e]), c = p(() => {
		e && e.dispatchCommand(Fe, void 0);
	}, [e]), l = p(() => {
		e && e.dispatchCommand(Pe, void 0);
	}, [e]), u = p(() => {
		if (!e) return "";
		let t = "";
		return e.getEditorState().read(() => {
			let e = z();
			B(e) && (t = e.getTextContent());
		}), t;
	}, [e]), d = p((t) => {
		e && (e.update(() => {
			let e = z();
			if (!B(e)) return;
			let n = e.getTextContent(), r = t.text.length > 0 ? t.text : n;
			if (!r.trim()) return;
			let i = J(t.url, {
				target: "_blank",
				rel: "noopener noreferrer",
				ariaLabel: t.ariaLabel || n || r,
				qrCode: t.qrCode,
				add: t.add || null,
				text: r
			}), a = R(r);
			i.append(a), e.insertNodes([i]);
		}), requestAnimationFrame(() => {
			e.focus();
		}));
	}, [e]), m = p((e, t, n, r, i) => {
		d({
			url: e,
			text: t,
			add: n,
			ariaLabel: r,
			qrCode: i
		});
	}, [d]), h = p((e, t) => {
		d({
			url: e,
			text: t,
			add: "",
			ariaLabel: "Внутренняя ссылка на статью: " + t,
			qrCode: !1
		});
	}, [d]), g = p(() => {
		if (!e) return "";
		let t = "";
		return e.getEditorState().read(() => {
			let e = z();
			if (!B(e)) {
				t = "";
				return;
			}
			let n = e.getTextContent(), r = e.anchor.getNode(), i = Le(r, (e) => Y(e) || V(e));
			if (Y(i)) {
				t = {
					url: i.getURL(),
					ariaLabel: i.getAriaLabel() || "",
					text: i.getText() || n,
					add: i.getAdd() || "",
					qrCode: i.getQrCode()
				};
				return;
			}
			if (V(i)) {
				t = {
					url: i.getURL(),
					ariaLabel: "",
					text: n,
					add: "",
					qrCode: !1
				};
				return;
			}
			t = n;
		}), t;
	}, [e]), _ = p((e) => {
		e === f.LOCAL_LINK && !n || r(e);
	}, [n, r]), v = p((t, n, r) => {
		e && (e.update(() => {
			let e = z();
			if (!B(e)) return;
			let i = e.getTextContent().trim(), a = n || i || r.title || r["aria-label"] || Object.values(r).join(" ") || t;
			if (!a.trim()) return;
			let o = Q(t, r, a);
			o.append(R(a)), e.insertNodes([o]);
		}), requestAnimationFrame(() => {
			e.focus();
		}));
	}, [e]);
	return {
		handleAddLink: m,
		handleAddLocalLink: h,
		handleAlignmentChange: s,
		handleBlockStyleToggle: a,
		handleCleanSemanticTag: p(() => {
			e && e.update(() => {
				let e = z();
				if (!B(e) || e.isCollapsed()) return;
				let t = e.getNodes(), n = /* @__PURE__ */ new Set();
				t.forEach((e) => {
					let t = e;
					for (; t;) et(t) && n.add(t), t = t.getParent();
				}), Array.from(n).sort((e, t) => K(t) - K(e)).forEach((e) => {
					e.isAttached() && (e.getChildren().forEach((t) => e.insertBefore(t)), e.remove());
				});
			});
		}, [e]),
		handleInlineStyleToggle: o,
		handleLinkClick: _,
		handleRedo: l,
		handleTagClick: p((e) => {
			i(e);
		}, [i]),
		handleUndo: c,
		getCurrentSelectionText: u,
		getSelectedLinkState: g,
		insertSemanticTagAtSelection: v
	};
}
var $ = {
	textEditor: "_75LW3N",
	textEditorContent: "PLiHsN",
	focused: "m-jmCu",
	wrapper: "_4NWAs0"
};
//#endregion
//#region src/text-editor/EmailDialog.tsx
function nt({ isOpen: t, onClose: o, onConfirm: s, initialState: c }) {
	let [l, u] = v(""), [d, f] = v(""), [p, h] = v(null), [g] = v(() => M(c) && typeof c == "string" ? {
		text: "",
		add: "",
		ariaLabel: "",
		url: c
	} : c);
	m(() => {
		t && M(g) && (u(g.url ?? ""), f(g.ariaLabel ?? ""));
	}, [t, g]);
	let _ = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) ? !0 : (h("Некорректный email адрес"), !1), b = (e) => {
		if (e.preventDefault(), _(l)) {
			if (!d) {
				h("Добавьте описание для email");
				return;
			}
			s(`mailto:${l}`, "", "", d, !1), x();
		}
	}, x = () => {
		u(""), f(""), h(null), o();
	};
	return /* @__PURE__ */ j(i, {
		isOpen: t,
		onClose: x,
		title: "Ссылка на email",
		size: "md",
		children: [/* @__PURE__ */ A(a, { children: /* @__PURE__ */ j("div", {
			className: y("flexColumn", "gapMd"),
			children: [
				/* @__PURE__ */ A(n, {
					label: "Email адрес",
					value: l,
					onChange: u,
					placeholder: "some_email@mail.ru"
				}),
				p && /* @__PURE__ */ j("div", {
					className: "textColorDanger",
					children: [
						/* @__PURE__ */ A("strong", { children: "Ошибка ввода:" }),
						" ",
						/* @__PURE__ */ A("span", {
							className: "fontItalic",
							children: p
						})
					]
				}),
				/* @__PURE__ */ A(n, {
					label: "Текст для экранных читалок",
					value: d,
					onChange: f,
					placeholder: "Электронная почта руководителя городской думмы"
				})
			]
		}) }), /* @__PURE__ */ j(r, { children: [/* @__PURE__ */ A(e, {
			appearance: "outline",
			tone: "error",
			onClick: x,
			children: "Отмена"
		}), /* @__PURE__ */ A(e, {
			appearance: "outline",
			tone: "success",
			onClick: b,
			disabled: !l || !d,
			children: "Подтвердить"
		})] })]
	});
}
//#endregion
//#region src/text-editor/LinkDialog.tsx
function rt({ isOpen: s, onClose: c, onConfirm: l, initialState: u }) {
	let [d, f] = v(""), [p, h] = v(""), [g, _] = v(null), [y, b] = v(!1), [x] = v(() => M(u) && typeof u == "string" ? {
		text: "",
		add: "",
		ariaLabel: "",
		url: u
	} : u);
	m(() => {
		s && M(x) && (f(x.url ?? ""), h(x.ariaLabel ?? ""));
	}, [s, x]);
	let S = (e) => {
		f(e), g && _(null);
	}, C = (e) => {
		e.preventDefault();
		let t = le(d);
		if (!t.isValid) {
			_(t.error);
			return;
		}
		if (!p) {
			_("добавьте описание для ссылки");
			return;
		}
		l(d.startsWith("http") ? d : `https://${d}`, "", "", p, y), w();
	}, w = () => {
		f(""), h(""), _(null), c();
	};
	return /* @__PURE__ */ j(i, {
		isOpen: s,
		onClose: w,
		title: "Ссылка на внешний url",
		size: "md",
		children: [/* @__PURE__ */ A(a, { children: /* @__PURE__ */ j(t, {
			gap: "md",
			children: [
				/* @__PURE__ */ A(n, {
					label: "Полный URL адрес",
					value: d,
					onChange: S,
					placeholder: "https://somesite.ru"
				}),
				g && /* @__PURE__ */ j("div", {
					className: "textColorDanger",
					children: [
						/* @__PURE__ */ A("strong", { children: "Ошибка ввода:" }),
						" ",
						/* @__PURE__ */ A("span", {
							className: "fontItalic",
							children: g
						})
					]
				}),
				/* @__PURE__ */ A(n, {
					label: "Текст для экранных читалок",
					value: p,
					onChange: h,
					placeholder: "Ссылка на официальный сайт городской думмы"
				}),
				/* @__PURE__ */ A(o, {
					title: "Показать кнопку для генерации QR кода ссылки",
					value: y,
					onChange: b
				})
			]
		}) }), /* @__PURE__ */ j(r, { children: [/* @__PURE__ */ A(e, {
			appearance: "outline",
			tone: "error",
			onClick: w,
			children: "Отмена"
		}), /* @__PURE__ */ A(e, {
			appearance: "outline",
			tone: "success",
			onClick: C,
			disabled: !d || !p,
			children: "Подтвердить"
		})] })]
	});
}
//#endregion
//#region src/text-editor/PhoneDialog.tsx
function it({ isOpen: o, onClose: s, onConfirm: c, initialState: l }) {
	let [u, d] = v(""), [f, p] = v(""), [h, g] = v(""), [_, b] = v(null), [x] = v(() => M(l) && typeof l == "string" ? {
		text: "",
		add: "",
		ariaLabel: "",
		url: l
	} : l);
	m(() => {
		o && M(x) && (d((x.url ?? "").replace(/\D/g, "").slice(0, 11).replace(/^7/, "")), x.add ? p((x.add ?? "").replace(/\D/g, "")) : p((x.url ?? "").replace(/\D/g, "").slice(11)), g(x.ariaLabel ?? ""));
	}, [o, x]);
	let S = (e) => {
		e = e.replace(/\D/g, ""), e.length <= 10 ? (d(e), b(null)) : b("нельзя ввести более 10 цифр");
	}, C = (e) => e.length === 10 || (b("номер телефона должен содержать 10 цифр"), !1), w = (e) => {
		if (e.preventDefault(), !C(u)) return;
		if (!h) {
			b("добавьте описание для телефона");
			return;
		}
		let t = ce(u);
		c(`tel:${`+7${u}`}`, f ? `${t} доб. ${f}` : t, f, h, !1), T();
	}, T = () => {
		d(""), g(""), b(null), s();
	};
	return /* @__PURE__ */ j(i, {
		isOpen: o,
		onClose: T,
		title: "Ссылка на телефон",
		size: "md",
		children: [/* @__PURE__ */ A(a, { children: /* @__PURE__ */ j(t, {
			gap: "md",
			children: [
				/* @__PURE__ */ j("div", {
					className: y("flex", "alignItemsEnd", "gapSm"),
					children: [/* @__PURE__ */ A(n, {
						label: "Номер телефона без 7-ки",
						description: "Вводится только номер (10) цифр без каких-либо дополнительных символов. Ссылка будет привязана к текущему выделенному фрагменту текста. Поэтому текст самой ссылки можно оформить грамотно, например: +7 (3522) 12-34-56 доб. 100",
						value: u,
						onChange: S,
						placeholder: "3522123456",
						className: "flex1"
					}), /* @__PURE__ */ A(n, {
						label: "Добавочный номер",
						value: f,
						onChange: p,
						placeholder: "100"
					})]
				}),
				_ && /* @__PURE__ */ j("div", {
					className: "textColorDanger",
					children: [
						/* @__PURE__ */ A("strong", { children: "Ошибка ввода:" }),
						" ",
						/* @__PURE__ */ A("span", {
							className: "fontItalic",
							children: _
						})
					]
				}),
				/* @__PURE__ */ A(n, {
					label: "Текст для экранных читалок",
					description: "Обязательное поле для организации доступности ссылки для лиц с ОВЗ, использующих скринридеры",
					value: h,
					onChange: g,
					placeholder: "Контактный телефон директора"
				})
			]
		}) }), /* @__PURE__ */ j(r, { children: [/* @__PURE__ */ A(e, {
			appearance: "solid",
			tone: "error",
			onClick: T,
			children: "Отмена"
		}), /* @__PURE__ */ A(e, {
			appearance: "solid",
			tone: "success",
			onClick: w,
			disabled: !u || !h,
			children: "Подтвердить"
		})] })]
	});
}
//#endregion
//#region src/text-editor/SemanticDialog.tsx
function at({ isOpen: o, onClose: s, onConfirm: c, config: l, initialText: u = "", initialState: d = {} }) {
	let [f, p] = v(u), [h, g] = v({}), [_, y] = v({}), [b, x] = v(!1);
	m(() => {
		if (o && !b) {
			let e = l.fields.reduce((e, t) => (e[t.name] = d[t.name] ?? "", e), {});
			g(e), y({}), x(!0);
		} else !o && b && x(!1);
	}, [
		o,
		l.fields,
		d,
		b
	]);
	let S = (e, t) => {
		g((n) => ({
			...n,
			[e]: t
		})), y((t) => ({
			...t,
			[e]: null
		}));
	}, C = () => {
		let e = {}, t = !0;
		f.trim() || (e.text = "Обязательное поле", t = !1);
		for (let n of l.fields) {
			let r = h[n.name]?.trim();
			if (n.required && !r) e[n.name] = "Обязательное поле", t = !1;
			else if (n.validate) {
				let i = n.validate(r);
				i && (e[n.name] = i, t = !1);
			}
		}
		return y(e), t;
	};
	return /* @__PURE__ */ j(i, {
		isOpen: o,
		onClose: s,
		title: `Вставка <${l.tagName}>`,
		size: "md",
		children: [/* @__PURE__ */ A(a, { children: /* @__PURE__ */ j(t, {
			gap: "md",
			children: [
				/* @__PURE__ */ j("div", { children: [
					l.description,
					".",
					/* @__PURE__ */ A("br", {})
				] }),
				/* @__PURE__ */ j("div", { children: [
					/* @__PURE__ */ A("strong", { children: "Пример:" }),
					" ",
					l.example
				] }),
				/* @__PURE__ */ A(n, {
					label: l.title,
					description: `Данный текст будет вставлен в редактор и обёрнуть в специальный семантический тег ${l.tagName}`,
					value: f,
					onChange: p,
					error: _.text ?? void 0,
					required: !0
				}),
				l.fields.map((e) => /* @__PURE__ */ A(n, {
					label: e.label,
					description: e.description,
					placeholder: e.placeholder,
					value: h[e.name] ?? "",
					onChange: (t) => S(e.name, t),
					error: _[e.name] ?? void 0,
					required: e.required
				}, e.name))
			]
		}) }), /* @__PURE__ */ j(r, { children: [/* @__PURE__ */ A(e, {
			appearance: "solid",
			tone: "error",
			onClick: s,
			children: "Отмена"
		}), /* @__PURE__ */ A(e, {
			appearance: "solid",
			tone: "success",
			onClick: () => {
				C() && (c(l.tagName, f.trim(), h), s());
			},
			children: "Подтвердить"
		})] })]
	});
}
//#endregion
//#region src/text-editor/semanticTagConfigs.tsx
var ot = {
	[u.abbr]: {
		tagName: "abbr",
		title: "Аббревиатура",
		description: "Обозначает аббревиатуры и сокращения, при наведении покажет расшифровку",
		example: /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("abbr", {
			title: "Национальное управление по аэронавтике и исследованию космического пространства",
			children: "НАСА"
		}), /* @__PURE__ */ A("div", {
			className: "marginTopMd",
			children: /* @__PURE__ */ A("code", { children: "<abbr title=\"Национальное управление по аэронавтике и исследованию космического пространства\">НАСА</abbr>" })
		})] }),
		fields: [{
			name: "title",
			label: "Расшифровка",
			description: "Появится как подсказка и будет прочитана скринридером",
			placeholder: "например: HyperText Markup Language",
			required: !0
		}]
	},
	[u.lang]: {
		tagName: "span",
		title: "Текст на другом языке",
		description: "Указывает язык фрагмента текста, если он отличается от основного языка страницы, скринридер прочитает это слово с французским произношением",
		example: /* @__PURE__ */ j(k, { children: [
			/* @__PURE__ */ A("span", {
				lang: "fr",
				children: "Bonjour!"
			}),
			" — сказал турист.",
			/* @__PURE__ */ A("div", {
				className: "marginTopMd",
				children: /* @__PURE__ */ A("code", { children: "<span lang=\"fr\">Bonjour!</span> — сказал турист." })
			})
		] }),
		fields: [{
			name: "lang",
			label: "Код языка",
			placeholder: "en, fr, ru",
			required: !0,
			validate: (e) => /^[a-z]{2,3}(-[A-Z]{2})?$/.test(e) ? null : "Неверный код языка (например, en или en-US)"
		}]
	},
	[u.time]: {
		tagName: "time",
		title: "Дата/время",
		description: "",
		example: "",
		fields: [{
			name: "datetime",
			label: "Дата/время (machine-readable)",
			description: "Формат ISO 8601: 2025-05-18, 14:30, 2025-05-18T14:30",
			placeholder: "например: 2025-05-18T14:30",
			required: !0
		}]
	},
	[u.cite]: {
		tagName: "cite",
		title: "Цитата источника",
		description: "Обозначает название книги, статьи, фильма или другого произведения, на которое вы ссылаетесь",
		example: /* @__PURE__ */ j(k, { children: [
			"По словам Эйнштейна: ",
			/* @__PURE__ */ A("cite", { children: "«Воображение важнее знания»" }),
			".",
			/* @__PURE__ */ A("div", {
				className: "marginTopMd",
				children: /* @__PURE__ */ A("code", { children: "По словам Эйнштейна: <cite>«Воображение важнее знания»</cite>." })
			})
		] }),
		fields: [{
			name: "title",
			label: "Название источника",
			description: "Будет отображаться как подсказка",
			placeholder: "например: Википедия",
			required: !1
		}]
	},
	[u.del]: {
		tagName: "del",
		title: "Изменения в тексте",
		description: "Удаленный фрагмент",
		example: /* @__PURE__ */ j(k, { children: [
			"Проект сдачи: ",
			/* @__PURE__ */ A("del", { children: "1 июня" }),
			" ",
			/* @__PURE__ */ A("ins", { children: "15 июня" }),
			/* @__PURE__ */ A("div", {
				className: "marginTopMd",
				children: /* @__PURE__ */ A("code", { children: "Проект сдачи: <del>1 июня</del> <ins>15 июня</ins>" })
			})
		] }),
		fields: [{
			name: "datetime",
			label: "Когда был удалён",
			description: "Формат ISO 8601: 2025-05-18T14:30",
			placeholder: "например: 2025-05-18T14:30",
			required: !1
		}, {
			name: "cite",
			label: "Источник/обоснование",
			description: "Ссылка на объяснение причины",
			placeholder: "например: https://example.com/edit-log",
			required: !1
		}]
	},
	[u.ins]: {
		tagName: "ins",
		title: "Изменения в тексте",
		description: "Новый добавленный текст",
		example: /* @__PURE__ */ j(k, { children: [
			"Проект сдачи: ",
			/* @__PURE__ */ A("del", { children: "1 июня" }),
			" ",
			/* @__PURE__ */ A("ins", { children: "15 июня" }),
			/* @__PURE__ */ A("div", {
				className: "marginTopMd",
				children: /* @__PURE__ */ A("code", { children: "Проект сдачи: <del>1 июня</del> <ins>15 июня</ins>" })
			})
		] }),
		fields: [{
			name: "datetime",
			label: "Когда был добавлен",
			description: "Формат ISO 8601: 2025-05-18T14:30",
			placeholder: "например: 2025-05-18T14:30",
			required: !1
		}, {
			name: "cite",
			label: "Источник/обоснование",
			description: "Ссылка на объяснение причины",
			placeholder: "например: https://example.com/edit-log",
			required: !1
		}]
	}
};
//#endregion
//#region src/text-editor/TimeDialog.tsx
function st({ isOpen: o, onClose: c, onConfirm: l, initialState: u }) {
	let [d, f] = v("date"), [p, g] = v(""), [_, y] = v(""), [b, x] = v({}), S = h((e) => {
		f(e?.mode ?? "date"), g(e?.from ?? ""), y(e?.to ?? ""), x({});
	});
	m(() => {
		o && S(u);
	}, [o, u]);
	let C = () => {
		let e = {}, t = (e) => /^\d{4}-\d{2}-\d{2}$/.test(e), n = (e) => /^\d{2}:\d{2}$/.test(e), r = (e) => /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(e), i = (e, i, a) => {
			if (!i) return `${e} обязательно`;
			if (a === "date" && !t(i)) return "Неверный формат даты (ГГГГ-ММ-ДД)";
			if (a === "time" && !n(i)) return "Неверный формат времени (ЧЧ:ММ)";
			if (a === "datetime" && !r(i)) return "Неверный формат даты и времени (ГГГГ-ММ-ДДTЧЧ:ММ)";
		};
		switch (d) {
			case "date":
				e.from = i("Дата", p, "date");
				break;
			case "time":
				e.from = i("Время", p, "time");
				break;
			case "datetime":
				e.from = i("Дата и время", p, "datetime");
				break;
			case "range-time":
				e.from = i("Время начала", p, "time"), e.to = i("Время окончания", _, "time");
				break;
			case "range-date":
				e.from = i("Дата начала", p, "date"), e.to = i("Дата окончания", _, "date");
				break;
			case "range-datetime": e.from = i("Начало", p, "datetime"), e.to = i("Окончание", _, "datetime");
		}
		return x(e), Object.values(e).every((e) => !e);
	};
	return /* @__PURE__ */ j(i, {
		isOpen: o,
		onClose: c,
		title: "Вставка <time>",
		size: "md",
		children: [/* @__PURE__ */ A(a, { children: /* @__PURE__ */ j(t, {
			gap: "md",
			children: [/* @__PURE__ */ j(s, {
				label: "Тип значения",
				value: d,
				onChange: f,
				children: [
					/* @__PURE__ */ A(s.Option, {
						label: "Дата",
						value: "date"
					}),
					/* @__PURE__ */ A(s.Option, {
						label: "Дата и время",
						value: "datetime"
					}),
					/* @__PURE__ */ A(s.Option, {
						label: "Время",
						value: "time"
					}),
					/* @__PURE__ */ A(s.Option, {
						label: "Диапазон дат",
						value: "range-date"
					}),
					/* @__PURE__ */ A(s.Option, {
						label: "Диапазон времени",
						value: "range-time"
					}),
					/* @__PURE__ */ A(s.Option, {
						label: "Диапазон даты и времени",
						value: "range-datetime"
					})
				]
			}), /* @__PURE__ */ A(t, {
				gap: "md",
				children: (() => {
					switch (d) {
						case "date":
						case "datetime":
						case "time": return /* @__PURE__ */ A(n, {
							label: "Значение",
							placeholder: d === "time" ? "09:00" : d === "date" ? "2025-05-18" : "2025-05-18T09:00",
							value: p,
							onChange: g,
							error: b.from
						});
						case "range-time":
						case "range-date":
						case "range-datetime": return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(n, {
							label: "С",
							placeholder: d.includes("time") ? "09:00" : d.includes("date") ? "2025-05-18" : "2025-05-18T09:00",
							value: p,
							onChange: g,
							error: b.from
						}), /* @__PURE__ */ A(n, {
							label: "По",
							placeholder: d.includes("time") ? "17:00" : d.includes("date") ? "2025-05-22" : "2025-05-22T17:00",
							value: _,
							onChange: g,
							error: b.to
						})] });
					}
				})()
			})]
		}) }), /* @__PURE__ */ j(r, { children: [/* @__PURE__ */ A(e, {
			appearance: "solid",
			tone: "error",
			onClick: c,
			children: "Отмена"
		}), /* @__PURE__ */ A(e, {
			appearance: "solid",
			tone: "success",
			onClick: () => {
				if (!C()) return;
				let e = _ ? `${p}/${_}` : p;
				l("time", e, { datetime: e }), c();
			},
			children: "Подтвердить"
		})] })]
	});
}
//#endregion
//#region src/text-editor/TextEditorDialogs.tsx
function ct({ linkTypeDialog: e, tagTypeDialog: t, localLinkDialogComponent: n, onCloseLinkDialog: r, onCloseTagDialog: i, onAddLink: a, onAddLocalLink: o, onInsertSemanticTag: s, getCurrentSelectionText: c, getSelectedLinkState: l }) {
	let d = n;
	return /* @__PURE__ */ j(k, { children: [e && /* @__PURE__ */ j(k, { children: [
		d && /* @__PURE__ */ A(d, {
			isOpen: e === f.LOCAL_LINK,
			onClose: r,
			onConfirm: o
		}),
		/* @__PURE__ */ A(rt, {
			isOpen: e === f.LINK,
			initialState: l(),
			onClose: r,
			onConfirm: a
		}),
		/* @__PURE__ */ A(it, {
			isOpen: e === f.PHONE,
			initialState: l(),
			onClose: r,
			onConfirm: a
		}),
		/* @__PURE__ */ A(nt, {
			isOpen: e === f.EMAIL,
			initialState: l(),
			onClose: r,
			onConfirm: a
		})
	] }), t && (t === u.time ? /* @__PURE__ */ A(st, {
		isOpen: !0,
		onClose: i,
		onConfirm: s
	}) : /* @__PURE__ */ A(at, {
		isOpen: !0,
		onClose: i,
		onConfirm: s,
		config: ot[t],
		initialText: c()
	}))] });
}
//#endregion
//#region src/text-editor/TextEditorLexicalClient.tsx
function lt({ initialData: e, onChange: t, toolbarComponents: n, businessAdapters: r }) {
	let i = r?.LocalLinkDialogComponent, [a, o] = v(!1), [s, l] = v(G), [u, d] = v(null), [f, m] = v(null), [h, _] = v(null), b = c(e?.raw) ? e.raw : null, x = !!b, S = g(() => {
		if (b) return JSON.stringify(b.editorState);
	}, [b]), C = p((e) => {
		console.error("Ошибка редактора Lexical", e);
	}, []), w = p((e, n) => {
		let r = "";
		e.read(() => {
			r = ue(n, null);
		}), t({
			raw: Ze(e),
			html: r
		});
	}, [t]), T = p((e) => {
		m(e);
	}, []), E = p((e) => {
		_(e);
	}, []), D = tt({
		editor: u,
		toolbarState: s,
		hasLocalLinkDialog: !!i,
		onOpenLinkDialog: T,
		onOpenTagDialog: E
	}), O = g(() => ({
		namespace: "KtkTextEditorLexical",
		onError: C,
		theme: {
			paragraph: "paragraph",
			text: {
				code: "lexicalTextCode",
				highlight: "lexicalTextHighlight",
				underline: "lexicalTextUnderline",
				strikethrough: "lexicalTextStrikethrough"
			}
		},
		nodes: [
			Oe,
			ke,
			ge,
			he,
			q,
			Z
		],
		editorState: S
	}), [C, S]);
	return /* @__PURE__ */ j("div", {
		className: $.textEditor,
		children: [/* @__PURE__ */ A("div", {
			className: y($.textEditorContent, { [$.focused]: a }),
			children: /* @__PURE__ */ j(_e, {
				initialConfig: O,
				children: [
					/* @__PURE__ */ A(He, {
						toolbarComponents: n,
						state: s,
						onBlockStyleToggle: D.handleBlockStyleToggle,
						onInlineStyleToggle: D.handleInlineStyleToggle,
						onAlignmentChange: D.handleAlignmentChange,
						onLinkClick: D.handleLinkClick,
						onTagClick: D.handleTagClick,
						onUndo: D.handleUndo,
						onRedo: D.handleRedo,
						onCleanTag: D.handleCleanSemanticTag
					}),
					/* @__PURE__ */ A(Ce, {
						contentEditable: /* @__PURE__ */ A(ve, {
							className: "lexicalEditorContentEditable",
							onFocus: () => o(!0),
							onBlur: () => o(!1)
						}),
						placeholder: /* @__PURE__ */ A("div", {
							className: "lexicalEditorPlaceholder",
							children: "Введите текст..."
						}),
						ErrorBoundary: ye
					}),
					/* @__PURE__ */ A(be, {}),
					/* @__PURE__ */ A(xe, {}),
					/* @__PURE__ */ A(Xe, {
						onEditorReady: d,
						onStateChange: l
					}),
					/* @__PURE__ */ A(Ue, {
						initialHTML: e?.html,
						shouldSkip: x
					}),
					/* @__PURE__ */ A(Se, {
						onChange: w,
						ignoreSelectionChange: !0
					})
				]
			})
		}), /* @__PURE__ */ A(ct, {
			linkTypeDialog: f,
			tagTypeDialog: h,
			localLinkDialogComponent: i,
			onCloseLinkDialog: () => m(null),
			onCloseTagDialog: () => _(null),
			onAddLink: D.handleAddLink,
			onAddLocalLink: D.handleAddLocalLink,
			onInsertSemanticTag: D.insertSemanticTagAtSelection,
			getCurrentSelectionText: D.getCurrentSelectionText,
			getSelectedLinkState: D.getSelectedLinkState
		})]
	});
}
//#endregion
export { lt as TextEditorLexicalClient };

//# sourceMappingURL=TextEditorLexicalClient-CK8j3RA4.js.map