@guodun/antdv 1.4.3 → 1.4.5

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