zs_library 0.6.19 → 0.6.20

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
@@ -5,14 +5,14 @@ import "./index.css";
5
5
  import Jo from "i18next";
6
6
  import { initReactI18next as Qo } from "react-i18next";
7
7
  import { jsx as s, jsxs as A, Fragment as Ie } from "react/jsx-runtime";
8
- import * as ie from "react";
9
- import { createContext as zt, useMemo as re, useContext as De, useState as B, useRef as ne, useCallback as fe, useEffect as V, forwardRef as Xe, useImperativeHandle as tt, memo as Ae, Fragment as er, useLayoutEffect as tr, cloneElement as or } from "react";
10
- import { css as E, cx as L } from "@emotion/css";
8
+ import * as le from "react";
9
+ import { createContext as zt, useMemo as re, useContext as De, useState as B, useRef as ne, useCallback as ge, useEffect as V, forwardRef as Xe, useImperativeHandle as tt, memo as Ae, Fragment as er, useLayoutEffect as tr, cloneElement as or } from "react";
10
+ import { css as E, cx as D } from "@emotion/css";
11
11
  import rr from "react-slick";
12
12
  import { ReactSortable as gt } from "react-sortablejs";
13
13
  import { useLocalStorageState as nr, useDebounceEffect as sr, useRequest as ar } from "ahooks";
14
14
  import { v4 as bt } from "uuid";
15
- import { motion as X, AnimatePresence as Ce, useMotionValue as Xt, useTransform as He, useSpring as nt } from "motion/react";
15
+ import { motion as Y, AnimatePresence as Ce, useMotionValue as Xt, useTransform as He, useSpring as nt } from "motion/react";
16
16
  import { useMotionValue as Fl } from "motion/react";
17
17
  import ir from "rc-dialog";
18
18
  import lr from "react-json-view";
@@ -391,8 +391,8 @@ rt(Me, "computeRowWidth", (e, o = 112) => {
391
391
  let f = Math.max(1, Math.floor((l + i) / (o + i)));
392
392
  const p = f * o + (f - 1) * i;
393
393
  l - p >= o * 0.9 && (f += 1);
394
- const g = f * o + (f - 1) * i, m = g > l ? Math.round((l - g) / 2) : 0;
395
- return { cols: f, width: g, marginLeft: m };
394
+ const g = f * o + (f - 1) * i, h = g > l ? Math.round((l - g) / 2) : 0;
395
+ return { cols: f, width: g, marginLeft: h };
396
396
  });
397
397
  const po = zt({
398
398
  list: [],
@@ -449,34 +449,34 @@ const po = zt({
449
449
  onChange: n,
450
450
  storageKey: r = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
451
451
  enableCaching: a = !0
452
- } = t, [i, l] = B(), [f, p] = B(), [d, g] = B(null), m = ne(d), [c, u] = B(null), [k, C] = B([]), [b, M] = B(null), [v, x] = B(null), [h, y] = B(!1), [D, N] = B(null), [P, $] = B(null), [q, T] = B(null), [O, R] = B(0), [W, se] = B(!1), [Z, G] = nr(r, {
452
+ } = t, [i, l] = B(), [f, p] = B(), [d, g] = B(null), h = ne(d), [c, u] = B(null), [v, C] = B([]), [y, N] = B(null), [x, k] = B(null), [m, b] = B(!1), [M, S] = B(null), [R, _] = B(null), [X, P] = B(null), [O, T] = B(0), [W, se] = B(!1), [ee, q] = nr(r, {
453
453
  defaultValue: [],
454
454
  listenStorageChange: !0
455
- }), ee = () => {
456
- u(null), clearTimeout(i), l(void 0), m.current = null;
457
- }, le = (U, te) => {
458
- let Y = U.target;
459
- for (; Y && !Y.getAttribute("data-id"); )
460
- Y = Y.parentElement;
461
- Y || (Y = U.target);
462
- const j = Y.getBoundingClientRect();
455
+ }), Z = () => {
456
+ u(null), clearTimeout(i), l(void 0), h.current = null;
457
+ }, ae = (U, te) => {
458
+ let G = U.target;
459
+ for (; G && !G.getAttribute("data-id"); )
460
+ G = G.parentElement;
461
+ G || (G = U.target);
462
+ const j = G.getBoundingClientRect();
463
463
  u({
464
464
  rect: j,
465
465
  pageX: U.pageX,
466
466
  pageY: U.pageY,
467
467
  data: te
468
468
  }), clearTimeout(i);
469
- }, ge = (U, te = !0) => {
470
- const { config: Y = {} } = U;
471
- return (Y == null ? void 0 : Y.allowContextMenu) === !1 ? {} : {
469
+ }, ce = (U, te = !0) => {
470
+ const { config: G = {} } = U;
471
+ return (G == null ? void 0 : G.allowContextMenu) === !1 ? {} : {
472
472
  onMouseDown: (j) => {
473
473
  l(
474
474
  setTimeout(() => {
475
- te && m.current === null && le(j, U);
475
+ te && h.current === null && ae(j, U);
476
476
  }, 800)
477
- ), y(!1), p(
477
+ ), b(!1), p(
478
478
  setTimeout(() => {
479
- y(!0);
479
+ b(!0);
480
480
  }, 800)
481
481
  );
482
482
  },
@@ -484,30 +484,30 @@ const po = zt({
484
484
  clearTimeout(f), p(void 0), clearTimeout(i), l(void 0);
485
485
  },
486
486
  onContextMenu: (j) => {
487
- te && (j.preventDefault(), le(j, U));
487
+ te && (j.preventDefault(), ae(j, U));
488
488
  }
489
489
  };
490
- }, ae = fe(
490
+ }, ie = ge(
491
491
  (U, te) => {
492
- const Y = [...te || []];
493
- if (Y.length > 0)
492
+ const G = [...te || []];
493
+ if (G.length > 0)
494
494
  C((j) => {
495
495
  const oe = [...j], J = (I) => {
496
- var S, F;
497
- const z = Y.shift(), w = I.find((H) => H.id === z), _ = I.findIndex((H) => H.id === z);
498
- if (Y.length && w) {
499
- if (((S = w.children) == null ? void 0 : S.filter((H) => !U.some((ue) => ue.id === H.id)).length) === 1 && U.length === 1) {
496
+ var L, F;
497
+ const z = G.shift(), w = I.find((H) => H.id === z), $ = I.findIndex((H) => H.id === z);
498
+ if (G.length && w) {
499
+ if (((L = w.children) == null ? void 0 : L.filter((H) => !U.some((fe) => fe.id === H.id)).length) === 1 && U.length === 1) {
500
500
  const H = { ...U[0] };
501
- return I.splice(_, 1, H), n == null || n(I), I;
501
+ return I.splice($, 1, H), n == null || n(I), I;
502
502
  }
503
- return w.children = J(w.children || []), I.splice(_, 1, w), n == null || n(I), I;
503
+ return w.children = J(w.children || []), I.splice($, 1, w), n == null || n(I), I;
504
504
  }
505
505
  if (w) {
506
506
  if (!((F = w.children) != null && F.length) && U.length && w.type !== "page") {
507
507
  const H = { ...w };
508
- return w.data = { name: "文件夹" }, w.type = "group", w.children = [H, ...U], w.id = bt(), I.splice(_, 1, w), n == null || n(I), I;
508
+ return w.data = { name: "文件夹" }, w.type = "group", w.children = [H, ...U], w.id = bt(), I.splice($, 1, w), n == null || n(I), I;
509
509
  }
510
- return w.children = Me.uniqueArray(U), I.splice(_, 1, w), n == null || n(I), I;
510
+ return w.children = Me.uniqueArray(U), I.splice($, 1, w), n == null || n(I), I;
511
511
  }
512
512
  return Me.uniqueArray(U);
513
513
  };
@@ -519,9 +519,9 @@ const po = zt({
519
519
  }
520
520
  },
521
521
  [n]
522
- ), ce = (U, te) => {
523
- C((Y) => {
524
- const j = [...Y], oe = (J) => {
522
+ ), de = (U, te) => {
523
+ C((G) => {
524
+ const j = [...G], oe = (J) => {
525
525
  var I;
526
526
  for (let z = 0; z < J.length; z++)
527
527
  if (J[z].id === U) {
@@ -531,9 +531,9 @@ const po = zt({
531
531
  };
532
532
  return oe(j), n == null || n(j), j;
533
533
  });
534
- }, de = (U, te) => {
535
- C((Y) => {
536
- const j = [...Y], oe = (J) => {
534
+ }, ue = (U, te) => {
535
+ C((G) => {
536
+ const j = [...G], oe = (J) => {
537
537
  var I;
538
538
  for (let z = 0; z < J.length; z++)
539
539
  if (J[z].id === U) {
@@ -545,7 +545,7 @@ const po = zt({
545
545
  });
546
546
  }, K = (U) => {
547
547
  C((te) => {
548
- const Y = [...te], j = (oe) => {
548
+ const G = [...te], j = (oe) => {
549
549
  var J;
550
550
  for (let I = 0; I < oe.length; I++)
551
551
  if (oe[I].id === U) {
@@ -553,14 +553,14 @@ const po = zt({
553
553
  break;
554
554
  } else ((J = oe[I].children) == null ? void 0 : J.length) !== void 0 && j(oe[I].children);
555
555
  };
556
- return j(Y), n == null || n(Y), Y;
556
+ return j(G), n == null || n(G), G;
557
557
  });
558
558
  }, be = (U, te) => {
559
- const Y = [...k], j = !te || te.length === 0 ? (ze == null ? void 0 : ze.id) !== void 0 ? [ze.id] : [] : te;
559
+ const G = [...v], j = !te || te.length === 0 ? (ze == null ? void 0 : ze.id) !== void 0 ? [ze.id] : [] : te;
560
560
  if (j.length === 0)
561
561
  return;
562
562
  const oe = (J, I) => {
563
- const z = I.shift(), w = J.find((S) => S.id === z), _ = J.findIndex((S) => S.id === z);
563
+ const z = I.shift(), w = J.find((L) => L.id === z), $ = J.findIndex((L) => L.id === z);
564
564
  return w && (I.length ? w.children = oe(w.children || [], I) : w.children = [
565
565
  ...w.children ?? [],
566
566
  {
@@ -568,78 +568,78 @@ const po = zt({
568
568
  id: bt(),
569
569
  config: (U == null ? void 0 : U.config) ?? {}
570
570
  }
571
- ], J.splice(_, 1, w)), J;
571
+ ], J.splice($, 1, w)), J;
572
572
  };
573
- C(oe(Y, [...j]));
573
+ C(oe(G, [...j]));
574
574
  }, Q = (U) => {
575
575
  C((te) => {
576
- const Y = {
576
+ const G = {
577
577
  ...U,
578
578
  id: bt()
579
- }, j = [...te, Y];
579
+ }, j = [...te, G];
580
580
  return n == null || n(j), j;
581
581
  });
582
582
  }, he = (U, te) => {
583
- C((Y) => {
584
- const j = [...Y], oe = j.findIndex((J) => J.id === U);
583
+ C((G) => {
584
+ const j = [...G], oe = j.findIndex((J) => J.id === U);
585
585
  return oe !== -1 && (j[oe] = { ...j[oe], ...te }, n == null || n(j)), j;
586
586
  });
587
587
  }, pe = (U) => {
588
588
  C((te) => {
589
- const Y = te.filter((j) => j.id !== U);
590
- return n == null || n(Y), Y;
589
+ const G = te.filter((j) => j.id !== U);
590
+ return n == null || n(G), G;
591
591
  });
592
592
  };
593
593
  V(() => {
594
- (o == null ? void 0 : o.length) > 0 && k.length === 0 && ae(o);
594
+ (o == null ? void 0 : o.length) > 0 && v.length === 0 && ie(o);
595
595
  }, [o]), V(() => {
596
- m.current = d, d !== null && ee();
596
+ h.current = d, d !== null && Z();
597
597
  }, [d]), V(() => {
598
- a && Z != null && Z.length && !W && (ae(Z), se(!0));
599
- }, [Z, W, a, ae]), sr(
598
+ a && ee != null && ee.length && !W && (ie(ee), se(!0));
599
+ }, [ee, W, a, ie]), sr(
600
600
  () => {
601
- a && G(k);
601
+ a && q(v);
602
602
  },
603
- [k, a],
603
+ [v, a],
604
604
  {
605
605
  wait: 1e3
606
606
  }
607
607
  );
608
- const ke = re(() => k.filter((U) => U.type !== "dock"), [k]), ze = re(() => ke[O] ?? null, [ke, O]);
608
+ const ke = re(() => v.filter((U) => U.type !== "dock"), [v]), ze = re(() => ke[O] ?? null, [ke, O]);
609
609
  return V(() => {
610
- O >= ke.length && R(ke.length > 0 ? ke.length - 1 : 0);
610
+ O >= ke.length && T(ke.length > 0 ? ke.length - 1 : 0);
611
611
  }, [O, ke.length]), /* @__PURE__ */ s(
612
612
  po.Provider,
613
613
  {
614
614
  value: {
615
- list: k,
616
- setList: ae,
615
+ list: v,
616
+ setList: ie,
617
617
  contextMenu: c,
618
618
  setContextMenu: u,
619
619
  listStatus: d,
620
620
  setListStatus: g,
621
- contextMenuFuns: ge,
622
- hideContextMenu: ee,
623
- showInfoItemData: b,
624
- setShowInfoItemData: M,
625
- openGroupItemData: v,
626
- setOpenGroupItemData: x,
627
- longPressTriggered: h,
628
- updateItemConfig: ce,
629
- updateItem: de,
621
+ contextMenuFuns: ce,
622
+ hideContextMenu: Z,
623
+ showInfoItemData: y,
624
+ setShowInfoItemData: N,
625
+ openGroupItemData: x,
626
+ setOpenGroupItemData: k,
627
+ longPressTriggered: m,
628
+ updateItemConfig: de,
629
+ updateItem: ue,
630
630
  removeItem: K,
631
631
  addItem: be,
632
632
  addRootItem: Q,
633
633
  updateRootItem: he,
634
634
  removeRootItem: pe,
635
- moveItemId: D,
636
- setMoveItemId: N,
637
- moveTargetId: P,
638
- setMoveTargetId: $,
639
- dragItem: q,
640
- setDragItem: T,
635
+ moveItemId: M,
636
+ setMoveItemId: S,
637
+ moveTargetId: R,
638
+ setMoveTargetId: _,
639
+ dragItem: X,
640
+ setDragItem: P,
641
641
  currentSliderIndex: O,
642
- setCurrentSliderIndex: R,
642
+ setCurrentSliderIndex: T,
643
643
  currentSliderPage: ze
644
644
  },
645
645
  children: e
@@ -657,22 +657,22 @@ const po = zt({
657
657
  containerRef: l,
658
658
  onCreateNewPage: f
659
659
  }, p) => {
660
- const d = ne(null), [g, m] = B(null), c = ne(0), u = ne(!1), k = fe(() => {
660
+ const d = ne(null), [g, h] = B(null), c = ne(0), u = ne(!1), v = ge(() => {
661
661
  d.current && (clearTimeout(d.current), d.current = null), u.current = !1;
662
- }, []), C = fe(
663
- (h) => {
662
+ }, []), C = ge(
663
+ (m) => {
664
664
  if (!r) return;
665
- const y = e >= o - 1, D = typeof n == "number" && o >= n;
666
- if (h === "right" && y && D)
665
+ const b = e >= o - 1, M = typeof n == "number" && o >= n;
666
+ if (m === "right" && b && M)
667
667
  return;
668
- const N = Date.now();
669
- u.current || N - c.current < a + 200 || g !== h && (m(h), k(), d.current = setTimeout(() => {
670
- const P = t.current;
671
- if (!P) {
672
- m(null);
668
+ const S = Date.now();
669
+ u.current || S - c.current < a + 200 || g !== m && (h(m), v(), d.current = setTimeout(() => {
670
+ const R = t.current;
671
+ if (!R) {
672
+ h(null);
673
673
  return;
674
674
  }
675
- u.current = !0, c.current = Date.now(), h === "left" && e > 0 ? P.slickGoTo(e - 1) : h === "right" && (e < o - 1 ? P.slickGoTo(e + 1) : D || f == null || f()), m(null), setTimeout(() => {
675
+ u.current = !0, c.current = Date.now(), m === "left" && e > 0 ? R.slickGoTo(e - 1) : m === "right" && (e < o - 1 ? R.slickGoTo(e + 1) : M || f == null || f()), h(null), setTimeout(() => {
676
676
  u.current = !1;
677
677
  }, 300);
678
678
  }, a));
@@ -682,28 +682,28 @@ const po = zt({
682
682
  e,
683
683
  o,
684
684
  n,
685
- k,
685
+ v,
686
686
  t,
687
687
  g,
688
688
  a,
689
689
  f
690
690
  ]
691
- ), b = fe(() => {
692
- m(null), k();
693
- }, [k]), M = fe(
694
- (h) => {
691
+ ), y = ge(() => {
692
+ h(null), v();
693
+ }, [v]), N = ge(
694
+ (m) => {
695
695
  if (!r || !l.current)
696
696
  return;
697
- const y = l.current.getBoundingClientRect(), D = h.clientX - y.left, N = y.width - i;
698
- if (D < i && e > 0)
697
+ const b = l.current.getBoundingClientRect(), M = m.clientX - b.left, S = b.width - i;
698
+ if (M < i && e > 0)
699
699
  C("left");
700
- else if (D > N) {
701
- const P = e >= o - 1, $ = typeof n == "number" && o >= n;
702
- if (P && $)
700
+ else if (M > S) {
701
+ const R = e >= o - 1, _ = typeof n == "number" && o >= n;
702
+ if (R && _)
703
703
  return;
704
704
  C("right");
705
705
  } else
706
- g && b();
706
+ g && y();
707
707
  },
708
708
  [
709
709
  r,
@@ -714,21 +714,21 @@ const po = zt({
714
714
  n,
715
715
  C,
716
716
  g,
717
- b
717
+ y
718
718
  ]
719
719
  );
720
720
  tt(
721
721
  p,
722
722
  () => ({
723
- handleDragMove: M
723
+ handleDragMove: N
724
724
  }),
725
- [M]
725
+ [N]
726
726
  ), V(() => () => {
727
- k();
728
- }, [k]), V(() => {
729
- r || (k(), m(null), u.current = !1, c.current = 0);
730
- }, [r, k]);
731
- const v = E`
727
+ v();
728
+ }, [v]), V(() => {
729
+ r || (v(), h(null), u.current = !1, c.current = 0);
730
+ }, [r, v]);
731
+ const x = E`
732
732
  position: absolute;
733
733
  top: 0;
734
734
  bottom: 0;
@@ -790,30 +790,30 @@ const po = zt({
790
790
  );
791
791
  }
792
792
  }
793
- `, x = typeof n == "number" && o >= n && e >= o - 1;
794
- return !r || x ? null : /* @__PURE__ */ A(Ie, { children: [
793
+ `, k = typeof n == "number" && o >= n && e >= o - 1;
794
+ return !r || k ? null : /* @__PURE__ */ A(Ie, { children: [
795
795
  e > 0 && /* @__PURE__ */ s(
796
796
  "div",
797
797
  {
798
- className: L(v, "left", g === "left" && "active"),
798
+ className: D(x, "left", g === "left" && "active"),
799
799
  onMouseEnter: () => {
800
800
  r && C("left");
801
801
  },
802
802
  onMouseLeave: () => {
803
- b();
803
+ y();
804
804
  }
805
805
  }
806
806
  ),
807
807
  /* @__PURE__ */ s(
808
808
  "div",
809
809
  {
810
- className: L(v, "right", g === "right" && "active"),
810
+ className: D(x, "right", g === "right" && "active"),
811
811
  onMouseEnter: () => {
812
- const h = e >= o - 1, y = typeof n == "number" && o >= n;
813
- r && !(h && y) && C("right");
812
+ const m = e >= o - 1, b = typeof n == "number" && o >= n;
813
+ r && !(m && b) && C("right");
814
814
  },
815
815
  onMouseLeave: () => {
816
- b();
816
+ y();
817
817
  }
818
818
  }
819
819
  )
@@ -1006,31 +1006,37 @@ function wo(t, e, o) {
1006
1006
  return { col: r.col, row: r.row };
1007
1007
  }
1008
1008
  const qs = Ae(({ src: t }) => {
1009
- const [e, o] = B(!0), [n, r] = B(!1), a = fe(() => {
1009
+ const [e, o] = B(!0), [n, r] = B(!1), a = ge(() => {
1010
1010
  o(!1);
1011
- }, []), i = fe(() => {
1011
+ }, []), i = ge(() => {
1012
1012
  o(!1), r(!0);
1013
1013
  }, []), l = re(() => `zs-w-full zs-h-full zs-object-cover zs-transition-opacity zs-duration-300 ${e ? "zs-opacity-0" : "zs-opacity-100"}`, [e]);
1014
1014
  return /* @__PURE__ */ A("div", { className: "zs-relative zs-w-full zs-h-full", children: [
1015
1015
  e && /* @__PURE__ */ s("div", { className: "zs-absolute zs-inset-0 zs-flex zs-items-center zs-justify-center zs-bg-gray-100", children: /* @__PURE__ */ s("div", { className: "zs-animate-spin zs-rounded-full zs-h-4 zs-w-4 zs-border-b-2 zs-border-gray-600" }) }),
1016
1016
  n ? /* @__PURE__ */ s("div", { className: "zs-w-full zs-h-full zs-flex zs-items-center zs-justify-center zs-bg-gray-100 zs-text-gray-400", children: /* @__PURE__ */ s("span", { className: "zs-text-xs", children: "加载失败" }) }) : /* @__PURE__ */ s("img", { src: t, alt: "", className: l, onLoad: a, onError: i })
1017
1017
  ] });
1018
- }), Ze = (t, e, o) => {
1019
- const { data: n = {} } = t, { icon: r } = n;
1020
- return e || (r ? typeof r == "string" && (r.startsWith("http") || r.startsWith("https")) ? /* @__PURE__ */ s(qs, { src: r }) : r : o ? typeof o == "function" ? o(t) : o : null);
1018
+ }), Ze = (t, e, o, n) => {
1019
+ const { data: r = {} } = t, { icon: a } = r;
1020
+ if (e) return e;
1021
+ if (typeof o == "function") {
1022
+ const i = o(t);
1023
+ if (i != null)
1024
+ return i;
1025
+ }
1026
+ return a ? typeof a == "string" && (a.startsWith("http") || a.startsWith("https")) ? /* @__PURE__ */ s(qs, { src: a }) : a : n ? typeof n == "function" ? n(t) : n : null;
1021
1027
  }, Co = (t) => {
1022
- var g, m;
1028
+ var g, h;
1023
1029
  const { data: e, noLetters: o = !1, name: n, defaultName: r, className: a } = t, { moveItemId: i } = Ee(), { theme: l } = me(), f = {
1024
1030
  visible: { opacity: 1, scale: 1 },
1025
1031
  hidden: { opacity: 0, scale: 0.95 }
1026
1032
  }, p = re(() => i === e.id.toString(), [e.id, i]), d = n || ((g = e.data) == null ? void 0 : g.name) || r || "";
1027
1033
  return /* @__PURE__ */ s(
1028
- X.p,
1034
+ Y.p,
1029
1035
  {
1030
- className: L(
1036
+ className: D(
1031
1037
  "zs-whitespace-nowrap zs-text-ellipsis zs-overflow-hidden zs-text-center zs-mt-1 zs-mb-0 zs-absolute zs-left-0 zs-right-0 zs-text-sm",
1032
1038
  E`
1033
- color: ${(m = l.token.items) == null ? void 0 : m.textColor};
1039
+ color: ${(h = l.token.items) == null ? void 0 : h.textColor};
1034
1040
  `,
1035
1041
  o && E`
1036
1042
  color: transparent;
@@ -1043,18 +1049,23 @@ const qs = Ae(({ src: t }) => {
1043
1049
  }
1044
1050
  );
1045
1051
  }, Zs = (t) => {
1046
- var C, b, M;
1047
- const { data: e, noLetters: o = !1, icon: n, iconColor: r, from: a, iconSize: i = 64, contextMenuProps: l } = t, { contextMenuFuns: f } = Ee(), { itemIconBuilder: p, theme: d, contextMenu: g } = me(), m = l != !1 ? l || g : l, { data: c = {} } = e, { name: u, iconColor: k } = c;
1052
+ var y, N, x;
1053
+ const { data: e, noLetters: o = !1, icon: n, iconColor: r, from: a, iconSize: i = 64, contextMenuProps: l } = t, { contextMenuFuns: f } = Ee(), {
1054
+ itemIconBuilder: p,
1055
+ itemIconBuilderAllowNull: d,
1056
+ theme: g,
1057
+ contextMenu: h
1058
+ } = me(), c = l != !1 ? l || h : l, { data: u = {} } = e, { name: v, iconColor: C } = u;
1048
1059
  return /* @__PURE__ */ A(Ie, { children: [
1049
1060
  /* @__PURE__ */ s(
1050
- X.div,
1061
+ Y.div,
1051
1062
  {
1052
- className: L(
1063
+ className: D(
1053
1064
  "zs-cursor-pointer zs-relative zs-overflow-hidden",
1054
1065
  E`
1055
- background-color: ${r ?? k ?? ((C = d.token.items) == null ? void 0 : C.iconBackgroundColor)};
1066
+ background-color: ${r ?? C ?? ((y = g.token.items) == null ? void 0 : y.iconBackgroundColor)};
1056
1067
  border-radius: 0.75rem;
1057
- box-shadow: 0 0 0.5rem ${(b = d.token.items) == null ? void 0 : b.iconShadowColor};
1068
+ box-shadow: 0 0 0.5rem ${(N = g.token.items) == null ? void 0 : N.iconShadowColor};
1058
1069
  width: ${i}px;
1059
1070
  height: ${i}px;
1060
1071
  `
@@ -1063,34 +1074,34 @@ const qs = Ae(({ src: t }) => {
1063
1074
  children: /* @__PURE__ */ s(
1064
1075
  "div",
1065
1076
  {
1066
- className: L(
1077
+ className: D(
1067
1078
  "zs-absolute zs-left-0 zs-top-0 zs-w-full zs-h-full",
1068
1079
  E`
1069
- color: ${(M = d.token.items) == null ? void 0 : M.textColor};
1080
+ color: ${(x = g.token.items) == null ? void 0 : x.textColor};
1070
1081
  `
1071
1082
  ),
1072
1083
  ...f(
1073
1084
  { ...e, ...a === "dock" ? { config: { allowResize: !1 } } : {} },
1074
- m !== !1
1085
+ c !== !1
1075
1086
  ),
1076
- children: Ze(e, n, p)
1087
+ children: Ze(e, n, d, p)
1077
1088
  }
1078
1089
  )
1079
1090
  }
1080
1091
  ),
1081
- /* @__PURE__ */ s(Co, { data: e, noLetters: o, name: u })
1092
+ /* @__PURE__ */ s(Co, { data: e, noLetters: o, name: v })
1082
1093
  ] });
1083
1094
  }, _e = (t) => {
1084
1095
  const { data: e, className: o, itemIndex: n, onClick: r, disabledDrag: a = !1, children: i, parentIds: l, childrenLength: f } = t;
1085
1096
  return /* @__PURE__ */ s(
1086
- X.div,
1097
+ Y.div,
1087
1098
  {
1088
1099
  "data-id": e.id,
1089
1100
  "data-index": n,
1090
1101
  "data-parent-ids": l == null ? void 0 : l.join(","),
1091
1102
  "data-children-length": f,
1092
1103
  onClick: () => r == null ? void 0 : r(e),
1093
- className: L(a && "drag-disabled", "zs-relative", o),
1104
+ className: D(a && "drag-disabled", "zs-relative", o),
1094
1105
  initial: { opacity: 0 },
1095
1106
  animate: { opacity: 1 },
1096
1107
  exit: { opacity: 0 },
@@ -1098,76 +1109,82 @@ const qs = Ae(({ src: t }) => {
1098
1109
  }
1099
1110
  );
1100
1111
  }, zo = (t) => {
1101
- var T, O, R, W, se;
1112
+ var O, T, W, se, ee;
1102
1113
  const { data: e, className: o, parentIds: n, itemIndex: r, onClick: a, noLetters: i = !1, disabledDrag: l = !1, icon: f } = t, {
1103
1114
  contextMenuFuns: p,
1104
1115
  setList: d,
1105
1116
  setOpenGroupItemData: g,
1106
- longPressTriggered: m,
1117
+ longPressTriggered: h,
1107
1118
  moveTargetId: c,
1108
1119
  setMoveTargetId: u,
1109
- listStatus: k
1110
- } = Ee(), { itemIconBuilder: C, theme: b, contextMenu: M, typeConfigMap: v } = me(), { children: x } = e, { row: h, col: y } = wo(e.type, (T = e.config) == null ? void 0 : T.sizeId, v), D = ((x == null ? void 0 : x.length) ?? 0) === 0, N = D ? [e] : [...x ?? []].slice(0, 9), P = re(() => c === e.id, [e.id, c]), $ = E`
1120
+ listStatus: v
1121
+ } = Ee(), {
1122
+ itemIconBuilder: C,
1123
+ itemIconBuilderAllowNull: y,
1124
+ theme: N,
1125
+ contextMenu: x,
1126
+ typeConfigMap: k
1127
+ } = me(), { children: m } = e, { row: b, col: M } = wo(e.type, (O = e.config) == null ? void 0 : O.sizeId, k), S = ((m == null ? void 0 : m.length) ?? 0) === 0, R = S ? [e] : [...m ?? []].slice(0, 9), _ = re(() => c === e.id, [e.id, c]), X = E`
1111
1128
  overflow: hidden;
1112
1129
  cursor: pointer;
1113
- background-color: ${(O = b.token.items) == null ? void 0 : O.iconBackgroundColor};
1114
- box-shadow: 0 0 0.5rem ${(R = b.token.items) == null ? void 0 : R.iconShadowColor};
1115
- `, q = () => {
1116
- var Z;
1117
- if (D)
1130
+ background-color: ${(T = N.token.items) == null ? void 0 : T.iconBackgroundColor};
1131
+ box-shadow: 0 0 0.5rem ${(W = N.token.items) == null ? void 0 : W.iconShadowColor};
1132
+ `, P = () => {
1133
+ var q;
1134
+ if (S)
1118
1135
  return /* @__PURE__ */ s(
1119
- X.div,
1136
+ Y.div,
1120
1137
  {
1121
- className: L(
1138
+ className: D(
1122
1139
  "sortable-group-item zs-cursor-pointer zs-w-full zs-h-full zs-absolute zs-left-0 zs-top-0 zs-bottom-0 zs-right-0 zs-overflow-hidden",
1123
1140
  E`
1124
- background-color: ${(Z = b.token.items) == null ? void 0 : Z.iconBackgroundColor};
1141
+ background-color: ${(q = N.token.items) == null ? void 0 : q.iconBackgroundColor};
1125
1142
  border-radius: 0.75rem;
1126
1143
  `
1127
1144
  ),
1128
- onClick: (G) => {
1129
- G.stopPropagation(), a == null || a(e);
1145
+ onClick: (Z) => {
1146
+ Z.stopPropagation(), a == null || a(e);
1130
1147
  },
1131
- children: Ze(e, f, C)
1148
+ children: Ze(e, f, y, C)
1132
1149
  }
1133
1150
  );
1134
- if (h === 1 && y === 1 || h === 2 && y === 2)
1151
+ if (b === 1 && M === 1 || b === 2 && M === 2)
1135
1152
  return /* @__PURE__ */ s(
1136
- X.div,
1153
+ Y.div,
1137
1154
  {
1138
- className: L(
1155
+ className: D(
1139
1156
  "zs-grid zs-w-full zs-h-full zs-grid-cols-3 zs-grid-rows-3 zs-place-items-center",
1140
1157
  E`
1141
- padding: ${y === 1 ? "0.125rem" : "0.25rem"};
1142
- gap: ${y === 1 ? "0.125rem" : "0.5rem"};
1158
+ padding: ${M === 1 ? "0.125rem" : "0.25rem"};
1159
+ gap: ${M === 1 ? "0.125rem" : "0.5rem"};
1143
1160
  `
1144
1161
  ),
1145
- children: N == null ? void 0 : N.slice(0, 9).map((G) => /* @__PURE__ */ s(
1146
- X.div,
1162
+ children: R == null ? void 0 : R.slice(0, 9).map((Z) => /* @__PURE__ */ s(
1163
+ Y.div,
1147
1164
  {
1148
- className: L(
1149
- $,
1165
+ className: D(
1166
+ X,
1150
1167
  "zs-w-full zs-h-full",
1151
1168
  E`
1152
- border-radius: ${y === 1 ? "0.25rem" : "0.5rem"};
1169
+ border-radius: ${M === 1 ? "0.25rem" : "0.5rem"};
1153
1170
  `
1154
1171
  ),
1155
- onClick: (ee) => {
1156
- ee.stopPropagation(), a == null || a(G);
1172
+ onClick: (ae) => {
1173
+ ae.stopPropagation(), a == null || a(Z);
1157
1174
  },
1158
- children: Ze(G, void 0, C)
1175
+ children: Ze(Z, void 0, y, C)
1159
1176
  },
1160
- G.id
1177
+ Z.id
1161
1178
  ))
1162
1179
  }
1163
1180
  );
1164
- if (h === 1 && y === 2)
1165
- return /* @__PURE__ */ s(X.div, { className: "zs-grid zs-grid-cols-10 zs-grid-rows-4 zs-gap-x-2 zs-gap-y-1 zs-place-items-center zs-w-36 h-[52px]", children: N == null ? void 0 : N.slice(0, 4).map((G, ee) => /* @__PURE__ */ s(
1166
- X.div,
1181
+ if (b === 1 && M === 2)
1182
+ return /* @__PURE__ */ s(Y.div, { className: "zs-grid zs-grid-cols-10 zs-grid-rows-4 zs-gap-x-2 zs-gap-y-1 zs-place-items-center zs-w-36 h-[52px]", children: R == null ? void 0 : R.slice(0, 4).map((Z, ae) => /* @__PURE__ */ s(
1183
+ Y.div,
1167
1184
  {
1168
- className: L(
1169
- $,
1170
- ee < 2 ? E`
1185
+ className: D(
1186
+ X,
1187
+ ae < 2 ? E`
1171
1188
  width: 52px;
1172
1189
  height: 52px;
1173
1190
  border-radius: 0.5rem;
@@ -1181,20 +1198,20 @@ const qs = Ae(({ src: t }) => {
1181
1198
  grid-row: span 2 / span 2;
1182
1199
  `
1183
1200
  ),
1184
- onClick: (le) => {
1185
- ee > 2 || (le.stopPropagation(), a == null || a(G));
1201
+ onClick: (ce) => {
1202
+ ae > 2 || (ce.stopPropagation(), a == null || a(Z));
1186
1203
  },
1187
- children: Ze(G, void 0, C)
1204
+ children: Ze(Z, void 0, y, C)
1188
1205
  },
1189
- G.id
1206
+ Z.id
1190
1207
  )) });
1191
- if (h === 2 && y === 1)
1192
- return /* @__PURE__ */ s(X.div, { className: "zs-grid zs-grid-cols-4 zs-grid-rows-10 zs-gap-x-1 zs-gap-y-2 w-[52px] zs-h-36 zs-place-items-center", children: N == null ? void 0 : N.slice(0, 4).map((G, ee) => /* @__PURE__ */ s(
1193
- X.div,
1208
+ if (b === 2 && M === 1)
1209
+ return /* @__PURE__ */ s(Y.div, { className: "zs-grid zs-grid-cols-4 zs-grid-rows-10 zs-gap-x-1 zs-gap-y-2 w-[52px] zs-h-36 zs-place-items-center", children: R == null ? void 0 : R.slice(0, 4).map((Z, ae) => /* @__PURE__ */ s(
1210
+ Y.div,
1194
1211
  {
1195
- className: L(
1196
- $,
1197
- ee < 2 ? E`
1212
+ className: D(
1213
+ X,
1214
+ ae < 2 ? E`
1198
1215
  width: 52px;
1199
1216
  height: 52px;
1200
1217
  border-radius: 0.5rem;
@@ -1208,12 +1225,12 @@ const qs = Ae(({ src: t }) => {
1208
1225
  grid-row: span 2 / span 2;
1209
1226
  `
1210
1227
  ),
1211
- onClick: (le) => {
1212
- ee > 2 || (le.stopPropagation(), a == null || a(G));
1228
+ onClick: (ce) => {
1229
+ ae > 2 || (ce.stopPropagation(), a == null || a(Z));
1213
1230
  },
1214
- children: Ze(G, void 0, C)
1231
+ children: Ze(Z, void 0, y, C)
1215
1232
  },
1216
- G.id
1233
+ Z.id
1217
1234
  )) });
1218
1235
  };
1219
1236
  return /* @__PURE__ */ A(
@@ -1222,46 +1239,46 @@ const qs = Ae(({ src: t }) => {
1222
1239
  data: e,
1223
1240
  itemIndex: r,
1224
1241
  parentIds: n,
1225
- childrenLength: x == null ? void 0 : x.length,
1226
- className: L(o),
1242
+ childrenLength: m == null ? void 0 : m.length,
1243
+ className: D(o),
1227
1244
  children: [
1228
1245
  /* @__PURE__ */ s(
1229
- X.div,
1246
+ Y.div,
1230
1247
  {
1231
1248
  whileTap: { scale: 0.9 },
1232
- className: L(
1233
- P ? "!scale-110" : "",
1249
+ className: D(
1250
+ _ ? "!scale-110" : "",
1234
1251
  "zs-cursor-pointer zs-relative my-0",
1235
1252
  E`
1236
1253
  border-radius: 0.75rem;
1237
- background-color: ${(W = b.token.items) == null ? void 0 : W.groupIconBackgroundColor};
1238
- box-shadow: 0 0 0.5rem ${(se = b.token.items) == null ? void 0 : se.groupIconShadowColor};
1254
+ background-color: ${(se = N.token.items) == null ? void 0 : se.groupIconBackgroundColor};
1255
+ box-shadow: 0 0 0.5rem ${(ee = N.token.items) == null ? void 0 : ee.groupIconShadowColor};
1239
1256
  /* overflow: hidden; */
1240
1257
  transition: all 0.3s;
1241
- transform-origin: ${k === null ? "center" : "top left"};
1242
- width: ${y * 64 + 44 * (y - 1)}px;
1243
- height: ${h * 64 + 44 * (h - 1)}px;
1258
+ transform-origin: ${v === null ? "center" : "top left"};
1259
+ width: ${M * 64 + 44 * (M - 1)}px;
1260
+ height: ${b * 64 + 44 * (b - 1)}px;
1244
1261
  `
1245
1262
  ),
1246
- onClick: (Z) => {
1247
- !D && !m && (e.parentIds = n, e.pageX = Z.pageX, e.pageY = Z.pageY, g(e));
1263
+ onClick: (q) => {
1264
+ !S && !h && (e.parentIds = n, e.pageX = q.pageX, e.pageY = q.pageY, g(e));
1248
1265
  },
1249
- ...p(e, M !== !1),
1266
+ ...p(e, x !== !1),
1250
1267
  children: /* @__PURE__ */ A(
1251
- X.div,
1268
+ Y.div,
1252
1269
  {
1253
- className: L(
1270
+ className: D(
1254
1271
  "zs-relative zs-w-full zs-h-full flex zs-items-center zs-justify-center",
1255
1272
  E`
1256
1273
  padding: 0.375rem;
1257
1274
  `
1258
1275
  ),
1259
1276
  children: [
1260
- q(),
1277
+ P(),
1261
1278
  /* @__PURE__ */ s(
1262
1279
  gt,
1263
1280
  {
1264
- className: L(
1281
+ className: D(
1265
1282
  "sortable-group-item",
1266
1283
  "zs-absolute zs-cursor-pointer",
1267
1284
  E`
@@ -1269,7 +1286,7 @@ const qs = Ae(({ src: t }) => {
1269
1286
  top: 0.375rem;
1270
1287
  width: calc(100% - 0.75rem);
1271
1288
  height: calc(100% - 0.75rem);
1272
- pointer-events: ${k === null ? "none" : "auto"};
1289
+ pointer-events: ${v === null ? "none" : "auto"};
1273
1290
  > * {
1274
1291
  opacity: 0;
1275
1292
  }
@@ -1278,8 +1295,8 @@ const qs = Ae(({ src: t }) => {
1278
1295
  group: { name: "nested", pull: !1, put: !0 },
1279
1296
  animation: 150,
1280
1297
  fallbackOnBody: !0,
1281
- list: x ?? [],
1282
- setList: (Z) => !l && d(Z, n),
1298
+ list: m ?? [],
1299
+ setList: (q) => !l && d(q, n),
1283
1300
  filter: () => !0,
1284
1301
  disabled: l,
1285
1302
  "data-id": e.id,
@@ -1298,9 +1315,9 @@ const qs = Ae(({ src: t }) => {
1298
1315
  }
1299
1316
  );
1300
1317
  }, No = Xs, Ks = ({ value: t, onChange: e, onBlur: o, placeholder: n = "标题" }) => {
1301
- var p, d, g, m, c, u, k, C, b, M, v, x, h, y, D, N, P, $, q, T, O;
1302
- const [r, a] = B(t), { theme: i } = me(), l = (R) => {
1303
- const W = R.target.value;
1318
+ var p, d, g, h, c, u, v, C, y, N, x, k, m, b, M, S, R, _, X, P, O;
1319
+ const [r, a] = B(t), { theme: i } = me(), l = (T) => {
1320
+ const W = T.target.value;
1304
1321
  a(W), e(W);
1305
1322
  }, f = () => {
1306
1323
  o == null || o();
@@ -1308,7 +1325,7 @@ const qs = Ae(({ src: t }) => {
1308
1325
  return /* @__PURE__ */ s(
1309
1326
  "input",
1310
1327
  {
1311
- className: L(
1328
+ className: D(
1312
1329
  "zs-bg-transparent zs-text-center zs-text-xl zs-w-full zs-rounded-lg py-2 px-4",
1313
1330
  E`
1314
1331
  border-style: none;
@@ -1316,27 +1333,27 @@ const qs = Ae(({ src: t }) => {
1316
1333
  font-weight: 600;
1317
1334
  letter-spacing: -0.5px;
1318
1335
  transition: all 0.2s ease-out;
1319
- background: ${(u = (c = (m = i.token.items) == null ? void 0 : m.groupModal) == null ? void 0 : c.title) == null ? void 0 : u.backgroundColor};
1336
+ background: ${(u = (c = (h = i.token.items) == null ? void 0 : h.groupModal) == null ? void 0 : c.title) == null ? void 0 : u.backgroundColor};
1320
1337
 
1321
1338
  &:focus {
1322
1339
  outline: none;
1323
- background: ${(b = (C = (k = i.token.items) == null ? void 0 : k.groupModal) == null ? void 0 : C.title) == null ? void 0 : b.focusBackgroundColor};
1340
+ background: ${(y = (C = (v = i.token.items) == null ? void 0 : v.groupModal) == null ? void 0 : C.title) == null ? void 0 : y.focusBackgroundColor};
1324
1341
  backdrop-filter: blur(8px);
1325
1342
  -webkit-backdrop-filter: blur(8px);
1326
- box-shadow: 0 0 0 2px ${(x = (v = (M = i.token.items) == null ? void 0 : M.groupModal) == null ? void 0 : v.title) == null ? void 0 : x.shadowColor};
1343
+ box-shadow: 0 0 0 2px ${(k = (x = (N = i.token.items) == null ? void 0 : N.groupModal) == null ? void 0 : x.title) == null ? void 0 : k.shadowColor};
1327
1344
  transform: scale(1.02);
1328
1345
  }
1329
1346
 
1330
1347
  &:hover {
1331
- background: ${(D = (y = (h = i.token.items) == null ? void 0 : h.groupModal) == null ? void 0 : y.title) == null ? void 0 : D.hoverBackgroundColor};
1348
+ background: ${(M = (b = (m = i.token.items) == null ? void 0 : m.groupModal) == null ? void 0 : b.title) == null ? void 0 : M.hoverBackgroundColor};
1332
1349
  }
1333
1350
 
1334
1351
  &::placeholder {
1335
- color: ${($ = (P = (N = i.token.items) == null ? void 0 : N.groupModal) == null ? void 0 : P.title) == null ? void 0 : $.placeholderColor};
1352
+ color: ${(_ = (R = (S = i.token.items) == null ? void 0 : S.groupModal) == null ? void 0 : R.title) == null ? void 0 : _.placeholderColor};
1336
1353
  }
1337
1354
 
1338
1355
  &::selection {
1339
- background: ${(O = (T = (q = i.token.items) == null ? void 0 : q.groupModal) == null ? void 0 : T.title) == null ? void 0 : O.selectionBackgroundColor};
1356
+ background: ${(O = (P = (X = i.token.items) == null ? void 0 : X.groupModal) == null ? void 0 : P.title) == null ? void 0 : O.selectionBackgroundColor};
1340
1357
  }
1341
1358
  `
1342
1359
  ),
@@ -1347,7 +1364,7 @@ const qs = Ae(({ src: t }) => {
1347
1364
  }
1348
1365
  );
1349
1366
  }, mt = (t) => {
1350
- var v, x, h, y, D, N, P, $, q, T, O, R, W, se, Z, G, ee, le, ge, ae, ce, de;
1367
+ var x, k, m, b, M, S, R, _, X, P, O, T, W, se, ee, q, Z, ae, ce, ie, de, ue;
1351
1368
  const {
1352
1369
  visible: e,
1353
1370
  onClose: o,
@@ -1360,16 +1377,16 @@ const qs = Ae(({ src: t }) => {
1360
1377
  footer: p = null,
1361
1378
  className: d,
1362
1379
  contentClassName: g
1363
- } = t, { theme: m } = me(), c = m.token.modal, [u, k] = B(!1), [C, b] = B(!1);
1380
+ } = t, { theme: h } = me(), c = h.token.modal, [u, v] = B(!1), [C, y] = B(!1);
1364
1381
  return V(() => {
1365
- k(!!e);
1382
+ v(!!e);
1366
1383
  }, [e]), /* @__PURE__ */ s(Ce, { children: e && /* @__PURE__ */ s(
1367
1384
  ir,
1368
1385
  {
1369
1386
  visible: u,
1370
1387
  onClose: () => {
1371
- b(!0), k(!1), setTimeout(() => {
1372
- b(!1), o();
1388
+ y(!0), v(!1), setTimeout(() => {
1389
+ y(!1), o();
1373
1390
  }, 300);
1374
1391
  },
1375
1392
  animation: "zoom",
@@ -1378,13 +1395,13 @@ const qs = Ae(({ src: t }) => {
1378
1395
  title: n,
1379
1396
  footer: p,
1380
1397
  closable: f,
1381
- className: L(
1398
+ className: D(
1382
1399
  "base-modal",
1383
1400
  { "modal-closing": C },
1384
1401
  E`
1385
1402
  .rc-dialog-mask {
1386
- background: ${(v = c == null ? void 0 : c.mask) == null ? void 0 : v.backgroundColor};
1387
- backdrop-filter: ${(x = c == null ? void 0 : c.mask) == null ? void 0 : x.backdropFilter};
1403
+ background: ${(x = c == null ? void 0 : c.mask) == null ? void 0 : x.backgroundColor};
1404
+ backdrop-filter: ${(k = c == null ? void 0 : c.mask) == null ? void 0 : k.backdropFilter};
1388
1405
  animation: maskFadeIn 0.2s ease-out;
1389
1406
  }
1390
1407
 
@@ -1395,7 +1412,7 @@ const qs = Ae(({ src: t }) => {
1395
1412
  }
1396
1413
  to {
1397
1414
  opacity: 1;
1398
- backdrop-filter: ${(h = c == null ? void 0 : c.mask) == null ? void 0 : h.backdropFilter};
1415
+ backdrop-filter: ${(m = c == null ? void 0 : c.mask) == null ? void 0 : m.backdropFilter};
1399
1416
  }
1400
1417
  }
1401
1418
 
@@ -1407,13 +1424,13 @@ const qs = Ae(({ src: t }) => {
1407
1424
  }
1408
1425
 
1409
1426
  .rc-dialog-content {
1410
- background: ${(y = c == null ? void 0 : c.content) == null ? void 0 : y.backgroundColor};
1411
- backdrop-filter: ${(D = c == null ? void 0 : c.content) == null ? void 0 : D.backdropFilter};
1412
- box-shadow: 0 20px 40px ${(N = c == null ? void 0 : c.content) == null ? void 0 : N.boxShadowColor},
1413
- 0 0 0 0.75px ${(P = c == null ? void 0 : c.content) == null ? void 0 : P.boxShadowBorderColor};
1414
- border: 0.75px solid ${($ = c == null ? void 0 : c.content) == null ? void 0 : $.borderColor};
1427
+ background: ${(b = c == null ? void 0 : c.content) == null ? void 0 : b.backgroundColor};
1428
+ backdrop-filter: ${(M = c == null ? void 0 : c.content) == null ? void 0 : M.backdropFilter};
1429
+ box-shadow: 0 20px 40px ${(S = c == null ? void 0 : c.content) == null ? void 0 : S.boxShadowColor},
1430
+ 0 0 0 0.75px ${(R = c == null ? void 0 : c.content) == null ? void 0 : R.boxShadowBorderColor};
1431
+ border: 0.75px solid ${(_ = c == null ? void 0 : c.content) == null ? void 0 : _.borderColor};
1415
1432
  padding: 0;
1416
- border-radius: ${(q = c == null ? void 0 : c.content) == null ? void 0 : q.borderRadius};
1433
+ border-radius: ${(X = c == null ? void 0 : c.content) == null ? void 0 : X.borderRadius};
1417
1434
  overflow: hidden;
1418
1435
  animation: modalSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
1419
1436
  position: relative;
@@ -1444,7 +1461,7 @@ const qs = Ae(({ src: t }) => {
1444
1461
  @keyframes maskFadeOut {
1445
1462
  from {
1446
1463
  opacity: 1;
1447
- backdrop-filter: ${(T = c == null ? void 0 : c.mask) == null ? void 0 : T.backdropFilter};
1464
+ backdrop-filter: ${(P = c == null ? void 0 : c.mask) == null ? void 0 : P.backdropFilter};
1448
1465
  }
1449
1466
  to {
1450
1467
  opacity: 0;
@@ -1493,7 +1510,7 @@ const qs = Ae(({ src: t }) => {
1493
1510
  }
1494
1511
 
1495
1512
  &::-webkit-scrollbar-track {
1496
- background: ${(R = c == null ? void 0 : c.scrollbar) == null ? void 0 : R.trackColor};
1513
+ background: ${(T = c == null ? void 0 : c.scrollbar) == null ? void 0 : T.trackColor};
1497
1514
  }
1498
1515
 
1499
1516
  &::-webkit-scrollbar-thumb {
@@ -1503,12 +1520,12 @@ const qs = Ae(({ src: t }) => {
1503
1520
  }
1504
1521
 
1505
1522
  &::-webkit-scrollbar-thumb:hover {
1506
- background: ${(Z = c == null ? void 0 : c.scrollbar) == null ? void 0 : Z.thumbHoverColor};
1523
+ background: ${(ee = c == null ? void 0 : c.scrollbar) == null ? void 0 : ee.thumbHoverColor};
1507
1524
  }
1508
1525
 
1509
1526
  /* Firefox 滚动条样式 */
1510
1527
  scrollbar-width: thin;
1511
- scrollbar-color: ${(G = c == null ? void 0 : c.scrollbar) == null ? void 0 : G.thumbColor} ${(ee = c == null ? void 0 : c.scrollbar) == null ? void 0 : ee.trackColor};
1528
+ scrollbar-color: ${(q = c == null ? void 0 : c.scrollbar) == null ? void 0 : q.thumbColor} ${(Z = c == null ? void 0 : c.scrollbar) == null ? void 0 : Z.trackColor};
1512
1529
  }
1513
1530
  `,
1514
1531
  d
@@ -1518,28 +1535,28 @@ const qs = Ae(({ src: t }) => {
1518
1535
  children: /* @__PURE__ */ s(
1519
1536
  "div",
1520
1537
  {
1521
- className: L(
1538
+ className: D(
1522
1539
  "zs-overflow-y-auto zs-relative",
1523
1540
  E`
1524
1541
  max-height: 60vh;
1525
1542
 
1526
1543
  /* iOS 风格的滚动条 */
1527
1544
  &::-webkit-scrollbar {
1528
- width: ${(le = c == null ? void 0 : c.scrollbar) == null ? void 0 : le.width};
1545
+ width: ${(ae = c == null ? void 0 : c.scrollbar) == null ? void 0 : ae.width};
1529
1546
  }
1530
1547
 
1531
1548
  &::-webkit-scrollbar-track {
1532
- background: ${(ge = c == null ? void 0 : c.scrollbar) == null ? void 0 : ge.trackColor};
1549
+ background: ${(ce = c == null ? void 0 : c.scrollbar) == null ? void 0 : ce.trackColor};
1533
1550
  }
1534
1551
 
1535
1552
  &::-webkit-scrollbar-thumb {
1536
- background: ${(ae = c == null ? void 0 : c.scrollbar) == null ? void 0 : ae.thumbColor};
1537
- border-radius: ${(ce = c == null ? void 0 : c.scrollbar) == null ? void 0 : ce.borderRadius};
1553
+ background: ${(ie = c == null ? void 0 : c.scrollbar) == null ? void 0 : ie.thumbColor};
1554
+ border-radius: ${(de = c == null ? void 0 : c.scrollbar) == null ? void 0 : de.borderRadius};
1538
1555
  transition: background 0.2s ease;
1539
1556
  }
1540
1557
 
1541
1558
  &::-webkit-scrollbar-thumb:hover {
1542
- background: ${(de = c == null ? void 0 : c.scrollbar) == null ? void 0 : de.thumbHoverColor};
1559
+ background: ${(ue = c == null ? void 0 : c.scrollbar) == null ? void 0 : ue.thumbHoverColor};
1543
1560
  }
1544
1561
  `,
1545
1562
  g
@@ -1550,50 +1567,50 @@ const qs = Ae(({ src: t }) => {
1550
1567
  }
1551
1568
  ) });
1552
1569
  }, Js = (t) => {
1553
- const { data: e, onClose: o, onItemClick: n } = t, { list: r, setList: a, setListStatus: i, setMoveItemId: l, setMoveTargetId: f, updateItem: p } = Ee(), [d, g] = B("文件夹"), m = ne(null), c = ne(null), [u, k] = B(), [C, b] = B(), M = [...(e == null ? void 0 : e.children) ?? []];
1570
+ const { data: e, onClose: o, onItemClick: n } = t, { list: r, setList: a, setListStatus: i, setMoveItemId: l, setMoveTargetId: f, updateItem: p } = Ee(), [d, g] = B("文件夹"), h = ne(null), c = ne(null), [u, v] = B(), [C, y] = B(), N = [...(e == null ? void 0 : e.children) ?? []];
1554
1571
  V(() => {
1555
- var N;
1556
- e && g((N = e.data) == null ? void 0 : N.name);
1572
+ var S;
1573
+ e && g((S = e.data) == null ? void 0 : S.name);
1557
1574
  }, [e]);
1558
- const v = (N) => {
1559
- g(N);
1560
- }, x = () => {
1575
+ const x = (S) => {
1576
+ g(S);
1577
+ }, k = () => {
1561
1578
  e && p(e.id, {
1562
1579
  ...e.data,
1563
1580
  name: d
1564
1581
  });
1565
- }, h = (N) => {
1566
- const P = N.relatedTarget;
1567
- P && (N.currentTarget.contains(P) || setTimeout(() => {
1582
+ }, m = (S) => {
1583
+ const R = S.relatedTarget;
1584
+ R && (S.currentTarget.contains(R) || setTimeout(() => {
1568
1585
  o();
1569
1586
  }, 500));
1570
- }, y = fe((N) => {
1571
- const { width: P, marginLeft: $ } = Me.computeRowWidth(N, 112);
1572
- k(P), b($);
1573
- }, []), D = fe(
1574
- (N) => {
1575
- if (c.current && (c.current.disconnect(), c.current = null), m.current = N, !!N)
1587
+ }, b = ge((S) => {
1588
+ const { width: R, marginLeft: _ } = Me.computeRowWidth(S, 112);
1589
+ v(R), y(_);
1590
+ }, []), M = ge(
1591
+ (S) => {
1592
+ if (c.current && (c.current.disconnect(), c.current = null), h.current = S, !!S)
1576
1593
  if (window.requestAnimationFrame(() => {
1577
- y(N);
1594
+ b(S);
1578
1595
  }), "ResizeObserver" in window) {
1579
- const P = new ResizeObserver(() => {
1580
- y(N);
1596
+ const R = new ResizeObserver(() => {
1597
+ b(S);
1581
1598
  });
1582
- P.observe(N), c.current = P;
1599
+ R.observe(S), c.current = R;
1583
1600
  } else {
1584
- const P = () => {
1585
- y(N);
1601
+ const R = () => {
1602
+ b(S);
1586
1603
  };
1587
- globalThis.addEventListener("resize", P), c.current = {
1588
- disconnect: () => globalThis.removeEventListener("resize", P)
1604
+ globalThis.addEventListener("resize", R), c.current = {
1605
+ disconnect: () => globalThis.removeEventListener("resize", R)
1589
1606
  };
1590
1607
  }
1591
1608
  },
1592
- [y]
1609
+ [b]
1593
1610
  );
1594
1611
  return V(() => {
1595
- e && m.current && y(m.current);
1596
- }, [e, y]), /* @__PURE__ */ s(
1612
+ e && h.current && b(h.current);
1613
+ }, [e, b]), /* @__PURE__ */ s(
1597
1614
  mt,
1598
1615
  {
1599
1616
  className: E`
@@ -1603,33 +1620,33 @@ const qs = Ae(({ src: t }) => {
1603
1620
  `,
1604
1621
  visible: !!e,
1605
1622
  onClose: o,
1606
- title: /* @__PURE__ */ s(Ks, { value: d, onChange: v, onBlur: x, placeholder: "文件夹" }),
1623
+ title: /* @__PURE__ */ s(Ks, { value: d, onChange: x, onBlur: k, placeholder: "文件夹" }),
1607
1624
  mousePosition: e != null && e.pageX && (e != null && e.pageY) ? {
1608
1625
  x: e == null ? void 0 : e.pageX,
1609
1626
  y: e == null ? void 0 : e.pageY
1610
1627
  } : null,
1611
- children: /* @__PURE__ */ s("div", { ref: D, className: "zs-min-h-96 zs-px-4", onDragLeave: h, children: /* @__PURE__ */ s(
1628
+ children: /* @__PURE__ */ s("div", { ref: M, className: "zs-min-h-96 zs-px-4", onDragLeave: m, children: /* @__PURE__ */ s(
1612
1629
  gt,
1613
1630
  {
1614
- className: L("zs-grid zs-place-items-center zs-grid-flow-row-dense zs-mx-auto", Gs),
1631
+ className: D("zs-grid zs-place-items-center zs-grid-flow-row-dense zs-mx-auto", Gs),
1615
1632
  style: { width: u, marginLeft: C },
1616
1633
  ...Vs,
1617
1634
  list: (e == null ? void 0 : e.children) ?? [],
1618
- setList: (N) => {
1619
- var q, T;
1620
- const P = N.map((O) => O.id), $ = (T = (q = r.find((O) => O.id === (e == null ? void 0 : e.id))) == null ? void 0 : q.children) == null ? void 0 : T.map((O) => O.id);
1621
- P.length === ($ == null ? void 0 : $.length) && P.every((O, R) => O === $[R]) || P.length < (($ == null ? void 0 : $.length) ?? 0) || a(N, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
1635
+ setList: (S) => {
1636
+ var X, P;
1637
+ const R = S.map((O) => O.id), _ = (P = (X = r.find((O) => O.id === (e == null ? void 0 : e.id))) == null ? void 0 : X.children) == null ? void 0 : P.map((O) => O.id);
1638
+ R.length === (_ == null ? void 0 : _.length) && R.every((O, T) => O === _[T]) || R.length < ((_ == null ? void 0 : _.length) ?? 0) || a(S, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
1622
1639
  },
1623
1640
  onMove: () => (f(null), i("onMove"), !0),
1624
- onStart: (N) => {
1625
- const P = N.item.dataset;
1626
- P != null && P.id && l(P.id), i("onMove");
1641
+ onStart: (S) => {
1642
+ const R = S.item.dataset;
1643
+ R != null && R.id && l(R.id), i("onMove");
1627
1644
  },
1628
1645
  onEnd: () => {
1629
1646
  l(null), f(null), i(null);
1630
1647
  },
1631
1648
  ghostClass: No,
1632
- children: /* @__PURE__ */ s(Ce, { mode: "popLayout", children: M.map((N, P) => /* @__PURE__ */ s("div", { className: "zs-w-28 zs-h-28 zs-flex zs-items-center zs-justify-center", children: /* @__PURE__ */ s(_e, { data: N, itemIndex: P, onClick: n }, N.id) }, N.id)) })
1649
+ children: /* @__PURE__ */ s(Ce, { mode: "popLayout", children: N.map((S, R) => /* @__PURE__ */ s("div", { className: "zs-w-28 zs-h-28 zs-flex zs-items-center zs-justify-center", children: /* @__PURE__ */ s(_e, { data: S, itemIndex: R, onClick: n }, S.id) }, S.id)) })
1633
1650
  }
1634
1651
  ) })
1635
1652
  }
@@ -1650,7 +1667,7 @@ const qs = Ae(({ src: t }) => {
1650
1667
  children: e && /* @__PURE__ */ s(
1651
1668
  "div",
1652
1669
  {
1653
- className: L(
1670
+ className: D(
1654
1671
  "zs-p-2 zs-rounded-md",
1655
1672
  E`
1656
1673
  background-color: ${(a = n.token.items) == null ? void 0 : a.infoModalBackgroundColor};
@@ -1664,7 +1681,7 @@ const qs = Ae(({ src: t }) => {
1664
1681
  }, ea = ({ dots: t, className: e }) => /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
1665
1682
  "ul",
1666
1683
  {
1667
- className: L(
1684
+ className: D(
1668
1685
  "slick-dots-default",
1669
1686
  "!zs-flex zs-justify-center zs-items-center zs-gap-3",
1670
1687
  E`
@@ -1712,7 +1729,7 @@ const qs = Ae(({ src: t }) => {
1712
1729
  "button",
1713
1730
  {
1714
1731
  type: "button",
1715
- className: L(
1732
+ className: D(
1716
1733
  "zs-w-2 zs-h-2 zs-rounded-full zs-border-none zs-cursor-pointer",
1717
1734
  E`
1718
1735
  background-color: ${r ? "rgba(0, 0, 0, 1)" : "rgba(0, 0, 0, 0.3)"};
@@ -1723,19 +1740,19 @@ const qs = Ae(({ src: t }) => {
1723
1740
  }
1724
1741
  );
1725
1742
  }, ra = ({ onClick: t, className: e }) => {
1726
- var c, u, k;
1727
- const [o, n] = B(!1), { theme: r } = me(), a = (k = (u = (c = r == null ? void 0 : r.token) == null ? void 0 : c.dock) == null ? void 0 : u.launchpad) == null ? void 0 : k.icon, i = a.textColor, l = a.backgroundColor, f = a.borderColor, p = a.shadowColor, d = a.hoverGlowColor, g = (C, b) => {
1743
+ var c, u, v;
1744
+ const [o, n] = B(!1), { theme: r } = me(), a = (v = (u = (c = r == null ? void 0 : r.token) == null ? void 0 : c.dock) == null ? void 0 : u.launchpad) == null ? void 0 : v.icon, i = a.textColor, l = a.backgroundColor, f = a.borderColor, p = a.shadowColor, d = a.hoverGlowColor, g = (C, y) => {
1728
1745
  if (C.startsWith("#")) {
1729
- const v = C.slice(1), x = parseInt(v.slice(0, 2), 16), h = parseInt(v.slice(2, 4), 16), y = parseInt(v.slice(4, 6), 16), D = b * 15, N = Math.max(0, x - D), P = Math.max(0, h - D), $ = Math.max(0, y - D);
1730
- return `rgb(${N}, ${P}, ${$})`;
1746
+ const x = C.slice(1), k = parseInt(x.slice(0, 2), 16), m = parseInt(x.slice(2, 4), 16), b = parseInt(x.slice(4, 6), 16), M = y * 15, S = Math.max(0, k - M), R = Math.max(0, m - M), _ = Math.max(0, b - M);
1747
+ return `rgb(${S}, ${R}, ${_})`;
1731
1748
  }
1732
- const M = C.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
1733
- if (M) {
1734
- const v = parseInt(M[1]), x = parseInt(M[2]), h = parseInt(M[3]), y = M[4] || "1", D = b * 15, N = Math.max(0, v - D), P = Math.max(0, x - D), $ = Math.max(0, h - D);
1735
- return `rgba(${N}, ${P}, ${$}, ${y})`;
1749
+ const N = C.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
1750
+ if (N) {
1751
+ const x = parseInt(N[1]), k = parseInt(N[2]), m = parseInt(N[3]), b = N[4] || "1", M = y * 15, S = Math.max(0, x - M), R = Math.max(0, k - M), _ = Math.max(0, m - M);
1752
+ return `rgba(${S}, ${R}, ${_}, ${b})`;
1736
1753
  }
1737
1754
  return C;
1738
- }, m = [
1755
+ }, h = [
1739
1756
  {
1740
1757
  id: "app1",
1741
1758
  icon: /* @__PURE__ */ s(cr, { size: 32 })
@@ -1751,9 +1768,9 @@ const qs = Ae(({ src: t }) => {
1751
1768
  }
1752
1769
  ];
1753
1770
  return /* @__PURE__ */ A(
1754
- X.div,
1771
+ Y.div,
1755
1772
  {
1756
- className: L("zs-cursor-pointer zs-relative", e),
1773
+ className: D("zs-cursor-pointer zs-relative", e),
1757
1774
  style: {
1758
1775
  overflow: "visible",
1759
1776
  padding: "0 8px 0 0"
@@ -1777,38 +1794,38 @@ const qs = Ae(({ src: t }) => {
1777
1794
  height: "56px",
1778
1795
  overflow: "visible"
1779
1796
  },
1780
- children: m.map((C, b) => {
1781
- const M = b * 4, v = 0, x = o ? M + b * 2 : M, h = v, y = 0, D = 1 - b * 0.05, N = m.length - b, P = ($) => $ === 0 ? l : g(l, $);
1797
+ children: h.map((C, y) => {
1798
+ const N = y * 4, x = 0, k = o ? N + y * 2 : N, m = x, b = 0, M = 1 - y * 0.05, S = h.length - y, R = (_) => _ === 0 ? l : g(l, _);
1782
1799
  return /* @__PURE__ */ s(
1783
- X.div,
1800
+ Y.div,
1784
1801
  {
1785
- className: L(
1802
+ className: D(
1786
1803
  "zs-absolute zs-w-full zs-h-full zs-rounded-xl zs-flex zs-items-center zs-justify-center zs-shadow-lg",
1787
1804
  E`
1788
- background: ${P(b)};
1805
+ background: ${R(y)};
1789
1806
  color: ${i};
1790
- z-index: ${N};
1791
- box-shadow: 0 ${1 + b * 0.5}px ${4 + b * 1}px
1792
- ${p.replace(/[\d.]+\)$/, `${0.1 + b * 0.02})`)};
1807
+ z-index: ${S};
1808
+ box-shadow: 0 ${1 + y * 0.5}px ${4 + y * 1}px
1809
+ ${p.replace(/[\d.]+\)$/, `${0.1 + y * 0.02})`)};
1793
1810
  border: 0.5px solid ${f};
1794
1811
  `
1795
1812
  ),
1796
1813
  initial: { opacity: 0, scale: 0.8 },
1797
1814
  animate: {
1798
1815
  opacity: 1,
1799
- scale: D,
1800
- x,
1801
- y: h,
1802
- rotate: y
1816
+ scale: M,
1817
+ x: k,
1818
+ y: m,
1819
+ rotate: b
1803
1820
  },
1804
1821
  transition: {
1805
- delay: b * 0.1,
1822
+ delay: y * 0.1,
1806
1823
  duration: 0.3,
1807
1824
  x: { duration: 0.2 },
1808
1825
  y: { duration: 0.2 },
1809
1826
  rotate: { duration: 0.2 }
1810
1827
  },
1811
- children: b === 0 && /* @__PURE__ */ s("div", { className: "zs-flex zs-items-center zs-justify-center zs-w-full zs-h-full", children: C.icon })
1828
+ children: y === 0 && /* @__PURE__ */ s("div", { className: "zs-flex zs-items-center zs-justify-center zs-w-full zs-h-full", children: C.icon })
1812
1829
  },
1813
1830
  C.id
1814
1831
  );
@@ -1816,9 +1833,9 @@ const qs = Ae(({ src: t }) => {
1816
1833
  }
1817
1834
  ),
1818
1835
  /* @__PURE__ */ s(
1819
- X.div,
1836
+ Y.div,
1820
1837
  {
1821
- className: L(
1838
+ className: D(
1822
1839
  "zs-absolute zs-inset-0 zs-rounded-xl zs-pointer-events-none",
1823
1840
  E`
1824
1841
  background: radial-gradient(circle, ${d} 0%, transparent 70%);
@@ -1832,7 +1849,7 @@ const qs = Ae(({ src: t }) => {
1832
1849
  ]
1833
1850
  }
1834
1851
  );
1835
- }, Io = ({ onClick: t, className: e }) => /* @__PURE__ */ s(ra, { onClick: t, className: L("zs-flex-shrink-0", e) });
1852
+ }, Io = ({ onClick: t, className: e }) => /* @__PURE__ */ s(ra, { onClick: t, className: D("zs-flex-shrink-0", e) });
1836
1853
  function Mo() {
1837
1854
  const t = () => {
1838
1855
  if (typeof navigator > "u") return !1;
@@ -1856,29 +1873,29 @@ const So = ({
1856
1873
  onDockItemsChange: p,
1857
1874
  itemSize: d = 56
1858
1875
  }) => {
1859
- var q;
1860
- const { setListStatus: g } = Ee(), { theme: m } = me(), c = m.token.dock, u = m.token.base, k = Mo(), [C, b] = B(null), [M, v] = B(null), [x, h] = B(0), [y, D] = B(!1), N = (T, O) => r ? r(T, O) : /* @__PURE__ */ s(_e, { data: T, itemIndex: O, noLetters: !0, from: "dock", iconSize: d }, T.id), P = (T, O) => a ? a(T, O) : /* @__PURE__ */ s(
1876
+ var X;
1877
+ const { setListStatus: g } = Ee(), { theme: h } = me(), c = h.token.dock, u = h.token.base, v = Mo(), [C, y] = B(null), [N, x] = B(null), [k, m] = B(0), [b, M] = B(!1), S = (P, O) => r ? r(P, O) : /* @__PURE__ */ s(_e, { data: P, itemIndex: O, noLetters: !0, from: "dock", iconSize: d }, P.id), R = (P, O) => a ? a(P, O) : /* @__PURE__ */ s(
1861
1878
  _e,
1862
1879
  {
1863
- data: T,
1880
+ data: P,
1864
1881
  itemIndex: O,
1865
1882
  noLetters: !0,
1866
1883
  from: "dock",
1867
1884
  disabledDrag: !0,
1868
1885
  iconSize: d
1869
1886
  },
1870
- T.id
1887
+ P.id
1871
1888
  );
1872
1889
  if (!t.length && !e.length && !i)
1873
1890
  return null;
1874
- const $ = /* @__PURE__ */ s(
1891
+ const _ = /* @__PURE__ */ s(
1875
1892
  "div",
1876
1893
  {
1877
- className: L(
1894
+ className: D(
1878
1895
  "zs-flex zs-transition-colors",
1879
1896
  o === "top" || o === "bottom" ? "zs-w-[1px] zs-h-8 zs-mx-1" : "zs-w-8 zs-h-[1px] zs-my-1",
1880
1897
  E`
1881
- background-color: ${((q = c == null ? void 0 : c.divider) == null ? void 0 : q.color) || "rgba(255, 255, 255, 0.3)"};
1898
+ background-color: ${((X = c == null ? void 0 : c.divider) == null ? void 0 : X.color) || "rgba(255, 255, 255, 0.3)"};
1882
1899
  `
1883
1900
  )
1884
1901
  }
@@ -1887,7 +1904,7 @@ const So = ({
1887
1904
  /* @__PURE__ */ A(
1888
1905
  "div",
1889
1906
  {
1890
- className: L(
1907
+ className: D(
1891
1908
  "zs-flex zs-justify-between zs-items-center zs-rounded-2xl zs-py-3 zs-px-4 zs-backdrop-blur-xl zs-gap-1 zs-border zs-transition-colors zs-max-w-full",
1892
1909
  o === "top" || o === "bottom" ? "zs-flex-row" : "zs-flex-col",
1893
1910
  o === "top" && "zs-mb-4",
@@ -1899,33 +1916,33 @@ const So = ({
1899
1916
  `,
1900
1917
  n
1901
1918
  ),
1902
- onDragOver: (T) => T.preventDefault(),
1903
- onDrop: (T) => {
1904
- T.preventDefault(), f && f();
1919
+ onDragOver: (P) => P.preventDefault(),
1920
+ onDrop: (P) => {
1921
+ P.preventDefault(), f && f();
1905
1922
  },
1906
1923
  children: [
1907
1924
  e.length > 0 && /* @__PURE__ */ s(
1908
1925
  "div",
1909
1926
  {
1910
- className: L(
1927
+ className: D(
1911
1928
  "zs-flex zs-gap-3",
1912
1929
  E`
1913
1930
  ${o === "top" || o === "bottom" ? "flex-direction: row;" : "flex-direction: column;"}
1914
1931
  `
1915
1932
  ),
1916
- children: /* @__PURE__ */ s(Ce, { mode: "popLayout", children: e.map((T, O) => /* @__PURE__ */ s("div", { children: P(T, O) }, T.id)) })
1933
+ children: /* @__PURE__ */ s(Ce, { mode: "popLayout", children: e.map((P, O) => /* @__PURE__ */ s("div", { children: R(P, O) }, P.id)) })
1917
1934
  }
1918
1935
  ),
1919
- e.length > 0 && t.length > 0 && $,
1936
+ e.length > 0 && t.length > 0 && _,
1920
1937
  /* @__PURE__ */ s(
1921
1938
  gt,
1922
1939
  {
1923
1940
  list: t,
1924
- setList: (T) => {
1925
- p && p(T);
1941
+ setList: (P) => {
1942
+ p && p(P);
1926
1943
  },
1927
1944
  ...yo,
1928
- className: L(
1945
+ className: D(
1929
1946
  "desktop-dock-sortable zs-flex zs-gap-3 flex-1 zs-relative",
1930
1947
  E`
1931
1948
  min-height: ${d}px;
@@ -1960,10 +1977,10 @@ const So = ({
1960
1977
  onEnd: () => {
1961
1978
  g(null);
1962
1979
  },
1963
- children: t.length > 0 ? t.map((T, O) => N(T, O)) : /* @__PURE__ */ s(
1964
- X.div,
1980
+ children: t.length > 0 ? t.map((P, O) => S(P, O)) : /* @__PURE__ */ s(
1981
+ Y.div,
1965
1982
  {
1966
- className: L(
1983
+ className: D(
1967
1984
  "drag-disabled dock-items-empty zs-flex zs-items-center zs-justify-center zs-gap-2 zs-rounded-xl zs-border-2 zs-border-dashed zs-absolute zs-top-0 zs-left-0",
1968
1985
  E`
1969
1986
  min-height: ${d}px;
@@ -1979,15 +1996,15 @@ const So = ({
1979
1996
  )
1980
1997
  }
1981
1998
  ),
1982
- i && !k && (e.length > 0 || t.length > 0) && $,
1983
- i && (!k || o !== "bottom") && /* @__PURE__ */ s(Io, { onClick: l, position: o })
1999
+ i && !v && (e.length > 0 || t.length > 0) && _,
2000
+ i && (!v || o !== "bottom") && /* @__PURE__ */ s(Io, { onClick: l, position: o })
1984
2001
  ]
1985
2002
  }
1986
2003
  ),
1987
- i && k && /* @__PURE__ */ s(
1988
- X.div,
2004
+ i && v && /* @__PURE__ */ s(
2005
+ Y.div,
1989
2006
  {
1990
- className: L(
2007
+ className: D(
1991
2008
  "zs-absolute zs-left-1/2 -zs-bottom-3 zs--translate-x-1/2 zs-rounded-full zs-cursor-pointer",
1992
2009
  E`
1993
2010
  width: 50vw;
@@ -2001,26 +2018,26 @@ const So = ({
2001
2018
  ),
2002
2019
  style: {
2003
2020
  // 根据上滑距离做轻微的视觉反馈
2004
- transform: `translateX(-50%) translateY(0) scale(${1 + Math.min(Math.max(-x, 0), 80) / 800})`
2021
+ transform: `translateX(-50%) translateY(0) scale(${1 + Math.min(Math.max(-k, 0), 80) / 800})`
2005
2022
  },
2006
- onTouchStart: (T) => {
2007
- b(T.touches[0].clientY), v(T.touches[0].clientX), h(0), D(!1);
2023
+ onTouchStart: (P) => {
2024
+ y(P.touches[0].clientY), x(P.touches[0].clientX), m(0), M(!1);
2008
2025
  },
2009
- onTouchMove: (T) => {
2010
- if (C === null || M === null) return;
2011
- const O = T.touches[0].clientY - C, R = T.touches[0].clientX - M;
2012
- if (!y)
2013
- if (Math.abs(O) > Math.abs(R) && O < 0)
2014
- D(!0);
2026
+ onTouchMove: (P) => {
2027
+ if (C === null || N === null) return;
2028
+ const O = P.touches[0].clientY - C, T = P.touches[0].clientX - N;
2029
+ if (!b)
2030
+ if (Math.abs(O) > Math.abs(T) && O < 0)
2031
+ M(!0);
2015
2032
  else
2016
2033
  return;
2017
- T.preventDefault(), T.stopPropagation(), h(O);
2034
+ P.preventDefault(), P.stopPropagation(), m(O);
2018
2035
  },
2019
2036
  onTouchEnd: () => {
2020
- y && C !== null && x < -60 && (l == null || l()), b(null), v(null), h(0), D(!1);
2037
+ b && C !== null && k < -60 && (l == null || l()), y(null), x(null), m(0), M(!1);
2021
2038
  },
2022
2039
  onTouchCancel: () => {
2023
- b(null), v(null), h(0), D(!1);
2040
+ y(null), x(null), m(0), M(!1);
2024
2041
  },
2025
2042
  title: "上滑打开启动台"
2026
2043
  }
@@ -2029,12 +2046,12 @@ const So = ({
2029
2046
  }, yt = E`
2030
2047
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
2031
2048
  `, na = ({ value: t, onChange: e, placeholder: o = "搜索应用", className: n = "" }) => {
2032
- var c, u, k, C, b, M, v, x, h, y, D, N, P, $, q, T, O, R, W, se, Z, G, ee, le, ge, ae, ce, de, K, be, Q, he, pe, ke, ze, U, te, Y, j, oe, J, I, z;
2049
+ var c, u, v, C, y, N, x, k, m, b, M, S, R, _, X, P, O, T, W, se, ee, q, Z, ae, ce, ie, de, ue, K, be, Q, he, pe, ke, ze, U, te, G, j, oe, J, I, z;
2033
2050
  const { theme: r } = me(), a = ne(null), i = ne(null), l = ne(null), [f, p] = B(!1), d = () => {
2034
2051
  p(!0), i.current && (i.current.style.transform = "translateY(-50%) translateX(-0.5rem)"), l.current && (l.current.style.transform = "translateY(-50%) translateX(0.5rem)");
2035
2052
  }, g = () => {
2036
2053
  p(!1), i.current && (i.current.style.transform = "translateY(-50%) translateX(0)"), l.current && (l.current.style.transform = "translateY(-50%) translateX(0)");
2037
- }, m = () => {
2054
+ }, h = () => {
2038
2055
  var w;
2039
2056
  e(""), (w = a.current) == null || w.focus();
2040
2057
  };
@@ -2043,10 +2060,10 @@ const So = ({
2043
2060
  "div",
2044
2061
  {
2045
2062
  ref: i,
2046
- className: L(
2063
+ className: D(
2047
2064
  "zs-absolute zs-left-4 zs-top-1/2 zs-transform zs--translate-y-1/2 zs-pointer-events-none zs-transition-all zs-duration-300",
2048
2065
  E`
2049
- color: ${f ? (C = (k = (u = (c = r.token.dock) == null ? void 0 : c.launchpad) == null ? void 0 : u.modal) == null ? void 0 : k.searchBox) == null ? void 0 : C.iconFocusColor : (x = (v = (M = (b = r.token.dock) == null ? void 0 : b.launchpad) == null ? void 0 : M.modal) == null ? void 0 : v.searchBox) == null ? void 0 : x.iconColor};
2066
+ color: ${f ? (C = (v = (u = (c = r.token.dock) == null ? void 0 : c.launchpad) == null ? void 0 : u.modal) == null ? void 0 : v.searchBox) == null ? void 0 : C.iconFocusColor : (k = (x = (N = (y = r.token.dock) == null ? void 0 : y.launchpad) == null ? void 0 : N.modal) == null ? void 0 : x.searchBox) == null ? void 0 : k.iconColor};
2050
2067
  `,
2051
2068
  yt
2052
2069
  ),
@@ -2057,17 +2074,17 @@ const So = ({
2057
2074
  "input",
2058
2075
  {
2059
2076
  ref: a,
2060
- className: L(
2077
+ className: D(
2061
2078
  "zs-w-full zs-h-11 zs-pl-12 zs-pr-12 zs-border-none zs-rounded-[22px] zs-text-base zs-outline-none zs-transition-all zs-duration-300 placeholder:zs-font-normal focus:zs-scale-[1.02]",
2062
2079
  E`
2063
- background-color: ${(N = (D = (y = (h = r.token.dock) == null ? void 0 : h.launchpad) == null ? void 0 : y.modal) == null ? void 0 : D.searchBox) == null ? void 0 : N.backgroundColor};
2064
- color: ${(T = (q = ($ = (P = r.token.dock) == null ? void 0 : P.launchpad) == null ? void 0 : $.modal) == null ? void 0 : q.searchBox) == null ? void 0 : T.textColor};
2080
+ background-color: ${(S = (M = (b = (m = r.token.dock) == null ? void 0 : m.launchpad) == null ? void 0 : b.modal) == null ? void 0 : M.searchBox) == null ? void 0 : S.backgroundColor};
2081
+ color: ${(P = (X = (_ = (R = r.token.dock) == null ? void 0 : R.launchpad) == null ? void 0 : _.modal) == null ? void 0 : X.searchBox) == null ? void 0 : P.textColor};
2065
2082
  &::placeholder {
2066
- color: ${(se = (W = (R = (O = r.token.dock) == null ? void 0 : O.launchpad) == null ? void 0 : R.modal) == null ? void 0 : W.searchBox) == null ? void 0 : se.placeholderColor};
2083
+ color: ${(se = (W = (T = (O = r.token.dock) == null ? void 0 : O.launchpad) == null ? void 0 : T.modal) == null ? void 0 : W.searchBox) == null ? void 0 : se.placeholderColor};
2067
2084
  }
2068
2085
  &:focus {
2069
- background-color: ${(le = (ee = (G = (Z = r.token.dock) == null ? void 0 : Z.launchpad) == null ? void 0 : G.modal) == null ? void 0 : ee.searchBox) == null ? void 0 : le.focusBackgroundColor};
2070
- box-shadow: 0 4px 20px ${(de = (ce = (ae = (ge = r.token.dock) == null ? void 0 : ge.launchpad) == null ? void 0 : ae.modal) == null ? void 0 : ce.searchBox) == null ? void 0 : de.shadowColor};
2086
+ background-color: ${(ae = (Z = (q = (ee = r.token.dock) == null ? void 0 : ee.launchpad) == null ? void 0 : q.modal) == null ? void 0 : Z.searchBox) == null ? void 0 : ae.focusBackgroundColor};
2087
+ box-shadow: 0 4px 20px ${(ue = (de = (ie = (ce = r.token.dock) == null ? void 0 : ce.launchpad) == null ? void 0 : ie.modal) == null ? void 0 : de.searchBox) == null ? void 0 : ue.shadowColor};
2071
2088
  }
2072
2089
  `,
2073
2090
  yt
@@ -2084,25 +2101,25 @@ const So = ({
2084
2101
  "button",
2085
2102
  {
2086
2103
  ref: l,
2087
- className: L(
2104
+ className: D(
2088
2105
  "zs-absolute zs-right-3 zs-top-1/2 zs-transform zs--translate-y-1/2 zs-w-5 zs-h-5 zs-rounded-full zs-border-none zs-text-xs zs-cursor-pointer zs-flex zs-items-center zs-justify-center zs-transition-all zs-duration-300 hover:zs-scale-110 active:zs-scale-95",
2089
2106
  E`
2090
2107
  background-color: ${(pe = (he = (Q = (be = (K = r.token.dock) == null ? void 0 : K.launchpad) == null ? void 0 : be.modal) == null ? void 0 : Q.searchBox) == null ? void 0 : he.clearButton) == null ? void 0 : pe.backgroundColor};
2091
- color: ${(Y = (te = (U = (ze = (ke = r.token.dock) == null ? void 0 : ke.launchpad) == null ? void 0 : ze.modal) == null ? void 0 : U.searchBox) == null ? void 0 : te.clearButton) == null ? void 0 : Y.textColor};
2108
+ color: ${(G = (te = (U = (ze = (ke = r.token.dock) == null ? void 0 : ke.launchpad) == null ? void 0 : ze.modal) == null ? void 0 : U.searchBox) == null ? void 0 : te.clearButton) == null ? void 0 : G.textColor};
2092
2109
  &:hover {
2093
2110
  background-color: ${(z = (I = (J = (oe = (j = r.token.dock) == null ? void 0 : j.launchpad) == null ? void 0 : oe.modal) == null ? void 0 : J.searchBox) == null ? void 0 : I.clearButton) == null ? void 0 : z.hoverBackgroundColor};
2094
2111
  }
2095
2112
  `,
2096
2113
  yt
2097
2114
  ),
2098
- onClick: m,
2115
+ onClick: h,
2099
2116
  title: "清除搜索",
2100
2117
  children: /* @__PURE__ */ s(Nt, { size: 12 })
2101
2118
  }
2102
2119
  )
2103
2120
  ] });
2104
2121
  }, Lo = (t) => {
2105
- var h, y, D, N, P, $, q, T, O, R, W, se, Z, G, ee, le, ge, ae, ce, de, K, be, Q;
2122
+ var m, b, M, S, R, _, X, P, O, T, W, se, ee, q, Z, ae, ce, ie, de, ue, K, be, Q;
2106
2123
  const {
2107
2124
  open: e = !1,
2108
2125
  onClose: o,
@@ -2115,33 +2132,33 @@ const So = ({
2115
2132
  maskClosable: p = !0,
2116
2133
  className: d,
2117
2134
  contentClassName: g,
2118
- ...m
2119
- } = t, { theme: c } = me(), u = c.token.modal, [k, C] = B(!1), [b, M] = B(!1);
2135
+ ...h
2136
+ } = t, { theme: c } = me(), u = c.token.modal, [v, C] = B(!1), [y, N] = B(!1);
2120
2137
  V(() => {
2121
2138
  C(!!e);
2122
2139
  }, [e]);
2123
- const v = (he) => {
2124
- M(!0), C(!1), setTimeout(() => {
2125
- M(!1), o == null || o(he);
2140
+ const x = (he) => {
2141
+ N(!0), C(!1), setTimeout(() => {
2142
+ N(!1), o == null || o(he);
2126
2143
  }, 300);
2127
- }, x = a === "left" || a === "right" ? { width: i } : { height: l ?? 300 };
2144
+ }, k = a === "left" || a === "right" ? { width: i } : { height: l ?? 300 };
2128
2145
  return e ? /* @__PURE__ */ s(
2129
2146
  Ar,
2130
2147
  {
2131
- open: k,
2132
- onClose: v,
2148
+ open: v,
2149
+ onClose: x,
2133
2150
  placement: a,
2134
2151
  mask: f,
2135
2152
  maskClosable: p,
2136
- className: L(
2153
+ className: D(
2137
2154
  "base-drawer",
2138
- { "drawer-closing": b },
2155
+ { "drawer-closing": y },
2139
2156
  E`
2140
2157
  /* Mask styling */
2141
2158
  .drawer-mask,
2142
2159
  .rc-drawer-mask {
2143
- background: ${(h = u == null ? void 0 : u.mask) == null ? void 0 : h.backgroundColor};
2144
- backdrop-filter: ${(y = u == null ? void 0 : u.mask) == null ? void 0 : y.backdropFilter};
2160
+ background: ${(m = u == null ? void 0 : u.mask) == null ? void 0 : m.backgroundColor};
2161
+ backdrop-filter: ${(b = u == null ? void 0 : u.mask) == null ? void 0 : b.backdropFilter};
2145
2162
  animation: maskFadeIn 0.2s ease-out;
2146
2163
  }
2147
2164
 
@@ -2152,14 +2169,14 @@ const So = ({
2152
2169
  }
2153
2170
  to {
2154
2171
  opacity: 1;
2155
- backdrop-filter: ${(D = u == null ? void 0 : u.mask) == null ? void 0 : D.backdropFilter};
2172
+ backdrop-filter: ${(M = u == null ? void 0 : u.mask) == null ? void 0 : M.backdropFilter};
2156
2173
  }
2157
2174
  }
2158
2175
 
2159
2176
  @keyframes maskFadeOut {
2160
2177
  from {
2161
2178
  opacity: 1;
2162
- backdrop-filter: ${(N = u == null ? void 0 : u.mask) == null ? void 0 : N.backdropFilter};
2179
+ backdrop-filter: ${(S = u == null ? void 0 : u.mask) == null ? void 0 : S.backdropFilter};
2163
2180
  }
2164
2181
  to {
2165
2182
  opacity: 0;
@@ -2170,12 +2187,12 @@ const So = ({
2170
2187
  /* Drawer content wrapper styling */
2171
2188
  .drawer-content-wrapper,
2172
2189
  .rc-drawer-content-wrapper {
2173
- background: ${(P = u == null ? void 0 : u.content) == null ? void 0 : P.backgroundColor};
2174
- backdrop-filter: ${($ = u == null ? void 0 : u.content) == null ? void 0 : $.backdropFilter};
2175
- box-shadow: 0 20px 40px ${(q = u == null ? void 0 : u.content) == null ? void 0 : q.boxShadowColor},
2176
- 0 0 0 0.75px ${(T = u == null ? void 0 : u.content) == null ? void 0 : T.boxShadowBorderColor};
2190
+ background: ${(R = u == null ? void 0 : u.content) == null ? void 0 : R.backgroundColor};
2191
+ backdrop-filter: ${(_ = u == null ? void 0 : u.content) == null ? void 0 : _.backdropFilter};
2192
+ box-shadow: 0 20px 40px ${(X = u == null ? void 0 : u.content) == null ? void 0 : X.boxShadowColor},
2193
+ 0 0 0 0.75px ${(P = u == null ? void 0 : u.content) == null ? void 0 : P.boxShadowBorderColor};
2177
2194
  border: 0.75px solid ${(O = u == null ? void 0 : u.content) == null ? void 0 : O.borderColor};
2178
- border-radius: ${(R = u == null ? void 0 : u.content) == null ? void 0 : R.borderRadius};
2195
+ border-radius: ${(T = u == null ? void 0 : u.content) == null ? void 0 : T.borderRadius};
2179
2196
  overflow: hidden;
2180
2197
  animation: drawerFadeIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
2181
2198
  }
@@ -2229,36 +2246,36 @@ const So = ({
2229
2246
  background: ${(se = u == null ? void 0 : u.scrollbar) == null ? void 0 : se.trackColor};
2230
2247
  }
2231
2248
  &::-webkit-scrollbar-thumb {
2232
- background: ${(Z = u == null ? void 0 : u.scrollbar) == null ? void 0 : Z.thumbColor};
2233
- border-radius: ${(G = u == null ? void 0 : u.scrollbar) == null ? void 0 : G.borderRadius};
2249
+ background: ${(ee = u == null ? void 0 : u.scrollbar) == null ? void 0 : ee.thumbColor};
2250
+ border-radius: ${(q = u == null ? void 0 : u.scrollbar) == null ? void 0 : q.borderRadius};
2234
2251
  transition: background-color 0.2s ease;
2235
2252
  }
2236
2253
  &::-webkit-scrollbar-thumb:hover {
2237
- background: ${(ee = u == null ? void 0 : u.scrollbar) == null ? void 0 : ee.thumbHoverColor};
2254
+ background: ${(Z = u == null ? void 0 : u.scrollbar) == null ? void 0 : Z.thumbHoverColor};
2238
2255
  }
2239
2256
  scrollbar-width: thin;
2240
- scrollbar-color: ${(le = u == null ? void 0 : u.scrollbar) == null ? void 0 : le.thumbColor} ${(ge = u == null ? void 0 : u.scrollbar) == null ? void 0 : ge.trackColor};
2257
+ scrollbar-color: ${(ae = u == null ? void 0 : u.scrollbar) == null ? void 0 : ae.thumbColor} ${(ce = u == null ? void 0 : u.scrollbar) == null ? void 0 : ce.trackColor};
2241
2258
  }
2242
2259
  `,
2243
2260
  d
2244
2261
  ),
2245
- ...x,
2246
- ...m,
2262
+ ...k,
2263
+ ...h,
2247
2264
  children: /* @__PURE__ */ A(
2248
2265
  "div",
2249
2266
  {
2250
- className: L(
2267
+ className: D(
2251
2268
  "zs-relative zs-overflow-y-auto",
2252
2269
  E`
2253
2270
  /* iOS-like scrollbar */
2254
2271
  &::-webkit-scrollbar {
2255
- width: ${(ae = u == null ? void 0 : u.scrollbar) == null ? void 0 : ae.width};
2272
+ width: ${(ie = u == null ? void 0 : u.scrollbar) == null ? void 0 : ie.width};
2256
2273
  }
2257
2274
  &::-webkit-scrollbar-track {
2258
- background: ${(ce = u == null ? void 0 : u.scrollbar) == null ? void 0 : ce.trackColor};
2275
+ background: ${(de = u == null ? void 0 : u.scrollbar) == null ? void 0 : de.trackColor};
2259
2276
  }
2260
2277
  &::-webkit-scrollbar-thumb {
2261
- background: ${(de = u == null ? void 0 : u.scrollbar) == null ? void 0 : de.thumbColor};
2278
+ background: ${(ue = u == null ? void 0 : u.scrollbar) == null ? void 0 : ue.thumbColor};
2262
2279
  border-radius: ${(K = u == null ? void 0 : u.scrollbar) == null ? void 0 : K.borderRadius};
2263
2280
  transition: background 0.2s ease;
2264
2281
  }
@@ -2272,7 +2289,7 @@ const So = ({
2272
2289
  r && /* @__PURE__ */ s(
2273
2290
  "div",
2274
2291
  {
2275
- className: L(
2292
+ className: D(
2276
2293
  "base-drawer-title zs-px-4 zs-pt-4 zs-pb-0",
2277
2294
  E`
2278
2295
  color: ${(Q = u == null ? void 0 : u.header) == null ? void 0 : Q.textColor};
@@ -2291,36 +2308,36 @@ const So = ({
2291
2308
  const { list: n } = Ee(), [r, a] = B(""), i = Mo(), { allApps: l, groups: f } = re(() => {
2292
2309
  if (!n || n.length === 0)
2293
2310
  return { allApps: [], groupedData: [], groups: [], groupCounts: [] };
2294
- const c = (h) => h.flatMap((y) => y.type === "app" ? [{ ...y }] : y.type === "group" && y.children ? c(y.children) : []), u = n.flatMap((h) => h.children ? c(h.children) : []), C = (r.trim() ? u.filter((h) => {
2295
- var D;
2296
- return (((D = h.data) == null ? void 0 : D.name) || h.id || "").toString().toLowerCase().includes(r.toLowerCase());
2297
- }) : u).sort((h, y) => {
2298
- var P, $;
2299
- const D = (((P = h.data) == null ? void 0 : P.name) || h.id || "").toString(), N = ((($ = y.data) == null ? void 0 : $.name) || y.id || "").toString();
2300
- return D.localeCompare(N);
2301
- }), b = /* @__PURE__ */ new Map();
2302
- C.forEach((h) => {
2303
- var P;
2304
- const D = (((P = h.data) == null ? void 0 : P.name) || h.id || "").toString().charAt(0).toUpperCase(), N = /[A-Z]/.test(D) ? D : "#";
2305
- b.has(N) || b.set(N, []), b.get(N).push(h);
2311
+ const c = (m) => m.flatMap((b) => b.type === "app" ? [{ ...b }] : b.type === "group" && b.children ? c(b.children) : []), u = n.flatMap((m) => m.children ? c(m.children) : []), C = (r.trim() ? u.filter((m) => {
2312
+ var M;
2313
+ return (((M = m.data) == null ? void 0 : M.name) || m.id || "").toString().toLowerCase().includes(r.toLowerCase());
2314
+ }) : u).sort((m, b) => {
2315
+ var R, _;
2316
+ const M = (((R = m.data) == null ? void 0 : R.name) || m.id || "").toString(), S = (((_ = b.data) == null ? void 0 : _.name) || b.id || "").toString();
2317
+ return M.localeCompare(S);
2318
+ }), y = /* @__PURE__ */ new Map();
2319
+ C.forEach((m) => {
2320
+ var R;
2321
+ const M = (((R = m.data) == null ? void 0 : R.name) || m.id || "").toString().charAt(0).toUpperCase(), S = /[A-Z]/.test(M) ? M : "#";
2322
+ y.has(S) || y.set(S, []), y.get(S).push(m);
2306
2323
  });
2307
- const M = Array.from(b.keys()).sort((h, y) => h === "#" ? 1 : y === "#" ? -1 : h.localeCompare(y)), v = [], x = [];
2308
- return M.forEach((h) => {
2309
- const y = b.get(h) || [];
2310
- v.push(...y), x.push(y.length);
2324
+ const N = Array.from(y.keys()).sort((m, b) => m === "#" ? 1 : b === "#" ? -1 : m.localeCompare(b)), x = [], k = [];
2325
+ return N.forEach((m) => {
2326
+ const b = y.get(m) || [];
2327
+ x.push(...b), k.push(b.length);
2311
2328
  }), {
2312
2329
  allApps: C,
2313
- groupedData: v,
2314
- groups: M,
2315
- groupCounts: x
2330
+ groupedData: x,
2331
+ groups: N,
2332
+ groupCounts: k
2316
2333
  };
2317
2334
  }, [n, r]), p = (c) => {
2318
- const u = f[c], k = document.getElementById(`group-${u}`);
2319
- k && k.scrollIntoView({ behavior: "smooth", block: "start" });
2335
+ const u = f[c], v = document.getElementById(`group-${u}`);
2336
+ v && v.scrollIntoView({ behavior: "smooth", block: "start" });
2320
2337
  }, d = /* @__PURE__ */ A("div", { className: "zs-py-4 zs-flex zs-items-center zs-gap-2", children: [
2321
2338
  /* @__PURE__ */ s(na, { className: "zs-grow", value: r, onChange: a, placeholder: "搜索应用" }),
2322
2339
  i && /* @__PURE__ */ s(Nt, { onClick: e, "aria-label": "关闭", className: "zs-shrink-0" })
2323
- ] }), g = /* @__PURE__ */ s("div", { className: L("zs-flex-1 zs-overflow-y-auto zs-h-full zs-p-1"), children: l.length === 0 ? /* @__PURE__ */ A("div", { className: "zs-flex zs-items-center zs-justify-center zs-flex-col zs-text-[#8e8e93] zs-text-xl zs-font-medium zs-text-center zs-h-full", children: [
2340
+ ] }), g = /* @__PURE__ */ s("div", { className: D("zs-flex-1 zs-overflow-y-auto zs-h-full zs-p-1"), children: l.length === 0 ? /* @__PURE__ */ A("div", { className: "zs-flex zs-items-center zs-justify-center zs-flex-col zs-text-[#8e8e93] zs-text-xl zs-font-medium zs-text-center zs-h-full", children: [
2324
2341
  /* @__PURE__ */ s("div", { className: "zs-text-6xl zs-mb-4 zs-opacity-60", children: r.trim() ? "🔍" : "📱" }),
2325
2342
  /* @__PURE__ */ s("div", { className: "zs-mb-2", children: r.trim() ? "未找到相关应用" : "暂无应用" }),
2326
2343
  /* @__PURE__ */ s("div", { className: "zs-text-base zs-text-[#c7c7cc] zs-font-normal", children: r.trim() ? "尝试使用其他关键词搜索" : "请添加应用到启动台" })
@@ -2333,8 +2350,8 @@ const So = ({
2333
2350
  onClick: o,
2334
2351
  disabledDrag: !0
2335
2352
  }
2336
- ) }, c.id)) }) }) }), m = /* @__PURE__ */ s(Ce, { children: /* @__PURE__ */ s(
2337
- X.div,
2353
+ ) }, c.id)) }) }) }), h = /* @__PURE__ */ s(Ce, { children: /* @__PURE__ */ s(
2354
+ Y.div,
2338
2355
  {
2339
2356
  initial: { opacity: 0, x: -10 },
2340
2357
  animate: { opacity: 1, x: 0 },
@@ -2342,7 +2359,7 @@ const So = ({
2342
2359
  transition: { duration: 0.25, ease: "easeInOut" },
2343
2360
  className: "zs-shrink-0 zs-w-12 zs-rounded-xl zs-py-2 zs-h-full zs-overflow-y-auto",
2344
2361
  children: f.map((c, u) => /* @__PURE__ */ s(
2345
- X.button,
2362
+ Y.button,
2346
2363
  {
2347
2364
  initial: { opacity: 0, scale: 0.9 },
2348
2365
  animate: { opacity: 1, scale: 1 },
@@ -2385,12 +2402,12 @@ const So = ({
2385
2402
  }
2386
2403
  `,
2387
2404
  children: /* @__PURE__ */ A("div", { className: "zs-relative zs-h-full zs-flex", children: [
2388
- m,
2405
+ h,
2389
2406
  g
2390
2407
  ] })
2391
2408
  }
2392
2409
  ) : /* @__PURE__ */ s(mt, { visible: t, onClose: e, title: d, width: 900, children: /* @__PURE__ */ A("div", { className: "zs-relative zs-flex zs-h-[60vh] zs-max-h-[600px] zs-overflow-hidden", children: [
2393
- m,
2410
+ h,
2394
2411
  g
2395
2412
  ] }) });
2396
2413
  }, sa = ({
@@ -2418,26 +2435,26 @@ const So = ({
2418
2435
  position: "bottom",
2419
2436
  showLaunchpad: !0
2420
2437
  }
2421
- } = t, p = ne(null), d = ne(null), g = ne(null), [m, c] = B(0), [u, k] = B(!1), [C, b] = B(!1), [M, v] = B(!0), {
2422
- list: x,
2423
- setList: h,
2424
- setListStatus: y,
2425
- showInfoItemData: D,
2426
- setShowInfoItemData: N,
2427
- openGroupItemData: P,
2428
- setOpenGroupItemData: $,
2429
- setMoveItemId: q,
2430
- setMoveTargetId: T,
2438
+ } = t, p = ne(null), d = ne(null), g = ne(null), [h, c] = B(0), [u, v] = B(!1), [C, y] = B(!1), [N, x] = B(!0), {
2439
+ list: k,
2440
+ setList: m,
2441
+ setListStatus: b,
2442
+ showInfoItemData: M,
2443
+ setShowInfoItemData: S,
2444
+ openGroupItemData: R,
2445
+ setOpenGroupItemData: _,
2446
+ setMoveItemId: X,
2447
+ setMoveTargetId: P,
2431
2448
  addItem: O,
2432
- dragItem: R,
2449
+ dragItem: T,
2433
2450
  setDragItem: W,
2434
2451
  addRootItem: se,
2435
- removeRootItem: Z,
2436
- setCurrentSliderIndex: G
2437
- } = Ee(), { pagingDotBuilder: ee, pagingDotsBuilder: le, itemBuilder: ge, itemBuilderAllowNull: ae, typeConfigMap: ce } = me(), de = re(() => {
2438
- const z = x.find((w) => w.type === "dock");
2452
+ removeRootItem: ee,
2453
+ setCurrentSliderIndex: q
2454
+ } = Ee(), { pagingDotBuilder: Z, pagingDotsBuilder: ae, itemBuilder: ce, itemBuilderAllowNull: ie, typeConfigMap: de } = me(), ue = re(() => {
2455
+ const z = k.find((w) => w.type === "dock");
2439
2456
  return (z == null ? void 0 : z.children) ?? [];
2440
- }, [x]), K = re(() => x.filter((z) => z.type !== "dock"), [x]), be = fe(() => {
2457
+ }, [k]), K = re(() => k.filter((z) => z.type !== "dock"), [k]), be = ge(() => {
2441
2458
  if (typeof a == "number" && K.length >= a)
2442
2459
  return;
2443
2460
  const z = {
@@ -2449,14 +2466,14 @@ const So = ({
2449
2466
  var w;
2450
2467
  (w = (r ?? p).current) == null || w.slickGoTo(K.length);
2451
2468
  }, 100);
2452
- }, [a, K.length, se, r]), Q = fe(() => {
2469
+ }, [a, K.length, se, r]), Q = ge(() => {
2453
2470
  const z = K.filter((w) => !w.children || w.children.length === 0);
2454
2471
  z.length === K.length && K.length > 1 ? z.slice(1).forEach((w) => {
2455
- Z(w.id);
2472
+ ee(w.id);
2456
2473
  }) : z.length > 0 && K.length > 1 && z.forEach((w) => {
2457
- (K.length - z.length > 0 || K.indexOf(w) > 0) && Z(w.id);
2474
+ (K.length - z.length > 0 || K.indexOf(w) > 0) && ee(w.id);
2458
2475
  });
2459
- }, [K, Z]), he = re(() => e === !1 ? {} : {
2476
+ }, [K, ee]), he = re(() => e === !1 ? {} : {
2460
2477
  top: E`
2461
2478
  display: flex;
2462
2479
  flex-direction: column;
@@ -2562,18 +2579,18 @@ const So = ({
2562
2579
  }
2563
2580
  `
2564
2581
  }[z];
2565
- }, [f]), [ke, ze] = B(void 0), [U, te] = B(void 0), Y = ne(null), j = ne(null), oe = ne(null), J = fe((z) => {
2566
- const { width: w, marginLeft: _ } = Me.computeRowWidth(z, 112);
2567
- ze(w), te(_);
2568
- }, []), I = fe(
2582
+ }, [f]), [ke, ze] = B(void 0), [U, te] = B(void 0), G = ne(null), j = ne(null), oe = ne(null), J = ge((z) => {
2583
+ const { width: w, marginLeft: $ } = Me.computeRowWidth(z, 112);
2584
+ ze(w), te($);
2585
+ }, []), I = ge(
2569
2586
  (z) => {
2570
- const w = Y.current, _ = j.current, S = oe.current;
2587
+ const w = G.current, $ = j.current, L = oe.current;
2571
2588
  if (!z && w) {
2572
- _ && (_.disconnect(), j.current = null), S && (globalThis.removeEventListener("resize", S), oe.current = null), Y.current = null;
2589
+ $ && ($.disconnect(), j.current = null), L && (globalThis.removeEventListener("resize", L), oe.current = null), G.current = null;
2573
2590
  return;
2574
2591
  }
2575
- if (z && w && z !== w && (_ && (_.disconnect(), j.current = null), S && (globalThis.removeEventListener("resize", S), oe.current = null), Y.current = null), z)
2576
- if (Y.current = z, requestAnimationFrame(() => J(z)), "ResizeObserver" in globalThis) {
2592
+ if (z && w && z !== w && ($ && ($.disconnect(), j.current = null), L && (globalThis.removeEventListener("resize", L), oe.current = null), G.current = null), z)
2593
+ if (G.current = z, requestAnimationFrame(() => J(z)), "ResizeObserver" in globalThis) {
2577
2594
  const F = new ResizeObserver(() => J(z));
2578
2595
  j.current = F, F.observe(z);
2579
2596
  } else {
@@ -2588,7 +2605,7 @@ const So = ({
2588
2605
  "div",
2589
2606
  {
2590
2607
  ref: d,
2591
- className: L("zs-relative zs-w-full zs-h-full", pe),
2608
+ className: D("zs-relative zs-w-full zs-h-full", pe),
2592
2609
  onDragOver: (z) => {
2593
2610
  z.preventDefault(), g.current && g.current.handleDragMove(z);
2594
2611
  },
@@ -2596,7 +2613,7 @@ const So = ({
2596
2613
  f.enabled && /* @__PURE__ */ s("div", { className: "zs-flex zs-items-center zs-justify-center dock-container", children: /* @__PURE__ */ s(
2597
2614
  So,
2598
2615
  {
2599
- items: de,
2616
+ items: ue,
2600
2617
  fixedItems: f.fixedItems,
2601
2618
  position: f.position,
2602
2619
  className: f.className,
@@ -2604,24 +2621,24 @@ const So = ({
2604
2621
  itemBuilder: f.itemBuilder,
2605
2622
  fixedItemBuilder: f.fixedItemBuilder,
2606
2623
  showLaunchpad: f.showLaunchpad,
2607
- onLaunchpadClick: () => b(!0),
2624
+ onLaunchpadClick: () => y(!0),
2608
2625
  onDockItemsChange: (z) => {
2609
- const w = x.map((_) => _.type === "dock" ? {
2610
- ..._,
2626
+ const w = k.map(($) => $.type === "dock" ? {
2627
+ ...$,
2611
2628
  children: z
2612
- } : _);
2613
- h(w);
2629
+ } : $);
2630
+ m(w);
2614
2631
  },
2615
2632
  onDrop: () => {
2616
- if (R && de.every((z) => z.id !== R.id)) {
2617
- const w = x.map((_) => _.type === "dock" ? {
2618
- ..._,
2619
- children: [..._.children ?? [], R]
2620
- } : _).map((_) => _.type !== "dock" && _.children ? {
2621
- ..._,
2622
- children: _.children.filter((S) => S.id !== R.id)
2623
- } : _);
2624
- h(w);
2633
+ if (T && ue.every((z) => z.id !== T.id)) {
2634
+ const w = k.map(($) => $.type === "dock" ? {
2635
+ ...$,
2636
+ children: [...$.children ?? [], T]
2637
+ } : $).map(($) => $.type !== "dock" && $.children ? {
2638
+ ...$,
2639
+ children: $.children.filter((L) => L.id !== T.id)
2640
+ } : $);
2641
+ m(w);
2625
2642
  }
2626
2643
  W(null);
2627
2644
  }
@@ -2633,7 +2650,7 @@ const So = ({
2633
2650
  {
2634
2651
  ref: g,
2635
2652
  isDragging: u,
2636
- activeSlide: m,
2653
+ activeSlide: h,
2637
2654
  totalSlides: K.length,
2638
2655
  maxSlides: a,
2639
2656
  sliderRef: r ?? p,
@@ -2651,8 +2668,8 @@ const So = ({
2651
2668
  infinite: !1,
2652
2669
  dots: !0,
2653
2670
  lazyLoad: "anticipated",
2654
- touchMove: M,
2655
- className: L(
2671
+ touchMove: N,
2672
+ className: D(
2656
2673
  he,
2657
2674
  E`
2658
2675
  height: 100%;
@@ -2677,23 +2694,23 @@ const So = ({
2677
2694
  `,
2678
2695
  o
2679
2696
  ),
2680
- customPaging: oa(K, m, ee),
2697
+ customPaging: oa(K, h, Z),
2681
2698
  appendDots: (z) => /* @__PURE__ */ s(
2682
2699
  ta,
2683
2700
  {
2684
- activeSlide: m,
2701
+ activeSlide: h,
2685
2702
  onDragEnter: (w) => {
2686
- var _;
2687
- (_ = (r ?? p).current) == null || _.slickGoTo(w);
2703
+ var $;
2704
+ ($ = (r ?? p).current) == null || $.slickGoTo(w);
2688
2705
  },
2689
2706
  onClick: (w) => {
2690
- var _;
2691
- (_ = (r ?? p).current) == null || _.slickGoTo(w);
2707
+ var $;
2708
+ ($ = (r ?? p).current) == null || $.slickGoTo(w);
2692
2709
  },
2693
- pagingDotsBuilder: le,
2710
+ pagingDotsBuilder: ae,
2694
2711
  slickDots: z,
2695
2712
  disabled: e === !1,
2696
- className: L(
2713
+ className: D(
2697
2714
  "slick-dots-default",
2698
2715
  E`
2699
2716
  .slick-dots-default {
@@ -2704,7 +2721,7 @@ const So = ({
2704
2721
  }
2705
2722
  ),
2706
2723
  beforeChange: (z, w) => {
2707
- c(w), G(w);
2724
+ c(w), q(w);
2708
2725
  },
2709
2726
  ...n,
2710
2727
  children: K.map((z) => /* @__PURE__ */ s(
@@ -2712,10 +2729,10 @@ const So = ({
2712
2729
  {
2713
2730
  onDrop: (w) => {
2714
2731
  w.preventDefault();
2715
- const _ = w.dataTransfer.getData("text/plain");
2716
- if (Me.quickJSONCheck(_))
2732
+ const $ = w.dataTransfer.getData("text/plain");
2733
+ if (Me.quickJSONCheck($))
2717
2734
  try {
2718
- O(JSON.parse(_), [z.id]);
2735
+ O(JSON.parse($), [z.id]);
2719
2736
  } catch (F) {
2720
2737
  console.log("drag error", F);
2721
2738
  }
@@ -2726,49 +2743,49 @@ const So = ({
2726
2743
  children: /* @__PURE__ */ A(
2727
2744
  gt,
2728
2745
  {
2729
- className: L("zs-grid zs-h-full", Ys),
2746
+ className: D("zs-grid zs-h-full", Ys),
2730
2747
  style: { width: ke, marginLeft: U, transform: "translate(28px, 28px)" },
2731
2748
  ...yo,
2732
2749
  list: z.children ?? [],
2733
- setList: (w) => h(w, [z.id]),
2750
+ setList: (w) => m(w, [z.id]),
2734
2751
  onMove: (w) => {
2735
- var ue;
2736
- y("onMove");
2737
- const { dragged: _, related: S } = w, F = _.dataset, H = S.dataset;
2738
- return T(null), !((Object.keys(H).length === 0 || H.parentIds) && Number(F.childrenLength) > 0 && S.classList.contains("sortable-group-item") || (S.classList.contains("desktop-dock-sortable") || (ue = S.parentElement) != null && ue.classList.contains("desktop-dock-sortable")) && Number(F.childrenLength) > 0);
2752
+ var fe;
2753
+ b("onMove");
2754
+ const { dragged: $, related: L } = w, F = $.dataset, H = L.dataset;
2755
+ return P(null), !((Object.keys(H).length === 0 || H.parentIds) && Number(F.childrenLength) > 0 && L.classList.contains("sortable-group-item") || (L.classList.contains("desktop-dock-sortable") || (fe = L.parentElement) != null && fe.classList.contains("desktop-dock-sortable")) && Number(F.childrenLength) > 0);
2739
2756
  },
2740
2757
  onStart: (w) => {
2741
2758
  var F;
2742
- const _ = w.item.dataset;
2743
- _ != null && _.id && q(_.id), y("onMove"), k(!0);
2744
- const S = (F = z.children) == null ? void 0 : F.find((H) => H.id === _.id);
2745
- S && W(S);
2759
+ const $ = w.item.dataset;
2760
+ $ != null && $.id && X($.id), b("onMove"), v(!0);
2761
+ const L = (F = z.children) == null ? void 0 : F.find((H) => H.id === $.id);
2762
+ L && W(L);
2746
2763
  },
2747
2764
  onEnd: () => {
2748
- q(null), T(null), y(null), k(!1), W(null), setTimeout(() => {
2765
+ X(null), P(null), b(null), v(!1), W(null), setTimeout(() => {
2749
2766
  Q();
2750
2767
  }, 100);
2751
2768
  },
2752
2769
  ghostClass: No,
2753
2770
  children: [
2754
- /* @__PURE__ */ s(Ce, { mode: "popLayout", children: (z.children ?? []).map((w, _) => {
2755
- var ue;
2756
- let S;
2757
- if (ae) {
2758
- const qe = ae(w);
2771
+ /* @__PURE__ */ s(Ce, { mode: "popLayout", children: (z.children ?? []).map((w, $) => {
2772
+ var fe;
2773
+ let L;
2774
+ if (ie) {
2775
+ const qe = ie(w, $);
2759
2776
  if (qe != null)
2760
2777
  return qe;
2761
2778
  }
2762
- if (ge)
2763
- return ge(w);
2764
- const { row: F, col: H } = wo(w.type, (ue = w.config) == null ? void 0 : ue.sizeId, ce);
2779
+ if (ce)
2780
+ return ce(w, $);
2781
+ const { row: F, col: H } = wo(w.type, (fe = w.config) == null ? void 0 : fe.sizeId, de);
2765
2782
  switch (w.type) {
2766
2783
  case "group":
2767
2784
  case "app":
2768
- S = /* @__PURE__ */ s(
2769
- X.div,
2785
+ L = /* @__PURE__ */ s(
2786
+ Y.div,
2770
2787
  {
2771
- className: L(
2788
+ className: D(
2772
2789
  "zs-flex zs-justify-start zs-items-start",
2773
2790
  E`
2774
2791
  grid-row: span ${F};
@@ -2778,13 +2795,13 @@ const So = ({
2778
2795
  "data-id": w.id,
2779
2796
  layout: u ? !1 : "position",
2780
2797
  transition: u ? { duration: 0 } : { type: "spring", stiffness: 380, damping: 38 },
2781
- onMouseEnter: () => v(!1),
2782
- onMouseLeave: () => v(!0),
2798
+ onMouseEnter: () => x(!1),
2799
+ onMouseLeave: () => x(!0),
2783
2800
  children: /* @__PURE__ */ s(
2784
2801
  zo,
2785
2802
  {
2786
2803
  data: w,
2787
- itemIndex: _,
2804
+ itemIndex: $,
2788
2805
  parentIds: [z.id, w.id],
2789
2806
  onClick: i
2790
2807
  }
@@ -2794,11 +2811,11 @@ const So = ({
2794
2811
  );
2795
2812
  break;
2796
2813
  default:
2797
- S = /* @__PURE__ */ s(
2798
- X.div,
2814
+ L = /* @__PURE__ */ s(
2815
+ Y.div,
2799
2816
  {
2800
- className: L(
2801
- "zs-flex zs-justify-center zs-items-center",
2817
+ className: D(
2818
+ "zs-flex zs-justify-start zs-items-start",
2802
2819
  E`
2803
2820
  grid-row: span ${F};
2804
2821
  grid-column: span ${H};
@@ -2807,15 +2824,15 @@ const So = ({
2807
2824
  "data-id": w.id,
2808
2825
  layout: u ? !1 : "position",
2809
2826
  transition: u ? { duration: 0 } : { type: "spring", stiffness: 380, damping: 38 },
2810
- onMouseEnter: () => v(!1),
2811
- onMouseLeave: () => v(!0),
2812
- children: /* @__PURE__ */ s(_e, { data: w, itemIndex: _, onClick: i })
2827
+ onMouseEnter: () => x(!1),
2828
+ onMouseLeave: () => x(!0),
2829
+ children: /* @__PURE__ */ s(_e, { data: w, itemIndex: $, onClick: i })
2813
2830
  },
2814
2831
  w.id
2815
2832
  );
2816
2833
  break;
2817
2834
  }
2818
- return S;
2835
+ return L;
2819
2836
  }) }),
2820
2837
  /* @__PURE__ */ s(sa, { renderFn: l, item: z })
2821
2838
  ]
@@ -2833,31 +2850,31 @@ const So = ({
2833
2850
  /* @__PURE__ */ s(
2834
2851
  Qs,
2835
2852
  {
2836
- data: D,
2853
+ data: M,
2837
2854
  onClose: () => {
2838
- N(null);
2855
+ S(null);
2839
2856
  }
2840
2857
  }
2841
2858
  ),
2842
2859
  /* @__PURE__ */ s(
2843
2860
  Js,
2844
2861
  {
2845
- data: P,
2862
+ data: R,
2846
2863
  onClose: () => {
2847
- $(null);
2864
+ _(null);
2848
2865
  },
2849
2866
  onItemClick: i
2850
2867
  }
2851
2868
  ),
2852
- C && /* @__PURE__ */ s(Do, { visible: C, onClose: () => b(!1), onItemClick: i })
2869
+ C && /* @__PURE__ */ s(Do, { visible: C, onClose: () => y(!1), onItemClick: i })
2853
2870
  ] });
2854
2871
  }, Eo = (t) => {
2855
2872
  var a, i, l, f, p;
2856
2873
  const { className: e, children: o, ...n } = t, { theme: r } = me();
2857
2874
  return /* @__PURE__ */ s(
2858
- X.div,
2875
+ Y.div,
2859
2876
  {
2860
- className: L(
2877
+ className: D(
2861
2878
  "zs-rounded-2xl py-2 zs-w-max zs-z-50",
2862
2879
  E`
2863
2880
  background-color: ${(a = r.token.contextMenu) == null ? void 0 : a.backgroundColor};
@@ -2890,12 +2907,12 @@ const So = ({
2890
2907
  setHoveredIndex: () => {
2891
2908
  }
2892
2909
  }), at = ({ icon: t, text: e, color: o, textColor: n, onClick: r, index: a, children: i, ...l }) => {
2893
- var k, C, b;
2894
- const { hoveredIndex: f, setHoveredIndex: p } = De(Lt), { theme: d } = me(), g = f === a, m = n || ((k = d.token.contextMenu) == null ? void 0 : k.textColor) || "#1d1d1f", c = o || ((C = d.token.contextMenu) == null ? void 0 : C.textColor) || "black";
2910
+ var v, C, y;
2911
+ const { hoveredIndex: f, setHoveredIndex: p } = De(Lt), { theme: d } = me(), g = f === a, h = n || ((v = d.token.contextMenu) == null ? void 0 : v.textColor) || "#1d1d1f", c = o || ((C = d.token.contextMenu) == null ? void 0 : C.textColor) || "black";
2895
2912
  return /* @__PURE__ */ A(
2896
- X.div,
2913
+ Y.div,
2897
2914
  {
2898
- className: L(
2915
+ className: D(
2899
2916
  "zs-py-0 zs-px-5 zs-flex zs-items-center zs-gap-4 zs-cursor-pointer zs-relative zs-h-10 zs-outline-none",
2900
2917
  E`
2901
2918
  z-index: 1;
@@ -2907,14 +2924,14 @@ const So = ({
2907
2924
  ...l,
2908
2925
  children: [
2909
2926
  /* @__PURE__ */ s(Ce, { children: g && /* @__PURE__ */ s(
2910
- X.div,
2927
+ Y.div,
2911
2928
  {
2912
2929
  layoutId: "menuHover",
2913
- className: L(
2930
+ className: D(
2914
2931
  "zs-absolute zs-top-0.5 zs-left-2 zs-right-2 zs-bottom-0.5 zs-bg-black zs-bg-opacity-5 zs-rounded-lg",
2915
2932
  E`
2916
2933
  z-index: -1;
2917
- background-color: ${((b = d.token.contextMenu) == null ? void 0 : b.activeColor) || "rgba(0, 0, 0, 0.05)"};
2934
+ background-color: ${((y = d.token.contextMenu) == null ? void 0 : y.activeColor) || "rgba(0, 0, 0, 0.05)"};
2918
2935
  `
2919
2936
  ),
2920
2937
  initial: { opacity: 0 },
@@ -2928,14 +2945,14 @@ const So = ({
2928
2945
  }
2929
2946
  ) }),
2930
2947
  /* @__PURE__ */ s(
2931
- X.div,
2948
+ Y.div,
2932
2949
  {
2933
- className: L(
2950
+ className: D(
2934
2951
  "zs-flex-1 zs-text-sm",
2935
2952
  E`
2936
2953
  font-weight: 400;
2937
2954
  line-height: 18px;
2938
- color: ${m};
2955
+ color: ${h};
2939
2956
  letter-spacing: -0.28px;
2940
2957
  `
2941
2958
  ),
@@ -2943,9 +2960,9 @@ const So = ({
2943
2960
  }
2944
2961
  ),
2945
2962
  t && /* @__PURE__ */ s(
2946
- X.div,
2963
+ Y.div,
2947
2964
  {
2948
- className: L(
2965
+ className: D(
2949
2966
  "zs-flex zs-items-center zs-justify-center zs-shrink-0",
2950
2967
  E`
2951
2968
  color: ${c};
@@ -2961,49 +2978,49 @@ const So = ({
2961
2978
  }
2962
2979
  );
2963
2980
  }, aa = ({ text: t, icon: e, index: o, children: n, color: r, textColor: a, ...i }) => {
2964
- var D, N, P;
2965
- const [l, f] = B(!1), [p, d] = B({ x: 0, y: 0 }), g = ne(null), m = ne(null), { hoveredIndex: c, setHoveredIndex: u } = De(Lt), { theme: k } = me(), C = c === o, b = a || ((D = k.token.contextMenu) == null ? void 0 : D.textColor) || "#1d1d1f", M = r || ((N = k.token.contextMenu) == null ? void 0 : N.textColor) || "black", v = () => {
2966
- if (m.current && clearTimeout(m.current), u(o), f(!0), g.current) {
2967
- const $ = g.current.getBoundingClientRect();
2981
+ var M, S, R;
2982
+ const [l, f] = B(!1), [p, d] = B({ x: 0, y: 0 }), g = ne(null), h = ne(null), { hoveredIndex: c, setHoveredIndex: u } = De(Lt), { theme: v } = me(), C = c === o, y = a || ((M = v.token.contextMenu) == null ? void 0 : M.textColor) || "#1d1d1f", N = r || ((S = v.token.contextMenu) == null ? void 0 : S.textColor) || "black", x = () => {
2983
+ if (h.current && clearTimeout(h.current), u(o), f(!0), g.current) {
2984
+ const _ = g.current.getBoundingClientRect();
2968
2985
  d({
2969
- x: $.width - 4,
2986
+ x: _.width - 4,
2970
2987
  y: 0
2971
2988
  });
2972
2989
  }
2973
- }, x = () => {
2974
- m.current = setTimeout(() => {
2990
+ }, k = () => {
2991
+ h.current = setTimeout(() => {
2975
2992
  f(!1);
2976
2993
  }, 150);
2977
- }, h = () => {
2978
- m.current && clearTimeout(m.current);
2979
- }, y = () => {
2994
+ }, m = () => {
2995
+ h.current && clearTimeout(h.current);
2996
+ }, b = () => {
2980
2997
  f(!1);
2981
2998
  };
2982
2999
  return V(() => () => {
2983
- m.current && clearTimeout(m.current);
3000
+ h.current && clearTimeout(h.current);
2984
3001
  }, []), /* @__PURE__ */ A(
2985
- X.div,
3002
+ Y.div,
2986
3003
  {
2987
3004
  ref: g,
2988
- className: L(
3005
+ className: D(
2989
3006
  "zs-py-0 zs-px-5 zs-flex zs-items-center zs-gap-4 zs-cursor-pointer zs-relative zs-h-10 zs-outline-none",
2990
3007
  E`
2991
3008
  z-index: 1;
2992
3009
  `
2993
3010
  ),
2994
- onMouseEnter: v,
2995
- onMouseLeave: x,
3011
+ onMouseEnter: x,
3012
+ onMouseLeave: k,
2996
3013
  ...i,
2997
3014
  children: [
2998
3015
  /* @__PURE__ */ s(Ce, { children: C && /* @__PURE__ */ s(
2999
- X.div,
3016
+ Y.div,
3000
3017
  {
3001
3018
  layoutId: "menuHover",
3002
- className: L(
3019
+ className: D(
3003
3020
  "zs-absolute zs-top-0.5 zs-left-2 zs-right-2 zs-bottom-0.5 zs-rounded-lg",
3004
3021
  E`
3005
3022
  z-index: -1;
3006
- background-color: ${((P = k.token.contextMenu) == null ? void 0 : P.activeColor) || "rgba(0, 0, 0, 0.05)"};
3023
+ background-color: ${((R = v.token.contextMenu) == null ? void 0 : R.activeColor) || "rgba(0, 0, 0, 0.05)"};
3007
3024
  `
3008
3025
  ),
3009
3026
  initial: { opacity: 0 },
@@ -3017,14 +3034,14 @@ const So = ({
3017
3034
  }
3018
3035
  ) }),
3019
3036
  /* @__PURE__ */ s(
3020
- X.div,
3037
+ Y.div,
3021
3038
  {
3022
- className: L(
3039
+ className: D(
3023
3040
  "zs-flex-1 zs-text-sm",
3024
3041
  E`
3025
3042
  font-weight: 400;
3026
3043
  line-height: 18px;
3027
- color: ${b};
3044
+ color: ${y};
3028
3045
  letter-spacing: -0.28px;
3029
3046
  `
3030
3047
  ),
@@ -3032,12 +3049,12 @@ const So = ({
3032
3049
  }
3033
3050
  ),
3034
3051
  /* @__PURE__ */ s(
3035
- X.div,
3052
+ Y.div,
3036
3053
  {
3037
- className: L(
3054
+ className: D(
3038
3055
  "zs-flex zs-items-center zs-justify-center zs-shrink-0",
3039
3056
  E`
3040
- color: ${M};
3057
+ color: ${N};
3041
3058
  width: 18px;
3042
3059
  height: 18px;
3043
3060
  `
@@ -3048,7 +3065,7 @@ const So = ({
3048
3065
  /* @__PURE__ */ s(Ce, { children: l && /* @__PURE__ */ s(
3049
3066
  Eo,
3050
3067
  {
3051
- className: L(
3068
+ className: D(
3052
3069
  "zs-absolute zs-overflow-hidden zs-z-50",
3053
3070
  E`
3054
3071
  left: ${p.x}px;
@@ -3060,8 +3077,8 @@ const So = ({
3060
3077
  style: {
3061
3078
  transformOrigin: "left"
3062
3079
  },
3063
- onMouseEnter: h,
3064
- onMouseLeave: y,
3080
+ onMouseEnter: m,
3081
+ onMouseLeave: b,
3065
3082
  children: n
3066
3083
  }
3067
3084
  ) })
@@ -3074,9 +3091,9 @@ const So = ({
3074
3091
  var p, d, g;
3075
3092
  const l = n === i, f = e === i;
3076
3093
  return /* @__PURE__ */ A(
3077
- X.div,
3094
+ Y.div,
3078
3095
  {
3079
- className: L(
3096
+ className: D(
3080
3097
  "zs-h-10 zs-py-0 zs-px-5 zs-flex zs-items-center zs-gap-4 zs-cursor-pointer zs-relative zs-outline-none",
3081
3098
  E`
3082
3099
  z-index: 1;
@@ -3088,9 +3105,9 @@ const So = ({
3088
3105
  whileTap: { scale: 0.98 },
3089
3106
  children: [
3090
3107
  /* @__PURE__ */ s(Ce, { children: (l || f) && /* @__PURE__ */ s(
3091
- X.div,
3108
+ Y.div,
3092
3109
  {
3093
- className: L(
3110
+ className: D(
3094
3111
  "zs-absolute zs-top-0.5 zs-left-2 zs-right-2 zs-bottom-0.5 zs-rounded-lg",
3095
3112
  E`
3096
3113
  z-index: -1;
@@ -3108,9 +3125,9 @@ const So = ({
3108
3125
  }
3109
3126
  ) }),
3110
3127
  /* @__PURE__ */ s(
3111
- X.div,
3128
+ Y.div,
3112
3129
  {
3113
- className: L(
3130
+ className: D(
3114
3131
  "zs-flex-1 zs-text-sm",
3115
3132
  E`
3116
3133
  font-weight: 400;
@@ -3123,9 +3140,9 @@ const So = ({
3123
3140
  }
3124
3141
  ),
3125
3142
  f && /* @__PURE__ */ s(
3126
- X.div,
3143
+ Y.div,
3127
3144
  {
3128
- className: L(
3145
+ className: D(
3129
3146
  "zs-flex zs-items-center zs-justify-center zs-shrink-0",
3130
3147
  E`
3131
3148
  color: ${((g = a.token.contextMenu) == null ? void 0 : g.textColor) || "#1d1d1f"};
@@ -3142,7 +3159,7 @@ const So = ({
3142
3159
  );
3143
3160
  }) });
3144
3161
  }, la = (t) => {
3145
- var $, q;
3162
+ var _, X;
3146
3163
  const {
3147
3164
  showInfoButton: e = !0,
3148
3165
  showRemoveButton: o = !0,
@@ -3153,21 +3170,21 @@ const So = ({
3153
3170
  onInfoClick: l,
3154
3171
  onShareClick: f,
3155
3172
  onRemoveClick: p
3156
- } = t, { contextMenu: d, setContextMenu: g, hideContextMenu: m, setShowInfoItemData: c, removeItem: u, updateItemConfig: k } = Ee(), { typeConfigMap: C, dataTypeMenuConfigMap: b, theme: M } = me(), [v, x] = B(null), { data: h } = d ?? {}, { config: y = {} } = h ?? {}, D = () => {
3173
+ } = t, { contextMenu: d, setContextMenu: g, hideContextMenu: h, setShowInfoItemData: c, removeItem: u, updateItemConfig: v } = Ee(), { typeConfigMap: C, dataTypeMenuConfigMap: y, theme: N } = me(), [x, k] = B(null), { data: m } = d ?? {}, { config: b = {} } = m ?? {}, M = () => {
3157
3174
  var O;
3158
- return dt(((O = d == null ? void 0 : d.data) == null ? void 0 : O.type) || "app", C).sizeConfigs.map((R) => R.name);
3159
- }, N = () => {
3175
+ return dt(((O = d == null ? void 0 : d.data) == null ? void 0 : O.type) || "app", C).sizeConfigs.map((T) => T.name);
3176
+ }, S = () => {
3160
3177
  var O;
3161
- const T = (O = d == null ? void 0 : d.data) == null ? void 0 : O.dataType;
3162
- return !T || !b ? [] : b[T] || [];
3163
- }, P = {
3178
+ const P = (O = d == null ? void 0 : d.data) == null ? void 0 : O.dataType;
3179
+ return !P || !y ? [] : y[P] || [];
3180
+ }, R = {
3164
3181
  setContextMenu: g,
3165
- hideContextMenu: m,
3182
+ hideContextMenu: h,
3166
3183
  setShowInfoItemData: c,
3167
3184
  removeItem: u,
3168
- updateItemConfig: k
3185
+ updateItemConfig: v
3169
3186
  };
3170
- return /* @__PURE__ */ s(Ce, { children: d && i && /* @__PURE__ */ s(Lt.Provider, { value: { hoveredIndex: v, setHoveredIndex: x }, children: /* @__PURE__ */ A(
3187
+ return /* @__PURE__ */ s(Ce, { children: d && i && /* @__PURE__ */ s(Lt.Provider, { value: { hoveredIndex: x, setHoveredIndex: k }, children: /* @__PURE__ */ A(
3171
3188
  Eo,
3172
3189
  {
3173
3190
  style: {
@@ -3179,8 +3196,8 @@ const So = ({
3179
3196
  {
3180
3197
  text: "移除",
3181
3198
  icon: /* @__PURE__ */ s(fr, {}),
3182
- color: (($ = M.token.contextMenu) == null ? void 0 : $.dangerColor) || "#ff3b30",
3183
- textColor: ((q = M.token.contextMenu) == null ? void 0 : q.dangerColor) || "#ff3b30",
3199
+ color: ((_ = N.token.contextMenu) == null ? void 0 : _.dangerColor) || "#ff3b30",
3200
+ textColor: ((X = N.token.contextMenu) == null ? void 0 : X.dangerColor) || "#ff3b30",
3184
3201
  index: 0,
3185
3202
  onClick: () => {
3186
3203
  if (p) {
@@ -3220,46 +3237,46 @@ const So = ({
3220
3237
  ...d.data,
3221
3238
  pageX: d.pageX,
3222
3239
  pageY: d.pageY
3223
- }), m();
3240
+ }), h();
3224
3241
  }
3225
3242
  }
3226
3243
  ),
3227
- r && (y == null ? void 0 : y.allowResize) !== !1 && (() => {
3244
+ r && (b == null ? void 0 : b.allowResize) !== !1 && (() => {
3228
3245
  var W, se;
3229
- const T = dt(((W = d == null ? void 0 : d.data) == null ? void 0 : W.type) || "app", C);
3230
- if (T.sizeConfigs.length <= 1) return null;
3246
+ const P = dt(((W = d == null ? void 0 : d.data) == null ? void 0 : W.type) || "app", C);
3247
+ if (P.sizeConfigs.length <= 1) return null;
3231
3248
  const O = ko(
3232
- (se = h == null ? void 0 : h.config) == null ? void 0 : se.sizeId,
3233
- T.sizeConfigs,
3234
- T.defaultSizeId
3249
+ (se = m == null ? void 0 : m.config) == null ? void 0 : se.sizeId,
3250
+ P.sizeConfigs,
3251
+ P.defaultSizeId
3235
3252
  );
3236
- let R = 0;
3237
- return o && R++, n && R++, e && R++, /* @__PURE__ */ s(aa, { text: "尺寸", icon: /* @__PURE__ */ s(mr, { size: 18 }), index: R, children: /* @__PURE__ */ s(
3253
+ let T = 0;
3254
+ return o && T++, n && T++, e && T++, /* @__PURE__ */ s(aa, { text: "尺寸", icon: /* @__PURE__ */ s(mr, { size: 18 }), index: T, children: /* @__PURE__ */ s(
3238
3255
  ia,
3239
3256
  {
3240
- sizes: D(),
3257
+ sizes: M(),
3241
3258
  currentSize: O.name,
3242
- onSizeChange: (Z) => {
3243
- const G = T.sizeConfigs.find((ee) => ee.name === Z);
3244
- G && k(d.data.id, {
3245
- sizeId: G.id || Z
3259
+ onSizeChange: (ee) => {
3260
+ const q = P.sizeConfigs.find((Z) => Z.name === ee);
3261
+ q && v(d.data.id, {
3262
+ sizeId: q.id || ee
3246
3263
  });
3247
3264
  }
3248
3265
  }
3249
3266
  ) });
3250
3267
  })(),
3251
- N().map((T, O) => {
3252
- let R = 0;
3253
- return o && R++, n && R++, e && R++, r && (y == null ? void 0 : y.allowResize) !== !1 && R++, R += O, /* @__PURE__ */ s(
3268
+ S().map((P, O) => {
3269
+ let T = 0;
3270
+ return o && T++, n && T++, e && T++, r && (b == null ? void 0 : b.allowResize) !== !1 && T++, T += O, /* @__PURE__ */ s(
3254
3271
  at,
3255
3272
  {
3256
- text: T.text,
3257
- icon: T.icon,
3258
- color: T.color,
3259
- textColor: T.textColor,
3260
- index: R,
3273
+ text: P.text,
3274
+ icon: P.icon,
3275
+ color: P.color,
3276
+ textColor: P.textColor,
3277
+ index: T,
3261
3278
  onClick: () => {
3262
- T.onClick && T.onClick(d.data, P);
3279
+ P.onClick && P.onClick(d.data, R);
3263
3280
  }
3264
3281
  },
3265
3282
  `custom-${O}`
@@ -3283,43 +3300,43 @@ const So = ({
3283
3300
  const { contextMenu: e, setContextMenu: o } = Ee(), [n, r] = B(!1), [a, i] = B(!1), [l, f] = B({
3284
3301
  left: 0,
3285
3302
  top: 0
3286
- }), [p, d] = B("center"), g = fe(
3287
- (b) => ({
3288
- left: b.left,
3289
- right: b.right,
3290
- top: b.top + window.scrollY,
3291
- bottom: b.bottom + window.scrollY,
3292
- width: b.width,
3293
- height: b.height
3303
+ }), [p, d] = B("center"), g = ge(
3304
+ (y) => ({
3305
+ left: y.left,
3306
+ right: y.right,
3307
+ top: y.top + window.scrollY,
3308
+ bottom: y.bottom + window.scrollY,
3309
+ width: y.width,
3310
+ height: y.height
3294
3311
  }),
3295
3312
  []
3296
- ), m = fe((b, M, v, x) => {
3297
- const h = ca(), y = Te.GAP;
3313
+ ), h = ge((y, N, x, k) => {
3314
+ const m = ca(), b = Te.GAP;
3298
3315
  return {
3299
- left: Math.max(h.left + y, Math.min(b, h.right - v - y)),
3300
- top: Math.max(h.top + y, Math.min(M, h.bottom - x - y))
3316
+ left: Math.max(m.left + b, Math.min(y, m.right - x - b)),
3317
+ top: Math.max(m.top + b, Math.min(N, m.bottom - k - b))
3301
3318
  };
3302
- }, []), c = fe(
3303
- (b, M, v) => {
3304
- const x = Te.GAP;
3305
- let h = b.right + x, y = b.top;
3306
- if (h + M > window.innerWidth) {
3307
- if (h = b.left - M - x, h < 0) {
3308
- h = b.left, y = b.bottom + x;
3309
- const D = window.innerHeight + window.scrollY;
3310
- y + v > D && (y = b.top - v - x);
3319
+ }, []), c = ge(
3320
+ (y, N, x) => {
3321
+ const k = Te.GAP;
3322
+ let m = y.right + k, b = y.top;
3323
+ if (m + N > window.innerWidth) {
3324
+ if (m = y.left - N - k, m < 0) {
3325
+ m = y.left, b = y.bottom + k;
3326
+ const M = window.innerHeight + window.scrollY;
3327
+ b + x > M && (b = y.top - x - k);
3311
3328
  }
3312
3329
  } else {
3313
- const D = window.innerHeight + window.scrollY;
3314
- if (y + v > D) {
3315
- y = b.bottom - v;
3316
- const N = window.scrollY;
3317
- y < N + x && (y = N + x);
3330
+ const M = window.innerHeight + window.scrollY;
3331
+ if (b + x > M) {
3332
+ b = y.bottom - x;
3333
+ const S = window.scrollY;
3334
+ b < S + k && (b = S + k);
3318
3335
  }
3319
3336
  }
3320
- return m(h, y, M, v);
3337
+ return h(m, b, N, x);
3321
3338
  },
3322
- [m]
3339
+ [h]
3323
3340
  ), u = e ? {
3324
3341
  getBoundingClientRect() {
3325
3342
  return {
@@ -3333,7 +3350,7 @@ const So = ({
3333
3350
  bottom: e.pageY || 0
3334
3351
  };
3335
3352
  }
3336
- } : null, { refs: k } = Er({
3353
+ } : null, { refs: v } = Er({
3337
3354
  open: n,
3338
3355
  strategy: "absolute",
3339
3356
  // 改为绝对定位策略
@@ -3350,48 +3367,48 @@ const So = ({
3350
3367
  elements: {
3351
3368
  reference: u
3352
3369
  }
3353
- }), C = (b, M, v) => {
3354
- const x = b < v.left, h = b > v.right, y = M < v.top, D = M > v.bottom;
3355
- return h ? y ? "bottom left" : D ? "top left" : "center left" : x ? y ? "bottom right" : D ? "top right" : "center right" : D ? "top center" : y ? "bottom center" : "center";
3370
+ }), C = (y, N, x) => {
3371
+ const k = y < x.left, m = y > x.right, b = N < x.top, M = N > x.bottom;
3372
+ return m ? b ? "bottom left" : M ? "top left" : "center left" : k ? b ? "bottom right" : M ? "top right" : "center right" : M ? "top center" : b ? "bottom center" : "center";
3356
3373
  };
3357
3374
  return V(() => {
3358
3375
  if (e) {
3359
3376
  i(!0), r(!0);
3360
- const { rect: b } = e, M = g(b), { left: v, top: x } = c(
3361
- M,
3377
+ const { rect: y } = e, N = g(y), { left: x, top: k } = c(
3378
+ N,
3362
3379
  Te.ESTIMATED_MENU_WIDTH,
3363
3380
  Te.ESTIMATED_MENU_HEIGHT
3364
- ), h = C(v, x, M);
3365
- d(h), f({ left: v, top: x });
3381
+ ), m = C(x, k, N);
3382
+ d(m), f({ left: x, top: k });
3366
3383
  } else {
3367
3384
  r(!1);
3368
- const b = setTimeout(() => {
3385
+ const y = setTimeout(() => {
3369
3386
  i(!1);
3370
3387
  }, Te.ANIMATION_DELAY);
3371
- return () => clearTimeout(b);
3388
+ return () => clearTimeout(y);
3372
3389
  }
3373
3390
  }, [e, g, c]), V(() => {
3374
- n && k.floating.current && e && a && requestAnimationFrame(() => {
3375
- const { rect: b } = e, M = g(b), v = k.floating.current, x = (v == null ? void 0 : v.offsetWidth) || Te.ESTIMATED_MENU_WIDTH, h = (v == null ? void 0 : v.offsetHeight) || Te.ESTIMATED_MENU_HEIGHT, { left: y, top: D } = c(M, x, h), N = C(y, D, M);
3376
- d(N), f({ left: y, top: D });
3391
+ n && v.floating.current && e && a && requestAnimationFrame(() => {
3392
+ const { rect: y } = e, N = g(y), x = v.floating.current, k = (x == null ? void 0 : x.offsetWidth) || Te.ESTIMATED_MENU_WIDTH, m = (x == null ? void 0 : x.offsetHeight) || Te.ESTIMATED_MENU_HEIGHT, { left: b, top: M } = c(N, k, m), S = C(b, M, N);
3393
+ d(S), f({ left: b, top: M });
3377
3394
  });
3378
- }, [n, e, k, a, g, c]), V(() => {
3395
+ }, [n, e, v, a, g, c]), V(() => {
3379
3396
  if (!n) return;
3380
- const b = (x) => {
3381
- const h = x.target, y = k.floating.current;
3382
- y && !y.contains(h) && o(null);
3383
- }, M = (x) => {
3384
- x.key === "Escape" && o(null);
3385
- }, v = setTimeout(() => {
3386
- document.addEventListener("mousedown", b), document.addEventListener("keydown", M);
3397
+ const y = (k) => {
3398
+ const m = k.target, b = v.floating.current;
3399
+ b && !b.contains(m) && o(null);
3400
+ }, N = (k) => {
3401
+ k.key === "Escape" && o(null);
3402
+ }, x = setTimeout(() => {
3403
+ document.addEventListener("mousedown", y), document.addEventListener("keydown", N);
3387
3404
  }, Te.EVENT_LISTENER_DELAY);
3388
3405
  return () => {
3389
- clearTimeout(v), document.removeEventListener("mousedown", b), document.removeEventListener("keydown", M);
3406
+ clearTimeout(x), document.removeEventListener("mousedown", y), document.removeEventListener("keydown", N);
3390
3407
  };
3391
- }, [n, o, k.floating]), a ? /* @__PURE__ */ s($r, { children: /* @__PURE__ */ s(
3408
+ }, [n, o, v.floating]), a ? /* @__PURE__ */ s($r, { children: /* @__PURE__ */ s(
3392
3409
  "div",
3393
3410
  {
3394
- ref: k.setFloating,
3411
+ ref: v.setFloating,
3395
3412
  style: {
3396
3413
  position: "absolute",
3397
3414
  left: l.left,
@@ -3400,8 +3417,8 @@ const So = ({
3400
3417
  transformOrigin: p
3401
3418
  // 只设置变换原点,让内部的 motion/react 处理动画
3402
3419
  },
3403
- onMouseDown: (b) => {
3404
- b.stopPropagation();
3420
+ onMouseDown: (y) => {
3421
+ y.stopPropagation();
3405
3422
  },
3406
3423
  children: /* @__PURE__ */ s(la, { ...t, animationOrigin: p, isOpen: n })
3407
3424
  }
@@ -3418,37 +3435,39 @@ const So = ({
3418
3435
  contextMenu: p,
3419
3436
  contextMenuBuilder: d,
3420
3437
  itemBuilder: g,
3421
- itemBuilderAllowNull: m,
3438
+ itemBuilderAllowNull: h,
3422
3439
  itemIconBuilder: c,
3423
- pagingDotBuilder: u,
3424
- pagingDotsBuilder: k,
3425
- ...C
3426
- } = t, b = {
3440
+ itemIconBuilderAllowNull: u,
3441
+ pagingDotBuilder: v,
3442
+ pagingDotsBuilder: C,
3443
+ ...y
3444
+ } = t, N = {
3427
3445
  list: o,
3428
3446
  onChange: n,
3429
3447
  storageKey: r,
3430
3448
  enableCaching: a
3431
- }, M = {
3449
+ }, x = {
3432
3450
  theme: i,
3433
3451
  noLetters: l,
3434
3452
  typeConfigMap: f,
3435
3453
  dataTypeMenuConfigMap: t.dataTypeMenuConfigMap,
3436
3454
  contextMenu: p,
3437
- pagingDotsBuilder: k,
3438
- pagingDotBuilder: u,
3455
+ pagingDotsBuilder: C,
3456
+ pagingDotBuilder: v,
3439
3457
  itemBuilder: g,
3440
- itemBuilderAllowNull: m,
3458
+ itemBuilderAllowNull: h,
3441
3459
  itemIconBuilder: c,
3460
+ itemIconBuilderAllowNull: u,
3442
3461
  contextMenuBuilder: d
3443
3462
  };
3444
- return /* @__PURE__ */ s(mo, { ...b, children: /* @__PURE__ */ A(go, { ...M, children: [
3463
+ return /* @__PURE__ */ s(mo, { ...N, children: /* @__PURE__ */ A(go, { ...x, children: [
3445
3464
  /* @__PURE__ */ s(() => {
3446
- const x = Ee(), h = me();
3465
+ const m = Ee(), b = me();
3447
3466
  return V(() => {
3448
- e && (typeof e == "function" ? e({ state: x, config: h }) : e.current = { state: x, config: h });
3449
- }, [x, h]), null;
3467
+ e && (typeof e == "function" ? e({ state: m, config: b }) : e.current = { state: m, config: b });
3468
+ }, [m, b]), null;
3450
3469
  }, {}),
3451
- /* @__PURE__ */ s(Ao, { ...C }),
3470
+ /* @__PURE__ */ s(Ao, { ...y }),
3452
3471
  /* @__PURE__ */ s(da, {})
3453
3472
  ] }) });
3454
3473
  }), fa = {
@@ -3698,7 +3717,7 @@ const So = ({
3698
3717
  margin-bottom: 0;
3699
3718
  }
3700
3719
  }
3701
- `, Ro = L(
3720
+ `, Ro = D(
3702
3721
  "markdown-body",
3703
3722
  E`
3704
3723
  p {
@@ -3849,7 +3868,7 @@ const So = ({
3849
3868
  viewMode: "rich-text"
3850
3869
  },
3851
3870
  headings: g,
3852
- link: m,
3871
+ link: h,
3853
3872
  codeBlock: c,
3854
3873
  codeMirror: u = {
3855
3874
  codeBlockLanguages: {
@@ -3860,18 +3879,18 @@ const So = ({
3860
3879
  "": "Unspecified"
3861
3880
  }
3862
3881
  },
3863
- directives: k = {
3882
+ directives: v = {
3864
3883
  directiveDescriptors: [_r]
3865
3884
  }
3866
- } = r ?? {}, [C, b] = B("");
3885
+ } = r ?? {}, [C, y] = B("");
3867
3886
  return V(() => {
3868
- var M;
3869
- e !== void 0 && f.current && ((M = f.current) == null || M.setMarkdown(e), b(e));
3887
+ var N;
3888
+ e !== void 0 && f.current && ((N = f.current) == null || N.setMarkdown(e), y(e));
3870
3889
  }, [e, f]), /* @__PURE__ */ s(
3871
3890
  Or,
3872
3891
  {
3873
3892
  ref: f,
3874
- className: L(
3893
+ className: D(
3875
3894
  ma,
3876
3895
  wt(i) ? pa : "",
3877
3896
  wt(i) ? Po : To,
@@ -3879,8 +3898,8 @@ const So = ({
3879
3898
  ),
3880
3899
  contentEditableClassName: Ro,
3881
3900
  markdown: C,
3882
- onChange: (M) => {
3883
- !e && !o && b(M), o && o(M);
3901
+ onChange: (N) => {
3902
+ !e && !o && y(N), o && o(N);
3884
3903
  },
3885
3904
  translation: n ?? ga,
3886
3905
  plugins: [
@@ -3910,7 +3929,7 @@ const So = ({
3910
3929
  jr(),
3911
3930
  Ur(),
3912
3931
  Wr(g),
3913
- Gr(m),
3932
+ Gr(h),
3914
3933
  Yr(),
3915
3934
  Xr(p),
3916
3935
  Vr(),
@@ -3919,7 +3938,7 @@ const So = ({
3919
3938
  Kr(c),
3920
3939
  Jr(u),
3921
3940
  Qr(),
3922
- en(k)
3941
+ en(v)
3923
3942
  ],
3924
3943
  ...l
3925
3944
  }
@@ -3933,7 +3952,7 @@ const So = ({
3933
3952
  children: /* @__PURE__ */ s(
3934
3953
  ao,
3935
3954
  {
3936
- className: L(Ro, o),
3955
+ className: D(Ro, o),
3937
3956
  remarkPlugins: [pn, mn],
3938
3957
  rehypePlugins: [hn],
3939
3958
  components: {
@@ -3997,43 +4016,43 @@ const Dt = (t) => {
3997
4016
  icon: n,
3998
4017
  href: r,
3999
4018
  children: a,
4000
- as: i = X.div,
4019
+ as: i = Y.div,
4001
4020
  componentClassName: l = "zs-rounded-full zs-bg-gray-200 dark:zs-bg-neutral-800",
4002
4021
  titleClassName: f = "zs-rounded-md zs-bg-gray-100 zs-border dark:zs-bg-neutral-800 dark:zs-border-neutral-900 dark:zs-text-white zs-border-gray-200 zs-text-neutral-700",
4003
4022
  childrenClassName: p,
4004
4023
  ...d
4005
- } = t, g = ne(null), m = He(e, (P) => {
4006
- var q;
4007
- const $ = ((q = g.current) == null ? void 0 : q.getBoundingClientRect()) ?? { x: 0, width: 0 };
4008
- return P - $.x - $.width / 2;
4009
- }), c = He(m, [-150, 0, 150], [40, 80, 40]), u = He(m, [-150, 0, 150], [40, 80, 40]), k = He(m, [-150, 0, 150], [20, 40, 20]), C = He(m, [-150, 0, 150], [20, 40, 20]), b = nt(c, {
4024
+ } = t, g = ne(null), h = He(e, (R) => {
4025
+ var X;
4026
+ const _ = ((X = g.current) == null ? void 0 : X.getBoundingClientRect()) ?? { x: 0, width: 0 };
4027
+ return R - _.x - _.width / 2;
4028
+ }), c = He(h, [-150, 0, 150], [40, 80, 40]), u = He(h, [-150, 0, 150], [40, 80, 40]), v = He(h, [-150, 0, 150], [20, 40, 20]), C = He(h, [-150, 0, 150], [20, 40, 20]), y = nt(c, {
4010
4029
  mass: 0.1,
4011
4030
  stiffness: 150,
4012
4031
  damping: 12
4013
- }), M = nt(u, {
4032
+ }), N = nt(u, {
4014
4033
  mass: 0.1,
4015
4034
  stiffness: 150,
4016
4035
  damping: 12
4017
- }), v = nt(k, {
4036
+ }), x = nt(v, {
4018
4037
  mass: 0.1,
4019
4038
  stiffness: 150,
4020
4039
  damping: 12
4021
- }), x = nt(C, {
4040
+ }), k = nt(C, {
4022
4041
  mass: 0.1,
4023
4042
  stiffness: 150,
4024
4043
  damping: 12
4025
- }), h = He(v, (P) => `${P}px`), [y, D] = B(!1), N = /* @__PURE__ */ A(
4044
+ }), m = He(x, (R) => `${R}px`), [b, M] = B(!1), S = /* @__PURE__ */ A(
4026
4045
  i,
4027
4046
  {
4028
4047
  ref: g,
4029
- style: { width: b, height: M },
4030
- onMouseEnter: () => D(!0),
4031
- onMouseLeave: () => D(!1),
4048
+ style: { width: y, height: N },
4049
+ onMouseEnter: () => M(!0),
4050
+ onMouseLeave: () => M(!1),
4032
4051
  className: Ke("zs-aspect-square zs-flex zs-items-center zs-justify-center zs-relative", l),
4033
4052
  ...d,
4034
4053
  children: [
4035
- o && /* @__PURE__ */ s(Ce, { children: y && /* @__PURE__ */ s(
4036
- X.div,
4054
+ o && /* @__PURE__ */ s(Ce, { children: b && /* @__PURE__ */ s(
4055
+ Y.div,
4037
4056
  {
4038
4057
  initial: { opacity: 0, y: 10, x: "-50%" },
4039
4058
  animate: { opacity: 1, y: 0, x: "-50%" },
@@ -4046,21 +4065,21 @@ const Dt = (t) => {
4046
4065
  }
4047
4066
  ) }),
4048
4067
  /* @__PURE__ */ s(
4049
- X.div,
4068
+ Y.div,
4050
4069
  {
4051
4070
  style: {
4052
- width: v,
4053
- height: x,
4054
- fontSize: h
4071
+ width: x,
4072
+ height: k,
4073
+ fontSize: m
4055
4074
  },
4056
4075
  className: Ke("zs-flex zs-items-center zs-justify-center", p),
4057
- children: typeof a == "function" ? a({ widthIcon: v, heightIcon: x, fontSizeTransform: h }) : a || n
4076
+ children: typeof a == "function" ? a({ widthIcon: x, heightIcon: k, fontSizeTransform: m }) : a || n
4058
4077
  }
4059
4078
  )
4060
4079
  ]
4061
4080
  }
4062
4081
  );
4063
- return r ? /* @__PURE__ */ s("a", { href: r, children: N }) : N;
4082
+ return r ? /* @__PURE__ */ s("a", { href: r, children: S }) : S;
4064
4083
  }, At = (t) => {
4065
4084
  const {
4066
4085
  items: e = [],
@@ -4068,7 +4087,7 @@ const Dt = (t) => {
4068
4087
  itemBuilder: n,
4069
4088
  children: r,
4070
4089
  mouseX: a,
4071
- as: i = X.div
4090
+ as: i = Y.div
4072
4091
  } = t, l = Xt(1 / 0), f = a ?? l;
4073
4092
  return /* @__PURE__ */ s(
4074
4093
  i,
@@ -4084,7 +4103,7 @@ const Dt = (t) => {
4084
4103
  }, ut = (t) => {
4085
4104
  const { title: e, icon: o, href: n, index: r, totalItems: a, children: i, ...l } = t;
4086
4105
  return /* @__PURE__ */ s(
4087
- X.div,
4106
+ Y.div,
4088
4107
  {
4089
4108
  initial: { opacity: 0, y: 10 },
4090
4109
  animate: {
@@ -4117,7 +4136,7 @@ const Dt = (t) => {
4117
4136
  };
4118
4137
  return /* @__PURE__ */ A("div", { className: Ke("zs-relative zs-block", r ? "md:zs-hidden" : "", o), children: [
4119
4138
  /* @__PURE__ */ s(Ce, { children: l && /* @__PURE__ */ s(
4120
- X.div,
4139
+ Y.div,
4121
4140
  {
4122
4141
  layoutId: "nav",
4123
4142
  className: "zs-absolute zs-bottom-full zs-mb-2 zs-inset-x-0 zs-flex zs-flex-col zs-gap-2",
@@ -4247,43 +4266,43 @@ function wa(t) {
4247
4266
  let e = "", o = !1;
4248
4267
  function n(d, g) {
4249
4268
  if (g.focus(), !d.dataTransfer) return;
4250
- const m = Tt(
4269
+ const h = Tt(
4251
4270
  {
4252
4271
  x: d.clientX + 50 + t.dragHandleWidth,
4253
4272
  y: d.clientY
4254
4273
  },
4255
4274
  t
4256
4275
  );
4257
- if (!(m instanceof Element)) return;
4258
- let c = Pt(m, g, t);
4276
+ if (!(h instanceof Element)) return;
4277
+ let c = Pt(h, g, t);
4259
4278
  if (c == null || c < 0) return;
4260
4279
  c = it(c, g);
4261
- const { from: u, to: k } = g.state.selection, C = u - k, b = it(u, g);
4262
- let M = !1;
4263
- const v = g.state.doc.resolve(b);
4264
- if (v.node().type.name === "doc") M = !0;
4280
+ const { from: u, to: v } = g.state.selection, C = u - v, y = it(u, g);
4281
+ let N = !1;
4282
+ const x = g.state.doc.resolve(y);
4283
+ if (x.node().type.name === "doc") N = !0;
4265
4284
  else {
4266
- const N = we.create(
4285
+ const S = we.create(
4267
4286
  g.state.doc,
4268
- v.before()
4287
+ x.before()
4269
4288
  );
4270
- M = !(c + 1 >= N.$from.pos && c <= N.$to.pos);
4289
+ N = !(c + 1 >= S.$from.pos && c <= S.$to.pos);
4271
4290
  }
4272
- let x = g.state.selection;
4273
- if (!M && C !== 0 && !(g.state.selection instanceof we)) {
4274
- const N = we.create(g.state.doc, k - 1);
4275
- x = us.create(
4291
+ let k = g.state.selection;
4292
+ if (!N && C !== 0 && !(g.state.selection instanceof we)) {
4293
+ const S = we.create(g.state.doc, v - 1);
4294
+ k = us.create(
4276
4295
  g.state.doc,
4277
4296
  c,
4278
- N.$to.pos
4297
+ S.$to.pos
4279
4298
  );
4280
- } else if (x = we.create(g.state.doc, c), x.node.type.isInline || x.node.type.name === "tableRow") {
4281
- const N = g.state.doc.resolve(x.from);
4282
- x = we.create(g.state.doc, N.before());
4299
+ } else if (k = we.create(g.state.doc, c), k.node.type.isInline || k.node.type.name === "tableRow") {
4300
+ const S = g.state.doc.resolve(k.from);
4301
+ k = we.create(g.state.doc, S.before());
4283
4302
  }
4284
- g.dispatch(g.state.tr.setSelection(x)), g.state.selection instanceof we && g.state.selection.node.type.name === "listItem" && (e = m.parentElement.tagName);
4285
- const h = g.state.selection.content(), { dom: y, text: D } = va(g, h);
4286
- d.dataTransfer.clearData(), d.dataTransfer.setData("text/html", y.innerHTML), d.dataTransfer.setData("text/plain", D), d.dataTransfer.effectAllowed = "copyMove", d.dataTransfer.setDragImage(m, 0, 0), g.dragging = { slice: h, move: d.ctrlKey };
4303
+ g.dispatch(g.state.tr.setSelection(k)), g.state.selection instanceof we && g.state.selection.node.type.name === "listItem" && (e = h.parentElement.tagName);
4304
+ const m = g.state.selection.content(), { dom: b, text: M } = va(g, m);
4305
+ d.dataTransfer.clearData(), d.dataTransfer.setData("text/html", b.innerHTML), d.dataTransfer.setData("text/plain", M), d.dataTransfer.effectAllowed = "copyMove", d.dataTransfer.setDragImage(h, 0, 0), g.dragging = { slice: m, move: d.ctrlKey };
4287
4306
  }
4288
4307
  let r = null;
4289
4308
  function a() {
@@ -4293,14 +4312,14 @@ function wa(t) {
4293
4312
  r && r.classList.remove("hide");
4294
4313
  }
4295
4314
  function l(d, g) {
4296
- const m = it(g, d), c = we.create(d.state.doc, m);
4315
+ const h = it(g, d), c = we.create(d.state.doc, h);
4297
4316
  d.dispatch(d.state.tr.setSelection(c)), d.focus(), o = !0;
4298
4317
  }
4299
4318
  function f(d) {
4300
4319
  if (o = d.state.selection instanceof we, o && (r != null && r.dataset.nodePos)) {
4301
- const m = parseInt(r.dataset.nodePos, 10);
4320
+ const h = parseInt(r.dataset.nodePos, 10);
4302
4321
  try {
4303
- const c = d.state.doc.resolve(m);
4322
+ const c = d.state.doc.resolve(h);
4304
4323
  c && c.parent && c.parent.type.name !== "doc" || (o = !1, a());
4305
4324
  } catch {
4306
4325
  o = !1, a();
@@ -4315,40 +4334,40 @@ function wa(t) {
4315
4334
  o || a();
4316
4335
  return;
4317
4336
  }
4318
- const m = g.closest(".drag-handle") || g.classList.contains("drag-handle"), c = g.closest(".tiptap") || g.classList.contains("tiptap");
4319
- !m && !c && !o && a();
4337
+ const h = g.closest(".drag-handle") || g.classList.contains("drag-handle"), c = g.closest(".tiptap") || g.classList.contains("tiptap");
4338
+ !h && !c && !o && a();
4320
4339
  }
4321
4340
  return new cs({
4322
4341
  key: new ds(t.pluginKey),
4323
4342
  view: (d) => {
4324
- var k, C, b, M;
4343
+ var v, C, y, N;
4325
4344
  const g = t.dragHandleSelector ? document.querySelector(t.dragHandleSelector) : null;
4326
4345
  r = g ?? document.createElement("div"), r.draggable = !0, r.dataset.dragHandle = "", r.classList.add("drag-handle");
4327
- function m(v) {
4328
- n(v, d);
4346
+ function h(x) {
4347
+ n(x, d);
4329
4348
  }
4330
- r.addEventListener("dragstart", m);
4331
- function c(v) {
4332
- g || (v.preventDefault(), v.stopPropagation());
4333
- const x = r == null ? void 0 : r.dataset.nodePos;
4334
- x && l(d, parseInt(x, 10));
4349
+ r.addEventListener("dragstart", h);
4350
+ function c(x) {
4351
+ g || (x.preventDefault(), x.stopPropagation());
4352
+ const k = r == null ? void 0 : r.dataset.nodePos;
4353
+ k && l(d, parseInt(k, 10));
4335
4354
  }
4336
4355
  r.addEventListener("click", c);
4337
- function u(v) {
4356
+ function u(x) {
4338
4357
  a();
4339
- const x = window.scrollY;
4340
- v.clientY < t.scrollTreshold ? window.scrollTo({ top: x - 30, behavior: "smooth" }) : window.innerHeight - v.clientY < t.scrollTreshold && window.scrollTo({ top: x + 30, behavior: "smooth" });
4358
+ const k = window.scrollY;
4359
+ x.clientY < t.scrollTreshold ? window.scrollTo({ top: k - 30, behavior: "smooth" }) : window.innerHeight - x.clientY < t.scrollTreshold && window.scrollTo({ top: k + 30, behavior: "smooth" });
4341
4360
  }
4342
- return r.addEventListener("drag", u), a(), g || (C = (k = d == null ? void 0 : d.dom) == null ? void 0 : k.parentElement) == null || C.appendChild(r), (M = (b = d == null ? void 0 : d.dom) == null ? void 0 : b.parentElement) == null || M.addEventListener(
4361
+ return r.addEventListener("drag", u), a(), g || (C = (v = d == null ? void 0 : d.dom) == null ? void 0 : v.parentElement) == null || C.appendChild(r), (N = (y = d == null ? void 0 : d.dom) == null ? void 0 : y.parentElement) == null || N.addEventListener(
4343
4362
  "mouseout",
4344
4363
  p
4345
4364
  ), {
4346
4365
  destroy: () => {
4347
- var v, x, h;
4348
- g || (v = r == null ? void 0 : r.remove) == null || v.call(r), r == null || r.removeEventListener("drag", u), r == null || r.removeEventListener(
4366
+ var x, k, m;
4367
+ g || (x = r == null ? void 0 : r.remove) == null || x.call(r), r == null || r.removeEventListener("drag", u), r == null || r.removeEventListener(
4349
4368
  "dragstart",
4350
- m
4351
- ), r == null || r.removeEventListener("click", c), r = null, (h = (x = d == null ? void 0 : d.dom) == null ? void 0 : x.parentElement) == null || h.removeEventListener(
4369
+ h
4370
+ ), r == null || r.removeEventListener("click", c), r = null, (m = (k = d == null ? void 0 : d.dom) == null ? void 0 : k.parentElement) == null || m.removeEventListener(
4352
4371
  "mouseout",
4353
4372
  p
4354
4373
  );
@@ -4360,23 +4379,23 @@ function wa(t) {
4360
4379
  mousemove: (d, g) => {
4361
4380
  if (!d.editable)
4362
4381
  return;
4363
- const m = Tt(
4382
+ const h = Tt(
4364
4383
  {
4365
4384
  x: g.clientX + 50 + t.dragHandleWidth,
4366
4385
  y: g.clientY
4367
4386
  },
4368
4387
  t
4369
- ), c = m == null ? void 0 : m.closest(".not-draggable"), u = t.excludedTags.concat(["ol", "ul"]).join(", ");
4370
- if (!(m instanceof Element) || m.matches(u) || c) {
4388
+ ), c = h == null ? void 0 : h.closest(".not-draggable"), u = t.excludedTags.concat(["ol", "ul"]).join(", ");
4389
+ if (!(h instanceof Element) || h.matches(u) || c) {
4371
4390
  o || a();
4372
4391
  return;
4373
4392
  }
4374
- const k = Pt(m, d, t);
4375
- k != null && k >= 0 && (r.dataset.nodePos = String(
4376
- it(k, d)
4393
+ const v = Pt(h, d, t);
4394
+ v != null && v >= 0 && (r.dataset.nodePos = String(
4395
+ it(v, d)
4377
4396
  ));
4378
- const C = window.getComputedStyle(m), b = parseInt(C.lineHeight, 10), M = isNaN(b) ? parseInt(C.fontSize) * 1.2 : b, v = parseInt(C.paddingTop, 10), x = ka(m);
4379
- x.top += (M - 24) / 2, x.top += v, m.matches("ul:not([data-type=taskList]) li, ol li") && (x.left -= t.dragHandleWidth - 28), x.width = t.dragHandleWidth, r && (r.style.position = "absolute", r.style.left = `${x.left - x.width}px`, r.style.top = `${x.top}px`, i());
4397
+ const C = window.getComputedStyle(h), y = parseInt(C.lineHeight, 10), N = isNaN(y) ? parseInt(C.fontSize) * 1.2 : y, x = parseInt(C.paddingTop, 10), k = ka(h);
4398
+ k.top += (N - 24) / 2, k.top += x, h.matches("ul:not([data-type=taskList]) li, ol li") && (k.left -= t.dragHandleWidth - 28), k.width = t.dragHandleWidth, r && (r.style.position = "absolute", r.style.left = `${k.left - k.width}px`, r.style.top = `${k.top}px`, i());
4380
4399
  },
4381
4400
  keydown: () => {
4382
4401
  o || a();
@@ -4395,19 +4414,19 @@ function wa(t) {
4395
4414
  drop: (d, g) => {
4396
4415
  var C;
4397
4416
  d.dom.classList.remove("dragging"), a();
4398
- let m = null;
4417
+ let h = null;
4399
4418
  const c = d.posAtCoords({
4400
4419
  left: g.clientX,
4401
4420
  top: g.clientY
4402
4421
  });
4403
- if (!c || (d.state.selection instanceof we && (m = d.state.selection.node), !m)) return;
4404
- const k = d.state.doc.resolve(c.pos).parent.type.name === "listItem";
4405
- if (d.state.selection instanceof we && d.state.selection.node.type.name === "listItem" && !k && e == "OL") {
4406
- const b = (C = d.state.schema.nodes.orderedList) == null ? void 0 : C.createAndFill(
4422
+ if (!c || (d.state.selection instanceof we && (h = d.state.selection.node), !h)) return;
4423
+ const v = d.state.doc.resolve(c.pos).parent.type.name === "listItem";
4424
+ if (d.state.selection instanceof we && d.state.selection.node.type.name === "listItem" && !v && e == "OL") {
4425
+ const y = (C = d.state.schema.nodes.orderedList) == null ? void 0 : C.createAndFill(
4407
4426
  null,
4408
- m
4409
- ), M = new fs(gs.from(b), 0, 0);
4410
- d.dragging = { slice: M, move: g.ctrlKey };
4427
+ h
4428
+ ), N = new fs(gs.from(y), 0, 0);
4429
+ d.dragging = { slice: N, move: g.ctrlKey };
4411
4430
  }
4412
4431
  },
4413
4432
  dragend: (d) => {
@@ -4420,12 +4439,12 @@ function wa(t) {
4420
4439
  init() {
4421
4440
  return {};
4422
4441
  },
4423
- apply(d, g, m, c) {
4442
+ apply(d, g, h, c) {
4424
4443
  if (d.docChanged && r && r.dataset.nodePos) {
4425
4444
  const u = parseInt(r.dataset.nodePos, 10);
4426
4445
  try {
4427
- const k = c.doc.resolve(u);
4428
- (!k || k.parent.type.name === "doc") && (o = !1, a());
4446
+ const v = c.doc.resolve(u);
4447
+ (!v || v.parent.type.name === "doc") && (o = !1, a());
4429
4448
  } catch {
4430
4449
  o = !1, a();
4431
4450
  }
@@ -4578,13 +4597,13 @@ const Ca = ls.create({
4578
4597
  _n,
4579
4598
  On,
4580
4599
  $a
4581
- ], _a = Je.Root, Oo = Je.Trigger, ht = ie.forwardRef(({ className: t, align: e = "center", sideOffset: o = 4, ...n }, r) => /* @__PURE__ */ s(Je.Portal, { children: /* @__PURE__ */ s(
4600
+ ], _a = Je.Root, Oo = Je.Trigger, ht = le.forwardRef(({ className: t, align: e = "center", sideOffset: o = 4, ...n }, r) => /* @__PURE__ */ s(Je.Portal, { children: /* @__PURE__ */ s(
4582
4601
  Je.Content,
4583
4602
  {
4584
4603
  ref: r,
4585
4604
  align: e,
4586
4605
  sideOffset: o,
4587
- className: L(
4606
+ className: D(
4588
4607
  "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
4589
4608
  t
4590
4609
  ),
@@ -4616,11 +4635,11 @@ const Oa = ss(
4616
4635
  size: "default"
4617
4636
  }
4618
4637
  }
4619
- ), Ne = ie.forwardRef(
4638
+ ), Ne = le.forwardRef(
4620
4639
  ({ className: t, variant: e, size: o, asChild: n = !1, ...r }, a) => /* @__PURE__ */ s(
4621
4640
  n ? hs : "button",
4622
4641
  {
4623
- className: L(Oa({ variant: e, size: o, className: t })),
4642
+ className: D(Oa({ variant: e, size: o, className: t })),
4624
4643
  ref: a,
4625
4644
  ...r
4626
4645
  }
@@ -4857,7 +4876,7 @@ const Ua = ({ open: t, onOpenChange: e }) => {
4857
4876
  /* @__PURE__ */ s(
4858
4877
  "p",
4859
4878
  {
4860
- className: L(
4879
+ className: D(
4861
4880
  "underline decoration-stone-400 underline-offset-4",
4862
4881
  {
4863
4882
  "text-blue-500": n.isActive("link")
@@ -4927,7 +4946,7 @@ const Ua = ({ open: t, onOpenChange: e }) => {
4927
4946
  children: /* @__PURE__ */ s(
4928
4947
  ys,
4929
4948
  {
4930
- className: L("size-4", { "text-blue-500": t.isActive("math") }),
4949
+ className: D("size-4", { "text-blue-500": t.isActive("math") }),
4931
4950
  strokeWidth: 2.3
4932
4951
  }
4933
4952
  )
@@ -5040,14 +5059,14 @@ const Ua = ({ open: t, onOpenChange: e }) => {
5040
5059
  ))
5041
5060
  ] })
5042
5061
  ] });
5043
- }, Ue = ie.forwardRef(
5062
+ }, Ue = le.forwardRef(
5044
5063
  ({ className: t, orientation: e = "horizontal", decorative: o = !0, ...n }, r) => /* @__PURE__ */ s(
5045
5064
  co.Root,
5046
5065
  {
5047
5066
  ref: r,
5048
5067
  decorative: o,
5049
5068
  orientation: e,
5050
- className: L(
5069
+ className: D(
5051
5070
  "shrink-0 bg-border",
5052
5071
  e === "horizontal" ? "h-[1px] w-full" : " w-[1px]",
5053
5072
  t
@@ -5061,11 +5080,11 @@ const Ya = () => /* @__PURE__ */ A("div", { className: "flex items-center justif
5061
5080
  /* @__PURE__ */ s("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
5062
5081
  /* @__PURE__ */ s("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
5063
5082
  /* @__PURE__ */ s("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
5064
- ] }), Fo = ie.forwardRef(({ className: t, children: e, ...o }, n) => /* @__PURE__ */ A(
5083
+ ] }), Fo = le.forwardRef(({ className: t, children: e, ...o }, n) => /* @__PURE__ */ A(
5065
5084
  Be.Root,
5066
5085
  {
5067
5086
  ref: n,
5068
- className: L("relative overflow-hidden", t),
5087
+ className: D("relative overflow-hidden", t),
5069
5088
  ...o,
5070
5089
  children: [
5071
5090
  /* @__PURE__ */ s(Be.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
@@ -5075,12 +5094,12 @@ const Ya = () => /* @__PURE__ */ A("div", { className: "flex items-center justif
5075
5094
  }
5076
5095
  ));
5077
5096
  Fo.displayName = Be.Root.displayName;
5078
- const Ho = ie.forwardRef(({ className: t, orientation: e = "vertical", ...o }, n) => /* @__PURE__ */ s(
5097
+ const Ho = le.forwardRef(({ className: t, orientation: e = "vertical", ...o }, n) => /* @__PURE__ */ s(
5079
5098
  Be.ScrollAreaScrollbar,
5080
5099
  {
5081
5100
  ref: n,
5082
5101
  orientation: e,
5083
- className: L(
5102
+ className: D(
5084
5103
  "flex touch-none select-none transition-colors",
5085
5104
  e === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
5086
5105
  e === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
@@ -5091,11 +5110,11 @@ const Ho = ie.forwardRef(({ className: t, orientation: e = "vertical", ...o }, n
5091
5110
  }
5092
5111
  ));
5093
5112
  Ho.displayName = Be.ScrollAreaScrollbar.displayName;
5094
- const Xa = Le.Portal, jo = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5113
+ const Xa = Le.Portal, jo = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5095
5114
  Le.Overlay,
5096
5115
  {
5097
5116
  ref: o,
5098
- className: L(
5117
+ className: D(
5099
5118
  "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
5100
5119
  t
5101
5120
  ),
@@ -5103,13 +5122,13 @@ const Xa = Le.Portal, jo = ie.forwardRef(({ className: t, ...e }, o) => /* @__PU
5103
5122
  }
5104
5123
  ));
5105
5124
  jo.displayName = Le.Overlay.displayName;
5106
- const Va = ie.forwardRef(({ className: t, children: e, ...o }, n) => /* @__PURE__ */ A(Xa, { children: [
5125
+ const Va = le.forwardRef(({ className: t, children: e, ...o }, n) => /* @__PURE__ */ A(Xa, { children: [
5107
5126
  /* @__PURE__ */ s(jo, {}),
5108
5127
  /* @__PURE__ */ A(
5109
5128
  Le.Content,
5110
5129
  {
5111
5130
  ref: n,
5112
- className: L(
5131
+ className: D(
5113
5132
  "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
5114
5133
  t
5115
5134
  ),
@@ -5125,11 +5144,11 @@ const Va = ie.forwardRef(({ className: t, children: e, ...o }, n) => /* @__PURE_
5125
5144
  )
5126
5145
  ] }));
5127
5146
  Va.displayName = Le.Content.displayName;
5128
- const qa = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5147
+ const qa = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5129
5148
  Le.Title,
5130
5149
  {
5131
5150
  ref: o,
5132
- className: L(
5151
+ className: D(
5133
5152
  "text-lg font-semibold leading-none tracking-tight",
5134
5153
  t
5135
5154
  ),
@@ -5137,20 +5156,20 @@ const qa = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5137
5156
  }
5138
5157
  ));
5139
5158
  qa.displayName = Le.Title.displayName;
5140
- const Za = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5159
+ const Za = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5141
5160
  Le.Description,
5142
5161
  {
5143
5162
  ref: o,
5144
- className: L("text-sm text-muted-foreground", t),
5163
+ className: D("text-sm text-muted-foreground", t),
5145
5164
  ...e
5146
5165
  }
5147
5166
  ));
5148
5167
  Za.displayName = Le.Description.displayName;
5149
- const Uo = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5168
+ const Uo = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5150
5169
  ve,
5151
5170
  {
5152
5171
  ref: o,
5153
- className: L(
5172
+ className: D(
5154
5173
  "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
5155
5174
  t
5156
5175
  ),
@@ -5158,13 +5177,13 @@ const Uo = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5158
5177
  }
5159
5178
  ));
5160
5179
  Uo.displayName = ve.displayName;
5161
- const Wo = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ A("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
5180
+ const Wo = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ A("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
5162
5181
  /* @__PURE__ */ s(It, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
5163
5182
  /* @__PURE__ */ s(
5164
5183
  ve.Input,
5165
5184
  {
5166
5185
  ref: o,
5167
- className: L(
5186
+ className: D(
5168
5187
  "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
5169
5188
  t
5170
5189
  ),
@@ -5173,16 +5192,16 @@ const Wo = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ A("div",
5173
5192
  )
5174
5193
  ] }));
5175
5194
  Wo.displayName = ve.Input.displayName;
5176
- const Ka = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5195
+ const Ka = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5177
5196
  ve.List,
5178
5197
  {
5179
5198
  ref: o,
5180
- className: L("max-h-[300px] overflow-y-auto overflow-x-hidden", t),
5199
+ className: D("max-h-[300px] overflow-y-auto overflow-x-hidden", t),
5181
5200
  ...e
5182
5201
  }
5183
5202
  ));
5184
5203
  Ka.displayName = ve.List.displayName;
5185
- const Ja = ie.forwardRef((t, e) => /* @__PURE__ */ s(
5204
+ const Ja = le.forwardRef((t, e) => /* @__PURE__ */ s(
5186
5205
  ve.Empty,
5187
5206
  {
5188
5207
  ref: e,
@@ -5191,11 +5210,11 @@ const Ja = ie.forwardRef((t, e) => /* @__PURE__ */ s(
5191
5210
  }
5192
5211
  ));
5193
5212
  Ja.displayName = ve.Empty.displayName;
5194
- const et = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5213
+ const et = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5195
5214
  ve.Group,
5196
5215
  {
5197
5216
  ref: o,
5198
- className: L(
5217
+ className: D(
5199
5218
  "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
5200
5219
  t
5201
5220
  ),
@@ -5203,20 +5222,20 @@ const et = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5203
5222
  }
5204
5223
  ));
5205
5224
  et.displayName = ve.Group.displayName;
5206
- const Rt = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5225
+ const Rt = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5207
5226
  ve.Separator,
5208
5227
  {
5209
5228
  ref: o,
5210
- className: L("-mx-1 h-px bg-border", t),
5229
+ className: D("-mx-1 h-px bg-border", t),
5211
5230
  ...e
5212
5231
  }
5213
5232
  ));
5214
5233
  Rt.displayName = ve.Separator.displayName;
5215
- const We = ie.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5234
+ const We = le.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
5216
5235
  ve.Item,
5217
5236
  {
5218
5237
  ref: o,
5219
- className: L(
5238
+ className: D(
5220
5239
  "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
5221
5240
  t
5222
5241
  ),
@@ -5547,7 +5566,7 @@ const ri = ({
5547
5566
  children: /* @__PURE__ */ s(
5548
5567
  o.icon,
5549
5568
  {
5550
- className: L("h-4 w-4", {
5569
+ className: D("h-4 w-4", {
5551
5570
  "text-blue-500": o.isActive(t)
5552
5571
  })
5553
5572
  }
@@ -5685,7 +5704,7 @@ const ri = ({
5685
5704
  st.Item,
5686
5705
  {
5687
5706
  onClick: i.onClick,
5688
- className: L(
5707
+ className: D(
5689
5708
  "gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
5690
5709
  i.className
5691
5710
  ),
@@ -5703,7 +5722,7 @@ const ri = ({
5703
5722
  st.SubMenu,
5704
5723
  {
5705
5724
  expandIcon: /* @__PURE__ */ s(Vt, { size: 16 }),
5706
- popupClassName: L(
5725
+ popupClassName: D(
5707
5726
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
5708
5727
  E`
5709
5728
  .rc-menu {
@@ -5713,7 +5732,7 @@ const ri = ({
5713
5732
  `
5714
5733
  ),
5715
5734
  popupOffset: [4, 0],
5716
- className: L(
5735
+ className: D(
5717
5736
  "gap-2 !p-0 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
5718
5737
  E`
5719
5738
  .rc-menu-submenu-title {
@@ -5747,7 +5766,7 @@ const ri = ({
5747
5766
  overlay: /* @__PURE__ */ s(
5748
5767
  st,
5749
5768
  {
5750
- className: L(
5769
+ className: D(
5751
5770
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
5752
5771
  E`
5753
5772
  .rc-menu-submenu-active {
@@ -5825,7 +5844,7 @@ const ci = ({ children: t, ...e }) => {
5825
5844
  return /* @__PURE__ */ A(
5826
5845
  "div",
5827
5846
  {
5828
- className: L(
5847
+ className: D(
5829
5848
  "custom-drag-handle",
5830
5849
  E`
5831
5850
  width: auto;
@@ -5882,61 +5901,61 @@ const ci = ({ children: t, ...e }) => {
5882
5901
  editorRef: p,
5883
5902
  enableAI: d = !1,
5884
5903
  aiOptions: g
5885
- } = t, [m, c] = B(
5904
+ } = t, [h, c] = B(
5886
5905
  o
5887
- ), [u, k] = B("Saved"), [C, b] = B(), [M, v] = B(!1), [x, h] = B(!1), [y, D] = B(!1), [N, P] = B(!1), $ = (R) => {
5888
- const W = new DOMParser().parseFromString(R, "text/html");
5906
+ ), [u, v] = B("Saved"), [C, y] = B(), [N, x] = B(!1), [k, m] = B(!1), [b, M] = B(!1), [S, R] = B(!1), _ = (T) => {
5907
+ const W = new DOMParser().parseFromString(T, "text/html");
5889
5908
  return W.querySelectorAll("pre code").forEach((se) => {
5890
5909
  Ps.highlightElement(se);
5891
5910
  }), new XMLSerializer().serializeToString(W);
5892
- }, q = rs(
5893
- async (R) => {
5894
- const W = R.getJSON();
5895
- b(R.storage.characterCount.words()), n == null || n(W), a && (window.localStorage.setItem(
5911
+ }, X = rs(
5912
+ async (T) => {
5913
+ const W = T.getJSON();
5914
+ y(T.storage.characterCount.words()), n == null || n(W), a && (window.localStorage.setItem(
5896
5915
  "html-content",
5897
- $(R.getHTML())
5916
+ _(T.getHTML())
5898
5917
  ), window.localStorage.setItem(r, JSON.stringify(W)), window.localStorage.setItem(
5899
5918
  "markdown",
5900
- R.storage.markdown.getMarkdown()
5901
- ), k("Saved"));
5919
+ T.storage.markdown.getMarkdown()
5920
+ ), v("Saved"));
5902
5921
  },
5903
5922
  500
5904
- ), T = re(() => {
5923
+ ), P = re(() => {
5905
5924
  if (!f) return si;
5906
5925
  const {
5907
- beforeUpload: R,
5926
+ beforeUpload: T,
5908
5927
  maxSize: W,
5909
5928
  action: se,
5910
- headers: Z,
5911
- method: G,
5912
- name: ee,
5913
- onSuccess: le,
5914
- onError: ge,
5915
- customUploadFn: ae
5929
+ headers: ee,
5930
+ method: q,
5931
+ name: Z,
5932
+ onSuccess: ae,
5933
+ onError: ce,
5934
+ customUploadFn: ie
5916
5935
  } = f;
5917
5936
  return io({
5918
- onUpload: async (ce) => {
5919
- let de;
5920
- if (ae)
5921
- de = ae(ce);
5937
+ onUpload: async (de) => {
5938
+ let ue;
5939
+ if (ie)
5940
+ ue = ie(de);
5922
5941
  else {
5923
5942
  const K = new FormData();
5924
- K.append(ee || "file", ce), de = fetch(se, {
5925
- method: G || "POST",
5943
+ K.append(Z || "file", de), ue = fetch(se, {
5944
+ method: q || "POST",
5926
5945
  headers: {
5927
- ...Z
5946
+ ...ee
5928
5947
  },
5929
5948
  body: K
5930
5949
  });
5931
5950
  }
5932
5951
  return new Promise((K, be) => {
5933
- de.then(async (Q) => {
5934
- if (le) {
5935
- const he = ae ? Q : await Q.json();
5936
- K(le(he));
5952
+ ue.then(async (Q) => {
5953
+ if (ae) {
5954
+ const he = ie ? Q : await Q.json();
5955
+ K(ae(he));
5937
5956
  return;
5938
5957
  }
5939
- if (ae) {
5958
+ if (ie) {
5940
5959
  if (typeof Q == "object" && Q !== null && "url" in Q) {
5941
5960
  K(Q.url);
5942
5961
  return;
@@ -5953,29 +5972,29 @@ const ci = ({ children: t, ...e }) => {
5953
5972
  pe.src = he, pe.onload = () => {
5954
5973
  K(he);
5955
5974
  };
5956
- } else throw Q.status === 401 ? (K(ce), new Error(
5975
+ } else throw Q.status === 401 ? (K(de), new Error(
5957
5976
  "`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead."
5958
5977
  )) : new Error("Error uploading image. Please try again.");
5959
5978
  }).catch((Q) => {
5960
- ge && ge(Q), be(Q);
5979
+ ce && ce(Q), be(Q);
5961
5980
  });
5962
5981
  });
5963
5982
  },
5964
- validateFn: (ce) => R ? R(ce) : ce.type.includes("image/") ? W && ce.size > W ? (console.error("File size too big (max 20MB)."), !1) : !0 : (console.error("File type not supported."), !1)
5983
+ validateFn: (de) => T ? T(de) : de.type.includes("image/") ? W && de.size > W ? (console.error("File size too big (max 20MB)."), !1) : !0 : (console.error("File type not supported."), !1)
5965
5984
  });
5966
5985
  }, [f]);
5967
5986
  if (V(() => {
5968
5987
  if (!a) return;
5969
- const R = window.localStorage.getItem(r);
5970
- c(R ? JSON.parse(R) : li);
5971
- }, [r, a]), !m) return null;
5988
+ const T = window.localStorage.getItem(r);
5989
+ c(T ? JSON.parse(T) : li);
5990
+ }, [r, a]), !h) return null;
5972
5991
  const O = [
5973
5992
  ..._o,
5974
5993
  ii({
5975
- uploadFn: T
5994
+ uploadFn: P
5976
5995
  })
5977
5996
  ];
5978
- return /* @__PURE__ */ A("div", { className: L("relative w-full max-w-screen-lg", e), children: [
5997
+ return /* @__PURE__ */ A("div", { className: D("relative w-full max-w-screen-lg", e), children: [
5979
5998
  (a && i || l) && /* @__PURE__ */ A("div", { className: "flex absolute right-5 top-5 z-10 mb-5 gap-2", children: [
5980
5999
  a && i && /* @__PURE__ */ s("div", { className: "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground", children: u }),
5981
6000
  l && /* @__PURE__ */ A(
@@ -5992,66 +6011,66 @@ const ci = ({ children: t, ...e }) => {
5992
6011
  /* @__PURE__ */ s(Xn, { children: /* @__PURE__ */ A(
5993
6012
  Vn,
5994
6013
  {
5995
- onCreate: ({ editor: R }) => {
5996
- p && (p.current = R);
6014
+ onCreate: ({ editor: T }) => {
6015
+ p && (p.current = T);
5997
6016
  },
5998
- initialContent: m,
6017
+ initialContent: h,
5999
6018
  extensions: O,
6000
6019
  className: "relative min-h-[500px] w-full editor-content",
6001
6020
  editorProps: {
6002
6021
  handleDOMEvents: {
6003
- keydown: (R, W) => Kn(W)
6022
+ keydown: (T, W) => Kn(W)
6004
6023
  },
6005
- handlePaste: (R, W) => Zn(R, W, T),
6006
- handleDrop: (R, W, se, Z) => qn(R, W, Z, T),
6024
+ handlePaste: (T, W) => Zn(T, W, P),
6025
+ handleDrop: (T, W, se, ee) => qn(T, W, ee, P),
6007
6026
  attributes: {
6008
6027
  class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
6009
6028
  }
6010
6029
  },
6011
- onUpdate: ({ editor: R }) => {
6012
- q(R), k("Unsaved");
6030
+ onUpdate: ({ editor: T }) => {
6031
+ X(T), v("Unsaved");
6013
6032
  },
6014
6033
  slotAfter: /* @__PURE__ */ s(os, {}),
6015
6034
  children: [
6016
6035
  /* @__PURE__ */ A(Jn, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
6017
6036
  /* @__PURE__ */ s(Qn, { className: "px-2 text-muted-foreground", children: "没有结果" }),
6018
6037
  /* @__PURE__ */ s(es, { children: Go({
6019
- uploadFn: T
6020
- }).map((R) => /* @__PURE__ */ A(
6038
+ uploadFn: P
6039
+ }).map((T) => /* @__PURE__ */ A(
6021
6040
  ts,
6022
6041
  {
6023
- value: R.title,
6024
- onCommand: (W) => R.command(W),
6042
+ value: T.title,
6043
+ onCommand: (W) => T.command(W),
6025
6044
  className: "flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm hover:bg-accent aria-selected:bg-accent",
6026
6045
  children: [
6027
- /* @__PURE__ */ s("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children: R.icon }),
6046
+ /* @__PURE__ */ s("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children: T.icon }),
6028
6047
  /* @__PURE__ */ A("div", { children: [
6029
- /* @__PURE__ */ s("p", { className: "font-medium", children: R.title }),
6030
- /* @__PURE__ */ s("p", { className: "text-xs text-muted-foreground", children: R.description })
6048
+ /* @__PURE__ */ s("p", { className: "font-medium", children: T.title }),
6049
+ /* @__PURE__ */ s("p", { className: "text-xs text-muted-foreground", children: T.description })
6031
6050
  ] })
6032
6051
  ]
6033
6052
  },
6034
- R.title
6053
+ T.title
6035
6054
  )) })
6036
6055
  ] }),
6037
6056
  /* @__PURE__ */ A(
6038
6057
  ri,
6039
6058
  {
6040
- open: N,
6041
- onOpenChange: P,
6059
+ open: S,
6060
+ onOpenChange: R,
6042
6061
  enableAI: d,
6043
6062
  aiOptions: g,
6044
6063
  children: [
6045
6064
  d && /* @__PURE__ */ s(Ue, { orientation: "vertical" }),
6046
- /* @__PURE__ */ s(Ga, { open: M, onOpenChange: v }),
6065
+ /* @__PURE__ */ s(Ga, { open: N, onOpenChange: x }),
6047
6066
  /* @__PURE__ */ s(Ue, { orientation: "vertical" }),
6048
- /* @__PURE__ */ s(Ua, { open: y, onOpenChange: D }),
6067
+ /* @__PURE__ */ s(Ua, { open: b, onOpenChange: M }),
6049
6068
  /* @__PURE__ */ s(Ue, { orientation: "vertical" }),
6050
6069
  /* @__PURE__ */ s(Wa, {}),
6051
6070
  /* @__PURE__ */ s(Ue, { orientation: "vertical" }),
6052
6071
  /* @__PURE__ */ s(ai, {}),
6053
6072
  /* @__PURE__ */ s(Ue, { orientation: "vertical" }),
6054
- /* @__PURE__ */ s(Fa, { open: x, onOpenChange: h })
6073
+ /* @__PURE__ */ s(Fa, { open: k, onOpenChange: m })
6055
6074
  ]
6056
6075
  }
6057
6076
  ),
@@ -6065,7 +6084,7 @@ const ci = ({ children: t, ...e }) => {
6065
6084
  return /* @__PURE__ */ s("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ s("div", { dangerouslySetInnerHTML: { __html: e } }) });
6066
6085
  }, Xo = ui;
6067
6086
  Xo.Preview = fi;
6068
- const gi = ie.createContext(null);
6087
+ const gi = le.createContext(null);
6069
6088
  function pi(t, e) {
6070
6089
  const o = Array.isArray(t) ? t[0] : t ? t.x : 0, n = Array.isArray(t) ? t[1] : t ? t.y : 0, r = Array.isArray(e) ? e[0] : e ? e.x : 0, a = Array.isArray(e) ? e[1] : e ? e.y : 0;
6071
6090
  return o === r && n === a;
@@ -6435,29 +6454,29 @@ function wi(t, e) {
6435
6454
  }
6436
6455
  n !== void 0 && t.setMaxParallelImageRequests(n), r !== void 0 && t.setWorkerCount(r), a !== void 0 && t.setWorkerUrl(a);
6437
6456
  }
6438
- const Ve = ie.createContext(null);
6457
+ const Ve = le.createContext(null);
6439
6458
  function Ci(t, e) {
6440
6459
  const o = De(gi), [n, r] = B(null), a = ne(), { current: i } = ne({ mapLib: null, map: null });
6441
6460
  V(() => {
6442
6461
  const p = t.mapLib;
6443
6462
  let d = !0, g;
6444
- return Promise.resolve(p || import("maplibre-gl")).then((m) => {
6463
+ return Promise.resolve(p || import("maplibre-gl")).then((h) => {
6445
6464
  if (!d)
6446
6465
  return;
6447
- if (!m)
6466
+ if (!h)
6448
6467
  throw new Error("Invalid mapLib");
6449
- const c = "Map" in m ? m : m.default;
6468
+ const c = "Map" in h ? h : h.default;
6450
6469
  if (!c.Map)
6451
6470
  throw new Error("Invalid mapLib");
6452
6471
  wi(c, t), t.reuseMaps && (g = Ye.reuse(t, a.current)), g || (g = new Ye(c.Map, t, a.current)), i.map = xi(g), i.mapLib = c, r(g), o == null || o.onMapMount(i.map, t.id);
6453
- }).catch((m) => {
6472
+ }).catch((h) => {
6454
6473
  const { onError: c } = t;
6455
6474
  c ? c({
6456
6475
  type: "error",
6457
6476
  target: null,
6458
6477
  originalEvent: null,
6459
- error: m
6460
- }) : console.error(m);
6478
+ error: h
6479
+ }) : console.error(h);
6461
6480
  }), () => {
6462
6481
  d = !1, g && (o == null || o.onMapUnmount(t.id), t.reuseMaps ? g.recycle() : g.destroy());
6463
6482
  };
@@ -6472,13 +6491,13 @@ function Ci(t, e) {
6472
6491
  }), [t.style]), f = {
6473
6492
  height: "100%"
6474
6493
  };
6475
- return ie.createElement("div", { id: t.id, ref: a, style: l }, n && ie.createElement(
6494
+ return le.createElement("div", { id: t.id, ref: a, style: l }, n && le.createElement(
6476
6495
  Ve.Provider,
6477
6496
  { value: i },
6478
- ie.createElement("div", { "mapboxgl-children": "", style: f }, t.children)
6497
+ le.createElement("div", { "mapboxgl-children": "", style: f }, t.children)
6479
6498
  ));
6480
6499
  }
6481
- const zi = ie.forwardRef(Ci), Ni = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
6500
+ const zi = le.forwardRef(Ci), Ni = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
6482
6501
  function Re(t, e) {
6483
6502
  if (!t || !e)
6484
6503
  return;
@@ -6503,48 +6522,48 @@ function Gt(t) {
6503
6522
  }
6504
6523
  const xt = Ae(Xe((t, e) => {
6505
6524
  const { map: o, mapLib: n } = De(Ve), r = ne({ props: t }), a = re(() => {
6506
- let b = !1;
6507
- ie.Children.forEach(t.children, (x) => {
6508
- x && (b = !0);
6525
+ let y = !1;
6526
+ le.Children.forEach(t.children, (k) => {
6527
+ k && (y = !0);
6509
6528
  });
6510
- const M = {
6529
+ const N = {
6511
6530
  ...t,
6512
- element: b ? document.createElement("div") : void 0
6513
- }, v = new n.Marker(M);
6514
- return v.setLngLat([t.longitude, t.latitude]), v.getElement().addEventListener("click", (x) => {
6515
- var h, y;
6516
- (y = (h = r.current.props).onClick) == null || y.call(h, {
6531
+ element: y ? document.createElement("div") : void 0
6532
+ }, x = new n.Marker(N);
6533
+ return x.setLngLat([t.longitude, t.latitude]), x.getElement().addEventListener("click", (k) => {
6534
+ var m, b;
6535
+ (b = (m = r.current.props).onClick) == null || b.call(m, {
6517
6536
  type: "click",
6518
- target: v,
6519
- originalEvent: x
6537
+ target: x,
6538
+ originalEvent: k
6520
6539
  });
6521
- }), v.on("dragstart", (x) => {
6522
- var y, D;
6523
- const h = x;
6524
- h.lngLat = a.getLngLat(), (D = (y = r.current.props).onDragStart) == null || D.call(y, h);
6525
- }), v.on("drag", (x) => {
6526
- var y, D;
6527
- const h = x;
6528
- h.lngLat = a.getLngLat(), (D = (y = r.current.props).onDrag) == null || D.call(y, h);
6529
- }), v.on("dragend", (x) => {
6530
- var y, D;
6531
- const h = x;
6532
- h.lngLat = a.getLngLat(), (D = (y = r.current.props).onDragEnd) == null || D.call(y, h);
6533
- }), v;
6540
+ }), x.on("dragstart", (k) => {
6541
+ var b, M;
6542
+ const m = k;
6543
+ m.lngLat = a.getLngLat(), (M = (b = r.current.props).onDragStart) == null || M.call(b, m);
6544
+ }), x.on("drag", (k) => {
6545
+ var b, M;
6546
+ const m = k;
6547
+ m.lngLat = a.getLngLat(), (M = (b = r.current.props).onDrag) == null || M.call(b, m);
6548
+ }), x.on("dragend", (k) => {
6549
+ var b, M;
6550
+ const m = k;
6551
+ m.lngLat = a.getLngLat(), (M = (b = r.current.props).onDragEnd) == null || M.call(b, m);
6552
+ }), x;
6534
6553
  }, []);
6535
6554
  V(() => (a.addTo(o.getMap()), () => {
6536
6555
  a.remove();
6537
6556
  }), []);
6538
- const { longitude: i, latitude: l, offset: f, style: p, draggable: d = !1, popup: g = null, rotation: m = 0, rotationAlignment: c = "auto", pitchAlignment: u = "auto" } = t;
6557
+ const { longitude: i, latitude: l, offset: f, style: p, draggable: d = !1, popup: g = null, rotation: h = 0, rotationAlignment: c = "auto", pitchAlignment: u = "auto" } = t;
6539
6558
  V(() => {
6540
6559
  Re(a.getElement(), p);
6541
6560
  }, [p]), tt(e, () => a, []);
6542
- const k = r.current.props;
6543
- (a.getLngLat().lng !== i || a.getLngLat().lat !== l) && a.setLngLat([i, l]), f && !pi(a.getOffset(), f) && a.setOffset(f), a.isDraggable() !== d && a.setDraggable(d), a.getRotation() !== m && a.setRotation(m), a.getRotationAlignment() !== c && a.setRotationAlignment(c), a.getPitchAlignment() !== u && a.setPitchAlignment(u), a.getPopup() !== g && a.setPopup(g);
6544
- const C = Vo(k.className, t.className);
6561
+ const v = r.current.props;
6562
+ (a.getLngLat().lng !== i || a.getLngLat().lat !== l) && a.setLngLat([i, l]), f && !pi(a.getOffset(), f) && a.setOffset(f), a.isDraggable() !== d && a.setDraggable(d), a.getRotation() !== h && a.setRotation(h), a.getRotationAlignment() !== c && a.setRotationAlignment(c), a.getPitchAlignment() !== u && a.setPitchAlignment(u), a.getPopup() !== g && a.setPopup(g);
6563
+ const C = Vo(v.className, t.className);
6545
6564
  if (C)
6546
- for (const b of C)
6547
- a.toggleClassName(b);
6565
+ for (const y of C)
6566
+ a.toggleClassName(y);
6548
6567
  return r.current.props = t, uo(t.children, a.getElement());
6549
6568
  }));
6550
6569
  Ae(Xe((t, e) => {
@@ -6727,7 +6746,7 @@ function vt(t) {
6727
6746
  }
6728
6747
  }, [e]);
6729
6748
  let a = e && e.style && e.getSource(r);
6730
- return a ? Pi(a, t, o.current) : a = Ti(e, r, t), o.current = t, a && ie.Children.map(t.children, (i) => i && or(i, {
6749
+ return a ? Pi(a, t, o.current) : a = Ti(e, r, t), o.current = t, a && le.Children.map(t.children, (i) => i && or(i, {
6731
6750
  source: r
6732
6751
  })) || null;
6733
6752
  }
@@ -6829,36 +6848,36 @@ const Oi = (t) => {
6829
6848
  }), f > 50 && p > 30)
6830
6849
  return console.log("视图范围很大,返回所有省份"), [...o];
6831
6850
  const d = [], g = new Map(
6832
- o.map((m) => [m.code, m])
6851
+ o.map((h) => [h.code, h])
6833
6852
  );
6834
- if (e.features.forEach((m) => {
6835
- if (!m.properties || !m.properties.adcode) return;
6836
- const { adcode: c } = m.properties, u = g.get(c);
6853
+ if (e.features.forEach((h) => {
6854
+ if (!h.properties || !h.properties.adcode) return;
6855
+ const { adcode: c } = h.properties, u = g.get(c);
6837
6856
  if (!u) return;
6838
- let k = Oi(m);
6839
- if (!k && u) {
6840
- const { longitude: h, latitude: y } = u;
6841
- k = [h - 2, y - 2, h + 2, y + 2];
6857
+ let v = Oi(h);
6858
+ if (!v && u) {
6859
+ const { longitude: m, latitude: b } = u;
6860
+ v = [m - 2, b - 2, m + 2, b + 2];
6842
6861
  }
6843
- if (!k) return;
6844
- const [C, b, M, v] = k;
6845
- !(M < r || // 省份完全在视图左侧
6862
+ if (!v) return;
6863
+ const [C, y, N, x] = v;
6864
+ !(N < r || // 省份完全在视图左侧
6846
6865
  C > a || // 省份完全在视图右侧
6847
- v < i || // 省份完全在视图下方
6848
- b > l) && d.push(u);
6849
- }), d.length < 3 && (console.log("找到的相交区域太少,尝试其他检查方法..."), o.forEach((m) => {
6850
- if (d.some((C) => C.code === m.code)) return;
6851
- const { longitude: u, latitude: k } = m;
6852
- u >= r && u <= a && k >= i && k <= l && d.push(m);
6866
+ x < i || // 省份完全在视图下方
6867
+ y > l) && d.push(u);
6868
+ }), d.length < 3 && (console.log("找到的相交区域太少,尝试其他检查方法..."), o.forEach((h) => {
6869
+ if (d.some((C) => C.code === h.code)) return;
6870
+ const { longitude: u, latitude: v } = h;
6871
+ u >= r && u <= a && v >= i && v <= l && d.push(h);
6853
6872
  }), d.length < 3 && (f > 10 || p > 10))) {
6854
6873
  console.log("扩大检查范围...");
6855
- const m = r - 2, c = a + 2, u = i - 2, k = l + 2;
6874
+ const h = r - 2, c = a + 2, u = i - 2, v = l + 2;
6856
6875
  o.forEach((C) => {
6857
6876
  if (d.some(
6858
- (x) => x.code === C.code
6877
+ (k) => k.code === C.code
6859
6878
  )) return;
6860
- const { longitude: M, latitude: v } = C;
6861
- M >= m && M <= c && v >= u && v <= k && d.push(C);
6879
+ const { longitude: N, latitude: x } = C;
6880
+ N >= h && N <= c && x >= u && x <= v && d.push(C);
6862
6881
  });
6863
6882
  }
6864
6883
  return console.log(`找到 ${d.length} 个区域与视图相交`), d;
@@ -6891,217 +6910,217 @@ const Oi = (t) => {
6891
6910
  fetchGeoData: d,
6892
6911
  children: g
6893
6912
  }) => {
6894
- const m = ne(null), [c, u] = B(Yt), [k, C] = B(null), [b, M] = B(t), [v, x] = B([]), h = ne({}), [y, D] = B({}), [N, P] = B({}), [$, q] = B(!1), [T, O] = B([]), [R, W] = B({}), [se, Z] = B({}), [G, ee] = B(!1), [le, ge] = B([]), ae = re(
6913
+ const h = ne(null), [c, u] = B(Yt), [v, C] = B(null), [y, N] = B(t), [x, k] = B([]), m = ne({}), [b, M] = B({}), [S, R] = B({}), [_, X] = B(!1), [P, O] = B([]), [T, W] = B({}), [se, ee] = B({}), [q, Z] = B(!1), [ae, ce] = B([]), ie = re(
6895
6914
  () => d || ji,
6896
6915
  [d]
6897
- ), { run: ce } = ar(
6898
- (I) => ae(I),
6916
+ ), { run: de } = ar(
6917
+ (I) => ie(I),
6899
6918
  {
6900
6919
  manual: !0,
6901
6920
  onSuccess: (I) => {
6902
6921
  C(I);
6903
- const z = de(I);
6904
- x(z);
6922
+ const z = ue(I);
6923
+ k(z);
6905
6924
  },
6906
6925
  onError: (I) => {
6907
6926
  console.error("Failed to load geo data:", I);
6908
6927
  }
6909
6928
  }
6910
- ), de = fe((I) => {
6929
+ ), ue = ge((I) => {
6911
6930
  const z = [];
6912
- let w = 0, _ = 0;
6913
- return I.features.forEach((S) => {
6931
+ let w = 0, $ = 0;
6932
+ return I.features.forEach((L) => {
6914
6933
  var F;
6915
- if (S.properties)
6934
+ if (L.properties)
6916
6935
  try {
6917
- let H = S.properties.centroid || null;
6918
- !H && S.properties.center && (H = S.properties.center), H && S.properties.adcode && S.properties.name ? (z.push({
6919
- name: S.properties.name,
6936
+ let H = L.properties.centroid || null;
6937
+ !H && L.properties.center && (H = L.properties.center), H && L.properties.adcode && L.properties.name ? (z.push({
6938
+ name: L.properties.name,
6920
6939
  longitude: H[0],
6921
6940
  latitude: H[1],
6922
- code: S.properties.adcode
6923
- }), w++) : (_++, console.warn(
6924
- `Missing centroid/center data for ${S.properties.name || "unknown area"}:`,
6925
- S.properties.adcode || "unknown code"
6941
+ code: L.properties.adcode
6942
+ }), w++) : ($++, console.warn(
6943
+ `Missing centroid/center data for ${L.properties.name || "unknown area"}:`,
6944
+ L.properties.adcode || "unknown code"
6926
6945
  ));
6927
6946
  } catch (H) {
6928
- _++, console.error(
6947
+ $++, console.error(
6929
6948
  "Error processing centroid data for feature:",
6930
- ((F = S.properties) == null ? void 0 : F.name) || "unknown",
6949
+ ((F = L.properties) == null ? void 0 : F.name) || "unknown",
6931
6950
  H
6932
6951
  );
6933
6952
  }
6934
6953
  }), console.info(
6935
- `Centroid points collection: ${w} successful, ${_} failed`
6954
+ `Centroid points collection: ${w} successful, ${$} failed`
6936
6955
  ), z;
6937
- }, []), K = fe(
6956
+ }, []), K = ge(
6938
6957
  (I) => {
6939
6958
  if (I.length === 0)
6940
6959
  return;
6941
6960
  const z = Array.from(
6942
- new Set(I.map((S) => S.code))
6943
- ).map((S) => ({ name: I.find((H) => H.code === S).name, code: S }));
6944
- q((S) => S || !0);
6961
+ new Set(I.map((L) => L.code))
6962
+ ).map((L) => ({ name: I.find((H) => H.code === L).name, code: L }));
6963
+ X((L) => L || !0);
6945
6964
  const w = z.filter(
6946
- (S) => !T.includes(S.code) && !y[S.code]
6965
+ (L) => !P.includes(L.code) && !b[L.code]
6947
6966
  );
6948
6967
  if (w.length === 0)
6949
6968
  return;
6950
- console.debug(`开始加载${w.length}个省的市级数据`), O((S) => {
6969
+ console.debug(`开始加载${w.length}个省的市级数据`), O((L) => {
6951
6970
  const F = w.map((H) => H.code);
6952
- return [.../* @__PURE__ */ new Set([...S, ...F])];
6971
+ return [.../* @__PURE__ */ new Set([...L, ...F])];
6953
6972
  });
6954
- const _ = w.map(
6955
- (S) => ae(S.code).then((F) => {
6956
- D((ue) => ({
6957
- ...ue,
6958
- [S.code]: F
6973
+ const $ = w.map(
6974
+ (L) => ie(L.code).then((F) => {
6975
+ M((fe) => ({
6976
+ ...fe,
6977
+ [L.code]: F
6959
6978
  }));
6960
- const H = de(F);
6961
- return P((ue) => ({
6962
- ...ue,
6963
- [S.code]: H
6964
- })), { code: S.code, data: F };
6979
+ const H = ue(F);
6980
+ return R((fe) => ({
6981
+ ...fe,
6982
+ [L.code]: H
6983
+ })), { code: L.code, data: F };
6965
6984
  }).catch((F) => (console.error(
6966
- `Failed to load cities data for province ${S.name}:`,
6985
+ `Failed to load cities data for province ${L.name}:`,
6967
6986
  F
6968
6987
  ), null))
6969
6988
  );
6970
- Promise.all(_).then((S) => {
6971
- const F = S.filter(Boolean).map((H) => (H == null ? void 0 : H.code) || "");
6989
+ Promise.all($).then((L) => {
6990
+ const F = L.filter(Boolean).map((H) => (H == null ? void 0 : H.code) || "");
6972
6991
  O(
6973
- (H) => H.filter((ue) => !F.includes(ue))
6992
+ (H) => H.filter((fe) => !F.includes(fe))
6974
6993
  );
6975
6994
  });
6976
6995
  },
6977
6996
  [
6978
- T,
6979
- y,
6980
- de,
6981
- ae
6997
+ P,
6998
+ b,
6999
+ ue,
7000
+ ie
6982
7001
  ]
6983
- ), be = fe(
7002
+ ), be = ge(
6984
7003
  (I) => {
6985
7004
  if (I.length === 0)
6986
7005
  return;
6987
- const z = Array.from(new Set(I.map((S) => S.code))).map(
6988
- (S) => ({ name: I.find((H) => H.code === S).name, code: S })
7006
+ const z = Array.from(new Set(I.map((L) => L.code))).map(
7007
+ (L) => ({ name: I.find((H) => H.code === L).name, code: L })
6989
7008
  );
6990
- ee((S) => S || !0);
7009
+ Z((L) => L || !0);
6991
7010
  const w = z.filter(
6992
- (S) => !le.includes(S.code) && !R[S.code]
7011
+ (L) => !ae.includes(L.code) && !T[L.code]
6993
7012
  );
6994
7013
  if (w.length === 0)
6995
7014
  return;
6996
- console.debug(`开始加载${w.length}个城市的区级数据`), ge((S) => {
7015
+ console.debug(`开始加载${w.length}个城市的区级数据`), ce((L) => {
6997
7016
  const F = w.map((H) => H.code);
6998
- return [.../* @__PURE__ */ new Set([...S, ...F])];
7017
+ return [.../* @__PURE__ */ new Set([...L, ...F])];
6999
7018
  });
7000
- const _ = w.map(
7001
- (S) => ae(S.code).then((F) => {
7002
- W((ue) => ({
7003
- ...ue,
7004
- [S.code]: F
7019
+ const $ = w.map(
7020
+ (L) => ie(L.code).then((F) => {
7021
+ W((fe) => ({
7022
+ ...fe,
7023
+ [L.code]: F
7005
7024
  }));
7006
- const H = de(F);
7007
- return Z((ue) => ({
7008
- ...ue,
7009
- [S.code]: H
7010
- })), { code: S.code, data: F };
7025
+ const H = ue(F);
7026
+ return ee((fe) => ({
7027
+ ...fe,
7028
+ [L.code]: H
7029
+ })), { code: L.code, data: F };
7011
7030
  }).catch((F) => (console.error(
7012
- `Failed to load districts data for city ${S.name}:`,
7031
+ `Failed to load districts data for city ${L.name}:`,
7013
7032
  F
7014
7033
  ), null))
7015
7034
  );
7016
- Promise.all(_).then((S) => {
7017
- const F = S.filter(Boolean).map((H) => (H == null ? void 0 : H.code) || "");
7018
- ge(
7019
- (H) => H.filter((ue) => !F.includes(ue))
7035
+ Promise.all($).then((L) => {
7036
+ const F = L.filter(Boolean).map((H) => (H == null ? void 0 : H.code) || "");
7037
+ ce(
7038
+ (H) => H.filter((fe) => !F.includes(fe))
7020
7039
  );
7021
7040
  });
7022
7041
  },
7023
- [le, R, de, ae]
7024
- ), Q = re(() => $ ? Object.values(N).flat() : [], [N, $]), he = re(() => G ? Object.values(se).flat() : [], [se, G]), pe = fe(() => {
7025
- if (!m.current || !k)
7042
+ [ae, T, ue, ie]
7043
+ ), Q = re(() => _ ? Object.values(S).flat() : [], [S, _]), he = re(() => q ? Object.values(se).flat() : [], [se, q]), pe = ge(() => {
7044
+ if (!h.current || !v)
7026
7045
  return;
7027
- const I = m.current.getBounds(), z = {
7046
+ const I = h.current.getBounds(), z = {
7028
7047
  north: I.getNorth(),
7029
7048
  south: I.getSouth(),
7030
7049
  east: I.getEast(),
7031
7050
  west: I.getWest()
7032
7051
  };
7033
- if (h.current.bounds && Math.abs(h.current.bounds.north - z.north) < 1e-4 && Math.abs(h.current.bounds.south - z.south) < 1e-4 && Math.abs(h.current.bounds.east - z.east) < 1e-4 && Math.abs(h.current.bounds.west - z.west) < 1e-4)
7052
+ if (m.current.bounds && Math.abs(m.current.bounds.north - z.north) < 1e-4 && Math.abs(m.current.bounds.south - z.south) < 1e-4 && Math.abs(m.current.bounds.east - z.east) < 1e-4 && Math.abs(m.current.bounds.west - z.west) < 1e-4)
7034
7053
  return;
7035
7054
  const w = Fi(
7036
- m.current,
7037
- k,
7038
- v
7055
+ h.current,
7056
+ v,
7057
+ x
7039
7058
  );
7040
- if (h.current = {
7059
+ if (m.current = {
7041
7060
  bounds: z,
7042
7061
  visibleAreasCount: w.length,
7043
- zoom: b
7044
- }, console.debug("计算结果:", w.length, "个区域在视图内"), l && l(w), b > p) {
7045
- q(!0), ee(!0), K(w);
7046
- const _ = Object.values(N).flat().filter(
7047
- (S) => {
7062
+ zoom: y
7063
+ }, console.debug("计算结果:", w.length, "个区域在视图内"), l && l(w), y > p) {
7064
+ X(!0), Z(!0), K(w);
7065
+ const $ = Object.values(S).flat().filter(
7066
+ (L) => {
7048
7067
  var F;
7049
- return (F = m.current) == null ? void 0 : F.getBounds().contains([S.longitude, S.latitude]);
7068
+ return (F = h.current) == null ? void 0 : F.getBounds().contains([L.longitude, L.latitude]);
7050
7069
  }
7051
7070
  );
7052
- _.length > 0 && (console.debug(`加载${_.length}个城市的区级数据`), be(_));
7053
- } else b > f ? (q(!0), ee(!1), K(w)) : (q(!1), ee(!1));
7071
+ $.length > 0 && (console.debug(`加载${$.length}个城市的区级数据`), be($));
7072
+ } else y > f ? (X(!0), Z(!1), K(w)) : (X(!1), Z(!1));
7054
7073
  }, [
7055
- m,
7056
- k,
7074
+ h,
7057
7075
  v,
7076
+ x,
7058
7077
  l,
7059
- b,
7078
+ y,
7060
7079
  K,
7061
7080
  be,
7062
- N,
7081
+ S,
7063
7082
  f,
7064
7083
  p
7065
7084
  ]);
7066
7085
  V(() => {
7067
- ce(c);
7068
- }, [c, ce]), V(() => {
7069
- if (m.current && v.length > 0) {
7086
+ de(c);
7087
+ }, [c, de]), V(() => {
7088
+ if (h.current && x.length > 0) {
7070
7089
  const I = requestAnimationFrame(() => {
7071
7090
  pe();
7072
7091
  });
7073
7092
  return () => cancelAnimationFrame(I);
7074
7093
  }
7075
- }, [m, v.length, pe]), V(() => {
7094
+ }, [h, x.length, pe]), V(() => {
7076
7095
  const I = setTimeout(() => {
7077
7096
  pe();
7078
7097
  }, 50);
7079
7098
  return () => clearTimeout(I);
7080
- }, [b, pe]);
7081
- const ke = fe(
7099
+ }, [y, pe]);
7100
+ const ke = ge(
7082
7101
  (I) => {
7083
- const z = I.viewState.zoom, w = h.current.zoom || b, _ = Math.abs(z - w) >= 5e-3;
7084
- if (m.current) {
7085
- const S = m.current.getBounds(), F = {
7086
- north: S.getNorth(),
7087
- south: S.getSouth(),
7088
- east: S.getEast(),
7089
- west: S.getWest()
7090
- }, H = !h.current.bounds || Math.abs(h.current.bounds.north - F.north) >= 1e-3 || Math.abs(h.current.bounds.south - F.south) >= 1e-3 || Math.abs(h.current.bounds.east - F.east) >= 1e-3 || Math.abs(h.current.bounds.west - F.west) >= 1e-3;
7091
- if (_) {
7092
- M(z), h.current.zoom = z;
7093
- let ue = 6;
7102
+ const z = I.viewState.zoom, w = m.current.zoom || y, $ = Math.abs(z - w) >= 5e-3;
7103
+ if (h.current) {
7104
+ const L = h.current.getBounds(), F = {
7105
+ north: L.getNorth(),
7106
+ south: L.getSouth(),
7107
+ east: L.getEast(),
7108
+ west: L.getWest()
7109
+ }, H = !m.current.bounds || Math.abs(m.current.bounds.north - F.north) >= 1e-3 || Math.abs(m.current.bounds.south - F.south) >= 1e-3 || Math.abs(m.current.bounds.east - F.east) >= 1e-3 || Math.abs(m.current.bounds.west - F.west) >= 1e-3;
7110
+ if ($) {
7111
+ N(z), m.current.zoom = z;
7112
+ let fe = 6;
7094
7113
  for (const [qe, qo] of Object.entries(r))
7095
- z >= qo && (ue = parseInt(qe, 10));
7096
- c.length !== ue && u(Yt);
7114
+ z >= qo && (fe = parseInt(qe, 10));
7115
+ c.length !== fe && u(Yt);
7097
7116
  }
7098
- (H || _) && pe();
7117
+ (H || $) && pe();
7099
7118
  }
7100
7119
  },
7101
- [c, r, b, pe]
7102
- ), ze = fe(() => {
7103
- v.length > 0 && m.current && pe();
7104
- }, [v, pe]), U = re(
7120
+ [c, r, y, pe]
7121
+ ), ze = ge(() => {
7122
+ x.length > 0 && h.current && pe();
7123
+ }, [x, pe]), U = re(
7105
7124
  () => ({
7106
7125
  "fill-color": "#e2e8f0",
7107
7126
  "fill-opacity": 0.6,
@@ -7115,16 +7134,16 @@ const Oi = (t) => {
7115
7134
  "line-opacity": 0.9
7116
7135
  }),
7117
7136
  []
7118
- ), Y = re(
7137
+ ), G = re(
7119
7138
  () => ({
7120
7139
  "line-color": "#64748b",
7121
7140
  "line-width": 1.2,
7122
7141
  "line-opacity": 0.8
7123
7142
  }),
7124
7143
  []
7125
- ), j = re(() => k && /* @__PURE__ */ A(vt, { id: "geojson-data", type: "geojson", data: k, children: [
7144
+ ), j = re(() => v && /* @__PURE__ */ A(vt, { id: "geojson-data", type: "geojson", data: v, children: [
7126
7145
  /* @__PURE__ */ s(je, { id: "geojson-layer", type: "fill", paint: U }),
7127
- ($ || G) && /* @__PURE__ */ s(
7146
+ (_ || q) && /* @__PURE__ */ s(
7128
7147
  je,
7129
7148
  {
7130
7149
  id: "province-border-layer",
@@ -7133,12 +7152,12 @@ const Oi = (t) => {
7133
7152
  }
7134
7153
  )
7135
7154
  ] }), [
7136
- k,
7155
+ v,
7137
7156
  U,
7138
7157
  te,
7139
- $,
7140
- G
7141
- ]), oe = re(() => $ ? Object.entries(y).map(([I, z]) => /* @__PURE__ */ A(
7158
+ _,
7159
+ q
7160
+ ]), oe = re(() => _ ? Object.entries(b).map(([I, z]) => /* @__PURE__ */ A(
7142
7161
  vt,
7143
7162
  {
7144
7163
  id: `city-source-${I}`,
@@ -7157,18 +7176,18 @@ const Oi = (t) => {
7157
7176
  }
7158
7177
  }
7159
7178
  ),
7160
- G && /* @__PURE__ */ s(
7179
+ q && /* @__PURE__ */ s(
7161
7180
  je,
7162
7181
  {
7163
7182
  id: `city-border-layer-${I}`,
7164
7183
  type: "line",
7165
- paint: Y
7184
+ paint: G
7166
7185
  }
7167
7186
  )
7168
7187
  ]
7169
7188
  },
7170
7189
  `city-source-${I}`
7171
- )) : null, [$, G, y, Y]), J = re(() => G ? Object.entries(R).map(
7190
+ )) : null, [_, q, b, G]), J = re(() => q ? Object.entries(T).map(
7172
7191
  ([I, z]) => /* @__PURE__ */ A(
7173
7192
  vt,
7174
7193
  {
@@ -7204,7 +7223,7 @@ const Oi = (t) => {
7204
7223
  },
7205
7224
  `district-source-${I}`
7206
7225
  )
7207
- ) : null, [G, R]);
7226
+ ) : null, [q, T]);
7208
7227
  return /* @__PURE__ */ s(
7209
7228
  "div",
7210
7229
  {
@@ -7213,7 +7232,7 @@ const Oi = (t) => {
7213
7232
  children: /* @__PURE__ */ A(
7214
7233
  zi,
7215
7234
  {
7216
- ref: m,
7235
+ ref: h,
7217
7236
  initialViewState: {
7218
7237
  longitude: e,
7219
7238
  latitude: o,
@@ -7229,9 +7248,9 @@ const Oi = (t) => {
7229
7248
  oe,
7230
7249
  J,
7231
7250
  " ",
7232
- v.map((I) => {
7233
- const z = $ && Object.keys(y).some((w) => w === I.code);
7234
- return !$ || !z ? /* @__PURE__ */ s(
7251
+ x.map((I) => {
7252
+ const z = _ && Object.keys(b).some((w) => w === I.code);
7253
+ return !_ || !z ? /* @__PURE__ */ s(
7235
7254
  xt,
7236
7255
  {
7237
7256
  longitude: I.longitude,
@@ -7244,11 +7263,11 @@ const Oi = (t) => {
7244
7263
  `province-${I.code}`
7245
7264
  ) : null;
7246
7265
  }),
7247
- $ && Q.map((I) => {
7248
- const z = G && Object.keys(R).some(
7266
+ _ && Q.map((I) => {
7267
+ const z = q && Object.keys(T).some(
7249
7268
  (w) => w === I.code
7250
7269
  );
7251
- return !G || !z ? /* @__PURE__ */ s(
7270
+ return !q || !z ? /* @__PURE__ */ s(
7252
7271
  xt,
7253
7272
  {
7254
7273
  longitude: I.longitude,
@@ -7261,7 +7280,7 @@ const Oi = (t) => {
7261
7280
  `city-${I.code}`
7262
7281
  ) : null;
7263
7282
  }),
7264
- G && he.map((I) => /* @__PURE__ */ s(
7283
+ q && he.map((I) => /* @__PURE__ */ s(
7265
7284
  xt,
7266
7285
  {
7267
7286
  longitude: I.longitude,