@guodun/antdv 1.7.12 → 1.7.14

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