@rhc-office/sdk 6.6.266 → 6.6.351
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/api/annotation-tool.d.ts +162 -102
- package/dist/api/annotation-tool.d.ts.map +1 -1
- package/dist/api/callbacks.d.ts +32 -6
- package/dist/api/callbacks.d.ts.map +1 -1
- package/dist/api/document-sdk.d.ts +6 -5
- package/dist/api/document-sdk.d.ts.map +1 -1
- package/dist/api/document-tool.d.ts +16 -11
- package/dist/api/document-tool.d.ts.map +1 -1
- package/dist/api/menu-visibility.d.ts +6 -1
- package/dist/api/menu-visibility.d.ts.map +1 -1
- package/dist/api/page-arrange-tool.d.ts +28 -0
- package/dist/api/page-arrange-tool.d.ts.map +1 -0
- package/dist/api/security-tool.d.ts +21 -0
- package/dist/api/security-tool.d.ts.map +1 -0
- package/dist/api/ui-tool.d.ts +19 -0
- package/dist/api/ui-tool.d.ts.map +1 -1
- package/dist/browser/document-viewer.js +1 -1
- package/dist/browser/document-viewer.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +730 -501
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/tools/AnnotationToolImpl.d.ts +25 -0
- package/dist/tools/AnnotationToolImpl.d.ts.map +1 -0
- package/dist/tools/CryptoToolImpl.d.ts +9 -0
- package/dist/tools/CryptoToolImpl.d.ts.map +1 -0
- package/dist/tools/DigitalSignToolImpl.d.ts +27 -0
- package/dist/tools/DigitalSignToolImpl.d.ts.map +1 -0
- package/dist/tools/DocumentToolImpl.d.ts +1 -0
- package/dist/tools/DocumentToolImpl.d.ts.map +1 -1
- package/dist/tools/PageArrangeToolImpl.d.ts +21 -0
- package/dist/tools/PageArrangeToolImpl.d.ts.map +1 -0
- package/dist/tools/SecurityToolImpl.d.ts +12 -0
- package/dist/tools/SecurityToolImpl.d.ts.map +1 -0
- package/dist/tools/SignServerToolImpl.d.ts +19 -0
- package/dist/tools/SignServerToolImpl.d.ts.map +1 -0
- package/dist/tools/SymbologyToolImpl.d.ts +8 -0
- package/dist/tools/SymbologyToolImpl.d.ts.map +1 -0
- package/dist/tools/TemplateSignToolImpl.d.ts +13 -0
- package/dist/tools/TemplateSignToolImpl.d.ts.map +1 -0
- package/dist/tools/UIToolImpl.d.ts +13 -0
- package/dist/tools/UIToolImpl.d.ts.map +1 -1
- package/dist/tools/index.d.ts +8 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/viewer/AdapterProtocol.d.ts +3 -1
- package/dist/viewer/AdapterProtocol.d.ts.map +1 -1
- package/dist/viewer/BridgeToolAdapter.d.ts +1 -0
- package/dist/viewer/BridgeToolAdapter.d.ts.map +1 -1
- package/dist/viewer/DocumentSDK.d.ts +7 -5
- package/dist/viewer/DocumentSDK.d.ts.map +1 -1
- package/dist/viewer/ReaderBridgeClient.d.ts +3 -0
- package/dist/viewer/ReaderBridgeClient.d.ts.map +1 -1
- package/dist/viewer/ReaderConfiguration.d.ts +0 -1
- package/dist/viewer/ReaderConfiguration.d.ts.map +1 -1
- package/dist/viewer/ReaderStateStore.d.ts +2 -0
- package/dist/viewer/ReaderStateStore.d.ts.map +1 -1
- package/dist/viewer/SdkCallbackRegistry.d.ts +5 -2
- package/dist/viewer/SdkCallbackRegistry.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/annotation-tool.ts +232 -146
- package/src/api/callbacks.ts +48 -7
- package/src/api/document-sdk.ts +9 -5
- package/src/api/document-tool.ts +25 -13
- package/src/api/menu-visibility.ts +10 -1
- package/src/api/page-arrange-tool.ts +67 -0
- package/src/api/security-tool.ts +32 -0
- package/src/api/ui-tool.ts +33 -0
- package/src/index.ts +3 -0
- package/src/tools/AnnotationToolImpl.ts +169 -0
- package/src/tools/CryptoToolImpl.ts +27 -0
- package/src/tools/DigitalSignToolImpl.ts +166 -0
- package/src/tools/DocumentToolImpl.ts +32 -6
- package/src/tools/PageArrangeToolImpl.ts +99 -0
- package/src/tools/SecurityToolImpl.ts +48 -0
- package/src/tools/SignServerToolImpl.ts +92 -0
- package/src/tools/SymbologyToolImpl.ts +34 -0
- package/src/tools/TemplateSignToolImpl.ts +51 -0
- package/src/tools/UIToolImpl.ts +98 -12
- package/src/tools/index.ts +8 -1
- package/src/viewer/AdapterProtocol.ts +4 -0
- package/src/viewer/BridgeToolAdapter.ts +11 -2
- package/src/viewer/DocumentSDK.ts +71 -144
- package/src/viewer/ReaderBridgeClient.ts +9 -0
- package/src/viewer/ReaderConfiguration.ts +0 -2
- package/src/viewer/ReaderStateStore.ts +13 -1
- package/src/viewer/SdkCallbackRegistry.ts +84 -6
- package/dist/tools/Phase1ToolPlaceholder.d.ts +0 -5
- package/dist/tools/Phase1ToolPlaceholder.d.ts.map +0 -1
- package/src/tools/Phase1ToolPlaceholder.ts +0 -35
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var W = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.COMPACT = "compact", t.HIDE = "none", t))(W || {});
|
|
2
|
+
const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", v = {
|
|
3
3
|
defaults: {
|
|
4
4
|
bjca: {
|
|
5
5
|
pin: ""
|
|
6
6
|
},
|
|
7
7
|
deviceType: "client",
|
|
8
|
-
edgePosition:
|
|
8
|
+
edgePosition: L,
|
|
9
9
|
kol: {
|
|
10
10
|
appId: "",
|
|
11
11
|
appName: "",
|
|
@@ -17,8 +17,8 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", b = "__RHC_OFFICE_DIGIT
|
|
|
17
17
|
pin: "",
|
|
18
18
|
usbKeyType: 14
|
|
19
19
|
},
|
|
20
|
-
rsaMode:
|
|
21
|
-
signatureType:
|
|
20
|
+
rsaMode: U,
|
|
21
|
+
signatureType: F
|
|
22
22
|
},
|
|
23
23
|
signServer: {
|
|
24
24
|
authSource: "Password",
|
|
@@ -38,216 +38,340 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", b = "__RHC_OFFICE_DIGIT
|
|
|
38
38
|
usbKeyType: 14
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
},
|
|
41
|
+
}, N = (t) => ({
|
|
42
42
|
bjca: {
|
|
43
|
-
pin:
|
|
43
|
+
pin: t.bjca.pin
|
|
44
44
|
},
|
|
45
|
-
deviceType:
|
|
46
|
-
edgePosition:
|
|
45
|
+
deviceType: t.deviceType,
|
|
46
|
+
edgePosition: t.edgePosition,
|
|
47
47
|
kol: {
|
|
48
|
-
appId:
|
|
49
|
-
appName:
|
|
50
|
-
pin:
|
|
51
|
-
serviceUrl:
|
|
52
|
-
token:
|
|
48
|
+
appId: t.kol.appId,
|
|
49
|
+
appName: t.kol.appName,
|
|
50
|
+
pin: t.kol.pin,
|
|
51
|
+
serviceUrl: t.kol.serviceUrl,
|
|
52
|
+
token: t.kol.token
|
|
53
53
|
},
|
|
54
54
|
plugin: {
|
|
55
|
-
pin:
|
|
56
|
-
usbKeyType:
|
|
55
|
+
pin: t.plugin.pin,
|
|
56
|
+
usbKeyType: t.plugin.usbKeyType
|
|
57
57
|
},
|
|
58
|
-
rsaMode:
|
|
59
|
-
signatureType:
|
|
60
|
-
}),
|
|
61
|
-
authSource:
|
|
62
|
-
defaultLogin:
|
|
63
|
-
defaultPassword:
|
|
64
|
-
defaultServer:
|
|
58
|
+
rsaMode: t.rsaMode,
|
|
59
|
+
signatureType: t.signatureType
|
|
60
|
+
}), B = (t) => ({
|
|
61
|
+
authSource: t.authSource,
|
|
62
|
+
defaultLogin: t.defaultLogin,
|
|
63
|
+
defaultPassword: t.defaultPassword,
|
|
64
|
+
defaultServer: t.defaultServer,
|
|
65
65
|
kol: {
|
|
66
|
-
appId:
|
|
67
|
-
appName:
|
|
68
|
-
serviceUrl:
|
|
69
|
-
token:
|
|
66
|
+
appId: t.kol.appId,
|
|
67
|
+
appName: t.kol.appName,
|
|
68
|
+
serviceUrl: t.kol.serviceUrl,
|
|
69
|
+
token: t.kol.token
|
|
70
70
|
},
|
|
71
|
-
macAddress:
|
|
72
|
-
token:
|
|
71
|
+
macAddress: t.macAddress,
|
|
72
|
+
token: t.token,
|
|
73
73
|
usbKey: {
|
|
74
|
-
checkCertificateBinding:
|
|
75
|
-
usbKeyType:
|
|
74
|
+
checkCertificateBinding: t.usbKey.checkCertificateBinding,
|
|
75
|
+
usbKeyType: t.usbKey.usbKeyType
|
|
76
76
|
}
|
|
77
|
-
}),
|
|
78
|
-
defaults:
|
|
79
|
-
signServer:
|
|
80
|
-
}),
|
|
81
|
-
defaults:
|
|
82
|
-
...
|
|
83
|
-
bjca:
|
|
84
|
-
kol:
|
|
85
|
-
plugin:
|
|
77
|
+
}), m = (t) => ({
|
|
78
|
+
defaults: N(t.defaults),
|
|
79
|
+
signServer: B(t.signServer)
|
|
80
|
+
}), x = (t) => ({
|
|
81
|
+
defaults: t.defaults ? {
|
|
82
|
+
...t.defaults,
|
|
83
|
+
bjca: t.defaults.bjca ? { ...t.defaults.bjca } : void 0,
|
|
84
|
+
kol: t.defaults.kol ? { ...t.defaults.kol } : void 0,
|
|
85
|
+
plugin: t.defaults.plugin ? { ...t.defaults.plugin } : void 0
|
|
86
86
|
} : void 0,
|
|
87
|
-
signServer:
|
|
88
|
-
...
|
|
89
|
-
kol:
|
|
90
|
-
usbKey:
|
|
87
|
+
signServer: t.signServer ? {
|
|
88
|
+
...t.signServer,
|
|
89
|
+
kol: t.signServer.kol ? { ...t.signServer.kol } : void 0,
|
|
90
|
+
usbKey: t.signServer.usbKey ? { ...t.signServer.usbKey } : void 0
|
|
91
91
|
} : void 0
|
|
92
|
-
}),
|
|
92
|
+
}), $ = (t, n) => n ? {
|
|
93
93
|
bjca: {
|
|
94
|
-
pin:
|
|
94
|
+
pin: n.bjca?.pin ?? t.bjca.pin
|
|
95
95
|
},
|
|
96
|
-
deviceType:
|
|
97
|
-
edgePosition:
|
|
96
|
+
deviceType: n.deviceType ?? t.deviceType,
|
|
97
|
+
edgePosition: n.edgePosition ?? t.edgePosition,
|
|
98
98
|
kol: {
|
|
99
|
-
appId:
|
|
100
|
-
appName:
|
|
101
|
-
pin:
|
|
102
|
-
serviceUrl:
|
|
103
|
-
token:
|
|
99
|
+
appId: n.kol?.appId ?? t.kol.appId,
|
|
100
|
+
appName: n.kol?.appName ?? t.kol.appName,
|
|
101
|
+
pin: n.kol?.pin ?? t.kol.pin,
|
|
102
|
+
serviceUrl: n.kol?.serviceUrl ?? t.kol.serviceUrl,
|
|
103
|
+
token: n.kol?.token ?? t.kol.token
|
|
104
104
|
},
|
|
105
105
|
plugin: {
|
|
106
|
-
pin:
|
|
107
|
-
usbKeyType:
|
|
106
|
+
pin: n.plugin?.pin ?? t.plugin.pin,
|
|
107
|
+
usbKeyType: n.plugin?.usbKeyType ?? t.plugin.usbKeyType
|
|
108
108
|
},
|
|
109
|
-
rsaMode:
|
|
110
|
-
signatureType:
|
|
111
|
-
} :
|
|
112
|
-
authSource:
|
|
113
|
-
defaultLogin:
|
|
114
|
-
defaultPassword:
|
|
115
|
-
defaultServer:
|
|
109
|
+
rsaMode: n.rsaMode ?? t.rsaMode,
|
|
110
|
+
signatureType: n.signatureType ?? t.signatureType
|
|
111
|
+
} : N(t), j = (t, n) => n ? {
|
|
112
|
+
authSource: n.authSource ?? t.authSource,
|
|
113
|
+
defaultLogin: n.defaultLogin ?? t.defaultLogin,
|
|
114
|
+
defaultPassword: n.defaultPassword ?? t.defaultPassword,
|
|
115
|
+
defaultServer: n.defaultServer ?? t.defaultServer,
|
|
116
116
|
kol: {
|
|
117
|
-
appId:
|
|
118
|
-
appName:
|
|
119
|
-
serviceUrl:
|
|
120
|
-
token:
|
|
117
|
+
appId: n.kol?.appId ?? t.kol.appId,
|
|
118
|
+
appName: n.kol?.appName ?? t.kol.appName,
|
|
119
|
+
serviceUrl: n.kol?.serviceUrl ?? t.kol.serviceUrl,
|
|
120
|
+
token: n.kol?.token ?? t.kol.token
|
|
121
121
|
},
|
|
122
|
-
macAddress:
|
|
123
|
-
token:
|
|
122
|
+
macAddress: n.macAddress ?? t.macAddress,
|
|
123
|
+
token: n.token ?? t.token,
|
|
124
124
|
usbKey: {
|
|
125
|
-
checkCertificateBinding:
|
|
126
|
-
usbKeyType:
|
|
125
|
+
checkCertificateBinding: n.usbKey?.checkCertificateBinding ?? t.usbKey.checkCertificateBinding,
|
|
126
|
+
usbKeyType: n.usbKey?.usbKeyType ?? t.usbKey.usbKeyType
|
|
127
127
|
}
|
|
128
|
-
} :
|
|
129
|
-
defaults:
|
|
130
|
-
signServer:
|
|
131
|
-
}),
|
|
132
|
-
defaults:
|
|
133
|
-
...n.defaults,
|
|
128
|
+
} : B(t), V = (t, n) => ({
|
|
129
|
+
defaults: $(t.defaults, n.defaults),
|
|
130
|
+
signServer: j(t.signServer, n.signServer)
|
|
131
|
+
}), Y = (t, n) => ({
|
|
132
|
+
defaults: t.defaults || n.defaults ? {
|
|
134
133
|
...t.defaults,
|
|
134
|
+
...n.defaults,
|
|
135
135
|
bjca: {
|
|
136
|
-
...
|
|
137
|
-
...
|
|
136
|
+
...t.defaults?.bjca ?? {},
|
|
137
|
+
...n.defaults?.bjca ?? {}
|
|
138
138
|
},
|
|
139
139
|
kol: {
|
|
140
|
-
...
|
|
141
|
-
...
|
|
140
|
+
...t.defaults?.kol ?? {},
|
|
141
|
+
...n.defaults?.kol ?? {}
|
|
142
142
|
},
|
|
143
143
|
plugin: {
|
|
144
|
-
...
|
|
145
|
-
...
|
|
144
|
+
...t.defaults?.plugin ?? {},
|
|
145
|
+
...n.defaults?.plugin ?? {}
|
|
146
146
|
}
|
|
147
147
|
} : void 0,
|
|
148
|
-
signServer:
|
|
149
|
-
...n.signServer,
|
|
148
|
+
signServer: t.signServer || n.signServer ? {
|
|
150
149
|
...t.signServer,
|
|
150
|
+
...n.signServer,
|
|
151
151
|
kol: {
|
|
152
|
-
...
|
|
153
|
-
...
|
|
152
|
+
...t.signServer?.kol ?? {},
|
|
153
|
+
...n.signServer?.kol ?? {}
|
|
154
154
|
},
|
|
155
155
|
usbKey: {
|
|
156
|
-
...
|
|
157
|
-
...
|
|
156
|
+
...t.signServer?.usbKey ?? {},
|
|
157
|
+
...n.signServer?.usbKey ?? {}
|
|
158
158
|
}
|
|
159
159
|
} : void 0
|
|
160
|
-
}),
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
current:
|
|
164
|
-
defaults:
|
|
160
|
+
}), X = () => globalThis, b = () => {
|
|
161
|
+
const t = X();
|
|
162
|
+
return t[S] || (t[S] = {
|
|
163
|
+
current: m(v),
|
|
164
|
+
defaults: m(v),
|
|
165
165
|
overrides: {}
|
|
166
|
-
}),
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
},
|
|
171
|
-
const
|
|
172
|
-
return
|
|
173
|
-
},
|
|
174
|
-
const
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
},
|
|
180
|
-
EDGE_POSITION:
|
|
181
|
-
RSA_MODE:
|
|
182
|
-
SIGNATURE_TYPE:
|
|
183
|
-
},
|
|
184
|
-
if (
|
|
185
|
-
return
|
|
186
|
-
},
|
|
166
|
+
}), t[S];
|
|
167
|
+
}, dt = () => b().current, ut = (t) => {
|
|
168
|
+
const n = b();
|
|
169
|
+
return n.defaults = m(t), n.current = V(n.defaults, n.overrides), n.current;
|
|
170
|
+
}, lt = (t) => {
|
|
171
|
+
const n = b();
|
|
172
|
+
return n.current = m(t), n.overrides = x(t), n.current;
|
|
173
|
+
}, ct = (t) => {
|
|
174
|
+
const n = b();
|
|
175
|
+
return n.overrides = Y(n.overrides, x(t)), n.current = V(n.current, t), n.current;
|
|
176
|
+
}, ht = (t) => {
|
|
177
|
+
const n = b();
|
|
178
|
+
return t && (n.defaults = m(t)), n.overrides = {}, n.current = m(n.defaults), n.current;
|
|
179
|
+
}, gt = {
|
|
180
|
+
EDGE_POSITION: L,
|
|
181
|
+
RSA_MODE: U,
|
|
182
|
+
SIGNATURE_TYPE: F
|
|
183
|
+
}, k = (t) => {
|
|
184
|
+
if (t.length !== 0)
|
|
185
|
+
return t.length === 1 ? t[0] : t;
|
|
186
|
+
}, d = (t, n, e) => new Proxy(
|
|
187
187
|
{},
|
|
188
188
|
{
|
|
189
189
|
get: (i, r) => {
|
|
190
190
|
if (r === "then")
|
|
191
191
|
return;
|
|
192
192
|
if (typeof r == "symbol")
|
|
193
|
-
return r === Symbol.toStringTag ?
|
|
194
|
-
const a =
|
|
195
|
-
return a ? (...
|
|
193
|
+
return r === Symbol.toStringTag ? t : void 0;
|
|
194
|
+
const a = n[r];
|
|
195
|
+
return a ? (...s) => {
|
|
196
196
|
if (a.kind === "callbackRegister") {
|
|
197
|
-
a.callback?.(e.callbacks,
|
|
197
|
+
a.callback?.(e.callbacks, s);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
200
|
if (a.kind === "stateGetter")
|
|
201
|
-
return a.state?.(e.state.snapshot(),
|
|
202
|
-
const
|
|
201
|
+
return a.state?.(e.state.snapshot(), s);
|
|
202
|
+
const o = a.adapterMethod ?? r;
|
|
203
203
|
if (a.kind === "query")
|
|
204
|
-
return e.bridge.request(
|
|
204
|
+
return e.bridge.request(t, o, k(s));
|
|
205
205
|
if (a.kind === "callbackQuery") {
|
|
206
|
-
const
|
|
207
|
-
e.bridge.request(
|
|
208
|
-
const
|
|
209
|
-
|
|
206
|
+
const c = s.find((h) => typeof h == "function"), l = s.filter((h) => typeof h != "function");
|
|
207
|
+
e.bridge.request(t, o, k(l)).then((h) => {
|
|
208
|
+
const Q = a.mapCallbackResult?.(h) ?? [h];
|
|
209
|
+
c?.(...Q);
|
|
210
210
|
}).catch(e.onAsyncError);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
e.bridge.request(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
const u = e.bridge.request(t, o, k(s)).catch((c) => {
|
|
214
|
+
e.onAsyncError(c);
|
|
215
|
+
});
|
|
216
|
+
if (a.returnsResult)
|
|
217
|
+
return u;
|
|
218
|
+
} : (...s) => {
|
|
219
|
+
const o = new Error(`${t}.${r} is not implemented by the SDK adapter.`);
|
|
220
|
+
e.onAsyncError(o);
|
|
217
221
|
};
|
|
218
222
|
}
|
|
219
223
|
}
|
|
220
|
-
),
|
|
221
|
-
{
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
), J = (t) => typeof t == "object" && t !== null && !Array.isArray(t) && "id" in t, y = (t) => t.annotations?.filter(J).map((n) => ({ ...n })) ?? [], Z = (t) => {
|
|
225
|
+
switch (t) {
|
|
226
|
+
case "select":
|
|
227
|
+
case "pen":
|
|
228
|
+
case "eraser":
|
|
229
|
+
case "line":
|
|
230
|
+
case "arrow":
|
|
231
|
+
case "rectangle":
|
|
232
|
+
case "circle":
|
|
233
|
+
case "text-highlight":
|
|
234
|
+
case "text-underline":
|
|
235
|
+
case "text-strikethrough":
|
|
236
|
+
case "text-squiggly":
|
|
237
|
+
case "text-note":
|
|
238
|
+
case "stamp":
|
|
239
|
+
return t;
|
|
240
|
+
case "none":
|
|
241
|
+
default:
|
|
242
|
+
return "none";
|
|
243
|
+
}
|
|
244
|
+
}, ee = {
|
|
245
|
+
addAnnotationEventCallback: {
|
|
246
|
+
kind: "callbackRegister",
|
|
247
|
+
callback: (t, n) => {
|
|
248
|
+
const e = n[0];
|
|
249
|
+
typeof e == "function" && t.annotationEvents.push(e);
|
|
229
250
|
}
|
|
251
|
+
},
|
|
252
|
+
isInAnnotationMode: {
|
|
253
|
+
kind: "stateGetter",
|
|
254
|
+
state: (t) => t.annotationEnabled
|
|
255
|
+
},
|
|
256
|
+
getAnnotationMode: {
|
|
257
|
+
kind: "stateGetter",
|
|
258
|
+
state: (t) => Z(t.annotationMode)
|
|
259
|
+
},
|
|
260
|
+
getAnnotations: {
|
|
261
|
+
kind: "stateGetter",
|
|
262
|
+
state: (t) => y(t)
|
|
263
|
+
},
|
|
264
|
+
getAnnotationsCount: {
|
|
265
|
+
kind: "stateGetter",
|
|
266
|
+
state: (t) => y(t).length
|
|
267
|
+
},
|
|
268
|
+
openAnnotationView: { kind: "command" },
|
|
269
|
+
closeAnnotationView: { kind: "command" },
|
|
270
|
+
saveAnnotations: { kind: "callbackQuery" },
|
|
271
|
+
clearAnnotations: { kind: "command", returnsResult: !0 },
|
|
272
|
+
undoAnnotation: { kind: "command", returnsResult: !0 },
|
|
273
|
+
redoAnnotation: { kind: "command", returnsResult: !0 },
|
|
274
|
+
canUndoAnnotation: { kind: "query" },
|
|
275
|
+
canRedoAnnotation: { kind: "query" },
|
|
276
|
+
selectAnnotationTool: { kind: "command" },
|
|
277
|
+
selectAnnotationStamp: { kind: "command" },
|
|
278
|
+
setAnnotationPenColor: { kind: "command" },
|
|
279
|
+
setAnnotationPenWidth: { kind: "command" },
|
|
280
|
+
setAnnotationPenStyle: { kind: "command" }
|
|
281
|
+
};
|
|
282
|
+
class te {
|
|
283
|
+
constructor(n) {
|
|
284
|
+
this.openAnnotationView = (e) => this.adapter.openAnnotationView(e), this.closeAnnotationView = () => this.adapter.closeAnnotationView(), this.saveAnnotations = (e) => this.adapter.saveAnnotations(e), this.clearAnnotations = () => this.adapter.clearAnnotations(), this.undoAnnotation = () => this.adapter.undoAnnotation(), this.redoAnnotation = () => this.adapter.redoAnnotation(), this.canUndoAnnotation = () => this.adapter.canUndoAnnotation(), this.canRedoAnnotation = () => this.adapter.canRedoAnnotation(), this.selectAnnotationTool = (e, i) => this.adapter.selectAnnotationTool(e, i), this.selectAnnotationStamp = (e) => this.adapter.selectAnnotationStamp(e), this.setAnnotationPenColor = (e) => this.adapter.setAnnotationPenColor(e), this.setAnnotationPenWidth = (e) => this.adapter.setAnnotationPenWidth(e), this.setAnnotationPenStyle = (e) => this.adapter.setAnnotationPenStyle(e), this.isInAnnotationMode = () => this.adapter.isInAnnotationMode(), this.getAnnotationMode = () => this.adapter.getAnnotationMode(), this.getAnnotations = () => this.adapter.getAnnotations(), this.getAnnotationsCount = () => this.adapter.getAnnotationsCount(), this.addAnnotationEventCallback = (e) => this.adapter.addAnnotationEventCallback(e), this.adapter = d(
|
|
285
|
+
"annotation",
|
|
286
|
+
ee,
|
|
287
|
+
n
|
|
288
|
+
);
|
|
230
289
|
}
|
|
231
|
-
|
|
290
|
+
}
|
|
291
|
+
const ne = {
|
|
292
|
+
configSecurityProvider: { kind: "command" },
|
|
293
|
+
getSecurityProviders: { kind: "query" }
|
|
294
|
+
};
|
|
295
|
+
class ie {
|
|
296
|
+
constructor(n) {
|
|
297
|
+
this.configSecurityProvider = (e) => this.adapter.configSecurityProvider(e), this.getSecurityProviders = () => this.adapter.getSecurityProviders(), this.adapter = d("crypto", ne, n);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const E = (t) => t.digitalSignatures ? [...t.digitalSignatures] : [], re = {
|
|
301
|
+
addDigitalSignatureRetrieveCallback: {
|
|
302
|
+
kind: "callbackRegister",
|
|
303
|
+
callback: (t, n) => {
|
|
304
|
+
const e = n[0];
|
|
305
|
+
typeof e == "function" && t.digitalSignatureRetrieve.push(e);
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
addDigitalSignatureParseCallback: {
|
|
309
|
+
kind: "callbackRegister",
|
|
310
|
+
callback: (t, n) => {
|
|
311
|
+
const e = n[0];
|
|
312
|
+
typeof e == "function" && t.digitalSignatureParse.push(e);
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
addDigitalSignCallback: {
|
|
316
|
+
kind: "callbackRegister",
|
|
317
|
+
callback: (t, n) => {
|
|
318
|
+
const e = n[0];
|
|
319
|
+
typeof e == "function" && t.digitalSign.push(e);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
setCryptoProvider: { kind: "command" },
|
|
323
|
+
setSealSource: { kind: "command" },
|
|
324
|
+
setDefaultStampPassword: { kind: "command" },
|
|
325
|
+
setDefaultSealPassword: { kind: "command" },
|
|
326
|
+
setDefaultKeystorePassword: { kind: "command" },
|
|
327
|
+
setDefaultUSBKeyPassword: { kind: "command" },
|
|
328
|
+
setupExternalSealServer: { kind: "command" },
|
|
329
|
+
setDigitalSignOptions: { kind: "command" },
|
|
330
|
+
setExternalDigitalSignOptions: { kind: "command" },
|
|
331
|
+
setPDFDigitalSignCaptionOptions: { kind: "command" },
|
|
332
|
+
addDigitalSignature: { kind: "callbackQuery" },
|
|
333
|
+
addDigitalSignatureBySelectedSearchHighlight: { kind: "command" },
|
|
334
|
+
listDigitalSignatures: { kind: "callbackQuery" },
|
|
335
|
+
getDigitalSignatures: {
|
|
336
|
+
kind: "stateGetter",
|
|
337
|
+
state: (t) => E(t)
|
|
338
|
+
},
|
|
339
|
+
getDigitalSignaturesCount: {
|
|
340
|
+
kind: "stateGetter",
|
|
341
|
+
state: (t) => E(t).length
|
|
342
|
+
},
|
|
343
|
+
enableDigitalSignatureInfoView: { kind: "command" },
|
|
344
|
+
enableDigitalSignatureRevocation: { kind: "command" }
|
|
345
|
+
};
|
|
346
|
+
class ae {
|
|
347
|
+
constructor(n) {
|
|
348
|
+
this.addDigitalSignatureRetrieveCallback = (e) => this.adapter.addDigitalSignatureRetrieveCallback(e), this.addDigitalSignatureParseCallback = (e) => this.adapter.addDigitalSignatureParseCallback(e), this.setCryptoProvider = (e, i, r) => this.adapter.setCryptoProvider(e, i, r), this.setSealSource = (e) => this.adapter.setSealSource(e), this.setDefaultStampPassword = (e) => this.adapter.setDefaultStampPassword(e), this.setDefaultSealPassword = (e) => this.adapter.setDefaultSealPassword(e), this.setDefaultKeystorePassword = (e) => this.adapter.setDefaultKeystorePassword(e), this.setDefaultUSBKeyPassword = (e) => this.adapter.setDefaultUSBKeyPassword(e), this.addDigitalSignCallback = (e) => this.adapter.addDigitalSignCallback(e), this.setupExternalSealServer = (e) => this.adapter.setupExternalSealServer(e), this.setDigitalSignOptions = (e) => this.adapter.setDigitalSignOptions(e), this.setExternalDigitalSignOptions = (e) => this.adapter.setExternalDigitalSignOptions(e), this.setPDFDigitalSignCaptionOptions = (e) => this.adapter.setPDFDigitalSignCaptionOptions(e), this.addDigitalSignature = (e, i) => this.adapter.addDigitalSignature(e, i), this.addDigitalSignatureBySelectedSearchHighlight = (e) => this.adapter.addDigitalSignatureBySelectedSearchHighlight(e), this.listDigitalSignatures = (e) => this.adapter.listDigitalSignatures(e), this.getDigitalSignatures = () => this.adapter.getDigitalSignatures(), this.getDigitalSignaturesCount = () => this.adapter.getDigitalSignaturesCount(), this.enableDigitalSignatureInfoView = (e) => this.adapter.enableDigitalSignatureInfoView(e), this.enableDigitalSignatureRevocation = (e) => this.adapter.enableDigitalSignatureRevocation(e), this.adapter = d(
|
|
349
|
+
"digitalSign",
|
|
350
|
+
re,
|
|
351
|
+
n
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
const se = "rhc-office.editor-adapter", oe = 1, de = "__RHC_OFFICE_EDITOR_ADAPTER__", P = "rhcOfficeAdapterReady", C = "rhcOfficeAdapterEvent", K = "data-rhc-office-reader-id", ue = {
|
|
232
356
|
addDocumentOpenedCallback: {
|
|
233
357
|
kind: "callbackRegister",
|
|
234
|
-
callback: (
|
|
235
|
-
const e =
|
|
236
|
-
typeof e == "function" &&
|
|
358
|
+
callback: (t, n) => {
|
|
359
|
+
const e = n[0];
|
|
360
|
+
typeof e == "function" && t.documentOpened.push(e);
|
|
237
361
|
}
|
|
238
362
|
},
|
|
239
363
|
addDocumentSavedCallback: {
|
|
240
364
|
kind: "callbackRegister",
|
|
241
|
-
callback: (
|
|
242
|
-
const e =
|
|
243
|
-
typeof e == "function" &&
|
|
365
|
+
callback: (t, n) => {
|
|
366
|
+
const e = n[0];
|
|
367
|
+
typeof e == "function" && t.documentSaved.push(e);
|
|
244
368
|
}
|
|
245
369
|
},
|
|
246
370
|
addDocumentClosedCallback: {
|
|
247
371
|
kind: "callbackRegister",
|
|
248
|
-
callback: (
|
|
249
|
-
const e =
|
|
250
|
-
typeof e == "function" &&
|
|
372
|
+
callback: (t, n) => {
|
|
373
|
+
const e = n[0];
|
|
374
|
+
typeof e == "function" && t.documentClosed.push(e);
|
|
251
375
|
}
|
|
252
376
|
},
|
|
253
377
|
openPDFDocument: { kind: "callbackQuery", adapterMethod: "open" },
|
|
@@ -263,83 +387,118 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", b = "__RHC_OFFICE_DIGIT
|
|
|
263
387
|
saveAs: { kind: "query" },
|
|
264
388
|
getDocumentContent: {
|
|
265
389
|
kind: "callbackQuery",
|
|
266
|
-
mapCallbackResult: (
|
|
267
|
-
const t = n;
|
|
268
|
-
return [t?.fileCacheId, t?.fileBuffer];
|
|
269
|
-
}
|
|
390
|
+
mapCallbackResult: (t) => [t]
|
|
270
391
|
},
|
|
271
392
|
closeDocument: { kind: "callbackQuery" },
|
|
272
393
|
isDocumentOpened: {
|
|
273
394
|
kind: "stateGetter",
|
|
274
|
-
state: (
|
|
395
|
+
state: (t) => t.documentOpened
|
|
275
396
|
},
|
|
276
397
|
isDocumentModified: {
|
|
277
398
|
kind: "stateGetter",
|
|
278
|
-
state: (
|
|
399
|
+
state: (t) => t.documentModified
|
|
279
400
|
},
|
|
280
401
|
print: { kind: "command" },
|
|
281
402
|
createPreview: { kind: "command" }
|
|
282
403
|
};
|
|
283
|
-
class
|
|
284
|
-
constructor(
|
|
285
|
-
this.addDocumentOpenedCallback = (e) => this.adapter.addDocumentOpenedCallback(e), this.addDocumentSavedCallback = (e) => this.adapter.addDocumentSavedCallback(e), this.addDocumentClosedCallback = (e) => this.adapter.addDocumentClosedCallback(e), this.openPDFDocument = (e, i) => this.adapter.openPDFDocument(e, i), this.openPdfDocument = (e, i) => this.adapter.openPdfDocument(e, i), this.openOFDDocument = (e, i) => this.adapter.openOFDDocument(e, i), this.openOfdDocument = (e, i) => this.adapter.openOfdDocument(e, i), this.openOfficeDocument = (e, i) => this.adapter.openOfficeDocument(e, i), this.openImageDocument = (e, i) => this.adapter.openImageDocument(e, i), this.openTextDocument = (e, i) => this.adapter.openTextDocument(e, i), this.openFromLocalStorage = () => this.adapter.openFromLocalStorage(), this.setUploadUrl = (e) => this.adapter.setUploadUrl(e), this.save = (e, i, r) => this.adapter.save(e, i, r), this.saveAs = (e) =>
|
|
404
|
+
class le {
|
|
405
|
+
constructor(n) {
|
|
406
|
+
this.context = n, this.addDocumentOpenedCallback = (e) => this.adapter.addDocumentOpenedCallback(e), this.addDocumentSavedCallback = (e) => this.adapter.addDocumentSavedCallback(e), this.addDocumentClosedCallback = (e) => this.adapter.addDocumentClosedCallback(e), this.openPDFDocument = (e, i) => this.adapter.openPDFDocument(e, i), this.openPdfDocument = (e, i) => this.adapter.openPdfDocument(e, i), this.openOFDDocument = (e, i) => this.adapter.openOFDDocument(e, i), this.openOfdDocument = (e, i) => this.adapter.openOfdDocument(e, i), this.openOfficeDocument = (e, i) => this.adapter.openOfficeDocument(e, i), this.openImageDocument = (e, i) => this.adapter.openImageDocument(e, i), this.openTextDocument = (e, i) => this.adapter.openTextDocument(e, i), this.openFromLocalStorage = () => this.adapter.openFromLocalStorage(), this.setUploadUrl = (e) => this.adapter.setUploadUrl(e), this.save = (e, i, r) => this.adapter.save(e, i, r), this.saveAs = (e) => {
|
|
407
|
+
const i = this.context.bridge.getReaderId();
|
|
408
|
+
if (!i)
|
|
409
|
+
return Promise.resolve({
|
|
410
|
+
success: !1,
|
|
411
|
+
action: "save-as",
|
|
412
|
+
filename: e?.filename,
|
|
413
|
+
error: "Reader is not mounted or does not expose saveAs."
|
|
414
|
+
});
|
|
415
|
+
const r = document.querySelector(
|
|
416
|
+
`[${K}="${i}"]`
|
|
417
|
+
);
|
|
418
|
+
return typeof r?.saveAs == "function" ? r.saveAs(e) : this.adapter.saveAs(e);
|
|
419
|
+
}, this.getDocumentContent = (e) => this.adapter.getDocumentContent(e), this.closeDocument = (e, i, r) => this.adapter.closeDocument(e, i, r), this.isDocumentOpened = () => this.adapter.isDocumentOpened(), this.isDocumentModified = () => this.adapter.isDocumentModified(), this.print = () => this.adapter.print(), this.createPreview = (e, i) => this.adapter.createPreview(e, i), this.adapter = d(
|
|
286
420
|
"document",
|
|
287
|
-
|
|
288
|
-
|
|
421
|
+
ue,
|
|
422
|
+
n
|
|
289
423
|
);
|
|
290
424
|
}
|
|
291
425
|
}
|
|
292
|
-
const
|
|
426
|
+
const ce = {
|
|
293
427
|
clearFind: { kind: "command" },
|
|
294
428
|
findNext: { kind: "command" },
|
|
295
429
|
findPrevious: { kind: "command" }
|
|
296
430
|
};
|
|
297
|
-
class
|
|
298
|
-
constructor(
|
|
299
|
-
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter =
|
|
431
|
+
class he {
|
|
432
|
+
constructor(n) {
|
|
433
|
+
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter = d("find", ce, n);
|
|
300
434
|
}
|
|
301
435
|
}
|
|
302
|
-
const
|
|
436
|
+
const ge = {
|
|
303
437
|
configFileUpload: { kind: "command" },
|
|
304
438
|
setHttpHeaders: { kind: "command" },
|
|
305
439
|
setHttpFormFields: { kind: "command" }
|
|
306
440
|
};
|
|
307
|
-
class
|
|
308
|
-
constructor(
|
|
309
|
-
this.configFileUpload = (e) => this.adapter.configFileUpload(e), this.setHttpHeaders = (e) => this.adapter.setHttpHeaders(e), this.setHttpFormFields = (e) => this.adapter.setHttpFormFields(e), this.adapter =
|
|
441
|
+
class me {
|
|
442
|
+
constructor(n) {
|
|
443
|
+
this.configFileUpload = (e) => this.adapter.configFileUpload(e), this.setHttpHeaders = (e) => this.adapter.setHttpHeaders(e), this.setHttpFormFields = (e) => this.adapter.setHttpFormFields(e), this.adapter = d(
|
|
310
444
|
"networking",
|
|
311
|
-
|
|
312
|
-
|
|
445
|
+
ge,
|
|
446
|
+
n
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
const pe = () => ({
|
|
451
|
+
clearContent: { kind: "command", returnsResult: !0 },
|
|
452
|
+
commit: { kind: "command", returnsResult: !0 },
|
|
453
|
+
deletePages: { kind: "command", returnsResult: !0 },
|
|
454
|
+
duplicatePages: { kind: "command", returnsResult: !0 },
|
|
455
|
+
execute: { kind: "command", returnsResult: !0 },
|
|
456
|
+
extractPages: { kind: "command", returnsResult: !0 },
|
|
457
|
+
getSnapshot: { kind: "query" },
|
|
458
|
+
importDocument: { kind: "command", returnsResult: !0 },
|
|
459
|
+
moveAfter: { kind: "command", returnsResult: !0 },
|
|
460
|
+
moveBefore: { kind: "command", returnsResult: !0 },
|
|
461
|
+
newPage: { kind: "command", returnsResult: !0 },
|
|
462
|
+
rotateLeft: { kind: "command", returnsResult: !0 },
|
|
463
|
+
rotateRight: { kind: "command", returnsResult: !0 },
|
|
464
|
+
undo: { kind: "command", returnsResult: !0 }
|
|
465
|
+
}), be = (t) => t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
466
|
+
class Se {
|
|
467
|
+
constructor(n) {
|
|
468
|
+
this.getSnapshot = () => this.adapter.getSnapshot(), this.execute = (e) => this.adapter.execute(e), this.newPage = (e, i) => this.adapter.newPage(e, i), this.deletePages = (e) => this.adapter.deletePages(e), this.duplicatePages = (e, i) => this.adapter.duplicatePages(e, i), this.rotateLeft = (e) => this.adapter.rotateLeft(e), this.rotateRight = (e) => this.adapter.rotateRight(e), this.clearContent = (e) => this.adapter.clearContent(e), this.moveBefore = (e, i) => this.adapter.moveBefore(e, i), this.moveAfter = (e, i) => this.adapter.moveAfter(e, i), this.importDocument = (e, i) => this.adapter.importDocument(be(e), i), this.extractPages = (e, i) => this.adapter.extractPages(e, i), this.undo = () => this.adapter.undo(), this.commit = () => this.adapter.commit(), this.adapter = d(
|
|
469
|
+
"pageArrange",
|
|
470
|
+
pe(),
|
|
471
|
+
n
|
|
313
472
|
);
|
|
314
473
|
}
|
|
315
474
|
}
|
|
316
|
-
const
|
|
475
|
+
const ke = (t) => ({
|
|
317
476
|
addPageChangeCallback: {
|
|
318
477
|
kind: "callbackRegister",
|
|
319
|
-
callback: (
|
|
478
|
+
callback: (n, e) => {
|
|
320
479
|
const i = e[0];
|
|
321
|
-
typeof i == "function" &&
|
|
480
|
+
typeof i == "function" && n.pageChange.push(i);
|
|
322
481
|
}
|
|
323
482
|
},
|
|
324
483
|
addPageModeChangeCallback: {
|
|
325
484
|
kind: "callbackRegister",
|
|
326
|
-
callback: (
|
|
485
|
+
callback: (n, e) => {
|
|
327
486
|
const i = e[0];
|
|
328
|
-
typeof i == "function" &&
|
|
487
|
+
typeof i == "function" && n.pageModeChange.push(i);
|
|
329
488
|
}
|
|
330
489
|
},
|
|
331
490
|
getPageCount: {
|
|
332
491
|
kind: "callbackRegister",
|
|
333
|
-
callback: (
|
|
492
|
+
callback: (n, e) => {
|
|
334
493
|
const i = e[0];
|
|
335
|
-
typeof i == "function" && i(
|
|
494
|
+
typeof i == "function" && i(t.state.snapshot().pageCount);
|
|
336
495
|
}
|
|
337
496
|
},
|
|
338
497
|
getPageIndex: {
|
|
339
498
|
kind: "callbackRegister",
|
|
340
|
-
callback: (
|
|
499
|
+
callback: (n, e) => {
|
|
341
500
|
const i = e[0];
|
|
342
|
-
typeof i == "function" && i(
|
|
501
|
+
typeof i == "function" && i(t.state.snapshot().pageIndex);
|
|
343
502
|
}
|
|
344
503
|
},
|
|
345
504
|
setSinglePageViewMode: { kind: "command" },
|
|
@@ -363,16 +522,16 @@ const J = (n) => ({
|
|
|
363
522
|
gotoPreviousPage: { kind: "command" },
|
|
364
523
|
rotatePage: { kind: "command" }
|
|
365
524
|
});
|
|
366
|
-
class
|
|
367
|
-
constructor(
|
|
368
|
-
this.addPageChangeCallback = (e) => this.adapter.addPageChangeCallback(e), this.addPageModeChangeCallback = (e) => this.adapter.addPageModeChangeCallback(e), this.getPageCount = (e) => this.adapter.getPageCount(e), this.getPageIndex = (e) => this.adapter.getPageIndex(e), this.setSinglePageViewMode = () => this.adapter.setSinglePageViewMode(), this.setTwoPagesViewMode = () => this.adapter.setTwoPagesViewMode(), this.setPageScrollVertical = () => this.adapter.setPageScrollVertical(), this.setPageScrollHorizontal = () => this.adapter.setPageScrollHorizontal(), this.setPageCursorPanDrag = () => this.adapter.setPageCursorPanDrag(), this.setPageCursorTextSelect = () => this.adapter.setPageCursorTextSelect(), this.rotateCW = () => this.adapter.rotateCW(), this.rotateCCW = () => this.adapter.rotateCCW(), this.autoFitPage = () => this.adapter.autoFitPage(), this.fitPageSize = () => this.adapter.fitPageSize(), this.fitPageWidth = () => this.adapter.fitPageWidth(), this.fitPageHeight = () => this.adapter.fitPageHeight(), this.increasePageScale = () => this.adapter.increasePageScale(), this.decreasePageScale = () => this.adapter.decreasePageScale(), this.setPageScale = (e) => this.adapter.setPageScale(e), this.setPageBlendColor = (e, i, r, a) => this.adapter.setPageBlendColor(e, i, r, a), this.gotoPage = (e, i, r) => this.adapter.gotoPage(e, i, r), this.gotoNextPage = () => this.adapter.gotoNextPage(), this.gotoPreviousPage = () => this.adapter.gotoPreviousPage(), this.rotatePage = (e) => this.adapter.rotatePage(e), this.adapter =
|
|
525
|
+
class fe {
|
|
526
|
+
constructor(n) {
|
|
527
|
+
this.addPageChangeCallback = (e) => this.adapter.addPageChangeCallback(e), this.addPageModeChangeCallback = (e) => this.adapter.addPageModeChangeCallback(e), this.getPageCount = (e) => this.adapter.getPageCount(e), this.getPageIndex = (e) => this.adapter.getPageIndex(e), this.setSinglePageViewMode = () => this.adapter.setSinglePageViewMode(), this.setTwoPagesViewMode = () => this.adapter.setTwoPagesViewMode(), this.setPageScrollVertical = () => this.adapter.setPageScrollVertical(), this.setPageScrollHorizontal = () => this.adapter.setPageScrollHorizontal(), this.setPageCursorPanDrag = () => this.adapter.setPageCursorPanDrag(), this.setPageCursorTextSelect = () => this.adapter.setPageCursorTextSelect(), this.rotateCW = () => this.adapter.rotateCW(), this.rotateCCW = () => this.adapter.rotateCCW(), this.autoFitPage = () => this.adapter.autoFitPage(), this.fitPageSize = () => this.adapter.fitPageSize(), this.fitPageWidth = () => this.adapter.fitPageWidth(), this.fitPageHeight = () => this.adapter.fitPageHeight(), this.increasePageScale = () => this.adapter.increasePageScale(), this.decreasePageScale = () => this.adapter.decreasePageScale(), this.setPageScale = (e) => this.adapter.setPageScale(e), this.setPageBlendColor = (e, i, r, a) => this.adapter.setPageBlendColor(e, i, r, a), this.gotoPage = (e, i, r) => this.adapter.gotoPage(e, i, r), this.gotoNextPage = () => this.adapter.gotoNextPage(), this.gotoPreviousPage = () => this.adapter.gotoPreviousPage(), this.rotatePage = (e) => this.adapter.rotatePage(e), this.adapter = d(
|
|
369
528
|
"page",
|
|
370
|
-
|
|
371
|
-
|
|
529
|
+
ke(n),
|
|
530
|
+
n
|
|
372
531
|
);
|
|
373
532
|
}
|
|
374
533
|
}
|
|
375
|
-
const
|
|
534
|
+
const Re = {
|
|
376
535
|
open: { kind: "command" },
|
|
377
536
|
setFormFieldValue: { kind: "command" },
|
|
378
537
|
setFormFieldReadonly: { kind: "command" },
|
|
@@ -386,65 +545,139 @@ const ee = {
|
|
|
386
545
|
},
|
|
387
546
|
toKeyValue: {
|
|
388
547
|
kind: "callbackQuery",
|
|
389
|
-
mapCallbackResult: (
|
|
548
|
+
mapCallbackResult: (t) => [Array.isArray(t) ? t : []]
|
|
390
549
|
}
|
|
391
550
|
};
|
|
392
|
-
class
|
|
393
|
-
constructor(
|
|
394
|
-
this.open = () => this.adapter.open(), this.setFormFieldValue = (e, i) => this.adapter.setFormFieldValue(e, i), this.setFormFieldReadonly = (e, i) => this.adapter.setFormFieldReadonly(e, i), this.commit = (e) => this.adapter.commit(e), this.clear = (e) => this.adapter.clear(e), this.toKeyValue = (e) => this.adapter.toKeyValue(e), this.adapter =
|
|
551
|
+
class Te {
|
|
552
|
+
constructor(n) {
|
|
553
|
+
this.open = () => this.adapter.open(), this.setFormFieldValue = (e, i) => this.adapter.setFormFieldValue(e, i), this.setFormFieldReadonly = (e, i) => this.adapter.setFormFieldReadonly(e, i), this.commit = (e) => this.adapter.commit(e), this.clear = (e) => this.adapter.clear(e), this.toKeyValue = (e) => this.adapter.toKeyValue(e), this.adapter = d(
|
|
395
554
|
"pdfFormFiller",
|
|
396
|
-
|
|
397
|
-
|
|
555
|
+
Re,
|
|
556
|
+
n
|
|
398
557
|
);
|
|
399
558
|
}
|
|
400
559
|
}
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
return !Number.isFinite(
|
|
404
|
-
},
|
|
405
|
-
const
|
|
406
|
-
if (
|
|
407
|
-
const r =
|
|
560
|
+
const ve = /\s*,\s*/, ye = /\s*-\s*/, f = (t) => {
|
|
561
|
+
const n = Number.parseInt(t.trim(), 10);
|
|
562
|
+
return !Number.isFinite(n) || n <= 0 ? null : n;
|
|
563
|
+
}, Ee = (t) => {
|
|
564
|
+
const n = t.split(ye);
|
|
565
|
+
if (n.length === 1) {
|
|
566
|
+
const r = f(n[0] ?? "");
|
|
408
567
|
return r ? [r] : [];
|
|
409
568
|
}
|
|
410
|
-
const e =
|
|
569
|
+
const e = f(n[0] ?? ""), i = f(n[1] ?? "");
|
|
411
570
|
return !e || !i || i < e ? [] : Array.from({ length: i - e + 1 }, (r, a) => e + a);
|
|
412
|
-
},
|
|
413
|
-
class
|
|
414
|
-
constructor(
|
|
571
|
+
}, Pe = (t) => t ? t.split(ve).flatMap((e) => Ee(e)).filter((e, i, r) => r.indexOf(e) === i) : [];
|
|
572
|
+
class Ce {
|
|
573
|
+
constructor(n, e, i) {
|
|
415
574
|
this.setFieldName = (r) => {
|
|
416
575
|
this.key = r;
|
|
417
576
|
}, this.setFieldValue = (r) => {
|
|
418
577
|
this.value = r;
|
|
419
578
|
}, this.setDescription = (r) => {
|
|
420
579
|
this.description = r;
|
|
421
|
-
}, this.key =
|
|
580
|
+
}, this.key = n, this.value = e, this.description = i;
|
|
422
581
|
}
|
|
423
582
|
}
|
|
424
|
-
class
|
|
583
|
+
class De {
|
|
425
584
|
constructor() {
|
|
426
|
-
this.fields = [], this.keywordTextFixedPositions = void 0, this.keywordOffsetX = 0, this.keywordOffsetY = 0, this.bookmarkOffsetX = 0, this.bookmarkOffsetY = 0, this.printMargin = 0, this.grayscaleSealImage = !1, this.signType = 0, this.sealPosition = 0, this.getSignType = () => this.signType, this.setSignType = (
|
|
427
|
-
this.signType =
|
|
428
|
-
}, this.isCrossPageSideSign = () => this.signType === 2 || this.signType === 3, this.getSealPosition = () => this.sealPosition, this.setSignOnPageSides = (
|
|
429
|
-
|
|
430
|
-
}, this.setSignPositionOnPageSides = (
|
|
431
|
-
this.sealPosition =
|
|
432
|
-
}, this.setPageRange = (
|
|
433
|
-
this.pageRange =
|
|
434
|
-
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () =>
|
|
435
|
-
this.signUserData =
|
|
436
|
-
}, this.setPrintMargin = (
|
|
437
|
-
this.printMargin =
|
|
438
|
-
}, this.getPrintMargin = () => this.printMargin ?? 0, this.setSignReason = (
|
|
439
|
-
this.signReason =
|
|
440
|
-
}, this.getSignReason = () => this.signReason, this.setSignLocation = (
|
|
441
|
-
this.signLocation =
|
|
442
|
-
}, this.getSignLocation = () => this.signLocation, this.setDefaultStampPassword = (
|
|
443
|
-
this.defaultStampPassword =
|
|
585
|
+
this.fields = [], this.keywordTextFixedPositions = void 0, this.keywordOffsetX = 0, this.keywordOffsetY = 0, this.bookmarkOffsetX = 0, this.bookmarkOffsetY = 0, this.printMargin = 0, this.grayscaleSealImage = !1, this.signType = 0, this.sealPosition = 0, this.getSignType = () => this.signType, this.setSignType = (n) => {
|
|
586
|
+
this.signType = n;
|
|
587
|
+
}, this.isCrossPageSideSign = () => this.signType === 2 || this.signType === 3, this.getSealPosition = () => this.sealPosition, this.setSignOnPageSides = (n) => {
|
|
588
|
+
n >= 0 && n <= 3 && (this.signType = n);
|
|
589
|
+
}, this.setSignPositionOnPageSides = (n) => {
|
|
590
|
+
this.sealPosition = n;
|
|
591
|
+
}, this.setPageRange = (n) => {
|
|
592
|
+
this.pageRange = n;
|
|
593
|
+
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () => Pe(this.pageRange), this.setSignUserData = (n) => {
|
|
594
|
+
this.signUserData = n;
|
|
595
|
+
}, this.setPrintMargin = (n) => {
|
|
596
|
+
this.printMargin = n;
|
|
597
|
+
}, this.getPrintMargin = () => this.printMargin ?? 0, this.setSignReason = (n) => {
|
|
598
|
+
this.signReason = n;
|
|
599
|
+
}, this.getSignReason = () => this.signReason, this.setSignLocation = (n) => {
|
|
600
|
+
this.signLocation = n;
|
|
601
|
+
}, this.getSignLocation = () => this.signLocation, this.setDefaultStampPassword = (n) => {
|
|
602
|
+
this.defaultStampPassword = n;
|
|
444
603
|
};
|
|
445
604
|
}
|
|
446
605
|
}
|
|
447
|
-
const
|
|
606
|
+
const Ae = {
|
|
607
|
+
getSecuritySettings: { kind: "query" },
|
|
608
|
+
isSecuritySettingsLocalEditable: { kind: "query" },
|
|
609
|
+
setSecuritySettingsLocalEditable: { kind: "query" },
|
|
610
|
+
setSecuritySettings: { kind: "query" },
|
|
611
|
+
openSecuritySettingsDialog: { kind: "command" }
|
|
612
|
+
};
|
|
613
|
+
class Me {
|
|
614
|
+
constructor(n) {
|
|
615
|
+
this.getSecuritySettings = () => this.adapter.getSecuritySettings(), this.setSecuritySettings = (e) => this.adapter.setSecuritySettings(e), this.isSecuritySettingsLocalEditable = () => this.adapter.isSecuritySettingsLocalEditable(), this.setSecuritySettingsLocalEditable = (e) => this.adapter.setSecuritySettingsLocalEditable(e), this.openSecuritySettingsDialog = () => this.adapter.openSecuritySettingsDialog(), this.adapter = d(
|
|
616
|
+
"security",
|
|
617
|
+
Ae,
|
|
618
|
+
n
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
const we = {
|
|
623
|
+
setSignServer: { kind: "command" },
|
|
624
|
+
addSignServerAuthCallback: {
|
|
625
|
+
kind: "callbackRegister",
|
|
626
|
+
callback: (t, n) => {
|
|
627
|
+
const e = n[0];
|
|
628
|
+
typeof e == "function" && t.signServerAuth.push(e);
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
setSignServerDefaultLogin: { kind: "command" },
|
|
632
|
+
setDefaultSignServerLogin: { kind: "command" },
|
|
633
|
+
setSignServerDefaultPassword: { kind: "command" },
|
|
634
|
+
setDefaultSignServerPassword: { kind: "command" },
|
|
635
|
+
loginNTKOSignServer: { kind: "command" },
|
|
636
|
+
loginSignServer: { kind: "callbackQuery" },
|
|
637
|
+
signOutSignServer: { kind: "command" },
|
|
638
|
+
isAuthenticatedOnSignServer: { kind: "stateGetter", state: () => !1 },
|
|
639
|
+
setSignServerLoginFromUSBKey: { kind: "command" },
|
|
640
|
+
setUserAuthSource: { kind: "command" }
|
|
641
|
+
};
|
|
642
|
+
class Ie {
|
|
643
|
+
constructor(n) {
|
|
644
|
+
this.setSignServer = (e) => this.adapter.setSignServer(e), this.addSignServerAuthCallback = (e) => this.adapter.addSignServerAuthCallback(e), this.setSignServerDefaultLogin = (e) => this.adapter.setSignServerDefaultLogin(e), this.setDefaultSignServerLogin = (e) => this.adapter.setDefaultSignServerLogin(e), this.setSignServerDefaultPassword = (e) => this.adapter.setSignServerDefaultPassword(e), this.setDefaultSignServerPassword = (e) => this.adapter.setDefaultSignServerPassword(e), this.loginNTKOSignServer = (e, i, r) => this.adapter.loginNTKOSignServer(e, i, r), this.loginSignServer = (e, i, r, a) => this.adapter.loginSignServer(e, i, r, a), this.signOutSignServer = () => this.adapter.signOutSignServer(), this.isAuthenticatedOnSignServer = () => this.adapter.isAuthenticatedOnSignServer(), this.setSignServerLoginFromUSBKey = (e, i) => this.adapter.setSignServerLoginFromUSBKey(e, i), this.setUserAuthSource = (e) => this.adapter.setUserAuthSource(e), this.adapter = d(
|
|
645
|
+
"signServer",
|
|
646
|
+
we,
|
|
647
|
+
n
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const Oe = {
|
|
652
|
+
createPDF417Barcode: { kind: "command" }
|
|
653
|
+
};
|
|
654
|
+
class _e {
|
|
655
|
+
constructor(n) {
|
|
656
|
+
this.createPDF417Barcode = (e, i, r, a, s, o, u) => this.adapter.createPDF417Barcode(e, i, r, a, s, o, u), this.adapter = d(
|
|
657
|
+
"symbology",
|
|
658
|
+
Oe,
|
|
659
|
+
n
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
const Le = {
|
|
664
|
+
setup: { kind: "command" },
|
|
665
|
+
create: { kind: "command" },
|
|
666
|
+
getMarkups: { kind: "callbackQuery" },
|
|
667
|
+
removeMarkup: { kind: "command" },
|
|
668
|
+
removeAllMarkups: { kind: "command" },
|
|
669
|
+
sign: { kind: "callbackQuery" }
|
|
670
|
+
};
|
|
671
|
+
class Fe {
|
|
672
|
+
constructor(n) {
|
|
673
|
+
this.setup = (e) => this.adapter.setup(e), this.create = (e) => this.adapter.create(e), this.getMarkups = (e) => this.adapter.getMarkups(e), this.removeMarkup = (e, i) => this.adapter.removeMarkup(e, i), this.removeAllMarkups = (e) => this.adapter.removeAllMarkups(e), this.sign = (e) => this.adapter.sign(e), this.adapter = d(
|
|
674
|
+
"templateSign",
|
|
675
|
+
Le,
|
|
676
|
+
n
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
const Ue = /* @__PURE__ */ new Set([2, 5]), Ne = (t) => ({
|
|
448
681
|
showToolbarMenu: { kind: "command" },
|
|
449
682
|
hideToolbarMenu: { kind: "command" },
|
|
450
683
|
setupToolbarMenu: { kind: "command" },
|
|
@@ -459,10 +692,22 @@ const de = /* @__PURE__ */ new Set([2, 5]), le = (n) => ({
|
|
|
459
692
|
hideRibbonMenuItem: { kind: "command" },
|
|
460
693
|
showRibbonTitleBar: { kind: "command" },
|
|
461
694
|
hideRibbonTitleBar: { kind: "command" },
|
|
695
|
+
showRibbonTabs: { kind: "command" },
|
|
696
|
+
hideRibbonTabs: { kind: "command" },
|
|
462
697
|
selectRibbonMenu: { kind: "command" },
|
|
698
|
+
setupRibbonMenuTab: { kind: "command" },
|
|
699
|
+
showRibbonMenuTab: { kind: "command" },
|
|
700
|
+
hideRibbonMenuTab: { kind: "command" },
|
|
701
|
+
enableRibbonMenuTab: { kind: "command" },
|
|
702
|
+
disableRibbonMenuTab: { kind: "command" },
|
|
703
|
+
setupRibbonMenuItemState: { kind: "command" },
|
|
704
|
+
enableRibbonMenuItem: { kind: "command" },
|
|
705
|
+
disableRibbonMenuItem: { kind: "command" },
|
|
463
706
|
setRibbonMenuButtonStyle: { kind: "command" },
|
|
464
707
|
setWatermark: { kind: "command" },
|
|
465
708
|
setCompactMode: { kind: "command" },
|
|
709
|
+
setRulerVisible: { kind: "command" },
|
|
710
|
+
toggleSidebar: { kind: "command" },
|
|
466
711
|
enterBookViewMode: {
|
|
467
712
|
kind: "callbackQuery",
|
|
468
713
|
mapCallbackResult: () => []
|
|
@@ -470,133 +715,141 @@ const de = /* @__PURE__ */ new Set([2, 5]), le = (n) => ({
|
|
|
470
715
|
exitBookViewMode: { kind: "command" },
|
|
471
716
|
isBookViewActivated: {
|
|
472
717
|
kind: "stateGetter",
|
|
473
|
-
state: () =>
|
|
718
|
+
state: () => Ue.has(t.state.snapshot().pageMode)
|
|
474
719
|
},
|
|
475
720
|
requestFullScreen: { kind: "command" },
|
|
476
721
|
exitFullScreen: { kind: "command" },
|
|
477
722
|
invalidateView: { kind: "command" }
|
|
478
723
|
});
|
|
479
|
-
class
|
|
480
|
-
constructor(
|
|
481
|
-
this.showToolbarMenu = () =>
|
|
724
|
+
class Be {
|
|
725
|
+
constructor(n) {
|
|
726
|
+
this.showToolbarMenu = () => (this.warnLegacyRibbonMethod("showToolbarMenu", "showRibbonMenu"), this.showRibbonMenu()), this.hideToolbarMenu = () => (this.warnLegacyRibbonMethod("hideToolbarMenu", "hideRibbonMenu"), this.hideRibbonMenu()), this.setupToolbarMenu = (e) => (this.warnLegacyRibbonMethod(
|
|
727
|
+
"setupToolbarMenu",
|
|
728
|
+
"showRibbonMenu/hideRibbonMenu/setupRibbonMenuTab"
|
|
729
|
+
), this.setupRibbonMenu(e)), this.showToolbarMenuItem = (e) => (this.warnLegacyRibbonMethod("showToolbarMenuItem", "showRibbonMenuItem"), this.showRibbonMenuItem(e)), this.hideToolbarMenuItem = (e) => (this.warnLegacyRibbonMethod("hideToolbarMenuItem", "hideRibbonMenuItem"), this.hideRibbonMenuItem(e)), this.setupRibbonMenu = (e) => (this.warnLegacyRibbonMethod(
|
|
730
|
+
"setupRibbonMenu",
|
|
731
|
+
"showRibbonMenu/hideRibbonMenu/setupRibbonMenuTab"
|
|
732
|
+
), typeof e == "boolean" ? e ? this.showRibbonMenu() : this.hideRibbonMenu() : this.setupRibbonMenuTab(e.menu, { visible: e.visible })), this.setupRibbonMenuItem = (e, i, r) => (this.warnLegacyRibbonMethod("setupRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: i, config: r })), this.setupRibbonTitleBar = (e) => (this.warnLegacyRibbonMethod("setupRibbonTitleBar", "showRibbonTabs/hideRibbonTabs"), e ? this.showRibbonTabs() : this.hideRibbonTabs()), this.showRibbonMenu = () => this.adapter.showRibbonMenu(), this.hideRibbonMenu = () => this.adapter.hideRibbonMenu(), this.showRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("showRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !0, config: i })), this.hideRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("hideRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !1, config: i })), this.showRibbonTitleBar = () => (this.warnLegacyRibbonMethod("showRibbonTitleBar", "showRibbonTabs"), this.showRibbonTabs()), this.hideRibbonTitleBar = () => (this.warnLegacyRibbonMethod("hideRibbonTitleBar", "hideRibbonTabs"), this.hideRibbonTabs()), this.showRibbonTabs = () => this.adapter.showRibbonTabs(), this.hideRibbonTabs = () => this.adapter.hideRibbonTabs(), this.selectRibbonMenu = (e) => this.adapter.selectRibbonMenu(e), this.setupRibbonMenuTab = (e, i) => this.adapter.setupRibbonMenuTab(e, i), this.showRibbonMenuTab = (e) => this.adapter.showRibbonMenuTab(e), this.hideRibbonMenuTab = (e) => this.adapter.hideRibbonMenuTab(e), this.enableRibbonMenuTab = (e) => this.adapter.enableRibbonMenuTab(e), this.disableRibbonMenuTab = (e) => this.adapter.disableRibbonMenuTab(e), this.setupRibbonMenuItemState = (e, i) => this.adapter.setupRibbonMenuItemState(e, i), this.enableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !1, config: i }), this.disableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !0, config: i }), this.setRibbonMenuButtonStyle = (e, i) => this.adapter.setRibbonMenuButtonStyle(e, i), this.setWatermark = (e) => this.adapter.setWatermark(e), this.setCompactMode = (e) => this.adapter.setCompactMode(e), this.setRulerVisible = (e) => this.adapter.setRulerVisible(e), this.toggleSidebar = () => this.adapter.toggleSidebar(), this.enterBookViewMode = (e) => this.adapter.enterBookViewMode(e), this.exitBookViewMode = () => this.adapter.exitBookViewMode(), this.isBookViewActivated = () => this.adapter.isBookViewActivated(), this.requestFullScreen = () => this.adapter.requestFullScreen(), this.exitFullScreen = () => this.adapter.exitFullScreen(), this.invalidateView = () => this.adapter.invalidateView(), this.adapter = d("ui", Ne(n), n);
|
|
733
|
+
}
|
|
734
|
+
warnLegacyRibbonMethod(n, e) {
|
|
735
|
+
console.warn(`[RHC Office SDK] ui.${n} is deprecated. Use ui.${e} instead.`);
|
|
482
736
|
}
|
|
483
737
|
}
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
738
|
+
const xe = (t) => {
|
|
739
|
+
if (!t)
|
|
486
740
|
return;
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
741
|
+
const n = t.trim().toLowerCase();
|
|
742
|
+
if (n === "application")
|
|
489
743
|
return "auto";
|
|
490
|
-
if (
|
|
491
|
-
return
|
|
492
|
-
},
|
|
493
|
-
const
|
|
494
|
-
return
|
|
495
|
-
},
|
|
496
|
-
const e =
|
|
744
|
+
if (n === "light" || n === "dark" || n === "high-contrast" || n === "auto")
|
|
745
|
+
return n;
|
|
746
|
+
}, G = (t) => {
|
|
747
|
+
const n = new URL(t, globalThis.location?.href ?? "http://localhost/");
|
|
748
|
+
return n.hash = "", n.pathname.endsWith("/") || (n.pathname = `${n.pathname}/`), n.toString();
|
|
749
|
+
}, Ve = (t) => new URL("editors.bootstrap.js", t).toString(), Ke = (t, n) => {
|
|
750
|
+
const e = G(t);
|
|
497
751
|
return {
|
|
498
|
-
...
|
|
752
|
+
...n,
|
|
499
753
|
appUrl: e,
|
|
500
|
-
|
|
501
|
-
theme: ue(t.theme)
|
|
754
|
+
theme: xe(n.theme)
|
|
502
755
|
};
|
|
503
|
-
},
|
|
504
|
-
const
|
|
505
|
-
return
|
|
756
|
+
}, g = "rhc-office-editor", R = "__RHC_OFFICE_SDK_READER_LOADER__", q = () => {
|
|
757
|
+
const t = globalThis;
|
|
758
|
+
return t[R] || (t[R] = {
|
|
506
759
|
activeAppUrl: null,
|
|
507
760
|
loadPromises: /* @__PURE__ */ new Map()
|
|
508
|
-
}),
|
|
509
|
-
},
|
|
510
|
-
class
|
|
511
|
-
constructor(
|
|
512
|
-
super(`Failed to load reader bootstrap script: ${
|
|
761
|
+
}), t[R];
|
|
762
|
+
}, Ge = (t) => Array.from(document.querySelectorAll("script")).find((n) => n.src === t) ?? null;
|
|
763
|
+
class D extends Error {
|
|
764
|
+
constructor(n) {
|
|
765
|
+
super(`Failed to load reader bootstrap script: ${n}`), this.name = "ReaderScriptLoadError";
|
|
513
766
|
}
|
|
514
767
|
}
|
|
515
|
-
class
|
|
516
|
-
constructor(
|
|
768
|
+
class qe extends Error {
|
|
769
|
+
constructor(n, e) {
|
|
517
770
|
super(
|
|
518
|
-
`Reader Web Component "${
|
|
771
|
+
`Reader Web Component "${g}" is already bound to ${n} and cannot be reloaded from ${e}.`
|
|
519
772
|
), this.name = "ReaderSourceConflictError";
|
|
520
773
|
}
|
|
521
774
|
}
|
|
522
|
-
const
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
throw new
|
|
526
|
-
},
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
const e =
|
|
775
|
+
const H = (t) => {
|
|
776
|
+
const n = q();
|
|
777
|
+
if (n.activeAppUrl && n.activeAppUrl !== t)
|
|
778
|
+
throw new qe(n.activeAppUrl, t);
|
|
779
|
+
}, He = (t) => {
|
|
780
|
+
const n = q();
|
|
781
|
+
H(t);
|
|
782
|
+
const e = n.loadPromises.get(t);
|
|
530
783
|
if (e)
|
|
531
784
|
return e;
|
|
532
|
-
if (globalThis.customElements?.get(
|
|
533
|
-
|
|
534
|
-
const
|
|
535
|
-
return
|
|
785
|
+
if (globalThis.customElements?.get(g)) {
|
|
786
|
+
n.activeAppUrl = t;
|
|
787
|
+
const s = Promise.resolve();
|
|
788
|
+
return n.loadPromises.set(t, s), s;
|
|
536
789
|
}
|
|
537
|
-
const i =
|
|
538
|
-
|
|
539
|
-
const a = new Promise((
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
},
|
|
543
|
-
globalThis.customElements.whenDefined(
|
|
544
|
-
|
|
545
|
-
}).catch(
|
|
790
|
+
const i = Ve(t), r = Ge(i);
|
|
791
|
+
n.activeAppUrl = t;
|
|
792
|
+
const a = new Promise((s, o) => {
|
|
793
|
+
const u = (h) => {
|
|
794
|
+
h?.remove(), o(new D(i));
|
|
795
|
+
}, c = () => {
|
|
796
|
+
globalThis.customElements.whenDefined(g).then(() => {
|
|
797
|
+
s();
|
|
798
|
+
}).catch(o);
|
|
546
799
|
};
|
|
547
800
|
if (r) {
|
|
548
|
-
if (globalThis.customElements?.get(
|
|
549
|
-
|
|
801
|
+
if (globalThis.customElements?.get(g)) {
|
|
802
|
+
s();
|
|
550
803
|
return;
|
|
551
804
|
}
|
|
552
805
|
r.addEventListener(
|
|
553
806
|
"error",
|
|
554
|
-
() =>
|
|
807
|
+
() => o(new D(i)),
|
|
555
808
|
{
|
|
556
809
|
once: !0
|
|
557
810
|
}
|
|
558
|
-
),
|
|
811
|
+
), c();
|
|
559
812
|
return;
|
|
560
813
|
}
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
}).catch((
|
|
564
|
-
throw
|
|
814
|
+
const l = document.createElement("script");
|
|
815
|
+
l.src = i, l.async = !0, l.dataset.rhcOfficeSdkReader = t, l.addEventListener("load", c, { once: !0 }), l.addEventListener("error", () => u(l), { once: !0 }), document.head.appendChild(l);
|
|
816
|
+
}).catch((s) => {
|
|
817
|
+
throw n.loadPromises.delete(t), !globalThis.customElements?.get(g) && n.activeAppUrl === t && (n.activeAppUrl = null), s;
|
|
565
818
|
});
|
|
566
|
-
return
|
|
567
|
-
},
|
|
568
|
-
const
|
|
569
|
-
return typeof
|
|
570
|
-
},
|
|
571
|
-
class
|
|
572
|
-
constructor(
|
|
573
|
-
super(e), this.name = "ReaderBridgeError", this.code =
|
|
819
|
+
return n.loadPromises.set(t, a), a;
|
|
820
|
+
}, ze = 5e3, Qe = 5e3, We = () => {
|
|
821
|
+
const t = globalThis.crypto;
|
|
822
|
+
return typeof t?.randomUUID == "function" ? t.randomUUID() : `adapter-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
823
|
+
}, p = () => globalThis[de];
|
|
824
|
+
class $e extends Error {
|
|
825
|
+
constructor(n, e, i) {
|
|
826
|
+
super(e), this.name = "ReaderBridgeError", this.code = n, this.details = i;
|
|
574
827
|
}
|
|
575
828
|
}
|
|
576
|
-
class
|
|
577
|
-
constructor(
|
|
578
|
-
this.readerId = null, this.readyTimeoutMs =
|
|
829
|
+
class je {
|
|
830
|
+
constructor(n) {
|
|
831
|
+
this.readerId = null, this.readyTimeoutMs = n?.readyTimeoutMs ?? Qe, this.requestTimeoutMs = n?.requestTimeoutMs ?? ze;
|
|
579
832
|
}
|
|
580
|
-
configureTimeouts(
|
|
581
|
-
this.readyTimeoutMs =
|
|
833
|
+
configureTimeouts(n) {
|
|
834
|
+
this.readyTimeoutMs = n?.readyTimeoutMs ?? this.readyTimeoutMs, this.requestTimeoutMs = n?.requestTimeoutMs ?? this.requestTimeoutMs;
|
|
582
835
|
}
|
|
583
|
-
setReaderId(
|
|
584
|
-
this.readerId =
|
|
836
|
+
setReaderId(n) {
|
|
837
|
+
this.readerId = n;
|
|
585
838
|
}
|
|
586
839
|
getReaderId() {
|
|
587
840
|
return this.readerId;
|
|
588
841
|
}
|
|
589
|
-
async request(
|
|
590
|
-
const a = await this.requestRaw(
|
|
842
|
+
async request(n, e, i, r) {
|
|
843
|
+
const a = await this.requestRaw(n, e, i, r);
|
|
591
844
|
if (a.ok)
|
|
592
845
|
return a.result;
|
|
593
|
-
throw new
|
|
846
|
+
throw new $e(
|
|
594
847
|
a.error.code,
|
|
595
848
|
a.error.message,
|
|
596
849
|
a.error.details
|
|
597
850
|
);
|
|
598
851
|
}
|
|
599
|
-
async requestRaw(
|
|
852
|
+
async requestRaw(n, e, i, r) {
|
|
600
853
|
if (!this.readerId)
|
|
601
854
|
return {
|
|
602
855
|
ok: !1,
|
|
@@ -616,42 +869,45 @@ class Pe {
|
|
|
616
869
|
message: "Editor adapter is not available."
|
|
617
870
|
}
|
|
618
871
|
};
|
|
619
|
-
const
|
|
620
|
-
protocol:
|
|
621
|
-
version:
|
|
622
|
-
requestId:
|
|
872
|
+
const s = {
|
|
873
|
+
protocol: se,
|
|
874
|
+
version: oe,
|
|
875
|
+
requestId: We(),
|
|
623
876
|
readerId: this.readerId,
|
|
624
|
-
tool:
|
|
877
|
+
tool: n,
|
|
625
878
|
method: e,
|
|
626
879
|
params: i
|
|
627
880
|
};
|
|
628
881
|
return this.withTimeout(
|
|
629
|
-
a.request(
|
|
630
|
-
|
|
882
|
+
a.request(s),
|
|
883
|
+
s.requestId,
|
|
631
884
|
r?.timeoutMs ?? this.requestTimeoutMs
|
|
632
885
|
);
|
|
633
886
|
}
|
|
634
887
|
getCapabilities() {
|
|
635
|
-
return this.readerId ?
|
|
888
|
+
return this.readerId ? p()?.getCapabilities(this.readerId) ?? null : null;
|
|
889
|
+
}
|
|
890
|
+
async waitForReady(n) {
|
|
891
|
+
return this.readerId ? !!await this.waitForAdapter(this.readerId, n?.timeoutMs) : !1;
|
|
636
892
|
}
|
|
637
|
-
async waitForAdapter(
|
|
638
|
-
const i =
|
|
639
|
-
return i?.getCapabilities(
|
|
893
|
+
async waitForAdapter(n, e = this.readyTimeoutMs) {
|
|
894
|
+
const i = p();
|
|
895
|
+
return i?.getCapabilities(n) ? i : new Promise((r) => {
|
|
640
896
|
let a;
|
|
641
|
-
const
|
|
642
|
-
a && clearTimeout(a), globalThis.removeEventListener(P,
|
|
643
|
-
},
|
|
644
|
-
if ((
|
|
897
|
+
const s = () => {
|
|
898
|
+
a && clearTimeout(a), globalThis.removeEventListener(P, o);
|
|
899
|
+
}, o = (u) => {
|
|
900
|
+
if ((u instanceof CustomEvent ? u.detail : void 0)?.readerId !== n)
|
|
645
901
|
return;
|
|
646
|
-
const
|
|
647
|
-
|
|
902
|
+
const l = p();
|
|
903
|
+
s(), r(l ?? null);
|
|
648
904
|
};
|
|
649
|
-
globalThis.addEventListener(P,
|
|
650
|
-
|
|
905
|
+
globalThis.addEventListener(P, o), a = setTimeout(() => {
|
|
906
|
+
s(), r(p()?.getCapabilities(n) ? p() : null);
|
|
651
907
|
}, e);
|
|
652
908
|
});
|
|
653
909
|
}
|
|
654
|
-
async withTimeout(
|
|
910
|
+
async withTimeout(n, e, i) {
|
|
655
911
|
return new Promise((r) => {
|
|
656
912
|
const a = setTimeout(() => {
|
|
657
913
|
r({
|
|
@@ -663,13 +919,13 @@ class Pe {
|
|
|
663
919
|
}
|
|
664
920
|
});
|
|
665
921
|
}, i);
|
|
666
|
-
|
|
922
|
+
n.then((s) => r(s)).catch((s) => {
|
|
667
923
|
r({
|
|
668
924
|
ok: !1,
|
|
669
925
|
requestId: e,
|
|
670
926
|
error: {
|
|
671
927
|
code: "EXECUTION_FAILED",
|
|
672
|
-
message:
|
|
928
|
+
message: s instanceof Error ? s.message : String(s)
|
|
673
929
|
}
|
|
674
930
|
});
|
|
675
931
|
}).finally(() => {
|
|
@@ -687,39 +943,68 @@ const A = {
|
|
|
687
943
|
pageMode: 0,
|
|
688
944
|
zoomLevel: 100
|
|
689
945
|
};
|
|
690
|
-
class
|
|
946
|
+
class Ye {
|
|
691
947
|
constructor() {
|
|
692
948
|
this.state = { ...A };
|
|
693
949
|
}
|
|
694
950
|
reset() {
|
|
695
951
|
this.state = { ...A };
|
|
696
952
|
}
|
|
697
|
-
update(
|
|
698
|
-
|
|
953
|
+
update(n) {
|
|
954
|
+
n && (this.state = {
|
|
699
955
|
...this.state,
|
|
700
|
-
...
|
|
956
|
+
...n,
|
|
957
|
+
annotations: n.annotations ? [...n.annotations] : this.state.annotations,
|
|
958
|
+
digitalSignatures: n.digitalSignatures ? [...n.digitalSignatures] : this.state.digitalSignatures
|
|
701
959
|
});
|
|
702
960
|
}
|
|
703
|
-
setDocumentOpened(
|
|
961
|
+
setDocumentOpened(n) {
|
|
704
962
|
this.state = {
|
|
705
963
|
...this.state,
|
|
706
|
-
documentOpened:
|
|
964
|
+
documentOpened: n
|
|
707
965
|
};
|
|
708
966
|
}
|
|
709
967
|
snapshot() {
|
|
710
|
-
return {
|
|
968
|
+
return {
|
|
969
|
+
...this.state,
|
|
970
|
+
annotations: this.state.annotations ? [...this.state.annotations] : void 0,
|
|
971
|
+
digitalSignatures: this.state.digitalSignatures ? [...this.state.digitalSignatures] : void 0
|
|
972
|
+
};
|
|
711
973
|
}
|
|
712
974
|
}
|
|
713
|
-
|
|
975
|
+
const Xe = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t : void 0, z = (t) => typeof t == "object" && t !== null && !Array.isArray(t), M = (t) => {
|
|
976
|
+
if (!z(t))
|
|
977
|
+
return;
|
|
978
|
+
const n = {};
|
|
979
|
+
return typeof t.currentPage == "number" && (n.currentPage = t.currentPage), typeof t.documentType == "string" && (n.documentType = t.documentType), typeof t.totalPages == "number" ? n.totalPages = t.totalPages : typeof t.pageCount == "number" && (n.totalPages = t.pageCount), typeof t.zoomLevel == "number" && (n.zoomLevel = t.zoomLevel), Object.keys(n).length > 0 ? n : void 0;
|
|
980
|
+
}, Je = (t) => {
|
|
981
|
+
if (!z(t))
|
|
982
|
+
return {
|
|
983
|
+
success: !0,
|
|
984
|
+
status: "ok"
|
|
985
|
+
};
|
|
986
|
+
const n = M(t.state), e = M(t), i = typeof t.error == "string" ? t.error : void 0, r = typeof t.success == "boolean" ? t.success : !i, a = typeof t.status == "string" ? t.status : r ? "ok" : "error";
|
|
987
|
+
return {
|
|
988
|
+
success: r,
|
|
989
|
+
status: a,
|
|
990
|
+
error: i,
|
|
991
|
+
state: n ?? e
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
class Ze {
|
|
714
995
|
constructor() {
|
|
715
|
-
this.annotationEvents = [], this.annotationPersist = [], this.annotationRetrieve = [], this.digitalAnnotationRetrieve = [], this.digitalSignatureParse = [], this.digitalSignatureRetrieve = [], this.documentClosed = [], this.documentOpened = [], this.documentSaved = [], this.pageChange = [], this.pageModeChange = [];
|
|
996
|
+
this.annotationEvents = [], this.annotationPersist = [], this.annotationRetrieve = [], this.digitalAnnotationRetrieve = [], this.digitalSign = [], this.digitalSignatureParse = [], this.digitalSignatureRetrieve = [], this.documentClosed = [], this.documentOpened = [], this.documentSaved = [], this.pageChange = [], this.pageModeChange = [], this.signServerAuth = [];
|
|
716
997
|
}
|
|
717
|
-
emit(
|
|
718
|
-
switch (
|
|
998
|
+
emit(n, e) {
|
|
999
|
+
switch (n) {
|
|
719
1000
|
case "documentOpened":
|
|
720
|
-
case "documentLoaded":
|
|
721
|
-
|
|
1001
|
+
case "documentLoaded": {
|
|
1002
|
+
const i = Je(e);
|
|
1003
|
+
this.documentOpened.forEach(
|
|
1004
|
+
(r) => r(i.status ?? "ok", i.error ?? "", i)
|
|
1005
|
+
);
|
|
722
1006
|
return;
|
|
1007
|
+
}
|
|
723
1008
|
case "documentSaved":
|
|
724
1009
|
this.documentSaved.forEach((i) => i(e));
|
|
725
1010
|
return;
|
|
@@ -741,7 +1026,10 @@ class Ae {
|
|
|
741
1026
|
case "annotationEvent": {
|
|
742
1027
|
const i = e;
|
|
743
1028
|
this.annotationEvents.forEach(
|
|
744
|
-
(r) => r(
|
|
1029
|
+
(r) => r(
|
|
1030
|
+
i.event ?? "annotationEvent",
|
|
1031
|
+
Xe(i.payload)
|
|
1032
|
+
)
|
|
745
1033
|
);
|
|
746
1034
|
return;
|
|
747
1035
|
}
|
|
@@ -756,6 +1044,9 @@ class Ae {
|
|
|
756
1044
|
(i) => i(Array.isArray(e) ? e : [])
|
|
757
1045
|
);
|
|
758
1046
|
return;
|
|
1047
|
+
case "digitalSign":
|
|
1048
|
+
this.digitalSign.forEach((i) => i(e));
|
|
1049
|
+
return;
|
|
759
1050
|
case "digitalSignatureRetrieve":
|
|
760
1051
|
this.digitalSignatureRetrieve.forEach(
|
|
761
1052
|
(i) => i(Array.isArray(e) ? e : [])
|
|
@@ -766,96 +1057,88 @@ class Ae {
|
|
|
766
1057
|
(i) => i(Array.isArray(e) ? e : [])
|
|
767
1058
|
);
|
|
768
1059
|
return;
|
|
1060
|
+
case "signServerAuth":
|
|
1061
|
+
this.signServerAuth.forEach((i) => i(e));
|
|
1062
|
+
return;
|
|
769
1063
|
default:
|
|
770
1064
|
return;
|
|
771
1065
|
}
|
|
772
1066
|
}
|
|
773
1067
|
}
|
|
774
|
-
const
|
|
1068
|
+
const et = [
|
|
775
1069
|
"documentLoaded",
|
|
776
1070
|
"documentStateChange",
|
|
777
1071
|
"documentError"
|
|
778
|
-
],
|
|
779
|
-
appUrl:
|
|
780
|
-
configuration:
|
|
781
|
-
element:
|
|
782
|
-
}),
|
|
783
|
-
if (typeof
|
|
784
|
-
const
|
|
785
|
-
if (!
|
|
786
|
-
throw new Error(`Reader container "${
|
|
787
|
-
if (!(
|
|
788
|
-
throw new Error(`Reader container "${
|
|
789
|
-
return
|
|
1072
|
+
], tt = "readerReady", nt = "readerUnload", T = "readerError", it = () => typeof globalThis.crypto?.randomUUID == "function" ? globalThis.crypto.randomUUID() : `rhc-reader-${Date.now()}-${Math.random().toString(36).slice(2)}`, w = (t, n) => ({
|
|
1073
|
+
appUrl: n?.appUrl ?? null,
|
|
1074
|
+
configuration: n,
|
|
1075
|
+
element: t
|
|
1076
|
+
}), rt = (t) => {
|
|
1077
|
+
if (typeof t == "string") {
|
|
1078
|
+
const n = document.getElementById(t);
|
|
1079
|
+
if (!n)
|
|
1080
|
+
throw new Error(`Reader container "${t}" was not found.`);
|
|
1081
|
+
if (!(n instanceof HTMLDivElement))
|
|
1082
|
+
throw new Error(`Reader container "${t}" must be a div element.`);
|
|
1083
|
+
return n;
|
|
790
1084
|
}
|
|
791
|
-
if (!(
|
|
1085
|
+
if (!(t instanceof HTMLDivElement))
|
|
792
1086
|
throw new Error("Reader container must be a div element.");
|
|
793
|
-
return
|
|
794
|
-
},
|
|
795
|
-
const
|
|
796
|
-
return (
|
|
797
|
-
},
|
|
798
|
-
const e =
|
|
1087
|
+
return t;
|
|
1088
|
+
}, at = () => {
|
|
1089
|
+
const t = typeof globalThis.matchMedia == "function";
|
|
1090
|
+
return (t ? globalThis.matchMedia("(prefers-contrast: more)").matches : !1) ? "high-contrast" : (t ? globalThis.matchMedia("(prefers-color-scheme: dark)").matches : !1) ? "dark" : "light";
|
|
1091
|
+
}, I = (t, n) => {
|
|
1092
|
+
const e = t;
|
|
799
1093
|
if (typeof e.addEventListener == "function") {
|
|
800
|
-
e.addEventListener("change",
|
|
1094
|
+
e.addEventListener("change", n);
|
|
801
1095
|
return;
|
|
802
1096
|
}
|
|
803
|
-
typeof e.addListener == "function" && e.addListener(
|
|
804
|
-
},
|
|
805
|
-
const e =
|
|
1097
|
+
typeof e.addListener == "function" && e.addListener(n);
|
|
1098
|
+
}, O = (t, n) => {
|
|
1099
|
+
const e = t;
|
|
806
1100
|
if (typeof e.removeEventListener == "function") {
|
|
807
|
-
e.removeEventListener("change",
|
|
1101
|
+
e.removeEventListener("change", n);
|
|
808
1102
|
return;
|
|
809
1103
|
}
|
|
810
|
-
typeof e.removeListener == "function" && e.removeListener(
|
|
811
|
-
},
|
|
812
|
-
t.style
|
|
813
|
-
},
|
|
814
|
-
const e =
|
|
1104
|
+
typeof e.removeListener == "function" && e.removeListener(n);
|
|
1105
|
+
}, st = (t) => {
|
|
1106
|
+
t.style.display || (t.style.display = "block"), t.style.width || (t.style.width = "100%"), t.style.height || (t.style.height = "100%");
|
|
1107
|
+
}, _ = (t, n) => {
|
|
1108
|
+
const e = n;
|
|
815
1109
|
if (!e)
|
|
816
|
-
return
|
|
1110
|
+
return t.removeAttribute("theme"), null;
|
|
817
1111
|
if (e !== "auto")
|
|
818
|
-
return
|
|
1112
|
+
return t.setAttribute("theme", e), null;
|
|
819
1113
|
const i = () => {
|
|
820
|
-
|
|
1114
|
+
t.setAttribute("theme", at());
|
|
821
1115
|
};
|
|
822
1116
|
if (i(), typeof globalThis.matchMedia != "function")
|
|
823
1117
|
return null;
|
|
824
|
-
const r = globalThis.matchMedia("(prefers-color-scheme: dark)"), a = globalThis.matchMedia("(prefers-contrast: more)"),
|
|
1118
|
+
const r = globalThis.matchMedia("(prefers-color-scheme: dark)"), a = globalThis.matchMedia("(prefers-contrast: more)"), s = () => {
|
|
825
1119
|
i();
|
|
826
1120
|
};
|
|
827
|
-
return
|
|
828
|
-
|
|
1121
|
+
return I(r, s), I(a, s), () => {
|
|
1122
|
+
O(r, s), O(a, s);
|
|
829
1123
|
};
|
|
830
1124
|
};
|
|
831
|
-
class
|
|
832
|
-
constructor(
|
|
833
|
-
this.bridge = new
|
|
1125
|
+
class ot {
|
|
1126
|
+
constructor(n) {
|
|
1127
|
+
this.bridge = new je(), this.callbacks = new Ze(), this.readerState = new Ye(), this.bridgeToolContext = {
|
|
834
1128
|
bridge: this.bridge,
|
|
835
1129
|
callbacks: this.callbacks,
|
|
836
1130
|
debug: () => this.debugEnabled,
|
|
837
1131
|
onAsyncError: (e) => this.reportAdapterError(e),
|
|
838
1132
|
state: this.readerState
|
|
839
|
-
}, this.documentTool = new
|
|
840
|
-
"signServer",
|
|
841
|
-
this.bridgeToolContext
|
|
842
|
-
), this.digitalSignTool = p(
|
|
843
|
-
"digitalSign",
|
|
844
|
-
this.bridgeToolContext
|
|
845
|
-
), this.symbologyTool = p(
|
|
846
|
-
"symbology",
|
|
847
|
-
this.bridgeToolContext
|
|
848
|
-
), this.annotationTool = this.createAnnotationTool(), this.templateSignTool = p(
|
|
849
|
-
"templateSign",
|
|
850
|
-
this.bridgeToolContext
|
|
851
|
-
), this.pdfFormFiller = new te(this.bridgeToolContext), this.networkingTool = new X(this.bridgeToolContext), this.cryptoTool = p(
|
|
852
|
-
"crypto",
|
|
853
|
-
this.bridgeToolContext
|
|
854
|
-
), this.readyCallbacks = [], this.unloadCallbacks = [], this.debugEnabled = !1, this.isReady = !1, this.removed = !1, this.mountToken = 0, this.hostContainer = null, this.readerElement = null, this.readerId = null, this.normalizedConfiguration = null, this.nativeEventCleanupCallbacks = [], this.themeCleanup = null, this.enableDebug = (e) => {
|
|
1133
|
+
}, this.documentTool = new le(this.bridgeToolContext), this.uiTool = new Be(this.bridgeToolContext), this.pageTool = new fe(this.bridgeToolContext), this.pageArrangeTool = new Se(this.bridgeToolContext), this.findTool = new he(this.bridgeToolContext), this.signServerTool = new Ie(this.bridgeToolContext), this.digitalSignTool = new ae(this.bridgeToolContext), this.symbologyTool = new _e(this.bridgeToolContext), this.annotationTool = new te(this.bridgeToolContext), this.templateSignTool = new Fe(this.bridgeToolContext), this.pdfFormFiller = new Te(this.bridgeToolContext), this.networkingTool = new me(this.bridgeToolContext), this.cryptoTool = new ie(this.bridgeToolContext), this.securityTool = new Me(this.bridgeToolContext), this.readyCallbacks = [], this.unloadCallbacks = [], this.debugEnabled = !1, this.isReady = !1, this.removed = !1, this.mountToken = 0, this.hostContainer = null, this.readerElement = null, this.readerId = null, this.normalizedConfiguration = null, this.nativeEventCleanupCallbacks = [], this.themeCleanup = null, this.enableDebug = (e) => {
|
|
855
1134
|
this.debugEnabled = e;
|
|
856
|
-
}, this.changeLanguage = () => {
|
|
857
|
-
|
|
858
|
-
|
|
1135
|
+
}, this.changeLanguage = (e) => {
|
|
1136
|
+
this.readerElement && this.readerElement.setAttribute("language", e);
|
|
1137
|
+
}, this.setThemeMode = (e) => {
|
|
1138
|
+
this.themeCleanup?.(), this.themeCleanup = null, this.normalizedConfiguration = this.normalizedConfiguration ? {
|
|
1139
|
+
...this.normalizedConfiguration,
|
|
1140
|
+
theme: e
|
|
1141
|
+
} : null, this.readerElement && (this.themeCleanup = _(this.readerElement, e));
|
|
859
1142
|
}, this.setSessionUser = (e) => {
|
|
860
1143
|
this.sessionUser = e;
|
|
861
1144
|
}, this.setSessionUserId = (e) => {
|
|
@@ -879,26 +1162,33 @@ class Ue {
|
|
|
879
1162
|
}, this.setReaderEventListener = (e) => {
|
|
880
1163
|
this.readerEventListener = e;
|
|
881
1164
|
}, this.embedReader = (e, i, r) => {
|
|
882
|
-
const a =
|
|
883
|
-
|
|
884
|
-
const
|
|
885
|
-
this.removeReader(), this.mountToken =
|
|
1165
|
+
const a = rt(e), s = G(i);
|
|
1166
|
+
H(s);
|
|
1167
|
+
const o = Ke(s, r), u = this.mountToken + 1;
|
|
1168
|
+
this.removeReader(), this.mountToken = u, this.removed = !1, this.hostContainer = a, this.normalizedConfiguration = o, this.mountReader(a, o, u);
|
|
886
1169
|
}, this.removeReader = () => {
|
|
887
1170
|
const e = !!(this.readerElement || this.hostContainer);
|
|
888
1171
|
if (this.mountToken += 1, this.cleanupNativeEventForwarders(), this.cleanupThemeBinding(), this.readerElement?.parentNode && this.readerElement.parentNode.removeChild(this.readerElement), this.readerElement = null, this.readerId = null, this.bridge.setReaderId(null), this.readerState.reset(), this.hostContainer = null, this.normalizedConfiguration = null, this.isReady = !1, this.removed = !0, !e)
|
|
889
1172
|
return;
|
|
890
|
-
const i =
|
|
891
|
-
this.emitReaderEvent(
|
|
892
|
-
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getFindTool = () => this.findTool, this.getSignServerTool = () => this.signServerTool, this.getDigitalSignTool = () => this.digitalSignTool, this.getSymbologyTool = () => this.symbologyTool, this.getAnnotationTool = () => this.annotationTool, this.getTemplateSignTool = () => this.templateSignTool, this.getPdfFormFiller = () => this.pdfFormFiller, this.getNetworkingTool = () => this.networkingTool, this.getCryptoTool = () => this.cryptoTool, this.createDigitalSignOptions = () => new
|
|
1173
|
+
const i = w(null, null);
|
|
1174
|
+
this.emitReaderEvent(nt, i), this.unloadCallbacks.forEach((r) => r());
|
|
1175
|
+
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getPageArrangeTool = () => this.pageArrangeTool, this.getFindTool = () => this.findTool, this.getSignServerTool = () => this.signServerTool, this.getDigitalSignTool = () => this.digitalSignTool, this.getSymbologyTool = () => this.symbologyTool, this.getAnnotationTool = () => this.annotationTool, this.getTemplateSignTool = () => this.templateSignTool, this.getPdfFormFiller = () => this.pdfFormFiller, this.getNetworkingTool = () => this.networkingTool, this.getCryptoTool = () => this.cryptoTool, this.getSecurityTool = () => this.securityTool, this.createDigitalSignOptions = () => new De(), this.createKVField = (e, i, r) => new Ce(e, i, r), this.mountReader = async (e, i, r) => {
|
|
893
1176
|
try {
|
|
894
|
-
if (await
|
|
1177
|
+
if (await He(i.appUrl), this.mountToken !== r)
|
|
895
1178
|
return;
|
|
896
|
-
const a = document.createElement(
|
|
897
|
-
|
|
1179
|
+
const a = document.createElement(g), s = it();
|
|
1180
|
+
a.setAttribute(K, s), this.readerId = s, this.bridge.setReaderId(s), st(a);
|
|
1181
|
+
const o = i.compactViewer === !0 && i.keepPCMenu !== !0;
|
|
1182
|
+
if (a.toggleAttribute("data-sdk-compact-mode", o), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup = _(a, i.theme), this.bindNativeReaderEvents(a), e.replaceChildren(a), this.readerElement = a, await Promise.resolve(), this.mountToken !== r)
|
|
898
1183
|
return;
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
1184
|
+
const u = await this.bridge.waitForReady();
|
|
1185
|
+
if (this.mountToken !== r)
|
|
1186
|
+
return;
|
|
1187
|
+
if (!u)
|
|
1188
|
+
throw new Error("Editor adapter is not available.");
|
|
1189
|
+
this.isReady = !0;
|
|
1190
|
+
const c = w(a, i);
|
|
1191
|
+
this.emitReaderEvent(tt, c), this.readyCallbacks.forEach((l) => l());
|
|
902
1192
|
} catch (a) {
|
|
903
1193
|
if (this.mountToken !== r)
|
|
904
1194
|
return;
|
|
@@ -915,10 +1205,10 @@ class Ue {
|
|
|
915
1205
|
C,
|
|
916
1206
|
i
|
|
917
1207
|
);
|
|
918
|
-
}),
|
|
919
|
-
const a = (
|
|
920
|
-
const
|
|
921
|
-
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r,
|
|
1208
|
+
}), et.forEach((r) => {
|
|
1209
|
+
const a = (s) => {
|
|
1210
|
+
const o = s instanceof CustomEvent ? s.detail : s;
|
|
1211
|
+
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r, o), r === "documentError" && this.emitReaderEvent(T, o);
|
|
922
1212
|
};
|
|
923
1213
|
e.addEventListener(r, a), this.nativeEventCleanupCallbacks.push(() => {
|
|
924
1214
|
e.removeEventListener(r, a);
|
|
@@ -931,102 +1221,41 @@ class Ue {
|
|
|
931
1221
|
}, this.emitReaderEvent = (e, i) => {
|
|
932
1222
|
this.readerEventListener?.(e, i);
|
|
933
1223
|
}, this.reportReaderError = (e) => {
|
|
934
|
-
this.isReady = !1, this.debugEnabled && console.error("[RHC Office SDK] Reader mount failed", e), this.emitReaderEvent(
|
|
1224
|
+
this.isReady = !1, this.debugEnabled && console.error("[RHC Office SDK] Reader mount failed", e), this.emitReaderEvent(T, e);
|
|
935
1225
|
}, this.reportAdapterError = (e) => {
|
|
936
|
-
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(
|
|
1226
|
+
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(T, e);
|
|
937
1227
|
}, this.bridge.configureTimeouts({
|
|
938
|
-
readyTimeoutMs:
|
|
939
|
-
requestTimeoutMs:
|
|
1228
|
+
readyTimeoutMs: n?.readyTimeoutMs,
|
|
1229
|
+
requestTimeoutMs: n?.requestTimeoutMs
|
|
940
1230
|
});
|
|
941
1231
|
}
|
|
942
|
-
createAnnotationTool() {
|
|
943
|
-
return c(
|
|
944
|
-
"annotation",
|
|
945
|
-
{
|
|
946
|
-
addAnnotationEventCallback: {
|
|
947
|
-
kind: "callbackRegister",
|
|
948
|
-
callback: (t, e) => {
|
|
949
|
-
const i = e[0];
|
|
950
|
-
typeof i == "function" && t.annotationEvents.push(i);
|
|
951
|
-
}
|
|
952
|
-
},
|
|
953
|
-
addAnnotationPersistCallback: {
|
|
954
|
-
kind: "callbackRegister",
|
|
955
|
-
callback: (t, e) => {
|
|
956
|
-
const i = e[0];
|
|
957
|
-
typeof i == "function" && t.annotationPersist.push(i);
|
|
958
|
-
}
|
|
959
|
-
},
|
|
960
|
-
addAnnotationRetrieveCallback: {
|
|
961
|
-
kind: "callbackRegister",
|
|
962
|
-
callback: (t, e) => {
|
|
963
|
-
const i = e[0];
|
|
964
|
-
typeof i == "function" && t.annotationRetrieve.push(i);
|
|
965
|
-
}
|
|
966
|
-
},
|
|
967
|
-
addDigitalAnnotationRetrieveCallback: {
|
|
968
|
-
kind: "callbackRegister",
|
|
969
|
-
callback: (t, e) => {
|
|
970
|
-
const i = e[0];
|
|
971
|
-
typeof i == "function" && t.digitalAnnotationRetrieve.push(
|
|
972
|
-
i
|
|
973
|
-
);
|
|
974
|
-
}
|
|
975
|
-
},
|
|
976
|
-
isInAnnotationMode: {
|
|
977
|
-
kind: "stateGetter",
|
|
978
|
-
state: (t) => t.annotationEnabled
|
|
979
|
-
},
|
|
980
|
-
getAnnotations: { kind: "stateGetter", state: () => [] },
|
|
981
|
-
getAnnotationsCount: { kind: "stateGetter", state: () => 0 },
|
|
982
|
-
queryAnnotationsBy: { kind: "stateGetter", state: () => [] },
|
|
983
|
-
setToolSource: { kind: "command" },
|
|
984
|
-
openAnnotationView: { kind: "command" },
|
|
985
|
-
closeAnnotationView: { kind: "command" },
|
|
986
|
-
openTextAnnotationView: { kind: "command" },
|
|
987
|
-
setTextAnnotationFontColor: { kind: "command" },
|
|
988
|
-
setTextAnnotationFontSize: { kind: "command" },
|
|
989
|
-
closeTextAnnotationView: { kind: "command" },
|
|
990
|
-
createTextAnnotation: { kind: "command" },
|
|
991
|
-
setPersistToDocument: { kind: "command" },
|
|
992
|
-
saveAnnotations: { kind: "callbackQuery" },
|
|
993
|
-
saveTextAnnotations: { kind: "command" },
|
|
994
|
-
clearAnnotations: { kind: "command" },
|
|
995
|
-
clearTextAnnotations: { kind: "command" },
|
|
996
|
-
undoAnnotation: { kind: "command" },
|
|
997
|
-
redoAnnotation: { kind: "command" },
|
|
998
|
-
selectAnnotationTool: { kind: "command" },
|
|
999
|
-
showAnnotationColorPicker: { kind: "command" },
|
|
1000
|
-
setAnnotationPenType: { kind: "command" },
|
|
1001
|
-
appendAnnotations: { kind: "callbackQuery" },
|
|
1002
|
-
batchAppendAnnotations: { kind: "callbackQuery" },
|
|
1003
|
-
setAnnotationPenColor: { kind: "command" },
|
|
1004
|
-
setAnnotationPenWidth: { kind: "command" },
|
|
1005
|
-
setAnnotationPenThickness: { kind: "command" },
|
|
1006
|
-
enableAnnotationsInfoView: { kind: "command" },
|
|
1007
|
-
enableAnnotationsDeletion: { kind: "command" },
|
|
1008
|
-
enableAnnotationsDeletionOnlyByAuthor: { kind: "command" },
|
|
1009
|
-
listDigitalStamps: { kind: "command" },
|
|
1010
|
-
listAnnotations: { kind: "command" },
|
|
1011
|
-
deleteAnnotationsBy: { kind: "command" },
|
|
1012
|
-
deleteAnnotationsById: { kind: "command" },
|
|
1013
|
-
addDigitalAnnotation: { kind: "command" },
|
|
1014
|
-
addInkAnnotationCallback: { kind: "callbackRegister" }
|
|
1015
|
-
},
|
|
1016
|
-
this.bridgeToolContext
|
|
1017
|
-
);
|
|
1018
|
-
}
|
|
1019
1232
|
}
|
|
1020
|
-
const
|
|
1233
|
+
const mt = (t) => new ot(t);
|
|
1021
1234
|
export {
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1235
|
+
te as AnnotationToolImpl,
|
|
1236
|
+
ie as CryptoToolImpl,
|
|
1237
|
+
gt as DIGITAL_SIGN_DEFAULTS,
|
|
1238
|
+
De as DigitalSignOptions,
|
|
1239
|
+
ae as DigitalSignToolImpl,
|
|
1240
|
+
ot as DocumentSDK,
|
|
1241
|
+
le as DocumentToolImpl,
|
|
1242
|
+
he as FindToolImpl,
|
|
1243
|
+
Ce as KVField,
|
|
1244
|
+
me as NetworkingToolImpl,
|
|
1245
|
+
Se as PageArrangeToolImpl,
|
|
1246
|
+
fe as PageToolImpl,
|
|
1247
|
+
Te as PdfFormFillerImpl,
|
|
1248
|
+
Me as SecurityToolImpl,
|
|
1249
|
+
Ie as SignServerToolImpl,
|
|
1250
|
+
_e as SymbologyToolImpl,
|
|
1251
|
+
Fe as TemplateSignToolImpl,
|
|
1252
|
+
Be as UIToolImpl,
|
|
1253
|
+
W as WatermarkDisplay,
|
|
1254
|
+
mt as createNewDocumentSdk,
|
|
1255
|
+
dt as getDigitalSignEnvironment,
|
|
1256
|
+
ut as initializeDigitalSignEnvironment,
|
|
1257
|
+
ct as patchDigitalSignEnvironment,
|
|
1258
|
+
ht as resetDigitalSignEnvironment,
|
|
1259
|
+
lt as setDigitalSignEnvironment
|
|
1031
1260
|
};
|
|
1032
1261
|
//# sourceMappingURL=index.js.map
|