@rhc-office/sdk 6.6.395 → 6.6.398
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/annotation-tool.d.ts +10 -18
- package/dist/api/annotation-tool.d.ts.map +1 -1
- package/dist/api/document-tool.d.ts +16 -1
- package/dist/api/document-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/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/index.js +221 -206
- 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/DocumentToolImpl.d.ts +4 -0
- package/dist/tools/DocumentToolImpl.d.ts.map +1 -1
- package/dist/tools/SDKValueObjects.d.ts.map +1 -1
- package/dist/tools/UIToolImpl.d.ts.map +1 -1
- package/dist/viewer/AdapterProtocol.d.ts +11 -0
- package/dist/viewer/AdapterProtocol.d.ts.map +1 -1
- package/dist/viewer/BridgeToolAdapter.d.ts.map +1 -1
- package/dist/viewer/DocumentSDK.d.ts.map +1 -1
- package/dist/viewer/SdkLogger.d.ts +3 -0
- package/dist/viewer/SdkLogger.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/api/annotation-tool.ts +17 -18
- package/src/api/document-tool.ts +24 -0
- package/src/browser.ts +2 -2
- package/src/tools/DocumentToolImpl.ts +23 -0
- package/src/tools/SDKValueObjects.ts +4 -1
- package/src/tools/UIToolImpl.ts +2 -1
- package/src/viewer/AdapterProtocol.ts +12 -0
- package/src/viewer/BridgeToolAdapter.ts +12 -4
- package/src/viewer/DocumentSDK.ts +3 -2
- package/src/viewer/SdkLogger.ts +22 -0
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var ee = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.COMPACT = "compact", t.HIDE = "none", t))(ee || {});
|
|
2
|
+
const K = "RIGHT_CENTER", q = "REGULAR_ESM", z = "auto", f = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", A = {
|
|
3
3
|
defaults: {
|
|
4
4
|
bjca: {
|
|
5
5
|
pin: ""
|
|
6
6
|
},
|
|
7
7
|
deviceType: "client",
|
|
8
|
-
edgePosition:
|
|
8
|
+
edgePosition: K,
|
|
9
9
|
plugin: {
|
|
10
10
|
pin: "",
|
|
11
11
|
usbKeyType: 14
|
|
12
12
|
},
|
|
13
|
-
rsaMode:
|
|
14
|
-
signatureType:
|
|
13
|
+
rsaMode: z,
|
|
14
|
+
signatureType: q
|
|
15
15
|
},
|
|
16
16
|
signServer: {
|
|
17
17
|
authSource: "Password",
|
|
@@ -25,7 +25,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
25
25
|
usbKeyType: 14
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, G = (t) => ({
|
|
29
29
|
bjca: {
|
|
30
30
|
pin: t.bjca.pin
|
|
31
31
|
},
|
|
@@ -37,7 +37,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
37
37
|
},
|
|
38
38
|
rsaMode: t.rsaMode,
|
|
39
39
|
signatureType: t.signatureType
|
|
40
|
-
}),
|
|
40
|
+
}), H = (t) => ({
|
|
41
41
|
authSource: t.authSource,
|
|
42
42
|
defaultLogin: t.defaultLogin,
|
|
43
43
|
defaultPassword: t.defaultPassword,
|
|
@@ -49,8 +49,8 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
49
49
|
usbKeyType: t.usbKey.usbKeyType
|
|
50
50
|
}
|
|
51
51
|
}), m = (t) => ({
|
|
52
|
-
defaults:
|
|
53
|
-
signServer:
|
|
52
|
+
defaults: G(t.defaults),
|
|
53
|
+
signServer: H(t.signServer)
|
|
54
54
|
}), E = (t) => ({
|
|
55
55
|
defaults: t.defaults ? {
|
|
56
56
|
...t.defaults,
|
|
@@ -61,7 +61,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
61
61
|
...t.signServer,
|
|
62
62
|
usbKey: t.signServer.usbKey ? { ...t.signServer.usbKey } : void 0
|
|
63
63
|
} : void 0
|
|
64
|
-
}),
|
|
64
|
+
}), te = (t, n) => n ? {
|
|
65
65
|
bjca: {
|
|
66
66
|
pin: n.bjca?.pin ?? t.bjca.pin
|
|
67
67
|
},
|
|
@@ -73,7 +73,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
73
73
|
},
|
|
74
74
|
rsaMode: n.rsaMode ?? t.rsaMode,
|
|
75
75
|
signatureType: n.signatureType ?? t.signatureType
|
|
76
|
-
} :
|
|
76
|
+
} : G(t), ne = (t, n) => n ? {
|
|
77
77
|
authSource: n.authSource ?? t.authSource,
|
|
78
78
|
defaultLogin: n.defaultLogin ?? t.defaultLogin,
|
|
79
79
|
defaultPassword: n.defaultPassword ?? t.defaultPassword,
|
|
@@ -84,10 +84,10 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
84
84
|
checkCertificateBinding: n.usbKey?.checkCertificateBinding ?? t.usbKey.checkCertificateBinding,
|
|
85
85
|
usbKeyType: n.usbKey?.usbKeyType ?? t.usbKey.usbKeyType
|
|
86
86
|
}
|
|
87
|
-
} :
|
|
88
|
-
defaults:
|
|
89
|
-
signServer:
|
|
90
|
-
}),
|
|
87
|
+
} : H(t), Q = (t, n) => ({
|
|
88
|
+
defaults: te(t.defaults, n.defaults),
|
|
89
|
+
signServer: ne(t.signServer, n.signServer)
|
|
90
|
+
}), ie = (t, n) => {
|
|
91
91
|
const e = t.defaults?.bjca || n.defaults?.bjca ? {
|
|
92
92
|
...t.defaults?.bjca,
|
|
93
93
|
...n.defaults?.bjca
|
|
@@ -111,36 +111,36 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
111
111
|
...r ? { usbKey: r } : {}
|
|
112
112
|
} : void 0
|
|
113
113
|
};
|
|
114
|
-
},
|
|
115
|
-
const t =
|
|
116
|
-
return t[
|
|
114
|
+
}, re = () => globalThis, p = () => {
|
|
115
|
+
const t = re();
|
|
116
|
+
return t[f] || (t[f] = {
|
|
117
117
|
current: m(A),
|
|
118
118
|
defaults: m(A),
|
|
119
119
|
overrides: {}
|
|
120
|
-
}), t[
|
|
121
|
-
},
|
|
120
|
+
}), t[f];
|
|
121
|
+
}, yt = () => p().current, vt = () => {
|
|
122
122
|
const t = p();
|
|
123
123
|
return {
|
|
124
124
|
current: m(t.current),
|
|
125
125
|
defaults: m(t.defaults),
|
|
126
126
|
overrides: E(t.overrides)
|
|
127
127
|
};
|
|
128
|
-
},
|
|
128
|
+
}, Et = (t) => {
|
|
129
129
|
const n = p();
|
|
130
|
-
return n.defaults = m(t), n.current =
|
|
131
|
-
},
|
|
130
|
+
return n.defaults = m(t), n.current = Q(n.defaults, n.overrides), n.current;
|
|
131
|
+
}, At = (t) => {
|
|
132
132
|
const n = p();
|
|
133
133
|
return n.current = m(t), n.overrides = E(t), n.current;
|
|
134
|
-
},
|
|
134
|
+
}, Ct = (t) => {
|
|
135
135
|
const n = p();
|
|
136
|
-
return n.overrides =
|
|
137
|
-
},
|
|
136
|
+
return n.overrides = ie(n.overrides, E(t)), n.current = Q(n.current, t), n.current;
|
|
137
|
+
}, Pt = (t) => {
|
|
138
138
|
const n = p();
|
|
139
139
|
return t && (n.defaults = m(t)), n.overrides = {}, n.current = m(n.defaults), n.current;
|
|
140
|
-
},
|
|
141
|
-
EDGE_POSITION:
|
|
142
|
-
RSA_MODE:
|
|
143
|
-
SIGNATURE_TYPE:
|
|
140
|
+
}, Dt = {
|
|
141
|
+
EDGE_POSITION: K,
|
|
142
|
+
RSA_MODE: z,
|
|
143
|
+
SIGNATURE_TYPE: q
|
|
144
144
|
}, R = (t) => {
|
|
145
145
|
if (t.length !== 0)
|
|
146
146
|
return t.length === 1 ? t[0] : t;
|
|
@@ -166,8 +166,8 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
166
166
|
if (a.kind === "callbackQuery") {
|
|
167
167
|
const l = s.find((h) => typeof h == "function"), c = s.filter((h) => typeof h != "function");
|
|
168
168
|
e.bridge.request(t, o, R(c)).then((h) => {
|
|
169
|
-
const
|
|
170
|
-
l?.(
|
|
169
|
+
const Z = a.mapCallbackResult?.(h) ?? [h];
|
|
170
|
+
l?.(...Z);
|
|
171
171
|
}).catch(e.onAsyncError);
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
@@ -182,7 +182,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
),
|
|
185
|
+
), ae = (t) => typeof t == "object" && t !== null && !Array.isArray(t) && "id" in t, C = (t) => t.annotations?.filter(ae).map((n) => ({ ...n })) ?? [], se = (t) => {
|
|
186
186
|
switch (t) {
|
|
187
187
|
case "select":
|
|
188
188
|
case "pen":
|
|
@@ -202,7 +202,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
202
202
|
default:
|
|
203
203
|
return "none";
|
|
204
204
|
}
|
|
205
|
-
},
|
|
205
|
+
}, oe = {
|
|
206
206
|
addAnnotationEventCallback: {
|
|
207
207
|
kind: "callbackRegister",
|
|
208
208
|
callback: (t, n) => {
|
|
@@ -216,7 +216,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
216
216
|
},
|
|
217
217
|
getAnnotationMode: {
|
|
218
218
|
kind: "stateGetter",
|
|
219
|
-
state: (t) =>
|
|
219
|
+
state: (t) => se(t.annotationMode)
|
|
220
220
|
},
|
|
221
221
|
getAnnotations: {
|
|
222
222
|
kind: "stateGetter",
|
|
@@ -244,16 +244,16 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
244
244
|
setAnnotationPenWidth: { kind: "command" },
|
|
245
245
|
setAnnotationPenStyle: { kind: "command" }
|
|
246
246
|
};
|
|
247
|
-
class
|
|
247
|
+
class de {
|
|
248
248
|
constructor(n) {
|
|
249
249
|
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.openTextNoteCalloutDialog = (e) => this.adapter.openTextNoteCalloutDialog(e), this.getCustomStamps = () => this.adapter.getCustomStamps(), this.addCustomTextStamp = (e) => this.adapter.addCustomTextStamp(e), this.addCustomImageStamp = (e) => this.adapter.addCustomImageStamp(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 = u(
|
|
250
250
|
"annotation",
|
|
251
|
-
|
|
251
|
+
oe,
|
|
252
252
|
n
|
|
253
253
|
);
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
const
|
|
256
|
+
const ue = {
|
|
257
257
|
addAttachmentChangedCallback: {
|
|
258
258
|
kind: "callbackRegister",
|
|
259
259
|
callback: (t, n) => {
|
|
@@ -266,7 +266,7 @@ const se = {
|
|
|
266
266
|
deleteAttachment: { kind: "command", returnsResult: !0 },
|
|
267
267
|
getAttachmentFile: { kind: "query" },
|
|
268
268
|
getAttachments: { kind: "query" }
|
|
269
|
-
},
|
|
269
|
+
}, le = async (t) => {
|
|
270
270
|
if (t instanceof Uint8Array)
|
|
271
271
|
return t.slice();
|
|
272
272
|
if (t instanceof ArrayBuffer)
|
|
@@ -276,16 +276,16 @@ const se = {
|
|
|
276
276
|
return new Uint8Array(n.buffer.slice(n.byteOffset, n.byteOffset + n.byteLength));
|
|
277
277
|
}
|
|
278
278
|
return new Uint8Array(await t.arrayBuffer());
|
|
279
|
-
},
|
|
279
|
+
}, ce = (t, n) => {
|
|
280
280
|
const e = { ...n }, i = typeof File < "u" && t instanceof File, r = typeof Blob < "u" && t instanceof Blob;
|
|
281
281
|
if (i ? (e.fileName = e.fileName || t.name, e.mimeType = e.mimeType || t.type) : r && (e.fileName = e.fileName || "attachment.bin", e.mimeType = e.mimeType || t.type), e.fileName = typeof e.fileName == "string" ? e.fileName.trim() : "", !e.fileName)
|
|
282
282
|
throw new Error("Attachment fileName is required for binary attachment input.");
|
|
283
283
|
return e.mimeType = typeof e.mimeType == "string" ? e.mimeType.trim() : "", e.mimeType = e.mimeType || void 0, e;
|
|
284
284
|
};
|
|
285
|
-
class
|
|
285
|
+
class he {
|
|
286
286
|
constructor(n) {
|
|
287
287
|
this.getAttachments = () => this.adapter.getAttachments(), this.getAttachmentFile = (e) => this.adapter.getAttachmentFile(e), this.addAttachment = async (e, i) => {
|
|
288
|
-
const r = await
|
|
288
|
+
const r = await le(e), a = ce(e, i);
|
|
289
289
|
if (r.byteLength === 0)
|
|
290
290
|
throw new Error("Attachment content cannot be empty.");
|
|
291
291
|
if (typeof a.maxSizeBytes == "number" && r.byteLength > a.maxSizeBytes)
|
|
@@ -296,21 +296,21 @@ class ue {
|
|
|
296
296
|
});
|
|
297
297
|
}, this.deleteAttachment = (e, i) => this.adapter.deleteAttachment(e, i), this.clearAttachments = (e) => this.adapter.clearAttachments(e), this.addAttachmentChangedCallback = (e) => this.adapter.addAttachmentChangedCallback(e), this.adapter = u(
|
|
298
298
|
"attachment",
|
|
299
|
-
|
|
299
|
+
ue,
|
|
300
300
|
n
|
|
301
301
|
), this.addAttachmentCommand = this.adapter.addAttachment;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
const
|
|
304
|
+
const me = {
|
|
305
305
|
configSecurityProvider: { kind: "command" },
|
|
306
306
|
getSecurityProviders: { kind: "query" }
|
|
307
307
|
};
|
|
308
|
-
class
|
|
308
|
+
class ge {
|
|
309
309
|
constructor(n) {
|
|
310
|
-
this.configSecurityProvider = (e) => this.adapter.configSecurityProvider(e), this.getSecurityProviders = () => this.adapter.getSecurityProviders(), this.adapter = u("crypto",
|
|
310
|
+
this.configSecurityProvider = (e) => this.adapter.configSecurityProvider(e), this.getSecurityProviders = () => this.adapter.getSecurityProviders(), this.adapter = u("crypto", me, n);
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
const P = (t) => t.digitalSignatures ? [...t.digitalSignatures] : [],
|
|
313
|
+
const P = (t) => t.digitalSignatures ? [...t.digitalSignatures] : [], pe = {
|
|
314
314
|
addDigitalSignatureRetrieveCallback: {
|
|
315
315
|
kind: "callbackRegister",
|
|
316
316
|
callback: (t, n) => {
|
|
@@ -356,16 +356,16 @@ const P = (t) => t.digitalSignatures ? [...t.digitalSignatures] : [], he = {
|
|
|
356
356
|
enableDigitalSignatureInfoView: { kind: "command" },
|
|
357
357
|
enableDigitalSignatureRevocation: { kind: "command" }
|
|
358
358
|
};
|
|
359
|
-
class
|
|
359
|
+
class be {
|
|
360
360
|
constructor(n) {
|
|
361
361
|
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 = u(
|
|
362
362
|
"digitalSign",
|
|
363
|
-
|
|
363
|
+
pe,
|
|
364
364
|
n
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
const
|
|
368
|
+
const Se = "rhc-office.editor-adapter", fe = 1, Re = "__RHC_OFFICE_EDITOR_ADAPTER__", D = "rhcOfficeAdapterReady", M = "rhcOfficeAdapterEvent", j = "data-rhc-office-reader-id", ke = {
|
|
369
369
|
addDocumentOpenedCallback: {
|
|
370
370
|
kind: "callbackRegister",
|
|
371
371
|
callback: (t, n) => {
|
|
@@ -402,6 +402,10 @@ const ge = "rhc-office.editor-adapter", pe = 1, be = "__RHC_OFFICE_EDITOR_ADAPTE
|
|
|
402
402
|
kind: "callbackQuery",
|
|
403
403
|
mapCallbackResult: (t) => [t]
|
|
404
404
|
},
|
|
405
|
+
getCurrentDocument: { kind: "query" },
|
|
406
|
+
getOpenDocuments: { kind: "query" },
|
|
407
|
+
activateDocument: { kind: "query" },
|
|
408
|
+
closeDocumentBySessionId: { kind: "query" },
|
|
405
409
|
closeDocument: { kind: "callbackQuery" },
|
|
406
410
|
isDocumentOpened: {
|
|
407
411
|
kind: "stateGetter",
|
|
@@ -414,7 +418,7 @@ const ge = "rhc-office.editor-adapter", pe = 1, be = "__RHC_OFFICE_EDITOR_ADAPTE
|
|
|
414
418
|
print: { kind: "command" },
|
|
415
419
|
createPreview: { kind: "command" }
|
|
416
420
|
};
|
|
417
|
-
class
|
|
421
|
+
class Te {
|
|
418
422
|
constructor(n) {
|
|
419
423
|
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, i) => this.adapter.setUploadUrl(e, i), this.save = (e, i, r) => this.adapter.save(e, i, r), this.saveAs = (e) => {
|
|
420
424
|
const i = this.context.bridge.getReaderId();
|
|
@@ -426,41 +430,41 @@ class Se {
|
|
|
426
430
|
error: "Reader is not mounted or does not expose saveAs."
|
|
427
431
|
});
|
|
428
432
|
const r = document.querySelector(
|
|
429
|
-
`[${
|
|
433
|
+
`[${j}="${i}"]`
|
|
430
434
|
);
|
|
431
435
|
return typeof r?.saveAs == "function" ? r.saveAs(e) : this.adapter.saveAs(e);
|
|
432
|
-
}, 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 = u(
|
|
436
|
+
}, this.getDocumentContent = (e) => this.adapter.getDocumentContent(e), this.getCurrentDocument = () => this.adapter.getCurrentDocument(), this.getOpenDocuments = () => this.adapter.getOpenDocuments(), this.activateDocument = (e) => this.adapter.activateDocument(e), this.closeDocumentBySessionId = (e, i) => this.adapter.closeDocumentBySessionId(e, i), 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 = u(
|
|
433
437
|
"document",
|
|
434
|
-
|
|
438
|
+
ke,
|
|
435
439
|
n
|
|
436
440
|
);
|
|
437
441
|
}
|
|
438
442
|
}
|
|
439
|
-
const
|
|
443
|
+
const ye = {
|
|
440
444
|
clearFind: { kind: "command" },
|
|
441
445
|
findNext: { kind: "command" },
|
|
442
446
|
findPrevious: { kind: "command" }
|
|
443
447
|
};
|
|
444
|
-
class
|
|
448
|
+
class ve {
|
|
445
449
|
constructor(n) {
|
|
446
|
-
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter = u("find",
|
|
450
|
+
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter = u("find", ye, n);
|
|
447
451
|
}
|
|
448
452
|
}
|
|
449
|
-
const
|
|
453
|
+
const Ee = {
|
|
450
454
|
configFileUpload: { kind: "command" },
|
|
451
455
|
setHttpHeaders: { kind: "command" },
|
|
452
456
|
setHttpFormFields: { kind: "command" }
|
|
453
457
|
};
|
|
454
|
-
class
|
|
458
|
+
class Ae {
|
|
455
459
|
constructor(n) {
|
|
456
460
|
this.configFileUpload = (e) => this.adapter.configFileUpload(e), this.setHttpHeaders = (e) => this.adapter.setHttpHeaders(e), this.setHttpFormFields = (e) => this.adapter.setHttpFormFields(e), this.adapter = u(
|
|
457
461
|
"networking",
|
|
458
|
-
|
|
462
|
+
Ee,
|
|
459
463
|
n
|
|
460
464
|
);
|
|
461
465
|
}
|
|
462
466
|
}
|
|
463
|
-
const
|
|
467
|
+
const Ce = () => ({
|
|
464
468
|
clearContent: { kind: "command", returnsResult: !0 },
|
|
465
469
|
commit: { kind: "command", returnsResult: !0 },
|
|
466
470
|
deletePages: { kind: "command", returnsResult: !0 },
|
|
@@ -475,17 +479,17 @@ const ve = () => ({
|
|
|
475
479
|
rotateLeft: { kind: "command", returnsResult: !0 },
|
|
476
480
|
rotateRight: { kind: "command", returnsResult: !0 },
|
|
477
481
|
undo: { kind: "command", returnsResult: !0 }
|
|
478
|
-
}),
|
|
479
|
-
class
|
|
482
|
+
}), Pe = (t) => t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
483
|
+
class De {
|
|
480
484
|
constructor(n) {
|
|
481
|
-
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(
|
|
485
|
+
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(Pe(e), i), this.extractPages = (e, i) => this.adapter.extractPages(e, i), this.undo = () => this.adapter.undo(), this.commit = () => this.adapter.commit(), this.adapter = u(
|
|
482
486
|
"pageArrange",
|
|
483
|
-
|
|
487
|
+
Ce(),
|
|
484
488
|
n
|
|
485
489
|
);
|
|
486
490
|
}
|
|
487
491
|
}
|
|
488
|
-
const
|
|
492
|
+
const Me = (t) => ({
|
|
489
493
|
addPageChangeCallback: {
|
|
490
494
|
kind: "callbackRegister",
|
|
491
495
|
callback: (n, e) => {
|
|
@@ -535,16 +539,16 @@ const Ce = (t) => ({
|
|
|
535
539
|
gotoPreviousPage: { kind: "command" },
|
|
536
540
|
rotatePage: { kind: "command" }
|
|
537
541
|
});
|
|
538
|
-
class
|
|
542
|
+
class we {
|
|
539
543
|
constructor(n) {
|
|
540
544
|
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 = u(
|
|
541
545
|
"page",
|
|
542
|
-
|
|
546
|
+
Me(n),
|
|
543
547
|
n
|
|
544
548
|
);
|
|
545
549
|
}
|
|
546
550
|
}
|
|
547
|
-
const
|
|
551
|
+
const Ie = {
|
|
548
552
|
open: { kind: "command" },
|
|
549
553
|
setFormFieldValue: { kind: "command" },
|
|
550
554
|
setFormFieldReadonly: { kind: "command" },
|
|
@@ -561,28 +565,28 @@ const De = {
|
|
|
561
565
|
mapCallbackResult: (t) => [Array.isArray(t) ? t : []]
|
|
562
566
|
}
|
|
563
567
|
};
|
|
564
|
-
class
|
|
568
|
+
class Oe {
|
|
565
569
|
constructor(n) {
|
|
566
570
|
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 = u(
|
|
567
571
|
"pdfFormFiller",
|
|
568
|
-
|
|
572
|
+
Ie,
|
|
569
573
|
n
|
|
570
574
|
);
|
|
571
575
|
}
|
|
572
576
|
}
|
|
573
|
-
const
|
|
577
|
+
const _e = /\s*,\s*/, Le = /\s*-\s*/, k = (t) => {
|
|
574
578
|
const n = Number.parseInt(t.trim(), 10);
|
|
575
579
|
return !Number.isFinite(n) || n <= 0 ? null : n;
|
|
576
|
-
},
|
|
577
|
-
const n = t.split(
|
|
580
|
+
}, Fe = (t) => {
|
|
581
|
+
const n = t.split(Le);
|
|
578
582
|
if (n.length === 1) {
|
|
579
583
|
const r = k(n[0] ?? "");
|
|
580
584
|
return r ? [r] : [];
|
|
581
585
|
}
|
|
582
586
|
const e = k(n[0] ?? ""), i = k(n[1] ?? "");
|
|
583
587
|
return !e || !i || i < e ? [] : Array.from({ length: i - e + 1 }, (r, a) => e + a);
|
|
584
|
-
},
|
|
585
|
-
class
|
|
588
|
+
}, Ne = (t) => t ? t.split(_e).flatMap((e) => Fe(e)).filter((e, i, r) => r.indexOf(e) === i) : [];
|
|
589
|
+
class Ue {
|
|
586
590
|
constructor(n, e, i) {
|
|
587
591
|
this.setFieldName = (r) => {
|
|
588
592
|
this.key = r;
|
|
@@ -593,7 +597,7 @@ class Le {
|
|
|
593
597
|
}, this.key = n, this.value = e, this.description = i;
|
|
594
598
|
}
|
|
595
599
|
}
|
|
596
|
-
class
|
|
600
|
+
class Be {
|
|
597
601
|
constructor() {
|
|
598
602
|
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) => {
|
|
599
603
|
this.signType = n;
|
|
@@ -603,7 +607,7 @@ class Fe {
|
|
|
603
607
|
this.sealPosition = n;
|
|
604
608
|
}, this.setPageRange = (n) => {
|
|
605
609
|
this.pageRange = n;
|
|
606
|
-
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () =>
|
|
610
|
+
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () => Ne(this.pageRange), this.setSignUserData = (n) => {
|
|
607
611
|
this.signUserData = n;
|
|
608
612
|
}, this.setPrintMargin = (n) => {
|
|
609
613
|
this.printMargin = n;
|
|
@@ -616,23 +620,23 @@ class Fe {
|
|
|
616
620
|
};
|
|
617
621
|
}
|
|
618
622
|
}
|
|
619
|
-
const
|
|
623
|
+
const xe = {
|
|
620
624
|
getSecuritySettings: { kind: "query" },
|
|
621
625
|
isSecuritySettingsLocalEditable: { kind: "query" },
|
|
622
626
|
setSecuritySettingsLocalEditable: { kind: "query" },
|
|
623
627
|
setSecuritySettings: { kind: "query" },
|
|
624
628
|
openSecuritySettingsDialog: { kind: "command" }
|
|
625
629
|
};
|
|
626
|
-
class
|
|
630
|
+
class Ve {
|
|
627
631
|
constructor(n) {
|
|
628
632
|
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 = u(
|
|
629
633
|
"security",
|
|
630
|
-
|
|
634
|
+
xe,
|
|
631
635
|
n
|
|
632
636
|
);
|
|
633
637
|
}
|
|
634
638
|
}
|
|
635
|
-
const
|
|
639
|
+
const Ke = {
|
|
636
640
|
setSignServer: { kind: "command" },
|
|
637
641
|
addSignServerAuthCallback: {
|
|
638
642
|
kind: "callbackRegister",
|
|
@@ -652,28 +656,28 @@ const Be = {
|
|
|
652
656
|
setSignServerLoginFromUSBKey: { kind: "command" },
|
|
653
657
|
setUserAuthSource: { kind: "command" }
|
|
654
658
|
};
|
|
655
|
-
class
|
|
659
|
+
class qe {
|
|
656
660
|
constructor(n) {
|
|
657
661
|
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 = u(
|
|
658
662
|
"signServer",
|
|
659
|
-
|
|
663
|
+
Ke,
|
|
660
664
|
n
|
|
661
665
|
);
|
|
662
666
|
}
|
|
663
667
|
}
|
|
664
|
-
const
|
|
668
|
+
const ze = {
|
|
665
669
|
createPDF417Barcode: { kind: "command" }
|
|
666
670
|
};
|
|
667
|
-
class
|
|
671
|
+
class Ge {
|
|
668
672
|
constructor(n) {
|
|
669
673
|
this.createPDF417Barcode = (e, i, r, a, s, o, d) => this.adapter.createPDF417Barcode(e, i, r, a, s, o, d), this.adapter = u(
|
|
670
674
|
"symbology",
|
|
671
|
-
|
|
675
|
+
ze,
|
|
672
676
|
n
|
|
673
677
|
);
|
|
674
678
|
}
|
|
675
679
|
}
|
|
676
|
-
const
|
|
680
|
+
const He = {
|
|
677
681
|
setup: { kind: "command" },
|
|
678
682
|
create: { kind: "command" },
|
|
679
683
|
getMarkups: { kind: "callbackQuery" },
|
|
@@ -681,16 +685,27 @@ const ze = {
|
|
|
681
685
|
removeAllMarkups: { kind: "command" },
|
|
682
686
|
sign: { kind: "callbackQuery" }
|
|
683
687
|
};
|
|
684
|
-
class
|
|
688
|
+
class Qe {
|
|
685
689
|
constructor(n) {
|
|
686
690
|
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 = u(
|
|
687
691
|
"templateSign",
|
|
688
|
-
|
|
692
|
+
He,
|
|
689
693
|
n
|
|
690
694
|
);
|
|
691
695
|
}
|
|
692
696
|
}
|
|
693
|
-
const
|
|
697
|
+
const w = "[RHC Office SDK]", je = (t, ...n) => {
|
|
698
|
+
$("warn", t, n);
|
|
699
|
+
}, I = (t, ...n) => {
|
|
700
|
+
$("error", t, n);
|
|
701
|
+
}, $ = (t, n, e) => {
|
|
702
|
+
const i = t === "error" ? console.error.bind(console) : console.warn.bind(console);
|
|
703
|
+
if (e.length > 0) {
|
|
704
|
+
i(`${w} ${n}`, ...e);
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
i(`${w} ${n}`);
|
|
708
|
+
}, $e = /* @__PURE__ */ new Set([2, 5]), We = (t) => ({
|
|
694
709
|
showToolbarMenu: { kind: "command" },
|
|
695
710
|
hideToolbarMenu: { kind: "command" },
|
|
696
711
|
setupToolbarMenu: { kind: "command" },
|
|
@@ -729,13 +744,13 @@ const qe = /* @__PURE__ */ new Set([2, 5]), He = (t) => ({
|
|
|
729
744
|
exitBookViewMode: { kind: "command" },
|
|
730
745
|
isBookViewActivated: {
|
|
731
746
|
kind: "stateGetter",
|
|
732
|
-
state: () =>
|
|
747
|
+
state: () => $e.has(t.state.snapshot().pageMode)
|
|
733
748
|
},
|
|
734
749
|
requestFullScreen: { kind: "command" },
|
|
735
750
|
exitFullScreen: { kind: "command" },
|
|
736
751
|
invalidateView: { kind: "command" }
|
|
737
752
|
});
|
|
738
|
-
class
|
|
753
|
+
class Ye {
|
|
739
754
|
constructor(n) {
|
|
740
755
|
this.showToolbarMenu = () => (this.warnLegacyRibbonMethod("showToolbarMenu", "showRibbonMenu"), this.showRibbonMenu()), this.hideToolbarMenu = () => (this.warnLegacyRibbonMethod("hideToolbarMenu", "hideRibbonMenu"), this.hideRibbonMenu()), this.setupToolbarMenu = (e) => (this.warnLegacyRibbonMethod(
|
|
741
756
|
"setupToolbarMenu",
|
|
@@ -743,13 +758,13 @@ class Qe {
|
|
|
743
758
|
), 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(
|
|
744
759
|
"setupRibbonMenu",
|
|
745
760
|
"showRibbonMenu/hideRibbonMenu/setupRibbonMenuTab"
|
|
746
|
-
), 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.setStatusBarVisible = (e) => this.adapter.setStatusBarVisible(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 = u("ui",
|
|
761
|
+
), 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.setStatusBarVisible = (e) => this.adapter.setStatusBarVisible(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 = u("ui", We(n), n);
|
|
747
762
|
}
|
|
748
763
|
warnLegacyRibbonMethod(n, e) {
|
|
749
|
-
|
|
764
|
+
je(`ui.${n} is deprecated. Use ui.${e} instead.`);
|
|
750
765
|
}
|
|
751
766
|
}
|
|
752
|
-
const
|
|
767
|
+
const Xe = (t) => {
|
|
753
768
|
if (!t)
|
|
754
769
|
return;
|
|
755
770
|
const n = t.trim().toLowerCase();
|
|
@@ -757,42 +772,42 @@ const je = (t) => {
|
|
|
757
772
|
return "auto";
|
|
758
773
|
if (n === "light" || n === "dark" || n === "high-contrast" || n === "auto")
|
|
759
774
|
return n;
|
|
760
|
-
},
|
|
775
|
+
}, W = (t) => {
|
|
761
776
|
const n = new URL(t, globalThis.location?.href ?? "http://localhost/");
|
|
762
777
|
return n.hash = "", n.pathname.endsWith("/") || (n.pathname = `${n.pathname}/`), n.toString();
|
|
763
|
-
},
|
|
764
|
-
const e =
|
|
778
|
+
}, Je = (t) => new URL("editors.bootstrap.js", t).toString(), Ze = (t, n) => {
|
|
779
|
+
const e = W(t);
|
|
765
780
|
return {
|
|
766
781
|
...n,
|
|
767
782
|
appUrl: e,
|
|
768
|
-
theme:
|
|
783
|
+
theme: Xe(n.theme)
|
|
769
784
|
};
|
|
770
|
-
}, g = "rhc-office-editor", T = "__RHC_OFFICE_SDK_READER_LOADER__",
|
|
785
|
+
}, g = "rhc-office-editor", T = "__RHC_OFFICE_SDK_READER_LOADER__", Y = () => {
|
|
771
786
|
const t = globalThis;
|
|
772
787
|
return t[T] || (t[T] = {
|
|
773
788
|
activeAppUrl: null,
|
|
774
789
|
loadPromises: /* @__PURE__ */ new Map()
|
|
775
790
|
}), t[T];
|
|
776
|
-
},
|
|
777
|
-
class
|
|
791
|
+
}, et = (t) => Array.from(document.querySelectorAll("script")).find((n) => n.src === t) ?? null;
|
|
792
|
+
class O extends Error {
|
|
778
793
|
constructor(n) {
|
|
779
794
|
super(`Failed to load reader bootstrap script: ${n}`), this.name = "ReaderScriptLoadError";
|
|
780
795
|
}
|
|
781
796
|
}
|
|
782
|
-
class
|
|
797
|
+
class tt extends Error {
|
|
783
798
|
constructor(n, e) {
|
|
784
799
|
super(
|
|
785
800
|
`Reader Web Component "${g}" is already bound to ${n} and cannot be reloaded from ${e}.`
|
|
786
801
|
), this.name = "ReaderSourceConflictError";
|
|
787
802
|
}
|
|
788
803
|
}
|
|
789
|
-
const
|
|
790
|
-
const n =
|
|
804
|
+
const X = (t) => {
|
|
805
|
+
const n = Y();
|
|
791
806
|
if (n.activeAppUrl && n.activeAppUrl !== t)
|
|
792
|
-
throw new
|
|
793
|
-
},
|
|
794
|
-
const n =
|
|
795
|
-
|
|
807
|
+
throw new tt(n.activeAppUrl, t);
|
|
808
|
+
}, nt = (t) => {
|
|
809
|
+
const n = Y();
|
|
810
|
+
X(t);
|
|
796
811
|
const e = n.loadPromises.get(t);
|
|
797
812
|
if (e)
|
|
798
813
|
return e;
|
|
@@ -801,11 +816,11 @@ const W = (t) => {
|
|
|
801
816
|
const s = Promise.resolve();
|
|
802
817
|
return n.loadPromises.set(t, s), s;
|
|
803
818
|
}
|
|
804
|
-
const i =
|
|
819
|
+
const i = Je(t), r = et(i);
|
|
805
820
|
n.activeAppUrl = t;
|
|
806
821
|
const a = new Promise((s, o) => {
|
|
807
822
|
const d = (h) => {
|
|
808
|
-
h?.remove(), o(new
|
|
823
|
+
h?.remove(), o(new O(i));
|
|
809
824
|
}, l = () => {
|
|
810
825
|
globalThis.customElements.whenDefined(g).then(() => {
|
|
811
826
|
s();
|
|
@@ -818,7 +833,7 @@ const W = (t) => {
|
|
|
818
833
|
}
|
|
819
834
|
r.addEventListener(
|
|
820
835
|
"error",
|
|
821
|
-
() => o(new
|
|
836
|
+
() => o(new O(i)),
|
|
822
837
|
{
|
|
823
838
|
once: !0
|
|
824
839
|
}
|
|
@@ -831,18 +846,18 @@ const W = (t) => {
|
|
|
831
846
|
throw n.loadPromises.delete(t), !globalThis.customElements?.get(g) && n.activeAppUrl === t && (n.activeAppUrl = null), s;
|
|
832
847
|
});
|
|
833
848
|
return n.loadPromises.set(t, a), a;
|
|
834
|
-
},
|
|
849
|
+
}, it = 5e3, rt = 5e3, at = () => {
|
|
835
850
|
const t = globalThis.crypto;
|
|
836
851
|
return typeof t?.randomUUID == "function" ? t.randomUUID() : `adapter-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
837
|
-
}, b = () => globalThis[
|
|
838
|
-
class
|
|
852
|
+
}, b = () => globalThis[Re];
|
|
853
|
+
class st extends Error {
|
|
839
854
|
constructor(n, e, i) {
|
|
840
855
|
super(e), this.name = "ReaderBridgeError", this.code = n, this.details = i;
|
|
841
856
|
}
|
|
842
857
|
}
|
|
843
|
-
class
|
|
858
|
+
class ot {
|
|
844
859
|
constructor(n) {
|
|
845
|
-
this.readerId = null, this.readyTimeoutMs = n?.readyTimeoutMs ??
|
|
860
|
+
this.readerId = null, this.readyTimeoutMs = n?.readyTimeoutMs ?? rt, this.requestTimeoutMs = n?.requestTimeoutMs ?? it;
|
|
846
861
|
}
|
|
847
862
|
configureTimeouts(n) {
|
|
848
863
|
this.readyTimeoutMs = n?.readyTimeoutMs ?? this.readyTimeoutMs, this.requestTimeoutMs = n?.requestTimeoutMs ?? this.requestTimeoutMs;
|
|
@@ -857,7 +872,7 @@ class it {
|
|
|
857
872
|
const a = await this.requestRaw(n, e, i, r);
|
|
858
873
|
if (a.ok)
|
|
859
874
|
return a.result;
|
|
860
|
-
throw new
|
|
875
|
+
throw new st(
|
|
861
876
|
a.error.code,
|
|
862
877
|
a.error.message,
|
|
863
878
|
a.error.details
|
|
@@ -884,9 +899,9 @@ class it {
|
|
|
884
899
|
}
|
|
885
900
|
};
|
|
886
901
|
const s = {
|
|
887
|
-
protocol:
|
|
888
|
-
version:
|
|
889
|
-
requestId:
|
|
902
|
+
protocol: Se,
|
|
903
|
+
version: fe,
|
|
904
|
+
requestId: at(),
|
|
890
905
|
readerId: this.readerId,
|
|
891
906
|
tool: n,
|
|
892
907
|
method: e,
|
|
@@ -948,7 +963,7 @@ class it {
|
|
|
948
963
|
});
|
|
949
964
|
}
|
|
950
965
|
}
|
|
951
|
-
const
|
|
966
|
+
const _ = {
|
|
952
967
|
annotationEnabled: !1,
|
|
953
968
|
documentModified: !1,
|
|
954
969
|
documentOpened: !1,
|
|
@@ -957,12 +972,12 @@ const I = {
|
|
|
957
972
|
pageMode: 0,
|
|
958
973
|
zoomLevel: 100
|
|
959
974
|
};
|
|
960
|
-
class
|
|
975
|
+
class dt {
|
|
961
976
|
constructor() {
|
|
962
|
-
this.state = { ...
|
|
977
|
+
this.state = { ..._ };
|
|
963
978
|
}
|
|
964
979
|
reset() {
|
|
965
|
-
this.state = { ...
|
|
980
|
+
this.state = { ..._ };
|
|
966
981
|
}
|
|
967
982
|
update(n) {
|
|
968
983
|
n && (this.state = {
|
|
@@ -986,18 +1001,18 @@ class rt {
|
|
|
986
1001
|
};
|
|
987
1002
|
}
|
|
988
1003
|
}
|
|
989
|
-
const
|
|
990
|
-
if (!
|
|
1004
|
+
const ut = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t : void 0, J = (t) => typeof t == "object" && t !== null && !Array.isArray(t), L = (t) => {
|
|
1005
|
+
if (!J(t))
|
|
991
1006
|
return;
|
|
992
1007
|
const n = {};
|
|
993
1008
|
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;
|
|
994
|
-
},
|
|
995
|
-
if (!
|
|
1009
|
+
}, lt = (t) => {
|
|
1010
|
+
if (!J(t))
|
|
996
1011
|
return {
|
|
997
1012
|
success: !0,
|
|
998
1013
|
status: "ok"
|
|
999
1014
|
};
|
|
1000
|
-
const n =
|
|
1015
|
+
const n = L(t.state), e = L(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";
|
|
1001
1016
|
return {
|
|
1002
1017
|
success: r,
|
|
1003
1018
|
status: a,
|
|
@@ -1005,7 +1020,7 @@ const at = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t :
|
|
|
1005
1020
|
state: n ?? e
|
|
1006
1021
|
};
|
|
1007
1022
|
};
|
|
1008
|
-
class
|
|
1023
|
+
class ct {
|
|
1009
1024
|
constructor() {
|
|
1010
1025
|
this.annotationEvents = [], this.annotationPersist = [], this.annotationRetrieve = [], this.attachmentChanged = [], this.digitalAnnotationRetrieve = [], this.digitalSign = [], this.digitalSignatureParse = [], this.digitalSignatureRetrieve = [], this.documentClosed = [], this.documentOpened = [], this.documentSaved = [], this.pageChange = [], this.pageModeChange = [], this.signServerAuth = [];
|
|
1011
1026
|
}
|
|
@@ -1013,7 +1028,7 @@ class ot {
|
|
|
1013
1028
|
switch (n) {
|
|
1014
1029
|
case "documentOpened":
|
|
1015
1030
|
case "documentLoaded": {
|
|
1016
|
-
const i =
|
|
1031
|
+
const i = lt(e);
|
|
1017
1032
|
this.documentOpened.forEach(
|
|
1018
1033
|
(r) => r(i.status ?? "ok", i.error ?? "", i)
|
|
1019
1034
|
);
|
|
@@ -1042,7 +1057,7 @@ class ot {
|
|
|
1042
1057
|
this.annotationEvents.forEach(
|
|
1043
1058
|
(r) => r(
|
|
1044
1059
|
i.event ?? "annotationEvent",
|
|
1045
|
-
|
|
1060
|
+
ut(i.payload)
|
|
1046
1061
|
)
|
|
1047
1062
|
);
|
|
1048
1063
|
return;
|
|
@@ -1082,15 +1097,15 @@ class ot {
|
|
|
1082
1097
|
}
|
|
1083
1098
|
}
|
|
1084
1099
|
}
|
|
1085
|
-
const
|
|
1100
|
+
const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig", ht = [
|
|
1086
1101
|
"documentLoaded",
|
|
1087
1102
|
"documentStateChange",
|
|
1088
1103
|
"documentError"
|
|
1089
|
-
],
|
|
1104
|
+
], mt = "readerReady", gt = "readerUnload", v = "readerError", pt = () => typeof globalThis.crypto?.randomUUID == "function" ? globalThis.crypto.randomUUID() : `rhc-reader-${Date.now()}-${Math.random().toString(36).slice(2)}`, F = (t, n) => ({
|
|
1090
1105
|
appUrl: n?.appUrl ?? null,
|
|
1091
1106
|
configuration: n,
|
|
1092
1107
|
element: t
|
|
1093
|
-
}),
|
|
1108
|
+
}), N = (t, n) => {
|
|
1094
1109
|
if (!t)
|
|
1095
1110
|
return;
|
|
1096
1111
|
const e = typeof t == "string" ? t.trim() : t.userName.trim();
|
|
@@ -1101,19 +1116,19 @@ const f = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
|
|
|
1101
1116
|
sessionUser: e,
|
|
1102
1117
|
...a ? { sessionUserId: a } : {}
|
|
1103
1118
|
};
|
|
1104
|
-
},
|
|
1119
|
+
}, bt = (t) => {
|
|
1105
1120
|
const n = t.trim().replace(/[-_\s]/g, "").toLowerCase();
|
|
1106
1121
|
return n === "view" ? "VIEW" : n === "annotation" ? "ANNOTATION" : n === "digitalsign" ? "DIGITAL_SIGN" : null;
|
|
1107
|
-
},
|
|
1122
|
+
}, U = (t) => {
|
|
1108
1123
|
const n = [];
|
|
1109
1124
|
return t.split(/[;,]/).forEach((e) => {
|
|
1110
|
-
const i =
|
|
1125
|
+
const i = bt(e);
|
|
1111
1126
|
i && !n.includes(i) && n.push(i);
|
|
1112
1127
|
}), n.length > 0 ? n.join(",") : "VIEW";
|
|
1113
|
-
},
|
|
1128
|
+
}, St = (t) => {
|
|
1114
1129
|
const n = {};
|
|
1115
1130
|
return t.canOpenNewFile !== void 0 && (n.canOpenNewFile = t.canOpenNewFile), t.canPrint !== void 0 && (n.canPrint = t.canPrint), t.canDownload !== void 0 && (n.canDownload = t.canDownload), Object.keys(n).length > 0 ? n : void 0;
|
|
1116
|
-
},
|
|
1131
|
+
}, ft = (t) => {
|
|
1117
1132
|
if (typeof t == "string") {
|
|
1118
1133
|
const n = document.getElementById(t);
|
|
1119
1134
|
if (!n)
|
|
@@ -1125,52 +1140,52 @@ const f = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
|
|
|
1125
1140
|
if (!(t instanceof HTMLDivElement))
|
|
1126
1141
|
throw new Error("Reader container must be a div element.");
|
|
1127
1142
|
return t;
|
|
1128
|
-
},
|
|
1143
|
+
}, Rt = () => {
|
|
1129
1144
|
const t = typeof globalThis.matchMedia == "function";
|
|
1130
1145
|
return (t ? globalThis.matchMedia("(prefers-contrast: more)").matches : !1) ? "high-contrast" : (t ? globalThis.matchMedia("(prefers-color-scheme: dark)").matches : !1) ? "dark" : "light";
|
|
1131
|
-
},
|
|
1146
|
+
}, B = (t, n) => {
|
|
1132
1147
|
const e = t;
|
|
1133
1148
|
if (typeof e.addEventListener == "function") {
|
|
1134
1149
|
e.addEventListener("change", n);
|
|
1135
1150
|
return;
|
|
1136
1151
|
}
|
|
1137
1152
|
typeof e.addListener == "function" && e.addListener(n);
|
|
1138
|
-
},
|
|
1153
|
+
}, x = (t, n) => {
|
|
1139
1154
|
const e = t;
|
|
1140
1155
|
if (typeof e.removeEventListener == "function") {
|
|
1141
1156
|
e.removeEventListener("change", n);
|
|
1142
1157
|
return;
|
|
1143
1158
|
}
|
|
1144
1159
|
typeof e.removeListener == "function" && e.removeListener(n);
|
|
1145
|
-
},
|
|
1160
|
+
}, kt = (t) => {
|
|
1146
1161
|
t.style.display || (t.style.display = "block"), t.style.width || (t.style.width = "100%"), t.style.height || (t.style.height = "100%");
|
|
1147
|
-
},
|
|
1162
|
+
}, V = (t, n) => {
|
|
1148
1163
|
const e = n;
|
|
1149
1164
|
if (!e)
|
|
1150
1165
|
return t.removeAttribute("theme"), null;
|
|
1151
1166
|
if (e !== "auto")
|
|
1152
1167
|
return t.setAttribute("theme", e), null;
|
|
1153
1168
|
const i = () => {
|
|
1154
|
-
t.setAttribute("theme",
|
|
1169
|
+
t.setAttribute("theme", Rt());
|
|
1155
1170
|
};
|
|
1156
1171
|
if (i(), typeof globalThis.matchMedia != "function")
|
|
1157
1172
|
return null;
|
|
1158
1173
|
const r = globalThis.matchMedia("(prefers-color-scheme: dark)"), a = globalThis.matchMedia("(prefers-contrast: more)"), s = () => {
|
|
1159
1174
|
i();
|
|
1160
1175
|
};
|
|
1161
|
-
return
|
|
1162
|
-
|
|
1176
|
+
return B(r, s), B(a, s), () => {
|
|
1177
|
+
x(r, s), x(a, s);
|
|
1163
1178
|
};
|
|
1164
1179
|
};
|
|
1165
|
-
class
|
|
1180
|
+
class Tt {
|
|
1166
1181
|
constructor(n) {
|
|
1167
|
-
this.bridge = new
|
|
1182
|
+
this.bridge = new ot(), this.callbacks = new ct(), this.readerState = new dt(), this.bridgeToolContext = {
|
|
1168
1183
|
bridge: this.bridge,
|
|
1169
1184
|
callbacks: this.callbacks,
|
|
1170
1185
|
debug: () => this.debugEnabled,
|
|
1171
1186
|
onAsyncError: (e) => this.reportAdapterError(e),
|
|
1172
1187
|
state: this.readerState
|
|
1173
|
-
}, this.documentTool = new
|
|
1188
|
+
}, this.documentTool = new Te(this.bridgeToolContext), this.uiTool = new Ye(this.bridgeToolContext), this.pageTool = new we(this.bridgeToolContext), this.pageArrangeTool = new De(this.bridgeToolContext), this.attachmentTool = new he(this.bridgeToolContext), this.findTool = new ve(this.bridgeToolContext), this.signServerTool = new qe(this.bridgeToolContext), this.digitalSignTool = new be(this.bridgeToolContext), this.symbologyTool = new Ge(this.bridgeToolContext), this.annotationTool = new de(this.bridgeToolContext), this.templateSignTool = new Qe(this.bridgeToolContext), this.pdfFormFiller = new Oe(this.bridgeToolContext), this.networkingTool = new Ae(this.bridgeToolContext), this.cryptoTool = new ge(this.bridgeToolContext), this.securityTool = new Ve(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.runtimeRestoreState = null, this.nativeEventCleanupCallbacks = [], this.themeCleanup = null, this.enableDebug = (e) => {
|
|
1174
1189
|
this.debugEnabled = e;
|
|
1175
1190
|
}, this.changeLanguage = (e) => {
|
|
1176
1191
|
this.readerElement && this.readerElement.setAttribute("language", e);
|
|
@@ -1178,7 +1193,7 @@ class ft {
|
|
|
1178
1193
|
this.themeCleanup?.(), this.themeCleanup = null, this.normalizedConfiguration = this.normalizedConfiguration ? {
|
|
1179
1194
|
...this.normalizedConfiguration,
|
|
1180
1195
|
theme: e
|
|
1181
|
-
} : null, this.readerElement && (this.themeCleanup =
|
|
1196
|
+
} : null, this.readerElement && (this.themeCleanup = V(this.readerElement, e));
|
|
1182
1197
|
}, this.setSessionUser = (e) => {
|
|
1183
1198
|
this.sessionUser = e, this.syncReaderRuntimeConfig();
|
|
1184
1199
|
}, this.setSessionUserId = (e) => {
|
|
@@ -1192,27 +1207,27 @@ class ft {
|
|
|
1192
1207
|
}, this.setReaderEventListener = (e) => {
|
|
1193
1208
|
this.readerEventListener = e;
|
|
1194
1209
|
}, this.embedReader = (e, i, r) => {
|
|
1195
|
-
const a =
|
|
1196
|
-
|
|
1197
|
-
const o =
|
|
1210
|
+
const a = ft(e), s = W(i);
|
|
1211
|
+
X(s);
|
|
1212
|
+
const o = Ze(s, r), d = this.mountToken + 1;
|
|
1198
1213
|
this.removeReader(), this.mountToken = d, this.removed = !1, this.hostContainer = a, this.normalizedConfiguration = o, this.mountReader(a, o, d);
|
|
1199
1214
|
}, this.removeReader = () => {
|
|
1200
1215
|
const e = !!(this.readerElement || this.hostContainer);
|
|
1201
1216
|
if (this.mountToken += 1, this.cleanupNativeEventForwarders(), this.cleanupThemeBinding(), this.restoreReaderRuntimeConfig(), 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)
|
|
1202
1217
|
return;
|
|
1203
|
-
const i =
|
|
1204
|
-
this.emitReaderEvent(
|
|
1205
|
-
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getPageArrangeTool = () => this.pageArrangeTool, this.getAttachmentTool = () => this.attachmentTool, 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
|
|
1218
|
+
const i = F(null, null);
|
|
1219
|
+
this.emitReaderEvent(gt, i), this.unloadCallbacks.forEach((r) => r());
|
|
1220
|
+
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getPageArrangeTool = () => this.pageArrangeTool, this.getAttachmentTool = () => this.attachmentTool, 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 Be(), this.createKVField = (e, i, r) => new Ue(e, i, r), this.mountReader = async (e, i, r) => {
|
|
1206
1221
|
try {
|
|
1207
|
-
if (await
|
|
1222
|
+
if (await nt(i.appUrl), this.mountToken !== r)
|
|
1208
1223
|
return;
|
|
1209
|
-
const a = document.createElement(g), s =
|
|
1210
|
-
a.setAttribute(
|
|
1224
|
+
const a = document.createElement(g), s = pt();
|
|
1225
|
+
a.setAttribute(j, s), this.readerId = s, this.bridge.setReaderId(s), kt(a), this.applyReaderRuntimeConfig(a, i);
|
|
1211
1226
|
const o = i.compactViewer === !0 && i.keepPCMenu !== !0;
|
|
1212
1227
|
if (a.toggleAttribute("data-sdk-compact-mode", o), a.toggleAttribute("data-sdk-ribbon-hidden", i.ribbonMenu === !1), a.toggleAttribute(
|
|
1213
1228
|
"data-sdk-ribbon-title-hidden",
|
|
1214
1229
|
i.ribbonTitle === !1
|
|
1215
|
-
), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup =
|
|
1230
|
+
), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup = V(a, i.theme), this.bindNativeReaderEvents(a), e.replaceChildren(a), this.readerElement = a, await Promise.resolve(), this.mountToken !== r)
|
|
1216
1231
|
return;
|
|
1217
1232
|
const d = await this.bridge.waitForReady();
|
|
1218
1233
|
if (this.mountToken !== r)
|
|
@@ -1220,8 +1235,8 @@ class ft {
|
|
|
1220
1235
|
if (!d)
|
|
1221
1236
|
throw new Error("Editor adapter is not available.");
|
|
1222
1237
|
this.isReady = !0;
|
|
1223
|
-
const l =
|
|
1224
|
-
this.emitReaderEvent(
|
|
1238
|
+
const l = F(a, i);
|
|
1239
|
+
this.emitReaderEvent(mt, l), this.readyCallbacks.forEach((c) => c());
|
|
1225
1240
|
} catch (a) {
|
|
1226
1241
|
if (this.mountToken !== r)
|
|
1227
1242
|
return;
|
|
@@ -1238,7 +1253,7 @@ class ft {
|
|
|
1238
1253
|
M,
|
|
1239
1254
|
i
|
|
1240
1255
|
);
|
|
1241
|
-
}),
|
|
1256
|
+
}), ht.forEach((r) => {
|
|
1242
1257
|
const a = (s) => {
|
|
1243
1258
|
const o = s instanceof CustomEvent ? s.detail : s;
|
|
1244
1259
|
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r, o), r === "documentError" && this.emitReaderEvent(v, o);
|
|
@@ -1254,9 +1269,9 @@ class ft {
|
|
|
1254
1269
|
}, this.emitReaderEvent = (e, i) => {
|
|
1255
1270
|
this.readerEventListener?.(e, i);
|
|
1256
1271
|
}, this.reportReaderError = (e) => {
|
|
1257
|
-
this.isReady = !1, this.debugEnabled &&
|
|
1272
|
+
this.isReady = !1, this.debugEnabled && I("Reader mount failed", e), this.emitReaderEvent(v, e);
|
|
1258
1273
|
}, this.reportAdapterError = (e) => {
|
|
1259
|
-
this.debugEnabled &&
|
|
1274
|
+
this.debugEnabled && I("Adapter command failed", e), this.emitReaderEvent(v, e);
|
|
1260
1275
|
}, this.bridge.configureTimeouts({
|
|
1261
1276
|
readyTimeoutMs: n?.readyTimeoutMs,
|
|
1262
1277
|
requestTimeoutMs: n?.requestTimeoutMs
|
|
@@ -1264,10 +1279,10 @@ class ft {
|
|
|
1264
1279
|
}
|
|
1265
1280
|
applyReaderRuntimeConfig(n, e) {
|
|
1266
1281
|
this.restoreReaderRuntimeConfig();
|
|
1267
|
-
const i =
|
|
1268
|
-
feature:
|
|
1282
|
+
const i = N(this.sessionUser, this.sessionUserId), r = {
|
|
1283
|
+
feature: U(e.viewMode),
|
|
1269
1284
|
...i ?? {}
|
|
1270
|
-
}, a =
|
|
1285
|
+
}, a = St(e), s = {
|
|
1271
1286
|
hostKind: "server",
|
|
1272
1287
|
...a ? { embedOptions: a } : {},
|
|
1273
1288
|
server: {
|
|
@@ -1277,11 +1292,11 @@ class ft {
|
|
|
1277
1292
|
...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
|
|
1278
1293
|
}, o = n;
|
|
1279
1294
|
o[y] = s;
|
|
1280
|
-
const d = globalThis, l = d[
|
|
1295
|
+
const d = globalThis, l = d[S];
|
|
1281
1296
|
this.runtimeRestoreState = {
|
|
1282
1297
|
hadPreviousRuntime: l !== void 0,
|
|
1283
1298
|
...l !== void 0 ? { previousRuntime: l } : {}
|
|
1284
|
-
}, d[
|
|
1299
|
+
}, d[S] = s;
|
|
1285
1300
|
}
|
|
1286
1301
|
syncReaderRuntimeConfig() {
|
|
1287
1302
|
if (!this.readerElement || !this.normalizedConfiguration)
|
|
@@ -1289,18 +1304,18 @@ class ft {
|
|
|
1289
1304
|
const n = this.readerElement, e = n[y];
|
|
1290
1305
|
if (!e)
|
|
1291
1306
|
return;
|
|
1292
|
-
const i =
|
|
1307
|
+
const i = N(this.sessionUser, this.sessionUserId), r = { ...e.identity ?? {} };
|
|
1293
1308
|
delete r.sessionUser, delete r.sessionUserId;
|
|
1294
1309
|
const a = {
|
|
1295
1310
|
...r,
|
|
1296
|
-
feature:
|
|
1311
|
+
feature: U(this.normalizedConfiguration.viewMode),
|
|
1297
1312
|
...i ?? {}
|
|
1298
1313
|
}, s = {
|
|
1299
1314
|
...e,
|
|
1300
1315
|
identity: a,
|
|
1301
1316
|
...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
|
|
1302
1317
|
};
|
|
1303
|
-
n[y] = s, globalThis[
|
|
1318
|
+
n[y] = s, globalThis[S] = s, this.isReady && this.bridge.request("extension", "updateReaderRuntimeConfig", {
|
|
1304
1319
|
identity: a,
|
|
1305
1320
|
...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
|
|
1306
1321
|
}).catch((o) => {
|
|
@@ -1311,37 +1326,37 @@ class ft {
|
|
|
1311
1326
|
if (!this.runtimeRestoreState)
|
|
1312
1327
|
return;
|
|
1313
1328
|
const n = globalThis;
|
|
1314
|
-
this.runtimeRestoreState.hadPreviousRuntime ? n[
|
|
1329
|
+
this.runtimeRestoreState.hadPreviousRuntime ? n[S] = this.runtimeRestoreState.previousRuntime : Reflect.deleteProperty(n, S), this.runtimeRestoreState = null;
|
|
1315
1330
|
}
|
|
1316
1331
|
}
|
|
1317
|
-
const
|
|
1332
|
+
const Mt = (t) => new Tt(t);
|
|
1318
1333
|
export {
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1334
|
+
de as AnnotationToolImpl,
|
|
1335
|
+
he as AttachmentToolImpl,
|
|
1336
|
+
ge as CryptoToolImpl,
|
|
1337
|
+
Dt as DIGITAL_SIGN_DEFAULTS,
|
|
1338
|
+
Be as DigitalSignOptions,
|
|
1339
|
+
be as DigitalSignToolImpl,
|
|
1340
|
+
Tt as DocumentSDK,
|
|
1341
|
+
Te as DocumentToolImpl,
|
|
1342
|
+
ve as FindToolImpl,
|
|
1343
|
+
Ue as KVField,
|
|
1344
|
+
Ae as NetworkingToolImpl,
|
|
1345
|
+
De as PageArrangeToolImpl,
|
|
1346
|
+
we as PageToolImpl,
|
|
1347
|
+
Oe as PdfFormFillerImpl,
|
|
1348
|
+
Ve as SecurityToolImpl,
|
|
1349
|
+
qe as SignServerToolImpl,
|
|
1350
|
+
Ge as SymbologyToolImpl,
|
|
1351
|
+
Qe as TemplateSignToolImpl,
|
|
1352
|
+
Ye as UIToolImpl,
|
|
1353
|
+
ee as WatermarkDisplay,
|
|
1354
|
+
Mt as createNewDocumentSdk,
|
|
1355
|
+
yt as getDigitalSignEnvironment,
|
|
1356
|
+
vt as getDigitalSignEnvironmentSource,
|
|
1357
|
+
Et as initializeDigitalSignEnvironment,
|
|
1358
|
+
Ct as patchDigitalSignEnvironment,
|
|
1359
|
+
Pt as resetDigitalSignEnvironment,
|
|
1360
|
+
At as setDigitalSignEnvironment
|
|
1346
1361
|
};
|
|
1347
1362
|
//# sourceMappingURL=index.js.map
|