var Me = Object.defineProperty; var Ge = (t, e, a) => e in t ? Me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a; var dt = (t, e, a) => Ge(t, typeof e != "symbol" ? e + "" : e, a); import { F as g, c as p, a as T, b as f, d as o, e as $, N as d, C as u, f as Ue, g as k, i as E } from "./index.Dlc3VA1f.js"; import { $ as Se, a9 as ze, A as Fe, s as ve, H as $t, y as j, a3 as Be, w as K, k as he, Z as je, aa as mt, a8 as ye, ab as Ke, t as se, a7 as R, ac as Ye, ad as Je, z as ie, v as re } from "./index.B_XvPxIW.js"; import { u as m } from "./jsxRuntime.module.92xvPm7T.js"; import { d as P, Y as Xe } from "./styled-components.browser.esm.BqRwOR0p.js"; import { a as We, b as qe } from "./store.CIwOEmOM.js"; import { t as s } from "./tokens.CKbL8mrq.js"; import { g as Ze } from "./colors.5zuHvbyn.js"; const Ie = ({ delay: t }, e) => { let a, n = !0; const r = (...i) => { n ? (clearTimeout(a), a = setTimeout(() => { n && e(...i), a = void 0; }, t)) : e(...i); }; return r.isPending = () => a !== void 0, r.cancel = () => { n = !1; }, r.flush = (...i) => e(...i), r; }, St = { DICTIONARY: "dictionary", // 辞書AI PLAIN: "plain", // やさしい日本語AI FURIGANA: "furigana" // ふりがな }, Ft = g.DICTIONARY, Y = { FDICTP: "FDICTP", FDICT: "FDICT" }, vt = [ { titleToken: s.features.dictionary_plainJapanese, variant: Y.FDICTP, icon: o.IconDictionary }, { titleToken: s.features.dictionary_dict, variant: Y.FDICT, icon: o.IconDictionary } ], Ia = "", ba = Se((t) => ({ searchText: "", isLoading: !1, result: void 0, setSearchText: async (e) => { t({ searchText: e, result: void 0 }); const a = w().use.getState().variant; if (e === "") return; t({ isLoading: !0 }); const n = ze(a).with(Y.FDICTP, () => St.PLAIN).otherwise(() => St.DICTIONARY), r = await Qe.getDefinition(ve, e, n); if (r.isErr()) { t({ isLoading: !1 }); return; } t({ isLoading: !1, result: r.value }); } })), Qe = Fe.createDictionaryRepository(), w = T(Ft, [$(Ft, vt)]), be = p(w), xa = () => w().use((t) => t.variant === Y.FDICT), La = () => w().use((t) => t.variant === Y.FDICTP), Pa = { titleToken: s.features.dictionary_plainJapanese, icon: o.IconDictionary, steps: vt, useVariant: () => w().use((t) => t.variant), useSetNextVariant: () => f(w, vt, () => Le.set(void 0)) }, Na = { name: Ft, setVariant: be.set }, xe = "body1", tn = P("span")` margin: 0; ${({ theme: t, $color: e }) => e && `color: ${e === "inherit" ? "inherit" : t.palette[e]};`} ${({ theme: t, $variant: e }) => t.fontToStyle(t.font[e || xe])} ${({ $textAlign: t }) => t && `text-align: ${t};`} ${({ theme: t, $fontWeight: e }) => e && `font-weight: ${t.fontWeights[e]};`} ${({ $lineHeight: t }) => t && `line-height: ${t};`} ${({ $underline: t }) => t && "text-decoration: underline;"} `, en = { h1: "h1", h2: "h2", h3: "h3", h4: "h4", h5: "h5", h6: "h6", subtitle1: "h6", body1: "p", body2: "p", body3: "p", extH2: "h2", extSubtitle1: "h6", extBody1: "p" }, Z = ({ component: t, variant: e, color: a, textAlign: n, fontWeight: r, lineHeight: i, underline: c, ...l }) => { const v = t || en[e || xe]; return /* @__PURE__ */ m( tn, { as: v, $variant: e, $color: a, $textAlign: n, $fontWeight: r, $lineHeight: i, $underline: c, ...l } ); }, nn = P.div` position: absolute; display: flex; flex-direction: column; align-items: start; min-width: 150px; max-width: 400px; background: rgb(253, 253, 215); padding: 8px 16px; gap: 6px; border: 1px solid grey; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); border-radius: 8px; z-index: ${je.TOOLTIP}; `, Va = ({ setSearchText: t, clearSearchText: e, maxTextLength: a, definition: n, searchingText: r }) => { const i = $t(null), c = $t(null); j(() => { const S = document.createElement("div"); return S.id = "uniweb-ts-tooltip", document.body.appendChild(S), i.current = S, c.current = S.attachShadow({ mode: "open" }), () => { S && document.body.removeChild(S); }; }, []); const v = Ie({ delay: 500 }, (S) => { if (S.length === 0 || S.length >= a) { e(); return; } t(S); }), h = () => { var ue; const S = ((ue = window.getSelection()) == null ? void 0 : ue.toString()) || ""; if (!S.length) { e(); return; } v(S); }; return j(() => (document.addEventListener("selectionchange", h), () => { document.removeEventListener("selectionchange", h); }), []), c.current ? /* @__PURE__ */ m(Xe, { target: c.current, children: Be.createPortal( /* @__PURE__ */ m( an, { definition: n, searchingText: r } ), c.current ) }) : null; }, an = ({ definition: t, searchingText: e }) => { const a = $t(null), [n, r] = K({ height: 0, width: 0 }); if (j(() => { if (a.current) { const h = a.current.getBoundingClientRect(); r({ height: h.height, width: h.width }); } }, [t]), !e) return null; let i, c; const l = window.getSelection(); if (l !== null && !l.isCollapsed) { const h = l.getRangeAt(0).getBoundingClientRect(); c = We(h, n.height), i = qe(h, n.width); } else i = "50vw", c = "50vh"; return /* @__PURE__ */ m( nn, { ref: a, style: { left: i, top: c }, children: t.isLoading ? /* @__PURE__ */ m(Z, { variant: "extBody1", children: "検索中..." }) : t.contents ? /* @__PURE__ */ m(he, { children: [ /* @__PURE__ */ m( Z, { component: "p", variant: "extSubtitle1", fontWeight: "bold", children: t.contents.word } ), /* @__PURE__ */ m(Z, { variant: "extBody1", children: t.contents.definition }) ] }) : /* @__PURE__ */ m(Z, { variant: "extBody1", children: "検索結果なし" }) } ); }, ht = g.FURIGANA, ce = { FFRGN: "FFRGN" }, yt = [ { titleToken: s.features.furigana, variant: ce.FFRGN, icon: o.IconFurigana } ], _a = "", on = Fe.createDictionaryRepository(), Ca = Se((t) => ({ searchText: "", isLoading: !1, result: void 0, setSearchText: async (e) => { t({ searchText: e, result: void 0 }); const a = J().use.getState().variant; if (e === "" || a !== ce.FFRGN) return; t({ isLoading: !0 }); const n = await on.getDefinition(ve, e, St.FURIGANA); if (n.isErr()) { t({ isLoading: !1 }); return; } t({ isLoading: !1, result: n.value }); } })), J = T(ht, [$(ht, yt)]), Le = p(J), Aa = () => J().use((t) => t.variant === ce.FFRGN), ka = { titleToken: s.features.furigana, icon: o.IconFurigana, steps: yt, useVariant: () => J().use((t) => t.variant), useSetNextVariant: () => f(J, yt, () => be.set(void 0)) }, Ra = { name: ht, setVariant: Le.set }, nt = { REVERSE: "reverse", DARK: "dark", LIGHT: "light" }, sn = { bg: "rgb(0, 0, 0)", border: "rgb(255, 255, 255)", font: { base: "rgb(80, 208, 160)", sub: "rgb(255, 255, 255)", link: "rgb(252, 255, 60)" } }, rn = { bg: "rgb(255, 255, 255)", border: "rgb(0, 0, 0)", font: { base: "rgb(0, 0, 0)", sub: "rgb(25, 25, 25)", link: "rgb(0, 0, 211)" } }, cn = { dark: sn, light: rn }, N = class N { static getInstance() { return N.instance || (N.instance = new N()), N.instance; } buildStyle(e, a) { return a === nt.REVERSE ? this.buildReverseStyle(e) : this.buildThemeStyle(e, a); } buildReverseStyle(e) { return ` .${e} { filter: invert(1) !important; } `; } buildThemeStyle(e, a) { const n = cn[a]; return ` body.${e} { background-color: ${n.bg} !important; } .${e} > *${d} *:not(a):not(a *) { background-color: ${n.bg} !important; border-color: ${n.border} !important; color: ${n.font.base} !important; } .${e} > *${d} a { background-color: ${n.bg} !important; border-color: ${n.border} !important; color: ${n.font.link} !important; } .${e} > *${d} a * { background-color: ${n.bg} !important; border-color: ${n.border} !important; color: ${n.font.link} !important; } .${e} > *${d} ::placeholder { color: ${n.font.sub} !important; } .${e} ::before { color: ${n.font.base} !important; } .${e} > *${d} svg { fill: ${n.font.base} !important; } .${e} > *${d} a svg { fill: ${n.font.link} !important; } .${e} > *${d} a::before, .${e} > *${d} a ::before { color: ${n.font.link} !important; } `; } }; dt(N, "instance"); let It = N; const gt = It.getInstance(), H = g.CONTRAST, y = { FCONT1: "FCONT1", FCONT2: "FCONT2", FCONT3: "FCONT3" }, bt = [ { titleToken: s.features.contrast_reverse, variant: y.FCONT1, icon: o.IconContrastInversion }, { titleToken: s.features.contrast_dark, variant: y.FCONT2, icon: o.IconContrast }, { titleToken: s.features.contrast_light, variant: y.FCONT3, icon: o.IconContrast } ], ln = ` ${gt.buildStyle(u + y.FCONT1, nt.REVERSE)} ${gt.buildStyle(u + y.FCONT2, nt.DARK)} ${gt.buildStyle(u + y.FCONT3, nt.LIGHT)} `, un = [ { variant: y.FCONT1, targets: ["origin-html"] }, { variant: y.FCONT2, targets: ["origin-body", "all-iframes"] }, { variant: y.FCONT3, targets: ["origin-body", "all-iframes"] } ], xt = T(H, [ Ue(H, un), $(H, bt) ]), Pe = p(xt), dn = { titleToken: s.features.contrast_base, icon: o.IconContrast, steps: bt, useVariant: () => xt().use((t) => t.variant), useSetNextVariant: () => f(xt, bt) }, mn = { name: H, setVariant: Pe.set }, wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ContrastVariant: y, componentParams: dn, direct: Pe, eventParams: mn, name: H, style: ln }, Symbol.toStringTag, { value: "Module" })), at = g.CURSOR, L = { FCUR1: "FCUR1", FCUR2: "FCUR2", FCUR3: "FCUR3" }, Lt = [ { titleToken: s.features.cursor_big, variant: L.FCUR1, icon: o.IconCursor }, { titleToken: s.features.cursor_focus, variant: L.FCUR2, icon: o.IconFocus }, { titleToken: s.features.cursor_readingGuide, variant: L.FCUR3, icon: o.IconReadingGuide } ], Ea = ` .${u + L.FCUR1} > * { cursor: url(${mt}/big_cursor.svg),auto!important; } .${u + L.FCUR1} a { cursor: url(${mt}/big_cursor.svg),auto!important; } .${u + L.FCUR1} button { cursor: url(${mt}/big_cursor.svg),auto!important; } `, X = T(at, [ k(at, "origin-body", "widget-root", "all-iframes"), $(at, Lt) ]), gn = p(X), pn = () => X().use((t) => t.variant === L.FCUR2), Tn = () => X().use((t) => t.variant === L.FCUR3), Ha = { titleToken: s.features.cursor_base, icon: o.IconCursor, steps: Lt, useVariant: () => X().use((t) => t.variant), useSetNextVariant: () => f(X, Lt) }, Da = { name: at, setVariant: gn.set }, W = { x: 0, y: 0 }, Oa = () => { const t = (e) => { W.x = e.clientX, W.y = e.clientY; }; document.addEventListener("mousemove", Ie({ delay: 300 }, t)); }, fn = P.div` box-sizing: border-box; background: ${({ theme: t }) => t.palette.readingGuideInner}; width: 40vw; min-width: 200px; max-width: 450px; position: absolute; height: 12px; border: solid 3px ${({ theme: t }) => t.palette.readingGuideOutline}; border-radius: 5px; top: 20px; z-index: ${Ke}; transform: translateX(-50%); `, $n = P.div` &:before, &:after { content: ""; bottom: 100%; left: 50%; border: solid transparent; height: 0; width: 0; position: absolute; pointer-events: none; } &:after { border-bottom-color: ${({ theme: t }) => t.palette.readingGuideInner}; border-width: 10px; margin-left: -10px; } &:before { border-bottom-color: ${({ theme: t }) => t.palette.readingGuideOutline}; border-width: 15px; margin-left: -15px; } `, Ma = () => !Tn() || ye.isMobile ? null : /* @__PURE__ */ m(Sn, {}), Sn = () => { const [t, e] = K(-1), [a, n] = K(-1), r = (c, l) => { e(c - 20), n(l); }, i = (c) => { r(c.clientY, c.clientX); }; return j(() => (r(W.y, W.x), window.addEventListener("mousemove", i), () => { window.removeEventListener("mousemove", i); }), []), t < 0 && a < 0 ? null : /* @__PURE__ */ m( fn, { style: { top: `${t}px`, left: `${a}px` }, children: /* @__PURE__ */ m($n, {}) } ); }, Fn = P.div` position: fixed; z-index: 2147483647; width: 100%; background: ${({ theme: t }) => t.palette.focusBlur}; top: 0; `, vn = P.div` width: 100%; height: 8px; position: absolute; background: ${({ theme: t }) => t.palette.focusLine}; bottom: 0; `, hn = P.div` position: fixed; z-index: 2147483647; width: 100%; background: ${({ theme: t }) => t.palette.focusBlur}; bottom: 0; `, yn = P.div` width: 100%; height: 8px; position: absolute; background: ${({ theme: t }) => t.palette.focusLine}; top: 0; `, Ga = () => !pn() || ye.isMobile ? null : /* @__PURE__ */ m(In, {}), In = () => { const [t, e] = K(-1), [a, n] = K(-1), r = (c) => { const l = c, v = window.innerHeight, h = l - 50, S = v - l - 50; e(h), n(S); }, i = (c) => { r(c.clientY); }; return j(() => (r(W.y), window.addEventListener("mousemove", i), () => { window.removeEventListener("mousemove", i); }), []), t < 0 && a < 0 ? null : /* @__PURE__ */ m(he, { children: [ /* @__PURE__ */ m(Fn, { style: { height: `${t}px` }, children: /* @__PURE__ */ m(vn, {}) }), /* @__PURE__ */ m(hn, { style: { height: `${a}px` }, children: /* @__PURE__ */ m(yn, {}) }) ] }); }, D = g.FONT, q = { FFONT1: "FFONT1", FFONT2: "FFONT2" }, Pt = [ { titleToken: s.features.font_dyslexia, variant: q.FFONT1, icon: o.IconFont }, { titleToken: s.features.font_readable, variant: q.FFONT2, icon: o.IconFont } ], bn = ` .${u + q.FFONT1} > *${d} * { font-family: "Lexend", sans-serif!important; } .${u + q.FFONT2} > *${d} * { font-family: "Noto Sans JP", sans-serif!important; } `, xn = [ '' ], Nt = T(D, [ k(D, "origin-body", "all-iframes"), $(D, Pt) ]), Ne = p(Nt), Ln = { titleToken: s.features.font_base, icon: o.IconFont, steps: Pt, useVariant: () => Nt().use((t) => t.variant), useSetNextVariant: () => f(Nt, Pt) }, Pn = { name: D, setVariant: Ne.set }, Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, FontVariant: q, componentParams: Ln, direct: Ne, eventParams: Pn, headTags: xn, name: D, style: bn }, Symbol.toStringTag, { value: "Module" })), pt = { activate: async () => { const t = await de(); t == null || t.activate(); }, deactivate: async () => { const t = await de(); t == null || t.diactivate(); } }; let Q; const de = async () => { if (Q) return Q; const [t, e] = await se(() => import("./lazy.CiUllxOw.js"))(); return t ? (console.error("Error loading ImgToText:", t), null) : (Q = e.ImgToTextController, Q); }, ot = g.IMAGE_HIDE, F = { FIH: "FIH", FITT: "FITT" }, Vt = [ { titleToken: s.features.imageHide_hidden, variant: F.FIH, icon: o.IconHideImage }, { titleToken: s.features.imageHide_toText, variant: F.FITT, icon: o.IconFontDownload } ], za = ` .${u + F.FIH} *${d} img, .${u + F.FIH} *${d} svg { visibility: hidden; } .${u + F.FIH} *${d} > *, .${u + F.FIH} *${d} > *:before, .${u + F.FIH} *${d} > *:after, .${u + F.FITT} *${d} > *, .${u + F.FITT} *${d} > *:before, .${u + F.FITT} *${d} > *:after { background-image: none!important; } `, Nn = () => (t, e, a) => ({ ...R("feature-toggle-img-to-text", e, (n) => { var l; const r = E(e), i = n.variant; return ((l = e()) == null ? void 0 : l.variant) === i ? {} : i !== F.FITT ? (pt.deactivate(), {}) : (r ? setTimeout(() => { pt.activate(); }, 500) : pt.activate(), {}); }) }), _t = T(ot, [ k(ot, "origin-body", "all-iframes"), $(ot, Vt), Nn() ]), Vn = p(_t), Ba = { titleToken: s.features.imageHide_hidden, icon: o.IconHideImage, steps: Vt, useVariant: () => _t().use((t) => t.variant), useSetNextVariant: () => f(_t, Vt) }, ja = { name: ot, setVariant: Vn.set }, me = { changeTextSize: async (t) => { const e = await _n(); e == null || e.changeTextSize(t); } }; let tt; const _n = async () => { if (tt) return tt; const [t, e] = await se(() => import("./lazy.CJYRjxDW.js"))(); return t ? (console.error("Error loading LargeText:", t), null) : (tt = e.LargeTextController, tt); }, Ct = g.LARGE_DISPLAY, I = { FLD1: "FLD1", FLD2: "FLD2", FLD3: "FLD3", FLD4: "FLD4" }, At = [ { titleToken: s.features.largeDisplay_large1, variant: I.FLD1, icon: o.IconLargeText }, { titleToken: s.features.largeDisplay_large2, variant: I.FLD2, icon: o.IconLargeText }, { titleToken: s.features.largeDisplay_large3, variant: I.FLD3, icon: o.IconLargeText }, { titleToken: s.features.largeDisplay_large4, variant: I.FLD4, icon: o.IconLargeText } ], Ka = "", Cn = { [I.FLD1]: 1, [I.FLD2]: 2, [I.FLD3]: 3, [I.FLD4]: 4 }, An = () => (t, e, a) => ({ ...R("feature-update-font-size", e, (n) => { var v; const r = E(e), i = n.variant, c = (v = e()) == null ? void 0 : v.variant; if (i === c) return {}; const l = i ? Cn[i] : void 0; return r ? setTimeout(() => { me.changeTextSize(l); }, 1e3) : me.changeTextSize(l), {}; }) }), kt = T(Ct, [ An(), $(Ct, At) ]), kn = p(kt), Ya = { titleToken: s.features.largeDisplay_base, icon: o.IconLargeText, steps: At, useVariant: () => kt().use((t) => t.variant), useSetNextVariant: () => f(kt, At) }, Ja = { name: Ct, setVariant: kn.set }, O = g.LINK_HIGHLIGHT, st = { FLH1: "FLH1" }, Rt = [ { titleToken: s.features.linkHighlight, variant: st.FLH1, icon: o.IconLink } ], Rn = ` .${u + st.FLH1} > *${d} a, .${u + st.FLH1} > *${d} a > * { text-decoration: underline !important; color: rgb(255, 255, 0) !important; background-color: rgb(0, 0, 0) !important; } `, wt = T(O, [ k(O, "origin-body", "all-iframes"), $(O, Rt) ]), Ve = p(wt), wn = { titleToken: s.features.linkHighlight, icon: o.IconLink, steps: Rt, useVariant: () => wt().use((t) => t.variant), useSetNextVariant: () => f(wt, Rt) }, En = { name: O, setVariant: Ve.set }, Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, LinkHighlightVariant: st, componentParams: wn, direct: Ve, eventParams: En, name: O, style: Rn }, Symbol.toStringTag, { value: "Module" })), it = g.MUTE_SOUND, le = { FMS: "FMS" }, Et = [ { titleToken: s.features.unmute_sound, variant: le.FMS, icon: o.IconUnmuteSound } ], Hn = "", Dn = (t) => { const e = document.querySelectorAll("audio,video"); for (const a of e) !(Ye(a) || Je(a)) || a.hasAttribute("muted") || (t === le.FMS ? a.muted = !0 : a.muted = !1); }, On = () => (t, e, a) => ({ ...R("feature-update-mute-sound", e, (n) => (Dn(n.variant), {})) }), Ht = T(it, [ $(it, Et), On() ]), _e = p(Ht), Mn = { titleToken: s.features.mute_sound, icon: o.IconMuteSound, steps: Et, useVariant: () => Ht().use((t) => t.variant), useSetNextVariant: () => f(Ht, Et) }, Gn = { name: it, setVariant: _e.set }, Wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, MuteSoundVariant: le, componentParams: Mn, direct: _e, eventParams: Gn, name: it, style: Hn }, Symbol.toStringTag, { value: "Module" })), Dt = g.PAGE_STRUCTURE, Ce = { FPS: "FPS" }, Ot = [ { titleToken: s.features.pageStructure, variant: Ce.FPS, icon: o.IconPageStructure } ], qa = "", rt = T(Dt, [$(Dt, Ot)]), Ae = p(rt), Un = () => rt().use((t) => t.variant === Ce.FPS), Za = () => Ae.reset, Qa = { titleToken: s.features.pageStructure, icon: o.IconPageStructure, steps: Ot, useVariant: () => rt().use((t) => t.variant), useSetNextVariant: () => f(rt, Ot) }, to = { name: Dt, setVariant: Ae.set }, zn = ie(() => import("./PageStructure.lazy.DiqoRudV.js")), eo = () => Un() ? /* @__PURE__ */ m(re, { fallback: null, children: /* @__PURE__ */ m(zn, {}) }) : null, M = g.PAUSE_ANIMATION, G = { FPA: "FPA" }, Mt = [ { titleToken: s.features.pauseAnimation_start, variant: G.FPA, icon: o.IconStartAnimation } ], Bn = ` .${u + G.FPA} > *${d} *, .${u + G.FPA} > *${d} *:before, .${u + G.FPA} > *${d} *:after { transition: none!important; animation-play-state: paused!important; } `, ge = (t) => { const e = t !== void 0, a = document.querySelectorAll("video"); for (const n of a) e ? n.pause() : n.play(); }, jn = () => (t, e, a) => ({ ...R("feature-toggle-video-state", e, (n) => { var l; const r = E(e), i = n.variant, c = (l = e()) == null ? void 0 : l.variant; return i === c ? {} : (r ? setTimeout(() => { ge(i); }, 1e3) : ge(i), {}); }) }), Gt = T(M, [ k(M, "origin-body", "all-iframes"), $(M, Mt), jn() ]), ke = p(Gt), Kn = { titleToken: s.features.pauseAnimation_stop, icon: o.IconPauseAnimation, steps: Mt, useVariant: () => Gt().use((t) => t.variant), useSetNextVariant: () => f(Gt, Mt) }, Yn = { name: M, setVariant: ke.set }, no = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, PauseAnimationVariant: G, componentParams: Kn, direct: ke, eventParams: Yn, name: M, style: Bn }, Symbol.toStringTag, { value: "Module" })), Ut = g.READING_MODE, Re = { FRM: "FRM" }, zt = [ { titleToken: s.features.readingMode, variant: Re.FRM, icon: o.IconBook } ], ao = "", ct = T(Ut, [$(Ut, zt)]), we = p(ct), oo = () => we.reset, Jn = () => ct().use((t) => t.variant === Re.FRM), so = { titleToken: s.features.readingMode, icon: o.IconBook, steps: zt, useVariant: () => ct().use((t) => t.variant), useSetNextVariant: () => f(ct, zt) }, io = { name: Ut, setVariant: we.set }, Xn = ie(() => import("./ReadingMode.lazy.DUa3zE07.js")), ro = () => Jn() ? /* @__PURE__ */ m(re, { fallback: null, children: /* @__PURE__ */ m(Xn, {}) }) : null, U = g.SATURATION, _ = { FS1: "FS1", FS2: "FS2", FS3: "FS3" }, Bt = [ { titleToken: s.features.saturation_low, variant: _.FS1, icon: o.IconSaturation }, { titleToken: s.features.saturation_high, variant: _.FS2, icon: o.IconSaturation }, { titleToken: s.features.saturation_monochrome, variant: _.FS3, icon: o.IconSaturation } ], Wn = ` .${u + _.FS1} { filter: saturate(0.5)!important; } .${u + _.FS2} { filter: saturate(3)!important; } .${u + _.FS3} { filter: saturate(0)!important; } `, jt = T(U, [ k(U, "origin-html"), $(U, Bt) ]), Ee = p(jt), qn = { titleToken: s.features.saturation_base, icon: o.IconSaturation, steps: Bt, useVariant: () => jt().use((t) => t.variant), useSetNextVariant: () => f(jt, Bt) }, Zn = { name: U, setVariant: Ee.set }, co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, SaturationVariant: _, componentParams: qn, direct: Ee, eventParams: Zn, name: U, style: Wn }, Symbol.toStringTag, { value: "Module" })), Tt = { execute: async () => { const t = await pe(); t == null || t.execute(); }, clear: async () => { const t = await pe(); t == null || t.clear(); } }; let et; const pe = async () => { if (et) return et; const [t, e] = await se(() => import("./lazy.BwTtMm22.js"))(); return t ? (console.error("Error loading SmartContrast:", t), null) : (et = e.SmartContrastController, et); }, Kt = g.SMART_CONTRAST, He = { FSMCONT1: "FSMCONT1" }, Yt = [ { titleToken: s.features.smartContrast, variant: He.FSMCONT1, icon: o.IconSmartContrast } ], lo = "", Qn = () => (t, e, a) => ({ ...R("feature-handle-smart-contrast", e, (n) => { var l; const r = E(e), i = n.variant, c = (l = e()) == null ? void 0 : l.variant; return i === c ? {} : i === void 0 ? (Tt.clear(), {}) : i !== He.FSMCONT1 ? {} : (r ? setTimeout(() => { Tt.execute(); }, 1e3) : Tt.execute(), {}); }) }), Jt = T(Kt, [ $(Kt, Yt), Qn() ]), ta = p(Jt), uo = { titleToken: s.features.smartContrast, icon: o.IconSmartContrast, steps: Yt, useVariant: () => Jt().use((t) => t.variant), useSetNextVariant: () => f(Jt, Yt) }, mo = { name: Kt, setVariant: ta.set }, b = { LEFT: "left", RIGHT: "right", CENTER: "center", JUSTIFY: "justify" }, V = class V { static getInstance() { return V.instance || (V.instance = new V()), V.instance; } changeAlignment(e) { this.targets().forEach((a) => { if (!(a instanceof HTMLElement) || this.isExceptNode(a)) return; const n = window.getComputedStyle(a); if (n.display === "flex") { this.changeFlexAlignment(a, n, e); return; } this.changeNonFlexAlignment(a, e); }); } changeFlexAlignment(e, a, n) { if (a.flexDirection === "column" || a.flexDirection === "column-reverse") { const i = n !== void 0 ? this.mappingAlignToAlignItems[n] : void 0; this.applyStyle(e, "align-items", i); } else this.applyStyle(e, "justify-content", n); } changeNonFlexAlignment(e, a) { this.applyStyle(e, "text-align", a); } applyStyle(e, a, n) { n !== void 0 ? e.style.setProperty(a, n, "important") : e.style.removeProperty(a); } targets() { return document.querySelectorAll("body *"); } get mappingAlignToAlignItems() { return { [b.LEFT]: "start", [b.RIGHT]: "end", [b.CENTER]: "center", [b.JUSTIFY]: "align" }; } isExceptNode(e) { return ["NOSCRIPT", "SCRIPT", "STYLE", "META", "LINK", "IFRAME"].includes(e.tagName); } }; dt(V, "instance"); let Xt = V; const ft = Xt.getInstance(), Wt = g.TEXT_ALIGN, x = { FTALIGN1: "FTALIGN1", FTALIGN2: "FTALIGN2", FTALIGN3: "FTALIGN3", FTALIGN4: "FTALIGN4" }, qt = [ { titleToken: s.features.textAlign_left, variant: x.FTALIGN1, icon: o.IconAlignLeft }, { titleToken: s.features.textAlign_right, variant: x.FTALIGN2, icon: o.IconAlignRight }, { titleToken: s.features.textAlign_center, variant: x.FTALIGN3, icon: o.IconAlignCenter }, { titleToken: s.features.textAlign_justify, variant: x.FTALIGN4, icon: o.IconAlignJustify } ], go = "", Te = { [x.FTALIGN1]: b.LEFT, [x.FTALIGN2]: b.RIGHT, [x.FTALIGN3]: b.CENTER, [x.FTALIGN4]: b.JUSTIFY }, ea = () => (t, e, a) => ({ ...R("feature-change-alignment", e, (n) => { var l; const r = E(e), i = n.variant, c = (l = e()) == null ? void 0 : l.variant; return i === c ? {} : i === void 0 ? (ft.changeAlignment(void 0), {}) : (r ? setTimeout(() => { ft.changeAlignment(Te[i]); }, 1e3) : ft.changeAlignment(Te[i]), {}); }) }), Zt = T(Wt, [ $(Wt, qt), ea() ]), na = p(Zt), po = { titleToken: s.features.textAlign_base, icon: o.IconAlignLeft, steps: qt, useVariant: () => Zt().use((t) => t.variant), useSetNextVariant: () => f(Zt, qt) }, To = { name: Wt, setVariant: na.set }, aa = (t) => { const e = { acceptNode: (a) => { var r; if (!((r = a.textContent) != null && r.trim())) return NodeFilter.FILTER_REJECT; const n = a.parentElement; return n && ["SCRIPT", "STYLE", "NOSCRIPT"].includes(n.tagName) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; } }; return document.createTreeWalker(t, NodeFilter.SHOW_TEXT, e); }, lt = g.TEXT_LINE_HEIGHT, C = { FTLH1: "FTLH1", FTLH2: "FTLH2", FTLH3: "FTLH3" }, Qt = [ { titleToken: s.features.textLineHeight_large1, variant: C.FTLH1, icon: o.IconLineHeight }, { titleToken: s.features.textLineHeight_large2, variant: C.FTLH2, icon: o.IconLineHeight }, { titleToken: s.features.textLineHeight_large3, variant: C.FTLH3, icon: o.IconLineHeight } ], oa = "", fe = /* @__PURE__ */ new Map(), sa = { [C.FTLH1]: 1.5, [C.FTLH2]: 1.75, [C.FTLH3]: 2 }, $e = (t) => { const e = aa(document.body); for (; e.nextNode(); ) { const a = e.currentNode.parentElement; if (!a) continue; let n = fe.get(a); if (t === void 0) { if (!n) continue; n.elStyleVal ? a.style.setProperty("line-height", n.elStyleVal, n.elStylePriority) : a.style.removeProperty("line-height"); continue; } if (!n) { const i = window.getComputedStyle(a), c = Number.parseFloat(i.lineHeight), l = Number.parseFloat(i.fontSize); n = { lineHeight: c / l, elStyleVal: a.style.getPropertyValue("line-height"), elStylePriority: a.style.getPropertyPriority("line-height") }, fe.set(a, n); } const r = sa[t]; a.style.setProperty("line-height", `${n.lineHeight * r}`, "important"); } }, ia = () => (t, e, a) => ({ ...R("feature-update-line-height", e, (n) => { var l; const r = E(e), i = n.variant, c = (l = e()) == null ? void 0 : l.variant; return i === c ? {} : (r ? setTimeout(() => { $e(i); }, 1e3) : $e(i), {}); }) }), te = T(lt, [ $(lt, Qt), ia() ]), De = p(te), ra = { titleToken: s.features.textLineHeight_base, icon: o.IconLineHeight, steps: Qt, useVariant: () => te().use((t) => t.variant), useSetNextVariant: () => f(te, Qt) }, ca = { name: lt, setVariant: De.set }, fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, TextLineHeightVariant: C, componentParams: ra, direct: De, eventParams: ca, name: lt, style: oa }, Symbol.toStringTag, { value: "Module" })), z = g.TEXT_SPACE, A = { FTS1: "FTS1", FTS2: "FTS2", FTS3: "FTS3" }, ee = [ { titleToken: s.features.textSpace_small, variant: A.FTS1, icon: o.IconLetterSpacing }, { titleToken: s.features.textSpace_medium, variant: A.FTS2, icon: o.IconLetterSpacing }, { titleToken: s.features.textSpace_large, variant: A.FTS3, icon: o.IconLetterSpacing } ], la = ` .${u + A.FTS1} > *${d} * { word-spacing: .25em!important; letter-spacing: .25em!important; } .${u + A.FTS2} > *${d} * { word-spacing: .5em!important; letter-spacing: .5em!important; } .${u + A.FTS3} > *${d} * { word-spacing: .75em!important; letter-spacing: .75em!important; } `, ne = T(z, [ $(z, ee), k(z, "origin-body", "all-iframes") ]), Oe = p(ne), ua = { titleToken: s.features.textSpace_base, icon: o.IconLetterSpacing, steps: ee, useVariant: () => ne().use((t) => t.variant), useSetNextVariant: () => f(ne, ee) }, da = { name: z, setVariant: Oe.set }, $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, TextSpaceVariant: A, componentParams: ua, direct: Oe, eventParams: da, name: z, style: la }, Symbol.toStringTag, { value: "Module" })), ae = g.VIRTUAL_KEYBOARD, B = { VKBD: "VKBD" }, oe = [ { titleToken: s.features.virtual_keyboard, variant: B.VKBD, icon: o.IconKeyboard } ], So = ` .${u + B.VKBD} { position: fixed; bottom: 0; width: 80%; left: 50%; transform: translateX(-50%); } .${u + B.VKBD} .simple-keyboard .hg-button[data-skbtn="{space}"] { width: 80%; } .${u + B.VKBD} .simple-keyboard .hg-rows .hg-row .hg-button:hover { background-color: ${Ze}; } `, ut = T(ae, [$(ae, oe)]), ma = p(ut), ga = () => ut().use((t) => t.variant === B.VKBD), Fo = { titleToken: s.features.virtual_keyboard, icon: o.IconKeyboard, steps: oe, useVariant: () => ut().use((t) => t.variant), useSetNextVariant: () => f(ut, oe) }, vo = { name: ae, setVariant: ma.set }, pa = ie(() => import("./VirtualKeyboard.lazy.DiyerHL9.js")), ho = () => ga() ? /* @__PURE__ */ m(re, { fallback: null, children: /* @__PURE__ */ m(pa, {}) }) : null; export { ot as $, Ca as A, ka as B, nt as C, St as D, Le as E, Ga as F, Ra as G, ht as H, F as I, _a as J, Ha as K, I as L, le as M, gn as N, Da as O, eo as P, at as Q, ro as R, _ as S, b as T, Ea as U, ho as V, pn as W, Tn as X, Ba as Y, Vn as Z, ja as _, Ma as a, za as a0, Ya as a1, kn as a2, Ja as a3, Ct as a4, Ka as a5, Qa as a6, Ae as a7, to as a8, Dt as a9, wa as aA, Xa as aB, $o as aC, no as aD, Ua as aE, fo as aF, co as aG, Wa as aH, Ee as aI, ke as aJ, Ne as aK, Z as aL, aa as aM, Ie as aN, qa as aa, Un as ab, Za as ac, so as ad, we as ae, io as af, Ut as ag, ao as ah, Jn as ai, oo as aj, uo as ak, ta as al, mo as am, Kt as an, lo as ao, po as ap, na as aq, To as ar, Wt as as, go as at, Fo as au, ma as av, vo as aw, ae as ax, So as ay, ga as az, y as b, L as c, Y as d, q as e, ce as f, st as g, Ce as h, G as i, Re as j, He as k, x as l, C as m, A as n, B as o, La as p, ba as q, Oa as r, Va as s, Pa as t, xa as u, be as v, Na as w, Ft as x, Ia as y, Aa as z };