bi-components-library 1.0.27 → 1.0.29

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.es.js CHANGED
@@ -1,19 +1,19 @@
1
- import { jsx as m, jsxs as W, Fragment as Ue } from "react/jsx-runtime";
2
- import { useState as X, useRef as j, useMemo as Oe, useCallback as U, useEffect as ae, useLayoutEffect as Re } from "react";
3
- import { Button as ge, Card as Be, Modal as Xe, Table as _e, Flex as He, Spin as Je, Empty as Qe, Select as Ge, Form as Ce, Input as Fe, Space as Ye, Dropdown as Ze, Tooltip as et, Progress as tt, Pagination as nt, theme as at } from "antd";
4
- import { createFromIconfontCN as rt, LeftOutlined as ot, SearchOutlined as lt, ReloadOutlined as st, InfoCircleOutlined as it, SendOutlined as ct, PauseCircleOutlined as ut, PlayCircleOutlined as dt } from "@ant-design/icons";
5
- import { createPortal as pt } from "react-dom";
6
- const ft = ({
1
+ import { jsx as E, jsxs as Z, Fragment as Ze } from "react/jsx-runtime";
2
+ import { useState as ne, useRef as Q, useMemo as Ye, useCallback as ae, useEffect as de, useLayoutEffect as ze } from "react";
3
+ import { Button as $e, Card as Oe, Modal as et, Table as Re, Flex as We, Spin as tt, Empty as nt, Select as Ge, Form as _e, Input as Ke, Space as at, DatePicker as rt, Dropdown as ot, Tooltip as st, Progress as it, Pagination as lt, theme as ct } from "antd";
4
+ import { createFromIconfontCN as ut, LeftOutlined as dt, SearchOutlined as pt, ReloadOutlined as ft, InfoCircleOutlined as yt, SendOutlined as mt, PauseCircleOutlined as ht, PlayCircleOutlined as gt } from "@ant-design/icons";
5
+ import { createPortal as Xe } from "react-dom";
6
+ const vt = ({
7
7
  variant: t = "primary",
8
- loading: y = !1,
9
- children: u,
8
+ loading: x = !1,
9
+ children: d,
10
10
  ...i
11
- }) => /* @__PURE__ */ m(
12
- ge,
11
+ }) => /* @__PURE__ */ E(
12
+ $e,
13
13
  {
14
14
  ...i,
15
- type: ((k) => {
16
- switch (k) {
15
+ type: ((T) => {
16
+ switch (T) {
17
17
  case "primary":
18
18
  return "primary";
19
19
  case "ghost":
@@ -28,12 +28,12 @@ const ft = ({
28
28
  return "primary";
29
29
  }
30
30
  })(t),
31
- loading: y,
31
+ loading: x,
32
32
  ghost: t === "ghost",
33
- children: u
33
+ children: d
34
34
  }
35
35
  );
36
- ft.__docgenInfo = {
36
+ vt.__docgenInfo = {
37
37
  displayName: "Button",
38
38
  description: "基础按钮,用于触发操作",
39
39
  props: {
@@ -77,25 +77,25 @@ ft.__docgenInfo = {
77
77
  }
78
78
  }
79
79
  };
80
- const yt = ({
80
+ const bt = ({
81
81
  title: t,
82
- children: y,
83
- bordered: u = !0,
82
+ children: x,
83
+ bordered: d = !0,
84
84
  hoverable: i = !1,
85
- size: c = "default",
86
- ...k
87
- }) => /* @__PURE__ */ m(
88
- Be,
85
+ size: u = "default",
86
+ ...T
87
+ }) => /* @__PURE__ */ E(
88
+ Oe,
89
89
  {
90
- ...k,
90
+ ...T,
91
91
  title: t,
92
- bordered: u,
92
+ bordered: d,
93
93
  hoverable: i,
94
- size: c,
95
- children: y
94
+ size: u,
95
+ children: x
96
96
  }
97
97
  );
98
- yt.__docgenInfo = {
98
+ bt.__docgenInfo = {
99
99
  displayName: "Card",
100
100
  description: "卡片容器,用于分组内容",
101
101
  props: {
@@ -146,23 +146,23 @@ yt.__docgenInfo = {
146
146
  }
147
147
  }
148
148
  };
149
- const mt = ({
149
+ const xt = ({
150
150
  showDefaultFooter: t = !0,
151
- ...y
151
+ ...x
152
152
  }) => {
153
- const u = y.footer !== void 0 ? y.footer : t ? (i, { OkBtn: c, CancelBtn: k }) => /* @__PURE__ */ W(Ue, { children: [
154
- /* @__PURE__ */ m(c, {}),
155
- /* @__PURE__ */ m(k, {})
153
+ const d = x.footer !== void 0 ? x.footer : t ? (i, { OkBtn: u, CancelBtn: T }) => /* @__PURE__ */ Z(Ze, { children: [
154
+ /* @__PURE__ */ E(u, {}),
155
+ /* @__PURE__ */ E(T, {})
156
156
  ] }) : null;
157
- return /* @__PURE__ */ m(
158
- Xe,
157
+ return /* @__PURE__ */ E(
158
+ et,
159
159
  {
160
- ...y,
161
- footer: u
160
+ ...x,
161
+ footer: d
162
162
  }
163
163
  );
164
164
  };
165
- mt.__docgenInfo = {
165
+ xt.__docgenInfo = {
166
166
  displayName: "AppModal",
167
167
  description: "应用级模态框组件,基于 Ant Design Modal 封装",
168
168
  props: {
@@ -223,29 +223,29 @@ mt.__docgenInfo = {
223
223
  }
224
224
  }
225
225
  };
226
- const gt = ({
226
+ const kt = ({
227
227
  scrollX: t,
228
- showPagination: y = !0,
229
- defaultPageSize: u = 10,
228
+ showPagination: x = !0,
229
+ defaultPageSize: d = 10,
230
230
  ...i
231
- }) => /* @__PURE__ */ m(
232
- _e,
231
+ }) => /* @__PURE__ */ E(
232
+ Re,
233
233
  {
234
234
  ...i,
235
235
  scroll: {
236
236
  x: t || "max-content",
237
237
  y: "50vh"
238
238
  },
239
- pagination: y ? {
239
+ pagination: x ? {
240
240
  hideOnSinglePage: !0,
241
241
  showSizeChanger: !0,
242
242
  showQuickJumper: !0,
243
- defaultPageSize: u,
243
+ defaultPageSize: d,
244
244
  ...i.pagination
245
245
  } : !1
246
246
  }
247
247
  );
248
- gt.__docgenInfo = {
248
+ kt.__docgenInfo = {
249
249
  displayName: "PageTable",
250
250
  description: "页面级表格组件,高度铺满容器,自动滚动",
251
251
  props: {
@@ -295,30 +295,30 @@ gt.__docgenInfo = {
295
295
  }
296
296
  }
297
297
  };
298
- const ht = rt({
298
+ const wt = ut({
299
299
  scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
300
- }), vt = ({
300
+ }), Et = ({
301
301
  name: t,
302
- size: y,
303
- color: u,
302
+ size: x,
303
+ color: d,
304
304
  style: i,
305
- ...c
305
+ ...u
306
306
  }) => {
307
- const k = {
308
- fontSize: y,
309
- color: u,
307
+ const T = {
308
+ fontSize: x,
309
+ color: d,
310
310
  ...i
311
311
  };
312
- return /* @__PURE__ */ m(
313
- ht,
312
+ return /* @__PURE__ */ E(
313
+ wt,
314
314
  {
315
- ...c,
315
+ ...u,
316
316
  type: t,
317
- style: k
317
+ style: T
318
318
  }
319
319
  );
320
320
  };
321
- vt.__docgenInfo = {
321
+ Et.__docgenInfo = {
322
322
  displayName: "XcIcon",
323
323
  description: "自定义图标组件,基于 iconfont",
324
324
  props: {
@@ -354,43 +354,43 @@ vt.__docgenInfo = {
354
354
  }
355
355
  }
356
356
  };
357
- const xt = ({
357
+ const $t = ({
358
358
  loading: t,
359
- description: y = "暂无数据",
360
- className: u,
359
+ description: x = "暂无数据",
360
+ className: d,
361
361
  emptyChildren: i,
362
- loadingText: c,
363
- emptyImage: k
364
- }) => t ? /* @__PURE__ */ W(
365
- He,
362
+ loadingText: u,
363
+ emptyImage: T
364
+ }) => t ? /* @__PURE__ */ Z(
365
+ We,
366
366
  {
367
- className: `pt-10 w-full ${u || ""}`,
367
+ className: `pt-10 w-full ${d || ""}`,
368
368
  align: "center",
369
369
  justify: "center",
370
370
  vertical: !0,
371
371
  children: [
372
- /* @__PURE__ */ m(Je, { size: "large" }),
373
- c && /* @__PURE__ */ m("div", { className: "mt-4 text-gray-500", children: c })
372
+ /* @__PURE__ */ E(tt, { size: "large" }),
373
+ u && /* @__PURE__ */ E("div", { className: "mt-4 text-gray-500", children: u })
374
374
  ]
375
375
  }
376
- ) : /* @__PURE__ */ m(
377
- He,
376
+ ) : /* @__PURE__ */ E(
377
+ We,
378
378
  {
379
- className: `pt-10 w-full ${u || ""}`,
379
+ className: `pt-10 w-full ${d || ""}`,
380
380
  align: "center",
381
381
  justify: "center",
382
- children: /* @__PURE__ */ m(
383
- Qe,
382
+ children: /* @__PURE__ */ E(
383
+ nt,
384
384
  {
385
- image: k,
386
- description: y,
385
+ image: T,
386
+ description: x,
387
387
  imageStyle: { height: 180 },
388
388
  children: i
389
389
  }
390
390
  )
391
391
  }
392
392
  );
393
- xt.__docgenInfo = {
393
+ $t.__docgenInfo = {
394
394
  displayName: "EmptyAndSpin",
395
395
  description: "空状态和加载状态组合组件",
396
396
  props: {
@@ -433,24 +433,24 @@ xt.__docgenInfo = {
433
433
  }
434
434
  }
435
435
  };
436
- const bt = ({
436
+ const Ct = ({
437
437
  onClick: t,
438
- showText: y = !1,
439
- className: u,
438
+ showText: x = !1,
439
+ className: d,
440
440
  size: i = "small",
441
- type: c = "default"
442
- }) => /* @__PURE__ */ m(
443
- ge,
441
+ type: u = "default"
442
+ }) => /* @__PURE__ */ E(
443
+ $e,
444
444
  {
445
445
  size: i,
446
- type: c,
447
- icon: /* @__PURE__ */ m(ot, {}),
448
- className: `cursor-pointer ${u || ""}`,
446
+ type: u,
447
+ icon: /* @__PURE__ */ E(dt, {}),
448
+ className: `cursor-pointer ${d || ""}`,
449
449
  onClick: t,
450
- children: y && "返回"
450
+ children: x && "返回"
451
451
  }
452
452
  );
453
- bt.__docgenInfo = {
453
+ Ct.__docgenInfo = {
454
454
  displayName: "BackButton",
455
455
  description: "返回按钮组件",
456
456
  props: {
@@ -489,23 +489,23 @@ bt.__docgenInfo = {
489
489
  }
490
490
  }
491
491
  };
492
- const kt = ({
492
+ const Tt = ({
493
493
  removePadding: t = !0,
494
- className: y,
495
- ...u
494
+ className: x,
495
+ ...d
496
496
  }) => {
497
- const i = t ? `px-0 h-auto ${y || ""}` : y;
498
- return /* @__PURE__ */ m(
499
- ge,
497
+ const i = t ? `px-0 h-auto ${x || ""}` : x;
498
+ return /* @__PURE__ */ E(
499
+ $e,
500
500
  {
501
501
  type: "link",
502
- ...u,
502
+ ...d,
503
503
  className: i,
504
- children: u.children
504
+ children: d.children
505
505
  }
506
506
  );
507
507
  };
508
- kt.__docgenInfo = {
508
+ Tt.__docgenInfo = {
509
509
  displayName: "LinkButton",
510
510
  description: "链接样式按钮组件,适用于表格操作列",
511
511
  props: {
@@ -542,129 +542,129 @@ kt.__docgenInfo = {
542
542
  }
543
543
  }
544
544
  };
545
- const { Option: wt } = Ge, Et = ({
545
+ const { Option: qt } = Ge, Nt = ({
546
546
  columns: t,
547
- request: y,
548
- searchFields: u = [],
547
+ request: x,
548
+ searchFields: d = [],
549
549
  showSearch: i = !0,
550
- showRefresh: c = !0,
551
- defaultPageSize: k = 10,
552
- pageSizeOptions: L = ["10", "20", "50", "100"],
553
- autoLoad: E = !0,
554
- externalParams: C = {},
550
+ showRefresh: u = !0,
551
+ defaultPageSize: T = 10,
552
+ pageSizeOptions: I = ["10", "20", "50", "100"],
553
+ autoLoad: $ = !0,
554
+ externalParams: w = {},
555
555
  ...e
556
556
  }) => {
557
- const [A, g] = X([]), [l, a] = X(!1), [n, o] = X({
557
+ const [q, f] = ne([]), [s, r] = ne(!1), [n, o] = ne({
558
558
  current: 1,
559
- pageSize: k,
559
+ pageSize: T,
560
560
  total: 0
561
- }), [r, s] = X({}), [d, h] = X({}), [x] = Ce.useForm(), G = j(n);
562
- G.current = n;
563
- const T = j(C);
564
- T.current = C;
565
- const _ = j(!1), H = Oe(() => t.map((N) => {
566
- const { sortable: M, render: ne, ...re } = N;
561
+ }), [a, p] = ne({}), [y, g] = ne({}), [b] = _e.useForm(), V = Q(n);
562
+ V.current = n;
563
+ const k = Q(w);
564
+ k.current = w;
565
+ const P = Q(!1), H = Ye(() => t.map((l) => {
566
+ const { sortable: c, render: v, ...L } = l;
567
567
  return {
568
- ...re,
569
- sorter: M ? !0 : void 0,
570
- render: ne || ((ce) => ce)
568
+ ...L,
569
+ sorter: c ? !0 : void 0,
570
+ render: v || ((N) => N)
571
571
  };
572
- }), [t]), D = U(async (N = {}) => {
573
- if (y) {
574
- a(!0);
572
+ }), [t]), F = ae(async (l = {}) => {
573
+ if (x) {
574
+ r(!0);
575
575
  try {
576
- const M = {
577
- page: G.current.current,
578
- pageSize: G.current.pageSize,
579
- sortField: d.field,
580
- sortOrder: d.order,
581
- searchParams: { ...r, ...T.current },
582
- ...N
583
- }, ne = await y(M);
584
- ne.success && (g(ne.data), o((re) => ({
585
- ...re,
586
- total: ne.total,
587
- current: M.page || re.current
576
+ const c = {
577
+ page: V.current.current,
578
+ pageSize: V.current.pageSize,
579
+ sortField: y.field,
580
+ sortOrder: y.order,
581
+ searchParams: { ...a, ...k.current },
582
+ ...l
583
+ }, v = await x(c);
584
+ v.success && (f(v.data), o((L) => ({
585
+ ...L,
586
+ total: v.total,
587
+ current: c.page || L.current
588
588
  })));
589
- } catch (M) {
590
- console.error("加载数据失败:", M);
589
+ } catch (c) {
590
+ console.error("加载数据失败:", c);
591
591
  } finally {
592
- a(!1);
592
+ r(!1);
593
593
  }
594
594
  }
595
- }, [y, d, r]), K = U((N) => {
596
- s(N), o((M) => ({ ...M, current: 1 }));
597
- }, []), Q = U(() => {
598
- x.resetFields(), s({}), o((N) => ({ ...N, current: 1 }));
599
- }, [x]), Y = U(() => {
600
- D();
601
- }, [D]), te = U((N, M, ne) => {
602
- const re = {
603
- current: N.current || 1,
604
- pageSize: N.pageSize || k,
605
- total: N.total || 0
606
- }, ce = {
607
- field: ne?.field,
608
- order: ne?.order
595
+ }, [x, y, a]), U = ae((l) => {
596
+ p(l), o((c) => ({ ...c, current: 1 }));
597
+ }, []), R = ae(() => {
598
+ b.resetFields(), p({}), o((l) => ({ ...l, current: 1 }));
599
+ }, [b]), ee = ae(() => {
600
+ F();
601
+ }, [F]), re = ae((l, c, v) => {
602
+ const L = {
603
+ current: l.current || 1,
604
+ pageSize: l.pageSize || T,
605
+ total: l.total || 0
606
+ }, N = {
607
+ field: v?.field,
608
+ order: v?.order
609
609
  };
610
- o(re), h(ce);
611
- }, [k]);
612
- return ae(() => {
613
- const N = Object.keys(C).length > 0;
614
- (E && !_.current || N) && (D(), _.current = !0);
615
- }, [E, C, D]), /* @__PURE__ */ W("div", { children: [
616
- i && u.length > 0 && /* @__PURE__ */ m(Be, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ W(
617
- Ce,
610
+ o(L), g(N);
611
+ }, [T]);
612
+ return de(() => {
613
+ const l = Object.keys(w).length > 0;
614
+ ($ && !P.current || l) && (F(), P.current = !0);
615
+ }, [$, w, F]), /* @__PURE__ */ Z("div", { children: [
616
+ i && d.length > 0 && /* @__PURE__ */ E(Oe, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ Z(
617
+ _e,
618
618
  {
619
- form: x,
619
+ form: b,
620
620
  layout: "inline",
621
- onFinish: K,
622
- initialValues: u.reduce((N, M) => (M.defaultValue !== void 0 && (N[M.key] = M.defaultValue), N), {}),
621
+ onFinish: U,
622
+ initialValues: d.reduce((l, c) => (c.defaultValue !== void 0 && (l[c.key] = c.defaultValue), l), {}),
623
623
  children: [
624
- u.map((N) => /* @__PURE__ */ m(Ce.Item, { name: N.key, label: N.label, children: N.type === "input" ? /* @__PURE__ */ m(
625
- Fe,
624
+ d.map((l) => /* @__PURE__ */ E(_e.Item, { name: l.key, label: l.label, children: l.type === "input" ? /* @__PURE__ */ E(
625
+ Ke,
626
626
  {
627
- placeholder: N.placeholder || `请输入${N.label}`,
627
+ placeholder: l.placeholder || `请输入${l.label}`,
628
628
  style: { width: 200 }
629
629
  }
630
- ) : /* @__PURE__ */ m(
630
+ ) : /* @__PURE__ */ E(
631
631
  Ge,
632
632
  {
633
- placeholder: N.placeholder || `请选择${N.label}`,
633
+ placeholder: l.placeholder || `请选择${l.label}`,
634
634
  style: { width: 200 },
635
635
  allowClear: !0,
636
- children: N.options?.map((M) => /* @__PURE__ */ m(wt, { value: M.value, children: M.label }, M.value))
636
+ children: l.options?.map((c) => /* @__PURE__ */ E(qt, { value: c.value, children: c.label }, c.value))
637
637
  }
638
- ) }, N.key)),
639
- /* @__PURE__ */ m(Ce.Item, { children: /* @__PURE__ */ W(Ye, { children: [
640
- /* @__PURE__ */ m(ge, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ m(lt, {}), children: "查询" }),
641
- /* @__PURE__ */ m(ge, { onClick: Q, children: "重置" }),
642
- c && /* @__PURE__ */ m(ge, { icon: /* @__PURE__ */ m(st, {}), onClick: Y, children: "刷新" })
638
+ ) }, l.key)),
639
+ /* @__PURE__ */ E(_e.Item, { children: /* @__PURE__ */ Z(at, { children: [
640
+ /* @__PURE__ */ E($e, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ E(pt, {}), children: "查询" }),
641
+ /* @__PURE__ */ E($e, { onClick: R, children: "重置" }),
642
+ u && /* @__PURE__ */ E($e, { icon: /* @__PURE__ */ E(ft, {}), onClick: ee, children: "刷新" })
643
643
  ] }) })
644
644
  ]
645
645
  }
646
646
  ) }),
647
- /* @__PURE__ */ m(
648
- _e,
647
+ /* @__PURE__ */ E(
648
+ Re,
649
649
  {
650
650
  ...e,
651
651
  columns: H,
652
- dataSource: A,
653
- loading: l,
652
+ dataSource: q,
653
+ loading: s,
654
654
  pagination: {
655
655
  ...n,
656
656
  showSizeChanger: !0,
657
657
  showQuickJumper: !0,
658
- showTotal: (N, M) => `第 ${M[0]}-${M[1]} 条/共 ${N} 条`,
659
- pageSizeOptions: L
658
+ showTotal: (l, c) => `第 ${c[0]}-${c[1]} 条/共 ${l} 条`,
659
+ pageSizeOptions: I
660
660
  },
661
- onChange: te,
661
+ onChange: re,
662
662
  scroll: { x: "max-content", y: "50vh" }
663
663
  }
664
664
  )
665
665
  ] });
666
666
  };
667
- Et.__docgenInfo = {
667
+ Nt.__docgenInfo = {
668
668
  displayName: "AdvancedTable",
669
669
  description: "高阶表格组件,支持异步请求、搜索、排序等功能",
670
670
  props: {
@@ -731,1579 +731,1965 @@ Et.__docgenInfo = {
731
731
  }
732
732
  }
733
733
  };
734
- function Te(t, y, u) {
734
+ function Be(t, x, d) {
735
735
  if (!t.current) return;
736
- const i = /* @__PURE__ */ new Set(), c = {};
737
- for (const g of y)
738
- g.exclusionGroup && g.exclusionGroup !== "separator" && (i.add(g.exclusionGroup), c[g.exclusionGroup] || (c[g.exclusionGroup] = []), c[g.exclusionGroup].push({
739
- type: g.type,
740
- key: g.key,
741
- exclusionGroup: g.exclusionGroup
736
+ const i = /* @__PURE__ */ new Set(), u = {};
737
+ for (const f of x)
738
+ f.exclusionGroup && f.exclusionGroup !== "separator" && (i.add(f.exclusionGroup), u[f.exclusionGroup] || (u[f.exclusionGroup] = []), u[f.exclusionGroup].push({
739
+ type: f.type,
740
+ key: f.key,
741
+ exclusionGroup: f.exclusionGroup
742
742
  }));
743
- const k = {};
744
- for (const g of i) {
745
- k[g] = !1;
746
- for (const l of c[g])
747
- if (l.type === "upload" && l.key) {
748
- if (u[l.key] !== null && u[l.key] !== void 0) {
749
- k[g] = !0;
743
+ const T = {};
744
+ for (const f of i) {
745
+ T[f] = !1;
746
+ for (const s of u[f])
747
+ if (s.type === "upload" && s.key) {
748
+ if (d[s.key] !== null && d[s.key] !== void 0) {
749
+ T[f] = !0;
750
750
  break;
751
751
  }
752
- } else if (l.type === "variable" && l.key) {
753
- const a = t.current.querySelector(
754
- `[data-type="variable"][data-key="${l.key}"]`
752
+ } else if (s.type === "variable" && s.key) {
753
+ const r = t.current.querySelector(
754
+ `[data-type="variable"][data-key="${s.key}"]`
755
755
  );
756
- if (a && a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
757
- k[g] = !0;
756
+ if (r && r.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
757
+ T[f] = !0;
758
758
  break;
759
759
  }
760
760
  }
761
761
  }
762
- const L = y.some((g) => g.exclusionGroup === "separator"), C = Object.keys(k).filter(
763
- (g) => k[g]
762
+ const I = x.some((f) => f.exclusionGroup === "separator"), w = Object.keys(T).filter(
763
+ (f) => T[f]
764
764
  ).length > 0;
765
765
  let e = null;
766
- if (C && L) {
767
- for (const g of y)
768
- if (g.exclusionGroup && g.exclusionGroup !== "separator" && k[g.exclusionGroup]) {
769
- e = g.exclusionGroup;
766
+ if (w && I) {
767
+ for (const f of x)
768
+ if (f.exclusionGroup && f.exclusionGroup !== "separator" && T[f.exclusionGroup]) {
769
+ e = f.exclusionGroup;
770
770
  break;
771
771
  }
772
772
  }
773
- for (const g of i) {
774
- const l = t.current.querySelectorAll(
775
- `[data-group="${g}"]`
773
+ for (const f of i) {
774
+ const s = t.current.querySelectorAll(
775
+ `[data-group="${f}"]`
776
776
  );
777
- L && C && e ? g === e ? l.forEach((a) => {
778
- a.classList.contains("required-upload-group") ? a.style.setProperty("display", "inline-flex", "important") : (a.classList.contains("exclusion-wrapper"), a.style.setProperty("display", "inline-block", "important"));
779
- }) : l.forEach((a) => {
780
- a.style.display = "none", a.style.setProperty("display", "none", "important");
781
- }) : l.forEach((a) => {
782
- a.classList.contains("required-upload-group") ? a.style.setProperty("display", "inline-flex", "important") : (a.classList.contains("exclusion-wrapper"), a.style.setProperty("display", "inline-block", "important"));
777
+ I && w && e ? f === e ? s.forEach((r) => {
778
+ r.classList.contains("required-upload-group") ? r.style.setProperty("display", "inline-flex", "important") : (r.classList.contains("exclusion-wrapper"), r.style.setProperty("display", "inline-block", "important"));
779
+ }) : s.forEach((r) => {
780
+ r.style.display = "none", r.style.setProperty("display", "none", "important");
781
+ }) : s.forEach((r) => {
782
+ r.classList.contains("required-upload-group") ? r.style.setProperty("display", "inline-flex", "important") : (r.classList.contains("exclusion-wrapper"), r.style.setProperty("display", "inline-block", "important"));
783
783
  });
784
784
  }
785
785
  t.current.querySelectorAll(
786
786
  '[data-group="separator"]'
787
- ).forEach((g) => {
788
- g.style.display = C ? "none" : "inline";
787
+ ).forEach((f) => {
788
+ f.style.display = w ? "none" : "inline";
789
789
  });
790
790
  }
791
- function $e(t, y, u, i) {
791
+ function Pe(t, x, d, i) {
792
792
  if (!t.current) {
793
793
  i(!1);
794
794
  return;
795
795
  }
796
- const c = [];
797
- for (let l = 0; l < y.length; l++) {
798
- const a = y[l];
799
- if ((a.type === "variable" || a.type === "upload" || a.type === "multi-variable" || a.type === "select" || a.type === "textarea" || a.type === "richtext" || a.type === "datepicker") && a.required && a.key) {
800
- c.push({
801
- exclusionGroup: a.exclusionGroup || "",
802
- key: a.key,
803
- type: a.type === "multi-variable" ? "variable" : a.type,
804
- isMultiVariable: a.type === "multi-variable",
805
- minCount: a.type === "multi-variable" ? a.minCount : void 0
796
+ const u = [];
797
+ for (let s = 0; s < x.length; s++) {
798
+ const r = x[s];
799
+ if ((r.type === "variable" || r.type === "upload" || r.type === "multi-variable" || r.type === "select" || r.type === "textarea" || r.type === "richtext" || r.type === "datepicker") && r.required && r.key) {
800
+ u.push({
801
+ exclusionGroup: r.exclusionGroup || "",
802
+ key: r.key,
803
+ type: r.type === "multi-variable" ? "variable" : r.type,
804
+ isMultiVariable: r.type === "multi-variable",
805
+ minCount: r.type === "multi-variable" ? r.minCount : void 0,
806
+ __index: s
806
807
  });
807
808
  continue;
808
809
  }
809
- if (a.type === "text" && a.className?.includes("rte-text-required"))
810
- if (a.exclusionGroup)
811
- for (let n = l + 1; n < y.length; n++) {
812
- const o = y[n];
813
- if (o.exclusionGroup === a.exclusionGroup && (o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
814
- c.push({
815
- exclusionGroup: a.exclusionGroup,
810
+ if (r.type === "text" && r.className?.includes("rte-text-required"))
811
+ if (r.exclusionGroup)
812
+ for (let n = s + 1; n < x.length; n++) {
813
+ const o = x[n];
814
+ if (o.exclusionGroup === r.exclusionGroup && (o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
815
+ u.push({
816
+ exclusionGroup: r.exclusionGroup,
816
817
  key: o.key,
817
- type: o.type
818
+ type: o.type,
819
+ __index: n
818
820
  });
819
821
  break;
820
822
  }
821
823
  }
822
824
  else
823
- for (let n = l + 1; n < y.length; n++) {
824
- const o = y[n];
825
+ for (let n = s + 1; n < x.length; n++) {
826
+ const o = x[n];
825
827
  if ((o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
826
- c.push({
828
+ u.push({
827
829
  exclusionGroup: o.exclusionGroup || "",
828
830
  key: o.key,
829
- type: o.type
831
+ type: o.type,
832
+ __index: n
830
833
  });
831
834
  break;
832
835
  }
833
836
  }
834
837
  }
835
- const k = y.some((l) => l.exclusionGroup === "separator"), L = [];
836
- if (k && c.length > 1) {
837
- const l = [];
838
- y.forEach((a, n) => {
839
- a.exclusionGroup === "separator" && l.push(n);
838
+ const T = x.some((s) => s.exclusionGroup === "separator"), I = [];
839
+ if (T && u.length > 1) {
840
+ const s = [];
841
+ x.forEach((r, n) => {
842
+ r.exclusionGroup === "separator" && s.push(n);
840
843
  });
841
- for (const a of l) {
842
- let n = null;
843
- for (let r = a - 1; r >= 0; r--) {
844
- const s = y[r];
845
- if ((s.type === "variable" || s.type === "upload" || s.type === "select" || s.type === "textarea" || s.type === "richtext" || s.type === "datepicker") && s.key) {
846
- const d = c.find((h) => h.key === s.key);
847
- if (d) {
848
- n = d;
849
- break;
850
- }
851
- }
852
- }
853
- let o = null;
854
- for (let r = a + 1; r < y.length; r++) {
855
- const s = y[r];
856
- if ((s.type === "variable" || s.type === "upload" || s.type === "select" || s.type === "textarea" || s.type === "richtext" || s.type === "datepicker") && s.key) {
857
- const d = c.find((h) => h.key === s.key);
858
- if (d) {
859
- o = d;
860
- break;
861
- }
862
- }
863
- }
864
- n && o && L.push([n, o]);
844
+ for (const r of s) {
845
+ const o = u.filter((y) => typeof y.__index == "number" && y.__index < r).sort((y, g) => (g.__index ?? 0) - (y.__index ?? 0))[0], p = u.filter((y) => typeof y.__index == "number" && y.__index > r).sort((y, g) => (y.__index ?? 0) - (g.__index ?? 0))[0];
846
+ o && p && I.push([o, p]);
865
847
  }
866
848
  }
867
- if (c.length === 0) {
868
- if (y.length === 0) {
849
+ if (u.length === 0) {
850
+ if (x.length === 0) {
869
851
  if (!t.current) {
870
852
  i(!1);
871
853
  return;
872
854
  }
873
- const l = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
874
- i(l.length > 0);
855
+ const s = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
856
+ i(s.length > 0);
875
857
  return;
876
858
  }
877
859
  i(!0);
878
860
  return;
879
861
  }
880
- const E = c.filter((l) => {
862
+ const $ = u.filter((s) => {
881
863
  if (!t.current) return !1;
882
- if (l.exclusionGroup) {
883
- const a = t.current.querySelectorAll(
884
- `[data-group="${l.exclusionGroup}"]`
864
+ if (s.exclusionGroup) {
865
+ const r = t.current.querySelectorAll(
866
+ `[data-group="${s.exclusionGroup}"]`
885
867
  );
886
- if (a.length > 0)
887
- return a[0].style.display !== "none";
868
+ if (r.length > 0)
869
+ return r[0].style.display !== "none";
888
870
  }
889
- if (l.type === "upload" && l.key) {
890
- const a = t.current.querySelector(
891
- `[data-type="upload"][data-key="${l.key}"]`
871
+ if (s.type === "upload" && s.key) {
872
+ const r = t.current.querySelector(
873
+ `[data-type="upload"][data-key="${s.key}"]`
892
874
  );
893
- if (a) {
894
- const n = a.closest("[data-group]") || a.parentElement;
875
+ if (r) {
876
+ const n = r.closest("[data-group]") || r.parentElement;
895
877
  return n ? n.style.display !== "none" : !0;
896
878
  }
897
- } else if (l.type === "variable" && l.key)
898
- if (l.isMultiVariable) {
899
- const a = t.current.querySelectorAll(
900
- `[data-type="variable"][data-multi-key="${l.key}"]`
879
+ } else if (s.type === "variable" && s.key)
880
+ if (s.isMultiVariable) {
881
+ const r = t.current.querySelectorAll(
882
+ `[data-type="variable"][data-multi-key="${s.key}"]`
901
883
  );
902
- if (a.length > 0) {
903
- const n = a[0], o = n.closest("[data-group]") || n.parentElement;
884
+ if (r.length > 0) {
885
+ const n = r[0], o = n.closest("[data-group]") || n.parentElement;
904
886
  return o ? o.style.display !== "none" : !0;
905
887
  }
906
888
  } else {
907
- const a = t.current.querySelector(
908
- `[data-type="variable"][data-key="${l.key}"]`
889
+ const r = t.current.querySelector(
890
+ `[data-type="variable"][data-key="${s.key}"]`
909
891
  );
910
- if (a) {
911
- const n = a.closest("[data-group]") || a.parentElement;
892
+ if (r) {
893
+ const n = r.closest("[data-group]") || r.parentElement;
912
894
  return n ? n.style.display !== "none" : !0;
913
895
  }
914
896
  }
915
- else if (l.type === "select" && l.key) {
916
- const a = t.current.querySelector(
917
- `[data-type="select"][data-key="${l.key}"]`
897
+ else if (s.type === "select" && s.key) {
898
+ const r = t.current.querySelector(
899
+ `[data-type="select"][data-key="${s.key}"]`
918
900
  );
919
- if (a) {
920
- const n = a.closest("[data-group]") || a.parentElement;
901
+ if (r) {
902
+ const n = r.closest("[data-group]") || r.parentElement;
921
903
  return n ? n.style.display !== "none" : !0;
922
904
  }
923
- } else if (l.type === "textarea" && l.key) {
924
- const a = t.current.querySelector(
925
- `[data-type="textarea"][data-key="${l.key}"]`
905
+ } else if (s.type === "textarea" && s.key) {
906
+ const r = t.current.querySelector(
907
+ `[data-type="textarea"][data-key="${s.key}"]`
926
908
  );
927
- if (a) {
928
- const n = a.closest("[data-group]") || a.parentElement;
909
+ if (r) {
910
+ const n = r.closest("[data-group]") || r.parentElement;
929
911
  return n ? n.style.display !== "none" : !0;
930
912
  }
931
- } else if (l.type === "richtext" && l.key) {
932
- const a = t.current.querySelector(
933
- `[data-type="richtext"][data-key="${l.key}"]`
913
+ } else if (s.type === "richtext" && s.key) {
914
+ const r = t.current.querySelector(
915
+ `[data-type="richtext"][data-key="${s.key}"]`
934
916
  );
935
- if (a) {
936
- const n = a.closest("[data-group]") || a.parentElement;
917
+ if (r) {
918
+ const n = r.closest("[data-group]") || r.parentElement;
937
919
  return n ? n.style.display !== "none" : !0;
938
920
  }
939
- } else if (l.type === "datepicker" && l.key) {
940
- const a = t.current.querySelector(
941
- `[data-type="datepicker"][data-key="${l.key}"]`
921
+ } else if (s.type === "datepicker" && s.key) {
922
+ const r = t.current.querySelector(
923
+ `[data-type="datepicker"][data-key="${s.key}"]`
942
924
  );
943
- if (a) {
944
- const n = a.closest("[data-group]") || a.parentElement;
925
+ if (r) {
926
+ const n = r.closest("[data-group]") || r.parentElement;
945
927
  return n ? n.style.display !== "none" : !0;
946
928
  }
947
929
  }
948
930
  return !1;
949
931
  });
950
- if (E.length === 0) {
932
+ if ($.length === 0) {
951
933
  i(!0);
952
934
  return;
953
935
  }
954
- const C = /* @__PURE__ */ new Set();
955
- L.forEach((l) => {
956
- l.forEach((a) => {
957
- a.key && C.add(a.key);
936
+ const w = /* @__PURE__ */ new Set();
937
+ I.forEach((s) => {
938
+ s.forEach((r) => {
939
+ r.key && w.add(r.key);
958
940
  });
959
941
  });
960
- const e = E.filter(
961
- (l) => !l.key || !C.has(l.key)
942
+ const e = $.filter(
943
+ (s) => !s.key || !w.has(s.key)
962
944
  );
963
- let A = (L.length === 0, !0);
964
- for (const l of L) {
965
- const a = l.filter((o) => {
945
+ let q = (I.length === 0, !0);
946
+ for (const s of I) {
947
+ const r = s.filter((o) => {
966
948
  if (!t.current) return !1;
967
949
  if (o.exclusionGroup) {
968
- const r = t.current.querySelectorAll(
950
+ const a = t.current.querySelectorAll(
969
951
  `[data-group="${o.exclusionGroup}"]`
970
952
  );
971
- if (r.length > 0)
972
- return r[0].style.display !== "none";
953
+ if (a.length > 0)
954
+ return a[0].style.display !== "none";
973
955
  }
974
956
  return !0;
975
957
  });
976
- if (a.length === 0)
958
+ if (r.length === 0)
977
959
  continue;
978
960
  let n = !1;
979
- for (const o of a)
961
+ for (const o of r)
980
962
  if (o.type === "upload" && o.key) {
981
- if (u[o.key] !== null && u[o.key] !== void 0) {
963
+ if (d[o.key] !== null && d[o.key] !== void 0) {
982
964
  n = !0;
983
965
  break;
984
966
  }
985
967
  } else if (o.type === "variable" && o.key)
986
968
  if (o.isMultiVariable) {
987
- const r = t.current.querySelectorAll(
969
+ const a = t.current.querySelectorAll(
988
970
  `[data-type="variable"][data-multi-key="${o.key}"]`
989
971
  );
990
- let s = 0;
991
- for (const h of Array.from(r))
992
- h.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (s += 1);
993
- const d = o.minCount && o.minCount > 0 ? o.minCount : 1;
994
- if (s >= d) {
972
+ let p = 0;
973
+ for (const g of Array.from(a)) {
974
+ if (g.classList.contains("show-placeholder"))
975
+ continue;
976
+ g.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (p += 1);
977
+ }
978
+ const y = o.minCount && o.minCount > 0 ? o.minCount : 1;
979
+ if (p >= y) {
995
980
  n = !0;
996
981
  break;
997
982
  }
998
983
  } else {
999
- const r = t.current.querySelector(
984
+ const a = t.current.querySelector(
1000
985
  `[data-type="variable"][data-key="${o.key}"]`
1001
986
  );
1002
- if (r && r.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1003
- n = !0;
1004
- break;
987
+ if (a) {
988
+ if (a.classList.contains("show-placeholder"))
989
+ continue;
990
+ if (a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
991
+ n = !0;
992
+ break;
993
+ }
1005
994
  }
1006
995
  }
1007
996
  else if (o.type === "select" && o.key) {
1008
- const r = t.current.querySelector(
997
+ const a = t.current.querySelector(
1009
998
  `[data-type="select"][data-key="${o.key}"]`
1010
999
  );
1011
- if (r && (r.value || "").trim().length > 0) {
1000
+ if (a && (a.value || "").trim().length > 0) {
1012
1001
  n = !0;
1013
1002
  break;
1014
1003
  }
1015
1004
  } else if (o.type === "textarea" && o.key) {
1016
- const r = t.current.querySelector(
1005
+ const a = t.current.querySelector(
1017
1006
  `[data-type="textarea"][data-key="${o.key}"]`
1018
1007
  );
1019
- if (r && (r.value || "").trim().length > 0) {
1008
+ if (a && (a.value || "").trim().length > 0) {
1020
1009
  n = !0;
1021
1010
  break;
1022
1011
  }
1023
1012
  } else if (o.type === "richtext" && o.key) {
1024
- const r = t.current.querySelector(
1013
+ const a = t.current.querySelector(
1025
1014
  `[data-type="richtext"][data-key="${o.key}"]`
1026
1015
  );
1027
- if (r && (r.textContent || "").replace(/[\u200B]/g, "").trim().length > 0) {
1016
+ if (a && (a.textContent || "").replace(/[\u200B]/g, "").trim().length > 0) {
1028
1017
  n = !0;
1029
1018
  break;
1030
1019
  }
1031
1020
  } else if (o.type === "datepicker" && o.key) {
1032
- const r = t.current.querySelector(
1021
+ const a = t.current.querySelector(
1033
1022
  `[data-type="datepicker"][data-key="${o.key}"]`
1034
1023
  );
1035
- if (r && (r.getAttribute("data-value") || "").trim().length > 0) {
1024
+ if (a && (a.getAttribute("data-value") || "").trim().length > 0) {
1036
1025
  n = !0;
1037
1026
  break;
1038
1027
  }
1039
1028
  }
1040
1029
  if (!n) {
1041
- A = !1;
1030
+ q = !1;
1042
1031
  break;
1043
1032
  }
1044
1033
  }
1045
- let g = !0;
1046
- for (const l of e)
1047
- if (l.type === "upload" && l.key) {
1048
- if (u[l.key] === null || u[l.key] === void 0) {
1049
- g = !1;
1034
+ let f = !0;
1035
+ for (const s of e)
1036
+ if (s.type === "upload" && s.key) {
1037
+ if (d[s.key] === null || d[s.key] === void 0) {
1038
+ f = !1;
1050
1039
  break;
1051
1040
  }
1052
- } else if (l.type === "variable" && l.key)
1053
- if (l.isMultiVariable) {
1054
- const a = t.current.querySelectorAll(
1055
- `[data-type="variable"][data-multi-key="${l.key}"]`
1041
+ } else if (s.type === "variable" && s.key)
1042
+ if (s.isMultiVariable) {
1043
+ const r = t.current.querySelectorAll(
1044
+ `[data-type="variable"][data-multi-key="${s.key}"]`
1056
1045
  );
1057
1046
  let n = 0;
1058
- for (const r of Array.from(a))
1059
- r.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (n += 1);
1060
- const o = l.minCount && l.minCount > 0 ? l.minCount : 1;
1047
+ for (const a of Array.from(r)) {
1048
+ if (a.classList.contains("show-placeholder"))
1049
+ continue;
1050
+ a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (n += 1);
1051
+ }
1052
+ const o = s.minCount && s.minCount > 0 ? s.minCount : 1;
1061
1053
  if (n < o) {
1062
- g = !1;
1054
+ f = !1;
1063
1055
  break;
1064
1056
  }
1065
1057
  } else {
1066
- const a = t.current.querySelector(
1067
- `[data-type="variable"][data-key="${l.key}"]`
1058
+ const r = t.current.querySelector(
1059
+ `[data-type="variable"][data-key="${s.key}"]`
1068
1060
  );
1069
- if (!a) {
1070
- g = !1;
1061
+ if (!r) {
1062
+ f = !1;
1071
1063
  break;
1072
1064
  }
1073
- if (a.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
1074
- g = !1;
1065
+ if (r.classList.contains("show-placeholder")) {
1066
+ f = !1;
1067
+ break;
1068
+ }
1069
+ if (r.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
1070
+ f = !1;
1075
1071
  break;
1076
1072
  }
1077
1073
  }
1078
- else if (l.type === "select" && l.key) {
1079
- const a = t.current.querySelector(
1080
- `[data-type="select"][data-key="${l.key}"]`
1074
+ else if (s.type === "select" && s.key) {
1075
+ const r = t.current.querySelector(
1076
+ `[data-type="select"][data-key="${s.key}"]`
1081
1077
  );
1082
- if (!a || (a.value || "").trim().length === 0) {
1083
- g = !1;
1078
+ if (!r || (r.value || "").trim().length === 0) {
1079
+ f = !1;
1084
1080
  break;
1085
1081
  }
1086
- } else if (l.type === "textarea" && l.key) {
1087
- const a = t.current.querySelector(
1088
- `[data-type="textarea"][data-key="${l.key}"]`
1082
+ } else if (s.type === "textarea" && s.key) {
1083
+ const r = t.current.querySelector(
1084
+ `[data-type="textarea"][data-key="${s.key}"]`
1089
1085
  );
1090
- if (!a || (a.value || "").trim().length === 0) {
1091
- g = !1;
1086
+ if (!r || (r.value || "").trim().length === 0) {
1087
+ f = !1;
1092
1088
  break;
1093
1089
  }
1094
- } else if (l.type === "richtext" && l.key) {
1095
- const a = t.current.querySelector(
1096
- `[data-type="richtext"][data-key="${l.key}"]`
1090
+ } else if (s.type === "richtext" && s.key) {
1091
+ const r = t.current.querySelector(
1092
+ `[data-type="richtext"][data-key="${s.key}"]`
1097
1093
  );
1098
- if (!a || (a.textContent || "").replace(/[\u200B]/g, "").trim().length === 0) {
1099
- g = !1;
1094
+ if (!r || (r.textContent || "").replace(/[\u200B]/g, "").trim().length === 0) {
1095
+ f = !1;
1100
1096
  break;
1101
1097
  }
1102
- } else if (l.type === "datepicker" && l.key) {
1103
- const a = t.current.querySelector(
1104
- `[data-type="datepicker"][data-key="${l.key}"]`
1098
+ } else if (s.type === "datepicker" && s.key) {
1099
+ const r = t.current.querySelector(
1100
+ `[data-type="datepicker"][data-key="${s.key}"]`
1105
1101
  );
1106
- if (!a || (a.getAttribute("data-value") || "").trim().length === 0) {
1107
- g = !1;
1102
+ if (!r || (r.getAttribute("data-value") || "").trim().length === 0) {
1103
+ f = !1;
1108
1104
  break;
1109
1105
  }
1110
1106
  }
1111
- i(A && g);
1107
+ i(q && f);
1112
1108
  }
1113
- function Ve(t, y) {
1109
+ function Me(t, x) {
1114
1110
  if (!t.current) return;
1115
1111
  t.current.querySelectorAll('[data-type="variable"]').forEach((i) => {
1116
- const c = i.innerText.replace(/\n/g, "");
1117
- c.replace(/\u200B/g, "") ? i.classList.remove("show-placeholder") : (c !== "​" && (i.innerText = "​"), i.classList.add("show-placeholder"));
1112
+ const u = i.innerText.replace(/\n/g, "");
1113
+ u.replace(/\u200B/g, "") ? i.classList.remove("show-placeholder") : (u !== "​" && (i.innerText = "​"), i.classList.add("show-placeholder"));
1118
1114
  });
1119
1115
  }
1120
- function qt(t, y, u, i, c, k = {}, L) {
1116
+ function St(t, x, d, i, u, T = {}, I) {
1121
1117
  if (!t.current) return;
1122
- let E = "", C = 0;
1123
- for (; C < y.length; ) {
1124
- const e = y[C], A = C + 1 < y.length ? y[C + 1] : null;
1125
- if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && A) {
1126
- const r = A.type === "upload" && A.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === A.exclusionGroup, s = A.type === "variable" && A.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === A.exclusionGroup;
1127
- if (r) {
1128
- const h = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, x = "</span>";
1129
- let G = "";
1130
- e.className ? G = `<span class="${e.className}">${e.text ?? ""}</span>` : G = e.text ?? "";
1131
- const T = A, _ = u[T.key] !== null && u[T.key] !== void 0, H = _ ? u[T.key] : null, D = _ ? u[T.key]?.name : T.text, K = _ ? "" : "hidden", Q = T.tooltip && !_ ? "" : "hidden", Y = _ ? "has-file" : "", te = _ && D ? ` data-file-name="${D.replace(/"/g, "&quot;")}"` : "";
1132
- let N = "";
1133
- _ && H && (H.type?.startsWith("image/") ? N = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(H)}" alt="preview" />` : N = "<i class='iconfont icon-exlwenjian'></i>");
1134
- const M = `<span contenteditable="false" data-type="upload" data-key="${T.key}" class="upload-chip"><span class="upload-inner-wrapper ${Y}"><span class="upload-icon">${N}</span><span class="upload-label"${te}>${D || T.text}</span>${T.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${Q}" data-upload-key="${T.key}" data-tooltip="${T.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${K}" title="移除文件">×</span></span></span>`;
1135
- E += h + G + M + x, C += 2;
1118
+ let $ = "", w = 0;
1119
+ for (; w < x.length; ) {
1120
+ const e = x[w], q = w + 1 < x.length ? x[w + 1] : null;
1121
+ if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && q) {
1122
+ const a = q.type === "upload" && q.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === q.exclusionGroup, p = q.type === "variable" && q.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === q.exclusionGroup;
1123
+ if (a) {
1124
+ const g = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, b = "</span>";
1125
+ let V = "";
1126
+ e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
1127
+ const k = q, P = d[k.key] !== null && d[k.key] !== void 0, H = P ? d[k.key] : null, F = P ? d[k.key]?.name : k.text, U = P ? "" : "hidden", R = k.tooltip && !P ? "" : "hidden", ee = P ? "has-file" : "", re = P && F ? ` data-file-name="${F.replace(/"/g, "&quot;")}"` : "";
1128
+ let l = "";
1129
+ P && H && (H.type?.startsWith("image/") ? l = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(H)}" alt="preview" />` : l = "<i class='iconfont icon-exlwenjian'></i>");
1130
+ const c = `<span contenteditable="false" data-type="upload" data-key="${k.key}" class="upload-chip"><span class="upload-inner-wrapper ${ee}"><span class="upload-icon">${l}</span><span class="upload-label"${re}>${F || k.text}</span>${k.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${R}" data-upload-key="${k.key}" data-tooltip="${k.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${U}" title="移除文件">×</span></span></span>`;
1131
+ $ += g + V + c + b, w += 2;
1136
1132
  continue;
1137
1133
  }
1138
- if (s) {
1139
- const h = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, x = "</span>";
1140
- let G = "";
1141
- e.className ? G = `<span class="${e.className}">${e.text ?? ""}</span>` : G = e.text ?? "";
1142
- const T = A, H = (T.key ? c[T.key] : void 0) || T.text || "", D = !H, K = D ? "​" : H, Q = D ? "show-placeholder" : "", Y = T.exclusionGroup ? ` data-group="${T.exclusionGroup}"` : "", te = T.tooltip ? ` data-tooltip="${T.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${T.key || ""}"` : "", N = T.tooltip && D ? "" : "hidden", M = `<span contenteditable="true" data-type="variable" data-key="${T.key}" data-placeholder="${T.placeholder || ""}"${Y}${te} class="variable-chip ${Q}">${K}${T.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${N}" data-variable-key="${T.key}" data-tooltip="${T.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1143
- E += h + G + M + x, C += 2;
1134
+ if (p) {
1135
+ const g = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, b = "</span>";
1136
+ let V = "";
1137
+ e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
1138
+ const k = q, H = (k.key ? u[k.key] : void 0) || k.text || "", F = !H, U = F ? "​" : H, R = F ? "show-placeholder" : "", ee = k.exclusionGroup ? ` data-group="${k.exclusionGroup}"` : "", re = k.tooltip ? ` data-tooltip="${k.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${k.key || ""}"` : "", l = k.tooltip && F ? "" : "hidden", c = `<span contenteditable="true" data-type="variable" data-key="${k.key}" data-placeholder="${k.placeholder || ""}"${ee}${re} class="variable-chip ${R}">${U}${k.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${l}" data-variable-key="${k.key}" data-tooltip="${k.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1139
+ $ += g + V + c + b, w += 2;
1144
1140
  continue;
1145
1141
  }
1146
1142
  }
1147
- const l = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", a = e.exclusionGroup ? `<span ${l} class="exclusion-wrapper">` : "", n = e.exclusionGroup ? "</span>" : "";
1143
+ const s = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", r = e.exclusionGroup ? `<span ${s} class="exclusion-wrapper">` : "", n = e.exclusionGroup ? "</span>" : "";
1148
1144
  let o = "";
1149
1145
  if (e.type === "tag") {
1150
- const s = i || L === "hideTagClose" ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', d = i ? ' data-locked="true"' : "", h = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1151
- o = `<span contenteditable="false" class="tag-node group"${d}${h}><span class="tag-label">${e.text}</span>${s}</span>`;
1146
+ const p = i || I === "hideTagClose" ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', y = i ? ' data-locked="true"' : "", g = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1147
+ o = `<span contenteditable="false" class="tag-node group"${y}${g}><span class="tag-label">${e.text}</span>${p}</span>`;
1152
1148
  } else if (e.type === "text") {
1153
- const r = i ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"', d = (e.text ?? "").replace(/\n/g, "<br/>");
1154
- e.className ? o = `<span class="${e.className}"${r}>${d}</span>` : o = i ? `<span${r}>${d}</span>` : `<span contenteditable="false">${d}</span>`;
1149
+ const a = i ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"', y = (e.text ?? "").replace(/\n/g, "<br/>");
1150
+ e.className ? o = `<span class="${e.className}"${a}>${y}</span>` : o = i ? `<span${a}>${y}</span>` : `<span contenteditable="false">${y}</span>`;
1155
1151
  } else if (e.type === "variable" && e.key) {
1156
- const s = c[e.key] || e.text || "", d = !s, h = d ? "​" : s, x = d ? "show-placeholder" : "", G = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", T = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", _ = e.tooltip && d ? "" : "hidden", H = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${G}${T} class="variable-chip ${x}">${h}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${_}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1152
+ const p = u[e.key] || e.text || "", y = !p, g = y ? "​" : p, b = y ? "show-placeholder" : "", V = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", k = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", P = e.tooltip && y ? "" : "hidden", H = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${V}${k} class="variable-chip ${b}">${g}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${P}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1157
1153
  e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</span>` : o = H;
1158
1154
  } else if (e.type === "upload" && e.key) {
1159
- const r = u[e.key] !== null && u[e.key] !== void 0, s = r ? u[e.key] : null, d = r ? u[e.key]?.name : e.text, h = r ? "" : "hidden", x = e.tooltip && !r ? "" : "hidden", G = r ? "has-file" : "", T = r && d ? ` data-file-name="${d.replace(/"/g, "&quot;")}"` : "";
1160
- let _ = "";
1161
- r && s && (s.type?.startsWith("image/") ? _ = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(s)}" alt="preview" />` : _ = "<i class='iconfont icon-exlwenjian'></i>");
1162
- const H = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${G}"><span class="upload-icon">${_}</span><span class="upload-label"${T}>${d || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${x}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${h}" title="移除文件">×</span></span></span>`;
1155
+ const a = d[e.key] !== null && d[e.key] !== void 0, p = a ? d[e.key] : null, y = a ? d[e.key]?.name : e.text, g = a ? "" : "hidden", b = e.tooltip && !a ? "" : "hidden", V = a ? "has-file" : "", k = a && y ? ` data-file-name="${y.replace(/"/g, "&quot;")}"` : "";
1156
+ let P = "";
1157
+ a && p && (p.type?.startsWith("image/") ? P = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(p)}" alt="preview" />` : P = "<i class='iconfont icon-exlwenjian'></i>");
1158
+ const H = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${V}"><span class="upload-icon">${P}</span><span class="upload-label"${k}>${y || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${b}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${g}" title="移除文件">×</span></span></span>`;
1163
1159
  e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</span>` : o = H;
1164
1160
  } else if (e.type === "select" && e.key) {
1165
- const r = c[e.key] ?? e.text ?? "", s = (e.options || []).map((T) => {
1166
- const _ = r === T.value ? "selected" : "";
1167
- return `<option value="${T.value}" ${_}>${T.label}</option>`;
1168
- }).join(""), d = e.placeholder ? `<option value="" ${r ? "" : "selected"} disabled hidden>${e.placeholder}</option>` : "", G = `<span class="rte-select-wrapper">${`<select data-type="select" data-key="${e.key}" class="rte-select rte-select-has-icon">${d}${s}</select>`}<i class="iconfont icon-qiehuan-xiayizhang rte-select-icon"></i></span>`;
1169
- e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${G}</span>` : o = G;
1161
+ const a = u[e.key] || e.defaultValue || "", p = (e.options || []).map((b) => {
1162
+ const V = a === b.value ? "selected" : "";
1163
+ return `<option value="${b.value}" ${V}>${b.label}</option>`;
1164
+ }).join(""), y = e.placeholder ? `<option value="" ${a ? "" : "selected"} disabled hidden>${e.placeholder}</option>` : "", g = `<select data-type="select" data-key="${e.key}" class="rte-select">${y}${p}</select>`;
1165
+ e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${g}</span>` : o = g;
1170
1166
  } else if (e.type === "textarea" && e.key) {
1171
- const r = c[e.key] || "", s = e.maxHeight || 252, d = e.expandable !== !1, h = e.placeholder ? ` placeholder="${e.placeholder}"` : "", x = `<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" data-max-height="${s}" style="max-height:${s}px;"${h}>${r}</textarea>`, G = d ? `<button type="button" class="rte-textarea-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", T = `<div class="rte-textarea-wrapper" data-key="${e.key}">${x}${G}</div>`;
1172
- e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${T}</span>` : o = T;
1167
+ const a = u[e.key] || "", p = e.maxHeight || 252, y = e.expandable !== !1, g = e.placeholder ? ` placeholder="${e.placeholder}"` : "", b = `<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" data-max-height="${p}" style="max-height:${p}px;"${g}>${a}</textarea>`, V = y ? `<button type="button" class="rte-textarea-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", k = `<div class="rte-textarea-wrapper" data-key="${e.key}">${b}${V}</div>`;
1168
+ e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${k}</span>` : o = k;
1173
1169
  } else if (e.type === "richtext" && e.key) {
1174
- const r = c[e.key] || e.text || "", s = e.minHeight || 140, d = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", h = e.expandable !== !1, x = r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), G = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${d} style="min-height:${s}px;">${x}</div>`, T = h ? `<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false"><i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span></button>` : "", _ = `<div class="rte-richtext-wrapper" data-key="${e.key}">${G}${T}</div>`, H = `<div class="rte-richtext-container" data-key="${e.key}">${_}</div>`;
1170
+ const a = u[e.key] || e.text || "", p = e.minHeight || 140, y = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", g = e.expandable !== !1, b = a, V = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${y} style="min-height:${p}px;">${b}</div>`, k = g ? `<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", P = `<div class="rte-richtext-wrapper" data-key="${e.key}">${V}${k}</div>`, H = `<div class="rte-richtext-container" data-key="${e.key}">${P}</div>`;
1175
1171
  e.required ? o = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group rte-richtext-required"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</div>` : o = H;
1176
1172
  } else if (e.type === "datepicker" && e.key) {
1177
- const r = c[e.key] || "", s = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", d = `<div data-type="datepicker" data-key="${e.key}" data-value="${r}" class="rte-datepicker-host"${s}></div>`;
1178
- e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${d}</span>` : o = d;
1173
+ const a = u[e.key] || "", p = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", y = e.limitRange ? ` data-limit-range="${e.limitRange}"` : "", g = e.disableFuture ? ' data-disable-future="true"' : "", b = `<div data-type="datepicker" data-key="${e.key}" data-value="${a}" class="rte-datepicker-host"${p}${y}${g}></div>`;
1174
+ e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${b}</span>` : o = b;
1179
1175
  } else if (e.type === "multi-variable" && e.key) {
1180
- const r = e.maxCount || 9, s = k[e.key] || 1, d = Math.min(s, r);
1176
+ const a = e.maxCount || 9, p = T[e.key] || 1, y = Math.min(p, a);
1181
1177
  if (e.required) {
1182
- const h = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, x = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "";
1183
- let G = "";
1184
- for (let T = 0; T < d; T++) {
1185
- const _ = `${e.key}_${T}`, H = c[_] || "", D = !H, K = D ? "​" : H, Q = D ? "show-placeholder" : "", Y = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", te = e.tooltip && D ? "" : "hidden", N = `<span contenteditable="true" data-type="variable" data-key="${_}" data-multi-key="${e.key}" data-index="${T}" data-placeholder="${e.placeholder || ""}"${Y} class="variable-chip ${Q}">${K}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${te}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1186
- T === 0 ? G += `<span ${x} class="exclusion-wrapper required-upload-group required-multi-first">${h}${N}</span>` : G += N;
1178
+ const g = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, b = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "";
1179
+ let V = "";
1180
+ for (let k = 0; k < y; k++) {
1181
+ const P = `${e.key}_${k}`, H = u[P] || "", F = !H, U = F ? "​" : H, R = F ? "show-placeholder" : "", ee = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", re = e.tooltip && F ? "" : "hidden", l = `<span contenteditable="true" data-type="variable" data-key="${P}" data-multi-key="${e.key}" data-index="${k}" data-placeholder="${e.placeholder || ""}"${ee} class="variable-chip ${R}">${U}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${re}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1182
+ k === 0 ? V += `<span ${b} class="exclusion-wrapper required-upload-group required-multi-first">${g}${l}</span>` : V += l;
1187
1183
  }
1188
- o = G;
1184
+ o = V;
1189
1185
  } else {
1190
- let h = "";
1191
- for (let x = 0; x < d; x++) {
1192
- const G = `${e.key}_${x}`, T = c[G] || "", _ = !T, H = _ ? "​" : T, D = _ ? "show-placeholder" : "", K = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", Q = e.tooltip && _ ? "" : "hidden", Y = `<span contenteditable="true" data-type="variable" data-key="${G}" data-multi-key="${e.key}" data-index="${x}" data-placeholder="${e.placeholder || ""}"${K} class="variable-chip ${D}">${H}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${Q}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1193
- h += Y;
1186
+ let g = "";
1187
+ for (let b = 0; b < y; b++) {
1188
+ const V = `${e.key}_${b}`, k = u[V] || "", P = !k, H = P ? "​" : k, F = P ? "show-placeholder" : "", U = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", R = e.tooltip && P ? "" : "hidden", ee = `<span contenteditable="true" data-type="variable" data-key="${V}" data-multi-key="${e.key}" data-index="${b}" data-placeholder="${e.placeholder || ""}"${U} class="variable-chip ${F}">${H}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${R}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1189
+ g += ee;
1194
1190
  }
1195
- o = h;
1191
+ o = g;
1196
1192
  }
1197
1193
  }
1198
- E += a + o + n, C++;
1194
+ $ += r + o + n, w++;
1199
1195
  }
1200
- t.current && (t.current.innerHTML = E, setTimeout(() => {
1196
+ t.current && (t.current.innerHTML = $, setTimeout(() => {
1201
1197
  if (!t.current) return;
1202
- t.current.querySelectorAll('[data-type="variable"]').forEach((A) => {
1203
- const g = A.innerText.replace(/\n/g, "");
1204
- g.replace(/\u200B/g, "") ? A.classList.remove("show-placeholder") : (g !== "​" && (A.innerText = "​"), A.classList.add("show-placeholder"));
1198
+ t.current.querySelectorAll('[data-type="variable"]').forEach((q) => {
1199
+ const f = q.innerText.replace(/\n/g, "");
1200
+ f.replace(/\u200B/g, "") ? q.classList.remove("show-placeholder") : (f !== "​" && (q.innerText = "​"), q.classList.add("show-placeholder"));
1205
1201
  });
1206
1202
  }, 0));
1207
1203
  }
1208
- function Ct(t, y, u, i, c = {}, k, L, E) {
1209
- const C = U(() => {
1204
+ function At(t, x, d, i, u = {}, T, I, $) {
1205
+ const w = ae(() => {
1210
1206
  if (!t.current) return;
1211
- if (y.length === 0) {
1207
+ if (x.length === 0) {
1212
1208
  t.current.innerHTML = "";
1213
1209
  return;
1214
1210
  }
1215
1211
  let e = {};
1216
- const g = t.current.__tempVariableValues;
1217
- if (g ? (e = g, setTimeout(() => {
1212
+ const f = t.current.__tempVariableValues;
1213
+ if (f ? (e = f, setTimeout(() => {
1218
1214
  if (t.current) {
1219
- const l = t.current;
1220
- l.__tempVariableValues === g && delete l.__tempVariableValues;
1221
- }
1222
- }, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((s) => {
1223
- const d = s.dataset.key;
1224
- if (d) {
1225
- const h = s.innerText.replace(/[\u200B\n]/g, "").trim();
1226
- h && (e[d] = h);
1227
- }
1228
- }), t.current.querySelectorAll('[data-type="select"]').forEach((s) => {
1229
- const d = s.dataset.key;
1230
- if (d) {
1231
- const h = s.value.trim();
1232
- h && (e[d] = h);
1233
- }
1234
- }), t.current.querySelectorAll('[data-type="textarea"]').forEach((s) => {
1235
- const d = s.dataset.key;
1236
- if (d) {
1237
- const h = s.value.replace(/[\u200B]/g, "").trim();
1238
- h && (e[d] = h);
1239
- }
1240
- }), t.current.querySelectorAll('[data-type="richtext"]').forEach((s) => {
1241
- const d = s.dataset.key;
1242
- if (d) {
1243
- const h = (s.textContent || "").replace(/[\u200B]/g, "").trim();
1244
- h && (e[d] = h);
1245
- }
1246
- }), t.current.querySelectorAll('[data-type="datepicker"]').forEach((s) => {
1247
- const d = s.dataset.key;
1248
- if (d) {
1249
- const h = (s.getAttribute("data-value") || "").trim();
1250
- h && (e[d] = h);
1251
- }
1252
- })), qt(t, y, u, i, e, c, E), k?.current) {
1253
- const { key: l, offset: a } = k.current;
1215
+ const s = t.current;
1216
+ s.__tempVariableValues === f && delete s.__tempVariableValues;
1217
+ }
1218
+ }, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((p) => {
1219
+ const y = p.dataset.key;
1220
+ if (y) {
1221
+ const g = p.innerText.replace(/[\u200B\n]/g, "").trim();
1222
+ g && (e[y] = g);
1223
+ }
1224
+ }), t.current.querySelectorAll('[data-type="select"]').forEach((p) => {
1225
+ const y = p.dataset.key;
1226
+ if (y) {
1227
+ const g = p.value.trim();
1228
+ g && (e[y] = g);
1229
+ }
1230
+ }), t.current.querySelectorAll('[data-type="textarea"]').forEach((p) => {
1231
+ const y = p.dataset.key;
1232
+ if (y) {
1233
+ const g = p.value.replace(/[\u200B]/g, "").trim();
1234
+ g && (e[y] = g);
1235
+ }
1236
+ }), t.current.querySelectorAll('[data-type="richtext"]').forEach((p) => {
1237
+ const y = p.dataset.key;
1238
+ if (y) {
1239
+ const g = (p.textContent || "").replace(/[\u200B]/g, "").trim();
1240
+ g && (e[y] = g);
1241
+ }
1242
+ }), t.current.querySelectorAll('[data-type="datepicker"]').forEach((p) => {
1243
+ const y = p.dataset.key;
1244
+ if (y) {
1245
+ const g = (p.getAttribute("data-value") || "").trim();
1246
+ g && (e[y] = g);
1247
+ }
1248
+ })), St(t, x, d, i, e, u, $), T?.current) {
1249
+ const { key: s, offset: r } = T.current;
1254
1250
  setTimeout(() => {
1255
1251
  if (!t.current) return;
1256
1252
  const n = t.current.querySelector(
1257
- `[data-type="variable"][data-key="${l}"]`
1253
+ `[data-type="variable"][data-key="${s}"]`
1258
1254
  );
1259
1255
  if (n) {
1260
1256
  try {
1261
- const o = document.createRange(), r = document.createTreeWalker(
1257
+ const o = document.createRange(), a = document.createTreeWalker(
1262
1258
  n,
1263
1259
  NodeFilter.SHOW_TEXT,
1264
1260
  null
1265
1261
  );
1266
- let s = 0, d = null, h = 0;
1267
- for (; r.nextNode(); ) {
1268
- const x = r.currentNode, G = x.textContent?.length || 0;
1269
- if (s + G >= a) {
1270
- d = x, h = a - s;
1262
+ let p = 0, y = null, g = 0;
1263
+ for (; a.nextNode(); ) {
1264
+ const b = a.currentNode, V = b.textContent?.length || 0;
1265
+ if (p + V >= r) {
1266
+ y = b, g = r - p;
1271
1267
  break;
1272
1268
  }
1273
- s += G;
1269
+ p += V;
1274
1270
  }
1275
- if (d) {
1276
- o.setStart(d, Math.min(h, d.textContent?.length || 0)), o.collapse(!0);
1277
- const x = window.getSelection();
1278
- x && (x.removeAllRanges(), x.addRange(o), n.focus());
1271
+ if (y) {
1272
+ o.setStart(y, Math.min(g, y.textContent?.length || 0)), o.collapse(!0);
1273
+ const b = window.getSelection();
1274
+ b && (b.removeAllRanges(), b.addRange(o), n.focus());
1279
1275
  } else {
1280
1276
  o.selectNodeContents(n), o.collapse(!1);
1281
- const x = window.getSelection();
1282
- x && (x.removeAllRanges(), x.addRange(o), n.focus());
1277
+ const b = window.getSelection();
1278
+ b && (b.removeAllRanges(), b.addRange(o), n.focus());
1283
1279
  }
1284
1280
  } catch {
1285
1281
  const o = document.createRange();
1286
1282
  o.selectNodeContents(n), o.collapse(!1);
1287
- const r = window.getSelection();
1288
- r && (r.removeAllRanges(), r.addRange(o), n.focus());
1283
+ const a = window.getSelection();
1284
+ a && (a.removeAllRanges(), a.addRange(o), n.focus());
1289
1285
  }
1290
- k.current = null;
1286
+ T.current = null;
1291
1287
  }
1292
1288
  }, 0);
1293
1289
  }
1294
- }, [y, u, i, t, c, k, L, E]);
1295
- ae(() => {
1296
- C();
1297
- }, [C]);
1290
+ }, [x, d, i, t, u, T, I, $]);
1291
+ de(() => {
1292
+ w();
1293
+ }, [w]);
1298
1294
  }
1299
- function Tt(t, y, u, i) {
1300
- ae(() => {
1301
- const c = t.current;
1302
- if (!c) return;
1303
- const k = (E) => {
1304
- const C = E.target?.closest(".upload-info-icon");
1305
- if (C && C.classList.contains("upload-info-icon")) {
1306
- const A = C.dataset.uploadKey;
1307
- A && i({ key: A, anchorEl: C, type: "upload" });
1295
+ function Lt(t, x, d, i) {
1296
+ de(() => {
1297
+ const u = t.current;
1298
+ if (!u) return;
1299
+ const T = ($) => {
1300
+ const w = $.target?.closest(".upload-info-icon");
1301
+ if (w && w.classList.contains("upload-info-icon")) {
1302
+ const q = w.dataset.uploadKey;
1303
+ q && i({ key: q, anchorEl: w, type: "upload" });
1308
1304
  return;
1309
1305
  }
1310
- const e = E.target?.closest('[data-type="upload"]');
1306
+ const e = $.target?.closest('[data-type="upload"]');
1311
1307
  if (e) {
1312
- const A = e.dataset.key;
1313
- if (A) {
1314
- const g = u[A];
1315
- g && g.type && g.type.startsWith("image/") && i({ key: A, anchorEl: e, type: "upload-preview" });
1308
+ const q = e.dataset.key;
1309
+ if (q) {
1310
+ const f = d[q];
1311
+ f && f.type && f.type.startsWith("image/") && i({ key: q, anchorEl: e, type: "upload-preview" });
1316
1312
  }
1317
1313
  }
1318
- }, L = (E) => {
1319
- const C = E.target?.closest(".upload-info-icon"), e = E.relatedTarget;
1320
- if (C && C.classList.contains("upload-info-icon")) {
1321
- !e || !c.contains(e) ? i(null) : e.closest(".upload-info-icon") || i(null);
1314
+ }, I = ($) => {
1315
+ const w = $.target?.closest(".upload-info-icon"), e = $.relatedTarget;
1316
+ if (w && w.classList.contains("upload-info-icon")) {
1317
+ !e || !u.contains(e) ? i(null) : e.closest(".upload-info-icon") || i(null);
1322
1318
  return;
1323
1319
  }
1324
- const A = E.target?.closest('[data-type="upload"]');
1325
- if (A) {
1326
- const g = e;
1327
- if (g && A.contains(g))
1320
+ const q = $.target?.closest('[data-type="upload"]');
1321
+ if (q) {
1322
+ const f = e;
1323
+ if (f && q.contains(f))
1328
1324
  return;
1329
1325
  i(null);
1330
1326
  }
1331
1327
  };
1332
- return c.addEventListener("mouseover", k, !0), c.addEventListener("mouseout", L, !0), () => {
1333
- c.removeEventListener("mouseover", k, !0), c.removeEventListener("mouseout", L, !0);
1328
+ return u.addEventListener("mouseover", T, !0), u.addEventListener("mouseout", I, !0), () => {
1329
+ u.removeEventListener("mouseover", T, !0), u.removeEventListener("mouseout", I, !0);
1334
1330
  };
1335
- }, [y, u, t, i]);
1331
+ }, [x, d, t, i]);
1336
1332
  }
1337
- function $t(t, y, u, i) {
1338
- ae(() => {
1333
+ function _t(t, x, d, i) {
1334
+ de(() => {
1339
1335
  if (!t.current) return;
1340
- const c = (C) => {
1336
+ const u = (w) => {
1341
1337
  if (i === "hideTagClose")
1342
1338
  return;
1343
- const e = C.currentTarget, A = e.dataset.tooltip, g = e.dataset.tagKey || "";
1344
- A && u({ key: g, anchorEl: e, type: "tag" });
1345
- }, k = () => {
1346
- u(null);
1339
+ const e = w.currentTarget, q = e.dataset.tooltip, f = e.dataset.tagKey || "";
1340
+ q && d({ key: f, anchorEl: e, type: "tag" });
1341
+ }, T = () => {
1342
+ d(null);
1347
1343
  };
1348
- let L;
1349
- const E = () => {
1344
+ let I;
1345
+ const $ = () => {
1350
1346
  if (!t.current) return;
1351
1347
  t.current.querySelectorAll(
1352
1348
  ".tag-node[data-tooltip]"
1353
1349
  ).forEach((e) => {
1354
- e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", k);
1350
+ e.addEventListener("mouseenter", u), e.addEventListener("mouseleave", T);
1355
1351
  });
1356
1352
  };
1357
- return L = requestAnimationFrame(() => {
1358
- L = requestAnimationFrame(E);
1353
+ return I = requestAnimationFrame(() => {
1354
+ I = requestAnimationFrame($);
1359
1355
  }), () => {
1360
- cancelAnimationFrame(L), t.current && t.current.querySelectorAll(
1356
+ cancelAnimationFrame(I), t.current && t.current.querySelectorAll(
1361
1357
  ".tag-node[data-tooltip]"
1362
1358
  ).forEach((e) => {
1363
- e.removeEventListener("mouseenter", c), e.removeEventListener("mouseleave", k);
1359
+ e.removeEventListener("mouseenter", u), e.removeEventListener("mouseleave", T);
1364
1360
  });
1365
1361
  };
1366
- }, [y, t, u, i]);
1362
+ }, [x, t, d, i]);
1367
1363
  }
1368
- function Nt(t, y, u) {
1369
- ae(() => {
1364
+ function Dt(t, x, d) {
1365
+ de(() => {
1370
1366
  const i = t.current;
1371
1367
  if (!i) return;
1372
- const c = (L) => {
1373
- const E = L.target?.closest(".variable-info-icon");
1374
- if (E && E.classList.contains("variable-info-icon")) {
1375
- const C = E.dataset.variableKey;
1376
- C && u({ key: C, anchorEl: E, type: "variable" });
1377
- }
1378
- }, k = (L) => {
1379
- const E = L.target?.closest(".variable-info-icon"), C = L.relatedTarget;
1380
- E && E.classList.contains("variable-info-icon") && (!C || !i.contains(C) ? u(null) : C.closest(".variable-info-icon") || u(null));
1368
+ const u = (I) => {
1369
+ const $ = I.target?.closest(".variable-info-icon");
1370
+ if ($ && $.classList.contains("variable-info-icon")) {
1371
+ const w = $.dataset.variableKey;
1372
+ w && d({ key: w, anchorEl: $, type: "variable" });
1373
+ }
1374
+ }, T = (I) => {
1375
+ const $ = I.target?.closest(".variable-info-icon"), w = I.relatedTarget;
1376
+ $ && $.classList.contains("variable-info-icon") && (!w || !i.contains(w) ? d(null) : w.closest(".variable-info-icon") || d(null));
1381
1377
  };
1382
- return i.addEventListener("mouseover", c, !0), i.addEventListener("mouseout", k, !0), () => {
1383
- i.removeEventListener("mouseover", c, !0), i.removeEventListener("mouseout", k, !0);
1378
+ return i.addEventListener("mouseover", u, !0), i.addEventListener("mouseout", T, !0), () => {
1379
+ i.removeEventListener("mouseover", u, !0), i.removeEventListener("mouseout", T, !0);
1384
1380
  };
1385
- }, [y, t, u]);
1381
+ }, [x, t, d]);
1386
1382
  }
1387
- function St(t, y, u, i) {
1388
- ae(() => {
1383
+ function It(t, x, d, i) {
1384
+ de(() => {
1389
1385
  if (!t.current) return;
1390
- const c = (C) => {
1391
- const e = C.currentTarget;
1386
+ const u = (w) => {
1387
+ const e = w.currentTarget;
1392
1388
  e.dataset.fileName && i({ key: "", anchorEl: e, type: "upload-label" });
1393
- }, k = () => {
1389
+ }, T = () => {
1394
1390
  i(null);
1395
1391
  };
1396
- let L;
1397
- const E = () => {
1392
+ let I;
1393
+ const $ = () => {
1398
1394
  if (!t.current) return;
1399
1395
  t.current.querySelectorAll(
1400
1396
  ".upload-label[data-file-name]"
1401
1397
  ).forEach((e) => {
1402
- e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", k);
1398
+ e.addEventListener("mouseenter", u), e.addEventListener("mouseleave", T);
1403
1399
  });
1404
1400
  };
1405
- return L = requestAnimationFrame(() => {
1406
- L = requestAnimationFrame(E);
1401
+ return I = requestAnimationFrame(() => {
1402
+ I = requestAnimationFrame($);
1407
1403
  }), () => {
1408
- cancelAnimationFrame(L), t.current && t.current.querySelectorAll(
1404
+ cancelAnimationFrame(I), t.current && t.current.querySelectorAll(
1409
1405
  ".upload-label[data-file-name]"
1410
1406
  ).forEach((e) => {
1411
- e.removeEventListener("mouseenter", c), e.removeEventListener("mouseleave", k);
1407
+ e.removeEventListener("mouseenter", u), e.removeEventListener("mouseleave", T);
1412
1408
  });
1413
1409
  };
1414
- }, [y, u, t, i]);
1410
+ }, [x, d, t, i]);
1415
1411
  }
1416
- function At(t, y, u, i) {
1417
- ae(() => {
1418
- const c = setTimeout(() => {
1419
- Te(t, y, u), $e(t, y, u, i);
1412
+ function Mt(t, x, d, i) {
1413
+ de(() => {
1414
+ const u = setTimeout(() => {
1415
+ Be(t, x, d), Pe(t, x, d, i);
1420
1416
  }, 0);
1421
- return () => clearTimeout(c);
1422
- }, [u, y, t, i]), ae(() => {
1423
- const c = t.current;
1424
- if (!c) return;
1425
- const k = (L) => {
1426
- const E = L.target;
1427
- E && E.matches('[data-type="select"]') && (Te(t, y, u), $e(t, y, u, i));
1428
- };
1429
- return c.addEventListener("change", k, !0), () => {
1430
- c.removeEventListener("change", k, !0);
1431
- };
1432
- }, [y, u, t, i]);
1417
+ return () => clearTimeout(u);
1418
+ }, [d, x, t, i]);
1433
1419
  }
1434
- function Lt(t, y) {
1435
- ae(() => {
1420
+ function Vt(t, x) {
1421
+ const d = Q(0);
1422
+ de(() => {
1436
1423
  if (!t.current) return;
1437
- let u = !1, i = 0;
1438
- const c = () => {
1439
- u = !0;
1440
- }, k = () => {
1441
- u = !1, i = Date.now();
1424
+ let i = !1, u = 0;
1425
+ const T = (a) => a instanceof HTMLElement ? !!(a.closest(".rte-datepicker-wrapper") || a.closest(".rte-datepicker-host") || a.closest(".ant-picker") || a.closest(".ant-picker-dropdown")) : !1, I = (a) => {
1426
+ i = !0, T(a.target) && (d.current = Date.now(), console.log("[SelectionCtrl] mousedown on datepicker target"));
1427
+ }, $ = () => {
1428
+ i = !1, u = Date.now();
1442
1429
  };
1443
- let L = !1, E = 0;
1444
- const C = () => {
1445
- L = !0;
1446
- }, e = () => {
1447
- L = !1, E = Date.now();
1448
- }, A = () => {
1449
- E = Date.now();
1450
- }, g = () => {
1430
+ let w = !1, e = 0;
1431
+ const q = () => {
1432
+ w = !0;
1433
+ }, f = () => {
1434
+ w = !1, e = Date.now();
1435
+ }, s = () => {
1436
+ e = Date.now();
1437
+ }, r = (a) => {
1438
+ T(a.target) && (d.current = Date.now(), console.log("[SelectionCtrl] focusin datepicker target"));
1439
+ }, n = () => {
1440
+ if (Date.now() - d.current < 800) {
1441
+ console.log("[SelectionCtrl] skip selectionchange due to recent datepicker interaction");
1442
+ return;
1443
+ }
1444
+ const a = document.activeElement;
1445
+ if (a && (a.closest(".rte-datepicker-wrapper") || a.closest(".rte-datepicker-host") || a.closest(".ant-picker-dropdown") || // Antd dropdown
1446
+ a.tagName === "INPUT" && a.closest(".ant-picker"))) {
1447
+ console.log("[SelectionCtrl] activeElement is datepicker; skip");
1448
+ return;
1449
+ }
1451
1450
  if (!t.current) return;
1452
- const a = window.getSelection();
1453
- if (!a || a.rangeCount === 0 || y.current || u || L || Date.now() - E < 500)
1451
+ const p = window.getSelection();
1452
+ if (!p || p.rangeCount === 0 || x.current || i || w || Date.now() - e < 500)
1454
1453
  return;
1455
- const n = a.getRangeAt(0);
1456
- if (!n.collapsed)
1457
- return t.current.contains(n.commonAncestorContainer), void 0;
1458
- const o = a.anchorNode;
1459
- if (!o || !t.current.contains(o))
1454
+ const y = p.getRangeAt(0);
1455
+ if (!y.collapsed)
1456
+ return t.current.contains(y.commonAncestorContainer), void 0;
1457
+ const g = p.anchorNode;
1458
+ if (!g || !t.current.contains(g))
1460
1459
  return;
1461
- let r = null;
1462
- if (o.nodeType === Node.ELEMENT_NODE ? r = o.closest('[data-type="variable"]') : o.nodeType === Node.TEXT_NODE && o.parentElement && (r = o.parentElement.closest('[data-type="variable"]')), !r) {
1463
- if (Date.now() - i > 500)
1460
+ let b = !1;
1461
+ if (g.nodeType === Node.ELEMENT_NODE) {
1462
+ const k = g;
1463
+ (k.closest('[data-type="datepicker"]') || k.closest(".rte-datepicker-wrapper") || k.closest(".rte-datepicker-host")) && (b = !0);
1464
+ } else if (g.parentElement) {
1465
+ const k = g.parentElement;
1466
+ (k.closest('[data-type="datepicker"]') || k.closest(".rte-datepicker-wrapper") || k.closest(".rte-datepicker-host")) && (b = !0);
1467
+ }
1468
+ if (b)
1469
+ return;
1470
+ let V = null;
1471
+ if (g.nodeType === Node.ELEMENT_NODE ? V = g.closest('[data-type="variable"]') : g.nodeType === Node.TEXT_NODE && g.parentElement && (V = g.parentElement.closest('[data-type="variable"]')), !V) {
1472
+ if (Date.now() - u > 500)
1464
1473
  return;
1465
- const s = t.current.querySelectorAll('[data-type="variable"]');
1466
- if (s.length > 0) {
1467
- let d = null;
1468
- for (const h of Array.from(s))
1469
- if (h.style.display !== "none") {
1470
- d = h;
1474
+ const k = t.current.querySelectorAll('[data-type="variable"]');
1475
+ if (k.length > 0) {
1476
+ let P = null;
1477
+ for (const H of Array.from(k))
1478
+ if (H.style.display !== "none") {
1479
+ P = H;
1471
1480
  break;
1472
1481
  }
1473
- if (!d && s.length > 0 && (d = s[0]), d) {
1474
- const h = document.createRange();
1475
- h.selectNodeContents(d), h.collapse(!1), a.removeAllRanges(), a.addRange(h), d.focus();
1482
+ if (!P && k.length > 0 && (P = k[0]), P) {
1483
+ const H = document.createRange();
1484
+ H.selectNodeContents(P), H.collapse(!1), p.removeAllRanges(), p.addRange(H), P.focus();
1476
1485
  } else
1477
- a.removeAllRanges();
1486
+ p.removeAllRanges();
1478
1487
  } else
1479
- a.removeAllRanges();
1488
+ p.removeAllRanges();
1480
1489
  }
1481
- }, l = t.current;
1482
- return l && (l.addEventListener("compositionstart", C), l.addEventListener("compositionend", e), l.addEventListener("input", A)), document.addEventListener("mousedown", c), document.addEventListener("mouseup", k), document.addEventListener("selectionchange", g), () => {
1490
+ }, o = t.current;
1491
+ return o && (o.addEventListener("compositionstart", q), o.addEventListener("compositionend", f), o.addEventListener("input", s)), document.addEventListener("mousedown", I), document.addEventListener("mouseup", $), document.addEventListener("focusin", r), document.addEventListener("selectionchange", n), () => {
1483
1492
  const a = t.current;
1484
- a && (a.removeEventListener("compositionstart", C), a.removeEventListener("compositionend", e), a.removeEventListener("input", A)), document.removeEventListener("mousedown", c), document.removeEventListener("mouseup", k), document.removeEventListener("selectionchange", g);
1493
+ a && (a.removeEventListener("compositionstart", q), a.removeEventListener("compositionend", f), a.removeEventListener("input", s)), document.removeEventListener("mousedown", I), document.removeEventListener("mouseup", $), document.removeEventListener("focusin", r), document.removeEventListener("selectionchange", n);
1485
1494
  };
1486
- }, [t, y]);
1495
+ }, [t, x]);
1496
+ }
1497
+ function Bt(t) {
1498
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1499
+ }
1500
+ var De = { exports: {} }, Pt = De.exports, je;
1501
+ function Ot() {
1502
+ return je || (je = 1, function(t, x) {
1503
+ (function(d, i) {
1504
+ t.exports = i();
1505
+ })(Pt, function() {
1506
+ var d = 1e3, i = 6e4, u = 36e5, T = "millisecond", I = "second", $ = "minute", w = "hour", e = "day", q = "week", f = "month", s = "quarter", r = "year", n = "date", o = "Invalid Date", a = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, p = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, y = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(l) {
1507
+ var c = ["th", "st", "nd", "rd"], v = l % 100;
1508
+ return "[" + l + (c[(v - 20) % 10] || c[v] || c[0]) + "]";
1509
+ } }, g = function(l, c, v) {
1510
+ var L = String(l);
1511
+ return !L || L.length >= c ? l : "" + Array(c + 1 - L.length).join(v) + l;
1512
+ }, b = { s: g, z: function(l) {
1513
+ var c = -l.utcOffset(), v = Math.abs(c), L = Math.floor(v / 60), N = v % 60;
1514
+ return (c <= 0 ? "+" : "-") + g(L, 2, "0") + ":" + g(N, 2, "0");
1515
+ }, m: function l(c, v) {
1516
+ if (c.date() < v.date()) return -l(v, c);
1517
+ var L = 12 * (v.year() - c.year()) + (v.month() - c.month()), N = c.clone().add(L, f), W = v - N < 0, z = c.clone().add(L + (W ? -1 : 1), f);
1518
+ return +(-(L + (v - N) / (W ? N - z : z - N)) || 0);
1519
+ }, a: function(l) {
1520
+ return l < 0 ? Math.ceil(l) || 0 : Math.floor(l);
1521
+ }, p: function(l) {
1522
+ return { M: f, y: r, w: q, d: e, D: n, h: w, m: $, s: I, ms: T, Q: s }[l] || String(l || "").toLowerCase().replace(/s$/, "");
1523
+ }, u: function(l) {
1524
+ return l === void 0;
1525
+ } }, V = "en", k = {};
1526
+ k[V] = y;
1527
+ var P = "$isDayjsObject", H = function(l) {
1528
+ return l instanceof ee || !(!l || !l[P]);
1529
+ }, F = function l(c, v, L) {
1530
+ var N;
1531
+ if (!c) return V;
1532
+ if (typeof c == "string") {
1533
+ var W = c.toLowerCase();
1534
+ k[W] && (N = W), v && (k[W] = v, N = W);
1535
+ var z = c.split("-");
1536
+ if (!N && z.length > 1) return l(z[0]);
1537
+ } else {
1538
+ var te = c.name;
1539
+ k[te] = c, N = te;
1540
+ }
1541
+ return !L && N && (V = N), N || !L && V;
1542
+ }, U = function(l, c) {
1543
+ if (H(l)) return l.clone();
1544
+ var v = typeof c == "object" ? c : {};
1545
+ return v.date = l, v.args = arguments, new ee(v);
1546
+ }, R = b;
1547
+ R.l = F, R.i = H, R.w = function(l, c) {
1548
+ return U(l, { locale: c.$L, utc: c.$u, x: c.$x, $offset: c.$offset });
1549
+ };
1550
+ var ee = function() {
1551
+ function l(v) {
1552
+ this.$L = F(v.locale, null, !0), this.parse(v), this.$x = this.$x || v.x || {}, this[P] = !0;
1553
+ }
1554
+ var c = l.prototype;
1555
+ return c.parse = function(v) {
1556
+ this.$d = function(L) {
1557
+ var N = L.date, W = L.utc;
1558
+ if (N === null) return /* @__PURE__ */ new Date(NaN);
1559
+ if (R.u(N)) return /* @__PURE__ */ new Date();
1560
+ if (N instanceof Date) return new Date(N);
1561
+ if (typeof N == "string" && !/Z$/i.test(N)) {
1562
+ var z = N.match(a);
1563
+ if (z) {
1564
+ var te = z[2] - 1 || 0, se = (z[7] || "0").substring(0, 3);
1565
+ return W ? new Date(Date.UTC(z[1], te, z[3] || 1, z[4] || 0, z[5] || 0, z[6] || 0, se)) : new Date(z[1], te, z[3] || 1, z[4] || 0, z[5] || 0, z[6] || 0, se);
1566
+ }
1567
+ }
1568
+ return new Date(N);
1569
+ }(v), this.init();
1570
+ }, c.init = function() {
1571
+ var v = this.$d;
1572
+ this.$y = v.getFullYear(), this.$M = v.getMonth(), this.$D = v.getDate(), this.$W = v.getDay(), this.$H = v.getHours(), this.$m = v.getMinutes(), this.$s = v.getSeconds(), this.$ms = v.getMilliseconds();
1573
+ }, c.$utils = function() {
1574
+ return R;
1575
+ }, c.isValid = function() {
1576
+ return this.$d.toString() !== o;
1577
+ }, c.isSame = function(v, L) {
1578
+ var N = U(v);
1579
+ return this.startOf(L) <= N && N <= this.endOf(L);
1580
+ }, c.isAfter = function(v, L) {
1581
+ return U(v) < this.startOf(L);
1582
+ }, c.isBefore = function(v, L) {
1583
+ return this.endOf(L) < U(v);
1584
+ }, c.$g = function(v, L, N) {
1585
+ return R.u(v) ? this[L] : this.set(N, v);
1586
+ }, c.unix = function() {
1587
+ return Math.floor(this.valueOf() / 1e3);
1588
+ }, c.valueOf = function() {
1589
+ return this.$d.getTime();
1590
+ }, c.startOf = function(v, L) {
1591
+ var N = this, W = !!R.u(L) || L, z = R.p(v), te = function(he, ye) {
1592
+ var xe = R.w(N.$u ? Date.UTC(N.$y, ye, he) : new Date(N.$y, ye, he), N);
1593
+ return W ? xe : xe.endOf(e);
1594
+ }, se = function(he, ye) {
1595
+ return R.w(N.toDate()[he].apply(N.toDate("s"), (W ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ye)), N);
1596
+ }, ce = this.$W, pe = this.$M, fe = this.$D, be = "set" + (this.$u ? "UTC" : "");
1597
+ switch (z) {
1598
+ case r:
1599
+ return W ? te(1, 0) : te(31, 11);
1600
+ case f:
1601
+ return W ? te(1, pe) : te(0, pe + 1);
1602
+ case q:
1603
+ var X = this.$locale().weekStart || 0, ue = (ce < X ? ce + 7 : ce) - X;
1604
+ return te(W ? fe - ue : fe + (6 - ue), pe);
1605
+ case e:
1606
+ case n:
1607
+ return se(be + "Hours", 0);
1608
+ case w:
1609
+ return se(be + "Minutes", 1);
1610
+ case $:
1611
+ return se(be + "Seconds", 2);
1612
+ case I:
1613
+ return se(be + "Milliseconds", 3);
1614
+ default:
1615
+ return this.clone();
1616
+ }
1617
+ }, c.endOf = function(v) {
1618
+ return this.startOf(v, !1);
1619
+ }, c.$set = function(v, L) {
1620
+ var N, W = R.p(v), z = "set" + (this.$u ? "UTC" : ""), te = (N = {}, N[e] = z + "Date", N[n] = z + "Date", N[f] = z + "Month", N[r] = z + "FullYear", N[w] = z + "Hours", N[$] = z + "Minutes", N[I] = z + "Seconds", N[T] = z + "Milliseconds", N)[W], se = W === e ? this.$D + (L - this.$W) : L;
1621
+ if (W === f || W === r) {
1622
+ var ce = this.clone().set(n, 1);
1623
+ ce.$d[te](se), ce.init(), this.$d = ce.set(n, Math.min(this.$D, ce.daysInMonth())).$d;
1624
+ } else te && this.$d[te](se);
1625
+ return this.init(), this;
1626
+ }, c.set = function(v, L) {
1627
+ return this.clone().$set(v, L);
1628
+ }, c.get = function(v) {
1629
+ return this[R.p(v)]();
1630
+ }, c.add = function(v, L) {
1631
+ var N, W = this;
1632
+ v = Number(v);
1633
+ var z = R.p(L), te = function(pe) {
1634
+ var fe = U(W);
1635
+ return R.w(fe.date(fe.date() + Math.round(pe * v)), W);
1636
+ };
1637
+ if (z === f) return this.set(f, this.$M + v);
1638
+ if (z === r) return this.set(r, this.$y + v);
1639
+ if (z === e) return te(1);
1640
+ if (z === q) return te(7);
1641
+ var se = (N = {}, N[$] = i, N[w] = u, N[I] = d, N)[z] || 1, ce = this.$d.getTime() + v * se;
1642
+ return R.w(ce, this);
1643
+ }, c.subtract = function(v, L) {
1644
+ return this.add(-1 * v, L);
1645
+ }, c.format = function(v) {
1646
+ var L = this, N = this.$locale();
1647
+ if (!this.isValid()) return N.invalidDate || o;
1648
+ var W = v || "YYYY-MM-DDTHH:mm:ssZ", z = R.z(this), te = this.$H, se = this.$m, ce = this.$M, pe = N.weekdays, fe = N.months, be = N.meridiem, X = function(ye, xe, we, Ce) {
1649
+ return ye && (ye[xe] || ye(L, W)) || we[xe].slice(0, Ce);
1650
+ }, ue = function(ye) {
1651
+ return R.s(te % 12 || 12, ye, "0");
1652
+ }, he = be || function(ye, xe, we) {
1653
+ var Ce = ye < 12 ? "AM" : "PM";
1654
+ return we ? Ce.toLowerCase() : Ce;
1655
+ };
1656
+ return W.replace(p, function(ye, xe) {
1657
+ return xe || function(we) {
1658
+ switch (we) {
1659
+ case "YY":
1660
+ return String(L.$y).slice(-2);
1661
+ case "YYYY":
1662
+ return R.s(L.$y, 4, "0");
1663
+ case "M":
1664
+ return ce + 1;
1665
+ case "MM":
1666
+ return R.s(ce + 1, 2, "0");
1667
+ case "MMM":
1668
+ return X(N.monthsShort, ce, fe, 3);
1669
+ case "MMMM":
1670
+ return X(fe, ce);
1671
+ case "D":
1672
+ return L.$D;
1673
+ case "DD":
1674
+ return R.s(L.$D, 2, "0");
1675
+ case "d":
1676
+ return String(L.$W);
1677
+ case "dd":
1678
+ return X(N.weekdaysMin, L.$W, pe, 2);
1679
+ case "ddd":
1680
+ return X(N.weekdaysShort, L.$W, pe, 3);
1681
+ case "dddd":
1682
+ return pe[L.$W];
1683
+ case "H":
1684
+ return String(te);
1685
+ case "HH":
1686
+ return R.s(te, 2, "0");
1687
+ case "h":
1688
+ return ue(1);
1689
+ case "hh":
1690
+ return ue(2);
1691
+ case "a":
1692
+ return he(te, se, !0);
1693
+ case "A":
1694
+ return he(te, se, !1);
1695
+ case "m":
1696
+ return String(se);
1697
+ case "mm":
1698
+ return R.s(se, 2, "0");
1699
+ case "s":
1700
+ return String(L.$s);
1701
+ case "ss":
1702
+ return R.s(L.$s, 2, "0");
1703
+ case "SSS":
1704
+ return R.s(L.$ms, 3, "0");
1705
+ case "Z":
1706
+ return z;
1707
+ }
1708
+ return null;
1709
+ }(ye) || z.replace(":", "");
1710
+ });
1711
+ }, c.utcOffset = function() {
1712
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
1713
+ }, c.diff = function(v, L, N) {
1714
+ var W, z = this, te = R.p(L), se = U(v), ce = (se.utcOffset() - this.utcOffset()) * i, pe = this - se, fe = function() {
1715
+ return R.m(z, se);
1716
+ };
1717
+ switch (te) {
1718
+ case r:
1719
+ W = fe() / 12;
1720
+ break;
1721
+ case f:
1722
+ W = fe();
1723
+ break;
1724
+ case s:
1725
+ W = fe() / 3;
1726
+ break;
1727
+ case q:
1728
+ W = (pe - ce) / 6048e5;
1729
+ break;
1730
+ case e:
1731
+ W = (pe - ce) / 864e5;
1732
+ break;
1733
+ case w:
1734
+ W = pe / u;
1735
+ break;
1736
+ case $:
1737
+ W = pe / i;
1738
+ break;
1739
+ case I:
1740
+ W = pe / d;
1741
+ break;
1742
+ default:
1743
+ W = pe;
1744
+ }
1745
+ return N ? W : R.a(W);
1746
+ }, c.daysInMonth = function() {
1747
+ return this.endOf(f).$D;
1748
+ }, c.$locale = function() {
1749
+ return k[this.$L];
1750
+ }, c.locale = function(v, L) {
1751
+ if (!v) return this.$L;
1752
+ var N = this.clone(), W = F(v, L, !0);
1753
+ return W && (N.$L = W), N;
1754
+ }, c.clone = function() {
1755
+ return R.w(this.$d, this);
1756
+ }, c.toDate = function() {
1757
+ return new Date(this.valueOf());
1758
+ }, c.toJSON = function() {
1759
+ return this.isValid() ? this.toISOString() : null;
1760
+ }, c.toISOString = function() {
1761
+ return this.$d.toISOString();
1762
+ }, c.toString = function() {
1763
+ return this.$d.toUTCString();
1764
+ }, l;
1765
+ }(), re = ee.prototype;
1766
+ return U.prototype = re, [["$ms", T], ["$s", I], ["$m", $], ["$H", w], ["$W", e], ["$M", f], ["$y", r], ["$D", n]].forEach(function(l) {
1767
+ re[l[1]] = function(c) {
1768
+ return this.$g(c, l[0], l[1]);
1769
+ };
1770
+ }), U.extend = function(l, c) {
1771
+ return l.$i || (l(c, ee, U), l.$i = !0), U;
1772
+ }, U.locale = F, U.isDayjs = H, U.unix = function(l) {
1773
+ return U(1e3 * l);
1774
+ }, U.en = k[V], U.Ls = k, U.p = {}, U;
1775
+ });
1776
+ }(De)), De.exports;
1487
1777
  }
1488
- const It = ({
1778
+ var Rt = Ot();
1779
+ const Ve = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, onChange: x }) => {
1780
+ const d = t.dataset.key, i = t.dataset.value, u = t.dataset.placeholder, T = t.dataset.limitRange ? parseInt(t.dataset.limitRange, 10) : void 0, I = t.dataset.disableFuture === "true", [$, w] = ne(() => {
1781
+ if (!i) return null;
1782
+ const o = i.split(",");
1783
+ return o.length === 2 && o[0] && o[1] ? [Ve(o[0]), Ve(o[1])] : null;
1784
+ }), [e, q] = ne(null);
1785
+ return Xe(
1786
+ /* @__PURE__ */ E("div", { className: "rte-datepicker-wrapper", contentEditable: !1, style: { display: "inline-block", verticalAlign: "middle", width: "240px" }, children: /* @__PURE__ */ E(
1787
+ Gt,
1788
+ {
1789
+ value: $,
1790
+ disabledDate: (o) => o ? I && o.isAfter(Ve(), "day") ? !0 : !T || !e || !e[0] ? !1 : Math.abs(o.diff(e[0], "days")) > T : !1,
1791
+ onCalendarChange: (o) => {
1792
+ console.log("[DatePicker] onCalendarChange", o?.map((a) => a?.format("YYYY-MM-DD") || null)), q(o);
1793
+ },
1794
+ onChange: (o) => {
1795
+ if (console.log("[DatePicker] onChange", o?.map((a) => a?.format("YYYY-MM-DD") || null)), w(o), q(null), o && o[0] && o[1]) {
1796
+ const a = `${o[0].format("YYYY-MM-DD")},${o[1].format("YYYY-MM-DD")}`;
1797
+ t.setAttribute("data-value", a), x(d, a);
1798
+ } else
1799
+ t.setAttribute("data-value", ""), x(d, "");
1800
+ },
1801
+ onOpenChange: (o) => {
1802
+ console.log("[DatePicker] onOpenChange", o), q(o ? $ : null);
1803
+ },
1804
+ placeholder: [u || "开始日期", u || "结束日期"],
1805
+ style: { width: "100%" },
1806
+ size: "small",
1807
+ allowClear: !0,
1808
+ getPopupContainer: () => document.body,
1809
+ popupClassName: "rte-datepicker-dropdown"
1810
+ }
1811
+ ) }),
1812
+ t
1813
+ );
1814
+ }, Ft = (t) => {
1815
+ const [x, d] = ne([]);
1816
+ return de(() => {
1817
+ const i = t.current;
1818
+ if (!i) return;
1819
+ const u = () => {
1820
+ const I = i.querySelectorAll(".rte-datepicker-host"), $ = [];
1821
+ I.forEach((w) => {
1822
+ const e = w.getAttribute("data-key");
1823
+ e && $.push(
1824
+ /* @__PURE__ */ E(
1825
+ Ht,
1826
+ {
1827
+ host: w,
1828
+ onChange: () => {
1829
+ if (t.current) {
1830
+ const q = new Event("input", { bubbles: !0 });
1831
+ t.current.dispatchEvent(q);
1832
+ }
1833
+ }
1834
+ },
1835
+ `datepicker-${e}`
1836
+ )
1837
+ );
1838
+ }), d($);
1839
+ };
1840
+ u();
1841
+ const T = new MutationObserver((I) => {
1842
+ let $ = !1;
1843
+ for (const w of I)
1844
+ if (w.type === "childList") {
1845
+ let e = !1;
1846
+ if (w.addedNodes.forEach((q) => {
1847
+ if (q.nodeType === Node.ELEMENT_NODE) {
1848
+ const f = q;
1849
+ (f.classList?.contains("rte-datepicker-host") || f.querySelector?.(".rte-datepicker-host")) && (e = !0);
1850
+ }
1851
+ }), w.removedNodes.forEach((q) => {
1852
+ if (q.nodeType === Node.ELEMENT_NODE) {
1853
+ const f = q;
1854
+ (f.classList?.contains("rte-datepicker-host") || f.querySelector?.(".rte-datepicker-host")) && (e = !0);
1855
+ }
1856
+ }), e) {
1857
+ $ = !0;
1858
+ break;
1859
+ }
1860
+ }
1861
+ $ && u();
1862
+ });
1863
+ return T.observe(i, { childList: !0, subtree: !0 }), () => T.disconnect();
1864
+ }, [t]), x;
1865
+ }, zt = ({
1489
1866
  config: t,
1490
- onSend: y,
1491
- isProcessing: u = !1,
1867
+ onSend: x,
1868
+ isProcessing: d = !1,
1492
1869
  disabled: i = !1,
1493
- width: c,
1494
- lockStructure: k = !1,
1495
- agentOptions: L = [],
1496
- onAgentSelect: E,
1497
- onAgentExit: C,
1870
+ width: u,
1871
+ lockStructure: T = !1,
1872
+ agentOptions: I = [],
1873
+ onAgentSelect: $,
1874
+ onAgentExit: w,
1498
1875
  loading: e = !1,
1499
- placeholder: A,
1500
- border: g,
1501
- background: l = "transparent",
1502
- hideButtons: a
1876
+ placeholder: q,
1877
+ border: f,
1878
+ background: s = "transparent",
1879
+ hideButtons: r
1503
1880
  }) => {
1504
- const n = j(null), o = j(null), [r, s] = X({}), [d, h] = X(null), [x, G] = X(null), T = j(!1), _ = j(null), [H, D] = X(!1), K = j(null), [Q, Y] = X(!0), [te, N] = X(() => {
1505
- const p = {};
1506
- return t.forEach((f) => {
1507
- f.type === "multi-variable" && f.key && (p[f.key] = 1);
1508
- }), p;
1509
- }), M = j({}), ne = j({}), re = j({});
1510
- ae(() => {
1511
- ne.current = r;
1512
- }, [r]), ae(() => {
1513
- re.current = te;
1514
- }, [te]);
1515
- const ce = U((p) => p.find((v) => v.type === "tag")?.text || null, []), ye = j(t), ue = j(null);
1516
- ae(() => {
1517
- const p = ce(ye.current), f = ce(t);
1518
- if (p && p !== f && n.current) {
1519
- const v = {};
1520
- n.current.querySelectorAll('[data-type="variable"]').forEach((w) => {
1521
- const B = w.dataset.key;
1522
- if (B) {
1523
- const $ = w.innerText.replace(/[\u200B\n]/g, "").trim();
1524
- $ && (v[B] = $);
1881
+ const n = Q(null), o = Q(null), [a, p] = ne({}), [y, g] = ne(null), [b, V] = ne(null), k = Q(!1), P = Q(null), [H, F] = ne(!1), U = Q(null), [R, ee] = ne(!0), [re, l] = ne(() => {
1882
+ const h = {};
1883
+ return t.forEach((m) => {
1884
+ m.type === "multi-variable" && m.key && (h[m.key] = 1);
1885
+ }), h;
1886
+ }), c = Q({}), v = Q({}), L = Q({});
1887
+ de(() => {
1888
+ v.current = a;
1889
+ }, [a]), de(() => {
1890
+ L.current = re;
1891
+ }, [re]);
1892
+ const N = ae((h) => h.find((C) => C.type === "tag")?.text || null, []), W = Q(t), z = Q(null);
1893
+ de(() => {
1894
+ const h = N(W.current), m = N(t);
1895
+ if (h && h !== m && n.current) {
1896
+ const C = {};
1897
+ n.current.querySelectorAll('[data-type="variable"]').forEach((A) => {
1898
+ const G = A.dataset.key;
1899
+ if (G) {
1900
+ const D = A.innerText.replace(/[\u200B\n]/g, "").trim();
1901
+ D && (C[G] = D);
1525
1902
  }
1526
- }), n.current.querySelectorAll('[data-type="select"]').forEach((w) => {
1527
- const B = w.dataset.key;
1528
- if (B) {
1529
- const $ = w.value.trim();
1530
- $ && (v[B] = $);
1903
+ }), n.current.querySelectorAll('[data-type="select"]').forEach((A) => {
1904
+ const G = A.dataset.key;
1905
+ if (G) {
1906
+ const D = A.value.trim();
1907
+ D && (C[G] = D);
1531
1908
  }
1532
- }), n.current.querySelectorAll('[data-type="textarea"]').forEach((w) => {
1533
- const B = w.dataset.key;
1534
- if (B) {
1535
- const $ = w.value.replace(/[\u200B]/g, "").trim();
1536
- $ && (v[B] = $);
1909
+ }), n.current.querySelectorAll('[data-type="textarea"]').forEach((A) => {
1910
+ const G = A.dataset.key;
1911
+ if (G) {
1912
+ const D = A.value.replace(/[\u200B]/g, "").trim();
1913
+ D && (C[G] = D);
1537
1914
  }
1538
- }), M.current[p] = {
1539
- variableValues: v,
1540
- files: { ...ne.current },
1541
- multiVariableCounts: { ...re.current }
1915
+ }), c.current[h] = {
1916
+ variableValues: C,
1917
+ files: { ...v.current },
1918
+ multiVariableCounts: { ...L.current }
1542
1919
  };
1543
1920
  }
1544
- if (f && M.current[f]) {
1545
- const v = M.current[f];
1546
- ue.current = v, s(v.files), N(v.multiVariableCounts);
1547
- } else if (f) {
1548
- ue.current = null;
1549
- const v = {};
1550
- t.forEach((S) => {
1551
- S.type === "multi-variable" && S.key && (v[S.key] = 1);
1552
- }), N(v), s({});
1921
+ if (m && c.current[m]) {
1922
+ const C = c.current[m];
1923
+ z.current = C, p(C.files), l(C.multiVariableCounts);
1924
+ } else if (m) {
1925
+ z.current = null;
1926
+ const C = {};
1927
+ t.forEach((M) => {
1928
+ M.type === "multi-variable" && M.key && (C[M.key] = 1);
1929
+ }), l(C), p({});
1553
1930
  } else
1554
- ue.current = null, N({}), s({});
1555
- ye.current = t;
1556
- }, [t, ce]), Re(() => {
1557
- ue.current && n.current && (n.current.__tempVariableValues = ue.current.variableValues, setTimeout(() => {
1558
- ue.current && (ue.current = null);
1931
+ z.current = null, l({}), p({});
1932
+ W.current = t;
1933
+ }, [t, N]), ze(() => {
1934
+ z.current && n.current && (n.current.__tempVariableValues = z.current.variableValues, setTimeout(() => {
1935
+ z.current && (z.current = null);
1559
1936
  }, 0));
1560
- }), Ct(n, t, r, k, te, K, void 0, a), Tt(n, t, r, G), $t(n, t, G, a), St(n, t, r, G), Nt(n, t, G), At(n, t, r, D), Lt(n, T), ae(() => {
1937
+ }), At(n, t, a, T, re, U, void 0, r), Lt(n, t, a, V), _t(n, t, V, r), It(n, t, a, V), Dt(n, t, V), Mt(n, t, a, F), Vt(n, k);
1938
+ const te = Ft(n);
1939
+ de(() => {
1561
1940
  if (t.length > 0) {
1562
- Y(!1);
1941
+ ee(!1);
1563
1942
  return;
1564
1943
  }
1565
- const p = () => {
1944
+ const h = () => {
1566
1945
  if (!n.current) {
1567
- Y(!0);
1946
+ ee(!0);
1568
1947
  return;
1569
1948
  }
1570
- const v = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", S = n.current.querySelectorAll('[data-type="variable"]'), b = n.current.querySelectorAll('[data-type="upload"]');
1571
- let q = !1;
1572
- S.forEach((B) => {
1573
- (B.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (q = !0);
1574
- }), b.forEach((B) => {
1575
- B.querySelector(".upload-inner-wrapper.has-file") && (q = !0);
1949
+ const C = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", M = n.current.querySelectorAll('[data-type="variable"]'), S = n.current.querySelectorAll('[data-type="upload"]');
1950
+ let _ = !1;
1951
+ M.forEach((G) => {
1952
+ (G.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (_ = !0);
1953
+ }), S.forEach((G) => {
1954
+ G.querySelector(".upload-inner-wrapper.has-file") && (_ = !0);
1576
1955
  });
1577
- const w = !v && !q;
1578
- Y(w), t.length === 0 && D(!w);
1956
+ const A = !C && !_;
1957
+ ee(A), t.length === 0 && F(!A);
1579
1958
  };
1580
- p();
1581
- const f = new MutationObserver(p);
1582
- return n.current && f.observe(n.current, {
1959
+ h();
1960
+ const m = new MutationObserver(h);
1961
+ return n.current && m.observe(n.current, {
1583
1962
  childList: !0,
1584
1963
  subtree: !0,
1585
1964
  characterData: !0
1586
1965
  }), () => {
1587
- f.disconnect();
1966
+ m.disconnect();
1588
1967
  };
1589
1968
  }, [t]);
1590
- const Ne = (p) => {
1969
+ const se = (h) => {
1591
1970
  if (i) {
1592
- p.preventDefault();
1971
+ h.preventDefault();
1593
1972
  return;
1594
1973
  }
1595
- p.preventDefault();
1596
- const f = p.clipboardData.getData("text/plain"), v = window.getSelection();
1597
- if (v && v.rangeCount > 0) {
1598
- const S = v.anchorNode;
1599
- if (S) {
1600
- let b = null;
1601
- if (S.nodeType === Node.ELEMENT_NODE ? b = S.closest('[data-type="variable"]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (b = S.parentElement.closest('[data-type="variable"]')), b) {
1602
- const q = b.dataset.multiKey;
1603
- if (q) {
1604
- const w = /[、,,\s\n\r\t]+/, B = f.split(w).map(($) => $.trim()).filter(($) => $.length > 0);
1605
- if (console.log("[Paste Event] 粘贴的内容:", f), console.log("[Paste Event] 拆分后的值:", B), B.length > 1) {
1606
- const $ = parseInt(b.dataset.index || "0", 10), P = t.find((ee) => ee.type === "multi-variable" && ee.key === q)?.maxCount || 9, z = te[q] || 1, I = Math.min($ + B.length, P);
1607
- I > z && N((F) => ({
1608
- ...F,
1609
- [q]: I
1974
+ h.preventDefault();
1975
+ const m = h.clipboardData.getData("text/plain"), C = window.getSelection();
1976
+ if (C && C.rangeCount > 0) {
1977
+ const M = C.anchorNode;
1978
+ if (M) {
1979
+ let S = null;
1980
+ if (M.nodeType === Node.ELEMENT_NODE ? S = M.closest('[data-type="variable"]') : M.nodeType === Node.TEXT_NODE && M.parentElement && (S = M.parentElement.closest('[data-type="variable"]')), S) {
1981
+ const _ = S.dataset.multiKey;
1982
+ if (_) {
1983
+ const A = /[、,,\s\n\r\t]+/, G = m.split(A).map((D) => D.trim()).filter((D) => D.length > 0);
1984
+ if (console.log("[Paste Event] 粘贴的内容:", m), console.log("[Paste Event] 拆分后的值:", G), G.length > 1) {
1985
+ const D = parseInt(S.dataset.index || "0", 10), j = t.find((le) => le.type === "multi-variable" && le.key === _)?.maxCount || 9, Y = re[_] || 1, B = Math.min(D + G.length, j);
1986
+ B > Y && l((J) => ({
1987
+ ...J,
1988
+ [_]: B
1610
1989
  }));
1611
- const R = [];
1612
- for (let F = 0; F < z; F++) {
1613
- const ee = `${q}_${F}`, se = n.current.querySelector(
1614
- `[data-type="variable"][data-key="${ee}"][data-multi-key="${q}"]`
1990
+ const K = [];
1991
+ for (let J = 0; J < Y; J++) {
1992
+ const le = `${_}_${J}`, ge = n.current.querySelector(
1993
+ `[data-type="variable"][data-key="${le}"][data-multi-key="${_}"]`
1615
1994
  );
1616
- if (se) {
1617
- const pe = se.innerText.replace(/[\u200B\n]/g, "").trim();
1618
- R.push(pe);
1995
+ if (ge) {
1996
+ const ke = ge.innerText.replace(/[\u200B\n]/g, "").trim();
1997
+ K.push(ke);
1619
1998
  }
1620
1999
  }
1621
- R.splice($, 1, ...B.slice(0, P - $));
1622
- const J = R.slice(0, P);
1623
- J.length > 0 && J[J.length - 1] !== "" && J.length < P && J.push("");
1624
- const V = Math.max(J.length, 1), Z = {};
1625
- J.forEach((F, ee) => {
1626
- F && (Z[`${q}_${ee}`] = F);
2000
+ K.splice(D, 1, ...G.slice(0, j - D));
2001
+ const oe = K.slice(0, j);
2002
+ oe.length > 0 && oe[oe.length - 1] !== "" && oe.length < j && oe.push("");
2003
+ const O = Math.max(oe.length, 1), ie = {};
2004
+ oe.forEach((J, le) => {
2005
+ J && (ie[`${_}_${le}`] = J);
1627
2006
  }), n.current.querySelectorAll(
1628
2007
  '[data-type="variable"]'
1629
- ).forEach((F) => {
1630
- const ee = F.dataset.key, se = F.dataset.multiKey;
1631
- if (ee && se !== q) {
1632
- const pe = F.innerText.replace(/[\u200B\n]/g, "").trim();
1633
- pe && (Z[ee] = pe);
2008
+ ).forEach((J) => {
2009
+ const le = J.dataset.key, ge = J.dataset.multiKey;
2010
+ if (le && ge !== _) {
2011
+ const ke = J.innerText.replace(/[\u200B\n]/g, "").trim();
2012
+ ke && (ie[le] = ke);
1634
2013
  }
1635
- }), n.current.__tempVariableValues = Z, N((F) => ({
1636
- ...F,
1637
- [q]: V
1638
- })), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", J);
2014
+ }), n.current.__tempVariableValues = ie, l((J) => ({
2015
+ ...J,
2016
+ [_]: O
2017
+ })), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", oe);
1639
2018
  return;
1640
- } else B.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
2019
+ } else G.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
1641
2020
  }
1642
2021
  }
1643
2022
  }
1644
2023
  }
1645
- document.execCommand("insertText", !1, f), de(), setTimeout(() => {
1646
- const S = window.getSelection();
1647
- if (S && S.rangeCount > 0) {
1648
- const b = S.anchorNode;
1649
- if (b) {
1650
- let q = null;
1651
- if (b.nodeType === Node.ELEMENT_NODE ? q = b.closest('[data-type="variable"][data-multi-key]') : b.nodeType === Node.TEXT_NODE && b.parentElement && (q = b.parentElement.closest('[data-type="variable"][data-multi-key]')), q) {
1652
- const w = q.innerText.replace(/[\u200B\n]/g, "").trim();
1653
- /[、,,\s]+/.test(w) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", w), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
2024
+ document.execCommand("insertText", !1, m), ye(), setTimeout(() => {
2025
+ const M = window.getSelection();
2026
+ if (M && M.rangeCount > 0) {
2027
+ const S = M.anchorNode;
2028
+ if (S) {
2029
+ let _ = null;
2030
+ if (S.nodeType === Node.ELEMENT_NODE ? _ = S.closest('[data-type="variable"][data-multi-key]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (_ = S.parentElement.closest('[data-type="variable"][data-multi-key]')), _) {
2031
+ const A = _.innerText.replace(/[\u200B\n]/g, "").trim();
2032
+ /[、,,\s]+/.test(A) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", A), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
1654
2033
  }
1655
2034
  }
1656
2035
  }
1657
2036
  }, 0);
1658
- }, Se = (p) => {
1659
- if (p.target.files && p.target.files[0] && d) {
1660
- const f = p.target.files[0], v = d;
1661
- s((S) => ({ ...S, [v]: f }));
2037
+ }, ce = (h) => {
2038
+ if (h.target.files && h.target.files[0] && y) {
2039
+ const m = h.target.files[0], C = y;
2040
+ p((M) => ({ ...M, [C]: m }));
1662
2041
  }
1663
- p.target && (p.target.value = ""), h(null);
1664
- }, xe = (p) => {
1665
- s((f) => {
1666
- const v = { ...f };
1667
- return delete v[p], v;
2042
+ h.target && (h.target.value = ""), g(null);
2043
+ }, pe = (h) => {
2044
+ p((m) => {
2045
+ const C = { ...m };
2046
+ return delete C[h], C;
1668
2047
  });
1669
- }, Ae = (p) => {
1670
- const f = p.target;
1671
- if (f.closest(".tag-close-btn")) {
1672
- if (p.preventDefault(), p.stopPropagation(), k)
2048
+ }, fe = (h) => {
2049
+ const m = h.target;
2050
+ if (m.closest(".rte-datepicker-wrapper") || m.closest(".rte-datepicker-host"))
2051
+ return;
2052
+ if (m.closest(".tag-close-btn")) {
2053
+ if (h.preventDefault(), h.stopPropagation(), T)
1673
2054
  return;
1674
- G(null), C ? C() : n.current && (n.current.innerHTML = "", n.current.focus());
2055
+ V(null), w ? w() : n.current && (n.current.innerHTML = "", n.current.focus());
1675
2056
  return;
1676
2057
  }
1677
- if (k) {
1678
- const b = f.closest(".tag-node"), q = f.closest('[data-type="text"]');
1679
- if (b || q) {
1680
- p.preventDefault(), p.stopPropagation();
1681
- const w = window.getSelection();
1682
- w && w.removeAllRanges();
2058
+ if (T) {
2059
+ const S = m.closest(".tag-node"), _ = m.closest('[data-type="text"]');
2060
+ if (S || _) {
2061
+ h.preventDefault(), h.stopPropagation();
2062
+ const A = window.getSelection();
2063
+ A && A.removeAllRanges();
1683
2064
  return;
1684
2065
  }
1685
2066
  }
1686
- f.closest('[data-type="variable"]') || (_.current = { x: p.clientX, y: p.clientY }, T.current = !1, f.closest(".file-remove-btn") && (p.preventDefault(), p.stopPropagation()));
1687
- }, me = (p) => {
1688
- if (!p.target.closest('[data-type="variable"]') && _.current) {
1689
- const S = Math.abs(p.clientX - _.current.x), b = Math.abs(p.clientY - _.current.y);
1690
- (S > 3 || b > 3) && (T.current = !0);
2067
+ m.closest('[data-type="variable"]') || (P.current = { x: h.clientX, y: h.clientY }, k.current = !1, m.closest(".file-remove-btn") && (h.preventDefault(), h.stopPropagation()));
2068
+ }, be = (h) => {
2069
+ if (!h.target.closest('[data-type="variable"]') && P.current) {
2070
+ const M = Math.abs(h.clientX - P.current.x), S = Math.abs(h.clientY - P.current.y);
2071
+ (M > 3 || S > 3) && (k.current = !0);
1691
2072
  }
1692
- }, Le = (p) => {
1693
- if (p.target.closest('[data-type="variable"]')) {
1694
- _.current = null, T.current = !1;
2073
+ }, X = (h) => {
2074
+ if (h.target.closest('[data-type="variable"]')) {
2075
+ P.current = null, k.current = !1;
1695
2076
  return;
1696
2077
  }
1697
- _.current = null, T.current = !1;
1698
- }, O = (p) => {
2078
+ P.current = null, k.current = !1;
2079
+ }, ue = (h) => {
1699
2080
  if (i)
1700
2081
  return;
1701
- const f = p.target;
1702
- if (f.closest('[data-type="datepicker"]'))
2082
+ const m = h.target;
2083
+ if (m.closest('[data-type="datepicker"]'))
1703
2084
  return;
1704
- if (f.closest(".tag-close-btn")) {
1705
- p.preventDefault(), p.stopPropagation();
2085
+ if (m.closest(".tag-close-btn")) {
2086
+ h.preventDefault(), h.stopPropagation();
1706
2087
  return;
1707
2088
  }
1708
2089
  if (t.length === 0)
1709
2090
  return;
1710
- const b = (I, R) => {
2091
+ const S = (B, K) => {
1711
2092
  if (!n.current) return;
1712
- Array.from(n.current.children).forEach((V) => {
1713
- if (V !== I)
1714
- if (R)
1715
- V.dataset.prevDisplay === void 0 && (V.dataset.prevDisplay = V.style.display || ""), V.style.setProperty("display", "none", "important");
1716
- else if (V.dataset.prevDisplay !== void 0) {
1717
- const Z = V.dataset.prevDisplay;
1718
- Z ? V.style.display = Z : V.style.removeProperty("display"), delete V.dataset.prevDisplay;
2093
+ Array.from(n.current.children).forEach((O) => {
2094
+ if (O !== B)
2095
+ if (K)
2096
+ O.dataset.prevDisplay === void 0 && (O.dataset.prevDisplay = O.style.display || ""), O.style.setProperty("display", "none", "important");
2097
+ else if (O.dataset.prevDisplay !== void 0) {
2098
+ const ie = O.dataset.prevDisplay;
2099
+ ie ? O.style.display = ie : O.style.removeProperty("display"), delete O.dataset.prevDisplay;
1719
2100
  } else
1720
- V.style.removeProperty("display");
2101
+ O.style.removeProperty("display");
1721
2102
  });
1722
- }, q = f.closest(".rte-textarea-toggle");
1723
- if (q) {
1724
- p.preventDefault(), p.stopPropagation();
1725
- const I = q.closest(".rte-textarea-wrapper"), R = I?.querySelector('[data-type="textarea"]'), V = !(q.getAttribute("data-expanded") === "true");
1726
- q.setAttribute("data-expanded", String(V)), q.textContent = V ? "收起" : "展开", I && I.classList.toggle("rte-textarea-expanded", V);
1727
- const Z = I?.closest(".rte-textarea-required");
1728
- if (Z ? Z.classList.toggle("rte-textarea-overlay", V) : I && I.classList.toggle("rte-textarea-overlay", V), R)
1729
- if (V)
1730
- R.classList.add("rte-textarea-expanded"), R.style.maxHeight = "none", R.style.height = "100%";
2103
+ }, _ = m.closest(".rte-textarea-toggle");
2104
+ if (_) {
2105
+ h.preventDefault(), h.stopPropagation();
2106
+ const B = _.closest(".rte-textarea-wrapper"), K = B?.querySelector('[data-type="textarea"]'), O = !(_.getAttribute("data-expanded") === "true");
2107
+ _.setAttribute("data-expanded", String(O)), _.textContent = O ? "收起" : "展开", B && B.classList.toggle("rte-textarea-expanded", O);
2108
+ const ie = B?.closest(".rte-textarea-required");
2109
+ if (ie ? ie.classList.toggle("rte-textarea-overlay", O) : B && B.classList.toggle("rte-textarea-overlay", O), K)
2110
+ if (O)
2111
+ K.classList.add("rte-textarea-expanded"), K.style.maxHeight = "none", K.style.height = "100%";
1731
2112
  else {
1732
- R.classList.remove("rte-textarea-expanded");
1733
- const oe = R.dataset.maxHeight || "252";
1734
- R.style.maxHeight = `${oe}px`, R.style.height = "auto";
2113
+ K.classList.remove("rte-textarea-expanded");
2114
+ const me = K.dataset.maxHeight || "252";
2115
+ K.style.maxHeight = `${me}px`, K.style.height = "auto";
1735
2116
  }
1736
- n.current && (V ? n.current.classList.add("rte-overlay-active") : n.current.classList.remove("rte-overlay-active"));
2117
+ n.current && (O ? n.current.classList.add("rte-overlay-active") : n.current.classList.remove("rte-overlay-active"));
1737
2118
  return;
1738
2119
  }
1739
- const w = f.closest(".rte-richtext-toggle");
1740
- if (w) {
1741
- p.preventDefault(), p.stopPropagation();
1742
- const I = w.closest(".rte-richtext-wrapper"), R = I?.querySelector('[data-type="richtext"]'), V = !(w.getAttribute("data-expanded") === "true");
1743
- ((ee, se) => {
1744
- ee.setAttribute("data-expanded", String(se)), ee.innerHTML = se ? '<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>' : '<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>';
1745
- })(w, V);
1746
- const oe = I?.closest(".rte-richtext-required");
1747
- oe ? oe.classList.toggle("rte-richtext-expanded", V) : I && I.classList.toggle("rte-richtext-expanded", V);
1748
- const F = I?.closest(".exclusion-wrapper") || I?.parentElement;
1749
- R && (V ? (R.style.height = "100%", R.style.overflow = "auto") : (R.style.height = "", R.style.overflow = "")), F && (F.classList.toggle("rte-richtext-host-expanded", V), b(F, V)), n.current && n.current.classList.toggle("rte-richtext-fullscreen-active", V);
2120
+ const A = m.closest(".rte-richtext-toggle");
2121
+ if (A) {
2122
+ h.preventDefault(), h.stopPropagation();
2123
+ const B = A.closest(".rte-richtext-wrapper"), K = B?.querySelector('[data-type="richtext"]'), O = !(A.getAttribute("data-expanded") === "true");
2124
+ ((le, ge) => {
2125
+ le.setAttribute("data-expanded", String(ge)), le.innerHTML = ge ? '<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>' : '<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>';
2126
+ })(A, O);
2127
+ const me = B?.closest(".rte-richtext-required");
2128
+ me ? me.classList.toggle("rte-richtext-expanded", O) : B && B.classList.toggle("rte-richtext-expanded", O);
2129
+ const J = B?.closest(".exclusion-wrapper") || B?.parentElement;
2130
+ K && (O ? (K.style.height = "100%", K.style.overflow = "auto") : (K.style.height = "", K.style.overflow = "")), J && (J.classList.toggle("rte-richtext-host-expanded", O), S(J, O)), n.current && n.current.classList.toggle("rte-richtext-fullscreen-active", O);
1750
2131
  return;
1751
2132
  }
1752
- if (f.closest('[data-type="text"]')) {
1753
- p.preventDefault(), p.stopPropagation();
1754
- const I = window.getSelection();
1755
- I && I.removeAllRanges();
2133
+ if (m.closest('[data-type="text"]')) {
2134
+ h.preventDefault(), h.stopPropagation();
2135
+ const B = window.getSelection();
2136
+ B && B.removeAllRanges();
1756
2137
  return;
1757
2138
  }
1758
- if (k && f.closest(".tag-node")) {
1759
- p.preventDefault(), p.stopPropagation();
1760
- const R = window.getSelection();
1761
- R && R.removeAllRanges();
2139
+ if (T && m.closest(".tag-node")) {
2140
+ h.preventDefault(), h.stopPropagation();
2141
+ const K = window.getSelection();
2142
+ K && K.removeAllRanges();
1762
2143
  return;
1763
2144
  }
1764
- if (f.closest('[data-type="variable"]')) {
1765
- if (T.current)
2145
+ if (m.closest('[data-type="variable"]')) {
2146
+ if (k.current)
1766
2147
  return;
1767
2148
  setTimeout(() => {
1768
- const I = window.getSelection();
1769
- I && !I.isCollapsed || Ve(n);
2149
+ const B = window.getSelection();
2150
+ B && !B.isCollapsed || Me(n);
1770
2151
  }, 10);
1771
2152
  return;
1772
2153
  }
1773
- const P = f.closest(".file-remove-btn");
1774
- if (P) {
1775
- p.preventDefault(), p.stopPropagation();
1776
- const R = P.closest('[data-type="upload"]')?.dataset.key;
1777
- R && xe(R);
2154
+ const j = m.closest(".file-remove-btn");
2155
+ if (j) {
2156
+ h.preventDefault(), h.stopPropagation();
2157
+ const K = j.closest('[data-type="upload"]')?.dataset.key;
2158
+ K && pe(K);
1778
2159
  return;
1779
2160
  }
1780
- const z = f.closest('[data-type="upload"]');
1781
- if (z) {
1782
- const I = z.dataset.key;
1783
- I && (h(I), o.current?.click());
2161
+ const Y = m.closest('[data-type="upload"]');
2162
+ if (Y) {
2163
+ const B = Y.dataset.key;
2164
+ B && (g(B), o.current?.click());
1784
2165
  return;
1785
2166
  }
1786
- }, le = (p) => {
1787
- const v = p.target.closest('[data-type="variable"]');
1788
- if (v) {
1789
- const S = window.getSelection();
1790
- if (S) {
1791
- const b = document.createRange(), q = v.textContent || "";
1792
- if (q.replace(/\u200B/g, "")) {
1793
- let B = 0, $ = q.length;
1794
- q.startsWith("​") && (B = 1), q.endsWith("​") && q.length > 1 && ($ = q.length - 1);
1795
- const P = v.firstChild;
1796
- P && P.nodeType === Node.TEXT_NODE ? (b.setStart(P, B), b.setEnd(P, $)) : b.selectNodeContents(v);
2167
+ }, he = (h) => {
2168
+ const C = h.target.closest('[data-type="variable"]');
2169
+ if (C) {
2170
+ const M = window.getSelection();
2171
+ if (M) {
2172
+ const S = document.createRange(), _ = C.textContent || "";
2173
+ if (_.replace(/\u200B/g, "")) {
2174
+ let G = 0, D = _.length;
2175
+ _.startsWith("​") && (G = 1), _.endsWith("​") && _.length > 1 && (D = _.length - 1);
2176
+ const j = C.firstChild;
2177
+ j && j.nodeType === Node.TEXT_NODE ? (S.setStart(j, G), S.setEnd(j, D)) : S.selectNodeContents(C);
1797
2178
  } else
1798
- b.selectNodeContents(v), b.collapse(!0);
1799
- S.removeAllRanges(), S.addRange(b);
2179
+ S.selectNodeContents(C), S.collapse(!0);
2180
+ M.removeAllRanges(), M.addRange(S);
1800
2181
  }
1801
2182
  }
1802
- }, de = () => {
2183
+ }, ye = () => {
1803
2184
  if (t.length === 0) {
1804
2185
  if (n.current) {
1805
- const v = !(n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
1806
- Y(v), D(!v);
2186
+ const C = !(n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
2187
+ ee(C), F(!C);
1807
2188
  }
1808
2189
  return;
1809
2190
  }
1810
- if (Ve(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((v) => {
1811
- const S = v.querySelector(".variable-info-icon");
1812
- if (S) {
1813
- let b = !1;
1814
- const q = document.createTreeWalker(
1815
- v,
2191
+ if (Me(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((C) => {
2192
+ const M = C.querySelector(".variable-info-icon");
2193
+ if (M) {
2194
+ let S = !1;
2195
+ const _ = document.createTreeWalker(
2196
+ C,
1816
2197
  NodeFilter.SHOW_TEXT,
1817
2198
  {
1818
- acceptNode: (w) => S.contains(w) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
2199
+ acceptNode: (A) => M.contains(A) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1819
2200
  }
1820
2201
  );
1821
- for (; q.nextNode(); )
1822
- if (q.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1823
- b = !0;
2202
+ for (; _.nextNode(); )
2203
+ if (_.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
2204
+ S = !0;
1824
2205
  break;
1825
2206
  }
1826
- b ? S.classList.add("hidden") : S.classList.remove("hidden");
1827
- }
1828
- }), Te(n, t, r), $e(n, t, r, D), !n.current) return;
1829
- t.filter((f) => f.type === "multi-variable" && f.key).forEach((f) => {
1830
- if (!f.key) return;
1831
- const v = f.maxCount || 9, S = te[f.key] || 1, b = [];
1832
- for (let P = 0; P < S; P++) {
1833
- const z = `${f.key}_${P}`, I = n.current.querySelector(
1834
- `[data-type="variable"][data-key="${z}"][data-multi-key="${f.key}"]`
2207
+ S ? M.classList.add("hidden") : M.classList.remove("hidden");
2208
+ }
2209
+ }), Be(n, t, a), Pe(n, t, a, F), !n.current) return;
2210
+ t.filter((m) => m.type === "multi-variable" && m.key).forEach((m) => {
2211
+ if (!m.key) return;
2212
+ const C = m.maxCount || 9, M = re[m.key] || 1, S = [];
2213
+ for (let j = 0; j < M; j++) {
2214
+ const Y = `${m.key}_${j}`, B = n.current.querySelector(
2215
+ `[data-type="variable"][data-key="${Y}"][data-multi-key="${m.key}"]`
1835
2216
  );
1836
- if (I) {
1837
- const R = I.innerText.replace(/[\u200B\n]/g, "").trim();
1838
- b.push(R);
2217
+ if (B) {
2218
+ const K = B.innerText.replace(/[\u200B\n]/g, "").trim();
2219
+ S.push(K);
1839
2220
  }
1840
2221
  }
1841
- const w = (b[b.length - 1] || "") === "";
1842
- let B = !1, $ = -1;
1843
- for (let P = 0; P < b.length - 1; P++)
1844
- if (b[P] === "") {
1845
- B = !0, $ = P;
2222
+ const A = (S[S.length - 1] || "") === "";
2223
+ let G = !1, D = -1;
2224
+ for (let j = 0; j < S.length - 1; j++)
2225
+ if (S[j] === "") {
2226
+ G = !0, D = j;
1846
2227
  break;
1847
2228
  }
1848
- if (B && $ >= 0) {
1849
- const P = window.getSelection();
1850
- if (P && P.rangeCount > 0) {
1851
- const V = P.getRangeAt(0), Z = V.startContainer, oe = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
1852
- if (oe) {
1853
- const F = oe.dataset.key;
1854
- if (F) {
1855
- const ee = document.createRange();
1856
- ee.setStartBefore(oe), ee.setEnd(V.startContainer, V.startOffset);
1857
- const se = ee.toString().length;
1858
- K.current = { key: F, offset: se };
2229
+ if (G && D >= 0) {
2230
+ const j = window.getSelection();
2231
+ if (j && j.rangeCount > 0) {
2232
+ const O = j.getRangeAt(0), ie = O.startContainer, me = ie.nodeType === Node.ELEMENT_NODE ? ie.closest('[data-type="variable"][data-multi-key]') : ie.parentElement?.closest('[data-type="variable"][data-multi-key]');
2233
+ if (me) {
2234
+ const J = me.dataset.key;
2235
+ if (J) {
2236
+ const le = document.createRange();
2237
+ le.setStartBefore(me), le.setEnd(O.startContainer, O.startOffset);
2238
+ const ge = le.toString().length;
2239
+ U.current = { key: J, offset: ge };
1859
2240
  }
1860
2241
  }
1861
2242
  }
1862
- const z = [...b];
1863
- for (let V = $; V < z.length - 1; V++)
1864
- z[V] = z[V + 1];
1865
- z.pop();
1866
- const I = {};
1867
- z.forEach((V, Z) => {
1868
- V && (I[`${f.key}_${Z}`] = V);
2243
+ const Y = [...S];
2244
+ for (let O = D; O < Y.length - 1; O++)
2245
+ Y[O] = Y[O + 1];
2246
+ Y.pop();
2247
+ const B = {};
2248
+ Y.forEach((O, ie) => {
2249
+ O && (B[`${m.key}_${ie}`] = O);
1869
2250
  });
1870
- const R = Math.max(w ? z.length : z.length + 1, 1);
2251
+ const K = Math.max(A ? Y.length : Y.length + 1, 1);
1871
2252
  n.current.querySelectorAll(
1872
2253
  '[data-type="variable"]'
1873
- ).forEach((V) => {
1874
- const Z = V.dataset.key, oe = V.dataset.multiKey;
1875
- if (Z && oe !== f.key) {
1876
- const F = V.innerText.replace(/[\u200B\n]/g, "").trim();
1877
- F && (I[Z] = F);
2254
+ ).forEach((O) => {
2255
+ const ie = O.dataset.key, me = O.dataset.multiKey;
2256
+ if (ie && me !== m.key) {
2257
+ const J = O.innerText.replace(/[\u200B\n]/g, "").trim();
2258
+ J && (B[ie] = J);
1878
2259
  }
1879
- }), n.current.__tempVariableValues = I, N((V) => ({
1880
- ...V,
1881
- [f.key]: R
2260
+ }), n.current.__tempVariableValues = B, l((O) => ({
2261
+ ...O,
2262
+ [m.key]: K
1882
2263
  }));
1883
2264
  return;
1884
2265
  }
1885
- if (!w) {
1886
- const P = S - 1, z = `${f.key}_${P}`, I = n.current.querySelector(
1887
- `[data-type="variable"][data-key="${z}"][data-multi-key="${f.key}"]`
2266
+ if (!A) {
2267
+ const j = M - 1, Y = `${m.key}_${j}`, B = n.current.querySelector(
2268
+ `[data-type="variable"][data-key="${Y}"][data-multi-key="${m.key}"]`
1888
2269
  );
1889
- if (I && I.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && S < v) {
1890
- const J = window.getSelection();
1891
- if (J && J.rangeCount > 0) {
1892
- const V = J.getRangeAt(0), Z = V.startContainer, oe = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
1893
- if (oe) {
1894
- const F = oe.dataset.key;
1895
- if (F) {
1896
- const ee = document.createRange();
1897
- ee.setStartBefore(oe), ee.setEnd(V.startContainer, V.startOffset);
1898
- const se = ee.toString().length;
1899
- K.current = { key: F, offset: se };
2270
+ if (B && B.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && M < C) {
2271
+ const oe = window.getSelection();
2272
+ if (oe && oe.rangeCount > 0) {
2273
+ const O = oe.getRangeAt(0), ie = O.startContainer, me = ie.nodeType === Node.ELEMENT_NODE ? ie.closest('[data-type="variable"][data-multi-key]') : ie.parentElement?.closest('[data-type="variable"][data-multi-key]');
2274
+ if (me) {
2275
+ const J = me.dataset.key;
2276
+ if (J) {
2277
+ const le = document.createRange();
2278
+ le.setStartBefore(me), le.setEnd(O.startContainer, O.startOffset);
2279
+ const ge = le.toString().length;
2280
+ U.current = { key: J, offset: ge };
1900
2281
  }
1901
2282
  }
1902
2283
  }
1903
- N((V) => ({
1904
- ...V,
1905
- [f.key]: S + 1
2284
+ l((O) => ({
2285
+ ...O,
2286
+ [m.key]: M + 1
1906
2287
  }));
1907
2288
  }
1908
2289
  }
1909
2290
  });
1910
2291
  };
1911
- Re(() => {
1912
- const p = n.current;
1913
- if (!p) return;
1914
- const f = /* @__PURE__ */ new Map(), v = (q) => {
1915
- const w = q.target, B = q.relatedTarget;
1916
- !w || !n.current || !n.current.contains(w) || B && n.current.contains(B) || setTimeout(() => {
2292
+ ze(() => {
2293
+ const h = n.current;
2294
+ if (!h) return;
2295
+ const m = /* @__PURE__ */ new Map(), C = (_) => {
2296
+ const A = _.target, G = _.relatedTarget;
2297
+ !A || !n.current || !n.current.contains(A) || G && n.current.contains(G) || setTimeout(() => {
1917
2298
  if (n.current) {
1918
2299
  if (t.length === 0) {
1919
- const $ = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1920
- D($.length > 0);
2300
+ const D = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
2301
+ F(D.length > 0);
1921
2302
  return;
1922
2303
  }
1923
- Ve(n), Te(n, t, r), $e(n, t, r, D);
2304
+ Me(n), Be(n, t, a), Pe(n, t, a, F);
1924
2305
  }
1925
2306
  }, 0);
1926
2307
  };
1927
- p.addEventListener("blur", v, !0);
1928
- const S = () => {
2308
+ h.addEventListener("blur", C, !0);
2309
+ const M = () => {
1929
2310
  if (!n.current) return;
1930
- f.forEach((B, $) => {
1931
- $.removeEventListener("blur", B, !1);
1932
- }), f.clear();
1933
- const q = n.current.querySelectorAll(
2311
+ m.forEach((G, D) => {
2312
+ D.removeEventListener("blur", G, !1);
2313
+ }), m.clear();
2314
+ const _ = n.current.querySelectorAll(
1934
2315
  '[data-type="variable"][data-multi-key]'
1935
- ), w = (B) => {
1936
- B.stopPropagation(), B.stopImmediatePropagation();
1937
- const $ = B.target;
1938
- if (!$ || !n.current || !n.current.contains($))
2316
+ ), A = (G) => {
2317
+ G.stopPropagation(), G.stopImmediatePropagation();
2318
+ const D = G.target;
2319
+ if (!D || !n.current || !n.current.contains(D))
1939
2320
  return;
1940
- const P = $.closest('[data-type="variable"][data-multi-key]');
1941
- if (!P || !n.current.contains(P))
2321
+ const j = D.closest('[data-type="variable"][data-multi-key]');
2322
+ if (!j || !n.current.contains(j))
1942
2323
  return;
1943
- let z = !1;
1944
- if (f.forEach((ee, se) => {
1945
- (se === P || se.contains($)) && (z = !0);
1946
- }), !z)
2324
+ let Y = !1;
2325
+ if (m.forEach((le, ge) => {
2326
+ (ge === j || ge.contains(D)) && (Y = !0);
2327
+ }), !Y)
1947
2328
  return;
1948
- const I = P.dataset.multiKey, R = P.dataset.key, J = P.dataset.index;
1949
- if (!I || !R || J === void 0) return;
1950
- const V = B.relatedTarget;
1951
- if (!(!V || !n.current.contains(V)))
2329
+ const B = j.dataset.multiKey, K = j.dataset.key, oe = j.dataset.index;
2330
+ if (!B || !K || oe === void 0) return;
2331
+ const O = G.relatedTarget;
2332
+ if (!(!O || !n.current.contains(O)))
1952
2333
  return;
1953
- const oe = P.innerText.replace(/[\u200B\n]/g, "").trim();
2334
+ const me = j.innerText.replace(/[\u200B\n]/g, "").trim();
1954
2335
  console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
1955
- multiKey: I,
1956
- currentKey: R,
1957
- index: J,
1958
- content: oe
2336
+ multiKey: B,
2337
+ currentKey: K,
2338
+ index: oe,
2339
+ content: me
1959
2340
  });
1960
- const F = /[、,,\s]+/;
1961
- if (F.test(oe)) {
1962
- const ee = oe.split(F).map((he) => he.trim()).filter((he) => he.length > 0);
1963
- console.log("[Blur Event] 拆分前的内容:", oe), console.log("[Blur Event] 拆分后的部分:", ee);
1964
- const pe = ee.slice(0, 9);
1965
- if (console.log("[Blur Event] 有效的部分(最多9个):", pe), pe.length > 1) {
1966
- const he = t.find((ke) => ke.type === "multi-variable" && ke.key === I);
1967
- if (he) {
1968
- const ke = te[I] || 1, De = parseInt(J, 10), Me = he.maxCount || 9, we = [];
1969
- for (let ie = 0; ie < ke; ie++) {
1970
- const ve = `${I}_${ie}`, Ee = n.current.querySelector(
1971
- `[data-type="variable"][data-key="${ve}"][data-multi-key="${I}"]`
2341
+ const J = /[、,,\s]+/;
2342
+ if (J.test(me)) {
2343
+ const le = me.split(J).map((Te) => Te.trim()).filter((Te) => Te.length > 0);
2344
+ console.log("[Blur Event] 拆分前的内容:", me), console.log("[Blur Event] 拆分后的部分:", le);
2345
+ const ke = le.slice(0, 9);
2346
+ if (console.log("[Blur Event] 有效的部分(最多9个):", ke), ke.length > 1) {
2347
+ const Te = t.find((Ne) => Ne.type === "multi-variable" && Ne.key === B);
2348
+ if (Te) {
2349
+ const Ne = re[B] || 1, He = parseInt(oe, 10), Fe = Te.maxCount || 9, Se = [];
2350
+ for (let ve = 0; ve < Ne; ve++) {
2351
+ const qe = `${B}_${ve}`, Ae = n.current.querySelector(
2352
+ `[data-type="variable"][data-key="${qe}"][data-multi-key="${B}"]`
1972
2353
  );
1973
- if (Ee) {
1974
- const qe = Ee.innerText.replace(/[\u200B\n]/g, "").trim();
1975
- we.push(qe);
2354
+ if (Ae) {
2355
+ const Le = Ae.innerText.replace(/[\u200B\n]/g, "").trim();
2356
+ Se.push(Le);
1976
2357
  }
1977
2358
  }
1978
- console.log("[Blur Event] 拆分前的所有值:", we), console.log("[Blur Event] 当前索引:", De), console.log("[Blur Event] 要插入的值:", pe), we.splice(De, 1, ...pe);
1979
- const fe = we.slice(0, Me);
1980
- console.log("[Blur Event] 拆分后的所有值:", fe), fe.length > 0 && fe[fe.length - 1] !== "" && fe.length < Me && fe.push("");
1981
- const Ke = Math.max(fe.length, 1), Ie = {};
1982
- fe.forEach((ie, ve) => {
1983
- ie && (Ie[`${I}_${ve}`] = ie);
2359
+ console.log("[Blur Event] 拆分前的所有值:", Se), console.log("[Blur Event] 当前索引:", He), console.log("[Blur Event] 要插入的值:", ke), Se.splice(He, 1, ...ke);
2360
+ const Ee = Se.slice(0, Fe);
2361
+ console.log("[Blur Event] 拆分后的所有值:", Ee), Ee.length > 0 && Ee[Ee.length - 1] !== "" && Ee.length < Fe && Ee.push("");
2362
+ const Qe = Math.max(Ee.length, 1), Ie = {};
2363
+ Ee.forEach((ve, qe) => {
2364
+ ve && (Ie[`${B}_${qe}`] = ve);
1984
2365
  }), n.current.querySelectorAll(
1985
2366
  '[data-type="variable"]'
1986
- ).forEach((ie) => {
1987
- const ve = ie.dataset.key, Ee = ie.dataset.multiKey;
1988
- if (ve && Ee !== I) {
1989
- const qe = ie.innerText.replace(/[\u200B\n]/g, "").trim();
1990
- qe && (Ie[ve] = qe);
2367
+ ).forEach((ve) => {
2368
+ const qe = ve.dataset.key, Ae = ve.dataset.multiKey;
2369
+ if (qe && Ae !== B) {
2370
+ const Le = ve.innerText.replace(/[\u200B\n]/g, "").trim();
2371
+ Le && (Ie[qe] = Le);
1991
2372
  }
1992
- }), n.current.__tempVariableValues = Ie, N((ie) => ({
1993
- ...ie,
1994
- [I]: Ke
2373
+ }), n.current.__tempVariableValues = Ie, l((ve) => ({
2374
+ ...ve,
2375
+ [B]: Qe
1995
2376
  }));
1996
2377
  }
1997
2378
  }
1998
2379
  }
1999
2380
  };
2000
- q.forEach((B) => {
2001
- B.addEventListener("blur", w, !1), f.set(B, w);
2381
+ _.forEach((G) => {
2382
+ G.addEventListener("blur", A, !1), m.set(G, A);
2002
2383
  });
2003
- }, b = setTimeout(() => {
2004
- S();
2384
+ }, S = setTimeout(() => {
2385
+ M();
2005
2386
  }, 0);
2006
2387
  return () => {
2007
- clearTimeout(b), p.removeEventListener("blur", v, !0), f.forEach((q, w) => {
2008
- w.removeEventListener("blur", q, !1);
2009
- }), f.clear();
2388
+ clearTimeout(S), h.removeEventListener("blur", C, !0), m.forEach((_, A) => {
2389
+ A.removeEventListener("blur", _, !1);
2390
+ }), m.clear();
2010
2391
  };
2011
- }, [t, te, r]);
2012
- const be = (p) => {
2392
+ }, [t, re, a]);
2393
+ const xe = (h) => {
2013
2394
  if (i) {
2014
- p.preventDefault();
2395
+ h.preventDefault();
2015
2396
  return;
2016
2397
  }
2017
- const f = window.getSelection();
2018
- if (f && f.rangeCount > 0) {
2019
- const v = f.anchorNode;
2020
- let S = null;
2021
- if (v && (v.nodeType === Node.ELEMENT_NODE ? S = v.closest('[data-type="text"]') : v.nodeType === Node.TEXT_NODE && v.parentElement && (S = v.parentElement.closest('[data-type="text"]'))), S) {
2022
- if (p.preventDefault(), p.stopPropagation(), n.current) {
2023
- const b = n.current.querySelector(
2398
+ const m = window.getSelection();
2399
+ if (m && m.rangeCount > 0) {
2400
+ const C = m.anchorNode;
2401
+ let M = null;
2402
+ if (C && (C.nodeType === Node.ELEMENT_NODE ? M = C.closest('[data-type="text"]') : C.nodeType === Node.TEXT_NODE && C.parentElement && (M = C.parentElement.closest('[data-type="text"]'))), M) {
2403
+ if (h.preventDefault(), h.stopPropagation(), n.current) {
2404
+ const S = n.current.querySelector(
2024
2405
  '[data-type="variable"], [data-type="upload"]'
2025
2406
  );
2026
- b && b.focus();
2407
+ S && S.focus();
2027
2408
  }
2028
2409
  return;
2029
2410
  }
2030
2411
  }
2031
- if (k && f && f.rangeCount > 0) {
2032
- const v = f.anchorNode;
2033
- let S = null;
2034
- if (v && (v.nodeType === Node.ELEMENT_NODE ? S = v.closest(".tag-node") : v.nodeType === Node.TEXT_NODE && v.parentElement && (S = v.parentElement.closest(".tag-node"))), S) {
2035
- if (p.preventDefault(), p.stopPropagation(), n.current) {
2036
- const b = n.current.querySelector(
2412
+ if (T && m && m.rangeCount > 0) {
2413
+ const C = m.anchorNode;
2414
+ let M = null;
2415
+ if (C && (C.nodeType === Node.ELEMENT_NODE ? M = C.closest(".tag-node") : C.nodeType === Node.TEXT_NODE && C.parentElement && (M = C.parentElement.closest(".tag-node"))), M) {
2416
+ if (h.preventDefault(), h.stopPropagation(), n.current) {
2417
+ const S = n.current.querySelector(
2037
2418
  '[data-type="variable"], [data-type="upload"]'
2038
2419
  );
2039
- b && b.focus();
2420
+ S && S.focus();
2040
2421
  }
2041
2422
  return;
2042
2423
  }
2043
2424
  }
2044
- if (p.key === "Enter" && !p.shiftKey && (p.preventDefault(), Pe()), p.key === "Escape" && n.current) {
2045
- if (k) {
2046
- p.preventDefault();
2425
+ if (h.key === "Enter" && !h.shiftKey && (h.preventDefault(), we()), h.key === "Escape" && n.current) {
2426
+ if (T) {
2427
+ h.preventDefault();
2047
2428
  return;
2048
2429
  }
2049
2430
  n.current.innerHTML = "", n.current.focus();
2050
2431
  }
2051
- if (p.key === "Backspace") {
2052
- const v = window.getSelection();
2053
- if (v && v.rangeCount > 0) {
2054
- const S = v.getRangeAt(0), b = v.anchorNode;
2055
- if (k) {
2056
- let w = null, B = null;
2057
- if (b && (b.nodeType === Node.ELEMENT_NODE ? (w = b.closest(".tag-node"), B = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (w = b.parentElement.closest(".tag-node"), B = b.parentElement.closest('[data-type="text"]'))), (w || B) && S.collapsed && S.startOffset === 0) {
2058
- p.preventDefault();
2432
+ if (h.key === "Backspace") {
2433
+ const C = window.getSelection();
2434
+ if (C && C.rangeCount > 0) {
2435
+ const M = C.getRangeAt(0), S = C.anchorNode;
2436
+ if (T) {
2437
+ let A = null, G = null;
2438
+ if (S && (S.nodeType === Node.ELEMENT_NODE ? (A = S.closest(".tag-node"), G = S.closest('[data-type="text"]')) : S.nodeType === Node.TEXT_NODE && S.parentElement && (A = S.parentElement.closest(".tag-node"), G = S.parentElement.closest('[data-type="text"]'))), (A || G) && M.collapsed && M.startOffset === 0) {
2439
+ h.preventDefault();
2059
2440
  return;
2060
2441
  }
2061
2442
  }
2062
- let q = null;
2063
- if (b && (b.nodeType === Node.ELEMENT_NODE ? q = b.closest(
2443
+ let _ = null;
2444
+ if (S && (S.nodeType === Node.ELEMENT_NODE ? _ = S.closest(
2064
2445
  '[data-type="variable"]'
2065
- ) : b.nodeType === Node.TEXT_NODE && b.parentElement && (q = b.parentElement.closest(
2446
+ ) : S.nodeType === Node.TEXT_NODE && S.parentElement && (_ = S.parentElement.closest(
2066
2447
  '[data-type="variable"]'
2067
- ))), q) {
2068
- if (!S.collapsed)
2448
+ ))), _) {
2449
+ if (!M.collapsed)
2069
2450
  return;
2070
- const w = q.innerText;
2071
- if (w === "​" || w === "") {
2072
- p.preventDefault();
2451
+ const A = _.innerText;
2452
+ if (A === "​" || A === "") {
2453
+ h.preventDefault();
2073
2454
  return;
2074
2455
  }
2075
- if (S.startOffset === 0) {
2076
- p.preventDefault();
2456
+ if (M.startOffset === 0) {
2457
+ h.preventDefault();
2077
2458
  return;
2078
2459
  }
2079
- if (w.startsWith("​") && S.startOffset === 1) {
2080
- p.preventDefault();
2460
+ if (A.startsWith("​") && M.startOffset === 1) {
2461
+ h.preventDefault();
2081
2462
  return;
2082
2463
  }
2083
2464
  }
2084
2465
  }
2085
2466
  }
2086
- }, Pe = () => {
2087
- if (u || i || e || !H || !n.current) return;
2467
+ }, we = () => {
2468
+ if (d || i || e || !H || !n.current) return;
2088
2469
  if (t.length === 0) {
2089
- const q = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
2090
- if (!q) return;
2091
- y(q, q);
2470
+ const _ = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
2471
+ if (!_) return;
2472
+ x(_, _);
2092
2473
  return;
2093
2474
  }
2094
- const p = n.current;
2095
- let f = "";
2096
- const v = {}, S = (q) => {
2097
- if (!(q.nodeType === Node.ELEMENT_NODE && q.style.display === "none")) {
2098
- if (q.nodeType === Node.TEXT_NODE)
2099
- f += (q.textContent || "").replace(/\u200B/g, "");
2100
- else if (q.nodeType === Node.ELEMENT_NODE) {
2101
- const w = q, B = w.dataset.type, $ = w.dataset.key;
2102
- if (B === "variable" && $) {
2103
- let P = "";
2104
- const z = document.createTreeWalker(
2105
- w,
2475
+ const h = n.current;
2476
+ let m = "";
2477
+ const C = {}, M = (_) => {
2478
+ if (!(_.nodeType === Node.ELEMENT_NODE && _.style.display === "none")) {
2479
+ if (_.nodeType === Node.TEXT_NODE)
2480
+ m += (_.textContent || "").replace(/\u200B/g, "");
2481
+ else if (_.nodeType === Node.ELEMENT_NODE) {
2482
+ const A = _, G = A.dataset.type, D = A.dataset.key;
2483
+ if (G === "variable" && D) {
2484
+ let j = "";
2485
+ const Y = document.createTreeWalker(
2486
+ A,
2106
2487
  NodeFilter.SHOW_TEXT,
2107
2488
  {
2108
- acceptNode: (R) => {
2109
- const J = w.querySelector(".variable-info-icon");
2110
- return J && J.contains(R) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2489
+ acceptNode: (K) => {
2490
+ const oe = A.querySelector(".variable-info-icon");
2491
+ return oe && oe.contains(K) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2111
2492
  }
2112
2493
  }
2113
2494
  );
2114
- for (; z.nextNode(); )
2115
- P += z.currentNode.textContent || "";
2116
- const I = P.replace(/[\u200B\n]/g, "").trim();
2117
- if (I) {
2118
- const R = w.dataset.multiKey;
2119
- if (R) {
2120
- (!v[R] || !Array.isArray(v[R])) && (v[R] = []);
2121
- const J = v[R];
2122
- J.push(I), J.length > 1 && (f += " "), f += I;
2495
+ for (; Y.nextNode(); )
2496
+ j += Y.currentNode.textContent || "";
2497
+ const B = j.replace(/[\u200B\n]/g, "").trim();
2498
+ if (B) {
2499
+ const K = A.dataset.multiKey;
2500
+ if (K) {
2501
+ (!C[K] || !Array.isArray(C[K])) && (C[K] = []);
2502
+ const oe = C[K];
2503
+ oe.push(B), oe.length > 1 && (m += " "), m += B;
2123
2504
  } else
2124
- v[$] = I, f += I;
2505
+ C[D] = B, m += B;
2125
2506
  }
2126
- } else if (B === "select" && $) {
2127
- const P = w, z = (P.value || "").trim();
2128
- if (z) {
2129
- v[$] = z;
2130
- const I = P.selectedOptions?.[0];
2131
- f += I?.textContent || z;
2507
+ } else if (G === "select" && D) {
2508
+ const j = A, Y = (j.value || "").trim();
2509
+ if (Y) {
2510
+ C[D] = Y;
2511
+ const B = j.selectedOptions?.[0];
2512
+ m += B?.textContent || Y;
2132
2513
  }
2133
- } else if (B === "textarea" && $) {
2134
- const z = (w.value || "").replace(/\u200B/g, "").trim();
2135
- z && (v[$] = z, f += z);
2136
- } else if (B === "richtext" && $) {
2137
- const z = (w.textContent || "").replace(/\u200B/g, "").trim();
2138
- z && (v[$] = z, f += z);
2139
- } else if (B === "datepicker" && $) {
2140
- const z = (w.getAttribute("data-value") || "").trim();
2141
- z && (v[$] = z, f += z);
2142
- } else if (B === "upload" && $)
2143
- v[$] = r[$] ?? null, r[$] && (f += ` [附带文件: ${r[$]?.name}] `);
2514
+ } else if (G === "textarea" && D) {
2515
+ const Y = (A.value || "").replace(/\u200B/g, "").trim();
2516
+ Y && (C[D] = Y, m += Y);
2517
+ } else if (G === "richtext" && D) {
2518
+ const Y = (A.textContent || "").replace(/\u200B/g, "").trim();
2519
+ Y && (C[D] = Y, m += Y);
2520
+ } else if (G === "datepicker" && D) {
2521
+ const Y = (A.getAttribute("data-value") || "").trim();
2522
+ if (Y)
2523
+ if (Y.includes(",")) {
2524
+ const B = Y.split(",");
2525
+ B.length === 2 ? (C[D] = B, m += `[${B[0]}, ${B[1]}]`) : (C[D] = Y, m += Y);
2526
+ } else
2527
+ C[D] = Y, m += Y;
2528
+ } else if (G === "upload" && D)
2529
+ C[D] = a[D] ?? null, a[D] && (m += ` [附带文件: ${a[D]?.name}] `);
2144
2530
  else {
2145
- if (w.classList.contains("tag-close-btn") || w.classList.contains("file-remove-btn")) return;
2146
- w.getAttribute("contenteditable") === "false" && !B && w.classList.contains("tag-node") ? f += w.innerText : w.childNodes.forEach(S);
2531
+ if (A.classList.contains("tag-close-btn") || A.classList.contains("file-remove-btn")) return;
2532
+ A.getAttribute("contenteditable") === "false" && !G && A.classList.contains("tag-node") ? m += A.innerText : A.childNodes.forEach(M);
2147
2533
  }
2148
2534
  }
2149
2535
  }
2150
2536
  };
2151
- if (p.childNodes.forEach(S), f = f.trim(), !f) return;
2152
- const b = new FormData();
2153
- b.append("fullPrompt", f), Object.keys(v).forEach((q) => {
2154
- const w = v[q];
2155
- w != null && (w instanceof File ? b.append(q, w) : Array.isArray(w) ? t.some(
2156
- ($) => $.type === "multi-variable" && $.key === q
2157
- ) ? w.forEach(($) => {
2158
- $ != null && $ !== "" && b.append(q, String($));
2159
- }) : w.forEach(($, P) => {
2160
- $ != null && ($ instanceof File ? b.append(`${q}[${P}]`, $) : typeof $ == "string" ? b.append(`${q}[${P}]`, $) : b.append(`${q}[${P}]`, String($)));
2161
- }) : typeof w == "string" ? b.append(q, w) : b.append(q, String(w)));
2162
- }), y(b, f);
2163
- }, je = {
2164
- ...c ? { width: typeof c == "number" ? `${c}px` : c } : {},
2165
- ...g ? { border: g } : {},
2166
- ...l ? { background: l } : {}
2537
+ if (h.childNodes.forEach(M), m = m.trim(), !m) return;
2538
+ const S = new FormData();
2539
+ S.append("fullPrompt", m), Object.keys(C).forEach((_) => {
2540
+ const A = C[_];
2541
+ A != null && (A instanceof File ? S.append(_, A) : Array.isArray(A) ? t.some(
2542
+ (D) => D.type === "multi-variable" && D.key === _
2543
+ ) ? A.forEach((D) => {
2544
+ D != null && D !== "" && S.append(_, String(D));
2545
+ }) : A.forEach((D, j) => {
2546
+ D != null && (D instanceof File ? S.append(`${_}[${j}]`, D) : typeof D == "string" ? S.append(`${_}[${j}]`, D) : S.append(`${_}[${j}]`, String(D)));
2547
+ }) : typeof A == "string" ? S.append(_, A) : S.append(_, String(A)));
2548
+ }), x(S, m);
2549
+ }, Ce = {
2550
+ ...u ? { width: typeof u == "number" ? `${u}px` : u } : {},
2551
+ ...f ? { border: f } : {},
2552
+ ...s ? { background: s } : {}
2167
2553
  };
2168
- return /* @__PURE__ */ W(
2554
+ return /* @__PURE__ */ Z(
2169
2555
  "div",
2170
2556
  {
2171
2557
  className: "rich-text-editor",
2172
- style: je,
2558
+ style: Ce,
2173
2559
  "data-disabled": i,
2174
2560
  children: [
2175
- /* @__PURE__ */ m(
2561
+ /* @__PURE__ */ E(
2176
2562
  "div",
2177
2563
  {
2178
2564
  ref: n,
2179
- className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${Q && A ? "rte-editor-empty" : ""}`,
2565
+ className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${R && q ? "rte-editor-empty" : ""}`,
2180
2566
  contentEditable: t.length === 0,
2181
2567
  suppressContentEditableWarning: !0,
2182
- "data-placeholder": A,
2183
- onMouseDown: Ae,
2184
- onMouseMove: me,
2185
- onMouseUp: Le,
2186
- onClick: O,
2187
- onDoubleClick: le,
2188
- onInput: de,
2189
- onKeyDown: be,
2190
- onPaste: Ne
2568
+ "data-placeholder": q,
2569
+ onMouseDown: fe,
2570
+ onMouseMove: be,
2571
+ onMouseUp: X,
2572
+ onClick: ue,
2573
+ onDoubleClick: he,
2574
+ onInput: ye,
2575
+ onKeyDown: xe,
2576
+ onPaste: se
2191
2577
  }
2192
2578
  ),
2193
- /* @__PURE__ */ m(
2579
+ /* @__PURE__ */ E(
2194
2580
  "input",
2195
2581
  {
2196
2582
  type: "file",
2197
2583
  ref: o,
2198
2584
  className: "rte-file-input",
2199
2585
  accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
2200
- onChange: Se
2586
+ onChange: ce
2201
2587
  }
2202
2588
  ),
2203
- /* @__PURE__ */ W("div", { className: "rich-text-editor-footer", children: [
2204
- /* @__PURE__ */ m("div", { className: "rich-text-editor-footer-left", children: /* @__PURE__ */ W("div", { className: "rich-text-editor-brand", children: [
2205
- /* @__PURE__ */ W("div", { className: "rte-brand-badge", children: [
2206
- /* @__PURE__ */ m("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
2207
- /* @__PURE__ */ m("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
2589
+ /* @__PURE__ */ Z("div", { className: "rich-text-editor-footer", children: [
2590
+ /* @__PURE__ */ E("div", { className: "rich-text-editor-footer-left", children: /* @__PURE__ */ Z("div", { className: "rich-text-editor-brand", children: [
2591
+ /* @__PURE__ */ Z("div", { className: "rte-brand-badge", children: [
2592
+ /* @__PURE__ */ E("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
2593
+ /* @__PURE__ */ E("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
2208
2594
  ] }),
2209
- a !== "hideAgent" && /* @__PURE__ */ m(
2210
- Ze,
2595
+ r !== "hideAgent" && /* @__PURE__ */ E(
2596
+ ot,
2211
2597
  {
2212
2598
  placement: "top",
2213
2599
  menu: {
2214
- items: L.map((p) => ({
2215
- key: p.key,
2216
- label: /* @__PURE__ */ W("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2217
- p.icon && /* @__PURE__ */ m("i", { className: p.icon }),
2218
- /* @__PURE__ */ m("span", { children: p.label })
2600
+ items: I.map((h) => ({
2601
+ key: h.key,
2602
+ label: /* @__PURE__ */ Z("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2603
+ h.icon && /* @__PURE__ */ E("i", { className: h.icon }),
2604
+ /* @__PURE__ */ E("span", { children: h.label })
2219
2605
  ] }),
2220
2606
  onClick: () => {
2221
- E?.(p);
2607
+ $?.(h);
2222
2608
  }
2223
2609
  }))
2224
2610
  },
2225
2611
  trigger: ["click"],
2226
- disabled: i || u,
2227
- children: /* @__PURE__ */ W("div", { className: "rte-agent-badge", style: { cursor: L.length > 0 ? "pointer" : "default" }, children: [
2228
- /* @__PURE__ */ m("i", { className: "iconfont icon-zhinengti" }),
2229
- /* @__PURE__ */ m("span", { className: "rte-agent-text", children: "智能体" })
2612
+ disabled: i || d,
2613
+ children: /* @__PURE__ */ Z("div", { className: "rte-agent-badge", style: { cursor: I.length > 0 ? "pointer" : "default" }, children: [
2614
+ /* @__PURE__ */ E("i", { className: "iconfont icon-zhinengti" }),
2615
+ /* @__PURE__ */ E("span", { className: "rte-agent-text", children: "智能体" })
2230
2616
  ] })
2231
2617
  }
2232
2618
  )
2233
2619
  ] }) }),
2234
- /* @__PURE__ */ W("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2620
+ /* @__PURE__ */ Z("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2235
2621
  (() => {
2236
- const p = t.find((v) => v.type === "tag");
2237
- if (!p || !p.text) return null;
2238
- const f = L.find((v) => v.label === p.text);
2239
- return !f || f.points === void 0 || f.points === null ? null : /* @__PURE__ */ W("div", { className: "rte-points-badge", children: [
2240
- /* @__PURE__ */ m("i", { className: "iconfont icon-jifen", style: { marginRight: "4px" } }),
2241
- /* @__PURE__ */ W("span", { style: { fontSize: "16px" }, children: [
2622
+ const h = t.find((C) => C.type === "tag");
2623
+ if (!h || !h.text) return null;
2624
+ const m = I.find((C) => C.label === h.text);
2625
+ return !m || m.points === void 0 || m.points === null ? null : /* @__PURE__ */ Z("div", { className: "rte-points-badge", children: [
2626
+ /* @__PURE__ */ E("i", { className: "iconfont icon-jifen", style: { marginRight: "4px" } }),
2627
+ /* @__PURE__ */ Z("span", { style: { fontSize: "16px" }, children: [
2242
2628
  "-",
2243
- String(f.points)
2629
+ String(m.points)
2244
2630
  ] })
2245
2631
  ] });
2246
2632
  })(),
2247
- /* @__PURE__ */ m(
2633
+ /* @__PURE__ */ E(
2248
2634
  "button",
2249
2635
  {
2250
2636
  type: "button",
2251
- onClick: Pe,
2252
- disabled: u || i || e || !H,
2637
+ onClick: we,
2638
+ disabled: d || i || e || !H,
2253
2639
  className: "rich-text-editor-send-button",
2254
- children: u || e ? /* @__PURE__ */ m("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ m("i", { className: "iconfont icon-fasong" })
2640
+ children: d || e ? /* @__PURE__ */ E("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ E("i", { className: "iconfont icon-fasong" })
2255
2641
  }
2256
2642
  )
2257
2643
  ] })
2258
2644
  ] }),
2259
- x?.anchorEl && (() => {
2260
- if (!document.body.contains(x.anchorEl))
2645
+ b?.anchorEl && (() => {
2646
+ if (!document.body.contains(b.anchorEl))
2261
2647
  return null;
2262
- let p = "", f = {
2648
+ let h = "", m = {
2263
2649
  background: "var(--neutral-800, #262626)"
2264
2650
  };
2265
- if (x.type === "upload")
2266
- p = t.find(
2267
- (b) => b.type === "upload" && b.key === x.key
2651
+ if (b.type === "upload")
2652
+ h = t.find(
2653
+ (S) => S.type === "upload" && S.key === b.key
2268
2654
  )?.tooltip || "";
2269
- else if (x.type === "tag")
2270
- p = x.anchorEl.dataset.tooltip || "";
2271
- else if (x.type === "upload-label")
2272
- p = x.anchorEl.dataset.fileName || "";
2273
- else if (x.type === "variable")
2274
- p = x.anchorEl.dataset.tooltip || "";
2275
- else if (x.type === "upload-preview") {
2276
- const S = r[x.key];
2277
- if (S && S.type && S.type.startsWith("image/")) {
2278
- const b = URL.createObjectURL(S);
2279
- p = /* @__PURE__ */ m("div", { style: { width: 120, height: 120, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ m("img", { src: b, style: { maxWidth: 120, maxHeight: 120, objectFit: "contain" } }) }), f = {
2655
+ else if (b.type === "tag")
2656
+ h = b.anchorEl.dataset.tooltip || "";
2657
+ else if (b.type === "upload-label")
2658
+ h = b.anchorEl.dataset.fileName || "";
2659
+ else if (b.type === "variable")
2660
+ h = b.anchorEl.dataset.tooltip || "";
2661
+ else if (b.type === "upload-preview") {
2662
+ const M = a[b.key];
2663
+ if (M && M.type && M.type.startsWith("image/")) {
2664
+ const S = URL.createObjectURL(M);
2665
+ h = /* @__PURE__ */ E("div", { style: { width: 120, height: 120, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ E("img", { src: S, style: { maxWidth: 120, maxHeight: 120, objectFit: "contain" } }) }), m = {
2280
2666
  background: "#fff",
2281
2667
  padding: 4
2282
- }, setTimeout(() => URL.revokeObjectURL(b), 1e3);
2668
+ }, setTimeout(() => URL.revokeObjectURL(S), 1e3);
2283
2669
  } else
2284
- p = "";
2670
+ h = "";
2285
2671
  }
2286
- if (!p) return null;
2287
- const v = x.type === "upload-preview" ? "#0A0A0A" : "#fff";
2288
- return pt(
2289
- /* @__PURE__ */ m(
2290
- et,
2672
+ if (!h) return null;
2673
+ const C = b.type === "upload-preview" ? "#0A0A0A" : "#fff";
2674
+ return Xe(
2675
+ /* @__PURE__ */ E(
2676
+ st,
2291
2677
  {
2292
2678
  arrow: !1,
2293
- title: /* @__PURE__ */ m("div", { style: { maxWidth: "200px", fontSize: "12px", color: v }, children: p }),
2679
+ title: /* @__PURE__ */ E("div", { style: { maxWidth: "200px", fontSize: "12px", color: C }, children: h }),
2294
2680
  open: !0,
2295
2681
  placement: "top",
2296
2682
  getPopupContainer: () => document.body,
2297
- overlayInnerStyle: f,
2298
- children: /* @__PURE__ */ m(
2683
+ overlayInnerStyle: m,
2684
+ children: /* @__PURE__ */ E(
2299
2685
  "div",
2300
2686
  {
2301
2687
  style: {
2302
2688
  position: "fixed",
2303
- left: `${x.anchorEl.getBoundingClientRect().left}px`,
2304
- top: `${x.anchorEl.getBoundingClientRect().top}px`,
2305
- width: `${x.anchorEl.offsetWidth}px`,
2306
- height: `${x.anchorEl.offsetHeight}px`,
2689
+ left: `${b.anchorEl.getBoundingClientRect().left}px`,
2690
+ top: `${b.anchorEl.getBoundingClientRect().top}px`,
2691
+ width: `${b.anchorEl.offsetWidth}px`,
2692
+ height: `${b.anchorEl.offsetHeight}px`,
2307
2693
  pointerEvents: "none"
2308
2694
  }
2309
2695
  }
@@ -2312,12 +2698,13 @@ const It = ({
2312
2698
  ),
2313
2699
  document.body
2314
2700
  );
2315
- })()
2701
+ })(),
2702
+ te
2316
2703
  ]
2317
2704
  }
2318
2705
  );
2319
2706
  };
2320
- It.__docgenInfo = {
2707
+ zt.__docgenInfo = {
2321
2708
  displayName: "RichTextEditor",
2322
2709
  description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
2323
2710
  props: {
@@ -2345,43 +2732,43 @@ It.__docgenInfo = {
2345
2732
  }
2346
2733
  }
2347
2734
  };
2348
- const ze = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", Vt = [
2735
+ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", Wt = [
2349
2736
  { label: "5页", value: 5 },
2350
2737
  { label: "10页", value: 10 },
2351
2738
  { label: "15页", value: 15 },
2352
2739
  { label: "30页", value: 30 }
2353
- ], Bt = ({
2740
+ ], jt = ({
2354
2741
  autoLoading: t,
2355
- batchSize: y,
2356
- loadingProgress: u,
2742
+ batchSize: x,
2743
+ loadingProgress: d,
2357
2744
  loadIcon: i,
2358
- onBatchSizeChange: c,
2359
- onLoadNextPage: k,
2360
- onStartAutoLoad: L,
2361
- onStopLoad: E
2362
- }) => t && u ? /* @__PURE__ */ W("div", { className: "auto_load_progress", children: [
2363
- i || /* @__PURE__ */ m("img", { src: ze, alt: "自动加载", width: 14, height: 14 }),
2364
- /* @__PURE__ */ W("span", { children: [
2745
+ onBatchSizeChange: u,
2746
+ onLoadNextPage: T,
2747
+ onStartAutoLoad: I,
2748
+ onStopLoad: $
2749
+ }) => t && d ? /* @__PURE__ */ Z("div", { className: "auto_load_progress", children: [
2750
+ i || /* @__PURE__ */ E("img", { src: Ue, alt: "自动加载", width: 14, height: 14 }),
2751
+ /* @__PURE__ */ Z("span", { children: [
2365
2752
  "正在加载第",
2366
- u.currentPage,
2753
+ d.currentPage,
2367
2754
  "/",
2368
- u.totalPages,
2755
+ d.totalPages,
2369
2756
  "页"
2370
2757
  ] }),
2371
- /* @__PURE__ */ m(
2372
- tt,
2758
+ /* @__PURE__ */ E(
2759
+ it,
2373
2760
  {
2374
- percent: u.percentage,
2761
+ percent: d.percentage,
2375
2762
  type: "line",
2376
2763
  size: [160, 8]
2377
2764
  }
2378
2765
  ),
2379
- /* @__PURE__ */ m("span", { onClick: E, className: "auto_load_stop_btn", children: "停止加载" })
2380
- ] }) : /* @__PURE__ */ W("div", { className: "auto_load_container", children: [
2381
- /* @__PURE__ */ m(
2766
+ /* @__PURE__ */ E("span", { onClick: $, className: "auto_load_stop_btn", children: "停止加载" })
2767
+ ] }) : /* @__PURE__ */ Z("div", { className: "auto_load_container", children: [
2768
+ /* @__PURE__ */ E(
2382
2769
  "div",
2383
2770
  {
2384
- onClick: k,
2771
+ onClick: T,
2385
2772
  className: "auto_load_next_btn",
2386
2773
  style: {
2387
2774
  backgroundColor: t ? "#f5f5f5" : "#2563eb"
@@ -2389,7 +2776,7 @@ const ze = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2389
2776
  children: "加载下一页"
2390
2777
  }
2391
2778
  ),
2392
- /* @__PURE__ */ W(
2779
+ /* @__PURE__ */ Z(
2393
2780
  "div",
2394
2781
  {
2395
2782
  className: "right_control_wrap",
@@ -2397,23 +2784,23 @@ const ze = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2397
2784
  backgroundColor: t ? "#f5f5f5" : "#2563eb"
2398
2785
  },
2399
2786
  children: [
2400
- /* @__PURE__ */ W(
2787
+ /* @__PURE__ */ Z(
2401
2788
  "div",
2402
2789
  {
2403
2790
  className: "auto_load_btn",
2404
- onClick: t ? void 0 : L,
2791
+ onClick: t ? void 0 : I,
2405
2792
  children: [
2406
- i || /* @__PURE__ */ m("img", { src: ze, alt: "自动加载", width: 14, height: 14 }),
2407
- /* @__PURE__ */ m("span", { children: "自动加载" })
2793
+ i || /* @__PURE__ */ E("img", { src: Ue, alt: "自动加载", width: 14, height: 14 }),
2794
+ /* @__PURE__ */ E("span", { children: "自动加载" })
2408
2795
  ]
2409
2796
  }
2410
2797
  ),
2411
- /* @__PURE__ */ m(
2798
+ /* @__PURE__ */ E(
2412
2799
  Ge,
2413
2800
  {
2414
- value: y,
2415
- onChange: c,
2416
- options: Vt,
2801
+ value: x,
2802
+ onChange: u,
2803
+ options: Wt,
2417
2804
  disabled: t,
2418
2805
  size: "small",
2419
2806
  className: "auto_load_select",
@@ -2423,80 +2810,80 @@ const ze = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2423
2810
  ]
2424
2811
  }
2425
2812
  )
2426
- ] }), _t = ({
2813
+ ] }), Ut = ({
2427
2814
  current: t,
2428
- loadIcon: y,
2429
- pageSize: u,
2815
+ loadIcon: x,
2816
+ pageSize: d,
2430
2817
  total: i,
2431
- cachedPages: c,
2432
- loadedCount: k,
2433
- autoLoading: L = !1,
2434
- loadingProgress: E,
2435
- onChange: C,
2818
+ cachedPages: u,
2819
+ loadedCount: T,
2820
+ autoLoading: I = !1,
2821
+ loadingProgress: $,
2822
+ onChange: w,
2436
2823
  onLoadNextPage: e,
2437
- onStartAutoLoad: A,
2438
- onStopLoading: g
2824
+ onStartAutoLoad: q,
2825
+ onStopLoading: f
2439
2826
  }) => {
2440
- const [l, a] = X(5), n = Math.ceil(i / u), o = Oe(() => c.length >= n, [c, n]), r = () => Array.from(
2827
+ const [s, r] = ne(5), n = Math.ceil(i / d), o = Ye(() => u.length >= n, [u, n]), a = () => Array.from(
2441
2828
  { length: n },
2442
- (h, x) => x + 1
2443
- ).filter((h) => !c.includes(h)).slice(0, l);
2444
- return /* @__PURE__ */ W("div", { className: "pagination_footer", children: [
2445
- /* @__PURE__ */ W("div", { className: "pagination_leftWrap", children: [
2446
- /* @__PURE__ */ W("span", { className: "pagination_total", children: [
2447
- /* @__PURE__ */ m(
2448
- it,
2829
+ (g, b) => b + 1
2830
+ ).filter((g) => !u.includes(g)).slice(0, s);
2831
+ return /* @__PURE__ */ Z("div", { className: "pagination_footer", children: [
2832
+ /* @__PURE__ */ Z("div", { className: "pagination_leftWrap", children: [
2833
+ /* @__PURE__ */ Z("span", { className: "pagination_total", children: [
2834
+ /* @__PURE__ */ E(
2835
+ yt,
2449
2836
  {
2450
2837
  style: { color: "#2563EB", marginRight: "4px" }
2451
2838
  }
2452
2839
  ),
2453
2840
  "已加载: ",
2454
- k,
2841
+ T,
2455
2842
  "/",
2456
2843
  i,
2457
2844
  "条数据"
2458
2845
  ] }),
2459
- !o && /* @__PURE__ */ m(
2460
- Bt,
2846
+ !o && /* @__PURE__ */ E(
2847
+ jt,
2461
2848
  {
2462
- loadIcon: y || void 0,
2463
- autoLoading: L,
2464
- batchSize: l,
2465
- loadingProgress: E,
2466
- disabled: !e || !A,
2467
- onBatchSizeChange: a,
2849
+ loadIcon: x || void 0,
2850
+ autoLoading: I,
2851
+ batchSize: s,
2852
+ loadingProgress: $,
2853
+ disabled: !e || !q,
2854
+ onBatchSizeChange: r,
2468
2855
  onLoadNextPage: () => e?.(),
2469
2856
  onStartAutoLoad: () => {
2470
- const d = r();
2471
- A?.(d);
2857
+ const y = a();
2858
+ q?.(y);
2472
2859
  },
2473
- onStopLoad: () => g?.()
2860
+ onStopLoad: () => f?.()
2474
2861
  }
2475
2862
  )
2476
2863
  ] }),
2477
- /* @__PURE__ */ m(
2478
- nt,
2864
+ /* @__PURE__ */ E(
2865
+ lt,
2479
2866
  {
2480
2867
  current: t,
2481
- pageSize: u,
2868
+ pageSize: d,
2482
2869
  total: i,
2483
- onChange: (d) => C(d),
2870
+ onChange: (y) => w(y),
2484
2871
  showSizeChanger: !1,
2485
2872
  showQuickJumper: !1,
2486
- showTotal: (d, h) => "",
2487
- itemRender: (d, h, x) => {
2488
- const G = c.includes(d);
2489
- return h === "prev" || h === "next" || h === "jump-prev" || h === "jump-next" ? /* @__PURE__ */ m("div", { className: "pageBox", children: x }) : /* @__PURE__ */ W(
2873
+ showTotal: (y, g) => "",
2874
+ itemRender: (y, g, b) => {
2875
+ const V = u.includes(y);
2876
+ return g === "prev" || g === "next" || g === "jump-prev" || g === "jump-next" ? /* @__PURE__ */ E("div", { className: "pageBox", children: b }) : /* @__PURE__ */ Z(
2490
2877
  "div",
2491
2878
  {
2492
2879
  className: "pageBox",
2493
2880
  style: {
2494
- backgroundColor: t === d ? "#2563EB" : "#f5f5f5",
2495
- color: t === d ? "#fff" : G ? "#171717" : "#a3a3a3"
2881
+ backgroundColor: t === y ? "#2563EB" : "#f5f5f5",
2882
+ color: t === y ? "#fff" : V ? "#171717" : "#a3a3a3"
2496
2883
  },
2497
2884
  children: [
2498
- d,
2499
- !G && /* @__PURE__ */ m("span", { className: "unload_spot" })
2885
+ y,
2886
+ !V && /* @__PURE__ */ E("span", { className: "unload_spot" })
2500
2887
  ]
2501
2888
  }
2502
2889
  );
@@ -2504,62 +2891,62 @@ const ze = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2504
2891
  }
2505
2892
  )
2506
2893
  ] });
2507
- }, Gt = (t) => {
2894
+ }, Yt = (t) => {
2508
2895
  const {
2509
- loading: y,
2510
- autoLoading: u,
2896
+ loading: x,
2897
+ autoLoading: d,
2511
2898
  loadingProgress: i,
2512
- columns: c = [],
2513
- dataSource: k = [],
2514
- total: L,
2515
- current: E,
2516
- pageSize: C,
2899
+ columns: u = [],
2900
+ dataSource: T = [],
2901
+ total: I,
2902
+ current: $,
2903
+ pageSize: w,
2517
2904
  cachedPages: e,
2518
- onChangePage: A,
2519
- onLoadNextPage: g,
2520
- onStartAutoLoad: l,
2521
- onStopLoading: a,
2905
+ onChangePage: q,
2906
+ onLoadNextPage: f,
2907
+ onStartAutoLoad: s,
2908
+ onStopLoading: r,
2522
2909
  ...n
2523
- } = t, o = j(null), r = U(
2524
- (s) => {
2525
- A(s), e.includes(s) && o.current?.scrollTo({
2526
- key: `${(s - 1) * C + 1}`
2910
+ } = t, o = Q(null), a = ae(
2911
+ (p) => {
2912
+ q(p), e.includes(p) && o.current?.scrollTo({
2913
+ key: `${(p - 1) * w + 1}`
2527
2914
  });
2528
2915
  },
2529
- [E]
2916
+ [$]
2530
2917
  );
2531
- return /* @__PURE__ */ W("div", { className: "flex flex-col", children: [
2532
- /* @__PURE__ */ m(
2533
- _e,
2918
+ return /* @__PURE__ */ Z("div", { className: "flex flex-col", children: [
2919
+ /* @__PURE__ */ E(
2920
+ Re,
2534
2921
  {
2535
2922
  ref: o,
2536
2923
  ...n,
2537
- columns: c,
2538
- dataSource: k,
2924
+ columns: u,
2925
+ dataSource: T,
2539
2926
  pagination: !1,
2540
2927
  virtual: !0
2541
2928
  }
2542
2929
  ),
2543
- /* @__PURE__ */ m(
2544
- _t,
2930
+ /* @__PURE__ */ E(
2931
+ Ut,
2545
2932
  {
2546
- loading: y,
2547
- autoLoading: u,
2933
+ loading: x,
2934
+ autoLoading: d,
2548
2935
  loadingProgress: i,
2549
- current: E,
2550
- pageSize: C,
2551
- total: L,
2552
- loadedCount: k.length,
2936
+ current: $,
2937
+ pageSize: w,
2938
+ total: I,
2939
+ loadedCount: T.length,
2553
2940
  cachedPages: e,
2554
- onChange: r,
2555
- onLoadNextPage: g,
2556
- onStartAutoLoad: l,
2557
- onStopLoading: a
2941
+ onChange: a,
2942
+ onLoadNextPage: f,
2943
+ onStartAutoLoad: s,
2944
+ onStopLoading: r
2558
2945
  }
2559
2946
  )
2560
2947
  ] });
2561
2948
  };
2562
- Gt.__docgenInfo = {
2949
+ Yt.__docgenInfo = {
2563
2950
  displayName: "VirtualTable",
2564
2951
  description: "虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",
2565
2952
  props: {
@@ -2666,77 +3053,77 @@ Gt.__docgenInfo = {
2666
3053
  }
2667
3054
  }
2668
3055
  };
2669
- const Pt = ({
3056
+ const Kt = ({
2670
3057
  texts: t = [],
2671
- placeholder: y = "请输入内容",
2672
- animationSpeed: u = 100,
3058
+ placeholder: x = "请输入内容",
3059
+ animationSpeed: d = 100,
2673
3060
  autoPlay: i = !0,
2674
- value: c,
2675
- onChange: k,
2676
- ...L
3061
+ value: u,
3062
+ onChange: T,
3063
+ ...I
2677
3064
  }) => {
2678
- const [E, C] = X(""), [e, A] = X(0), [g, l] = X(!1), [a, n] = X(!1), [o, r] = X(!1), s = j(void 0), d = j(void 0), h = j(t), x = j(e), G = j(a), T = j(E);
2679
- ae(() => {
2680
- h.current = t, x.current = e, G.current = a, T.current = E;
3065
+ const [$, w] = ne(""), [e, q] = ne(0), [f, s] = ne(!1), [r, n] = ne(!1), [o, a] = ne(!1), p = Q(void 0), y = Q(void 0), g = Q(t), b = Q(e), V = Q(r), k = Q($);
3066
+ de(() => {
3067
+ g.current = t, b.current = e, V.current = r, k.current = $;
2681
3068
  });
2682
- const _ = U((N, M) => {
2683
- let ne = 0;
2684
- r(!0);
2685
- const re = () => {
2686
- ne < N.length ? (C(N.slice(0, ne + 1)), ne++, d.current = window.setTimeout(re, u)) : (r(!1), M?.());
3069
+ const P = ae((l, c) => {
3070
+ let v = 0;
3071
+ a(!0);
3072
+ const L = () => {
3073
+ v < l.length ? (w(l.slice(0, v + 1)), v++, y.current = window.setTimeout(L, d)) : (a(!1), c?.());
2687
3074
  };
2688
- re();
2689
- }, [u]), H = U((N) => {
2690
- let M = T.current.length;
2691
- const ne = () => {
2692
- M > 0 ? (C(T.current.slice(0, M - 1)), M--, d.current = window.setTimeout(ne, u / 2)) : N?.();
3075
+ L();
3076
+ }, [d]), H = ae((l) => {
3077
+ let c = k.current.length;
3078
+ const v = () => {
3079
+ c > 0 ? (w(k.current.slice(0, c - 1)), c--, y.current = window.setTimeout(v, d / 2)) : l?.();
2693
3080
  };
2694
- ne();
2695
- }, [u]), D = U(() => {
2696
- if (h.current.length === 0 || G.current) return;
2697
- l(!0);
2698
- const N = h.current[x.current];
2699
- T.current ? H(() => {
2700
- _(N, () => {
2701
- s.current = window.setTimeout(() => {
2702
- A((M) => (M + 1) % h.current.length), l(!1);
3081
+ v();
3082
+ }, [d]), F = ae(() => {
3083
+ if (g.current.length === 0 || V.current) return;
3084
+ s(!0);
3085
+ const l = g.current[b.current];
3086
+ k.current ? H(() => {
3087
+ P(l, () => {
3088
+ p.current = window.setTimeout(() => {
3089
+ q((c) => (c + 1) % g.current.length), s(!1);
2703
3090
  }, 2e3);
2704
3091
  });
2705
- }) : _(N, () => {
2706
- s.current = window.setTimeout(() => {
2707
- A((M) => (M + 1) % h.current.length), l(!1);
3092
+ }) : P(l, () => {
3093
+ p.current = window.setTimeout(() => {
3094
+ q((c) => (c + 1) % g.current.length), s(!1);
2708
3095
  }, 2e3);
2709
3096
  });
2710
- }, [H, _]);
2711
- return ae(() => (i && t.length > 0 && !a && D(), () => {
2712
- s.current && window.clearTimeout(s.current), d.current && window.clearTimeout(d.current);
2713
- }), [e, a, i, t.length, D]), ae(() => {
2714
- !g && i && t.length > 0 && !a && D();
2715
- }, [e, g, i, t.length, a, D]), /* @__PURE__ */ W("div", { style: { position: "relative" }, children: [
2716
- /* @__PURE__ */ m(
2717
- Fe,
3097
+ }, [H, P]);
3098
+ return de(() => (i && t.length > 0 && !r && F(), () => {
3099
+ p.current && window.clearTimeout(p.current), y.current && window.clearTimeout(y.current);
3100
+ }), [e, r, i, t.length, F]), de(() => {
3101
+ !f && i && t.length > 0 && !r && F();
3102
+ }, [e, f, i, t.length, r, F]), /* @__PURE__ */ Z("div", { style: { position: "relative" }, children: [
3103
+ /* @__PURE__ */ E(
3104
+ Ke,
2718
3105
  {
2719
- ...L,
2720
- value: c,
2721
- onChange: (N) => {
2722
- k?.(N.target.value), L.onChange?.(N);
3106
+ ...I,
3107
+ value: u,
3108
+ onChange: (l) => {
3109
+ T?.(l.target.value), I.onChange?.(l);
2723
3110
  },
2724
- onFocus: (N) => {
2725
- n(!0), s.current && window.clearTimeout(s.current), d.current && window.clearTimeout(d.current), l(!1), r(!1), L.onFocus?.(N);
3111
+ onFocus: (l) => {
3112
+ n(!0), p.current && window.clearTimeout(p.current), y.current && window.clearTimeout(y.current), s(!1), a(!1), I.onFocus?.(l);
2726
3113
  },
2727
- onBlur: (N) => {
2728
- n(!1), !c && t.length > 0 && (C(""), A(0)), L.onBlur?.(N);
3114
+ onBlur: (l) => {
3115
+ n(!1), !u && t.length > 0 && (w(""), q(0)), I.onBlur?.(l);
2729
3116
  },
2730
- placeholder: a || c ? y : E || y,
3117
+ placeholder: r || u ? x : $ || x,
2731
3118
  style: {
2732
3119
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2733
- ...L.style,
3120
+ ...I.style,
2734
3121
  position: "relative",
2735
3122
  zIndex: 1
2736
3123
  }
2737
3124
  }
2738
3125
  ),
2739
- !a && !c && E && /* @__PURE__ */ W(
3126
+ !r && !u && $ && /* @__PURE__ */ Z(
2740
3127
  "div",
2741
3128
  {
2742
3129
  style: {
@@ -2756,8 +3143,8 @@ const Pt = ({
2756
3143
  fontFamily: "inherit"
2757
3144
  },
2758
3145
  children: [
2759
- /* @__PURE__ */ m("span", { children: E }),
2760
- o && /* @__PURE__ */ m(
3146
+ /* @__PURE__ */ E("span", { children: $ }),
3147
+ o && /* @__PURE__ */ E(
2761
3148
  "span",
2762
3149
  {
2763
3150
  style: {
@@ -2773,7 +3160,7 @@ const Pt = ({
2773
3160
  ]
2774
3161
  }
2775
3162
  ),
2776
- /* @__PURE__ */ m("style", { children: `
3163
+ /* @__PURE__ */ E("style", { children: `
2777
3164
  @keyframes blink {
2778
3165
  0%, 50% { opacity: 1; }
2779
3166
  51%, 100% { opacity: 0; }
@@ -2781,7 +3168,7 @@ const Pt = ({
2781
3168
  ` })
2782
3169
  ] });
2783
3170
  };
2784
- Pt.__docgenInfo = {
3171
+ Kt.__docgenInfo = {
2785
3172
  displayName: "DynamicInput",
2786
3173
  description: "动态文案输入框组件,支持流式文字动画效果",
2787
3174
  props: {
@@ -2826,109 +3213,109 @@ Pt.__docgenInfo = {
2826
3213
  }
2827
3214
  }
2828
3215
  };
2829
- const Dt = ({
3216
+ const Xt = ({
2830
3217
  texts: t = [],
2831
3218
  // 动态文案数组,默认为空数组
2832
- placeholder: y = "请输入内容",
3219
+ placeholder: x = "请输入内容",
2833
3220
  // 占位符文本
2834
- animationSpeed: u = 100,
3221
+ animationSpeed: d = 100,
2835
3222
  // 打字机动画速度,毫秒
2836
3223
  autoPlay: i = !0,
2837
3224
  // 是否自动播放动画
2838
- value: c = "",
3225
+ value: u = "",
2839
3226
  // 受控模式的值
2840
- onChange: k,
3227
+ onChange: T,
2841
3228
  // 受控模式的变化回调
2842
- onSubmit: L,
3229
+ onSubmit: I,
2843
3230
  // 提交回调
2844
- maxLength: E = 500,
3231
+ maxLength: $ = 500,
2845
3232
  // 最大字符数限制
2846
- showCount: C = !0,
3233
+ showCount: w = !0,
2847
3234
  // 是否显示字数统计
2848
3235
  submitText: e = "发送",
2849
3236
  // 提交按钮文本
2850
- disabled: A = !1,
3237
+ disabled: q = !1,
2851
3238
  // 是否禁用组件
2852
- rows: g = 4,
3239
+ rows: f = 4,
2853
3240
  // 文本域行数
2854
- style: l,
3241
+ style: s,
2855
3242
  // 自定义样式
2856
- ...a
3243
+ ...r
2857
3244
  // 其他原生属性
2858
3245
  }) => {
2859
- const [n, o] = X(""), [r, s] = X(0), [d, h] = X(!1), [x, G] = X(!1), [T, _] = X(!1), [H, D] = X(c || ""), K = j(void 0), Q = j(void 0), Y = j(t), te = j(r), N = j(x), M = j(n), ne = j(null);
2860
- ae(() => {
2861
- Y.current = t, te.current = r, N.current = x, M.current = n;
3246
+ const [n, o] = ne(""), [a, p] = ne(0), [y, g] = ne(!1), [b, V] = ne(!1), [k, P] = ne(!1), [H, F] = ne(u || ""), U = Q(void 0), R = Q(void 0), ee = Q(t), re = Q(a), l = Q(b), c = Q(n), v = Q(null);
3247
+ de(() => {
3248
+ ee.current = t, re.current = a, l.current = b, c.current = n;
2862
3249
  });
2863
- const re = U((O, le) => {
2864
- let de = 0;
2865
- _(!0);
2866
- const be = () => {
2867
- de < O.length ? (o(O.slice(0, de + 1)), de++, Q.current = window.setTimeout(be, u)) : (_(!1), le?.());
3250
+ const L = ae((X, ue) => {
3251
+ let he = 0;
3252
+ P(!0);
3253
+ const ye = () => {
3254
+ he < X.length ? (o(X.slice(0, he + 1)), he++, R.current = window.setTimeout(ye, d)) : (P(!1), ue?.());
2868
3255
  };
2869
- be();
2870
- }, [u]), ce = U((O) => {
2871
- let le = M.current.length;
2872
- const de = () => {
2873
- le > 0 ? (o(M.current.slice(0, le - 1)), le--, Q.current = window.setTimeout(de, u / 2)) : O?.();
3256
+ ye();
3257
+ }, [d]), N = ae((X) => {
3258
+ let ue = c.current.length;
3259
+ const he = () => {
3260
+ ue > 0 ? (o(c.current.slice(0, ue - 1)), ue--, R.current = window.setTimeout(he, d / 2)) : X?.();
2874
3261
  };
2875
- de();
2876
- }, [u]), ye = U(() => {
2877
- if (Y.current.length === 0 || N.current) return;
2878
- h(!0);
2879
- const O = Y.current[te.current];
2880
- M.current ? ce(() => {
2881
- re(O, () => {
2882
- K.current = window.setTimeout(() => {
2883
- s((le) => (le + 1) % Y.current.length), h(!1);
3262
+ he();
3263
+ }, [d]), W = ae(() => {
3264
+ if (ee.current.length === 0 || l.current) return;
3265
+ g(!0);
3266
+ const X = ee.current[re.current];
3267
+ c.current ? N(() => {
3268
+ L(X, () => {
3269
+ U.current = window.setTimeout(() => {
3270
+ p((ue) => (ue + 1) % ee.current.length), g(!1);
2884
3271
  }, 2e3);
2885
3272
  });
2886
- }) : re(O, () => {
2887
- K.current = window.setTimeout(() => {
2888
- s((le) => (le + 1) % Y.current.length), h(!1);
3273
+ }) : L(X, () => {
3274
+ U.current = window.setTimeout(() => {
3275
+ p((ue) => (ue + 1) % ee.current.length), g(!1);
2889
3276
  }, 2e3);
2890
3277
  });
2891
- }, [ce, re]);
2892
- ae(() => (i && t.length > 0 && !x && ye(), () => {
2893
- K.current && window.clearTimeout(K.current), Q.current && window.clearTimeout(Q.current);
2894
- }), [r, x, i, t.length, ye]), ae(() => {
2895
- !d && i && t.length > 0 && !x && ye();
2896
- }, [r, d, i, t.length, x, ye]);
2897
- const ue = (O) => {
2898
- G(!0), K.current && window.clearTimeout(K.current), Q.current && window.clearTimeout(Q.current), h(!1), _(!1), a.onFocus?.(O);
2899
- }, Ne = (O) => {
2900
- G(!1), !c && t.length > 0 && (o(""), s(0)), a.onBlur?.(O);
2901
- }, Se = (O) => {
2902
- const le = O.target.value;
2903
- E && le.length > E || (k ? k(le) : D(le), a.onChange?.(O));
2904
- }, xe = () => {
2905
- const O = k ? c : H;
2906
- O.trim() && !A && (L?.(O), k || D(""));
2907
- }, Ae = (O) => {
2908
- (O.ctrlKey || O.metaKey) && O.key === "Enter" && (O.preventDefault(), xe()), a.onKeyDown?.(O);
2909
- }, me = k ? c : H, Le = A || !me.trim() || (E ? me.length > E : !1);
2910
- return /* @__PURE__ */ W("div", { style: { position: "relative", ...l }, children: [
2911
- /* @__PURE__ */ W("div", { style: { position: "relative" }, children: [
2912
- /* @__PURE__ */ m(
3278
+ }, [N, L]);
3279
+ de(() => (i && t.length > 0 && !b && W(), () => {
3280
+ U.current && window.clearTimeout(U.current), R.current && window.clearTimeout(R.current);
3281
+ }), [a, b, i, t.length, W]), de(() => {
3282
+ !y && i && t.length > 0 && !b && W();
3283
+ }, [a, y, i, t.length, b, W]);
3284
+ const z = (X) => {
3285
+ V(!0), U.current && window.clearTimeout(U.current), R.current && window.clearTimeout(R.current), g(!1), P(!1), r.onFocus?.(X);
3286
+ }, te = (X) => {
3287
+ V(!1), !u && t.length > 0 && (o(""), p(0)), r.onBlur?.(X);
3288
+ }, se = (X) => {
3289
+ const ue = X.target.value;
3290
+ $ && ue.length > $ || (T ? T(ue) : F(ue), r.onChange?.(X));
3291
+ }, ce = () => {
3292
+ const X = T ? u : H;
3293
+ X.trim() && !q && (I?.(X), T || F(""));
3294
+ }, pe = (X) => {
3295
+ (X.ctrlKey || X.metaKey) && X.key === "Enter" && (X.preventDefault(), ce()), r.onKeyDown?.(X);
3296
+ }, fe = T ? u : H, be = q || !fe.trim() || ($ ? fe.length > $ : !1);
3297
+ return /* @__PURE__ */ Z("div", { style: { position: "relative", ...s }, children: [
3298
+ /* @__PURE__ */ Z("div", { style: { position: "relative" }, children: [
3299
+ /* @__PURE__ */ E(
2913
3300
  "textarea",
2914
3301
  {
2915
- ref: ne,
2916
- value: k ? c : H,
2917
- onChange: Se,
2918
- onFocus: (O) => {
2919
- O.target.style.borderColor = "#1890ff", O.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", ue(O);
3302
+ ref: v,
3303
+ value: T ? u : H,
3304
+ onChange: se,
3305
+ onFocus: (X) => {
3306
+ X.target.style.borderColor = "#1890ff", X.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", z(X);
2920
3307
  },
2921
- onBlur: (O) => {
2922
- O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none", Ne(O);
3308
+ onBlur: (X) => {
3309
+ X.target.style.borderColor = "#d9d9d9", X.target.style.boxShadow = "none", te(X);
2923
3310
  },
2924
- onKeyDown: Ae,
2925
- placeholder: x || me ? y : "",
2926
- maxLength: E,
2927
- rows: g,
2928
- disabled: A,
3311
+ onKeyDown: pe,
3312
+ placeholder: b || fe ? x : "",
3313
+ maxLength: $,
3314
+ rows: f,
3315
+ disabled: q,
2929
3316
  style: {
2930
3317
  width: "100%",
2931
- minHeight: `${g * 24 + 16}px`,
3318
+ minHeight: `${f * 24 + 16}px`,
2932
3319
  padding: "8px 60px 8px 12px",
2933
3320
  // 右侧留出按钮空间
2934
3321
  border: "1px solid #d9d9d9",
@@ -2941,12 +3328,12 @@ const Dt = ({
2941
3328
  transition: "border-color 0.3s, box-shadow 0.3s",
2942
3329
  backgroundColor: "#fff",
2943
3330
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2944
- ...a.style
3331
+ ...r.style
2945
3332
  },
2946
- ...a
3333
+ ...r
2947
3334
  }
2948
3335
  ),
2949
- !x && !me && n && /* @__PURE__ */ W(
3336
+ !b && !fe && n && /* @__PURE__ */ Z(
2950
3337
  "div",
2951
3338
  {
2952
3339
  style: {
@@ -2968,8 +3355,8 @@ const Dt = ({
2968
3355
  lineHeight: "1.5"
2969
3356
  },
2970
3357
  children: [
2971
- /* @__PURE__ */ m("span", { children: n }),
2972
- T && /* @__PURE__ */ m(
3358
+ /* @__PURE__ */ E("span", { children: n }),
3359
+ k && /* @__PURE__ */ E(
2973
3360
  "span",
2974
3361
  {
2975
3362
  style: {
@@ -2985,7 +3372,7 @@ const Dt = ({
2985
3372
  ]
2986
3373
  }
2987
3374
  ),
2988
- /* @__PURE__ */ m(
3375
+ /* @__PURE__ */ E(
2989
3376
  "div",
2990
3377
  {
2991
3378
  style: {
@@ -2994,14 +3381,14 @@ const Dt = ({
2994
3381
  right: 8,
2995
3382
  zIndex: 3
2996
3383
  },
2997
- children: /* @__PURE__ */ m(
2998
- ge,
3384
+ children: /* @__PURE__ */ E(
3385
+ $e,
2999
3386
  {
3000
3387
  type: "primary",
3001
3388
  size: "small",
3002
- icon: /* @__PURE__ */ m(ct, {}),
3003
- onClick: xe,
3004
- disabled: Le,
3389
+ icon: /* @__PURE__ */ E(mt, {}),
3390
+ onClick: ce,
3391
+ disabled: be,
3005
3392
  style: {
3006
3393
  borderRadius: 6,
3007
3394
  minWidth: 32,
@@ -3016,7 +3403,7 @@ const Dt = ({
3016
3403
  }
3017
3404
  )
3018
3405
  ] }),
3019
- C && /* @__PURE__ */ W(
3406
+ w && /* @__PURE__ */ Z(
3020
3407
  "div",
3021
3408
  {
3022
3409
  style: {
@@ -3026,13 +3413,13 @@ const Dt = ({
3026
3413
  color: "#999"
3027
3414
  },
3028
3415
  children: [
3029
- me.length,
3416
+ fe.length,
3030
3417
  "/",
3031
- E
3418
+ $
3032
3419
  ]
3033
3420
  }
3034
3421
  ),
3035
- /* @__PURE__ */ m("style", { children: `
3422
+ /* @__PURE__ */ E("style", { children: `
3036
3423
  @keyframes blink {
3037
3424
  0%, 50% { opacity: 1; }
3038
3425
  51%, 100% { opacity: 0; }
@@ -3040,7 +3427,7 @@ const Dt = ({
3040
3427
  ` })
3041
3428
  ] });
3042
3429
  };
3043
- Dt.__docgenInfo = {
3430
+ Xt.__docgenInfo = {
3044
3431
  displayName: "DynamicTextArea",
3045
3432
  description: "动态文案文本域组件,支持流式文字动画效果",
3046
3433
  props: {
@@ -3126,96 +3513,96 @@ Dt.__docgenInfo = {
3126
3513
  }
3127
3514
  }
3128
3515
  };
3129
- const We = ({
3516
+ const Je = ({
3130
3517
  src: t,
3131
- poster: y,
3132
- width: u = 300,
3518
+ poster: x,
3519
+ width: d = 300,
3133
3520
  height: i,
3134
- videoWidth: c,
3521
+ videoWidth: u,
3135
3522
  // 参数保留但不使用,由CSS控制
3136
- videoHeight: k,
3523
+ videoHeight: T,
3137
3524
  // 参数保留但不使用,由CSS控制
3138
- showPlayButton: L = !0,
3139
- autoPlayOnHover: E = !0,
3140
- onClick: C,
3525
+ showPlayButton: I = !0,
3526
+ autoPlayOnHover: $ = !0,
3527
+ onClick: w,
3141
3528
  onVideoLoaded: e,
3142
- onVideoPlay: A,
3143
- onVideoPause: g,
3144
- onVideoEnded: l,
3145
- className: a,
3529
+ onVideoPlay: q,
3530
+ onVideoPause: f,
3531
+ onVideoEnded: s,
3532
+ className: r,
3146
3533
  style: n,
3147
3534
  ...o
3148
3535
  }) => {
3149
- const r = j(null), [s, d] = X(!1), [h, x] = X(!1), [G, T] = X(!1), _ = U(() => {
3150
- r.current && (r.current.play(), d(!0), A?.());
3151
- }, [A]), H = U(() => {
3152
- r.current && (r.current.pause(), d(!1), g?.());
3153
- }, [g]), D = U((re) => {
3154
- re.stopPropagation(), s ? H() : _();
3155
- }, [s, _, H]), K = U(() => {
3156
- x(!0), E && !s && _();
3157
- }, [E, s, _]), Q = U(() => {
3158
- x(!1), E && s && H();
3159
- }, [E, s, H]), Y = U(() => {
3160
- T(!0), e?.();
3161
- }, [e]), te = U(() => {
3162
- d(!0), A?.();
3163
- }, [A]), N = U(() => {
3164
- d(!1), g?.();
3165
- }, [g]), M = U(() => {
3166
- d(!1), l?.();
3167
- }, [l]), ne = U((re) => {
3168
- C?.(re);
3169
- }, [C]);
3170
- return /* @__PURE__ */ m(
3171
- Be,
3536
+ const a = Q(null), [p, y] = ne(!1), [g, b] = ne(!1), [V, k] = ne(!1), P = ae(() => {
3537
+ a.current && (a.current.play(), y(!0), q?.());
3538
+ }, [q]), H = ae(() => {
3539
+ a.current && (a.current.pause(), y(!1), f?.());
3540
+ }, [f]), F = ae((L) => {
3541
+ L.stopPropagation(), p ? H() : P();
3542
+ }, [p, P, H]), U = ae(() => {
3543
+ b(!0), $ && !p && P();
3544
+ }, [$, p, P]), R = ae(() => {
3545
+ b(!1), $ && p && H();
3546
+ }, [$, p, H]), ee = ae(() => {
3547
+ k(!0), e?.();
3548
+ }, [e]), re = ae(() => {
3549
+ y(!0), q?.();
3550
+ }, [q]), l = ae(() => {
3551
+ y(!1), f?.();
3552
+ }, [f]), c = ae(() => {
3553
+ y(!1), s?.();
3554
+ }, [s]), v = ae((L) => {
3555
+ w?.(L);
3556
+ }, [w]);
3557
+ return /* @__PURE__ */ E(
3558
+ Oe,
3172
3559
  {
3173
3560
  ...o,
3174
- className: `video-card ${a || ""}`,
3561
+ className: `video-card ${r || ""}`,
3175
3562
  style: {
3176
- width: u,
3563
+ width: d,
3177
3564
  height: i,
3178
3565
  padding: 0,
3179
3566
  overflow: "hidden",
3180
- cursor: C ? "pointer" : "default",
3567
+ cursor: w ? "pointer" : "default",
3181
3568
  border: "none",
3182
3569
  borderRadius: 0,
3183
3570
  ...n
3184
3571
  },
3185
3572
  bordered: !1,
3186
- onMouseEnter: K,
3187
- onMouseLeave: Q,
3188
- onClick: ne,
3189
- children: /* @__PURE__ */ W("div", { className: "video-card-container", children: [
3190
- /* @__PURE__ */ m(
3573
+ onMouseEnter: U,
3574
+ onMouseLeave: R,
3575
+ onClick: v,
3576
+ children: /* @__PURE__ */ Z("div", { className: "video-card-container", children: [
3577
+ /* @__PURE__ */ E(
3191
3578
  "video",
3192
3579
  {
3193
- ref: r,
3580
+ ref: a,
3194
3581
  src: t,
3195
- poster: y,
3582
+ poster: x,
3196
3583
  preload: "metadata",
3197
- onLoadedData: Y,
3198
- onPlay: te,
3199
- onPause: N,
3200
- onEnded: M,
3584
+ onLoadedData: ee,
3585
+ onPlay: re,
3586
+ onPause: l,
3587
+ onEnded: c,
3201
3588
  muted: !0,
3202
3589
  loop: !0
3203
3590
  }
3204
3591
  ),
3205
- L && /* @__PURE__ */ m(
3592
+ I && /* @__PURE__ */ E(
3206
3593
  "div",
3207
3594
  {
3208
- className: `video-play-button ${h ? "hovered" : ""}`,
3209
- onClick: D,
3210
- children: s ? /* @__PURE__ */ m(ut, { className: "play-icon" }) : /* @__PURE__ */ m(dt, { className: "play-icon" })
3595
+ className: `video-play-button ${g ? "hovered" : ""}`,
3596
+ onClick: F,
3597
+ children: p ? /* @__PURE__ */ E(ht, { className: "play-icon" }) : /* @__PURE__ */ E(gt, { className: "play-icon" })
3211
3598
  }
3212
3599
  ),
3213
- !G && /* @__PURE__ */ m("div", { className: "video-loading-mask", children: /* @__PURE__ */ m("div", { className: "loading-spinner" }) })
3600
+ !V && /* @__PURE__ */ E("div", { className: "video-loading-mask", children: /* @__PURE__ */ E("div", { className: "loading-spinner" }) })
3214
3601
  ] })
3215
3602
  }
3216
3603
  );
3217
3604
  };
3218
- We.__docgenInfo = {
3605
+ Je.__docgenInfo = {
3219
3606
  displayName: "VideoCard",
3220
3607
  description: "视频卡片组件,支持鼠标悬浮播放控制",
3221
3608
  props: {
@@ -3316,12 +3703,12 @@ We.__docgenInfo = {
3316
3703
  }
3317
3704
  }
3318
3705
  };
3319
- const Mt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((u) => t.toLowerCase().includes(u)), Rt = (t) => t.type ? t.type : Mt(t.url) ? "video" : "image", Ht = ({
3706
+ const Jt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((d) => t.toLowerCase().includes(d)), Qt = (t) => t.type ? t.type : Jt(t.url) ? "video" : "image", Zt = ({
3320
3707
  items: t,
3321
- columns: y,
3322
- gap: u = 0,
3708
+ columns: x,
3709
+ gap: d = 0,
3323
3710
  responsive: i = !0,
3324
- breakpoints: c = {
3711
+ breakpoints: u = {
3325
3712
  xs: 1,
3326
3713
  sm: 2,
3327
3714
  md: 3,
@@ -3329,92 +3716,92 @@ const Mt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
3329
3716
  xl: 5,
3330
3717
  xxl: 6
3331
3718
  },
3332
- className: k,
3333
- style: L,
3334
- onClick: E
3719
+ className: T,
3720
+ style: I,
3721
+ onClick: $
3335
3722
  }) => {
3336
- const C = j(null), [e, A] = X(y || c.md || 3), g = j(/* @__PURE__ */ new Map()), l = U(() => {
3337
- if (!i || y)
3338
- return y || c.md || 3;
3339
- const r = window.innerWidth;
3340
- return r < 576 ? c.xs || 1 : r < 768 ? c.sm || 2 : r < 992 ? c.md || 3 : r < 1200 ? c.lg || 4 : r < 1600 ? c.xl || 5 : c.xxl || 6;
3341
- }, [i, y, c]), a = U(() => {
3342
- if (!C.current) return;
3343
- const r = e, s = C.current, h = (s.offsetWidth - u * (r - 1)) / r, x = new Array(r).fill(0);
3344
- t.forEach((T, _) => {
3345
- const H = T.id || _, D = g.current.get(H);
3346
- if (!D) return;
3347
- const K = Math.min(...x), Q = x.indexOf(K), Y = Q * (h + u), te = x[Q];
3348
- D.style.position = "absolute", D.style.left = `${Y}px`, D.style.top = `${te}px`, D.style.width = `${h}px`, x[Q] += D.offsetHeight + u;
3723
+ const w = Q(null), [e, q] = ne(x || u.md || 3), f = Q(/* @__PURE__ */ new Map()), s = ae(() => {
3724
+ if (!i || x)
3725
+ return x || u.md || 3;
3726
+ const a = window.innerWidth;
3727
+ return a < 576 ? u.xs || 1 : a < 768 ? u.sm || 2 : a < 992 ? u.md || 3 : a < 1200 ? u.lg || 4 : a < 1600 ? u.xl || 5 : u.xxl || 6;
3728
+ }, [i, x, u]), r = ae(() => {
3729
+ if (!w.current) return;
3730
+ const a = e, p = w.current, g = (p.offsetWidth - d * (a - 1)) / a, b = new Array(a).fill(0);
3731
+ t.forEach((k, P) => {
3732
+ const H = k.id || P, F = f.current.get(H);
3733
+ if (!F) return;
3734
+ const U = Math.min(...b), R = b.indexOf(U), ee = R * (g + d), re = b[R];
3735
+ F.style.position = "absolute", F.style.left = `${ee}px`, F.style.top = `${re}px`, F.style.width = `${g}px`, b[R] += F.offsetHeight + d;
3349
3736
  });
3350
- const G = Math.max(...x);
3351
- s.style.height = `${G}px`;
3352
- }, [t, e, u]);
3353
- ae(() => {
3354
- const r = () => {
3355
- const s = l();
3356
- s !== e && A(s);
3737
+ const V = Math.max(...b);
3738
+ p.style.height = `${V}px`;
3739
+ }, [t, e, d]);
3740
+ de(() => {
3741
+ const a = () => {
3742
+ const p = s();
3743
+ p !== e && q(p);
3357
3744
  };
3358
3745
  if (i)
3359
- return window.addEventListener("resize", r), r(), () => window.removeEventListener("resize", r);
3360
- }, [i, l, e]), ae(() => {
3361
- const r = setTimeout(() => {
3362
- a();
3746
+ return window.addEventListener("resize", a), a(), () => window.removeEventListener("resize", a);
3747
+ }, [i, s, e]), de(() => {
3748
+ const a = setTimeout(() => {
3749
+ r();
3363
3750
  }, 100);
3364
- return () => clearTimeout(r);
3365
- }, [t, e, a]);
3366
- const n = U(() => {
3367
- a();
3368
- }, [a]), o = U((r) => {
3369
- E && E(r), r.onClick?.(r);
3370
- }, [E]);
3371
- return /* @__PURE__ */ m(
3751
+ return () => clearTimeout(a);
3752
+ }, [t, e, r]);
3753
+ const n = ae(() => {
3754
+ r();
3755
+ }, [r]), o = ae((a) => {
3756
+ $ && $(a), a.onClick?.(a);
3757
+ }, [$]);
3758
+ return /* @__PURE__ */ E(
3372
3759
  "div",
3373
3760
  {
3374
- ref: C,
3375
- className: `waterfall-container ${k || ""}`,
3761
+ ref: w,
3762
+ className: `waterfall-container ${T || ""}`,
3376
3763
  style: {
3377
3764
  position: "relative",
3378
3765
  width: "100%",
3379
- ...L
3766
+ ...I
3380
3767
  },
3381
- children: t.map((r, s) => {
3382
- const d = r.id || s, h = Rt(r);
3383
- return /* @__PURE__ */ m(
3768
+ children: t.map((a, p) => {
3769
+ const y = a.id || p, g = Qt(a);
3770
+ return /* @__PURE__ */ E(
3384
3771
  "div",
3385
3772
  {
3386
- ref: (x) => {
3387
- x ? g.current.set(d, x) : g.current.delete(d);
3773
+ ref: (b) => {
3774
+ b ? f.current.set(y, b) : f.current.delete(y);
3388
3775
  },
3389
3776
  className: "waterfall-item",
3390
- children: h === "video" ? /* @__PURE__ */ m("div", { style: {
3777
+ children: g === "video" ? /* @__PURE__ */ E("div", { style: {
3391
3778
  width: "100%",
3392
3779
  position: "relative",
3393
3780
  paddingBottom: "56.25%",
3394
- cursor: E || r.onClick ? "pointer" : "default"
3395
- }, children: /* @__PURE__ */ m("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ m(
3396
- We,
3781
+ cursor: $ || a.onClick ? "pointer" : "default"
3782
+ }, children: /* @__PURE__ */ E("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ E(
3783
+ Je,
3397
3784
  {
3398
- src: r.url,
3399
- poster: r.poster,
3785
+ src: a.url,
3786
+ poster: a.poster,
3400
3787
  width: "100%",
3401
3788
  height: "100%",
3402
- onClick: () => o(r),
3789
+ onClick: () => o(a),
3403
3790
  onVideoLoaded: n,
3404
3791
  autoPlayOnHover: !0,
3405
3792
  showPlayButton: !1
3406
3793
  }
3407
- ) }) }) : /* @__PURE__ */ m(
3794
+ ) }) }) : /* @__PURE__ */ E(
3408
3795
  "div",
3409
3796
  {
3410
3797
  className: "waterfall-image-wrapper",
3411
- onClick: () => o(r),
3412
- style: { cursor: E || r.onClick ? "pointer" : "default" },
3413
- children: /* @__PURE__ */ m(
3798
+ onClick: () => o(a),
3799
+ style: { cursor: $ || a.onClick ? "pointer" : "default" },
3800
+ children: /* @__PURE__ */ E(
3414
3801
  "img",
3415
3802
  {
3416
- src: r.url,
3417
- alt: `瀑布流图片 ${s + 1}`,
3803
+ src: a.url,
3804
+ alt: `瀑布流图片 ${p + 1}`,
3418
3805
  className: "waterfall-image",
3419
3806
  onLoad: n,
3420
3807
  onError: n,
@@ -3424,13 +3811,13 @@ const Mt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
3424
3811
  }
3425
3812
  )
3426
3813
  },
3427
- d
3814
+ y
3428
3815
  );
3429
3816
  })
3430
3817
  }
3431
3818
  );
3432
3819
  };
3433
- Ht.__docgenInfo = {
3820
+ Zt.__docgenInfo = {
3434
3821
  displayName: "Waterfall",
3435
3822
  description: "瀑布流布局组件,支持图片和视频混合展示",
3436
3823
  props: {
@@ -3486,8 +3873,8 @@ Ht.__docgenInfo = {
3486
3873
  }
3487
3874
  }
3488
3875
  };
3489
- const Ut = {
3490
- algorithm: at.defaultAlgorithm,
3876
+ const sn = {
3877
+ algorithm: ct.defaultAlgorithm,
3491
3878
  token: {
3492
3879
  // 主色
3493
3880
  colorPrimary: "#3b82f6",
@@ -3553,21 +3940,21 @@ const Ut = {
3553
3940
  }
3554
3941
  };
3555
3942
  export {
3556
- Et as AdvancedTable,
3557
- mt as AppModal,
3558
- bt as BackButton,
3559
- ft as Button,
3560
- yt as Card,
3561
- Pt as DynamicInput,
3562
- Dt as DynamicTextArea,
3563
- xt as EmptyAndSpin,
3564
- kt as LinkButton,
3565
- gt as PageTable,
3566
- It as RichTextEditor,
3567
- We as VideoCard,
3568
- Gt as VirtualTable,
3569
- Ht as Waterfall,
3570
- vt as XcIcon,
3571
- Ut as lightTheme
3943
+ Nt as AdvancedTable,
3944
+ xt as AppModal,
3945
+ Ct as BackButton,
3946
+ vt as Button,
3947
+ bt as Card,
3948
+ Kt as DynamicInput,
3949
+ Xt as DynamicTextArea,
3950
+ $t as EmptyAndSpin,
3951
+ Tt as LinkButton,
3952
+ kt as PageTable,
3953
+ zt as RichTextEditor,
3954
+ Je as VideoCard,
3955
+ Yt as VirtualTable,
3956
+ Zt as Waterfall,
3957
+ Et as XcIcon,
3958
+ sn as lightTheme
3572
3959
  };
3573
3960
  //# sourceMappingURL=index.es.js.map