UNPKG

denwa-react-shared

Version:
1,389 lines (1,388 loc) • 47.2 kB
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as ee, a as D, b as te, c as O, d as ne, et as re, f as ie, g as k, h as ae, i as oe, j as se, k as ce, l as le, m as ue, n as de, o as fe, p as pe, q as me, r as he, s as ge, t as A, u as _e, v as ve, w as ye, x as be, y as j, z as xe } from "./styles.module-djPz2AzU.js"; import { create as Se } from "zustand"; import { HttpStatusCode as Ce } from "axios"; import M from "dayjs"; import { Fragment as we, jsx as N, jsxs as P } from "react/jsx-runtime"; import { useDebounce as F } from "react-use"; import { Suspense as Te, createElement as Ee, forwardRef as I, lazy as L, useCallback as De, useEffect as R, useImperativeHandle as Oe, useMemo as ke, useState as z } from "react"; import { Button as B, Card as Ae, ConfigProvider as je, DatePicker as Me, Drawer as Ne, Flex as V, Form as Pe, Image as Fe, Input as H, List as Ie, Modal as Le, Popover as Re, Select as ze, Skeleton as U, Spin as Be, Tooltip as W, Typography as G, Upload as Ve, theme as K } from "antd"; import q from "classnames"; import { DndContext as He, PointerSensor as Ue, useSensor as We } from "@dnd-kit/core"; import { SortableContext as Ge, arrayMove as Ke, useSortable as qe, verticalListSortingStrategy as Je } from "@dnd-kit/sortable"; import { AlignCenterOutlined as Ye, AlignLeftOutlined as Xe, AlignRightOutlined as Ze, BoldOutlined as Qe, DeleteOutlined as $e, DisconnectOutlined as et, HolderOutlined as tt, ItalicOutlined as nt, LinkOutlined as rt, LoadingOutlined as it, MenuOutlined as at, OrderedListOutlined as ot, PictureOutlined as st, PlusOutlined as ct, UnderlineOutlined as lt, UnorderedListOutlined as ut, UploadOutlined as dt } from "@ant-design/icons"; import { CSS as ft } from "@dnd-kit/utilities"; import { FullscreenControl as pt, Map as mt, Placemark as ht, SearchControl as gt, YMaps as _t, ZoomControl as vt } from "@iminside/react-yandex-maps"; import { Editor as J, Element as yt, Range as bt, Text as xt, Transforms as Y, createEditor as St } from "slate"; import { Editable as Ct, Slate as wt, useSelected as Tt, useSlate as Et, withReact as Dt } from "slate-react"; import Ot from "is-hotkey"; import { withHistory as kt } from "slate-history"; import At from "validator"; //#region src/entities/session/model/session.store.ts var jt = Se((e, t) => ({ isLoading: !1, isFirstLoadCompleted: !1, currentSession: void 0, loadSession: async ({ domain: n, ROLE_PRIORITY: r, isNotSecure: i = !1, navigate: a, refresh: o }) => { let s = t().currentSession; if (s) return s; D(E.SESSION_TEMP, n), e({ isLoading: !0 }); try { let t = await o(); if (t.status !== Ce.Ok) { e({ currentSession: void 0, isLoading: !1, isFirstLoadCompleted: !0 }), a({ to: "/login" }), D(E.SESSION, n); return; } let s = t.data?.data; if (!s) { e({ currentSession: void 0, isLoading: !1, isFirstLoadCompleted: !0 }), a({ to: "/login" }), D(E.SESSION, n); return; } let { maxUserRolePriority: c } = le({ userRoles: s.roles, comparedUserRoles: s.roles, rolePriority: r }), l = { id: s.id, profileId: s.profileId, phone: s.phone, email: s.email, name: s.name, surname: s.surname, roles: s.roles, isAllDomains: s.isAllDomains || s.isAllCities, domains: s.domains || s.cities, isEmailConfirmed: s.isEmailConfirmed ?? !1, isPhoneConfirmed: s.isPhoneConfirmed ?? !1, maxRolePriority: c, tokens: { accessToken: { token: s.tokens?.accessToken?.token ?? "", exp: s.tokens?.accessToken?.exp ?? 0 }, refreshToken: { token: s.tokens?.refreshToken?.token ?? "", exp: s.tokens?.refreshToken?.exp ?? 0 } } }, u = M(), d = s.tokens?.refreshToken?.exp ?? 0, f = M(d > 0 && d < 1e10 ? d * 1e3 : d), p = Math.max(0, f.diff(u, "seconds")); return O(E.SESSION, JSON.stringify(l), { domain: n, secure: !i, "max-age": p }), e({ currentSession: l, isLoading: !1, isFirstLoadCompleted: !0 }), l; } catch { e({ currentSession: void 0, isLoading: !1, isFirstLoadCompleted: !0 }), a({ to: "/login" }), D(E.SESSION, n); return; } }, setCurrentSession: ({ domain: t, session: n, isRemember: r, isNotSecure: i }) => { e({ currentSession: n }); let a = M(), o = n.tokens?.refreshToken?.exp ?? 0, s = M(o > 0 && o < 1e10 ? o * 1e3 : o), c = Math.max(0, s.diff(a, "seconds")); O(r ? E.SESSION : E.SESSION_TEMP, JSON.stringify(n), { domain: t, secure: !i, "max-age": c }); }, removeSession: ({ domain: t, navigate: n }) => { e({ currentSession: void 0 }), D(E.SESSION, t), D(E.SESSION_TEMP, t), n({ to: "/login" }); } })), Mt = /* @__PURE__ */ function(e) { return e.russian = "ru", e.english = "en", e.arabic = "ar", e; }({}), Nt = /* @__PURE__ */ function(e) { return e[e.January = 1] = "January", e[e.February = 2] = "February", e[e.March = 3] = "March", e[e.April = 4] = "April", e[e.May = 5] = "May", e[e.June = 6] = "June", e[e.July = 7] = "July", e[e.August = 8] = "August", e[e.September = 9] = "September", e[e.October = 10] = "October", e[e.November = 11] = "November", e[e.December = 12] = "December", e; }({}), Pt = { container: "_container_j6rsl_1" }, Ft = ({ children: e }) => /* @__PURE__ */ N("div", { className: Pt.container, children: e }), It = { readOnly: "_readOnly_1qyk0_1", noData: "_noData_1qyk0_6" }, Lt = ({ configLocale: e, noDateText: t, currentValue: n, readOnly: r = !1, isTime: i = !1, ...a }) => { if (r && !n) return /* @__PURE__ */ N(G.Text, { children: t }); let o = M(n); return r ? /* @__PURE__ */ N(G.Text, { className: q(It.readOnly, It.noData), children: i ? o.format("YYYY-MM-DD, HH:mm:ss") : o.format("YYYY-MM-DD") }) : /* @__PURE__ */ N(je, { locale: e, children: /* @__PURE__ */ N(Me, { ...a, format: i ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD", value: n ? o : null, readOnly: r, showTime: i ? { defaultValue: M("00:00:00", "HH:mm:ss") } : !1 }) }); }, Rt = { form: "_form_6uo9h_1", buttons: "_buttons_6uo9h_5" }, zt = I(({ children: e, language: t, saveText: n, translateAllText: r, translateAllTooltipText: i, submitButtonText: a, languagesData: o, submitHtmlType: s = "submit", isSubmitting: c = !1, isVisibleSubmit: l = !0, isVisibleLanguage: d = !1, isVisibleLanguageButton: f = !1, onSubmitClick: p, onChangeLang: m, onTranslateAllClick: h, ...g }, _) => { let [v, y] = z(!1); Oe(_, () => ({ translateComplete: () => { setTimeout(() => y(!1), u.milliseconds.seconds1); } })); let b = async () => { h && (y(!0), h()); }, x = (e) => { p && (s !== "submit" && e.preventDefault(), p()); }; return /* @__PURE__ */ P(Pe, { ...g, className: Rt.form, layout: "vertical", children: [e, /* @__PURE__ */ P("div", { className: Rt.buttons, children: [d && !!o?.length && /* @__PURE__ */ P(V, { gap: "small", vertical: !0, children: [f && /* @__PURE__ */ N(W, { title: i, children: /* @__PURE__ */ N(B, { loading: v, onClick: b, children: r }) }), /* @__PURE__ */ N(ze, { value: t, disabled: v, options: o, onChange: (e) => m?.(e) })] }), l && /* @__PURE__ */ N(B, { type: "primary", htmlType: s, disabled: v, loading: c, onClick: x, children: a ?? n })] })] }); }), Bt = ({ fallback: e = "data:image/png;base64,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", ...t }) => /* @__PURE__ */ N(Fe, { fallback: e, ...t }), Vt = ({ downloadText: e }) => /* @__PURE__ */ P("button", { style: { border: 0, background: "none" }, type: "button", children: [/* @__PURE__ */ N(ct, {}), /* @__PURE__ */ N("div", { style: { marginTop: 8 }, children: e })] }), X = { uploadContainer: "_uploadContainer_lavhx_1", card: "_card_lavhx_6", error: "_error_lavhx_14", disabled: "_disabled_lavhx_23", image: "_image_lavhx_32" }, Ht = [ { lang: "RU", alt: "altRU" }, { lang: "EN", alt: "altEN" }, { lang: "AR", alt: "altAR" } ], Z = { readOnly: "_readOnly_11g47_1", noData: "_noData_11g47_18" }, Ut = ({ emptyText: e, className: t, readOnly: n, value: r, ...i }) => n && !(r != null && r !== "") ? /* @__PURE__ */ N(G.Text, { className: q(Z.readOnly, Z.noData), children: e }) : /* @__PURE__ */ N(H, { ...i, readOnly: n, value: r, className: q(t, { [Z.readOnly]: n }) }), Wt = ({ emptyText: e, className: t, readOnly: n, value: r, ...i }) => n && !(r != null && r !== "") ? /* @__PURE__ */ N(G.Text, { className: q(Z.readOnly, Z.noData), children: e }) : /* @__PURE__ */ N(H.Password, { ...i, value: r, readOnly: n, className: q(t, { [Z.readOnly]: n }) }), Gt = ({ emptyText: e, className: t, readOnly: n, value: r, ...i }) => n && !(r != null && r !== "") ? /* @__PURE__ */ N(G.Text, { className: q(Z.readOnly, Z.noData), children: e }) : /* @__PURE__ */ N(H.TextArea, { ...i, value: r, readOnly: n, className: q(t, { [Z.readOnly]: n }) }), { useToken: Kt } = K, qt = (e) => { let t = e.lastIndexOf("."); return t === -1 ? e : e.substring(0, t); }, Jt = ({ emptyText: e, labelText: t, loadingErrorText: n, file: r, language: i, errorsUid: a, actions: o, disabled: s, maxCount: c, updatedImages: l, isLoading: d, onUpdateData: f, onDeleteImage: p, onDeleteError: m }) => { let [h, g] = z({ ru: "", en: "", ar: "" }), [_, v] = z(null), [y, b] = z(!1), [x, S] = z(!1), { remove: C } = o, { token: w } = Kt(), { attributes: T, listeners: E, setNodeRef: ee, transform: D, transition: te, isDragging: O } = qe({ id: r.uid }); F(() => { x && f({ uid: r.uid, name: qt(r.name), altRU: h.ru, altEN: h.en, altAR: h.ar }); }, u.milliseconds.milliseconds500, [h]); let ne = q(X.card, { "is-dragging": O, [X.error]: y, [X.disabled]: s || c === 1 }), re = { transform: ft.Translate.toString(D), transition: te, borderColor: y ? w.colorError : void 0 }; R(() => { f({ uid: r.uid, name: qt(r.name) }); }, []), R(() => { a.includes(r.uid) ? (b(!0), f({ uid: r.uid, name: qt(r.name), isError: !0 })) : b(!1); }, [ r.uid, r.name, a ]), R(() => { if (!l) return; let e = l.find((e) => e.uid === r.uid); e && (g({ ru: e.altRU ?? "", en: e.altEN ?? "", ar: e.altAR ?? "" }), S(!0)); }, [l]), R(() => { (async () => { r?.originFileObj ? (v(await pe(r.originFileObj)), S(!0)) : r.url && (g({ ru: r.altRU ?? "", en: r.altEN ?? "", ar: r.altAR ?? "" }), v(r.url), S(!0)); })(); }, [r.url, r.originFileObj]); let ie = () => { s || (C(), p(r.uid), m(r.uid)); }, k = (e, t) => { S(!0), g((n) => ({ ...n, [e.toLocaleLowerCase()]: t })); }, ae = [/* @__PURE__ */ N($e, { onClick: ie }, "delete")]; return !s && c !== 1 && ae.unshift(/* @__PURE__ */ N(tt, { style: { cursor: "grab" }, ...T, ...E }, "drag")), /* @__PURE__ */ N(Ae, { ref: !y && !s && c !== 1 ? ee : void 0, className: ne, hoverable: !s, size: "small", loading: !_ || d, style: re, cover: _ ? /* @__PURE__ */ N(Fe, { className: X.image, height: 160, src: _ }) : void 0, actions: ae, children: Ht.map((r) => /* @__PURE__ */ N(Pe.Item, { label: `${t} ${r.lang.toUpperCase()}`, style: { display: i === r.lang.toLowerCase() ? "block" : "none" }, children: /* @__PURE__ */ N(Ut, { emptyText: e, disabled: y || s, value: h[r.lang.toLowerCase()], placeholder: y ? n : t, onChange: (e) => k(r.lang, e.target.value) }) }, r.alt)) }); }, Yt = ({ labelText: e, loadingErrorText: t, emptyText: n, downloadText: r, serverImages: i, updatedImages: a, disabled: o = !1, maxCount: s, language: c, customRequest: l, onChange: u, onUpdateData: d, onDeleteImage: f, onImagesOrder: p, onSuccessUpload: m, onUpdateTempImage: h, ...g }) => { let [_, v] = z([]), [y, b] = z([]); R(() => { if (!i?.length) { v([]), p?.([]); return; } let e = i.map((e) => { let t = e.url?.split("/") ?? [], n = t[t.length - 1]; return { uid: e.uid ?? "", name: n ?? `${Math.random()}.jpg`, status: "done", url: e.url ?? "", altRU: e.altRU || "", altEN: e.altEN || "", altAR: e.altAR || "" }; }).filter((e) => !!e.uid), t = e.map((e) => e.uid); v(e), p?.(t); }, [i]), R(() => { if (!_?.length) return; let e = _.map((e) => e.uid); p?.(e); }, [_]); let x = We(Ue, { activationConstraint: { distance: 10 } }), S = (e) => { let { fileList: t } = e; v(t), u?.(e); }, C = (e) => { b((t) => t.filter((t) => t !== e)); }, w = ({ active: e, over: t }) => { e.id === t?.id || o || v((n) => Ke(n, n.findIndex((t) => t.uid === e.id), n.findIndex((e) => e.uid === t?.id))); }, T = async (e, t) => { let { file: n, onSuccess: r, onError: i } = e, a = n, o = new FormData(); o.append("files", n); try { let e = await h(o); e.status === 200 || e.status === 201 ? (m({ tempName: e.data.data.tempFiles[0], uid: a.uid ?? "" }), r?.("Ok")) : (b((e) => [...e, a.uid ?? ""]), i?.(e.error)); } catch (e) { b((e) => [...e, a.uid ?? ""]), i?.(e); } l?.(e, t); }; return /* @__PURE__ */ N("div", { className: X.uploadContainer, children: /* @__PURE__ */ N(He, { sensors: [x], onDragEnd: w, children: /* @__PURE__ */ N(Ge, { items: _.map((e) => e.uid), children: /* @__PURE__ */ N(Ve, { accept: "image/png, image/jpeg, image/webp, image/avif", ...g, disabled: o, maxCount: s, customRequest: T, listType: "picture-card", fileList: _, itemRender: (r, i, l, u) => /* @__PURE__ */ N(Jt, { emptyText: n, labelText: e, loadingErrorText: t, file: i, language: c, errorsUid: y, actions: u, disabled: o, maxCount: s, updatedImages: a, isLoading: i.status === "uploading", onUpdateData: d, onDeleteImage: f, onDeleteError: C }), onChange: S, children: (!s || _?.length < s) && /* @__PURE__ */ N(Vt, { downloadText: r }) }) }) }) }); }, Xt = ({ children: e, className: t, style: n, ...r }) => { let { token: { colorBgContainer: i, boxShadow: a, borderRadius: o } } = K.useToken(); return /* @__PURE__ */ N("div", { ...r, className: t, style: { padding: w.OFFSET[1], boxShadow: a, borderRadius: o, background: i, ...n }, children: e }); }, Zt = ({ latitude: e, longitude: t, defaultLatitude: n = 55.757056, defaultLongitude: r = 37.558708, defaultZoom: i = 3, zoom: a = 10, mapHeight: o = 300, apikey: s, suggestApikey: c, disabled: l, isSearchControl: u, onPlacemarkMove: d }) => { let [f, p] = z(void 0), [m, h] = z(e), [g, _] = z(t), { token: { colorPrimary: v } } = K.useToken(); R(() => { h(e); }, [e]), R(() => { _(t); }, [t]); let y = (e, t) => { e?.length < 2 || l || (h(e[0]), _(e[1]), d?.(e, t)); }; return /* @__PURE__ */ N(_t, { query: { apikey: s, suggest_apikey: c }, children: /* @__PURE__ */ P(mt, { instanceRef: (e) => p(e), defaultState: { center: [n, r], zoom: i, controls: [] }, state: { center: m && g ? [m, g] : [n, r], zoom: m && g ? a : i }, width: "100%", height: o, onClick: (e) => { let t = e.get("coords"), n = f?.getZoom(); y(t, n); }, children: [ m && g && /* @__PURE__ */ N(ht, { geometry: [m, g], options: { iconColor: v, draggable: !l }, onDragEnd: (e) => { let t = e.get("target").geometry.getCoordinates(), n = f?.getZoom(); y(t, n); } }), /* @__PURE__ */ N(pt, {}), /* @__PURE__ */ N(vt, {}), u && /* @__PURE__ */ N(gt, {}) ] }) }); }, Qt = { readOnly: "_readOnly_uqcto_1", noData: "_noData_uqcto_19" }, $t = ({ value: e, emptyText: t }) => { let n = e != null && e !== ""; return /* @__PURE__ */ N(G.Text, { className: q(Qt.readOnly, { [Qt.noData]: !n }), children: n ? e : t }); }, en = { flex: "_flex_jguhl_2" }, tn = ({ notFoundText: e, dataName: t, value: n, placeholder: r, searchTypeDefaultValue: i, searchTypeOptions: a, style: o, searchTypeStyle: s, loading: c, disabled: l, mode: d, onSearch: f, onChange: p }) => { let [m, h] = z([]), [g, _] = z(""), [v, y] = z(i), [b, x] = z(t); return F(() => { f(g, v, h); }, u.milliseconds.milliseconds500, [g, v]), R(() => { x(t); }, [t]), R(() => { if (!(!b || !n)) if (Array.isArray(n) && Array.isArray(b)) { let e = n.map((e, t) => { let n = b[t]; return n ? { label: n, value: e } : null; }).filter(Boolean); h((t) => { let n = t || [], r = e.filter((e) => !n.find((t) => t.value === e.value)); return r.length === 0 ? n : [...n, ...r]; }); } else typeof n == "string" && typeof b == "string" && h((e) => { let t = e || [], r = t.find((e) => e.value === n); return r && r.label === b ? t : r ? t.map((e) => e.value === n ? { ...e, label: b } : e) : [...t, { label: b, value: n }]; }); }, [b, n]), /* @__PURE__ */ P(V, { className: en.flex, gap: "small", children: [/* @__PURE__ */ N(ze, { defaultValue: i, value: v, options: a, style: s, disabled: l, onChange: (e) => { y(e); } }), /* @__PURE__ */ N(ze, { mode: d, value: n, placeholder: r, defaultActiveFirstOption: !1, suffixIcon: null, filterOption: !1, onSearch: (e) => _(e), onChange: (e, t) => { t && x(Array.isArray(t) ? t.map((e) => e.label) : t.label), p(e); }, options: m || [], style: o, notFoundContent: c ? /* @__PURE__ */ N(U.Input, { size: "small", block: !0, active: !0 }) : e, showSearch: !0, allowClear: !0, disabled: l })] }); }, nn = ({ children: e, spinFontSize: t = 36, ...n }) => /* @__PURE__ */ N(Be, { indicator: /* @__PURE__ */ N(it, { style: { fontSize: t } }), ...n, children: e }), rn = { "mod+b": "bold", "mod+i": "italic", "mod+u": "underline", "mod+`": "code" }, an = ["numbered-list", "bulleted-list"], on = [ "left", "center", "right", "justify" ], sn = [ "http:", "https:", "mailto:", "tel:" ], cn = [ { id: "1", format: "title", text: "Заголовок" }, { id: "2", format: "subtitle", text: "Подзаголовок" }, { id: "3", format: "note", text: "Примечание" }, { id: "4", format: "info", text: "Информационный блок" } ], ln = ({ boldText: e, italicText: t, underlineText: n, numberedListText: r, bulletedListText: i, leftText: a, centerText: o, rightText: s, justifyText: c }) => [ { id: "1", title: e, format: "bold", icon: /* @__PURE__ */ N(Qe, {}), type: "mark" }, { id: "2", title: t, format: "italic", icon: /* @__PURE__ */ N(nt, {}), type: "mark" }, { id: "3", title: n, format: "underline", icon: /* @__PURE__ */ N(lt, {}), type: "mark" }, { id: "4", title: r, format: "numbered-list", icon: /* @__PURE__ */ N(ot, {}), type: "list" }, { id: "5", title: i, format: "bulleted-list", icon: /* @__PURE__ */ N(ut, {}), type: "list" }, { id: "6", title: a, format: "left", icon: /* @__PURE__ */ N(Xe, {}), type: "align" }, { id: "7", title: o, format: "center", icon: /* @__PURE__ */ N(Ye, {}), type: "align" }, { id: "8", title: s, format: "right", icon: /* @__PURE__ */ N(Ze, {}), type: "align" }, { id: "9", title: c, format: "justify", icon: /* @__PURE__ */ N(at, {}), type: "align" } ], un = (e, t, n = "type") => { let { selection: r } = e; if (!r) return "default"; let [i] = Array.from(J.nodes(e, { at: J.unhangRange(e, r), match: (e) => !J.isEditor(e) && yt.isElement(e) && e[n] === t })); return i ? "primary" : "default"; }, dn = (e, t) => { let n = J.marks(e); return n && n[t] === !0 ? "primary" : "default"; }, fn = (e, t) => { dn(e, t) === "primary" ? J.removeMark(e, t) : J.addMark(e, t, !0); }, pn = (e, t) => { let n = un(e, t, on.includes(t) ? "align" : "type") === "primary", r = an.includes(t); Y.unwrapNodes(e, { match: (e) => !J.isEditor(e) && yt.isElement(e) && an.includes(e.type) && !on.includes(t), split: !0 }); let i; if (i = on.includes(t) ? { align: n ? void 0 : t } : { type: n ? "paragraph" : r ? "list-item" : t }, Y.setNodes(e, i), !n && r) { let n = { type: t, children: [] }; Y.wrapNodes(e, n); } }, mn = (e) => { let [t] = J.nodes(e, { match: (e) => !J.isEditor(e) && yt.isElement(e) && e.type === "link" }); return !!t; }, hn = (e) => { Y.unwrapNodes(e, { match: (e) => !J.isEditor(e) && yt.isElement(e) && e.type === "link" }); }, gn = (e, t) => { e.selection && _n(e, t); }, _n = (e, t) => { mn(e) && hn(e); let { selection: n } = e, r = n && bt.isCollapsed(n), i = { type: "link", href: t, children: r ? [{ text: t }] : [] }; r ? Y.insertNodes(e, i) : (Y.wrapNodes(e, i, { split: !0 }), Y.collapse(e, { edge: "end" })); }, vn = (e, t, n) => { let r = { type: "image", url: t, pictureData: n, children: [{ text: "" }] }; Y.insertNodes(e, r), Y.insertNodes(e, { type: "paragraph", children: [{ text: "" }] }); }, yn = (e) => { if (!e || typeof e != "string") return !1; try { let t = new URL(e).pathname.split(".").pop()?.toLowerCase(); return !!t && [ "jpg", "jpeg", "png", "gif", "webp", "avif", "svg" ].includes(t); } catch { return !1; } }, bn = (e) => { let { insertData: t, isVoid: n } = e; return e.isVoid = (e) => e.type === "image" ? !0 : n(e), e.insertData = (n) => { let r = n.getData("text/plain"), { files: i } = n; if (i && i.length > 0) for (let t of i) { let n = new FileReader(), [r] = t.type.split("/"); r === "image" && (n.addEventListener("load", () => { let t = n.result; vn(e, t); }), n.readAsDataURL(t)); } else yn(r) ? vn(e, r) : t(n); }, e; }, xn = (e) => { let { insertData: t, insertText: n, isInline: r } = e; return e.isInline = (e) => ["link"].includes(e.type) || r(e), e.insertText = (t) => { t && k(t) ? _n(e, t) : n(t); }, e.insertData = (n) => { let r = n.getData("text/plain"); r && k(r) ? _n(e, r) : t(n); }, e; }, Q = (e) => { let t = /["'&<>]/, n = "" + e, r = t.exec(n); if (!r) return n; let i, a = "", o, s = 0; for (o = r.index; o < n.length; o++) { switch (n.charCodeAt(o)) { case 34: i = "&quot;"; break; case 38: i = "&amp;"; break; case 39: i = "&#39;"; break; case 60: i = "&lt;"; break; case 62: i = "&gt;"; break; default: continue; } s !== o && (a += n.substring(s, o)), s = o + 1, a += i; } return s === o ? a : a + n.substring(s, o); }, Sn = (e) => { if (xt.isText(e)) { let t = Q(e.text); return e.bold && (t = `<strong class="content-strong">${t}</strong>`), e.italic && (t = `<em class="content-italic">${t}</em>`), e.underline && (t = `<u class="content-underline">${t}</u>`), t; } let t = e.children.map((e) => Sn(e)).join(""), n = e.align ? `text-align: ${e.align}` : ""; switch (e.type) { case "title": return `<h2 class="content-title"${n ? ` style="${n}"` : ""}>${t}</h2>`; case "subtitle": return `<h3 class="content-subtitle"${n ? ` style="${n}"` : ""}>${t}</h3>`; case "note": return `<p class="content-note"${n ? ` style="${n}"` : ""}>${t}</p>`; case "info": return `<p class="content-info"${n ? ` style="${n}"` : ""}>${t}</p>`; case "paragraph": return `<p class="content-paragraph" ${n ? ` style="${n}"` : ""}>${t}</p>`; case "bulleted-list": return `<ul class="content-bulleted-list"${n ? ` style="${n}"` : ""}>${t}</ul>`; case "numbered-list": return `<ol class="content-numbered-list"${n ? ` style="${n}"` : ""}>${t}</ol>`; case "list-item": return `<li class="content-list-item" ${n ? ` style="${n}"` : ""}>${t}</li>`; case "link": return `<a class="content-link" href="${Q(e.href ?? "")}">${t}</a>`; case "image": { if (e.pictureData) { let t = e.pictureData, n = Q(e.alt ?? ""), r = []; return t.mobileImage1xAvif && r.push(`<source srcset="${Q(t.mobileImage1xAvif)} 1x${t.mobileImage2xAvif ? `, ${Q(t.mobileImage2xAvif)} 2x` : ""}" media="(max-width: 450px)" type="image/avif" />`), t.mobileImage1xWebp && r.push(`<source srcset="${Q(t.mobileImage1xWebp)} 1x${t.mobileImage2xWebp ? `, ${Q(t.mobileImage2xWebp)} 2x` : ""}" media="(max-width: 450px)" type="image/webp" />`), t.mobileImage1x && r.push(`<source srcset="${Q(t.mobileImage1x)} 1x${t.mobileImage2x ? `, ${Q(t.mobileImage2x)} 2x` : ""}" media="(max-width: 450px)" />`), t.image1xAvif && r.push(`<source srcset="${Q(t.image1xAvif)} 1x${t.image2xAvif ? `, ${Q(t.image2xAvif)} 2x` : ""}" type="image/avif" />`), t.image1xWebp && r.push(`<source srcset="${Q(t.image1xWebp)} 1x${t.image2xWebp ? `, ${Q(t.image2xWebp)} 2x` : ""}" type="image/webp" />`), t.image1x && r.push(`<source srcset="${Q(t.image1x)} 1x${t.image2x ? `, ${Q(t.image2x)} 2x` : ""}" />`), `<picture class="content-image">${r.join("")}<img class="content-image" src="${Q(t.image1x ?? "")}" alt="${n}" loading="lazy" /></picture>`; } let t = Q(e.alt ?? ""); return `<img class="content-image" src="${Q(e.url ?? "")}" alt="${t}" />`; } default: return t; } }, Cn = (e) => { let t = [{ type: "paragraph", children: [{ text: "" }] }]; if (!e) return t; if (typeof e == "string") try { return Cn(JSON.parse(e)); } catch { return t; } if (Array.isArray(e)) return e.every((e) => e && typeof e == "object" && ("type" in e && "children" in e || "text" in e)) ? e : t; if (typeof e == "object" && e) { if ("children" in e && Array.isArray(e.children)) { let t = e.children; if (t.every((e) => e && typeof e == "object" && ("type" in e && "children" in e || "text" in e))) return t; } if ("type" in e && "children" in e && Array.isArray(e.children)) return [e]; } return t; }, wn = () => /* @__PURE__ */ N("span", { contentEditable: !1, style: { fontSize: 0 }, children: String.fromCodePoint(160) }), Tn = ({ attributes: e, children: t, element: n }) => { let r = Tt(), { token: { colorLink: i, colorLinkHover: a } } = K.useToken(), o = ke(() => { let e = null; try { e = new URL(n.href); } catch (e) { console.log(e); } return e && sn.includes(e.protocol) ? e.href : "about:blank"; }, [n.href]); return /* @__PURE__ */ N(Re, { title: "URL", content: o, children: /* @__PURE__ */ P("a", { ...e, href: o, style: { color: r ? a : i }, children: [ /* @__PURE__ */ N(wn, {}), t, /* @__PURE__ */ N(wn, {}) ] }) }); }, En = ({ attributes: e, children: t, element: n }) => { let r = { textAlign: n.align }; switch (n.type) { case "bulleted-list": return /* @__PURE__ */ N("ul", { className: "content-bulleted-list", style: r, ...e, children: t }); case "title": return /* @__PURE__ */ N("h2", { className: "content-title", style: r, ...e, children: t }); case "subtitle": return /* @__PURE__ */ N("h3", { className: "content-subtitle", style: r, ...e, children: t }); case "list-item": return /* @__PURE__ */ N("li", { style: r, ...e, children: t }); case "numbered-list": return /* @__PURE__ */ N("ol", { className: "content-numbered-list", style: r, ...e, children: t }); case "note": return /* @__PURE__ */ N("p", { className: "content-note", style: r, ...e, children: t }); case "info": return /* @__PURE__ */ N("p", { className: "content-info", style: r, ...e, children: t }); case "link": return /* @__PURE__ */ N(Tn, { attributes: e, children: t, element: n }); case "image": if (n.pictureData) { let r = n.pictureData; return /* @__PURE__ */ P("div", { ...e, contentEditable: !1, children: [/* @__PURE__ */ P("picture", { className: "content-image", children: [ r.mobileImage1xAvif && /* @__PURE__ */ N("source", { srcSet: `${r.mobileImage1xAvif} 1x${r.mobileImage2xAvif ? `, ${r.mobileImage2xAvif} 2x` : ""}`, media: "(max-width: 450px)", type: "image/avif" }), r.mobileImage1xWebp && /* @__PURE__ */ N("source", { srcSet: `${r.mobileImage1xWebp} 1x${r.mobileImage2xWebp ? `, ${r.mobileImage2xWebp} 2x` : ""}`, media: "(max-width: 450px)", type: "image/webp" }), r.mobileImage1x && /* @__PURE__ */ N("source", { srcSet: `${r.mobileImage1x} 1x${r.mobileImage2x ? `, ${r.mobileImage2x} 2x` : ""}`, media: "(max-width: 450px)" }), r.image1xAvif && /* @__PURE__ */ N("source", { srcSet: `${r.image1xAvif} 1x${r.image2xAvif ? `, ${r.image2xAvif} 2x` : ""}`, type: "image/avif" }), r.image1xWebp && /* @__PURE__ */ N("source", { srcSet: `${r.image1xWebp} 1x${r.image2xWebp ? `, ${r.image2xWebp} 2x` : ""}`, type: "image/webp" }), r.image1x && /* @__PURE__ */ N("source", { srcSet: `${r.image1x} 1x${r.image2x ? `, ${r.image2x} 2x` : ""}` }), /* @__PURE__ */ N("img", { className: "content-image", src: r.image1x, alt: n.alt ?? "", loading: "lazy", style: { maxWidth: "100%" } }) ] }), t] }); } return /* @__PURE__ */ P("div", { ...e, contentEditable: !1, children: [/* @__PURE__ */ N("img", { className: "content-image", src: n.url, alt: n.alt ?? "", style: { maxWidth: "100%" } }), t] }); default: return /* @__PURE__ */ N("p", { style: r, ...e, children: t }); } }, Dn = ({ attributes: e, children: t, leaf: n }) => (n.bold && (t = /* @__PURE__ */ N("strong", { children: t })), n.italic && (t = /* @__PURE__ */ N("em", { children: t })), n.underline && (t = /* @__PURE__ */ N("u", { children: t })), /* @__PURE__ */ N("span", { ...e, children: t })), On = ({ tooltipText: e, linkErrorText: t, onErrorMessage: n }) => { let [r, i] = z(!1), [a, o] = z(""), s = Et(), c = () => { i((e) => !e); }; return /* @__PURE__ */ P(we, { children: [/* @__PURE__ */ N(W, { title: e, children: /* @__PURE__ */ N(B, { icon: /* @__PURE__ */ N(rt, {}), onClick: c }) }), /* @__PURE__ */ N(Le, { title: e, open: r, destroyOnHidden: !0, onOk: () => { let e = ""; if (At.isEmail(a)) e += `mailto:${a}`; else if (At.isMobilePhone(a)) e += `tel:${a}`; else if (At.isURL(a, { protocols: ["http", "https"], require_protocol: !0 })) e += a; else { n(t); return; } gn(s, e), o(""), c(); }, onCancel: () => { c(), o(""); }, children: /* @__PURE__ */ N(H, { placeholder: "https://site.ru | test@mail.ru | +79881234567", value: a, onChange: (e) => { o(e.target.value); } }) })] }); }, kn = ({ tooltipText: e }) => { let t = Et(); return /* @__PURE__ */ N(W, { title: e, children: /* @__PURE__ */ N(B, { icon: /* @__PURE__ */ N(et, {}), onClick: () => { mn(t) && hn(t); } }) }); }, An = ({ boldText: e, italicText: t, underlineText: n, numberedListText: r, bulletedListText: i, leftText: a, centerText: o, rightText: s, justifyText: c, linkErrorText: l, linkButtonTooltipText: u, removeLinkTooltipText: d, imageButtonTooltipText: f, onErrorMessage: p, onUploadImage: m }) => { let h = Et(), g = ln({ boldText: e, italicText: t, underlineText: n, numberedListText: r, bulletedListText: i, leftText: a, centerText: o, rightText: s, justifyText: c }), _ = async (e) => { if (!(!m || !e)) try { let t = await m(e); t && vn(h, t.url, t.pictureData); } catch (e) { p(e instanceof Error ? e.message : "Image upload failed"); } }; return /* @__PURE__ */ P(V, { gap: "small", wrap: !0, children: [/* @__PURE__ */ N(V, { gap: "small", wrap: !0, children: cn.map((e) => /* @__PURE__ */ N(B, { type: un(h, e.format, "type"), onClick: () => pn(h, e.format), children: e.text }, e.id)) }), /* @__PURE__ */ P(V, { gap: "small", wrap: !0, children: [ g.map((e) => { let t, n; return e.type === "mark" ? (t = dn(h, e.format), n = () => fn(h, e.format)) : (t = un(h, e.format, e.type === "list" ? "type" : "align"), n = () => pn(h, e.format)), /* @__PURE__ */ N(W, { title: e.title, children: /* @__PURE__ */ N(B, { type: t, icon: e.icon, onClick: n }) }, e.id); }), m && /* @__PURE__ */ N(W, { title: f ?? "Image", children: /* @__PURE__ */ N(B, { icon: /* @__PURE__ */ N(st, {}), onClick: () => { let e = document.createElement("input"); e.type = "file", e.accept = "image/png, image/jpeg, image/webp, image/avif", e.style.display = "none", e.addEventListener("change", () => { let t = e.files?.[0]; t && _(t); }), document.body.appendChild(e), e.click(), document.body.removeChild(e); } }) }), /* @__PURE__ */ N(On, { tooltipText: u, linkErrorText: l, onErrorMessage: p }), /* @__PURE__ */ N(kn, { tooltipText: d }) ] })] }); }, jn = { editable: "_editable_136f6_1" }, $ = [{ type: "paragraph", children: [{ text: "" }] }], { useToken: Mn } = K, Nn = I(({ boldText: e, italicText: t, underlineText: n, numberedListText: r, bulletedListText: i, leftText: a, centerText: o, rightText: s, justifyText: c, linkErrorText: l, linkButtonTooltipText: d, removeLinkTooltipText: f, imageButtonTooltipText: p, language: m, readOnly: h = !1, onSetContent: g, onSetHtml: _, onErrorMessage: v, onUploadImage: y }, b) => { let [x, S] = z($), C = ke(() => bn(xn(kt(Dt(St())))), []), { token: w } = Mn(), [,] = F(() => { let e = JSON.stringify(x), t = x.map((e) => Sn(e)).join(""); g(e, m), _(t, m); }, u.seconds.seconds1, [x]); Oe(b, () => ({ resetData: () => { S($), C.children = $, Y.deselect(C); }, setValue: (e) => { try { let t = Cn(JSON.parse(e)); S(t), C.children = t, Y.deselect(C), C.selection = null, C.operations = [], setTimeout(() => { Y.select(C, { anchor: J.start(C, [0]), focus: J.start(C, [0]) }); }, 0); } catch (e) { console.error("Error parsing slate value:", e), S($), C.children = $, Y.deselect(C); } } })); let T = De((e) => /* @__PURE__ */ N(En, { ...e }), []), E = De((e) => /* @__PURE__ */ N(Dn, { ...e }), []); return /* @__PURE__ */ N(wt, { editor: C, initialValue: x, onChange: (e) => { S(e); }, children: /* @__PURE__ */ P(V, { gap: "small", vertical: !0, children: [!h && /* @__PURE__ */ N(An, { boldText: e, italicText: t, underlineText: n, numberedListText: r, bulletedListText: i, leftText: a, centerText: o, rightText: s, justifyText: c, linkErrorText: l, linkButtonTooltipText: d, removeLinkTooltipText: f, imageButtonTooltipText: p, onErrorMessage: v, onUploadImage: y }), /* @__PURE__ */ N(Ct, { className: jn.editable, style: { padding: w.padding, border: `1px solid ${w.colorBorder}`, borderRadius: `${w.borderRadius}px` }, spellCheck: !0, readOnly: h, renderElement: T, renderLeaf: E, onKeyDown: (e) => { for (let t in rn) if (Ot(t, e)) { e.preventDefault(); let n = rn[t]; fn(C, n); } } })] }) }); }), Pn = () => /* @__PURE__ */ P("div", { className: A.tableHeadSkeleton, style: { marginBottom: w.OFFSET[1] }, children: [/* @__PURE__ */ P(V, { align: "center", gap: "middle", wrap: "wrap", children: [/* @__PURE__ */ N("div", { className: A.skeletonHead1, children: /* @__PURE__ */ N(U.Button, { active: !0, block: !0 }) }), /* @__PURE__ */ N("div", { className: A.skeletonHead2, children: /* @__PURE__ */ N(U.Button, { active: !0, block: !0 }) })] }), /* @__PURE__ */ P(V, { className: q(A.buttonsContainer, A.skeletonButtonsContainer), gap: "small", children: [/* @__PURE__ */ N("div", { className: A.skeletonHead3, children: /* @__PURE__ */ N(U.Button, { active: !0, block: !0 }) }), /* @__PURE__ */ N("div", { className: A.skeletonHead4, children: /* @__PURE__ */ N(U.Button, { active: !0, block: !0 }) })] })] }), Fn = L(() => import("./table-head-B_C2mqGt.js").then(({ TableHead: e }) => ({ default: e }))), In = L(() => import("./base-table-C5ub4tMa.js").then(({ BaseTable: e }) => ({ default: e }))), Ln = ({ drawerContent: e, sortTooltipText: t, updateDataText: n, refreshText: r, createText: i, createNewElementText: a, viewText: o, actionsText: s, editText: c, tableData: l, columns: u, order: d, orderOptions: f, searchProps: p, serverPagination: m, fetchedDataLoading: h, createButtonTooltip: g, readAction: _, createAction: v, updateAction: y, deleteText: b, deletedText: x, cancelText: S, deleteErrorText: C, drawerTitle: w, closeModalTitleText: T, closeModalContentText: E, closeModalOkText: ee, closeModalCancelText: D, drawerSize: te = "default", modalTitle: O, scrollWidth: ne, isCanRead: re, isCanCreate: ie, isCanUpdate: k, isCanDelete: ae, isExpandable: oe, isHiddenCreate: se, isHiddenUpdate: ce, isHiddenActions: le, isFixedActions: ue, renderActions: de, configProviderProps: fe, onGetError: pe, onChangeOrder: me, onRefetch: he, onSetPaginate: ge, onDelete: A, onShowSizeChange: _e, onSuccessMessage: ve, onErrorMessage: ye }) => { let [be, j] = z(!1), [xe, Se] = z(!1), [Ce, M] = z(!1), [we, F] = z(_), [I, L] = z(""), De = (e) => { L(e), j(!0), F(_); }, R = (e) => { L(e); }, Oe = () => { j(!0), F(v), L(""); }, ke = () => { j(!0), F(y); }, B = () => { Se((e) => !e); }, Ae = () => { j(!1); }, Me = () => { if (we === _) { Ae(); return; } M((e) => !e); }, V = async () => { try { await A?.(I), ve(x); } catch (e) { pe({ error: e }), ye(C); } Se(!1); }, Pe = (e) => { e.current && (ge(e.current, e.pageSize ?? 10), he()); }, Fe = (e) => { F(e); }; return /* @__PURE__ */ P(je, { ...fe, children: [ /* @__PURE__ */ N(Te, { fallback: /* @__PURE__ */ N(Pn, {}), children: /* @__PURE__ */ N(Fn, { sortTooltipText: t, updateDataText: n, refreshText: r, createText: i, createNewElementText: a, order: d, orderOptions: f, searchProps: p, createButtonTooltip: g, isCanCreate: ie, isHiddenCreate: se, onCreate: Oe, onChangeOrder: me, onRefetch: he }) }), /* @__PURE__ */ N(Xt, { children: /* @__PURE__ */ N(Te, { fallback: /* @__PURE__ */ N("div", { style: { height: "70vh" }, children: /* @__PURE__ */ N(U, { active: !0 }) }), children: /* @__PURE__ */ N(In, { viewText: o, actionsText: s, editText: c, deleteText: b, dataSource: l, columns: u, serverPagination: m, loading: h, isHiddenUpdate: ce, isHiddenActions: le, isCanRead: re, isCanUpdate: k, isCanDelete: ae, isFixedActions: ue, renderActions: de, scroll: { x: ne }, expandable: oe ? { expandedRowRender: (e) => { if (Array.isArray(e.list)) return /* @__PURE__ */ N(Ie, { bordered: !0, dataSource: e.list, renderItem: (e) => /* @__PURE__ */ N(Ie.Item, { children: /* @__PURE__ */ N(G.Text, { children: e.text }) }) }); } } : void 0, onView: De, onDropdownClick: R, onEdit: ke, onDelete: A ? B : void 0, onChange: Pe, onShowSizeChange: _e }) }) }), /* @__PURE__ */ N(Ne, { title: w, open: be, size: te, destroyOnHidden: !0, onClose: Me, children: Ee(e, { id: I, action: we, onClose: Ae, onRefetch: he, onChangeActionValue: Fe }) }), /* @__PURE__ */ N(Le, { title: T, open: Ce, okText: ee, cancelText: D, destroyOnHidden: !0, onOk: () => { Ae(), Me(); }, onCancel: Me, children: E }), A && /* @__PURE__ */ N(Le, { title: O, open: xe, okText: b, cancelText: S, okButtonProps: { danger: !0 }, onOk: V, onCancel: B }) ] }); }, Rn = ({ originNode: e, file: t }) => { let { attributes: n, listeners: r, setNodeRef: i, transform: a, transition: o, isDragging: s } = qe({ id: t.uid }); return /* @__PURE__ */ N("div", { ref: i, style: { transform: ft.Translate.toString(a), transition: o, cursor: "move" }, className: s ? "is-dragging" : "", ...n, ...r, children: t.status === "error" && s ? e.props.children : e }); }, zn = ({ text: e, serverFiles: t, onOrder: n, onChange: r, onUpdateTemp: i, customRequest: a, onSuccessUpload: o, ...s }) => { let [c, l] = z([]), u = We(Ue, { activationConstraint: { distance: 10 } }); R(() => { c?.length && n(c.map((e) => e.uid)); }, [c]), R(() => { if (!t?.length) { l([]), n([]); return; } let e = t.map((e) => { let t = e.url?.split("/") ?? [], n = t[t.length - 1]; return { uid: e.uid ?? "", name: n ?? `file-${e.uid || Math.random()}`, status: "done", url: e.url ?? "" }; }).filter((e) => !!e.uid), r = e.map((e) => e.uid); l(e), n(r); }, [t]); let d = ({ active: e, over: t }) => { e.id !== t?.id && l((n) => Ke(n, n.findIndex((t) => t.uid === e.id), n.findIndex((e) => e.uid === t?.id))); }, f = (e) => { let { fileList: t } = e; l(t), r?.(e); }, p = async (e, t) => { let { file: n, onSuccess: r, onError: s } = e, c = n, l = new FormData(); l.append("files", n); try { let e = await i(l); e.status === 200 || e.status === 201 ? (o({ tempName: e.data.data.tempFiles[0], uid: c.uid ?? "" }), r?.("Ok")) : s?.(e.error); } catch (e) { s?.(e); } a?.(e, t); }; return /* @__PURE__ */ N(He, { sensors: [u], onDragEnd: d, children: /* @__PURE__ */ N(Ge, { items: c.map((e) => e.uid), strategy: Je, children: /* @__PURE__ */ N(Ve, { ...s, fileList: c, itemRender: (e, t) => /* @__PURE__ */ N(Rn, { originNode: e, file: t }), customRequest: p, onChange: f, children: /* @__PURE__ */ N(B, { icon: /* @__PURE__ */ N(dt, {}), children: e }) }) }) }); }; //#endregion export { Ln as AdminTable, Lt as BaseDatePicker, zt as BaseDrawerForm, zn as BaseFileUpload, Bt as BaseImage, Yt as BaseImageUpload, Ut as BaseInput, de as BaseInputNumber, Zt as BaseMaterialMap, Wt as BasePasswordInput, $t as BaseReadonlyInput, tn as BaseSearchInput, nn as BaseSpin, Gt as BaseTextAreaInput, Nn as BaseTextEditor, E as COOKIE, Ft as Container, _ as LOCAL_STORAGE, Mt as Languages, Xt as LayoutCard, Nt as MonthsNumber, he as OpenApiAxios, e as ProviderComposer, w as THEME, u as TIME, T as VALIDATION_VALUE, b as checkCorrectFileObject, a as checkCorrectImageObject, le as compareRolesPriority, _e as convertPhoneMask, ne as createProfileLabel, ie as createUploadImagesStore, D as deleteCookie, Q as escapeHtml, pe as fileToBase64, ue as formatPhoneToInternational, ae as formatPhoneToNumber, fe as getCookie, i as getImagePrefix, ge as getTokenInCookie, h as getUploadFileUrl, ce as getUploadImageUrl, vn as insertImage, gn as insertLink, un as isBlockActive, yn as isImageUrl, mn as isLinkActive, dn as isMarkActive, k as isUrl, oe as mergeObjectArrays, Cn as normalizeSlateData, ee as objectArrayToOptions, ve as onFilterSelectOptionsByLabel, j as prepareFilesToSubmit, te as prepareImagesToSubmit, t as prepareServerFiles, se as prepareServerImages, re as provider, m as responseSchema, S as searchRadioDefaultValue, Sn as serializeToHtml, g as serverFileSchema, o as serverImageSchema, l as sessionCookieSchema, O as setCookie, p as sortFilesArrayByReference, pn as toggleBlock, fn as toggleMark, be as translateContent, y as translateContentToLanguages, r as translateField, ye as translateImagesAlt, hn as unwrapLink, f as uploadFilesSchema, v as uploadImageSchema, xe as uploadTempSchema, c as useExtraMediumViewPort, n as useFetchTableData, x as useLaptopBigViewPort, C as useLaptopViewPort, s as useMobileViewPort, jt as useSession, d as useSmallViewPort, me as useTabletViewPort, bn as withImages, xn as withInlines, _n as wrapLink };