@guodun/antdv 1.7.6 → 1.7.8

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.
Files changed (47) hide show
  1. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +152 -146
  2. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +415 -295
  3. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1040 -993
  4. package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +141 -47
  5. package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +1 -1
  6. package/dist/es/components/pro-contract-template-designer/src/composables/use-page-authoring.mjs +22 -21
  7. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +37 -36
  8. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +125 -75
  9. package/dist/es/components/pro-contract-template-designer/src/utils/authoring-search.mjs +34 -13
  10. package/dist/es/components/pro-contract-template-designer/src/utils/caret-viewport.mjs +41 -0
  11. package/dist/es/components/pro-contract-template-designer/src/utils/document-outline.mjs +24 -1
  12. package/dist/es/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.mjs +15 -0
  13. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  14. package/dist/es/index.mjs +21 -21
  15. package/dist/es/node_modules/@tiptap/pm/dist/transform/index.mjs +1 -0
  16. package/dist/es/node_modules/prosemirror-transform/dist/index.mjs +161 -67
  17. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
  18. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  19. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  20. package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -1
  21. package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -1
  22. package/dist/lib/components/pro-contract-template-designer/src/composables/use-page-authoring.cjs +1 -1
  23. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.cjs +1 -1
  24. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  25. package/dist/lib/components/pro-contract-template-designer/src/utils/authoring-search.cjs +1 -1
  26. package/dist/lib/components/pro-contract-template-designer/src/utils/caret-viewport.cjs +1 -0
  27. package/dist/lib/components/pro-contract-template-designer/src/utils/document-outline.cjs +1 -1
  28. package/dist/lib/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.cjs +1 -0
  29. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  30. package/dist/lib/index.cjs +1 -1
  31. package/dist/lib/node_modules/@tiptap/pm/dist/transform/index.cjs +1 -0
  32. package/dist/lib/node_modules/prosemirror-transform/dist/index.cjs +2 -2
  33. package/dist/theme/icon.css +1 -1
  34. package/dist/theme/index.css +1 -1
  35. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
  36. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +28 -0
  37. package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +25 -2
  38. package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +1 -1
  39. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +10 -1
  40. package/dist/types/components/pro-contract-template-designer/src/utils/authoring-search.d.ts +5 -0
  41. package/dist/types/components/pro-contract-template-designer/src/utils/caret-viewport.d.ts +18 -0
  42. package/dist/types/components/pro-contract-template-designer/src/utils/document-outline.d.ts +6 -0
  43. package/dist/types/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.d.ts +16 -0
  44. package/package.json +3 -3
  45. package/dist/theme/dept-selector.css +0 -1
  46. package/dist/theme/pro-selector-group.css +0 -1
  47. package/dist/theme/role-selector.css +0 -1
@@ -1,54 +1,55 @@
1
1
  import { CONTRACT_BLOCK_STYLES as e, DEFAULT_CONTRACT_FONT_FAMILY as t, DEFAULT_FONT_SIZE_PRESETS as n, DEFAULT_TEXT_ALIGN_OPTIONS as r, resolveFontFamilyOptions as i } from "./constants.mjs";
2
2
  import { collectPageDecorationVariableKeys as a, normalizePageDecorations as o, resolvePageDecorationPreset as ee, resolvePageDecorationValidationPath as te, rewritePageDecorationVariableTokens as ne } from "./utils/page-decorations.mjs";
3
3
  import { isContractTemplateFieldType as re } from "./types.mjs";
4
- import { DEFAULT_ADVANCED_CHOICE_FIELD_TYPES as ie, DEFAULT_BUILTIN_SELECTOR_FIELD_TYPES as ae, DEFAULT_CUSTOM_FIELD_TYPES as oe, DEFAULT_FIELD_STYLE as se, DEFAULT_FIELD_TYPES as s, DEFAULT_PAGE_SIZE as ce, buildTemplatePreviewPages as le, cloneTemplateValue as c, collectTemplateValueVariableKeys as ue, constrainTemplatePageSizes as de, createBlankPage as fe, createBlankTemplate as pe, createDefaultPage as me, createTemplateVariable as he, exportTemplateValue as ge, getFieldOption as _e, getPageSizeKey as ve, normalizeContractTemplateMaxPages as ye, normalizePageSizeOptions as be, normalizeTemplateValue as xe, resolvePageSize as Se, syncTemplateVariablesWithPages as Ce, validateContractTemplateVariableKey as we, validateTemplateValue as Te } from "./composables/use-template-designer.mjs";
4
+ import { DEFAULT_ADVANCED_CHOICE_FIELD_TYPES as ie, DEFAULT_BUILTIN_SELECTOR_FIELD_TYPES as ae, DEFAULT_CUSTOM_FIELD_TYPES as oe, DEFAULT_FIELD_STYLE as se, DEFAULT_FIELD_TYPES as s, DEFAULT_PAGE_SIZE as ce, buildTemplatePreviewPages as le, cloneTemplateValue as c, constrainTemplatePageSizes as ue, createBlankPage as de, createBlankTemplate as fe, createDefaultPage as pe, createTemplateBodySync as me, createTemplateVariable as he, exportTemplateValue as ge, getFieldOption as _e, getPageSizeKey as ve, normalizeContractTemplateMaxPages as ye, normalizePageSizeOptions as be, normalizeTemplateValue as xe, resolvePageSize as Se, syncTemplateVariablesWithPages as Ce, validateContractTemplateVariableKey as we, validateTemplateValue as Te } from "./composables/use-template-designer.mjs";
5
5
  import { isSafeContractImageUrl as Ee } from "./utils/image-url.mjs";
6
6
  import { buildTemplateVariableData as De } from "./utils/template-renderer.mjs";
7
7
  import { useFitWidthZoom as Oe } from "./composables/use-fit-width-zoom.mjs";
8
8
  import { normalizeContractImageDimension as ke, processContractImageFile as Ae } from "./utils/content-image.mjs";
9
9
  import { SIGNING_LAYOUT_PRESETS as je, SIGNING_LAYOUT_PRESET_KEYS as Me, isSigningLayoutPresetKey as Ne } from "./utils/signing-layout-presets.mjs";
10
10
  import { inferContextVariableLabel as Pe, resolveContextVariableWidth as Fe } from "./utils/context-variable.mjs";
11
- import Ie from "./DesignerPage.mjs";
12
- import Le from "./TableContextMenu.mjs";
13
- import Re from "./ContractTemplateDesignerWorkspaceHeader.mjs";
14
- import { resolveFieldTypeIcon as ze } from "./utils/template-tool-icons.mjs";
15
- import Be from "./ContractTemplateDesignerToolbar.mjs";
16
- import Ve from "./ContractTemplateAuthoringBar.mjs";
17
- import { useTemplateAuthoring as He } from "./composables/use-template-authoring.mjs";
18
- import Ue from "./ContractTemplateTextContextMenu.mjs";
19
- import We from "./ContractTemplateTextBubbleMenu.mjs";
20
- import Ge from "./ContractTemplateImageContextMenu.mjs";
21
- import Ke from "./ContractTemplatePreviewModal.mjs";
22
- import qe from "./ContractTemplateSubmitDataModal.mjs";
23
- import Je from "./ContractTemplateVariableDataModal.mjs";
24
- import Ye from "./SigningLayoutCustomModal.mjs";
25
- import { DEFAULT_DRAFT_CACHE_INTERVAL as Xe, DEFAULT_DRAFT_CACHE_KEY as Ze, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, createDraftCacheStatus as Qe, formatDraftCacheSavedAt as $e } from "./composables/use-template-draft-cache.mjs";
26
- import { useAutoPagination as et } from "./composables/use-auto-pagination.mjs";
27
- import { resolveSetActiveFileIdOptions as tt } from "./composables/use-designer-files.mjs";
28
- import { cloneContractTemplateFiles as u, constrainContractTemplateFiles as nt, createContractTemplateFile as rt, exportContractTemplateFiles as it, moveContractTemplateFile as at, normalizeContractTemplateFiles as ot, removeContractTemplateFile as st, renameContractTemplateFile as ct, replaceContractTemplateFile as lt, resolveContractTemplateActiveFileId as ut } from "./composables/use-template-files.mjs";
29
- import { useDraftCacheSession as dt } from "./composables/use-draft-cache-session.mjs";
30
- import ft from "./ContractTemplateFileBar.mjs";
31
- import pt from "./ContractTemplateDesignerSidebar.mjs";
32
- import mt from "./ContractTemplateDesignerInspector.mjs";
33
- import ht from "./ContractTemplatePageDecorationsStudio.mjs";
11
+ import { captureCaretViewport as Ie } from "./utils/caret-viewport.mjs";
12
+ import Le from "./DesignerPage.mjs";
13
+ import Re from "./TableContextMenu.mjs";
14
+ import ze from "./ContractTemplateDesignerWorkspaceHeader.mjs";
15
+ import { resolveFieldTypeIcon as Be } from "./utils/template-tool-icons.mjs";
16
+ import Ve from "./ContractTemplateDesignerToolbar.mjs";
17
+ import He from "./ContractTemplateAuthoringBar.mjs";
18
+ import { useTemplateAuthoring as Ue } from "./composables/use-template-authoring.mjs";
19
+ import We from "./ContractTemplateTextContextMenu.mjs";
20
+ import Ge from "./ContractTemplateTextBubbleMenu.mjs";
21
+ import Ke from "./ContractTemplateImageContextMenu.mjs";
22
+ import qe from "./ContractTemplatePreviewModal.mjs";
23
+ import Je from "./ContractTemplateSubmitDataModal.mjs";
24
+ import Ye from "./ContractTemplateVariableDataModal.mjs";
25
+ import Xe from "./SigningLayoutCustomModal.mjs";
26
+ import { DEFAULT_DRAFT_CACHE_INTERVAL as Ze, DEFAULT_DRAFT_CACHE_KEY as Qe, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, createDraftCacheStatus as $e, formatDraftCacheSavedAt as et } from "./composables/use-template-draft-cache.mjs";
27
+ import { useAutoPagination as tt } from "./composables/use-auto-pagination.mjs";
28
+ import { resolveSetActiveFileIdOptions as nt } from "./composables/use-designer-files.mjs";
29
+ import { cloneContractTemplateFiles as u, constrainContractTemplateFiles as rt, createContractTemplateFile as it, exportContractTemplateFiles as at, moveContractTemplateFile as ot, normalizeContractTemplateFiles as st, removeContractTemplateFile as ct, renameContractTemplateFile as lt, replaceContractTemplateFile as ut, resolveContractTemplateActiveFileId as dt } from "./composables/use-template-files.mjs";
30
+ import { useDraftCacheSession as ft } from "./composables/use-draft-cache-session.mjs";
31
+ import pt from "./ContractTemplateFileBar.mjs";
32
+ import mt from "./ContractTemplateDesignerSidebar.mjs";
33
+ import ht from "./ContractTemplateDesignerInspector.mjs";
34
+ import gt from "./ContractTemplatePageDecorationsStudio.mjs";
34
35
  import { serializeFingerprint as d } from "./utils/serialize-fingerprint.mjs";
35
- import { isSameEditorState as gt } from "./utils/editor-state.mjs";
36
- import { clampContextMenuPosition as _t, clampContextMenuToElement as vt } from "./utils/context-menu-viewport.mjs";
37
- import { Fragment as yt, Teleport as bt, computed as f, createBlock as xt, createCommentVNode as p, createElementBlock as St, createElementVNode as m, createVNode as h, defineComponent as g, isRef as Ct, nextTick as _, normalizeClass as wt, normalizeStyle as Tt, onBeforeUnmount as Et, onMounted as Dt, openBlock as v, ref as y, renderList as Ot, toDisplayString as kt, unref as b, useId as At, vShow as jt, watch as x, withCtx as Mt, withDirectives as Nt } from "vue";
38
- import { Alert as Pt, Modal as Ft, Tooltip as It, message as Lt } from "ant-design-vue";
39
- import { useElementSize as Rt } from "@vueuse/core";
40
- import { CompressOutlined as zt, DownOutlined as Bt } from "@ant-design/icons-vue";
36
+ import { isSameEditorState as _t } from "./utils/editor-state.mjs";
37
+ import { clampContextMenuPosition as vt, clampContextMenuToElement as yt } from "./utils/context-menu-viewport.mjs";
38
+ import { Fragment as bt, Teleport as xt, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as St, createElementVNode as h, createVNode as g, defineComponent as _, isRef as Ct, nextTick as v, normalizeClass as wt, normalizeStyle as Tt, onBeforeUnmount as Et, onMounted as Dt, openBlock as y, ref as b, renderList as Ot, toDisplayString as kt, toRaw as At, unref as x, useId as jt, vShow as Mt, watch as S, withCtx as Nt, withDirectives as Pt } from "vue";
39
+ import { Alert as Ft, Modal as It, Tooltip as Lt, message as Rt } from "ant-design-vue";
40
+ import { useElementSize as zt } from "@vueuse/core";
41
+ import { CompressOutlined as Bt, DownOutlined as Vt } from "@ant-design/icons-vue";
41
42
  //#region src/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue?vue&type=script&setup=true&lang.ts
42
- var Vt = {
43
+ var Ht = {
43
44
  key: 2,
44
45
  class: "gd-contract-template-designer__validation"
45
- }, Ht = {
46
+ }, Ut = {
46
47
  key: 0,
47
48
  class: "gd-contract-template-designer__validation-list"
48
- }, Ut = ["onClick"], Wt = {
49
+ }, Wt = ["onClick"], Gt = {
49
50
  class: "gd-contract-template-designer__sr-status",
50
51
  "aria-live": "polite"
51
- }, Gt = .5, Kt = 1.5, qt = .1, Jt = 120, Yt = 128, Xt = 108, Zt = 48, Qt = 24, $t = 10, en = 48, tn = 8, nn = /* @__PURE__ */ g({
52
+ }, Kt = .5, qt = 1.5, Jt = .1, Yt = 300, Xt = 500, Zt = 128, Qt = 108, $t = 48, en = 24, tn = 10, nn = 48, rn = 8, an = /* @__PURE__ */ _({
52
53
  name: "ProContractTemplateDesigner",
53
54
  __name: "ProContractTemplateDesigner",
54
55
  props: {
@@ -103,8 +104,8 @@ var Vt = {
103
104
  type: Boolean,
104
105
  default: !0
105
106
  },
106
- draftCacheKey: { default: Ze },
107
- draftCacheInterval: { default: Xe },
107
+ draftCacheKey: { default: Qe },
108
+ draftCacheInterval: { default: Ze },
108
109
  draftCacheMaxBytes: { default: l },
109
110
  showDraftCacheStatus: {
110
111
  type: Boolean,
@@ -127,55 +128,61 @@ var Vt = {
127
128
  "page-limit",
128
129
  "image-error"
129
130
  ],
130
- setup(s, { expose: Xe, emit: Ze }) {
131
- let l = s, g = Ze, nn = f(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), rn = y(), an = y(), on = y(), sn = y(), cn = y(), ln = `gd-contract-template-page-decorations-studio-${At()}`, un = `gd-contract-template-workspace-chrome-${At()}`, dn = y(), fn = y(), pn = y(), mn = "", hn = "", gn = y(!1), S = f(() => gn.value || Array.isArray(l.files)), _n = ot(l.files, l.modelValue, l.pageSize), vn = nt(_n, l.pageSizeOptions), yn = S.value ? vn.files : _n, bn = ut(yn, l.activeFileId), C = y(yn), w = y(bn), xn = xe((yn.find((e) => e.id === bn) ?? yn[0])?.template ?? l.modelValue, l.pageSize), T = y(de(xn, l.pageSizeOptions));
132
- if (S.value) {
133
- if (C.value = lt(C.value, w.value, T.value), d(C.value) !== d(_n)) {
134
- let e = u(C.value);
135
- mn = d(e), g("update:files", e), g("files-change", u(e));
136
- }
137
- } else l.modelValue && d(T.value) !== d(xn) && (hn = d(T.value), g("update:modelValue", c(T.value)), g("change", c(T.value)));
138
- let E = y(""), D = y(T.value.pages[0]?.id ?? ""), O = y(!1), k = y([]), A = /* @__PURE__ */ new Map(), Sn = y(!1), Cn = y(""), wn = y(!1), Tn = y(), En = y(), Dn = y(""), On = y(!1), kn = y(""), An = y(!1), jn = y({
131
+ setup(s, { expose: Ze, emit: Qe }) {
132
+ let l = s, _ = Qe, an = f(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), on = b(), sn = b();
133
+ function cn() {
134
+ return sn.value;
135
+ }
136
+ function ln() {
137
+ let e = Cn, t = sn.value;
138
+ return Ie(t, () => e === Cn && !Cr && !W.value && t?.isConnected !== !1);
139
+ }
140
+ function un() {
141
+ Cn += 1;
142
+ }
143
+ let dn = b(), fn = b(), pn = b(), mn = `gd-contract-template-page-decorations-studio-${jt()}`, hn = `gd-contract-template-workspace-chrome-${jt()}`, gn = b(), _n = b(), vn = b(), yn = "", bn = "", xn, Sn, Cn = 0, wn = me(), Tn = /* @__PURE__ */ new Map(), En = b(!1), C = f(() => En.value || Array.isArray(l.files)), Dn = st(l.files, l.modelValue, l.pageSize), On = rt(Dn, l.pageSizeOptions), kn = C.value ? On.files : Dn, An = dt(kn, l.activeFileId), w = b(kn), T = b(An), jn = xe((kn.find((e) => e.id === An) ?? kn[0])?.template ?? l.modelValue, l.pageSize), E = b(ue(jn, l.pageSizeOptions));
144
+ C.value ? (w.value = ut(w.value, T.value, E.value), d(w.value) !== d(Dn) && X(w.value)) : l.modelValue && d(E.value) !== d(jn) && Qi(E.value);
145
+ let D = b(""), O = b(E.value.pages[0]?.id ?? ""), k = b(!1), A = b([]), j = /* @__PURE__ */ new Map(), Mn = b(!1), Nn = b(""), Pn = b(!1), Fn = b(), In = b(), Ln = b(""), Rn = b(!1), zn = b(""), Bn = b(!1), Vn = b({
139
146
  values: {},
140
147
  variables: []
141
- }), j = y(1), M = y(!1), Mn = y(!1), Nn = y(!1), N = y(!1), P = y(!1), Pn = y(), F = y(!1), Fn = y("header"), In = y(!1), Ln = y({}), Rn = y(""), I = y(!1), L = y(!1), zn = y(!1), Bn = y(!1), Vn = y(!1), Hn = y(!1), Un = y(!1), Wn = y(""), Gn = y(), Kn = y(), qn = y(""), Jn = y(!1), R = y(), Yn = y(), z = y(), Xn = y(), Zn = y(!1), Qn, $n = y(!1), er, tr = y(!1), nr = y(""), B = y(), rr = y(), V = y(), ir = y(), ar = y(), or = y(), H = y(""), U = y(Qe("idle", "暂无本地草稿")), sr = y({
148
+ }), M = b(1), N = b(!1), Hn = b(!1), Un = b(!1), P = b(!1), Wn = b(!1), Gn = b(), F = b(!1), Kn = b("header"), qn = b(!1), Jn = b({}), Yn = b(""), I = b(!1), L = b(!1), Xn = b(!1), Zn = b(!1), Qn = b(!1), $n = b(!1), er = b(!1), tr = b(""), nr = b(), rr = b(), ir = b(""), ar = b(!1), R = b(), or = b(), z = b(), sr = b(), cr = b(!1), lr, ur = b(!1), dr, fr = b(!1), pr = b(""), B = b(), mr = b(), V = b(), hr = b(), gr = b(), _r = b(), H = b(""), U = b($e("idle", "暂无本地草稿")), vr = b({
142
149
  rows: 3,
143
150
  cols: 3,
144
151
  withHeaderRow: !0
145
- }), cr = /* @__PURE__ */ new WeakSet(), lr = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), ur, dr, fr = !1, pr = !1, mr, W = f(() => l.readonly || l.disabled), { panel: hr, query: gr, replacement: _r, matchCase: vr, matches: yr, currentIndex: br, currentMatch: xr, feedback: Sr, highlightQuery: Cr, open: wr, close: Tr, navigate: Er, replaceCurrent: Dr, replaceAll: Or, handleKeydown: kr } = He({
146
- pages: () => T.value.pages,
147
- fileId: () => w.value,
152
+ }), yr = /* @__PURE__ */ new WeakSet(), br = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), xr, Sr, Cr = !1, wr = !1, Tr, Er, W = f(() => l.readonly || l.disabled), { panel: Dr, query: Or, replacement: kr, matchCase: Ar, matches: jr, currentIndex: Mr, currentMatch: Nr, feedback: Pr, highlightQuery: Fr, open: Ir, close: Lr, navigate: Rr, replaceCurrent: zr, replaceAll: Br, handleKeydown: Vr } = Ue({
153
+ pages: () => E.value.pages,
154
+ fileId: () => T.value,
148
155
  readonly: () => W.value,
149
- root: () => rn.value,
150
- pageRefs: A,
151
- activatePage: bo,
156
+ root: () => on.value,
157
+ pageRefs: j,
158
+ activatePage: Lo,
152
159
  beforeOpen: () => {
153
- $(), cs(), N.value = !1;
160
+ $(), Ts(), P.value = !1;
154
161
  },
155
- focusPanel: () => pn.value?.focusPanel(),
156
- focusTrigger: (e) => pn.value?.focusTrigger(e)
157
- }), Ar = f(() => !!(R.value || hr.value || B.value || V.value || I.value || L.value || In.value || zn.value || Bn.value || Vn.value || Hn.value || Un.value)), jr = f(() => !!l.enableDraftCache && !W.value), Mr = f(() => C.value.find((e) => e.id === w.value) ?? C.value[0]), Nr = f(() => Tn.value ? le(Tn.value) : []), Pr = f(() => (En.value ?? []).map((e) => ({
162
+ focusPanel: () => vn.value?.focusPanel(),
163
+ focusTrigger: (e) => vn.value?.focusTrigger(e)
164
+ }), Hr = f(() => !!(R.value || Dr.value || B.value || V.value || I.value || L.value || qn.value || Xn.value || Zn.value || Qn.value || $n.value || er.value)), Ur = f(() => !!l.enableDraftCache && !W.value), Wr = f(() => w.value.find((e) => e.id === T.value) ?? w.value[0]), Gr = f(() => Fn.value ? le(Fn.value) : []), Kr = f(() => (In.value ?? []).map((e) => ({
158
165
  file: e,
159
166
  pages: le(e.template)
160
- }))), Fr = f(() => Pr.value.find((e) => e.file.id === Dn.value) ?? Pr.value[0]), G = f(() => T.value.pages.find((e) => e.id === D.value) ?? T.value.pages[0]), Ir = f(() => Se(G.value?.pageSize, T.value.pageSize)), Lr = f(() => O.value && k.value.length === 0), Rr = f(() => O.value ? Lr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${k.value.length} 个校验问题` : ""), zr = f(() => {
167
+ }))), qr = f(() => Kr.value.find((e) => e.file.id === Ln.value) ?? Kr.value[0]), G = f(() => E.value.pages.find((e) => e.id === O.value) ?? E.value.pages[0]), Jr = f(() => Se(G.value?.pageSize, E.value.pageSize)), Yr = f(() => k.value && A.value.length === 0), Xr = f(() => k.value ? Yr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${A.value.length} 个校验问题` : ""), Zr = f(() => {
161
168
  let e = G.value?.title || "合同正文";
162
- return `${S.value && Mr.value ? `${Mr.value.name} · ` : ""}${e} · ${Ir.value.label} · 共 ${T.value.pages.length} 页`;
163
- }), Br = f(() => ({
169
+ return `${C.value && Wr.value ? `${Wr.value.name} · ` : ""}${e} · ${Jr.value.label} · 共 ${E.value.pages.length} 页`;
170
+ }), Qr = f(() => ({
164
171
  none: "无装饰",
165
172
  "page-number": "标准页码",
166
173
  "internal-review": "内部审阅",
167
174
  draft: "草稿",
168
175
  custom: "自定义"
169
- })[ee(T.value.pageDecorations)]), Vr = f(() => {
170
- let e = o(T.value.pageDecorations);
176
+ })[ee(E.value.pageDecorations)]), $r = f(() => {
177
+ let e = o(E.value.pageDecorations);
171
178
  return {
172
179
  header: e.header.enabled,
173
180
  footer: e.footer.enabled,
174
181
  watermark: e.watermark.enabled
175
182
  };
176
- }), Hr = f(() => Object.values(Vr.value).filter(Boolean).length), Ur = f(() => {
183
+ }), ei = f(() => Object.values($r.value).filter(Boolean).length), ti = f(() => {
177
184
  switch (U.value.type) {
178
- case "saved": return `草稿已缓存 ${$e(U.value.savedAt)}`;
185
+ case "saved": return `草稿已缓存 ${et(U.value.savedAt)}`;
179
186
  case "restored": return "已恢复本地草稿";
180
187
  case "too-large": return "草稿过大,未缓存";
181
188
  case "unavailable":
@@ -184,23 +191,23 @@ var Vt = {
184
191
  case "cleared": return "草稿缓存已清理";
185
192
  default: return "";
186
193
  }
187
- }), Wr = f(() => ({
194
+ }), ni = f(() => ({
188
195
  "is-success": U.value.type === "saved" || U.value.type === "restored",
189
196
  "is-warning": U.value.type === "too-large",
190
197
  "is-error": U.value.type === "unavailable" || U.value.type === "read-failed" || U.value.type === "write-failed"
191
- })), Gr = f(() => `${Math.round(j.value * 100)}%`), Kr = f(() => i(l.fontFamilies, l.fontFamilyMode)), qr = f(() => Kr.value.map((e) => ({
198
+ })), ri = f(() => `${Math.round(M.value * 100)}%`), ii = f(() => i(l.fontFamilies, l.fontFamilyMode)), ai = f(() => ii.value.map((e) => ({
192
199
  label: e.label,
193
200
  value: e.value
194
- }))), Jr = r, Yr = [...e.map((e) => ({
201
+ }))), oi = r, si = [...e.map((e) => ({
195
202
  label: e.label,
196
203
  value: e.format
197
- }))], Xr = [{
204
+ }))], ci = [{
198
205
  label: "实线",
199
206
  value: "solid"
200
207
  }, {
201
208
  label: "虚线",
202
209
  value: "dashed"
203
- }], Zr = [
210
+ }], li = [
204
211
  {
205
212
  label: "完整显示",
206
213
  value: "contain"
@@ -213,10 +220,10 @@ var Vt = {
213
220
  label: "拉伸填充",
214
221
  value: "fill"
215
222
  }
216
- ], Qr = f(() => be(l.pageSizeOptions)), $r = f(() => Qr.value.map((e) => ({
223
+ ], ui = f(() => be(l.pageSizeOptions)), di = f(() => ui.value.map((e) => ({
217
224
  label: `${e.label} · ${e.width} × ${e.height}`,
218
225
  value: ve(e)
219
- }))), ei = f(() => ve(Ir.value)), ti = f(() => l.draftCacheKey), K = f(() => T.value.variables.find((e) => e.key === E.value)), ni = f(() => {
226
+ }))), fi = f(() => ve(Jr.value)), pi = f(() => l.draftCacheKey), K = f(() => E.value.variables.find((e) => e.key === D.value)), mi = f(() => {
220
227
  let e = [
221
228
  ...l.variableTypes,
222
229
  ...l.showAdvancedChoiceControls ? ie : [],
@@ -224,56 +231,61 @@ var Vt = {
224
231
  ...l.showCustomControls ? oe : []
225
232
  ].filter((e) => re(e?.type));
226
233
  return Array.from(new Map(e.map((e) => [e.type, e])).values());
227
- }), ri = f(() => {
234
+ }), hi = f(() => {
228
235
  let e = [...Me.map((e) => je[e]), ...(l.signingLayoutPresets ?? []).filter((e) => !!e?.key)];
229
236
  return Array.from(new Map(e.map((e) => [e.key, e])).values());
230
- }), ii = f(() => ni.value.map((e) => ({
237
+ }), gi = f(() => mi.value.map((e) => ({
231
238
  ...e,
232
- icon: ze(e.type),
239
+ icon: Be(e.type),
233
240
  group: e.type === "select" || e.type === "radio" ? "advanced-choice" : e.type.endsWith("-selector") ? "builtin-selector" : e.type === "custom" ? "custom" : "basic"
234
- }))), ai = f(() => ye(l.maxPages)), oi = f(() => T.value.pages.length >= ai.value), si = f(() => {
235
- let e = ue(T.value);
236
- return Array.from(a(T.value.pageDecorations)).filter((t) => !e.has(t));
237
- }), { scheduleAutoPaginate: q } = et({
238
- templateValue: T,
241
+ }))), _i = f(() => ye(l.maxPages)), vi = f(() => E.value.pages.length >= _i.value), yi = f(() => {
242
+ let e = wn.collectKeys(E.value);
243
+ return Array.from(a(E.value.pageDecorations)).filter((t) => !e.has(t));
244
+ }), { scheduleAutoPaginate: bi, scheduleFullPagination: q, resetPagination: xi, disposePagination: Si } = tt({
245
+ templateValue: E,
239
246
  readonlyState: W,
240
- isAutoPaginating: Sn,
241
- pendingPaginationPageId: Cn,
242
- activePageId: D,
243
- normalizedMaxPages: ai,
244
- pageRefs: A,
245
- syncPageEditors: Ai,
246
- commitBodyChange: Ki,
247
- getPageSize: Ji,
248
- notifyPageLimit: Xi
249
- }), { saveDraftCache: ci, loadDraftCache: li, clearDraftCache: ui, restoreDraftCacheIfNeeded: di, stopDraftCacheTimer: fi, restartDraftCacheTimer: pi, resetDraftFingerprint: mi } = dt({
250
- draftCacheWritable: jr,
251
- multipleFilesMode: S,
252
- filesValue: C,
253
- activeFileIdValue: w,
254
- templateValue: T,
255
- draftCacheKey: ti,
247
+ isAutoPaginating: Mn,
248
+ pendingPaginationPageId: Nn,
249
+ activePageId: O,
250
+ normalizedMaxPages: _i,
251
+ pageRefs: j,
252
+ applyPagesChange: (e) => {
253
+ E.value = {
254
+ ...E.value,
255
+ pages: e
256
+ }, k.value = !1, A.value = [], Yi();
257
+ },
258
+ getPageSize: da,
259
+ notifyPageLimit: pa,
260
+ captureViewport: ln
261
+ }), { saveDraftCache: Ci, loadDraftCache: wi, clearDraftCache: Ti, restoreDraftCacheIfNeeded: Ei, stopDraftCacheTimer: Di, restartDraftCacheTimer: Oi, resetDraftFingerprint: ki } = ft({
262
+ draftCacheWritable: Ur,
263
+ multipleFilesMode: C,
264
+ filesValue: w,
265
+ activeFileIdValue: T,
266
+ templateValue: E,
267
+ draftCacheKey: pi,
256
268
  draftCacheInterval: () => l.draftCacheInterval,
257
269
  draftCacheMaxBytes: () => l.draftCacheMaxBytes,
258
270
  pageSize: () => l.pageSize,
259
271
  pageSizeOptions: () => l.pageSizeOptions,
260
272
  syncActiveFileSnapshot: Y,
261
- syncPageEditors: Ai,
262
- setActiveFileId: Ii,
273
+ syncPageEditors: () => (Ji(), Gi()),
274
+ setActiveFileId: $i,
263
275
  emitFilesChange: X,
264
276
  commit: Z,
265
- updateDraftCacheStatus: Li,
266
- scheduleAutoPaginate: q,
267
- activePageId: D,
268
- selectedVariableKey: E
269
- }), hi = f(() => {
270
- let e = nr.value.trim().toLowerCase(), t = T.value.variables;
277
+ updateDraftCacheStatus: ea,
278
+ scheduleFullPagination: q,
279
+ activePageId: O,
280
+ selectedVariableKey: D
281
+ }), Ai = f(() => {
282
+ let e = pr.value.trim().toLowerCase(), t = E.value.variables;
271
283
  return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
272
- }), gi = f(() => Math.max(Zt, Ir.value.width - Yt)), _i = f(() => Math.max(Qt, Ir.value.height - Xt)), J = f(() => Ln.value[D.value] ?? Ti()), vi = f(() => J.value.hasMixedBlockFormats ? void 0 : J.value.currentHeadingLevel ?? "paragraph"), yi = f(() => J.value.fontFamily || t), bi = f(() => J.value.fontSize ?? se.fontSize ?? 14), xi = f(() => J.value.textColor || se.color || "#1f2937"), Si = f(() => K.value?.style?.fontFamily || se.fontFamily || t), Ci = f(() => {
284
+ }), ji = f(() => Math.max($t, Jr.value.width - Zt)), Mi = f(() => Math.max(en, Jr.value.height - Qt)), J = f(() => Jn.value[O.value] ?? Bi()), Ni = f(() => J.value.hasMixedBlockFormats ? void 0 : J.value.currentHeadingLevel ?? "paragraph"), Pi = f(() => J.value.fontFamily || t), Fi = f(() => J.value.fontSize ?? se.fontSize ?? 14), Ii = f(() => J.value.textColor || se.color || "#1f2937"), Li = f(() => K.value?.style?.fontFamily || se.fontFamily || t), Ri = f(() => {
273
285
  let e = n.map((e) => ({
274
286
  label: `${e}px`,
275
287
  value: e
276
- })), t = ki(bi.value), r = ki(Rn.value), i = /* @__PURE__ */ new Map();
288
+ })), t = Wi(Fi.value), r = Wi(Yn.value), i = /* @__PURE__ */ new Map();
277
289
  return r && !n.includes(r) && i.set(r, {
278
290
  label: `使用 ${r}px`,
279
291
  value: r
@@ -282,78 +294,91 @@ var Vt = {
282
294
  value: t
283
295
  }), [...Array.from(i.values()), ...e];
284
296
  });
285
- x(() => l.modelValue, (e) => {
286
- if (!e || S.value) return;
287
- let t = xe(e, l.pageSize), n = de(t, l.pageSizeOptions), r = d(n) !== d(T.value), i = d(n), a = i === hn;
288
- a && (hn = ""), (r || !a) && (T.value = n, C.value = lt(C.value, w.value, n), D.value = n.pages[0]?.id ?? "", E.value = "", q(D.value)), d(n) !== d(t) && (hn = i, g("update:modelValue", c(n)), g("change", c(n)));
289
- }, { deep: !0 }), x(() => l.files, (e) => {
297
+ S(() => l.modelValue, (e, t) => {
298
+ if (!e || C.value) return;
299
+ if (e !== t && Sn && At(e) === At(Sn)) {
300
+ bn = "";
301
+ return;
302
+ }
303
+ if (d(e) === bn) {
304
+ bn = "";
305
+ return;
306
+ }
307
+ let n = xe(e, l.pageSize), r = ue(n, l.pageSizeOptions), i = d(r) !== d(E.value), a = d(r) === bn;
308
+ a && (bn = ""), (i || !a) && (bn = "", un(), xi(), wn.clear(), qi(), E.value = r, w.value = ut(w.value, T.value, r), O.value = r.pages[0]?.id ?? "", D.value = "", q()), d(r) !== d(n) && Qi(r);
309
+ }, { deep: !0 }), S(() => l.files, (e, t) => {
290
310
  if (!Array.isArray(e)) return;
291
- let t = ot(e, void 0, l.pageSize), n = nt(t, l.pageSizeOptions).files, r = d(n), i = d(C.value);
292
- r === mn && (mn = "");
293
- let a = ut(n, l.activeFileId || w.value);
294
- if (r === i ? a !== w.value && Ii(a, {
311
+ if (e !== t && xn && At(e) === At(xn)) {
312
+ yn = "";
313
+ return;
314
+ }
315
+ if (d(e) === yn) {
316
+ yn = "";
317
+ return;
318
+ }
319
+ let n = st(e, void 0, l.pageSize), r = rt(n, l.pageSizeOptions).files, i = d(r), a = d(w.value);
320
+ i === yn && (yn = "");
321
+ let o = dt(r, l.activeFileId || T.value);
322
+ i === a ? o !== T.value && $i(o, {
295
323
  syncCurrent: !1,
296
324
  shouldEmit: !1
297
- }) : (C.value = n, Ii(a, {
325
+ }) : (yn = "", w.value = r, $i(o, {
298
326
  syncCurrent: !1,
299
327
  shouldEmit: !1,
300
328
  forceRefresh: !0
301
- })), r !== d(t)) {
302
- let e = u(n);
303
- mn = d(e), g("update:files", e), g("files-change", u(e));
304
- }
305
- }, { deep: !0 }), x(() => l.activeFileId, (e) => {
306
- !S.value || !e || e === w.value || Ii(e, {
329
+ })), i !== d(n) && X(r);
330
+ }, { deep: !0 }), S(() => l.activeFileId, (e) => {
331
+ !C.value || !e || e === T.value || $i(e, {
307
332
  syncCurrent: !0,
308
333
  shouldEmit: !1
309
334
  });
310
335
  });
311
- function wi(e, t) {
312
- let n = d(C.value);
336
+ function zi(e, t) {
337
+ let n = d(w.value);
313
338
  Y(!1);
314
- let { files: r } = nt(ot(C.value, void 0, e), t), i = d(r) !== n, a = r.find((e) => e.id === w.value);
315
- return a && d(a.template) !== d(T.value) && (T.value = c(a.template)), i && (O.value = !1, k.value = [], X(r, "")), i;
339
+ let { files: r } = rt(st(w.value, void 0, e), t), i = d(r) !== n, a = r.find((e) => e.id === T.value);
340
+ return a && d(a.template) !== d(E.value) && (E.value = c(a.template)), i && (k.value = !1, A.value = [], X(r, "")), i;
316
341
  }
317
- x([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
318
- if (S.value) {
319
- wi(e, t), q(D.value);
342
+ S([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
343
+ if (C.value) {
344
+ zi(e, t), q();
320
345
  return;
321
346
  }
322
- let n = de(xe(T.value, e), t);
323
- d(n) !== d(T.value) && Z(n), q(D.value);
324
- }, { deep: !0 }), x(ai, () => {
325
- q(T.value.pages[0]?.id);
326
- }), x(W, (e) => {
327
- e && ($(), I.value = !1, L.value = !1);
328
- }), x(D, () => {
347
+ let n = ue(xe(E.value, e), t);
348
+ d(n) !== d(E.value) && Z(n), q();
349
+ }, { deep: !0 }), S(_i, () => {
350
+ q();
351
+ }), S(W, (e) => {
352
+ e ? ($(), I.value = !1, L.value = !1) : q();
353
+ }), S(O, () => {
329
354
  z.value = void 0;
330
- }), x([
331
- Ar,
355
+ }), S([
356
+ Hr,
332
357
  F,
333
- wn
358
+ Pn
334
359
  ], () => {
335
- ds();
336
- }), x(() => [
360
+ Os();
361
+ }), S(() => [
337
362
  l.enableDraftCache,
338
- ti.value,
363
+ pi.value,
339
364
  l.draftCacheInterval,
340
365
  W.value
341
366
  ], () => {
342
- mi(), pi();
343
- }), x(M, (e) => {
367
+ ki(), Oi();
368
+ }), S(N, (e) => {
344
369
  if (!(typeof document > "u")) {
345
370
  if (e) {
346
- ur = document.body.style.overflow, document.body.style.overflow = "hidden";
371
+ xr = document.body.style.overflow, document.body.style.overflow = "hidden";
347
372
  return;
348
373
  }
349
- document.body.style.overflow = ur ?? "", ur = void 0;
374
+ document.body.style.overflow = xr ?? "", xr = void 0;
350
375
  }
351
376
  }), Dt(() => {
352
- di(), pi(), q(D.value), window.addEventListener("pointerdown", ys, !0), window.addEventListener("pointerup", gs), window.addEventListener("keydown", Ss, !0), window.addEventListener("keydown", Cs), window.addEventListener("resize", _s), window.addEventListener("scroll", bs, !0);
377
+ Ei(), Oi(), q(), document.fonts?.ready.then(q), document.fonts?.addEventListener("loadingdone", q), window.addEventListener("pointerdown", Is, !0), window.addEventListener("pointerup", Ns), window.addEventListener("keydown", zs, !0), window.addEventListener("keydown", Bs), window.addEventListener("resize", Ps), window.addEventListener("scroll", Ls, !0);
353
378
  }), Et(() => {
354
- Mi(), fr = !0, M.value && typeof document < "u" && (document.body.style.overflow = ur ?? ""), window.removeEventListener("pointerdown", ys, !0), window.removeEventListener("pointerup", gs), window.removeEventListener("keydown", Ss, !0), window.removeEventListener("keydown", Cs), window.removeEventListener("resize", _s), window.removeEventListener("scroll", bs, !0), er !== void 0 && cancelAnimationFrame(er), fi();
379
+ un(), Si(), Ji(), Cr = !0, N.value && typeof document < "u" && (document.body.style.overflow = xr ?? ""), document.fonts?.removeEventListener("loadingdone", q), window.removeEventListener("pointerdown", Is, !0), window.removeEventListener("pointerup", Ns), window.removeEventListener("keydown", zs, !0), window.removeEventListener("keydown", Bs), window.removeEventListener("resize", Ps), window.removeEventListener("scroll", Ls, !0), dr !== void 0 && cancelAnimationFrame(dr), Di();
355
380
  });
356
- function Ti() {
381
+ function Bi() {
357
382
  return {
358
383
  isFocused: !1,
359
384
  canUndo: !1,
@@ -372,235 +397,251 @@ var Vt = {
372
397
  hasMixedBlockFormats: !1
373
398
  };
374
399
  }
375
- function Ei(e) {
400
+ function Vi(e) {
376
401
  return e === "left" || e === "center" || e === "right";
377
402
  }
378
- function Di(e) {
403
+ function Hi(e) {
379
404
  return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
380
405
  }
381
- function Oi(e, t = bi.value) {
406
+ function Ui(e, t = Fi.value) {
382
407
  let n = Number(e);
383
- return Number.isFinite(n) ? Math.min(en, Math.max($t, Math.round(n))) : t;
408
+ return Number.isFinite(n) ? Math.min(nn, Math.max(tn, Math.round(n))) : t;
384
409
  }
385
- function ki(e) {
410
+ function Wi(e) {
386
411
  let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
387
412
  if (!t) return;
388
413
  let n = Number(t[1]);
389
- if (Number.isFinite(n)) return Math.min(en, Math.max($t, Math.round(n)));
414
+ if (Number.isFinite(n)) return Math.min(nn, Math.max(tn, Math.round(n)));
390
415
  }
391
- function Ai(e = T.value) {
392
- return {
416
+ function Gi(e = E.value) {
417
+ let t = !1, n = e.pages.map((e) => {
418
+ let n = j.get(e.id)?.getContentSnapshot(e), r = n?.contentHtml ?? e.contentHtml, i = n?.contentJson ?? e.contentJson;
419
+ return r === e.contentHtml && At(i) === At(e.contentJson) ? e : (t = !0, {
420
+ ...e,
421
+ contentHtml: r,
422
+ contentJson: i
423
+ });
424
+ });
425
+ return t ? {
393
426
  ...e,
394
- pages: e.pages.map((e) => {
395
- let t = A.get(e.id);
396
- return {
397
- ...e,
398
- contentHtml: t?.getHTML() ?? e.contentHtml,
399
- contentJson: t?.getJSON() ?? e.contentJson
400
- };
401
- })
402
- };
427
+ pages: n
428
+ } : e;
403
429
  }
404
- function ji() {
405
- pr = !1, mr &&= (clearTimeout(mr), void 0);
430
+ function Ki() {
431
+ Tr !== void 0 && (clearTimeout(Tr), Tr = void 0), Er !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(Er), Er = void 0;
406
432
  }
407
- function Mi() {
408
- let e = pr;
409
- ji(), e && Fi();
433
+ function qi() {
434
+ wr = !1, Ki();
410
435
  }
411
- function Ni() {
412
- pr = !0, mr && clearTimeout(mr), mr = setTimeout(() => {
413
- mr = void 0, !(!pr || fr) && (pr = !1, Fi());
414
- }, Jt);
436
+ function Ji() {
437
+ let e = wr;
438
+ qi(), e && Zi();
439
+ }
440
+ function Yi() {
441
+ wr = !0, Ki(), Tr = setTimeout(() => {
442
+ Tr = void 0;
443
+ let e = () => {
444
+ if (Er = void 0, !(!wr || Cr)) {
445
+ if (Mn.value) return Yi();
446
+ wr = !1, Zi();
447
+ }
448
+ };
449
+ typeof requestIdleCallback == "function" ? Er = requestIdleCallback(e, { timeout: Xt }) : e();
450
+ }, Yt);
415
451
  }
416
- function Pi(e) {
417
- let t = T.value.pages, n = t.findIndex((t) => t.id === e.id);
452
+ function Xi(e) {
453
+ let t = E.value.pages, n = t.findIndex((t) => t.id === e.id);
418
454
  if (n < 0) return;
419
455
  let r = t[n];
420
456
  if (r.contentHtml === e.contentHtml && r.contentJson === e.contentJson && r.title === e.title && r.pageSize === e.pageSize) return;
421
457
  let i = t.slice();
422
- i[n] = e, T.value = {
423
- ...T.value,
458
+ i[n] = e, E.value = {
459
+ ...E.value,
424
460
  pages: i
425
461
  };
426
462
  }
427
- function Fi() {
428
- let e = Ce(Ai());
429
- E.value && !e.variables.some((e) => e.key === E.value) && (E.value = ""), Z(e);
463
+ function Zi() {
464
+ let e = Gi(), t = wn.sync(e);
465
+ D.value && !t.variables.some((e) => e.key === D.value) && (D.value = ""), Z(t, { normalizedBody: !0 });
430
466
  }
431
467
  function Y(e = !1) {
432
- Mi();
433
- let t = c(Ai());
434
- if (!S.value) return t;
435
- let n = C.value.find((e) => e.id === w.value)?.template, r = d(n) !== d(t), i = lt(C.value, w.value, t);
436
- return C.value = i, r && e && X(i), t;
437
- }
438
- function X(e, t = w.value) {
439
- if (!S.value) return;
440
- let n = u(e);
441
- C.value = n, mn = d(n), g("update:files", u(n)), g("files-change", u(n));
442
- let r = n.find((e) => e.id === t);
443
- r && g("file-change", u([r])[0]);
444
- }
445
- function Ii(e, t = {}) {
446
- let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = tt(t), a = ut(C.value, e), o = a !== w.value;
447
- if (n ? Y(!0) : ji(), !o && !i) return;
448
- let ee = C.value.find((e) => e.id === a);
449
- ee && (w.value = a, T.value = c(ee.template), E.value = "", D.value = T.value.pages[0]?.id ?? "", Ln.value = {}, A.clear(), Cn.value = "", O.value = !1, k.value = [], wn.value = !1, Tn.value = void 0, En.value = void 0, mi(), r && o && g("update:activeFileId", a), n && o && jr.value && ci(), _(() => {
450
- q(D.value);
468
+ Ji();
469
+ let t = c(Gi());
470
+ if (!C.value) return t;
471
+ let n = w.value.find((e) => e.id === T.value)?.template, r = d(n) !== d(t), i = ut(w.value, T.value, t);
472
+ return w.value = i, r && e && X(i), t;
473
+ }
474
+ function Qi(e) {
475
+ let t = c(e);
476
+ Sn = t, bn = d(e), _("update:modelValue", t), _("change", c(e));
477
+ }
478
+ function X(e, t = T.value) {
479
+ if (!C.value) return;
480
+ let n = u(e), r = u(n);
481
+ w.value = n, xn = r, yn = d(r), _("update:files", r), _("files-change", u(r));
482
+ let i = r.find((e) => e.id === t);
483
+ i && _("file-change", u([i])[0]);
484
+ }
485
+ function $i(e, t = {}) {
486
+ let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = nt(t), a = dt(w.value, e), o = a !== T.value;
487
+ if ((o || i) && w.value.some((e) => e.id === a) && (un(), xi()), n ? Y(!0) : qi(), !o && !i) return;
488
+ let ee = w.value.find((e) => e.id === a);
489
+ ee && (T.value = a, E.value = c(ee.template), D.value = "", O.value = E.value.pages[0]?.id ?? "", Jn.value = {}, j.clear(), wn.clear(), Tn.clear(), k.value = !1, A.value = [], Pn.value = !1, Fn.value = void 0, In.value = void 0, ki(), r && o && _("update:activeFileId", a), n && o && Ur.value && Ci(), v(() => {
490
+ q();
451
491
  }));
452
492
  }
453
- function Z(e) {
454
- ji();
455
- let t = de(xe(e, l.pageSize), l.pageSizeOptions);
456
- return T.value = t, O.value = !1, k.value = [], S.value ? X(lt(C.value, w.value, t)) : (C.value = lt(C.value, w.value, t), hn = d(t), g("update:modelValue", c(t)), g("change", c(t))), t;
493
+ function Z(e, t = {}) {
494
+ qi();
495
+ let n = t.normalizedBody ? e : ue(xe(e, l.pageSize), l.pageSizeOptions);
496
+ return t.normalizedBody || (wn.clear(), Tn.clear()), E.value = n, k.value = !1, A.value = [], C.value ? X(ut(w.value, T.value, n)) : (w.value = ut(w.value, T.value, n), Qi(n)), n;
457
497
  }
458
- function Li(e, t = e.type !== "unchanged") {
459
- U.value = e, t && g("draft-cache-change", { ...e });
498
+ function ea(e, t = e.type !== "unchanged") {
499
+ U.value = e, t && _("draft-cache-change", { ...e });
460
500
  }
461
- function Ri() {
501
+ function ta() {
462
502
  return { ...U.value };
463
503
  }
464
- function zi(e, t) {
465
- t ? A.set(e, t) : A.delete(e);
504
+ function na(e, t) {
505
+ t ? j.set(e, t) : j.delete(e);
466
506
  }
467
- function Bi(e) {
468
- $(), Vn.value = !1, Q({
507
+ function ra(e) {
508
+ $(), Qn.value = !1, Q({
469
509
  type: "insert-signing-layout",
470
510
  preset: Ne(e.key) ? e.key : void 0,
471
511
  options: e.options
472
512
  });
473
513
  }
474
- function Vi(e) {
514
+ function ia(e) {
475
515
  $(), Q({
476
516
  type: "insert-signing-layout",
477
517
  options: e
478
518
  });
479
519
  }
480
- function Hi() {
481
- Vn.value = !1, Un.value = !0;
520
+ function aa() {
521
+ Qn.value = !1, er.value = !0;
482
522
  }
483
- function Ui(e) {
484
- $(), Hn.value = !1, Q({
523
+ function oa(e) {
524
+ $(), $n.value = !1, Q({
485
525
  type: "insert-signing-mark",
486
526
  mark: { markType: e }
487
527
  });
488
528
  }
489
- function Q(e, t = G.value?.id ?? D.value) {
490
- W.value || A.get(t)?.runCommand(e);
529
+ function Q(e, t = G.value?.id ?? O.value) {
530
+ W.value || j.get(t)?.runCommand(e);
491
531
  }
492
- function Wi(e) {
532
+ function sa(e) {
493
533
  Q(e), $();
494
534
  }
495
- function Gi(e) {
535
+ function ca(e) {
496
536
  let t = R.value?.pageId;
497
- t && (A.get(t)?.focus(), H.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
537
+ t && (j.get(t)?.focus(), H.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
498
538
  }
499
- function Ki(e) {
539
+ function la(e) {
500
540
  let t = Z(Ce(e));
501
- return E.value && !t.variables.some((e) => e.key === E.value) && (E.value = ""), t;
541
+ return D.value && !t.variables.some((e) => e.key === D.value) && (D.value = ""), t;
502
542
  }
503
- function qi(e) {
504
- Pi(e), Ni(), q(e.id);
543
+ function ua(e) {
544
+ Xi(e), Yi(), bi(e.id);
505
545
  }
506
- function Ji(e) {
507
- return Se(e?.pageSize, T.value.pageSize);
546
+ function da(e) {
547
+ let t = Se(e?.pageSize, E.value.pageSize), n = `${ve(t)}:${t.label ?? ""}`;
548
+ return Tn.get(n) || (Tn.set(n, t), t);
508
549
  }
509
- function Yi(e) {
550
+ function fa(e) {
510
551
  if (W.value || !G.value) return;
511
- let t = Qr.value.find((t) => ve(t) === e);
552
+ let t = ui.value.find((t) => ve(t) === e);
512
553
  if (!t) return;
513
- let n = G.value.id, r = Se(t, T.value.pageSize);
554
+ let n = G.value.id, r = Se(t, E.value.pageSize);
514
555
  Z({
515
- ...T.value,
516
- pages: T.value.pages.map((e) => e.id === n ? {
556
+ ...E.value,
557
+ pages: E.value.pages.map((e) => e.id === n ? {
517
558
  ...e,
518
559
  pageSize: r
519
560
  } : e)
520
- }), q(n);
561
+ }), bi(n);
521
562
  }
522
- function Xi(e) {
523
- let t = ai.value;
524
- H.value = `合同最多支持 ${t} 页`, g("page-limit", t, e);
563
+ function pa(e) {
564
+ let t = _i.value;
565
+ H.value = `合同最多支持 ${t} 页`, _("page-limit", t, e);
525
566
  }
526
- function Zi() {
567
+ function ma() {
527
568
  if (W.value) return;
528
- if (oi.value) {
529
- Xi("add");
569
+ if (vi.value) {
570
+ pa("add");
530
571
  return;
531
572
  }
532
- let e = me(T.value.pages.length + 1, Ir.value);
573
+ let e = pe(E.value.pages.length + 1, Jr.value);
533
574
  Z({
534
- ...T.value,
535
- pages: [...T.value.pages, e]
536
- }), D.value = e.id;
575
+ ...E.value,
576
+ pages: [...E.value.pages, e]
577
+ }), O.value = e.id, q();
537
578
  }
538
- function Qi(e) {
579
+ function ha(e) {
539
580
  if (W.value) return;
540
- if (oi.value) {
541
- Xi("duplicate");
581
+ if (vi.value) {
582
+ pa("duplicate");
542
583
  return;
543
584
  }
544
- let t = T.value.pages.findIndex((t) => t.id === e.id);
585
+ let t = E.value.pages.findIndex((t) => t.id === e.id);
545
586
  if (t < 0) return;
546
587
  let n = c({
547
588
  pages: [e],
548
589
  variables: [],
549
- pageSize: T.value.pageSize
550
- }).pages[0], r = fe(t + 2, Ji(e), n.contentHtml, n.contentJson);
590
+ pageSize: E.value.pageSize
591
+ }).pages[0], r = de(t + 2, da(e), n.contentHtml, n.contentJson);
551
592
  r.title = `${e.title || `第 ${t + 1} 页`}副本`;
552
- let i = [...T.value.pages];
593
+ let i = [...E.value.pages];
553
594
  i.splice(t + 1, 0, r), Z({
554
- ...T.value,
595
+ ...E.value,
555
596
  pages: i
556
- }), D.value = r.id;
597
+ }), O.value = r.id, q();
557
598
  }
558
- function $i(e) {
559
- if (W.value || T.value.pages.length <= 1) return;
560
- let t = T.value.pages.findIndex((t) => t.id === e.id);
599
+ function ga(e) {
600
+ if (W.value || E.value.pages.length <= 1) return;
601
+ let t = E.value.pages.findIndex((t) => t.id === e.id);
561
602
  if (t < 0) return;
562
- let n = T.value.pages.filter((t) => t.id !== e.id), r = Ki({
563
- ...T.value,
603
+ let n = E.value.pages.filter((t) => t.id !== e.id), r = la({
604
+ ...E.value,
564
605
  pages: n
565
606
  });
566
- D.value = r.pages[Math.min(t, r.pages.length - 1)]?.id ?? "";
607
+ O.value = r.pages[Math.min(t, r.pages.length - 1)]?.id ?? "", q();
567
608
  }
568
- function ea(e) {
569
- W.value || T.value.pages.length <= 1 || Ft.confirm({
609
+ function _a(e) {
610
+ W.value || E.value.pages.length <= 1 || It.confirm({
570
611
  title: "删除合同页面",
571
612
  content: "删除页面会同时移除页面正文,是否继续?",
572
613
  okText: "确认删除",
573
614
  okType: "danger",
574
615
  cancelText: "取消",
575
616
  onOk: () => {
576
- $i(e);
617
+ ga(e);
577
618
  }
578
619
  });
579
620
  }
580
- function ta(e) {
581
- let t = new Set(T.value.variables.map((e) => e.key)), n = 1;
621
+ function va(e) {
622
+ let t = new Set(E.value.variables.map((e) => e.key)), n = 1;
582
623
  for (; t.has(`${e}_${n}`);) n += 1;
583
624
  return `${e}_${n}`;
584
625
  }
585
- function na(e) {
626
+ function ya(e) {
586
627
  let t = e.type ?? "text";
587
628
  return he({
588
629
  ...e,
589
630
  type: t,
590
- key: e.key || ta(t),
591
- label: e.label || _e(t, ni.value).label
592
- }, ni.value, l.defaultVariableStyle);
631
+ key: e.key || va(t),
632
+ label: e.label || _e(t, mi.value).label
633
+ }, mi.value, l.defaultVariableStyle);
593
634
  }
594
- function ra(e, t = G.value?.id ?? T.value.pages[0].id, n) {
635
+ function ba(e, t = G.value?.id ?? E.value.pages[0].id, n) {
595
636
  if (W.value) return e;
596
- let r = A.get(t)?.insertVariable(e, n), i = !T.value.variables.some((t) => t.key === e.key);
637
+ let r = j.get(t)?.insertVariable(e, n), i = !E.value.variables.some((t) => t.key === e.key);
597
638
  return Z({
598
- ...T.value,
599
- pages: r ? T.value.pages.map((e) => e.id === r.id ? r : e) : T.value.pages,
600
- variables: i ? [...T.value.variables, e] : T.value.variables
601
- }), E.value = e.key, D.value = t, i && g("variable-add", e), q(t), e;
639
+ ...E.value,
640
+ pages: r ? E.value.pages.map((e) => e.id === r.id ? r : e) : E.value.pages,
641
+ variables: i ? [...E.value.variables, e] : E.value.variables
642
+ }), D.value = e.key, O.value = t, i && _("variable-add", e), bi(t), e;
602
643
  }
603
- function ia(e) {
644
+ function xa(e) {
604
645
  let { width: t, height: n, ...r } = e, i = ke(t), a = ke(n);
605
646
  return {
606
647
  ...r,
@@ -608,101 +649,101 @@ var Vt = {
608
649
  ...a === void 0 ? {} : { height: a }
609
650
  };
610
651
  }
611
- function aa(e = {}) {
612
- let t = ke(Gn.value), n = ke(Kn.value);
652
+ function Sa(e = {}) {
653
+ let t = ke(nr.value), n = ke(rr.value);
613
654
  return {
614
655
  ...e,
615
656
  ...t === void 0 ? {} : { width: t },
616
657
  ...n === void 0 ? {} : { height: n }
617
658
  };
618
659
  }
619
- function oa() {
620
- Wn.value = "", Gn.value = void 0, Kn.value = void 0, qn.value = "";
660
+ function Ca() {
661
+ tr.value = "", nr.value = void 0, rr.value = void 0, ir.value = "";
621
662
  }
622
- function sa(e, t = G.value?.id ?? T.value.pages[0]?.id, n) {
623
- let r = ia({
663
+ function wa(e, t = G.value?.id ?? E.value.pages[0]?.id, n) {
664
+ let r = xa({
624
665
  ...e,
625
666
  src: e.src.trim()
626
667
  });
627
- if (!(W.value || !t || !Ee(r.src) || !r.src || !A.get(t)?.insertContentImage(r, n))) return D.value = t, E.value = "", r.src;
668
+ if (!(W.value || !t || !Ee(r.src) || !r.src || !j.get(t)?.insertContentImage(r, n))) return O.value = t, D.value = "", r.src;
628
669
  }
629
- function ca(e) {
670
+ function Ta(e) {
630
671
  return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
631
672
  }
632
- async function la(e, t) {
633
- t === "toolbar" && (Jn.value = !0, qn.value = "");
673
+ async function Ea(e, t) {
674
+ t === "toolbar" && (ar.value = !0, ir.value = "");
634
675
  try {
635
676
  let n = await Ae(e, {
636
677
  source: t,
637
678
  compression: l.imageCompression,
638
679
  upload: l.imageUpload
639
680
  });
640
- return fr ? void 0 : n.src;
681
+ return Cr ? void 0 : n.src;
641
682
  } catch (e) {
642
- let n = ca(e);
643
- t === "toolbar" && (qn.value = n.message), H.value = n.message, g("image-error", n, t);
683
+ let n = Ta(e);
684
+ t === "toolbar" && (ir.value = n.message), H.value = n.message, _("image-error", n, t);
644
685
  return;
645
686
  } finally {
646
- t === "toolbar" && (Jn.value = !1);
687
+ t === "toolbar" && (ar.value = !1);
647
688
  }
648
689
  }
649
- let ua = 0;
650
- function da(e) {
690
+ let Da = 0;
691
+ function Oa(e) {
651
692
  let t = e.replacedFontFamilies.filter(Boolean);
652
693
  if (!t.length) return;
653
694
  let n = Date.now();
654
- n - ua < 800 || (ua = n, Lt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
695
+ n - Da < 800 || (Da = n, Rt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
655
696
  }
656
- async function fa(e) {
657
- return await la(e, "paste") ?? null;
697
+ async function ka(e) {
698
+ return await Ea(e, "paste") ?? null;
658
699
  }
659
- async function pa(e, t = {}) {
700
+ async function Aa(e, t = {}) {
660
701
  if (W.value) return;
661
- let n = G.value?.id ?? T.value.pages[0]?.id, r = n ? A.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await la(e, "toolbar");
662
- if (fr) return;
702
+ let n = G.value?.id ?? E.value.pages[0]?.id, r = n ? j.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await Ea(e, "toolbar");
703
+ if (Cr) return;
663
704
  if (!i || !Ee(i)) {
664
- typeof e == "string" && (qn.value = "请输入安全的图片 URL");
705
+ typeof e == "string" && (ir.value = "请输入安全的图片 URL");
665
706
  return;
666
707
  }
667
- if (n && !A.has(n)) return;
668
- let a = sa({
708
+ if (n && !j.has(n)) return;
709
+ let a = wa({
669
710
  ...t,
670
711
  src: i
671
712
  }, n, r);
672
- return a && (Bn.value = !1, oa(), H.value = "已插入图片"), a;
713
+ return a && (Zn.value = !1, Ca(), H.value = "已插入图片"), a;
673
714
  }
674
- function ma() {
675
- W.value || Jn.value || ($(), qn.value = "", fn.value && (fn.value.value = ""), fn.value?.click());
715
+ function ja() {
716
+ W.value || ar.value || ($(), ir.value = "", _n.value && (_n.value.value = ""), _n.value?.click());
676
717
  }
677
- async function ha(e) {
718
+ async function Ma(e) {
678
719
  let t = e.target.files?.[0];
679
- t && await pa(t, aa({ alt: t.name }));
720
+ t && await Aa(t, Sa({ alt: t.name }));
680
721
  }
681
- async function ga() {
682
- let e = Wn.value;
683
- await pa(e, aa());
722
+ async function Na() {
723
+ let e = tr.value;
724
+ await Aa(e, Sa());
684
725
  }
685
- function _a(e) {
686
- La(e), zn.value = !1;
726
+ function Pa(e) {
727
+ eo(e), Xn.value = !1;
687
728
  }
688
- function va() {
689
- $(), Zi();
729
+ function Fa() {
730
+ $(), ma();
690
731
  }
691
- function ya(e, t, n, r) {
692
- $(), ra(na({ type: t }), e, {
732
+ function Ia(e, t, n, r) {
733
+ $(), ba(ya({ type: t }), e, {
693
734
  left: n,
694
735
  top: r
695
736
  });
696
737
  }
697
- function ba(e) {
698
- $(), E.value = e;
738
+ function La(e) {
739
+ $(), D.value = e;
699
740
  }
700
- function xa(e) {
701
- let t = T.value.variables.find((t) => t.id === e.id);
741
+ function Ra(e) {
742
+ let t = E.value.variables.find((t) => t.id === e.id);
702
743
  if (!t) return;
703
744
  let n = e.key.trim();
704
745
  if (n !== t.key) {
705
- let t = we(n, T.value.variables, e.id);
746
+ let t = we(n, E.value.variables, e.id);
706
747
  if (t) {
707
748
  H.value = t;
708
749
  return;
@@ -712,23 +753,22 @@ var Vt = {
712
753
  ...e,
713
754
  key: n
714
755
  };
715
- let r = [...T.value.pages], i = t.key, a = "";
716
- A.forEach((t, n) => {
717
- let o = t.updateVariable(e, i);
718
- if (o) {
719
- a ||= n;
756
+ let r = [...E.value.pages], i = t.key;
757
+ j.forEach((t, n) => {
758
+ let a = t.updateVariable(e, i);
759
+ if (a) {
720
760
  let e = r.findIndex((e) => e.id === n);
721
- e >= 0 && (r[e] = o);
761
+ e >= 0 && (r[e] = a);
722
762
  }
723
763
  }), Z({
724
- ...T.value,
764
+ ...E.value,
725
765
  pages: r,
726
- variables: T.value.variables.map((t) => t.id === e.id ? e : t),
727
- ...i !== e.key && T.value.pageDecorations ? { pageDecorations: ne(T.value.pageDecorations, i, e.key) } : {}
728
- }), E.value = e.key, q(a || D.value);
766
+ variables: E.value.variables.map((t) => t.id === e.id ? e : t),
767
+ ...i !== e.key && E.value.pageDecorations ? { pageDecorations: ne(E.value.pageDecorations, i, e.key) } : {}
768
+ }), D.value = e.key, q();
729
769
  }
730
- function Sa(e) {
731
- K.value && xa({
770
+ function za(e) {
771
+ K.value && Ra({
732
772
  ...K.value,
733
773
  ...e,
734
774
  style: {
@@ -737,338 +777,338 @@ var Vt = {
737
777
  }
738
778
  });
739
779
  }
740
- function Ca(e) {
741
- W.value || !K.value || Sa({ key: e });
780
+ function Ba(e) {
781
+ W.value || !K.value || za({ key: e });
742
782
  }
743
- function wa(e) {
783
+ function Va(e) {
744
784
  W.value || (Z({
745
- ...T.value,
785
+ ...E.value,
746
786
  pageDecorations: o(e)
747
- }), q(T.value.pages[0]?.id));
787
+ }), q());
748
788
  }
749
- function Ta(e) {
750
- (e === "left" || e === "center" || e === "right") && Sa({ style: { textAlign: e } });
789
+ function Ha(e) {
790
+ (e === "left" || e === "center" || e === "right") && za({ style: { textAlign: e } });
751
791
  }
752
- function Ea(e) {
753
- (e === "solid" || e === "dashed") && Sa({ style: { borderStyle: e } });
792
+ function Ua(e) {
793
+ (e === "solid" || e === "dashed") && za({ style: { borderStyle: e } });
754
794
  }
755
- function Da(e) {
756
- (e === "contain" || e === "cover" || e === "fill") && Sa({ style: { objectFit: e } });
795
+ function Wa(e) {
796
+ (e === "contain" || e === "cover" || e === "fill") && za({ style: { objectFit: e } });
757
797
  }
758
- function Oa(e) {
759
- Sa({ style: e });
798
+ function Ga(e) {
799
+ za({ style: e });
760
800
  }
761
- function ka(e) {
762
- Oa({ fontFamily: String(e || "").trim() || t });
801
+ function Ka(e) {
802
+ Ga({ fontFamily: String(e || "").trim() || t });
763
803
  }
764
- function Aa(e) {
765
- Oa({ fontSize: Oi(e, K.value?.style?.fontSize ?? 14) });
804
+ function qa(e) {
805
+ Ga({ fontSize: Ui(e, K.value?.style?.fontSize ?? 14) });
766
806
  }
767
- function ja(e) {
768
- K.value && Sa({
807
+ function Ja(e) {
808
+ K.value && za({
769
809
  multiline: e,
770
810
  rows: K.value.rows || 3,
771
811
  lineHeight: K.value.lineHeight || 28,
772
812
  style: e ? { underline: !0 } : void 0
773
813
  });
774
814
  }
775
- function Ma(e) {
776
- K.value && Sa({
815
+ function Ya(e) {
816
+ K.value && za({
777
817
  rows: Number(e || 3),
778
818
  lineHeight: K.value.lineHeight || 28
779
819
  });
780
820
  }
781
- function Na(e) {
821
+ function Xa(e) {
782
822
  if (W.value) return;
783
- let t = [...T.value.pages];
784
- A.forEach((n, r) => {
823
+ let t = [...E.value.pages];
824
+ j.forEach((n, r) => {
785
825
  let i = n.removeVariable(e.key);
786
826
  if (i) {
787
827
  let e = t.findIndex((e) => e.id === r);
788
828
  e >= 0 && (t[e] = i);
789
829
  }
790
830
  }), Z({
791
- ...T.value,
831
+ ...E.value,
792
832
  pages: t,
793
- variables: T.value.variables.filter((t) => t.id !== e.id),
794
- ...T.value.pageDecorations ? { pageDecorations: ne(T.value.pageDecorations, e.key) } : {}
795
- }), E.value = "";
833
+ variables: E.value.variables.filter((t) => t.id !== e.id),
834
+ ...E.value.pageDecorations ? { pageDecorations: ne(E.value.pageDecorations, e.key) } : {}
835
+ }), D.value = "";
796
836
  }
797
- function Pa(e) {
798
- let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(T.value.variables.map((e) => e.key));
837
+ function Za(e) {
838
+ let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(E.value.variables.map((e) => e.key));
799
839
  if (!n.has(t)) return t;
800
840
  let r = 2;
801
841
  for (; n.has(`${t}_${r}`);) r += 1;
802
842
  return `${t}_${r}`;
803
843
  }
804
- function Fa(e) {
805
- W.value || ra(he({
844
+ function Qa(e) {
845
+ W.value || ba(he({
806
846
  ...e,
807
847
  id: void 0,
808
- key: Pa(`${e.key || e.type}_copy`),
848
+ key: Za(`${e.key || e.type}_copy`),
809
849
  label: `${e.label}副本`,
810
850
  style: { ...e.style }
811
- }, ni.value, l.defaultVariableStyle));
851
+ }, mi.value, l.defaultVariableStyle));
812
852
  }
813
- function Ia(e) {
814
- return W.value ? void 0 : ra(T.value.variables.find((t) => t.key === e.key) ?? he(e, ni.value, l.defaultVariableStyle));
853
+ function $a(e) {
854
+ return W.value ? void 0 : ba(E.value.variables.find((t) => t.key === e.key) ?? he(e, mi.value, l.defaultVariableStyle));
815
855
  }
816
- function La(e) {
817
- if (!W.value) return ra(na({ type: e }));
856
+ function eo(e) {
857
+ if (!W.value) return ba(ya({ type: e }));
818
858
  }
819
- function Ra(e) {
859
+ function to(e) {
820
860
  if (W.value || !re(e)) return;
821
- let t = R.value, n = ni.value.find((t) => t.type === e);
861
+ let t = R.value, n = mi.value.find((t) => t.type === e);
822
862
  if (!t || !n) return;
823
- let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, Zt, gi.value), a = za();
824
- ra(na({
863
+ let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, $t, ji.value), a = no();
864
+ ba(ya({
825
865
  type: e,
826
866
  label: r,
827
867
  ...i ? { width: i } : {},
828
868
  ...a ? { style: a } : {}
829
869
  }), t.pageId), H.value = t.hasSelection ? `已将选中内容替换为${n.label}控件` : `已插入${n.label}控件`, $();
830
870
  }
831
- function za() {
871
+ function no() {
832
872
  let e = J.value, t = {};
833
873
  return e.isUnderline && (t.underline = !0), typeof e.fontSize == "number" && Number.isFinite(e.fontSize) && (t.fontSize = e.fontSize), e.fontFamily && (t.fontFamily = e.fontFamily), e.textColor && (t.color = e.textColor), Object.keys(t).length ? t : void 0;
834
874
  }
835
- function Ba(e) {
875
+ function ro(e) {
836
876
  if (W.value) return;
837
877
  let t = R.value;
838
- t && (ra(e, t.pageId), H.value = `已绑定到${e.label},沿用原控件尺寸`, $());
878
+ t && (ba(e, t.pageId), H.value = `已绑定到${e.label},沿用原控件尺寸`, $());
839
879
  }
840
- function Va(e) {
841
- return _e(e.type && re(e.type) ? e.type : "text", ni.value).label;
880
+ function io(e) {
881
+ return _e(e.type && re(e.type) ? e.type : "text", mi.value).label;
842
882
  }
843
- function Ha() {
844
- T.value.variables.length && (tr.value = !0, _(() => {
845
- ts(), Yn.value?.focusBindSearch();
883
+ function ao() {
884
+ E.value.variables.length && (fr.value = !0, v(() => {
885
+ vs(), or.value?.focusBindSearch();
846
886
  }));
847
887
  }
848
- function Ua(e, t) {
888
+ function oo(e, t) {
849
889
  e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
850
890
  }
851
- function Wa(e) {
852
- return j.value = Math.round(Math.min(Kt, Math.max(Gt, Number.isFinite(e) ? e : 1)) * 100) / 100, j.value;
891
+ function so(e) {
892
+ return M.value = Math.round(Math.min(qt, Math.max(Kt, Number.isFinite(e) ? e : 1)) * 100) / 100, M.value;
853
893
  }
854
- let { width: Ga } = Rt(an), { fitWidth: Ka, applyAutoFit: qa, markUserAdjusted: Ja, userAdjusted: Ya } = Oe({
855
- viewportWidth: Ga,
856
- widestPageWidth: f(() => Math.max(...T.value.pages.map((e) => Ji(e).width), ce.width) + 10),
894
+ let { width: co } = zt(sn), { fitWidth: lo, applyAutoFit: uo, markUserAdjusted: fo, userAdjusted: po } = Oe({
895
+ viewportWidth: co,
896
+ widestPageWidth: f(() => Math.max(...E.value.pages.map((e) => da(e).width), ce.width) + 10),
857
897
  padding: 48,
858
- minZoom: Gt,
859
- maxZoom: Kt,
860
- getZoom: () => j.value,
861
- applyZoom: Wa
898
+ minZoom: Kt,
899
+ maxZoom: qt,
900
+ getZoom: () => M.value,
901
+ applyZoom: so
862
902
  });
863
- function Xa(e) {
864
- return Ja(), Wa(e);
903
+ function mo(e) {
904
+ return fo(), so(e);
865
905
  }
866
- function Za() {
867
- return qa();
906
+ function ho() {
907
+ return uo();
868
908
  }
869
- function Qa() {
870
- return j.value;
909
+ function go() {
910
+ return M.value;
871
911
  }
872
- function $a() {
873
- Xa(j.value + qt);
912
+ function _o() {
913
+ mo(M.value + Jt);
874
914
  }
875
- function eo() {
876
- Xa(j.value - qt);
915
+ function vo() {
916
+ mo(M.value - Jt);
877
917
  }
878
- function to() {
879
- $(), cs(), M.value = !M.value;
918
+ function yo() {
919
+ $(), Ts(), N.value = !N.value;
880
920
  }
881
- x(Ga, (e) => {
882
- P.value && !Ya.value && e > 0 && Ka();
921
+ S(co, (e) => {
922
+ Wn.value && !po.value && e > 0 && lo();
883
923
  });
884
- function no(e) {
885
- N.value ? dn.value?.focus() : e();
886
- }
887
- function ro() {
888
- $(), cs(), F.value = !1, dr = {
889
- fullscreen: M.value,
890
- sidebar: Mn.value,
891
- inspector: Nn.value,
892
- chrome: N.value,
893
- zoom: j.value,
894
- userAdjusted: Ya.value
895
- }, M.value = !0, Mn.value = !0, Nn.value = !0, N.value = !0, P.value = !0, _(() => {
896
- W.value ? Pn.value?.focus() : A.get(D.value)?.focus();
924
+ function bo(e) {
925
+ P.value ? gn.value?.focus() : e();
926
+ }
927
+ function xo() {
928
+ $(), Ts(), F.value = !1, Sr = {
929
+ fullscreen: N.value,
930
+ sidebar: Hn.value,
931
+ inspector: Un.value,
932
+ chrome: P.value,
933
+ zoom: M.value,
934
+ userAdjusted: po.value
935
+ }, N.value = !0, Hn.value = !0, Un.value = !0, P.value = !0, Wn.value = !0, v(() => {
936
+ W.value ? Gn.value?.focus() : j.get(O.value)?.focus();
897
937
  });
898
938
  }
899
- function io() {
900
- let e = dr;
901
- P.value = !1, dr = void 0, e && (M.value = e.fullscreen, Mn.value = e.sidebar, Nn.value = e.inspector, N.value = e.chrome, e.userAdjusted ? Xa(e.zoom) : qa(), _(() => no(() => sn.value?.focusImmersive())));
939
+ function So() {
940
+ let e = Sr;
941
+ Wn.value = !1, Sr = void 0, e && (N.value = e.fullscreen, Hn.value = e.sidebar, Un.value = e.inspector, P.value = e.chrome, e.userAdjusted ? mo(e.zoom) : uo(), v(() => bo(() => fn.value?.focusImmersive())));
902
942
  }
903
- function ao() {
904
- P.value ? io() : ro();
943
+ function Co() {
944
+ Wn.value ? So() : xo();
905
945
  }
906
- function oo() {
946
+ function wo() {
907
947
  $(), z.value = void 0;
908
948
  let e = Y(!1);
909
- S.value ? (En.value = u(C.value), Tn.value = void 0, Dn.value = w.value || C.value[0]?.id || "") : (Tn.value = c(e), En.value = void 0, Dn.value = ""), wn.value = !0;
949
+ C.value ? (In.value = u(w.value), Fn.value = void 0, Ln.value = T.value || w.value[0]?.id || "") : (Fn.value = c(e), In.value = void 0, Ln.value = ""), Pn.value = !0;
910
950
  }
911
- function so() {
912
- wn.value = !1, Tn.value = void 0, En.value = void 0, Dn.value = "";
951
+ function To() {
952
+ Pn.value = !1, Fn.value = void 0, In.value = void 0, Ln.value = "";
913
953
  }
914
- function co() {
915
- return Ro();
954
+ function Eo() {
955
+ return ts();
916
956
  }
917
- function lo() {
957
+ function Do() {
918
958
  $();
919
- let e = co();
920
- return kn.value = JSON.stringify(e, null, 2), On.value = !0, e;
959
+ let e = Eo();
960
+ return zn.value = JSON.stringify(e, null, 2), Rn.value = !0, e;
921
961
  }
922
- function uo() {
923
- On.value = !1;
962
+ function Oo() {
963
+ Rn.value = !1;
924
964
  }
925
- function fo() {
965
+ function ko() {
926
966
  return De(Y(!1));
927
967
  }
928
- function po() {
968
+ function Ao() {
929
969
  $();
930
- let e = fo();
931
- return jn.value = e, An.value = !0, e;
970
+ let e = ko();
971
+ return Vn.value = e, Bn.value = !0, e;
932
972
  }
933
- function mo() {
934
- An.value = !1;
973
+ function jo() {
974
+ Bn.value = !1;
935
975
  }
936
- function ho() {
937
- $(), z.value = void 0, I.value = !1, L.value = !1, E.value = "", D.value = "", wn.value = !1, Tn.value = void 0, En.value = void 0, On.value = !1, kn.value = "", An.value = !1, jn.value = {
976
+ function Mo() {
977
+ $(), z.value = void 0, I.value = !1, L.value = !1, D.value = "", O.value = "", Pn.value = !1, Fn.value = void 0, In.value = void 0, Rn.value = !1, zn.value = "", Bn.value = !1, Vn.value = {
938
978
  values: {},
939
979
  variables: []
940
- }, Ln.value = {}, Cn.value = "";
941
- let e = Z(pe(ce));
942
- return D.value = e.pages[0]?.id ?? "", c(e);
980
+ }, Jn.value = {}, un(), xi();
981
+ let e = Z(fe(ce));
982
+ return O.value = e.pages[0]?.id ?? "", c(e);
943
983
  }
944
- function go() {
945
- W.value || ($(), Ft.confirm({
984
+ function No() {
985
+ W.value || ($(), It.confirm({
946
986
  title: "清空合同内容",
947
987
  content: "将清空全部合同正文、页面和模板变量,仅保留一个空白 A4 合同页。此操作不可撤销。",
948
988
  okText: "确认清空",
949
989
  okType: "danger",
950
990
  cancelText: "取消",
951
991
  onOk: () => {
952
- ho();
992
+ Mo();
953
993
  }
954
994
  }));
955
995
  }
956
- function _o(e) {
957
- let t = Ai().pages, n = t.find((e) => e.id === D.value);
996
+ function Po(e) {
997
+ let t = Gi().pages, n = t.find((e) => e.id === O.value);
958
998
  return (n ? [n, ...t.filter((e) => e.id !== n.id)] : t).find((t) => t.contentHtml.includes(`data-key="${e.key}"`) || t.contentHtml.includes(`data-key='${e.key}'`));
959
999
  }
960
- function vo(e) {
961
- $(), E.value = e.key;
962
- let t = _o(e);
963
- t && (D.value = t.id, _(() => {
964
- A.get(t.id)?.scrollIntoVariable(e.key);
1000
+ function Fo(e) {
1001
+ $(), D.value = e.key;
1002
+ let t = Po(e);
1003
+ t && (O.value = t.id, v(() => {
1004
+ j.get(t.id)?.scrollIntoVariable(e.key);
965
1005
  }));
966
1006
  }
967
- function yo(e) {
968
- let t = T.value.variables.find((t) => t.key === e || t.id === e);
969
- t && vo(t);
1007
+ function Io(e) {
1008
+ let t = E.value.variables.find((t) => t.key === e || t.id === e);
1009
+ t && Fo(t);
970
1010
  }
971
- function bo(e, t = !0) {
972
- $(), D.value = e, t && _(() => {
973
- A.get(e)?.scrollIntoPage();
1011
+ function Lo(e, t = !0) {
1012
+ $(), O.value = e, t && v(() => {
1013
+ j.get(e)?.scrollIntoPage();
974
1014
  });
975
1015
  }
976
- function xo(e) {
977
- bo(e.pageId, !1), A.get(e.pageId)?.focusHeading(e.headingIndex);
1016
+ function Ro(e) {
1017
+ Lo(e.pageId, !1), j.get(e.pageId)?.focusHeading(e.headingIndex);
978
1018
  }
979
- function So(e) {
980
- T.value.pages.some((t) => t.id === e) && bo(e);
1019
+ function zo(e) {
1020
+ E.value.pages.some((t) => t.id === e) && Lo(e);
981
1021
  }
982
- function Co() {
1022
+ function Bo() {
983
1023
  if (F.value) {
984
- wo();
1024
+ Vo();
985
1025
  return;
986
1026
  }
987
1027
  F.value = !0;
988
1028
  }
989
- function wo() {
990
- F.value = !1, _(() => no(() => sn.value?.focusPageDecorations()));
1029
+ function Vo() {
1030
+ F.value = !1, v(() => bo(() => fn.value?.focusPageDecorations()));
991
1031
  }
992
- function To() {
993
- return Mi(), c(Ai());
1032
+ function Ho() {
1033
+ return Ji(), c(Gi());
994
1034
  }
995
- function Eo(e) {
996
- q(Z(xe(e, l.pageSize)).pages[0]?.id);
1035
+ function Uo(e) {
1036
+ un(), xi(), Z(e), q();
997
1037
  }
998
- function Do() {
1038
+ function Wo() {
999
1039
  let e = Y(!1);
1000
- return S.value ? u(C.value) : u(lt(C.value, w.value, e));
1040
+ return C.value ? u(w.value) : u(ut(w.value, T.value, e));
1001
1041
  }
1002
- function Oo(e, t) {
1003
- let n = nt(ot(e, void 0, l.pageSize), l.pageSizeOptions), r = C.value;
1004
- gn.value = !0, Y(!1), C.value = n.files, Ii(ut(C.value, t ?? w.value), {
1042
+ function Go(e, t) {
1043
+ let n = rt(st(e, void 0, l.pageSize), l.pageSizeOptions), r = w.value;
1044
+ En.value = !0, Y(!1), w.value = n.files, $i(dt(w.value, t ?? T.value), {
1005
1045
  syncCurrent: !1,
1006
1046
  shouldEmit: !0,
1007
1047
  forceRefresh: !0
1008
- }), d(r) !== d(C.value) && X(C.value, "");
1048
+ }), d(r) !== d(w.value) && X(w.value, "");
1009
1049
  }
1010
- function ko(e) {
1050
+ function Ko(e) {
1011
1051
  if (W.value) return;
1012
- gn.value = !0, Y(!0);
1013
- let t = rt(e || `合同文件 ${C.value.length + 1}`, l.pageSize);
1014
- return C.value = [...C.value, t], X(C.value, ""), g("file-add", u([t])[0]), Ii(t.id, {
1052
+ En.value = !0, Y(!0);
1053
+ let t = it(e || `合同文件 ${w.value.length + 1}`, l.pageSize);
1054
+ return w.value = [...w.value, t], X(w.value, ""), _("file-add", u([t])[0]), $i(t.id, {
1015
1055
  syncCurrent: !1,
1016
1056
  shouldEmit: !0,
1017
1057
  forceRefresh: !0
1018
1058
  }), u([t])[0];
1019
1059
  }
1020
- function Ao(e) {
1021
- !S.value && !C.value.some((t) => t.id === e) || (gn.value = !0, Ii(e));
1060
+ function qo(e) {
1061
+ !C.value && !w.value.some((t) => t.id === e) || (En.value = !0, $i(e));
1022
1062
  }
1023
- function jo(e, t) {
1063
+ function Jo(e, t) {
1024
1064
  if (W.value) return;
1025
- gn.value = !0, Y(!1);
1026
- let n = ct(C.value, e, t), r = n.find((t) => t.id === e);
1027
- if (r) return C.value = n, X(n, e), u([r])[0];
1028
- }
1029
- function Mo(e) {
1030
- if (W.value || C.value.length <= 1) return;
1031
- gn.value = !0, Y(!1);
1032
- let t = C.value.find((t) => t.id === e);
1065
+ En.value = !0, Y(!1);
1066
+ let n = lt(w.value, e, t), r = n.find((t) => t.id === e);
1067
+ if (r) return w.value = n, X(n, e), u([r])[0];
1068
+ }
1069
+ function Yo(e) {
1070
+ if (W.value || w.value.length <= 1) return;
1071
+ En.value = !0, Y(!1);
1072
+ let t = w.value.find((t) => t.id === e);
1033
1073
  if (!t) return;
1034
- let n = st(C.value, e);
1035
- if (n.length !== C.value.length) return C.value = n, X(n, ""), g("file-remove", u([t])[0]), w.value === e && Ii(ut(n, n[0]?.id), {
1074
+ let n = ct(w.value, e);
1075
+ if (n.length !== w.value.length) return w.value = n, X(n, ""), _("file-remove", u([t])[0]), T.value === e && $i(dt(n, n[0]?.id), {
1036
1076
  syncCurrent: !1,
1037
1077
  shouldEmit: !0,
1038
1078
  forceRefresh: !0
1039
1079
  }), u([t])[0];
1040
1080
  }
1041
- function No(e) {
1042
- if (W.value || C.value.length <= 1) return;
1043
- let t = C.value.find((t) => t.id === e);
1044
- t && Ft.confirm({
1081
+ function Xo(e) {
1082
+ if (W.value || w.value.length <= 1) return;
1083
+ let t = w.value.find((t) => t.id === e);
1084
+ t && It.confirm({
1045
1085
  title: "删除合同文件",
1046
1086
  content: `删除“${t.name}”后,其正文和变量将无法恢复,是否继续?`,
1047
1087
  okText: "确认删除",
1048
1088
  okType: "danger",
1049
1089
  cancelText: "取消",
1050
1090
  onOk: () => {
1051
- Mo(e);
1091
+ Yo(e);
1052
1092
  }
1053
1093
  });
1054
1094
  }
1055
- function Po(e, t) {
1095
+ function Zo(e, t) {
1056
1096
  if (W.value) return;
1057
- gn.value = !0, Y(!1);
1058
- let n = C.value.findIndex((t) => t.id === e), r = at(C.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
1059
- if (!(!a || n === i)) return C.value = r, X(r, ""), g("file-move", u([a])[0], n, i), u([a])[0];
1097
+ En.value = !0, Y(!1);
1098
+ let n = w.value.findIndex((t) => t.id === e), r = ot(w.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
1099
+ if (!(!a || n === i)) return w.value = r, X(r, ""), _("file-move", u([a])[0], n, i), u([a])[0];
1060
1100
  }
1061
- function Fo() {
1101
+ function Qo() {
1062
1102
  Y(!1);
1063
- let e = Bo(S.value ? C.value.flatMap((e) => Te(e.template, { maxPages: ai.value }).map((t) => ({
1103
+ let e = rs(C.value ? w.value.flatMap((e) => Te(e.template, { maxPages: _i.value }).map((t) => ({
1064
1104
  ...t,
1065
1105
  fileId: e.id
1066
- }))) : Te(Ai(), { maxPages: ai.value }));
1067
- return k.value = e, O.value = !0, g("validate", e), e;
1106
+ }))) : Te(Gi(), { maxPages: _i.value }));
1107
+ return A.value = e, k.value = !0, _("validate", e), e;
1068
1108
  }
1069
- function Io(e) {
1070
- if (e.fileId && e.fileId !== w.value) {
1071
- Ao(e.fileId), _(() => Io({
1109
+ function $o(e) {
1110
+ if (e.fileId && e.fileId !== T.value) {
1111
+ qo(e.fileId), v(() => $o({
1072
1112
  ...e,
1073
1113
  fileId: void 0
1074
1114
  }));
@@ -1076,70 +1116,70 @@ var Vt = {
1076
1116
  }
1077
1117
  let t = te(e);
1078
1118
  if (t) {
1079
- F.value = !0, _(() => cn.value?.focusField(t));
1119
+ F.value = !0, v(() => pn.value?.focusField(t));
1080
1120
  return;
1081
1121
  }
1082
1122
  if (e.variableKey) {
1083
- yo(e.variableKey);
1123
+ Io(e.variableKey);
1084
1124
  return;
1085
1125
  }
1086
1126
  if (e.pageId) {
1087
- So(e.pageId);
1127
+ zo(e.pageId);
1088
1128
  return;
1089
1129
  }
1090
- let n = T.value.variables.find((t) => t.id === e.id || t.key === e.id);
1130
+ let n = E.value.variables.find((t) => t.id === e.id || t.key === e.id);
1091
1131
  if (n) {
1092
- vo(n);
1132
+ Fo(n);
1093
1133
  return;
1094
1134
  }
1095
- T.value.pages.some((t) => t.id === e.id) && bo(e.id);
1135
+ E.value.pages.some((t) => t.id === e.id) && Lo(e.id);
1096
1136
  }
1097
- function Lo(e) {
1137
+ function es(e) {
1098
1138
  return te(e) ? "页面装饰" : e.type === "variable" ? "变量" : "字段";
1099
1139
  }
1100
- function Ro() {
1101
- return Mi(), ge(Ai());
1140
+ function ts() {
1141
+ return Ji(), ge(Gi());
1102
1142
  }
1103
- function zo() {
1143
+ function ns() {
1104
1144
  let e = Y(!1);
1105
- return it(S.value ? C.value : lt(C.value, w.value, e));
1145
+ return at(C.value ? w.value : ut(w.value, T.value, e));
1106
1146
  }
1107
- function Bo(e) {
1147
+ function rs(e) {
1108
1148
  let t = /* @__PURE__ */ new Set();
1109
1149
  return e.filter((e) => {
1110
1150
  let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
1111
1151
  return t.has(n) ? !1 : (t.add(n), !0);
1112
1152
  });
1113
1153
  }
1114
- function Vo(e) {
1115
- k.value = [...e], O.value = !0;
1154
+ function is(e) {
1155
+ A.value = [...e], k.value = !0;
1116
1156
  }
1117
- function Ho() {
1118
- k.value = [], O.value = !1;
1157
+ function as() {
1158
+ A.value = [], k.value = !1;
1119
1159
  }
1120
- function Uo() {
1121
- A.get(G.value?.id ?? D.value)?.focus();
1160
+ function os() {
1161
+ j.get(G.value?.id ?? O.value)?.focus();
1122
1162
  }
1123
- function Wo(e) {
1124
- Ei(e) && Q({
1163
+ function ss(e) {
1164
+ Vi(e) && Q({
1125
1165
  type: "set-text-align",
1126
1166
  value: e
1127
1167
  });
1128
1168
  }
1129
- function Go(e) {
1130
- (e === "paragraph" || Di(e)) && Q({
1169
+ function cs(e) {
1170
+ (e === "paragraph" || Hi(e)) && Q({
1131
1171
  type: "apply-block-style",
1132
1172
  format: e
1133
1173
  });
1134
1174
  }
1135
- function Ko(e) {
1136
- let t = ki(e);
1175
+ function ls(e) {
1176
+ let t = Wi(e);
1137
1177
  t && (Q({
1138
1178
  type: "set-font-size",
1139
1179
  value: t
1140
- }), Rn.value = "");
1180
+ }), Yn.value = "");
1141
1181
  }
1142
- function qo(e) {
1182
+ function us(e) {
1143
1183
  let t = String(e || "").trim();
1144
1184
  if (!t) {
1145
1185
  Q({ type: "unset-font-family" });
@@ -1150,32 +1190,32 @@ var Vt = {
1150
1190
  value: t
1151
1191
  });
1152
1192
  }
1153
- function Jo(e) {
1154
- Yo(e.target?.value ?? "");
1193
+ function ds(e) {
1194
+ fs(e.target?.value ?? "");
1155
1195
  }
1156
- function Yo(e) {
1196
+ function fs(e) {
1157
1197
  let t = e.trim();
1158
1198
  t && Q({
1159
1199
  type: "set-color",
1160
1200
  value: t
1161
1201
  });
1162
1202
  }
1163
- function Xo(e) {
1164
- Rn.value = e;
1203
+ function ps(e) {
1204
+ Yn.value = e;
1165
1205
  }
1166
- function Zo() {
1167
- Rn.value.trim() && Ko(Rn.value);
1206
+ function ms() {
1207
+ Yn.value.trim() && ls(Yn.value);
1168
1208
  }
1169
- function Qo(e) {
1170
- e.key === "Enter" && (e.preventDefault(), Zo());
1209
+ function hs(e) {
1210
+ e.key === "Enter" && (e.preventDefault(), ms());
1171
1211
  }
1172
- function $o(e) {
1173
- e || (Zo(), Rn.value = "");
1212
+ function gs(e) {
1213
+ e || (ms(), Yn.value = "");
1174
1214
  }
1175
- function es(e) {
1215
+ function _s(e) {
1176
1216
  if (W.value) return;
1177
- D.value = e.pageId, I.value = !1, L.value = !1, B.value = void 0, V.value = void 0, tr.value = !1, nr.value = "";
1178
- let t = _t(e.clientX, e.clientY, 304, 300);
1217
+ O.value = e.pageId, I.value = !1, L.value = !1, B.value = void 0, V.value = void 0, fr.value = !1, pr.value = "";
1218
+ let t = vt(e.clientX, e.clientY, 304, 300);
1179
1219
  R.value = {
1180
1220
  pageId: e.pageId,
1181
1221
  x: t.x,
@@ -1183,208 +1223,208 @@ var Vt = {
1183
1223
  hasSelection: e.hasSelection,
1184
1224
  selectionWidth: e.selectionWidth,
1185
1225
  leadingText: e.leadingText
1186
- }, _(() => {
1187
- ts(), Yn.value?.focusFirstButton();
1226
+ }, v(() => {
1227
+ vs(), or.value?.focusFirstButton();
1188
1228
  });
1189
1229
  }
1190
- function ts() {
1191
- let e = Yn.value?.getMenuElement(), t = R.value;
1230
+ function vs() {
1231
+ let e = or.value?.getMenuElement(), t = R.value;
1192
1232
  if (!e || !t) return;
1193
- let n = vt(t.x, t.y, e);
1233
+ let n = yt(t.x, t.y, e);
1194
1234
  R.value = {
1195
1235
  ...t,
1196
1236
  x: n.x,
1197
1237
  y: n.y
1198
1238
  };
1199
1239
  }
1200
- function ns(e) {
1240
+ function ys(e) {
1201
1241
  if (W.value) return;
1202
- D.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, V.value = void 0;
1203
- let t = _t(e.clientX, e.clientY, 248, 400);
1242
+ O.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, V.value = void 0;
1243
+ let t = vt(e.clientX, e.clientY, 248, 400);
1204
1244
  B.value = {
1205
1245
  ...e,
1206
1246
  x: t.x,
1207
1247
  y: t.y
1208
- }, _(() => {
1209
- let e = rr.value?.getMenuElement(), t = B.value;
1248
+ }, v(() => {
1249
+ let e = mr.value?.getMenuElement(), t = B.value;
1210
1250
  if (e && t) {
1211
- let n = vt(t.x, t.y, e);
1251
+ let n = yt(t.x, t.y, e);
1212
1252
  B.value = {
1213
1253
  ...t,
1214
1254
  x: n.x,
1215
1255
  y: n.y
1216
1256
  };
1217
1257
  }
1218
- rr.value?.focusFirstItem();
1258
+ mr.value?.focusFirstItem();
1219
1259
  });
1220
1260
  }
1221
- function rs(e) {
1261
+ function bs(e) {
1222
1262
  if (W.value) return;
1223
- D.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, B.value = void 0, ar.value = e.image.width, or.value = e.image.height, E.value = "";
1224
- let t = _t(e.clientX, e.clientY, 288, 196);
1263
+ O.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, B.value = void 0, gr.value = e.image.width, _r.value = e.image.height, D.value = "";
1264
+ let t = vt(e.clientX, e.clientY, 288, 196);
1225
1265
  V.value = {
1226
1266
  pageId: e.pageId,
1227
1267
  image: e.image,
1228
1268
  x: t.x,
1229
1269
  y: t.y
1230
- }, _(() => {
1231
- is(), ir.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
1270
+ }, v(() => {
1271
+ xs(), hr.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
1232
1272
  });
1233
1273
  }
1234
- function is() {
1235
- let e = ir.value?.getMenuElement(), t = V.value;
1274
+ function xs() {
1275
+ let e = hr.value?.getMenuElement(), t = V.value;
1236
1276
  if (!e || !t) return;
1237
- let n = vt(t.x, t.y, e);
1277
+ let n = yt(t.x, t.y, e);
1238
1278
  V.value = {
1239
1279
  ...t,
1240
1280
  x: n.x,
1241
1281
  y: n.y
1242
1282
  };
1243
1283
  }
1244
- function as() {
1284
+ function Ss() {
1245
1285
  let e = V.value;
1246
- !e || W.value || (A.get(e.pageId)?.updateSelectedContentImage({
1247
- width: ke(ar.value),
1248
- height: ke(or.value)
1286
+ !e || W.value || (j.get(e.pageId)?.updateSelectedContentImage({
1287
+ width: ke(gr.value),
1288
+ height: ke(_r.value)
1249
1289
  }) && (H.value = "已更新图片尺寸"), $());
1250
1290
  }
1251
- function os() {
1291
+ function Cs() {
1252
1292
  let e = V.value;
1253
- !e || W.value || (A.get(e.pageId)?.updateSelectedContentImage({
1293
+ !e || W.value || (j.get(e.pageId)?.updateSelectedContentImage({
1254
1294
  width: void 0,
1255
1295
  height: void 0
1256
1296
  }) && (H.value = "已恢复图片自然尺寸"), $());
1257
1297
  }
1258
- function ss(e) {
1259
- e.type === "table" ? ns(e) : e.type === "image" ? rs(e) : es(e);
1298
+ function ws(e) {
1299
+ e.type === "table" ? ys(e) : e.type === "image" ? bs(e) : _s(e);
1260
1300
  }
1261
1301
  function $() {
1262
- R.value = void 0, B.value = void 0, V.value = void 0, tr.value = !1, nr.value = "";
1302
+ R.value = void 0, B.value = void 0, V.value = void 0, fr.value = !1, pr.value = "";
1263
1303
  }
1264
- function cs() {
1265
- Tr(!1), I.value = !1, L.value = !1, In.value = !1, zn.value = !1, Bn.value = !1, Vn.value = !1, Hn.value = !1;
1304
+ function Ts() {
1305
+ Lr(!1), I.value = !1, L.value = !1, qn.value = !1, Xn.value = !1, Zn.value = !1, Qn.value = !1, $n.value = !1;
1266
1306
  }
1267
- function ls() {
1268
- cs(), N.value = !N.value, _(() => no(() => sn.value?.focusChromeToggle()));
1307
+ function Es() {
1308
+ Ts(), P.value = !P.value, v(() => bo(() => fn.value?.focusChromeToggle()));
1269
1309
  }
1270
- let us = [
1310
+ let Ds = [
1271
1311
  ".gd-contract-template-designer__context-menu",
1272
1312
  ".gd-contract-template-designer__bubble-menu",
1273
1313
  ".gd-contract-template-designer__bubble-menu-popup"
1274
1314
  ].join(",");
1275
- function ds() {
1276
- let e = W.value || $n.value || Zn.value || Ar.value || F.value || wn.value, t = D.value, n = e ? void 0 : A.get(t)?.getSelectionViewportRect();
1315
+ function Os() {
1316
+ let e = W.value || ur.value || cr.value || Hr.value || F.value || Pn.value, t = O.value, n = e ? void 0 : j.get(t)?.getSelectionViewportRect();
1277
1317
  if (!n) {
1278
1318
  z.value = void 0;
1279
1319
  return;
1280
1320
  }
1281
- let r = n.top - 40 - tn, i = r >= 12 ? r : n.bottom + tn, a = _t((n.left + n.right) / 2 - 380 / 2, i, 380, 40);
1321
+ let r = n.top - 40 - rn, i = r >= 12 ? r : n.bottom + rn, a = vt((n.left + n.right) / 2 - 380 / 2, i, 380, 40);
1282
1322
  z.value = {
1283
1323
  pageId: t,
1284
1324
  x: a.x,
1285
1325
  y: a.y
1286
- }, _(() => fs(n));
1326
+ }, v(() => ks(n));
1287
1327
  }
1288
- function fs(e) {
1289
- let t = Xn.value?.getMenuElement(), n = z.value;
1328
+ function ks(e) {
1329
+ let t = sr.value?.getMenuElement(), n = z.value;
1290
1330
  if (!t || !n) return;
1291
- let r = t.getBoundingClientRect(), i = e.top - r.height - tn, a = i >= 12 ? i : e.bottom + tn, o = vt((e.left + e.right) / 2 - r.width / 2, a, t);
1331
+ let r = t.getBoundingClientRect(), i = e.top - r.height - rn, a = i >= 12 ? i : e.bottom + rn, o = yt((e.left + e.right) / 2 - r.width / 2, a, t);
1292
1332
  z.value = {
1293
1333
  ...n,
1294
1334
  x: o.x,
1295
1335
  y: o.y
1296
1336
  };
1297
1337
  }
1298
- function ps() {
1299
- let e = z.value?.pageId ?? D.value, t = A.get(e)?.getSelectionRange();
1300
- Qn = t ? {
1338
+ function As() {
1339
+ let e = z.value?.pageId ?? O.value, t = j.get(e)?.getSelectionRange();
1340
+ lr = t ? {
1301
1341
  pageId: e,
1302
1342
  ...t
1303
- } : void 0, Zn.value = !0, z.value = void 0;
1343
+ } : void 0, cr.value = !0, z.value = void 0;
1304
1344
  }
1305
- function ms(e) {
1306
- if (!Zn.value) return;
1307
- let t = Qn, n = A.get(e)?.getSelectionRange();
1308
- t && n && t.pageId === e && t.from === n.from && t.to === n.to || (Zn.value = !1, Qn = void 0);
1345
+ function js(e) {
1346
+ if (!cr.value) return;
1347
+ let t = lr, n = j.get(e)?.getSelectionRange();
1348
+ t && n && t.pageId === e && t.from === n.from && t.to === n.to || (cr.value = !1, lr = void 0);
1309
1349
  }
1310
- function hs() {
1311
- !z.value || er !== void 0 || (er = requestAnimationFrame(() => {
1312
- er = void 0, ds();
1350
+ function Ms() {
1351
+ !z.value || dr !== void 0 || (dr = requestAnimationFrame(() => {
1352
+ dr = void 0, Os();
1313
1353
  }));
1314
1354
  }
1315
- function gs() {
1316
- $n.value && ($n.value = !1, ds());
1355
+ function Ns() {
1356
+ ur.value && (ur.value = !1, Os());
1317
1357
  }
1318
- function _s() {
1319
- $(), hs();
1358
+ function Ps() {
1359
+ $(), Ms();
1320
1360
  }
1321
- function vs(e, t) {
1322
- A.get(z.value?.pageId ?? D.value)?.requestTextContextMenu(e, t);
1361
+ function Fs(e, t) {
1362
+ j.get(z.value?.pageId ?? O.value)?.requestTextContextMenu(e, t);
1323
1363
  }
1324
- function ys(e) {
1364
+ function Is(e) {
1325
1365
  let t = e.target instanceof Element ? e.target : null;
1326
- t?.closest(".ProseMirror") && ($n.value = !0, z.value = void 0), !(!R.value && !B.value && !V.value && !z.value) && (t?.closest(us) || ($(), z.value && ps()));
1366
+ t?.closest(".ProseMirror") && (ur.value = !0, z.value = void 0), !(!R.value && !B.value && !V.value && !z.value) && (t?.closest(Ds) || ($(), z.value && As()));
1327
1367
  }
1328
- function bs(e) {
1329
- (e.target instanceof Element ? e.target : null)?.closest(us) || ($(), hs());
1368
+ function Ls(e) {
1369
+ (e.target instanceof Element ? e.target : null)?.closest(Ds) || ($(), Ms());
1330
1370
  }
1331
- function xs(e) {
1332
- let t = rn.value;
1371
+ function Rs(e) {
1372
+ let t = on.value;
1333
1373
  if (!t || typeof document > "u") return !1;
1334
1374
  let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
1335
1375
  return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
1336
1376
  }
1337
- function Ss(e) {
1377
+ function zs(e) {
1338
1378
  if (e.key !== "Escape" || !F.value || typeof document > "u") return;
1339
- let t = rn.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
1379
+ let t = on.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
1340
1380
  if (!t) return;
1341
- let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(lr) || r?.closest(lr)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
1381
+ let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(br) || r?.closest(br)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
1342
1382
  if (i || a && o) {
1343
- cr.add(e);
1383
+ yr.add(e);
1344
1384
  return;
1345
1385
  }
1346
- !Ar.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), wo());
1386
+ !Hr.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), Vo());
1347
1387
  }
1348
- function Cs(e) {
1388
+ function Bs(e) {
1349
1389
  if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
1350
- if (!jr.value || !xs(e)) return;
1351
- e.preventDefault(), ci();
1390
+ if (!Ur.value || !Rs(e)) return;
1391
+ e.preventDefault(), Ci();
1352
1392
  return;
1353
1393
  }
1354
1394
  if (e.key === "Escape") {
1355
- if (cr.has(e)) {
1356
- cr.delete(e);
1395
+ if (yr.has(e)) {
1396
+ yr.delete(e);
1357
1397
  return;
1358
1398
  }
1359
- let t = Ar.value, n = t || F.value;
1360
- if (!t && F.value && wo(), $(), cs(), n && e.stopPropagation(), !n) {
1399
+ let t = Hr.value, n = t || F.value;
1400
+ if (!t && F.value && Vo(), $(), Ts(), n && e.stopPropagation(), !n) {
1361
1401
  if (z.value) {
1362
- ps(), e.stopPropagation();
1402
+ As(), e.stopPropagation();
1363
1403
  return;
1364
1404
  }
1365
- P.value ? io() : M.value = !1;
1405
+ Wn.value ? So() : N.value = !1;
1366
1406
  }
1367
1407
  }
1368
1408
  }
1369
- function ws(e, t) {
1370
- e === D.value && t.selectedContentImage && (E.value = ""), e === D.value && (ms(e), ds());
1371
- let n = Ln.value[e];
1372
- n && gt(n, t) || (Ln.value = {
1373
- ...Ln.value,
1409
+ function Vs(e, t) {
1410
+ e === O.value && t.selectedContentImage && (D.value = ""), e === O.value && (js(e), Os());
1411
+ let n = Jn.value[e];
1412
+ n && _t(n, t) || (Jn.value = {
1413
+ ...Jn.value,
1374
1414
  [e]: t
1375
1415
  });
1376
1416
  }
1377
- function Ts(e = sr.value.rows, t = sr.value.cols) {
1417
+ function Hs(e = vr.value.rows, t = vr.value.cols) {
1378
1418
  Q({
1379
1419
  type: "insert-table",
1380
1420
  options: {
1381
1421
  rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
1382
1422
  cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
1383
- withHeaderRow: !!sr.value.withHeaderRow
1423
+ withHeaderRow: !!vr.value.withHeaderRow
1384
1424
  }
1385
1425
  }), I.value = !1, $();
1386
1426
  }
1387
- let Es = {
1427
+ let Us = {
1388
1428
  "delete-table-row": {
1389
1429
  label: "删除当前行",
1390
1430
  countKey: "deleteRow"
@@ -1398,34 +1438,34 @@ var Vt = {
1398
1438
  countKey: "deleteTable"
1399
1439
  }
1400
1440
  };
1401
- function Ds(e) {
1441
+ function Ws(e) {
1402
1442
  let t = B.value;
1403
1443
  if (!t) return;
1404
1444
  let n = () => {
1405
1445
  Q(e, t.pageId), $();
1406
- }, r = Es[e.type];
1446
+ }, r = Us[e.type];
1407
1447
  if (!r) {
1408
1448
  n();
1409
1449
  return;
1410
1450
  }
1411
1451
  let i = t.affectedVariableCounts[r.countKey];
1412
- $(), Ft.confirm({
1452
+ $(), It.confirm({
1413
1453
  title: r.label,
1414
1454
  content: i ? `此操作将移除 ${i} 个正文变量节点,是否继续?` : "此操作将修改表格结构,是否继续?",
1415
1455
  okText: "确认",
1416
1456
  okType: "danger",
1417
1457
  cancelText: "取消",
1418
1458
  onOk: n,
1419
- onCancel: () => A.get(t.pageId)?.focus()
1459
+ onCancel: () => j.get(t.pageId)?.focus()
1420
1460
  });
1421
1461
  }
1422
- function Os(e) {
1423
- let t = rr.value?.getMenuElement();
1462
+ function Gs(e) {
1463
+ let t = mr.value?.getMenuElement();
1424
1464
  if (!t) return;
1425
1465
  if (e.key === "Escape") {
1426
1466
  e.preventDefault(), e.stopPropagation();
1427
1467
  let t = B.value?.pageId;
1428
- $(), A.get(t ?? "")?.focus();
1468
+ $(), j.get(t ?? "")?.focus();
1429
1469
  return;
1430
1470
  }
1431
1471
  let n = Array.from(t.querySelectorAll("button:not(:disabled)"));
@@ -1443,115 +1483,117 @@ var Vt = {
1443
1483
  let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
1444
1484
  e.preventDefault(), n[r]?.focus();
1445
1485
  }
1446
- function ks(e) {
1486
+ function Ks(e) {
1447
1487
  if (e.key !== "Escape") return;
1448
1488
  e.preventDefault(), e.stopPropagation();
1449
1489
  let t = R.value?.pageId;
1450
- $(), A.get(t ?? "")?.focus();
1490
+ $(), j.get(t ?? "")?.focus();
1451
1491
  }
1452
- function As(e) {
1492
+ function qs(e) {
1453
1493
  if (e.key !== "Escape") return;
1454
1494
  e.preventDefault(), e.stopPropagation();
1455
1495
  let t = V.value?.pageId;
1456
- $(), A.get(t ?? "")?.focus();
1496
+ $(), j.get(t ?? "")?.focus();
1457
1497
  }
1458
- function js(e) {
1498
+ function Js(e) {
1459
1499
  Q({ type: e }), L.value = !1, $();
1460
1500
  }
1461
- return Xe({
1462
- getValue: To,
1463
- setValue: Eo,
1464
- getFiles: Do,
1465
- setFiles: Oo,
1466
- addFile: ko,
1467
- selectFile: Ao,
1468
- renameFile: jo,
1469
- removeFile: Mo,
1470
- moveFile: Po,
1471
- validate: Fo,
1472
- exportTemplate: Ro,
1473
- exportFiles: zo,
1474
- getSubmitData: co,
1475
- clearTemplate: ho,
1476
- saveDraftCache: ci,
1477
- loadDraftCache: li,
1478
- clearDraftCache: ui,
1479
- getDraftCacheStatus: Ri,
1480
- insertVariable: Ia,
1481
- insertImage: pa,
1482
- focus: Uo,
1483
- openPreview: oo,
1484
- closePreview: so,
1485
- openSubmitDataViewer: lo,
1486
- closeSubmitDataViewer: uo,
1487
- getVariableData: fo,
1488
- openVariableDataViewer: po,
1489
- closeVariableDataViewer: mo,
1490
- setServerValidationErrors: Vo,
1491
- clearValidationErrors: Ho,
1492
- scrollToVariable: yo,
1493
- scrollToPage: So,
1494
- setZoom: Xa,
1495
- resetZoom: Za,
1496
- getZoom: Qa,
1497
- fitWidth: Ka
1498
- }), (e, t) => (v(), St("div", {
1501
+ return Ze({
1502
+ getValue: Ho,
1503
+ setValue: Uo,
1504
+ getFiles: Wo,
1505
+ setFiles: Go,
1506
+ addFile: Ko,
1507
+ selectFile: qo,
1508
+ renameFile: Jo,
1509
+ removeFile: Yo,
1510
+ moveFile: Zo,
1511
+ validate: Qo,
1512
+ exportTemplate: ts,
1513
+ exportFiles: ns,
1514
+ getSubmitData: Eo,
1515
+ clearTemplate: Mo,
1516
+ saveDraftCache: Ci,
1517
+ loadDraftCache: wi,
1518
+ clearDraftCache: Ti,
1519
+ getDraftCacheStatus: ta,
1520
+ insertVariable: $a,
1521
+ insertImage: Aa,
1522
+ focus: os,
1523
+ openPreview: wo,
1524
+ closePreview: To,
1525
+ openSubmitDataViewer: Do,
1526
+ closeSubmitDataViewer: Oo,
1527
+ getVariableData: ko,
1528
+ openVariableDataViewer: Ao,
1529
+ closeVariableDataViewer: jo,
1530
+ setServerValidationErrors: is,
1531
+ clearValidationErrors: as,
1532
+ scrollToVariable: Io,
1533
+ scrollToPage: zo,
1534
+ setZoom: mo,
1535
+ resetZoom: ho,
1536
+ getZoom: go,
1537
+ fitWidth: lo
1538
+ }), (e, t) => (y(), St("div", {
1499
1539
  ref_key: "designerElement",
1500
- ref: rn,
1540
+ ref: on,
1501
1541
  class: wt(["gd-contract-template-designer", {
1502
1542
  "is-disabled": s.disabled,
1503
1543
  "is-readonly": W.value,
1504
- "is-fullscreen": M.value,
1505
- "is-immersive": P.value
1544
+ "is-fullscreen": N.value,
1545
+ "is-immersive": Wn.value
1506
1546
  }]),
1507
- style: Tt(nn.value),
1508
- onKeydownCapture: t[31] ||= (...e) => b(kr) && b(kr)(...e)
1547
+ style: Tt(an.value),
1548
+ onKeydownCapture: t[31] ||= (...e) => x(Vr) && x(Vr)(...e)
1509
1549
  }, [
1510
- S.value ? (v(), xt(ft, {
1550
+ C.value ? (y(), p(pt, {
1511
1551
  key: 0,
1512
- files: C.value,
1513
- "active-file-id": w.value,
1552
+ files: w.value,
1553
+ "active-file-id": T.value,
1514
1554
  readonly: W.value,
1515
- onSelect: Ao,
1516
- onAdd: t[0] ||= (e) => ko(),
1517
- onRename: jo,
1518
- onRemove: No,
1519
- onMove: Po
1555
+ onSelect: qo,
1556
+ onAdd: t[0] ||= (e) => Ko(),
1557
+ onRename: Jo,
1558
+ onRemove: Xo,
1559
+ onMove: Zo
1520
1560
  }, null, 8, [
1521
1561
  "files",
1522
1562
  "active-file-id",
1523
1563
  "readonly"
1524
- ])) : p("", !0),
1525
- m("div", { class: wt(["gd-contract-template-designer__layout", {
1526
- "is-sidebar-collapsed": Mn.value,
1527
- "is-inspector-collapsed": Nn.value
1564
+ ])) : m("", !0),
1565
+ h("div", { class: wt(["gd-contract-template-designer__layout", {
1566
+ "is-sidebar-collapsed": Hn.value,
1567
+ "is-inspector-collapsed": Un.value
1528
1568
  }]) }, [
1529
- h(pt, {
1530
- collapsed: Mn.value,
1531
- pages: T.value.pages,
1532
- variables: T.value.variables,
1533
- "decoration-variable-keys": si.value,
1534
- "active-page-id": D.value,
1535
- "selected-variable-key": E.value,
1536
- "normalized-max-pages": ai.value,
1537
- "page-limit-reached": oi.value,
1569
+ g(mt, {
1570
+ collapsed: Hn.value,
1571
+ "file-id": T.value,
1572
+ pages: E.value.pages,
1573
+ variables: E.value.variables,
1574
+ "decoration-variable-keys": yi.value,
1575
+ "active-page-id": O.value,
1576
+ "selected-variable-key": D.value,
1577
+ "normalized-max-pages": _i.value,
1578
+ "page-limit-reached": vi.value,
1538
1579
  "selected-page": G.value,
1539
- "selected-page-size": Ir.value,
1540
- "normalized-page-size-options": Qr.value,
1541
- "page-size-options": $r.value,
1542
- "selected-page-size-option-value": ei.value,
1580
+ "selected-page-size": Jr.value,
1581
+ "normalized-page-size-options": ui.value,
1582
+ "page-size-options": di.value,
1583
+ "selected-page-size-option-value": fi.value,
1543
1584
  readonly: W.value,
1544
- "get-page-size": Ji,
1545
- onToggle: t[1] ||= (e) => Mn.value = !Mn.value,
1546
- onAddPage: Zi,
1547
- onActivatePage: bo,
1548
- onNavigateOutline: xo,
1549
- onDuplicatePage: Qi,
1550
- onRemovePage: ea,
1551
- onPatchPageFormat: Yi,
1552
- onScrollToVariable: vo
1585
+ "get-page-size": da,
1586
+ onToggle: t[1] ||= (e) => Hn.value = !Hn.value,
1587
+ onAddPage: ma,
1588
+ onActivatePage: Lo,
1589
+ onNavigateOutline: Ro,
1590
+ onDuplicatePage: ha,
1591
+ onRemovePage: _a,
1592
+ onPatchPageFormat: fa,
1593
+ onScrollToVariable: Fo
1553
1594
  }, null, 8, [
1554
1595
  "collapsed",
1596
+ "file-id",
1555
1597
  "pages",
1556
1598
  "variables",
1557
1599
  "decoration-variable-keys",
@@ -1566,71 +1608,71 @@ var Vt = {
1566
1608
  "selected-page-size-option-value",
1567
1609
  "readonly"
1568
1610
  ]),
1569
- m("main", {
1611
+ h("main", {
1570
1612
  ref_key: "workspaceElement",
1571
- ref: on,
1613
+ ref: dn,
1572
1614
  class: "gd-contract-template-designer__workspace"
1573
1615
  }, [
1574
- Nt(m("div", {
1575
- id: un,
1616
+ Pt(h("div", {
1617
+ id: hn,
1576
1618
  class: "gd-contract-template-designer__workspace-chrome"
1577
- }, [h(Re, {
1619
+ }, [g(ze, {
1578
1620
  ref_key: "workspaceHeaderElement",
1579
- ref: sn,
1580
- summary: zr.value,
1581
- "draft-cache-status-text": Ur.value,
1582
- "draft-cache-status-class": Wr.value,
1621
+ ref: fn,
1622
+ summary: Zr.value,
1623
+ "draft-cache-status-text": ti.value,
1624
+ "draft-cache-status-class": ni.value,
1583
1625
  "show-draft-cache-status": s.showDraftCacheStatus,
1584
1626
  "show-clear-button": s.showClearButton,
1585
1627
  "show-submit-data-viewer": s.showSubmitDataViewer,
1586
1628
  "show-variable-data-viewer": s.showVariableDataViewer,
1587
1629
  readonly: W.value,
1588
- "zoom-percent": Gr.value,
1589
- "zoom-out-disabled": j.value <= Gt,
1590
- "zoom-in-disabled": j.value >= Kt,
1591
- "is-fullscreen": M.value,
1592
- immersive: P.value,
1630
+ "zoom-percent": ri.value,
1631
+ "zoom-out-disabled": M.value <= Kt,
1632
+ "zoom-in-disabled": M.value >= qt,
1633
+ "is-fullscreen": N.value,
1634
+ immersive: Wn.value,
1593
1635
  "page-decorations-open": F.value,
1594
- "page-decorations-studio-id": ln,
1595
- "page-decorations-preset-label": Br.value,
1596
- "page-decorations-enabled-count": Hr.value,
1597
- "page-decorations-enabled-states": Vr.value,
1598
- "chrome-controls-id": un,
1599
- onZoomOut: eo,
1600
- onZoomIn: $a,
1601
- onFitWidth: b(Ka),
1602
- onResetZoom: Za,
1603
- onToggleFullscreen: to,
1604
- onToggleImmersive: ao,
1605
- onClear: go,
1606
- onValidate: Fo,
1607
- onPreview: oo,
1608
- onSubmitData: lo,
1609
- onVariableData: po,
1610
- onTogglePageDecorations: Co,
1611
- onToggleChrome: ls
1636
+ "page-decorations-studio-id": mn,
1637
+ "page-decorations-preset-label": Qr.value,
1638
+ "page-decorations-enabled-count": ei.value,
1639
+ "page-decorations-enabled-states": $r.value,
1640
+ "chrome-controls-id": hn,
1641
+ onZoomOut: vo,
1642
+ onZoomIn: _o,
1643
+ onFitWidth: x(lo),
1644
+ onResetZoom: ho,
1645
+ onToggleFullscreen: yo,
1646
+ onToggleImmersive: Co,
1647
+ onClear: No,
1648
+ onValidate: Qo,
1649
+ onPreview: wo,
1650
+ onSubmitData: Do,
1651
+ onVariableData: Ao,
1652
+ onTogglePageDecorations: Bo,
1653
+ onToggleChrome: Es
1612
1654
  }, {
1613
- authoring: Mt(() => [h(Ve, {
1655
+ authoring: Nt(() => [g(He, {
1614
1656
  ref_key: "authoringBarElement",
1615
- ref: pn,
1657
+ ref: vn,
1616
1658
  compact: "",
1617
- query: b(gr),
1618
- "onUpdate:query": t[2] ||= (e) => Ct(gr) ? gr.value = e : null,
1619
- replacement: b(_r),
1620
- "onUpdate:replacement": t[3] ||= (e) => Ct(_r) ? _r.value = e : null,
1621
- "match-case": b(vr),
1622
- "onUpdate:matchCase": t[4] ||= (e) => Ct(vr) ? vr.value = e : null,
1623
- panel: b(hr),
1659
+ query: x(Or),
1660
+ "onUpdate:query": t[2] ||= (e) => Ct(Or) ? Or.value = e : null,
1661
+ replacement: x(kr),
1662
+ "onUpdate:replacement": t[3] ||= (e) => Ct(kr) ? kr.value = e : null,
1663
+ "match-case": x(Ar),
1664
+ "onUpdate:matchCase": t[4] ||= (e) => Ct(Ar) ? Ar.value = e : null,
1665
+ panel: x(Dr),
1624
1666
  readonly: W.value,
1625
- total: b(yr).length,
1626
- "current-index": b(br),
1627
- "current-page": b(xr) ? b(xr).pageIndex + 1 : void 0,
1628
- feedback: b(Sr),
1629
- onOpen: b(wr),
1630
- onClose: t[5] ||= (e) => b(Tr)(),
1631
- onNavigate: b(Er),
1632
- onReplaceCurrent: b(Dr),
1633
- onReplaceAll: b(Or)
1667
+ total: x(jr).length,
1668
+ "current-index": x(Mr),
1669
+ "current-page": x(Nr) ? x(Nr).pageIndex + 1 : void 0,
1670
+ feedback: x(Pr),
1671
+ onOpen: x(Ir),
1672
+ onClose: t[5] ||= (e) => x(Lr)(),
1673
+ onNavigate: x(Rr),
1674
+ onReplaceCurrent: x(zr),
1675
+ onReplaceAll: x(Br)
1634
1676
  }, null, 8, [
1635
1677
  "query",
1636
1678
  "replacement",
@@ -1666,135 +1708,138 @@ var Vt = {
1666
1708
  "page-decorations-enabled-count",
1667
1709
  "page-decorations-enabled-states",
1668
1710
  "onFitWidth"
1669
- ]), h(Be, {
1670
- "variable-insert-popover-open": zn.value,
1671
- "onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => zn.value = e,
1672
- "signing-layout-popover-open": Vn.value,
1673
- "onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => Vn.value = e,
1674
- "signing-mark-popover-open": Hn.value,
1675
- "onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => Hn.value = e,
1676
- "image-insert-popover-open": Bn.value,
1677
- "onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => Bn.value = e,
1678
- "image-insert-url": Wn.value,
1679
- "onUpdate:imageInsertUrl": t[10] ||= (e) => Wn.value = e,
1680
- "image-insert-width": Gn.value,
1681
- "onUpdate:imageInsertWidth": t[11] ||= (e) => Gn.value = e,
1682
- "image-insert-height": Kn.value,
1683
- "onUpdate:imageInsertHeight": t[12] ||= (e) => Kn.value = e,
1711
+ ]), g(Ve, {
1712
+ "variable-insert-popover-open": Xn.value,
1713
+ "onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => Xn.value = e,
1714
+ "signing-layout-popover-open": Qn.value,
1715
+ "onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => Qn.value = e,
1716
+ "signing-mark-popover-open": $n.value,
1717
+ "onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => $n.value = e,
1718
+ "image-insert-popover-open": Zn.value,
1719
+ "onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => Zn.value = e,
1720
+ "image-insert-url": tr.value,
1721
+ "onUpdate:imageInsertUrl": t[10] ||= (e) => tr.value = e,
1722
+ "image-insert-width": nr.value,
1723
+ "onUpdate:imageInsertWidth": t[11] ||= (e) => nr.value = e,
1724
+ "image-insert-height": rr.value,
1725
+ "onUpdate:imageInsertHeight": t[12] ||= (e) => rr.value = e,
1684
1726
  "table-insert-popover-open": I.value,
1685
1727
  "onUpdate:tableInsertPopoverOpen": t[13] ||= (e) => I.value = e,
1686
1728
  "table-actions-popover-open": L.value,
1687
1729
  "onUpdate:tableActionsPopoverOpen": t[14] ||= (e) => L.value = e,
1688
- "table-insert-draft": sr.value,
1689
- "onUpdate:tableInsertDraft": t[15] ||= (e) => sr.value = e,
1690
- "toolbar-more-open": In.value,
1691
- "onUpdate:toolbarMoreOpen": t[16] ||= (e) => In.value = e,
1730
+ "table-insert-draft": vr.value,
1731
+ "onUpdate:tableInsertDraft": t[15] ||= (e) => vr.value = e,
1732
+ "toolbar-more-open": qn.value,
1733
+ "onUpdate:toolbarMoreOpen": t[16] ||= (e) => qn.value = e,
1692
1734
  readonly: W.value,
1693
1735
  "editor-state": J.value,
1694
- "current-block-format": vi.value,
1695
- "block-format-options": Yr,
1696
- "font-family-select-options": qr.value,
1697
- "current-editor-font-family": yi.value,
1698
- "font-size-preset-options": Ci.value,
1699
- "current-editor-font-size": bi.value,
1700
- "editor-font-size-search-value": Rn.value,
1701
- "current-editor-text-color": xi.value,
1702
- "body-control-tool-items": ii.value,
1703
- "signing-layout-presets": ri.value,
1704
- "page-limit-reached": oi.value,
1705
- "normalized-max-pages": ai.value,
1706
- "image-processing": Jn.value,
1707
- "image-insert-error": qn.value,
1736
+ "current-block-format": Ni.value,
1737
+ "block-format-options": si,
1738
+ "font-family-select-options": ai.value,
1739
+ "current-editor-font-family": Pi.value,
1740
+ "font-size-preset-options": Ri.value,
1741
+ "current-editor-font-size": Fi.value,
1742
+ "editor-font-size-search-value": Yn.value,
1743
+ "current-editor-text-color": Ii.value,
1744
+ "body-control-tool-items": gi.value,
1745
+ "signing-layout-presets": hi.value,
1746
+ "page-limit-reached": vi.value,
1747
+ "normalized-max-pages": _i.value,
1748
+ "image-processing": ar.value,
1749
+ "image-insert-error": ir.value,
1708
1750
  onCommand: t[17] ||= (e) => Q(e),
1709
- onPatchBlockFormat: Go,
1710
- onPatchFontFamily: qo,
1711
- onPatchFontSize: Ko,
1712
- onPatchColor: Jo,
1713
- onPatchTextAlign: Wo,
1714
- onInsertVariable: _a,
1715
- onInsertSigningLayout: Bi,
1716
- onInsertSigningMark: Ui,
1717
- onOpenSigningLayoutCustom: Hi,
1718
- onOpenImageFile: ma,
1719
- onInsertImageUrl: ga,
1720
- onAddPage: Zi,
1721
- onInsertTable: Ts,
1722
- onTableAction: js,
1723
- onFontSizeSearch: Xo,
1724
- onFontSizeCommit: Zo,
1725
- onFontSizeDropdownChange: $o,
1726
- onFontSizeKeydown: Qo
1727
- }, null, 8, /* @__PURE__ */ "variable-insert-popover-open.signing-layout-popover-open.signing-mark-popover-open.image-insert-popover-open.image-insert-url.image-insert-width.image-insert-height.table-insert-popover-open.table-actions-popover-open.table-insert-draft.toolbar-more-open.readonly.editor-state.current-block-format.font-family-select-options.current-editor-font-family.font-size-preset-options.current-editor-font-size.editor-font-size-search-value.current-editor-text-color.body-control-tool-items.signing-layout-presets.page-limit-reached.normalized-max-pages.image-processing.image-insert-error".split("."))], 512), [[jt, !N.value]]),
1728
- N.value ? (v(), xt(b(It), {
1751
+ onPatchBlockFormat: cs,
1752
+ onPatchFontFamily: us,
1753
+ onPatchFontSize: ls,
1754
+ onPatchColor: ds,
1755
+ onPatchTextAlign: ss,
1756
+ onInsertVariable: Pa,
1757
+ onInsertSigningLayout: ra,
1758
+ onInsertSigningMark: oa,
1759
+ onOpenSigningLayoutCustom: aa,
1760
+ onOpenImageFile: ja,
1761
+ onInsertImageUrl: Na,
1762
+ onAddPage: ma,
1763
+ onInsertTable: Hs,
1764
+ onTableAction: Js,
1765
+ onFontSizeSearch: ps,
1766
+ onFontSizeCommit: ms,
1767
+ onFontSizeDropdownChange: gs,
1768
+ onFontSizeKeydown: hs
1769
+ }, null, 8, /* @__PURE__ */ "variable-insert-popover-open.signing-layout-popover-open.signing-mark-popover-open.image-insert-popover-open.image-insert-url.image-insert-width.image-insert-height.table-insert-popover-open.table-actions-popover-open.table-insert-draft.toolbar-more-open.readonly.editor-state.current-block-format.font-family-select-options.current-editor-font-family.font-size-preset-options.current-editor-font-size.editor-font-size-search-value.current-editor-text-color.body-control-tool-items.signing-layout-presets.page-limit-reached.normalized-max-pages.image-processing.image-insert-error".split("."))], 512), [[Mt, !P.value]]),
1770
+ P.value ? (y(), p(x(Lt), {
1729
1771
  key: 0,
1730
1772
  title: "展开工具区"
1731
1773
  }, {
1732
- default: Mt(() => [m("button", {
1774
+ default: Nt(() => [h("button", {
1733
1775
  ref_key: "workspaceChromeHandleElement",
1734
- ref: dn,
1776
+ ref: gn,
1735
1777
  type: "button",
1736
1778
  class: "gd-contract-template-designer__workspace-chrome-handle",
1737
1779
  "aria-label": "展开工具区",
1738
1780
  "aria-expanded": !1,
1739
- "aria-controls": un,
1740
- onClick: ls
1741
- }, [h(b(Bt), { "aria-hidden": "true" })], 512)]),
1781
+ "aria-controls": hn,
1782
+ onClick: Es
1783
+ }, [g(x(Vt), { "aria-hidden": "true" })], 512)]),
1742
1784
  _: 1
1743
- })) : p("", !0),
1744
- P.value && !F.value ? (v(), St("button", {
1785
+ })) : m("", !0),
1786
+ Wn.value && !F.value ? (y(), St("button", {
1745
1787
  key: 1,
1746
1788
  ref_key: "immersiveExitElement",
1747
- ref: Pn,
1789
+ ref: Gn,
1748
1790
  type: "button",
1749
1791
  class: "gd-contract-template-designer__immersive-exit",
1750
1792
  "aria-label": "退出沉浸写作",
1751
- onClick: io
1793
+ onClick: So
1752
1794
  }, [
1753
- h(b(zt), { "aria-hidden": "true" }),
1754
- t[32] ||= m("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
1755
- t[33] ||= m("kbd", null, "Esc", -1)
1756
- ], 512)) : p("", !0),
1757
- O.value ? (v(), St("section", Vt, [h(b(Pt), {
1758
- type: Lr.value ? "success" : "error",
1759
- message: Rr.value,
1795
+ g(x(Bt), { "aria-hidden": "true" }),
1796
+ t[32] ||= h("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
1797
+ t[33] ||= h("kbd", null, "Esc", -1)
1798
+ ], 512)) : m("", !0),
1799
+ k.value ? (y(), St("section", Ht, [g(x(Ft), {
1800
+ type: Yr.value ? "success" : "error",
1801
+ message: Xr.value,
1760
1802
  "show-icon": ""
1761
- }, null, 8, ["type", "message"]), k.value.length ? (v(), St("div", Ht, [(v(!0), St(yt, null, Ot(k.value, (e) => (v(), St("button", {
1803
+ }, null, 8, ["type", "message"]), A.value.length ? (y(), St("div", Ut, [(y(!0), St(bt, null, Ot(A.value, (e) => (y(), St("button", {
1762
1804
  key: `${e.id}-${e.message}`,
1763
1805
  type: "button",
1764
1806
  class: "gd-contract-template-designer__validation-item",
1765
- onClick: (t) => Io(e)
1766
- }, [m("span", null, kt(e.message), 1), m("small", null, kt(Lo(e)), 1)], 8, Ut))), 128))])) : p("", !0)])) : p("", !0),
1767
- m("div", {
1807
+ onClick: (t) => $o(e)
1808
+ }, [h("span", null, kt(e.message), 1), h("small", null, kt(es(e)), 1)], 8, Wt))), 128))])) : m("", !0)])) : m("", !0),
1809
+ h("div", {
1768
1810
  ref_key: "canvasElement",
1769
- ref: an,
1811
+ ref: sn,
1770
1812
  class: "gd-contract-template-designer__canvas"
1771
- }, [(v(!0), St(yt, null, Ot(T.value.pages, (e, n) => (v(), xt(Ie, {
1772
- key: `${w.value}:${e.id}`,
1813
+ }, [(y(!0), St(bt, null, Ot(E.value.pages, (e, n) => (y(), p(Le, {
1814
+ key: `${T.value}:${e.id}`,
1773
1815
  ref_for: !0,
1774
- ref: (t) => zi(e.id, t),
1816
+ ref: (t) => na(e.id, t),
1775
1817
  page: e,
1776
1818
  "page-index": n,
1777
- "page-size": Ji(e),
1778
- "page-decorations": T.value.pageDecorations,
1779
- "total-pages": T.value.pages.length,
1780
- variables: T.value.variables,
1781
- "selected-variable-key": E.value,
1782
- active: D.value === e.id,
1819
+ "page-size": da(e),
1820
+ "page-decorations": E.value.pageDecorations,
1821
+ "total-pages": E.value.pages.length,
1822
+ variables: E.value.variables,
1823
+ "selected-variable-key": D.value,
1824
+ active: O.value === e.id,
1783
1825
  readonly: s.readonly,
1784
1826
  disabled: s.disabled,
1785
- zoom: j.value,
1786
- "process-image-file": fa,
1787
- "search-query": b(Cr),
1788
- "search-match-case": b(vr),
1789
- "active-search-match": b(xr)?.pageId === e.id ? b(xr) : void 0,
1790
- onPageUpdate: qi,
1791
- onVariableDrop: ya,
1792
- onVariableSelect: ba,
1793
- onEditorFocus: t[18] ||= (e) => bo(e, !1),
1794
- onEditorReady: b(q),
1795
- onEditorStateChange: ws,
1796
- onEditorContextMenu: ss,
1797
- onWordPaste: da,
1827
+ zoom: M.value,
1828
+ "process-image-file": ka,
1829
+ "search-query": x(Fr),
1830
+ "search-match-case": x(Ar),
1831
+ "active-search-match": x(Nr)?.pageId === e.id ? x(Nr) : void 0,
1832
+ "get-scroll-container": cn,
1833
+ onPageUpdate: ua,
1834
+ onVariableDrop: Ia,
1835
+ onVariableSelect: La,
1836
+ onEditorFocus: t[18] ||= (e) => Lo(e, !1),
1837
+ onEditorReady: x(bi),
1838
+ onCompositionEnd: x(bi),
1839
+ onPageLayoutChange: x(bi),
1840
+ onEditorStateChange: Vs,
1841
+ onEditorContextMenu: ws,
1842
+ onWordPaste: Oa,
1798
1843
  onVariableMoveBlocked: t[19] ||= (e) => H.value = "变量只能在当前页内移动,跨页移动尚未支持。"
1799
1844
  }, null, 8, [
1800
1845
  "page",
@@ -1811,41 +1856,43 @@ var Vt = {
1811
1856
  "search-query",
1812
1857
  "search-match-case",
1813
1858
  "active-search-match",
1814
- "onEditorReady"
1859
+ "onEditorReady",
1860
+ "onCompositionEnd",
1861
+ "onPageLayoutChange"
1815
1862
  ]))), 128))], 512)
1816
1863
  ], 512),
1817
- h(mt, {
1818
- collapsed: Nn.value,
1864
+ g(ht, {
1865
+ collapsed: Un.value,
1819
1866
  readonly: s.readonly,
1820
1867
  disabled: s.disabled,
1821
- "body-control-tool-items": ii.value,
1868
+ "body-control-tool-items": gi.value,
1822
1869
  "selected-variable": K.value,
1823
- variables: T.value.variables,
1824
- "current-variable-font-family": Si.value,
1825
- "font-family-select-options": qr.value,
1826
- "text-align-options": b(Jr),
1827
- "border-style-options": Xr,
1828
- "object-fit-options": Zr,
1829
- "selected-variable-width-max": gi.value,
1830
- "selected-variable-height-max": _i.value,
1831
- "min-font-size": $t,
1832
- "max-font-size": en,
1833
- "default-multiline-rows": b(3),
1834
- onToggle: t[20] ||= (e) => Nn.value = !Nn.value,
1835
- onVariableDragStart: Ua,
1836
- onInsertVariable: La,
1837
- onDuplicateVariable: Fa,
1838
- onRemoveVariable: Na,
1839
- onPatchVariable: Sa,
1840
- onRenameVariable: Ca,
1841
- onPatchStyle: Oa,
1842
- onPatchMultiline: ja,
1843
- onPatchRows: Ma,
1844
- onPatchFontFamily: ka,
1845
- onPatchFontSize: Aa,
1846
- onPatchTextAlign: Ta,
1847
- onPatchBorderStyle: Ea,
1848
- onPatchObjectFit: Da
1870
+ variables: E.value.variables,
1871
+ "current-variable-font-family": Li.value,
1872
+ "font-family-select-options": ai.value,
1873
+ "text-align-options": x(oi),
1874
+ "border-style-options": ci,
1875
+ "object-fit-options": li,
1876
+ "selected-variable-width-max": ji.value,
1877
+ "selected-variable-height-max": Mi.value,
1878
+ "min-font-size": tn,
1879
+ "max-font-size": nn,
1880
+ "default-multiline-rows": x(3),
1881
+ onToggle: t[20] ||= (e) => Un.value = !Un.value,
1882
+ onVariableDragStart: oo,
1883
+ onInsertVariable: eo,
1884
+ onDuplicateVariable: Qa,
1885
+ onRemoveVariable: Xa,
1886
+ onPatchVariable: za,
1887
+ onRenameVariable: Ba,
1888
+ onPatchStyle: Ga,
1889
+ onPatchMultiline: Ja,
1890
+ onPatchRows: Ya,
1891
+ onPatchFontFamily: Ka,
1892
+ onPatchFontSize: qa,
1893
+ onPatchTextAlign: Ha,
1894
+ onPatchBorderStyle: Ua,
1895
+ onPatchObjectFit: Wa
1849
1896
  }, null, 8, [
1850
1897
  "collapsed",
1851
1898
  "readonly",
@@ -1861,20 +1908,20 @@ var Vt = {
1861
1908
  "default-multiline-rows"
1862
1909
  ])
1863
1910
  ], 2),
1864
- Nt(h(ht, {
1911
+ Pt(g(gt, {
1865
1912
  ref_key: "pageDecorationsStudioElement",
1866
- ref: cn,
1867
- id: ln,
1913
+ ref: pn,
1914
+ id: mn,
1868
1915
  open: F.value,
1869
- decorations: T.value.pageDecorations,
1870
- variables: T.value.variables,
1871
- "font-family-options": qr.value,
1916
+ decorations: E.value.pageDecorations,
1917
+ variables: E.value.variables,
1918
+ "font-family-options": ai.value,
1872
1919
  readonly: s.readonly,
1873
1920
  disabled: s.disabled,
1874
- "active-tab": Fn.value,
1875
- "onUpdate:activeTab": t[21] ||= (e) => Fn.value = e,
1876
- onChange: wa,
1877
- onClose: wo
1921
+ "active-tab": Kn.value,
1922
+ "onUpdate:activeTab": t[21] ||= (e) => Kn.value = e,
1923
+ onChange: Va,
1924
+ onClose: Vo
1878
1925
  }, null, 8, [
1879
1926
  "open",
1880
1927
  "decorations",
@@ -1883,71 +1930,71 @@ var Vt = {
1883
1930
  "readonly",
1884
1931
  "disabled",
1885
1932
  "active-tab"
1886
- ]), [[jt, F.value]]),
1887
- (v(), xt(bt, { to: "body" }, [
1888
- B.value ? (v(), xt(Le, {
1933
+ ]), [[Mt, F.value]]),
1934
+ (y(), p(xt, { to: "body" }, [
1935
+ B.value ? (y(), p(Re, {
1889
1936
  key: 0,
1890
1937
  ref_key: "tableContextMenuElement",
1891
- ref: rr,
1938
+ ref: mr,
1892
1939
  capabilities: B.value.capabilities,
1893
1940
  "active-alignment": B.value.activeAlignment,
1894
1941
  style: Tt({
1895
1942
  left: `${B.value.x}px`,
1896
1943
  top: `${B.value.y}px`
1897
1944
  }),
1898
- onExecute: Ds,
1899
- onKeydown: Os
1945
+ onExecute: Ws,
1946
+ onKeydown: Gs
1900
1947
  }, null, 8, [
1901
1948
  "capabilities",
1902
1949
  "active-alignment",
1903
1950
  "style"
1904
- ])) : p("", !0),
1905
- V.value ? (v(), xt(Ge, {
1951
+ ])) : m("", !0),
1952
+ V.value ? (y(), p(Ke, {
1906
1953
  key: 1,
1907
1954
  ref_key: "imageContextMenuElement",
1908
- ref: ir,
1909
- width: ar.value,
1910
- "onUpdate:width": t[22] ||= (e) => ar.value = e,
1911
- height: or.value,
1912
- "onUpdate:height": t[23] ||= (e) => or.value = e,
1955
+ ref: hr,
1956
+ width: gr.value,
1957
+ "onUpdate:width": t[22] ||= (e) => gr.value = e,
1958
+ height: _r.value,
1959
+ "onUpdate:height": t[23] ||= (e) => _r.value = e,
1913
1960
  x: V.value.x,
1914
1961
  y: V.value.y,
1915
1962
  readonly: W.value,
1916
- onRestore: os,
1917
- onApply: as,
1918
- onKeydown: As
1963
+ onRestore: Cs,
1964
+ onApply: Ss,
1965
+ onKeydown: qs
1919
1966
  }, null, 8, [
1920
1967
  "width",
1921
1968
  "height",
1922
1969
  "x",
1923
1970
  "y",
1924
1971
  "readonly"
1925
- ])) : p("", !0),
1926
- R.value ? (v(), xt(Ue, {
1972
+ ])) : m("", !0),
1973
+ R.value ? (y(), p(We, {
1927
1974
  key: 2,
1928
1975
  ref_key: "textContextMenuElement",
1929
- ref: Yn,
1930
- "bind-open": tr.value,
1931
- "onUpdate:bindOpen": t[24] ||= (e) => tr.value = e,
1932
- "bind-keyword": nr.value,
1933
- "onUpdate:bindKeyword": t[25] ||= (e) => nr.value = e,
1976
+ ref: or,
1977
+ "bind-open": fr.value,
1978
+ "onUpdate:bindOpen": t[24] ||= (e) => fr.value = e,
1979
+ "bind-keyword": pr.value,
1980
+ "onUpdate:bindKeyword": t[25] ||= (e) => pr.value = e,
1934
1981
  x: R.value.x,
1935
1982
  y: R.value.y,
1936
1983
  "has-selection": R.value.hasSelection,
1937
1984
  "editor-state": J.value,
1938
- "current-editor-text-color": xi.value,
1939
- "body-control-tool-items": ii.value,
1940
- "text-menu-bindable-variables": hi.value,
1941
- "variables-count": T.value.variables.length,
1942
- "resolve-bind-variable-type-label": Va,
1943
- onCommand: Wi,
1944
- onClipboard: Gi,
1945
- onAddPage: va,
1946
- onInsertVariable: Ra,
1947
- onBindVariable: Ba,
1948
- onOpenBindPanel: Ha,
1949
- onKeydown: ks,
1950
- onPatchColor: Yo
1985
+ "current-editor-text-color": Ii.value,
1986
+ "body-control-tool-items": gi.value,
1987
+ "text-menu-bindable-variables": Ai.value,
1988
+ "variables-count": E.value.variables.length,
1989
+ "resolve-bind-variable-type-label": io,
1990
+ onCommand: sa,
1991
+ onClipboard: ca,
1992
+ onAddPage: Fa,
1993
+ onInsertVariable: to,
1994
+ onBindVariable: ro,
1995
+ onOpenBindPanel: ao,
1996
+ onKeydown: Ks,
1997
+ onPatchColor: fs
1951
1998
  }, null, 8, [
1952
1999
  "bind-open",
1953
2000
  "bind-keyword",
@@ -1959,28 +2006,28 @@ var Vt = {
1959
2006
  "body-control-tool-items",
1960
2007
  "text-menu-bindable-variables",
1961
2008
  "variables-count"
1962
- ])) : p("", !0),
1963
- z.value ? (v(), xt(We, {
2009
+ ])) : m("", !0),
2010
+ z.value ? (y(), p(Ge, {
1964
2011
  key: 3,
1965
2012
  ref_key: "textBubbleElement",
1966
- ref: Xn,
2013
+ ref: sr,
1967
2014
  x: z.value.x,
1968
2015
  y: z.value.y,
1969
2016
  "editor-state": J.value,
1970
- "font-size-preset-options": Ci.value,
1971
- "current-editor-font-size": bi.value,
1972
- "editor-font-size-search-value": Rn.value,
1973
- "current-editor-text-color": xi.value,
1974
- "text-align-options": b(Jr),
2017
+ "font-size-preset-options": Ri.value,
2018
+ "current-editor-font-size": Fi.value,
2019
+ "editor-font-size-search-value": Yn.value,
2020
+ "current-editor-text-color": Ii.value,
2021
+ "text-align-options": x(oi),
1975
2022
  onCommand: Q,
1976
- onPatchFontSize: Ko,
1977
- onPatchTextAlign: Wo,
1978
- onPatchColor: Yo,
1979
- onFontSizeSearch: Xo,
1980
- onFontSizeCommit: Zo,
1981
- onFontSizeDropdownChange: $o,
1982
- onFontSizeKeydown: Qo,
1983
- onMore: vs
2023
+ onPatchFontSize: ls,
2024
+ onPatchTextAlign: ss,
2025
+ onPatchColor: fs,
2026
+ onFontSizeSearch: ps,
2027
+ onFontSizeCommit: ms,
2028
+ onFontSizeDropdownChange: gs,
2029
+ onFontSizeKeydown: hs,
2030
+ onMore: Fs
1984
2031
  }, null, 8, [
1985
2032
  "x",
1986
2033
  "y",
@@ -1990,29 +2037,29 @@ var Vt = {
1990
2037
  "editor-font-size-search-value",
1991
2038
  "current-editor-text-color",
1992
2039
  "text-align-options"
1993
- ])) : p("", !0)
2040
+ ])) : m("", !0)
1994
2041
  ])),
1995
- m("input", {
2042
+ h("input", {
1996
2043
  ref_key: "imageFileInputElement",
1997
- ref: fn,
2044
+ ref: _n,
1998
2045
  class: "gd-contract-template-designer__hidden-file-input",
1999
2046
  type: "file",
2000
2047
  accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
2001
2048
  tabindex: "-1",
2002
2049
  "aria-hidden": "true",
2003
- onChange: ha
2050
+ onChange: Ma
2004
2051
  }, null, 544),
2005
- m("span", Wt, kt(H.value), 1),
2006
- h(Ke, {
2007
- open: wn.value,
2008
- "onUpdate:open": t[26] ||= (e) => wn.value = e,
2009
- "preview-pages": Nr.value,
2010
- "preview-file-groups": Pr.value,
2011
- "preview-active-group": Fr.value,
2012
- "preview-snapshot": Tn.value,
2052
+ h("span", Gt, kt(H.value), 1),
2053
+ g(qe, {
2054
+ open: Pn.value,
2055
+ "onUpdate:open": t[26] ||= (e) => Pn.value = e,
2056
+ "preview-pages": Gr.value,
2057
+ "preview-file-groups": Kr.value,
2058
+ "preview-active-group": qr.value,
2059
+ "preview-snapshot": Fn.value,
2013
2060
  "font-base-url": s.contractFontBaseUrl,
2014
- onCancel: so,
2015
- onSelectFile: t[27] ||= (e) => Dn.value = e
2061
+ onCancel: To,
2062
+ onSelectFile: t[27] ||= (e) => Ln.value = e
2016
2063
  }, null, 8, [
2017
2064
  "open",
2018
2065
  "preview-pages",
@@ -2021,31 +2068,31 @@ var Vt = {
2021
2068
  "preview-snapshot",
2022
2069
  "font-base-url"
2023
2070
  ]),
2024
- h(qe, {
2025
- open: On.value,
2026
- "onUpdate:open": t[28] ||= (e) => On.value = e,
2027
- json: kn.value,
2028
- onCancel: uo
2071
+ g(Je, {
2072
+ open: Rn.value,
2073
+ "onUpdate:open": t[28] ||= (e) => Rn.value = e,
2074
+ json: zn.value,
2075
+ onCancel: Oo
2029
2076
  }, null, 8, ["open", "json"]),
2030
- h(Je, {
2031
- open: An.value,
2032
- "onUpdate:open": t[29] ||= (e) => An.value = e,
2033
- data: jn.value,
2034
- "file-name": Mr.value?.name,
2035
- onCancel: mo
2077
+ g(Ye, {
2078
+ open: Bn.value,
2079
+ "onUpdate:open": t[29] ||= (e) => Bn.value = e,
2080
+ data: Vn.value,
2081
+ "file-name": Wr.value?.name,
2082
+ onCancel: jo
2036
2083
  }, null, 8, [
2037
2084
  "open",
2038
2085
  "data",
2039
2086
  "file-name"
2040
2087
  ]),
2041
- h(Ye, {
2042
- open: Un.value,
2043
- "onUpdate:open": t[30] ||= (e) => Un.value = e,
2088
+ g(Xe, {
2089
+ open: er.value,
2090
+ "onUpdate:open": t[30] ||= (e) => er.value = e,
2044
2091
  disabled: W.value,
2045
- onInsert: Vi
2092
+ onInsert: ia
2046
2093
  }, null, 8, ["open", "disabled"])
2047
2094
  ], 38));
2048
2095
  }
2049
2096
  });
2050
2097
  //#endregion
2051
- export { nn as default };
2098
+ export { an as default };