book-index-ui 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { e as Vt, a as gn } from "./storage-entry-CWocbrbM.js";
2
- import { B as Ei, b as $i, c as Pi, d as Ai, f as Mi, C as Hi, G as Oi, I as Di, g as ji, L as Fi, M as Ui, S as Vi, h as Ni, i as Ki, j as Yi, k as Gi, l as Ji, m as qi, n as Zi, o as Xi, p as Qi, q as el, s as tl, v as nl } from "./storage-entry-CWocbrbM.js";
1
+ import { e as Vt, a as gn } from "./storage-entry-UQLfmeLb.js";
2
+ import { B as Ei, b as $i, c as Ai, d as Pi, f as Mi, C as Hi, G as Oi, I as Di, g as ji, L as Fi, M as Ui, S as Vi, h as Ni, i as Ki, j as Yi, k as Gi, l as Ji, m as qi, n as Zi, o as Xi, p as Qi, q as el, s as tl, v as nl } from "./storage-entry-UQLfmeLb.js";
3
3
  import { jsx as t, jsxs as i, Fragment as j } from "react/jsx-runtime";
4
- import rt, { createContext as Nt, useMemo as ae, useContext as Ve, useState as w, useEffect as P, useCallback as U, useRef as Q } from "react";
4
+ import rt, { createContext as Nt, useMemo as ce, useContext as Ve, useState as w, useEffect as $, useCallback as F, useRef as Q } from "react";
5
5
  import { createPortal as hn } from "react-dom";
6
6
  const xn = (e) => `/book-index?id=${e}`, Kt = Nt(xn);
7
7
  function Si({ buildUrl: e, children: n }) {
8
- const o = ae(() => e, [e]);
8
+ const o = ce(() => e, [e]);
9
9
  return /* @__PURE__ */ t(Kt.Provider, { value: o, children: n });
10
10
  }
11
11
  function de() {
@@ -619,13 +619,13 @@ const _n = "zh-Hant", wi = ({
619
619
  children: o
620
620
  }) => {
621
621
  const [r, a] = w(e ?? _n), l = e ?? r;
622
- P(() => {
622
+ $(() => {
623
623
  if (e) return;
624
624
  const g = Sn();
625
625
  g && g !== r && a(g);
626
626
  }, []);
627
627
  const [c, s] = w(null);
628
- P(() => {
628
+ $(() => {
629
629
  l === "zh-Hans" ? import("opencc-js/t2cn").then((g) => {
630
630
  const f = g.Converter({ from: "tw", to: "cn" });
631
631
  s(() => f);
@@ -633,9 +633,9 @@ const _n = "zh-Hant", wi = ({
633
633
  s(() => (g) => g);
634
634
  }) : s(null);
635
635
  }, [l]);
636
- const d = U((g) => {
636
+ const d = F((g) => {
637
637
  a(g), wn(g), n == null || n(g);
638
- }, [n]), u = ae(() => ({
638
+ }, [n]), u = ce(() => ({
639
639
  locale: l,
640
640
  setLocale: d,
641
641
  messages: kn[l],
@@ -648,10 +648,10 @@ function H() {
648
648
  return (e == null ? void 0 : e.messages) ?? Gt;
649
649
  }
650
650
  const zn = 2e3;
651
- function K() {
651
+ function Y() {
652
652
  const e = Ve(Ne), n = (e == null ? void 0 : e.locale) ?? "zh-Hant", o = (e == null ? void 0 : e.converter) ?? null, r = Q(/* @__PURE__ */ new Map()), a = Q(n);
653
653
  a.current !== n && (r.current.clear(), a.current = n);
654
- const l = U((c) => {
654
+ const l = F((c) => {
655
655
  if (!c) return "";
656
656
  if (!o) return c;
657
657
  const s = r.current.get(c);
@@ -663,7 +663,7 @@ function K() {
663
663
  }
664
664
  return r.current.set(c, d), d;
665
665
  }, [o]);
666
- return ae(() => ({
666
+ return ce(() => ({
667
667
  convert: l,
668
668
  locale: n,
669
669
  isSimplified: n === "zh-Hans"
@@ -709,35 +709,35 @@ const st = ({
709
709
  ], u = [
710
710
  { value: "catalog", label: l.rootType.catalog },
711
711
  { value: "search", label: l.rootType.search }
712
- ], g = (y) => {
712
+ ], g = (m) => {
713
713
  if (!a) return !0;
714
- const v = ke(y);
714
+ const v = ke(m);
715
715
  return a === "text" ? v.includes("text") : a === "image" ? v.includes("image") || v.includes("physical") : a === "physical" ? v.includes("physical") : v.includes(a);
716
- }, f = e.map((y, v) => ({ item: y, originalIndex: v })).filter(({ item: y }) => g(y)), x = () => {
717
- const y = In();
718
- a && (y.type = a), n([...e, y]), s(e.length);
719
- }, p = (y) => {
720
- n(e.filter((v, k) => k !== y)), s(null);
721
- }, b = (y, v, k) => {
722
- const T = [...e];
723
- if (T[y] = { ...T[y], [v]: k }, v === "url" && !T[y].id) {
716
+ }, f = e.map((m, v) => ({ item: m, originalIndex: v })).filter(({ item: m }) => g(m)), x = () => {
717
+ const m = In();
718
+ a && (m.type = a), n([...e, m]), s(e.length);
719
+ }, p = (m) => {
720
+ n(e.filter((v, k) => k !== m)), s(null);
721
+ }, b = (m, v, k) => {
722
+ const I = [...e];
723
+ if (I[m] = { ...I[m], [v]: k }, v === "url" && !I[m].id) {
724
724
  const _ = Cn(k);
725
- _ && (T[y].id = _);
725
+ _ && (I[m].id = _);
726
726
  }
727
- n(T);
728
- }, S = (y, v, k) => {
729
- const _ = { ...e[y].metadata || {} };
730
- k ? _[v] = k : delete _[v], b(y, "metadata", Object.keys(_).length > 0 ? _ : void 0);
731
- }, h = (y, v) => {
732
- const k = v.trim() ? v.split(/[,,、]/).map((T) => T.trim()).filter(Boolean) : void 0;
733
- b(y, "structure", k);
734
- }, z = (y, v, k) => {
735
- const _ = e[y].coverage || { level: 1, ranges: "" };
736
- v === "level" ? _.level = parseInt(k) || 1 : _.ranges = k, b(y, "coverage", _.ranges ? _ : void 0);
727
+ n(I);
728
+ }, S = (m, v, k) => {
729
+ const _ = { ...e[m].metadata || {} };
730
+ k ? _[v] = k : delete _[v], b(m, "metadata", Object.keys(_).length > 0 ? _ : void 0);
731
+ }, h = (m, v) => {
732
+ const k = v.trim() ? v.split(/[,,、]/).map((I) => I.trim()).filter(Boolean) : void 0;
733
+ b(m, "structure", k);
734
+ }, z = (m, v, k) => {
735
+ const _ = e[m].coverage || { level: 1, ranges: "" };
736
+ v === "level" ? _.level = parseInt(k) || 1 : _.ranges = k, b(m, "coverage", _.ranges ? _ : void 0);
737
737
  };
738
738
  return /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
739
- f.map(({ item: y, originalIndex: v }) => {
740
- var k, T, _;
739
+ f.map(({ item: m, originalIndex: v }) => {
740
+ var k, I, _;
741
741
  return /* @__PURE__ */ i(
742
742
  "div",
743
743
  {
@@ -765,32 +765,32 @@ const st = ({
765
765
  fontSize: "11px",
766
766
  padding: "1px 6px",
767
767
  borderRadius: "3px",
768
- background: Tn(y.type ?? "text"),
768
+ background: Tn(m.type ?? "text"),
769
769
  color: "#fff"
770
770
  }, children: (() => {
771
- var L, W;
772
- const m = ke(y);
773
- return m.length === 0 ? y.type ?? "text" : m.length === 1 ? ((L = d.find(($) => $.value === m[0])) == null ? void 0 : L.label) ?? m[0] : m.includes("text") && m.includes("image") ? ((W = d.find(($) => $.value === "text+image")) == null ? void 0 : W.label) ?? "text+image" : m.join("+");
771
+ var B, W;
772
+ const y = ke(m);
773
+ return y.length === 0 ? m.type ?? "text" : y.length === 1 ? ((B = d.find((E) => E.value === y[0])) == null ? void 0 : B.label) ?? y[0] : y.includes("text") && y.includes("image") ? ((W = d.find((E) => E.value === "text+image")) == null ? void 0 : W.label) ?? "text+image" : y.join("+");
774
774
  })() }),
775
- /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: "13px", fontWeight: 500 }, children: y.name || `${l.editor.resourcePlaceholder} ${v + 1}` }),
776
- y.id && /* @__PURE__ */ t("span", { style: { fontSize: "11px", opacity: 0.5 }, children: y.id }),
777
- y.url && /* @__PURE__ */ t(
775
+ /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: "13px", fontWeight: 500 }, children: m.name || `${l.editor.resourcePlaceholder} ${v + 1}` }),
776
+ m.id && /* @__PURE__ */ t("span", { style: { fontSize: "11px", opacity: 0.5 }, children: m.id }),
777
+ m.url && /* @__PURE__ */ t(
778
778
  "a",
779
779
  {
780
- href: y.url,
780
+ href: m.url,
781
781
  target: "_blank",
782
782
  rel: "noopener noreferrer",
783
- onClick: (m) => m.stopPropagation(),
783
+ onClick: (y) => y.stopPropagation(),
784
784
  style: { fontSize: "12px", opacity: 0.7 },
785
785
  children: "🔗"
786
786
  }
787
787
  ),
788
- o && y.url && Rn(v, r == null ? void 0 : r[v], o, l),
788
+ o && m.url && Rn(v, r == null ? void 0 : r[v], o, l),
789
789
  /* @__PURE__ */ t(
790
790
  "button",
791
791
  {
792
- onClick: (m) => {
793
- m.stopPropagation(), p(v);
792
+ onClick: (y) => {
793
+ y.stopPropagation(), p(v);
794
794
  },
795
795
  style: {
796
796
  background: "transparent",
@@ -808,7 +808,7 @@ const st = ({
808
808
  }
809
809
  ),
810
810
  c === v && /* @__PURE__ */ i("div", { style: { padding: "12px", borderTop: "1px solid var(--bim-widget-border, #e0e0e0)" }, children: [
811
- bn(y, "image") && y.url && Ln(y, l),
811
+ bn(m, "image") && m.url && Ln(m, l),
812
812
  /* @__PURE__ */ i("div", { style: { display: "grid", gap: "8px" }, children: [
813
813
  /* @__PURE__ */ i("div", { style: { display: "flex", gap: "8px" }, children: [
814
814
  /* @__PURE__ */ i("label", { style: Le, children: [
@@ -816,10 +816,10 @@ const st = ({
816
816
  /* @__PURE__ */ t(
817
817
  "select",
818
818
  {
819
- value: y.type,
820
- onChange: (m) => b(v, "type", m.target.value),
819
+ value: m.type,
820
+ onChange: (y) => b(v, "type", y.target.value),
821
821
  style: { ...ge, flex: 1 },
822
- children: d.map((m) => /* @__PURE__ */ t("option", { value: m.value, children: m.label }, m.value))
822
+ children: d.map((y) => /* @__PURE__ */ t("option", { value: y.value, children: y.label }, y.value))
823
823
  }
824
824
  )
825
825
  ] }),
@@ -828,10 +828,10 @@ const st = ({
828
828
  /* @__PURE__ */ t(
829
829
  "select",
830
830
  {
831
- value: y.root_type || "catalog",
832
- onChange: (m) => b(v, "root_type", m.target.value),
831
+ value: m.root_type || "catalog",
832
+ onChange: (y) => b(v, "root_type", y.target.value),
833
833
  style: { ...ge, flex: 1 },
834
- children: u.map((m) => /* @__PURE__ */ t("option", { value: m.value, children: m.label }, m.value))
834
+ children: u.map((y) => /* @__PURE__ */ t("option", { value: y.value, children: y.label }, y.value))
835
835
  }
836
836
  )
837
837
  ] })
@@ -841,8 +841,8 @@ const st = ({
841
841
  "input",
842
842
  {
843
843
  type: "text",
844
- value: y.id,
845
- onChange: (m) => b(v, "id", m.target.value),
844
+ value: m.id,
845
+ onChange: (y) => b(v, "id", y.target.value),
846
846
  placeholder: l.editor.idAutoExtract,
847
847
  style: { ...ge, width: "140px", flexShrink: 0 }
848
848
  }
@@ -851,8 +851,8 @@ const st = ({
851
851
  "input",
852
852
  {
853
853
  type: "text",
854
- value: y.name,
855
- onChange: (m) => b(v, "name", m.target.value),
854
+ value: m.name,
855
+ onChange: (y) => b(v, "name", y.target.value),
856
856
  placeholder: l.editor.resourceName,
857
857
  style: { ...ge, flex: 1 }
858
858
  }
@@ -862,8 +862,8 @@ const st = ({
862
862
  "input",
863
863
  {
864
864
  type: "text",
865
- value: y.url,
866
- onChange: (m) => b(v, "url", m.target.value),
865
+ value: m.url,
866
+ onChange: (y) => b(v, "url", y.target.value),
867
867
  placeholder: l.editor.resourceUrl,
868
868
  style: ge
869
869
  }
@@ -872,8 +872,8 @@ const st = ({
872
872
  "input",
873
873
  {
874
874
  type: "text",
875
- value: ((k = y.structure) == null ? void 0 : k.join("、")) || "",
876
- onChange: (m) => h(v, m.target.value),
875
+ value: ((k = m.structure) == null ? void 0 : k.join("、")) || "",
876
+ onChange: (y) => h(v, y.target.value),
877
877
  placeholder: l.editor.structurePlaceholder,
878
878
  style: ge
879
879
  }
@@ -886,8 +886,8 @@ const st = ({
886
886
  {
887
887
  type: "number",
888
888
  min: 1,
889
- value: ((T = y.coverage) == null ? void 0 : T.level) ?? "",
890
- onChange: (m) => z(v, "level", m.target.value),
889
+ value: ((I = m.coverage) == null ? void 0 : I.level) ?? "",
890
+ onChange: (y) => z(v, "level", y.target.value),
891
891
  placeholder: "1",
892
892
  style: { ...ge, width: "60px" }
893
893
  }
@@ -899,8 +899,8 @@ const st = ({
899
899
  "input",
900
900
  {
901
901
  type: "text",
902
- value: ((_ = y.coverage) == null ? void 0 : _.ranges) || "",
903
- onChange: (m) => z(v, "ranges", m.target.value),
902
+ value: ((_ = m.coverage) == null ? void 0 : _.ranges) || "",
903
+ onChange: (y) => z(v, "ranges", y.target.value),
904
904
  placeholder: l.editor.coverageRangePlaceholder,
905
905
  style: { ...ge, flex: 1 }
906
906
  }
@@ -910,29 +910,29 @@ const st = ({
910
910
  /* @__PURE__ */ t(
911
911
  "textarea",
912
912
  {
913
- value: y.details || "",
914
- onChange: (m) => b(v, "details", m.target.value),
913
+ value: m.details || "",
914
+ onChange: (y) => b(v, "details", y.target.value),
915
915
  placeholder: l.editor.detailsPlaceholder,
916
916
  style: { ...ge, minHeight: "60px", resize: "vertical" }
917
917
  }
918
918
  ),
919
919
  /* @__PURE__ */ i("div", { style: { borderTop: "1px solid var(--bim-widget-border, #e0e0e0)", paddingTop: "8px", marginTop: "4px" }, children: [
920
920
  /* @__PURE__ */ t("div", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #717171)", marginBottom: "6px" }, children: l.label.metadata }),
921
- /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "6px" }, children: Object.entries(l.metadata).map(([m, L]) => {
921
+ /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "6px" }, children: Object.entries(l.metadata).map(([y, B]) => {
922
922
  var W;
923
923
  return /* @__PURE__ */ i("label", { style: { ...Le, gap: "4px" }, children: [
924
- /* @__PURE__ */ t("span", { style: { ...Be, minWidth: "56px" }, children: L }),
924
+ /* @__PURE__ */ t("span", { style: { ...Be, minWidth: "56px" }, children: B }),
925
925
  /* @__PURE__ */ t(
926
926
  "input",
927
927
  {
928
928
  type: "text",
929
- value: ((W = y.metadata) == null ? void 0 : W[m]) || "",
930
- onChange: ($) => S(v, m, $.target.value),
931
- placeholder: L,
929
+ value: ((W = m.metadata) == null ? void 0 : W[y]) || "",
930
+ onChange: (E) => S(v, y, E.target.value),
931
+ placeholder: B,
932
932
  style: { ...ge, flex: 1 }
933
933
  }
934
934
  )
935
- ] }, m);
935
+ ] }, y);
936
936
  }) })
937
937
  ] })
938
938
  ] })
@@ -1102,7 +1102,7 @@ const qt = ({
1102
1102
  onNavigate: o,
1103
1103
  renderLink: r
1104
1104
  }) => {
1105
- const a = H(), l = ae(() => $n(e || []), [e]), c = {
1105
+ const a = H(), l = ce(() => $n(e || []), [e]), c = {
1106
1106
  text: a.resourceType.text,
1107
1107
  image: a.resourceType.image,
1108
1108
  "text+image": a.resourceType.textImage,
@@ -1164,13 +1164,13 @@ const qt = ({
1164
1164
  background: o.bg,
1165
1165
  color: o.fg
1166
1166
  }, children: o.label }) : /* @__PURE__ */ t("span", { children: e });
1167
- }, Pn = (e, n, o, r) => {
1167
+ }, An = (e, n, o, r) => {
1168
1168
  if (e === "check_type" && typeof n == "string") return /* @__PURE__ */ t(Zt, { value: n });
1169
1169
  if (e === "has_translation") return n ? o.misc.hasTranslation : o.misc.noTranslation;
1170
1170
  const a = String(n);
1171
1171
  return r ? r(a) : a;
1172
1172
  };
1173
- function An(e, n) {
1173
+ function Pn(e, n) {
1174
1174
  try {
1175
1175
  if (new URL(e).hostname.includes("wikimedia.org")) {
1176
1176
  const a = e.match(/\/wiki\/File:(.+?)(?:#|$)/);
@@ -1201,7 +1201,7 @@ const On = {
1201
1201
  color: { label: "", bg: "#fff8e1", fg: "#f57f17" }
1202
1202
  }, ft = ({ item: e, onNavigate: n, renderLink: o }) => {
1203
1203
  var S;
1204
- const r = H(), { convert: a } = K(), l = de(), [c, s] = w(!1), d = ae(() => (e.url ? Wn(e.url) : void 0) || a(e.name), [e.url, e.name, a]), u = ae(() => !e.volumes || e.volumes.length === 0 ? null : e.volumes.map((h) => ({
1204
+ const r = H(), { convert: a } = Y(), l = de(), [c, s] = w(!1), d = ce(() => (e.url ? Wn(e.url) : void 0) || a(e.name), [e.url, e.name, a]), u = ce(() => !e.volumes || e.volumes.length === 0 ? null : e.volumes.map((h) => ({
1205
1205
  ...h,
1206
1206
  url: h.url || Hn(h)
1207
1207
  })), [e.volumes]), g = u && u.length > 0, f = g ? new Set(u.filter((h) => h.status !== "missing").map((h) => h.volume)).size : 0, x = g ? new Set(u.filter((h) => h.status === "missing").map((h) => h.volume)).size : 0, p = e.expected_volumes ?? (g ? f + x : 0), b = e.color_mode ? {
@@ -1253,7 +1253,7 @@ const On = {
1253
1253
  {
1254
1254
  href: (() => {
1255
1255
  const h = Mn(e.metadata);
1256
- return h ? An(e.url, h) : e.url;
1256
+ return h ? Pn(e.url, h) : e.url;
1257
1257
  })(),
1258
1258
  target: "_blank",
1259
1259
  rel: "noopener noreferrer",
@@ -1285,7 +1285,7 @@ const On = {
1285
1285
  e.metadata && Object.entries(e.metadata).filter(([h]) => h !== "check_type").map(([h, z]) => /* @__PURE__ */ i("span", { children: [
1286
1286
  r.metadata[h] || h,
1287
1287
  ": ",
1288
- Pn(h, z, r, a)
1288
+ An(h, z, r, a)
1289
1289
  ] }, h)),
1290
1290
  e.details && !g && /* @__PURE__ */ t("span", { children: a(e.details) }),
1291
1291
  e.structure && /* @__PURE__ */ i("span", { children: [
@@ -1306,12 +1306,12 @@ const On = {
1306
1306
  if (h) {
1307
1307
  let v = null;
1308
1308
  for (const k of u) {
1309
- const T = k.group || "";
1310
- (!v || v.title !== T) && (v = { title: T, group_id: k.group_id, vols: [] }, z.push(v)), v.vols.push(k);
1309
+ const I = k.group || "";
1310
+ (!v || v.title !== I) && (v = { title: I, group_id: k.group_id, vols: [] }, z.push(v)), v.vols.push(k);
1311
1311
  }
1312
1312
  } else
1313
1313
  z.push({ vols: u });
1314
- const y = (v) => {
1314
+ const m = (v) => {
1315
1315
  const k = v.status === "missing";
1316
1316
  return v.url && !k ? /* @__PURE__ */ t(
1317
1317
  "a",
@@ -1353,14 +1353,14 @@ const On = {
1353
1353
  flexDirection: "column",
1354
1354
  gap: "8px"
1355
1355
  }, children: z.map((v, k) => {
1356
- const T = v.title ? a(v.title) : "";
1357
- let _ = T;
1358
- return v.title && v.group_id && (o ? _ = o(v.group_id, T) : n && (_ = /* @__PURE__ */ t(
1356
+ const I = v.title ? a(v.title) : "";
1357
+ let _ = I;
1358
+ return v.title && v.group_id && (o ? _ = o(v.group_id, I) : n && (_ = /* @__PURE__ */ t(
1359
1359
  "a",
1360
1360
  {
1361
1361
  href: l(v.group_id),
1362
- onClick: (m) => {
1363
- m.metaKey || m.ctrlKey || (m.preventDefault(), n(v.group_id));
1362
+ onClick: (y) => {
1363
+ y.metaKey || y.ctrlKey || (y.preventDefault(), n(v.group_id));
1364
1364
  },
1365
1365
  style: {
1366
1366
  color: "var(--bim-link-fg, #0066cc)",
@@ -1368,9 +1368,9 @@ const On = {
1368
1368
  textDecoration: "none",
1369
1369
  borderBottom: "1px dashed var(--bim-link-fg, #0066cc)"
1370
1370
  },
1371
- onMouseEnter: (m) => m.currentTarget.style.borderBottomStyle = "solid",
1372
- onMouseLeave: (m) => m.currentTarget.style.borderBottomStyle = "dashed",
1373
- children: T
1371
+ onMouseEnter: (y) => y.currentTarget.style.borderBottomStyle = "solid",
1372
+ onMouseLeave: (y) => y.currentTarget.style.borderBottomStyle = "dashed",
1373
+ children: I
1374
1374
  }
1375
1375
  ))), /* @__PURE__ */ i("div", { children: [
1376
1376
  v.title && /* @__PURE__ */ i("div", { style: {
@@ -1386,7 +1386,7 @@ const On = {
1386
1386
  ")"
1387
1387
  ] })
1388
1388
  ] }),
1389
- /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: v.vols.map(y) })
1389
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: v.vols.map(m) })
1390
1390
  ] }, k);
1391
1391
  }) });
1392
1392
  })()
@@ -1563,96 +1563,91 @@ const Vn = ({
1563
1563
  book: c.indexType.book,
1564
1564
  collection: c.indexType.collection,
1565
1565
  entity: c.indexType.entity
1566
- }, [u, g] = w(!1), [f, x] = w([]), [p, b] = w(-1), [S, h] = w(null), [z, y] = w($e), v = Q(null), k = Q(null), T = Q(null);
1567
- P(() => {
1568
- if (!e.getAllEntries) return;
1569
- let I = !1;
1570
- return e.getAllEntries().then((E) => {
1571
- I || h(E);
1566
+ }, [u, g] = w(!1), [f, x] = w([]), [p, b] = w(-1), [S, h] = w(null), [z, m] = w($e), v = Q(null), k = Q(null), I = Q(null), _ = Q(!1), y = F(() => {
1567
+ _.current || !e.getAllEntries || (_.current = !0, e.getAllEntries().then((T) => {
1568
+ h(T);
1572
1569
  }).catch(() => {
1573
- }), () => {
1574
- I = !0;
1575
- };
1576
- }, [e]);
1577
- const _ = U((I) => {
1578
- if (!I.trim())
1579
- return z.map((C) => ({ type: "history", text: C }));
1570
+ _.current = !1;
1571
+ }));
1572
+ }, [e]), B = F((T) => {
1573
+ if (!T.trim())
1574
+ return z.map((P) => ({ type: "history", text: P }));
1580
1575
  if (!S) return [];
1581
- const E = I.toLowerCase(), O = [], N = [];
1582
- for (const C of S) {
1583
- if (O.length + N.length >= ht * 2) break;
1584
- const B = (C.title ?? "").toLowerCase();
1585
- if (B.startsWith(E))
1586
- O.push({ type: "entry", text: C.title, entry: C });
1587
- else if (B.includes(E))
1588
- N.push({ type: "entry", text: C.title, entry: C });
1576
+ const D = T.toLowerCase(), C = [], R = [];
1577
+ for (const P of S) {
1578
+ if (C.length + R.length >= ht * 2) break;
1579
+ const J = (P.title ?? "").toLowerCase();
1580
+ if (J.startsWith(D))
1581
+ C.push({ type: "entry", text: P.title, entry: P });
1582
+ else if (J.includes(D))
1583
+ R.push({ type: "entry", text: P.title, entry: P });
1589
1584
  else {
1590
- const Y = [...C.additional_titles || [], ...C.attached_texts || []];
1591
- for (const G of Y) {
1592
- const F = typeof G == "string" ? G : G == null ? void 0 : G.book_title;
1593
- if (F != null && F.toLowerCase().includes(E)) {
1594
- O.push({ type: "entry", text: `${C.title}`, entry: C });
1585
+ const V = [...P.additional_titles || [], ...P.attached_texts || []];
1586
+ for (const ee of V) {
1587
+ const te = typeof ee == "string" ? ee : ee == null ? void 0 : ee.book_title;
1588
+ if (te != null && te.toLowerCase().includes(D)) {
1589
+ C.push({ type: "entry", text: `${P.title}`, entry: P });
1595
1590
  break;
1596
1591
  }
1597
1592
  }
1598
1593
  }
1599
1594
  }
1600
- return [...O, ...N].slice(0, ht);
1595
+ return [...C, ...R].slice(0, ht);
1601
1596
  }, [S, z]);
1602
- P(() => {
1603
- x(_(n)), b(-1);
1604
- }, [n, _]), P(() => {
1605
- const I = (E) => {
1606
- T.current && !T.current.contains(E.target) && g(!1);
1597
+ $(() => {
1598
+ x(B(n)), b(-1);
1599
+ }, [n, B]), $(() => {
1600
+ const T = (D) => {
1601
+ I.current && !I.current.contains(D.target) && g(!1);
1607
1602
  };
1608
- return document.addEventListener("mousedown", I), () => document.removeEventListener("mousedown", I);
1609
- }, []), P(() => {
1610
- const I = (E) => {
1611
- var O, N;
1612
- if (E.key === "/" && document.activeElement !== v.current) {
1613
- const C = (O = document.activeElement) == null ? void 0 : O.tagName;
1614
- if (C === "INPUT" || C === "TEXTAREA" || C === "SELECT") return;
1615
- E.preventDefault(), (N = v.current) == null || N.focus();
1603
+ return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
1604
+ }, []), $(() => {
1605
+ const T = (D) => {
1606
+ var C, R;
1607
+ if (D.key === "/" && document.activeElement !== v.current) {
1608
+ const P = (C = document.activeElement) == null ? void 0 : C.tagName;
1609
+ if (P === "INPUT" || P === "TEXTAREA" || P === "SELECT") return;
1610
+ D.preventDefault(), (R = v.current) == null || R.focus();
1616
1611
  }
1617
1612
  };
1618
- return document.addEventListener("keydown", I), () => document.removeEventListener("keydown", I);
1613
+ return document.addEventListener("keydown", T), () => document.removeEventListener("keydown", T);
1619
1614
  }, []);
1620
- const m = U((I) => {
1621
- I.trim() && (jn(I.trim()), y($e())), r(I), g(!1);
1622
- }, [r]), L = U((I) => {
1623
- I.type === "history" ? (o(I.text), m(I.text)) : I.entry && (a ? (a(I.entry), g(!1)) : (o(I.text), m(I.text)));
1624
- }, [o, m, a]), W = U((I) => {
1615
+ const W = F((T) => {
1616
+ T.trim() && (jn(T.trim()), m($e())), r(T), g(!1);
1617
+ }, [r]), E = F((T) => {
1618
+ T.type === "history" ? (o(T.text), W(T.text)) : T.entry && (a ? (a(T.entry), g(!1)) : (o(T.text), W(T.text)));
1619
+ }, [o, W, a]), O = F((T) => {
1625
1620
  if (!u || f.length === 0) {
1626
- I.key === "Enter" && m(n);
1621
+ T.key === "Enter" && W(n);
1627
1622
  return;
1628
1623
  }
1629
- switch (I.key) {
1624
+ switch (T.key) {
1630
1625
  case "ArrowDown":
1631
- I.preventDefault(), b((E) => (E + 1) % f.length);
1626
+ T.preventDefault(), b((D) => (D + 1) % f.length);
1632
1627
  break;
1633
1628
  case "ArrowUp":
1634
- I.preventDefault(), b((E) => (E - 1 + f.length) % f.length);
1629
+ T.preventDefault(), b((D) => (D - 1 + f.length) % f.length);
1635
1630
  break;
1636
1631
  case "Enter":
1637
- I.preventDefault(), p >= 0 && p < f.length ? L(f[p]) : m(n);
1632
+ T.preventDefault(), p >= 0 && p < f.length ? E(f[p]) : W(n);
1638
1633
  break;
1639
1634
  case "Escape":
1640
- I.preventDefault(), g(!1);
1635
+ T.preventDefault(), g(!1);
1641
1636
  break;
1642
1637
  }
1643
- }, [u, f, p, n, m, L]), $ = U((I, E) => {
1644
- E.stopPropagation(), Fn(I), y($e()), x((O) => O.filter((N) => !(N.type === "history" && N.text === I)));
1645
- }, []), D = U((I) => {
1646
- I.stopPropagation(), Un(), y([]), x([]);
1638
+ }, [u, f, p, n, W, E]), A = F((T, D) => {
1639
+ D.stopPropagation(), Fn(T), m($e()), x((C) => C.filter((R) => !(R.type === "history" && R.text === T)));
1640
+ }, []), N = F((T) => {
1641
+ T.stopPropagation(), Un(), m([]), x([]);
1647
1642
  }, []);
1648
- P(() => {
1643
+ $(() => {
1649
1644
  if (p >= 0 && k.current) {
1650
- const I = k.current.children;
1651
- I[p] && I[p].scrollIntoView({ block: "nearest" });
1645
+ const T = k.current.children;
1646
+ T[p] && T[p].scrollIntoView({ block: "nearest" });
1652
1647
  }
1653
1648
  }, [p]);
1654
- const A = !n.trim() && z.length > 0;
1655
- return /* @__PURE__ */ i("div", { ref: T, style: { position: "relative", flex: 1 }, children: [
1649
+ const U = !n.trim() && z.length > 0;
1650
+ return /* @__PURE__ */ i("div", { ref: I, style: { position: "relative", flex: 1 }, children: [
1656
1651
  /* @__PURE__ */ t(
1657
1652
  "input",
1658
1653
  {
@@ -1660,11 +1655,13 @@ const Vn = ({
1660
1655
  type: "text",
1661
1656
  placeholder: s,
1662
1657
  value: n,
1663
- onChange: (I) => {
1664
- o(I.target.value), g(!0);
1658
+ onChange: (T) => {
1659
+ o(T.target.value), g(!0), y();
1660
+ },
1661
+ onFocus: () => {
1662
+ g(!0), y();
1665
1663
  },
1666
- onFocus: () => g(!0),
1667
- onKeyDown: W,
1664
+ onKeyDown: O,
1668
1665
  style: {
1669
1666
  width: "100%",
1670
1667
  padding: "8px 12px",
@@ -1696,7 +1693,7 @@ const Vn = ({
1696
1693
  overflow: "auto"
1697
1694
  },
1698
1695
  children: [
1699
- A && /* @__PURE__ */ i("div", { style: {
1696
+ U && /* @__PURE__ */ i("div", { style: {
1700
1697
  display: "flex",
1701
1698
  justifyContent: "space-between",
1702
1699
  alignItems: "center",
@@ -1709,7 +1706,7 @@ const Vn = ({
1709
1706
  /* @__PURE__ */ t(
1710
1707
  "button",
1711
1708
  {
1712
- onClick: D,
1709
+ onClick: N,
1713
1710
  style: {
1714
1711
  border: "none",
1715
1712
  background: "transparent",
@@ -1722,10 +1719,10 @@ const Vn = ({
1722
1719
  }
1723
1720
  )
1724
1721
  ] }),
1725
- f.map((I, E) => /* @__PURE__ */ i(
1722
+ f.map((T, D) => /* @__PURE__ */ i(
1726
1723
  "div",
1727
1724
  {
1728
- onClick: () => L(I),
1725
+ onClick: () => E(T),
1729
1726
  style: {
1730
1727
  display: "flex",
1731
1728
  alignItems: "center",
@@ -1734,20 +1731,20 @@ const Vn = ({
1734
1731
  cursor: "pointer",
1735
1732
  fontSize: "13px",
1736
1733
  color: "var(--bim-fg, #333)",
1737
- background: E === p ? "var(--bim-list-active-bg, #e8f0fe)" : "transparent"
1734
+ background: D === p ? "var(--bim-list-active-bg, #e8f0fe)" : "transparent"
1738
1735
  },
1739
1736
  children: [
1740
- /* @__PURE__ */ t("span", { style: { fontSize: "12px", opacity: 0.5, width: "16px", textAlign: "center" }, children: I.type === "history" ? "🕐" : "🔍" }),
1741
- /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: I.text }),
1742
- I.entry && /* @__PURE__ */ i("span", { style: { fontSize: "11px", color: "var(--bim-desc-fg, #717171)", flexShrink: 0 }, children: [
1743
- d[I.entry.type],
1744
- I.entry.edition && ` · ${I.entry.edition}`,
1745
- I.entry.author && ` · ${I.entry.author}`
1737
+ /* @__PURE__ */ t("span", { style: { fontSize: "12px", opacity: 0.5, width: "16px", textAlign: "center" }, children: T.type === "history" ? "🕐" : "🔍" }),
1738
+ /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: T.text }),
1739
+ T.entry && /* @__PURE__ */ i("span", { style: { fontSize: "11px", color: "var(--bim-desc-fg, #717171)", flexShrink: 0 }, children: [
1740
+ d[T.entry.type],
1741
+ T.entry.edition && ` · ${T.entry.edition}`,
1742
+ T.entry.author && ` · ${T.entry.author}`
1746
1743
  ] }),
1747
- I.type === "history" && /* @__PURE__ */ t(
1744
+ T.type === "history" && /* @__PURE__ */ t(
1748
1745
  "button",
1749
1746
  {
1750
- onClick: (O) => $(I.text, O),
1747
+ onClick: (C) => A(T.text, C),
1751
1748
  style: {
1752
1749
  border: "none",
1753
1750
  background: "transparent",
@@ -1763,14 +1760,14 @@ const Vn = ({
1763
1760
  )
1764
1761
  ]
1765
1762
  },
1766
- `${I.type}-${I.text}-${E}`
1763
+ `${T.type}-${T.text}-${D}`
1767
1764
  ))
1768
1765
  ]
1769
1766
  }
1770
1767
  )
1771
1768
  ] });
1772
1769
  }, Me = "bim-recent-ids", xt = "bim-recent-entries", bt = 50, Xe = 5, Nn = 50, Kn = 200;
1773
- function Pe() {
1770
+ function Ae() {
1774
1771
  try {
1775
1772
  const e = localStorage.getItem(Me);
1776
1773
  if (e) return JSON.parse(e);
@@ -1786,14 +1783,14 @@ function Pe() {
1786
1783
  }
1787
1784
  function Yn(e) {
1788
1785
  try {
1789
- const n = Pe().filter((o) => o !== e);
1786
+ const n = Ae().filter((o) => o !== e);
1790
1787
  n.unshift(e), n.length > bt && (n.length = bt), localStorage.setItem(Me, JSON.stringify(n));
1791
1788
  } catch {
1792
1789
  }
1793
1790
  }
1794
1791
  function Gn(e) {
1795
1792
  try {
1796
- const n = Pe().filter((o) => o !== e);
1793
+ const n = Ae().filter((o) => o !== e);
1797
1794
  localStorage.setItem(Me, JSON.stringify(n));
1798
1795
  } catch {
1799
1796
  }
@@ -1829,21 +1826,21 @@ const qn = {
1829
1826
  { type: "book", icon: "📖", name: p.indexType.book, key: "books" },
1830
1827
  { type: "collection", icon: "📚", name: p.indexType.collection, key: "collections" },
1831
1828
  { type: "entity", icon: "👤", name: p.indexType.entity, key: "entities" }
1832
- ], [S, h] = w(g ?? ""), [z, y] = w(null), [v, k] = w(null), [T, _] = w(!1), [m, L] = w(null), [W, $] = w(""), [D, A] = w(!g), [I, E] = w(Pe), [O, N] = w([]), [C, B] = w(!1), [Y, G] = w(!1), [F, ce] = w(null), [oe, pe] = w(null), ve = Q(void 0), ye = Q(!1), ee = U(async (M, Z) => {
1829
+ ], [S, h] = w(g ?? ""), [z, m] = w(null), [v, k] = w(null), [I, _] = w(!1), [y, B] = w(null), [W, E] = w(""), [O, A] = w(!g), [N, U] = w(Ae), [T, D] = w([]), [C, R] = w(!1), [P, J] = w(!1), [V, ee] = w(null), [te, pe] = w(null), ve = Q(void 0), ye = Q(!1), ne = F(async (M, Z) => {
1833
1830
  if (!M.trim()) {
1834
- A(!0), y(null), k(null);
1831
+ A(!0), m(null), k(null);
1835
1832
  return;
1836
1833
  }
1837
- A(!1), _(!0), $("");
1834
+ A(!1), _(!0), E("");
1838
1835
  try {
1839
1836
  if (e.searchAll) {
1840
- const J = await e.searchAll(M, Z ?? Xe);
1841
- y(J);
1837
+ const G = await e.searchAll(M, Z ?? Xe);
1838
+ m(G);
1842
1839
  } else {
1843
- const J = ["work", "book", "collection", "entity"], q = await Promise.all(
1844
- J.map((te) => e.search(M, te, { page: 1, pageSize: Z ?? Xe }))
1840
+ const G = ["work", "book", "collection", "entity"], q = await Promise.all(
1841
+ G.map((oe) => e.search(M, oe, { page: 1, pageSize: Z ?? Xe }))
1845
1842
  );
1846
- y({
1843
+ m({
1847
1844
  works: q[0].entries,
1848
1845
  books: q[1].entries,
1849
1846
  collections: q[2].entries,
@@ -1854,21 +1851,21 @@ const qn = {
1854
1851
  totalEntities: q[3].total
1855
1852
  });
1856
1853
  }
1857
- } catch (J) {
1858
- $(J instanceof Error ? J.message : String(J)), y(null);
1854
+ } catch (G) {
1855
+ E(G instanceof Error ? G.message : String(G)), m(null);
1859
1856
  } finally {
1860
1857
  _(!1);
1861
1858
  }
1862
1859
  }, [e]);
1863
- P(() => {
1860
+ $(() => {
1864
1861
  let M = !1;
1865
1862
  const Z = () => {
1866
- var V, re;
1867
- const J = ["work", "book", "collection", "entity"], q = Promise.all(
1868
- J.map((ue) => e.loadEntries(ue, { page: 1, pageSize: 1 }).catch(() => ({ total: 0 })))
1869
- ), te = ((V = e.getResourceCounts) == null ? void 0 : V.call(e).catch(() => null)) ?? Promise.resolve(null), R = ((re = e.getSubtypeStats) == null ? void 0 : re.call(e).catch(() => null)) ?? Promise.resolve(null);
1870
- Promise.all([q, te, R]).then(([ue, fe, ct]) => {
1871
- M || (ce({
1863
+ var K, ie;
1864
+ const G = ["work", "book", "collection", "entity"], q = Promise.all(
1865
+ G.map((ue) => e.loadEntries(ue, { page: 1, pageSize: 1 }).catch(() => ({ total: 0 })))
1866
+ ), oe = ((K = e.getResourceCounts) == null ? void 0 : K.call(e).catch(() => null)) ?? Promise.resolve(null), L = ((ie = e.getSubtypeStats) == null ? void 0 : ie.call(e).catch(() => null)) ?? Promise.resolve(null);
1867
+ Promise.all([q, oe, L]).then(([ue, fe, ct]) => {
1868
+ M || (ee({
1872
1869
  works: ue[0].total,
1873
1870
  books: ue[1].total,
1874
1871
  collections: ue[2].total,
@@ -1878,62 +1875,62 @@ const qn = {
1878
1875
  }), ct && pe(ct));
1879
1876
  });
1880
1877
  };
1881
- return e.getCounts ? e.getCounts().then((J) => {
1882
- var q, te;
1883
- M || (ce({
1884
- works: J.works,
1885
- books: J.books,
1886
- collections: J.collections,
1887
- entities: J.entities,
1888
- hasText: (q = J.resourceCounts) == null ? void 0 : q.hasText,
1889
- hasImage: (te = J.resourceCounts) == null ? void 0 : te.hasImage
1890
- }), J.subtypeStats && pe(J.subtypeStats));
1878
+ return e.getCounts ? e.getCounts().then((G) => {
1879
+ var q, oe;
1880
+ M || (ee({
1881
+ works: G.works,
1882
+ books: G.books,
1883
+ collections: G.collections,
1884
+ entities: G.entities,
1885
+ hasText: (q = G.resourceCounts) == null ? void 0 : q.hasText,
1886
+ hasImage: (oe = G.resourceCounts) == null ? void 0 : oe.hasImage
1887
+ }), G.subtypeStats && pe(G.subtypeStats));
1891
1888
  }).catch(() => {
1892
1889
  M || Z();
1893
1890
  }) : Z(), () => {
1894
1891
  M = !0;
1895
1892
  };
1896
- }, [e]), P(() => {
1897
- ye.current || !(g != null && g.trim()) || (ye.current = !0, ee(g));
1898
- }, [g, ee]);
1899
- const X = U((M) => {
1893
+ }, [e]), $(() => {
1894
+ ye.current || !(g != null && g.trim()) || (ye.current = !0, ne(g));
1895
+ }, [g, ne]);
1896
+ const X = F((M) => {
1900
1897
  if (h(M), f == null || f(M), !M.trim()) {
1901
- A(!0), y(null), k(null);
1898
+ A(!0), m(null), k(null);
1902
1899
  return;
1903
1900
  }
1904
1901
  ve.current && clearTimeout(ve.current), ve.current = setTimeout(() => {
1905
- k(null), ee(M);
1902
+ k(null), ne(M);
1906
1903
  }, Kn);
1907
- }, [ee, f]), Ge = U((M) => {
1908
- ve.current && clearTimeout(ve.current), f == null || f(M), ee(M);
1909
- }, [ee, f]), Je = U((M) => {
1910
- k(M), ee(S, Nn);
1911
- }, [S, ee]);
1912
- P(() => {
1913
- if (!I.length) {
1914
- N([]);
1904
+ }, [ne, f]), Ge = F((M) => {
1905
+ ve.current && clearTimeout(ve.current), f == null || f(M), ne(M);
1906
+ }, [ne, f]), Je = F((M) => {
1907
+ k(M), ne(S, Nn);
1908
+ }, [S, ne]);
1909
+ $(() => {
1910
+ if (!N.length) {
1911
+ D([]);
1915
1912
  return;
1916
1913
  }
1917
1914
  let M = !1;
1918
- return B(!0), Promise.all(
1919
- I.slice(0, 10).map(async (Z) => {
1920
- var J, q, te;
1915
+ return R(!0), Promise.all(
1916
+ N.slice(0, 10).map(async (Z) => {
1917
+ var G, q, oe;
1921
1918
  try {
1922
1919
  if (e.getEntry) {
1923
- const V = await e.getEntry(Z);
1924
- if (V) return V;
1920
+ const K = await e.getEntry(Z);
1921
+ if (K) return K;
1925
1922
  }
1926
- const R = await e.getItem(Z);
1927
- if (R) {
1928
- const V = R.authors;
1923
+ const L = await e.getItem(Z);
1924
+ if (L) {
1925
+ const K = L.authors;
1929
1926
  return {
1930
1927
  id: Z,
1931
- title: R.title || Z,
1932
- type: R.type || "work",
1933
- author: (J = V == null ? void 0 : V[0]) == null ? void 0 : J.name,
1934
- dynasty: (q = V == null ? void 0 : V[0]) == null ? void 0 : q.dynasty,
1935
- role: (te = V == null ? void 0 : V[0]) == null ? void 0 : te.role,
1936
- edition: R.edition || void 0
1928
+ title: L.title || Z,
1929
+ type: L.type || "work",
1930
+ author: (G = K == null ? void 0 : K[0]) == null ? void 0 : G.name,
1931
+ dynasty: (q = K == null ? void 0 : K[0]) == null ? void 0 : q.dynasty,
1932
+ role: (oe = K == null ? void 0 : K[0]) == null ? void 0 : oe.role,
1933
+ edition: L.edition || void 0
1937
1934
  };
1938
1935
  }
1939
1936
  } catch {
@@ -1941,17 +1938,17 @@ const qn = {
1941
1938
  return { id: Z, title: Z, type: "work", notFound: !0 };
1942
1939
  })
1943
1940
  ).then((Z) => {
1944
- M || (N(Z), B(!1));
1941
+ M || (D(Z), R(!1));
1945
1942
  }), () => {
1946
1943
  M = !0;
1947
1944
  };
1948
- }, [I, e]);
1945
+ }, [N, e]);
1949
1946
  const Te = (M) => {
1950
- L(M.id), Yn(M.id), E(Pe()), r == null || r(M);
1947
+ B(M.id), Yn(M.id), U(Ae()), r == null || r(M);
1951
1948
  }, Re = (M) => {
1952
- Gn(M), E(Pe());
1949
+ Gn(M), U(Ae());
1953
1950
  }, qe = () => {
1954
- Jn(), E([]);
1951
+ Jn(), U([]);
1955
1952
  }, He = (M) => b.find((Z) => Z.type === M), Ze = z && (z.works.length > 0 || z.books.length > 0 || z.collections.length > 0);
1956
1953
  return /* @__PURE__ */ i("div", { className: "bim-browser-container", children: [
1957
1954
  /* @__PURE__ */ t("header", { style: { padding: "12px 20px", borderBottom: "1px solid var(--bim-widget-border, #e0e0e0)" }, children: /* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
@@ -2000,7 +1997,7 @@ const qn = {
2000
1997
  }
2001
1998
  )
2002
1999
  ] }),
2003
- F && D && /* @__PURE__ */ i("div", { style: {
2000
+ V && O && /* @__PURE__ */ i("div", { style: {
2004
2001
  padding: "0 20px 8px",
2005
2002
  fontSize: "12px",
2006
2003
  color: "var(--bim-desc-fg, #999)",
@@ -2009,64 +2006,64 @@ const qn = {
2009
2006
  flexWrap: "wrap",
2010
2007
  gap: "4px"
2011
2008
  }, children: [
2012
- /* @__PURE__ */ t("span", { children: oe ? /* @__PURE__ */ i(j, { children: [
2013
- (oe.book ?? 0) > 0 && /* @__PURE__ */ i(j, { children: [
2009
+ /* @__PURE__ */ t("span", { children: te ? /* @__PURE__ */ i(j, { children: [
2010
+ (te.book ?? 0) > 0 && /* @__PURE__ */ i(j, { children: [
2014
2011
  "書 ",
2015
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: oe.book.toLocaleString() }),
2012
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: te.book.toLocaleString() }),
2016
2013
  " 部 ,",
2017
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: F.books.toLocaleString() }),
2014
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.books.toLocaleString() }),
2018
2015
  " 本"
2019
2016
  ] }),
2020
- oe.article ? /* @__PURE__ */ i(j, { children: [
2017
+ te.article ? /* @__PURE__ */ i(j, { children: [
2021
2018
  /* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
2022
2019
  "文章 ",
2023
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: oe.article.toLocaleString() }),
2020
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: te.article.toLocaleString() }),
2024
2021
  " 篇"
2025
2022
  ] }) : null,
2026
- oe.poem ? /* @__PURE__ */ i(j, { children: [
2023
+ te.poem ? /* @__PURE__ */ i(j, { children: [
2027
2024
  /* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
2028
2025
  "詩詞 ",
2029
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: oe.poem.toLocaleString() }),
2026
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: te.poem.toLocaleString() }),
2030
2027
  " 首"
2031
2028
  ] }) : null,
2032
2029
  /* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
2033
2030
  "叢編 ",
2034
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: F.collections.toLocaleString() })
2031
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.collections.toLocaleString() })
2035
2032
  ] }) : /* @__PURE__ */ i(j, { children: [
2036
2033
  p.indexType.work,
2037
2034
  " ",
2038
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: F.works.toLocaleString() }),
2035
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.works.toLocaleString() }),
2039
2036
  /* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
2040
2037
  p.indexType.book,
2041
2038
  " ",
2042
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: F.books.toLocaleString() }),
2039
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.books.toLocaleString() }),
2043
2040
  /* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
2044
2041
  p.indexType.collection,
2045
2042
  " ",
2046
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: F.collections.toLocaleString() }),
2047
- F.entities > 0 && /* @__PURE__ */ i(j, { children: [
2043
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.collections.toLocaleString() }),
2044
+ V.entities > 0 && /* @__PURE__ */ i(j, { children: [
2048
2045
  /* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
2049
2046
  p.indexType.entity,
2050
2047
  " ",
2051
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: F.entities.toLocaleString() })
2048
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.entities.toLocaleString() })
2052
2049
  ] })
2053
2050
  ] }) }),
2054
- F.hasImage != null && F.hasText != null && /* @__PURE__ */ i("span", { children: [
2051
+ V.hasImage != null && V.hasText != null && /* @__PURE__ */ i("span", { children: [
2055
2052
  p.resourceType.image,
2056
2053
  " ",
2057
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: F.hasImage.toLocaleString() }),
2054
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.hasImage.toLocaleString() }),
2058
2055
  /* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
2059
2056
  p.resourceType.text,
2060
2057
  " ",
2061
- /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: F.hasText.toLocaleString() })
2058
+ /* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.hasText.toLocaleString() })
2062
2059
  ] })
2063
2060
  ] }),
2064
- /* @__PURE__ */ t("div", { style: { padding: "0 20px 20px", flex: 1, display: "flex", flexDirection: "column", overflow: "auto" }, children: T ? /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "40px", color: "var(--bim-desc-fg, #717171)" }, children: p.search.searching }) : W ? /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "40px" }, children: [
2061
+ /* @__PURE__ */ t("div", { style: { padding: "0 20px 20px", flex: 1, display: "flex", flexDirection: "column", overflow: "auto" }, children: I ? /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "40px", color: "var(--bim-desc-fg, #717171)" }, children: p.search.searching }) : W ? /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "40px" }, children: [
2065
2062
  /* @__PURE__ */ t("div", { style: { fontSize: "24px", marginBottom: "8px" }, children: "⚠️" }),
2066
2063
  /* @__PURE__ */ t("p", { style: { color: "var(--bim-desc-fg, #717171)" }, children: W })
2067
- ] }) : D ? (
2064
+ ] }) : O ? (
2068
2065
  /* Recent entries view */
2069
- /* @__PURE__ */ t("div", { style: { flex: 1 }, children: C ? /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "40px", color: "var(--bim-desc-fg, #717171)" }, children: p.search.loading }) : O.length > 0 ? /* @__PURE__ */ i(j, { children: [
2066
+ /* @__PURE__ */ t("div", { style: { flex: 1 }, children: C ? /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "40px", color: "var(--bim-desc-fg, #717171)" }, children: p.search.loading }) : T.length > 0 ? /* @__PURE__ */ i(j, { children: [
2070
2067
  /* @__PURE__ */ i("div", { style: { padding: "8px 0", fontSize: "12px", color: "var(--bim-desc-fg, #717171)", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
2071
2068
  /* @__PURE__ */ t("span", { children: p.search.recentBrowse }),
2072
2069
  /* @__PURE__ */ t(
@@ -2085,7 +2082,7 @@ const qn = {
2085
2082
  }
2086
2083
  )
2087
2084
  ] }),
2088
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: O.slice(0, Y ? 10 : 3).map((M) => M.notFound ? /* @__PURE__ */ t(
2085
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: T.slice(0, P ? 10 : 3).map((M) => M.notFound ? /* @__PURE__ */ t(
2089
2086
  Zn,
2090
2087
  {
2091
2088
  id: M.id,
@@ -2097,17 +2094,17 @@ const qn = {
2097
2094
  yt,
2098
2095
  {
2099
2096
  entry: M,
2100
- selected: m === M.id,
2097
+ selected: y === M.id,
2101
2098
  onClick: Te,
2102
2099
  getConfig: He,
2103
2100
  onRemove: Re
2104
2101
  },
2105
2102
  M.id
2106
2103
  )) }),
2107
- !Y && O.length > 3 && /* @__PURE__ */ t(
2104
+ !P && T.length > 3 && /* @__PURE__ */ t(
2108
2105
  "button",
2109
2106
  {
2110
- onClick: () => G(!0),
2107
+ onClick: () => J(!0),
2111
2108
  style: {
2112
2109
  display: "block",
2113
2110
  margin: "8px auto 0",
@@ -2129,10 +2126,10 @@ const qn = {
2129
2126
  ] }) })
2130
2127
  ) : Ze ? (
2131
2128
  /* Grouped search results */
2132
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: b.map(({ type: M, icon: Z, name: J, key: q }) => {
2133
- const te = z[q] ?? [], R = qn[q], V = z[R] ?? 0;
2134
- if (te.length === 0) return null;
2135
- const ue = !(v === M) && V > Xe;
2129
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: b.map(({ type: M, icon: Z, name: G, key: q }) => {
2130
+ const oe = z[q] ?? [], L = qn[q], K = z[L] ?? 0;
2131
+ if (oe.length === 0) return null;
2132
+ const ue = !(v === M) && K > Xe;
2136
2133
  return /* @__PURE__ */ i("div", { children: [
2137
2134
  /* @__PURE__ */ i("div", { style: {
2138
2135
  display: "flex",
@@ -2145,9 +2142,9 @@ const qn = {
2145
2142
  /* @__PURE__ */ i("span", { style: { fontSize: "13px", fontWeight: 600, color: "var(--bim-fg, #333)" }, children: [
2146
2143
  Z,
2147
2144
  " ",
2148
- J,
2145
+ G,
2149
2146
  /* @__PURE__ */ i("span", { style: { fontWeight: 400, color: "var(--bim-desc-fg, #717171)", marginLeft: "6px" }, children: [
2150
- V,
2147
+ K,
2151
2148
  " ",
2152
2149
  p.unit.items
2153
2150
  ] })
@@ -2167,11 +2164,11 @@ const qn = {
2167
2164
  }
2168
2165
  )
2169
2166
  ] }),
2170
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: te.map((fe) => /* @__PURE__ */ t(
2167
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: oe.map((fe) => /* @__PURE__ */ t(
2171
2168
  yt,
2172
2169
  {
2173
2170
  entry: fe,
2174
- selected: m === fe.id,
2171
+ selected: y === fe.id,
2175
2172
  onClick: Te,
2176
2173
  getConfig: He,
2177
2174
  query: S
@@ -2187,7 +2184,7 @@ const qn = {
2187
2184
  ] }) })
2188
2185
  ] });
2189
2186
  }, yt = ({ entry: e, selected: n, onClick: o, getConfig: r, query: a, onRemove: l }) => {
2190
- const c = H(), { convert: s } = K(), d = [...e.additional_titles || [], ...e.attached_texts || []], u = a && d.length ? d.find((g) => {
2187
+ const c = H(), { convert: s } = Y(), d = [...e.additional_titles || [], ...e.attached_texts || []], u = a && d.length ? d.find((g) => {
2191
2188
  const f = typeof g == "string" ? g : g == null ? void 0 : g.book_title;
2192
2189
  return f == null ? void 0 : f.toLowerCase().includes(a.toLowerCase());
2193
2190
  }) : void 0;
@@ -2314,7 +2311,7 @@ function Xn(e) {
2314
2311
  return !e.dynasty && !e.birth_year && !e.death_year && (!e.alt_names || e.alt_names.length === 0) && !((n = e.description) != null && n.text);
2315
2312
  }
2316
2313
  function Qn({ data: e }) {
2317
- const { convert: n } = K(), { dynasty: o, birth_year: r, death_year: a } = e, l = [];
2314
+ const { convert: n } = Y(), { dynasty: o, birth_year: r, death_year: a } = e, l = [];
2318
2315
  return o && l.push(`〔${n(o)}〕`), r !== void 0 && a !== void 0 ? l.push(`${r}—${a}`) : r !== void 0 ? l.push(`${r}—?`) : a !== void 0 && l.push(`?—${a}`), l.length === 0 ? null : /* @__PURE__ */ t("span", { style: {
2319
2316
  fontSize: "14px",
2320
2317
  color: "var(--bim-desc-fg, #717171)",
@@ -2323,7 +2320,7 @@ function Qn({ data: e }) {
2323
2320
  }, children: l.join(" ") });
2324
2321
  }
2325
2322
  function eo({ alt_names: e }) {
2326
- const { convert: n } = K(), o = /* @__PURE__ */ new Map();
2323
+ const { convert: n } = Y(), o = /* @__PURE__ */ new Map();
2327
2324
  for (const l of e) {
2328
2325
  const c = l.type || "別名";
2329
2326
  o.has(c) || o.set(c, []), o.get(c).push(l.name);
@@ -2411,8 +2408,8 @@ function to({ data: e }) {
2411
2408
  }, children: o });
2412
2409
  }
2413
2410
  function no({ works: e, transport: n, onNavigate: o, renderLink: r }) {
2414
- const a = H(), { convert: l } = K(), c = de(), [s, d] = w(/* @__PURE__ */ new Map());
2415
- P(() => {
2411
+ const a = H(), { convert: l } = Y(), c = de(), [s, d] = w(/* @__PURE__ */ new Map());
2412
+ $(() => {
2416
2413
  if (!n) return;
2417
2414
  let x = !1;
2418
2415
  const p = e.map((S) => S.work_id);
@@ -2422,9 +2419,9 @@ function no({ works: e, transport: n, onNavigate: o, renderLink: r }) {
2422
2419
  try {
2423
2420
  const v = await n.getEntriesByIds(p);
2424
2421
  let k = !0;
2425
- for (let T = 0; T < p.length; T++) {
2426
- const _ = v[T];
2427
- _ != null && _.title ? S.set(p[T], _.title) : _ != null && _.primary_name ? S.set(p[T], _.primary_name) : k = !1;
2422
+ for (let I = 0; I < p.length; I++) {
2423
+ const _ = v[I];
2424
+ _ != null && _.title ? S.set(p[I], _.title) : _ != null && _.primary_name ? S.set(p[I], _.primary_name) : k = !1;
2428
2425
  }
2429
2426
  if (k) return S;
2430
2427
  } catch {
@@ -2432,15 +2429,15 @@ function no({ works: e, transport: n, onNavigate: o, renderLink: r }) {
2432
2429
  if (n.getAllEntries)
2433
2430
  try {
2434
2431
  const v = await n.getAllEntries(), k = new Map(v.map((_) => [_.id, _.title || _.primary_name || _.id]));
2435
- let T = !0;
2432
+ let I = !0;
2436
2433
  for (const _ of p) {
2437
- const m = k.get(_);
2438
- m ? S.set(_, m) : T = !1;
2434
+ const y = k.get(_);
2435
+ y ? S.set(_, y) : I = !1;
2439
2436
  }
2440
- if (T) return S;
2437
+ if (I) return S;
2441
2438
  } catch {
2442
2439
  }
2443
- const h = [...p], z = 8, y = new Array(z).fill(0).map(async () => {
2440
+ const h = [...p], z = 8, m = new Array(z).fill(0).map(async () => {
2444
2441
  for (; h.length; ) {
2445
2442
  const v = h.shift();
2446
2443
  if (!v) break;
@@ -2453,14 +2450,14 @@ function no({ works: e, transport: n, onNavigate: o, renderLink: r }) {
2453
2450
  continue;
2454
2451
  }
2455
2452
  }
2456
- const k = await n.getItem(v), T = k && (k.title || k.primary_name) || v;
2457
- S.set(v, T);
2453
+ const k = await n.getItem(v), I = k && (k.title || k.primary_name) || v;
2454
+ S.set(v, I);
2458
2455
  } catch {
2459
2456
  S.set(v, v);
2460
2457
  }
2461
2458
  }
2462
2459
  });
2463
- return await Promise.all(y), S;
2460
+ return await Promise.all(m), S;
2464
2461
  })().then((S) => {
2465
2462
  x || d(S);
2466
2463
  }), () => {
@@ -2549,7 +2546,7 @@ const oo = ({
2549
2546
  headerExtra: a
2550
2547
  }) => {
2551
2548
  var g;
2552
- const l = H(), { convert: c } = K();
2549
+ const l = H(), { convert: c } = Y();
2553
2550
  let s = !1;
2554
2551
  try {
2555
2552
  s = Vt(e.id) === "draft";
@@ -2720,7 +2717,7 @@ function lo({ id: e }) {
2720
2717
  )
2721
2718
  ] });
2722
2719
  }
2723
- function ie({ children: e, extra: n }) {
2720
+ function le({ children: e, extra: n }) {
2724
2721
  return /* @__PURE__ */ i("div", { style: {
2725
2722
  display: "flex",
2726
2723
  alignItems: "center",
@@ -2745,7 +2742,7 @@ function xe({ label: e, children: n }) {
2745
2742
  ] });
2746
2743
  }
2747
2744
  function en({ authors: e, type: n, onNavigate: o, renderLink: r }) {
2748
- const { convert: a } = K();
2745
+ const { convert: a } = Y();
2749
2746
  return /* @__PURE__ */ t("span", { style: {
2750
2747
  fontSize: "14px",
2751
2748
  color: "var(--bim-fg, #333)",
@@ -2850,11 +2847,11 @@ function ao({ id: e, title: n, edition: o, type: r, isDraft: a, authors: l, volu
2850
2847
  ] });
2851
2848
  }
2852
2849
  function tn({ items: e, label: n, showMeta: o, onNavigate: r, renderLink: a }) {
2853
- const l = H(), { convert: c } = K();
2850
+ const l = H(), { convert: c } = Y();
2854
2851
  if (!e.length) return null;
2855
2852
  const [s, d] = w(null);
2856
2853
  return /* @__PURE__ */ i(j, { children: [
2857
- /* @__PURE__ */ t(ie, { children: n }),
2854
+ /* @__PURE__ */ t(le, { children: n }),
2858
2855
  /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: e.map((u, g) => {
2859
2856
  const f = s === g;
2860
2857
  return /* @__PURE__ */ i("div", { style: {
@@ -2999,9 +2996,9 @@ function so({ items: e, onNavigate: n, renderLink: o }) {
2999
2996
  return /* @__PURE__ */ t(tn, { items: e, label: r.section.emendated, onNavigate: n, renderLink: o });
3000
2997
  }
3001
2998
  function nn({ label: e, items: n }) {
3002
- const { convert: o } = K();
2999
+ const { convert: o } = Y();
3003
3000
  return n.length ? /* @__PURE__ */ i(j, { children: [
3004
- /* @__PURE__ */ t(ie, { children: e }),
3001
+ /* @__PURE__ */ t(le, { children: e }),
3005
3002
  /* @__PURE__ */ t("div", { style: {
3006
3003
  display: "flex",
3007
3004
  flexWrap: "wrap",
@@ -3031,9 +3028,9 @@ function uo({ items: e }) {
3031
3028
  return /* @__PURE__ */ t(nn, { label: n.section.attachedTexts, items: e });
3032
3029
  }
3033
3030
  function fo({ items: e }) {
3034
- const n = H(), { convert: o } = K();
3031
+ const n = H(), { convert: o } = Y();
3035
3032
  return e.length ? /* @__PURE__ */ i(j, { children: [
3036
- /* @__PURE__ */ t(ie, { children: n.section.appendix }),
3033
+ /* @__PURE__ */ t(le, { children: n.section.appendix }),
3037
3034
  /* @__PURE__ */ t("div", { style: {
3038
3035
  display: "flex",
3039
3036
  flexWrap: "wrap",
@@ -3060,9 +3057,9 @@ function fo({ items: e }) {
3060
3057
  ] }) : null;
3061
3058
  }
3062
3059
  function go({ items: e }) {
3063
- const n = H(), { convert: o } = K();
3060
+ const n = H(), { convert: o } = Y();
3064
3061
  return e.length ? /* @__PURE__ */ i(j, { children: [
3065
- /* @__PURE__ */ t(ie, { children: n.section.locationHistory }),
3062
+ /* @__PURE__ */ t(le, { children: n.section.locationHistory }),
3066
3063
  /* @__PURE__ */ i("div", { style: { position: "relative", paddingLeft: "18px" }, children: [
3067
3064
  /* @__PURE__ */ t("div", { style: {
3068
3065
  position: "absolute",
@@ -3090,9 +3087,9 @@ function go({ items: e }) {
3090
3087
  ] }) : null;
3091
3088
  }
3092
3089
  function ho({ items: e }) {
3093
- const n = H(), { convert: o } = K();
3090
+ const n = H(), { convert: o } = Y();
3094
3091
  return e.length ? /* @__PURE__ */ i(j, { children: [
3095
- /* @__PURE__ */ t(ie, { children: n.section.historyOverview }),
3092
+ /* @__PURE__ */ t(le, { children: n.section.historyOverview }),
3096
3093
  /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: e.map((r, a) => /* @__PURE__ */ i("div", { style: {
3097
3094
  fontSize: "13px",
3098
3095
  color: "var(--bim-fg, #333)",
@@ -3111,8 +3108,8 @@ function ho({ items: e }) {
3111
3108
  ] }) : null;
3112
3109
  }
3113
3110
  function kt({ title: e, ids: n, transport: o, onNavigate: r, renderLink: a }) {
3114
- const { convert: l } = K(), [c, s] = w([]);
3115
- return P(() => {
3111
+ const { convert: l } = Y(), [c, s] = w([]);
3112
+ return $(() => {
3116
3113
  if (!n.length) {
3117
3114
  s([]);
3118
3115
  return;
@@ -3137,7 +3134,7 @@ function kt({ title: e, ids: n, transport: o, onNavigate: r, renderLink: a }) {
3137
3134
  d = !0;
3138
3135
  };
3139
3136
  }, [n, o]), n.length ? /* @__PURE__ */ i(j, { children: [
3140
- /* @__PURE__ */ i(ie, { children: [
3137
+ /* @__PURE__ */ i(le, { children: [
3141
3138
  e,
3142
3139
  /* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #aaa)", fontWeight: 400 }, children: [
3143
3140
  "(",
@@ -3166,7 +3163,7 @@ function kt({ title: e, ids: n, transport: o, onNavigate: r, renderLink: a }) {
3166
3163
  ] }) : null;
3167
3164
  }
3168
3165
  function xo({ book: e, onNavigate: n, renderLink: o }) {
3169
- const r = H(), { convert: a } = K(), [l, c] = w(!1), s = e.resources && e.resources.length > 0, d = e.edition ? a(e.edition) : a(e.title) || void 0;
3166
+ const r = H(), { convert: a } = Y(), [l, c] = w(!1), s = e.resources && e.resources.length > 0, d = e.edition ? a(e.edition) : a(e.title) || void 0;
3170
3167
  return /* @__PURE__ */ i("div", { style: {
3171
3168
  border: "1px solid var(--bim-widget-border, #e0e0e0)",
3172
3169
  borderRadius: "6px",
@@ -3204,7 +3201,7 @@ function xo({ book: e, onNavigate: n, renderLink: o }) {
3204
3201
  }
3205
3202
  function bo({ ids: e, transport: n, onNavigate: o, renderLink: r }) {
3206
3203
  const a = H(), [l, c] = w([]);
3207
- return P(() => {
3204
+ return $(() => {
3208
3205
  if (!e.length) {
3209
3206
  c([]);
3210
3207
  return;
@@ -3229,7 +3226,7 @@ function bo({ ids: e, transport: n, onNavigate: o, renderLink: r }) {
3229
3226
  s = !0;
3230
3227
  };
3231
3228
  }, [e, n]), e.length ? /* @__PURE__ */ i(j, { children: [
3232
- /* @__PURE__ */ i(ie, { children: [
3229
+ /* @__PURE__ */ i(le, { children: [
3233
3230
  a.section.relatedVersions,
3234
3231
  /* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #aaa)", fontWeight: 400 }, children: [
3235
3232
  "(",
@@ -3242,7 +3239,7 @@ function bo({ ids: e, transport: n, onNavigate: o, renderLink: r }) {
3242
3239
  }
3243
3240
  function mo({ workData: e, onNavigate: n, renderLink: o }) {
3244
3241
  var l, c, s;
3245
- const r = H(), { convert: a } = K();
3242
+ const r = H(), { convert: a } = Y();
3246
3243
  return /* @__PURE__ */ i("div", { style: {
3247
3244
  border: "1px solid var(--bim-widget-border, #e0e0e0)",
3248
3245
  borderRadius: "8px",
@@ -3289,7 +3286,7 @@ function mo({ workData: e, onNavigate: n, renderLink: o }) {
3289
3286
  ] });
3290
3287
  }
3291
3288
  function yo({ items: e, onNavigate: n, renderLink: o }) {
3292
- const r = H(), { convert: a } = K();
3289
+ const r = H(), { convert: a } = Y();
3293
3290
  return e.length ? /* @__PURE__ */ t("div", { style: {
3294
3291
  display: "flex",
3295
3292
  flexWrap: "wrap",
@@ -3324,43 +3321,43 @@ const on = ({
3324
3321
  className: c,
3325
3322
  style: s
3326
3323
  }) => {
3327
- var D, A, I, E, O, N;
3328
- const d = H(), { convert: u } = K(), [g, f] = w(null), [x, p] = w(!1), [b, S] = w(null), [h, z] = w(null), [y, v] = w([]), k = e || g;
3329
- if (P(() => {
3324
+ var O, A, N, U, T, D;
3325
+ const d = H(), { convert: u } = Y(), [g, f] = w(null), [x, p] = w(!1), [b, S] = w(null), [h, z] = w(null), [m, v] = w([]), k = e || g;
3326
+ if ($(() => {
3330
3327
  if (e || !n || !o) return;
3331
3328
  let C = !1;
3332
- return p(!0), S(null), o.getItem(n).then((B) => {
3333
- C || (B ? f(B) : S(d.misc.notFoundEntry));
3334
- }).catch((B) => {
3335
- C || S(B instanceof Error ? B.message : d.misc.loadFailed);
3329
+ return p(!0), S(null), o.getItem(n).then((R) => {
3330
+ C || (R ? f(R) : S(d.misc.notFoundEntry));
3331
+ }).catch((R) => {
3332
+ C || S(R instanceof Error ? R.message : d.misc.loadFailed);
3336
3333
  }).finally(() => {
3337
3334
  C || p(!1);
3338
3335
  }), () => {
3339
3336
  C = !0;
3340
3337
  };
3341
- }, [e, n, o]), P(() => {
3338
+ }, [e, n, o]), $(() => {
3342
3339
  if (!k || !o) {
3343
3340
  z(null), v([]);
3344
3341
  return;
3345
3342
  }
3346
3343
  let C = !1;
3347
- const B = k.type === "book" || k.type === "collection" ? k.work_id : void 0;
3348
- if (B ? o.getItem(B).then((Y) => {
3349
- !C && Y && Y.type === "work" && z(Y);
3344
+ const R = k.type === "book" || k.type === "collection" ? k.work_id : void 0;
3345
+ if (R ? o.getItem(R).then((P) => {
3346
+ !C && P && P.type === "work" && z(P);
3350
3347
  }).catch(() => {
3351
3348
  }) : z(null), k.type === "book") {
3352
- const Y = k;
3353
- Y.contained_in && Y.contained_in.length > 0 ? Promise.all(
3354
- Y.contained_in.map((G) => {
3355
- const F = typeof G == "string" ? G : G.id, ce = typeof G == "string" ? void 0 : G.volume_index;
3356
- return o.getItem(F).then((oe) => ({
3357
- id: F,
3358
- title: oe && oe.title || F,
3359
- volume_index: ce
3360
- })).catch(() => ({ id: F, title: F, volume_index: ce }));
3349
+ const P = k;
3350
+ P.contained_in && P.contained_in.length > 0 ? Promise.all(
3351
+ P.contained_in.map((J) => {
3352
+ const V = typeof J == "string" ? J : J.id, ee = typeof J == "string" ? void 0 : J.volume_index;
3353
+ return o.getItem(V).then((te) => ({
3354
+ id: V,
3355
+ title: te && te.title || V,
3356
+ volume_index: ee
3357
+ })).catch(() => ({ id: V, title: V, volume_index: ee }));
3361
3358
  })
3362
- ).then((G) => {
3363
- C || v(G);
3359
+ ).then((J) => {
3360
+ C || v(J);
3364
3361
  }) : v([]);
3365
3362
  } else
3366
3363
  v([]);
@@ -3368,13 +3365,13 @@ const on = ({
3368
3365
  C = !0;
3369
3366
  };
3370
3367
  }, [k, o]), x)
3371
- return /* @__PURE__ */ t("div", { className: c, style: { ...s, padding: "24px" }, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [180, 260, 160].map((C, B) => /* @__PURE__ */ t("div", { style: {
3372
- height: B === 1 ? "32px" : "16px",
3368
+ return /* @__PURE__ */ t("div", { className: c, style: { ...s, padding: "24px" }, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [180, 260, 160].map((C, R) => /* @__PURE__ */ t("div", { style: {
3369
+ height: R === 1 ? "32px" : "16px",
3373
3370
  width: `${C}px`,
3374
3371
  background: "var(--bim-widget-border, #e0e0e0)",
3375
3372
  borderRadius: "4px",
3376
3373
  opacity: 0.4
3377
- } }, B)) }) });
3374
+ } }, R)) }) });
3378
3375
  if (b)
3379
3376
  return /* @__PURE__ */ t("div", { className: c, style: {
3380
3377
  ...s,
@@ -3395,20 +3392,20 @@ const on = ({
3395
3392
  headerExtra: l
3396
3393
  }
3397
3394
  ) });
3398
- const T = k.type === "book" ? k : null, _ = k.type === "collection" ? k : null, m = k.type === "work" ? k : null;
3399
- let L = !1;
3395
+ const I = k.type === "book" ? k : null, _ = k.type === "collection" ? k : null, y = k.type === "work" ? k : null;
3396
+ let B = !1;
3400
3397
  try {
3401
- L = Vt(k.id) === "draft";
3398
+ B = Vt(k.id) === "draft";
3402
3399
  } catch {
3403
3400
  }
3404
3401
  let W = "";
3405
- k.measure_info ? W = u(k.measure_info) : (D = k.juan_count) != null && D.number ? W = Xt(k.juan_count.number) + d.unit.juan : (A = k.juan_count) != null && A.description && (W = u(k.juan_count.description));
3406
- const $ = [];
3407
- return (I = k.publication_info) != null && I.year && $.push(/* @__PURE__ */ t(xe, { label: d.label.year, children: k.publication_info.year }, "year")), (E = k.current_location) != null && E.name && $.push(/* @__PURE__ */ t(xe, { label: d.label.currentLocation, children: u(k.current_location.name) }, "loc")), (O = k.page_count) != null && O.description && $.push(/* @__PURE__ */ t(xe, { label: d.label.pageCount, children: k.page_count.description }, "page")), T != null && T.edition && $.push(/* @__PURE__ */ t(xe, { label: d.label.edition, children: u(T.edition) }, "ver")), m != null && m.parent_work && $.push(
3408
- /* @__PURE__ */ t(xe, { label: d.label.parentWork, children: /* @__PURE__ */ t(se, { id: m.parent_work.id, label: u(m.parent_work.title), onNavigate: r, renderLink: a }) }, "pw")
3409
- ), m != null && m.parent_works && m.parent_works.length > 0 && !m.parent_work && $.push(
3410
- /* @__PURE__ */ t(xe, { label: d.label.parentWork, children: m.parent_works.map((C, B) => /* @__PURE__ */ i("span", { children: [
3411
- B > 0 && "、",
3402
+ k.measure_info ? W = u(k.measure_info) : (O = k.juan_count) != null && O.number ? W = Xt(k.juan_count.number) + d.unit.juan : (A = k.juan_count) != null && A.description && (W = u(k.juan_count.description));
3403
+ const E = [];
3404
+ return (N = k.publication_info) != null && N.year && E.push(/* @__PURE__ */ t(xe, { label: d.label.year, children: k.publication_info.year }, "year")), (U = k.current_location) != null && U.name && E.push(/* @__PURE__ */ t(xe, { label: d.label.currentLocation, children: u(k.current_location.name) }, "loc")), (T = k.page_count) != null && T.description && E.push(/* @__PURE__ */ t(xe, { label: d.label.pageCount, children: k.page_count.description }, "page")), I != null && I.edition && E.push(/* @__PURE__ */ t(xe, { label: d.label.edition, children: u(I.edition) }, "ver")), y != null && y.parent_work && E.push(
3405
+ /* @__PURE__ */ t(xe, { label: d.label.parentWork, children: /* @__PURE__ */ t(se, { id: y.parent_work.id, label: u(y.parent_work.title), onNavigate: r, renderLink: a }) }, "pw")
3406
+ ), y != null && y.parent_works && y.parent_works.length > 0 && !y.parent_work && E.push(
3407
+ /* @__PURE__ */ t(xe, { label: d.label.parentWork, children: y.parent_works.map((C, R) => /* @__PURE__ */ i("span", { children: [
3408
+ R > 0 && "、",
3412
3409
  /* @__PURE__ */ t(se, { id: C, onNavigate: r, renderLink: a })
3413
3410
  ] }, C)) }, "pws")
3414
3411
  ), /* @__PURE__ */ i("div", { className: c, style: s, children: [
@@ -3419,28 +3416,28 @@ const on = ({
3419
3416
  title: u(k.title),
3420
3417
  edition: k.edition ? u(k.edition) : void 0,
3421
3418
  type: k.type,
3422
- isDraft: L,
3419
+ isDraft: B,
3423
3420
  authors: k.authors,
3424
3421
  volumeText: W,
3425
- meta: $,
3422
+ meta: E,
3426
3423
  headerExtra: l,
3427
3424
  onNavigate: r,
3428
3425
  renderLink: a
3429
3426
  }
3430
3427
  ),
3431
- ((N = k.description) == null ? void 0 : N.text) && /* @__PURE__ */ t("p", { style: {
3428
+ ((D = k.description) == null ? void 0 : D.text) && /* @__PURE__ */ t("p", { style: {
3432
3429
  fontSize: "14px",
3433
3430
  color: "var(--bim-fg, #444)",
3434
3431
  lineHeight: 1.9,
3435
3432
  margin: "0 0 4px",
3436
3433
  textAlign: "justify"
3437
3434
  }, children: u(k.description.text) }),
3438
- y.length > 0 && /* @__PURE__ */ i(j, { children: [
3439
- /* @__PURE__ */ t(ie, { children: d.section.containedIn }),
3440
- /* @__PURE__ */ t(yo, { items: y, onNavigate: r, renderLink: a })
3435
+ m.length > 0 && /* @__PURE__ */ i(j, { children: [
3436
+ /* @__PURE__ */ t(le, { children: d.section.containedIn }),
3437
+ /* @__PURE__ */ t(yo, { items: m, onNavigate: r, renderLink: a })
3441
3438
  ] }),
3442
3439
  h && /* @__PURE__ */ i(j, { children: [
3443
- /* @__PURE__ */ t(ie, { children: d.section.belongsToWork }),
3440
+ /* @__PURE__ */ t(le, { children: d.section.belongsToWork }),
3444
3441
  /* @__PURE__ */ t(mo, { workData: h, onNavigate: r, renderLink: a })
3445
3442
  ] }),
3446
3443
  k.additional_works && k.additional_works.length > 0 && /* @__PURE__ */ t(fo, { items: k.additional_works }),
@@ -3449,15 +3446,15 @@ const on = ({
3449
3446
  k.indexed_by && k.indexed_by.length > 0 && /* @__PURE__ */ t(co, { items: k.indexed_by, onNavigate: r, renderLink: a }),
3450
3447
  k.emendated_by && k.emendated_by.length > 0 && /* @__PURE__ */ t(so, { items: k.emendated_by, onNavigate: r, renderLink: a }),
3451
3448
  k.resources && k.resources.length > 0 && /* @__PURE__ */ i(j, { children: [
3452
- /* @__PURE__ */ t(ie, { children: d.section.resources }),
3449
+ /* @__PURE__ */ t(le, { children: d.section.resources }),
3453
3450
  /* @__PURE__ */ t(qt, { items: k.resources, groupByType: !0, onNavigate: r, renderLink: a })
3454
3451
  ] }),
3455
- (T == null ? void 0 : T.location_history) && T.location_history.length > 0 && /* @__PURE__ */ t(go, { items: T.location_history }),
3452
+ (I == null ? void 0 : I.location_history) && I.location_history.length > 0 && /* @__PURE__ */ t(go, { items: I.location_history }),
3456
3453
  (_ == null ? void 0 : _.history) && _.history.length > 0 && /* @__PURE__ */ t(ho, { items: _.history }),
3457
- (T == null ? void 0 : T.related_books) && T.related_books.length > 0 && /* @__PURE__ */ t(kt, { title: d.section.relatedVersions, ids: T.related_books, transport: o, onNavigate: r, renderLink: a }),
3454
+ (I == null ? void 0 : I.related_books) && I.related_books.length > 0 && /* @__PURE__ */ t(kt, { title: d.section.relatedVersions, ids: I.related_books, transport: o, onNavigate: r, renderLink: a }),
3458
3455
  (_ == null ? void 0 : _.books) && _.books.length > 0 && /* @__PURE__ */ t(kt, { title: d.section.containedBooks, ids: _.books, transport: o, onNavigate: r, renderLink: a }),
3459
3456
  (_ == null ? void 0 : _.contained_works) && _.contained_works.length > 0 && /* @__PURE__ */ i("div", { children: [
3460
- /* @__PURE__ */ i(ie, { children: [
3457
+ /* @__PURE__ */ i(le, { children: [
3461
3458
  d.section.containedWorks,
3462
3459
  /* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #aaa)", fontWeight: 400 }, children: [
3463
3460
  "(",
@@ -3476,19 +3473,19 @@ const on = ({
3476
3473
  background: "var(--bim-input-bg, #fff)"
3477
3474
  }, children: /* @__PURE__ */ t(se, { id: C.id, label: u(C.title), onNavigate: r, renderLink: a }) }, C.id)) })
3478
3475
  ] }),
3479
- (m == null ? void 0 : m.books) && m.books.length > 0 && /* @__PURE__ */ t(bo, { ids: m.books, transport: o, onNavigate: r, renderLink: a }),
3480
- (m == null ? void 0 : m.related_works) && m.related_works.length > 0 && (() => {
3481
- const C = [], B = m.related_works.filter((F) => F.relation === "part_of"), Y = m.related_works.filter((F) => F.relation === "has_part"), G = m.related_works.filter((F) => !F.relation);
3482
- return B.length > 0 && C.push({ label: d.section.belongsToWork, items: B }), Y.length > 0 && C.push({ label: d.section.containedWorks, items: Y }), G.length > 0 && C.push({ label: d.section.relatedWorks, items: G }), C.map((F) => /* @__PURE__ */ i("div", { children: [
3483
- /* @__PURE__ */ i(ie, { children: [
3484
- F.label,
3476
+ (y == null ? void 0 : y.books) && y.books.length > 0 && /* @__PURE__ */ t(bo, { ids: y.books, transport: o, onNavigate: r, renderLink: a }),
3477
+ (y == null ? void 0 : y.related_works) && y.related_works.length > 0 && (() => {
3478
+ const C = [], R = y.related_works.filter((V) => V.relation === "part_of"), P = y.related_works.filter((V) => V.relation === "has_part"), J = y.related_works.filter((V) => !V.relation);
3479
+ return R.length > 0 && C.push({ label: d.section.belongsToWork, items: R }), P.length > 0 && C.push({ label: d.section.containedWorks, items: P }), J.length > 0 && C.push({ label: d.section.relatedWorks, items: J }), C.map((V) => /* @__PURE__ */ i("div", { children: [
3480
+ /* @__PURE__ */ i(le, { children: [
3481
+ V.label,
3485
3482
  /* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #aaa)", fontWeight: 400 }, children: [
3486
3483
  "(",
3487
- F.items.length,
3484
+ V.items.length,
3488
3485
  ")"
3489
3486
  ] })
3490
3487
  ] }),
3491
- /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" }, children: F.items.map((ce) => /* @__PURE__ */ t("span", { style: {
3488
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" }, children: V.items.map((ee) => /* @__PURE__ */ t("span", { style: {
3492
3489
  display: "inline-flex",
3493
3490
  alignItems: "center",
3494
3491
  gap: "4px",
@@ -3497,13 +3494,13 @@ const on = ({
3497
3494
  border: "1px solid var(--bim-widget-border, #e0e0e0)",
3498
3495
  borderRadius: "4px",
3499
3496
  background: "var(--bim-input-bg, #fff)"
3500
- }, children: /* @__PURE__ */ t(se, { id: ce.id, label: u(ce.title), onNavigate: r, renderLink: a }) }, ce.id)) })
3501
- ] }, F.label));
3497
+ }, children: /* @__PURE__ */ t(se, { id: ee.id, label: u(ee.title), onNavigate: r, renderLink: a }) }, ee.id)) })
3498
+ ] }, V.label));
3502
3499
  })()
3503
3500
  ] });
3504
3501
  };
3505
3502
  function vo({ data: e }) {
3506
- const n = H(), { convert: o } = K(), { stats: r } = e, a = r.processed_volumes ?? r.total_found_volumes, l = a != null && e.total_volumes > 0 ? Math.round(a / e.total_volumes * 100) : null;
3503
+ const n = H(), { convert: o } = Y(), { stats: r } = e, a = r.processed_volumes ?? r.total_found_volumes, l = a != null && e.total_volumes > 0 ? Math.round(a / e.total_volumes * 100) : null;
3507
3504
  return /* @__PURE__ */ i("div", { style: { marginBottom: "24px" }, children: [
3508
3505
  /* @__PURE__ */ t("h2", { style: {
3509
3506
  fontSize: "18px",
@@ -3649,7 +3646,7 @@ function wo(e, n) {
3649
3646
  return r - o + 1 === e.length ? `${o}–${r}` : e.length <= 3 ? e.join(", ") : `${o}–${r} (${e.length}${n})`;
3650
3647
  }
3651
3648
  function wt({ book: e, onNavigate: n, renderLink: o, showVolumes: r }) {
3652
- const a = H(), { convert: l } = K(), c = e.book_id || e.work_id, s = r && e.volumes.length > 0 ? wo(e.volumes, a.unit.volume) : null, d = e.missing_volumes && e.missing_volumes.length > 0;
3649
+ const a = H(), { convert: l } = Y(), c = e.book_id || e.work_id, s = r && e.volumes.length > 0 ? wo(e.volumes, a.unit.volume) : null, d = e.missing_volumes && e.missing_volumes.length > 0;
3653
3650
  return /* @__PURE__ */ i("div", { style: {
3654
3651
  display: "flex",
3655
3652
  alignItems: "baseline",
@@ -3724,60 +3721,60 @@ const _o = ({
3724
3721
  className: l,
3725
3722
  style: c
3726
3723
  }) => {
3727
- const s = H(), [d, u] = w(null), [g, f] = w(!1), [x, p] = w(null), [b, S] = w(null), [h, z] = w(""), y = e || d;
3728
- P(() => {
3724
+ const s = H(), [d, u] = w(null), [g, f] = w(!1), [x, p] = w(null), [b, S] = w(null), [h, z] = w(""), m = e || d;
3725
+ $(() => {
3729
3726
  if (e || !n || !(o != null && o.getCollectionCatalog)) return;
3730
- let m = !1;
3731
- return f(!0), p(null), o.getCollectionCatalog(n).then((L) => {
3732
- m || (L ? u(L) : p(s.catalog.notFound));
3733
- }).catch((L) => {
3734
- m || p(L instanceof Error ? L.message : s.catalog.loadFailed);
3727
+ let y = !1;
3728
+ return f(!0), p(null), o.getCollectionCatalog(n).then((B) => {
3729
+ y || (B ? u(B) : p(s.catalog.notFound));
3730
+ }).catch((B) => {
3731
+ y || p(B instanceof Error ? B.message : s.catalog.loadFailed);
3735
3732
  }).finally(() => {
3736
- m || f(!1);
3733
+ y || f(!1);
3737
3734
  }), () => {
3738
- m = !0;
3735
+ y = !0;
3739
3736
  };
3740
3737
  }, [e, n, o, s]);
3741
- const v = (y == null ? void 0 : y.sections) && y.sections.length > 0, k = ae(() => {
3742
- if (!y) return !1;
3743
- if (y.volume_index && Object.keys(y.volume_index).length > 0) return !0;
3744
- const m = y.books.map((W) => W.volumes[0]).filter((W) => W != null);
3745
- return new Set(m).size < m.length;
3746
- }, [y]), T = ae(() => {
3747
- if (!y) return [];
3748
- let m = y.books;
3749
- if (b && (m = m.filter((L) => L.section === b)), h.trim()) {
3750
- const L = h.trim().toLowerCase();
3751
- m = m.filter(
3752
- (W) => W.title.toLowerCase().includes(L) || W.sub_items && W.sub_items.some(($) => $.toLowerCase().includes(L)) || W.edition && W.edition.toLowerCase().includes(L)
3738
+ const v = (m == null ? void 0 : m.sections) && m.sections.length > 0, k = ce(() => {
3739
+ if (!m) return !1;
3740
+ if (m.volume_index && Object.keys(m.volume_index).length > 0) return !0;
3741
+ const y = m.books.map((W) => W.volumes[0]).filter((W) => W != null);
3742
+ return new Set(y).size < y.length;
3743
+ }, [m]), I = ce(() => {
3744
+ if (!m) return [];
3745
+ let y = m.books;
3746
+ if (b && (y = y.filter((B) => B.section === b)), h.trim()) {
3747
+ const B = h.trim().toLowerCase();
3748
+ y = y.filter(
3749
+ (W) => W.title.toLowerCase().includes(B) || W.sub_items && W.sub_items.some((E) => E.toLowerCase().includes(B)) || W.edition && W.edition.toLowerCase().includes(B)
3753
3750
  );
3754
3751
  }
3755
- return m;
3756
- }, [y, b, h]), _ = ae(() => {
3752
+ return y;
3753
+ }, [m, b, h]), _ = ce(() => {
3757
3754
  if (!k) return null;
3758
- const m = [], L = /* @__PURE__ */ new Map();
3759
- for (const $ of T) {
3760
- if (!$.volumes || $.volumes.length === 0) continue;
3761
- const D = $.volumes[0];
3762
- L.has(D) || L.set(D, []), L.get(D).push($);
3755
+ const y = [], B = /* @__PURE__ */ new Map();
3756
+ for (const E of I) {
3757
+ if (!E.volumes || E.volumes.length === 0) continue;
3758
+ const O = E.volumes[0];
3759
+ B.has(O) || B.set(O, []), B.get(O).push(E);
3763
3760
  }
3764
- const W = [...L.keys()].sort(($, D) => $ - D);
3765
- for (const $ of W)
3766
- m.push({ volume: $, books: L.get($) });
3767
- return m;
3768
- }, [T, k]);
3761
+ const W = [...B.keys()].sort((E, O) => E - O);
3762
+ for (const E of W)
3763
+ y.push({ volume: E, books: B.get(E) });
3764
+ return y;
3765
+ }, [I, k]);
3769
3766
  return g ? /* @__PURE__ */ t("div", { className: l, style: { ...c, padding: "24px" }, children: /* @__PURE__ */ t("div", { style: { color: "var(--bim-desc-fg, #717171)", fontSize: "13px" }, children: s.catalog.loading }) }) : x ? /* @__PURE__ */ t("div", { className: l, style: {
3770
3767
  ...c,
3771
3768
  padding: "24px",
3772
3769
  textAlign: "center",
3773
3770
  color: "var(--bim-desc-fg, #717171)",
3774
3771
  fontSize: "13px"
3775
- }, children: x }) : y ? /* @__PURE__ */ i("div", { className: l, style: c, children: [
3776
- /* @__PURE__ */ t(vo, { data: y }),
3772
+ }, children: x }) : m ? /* @__PURE__ */ i("div", { className: l, style: c, children: [
3773
+ /* @__PURE__ */ t(vo, { data: m }),
3777
3774
  v && /* @__PURE__ */ t(
3778
3775
  ko,
3779
3776
  {
3780
- sections: y.sections,
3777
+ sections: m.sections,
3781
3778
  activeSection: b,
3782
3779
  onSelect: S
3783
3780
  }
@@ -3789,7 +3786,7 @@ const _o = ({
3789
3786
  type: "text",
3790
3787
  placeholder: s.search.searchBookName,
3791
3788
  value: h,
3792
- onChange: (m) => z(m.target.value),
3789
+ onChange: (y) => z(y.target.value),
3793
3790
  style: {
3794
3791
  width: "100%",
3795
3792
  maxWidth: "320px",
@@ -3808,7 +3805,7 @@ const _o = ({
3808
3805
  fontSize: "12px",
3809
3806
  color: "var(--bim-desc-fg, #999)"
3810
3807
  }, children: [
3811
- T.length,
3808
+ I.length,
3812
3809
  " ",
3813
3810
  s.unit.bu
3814
3811
  ] })
@@ -3820,7 +3817,7 @@ const _o = ({
3820
3817
  }, children: [
3821
3818
  _ ? (
3822
3819
  /* 按册分组模式 */
3823
- _.map((m, L) => /* @__PURE__ */ i("div", { children: [
3820
+ _.map((y, B) => /* @__PURE__ */ i("div", { children: [
3824
3821
  /* @__PURE__ */ t("div", { style: {
3825
3822
  padding: "4px 12px",
3826
3823
  background: "var(--bim-bg, #f8f8f8)",
@@ -3831,8 +3828,8 @@ const _o = ({
3831
3828
  position: "sticky",
3832
3829
  top: 0,
3833
3830
  zIndex: 1
3834
- }, children: Ke(s.catalog.volume, { n: m.volume }) }),
3835
- m.books.map((W, $) => /* @__PURE__ */ t(
3831
+ }, children: Ke(s.catalog.volume, { n: y.volume }) }),
3832
+ y.books.map((W, E) => /* @__PURE__ */ t(
3836
3833
  wt,
3837
3834
  {
3838
3835
  book: W,
@@ -3840,23 +3837,23 @@ const _o = ({
3840
3837
  renderLink: a,
3841
3838
  showVolumes: W.volumes.length > 1
3842
3839
  },
3843
- `${m.volume}-${$}`
3840
+ `${y.volume}-${E}`
3844
3841
  ))
3845
- ] }, `${m.volume}-${L}`))
3842
+ ] }, `${y.volume}-${B}`))
3846
3843
  ) : (
3847
3844
  /* 平铺模式(百衲本等,每本书独立行) */
3848
- T.map((m, L) => /* @__PURE__ */ t(
3845
+ I.map((y, B) => /* @__PURE__ */ t(
3849
3846
  wt,
3850
3847
  {
3851
- book: m,
3848
+ book: y,
3852
3849
  onNavigate: r,
3853
3850
  renderLink: a,
3854
3851
  showVolumes: !0
3855
3852
  },
3856
- L
3853
+ B
3857
3854
  ))
3858
3855
  ),
3859
- T.length === 0 && /* @__PURE__ */ t("div", { style: {
3856
+ I.length === 0 && /* @__PURE__ */ t("div", { style: {
3860
3857
  padding: "32px",
3861
3858
  textAlign: "center",
3862
3859
  color: "var(--bim-desc-fg, #999)",
@@ -3866,11 +3863,11 @@ const _o = ({
3866
3863
  ] }) : null;
3867
3864
  }, Se = () => {
3868
3865
  const [e, n] = w(1);
3869
- return P(() => {
3866
+ return $(() => {
3870
3867
  const o = setInterval(() => n((r) => r >= 3 ? 1 : r + 1), 500);
3871
3868
  return () => clearInterval(o);
3872
3869
  }, []), /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "32px 0", color: "var(--bim-desc-fg, #717171)", fontSize: "14px" }, children: "加载中" + ".".repeat(e) });
3873
- }, ne = 6, Oe = 7, zo = ({
3870
+ }, re = 6, Oe = 7, zo = ({
3874
3871
  content: e,
3875
3872
  children: n,
3876
3873
  placement: o = "top",
@@ -3878,25 +3875,25 @@ const _o = ({
3878
3875
  maxWidth: a = 280,
3879
3876
  wrapperStyle: l
3880
3877
  }) => {
3881
- const [c, s] = w(!1), [d, u] = w(null), g = Q(null), f = Q(null), x = Q(null), p = U(() => {
3878
+ const [c, s] = w(!1), [d, u] = w(null), g = Q(null), f = Q(null), x = Q(null), p = F(() => {
3882
3879
  const h = f.current, z = x.current;
3883
3880
  if (!h || !z) return;
3884
- const y = h.getBoundingClientRect(), v = z.getBoundingClientRect(), k = window.innerHeight, T = document.documentElement.clientWidth;
3881
+ const m = h.getBoundingClientRect(), v = z.getBoundingClientRect(), k = window.innerHeight, I = document.documentElement.clientWidth;
3885
3882
  let _ = o;
3886
- o === "top" && y.top - v.height - Oe < 8 && (_ = "bottom"), o === "bottom" && y.bottom + v.height + Oe > k - 8 && (_ = "top");
3887
- const m = _ === "top" ? y.top - v.height - Oe : y.bottom + Oe;
3888
- let L = y.left + y.width / 2 - v.width / 2;
3889
- L = Math.max(8, Math.min(L, T - v.width - 8)), u({ left: L, top: m, placement: _ });
3890
- }, [o]), b = U(() => {
3883
+ o === "top" && m.top - v.height - Oe < 8 && (_ = "bottom"), o === "bottom" && m.bottom + v.height + Oe > k - 8 && (_ = "top");
3884
+ const y = _ === "top" ? m.top - v.height - Oe : m.bottom + Oe;
3885
+ let B = m.left + m.width / 2 - v.width / 2;
3886
+ B = Math.max(8, Math.min(B, I - v.width - 8)), u({ left: B, top: y, placement: _ });
3887
+ }, [o]), b = F(() => {
3891
3888
  g.current && clearTimeout(g.current), g.current = setTimeout(() => s(!0), r);
3892
- }, [r]), S = U(() => {
3889
+ }, [r]), S = F(() => {
3893
3890
  g.current && clearTimeout(g.current), s(!1), u(null);
3894
3891
  }, []);
3895
- return P(() => {
3892
+ return $(() => {
3896
3893
  if (!c) return;
3897
3894
  const h = requestAnimationFrame(p);
3898
3895
  return () => cancelAnimationFrame(h);
3899
- }, [c, p]), P(() => () => {
3896
+ }, [c, p]), $(() => () => {
3900
3897
  g.current && clearTimeout(g.current);
3901
3898
  }, []), /* @__PURE__ */ i(j, { children: [
3902
3899
  /* @__PURE__ */ t(
@@ -3946,19 +3943,19 @@ const _o = ({
3946
3943
  style: {
3947
3944
  position: "absolute",
3948
3945
  left: "50%",
3949
- marginLeft: -ne,
3946
+ marginLeft: -re,
3950
3947
  width: 0,
3951
3948
  height: 0,
3952
3949
  ...d.placement === "top" ? {
3953
- bottom: -ne,
3954
- borderTop: `${ne}px solid var(--bim-widget-border, #e0e0e0)`,
3955
- borderLeft: `${ne}px solid transparent`,
3956
- borderRight: `${ne}px solid transparent`
3950
+ bottom: -re,
3951
+ borderTop: `${re}px solid var(--bim-widget-border, #e0e0e0)`,
3952
+ borderLeft: `${re}px solid transparent`,
3953
+ borderRight: `${re}px solid transparent`
3957
3954
  } : {
3958
- top: -ne,
3959
- borderBottom: `${ne}px solid var(--bim-widget-border, #e0e0e0)`,
3960
- borderLeft: `${ne}px solid transparent`,
3961
- borderRight: `${ne}px solid transparent`
3955
+ top: -re,
3956
+ borderBottom: `${re}px solid var(--bim-widget-border, #e0e0e0)`,
3957
+ borderLeft: `${re}px solid transparent`,
3958
+ borderRight: `${re}px solid transparent`
3962
3959
  }
3963
3960
  }
3964
3961
  }
@@ -3974,14 +3971,14 @@ const _o = ({
3974
3971
  height: 0,
3975
3972
  ...d.placement === "top" ? {
3976
3973
  bottom: -5,
3977
- borderTop: `${ne - 1}px solid var(--bim-input-bg, #fff)`,
3978
- borderLeft: `${ne - 1}px solid transparent`,
3979
- borderRight: `${ne - 1}px solid transparent`
3974
+ borderTop: `${re - 1}px solid var(--bim-input-bg, #fff)`,
3975
+ borderLeft: `${re - 1}px solid transparent`,
3976
+ borderRight: `${re - 1}px solid transparent`
3980
3977
  } : {
3981
3978
  top: -5,
3982
- borderBottom: `${ne - 1}px solid var(--bim-input-bg, #fff)`,
3983
- borderLeft: `${ne - 1}px solid transparent`,
3984
- borderRight: `${ne - 1}px solid transparent`
3979
+ borderBottom: `${re - 1}px solid var(--bim-input-bg, #fff)`,
3980
+ borderLeft: `${re - 1}px solid transparent`,
3981
+ borderRight: `${re - 1}px solid transparent`
3985
3982
  }
3986
3983
  }
3987
3984
  }
@@ -4026,24 +4023,24 @@ function Ro(e, n) {
4026
4023
  }
4027
4024
  return a.replace(/〇$/, "");
4028
4025
  }
4029
- let Ae = null, De = null;
4026
+ let Pe = null, De = null;
4030
4027
  const Ue = /* @__PURE__ */ new Set();
4031
4028
  function Lo() {
4032
- return Ae ? Promise.resolve() : De || (De = import("opencc-js/t2cn").then((e) => {
4033
- Ae = e.Converter({ from: "tw", to: "cn" }), Ue.forEach((n) => n());
4029
+ return Pe ? Promise.resolve() : De || (De = import("opencc-js/t2cn").then((e) => {
4030
+ Pe = e.Converter({ from: "tw", to: "cn" }), Ue.forEach((n) => n());
4034
4031
  }).catch(() => {
4035
- Ae = (e) => e, Ue.forEach((e) => e());
4032
+ Pe = (e) => e, Ue.forEach((e) => e());
4036
4033
  }), De);
4037
4034
  }
4038
4035
  function me() {
4039
4036
  const [, e] = w(0);
4040
- return P(() => {
4041
- if (Ae) return;
4037
+ return $(() => {
4038
+ if (Pe) return;
4042
4039
  const n = () => e((o) => o + 1);
4043
4040
  return Ue.add(n), Lo(), () => {
4044
4041
  Ue.delete(n);
4045
4042
  };
4046
- }, []), Ae ?? ((n) => n);
4043
+ }, []), Pe ?? ((n) => n);
4047
4044
  }
4048
4045
  function Ce(e, n) {
4049
4046
  return n(e).toLowerCase();
@@ -4162,33 +4159,33 @@ function $o(e, n) {
4162
4159
  function sn({ group: e, activeFile: n, onSelect: o, depth: r = 0, juanMeta: a, matchStates: l }) {
4163
4160
  var b;
4164
4161
  const c = an(e, n || ""), s = $o(e, l), d = typeof s == "number" && s > 0, u = s === 0, [g, f] = w(c || d), x = cn(e), p = !!((b = e.children) != null && b.length);
4165
- if (P(() => {
4162
+ if ($(() => {
4166
4163
  c && f(!0);
4167
- }, [c]), P(() => {
4164
+ }, [c]), $(() => {
4168
4165
  d && f(!0);
4169
4166
  }, [d]), e.files.length === 1 && !p) {
4170
- const S = e.files[0], h = n === S, z = l[S], y = z === 0, v = z === "loading", k = typeof z == "number" && z > 0;
4167
+ const S = e.files[0], h = n === S, z = l[S], m = z === 0, v = z === "loading", k = typeof z == "number" && z > 0;
4171
4168
  return /* @__PURE__ */ i(
4172
4169
  "button",
4173
4170
  {
4174
4171
  onClick: () => {
4175
- y || o(S);
4172
+ m || o(S);
4176
4173
  },
4177
- disabled: y,
4174
+ disabled: m,
4178
4175
  style: {
4179
4176
  display: "inline-block",
4180
4177
  padding: "3px 8px",
4181
4178
  margin: "2px 0",
4182
4179
  marginLeft: `${8 + r * 16}px`,
4183
- border: h ? "1px solid var(--bim-primary, #8e6f3e)" : y ? "1px dashed var(--bim-widget-border, #e0e0e0)" : "1px solid var(--bim-widget-border, #e0e0e0)",
4180
+ border: h ? "1px solid var(--bim-primary, #8e6f3e)" : m ? "1px dashed var(--bim-widget-border, #e0e0e0)" : "1px solid var(--bim-widget-border, #e0e0e0)",
4184
4181
  borderRadius: "3px",
4185
4182
  background: h ? "color-mix(in srgb, var(--bim-primary, #8e6f3e) 10%, transparent)" : k ? `${it}40` : "transparent",
4186
- color: h ? "var(--bim-primary, #8e6f3e)" : y ? "var(--bim-desc-fg, #bbb)" : "var(--bim-fg, #333)",
4187
- cursor: y ? "not-allowed" : "pointer",
4183
+ color: h ? "var(--bim-primary, #8e6f3e)" : m ? "var(--bim-desc-fg, #bbb)" : "var(--bim-fg, #333)",
4184
+ cursor: m ? "not-allowed" : "pointer",
4188
4185
  fontSize: "12px",
4189
4186
  fontWeight: h ? 600 : 400,
4190
4187
  lineHeight: 1.4,
4191
- opacity: y ? 0.5 : 1
4188
+ opacity: m ? 0.5 : 1
4192
4189
  },
4193
4190
  children: [
4194
4191
  e.label,
@@ -4248,7 +4245,7 @@ function sn({ group: e, activeFile: n, onSelect: o, depth: r = 0, juanMeta: a, m
4248
4245
  ] })
4249
4246
  ] });
4250
4247
  }
4251
- function Po({
4248
+ function Ao({
4252
4249
  files: e,
4253
4250
  groups: n,
4254
4251
  activeFile: o,
@@ -4267,7 +4264,7 @@ function Po({
4267
4264
  padding: "4px 0"
4268
4265
  }, children: c.map((s) => /* @__PURE__ */ t(ln, { file: s, isActive: o === s, onSelect: r, meta: a == null ? void 0 : a[s], matchState: l[s] }, s)) });
4269
4266
  }
4270
- function Ao({ type: e }) {
4267
+ function Po({ type: e }) {
4271
4268
  const n = at[e] || "#717171";
4272
4269
  return /* @__PURE__ */ t("span", { style: {
4273
4270
  display: "inline-block",
@@ -4282,12 +4279,12 @@ function Ao({ type: e }) {
4282
4279
  }, children: e });
4283
4280
  }
4284
4281
  function Mo({ section: e, onNavigate: n, highlightQuery: o = "" }) {
4285
- const { convert: r } = K(), a = de(), l = me(), c = (S) => {
4282
+ const { convert: r } = Y(), a = de(), l = me(), c = (S) => {
4286
4283
  if (!S) return "";
4287
4284
  const h = r(S);
4288
4285
  return o ? Ie(h, o, l) : h;
4289
4286
  }, [s, d] = w(!1), u = !!e.summary, g = !!e.comment, f = !!e.additional_comment, x = !!(e.content && e.content.length > 60), p = u || g || f || x;
4290
- P(() => {
4287
+ $(() => {
4291
4288
  o && d(!0);
4292
4289
  }, [o]);
4293
4290
  const b = !s && x ? e.content.replace(/\n/g, " ").slice(0, 80) + "…" : null;
@@ -4469,7 +4466,7 @@ function Mo({ section: e, onNavigate: n, highlightQuery: o = "" }) {
4469
4466
  ] });
4470
4467
  }
4471
4468
  function Ho({ section: e, highlightQuery: n = "" }) {
4472
- const { convert: o } = K(), r = me(), a = (d) => {
4469
+ const { convert: o } = Y(), r = me(), a = (d) => {
4473
4470
  if (!d) return "";
4474
4471
  const u = o(d);
4475
4472
  return n ? Ie(u, n, r) : u;
@@ -4487,7 +4484,7 @@ function Ho({ section: e, highlightQuery: n = "" }) {
4487
4484
  userSelect: "none"
4488
4485
  },
4489
4486
  children: [
4490
- /* @__PURE__ */ t(Ao, { type: e.type }),
4487
+ /* @__PURE__ */ t(Po, { type: e.type }),
4491
4488
  /* @__PURE__ */ t("span", { style: {
4492
4489
  fontSize: "15px",
4493
4490
  fontWeight: 600,
@@ -4520,7 +4517,7 @@ function Ho({ section: e, highlightQuery: n = "" }) {
4520
4517
  ] });
4521
4518
  }
4522
4519
  function Oo({ section: e, highlightQuery: n = "" }) {
4523
- const { convert: o } = K(), r = me();
4520
+ const { convert: o } = Y(), r = me();
4524
4521
  if (!e.content && !e.title) return null;
4525
4522
  const a = o((e.content || e.title || "").replace(/\n{2,}/g, `
4526
4523
  `)), l = n ? Ie(a, n, r) : a, c = at[e.type] || "#717171", s = e.type === "序" || e.type === "结语";
@@ -4553,7 +4550,7 @@ function Oo({ section: e, highlightQuery: n = "" }) {
4553
4550
  }
4554
4551
  function Do(e, n, o) {
4555
4552
  const [r, a] = w({});
4556
- return P(() => {
4553
+ return $(() => {
4557
4554
  var u;
4558
4555
  if (!n || e.length === 0) return;
4559
4556
  let l = !1;
@@ -4595,12 +4592,12 @@ function Do(e, n, o) {
4595
4592
  }, [e.join(","), n]), r;
4596
4593
  }
4597
4594
  function jo({ section: e, onNavigate: n, transport: o, workLabelCache: r, highlightQuery: a = "" }) {
4598
- const { convert: l } = K(), c = de(), s = me(), d = (y) => {
4599
- if (!y) return "";
4600
- const v = l(y);
4595
+ const { convert: l } = Y(), c = de(), s = me(), d = (m) => {
4596
+ if (!m) return "";
4597
+ const v = l(m);
4601
4598
  return a ? Ie(v, a, s) : v;
4602
4599
  }, [u, g] = w(!1);
4603
- P(() => {
4600
+ $(() => {
4604
4601
  a && g(!0);
4605
4602
  }, [a]);
4606
4603
  const f = e.type, x = Wo[f] || "#717171", p = !!e.content, b = e.work_ids || [], S = b.length > 1, h = Do(
@@ -4652,8 +4649,8 @@ function jo({ section: e, onNavigate: n, transport: o, workLabelCache: r, highli
4652
4649
  "a",
4653
4650
  {
4654
4651
  href: c(b[0]),
4655
- onClick: (y) => {
4656
- y.metaKey || y.ctrlKey || (y.preventDefault(), y.stopPropagation(), n(b[0]));
4652
+ onClick: (m) => {
4653
+ m.metaKey || m.ctrlKey || (m.preventDefault(), m.stopPropagation(), n(b[0]));
4657
4654
  },
4658
4655
  style: {
4659
4656
  fontSize: "11px",
@@ -4693,14 +4690,14 @@ function jo({ section: e, onNavigate: n, transport: o, workLabelCache: r, highli
4693
4690
  display: "flex",
4694
4691
  flexWrap: "wrap",
4695
4692
  gap: "4px 12px"
4696
- }, children: b.map((y) => {
4697
- const v = h[y], k = v ? `${l(v.title)}${v.author ? `(${l(v.author)})` : ""}` : y.slice(0, 8) + "…";
4693
+ }, children: b.map((m) => {
4694
+ const v = h[m], k = v ? `${l(v.title)}${v.author ? `(${l(v.author)})` : ""}` : m.slice(0, 8) + "…";
4698
4695
  return /* @__PURE__ */ i(
4699
4696
  "a",
4700
4697
  {
4701
- href: c(y),
4702
- onClick: (T) => {
4703
- T.metaKey || T.ctrlKey || (T.preventDefault(), T.stopPropagation(), n(y));
4698
+ href: c(m),
4699
+ onClick: (I) => {
4700
+ I.metaKey || I.ctrlKey || (I.preventDefault(), I.stopPropagation(), n(m));
4704
4701
  },
4705
4702
  style: {
4706
4703
  fontSize: "12px",
@@ -4709,13 +4706,13 @@ function jo({ section: e, onNavigate: n, transport: o, workLabelCache: r, highli
4709
4706
  textDecoration: "none",
4710
4707
  lineHeight: 1.8
4711
4708
  },
4712
- title: y,
4709
+ title: m,
4713
4710
  children: [
4714
4711
  "→",
4715
4712
  k
4716
4713
  ]
4717
4714
  },
4718
- y
4715
+ m
4719
4716
  );
4720
4717
  }) }),
4721
4718
  u && p && /* @__PURE__ */ i("div", { style: {
@@ -4752,7 +4749,7 @@ function Fo({
4752
4749
  transport: r,
4753
4750
  workLabelCache: a
4754
4751
  }) {
4755
- const { convert: l } = K(), c = me(), s = n.trim(), d = ae(() => s ? e.sections.filter((f) => lt(f, s, !0, c)) : e.sections, [e.sections, s, c]), u = e.sections.filter((f) => f.type === "考证").length, g = d.filter((f) => f.type === "考证").length;
4752
+ const { convert: l } = Y(), c = me(), s = n.trim(), d = ce(() => s ? e.sections.filter((f) => lt(f, s, !0, c)) : e.sections, [e.sections, s, c]), u = e.sections.filter((f) => f.type === "考证").length, g = d.filter((f) => f.type === "考证").length;
4756
4753
  return /* @__PURE__ */ i("div", { children: [
4757
4754
  /* @__PURE__ */ i("div", { style: {
4758
4755
  display: "flex",
@@ -4798,7 +4795,7 @@ function Fo({
4798
4795
  ] });
4799
4796
  }
4800
4797
  function Uo({ text: e, highlightQuery: n = "" }) {
4801
- const { convert: o } = K(), r = me(), a = (c) => {
4798
+ const { convert: o } = Y(), r = me(), a = (c) => {
4802
4799
  const s = o(c);
4803
4800
  return n ? Ie(s, n, r) : s;
4804
4801
  }, l = e.split(`
@@ -4819,7 +4816,7 @@ function Uo({ text: e, highlightQuery: n = "" }) {
4819
4816
  }) });
4820
4817
  }
4821
4818
  function Vo({ sections: e, onNavigate: n, highlightQuery: o = "" }) {
4822
- const { convert: r } = K(), a = de(), l = me(), c = (u) => {
4819
+ const { convert: r } = Y(), a = de(), l = me(), c = (u) => {
4823
4820
  if (!u) return "";
4824
4821
  const g = r(u);
4825
4822
  return o ? Ie(g, o, l) : g;
@@ -4855,7 +4852,7 @@ function No({
4855
4852
  searchQuery: o,
4856
4853
  onNavigate: r
4857
4854
  }) {
4858
- const { convert: a } = K(), l = me(), [c, s] = w("catalog"), d = o.trim(), u = ae(() => d ? e.sections.filter((p) => lt(p, d, !1, l)) : e.sections, [e.sections, d, l]), g = e.sections.filter((p) => p.type === "书").length, f = e.sections.filter((p) => p.type === "詩").length, x = d ? u.filter((p) => p.type === "书" || p.type === "詩").length : null;
4855
+ const { convert: a } = Y(), l = me(), [c, s] = w("catalog"), d = o.trim(), u = ce(() => d ? e.sections.filter((p) => lt(p, d, !1, l)) : e.sections, [e.sections, d, l]), g = e.sections.filter((p) => p.type === "书").length, f = e.sections.filter((p) => p.type === "詩").length, x = d ? u.filter((p) => p.type === "书" || p.type === "詩").length : null;
4859
4856
  return /* @__PURE__ */ i("div", { children: [
4860
4857
  /* @__PURE__ */ i("div", { style: {
4861
4858
  display: "flex",
@@ -4911,19 +4908,19 @@ function Ct(e) {
4911
4908
  }
4912
4909
  function Ko(e) {
4913
4910
  const { workId: n, transport: o, files: r, activeFile: a, activeJuan: l, activeRawText: c, query: s, isKaozhen: d } = e, u = me(), g = Q(/* @__PURE__ */ new Map()), [f, x] = w({});
4914
- P(() => {
4911
+ $(() => {
4915
4912
  a && l && g.current.set(a, { juan: l, rawText: c });
4916
- }, [a, l, c]), P(() => {
4913
+ }, [a, l, c]), $(() => {
4917
4914
  g.current.clear(), x({});
4918
4915
  }, [n]);
4919
- const p = U((b, S) => {
4916
+ const p = F((b, S) => {
4920
4917
  let h = 0;
4921
4918
  if (b.juan)
4922
4919
  for (const z of b.juan.sections)
4923
4920
  lt(z, S, d, u) && h++;
4924
4921
  return h === 0 && b.rawText && Bo(b.rawText, S, u) && (h = 1), h;
4925
4922
  }, [d, u]);
4926
- return P(() => {
4923
+ return $(() => {
4927
4924
  const b = s.trim();
4928
4925
  if (!b) {
4929
4926
  x({});
@@ -4933,31 +4930,31 @@ function Ko(e) {
4933
4930
  let S = !1;
4934
4931
  const h = {}, z = [];
4935
4932
  for (const _ of r) {
4936
- const m = g.current.get(_);
4937
- m ? h[_] = p(m, b) : (h[_] = "loading", z.push(_));
4933
+ const y = g.current.get(_);
4934
+ y ? h[_] = p(y, b) : (h[_] = "loading", z.push(_));
4938
4935
  }
4939
4936
  x(h);
4940
- const y = 8;
4937
+ const m = 8;
4941
4938
  let v = 0;
4942
4939
  const k = async () => {
4943
4940
  var _;
4944
4941
  for (; v < z.length; ) {
4945
4942
  if (S) return;
4946
- const m = v++, L = z[m];
4943
+ const y = v++, B = z[y];
4947
4944
  try {
4948
- const [W, $] = await Promise.all([
4949
- o.getCollatedJuan(n, L),
4950
- ((_ = o.getCollatedJuanText) == null ? void 0 : _.call(o, n, L)) ?? Promise.resolve(null)
4951
- ]), D = { juan: W, rawText: $ };
4952
- if (g.current.set(L, D), S) return;
4953
- x((A) => ({ ...A, [L]: p(D, b) }));
4945
+ const [W, E] = await Promise.all([
4946
+ o.getCollatedJuan(n, B),
4947
+ ((_ = o.getCollatedJuanText) == null ? void 0 : _.call(o, n, B)) ?? Promise.resolve(null)
4948
+ ]), O = { juan: W, rawText: E };
4949
+ if (g.current.set(B, O), S) return;
4950
+ x((A) => ({ ...A, [B]: p(O, b) }));
4954
4951
  } catch {
4955
4952
  if (S) return;
4956
- x((W) => ({ ...W, [L]: 0 }));
4953
+ x((W) => ({ ...W, [B]: 0 }));
4957
4954
  }
4958
4955
  }
4959
- }, T = Array.from({ length: Math.min(y, z.length) }, () => k());
4960
- return Promise.all(T), () => {
4956
+ }, I = Array.from({ length: Math.min(m, z.length) }, () => k());
4957
+ return Promise.all(I), () => {
4961
4958
  S = !0;
4962
4959
  };
4963
4960
  }, [s, n, o, r.join(","), p, u]), { matchStates: f };
@@ -4972,59 +4969,59 @@ const Yo = ({
4972
4969
  className: c,
4973
4970
  style: s
4974
4971
  }) => {
4975
- const [d, u] = w(null), [g, f] = w(!1), [x, p] = w(null), [b, S] = w(null), [h, z] = w(null), [y, v] = w(!1), [k, T] = w(null), [_, m] = w(""), L = Q(/* @__PURE__ */ new Map()), W = a ?? b, $ = U((C) => {
4972
+ const [d, u] = w(null), [g, f] = w(!1), [x, p] = w(null), [b, S] = w(null), [h, z] = w(null), [m, v] = w(!1), [k, I] = w(null), [_, y] = w(""), B = Q(/* @__PURE__ */ new Map()), W = a ?? b, E = F((C) => {
4976
4973
  S(C), l == null || l(C);
4977
- }, [l]), D = e || d;
4978
- P(() => {
4974
+ }, [l]), O = e || d;
4975
+ $(() => {
4979
4976
  e && (f(!1), p(null));
4980
- }, [e]), P(() => {
4977
+ }, [e]), $(() => {
4981
4978
  if (e || !n || !(o != null && o.getCollatedEditionIndex)) return;
4982
4979
  let C = !1;
4983
- return f(!0), p(null), o.getCollatedEditionIndex(n).then((B) => {
4980
+ return f(!0), p(null), o.getCollatedEditionIndex(n).then((R) => {
4984
4981
  if (!C)
4985
- if (!B)
4982
+ if (!R)
4986
4983
  p("未找到整理本数据");
4987
4984
  else {
4988
- u(B);
4989
- const Y = Ct(B);
4990
- !a && Y && $(Y);
4985
+ u(R);
4986
+ const P = Ct(R);
4987
+ !a && P && E(P);
4991
4988
  }
4992
- }).catch((B) => {
4993
- C || p(B instanceof Error ? B.message : "加载失败");
4989
+ }).catch((R) => {
4990
+ C || p(R instanceof Error ? R.message : "加载失败");
4994
4991
  }).finally(() => {
4995
4992
  C || f(!1);
4996
4993
  }), () => {
4997
4994
  C = !0;
4998
4995
  };
4999
- }, [e, n, o, a, $]), P(() => {
4996
+ }, [e, n, o, a, E]), $(() => {
5000
4997
  const C = e || d;
5001
4998
  if (C && !W) {
5002
- const B = Ct(C);
5003
- B && $(B);
4999
+ const R = Ct(C);
5000
+ R && E(R);
5004
5001
  }
5005
- }, [e, d, W, $]);
5006
- const A = n || (D == null ? void 0 : D.work_id), I = U(async (C) => {
5007
- var B;
5002
+ }, [e, d, W, E]);
5003
+ const A = n || (O == null ? void 0 : O.work_id), N = F(async (C) => {
5004
+ var R;
5008
5005
  if (!(!A || !(o != null && o.getCollatedJuan))) {
5009
- v(!0), z(null), T(null);
5006
+ v(!0), z(null), I(null);
5010
5007
  try {
5011
- const [Y, G] = await Promise.all([
5008
+ const [P, J] = await Promise.all([
5012
5009
  o.getCollatedJuan(A, C),
5013
- ((B = o.getCollatedJuanText) == null ? void 0 : B.call(o, A, C)) ?? Promise.resolve(null)
5010
+ ((R = o.getCollatedJuanText) == null ? void 0 : R.call(o, A, C)) ?? Promise.resolve(null)
5014
5011
  ]);
5015
- z(Y), T(G);
5012
+ z(P), I(J);
5016
5013
  } catch {
5017
- z(null), T(null);
5014
+ z(null), I(null);
5018
5015
  } finally {
5019
5016
  v(!1);
5020
5017
  }
5021
5018
  }
5022
5019
  }, [A, o]);
5023
- P(() => {
5024
- W && I(W);
5025
- }, [W, I]);
5026
- const E = (C) => {
5027
- $(C);
5020
+ $(() => {
5021
+ W && N(W);
5022
+ }, [W, N]);
5023
+ const U = (C) => {
5024
+ E(C);
5028
5025
  };
5029
5026
  if (g)
5030
5027
  return /* @__PURE__ */ t("div", { className: c, style: { ...s, padding: "24px" }, children: /* @__PURE__ */ t("div", { style: { color: "var(--bim-desc-fg, #717171)", fontSize: "13px" }, children: "加载整理本..." }) });
@@ -5036,27 +5033,27 @@ const Yo = ({
5036
5033
  color: "var(--bim-desc-fg, #717171)",
5037
5034
  fontSize: "13px"
5038
5035
  }, children: x });
5039
- if (!D) return null;
5040
- const O = D.type === "kaozhen", N = dn(D);
5036
+ if (!O) return null;
5037
+ const T = O.type === "kaozhen", D = dn(O);
5041
5038
  return /* @__PURE__ */ t(
5042
5039
  Go,
5043
5040
  {
5044
5041
  className: c,
5045
5042
  style: s,
5046
- index: D,
5047
- allFiles: N,
5048
- isKaozhen: O,
5043
+ index: O,
5044
+ allFiles: D,
5045
+ isKaozhen: T,
5049
5046
  effectiveWorkId: A,
5050
5047
  transport: o,
5051
5048
  activeFile: W,
5052
- handleSelectFile: E,
5049
+ handleSelectFile: U,
5053
5050
  juanData: h,
5054
5051
  juanRawText: k,
5055
- juanLoading: y,
5052
+ juanLoading: m,
5056
5053
  searchQuery: _,
5057
- setSearchQuery: m,
5054
+ setSearchQuery: y,
5058
5055
  onNavigate: r,
5059
- workLabelCacheRef: L
5056
+ workLabelCacheRef: B
5060
5057
  }
5061
5058
  );
5062
5059
  }, Go = ({
@@ -5153,7 +5150,7 @@ const Yo = ({
5153
5150
  })()
5154
5151
  ] }),
5155
5152
  /* @__PURE__ */ t(
5156
- Po,
5153
+ Ao,
5157
5154
  {
5158
5155
  files: r,
5159
5156
  groups: o.juan_groups,
@@ -5198,14 +5195,14 @@ const Yo = ({
5198
5195
  marginBottom: "8px",
5199
5196
  letterSpacing: "2px"
5200
5197
  }, children: "參考文獻" }),
5201
- o.references.map((z, y) => /* @__PURE__ */ i("div", { style: {
5198
+ o.references.map((z, m) => /* @__PURE__ */ i("div", { style: {
5202
5199
  fontSize: "12px",
5203
5200
  color: "var(--bim-desc-fg, #999)",
5204
5201
  lineHeight: 1.8,
5205
5202
  paddingLeft: "12px"
5206
5203
  }, children: [
5207
5204
  /* @__PURE__ */ i("span", { children: [
5208
- y + 1,
5205
+ m + 1,
5209
5206
  ". "
5210
5207
  ] }),
5211
5208
  z.url ? /* @__PURE__ */ t(
@@ -5231,7 +5228,7 @@ const Yo = ({
5231
5228
  "。",
5232
5229
  z.note
5233
5230
  ] })
5234
- ] }, y))
5231
+ ] }, m))
5235
5232
  ] })
5236
5233
  ] });
5237
5234
  }, Jo = {
@@ -5331,63 +5328,63 @@ const Xo = ({ items: e, loading: n }) => {
5331
5328
  onTabChange: a,
5332
5329
  feedbackApiUrl: l
5333
5330
  }) => {
5334
- const c = H(), [s, d] = w(null), [u, g] = w([]), [f, x] = w("recommend"), [p, b] = w([]), [S, h] = w(!1), z = r ?? f, y = (A) => {
5331
+ const c = H(), [s, d] = w(null), [u, g] = w([]), [f, x] = w("recommend"), [p, b] = w([]), [S, h] = w(!1), z = r ?? f, m = (A) => {
5335
5332
  x(A), a == null || a(A);
5336
- }, [v, k] = w(!0), [T, _] = w(null), [m, L] = w(null), [W, $] = w(null);
5337
- P(() => {
5333
+ }, [v, k] = w(!0), [I, _] = w(null), [y, B] = w(null), [W, E] = w(null);
5334
+ $(() => {
5338
5335
  let A = !1;
5339
- const I = (O) => {
5340
- A || d(O);
5341
- }, E = () => {
5342
- e.getAllEntries && e.getAllEntries().then((O) => {
5343
- I({
5344
- works: O.filter((N) => N.type === "work").length,
5345
- books: O.filter((N) => N.type === "book").length,
5346
- collections: O.filter((N) => N.type === "collection").length
5336
+ const N = (T) => {
5337
+ A || d(T);
5338
+ }, U = () => {
5339
+ e.getAllEntries && e.getAllEntries().then((T) => {
5340
+ N({
5341
+ works: T.filter((D) => D.type === "work").length,
5342
+ books: T.filter((D) => D.type === "book").length,
5343
+ collections: T.filter((D) => D.type === "collection").length
5347
5344
  });
5348
5345
  }).catch(() => {
5349
5346
  });
5350
5347
  };
5351
- return e.getCounts ? e.getCounts().then((O) => I({ works: O.works, books: O.books, collections: O.collections })).catch(E) : E(), () => {
5348
+ return e.getCounts ? e.getCounts().then((T) => N({ works: T.works, books: T.books, collections: T.collections })).catch(U) : U(), () => {
5352
5349
  A = !0;
5353
5350
  };
5354
- }, [e]), P(() => {
5351
+ }, [e]), $(() => {
5355
5352
  let A = !1;
5356
5353
  return (async () => {
5357
5354
  if (o) return o;
5358
5355
  if (e.getRecommended)
5359
5356
  try {
5360
- const E = await e.getRecommended();
5361
- if (E != null && E.groups)
5362
- return E.groups.flatMap(
5363
- (O) => O.items.map((N) => ({ ...N, group: O.name }))
5357
+ const U = await e.getRecommended();
5358
+ if (U != null && U.groups)
5359
+ return U.groups.flatMap(
5360
+ (T) => T.items.map((D) => ({ ...D, group: T.name }))
5364
5361
  );
5365
5362
  } catch {
5366
5363
  }
5367
5364
  return [];
5368
- })().then(async (E) => {
5365
+ })().then(async (U) => {
5369
5366
  if (A) return;
5370
- const O = E.filter((C) => C.id);
5371
- if (O.length === 0) {
5367
+ const T = U.filter((C) => C.id);
5368
+ if (T.length === 0) {
5372
5369
  k(!1);
5373
5370
  return;
5374
5371
  }
5375
- const N = await Promise.all(
5376
- O.map(async (C) => {
5372
+ const D = await Promise.all(
5373
+ T.map(async (C) => {
5377
5374
  try {
5378
- let B = null;
5375
+ let R = null;
5379
5376
  if (e.getEntry)
5380
- B = await e.getEntry(C.id);
5377
+ R = await e.getEntry(C.id);
5381
5378
  else {
5382
- const Y = await e.getItem(C.id);
5383
- Y && (B = {
5379
+ const P = await e.getItem(C.id);
5380
+ P && (R = {
5384
5381
  id: C.id,
5385
- title: Y.title || C.id,
5386
- type: Y.type || "work"
5382
+ title: P.title || C.id,
5383
+ type: P.type || "work"
5387
5384
  });
5388
5385
  }
5389
- if (B)
5390
- return { ...B, group: C.group, fallbackDescription: C.description };
5386
+ if (R)
5387
+ return { ...R, group: C.group, fallbackDescription: C.description };
5391
5388
  } catch {
5392
5389
  }
5393
5390
  return {
@@ -5399,43 +5396,43 @@ const Xo = ({ items: e, loading: n }) => {
5399
5396
  };
5400
5397
  })
5401
5398
  );
5402
- A || (g(N.filter((C) => C !== null)), k(!1));
5399
+ A || (g(D.filter((C) => C !== null)), k(!1));
5403
5400
  }), () => {
5404
5401
  A = !0;
5405
5402
  };
5406
- }, [e, o]), P(() => {
5403
+ }, [e, o]), $(() => {
5407
5404
  let A = !1;
5408
- const I = e.getCatalogProgress ?? e.getResourceProgress;
5409
- if (I)
5410
- return I.call(e).then((E) => {
5411
- A || _(E);
5405
+ const N = e.getCatalogProgress ?? e.getResourceProgress;
5406
+ if (N)
5407
+ return N.call(e).then((U) => {
5408
+ A || _(U);
5412
5409
  }).catch(() => {
5413
5410
  }), () => {
5414
5411
  A = !0;
5415
5412
  };
5416
- }, [e]), P(() => {
5413
+ }, [e]), $(() => {
5417
5414
  if (!e.getCollectionProgress) return;
5418
5415
  let A = !1;
5419
- return e.getCollectionProgress().then((I) => {
5420
- A || L(I);
5416
+ return e.getCollectionProgress().then((N) => {
5417
+ A || B(N);
5421
5418
  }).catch(() => {
5422
5419
  }), () => {
5423
5420
  A = !0;
5424
5421
  };
5425
- }, [e]), P(() => {
5422
+ }, [e]), $(() => {
5426
5423
  if (!e.getSiteProgress) return;
5427
5424
  let A = !1;
5428
- return e.getSiteProgress().then((I) => {
5429
- A || $(I);
5425
+ return e.getSiteProgress().then((N) => {
5426
+ A || E(N);
5430
5427
  }).catch(() => {
5431
5428
  }), () => {
5432
5429
  A = !0;
5433
5430
  };
5434
- }, [e]), P(() => {
5431
+ }, [e]), $(() => {
5435
5432
  if (!l || z !== "feedback") return;
5436
5433
  let A = !1;
5437
- return h(!0), fetch(l).then((I) => I.json()).then((I) => {
5438
- !A && I.success && b(I.items || []);
5434
+ return h(!0), fetch(l).then((N) => N.json()).then((N) => {
5435
+ !A && N.success && b(N.items || []);
5439
5436
  }).catch(() => {
5440
5437
  }).finally(() => {
5441
5438
  A || h(!1);
@@ -5443,7 +5440,7 @@ const Xo = ({ items: e, loading: n }) => {
5443
5440
  A = !0;
5444
5441
  };
5445
5442
  }, [l, z]);
5446
- const D = (A) => {
5443
+ const O = (A) => {
5447
5444
  switch (A) {
5448
5445
  case "work":
5449
5446
  return "✍️";
@@ -5475,7 +5472,7 @@ const Xo = ({ items: e, loading: n }) => {
5475
5472
  {
5476
5473
  label: c.home.recommendTab,
5477
5474
  active: z === "recommend",
5478
- onClick: () => y("recommend")
5475
+ onClick: () => m("recommend")
5479
5476
  }
5480
5477
  ),
5481
5478
  /* @__PURE__ */ t(
@@ -5483,7 +5480,7 @@ const Xo = ({ items: e, loading: n }) => {
5483
5480
  {
5484
5481
  label: c.home.catalogTab,
5485
5482
  active: z === "catalog",
5486
- onClick: () => y("catalog")
5483
+ onClick: () => m("catalog")
5487
5484
  }
5488
5485
  ),
5489
5486
  /* @__PURE__ */ t(
@@ -5491,7 +5488,7 @@ const Xo = ({ items: e, loading: n }) => {
5491
5488
  {
5492
5489
  label: c.home.collectionTab,
5493
5490
  active: z === "collection",
5494
- onClick: () => y("collection")
5491
+ onClick: () => m("collection")
5495
5492
  }
5496
5493
  ),
5497
5494
  /* @__PURE__ */ t(
@@ -5499,7 +5496,7 @@ const Xo = ({ items: e, loading: n }) => {
5499
5496
  {
5500
5497
  label: c.home.siteTab,
5501
5498
  active: z === "site",
5502
- onClick: () => y("site")
5499
+ onClick: () => m("site")
5503
5500
  }
5504
5501
  ),
5505
5502
  l && /* @__PURE__ */ t(
@@ -5507,7 +5504,7 @@ const Xo = ({ items: e, loading: n }) => {
5507
5504
  {
5508
5505
  label: c.home.feedbackTab,
5509
5506
  active: z === "feedback",
5510
- onClick: () => y("feedback")
5507
+ onClick: () => m("feedback")
5511
5508
  }
5512
5509
  )
5513
5510
  ] }),
@@ -5517,12 +5514,12 @@ const Xo = ({ items: e, loading: n }) => {
5517
5514
  recommended: u,
5518
5515
  loading: v,
5519
5516
  onNavigate: n,
5520
- getIcon: D,
5517
+ getIcon: O,
5521
5518
  t: c
5522
5519
  }
5523
5520
  ),
5524
- z === "catalog" && /* @__PURE__ */ t(Lt, { progress: T, t: c, onNavigate: n }),
5525
- z === "collection" && /* @__PURE__ */ t(Lt, { progress: m, t: c, onNavigate: n }),
5521
+ z === "catalog" && /* @__PURE__ */ t(Lt, { progress: I, t: c, onNavigate: n }),
5522
+ z === "collection" && /* @__PURE__ */ t(Lt, { progress: y, t: c, onNavigate: n }),
5526
5523
  z === "site" && /* @__PURE__ */ t(sr, { progress: W, t: c, totalWorks: (s == null ? void 0 : s.works) ?? 0 }),
5527
5524
  z === "feedback" && l && /* @__PURE__ */ t(Xo, { items: p, loading: S })
5528
5525
  ] }) });
@@ -5782,7 +5779,7 @@ const Xo = ({ items: e, loading: n }) => {
5782
5779
  }, Wt = "(max-width: 768px)";
5783
5780
  function dr() {
5784
5781
  const [e, n] = w(() => typeof window > "u" ? !1 : window.matchMedia(Wt).matches);
5785
- return P(() => {
5782
+ return $(() => {
5786
5783
  const o = window.matchMedia(Wt), r = (a) => n(a.matches);
5787
5784
  return o.addEventListener("change", r), () => o.removeEventListener("change", r);
5788
5785
  }, []), e;
@@ -5794,22 +5791,22 @@ const _i = ({
5794
5791
  recommendedIds: r,
5795
5792
  headerRight: a
5796
5793
  }) => {
5797
- var N;
5798
- const l = H(), { convert: c } = K(), s = dr(), [d, u] = w(null), [g, f] = w(null), [x, p] = w(!1), [b, S] = w("detail"), [h, z] = w([]), [y, v] = w(!1), [k, T] = w(null), [_, m] = w(!1), L = U(async (C) => {
5794
+ var D;
5795
+ const l = H(), { convert: c } = Y(), s = dr(), [d, u] = w(null), [g, f] = w(null), [x, p] = w(!1), [b, S] = w("detail"), [h, z] = w([]), [m, v] = w(!1), [k, I] = w(null), [_, y] = w(!1), B = F(async (C) => {
5799
5796
  if (!e.getCollatedEditionIndex) {
5800
- T(null);
5797
+ I(null);
5801
5798
  return;
5802
5799
  }
5803
- m(!0);
5800
+ y(!0);
5804
5801
  try {
5805
- const B = await e.getCollatedEditionIndex(C);
5806
- T(B);
5802
+ const R = await e.getCollatedEditionIndex(C);
5803
+ I(R);
5807
5804
  } catch {
5808
- T(null);
5805
+ I(null);
5809
5806
  } finally {
5810
- m(!1);
5807
+ y(!1);
5811
5808
  }
5812
- }, [e]), W = U(async (C) => {
5809
+ }, [e]), W = F(async (C) => {
5813
5810
  if (!e.getCollectionCatalogs && !e.getCollectionCatalog) {
5814
5811
  z([]);
5815
5812
  return;
@@ -5817,48 +5814,48 @@ const _i = ({
5817
5814
  v(!0);
5818
5815
  try {
5819
5816
  if (e.getCollectionCatalogs) {
5820
- const B = await e.getCollectionCatalogs(C);
5821
- z(B || []);
5817
+ const R = await e.getCollectionCatalogs(C);
5818
+ z(R || []);
5822
5819
  } else if (e.getCollectionCatalog) {
5823
- const B = await e.getCollectionCatalog(C);
5824
- z(B ? [{ resource_id: "", data: B }] : []);
5820
+ const R = await e.getCollectionCatalog(C);
5821
+ z(R ? [{ resource_id: "", data: R }] : []);
5825
5822
  }
5826
5823
  } catch {
5827
5824
  z([]);
5828
5825
  } finally {
5829
5826
  v(!1);
5830
5827
  }
5831
- }, [e]), $ = U(async (C) => {
5828
+ }, [e]), E = F(async (C) => {
5832
5829
  if (o) {
5833
5830
  o(C);
5834
5831
  return;
5835
5832
  }
5836
- u(C), f(null), z([]), T(null), S("detail"), p(!0);
5833
+ u(C), f(null), z([]), I(null), S("detail"), p(!0);
5837
5834
  try {
5838
- const B = await e.getItem(C.id);
5839
- B && (f(B), B.type === "collection" ? W(C.id) : B.type === "work" && B.has_collated && L(C.id));
5840
- } catch (B) {
5841
- console.error("加载详情失败:", B);
5835
+ const R = await e.getItem(C.id);
5836
+ R && (f(R), R.type === "collection" ? W(C.id) : R.type === "work" && R.has_collated && B(C.id));
5837
+ } catch (R) {
5838
+ console.error("加载详情失败:", R);
5842
5839
  } finally {
5843
5840
  p(!1);
5844
5841
  }
5845
- }, [e, o, W, L]), D = U(async (C) => {
5846
- f(null), z([]), T(null), S("detail"), p(!0);
5842
+ }, [e, o, W, B]), O = F(async (C) => {
5843
+ f(null), z([]), I(null), S("detail"), p(!0);
5847
5844
  try {
5848
- const B = await e.getItem(C);
5849
- B && (f(B), u({
5845
+ const R = await e.getItem(C);
5846
+ R && (f(R), u({
5850
5847
  id: C,
5851
- title: B.title || C,
5852
- type: B.type || "book"
5853
- }), B.type === "collection" ? W(C) : B.type === "work" && B.has_collated && L(C));
5854
- } catch (B) {
5855
- console.error("导航失败:", B);
5848
+ title: R.title || C,
5849
+ type: R.type || "book"
5850
+ }), R.type === "collection" ? W(C) : R.type === "work" && R.has_collated && B(C));
5851
+ } catch (R) {
5852
+ console.error("导航失败:", R);
5856
5853
  } finally {
5857
5854
  p(!1);
5858
5855
  }
5859
- }, [e, W, L]), A = (g == null ? void 0 : g.type) === "collection" && (h.length > 0 || y) || (g == null ? void 0 : g.type) === "work" && (k || _), I = s && (x || g), E = U(() => {
5860
- u(null), f(null), z([]), T(null), S("detail");
5861
- }, []), O = /* @__PURE__ */ t(j, { children: x ? /* @__PURE__ */ t(Se, {}) : g ? /* @__PURE__ */ i(j, { children: [
5856
+ }, [e, W, B]), A = (g == null ? void 0 : g.type) === "collection" && (h.length > 0 || m) || (g == null ? void 0 : g.type) === "work" && (k || _), N = s && (x || g), U = F(() => {
5857
+ u(null), f(null), z([]), I(null), S("detail");
5858
+ }, []), T = /* @__PURE__ */ t(j, { children: x ? /* @__PURE__ */ t(Se, {}) : g ? /* @__PURE__ */ i(j, { children: [
5862
5859
  (A || a) && /* @__PURE__ */ i("div", { style: {
5863
5860
  display: "flex",
5864
5861
  alignItems: "center",
@@ -5877,7 +5874,7 @@ const _i = ({
5877
5874
  children: l.detailTab.basicInfo
5878
5875
  }
5879
5876
  ),
5880
- g.type === "collection" && y && h.length === 0 && /* @__PURE__ */ i(
5877
+ g.type === "collection" && m && h.length === 0 && /* @__PURE__ */ i(
5881
5878
  "button",
5882
5879
  {
5883
5880
  onClick: () => {
@@ -5917,13 +5914,13 @@ const _i = ({
5917
5914
  {
5918
5915
  data: g,
5919
5916
  transport: e,
5920
- onNavigate: D
5917
+ onNavigate: O
5921
5918
  }
5922
5919
  ) : b.startsWith("catalog:") ? /* @__PURE__ */ t(
5923
5920
  _o,
5924
5921
  {
5925
- data: (N = h.find((C) => `catalog:${C.resource_id}` === b)) == null ? void 0 : N.data,
5926
- onNavigate: D
5922
+ data: (D = h.find((C) => `catalog:${C.resource_id}` === b)) == null ? void 0 : D.data,
5923
+ onNavigate: O
5927
5924
  }
5928
5925
  ) : b === "collated" ? /* @__PURE__ */ t(
5929
5926
  Yo,
@@ -5931,14 +5928,14 @@ const _i = ({
5931
5928
  index: k || void 0,
5932
5929
  workId: g.id,
5933
5930
  transport: e,
5934
- onNavigate: D
5931
+ onNavigate: O
5935
5932
  }
5936
5933
  ) : null })
5937
5934
  ] }) : /* @__PURE__ */ t(
5938
5935
  Rt,
5939
5936
  {
5940
5937
  transport: e,
5941
- onNavigate: D,
5938
+ onNavigate: O,
5942
5939
  recommendedIds: r
5943
5940
  }
5944
5941
  ) });
@@ -5949,7 +5946,7 @@ const _i = ({
5949
5946
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif',
5950
5947
  background: "var(--bim-bg, #f5f5f5)",
5951
5948
  color: "var(--bim-fg, #333)"
5952
- }, children: I ? /* @__PURE__ */ i(j, { children: [
5949
+ }, children: N ? /* @__PURE__ */ i(j, { children: [
5953
5950
  /* @__PURE__ */ t("div", { style: {
5954
5951
  padding: "8px 12px",
5955
5952
  borderBottom: "1px solid var(--bim-widget-border, #e0e0e0)",
@@ -5958,7 +5955,7 @@ const _i = ({
5958
5955
  }, children: /* @__PURE__ */ i(
5959
5956
  "button",
5960
5957
  {
5961
- onClick: E,
5958
+ onClick: U,
5962
5959
  style: {
5963
5960
  padding: "4px 12px",
5964
5961
  border: "1px solid var(--bim-widget-border, #e0e0e0)",
@@ -5974,13 +5971,13 @@ const _i = ({
5974
5971
  ]
5975
5972
  }
5976
5973
  ) }),
5977
- /* @__PURE__ */ t("div", { style: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: O })
5974
+ /* @__PURE__ */ t("div", { style: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: T })
5978
5975
  ] }) : /* @__PURE__ */ i("div", { style: { flex: 1, overflow: "auto" }, children: [
5979
5976
  /* @__PURE__ */ t(
5980
5977
  mt,
5981
5978
  {
5982
5979
  transport: e,
5983
- onEntryClick: $,
5980
+ onEntryClick: E,
5984
5981
  hideModeIndicator: n
5985
5982
  }
5986
5983
  ),
@@ -5988,7 +5985,7 @@ const _i = ({
5988
5985
  Rt,
5989
5986
  {
5990
5987
  transport: e,
5991
- onNavigate: D,
5988
+ onNavigate: O,
5992
5989
  recommendedIds: r
5993
5990
  }
5994
5991
  )
@@ -6011,11 +6008,11 @@ const _i = ({
6011
6008
  mt,
6012
6009
  {
6013
6010
  transport: e,
6014
- onEntryClick: $,
6011
+ onEntryClick: E,
6015
6012
  hideModeIndicator: n
6016
6013
  }
6017
6014
  ) }) }),
6018
- /* @__PURE__ */ t("div", { style: { flex: 1, overflow: "auto", background: "var(--bim-bg, #f5f5f5)", display: "flex", flexDirection: "column" }, children: O })
6015
+ /* @__PURE__ */ t("div", { style: { flex: 1, overflow: "auto", background: "var(--bim-bg, #f5f5f5)", display: "flex", flexDirection: "column" }, children: T })
6019
6016
  ] });
6020
6017
  };
6021
6018
  function je(e) {
@@ -6037,7 +6034,7 @@ const zi = ({
6037
6034
  style: r
6038
6035
  }) => {
6039
6036
  var g;
6040
- const a = H(), { convert: l } = K(), [c, s] = w(((g = e.divisions[0]) == null ? void 0 : g.name) ?? null), [d, u] = w(null);
6037
+ const a = H(), { convert: l } = Y(), [c, s] = w(((g = e.divisions[0]) == null ? void 0 : g.name) ?? null), [d, u] = w(null);
6041
6038
  return /* @__PURE__ */ i("div", { className: o, style: r, children: [
6042
6039
  /* @__PURE__ */ i("div", { style: { marginBottom: "16px" }, children: [
6043
6040
  /* @__PURE__ */ t("h2", { style: { fontSize: "18px", fontWeight: 600, color: "var(--bim-fg, #1a1a1a)", margin: "0 0 8px" }, children: l(e.title) }),
@@ -6081,7 +6078,7 @@ const zi = ({
6081
6078
  )) })
6082
6079
  ] });
6083
6080
  }, pr = ({ division: e, expanded: n, onToggle: o, expandedCat: r, onCatToggle: a, onNavigate: l }) => {
6084
- const { convert: c } = K(), s = e.categories.reduce((d, u) => {
6081
+ const { convert: c } = Y(), s = e.categories.reduce((d, u) => {
6085
6082
  const g = u.stats || { zhulu: 0, cunmu: 0 };
6086
6083
  return d + (g.zhulu || 0) + (g.cunmu || 0);
6087
6084
  }, 0);
@@ -6136,7 +6133,7 @@ const zi = ({
6136
6133
  ] });
6137
6134
  }, ur = ({ category: e, expanded: n, onToggle: o, onNavigate: r }) => {
6138
6135
  var d, u, g, f;
6139
- const { convert: a } = K(), l = ((d = e.books) == null ? void 0 : d.zhulu) || [], c = ((u = e.books) == null ? void 0 : u.cunmu) || [], s = (((g = e.stats) == null ? void 0 : g.zhulu) || l.length) + (((f = e.stats) == null ? void 0 : f.cunmu) || c.length);
6136
+ const { convert: a } = Y(), l = ((d = e.books) == null ? void 0 : d.zhulu) || [], c = ((u = e.books) == null ? void 0 : u.cunmu) || [], s = (((g = e.stats) == null ? void 0 : g.zhulu) || l.length) + (((f = e.stats) == null ? void 0 : f.cunmu) || c.length);
6140
6137
  return /* @__PURE__ */ i("div", { children: [
6141
6138
  /* @__PURE__ */ i(
6142
6139
  "button",
@@ -6177,7 +6174,7 @@ const zi = ({
6177
6174
  ] })
6178
6175
  ] });
6179
6176
  }, Et = ({ label: e, books: n, onNavigate: o }) => {
6180
- const { convert: r } = K(), a = de(), [l, c] = w(n.length <= 20), s = l ? n : n.slice(0, 10);
6177
+ const { convert: r } = Y(), a = de(), [l, c] = w(n.length <= 20), s = l ? n : n.slice(0, 10);
6181
6178
  return /* @__PURE__ */ i("div", { style: { marginBottom: "8px" }, children: [
6182
6179
  /* @__PURE__ */ i("div", { style: { fontSize: "11px", color: "var(--bim-desc-fg, #999)", marginBottom: "4px", fontWeight: 500 }, children: [
6183
6180
  e,
@@ -6264,7 +6261,7 @@ const zi = ({
6264
6261
  background: "transparent",
6265
6262
  color: "var(--bim-fg, #333)",
6266
6263
  cursor: "pointer"
6267
- }, le = ({ label: e, value: n, onChange: o, placeholder: r, disabled: a }) => /* @__PURE__ */ i("div", { style: { marginBottom: "16px" }, children: [
6264
+ }, ae = ({ label: e, value: n, onChange: o, placeholder: r, disabled: a }) => /* @__PURE__ */ i("div", { style: { marginBottom: "16px" }, children: [
6268
6265
  /* @__PURE__ */ t("label", { style: {
6269
6266
  display: "block",
6270
6267
  fontSize: "11px",
@@ -6295,7 +6292,7 @@ const zi = ({
6295
6292
  )
6296
6293
  ] }), ze = ({ value: e, onChange: n, placeholder: o }) => {
6297
6294
  const r = Q(null);
6298
- return P(() => {
6295
+ return $(() => {
6299
6296
  r.current && (r.current.style.height = "auto", r.current.style.height = `${r.current.scrollHeight}px`);
6300
6297
  }, [e]), /* @__PURE__ */ t(
6301
6298
  "textarea",
@@ -6339,7 +6336,7 @@ function hr(e) {
6339
6336
  }
6340
6337
  const Qe = ({ value: e, onChange: n, label: o }) => {
6341
6338
  const [r, a] = w(!1), l = Q(null), c = hr(e || "");
6342
- return P(() => {
6339
+ return $(() => {
6343
6340
  r && l.current && l.current.focus();
6344
6341
  }, [r]), !r && c ? /* @__PURE__ */ i("div", { style: { marginBottom: "16px" }, children: [
6345
6342
  /* @__PURE__ */ t("label", { style: $t, children: o }),
@@ -6469,12 +6466,12 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
6469
6466
  !f.type && /* @__PURE__ */ i("div", { children: [
6470
6467
  /* @__PURE__ */ t("label", { style: be, children: r.editor.selectSourceType }),
6471
6468
  /* @__PURE__ */ i("div", { style: { display: "flex", gap: "8px", marginTop: "8px" }, children: [
6472
- /* @__PURE__ */ i("button", { onClick: () => u(x, "bookID"), style: { ...Pt, borderColor: "#4caf50", color: "#4caf50" }, children: [
6469
+ /* @__PURE__ */ i("button", { onClick: () => u(x, "bookID"), style: { ...At, borderColor: "#4caf50", color: "#4caf50" }, children: [
6473
6470
  /* @__PURE__ */ t("span", { style: { fontSize: "18px" }, children: "📚" }),
6474
6471
  /* @__PURE__ */ t("span", { children: "Book ID" }),
6475
6472
  /* @__PURE__ */ t("span", { style: { fontSize: "11px", opacity: 0.7 }, children: r.editor.fromExistingBook })
6476
6473
  ] }),
6477
- /* @__PURE__ */ i("button", { onClick: () => u(x, "url"), style: { ...Pt, borderColor: "#2196f3", color: "#2196f3" }, children: [
6474
+ /* @__PURE__ */ i("button", { onClick: () => u(x, "url"), style: { ...At, borderColor: "#2196f3", color: "#2196f3" }, children: [
6478
6475
  /* @__PURE__ */ t("span", { style: { fontSize: "18px" }, children: "🔗" }),
6479
6476
  /* @__PURE__ */ t("span", { children: "URL" }),
6480
6477
  /* @__PURE__ */ t("span", { style: { fontSize: "11px", opacity: 0.7 }, children: r.editor.enterUrl })
@@ -6487,7 +6484,7 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
6487
6484
  /* @__PURE__ */ t("button", { onClick: () => {
6488
6485
  const p = [...e];
6489
6486
  p[x] = { ...p[x], type: "", id: "", name: "" }, n(p);
6490
- }, style: At, children: r.action.changeType })
6487
+ }, style: Pt, children: r.action.changeType })
6491
6488
  ] }),
6492
6489
  f.id && f.name ? /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: "8px", padding: "10px 14px", background: "var(--bim-bg, #fff)", border: "1px solid #4caf50", borderRadius: "6px" }, children: [
6493
6490
  /* @__PURE__ */ t("span", { style: { color: "#4caf50", fontSize: "16px" }, children: "✓" }),
@@ -6508,7 +6505,7 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
6508
6505
  /* @__PURE__ */ t("button", { onClick: () => {
6509
6506
  const p = [...e];
6510
6507
  p[x] = { ...p[x], type: "", id: "", name: "" }, n(p);
6511
- }, style: At, children: r.action.changeType })
6508
+ }, style: Pt, children: r.action.changeType })
6512
6509
  ] }),
6513
6510
  /* @__PURE__ */ t("input", { type: "text", value: f.name, onChange: (p) => d(x, "name", p.target.value), placeholder: r.editor.sourceNamePlaceholder, style: we })
6514
6511
  ] }),
@@ -6575,7 +6572,7 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
6575
6572
  borderRadius: "2px",
6576
6573
  fontSize: "13px",
6577
6574
  boxSizing: "border-box"
6578
- }, Pt = {
6575
+ }, At = {
6579
6576
  flex: 1,
6580
6577
  display: "flex",
6581
6578
  flexDirection: "column",
@@ -6589,7 +6586,7 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
6589
6586
  fontSize: "13px",
6590
6587
  fontWeight: 500,
6591
6588
  transition: "all 0.2s"
6592
- }, At = {
6589
+ }, Pt = {
6593
6590
  background: "transparent",
6594
6591
  border: "none",
6595
6592
  color: "var(--bim-link-fg, #0066cc)",
@@ -6929,7 +6926,7 @@ const Sr = {
6929
6926
  excludeId: u
6930
6927
  }) => {
6931
6928
  const [g, f] = w(""), x = u ? c.filter((h) => h.id !== u) : c;
6932
- P(() => {
6929
+ $(() => {
6933
6930
  e && (f(""), s(""));
6934
6931
  }, [e]);
6935
6932
  const p = (h) => {
@@ -7048,7 +7045,7 @@ const Sr = {
7048
7045
  onCancel: l
7049
7046
  }) => {
7050
7047
  const [c, s] = w(""), d = Q(null);
7051
- P(() => {
7048
+ $(() => {
7052
7049
  e && (s((r == null ? void 0 : r.title) || ""), setTimeout(() => {
7053
7050
  var x, p;
7054
7051
  (x = d.current) == null || x.focus(), (p = d.current) == null || p.select();
@@ -7118,9 +7115,9 @@ const Sr = {
7118
7115
  ] })
7119
7116
  ] }),
7120
7117
  /* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "flex-end", gap: "8px" }, children: [
7121
- /* @__PURE__ */ t("button", { onClick: l, style: Pr, children: "取消" }),
7118
+ /* @__PURE__ */ t("button", { onClick: l, style: Ar, children: "取消" }),
7122
7119
  /* @__PURE__ */ t("button", { onClick: g, disabled: !c.trim(), style: {
7123
- ...Ar,
7120
+ ...Pr,
7124
7121
  opacity: c.trim() ? 1 : 0.6,
7125
7122
  cursor: c.trim() ? "pointer" : "not-allowed"
7126
7123
  }, children: "创建" })
@@ -7155,7 +7152,7 @@ const Sr = {
7155
7152
  color: "var(--bim-input-fg, #333)",
7156
7153
  outline: "none",
7157
7154
  boxSizing: "border-box"
7158
- }, Pr = {
7155
+ }, Ar = {
7159
7156
  padding: "8px 16px",
7160
7157
  fontSize: "13px",
7161
7158
  border: "1px solid var(--bim-widget-border, #e0e0e0)",
@@ -7163,7 +7160,7 @@ const Sr = {
7163
7160
  background: "transparent",
7164
7161
  color: "var(--bim-fg, #333)",
7165
7162
  cursor: "pointer"
7166
- }, Ar = {
7163
+ }, Pr = {
7167
7164
  padding: "8px 16px",
7168
7165
  fontSize: "13px",
7169
7166
  border: "none",
@@ -7220,15 +7217,15 @@ const Or = ({
7220
7217
  onCreate: u,
7221
7218
  onSearch: g
7222
7219
  }) => {
7223
- const [f, x] = w(""), [p, b] = w([]), [S, h] = w(!1), [z, y] = w("recent");
7224
- P(() => {
7225
- e && (x(""), b([]), y(r.length > 0 ? "recent" : "search"));
7226
- }, [e, r.length]), P(() => {
7220
+ const [f, x] = w(""), [p, b] = w([]), [S, h] = w(!1), [z, m] = w("recent");
7221
+ $(() => {
7222
+ e && (x(""), b([]), m(r.length > 0 ? "recent" : "search"));
7223
+ }, [e, r.length]), $(() => {
7227
7224
  if (!f.trim()) {
7228
7225
  b([]);
7229
7226
  return;
7230
7227
  }
7231
- const L = setTimeout(async () => {
7228
+ const B = setTimeout(async () => {
7232
7229
  h(!0);
7233
7230
  try {
7234
7231
  b(await g(f, o));
@@ -7238,16 +7235,16 @@ const Or = ({
7238
7235
  h(!1);
7239
7236
  }
7240
7237
  }, 300);
7241
- return () => clearTimeout(L);
7238
+ return () => clearTimeout(B);
7242
7239
  }, [f, o, g]);
7243
- const v = U((L) => {
7244
- x(L.target.value), L.target.value.trim() && y("search");
7245
- }, []), k = U((L) => a ? L.filter((W) => W.id !== a) : L, [a]);
7240
+ const v = F((B) => {
7241
+ x(B.target.value), B.target.value.trim() && m("search");
7242
+ }, []), k = F((B) => a ? B.filter((W) => W.id !== a) : B, [a]);
7246
7243
  if (!e) return null;
7247
- const T = n || (o === "all" ? "选择实体" : `选择${un(o)}`), _ = k(r), m = k(p);
7244
+ const I = n || (o === "all" ? "选择实体" : `选择${un(o)}`), _ = k(r), y = k(p);
7248
7245
  return /* @__PURE__ */ t("div", { style: jr, children: /* @__PURE__ */ i("div", { style: Fr, children: [
7249
7246
  /* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", padding: "16px 20px", borderBottom: "1px solid var(--bim-widget-border, #e0e0e0)" }, children: [
7250
- /* @__PURE__ */ t("div", { style: { fontSize: "15px", fontWeight: 600 }, children: T }),
7247
+ /* @__PURE__ */ t("div", { style: { fontSize: "15px", fontWeight: 600 }, children: I }),
7251
7248
  /* @__PURE__ */ t("button", { onClick: d, style: Ur, children: "✕" })
7252
7249
  ] }),
7253
7250
  /* @__PURE__ */ t("div", { style: { padding: "16px 20px 12px" }, children: /* @__PURE__ */ i("div", { style: { position: "relative" }, children: [
@@ -7266,17 +7263,17 @@ const Or = ({
7266
7263
  S && /* @__PURE__ */ t("span", { style: { position: "absolute", right: "14px", top: "50%", transform: "translateY(-50%)", fontSize: "12px", opacity: 0.6 }, children: "搜索中..." })
7267
7264
  ] }) }),
7268
7265
  _.length > 0 && /* @__PURE__ */ i("div", { style: { display: "flex", padding: "0 20px", gap: "4px", borderBottom: "1px solid var(--bim-widget-border, #e0e0e0)" }, children: [
7269
- /* @__PURE__ */ i(Ot, { active: z === "recent", onClick: () => y("recent"), children: [
7266
+ /* @__PURE__ */ i(Ot, { active: z === "recent", onClick: () => m("recent"), children: [
7270
7267
  "最近使用 (",
7271
7268
  _.length,
7272
7269
  ")"
7273
7270
  ] }),
7274
- /* @__PURE__ */ i(Ot, { active: z === "search", onClick: () => y("search"), children: [
7271
+ /* @__PURE__ */ i(Ot, { active: z === "search", onClick: () => m("search"), children: [
7275
7272
  "搜索结果 ",
7276
- m.length > 0 && `(${m.length})`
7273
+ y.length > 0 && `(${y.length})`
7277
7274
  ] })
7278
7275
  ] }),
7279
- /* @__PURE__ */ t("div", { style: { flex: 1, overflowY: "auto", padding: "12px 20px", minHeight: "200px", maxHeight: "400px" }, children: z === "recent" && _.length > 0 ? /* @__PURE__ */ t(Dt, { entities: _, onSelect: s }) : f.trim() ? S ? /* @__PURE__ */ t(tt, { message: "搜索中..." }) : m.length > 0 ? /* @__PURE__ */ t(Dt, { entities: m, onSelect: s }) : /* @__PURE__ */ t(tt, { message: "未找到匹配的结果" }) : /* @__PURE__ */ t(tt, { message: "输入关键词开始搜索" }) }),
7276
+ /* @__PURE__ */ t("div", { style: { flex: 1, overflowY: "auto", padding: "12px 20px", minHeight: "200px", maxHeight: "400px" }, children: z === "recent" && _.length > 0 ? /* @__PURE__ */ t(Dt, { entities: _, onSelect: s }) : f.trim() ? S ? /* @__PURE__ */ t(tt, { message: "搜索中..." }) : y.length > 0 ? /* @__PURE__ */ t(Dt, { entities: y, onSelect: s }) : /* @__PURE__ */ t(tt, { message: "未找到匹配的结果" }) : /* @__PURE__ */ t(tt, { message: "输入关键词开始搜索" }) }),
7280
7277
  l && u && /* @__PURE__ */ i("div", { style: { padding: "12px 20px", borderTop: "1px solid var(--bim-widget-border, #e0e0e0)", display: "flex", alignItems: "center", gap: "8px" }, children: [
7281
7278
  /* @__PURE__ */ t("span", { style: { fontSize: "12px", opacity: 0.7 }, children: "找不到?" }),
7282
7279
  /* @__PURE__ */ t("button", { onClick: u, style: Nr, children: c || "创建新实体" })
@@ -7389,42 +7386,42 @@ const Or = ({
7389
7386
  relations: f,
7390
7387
  onRelationsChange: x
7391
7388
  }) => {
7392
- var te;
7393
- const p = H(), [b, S] = w(!1), [h, z] = w("work"), [y, v] = w(""), [k, T] = w(""), [_, m] = w([]), [L, W] = w(!1), [$, D] = w(!1), [A, I] = w("work"), [E, O] = w(""), [N, C] = w(), [B, Y] = w(!1), [G, F] = w(null), [ce, oe] = w([]);
7389
+ var oe;
7390
+ const p = H(), [b, S] = w(!1), [h, z] = w("work"), [m, v] = w(""), [k, I] = w(""), [_, y] = w([]), [B, W] = w(!1), [E, O] = w(!1), [A, N] = w("work"), [U, T] = w(""), [D, C] = w(), [R, P] = w(!1), [J, V] = w(null), [ee, te] = w([]);
7394
7391
  Q(null);
7395
- const pe = e.type, ve = pe === "work", ye = pe === "collection", ee = pe === "book", X = U((R, V) => {
7396
- n({ ...e, [R]: V });
7397
- }, [e, n]), Ge = U((R, V) => {
7398
- v(R), z(V), T(p.editor.selectToLink + p.indexType[V]), m([]), S(!0);
7399
- }, [p]), Je = U((R) => {
7400
- r != null && r.unlinkEntity && r.unlinkEntity(e.id, R);
7401
- }, [r, e.id]), Te = U((R) => {
7402
- a == null || a(R.id, R.type);
7403
- }, [a]), Re = U((R, V, re) => {
7404
- const ue = { ...re, author: (re == null ? void 0 : re.author) || e.author, dynasty: (re == null ? void 0 : re.dynasty) || e.dynasty };
7405
- I(V), O(R), C(ue), D(!0);
7406
- }, [e.author, e.dynasty]), qe = U((R, V) => {
7407
- r != null && r.createAndLink && r.createAndLink(e.id, E, { type: A, title: R, inheritData: V }), D(!1);
7408
- }, [r, e.id, E, A]), He = U((R) => {
7409
- if (!R.trim()) {
7410
- m([]);
7392
+ const pe = e.type, ve = pe === "work", ye = pe === "collection", ne = pe === "book", X = F((L, K) => {
7393
+ n({ ...e, [L]: K });
7394
+ }, [e, n]), Ge = F((L, K) => {
7395
+ v(L), z(K), I(p.editor.selectToLink + p.indexType[K]), y([]), S(!0);
7396
+ }, [p]), Je = F((L) => {
7397
+ r != null && r.unlinkEntity && r.unlinkEntity(e.id, L);
7398
+ }, [r, e.id]), Te = F((L) => {
7399
+ a == null || a(L.id, L.type);
7400
+ }, [a]), Re = F((L, K, ie) => {
7401
+ const ue = { ...ie, author: (ie == null ? void 0 : ie.author) || e.author, dynasty: (ie == null ? void 0 : ie.dynasty) || e.dynasty };
7402
+ N(K), T(L), C(ue), O(!0);
7403
+ }, [e.author, e.dynasty]), qe = F((L, K) => {
7404
+ r != null && r.createAndLink && r.createAndLink(e.id, U, { type: A, title: L, inheritData: K }), O(!1);
7405
+ }, [r, e.id, U, A]), He = F((L) => {
7406
+ if (!L.trim()) {
7407
+ y([]);
7411
7408
  return;
7412
7409
  }
7413
- W(!0), r != null && r.searchEntities && r.searchEntities(R, h).then((V) => {
7414
- m(V), W(!1);
7410
+ W(!0), r != null && r.searchEntities && r.searchEntities(L, h).then((K) => {
7411
+ y(K), W(!1);
7415
7412
  }).catch(() => {
7416
- m([]), W(!1);
7413
+ y([]), W(!1);
7417
7414
  });
7418
- }, [r, h]), Ze = U((R) => {
7419
- r != null && r.linkEntity && r.linkEntity(e.id, y, R.id), S(!1);
7420
- }, [r, e.id, y]), M = U(() => {
7415
+ }, [r, h]), Ze = F((L) => {
7416
+ r != null && r.linkEntity && r.linkEntity(e.id, m, L.id), S(!1);
7417
+ }, [r, e.id, m]), M = F(() => {
7421
7418
  o();
7422
- }, [o]), Z = U((R) => {
7423
- F(() => R), Y(!0), r != null && r.getRecentEntities && r.getRecentEntities().then(oe).catch(() => {
7419
+ }, [o]), Z = F((L) => {
7420
+ V(() => L), P(!0), r != null && r.getRecentEntities && r.getRecentEntities().then(te).catch(() => {
7424
7421
  });
7425
- }, [r]), J = U((R, V) => r != null && r.searchEntities ? r.searchEntities(R, V === "all" ? void 0 : V) : Promise.resolve([]), [r]), q = U((R) => {
7426
- r != null && r.addRecentEntity && r.addRecentEntity(R), oe((V) => [R, ...V.filter((re) => re.id !== R.id)].slice(0, 10)), G == null || G(R), Y(!1), F(null);
7427
- }, [r, G]);
7422
+ }, [r]), G = F((L, K) => r != null && r.searchEntities ? r.searchEntities(L, K === "all" ? void 0 : K) : Promise.resolve([]), [r]), q = F((L) => {
7423
+ r != null && r.addRecentEntity && r.addRecentEntity(L), te((K) => [L, ...K.filter((ie) => ie.id !== L.id)].slice(0, 10)), J == null || J(L), P(!1), V(null);
7424
+ }, [r, J]);
7428
7425
  return /* @__PURE__ */ i("div", { style: { padding: "16px", maxWidth: "900px", margin: "0 auto" }, children: [
7429
7426
  /* @__PURE__ */ t("div", { style: {
7430
7427
  display: "flex",
@@ -7452,46 +7449,46 @@ const Or = ({
7452
7449
  {
7453
7450
  label: ve ? p.editor.workTitle : ye ? p.editor.collectionTitle : p.editor.bookTitle,
7454
7451
  value: e.title,
7455
- onChange: (R) => X("title", R)
7452
+ onChange: (L) => X("title", L)
7456
7453
  }
7457
7454
  ),
7458
- ee && /* @__PURE__ */ t(Qe, { label: p.editor.belongsToWork, value: e.workName || "", onChange: (R) => X("workName", R) }),
7459
- /* @__PURE__ */ t(le, { label: p.editor.authorLabel, value: e.author || "", onChange: (R) => X("author", R) }),
7460
- /* @__PURE__ */ t(le, { label: p.editor.dynastyLabel, value: e.dynasty || "", onChange: (R) => X("dynasty", R) }),
7461
- (ee || ye) && /* @__PURE__ */ t(Qe, { label: p.editor.containedIn, value: e.collection || "", onChange: (R) => X("collection", R) }),
7462
- (ee || ye) && /* @__PURE__ */ t(le, { label: p.editor.holderLabel, value: e.holder || "", onChange: (R) => X("holder", R) }),
7463
- (ee || ye) && /* @__PURE__ */ t(le, { label: ee ? p.editor.pageLabel : p.editor.volumeLabel, value: e.pages || "", onChange: (R) => X("pages", R) }),
7464
- /* @__PURE__ */ t("div", { style: { gridColumn: "1 / -1" }, children: /* @__PURE__ */ t(le, { label: p.editor.firstImageLabel, value: e.firstImage || "", onChange: (R) => X("firstImage", R) }) })
7455
+ ne && /* @__PURE__ */ t(Qe, { label: p.editor.belongsToWork, value: e.workName || "", onChange: (L) => X("workName", L) }),
7456
+ /* @__PURE__ */ t(ae, { label: p.editor.authorLabel, value: e.author || "", onChange: (L) => X("author", L) }),
7457
+ /* @__PURE__ */ t(ae, { label: p.editor.dynastyLabel, value: e.dynasty || "", onChange: (L) => X("dynasty", L) }),
7458
+ (ne || ye) && /* @__PURE__ */ t(Qe, { label: p.editor.containedIn, value: e.collection || "", onChange: (L) => X("collection", L) }),
7459
+ (ne || ye) && /* @__PURE__ */ t(ae, { label: p.editor.holderLabel, value: e.holder || "", onChange: (L) => X("holder", L) }),
7460
+ (ne || ye) && /* @__PURE__ */ t(ae, { label: ne ? p.editor.pageLabel : p.editor.volumeLabel, value: e.pages || "", onChange: (L) => X("pages", L) }),
7461
+ /* @__PURE__ */ t("div", { style: { gridColumn: "1 / -1" }, children: /* @__PURE__ */ t(ae, { label: p.editor.firstImageLabel, value: e.firstImage || "", onChange: (L) => X("firstImage", L) }) })
7465
7462
  ] })
7466
7463
  }
7467
7464
  ),
7468
- /* @__PURE__ */ t(he, { title: p.section.description, onSave: o, onAskAI: s ? () => s("介绍") : void 0, children: /* @__PURE__ */ t(ze, { value: e.description || "", onChange: (R) => X("description", R), placeholder: p.editor.descriptionPlaceholder }) }),
7469
- (((te = e.additional_works) == null ? void 0 : te.length) || 0) > 0 && /* @__PURE__ */ t(he, { title: p.section.additionalWorks, onSave: o, children: /* @__PURE__ */ t(
7465
+ /* @__PURE__ */ t(he, { title: p.section.description, onSave: o, onAskAI: s ? () => s("介绍") : void 0, children: /* @__PURE__ */ t(ze, { value: e.description || "", onChange: (L) => X("description", L), placeholder: p.editor.descriptionPlaceholder }) }),
7466
+ (((oe = e.additional_works) == null ? void 0 : oe.length) || 0) > 0 && /* @__PURE__ */ t(he, { title: p.section.additionalWorks, onSave: o, children: /* @__PURE__ */ t(
7470
7467
  Jr,
7471
7468
  {
7472
7469
  items: e.additional_works || [],
7473
- onChange: (R) => X("additional_works", R)
7470
+ onChange: (L) => X("additional_works", L)
7474
7471
  }
7475
7472
  ) }),
7476
7473
  /* @__PURE__ */ t(he, { title: p.section.indexedBy, onSave: o, onAskAI: s ? () => s("收录于") : void 0, children: /* @__PURE__ */ t(
7477
7474
  qr,
7478
7475
  {
7479
7476
  items: e.indexed_by || [],
7480
- onChange: (R) => X("indexed_by", R)
7477
+ onChange: (L) => X("indexed_by", L)
7481
7478
  }
7482
7479
  ) }),
7483
7480
  /* @__PURE__ */ t(he, { title: p.section.emendatedBy, onSave: o, onAskAI: s ? () => s("考证") : void 0, children: /* @__PURE__ */ t(
7484
7481
  Zr,
7485
7482
  {
7486
7483
  items: e.emendated_by || [],
7487
- onChange: (R) => X("emendated_by", R)
7484
+ onChange: (L) => X("emendated_by", L)
7488
7485
  }
7489
7486
  ) }),
7490
7487
  /* @__PURE__ */ t(he, { title: p.section.textResources, onSave: o, onAskAI: s ? () => s("资源") : void 0, children: /* @__PURE__ */ t(
7491
7488
  st,
7492
7489
  {
7493
7490
  items: e.resources || [],
7494
- onChange: (R) => X("resources", R),
7491
+ onChange: (L) => X("resources", L),
7495
7492
  onDownload: u,
7496
7493
  downloadStatuses: g,
7497
7494
  filterType: "text"
@@ -7501,7 +7498,7 @@ const Or = ({
7501
7498
  st,
7502
7499
  {
7503
7500
  items: e.resources || [],
7504
- onChange: (R) => X("resources", R),
7501
+ onChange: (L) => X("resources", L),
7505
7502
  onDownload: u,
7506
7503
  downloadStatuses: g,
7507
7504
  filterType: "image"
@@ -7511,12 +7508,12 @@ const Or = ({
7511
7508
  mr,
7512
7509
  {
7513
7510
  items: yr(e.sources || ""),
7514
- onChange: (R) => X("sources", vr(R)),
7511
+ onChange: (L) => X("sources", vr(L)),
7515
7512
  onOpenEntityPicker: Z
7516
7513
  }
7517
7514
  ) }),
7518
- (ee || ye) && /* @__PURE__ */ t(he, { title: p.section.provenance, onSave: o, onAskAI: s ? () => s("收藏历史") : void 0, children: /* @__PURE__ */ t(ze, { value: e.provenance || "", onChange: (R) => X("provenance", R), placeholder: p.editor.provenancePlaceholder }) }),
7519
- ee && /* @__PURE__ */ t(he, { title: p.section.otherEditions, onSave: o, onAskAI: s ? () => s("其他版本") : void 0, children: /* @__PURE__ */ t(ze, { value: e.otherEditions || "", onChange: (R) => X("otherEditions", R), placeholder: p.editor.otherEditionsPlaceholder }) }),
7515
+ (ne || ye) && /* @__PURE__ */ t(he, { title: p.section.provenance, onSave: o, onAskAI: s ? () => s("收藏历史") : void 0, children: /* @__PURE__ */ t(ze, { value: e.provenance || "", onChange: (L) => X("provenance", L), placeholder: p.editor.provenancePlaceholder }) }),
7516
+ ne && /* @__PURE__ */ t(he, { title: p.section.otherEditions, onSave: o, onAskAI: s ? () => s("其他版本") : void 0, children: /* @__PURE__ */ t(ze, { value: e.otherEditions || "", onChange: (L) => X("otherEditions", L), placeholder: p.editor.otherEditionsPlaceholder }) }),
7520
7517
  /* @__PURE__ */ t(
7521
7518
  kr,
7522
7519
  {
@@ -7566,38 +7563,38 @@ const Or = ({
7566
7563
  onSelect: Ze,
7567
7564
  onCancel: () => S(!1),
7568
7565
  onCreate: () => {
7569
- S(!1), Re(y, h);
7566
+ S(!1), Re(m, h);
7570
7567
  },
7571
7568
  searchResults: _,
7572
7569
  onSearch: He,
7573
- isLoading: L,
7570
+ isLoading: B,
7574
7571
  excludeId: e.id
7575
7572
  }
7576
7573
  ),
7577
7574
  /* @__PURE__ */ t(
7578
7575
  Br,
7579
7576
  {
7580
- isOpen: $,
7577
+ isOpen: E,
7581
7578
  entityType: A,
7582
- relationField: E,
7583
- inheritData: N,
7579
+ relationField: U,
7580
+ inheritData: D,
7584
7581
  onConfirm: qe,
7585
- onCancel: () => D(!1)
7582
+ onCancel: () => O(!1)
7586
7583
  }
7587
7584
  ),
7588
7585
  /* @__PURE__ */ t(
7589
7586
  Or,
7590
7587
  {
7591
- isOpen: B,
7588
+ isOpen: R,
7592
7589
  title: p.action.selectBookOrWork,
7593
7590
  filterType: "all",
7594
- recentEntities: ce,
7591
+ recentEntities: ee,
7595
7592
  excludeId: e.id,
7596
7593
  onSelect: q,
7597
7594
  onCancel: () => {
7598
- Y(!1), F(null);
7595
+ P(!1), V(null);
7599
7596
  },
7600
- onSearch: J
7597
+ onSearch: G
7601
7598
  }
7602
7599
  )
7603
7600
  ] });
@@ -7609,8 +7606,8 @@ function Jr({ items: e, onChange: n }) {
7609
7606
  }, a = (c) => n(e.filter((s, d) => d !== c)), l = () => n([...e, { book_title: "" }]);
7610
7607
  return /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
7611
7608
  e.map((c, s) => /* @__PURE__ */ i("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
7612
- /* @__PURE__ */ t(le, { label: o.editor.bookNameLabel, value: c.book_title, onChange: (d) => r(s, "book_title", d) }),
7613
- /* @__PURE__ */ t("div", { style: { width: "100px" }, children: /* @__PURE__ */ t(le, { label: o.label.juanCount, value: c.n_juan != null ? String(c.n_juan) : "", onChange: (d) => r(s, "n_juan", d && parseInt(d, 10) || void 0) }) }),
7609
+ /* @__PURE__ */ t(ae, { label: o.editor.bookNameLabel, value: c.book_title, onChange: (d) => r(s, "book_title", d) }),
7610
+ /* @__PURE__ */ t("div", { style: { width: "100px" }, children: /* @__PURE__ */ t(ae, { label: o.label.juanCount, value: c.n_juan != null ? String(c.n_juan) : "", onChange: (d) => r(s, "n_juan", d && parseInt(d, 10) || void 0) }) }),
7614
7611
  /* @__PURE__ */ t("button", { onClick: () => a(s), style: {
7615
7612
  padding: "4px 8px",
7616
7613
  fontSize: "12px",
@@ -7686,15 +7683,15 @@ function fn({ items: e, onChange: n, showMeta: o, addLabel: r }) {
7686
7683
  ] }),
7687
7684
  x && /* @__PURE__ */ i("div", { style: { padding: "8px 12px 12px", display: "flex", flexDirection: "column", gap: "8px" }, children: [
7688
7685
  /* @__PURE__ */ i("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "8px" }, children: [
7689
- /* @__PURE__ */ t(le, { label: a.label.sourceName, value: g.source, onChange: (p) => s(f, "source", p) }),
7690
- /* @__PURE__ */ t(le, { label: a.label.sourceBid, value: g.source_bid || "", onChange: (p) => s(f, "source_bid", p) })
7686
+ /* @__PURE__ */ t(ae, { label: a.label.sourceName, value: g.source, onChange: (p) => s(f, "source", p) }),
7687
+ /* @__PURE__ */ t(ae, { label: a.label.sourceBid, value: g.source_bid || "", onChange: (p) => s(f, "source_bid", p) })
7691
7688
  ] }),
7692
7689
  o && /* @__PURE__ */ i(j, { children: [
7693
7690
  /* @__PURE__ */ i("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "8px" }, children: [
7694
- /* @__PURE__ */ t(le, { label: a.label.titleInfo, value: g.title_info || "", onChange: (p) => s(f, "title_info", p) }),
7695
- /* @__PURE__ */ t(le, { label: a.label.authorInfo, value: g.author_info || "", onChange: (p) => s(f, "author_info", p) })
7691
+ /* @__PURE__ */ t(ae, { label: a.label.titleInfo, value: g.title_info || "", onChange: (p) => s(f, "title_info", p) }),
7692
+ /* @__PURE__ */ t(ae, { label: a.label.authorInfo, value: g.author_info || "", onChange: (p) => s(f, "author_info", p) })
7696
7693
  ] }),
7697
- /* @__PURE__ */ t(le, { label: a.label.edition, value: g.edition || "", onChange: (p) => s(f, "edition", p) })
7694
+ /* @__PURE__ */ t(ae, { label: a.label.edition, value: g.edition || "", onChange: (p) => s(f, "edition", p) })
7698
7695
  ] }),
7699
7696
  /* @__PURE__ */ t(ze, { value: g.summary || "", onChange: (p) => s(f, "summary", p), placeholder: a.editor.summaryPlaceholder }),
7700
7697
  /* @__PURE__ */ t(ze, { value: g.comment || "", onChange: (p) => s(f, "comment", p), placeholder: a.editor.commentPlaceholder }),
@@ -7787,28 +7784,28 @@ const Ii = (e) => {
7787
7784
  relations: S,
7788
7785
  onRelationsChange: h,
7789
7786
  headerExtra: z,
7790
- className: y,
7787
+ className: m,
7791
7788
  style: v
7792
7789
  } = e;
7793
7790
  H();
7794
- const [k, T] = w(a), _ = l ? a : k;
7795
- P(() => {
7796
- a !== k && T(a);
7791
+ const [k, I] = w(a), _ = l ? a : k;
7792
+ $(() => {
7793
+ a !== k && I(a);
7797
7794
  }, [a]);
7798
- const m = U(() => {
7799
- const E = _ === "view" ? "edit" : "view";
7800
- l ? l(E) : T(E);
7801
- }, [_, l]), [L, W] = w(null);
7802
- P(() => {
7803
- o && r && r.getItem(o).then((E) => {
7804
- E && W(E);
7795
+ const y = F(() => {
7796
+ const U = _ === "view" ? "edit" : "view";
7797
+ l ? l(U) : I(U);
7798
+ }, [_, l]), [B, W] = w(null);
7799
+ $(() => {
7800
+ o && r && r.getItem(o).then((U) => {
7801
+ U && W(U);
7805
7802
  });
7806
7803
  }, [o, r]);
7807
- const $ = n || L, D = ae(() => $ ? Xr($) : null, [$]), I = /* @__PURE__ */ i(j, { children: [
7804
+ const E = n || B, O = ce(() => E ? Xr(E) : null, [E]), N = /* @__PURE__ */ i(j, { children: [
7808
7805
  l || !n ? /* @__PURE__ */ t(
7809
7806
  "button",
7810
7807
  {
7811
- onClick: m,
7808
+ onClick: y,
7812
7809
  style: {
7813
7810
  padding: "4px 12px",
7814
7811
  fontSize: "12px",
@@ -7827,23 +7824,23 @@ const Ii = (e) => {
7827
7824
  ) : null,
7828
7825
  z
7829
7826
  ] });
7830
- return !$ && !D ? /* @__PURE__ */ t(Se, {}) : _ === "view" ? /* @__PURE__ */ t(
7827
+ return !E && !O ? /* @__PURE__ */ t(Se, {}) : _ === "view" ? /* @__PURE__ */ t(
7831
7828
  on,
7832
7829
  {
7833
- data: $,
7830
+ data: E,
7834
7831
  transport: r,
7835
- onNavigate: u ? (E) => u(E) : void 0,
7832
+ onNavigate: u ? (U) => u(U) : void 0,
7836
7833
  renderLink: g,
7837
- headerExtra: I,
7838
- className: y,
7834
+ headerExtra: N,
7835
+ className: m,
7839
7836
  style: v
7840
7837
  }
7841
- ) : D ? /* @__PURE__ */ i("div", { className: y, style: v, children: [
7842
- I && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "flex-end", padding: "8px 0", gap: "8px" }, children: I }),
7838
+ ) : O ? /* @__PURE__ */ i("div", { className: m, style: v, children: [
7839
+ N && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "flex-end", padding: "8px 0", gap: "8px" }, children: N }),
7843
7840
  /* @__PURE__ */ t(
7844
7841
  Gr,
7845
7842
  {
7846
- data: D,
7843
+ data: O,
7847
7844
  onChange: c || (() => {
7848
7845
  }),
7849
7846
  onSave: s || (() => {
@@ -7866,19 +7863,19 @@ const Ii = (e) => {
7866
7863
  { value: "resource", label: "添加资源", icon: "📚", placeholder: "请提供完整资源链接和简要版本说明" }
7867
7864
  ], Qr = ({ isOpen: e, onClose: n, onSubmit: o, feedbackListUrl: r }) => {
7868
7865
  const [a, l] = w(null), [c, s] = w(""), [d, u] = w("idle"), [g, f] = w(""), x = Q(null);
7869
- P(() => {
7866
+ $(() => {
7870
7867
  e && (l(null), s(""), u("idle"), f(""));
7871
- }, [e]), P(() => {
7868
+ }, [e]), $(() => {
7872
7869
  a && setTimeout(() => {
7873
7870
  var h;
7874
7871
  return (h = x.current) == null ? void 0 : h.focus();
7875
7872
  }, 100);
7876
- }, [a]), P(() => {
7873
+ }, [a]), $(() => {
7877
7874
  if (d === "success") {
7878
7875
  const h = setTimeout(n, 2e3);
7879
7876
  return () => clearTimeout(h);
7880
7877
  }
7881
- }, [d, n]), P(() => {
7878
+ }, [d, n]), $(() => {
7882
7879
  if (!e) return;
7883
7880
  const h = (z) => {
7884
7881
  z.key === "Escape" && n();
@@ -8090,7 +8087,7 @@ const Ii = (e) => {
8090
8087
  { value: "resource", label: "添加资源", icon: "📚", placeholder: "请提供完整资源链接和简要版本说明" }
8091
8088
  ], Ri = ({ onSubmit: e }) => {
8092
8089
  const [n, o] = w("bug"), [r, a] = w(""), [l, c] = w("idle"), [s, d] = w(""), u = Q(null);
8093
- P(() => {
8090
+ $(() => {
8094
8091
  n && setTimeout(() => {
8095
8092
  var p;
8096
8093
  return (p = u.current) == null ? void 0 : p.focus();
@@ -8270,8 +8267,8 @@ export {
8270
8267
  Ei as BidLink,
8271
8268
  Si as BidUrlProvider,
8272
8269
  $i as BookIndexError,
8273
- Pi as BookIndexManager,
8274
- Ai as BookIndexStorage,
8270
+ Ai as BookIndexManager,
8271
+ Pi as BookIndexStorage,
8275
8272
  Mi as BundleStorage,
8276
8273
  Yo as CollatedEdition,
8277
8274
  _o as CollectionCatalog,
@@ -8285,7 +8282,7 @@ export {
8285
8282
  Qr as FeedbackDialog,
8286
8283
  Ri as FeedbackForm,
8287
8284
  Xo as FeedbackList,
8288
- le as FormInput,
8285
+ ae as FormInput,
8289
8286
  ze as FormTextArea,
8290
8287
  Oi as GithubStorage,
8291
8288
  Rt as HomePage,
@@ -8330,7 +8327,7 @@ export {
8330
8327
  tl as smartDecode,
8331
8328
  vr as stringifySources,
8332
8329
  de as useBidUrl,
8333
- K as useConvert,
8330
+ Y as useConvert,
8334
8331
  H as useT,
8335
8332
  nl as validateResource
8336
8333
  };