@opencloud-eu/web-client 5.1.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/axios-Drchb9eh.js +1646 -0
  2. package/dist/dist-tjee3PVd.js +809 -0
  3. package/dist/generated-B6vcMOfs.js +3317 -0
  4. package/dist/graph-DcYhPBws.js +372 -0
  5. package/dist/helpers-B0hzJ78Q.js +1463 -0
  6. package/dist/ocs-2K0ogAXF.js +1658 -0
  7. package/dist/src/graph/activities/activities.d.ts +2 -2
  8. package/dist/src/graph/activities/types.d.ts +2 -2
  9. package/dist/src/graph/applications/applications.d.ts +2 -2
  10. package/dist/src/graph/applications/types.d.ts +2 -2
  11. package/dist/src/graph/driveItems/driveItems.d.ts +2 -2
  12. package/dist/src/graph/driveItems/types.d.ts +3 -1
  13. package/dist/src/graph/drives/drives.d.ts +2 -2
  14. package/dist/src/graph/drives/types.d.ts +4 -3
  15. package/dist/src/graph/generated/api.d.ts +394 -1720
  16. package/dist/src/graph/generated/base.d.ts +11 -24
  17. package/dist/src/graph/generated/common.d.ts +15 -35
  18. package/dist/src/graph/generated/configuration.d.ts +24 -17
  19. package/dist/src/graph/generated/index.d.ts +2 -2
  20. package/dist/src/graph/groups/groups.d.ts +2 -2
  21. package/dist/src/graph/groups/types.d.ts +2 -2
  22. package/dist/src/graph/index.d.ts +2 -2
  23. package/dist/src/graph/permissions/permissions.d.ts +2 -2
  24. package/dist/src/graph/permissions/types.d.ts +2 -2
  25. package/dist/src/graph/photos/photo.d.ts +2 -2
  26. package/dist/src/graph/photos/types.d.ts +1 -1
  27. package/dist/src/graph/tags/tags.d.ts +2 -2
  28. package/dist/src/graph/tags/types.d.ts +2 -2
  29. package/dist/src/graph/types.d.ts +2 -2
  30. package/dist/src/graph/users/types.d.ts +2 -2
  31. package/dist/src/graph/users/users.d.ts +2 -2
  32. package/dist/src/helpers/space/functions.d.ts +1 -1
  33. package/dist/src/webdav/clearTrashBin.d.ts +1 -1
  34. package/dist/src/webdav/copyFiles.d.ts +1 -1
  35. package/dist/src/webdav/deleteFile.d.ts +1 -1
  36. package/dist/src/webdav/listFileVersions.d.ts +1 -1
  37. package/dist/src/webdav/moveFiles.d.ts +1 -1
  38. package/dist/src/webdav/putFileContents.d.ts +1 -1
  39. package/dist/src/webdav/restoreFile.d.ts +1 -1
  40. package/dist/src/webdav/restoreFileVersion.d.ts +1 -1
  41. package/dist/src/webdav/setFavorite.d.ts +1 -1
  42. package/dist/src/webdav/types.d.ts +0 -2
  43. package/dist/toString-tGn_k7yU.js +287 -0
  44. package/dist/web-client/graph/generated.js +2 -5757
  45. package/dist/web-client/graph.js +2 -5
  46. package/dist/web-client/ocs.js +2 -5
  47. package/dist/web-client/sse.js +195 -201
  48. package/dist/web-client/webdav.js +3 -10
  49. package/dist/web-client.js +6 -82
  50. package/dist/webdav-CcBUJk4K.js +4423 -0
  51. package/package.json +8 -14
  52. package/dist/functions-JSgappH3.js +0 -1189
  53. package/dist/functions-K2XX5sqY.cjs +0 -1
  54. package/dist/index-Bjk4YP4o.js +0 -1447
  55. package/dist/index-Brk6gzFd.js +0 -688
  56. package/dist/index-CDNcS2Ra.cjs +0 -1
  57. package/dist/index-CRMq09Yn.js +0 -1933
  58. package/dist/index-D0bnLDAA.cjs +0 -1
  59. package/dist/index-Dn0XwAD_.cjs +0 -13
  60. package/dist/index-YuBBVVCr.js +0 -3860
  61. package/dist/index-_QOU-c0Z.cjs +0 -4
  62. package/dist/index-cttW6Cve.js +0 -1018
  63. package/dist/index-mNoGEl9R.cjs +0 -6
  64. package/dist/src/webdav/listFavoriteFiles.d.ts +0 -12
  65. package/dist/toString-CKeGA2IK.js +0 -255
  66. package/dist/toString-DsGM1XcL.cjs +0 -1
  67. package/dist/vite.config.d.ts +0 -2
  68. package/dist/web-client/graph/generated.cjs +0 -1
  69. package/dist/web-client/graph.cjs +0 -1
  70. package/dist/web-client/ocs.cjs +0 -1
  71. package/dist/web-client/sse.cjs +0 -2
  72. package/dist/web-client/webdav.cjs +0 -1
  73. package/dist/web-client.cjs +0 -1
@@ -1,1447 +0,0 @@
1
- import { i as ge, a as pe, M as be, t as Ce, u as Oe } from "./toString-CKeGA2IK.js";
2
- import { B as Se } from "./index-cttW6Cve.js";
3
- var Pe = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Le = /^\w*$/;
4
- function ve(n, e) {
5
- if (ge(n))
6
- return !1;
7
- var t = typeof n;
8
- return t == "number" || t == "symbol" || t == "boolean" || n == null || pe(n) ? !0 : Le.test(n) || !Pe.test(n) || e != null && n in Object(e);
9
- }
10
- var He = "Expected a function";
11
- function se(n, e) {
12
- if (typeof n != "function" || e != null && typeof e != "function")
13
- throw new TypeError(He);
14
- var t = function() {
15
- var s = arguments, r = e ? e.apply(this, s) : s[0], i = t.cache;
16
- if (i.has(r))
17
- return i.get(r);
18
- var o = n.apply(this, s);
19
- return t.cache = i.set(r, o) || i, o;
20
- };
21
- return t.cache = new (se.Cache || be)(), t;
22
- }
23
- se.Cache = be;
24
- var _e = 500;
25
- function me(n) {
26
- var e = se(n, function(s) {
27
- return t.size === _e && t.clear(), s;
28
- }), t = e.cache;
29
- return e;
30
- }
31
- var ke = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Fe = /\\(\\)?/g, Ue = me(function(n) {
32
- var e = [];
33
- return n.charCodeAt(0) === 46 && e.push(""), n.replace(ke, function(t, s, r, i) {
34
- e.push(r ? i.replace(Fe, "$1") : s || t);
35
- }), e;
36
- });
37
- function Me(n, e) {
38
- return ge(n) ? n : ve(n, e) ? [n] : Ue(Ce(n));
39
- }
40
- function Ve(n) {
41
- if (typeof n == "string" || pe(n))
42
- return n;
43
- var e = n + "";
44
- return e == "0" && 1 / n == -1 / 0 ? "-0" : e;
45
- }
46
- function Be(n, e) {
47
- e = Me(e, n);
48
- for (var t = 0, s = e.length; n != null && t < s; )
49
- n = n[Ve(e[t++])];
50
- return t && t == s ? n : void 0;
51
- }
52
- function Re(n, e, t) {
53
- var s = n == null ? void 0 : Be(n, e);
54
- return s === void 0 ? t : s;
55
- }
56
- const $e = (n, e) => {
57
- const t = new URL(n);
58
- t.pathname = [...t.pathname.split("/"), "cloud", "capabilities"].filter(Boolean).join("/"), t.searchParams.append("format", "json");
59
- const s = t.href;
60
- return {
61
- async getCapabilities() {
62
- const r = await e.get(s);
63
- return Re(r, "data.ocs.data", { capabilities: null, version: null });
64
- }
65
- };
66
- };
67
- function Ke(n) {
68
- return n instanceof Uint8Array || ArrayBuffer.isView(n) && n.constructor.name === "Uint8Array";
69
- }
70
- function V(n, e = "") {
71
- if (!Number.isSafeInteger(n) || n < 0) {
72
- const t = e && `"${e}" `;
73
- throw new Error(`${t}expected integer >= 0, got ${n}`);
74
- }
75
- }
76
- function B(n, e, t = "") {
77
- const s = Ke(n), r = n?.length, i = e !== void 0;
78
- if (!s || i && r !== e) {
79
- const o = t && `"${t}" `, a = i ? ` of length ${e}` : "", f = s ? `length=${r}` : `type=${typeof n}`;
80
- throw new Error(o + "expected Uint8Array" + a + ", got " + f);
81
- }
82
- return n;
83
- }
84
- function Ee(n) {
85
- if (typeof n != "function" || typeof n.create != "function")
86
- throw new Error("Hash must wrapped by utils.createHasher");
87
- V(n.outputLen), V(n.blockLen);
88
- }
89
- function W(n, e = !0) {
90
- if (n.destroyed)
91
- throw new Error("Hash instance has been destroyed");
92
- if (e && n.finished)
93
- throw new Error("Hash#digest() has already been called");
94
- }
95
- function je(n, e) {
96
- B(n, void 0, "digestInto() output");
97
- const t = e.outputLen;
98
- if (n.length < t)
99
- throw new Error('"digestInto() output" expected to be of length >=' + t);
100
- }
101
- function R(...n) {
102
- for (let e = 0; e < n.length; e++)
103
- n[e].fill(0);
104
- }
105
- function Y(n) {
106
- return new DataView(n.buffer, n.byteOffset, n.byteLength);
107
- }
108
- function Ge(n) {
109
- if (typeof n != "string")
110
- throw new Error("string expected");
111
- return new Uint8Array(new TextEncoder().encode(n));
112
- }
113
- function ie(n, e = "") {
114
- return typeof n == "string" ? Ge(n) : B(n, void 0, e);
115
- }
116
- function Xe(n, e) {
117
- if (e !== void 0 && {}.toString.call(e) !== "[object Object]")
118
- throw new Error("options must be object or undefined");
119
- return Object.assign(n, e);
120
- }
121
- function Ye(n, e = {}) {
122
- const t = (r, i) => n(i).update(r).digest(), s = n(void 0);
123
- return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = (r) => n(r), Object.assign(t, e), Object.freeze(t);
124
- }
125
- const We = (n) => ({
126
- oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, n])
127
- });
128
- class ye {
129
- oHash;
130
- iHash;
131
- blockLen;
132
- outputLen;
133
- finished = !1;
134
- destroyed = !1;
135
- constructor(e, t) {
136
- if (Ee(e), B(t, void 0, "key"), this.iHash = e.create(), typeof this.iHash.update != "function")
137
- throw new Error("Expected instance of class which extends utils.Hash");
138
- this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
139
- const s = this.blockLen, r = new Uint8Array(s);
140
- r.set(t.length > s ? e.create().update(t).digest() : t);
141
- for (let i = 0; i < r.length; i++)
142
- r[i] ^= 54;
143
- this.iHash.update(r), this.oHash = e.create();
144
- for (let i = 0; i < r.length; i++)
145
- r[i] ^= 106;
146
- this.oHash.update(r), R(r);
147
- }
148
- update(e) {
149
- return W(this), this.iHash.update(e), this;
150
- }
151
- digestInto(e) {
152
- W(this), B(e, this.outputLen, "output"), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
153
- }
154
- digest() {
155
- const e = new Uint8Array(this.oHash.outputLen);
156
- return this.digestInto(e), e;
157
- }
158
- _cloneInto(e) {
159
- e ||= Object.create(Object.getPrototypeOf(this), {});
160
- const { oHash: t, iHash: s, finished: r, destroyed: i, blockLen: o, outputLen: a } = this;
161
- return e = e, e.finished = r, e.destroyed = i, e.blockLen = o, e.outputLen = a, e.oHash = t._cloneInto(e.oHash), e.iHash = s._cloneInto(e.iHash), e;
162
- }
163
- clone() {
164
- return this._cloneInto();
165
- }
166
- destroy() {
167
- this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
168
- }
169
- }
170
- const we = (n, e, t) => new ye(n, e).update(t).digest();
171
- we.create = (n, e) => new ye(n, e);
172
- function Ze(n, e, t, s) {
173
- Ee(n);
174
- const r = Xe({ dkLen: 32, asyncTick: 10 }, s), { c: i, dkLen: o, asyncTick: a } = r;
175
- if (V(i, "c"), V(o, "dkLen"), V(a, "asyncTick"), i < 1)
176
- throw new Error("iterations (c) must be >= 1");
177
- const f = ie(e, "password"), c = ie(t, "salt"), l = new Uint8Array(o), u = we.create(n, f), d = u._cloneInto().update(c);
178
- return { c: i, dkLen: o, asyncTick: a, DK: l, PRF: u, PRFSalt: d };
179
- }
180
- function ze(n, e, t, s, r) {
181
- return n.destroy(), e.destroy(), s && s.destroy(), R(r), t;
182
- }
183
- function Je(n, e, t, s) {
184
- const { c: r, dkLen: i, DK: o, PRF: a, PRFSalt: f } = Ze(n, e, t, s);
185
- let c;
186
- const l = new Uint8Array(4), u = Y(l), d = new Uint8Array(a.outputLen);
187
- for (let w = 1, E = 0; E < i; w++, E += a.outputLen) {
188
- const b = o.subarray(E, E + a.outputLen);
189
- u.setInt32(0, w, !1), (c = f._cloneInto(c)).update(l).digestInto(d), b.set(d.subarray(0, b.length));
190
- for (let h = 1; h < r; h++) {
191
- a._cloneInto(c).update(d).digestInto(d);
192
- for (let y = 0; y < b.length; y++)
193
- b[y] ^= d[y];
194
- }
195
- }
196
- return ze(a, f, o, c, d);
197
- }
198
- class qe {
199
- blockLen;
200
- outputLen;
201
- padOffset;
202
- isLE;
203
- // For partial updates less than block size
204
- buffer;
205
- view;
206
- finished = !1;
207
- length = 0;
208
- pos = 0;
209
- destroyed = !1;
210
- constructor(e, t, s, r) {
211
- this.blockLen = e, this.outputLen = t, this.padOffset = s, this.isLE = r, this.buffer = new Uint8Array(e), this.view = Y(this.buffer);
212
- }
213
- update(e) {
214
- W(this), B(e);
215
- const { view: t, buffer: s, blockLen: r } = this, i = e.length;
216
- for (let o = 0; o < i; ) {
217
- const a = Math.min(r - this.pos, i - o);
218
- if (a === r) {
219
- const f = Y(e);
220
- for (; r <= i - o; o += r)
221
- this.process(f, o);
222
- continue;
223
- }
224
- s.set(e.subarray(o, o + a), this.pos), this.pos += a, o += a, this.pos === r && (this.process(t, 0), this.pos = 0);
225
- }
226
- return this.length += e.length, this.roundClean(), this;
227
- }
228
- digestInto(e) {
229
- W(this), je(e, this), this.finished = !0;
230
- const { buffer: t, view: s, blockLen: r, isLE: i } = this;
231
- let { pos: o } = this;
232
- t[o++] = 128, R(this.buffer.subarray(o)), this.padOffset > r - o && (this.process(s, 0), o = 0);
233
- for (let u = o; u < r; u++)
234
- t[u] = 0;
235
- s.setBigUint64(r - 8, BigInt(this.length * 8), i), this.process(s, 0);
236
- const a = Y(e), f = this.outputLen;
237
- if (f % 4)
238
- throw new Error("_sha2: outputLen must be aligned to 32bit");
239
- const c = f / 4, l = this.get();
240
- if (c > l.length)
241
- throw new Error("_sha2: outputLen bigger than state");
242
- for (let u = 0; u < c; u++)
243
- a.setUint32(4 * u, l[u], i);
244
- }
245
- digest() {
246
- const { buffer: e, outputLen: t } = this;
247
- this.digestInto(e);
248
- const s = e.slice(0, t);
249
- return this.destroy(), s;
250
- }
251
- _cloneInto(e) {
252
- e ||= new this.constructor(), e.set(...this.get());
253
- const { blockLen: t, buffer: s, length: r, finished: i, destroyed: o, pos: a } = this;
254
- return e.destroyed = o, e.finished = i, e.length = r, e.pos = a, r % t && e.buffer.set(s), e;
255
- }
256
- clone() {
257
- return this._cloneInto();
258
- }
259
- }
260
- const N = /* @__PURE__ */ Uint32Array.from([
261
- 1779033703,
262
- 4089235720,
263
- 3144134277,
264
- 2227873595,
265
- 1013904242,
266
- 4271175723,
267
- 2773480762,
268
- 1595750129,
269
- 1359893119,
270
- 2917565137,
271
- 2600822924,
272
- 725511199,
273
- 528734635,
274
- 4215389547,
275
- 1541459225,
276
- 327033209
277
- ]), j = /* @__PURE__ */ BigInt(2 ** 32 - 1), oe = /* @__PURE__ */ BigInt(32);
278
- function Qe(n, e = !1) {
279
- return e ? { h: Number(n & j), l: Number(n >> oe & j) } : { h: Number(n >> oe & j) | 0, l: Number(n & j) | 0 };
280
- }
281
- function De(n, e = !1) {
282
- const t = n.length;
283
- let s = new Uint32Array(t), r = new Uint32Array(t);
284
- for (let i = 0; i < t; i++) {
285
- const { h: o, l: a } = Qe(n[i], e);
286
- [s[i], r[i]] = [o, a];
287
- }
288
- return [s, r];
289
- }
290
- const fe = (n, e, t) => n >>> t, ce = (n, e, t) => n << 32 - t | e >>> t, k = (n, e, t) => n >>> t | e << 32 - t, F = (n, e, t) => n << 32 - t | e >>> t, G = (n, e, t) => n << 64 - t | e >>> t - 32, X = (n, e, t) => n >>> t - 32 | e << 64 - t;
291
- function O(n, e, t, s) {
292
- const r = (e >>> 0) + (s >>> 0);
293
- return { h: n + t + (r / 2 ** 32 | 0) | 0, l: r | 0 };
294
- }
295
- const et = (n, e, t) => (n >>> 0) + (e >>> 0) + (t >>> 0), tt = (n, e, t, s) => e + t + s + (n / 2 ** 32 | 0) | 0, nt = (n, e, t, s) => (n >>> 0) + (e >>> 0) + (t >>> 0) + (s >>> 0), st = (n, e, t, s, r) => e + t + s + r + (n / 2 ** 32 | 0) | 0, rt = (n, e, t, s, r) => (n >>> 0) + (e >>> 0) + (t >>> 0) + (s >>> 0) + (r >>> 0), it = (n, e, t, s, r, i) => e + t + s + r + i + (n / 2 ** 32 | 0) | 0, Ne = De([
296
- "0x428a2f98d728ae22",
297
- "0x7137449123ef65cd",
298
- "0xb5c0fbcfec4d3b2f",
299
- "0xe9b5dba58189dbbc",
300
- "0x3956c25bf348b538",
301
- "0x59f111f1b605d019",
302
- "0x923f82a4af194f9b",
303
- "0xab1c5ed5da6d8118",
304
- "0xd807aa98a3030242",
305
- "0x12835b0145706fbe",
306
- "0x243185be4ee4b28c",
307
- "0x550c7dc3d5ffb4e2",
308
- "0x72be5d74f27b896f",
309
- "0x80deb1fe3b1696b1",
310
- "0x9bdc06a725c71235",
311
- "0xc19bf174cf692694",
312
- "0xe49b69c19ef14ad2",
313
- "0xefbe4786384f25e3",
314
- "0x0fc19dc68b8cd5b5",
315
- "0x240ca1cc77ac9c65",
316
- "0x2de92c6f592b0275",
317
- "0x4a7484aa6ea6e483",
318
- "0x5cb0a9dcbd41fbd4",
319
- "0x76f988da831153b5",
320
- "0x983e5152ee66dfab",
321
- "0xa831c66d2db43210",
322
- "0xb00327c898fb213f",
323
- "0xbf597fc7beef0ee4",
324
- "0xc6e00bf33da88fc2",
325
- "0xd5a79147930aa725",
326
- "0x06ca6351e003826f",
327
- "0x142929670a0e6e70",
328
- "0x27b70a8546d22ffc",
329
- "0x2e1b21385c26c926",
330
- "0x4d2c6dfc5ac42aed",
331
- "0x53380d139d95b3df",
332
- "0x650a73548baf63de",
333
- "0x766a0abb3c77b2a8",
334
- "0x81c2c92e47edaee6",
335
- "0x92722c851482353b",
336
- "0xa2bfe8a14cf10364",
337
- "0xa81a664bbc423001",
338
- "0xc24b8b70d0f89791",
339
- "0xc76c51a30654be30",
340
- "0xd192e819d6ef5218",
341
- "0xd69906245565a910",
342
- "0xf40e35855771202a",
343
- "0x106aa07032bbd1b8",
344
- "0x19a4c116b8d2d0c8",
345
- "0x1e376c085141ab53",
346
- "0x2748774cdf8eeb99",
347
- "0x34b0bcb5e19b48a8",
348
- "0x391c0cb3c5c95a63",
349
- "0x4ed8aa4ae3418acb",
350
- "0x5b9cca4f7763e373",
351
- "0x682e6ff3d6b2b8a3",
352
- "0x748f82ee5defb2fc",
353
- "0x78a5636f43172f60",
354
- "0x84c87814a1f0ab72",
355
- "0x8cc702081a6439ec",
356
- "0x90befffa23631e28",
357
- "0xa4506cebde82bde9",
358
- "0xbef9a3f7b2c67915",
359
- "0xc67178f2e372532b",
360
- "0xca273eceea26619c",
361
- "0xd186b8c721c0c207",
362
- "0xeada7dd6cde0eb1e",
363
- "0xf57d4f7fee6ed178",
364
- "0x06f067aa72176fba",
365
- "0x0a637dc5a2c898a6",
366
- "0x113f9804bef90dae",
367
- "0x1b710b35131c471b",
368
- "0x28db77f523047d84",
369
- "0x32caab7b40c72493",
370
- "0x3c9ebe0a15c9bebc",
371
- "0x431d67c49c100d4c",
372
- "0x4cc5d4becb3e42b6",
373
- "0x597f299cfc657e2a",
374
- "0x5fcb6fab3ad6faec",
375
- "0x6c44198c4a475817"
376
- ].map((n) => BigInt(n))), ot = Ne[0], ft = Ne[1], L = /* @__PURE__ */ new Uint32Array(80), v = /* @__PURE__ */ new Uint32Array(80);
377
- class ct extends qe {
378
- constructor(e) {
379
- super(128, e, 16, !1);
380
- }
381
- // prettier-ignore
382
- get() {
383
- const { Ah: e, Al: t, Bh: s, Bl: r, Ch: i, Cl: o, Dh: a, Dl: f, Eh: c, El: l, Fh: u, Fl: d, Gh: w, Gl: E, Hh: b, Hl: h } = this;
384
- return [e, t, s, r, i, o, a, f, c, l, u, d, w, E, b, h];
385
- }
386
- // prettier-ignore
387
- set(e, t, s, r, i, o, a, f, c, l, u, d, w, E, b, h) {
388
- this.Ah = e | 0, this.Al = t | 0, this.Bh = s | 0, this.Bl = r | 0, this.Ch = i | 0, this.Cl = o | 0, this.Dh = a | 0, this.Dl = f | 0, this.Eh = c | 0, this.El = l | 0, this.Fh = u | 0, this.Fl = d | 0, this.Gh = w | 0, this.Gl = E | 0, this.Hh = b | 0, this.Hl = h | 0;
389
- }
390
- process(e, t) {
391
- for (let g = 0; g < 16; g++, t += 4)
392
- L[g] = e.getUint32(t), v[g] = e.getUint32(t += 4);
393
- for (let g = 16; g < 80; g++) {
394
- const S = L[g - 15] | 0, P = v[g - 15] | 0, J = k(S, P, 1) ^ k(S, P, 8) ^ fe(S, P, 7), q = F(S, P, 1) ^ F(S, P, 8) ^ ce(S, P, 7), x = L[g - 2] | 0, C = v[g - 2] | 0, $ = k(x, C, 19) ^ G(x, C, 61) ^ fe(x, C, 6), Q = F(x, C, 19) ^ X(x, C, 61) ^ ce(x, C, 6), K = nt(q, Q, v[g - 7], v[g - 16]), D = st(K, J, $, L[g - 7], L[g - 16]);
395
- L[g] = D | 0, v[g] = K | 0;
396
- }
397
- let { Ah: s, Al: r, Bh: i, Bl: o, Ch: a, Cl: f, Dh: c, Dl: l, Eh: u, El: d, Fh: w, Fl: E, Gh: b, Gl: h, Hh: y, Hl: A } = this;
398
- for (let g = 0; g < 80; g++) {
399
- const S = k(u, d, 14) ^ k(u, d, 18) ^ G(u, d, 41), P = F(u, d, 14) ^ F(u, d, 18) ^ X(u, d, 41), J = u & w ^ ~u & b, q = d & E ^ ~d & h, x = rt(A, P, q, ft[g], v[g]), C = it(x, y, S, J, ot[g], L[g]), $ = x | 0, Q = k(s, r, 28) ^ G(s, r, 34) ^ G(s, r, 39), K = F(s, r, 28) ^ X(s, r, 34) ^ X(s, r, 39), D = s & i ^ s & a ^ i & a, xe = r & o ^ r & f ^ o & f;
400
- y = b | 0, A = h | 0, b = w | 0, h = E | 0, w = u | 0, E = d | 0, { h: u, l: d } = O(c | 0, l | 0, C | 0, $ | 0), c = a | 0, l = f | 0, a = i | 0, f = o | 0, i = s | 0, o = r | 0;
401
- const re = et($, K, xe);
402
- s = tt(re, C, Q, D), r = re | 0;
403
- }
404
- ({ h: s, l: r } = O(this.Ah | 0, this.Al | 0, s | 0, r | 0)), { h: i, l: o } = O(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: f } = O(this.Ch | 0, this.Cl | 0, a | 0, f | 0), { h: c, l } = O(this.Dh | 0, this.Dl | 0, c | 0, l | 0), { h: u, l: d } = O(this.Eh | 0, this.El | 0, u | 0, d | 0), { h: w, l: E } = O(this.Fh | 0, this.Fl | 0, w | 0, E | 0), { h: b, l: h } = O(this.Gh | 0, this.Gl | 0, b | 0, h | 0), { h: y, l: A } = O(this.Hh | 0, this.Hl | 0, y | 0, A | 0), this.set(s, r, i, o, a, f, c, l, u, d, w, E, b, h, y, A);
405
- }
406
- roundClean() {
407
- R(L, v);
408
- }
409
- destroy() {
410
- R(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
411
- }
412
- }
413
- class at extends ct {
414
- Ah = N[0] | 0;
415
- Al = N[1] | 0;
416
- Bh = N[2] | 0;
417
- Bl = N[3] | 0;
418
- Ch = N[4] | 0;
419
- Cl = N[5] | 0;
420
- Dh = N[6] | 0;
421
- Dl = N[7] | 0;
422
- Eh = N[8] | 0;
423
- El = N[9] | 0;
424
- Fh = N[10] | 0;
425
- Fl = N[11] | 0;
426
- Gh = N[12] | 0;
427
- Gl = N[13] | 0;
428
- Hh = N[14] | 0;
429
- Hl = N[15] | 0;
430
- constructor() {
431
- super(64);
432
- }
433
- }
434
- const ut = /* @__PURE__ */ Ye(
435
- () => new at(),
436
- /* @__PURE__ */ We(3)
437
- ), lt = (n, e, t, s) => Se.from(Je(ut, n, e, { c: t, dkLen: s })), Te = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", dt = Te + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", ht = "[" + Te + "][" + dt + "]*", gt = new RegExp("^" + ht + "$");
438
- function Ie(n, e) {
439
- const t = [];
440
- let s = e.exec(n);
441
- for (; s; ) {
442
- const r = [];
443
- r.startIndex = e.lastIndex - s[0].length;
444
- const i = s.length;
445
- for (let o = 0; o < i; o++)
446
- r.push(s[o]);
447
- t.push(r), s = e.exec(n);
448
- }
449
- return t;
450
- }
451
- const z = function(n) {
452
- const e = gt.exec(n);
453
- return !(e === null || typeof e > "u");
454
- };
455
- function pt(n) {
456
- return typeof n < "u";
457
- }
458
- const bt = {
459
- allowBooleanAttributes: !1,
460
- //A tag can have attributes without any value
461
- unpairedTags: []
462
- };
463
- function Et(n, e) {
464
- e = Object.assign({}, bt, e);
465
- const t = [];
466
- let s = !1, r = !1;
467
- n[0] === "\uFEFF" && (n = n.substr(1));
468
- for (let i = 0; i < n.length; i++)
469
- if (n[i] === "<" && n[i + 1] === "?") {
470
- if (i += 2, i = ue(n, i), i.err) return i;
471
- } else if (n[i] === "<") {
472
- let o = i;
473
- if (i++, n[i] === "!") {
474
- i = le(n, i);
475
- continue;
476
- } else {
477
- let a = !1;
478
- n[i] === "/" && (a = !0, i++);
479
- let f = "";
480
- for (; i < n.length && n[i] !== ">" && n[i] !== " " && n[i] !== " " && n[i] !== `
481
- ` && n[i] !== "\r"; i++)
482
- f += n[i];
483
- if (f = f.trim(), f[f.length - 1] === "/" && (f = f.substring(0, f.length - 1), i--), !Ct(f)) {
484
- let u;
485
- return f.trim().length === 0 ? u = "Invalid space after '<'." : u = "Tag '" + f + "' is an invalid name.", p("InvalidTag", u, T(n, i));
486
- }
487
- const c = Nt(n, i);
488
- if (c === !1)
489
- return p("InvalidAttr", "Attributes for '" + f + "' have open quote.", T(n, i));
490
- let l = c.value;
491
- if (i = c.index, l[l.length - 1] === "/") {
492
- const u = i - l.length;
493
- l = l.substring(0, l.length - 1);
494
- const d = de(l, e);
495
- if (d === !0)
496
- s = !0;
497
- else
498
- return p(d.err.code, d.err.msg, T(n, u + d.err.line));
499
- } else if (a)
500
- if (c.tagClosed) {
501
- if (l.trim().length > 0)
502
- return p("InvalidTag", "Closing tag '" + f + "' can't have attributes or invalid starting.", T(n, o));
503
- if (t.length === 0)
504
- return p("InvalidTag", "Closing tag '" + f + "' has not been opened.", T(n, o));
505
- {
506
- const u = t.pop();
507
- if (f !== u.tagName) {
508
- let d = T(n, u.tagStartPos);
509
- return p(
510
- "InvalidTag",
511
- "Expected closing tag '" + u.tagName + "' (opened in line " + d.line + ", col " + d.col + ") instead of closing tag '" + f + "'.",
512
- T(n, o)
513
- );
514
- }
515
- t.length == 0 && (r = !0);
516
- }
517
- } else return p("InvalidTag", "Closing tag '" + f + "' doesn't have proper closing.", T(n, i));
518
- else {
519
- const u = de(l, e);
520
- if (u !== !0)
521
- return p(u.err.code, u.err.msg, T(n, i - l.length + u.err.line));
522
- if (r === !0)
523
- return p("InvalidXml", "Multiple possible root nodes found.", T(n, i));
524
- e.unpairedTags.indexOf(f) !== -1 || t.push({ tagName: f, tagStartPos: o }), s = !0;
525
- }
526
- for (i++; i < n.length; i++)
527
- if (n[i] === "<")
528
- if (n[i + 1] === "!") {
529
- i++, i = le(n, i);
530
- continue;
531
- } else if (n[i + 1] === "?") {
532
- if (i = ue(n, ++i), i.err) return i;
533
- } else
534
- break;
535
- else if (n[i] === "&") {
536
- const u = At(n, i);
537
- if (u == -1)
538
- return p("InvalidChar", "char '&' is not expected.", T(n, i));
539
- i = u;
540
- } else if (r === !0 && !ae(n[i]))
541
- return p("InvalidXml", "Extra text at the end", T(n, i));
542
- n[i] === "<" && i--;
543
- }
544
- } else {
545
- if (ae(n[i]))
546
- continue;
547
- return p("InvalidChar", "char '" + n[i] + "' is not expected.", T(n, i));
548
- }
549
- if (s) {
550
- if (t.length == 1)
551
- return p("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", T(n, t[0].tagStartPos));
552
- if (t.length > 0)
553
- return p("InvalidXml", "Invalid '" + JSON.stringify(t.map((i) => i.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
554
- } else return p("InvalidXml", "Start tag expected.", 1);
555
- return !0;
556
- }
557
- function ae(n) {
558
- return n === " " || n === " " || n === `
559
- ` || n === "\r";
560
- }
561
- function ue(n, e) {
562
- const t = e;
563
- for (; e < n.length; e++)
564
- if (n[e] == "?" || n[e] == " ") {
565
- const s = n.substr(t, e - t);
566
- if (e > 5 && s === "xml")
567
- return p("InvalidXml", "XML declaration allowed only at the start of the document.", T(n, e));
568
- if (n[e] == "?" && n[e + 1] == ">") {
569
- e++;
570
- break;
571
- } else
572
- continue;
573
- }
574
- return e;
575
- }
576
- function le(n, e) {
577
- if (n.length > e + 5 && n[e + 1] === "-" && n[e + 2] === "-") {
578
- for (e += 3; e < n.length; e++)
579
- if (n[e] === "-" && n[e + 1] === "-" && n[e + 2] === ">") {
580
- e += 2;
581
- break;
582
- }
583
- } else if (n.length > e + 8 && n[e + 1] === "D" && n[e + 2] === "O" && n[e + 3] === "C" && n[e + 4] === "T" && n[e + 5] === "Y" && n[e + 6] === "P" && n[e + 7] === "E") {
584
- let t = 1;
585
- for (e += 8; e < n.length; e++)
586
- if (n[e] === "<")
587
- t++;
588
- else if (n[e] === ">" && (t--, t === 0))
589
- break;
590
- } else if (n.length > e + 9 && n[e + 1] === "[" && n[e + 2] === "C" && n[e + 3] === "D" && n[e + 4] === "A" && n[e + 5] === "T" && n[e + 6] === "A" && n[e + 7] === "[") {
591
- for (e += 8; e < n.length; e++)
592
- if (n[e] === "]" && n[e + 1] === "]" && n[e + 2] === ">") {
593
- e += 2;
594
- break;
595
- }
596
- }
597
- return e;
598
- }
599
- const yt = '"', wt = "'";
600
- function Nt(n, e) {
601
- let t = "", s = "", r = !1;
602
- for (; e < n.length; e++) {
603
- if (n[e] === yt || n[e] === wt)
604
- s === "" ? s = n[e] : s !== n[e] || (s = "");
605
- else if (n[e] === ">" && s === "") {
606
- r = !0;
607
- break;
608
- }
609
- t += n[e];
610
- }
611
- return s !== "" ? !1 : {
612
- value: t,
613
- index: e,
614
- tagClosed: r
615
- };
616
- }
617
- const Tt = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
618
- function de(n, e) {
619
- const t = Ie(n, Tt), s = {};
620
- for (let r = 0; r < t.length; r++) {
621
- if (t[r][1].length === 0)
622
- return p("InvalidAttr", "Attribute '" + t[r][2] + "' has no space in starting.", U(t[r]));
623
- if (t[r][3] !== void 0 && t[r][4] === void 0)
624
- return p("InvalidAttr", "Attribute '" + t[r][2] + "' is without value.", U(t[r]));
625
- if (t[r][3] === void 0 && !e.allowBooleanAttributes)
626
- return p("InvalidAttr", "boolean attribute '" + t[r][2] + "' is not allowed.", U(t[r]));
627
- const i = t[r][2];
628
- if (!xt(i))
629
- return p("InvalidAttr", "Attribute '" + i + "' is an invalid name.", U(t[r]));
630
- if (!s.hasOwnProperty(i))
631
- s[i] = 1;
632
- else
633
- return p("InvalidAttr", "Attribute '" + i + "' is repeated.", U(t[r]));
634
- }
635
- return !0;
636
- }
637
- function It(n, e) {
638
- let t = /\d/;
639
- for (n[e] === "x" && (e++, t = /[\da-fA-F]/); e < n.length; e++) {
640
- if (n[e] === ";")
641
- return e;
642
- if (!n[e].match(t))
643
- break;
644
- }
645
- return -1;
646
- }
647
- function At(n, e) {
648
- if (e++, n[e] === ";")
649
- return -1;
650
- if (n[e] === "#")
651
- return e++, It(n, e);
652
- let t = 0;
653
- for (; e < n.length; e++, t++)
654
- if (!(n[e].match(/\w/) && t < 20)) {
655
- if (n[e] === ";")
656
- break;
657
- return -1;
658
- }
659
- return e;
660
- }
661
- function p(n, e, t) {
662
- return {
663
- err: {
664
- code: n,
665
- msg: e,
666
- line: t.line || t,
667
- col: t.col
668
- }
669
- };
670
- }
671
- function xt(n) {
672
- return z(n);
673
- }
674
- function Ct(n) {
675
- return z(n);
676
- }
677
- function T(n, e) {
678
- const t = n.substring(0, e).split(/\r?\n/);
679
- return {
680
- line: t.length,
681
- // column number is last line's length + 1, because column numbering starts at 1:
682
- col: t[t.length - 1].length + 1
683
- };
684
- }
685
- function U(n) {
686
- return n.startIndex + n[1].length;
687
- }
688
- const Ot = {
689
- preserveOrder: !1,
690
- attributeNamePrefix: "@_",
691
- attributesGroupName: !1,
692
- textNodeName: "#text",
693
- ignoreAttributes: !0,
694
- removeNSPrefix: !1,
695
- // remove NS from tag name or attribute name if true
696
- allowBooleanAttributes: !1,
697
- //a tag can have attributes without any value
698
- //ignoreRootElement : false,
699
- parseTagValue: !0,
700
- parseAttributeValue: !1,
701
- trimValues: !0,
702
- //Trim string values of tag and attributes
703
- cdataPropName: !1,
704
- numberParseOptions: {
705
- hex: !0,
706
- leadingZeros: !0,
707
- eNotation: !0
708
- },
709
- tagValueProcessor: function(n, e) {
710
- return e;
711
- },
712
- attributeValueProcessor: function(n, e) {
713
- return e;
714
- },
715
- stopNodes: [],
716
- //nested tags will not be parsed even for errors
717
- alwaysCreateTextNode: !1,
718
- isArray: () => !1,
719
- commentPropName: !1,
720
- unpairedTags: [],
721
- processEntities: !0,
722
- htmlEntities: !1,
723
- ignoreDeclaration: !1,
724
- ignorePiTags: !1,
725
- transformTagName: !1,
726
- transformAttributeName: !1,
727
- updateTag: function(n, e, t) {
728
- return n;
729
- },
730
- // skipEmptyListItem: false
731
- captureMetaData: !1
732
- }, St = function(n) {
733
- return Object.assign({}, Ot, n);
734
- };
735
- let Z;
736
- typeof Symbol != "function" ? Z = "@@xmlMetadata" : Z = /* @__PURE__ */ Symbol("XML Node Metadata");
737
- class _ {
738
- constructor(e) {
739
- this.tagname = e, this.child = [], this[":@"] = {};
740
- }
741
- add(e, t) {
742
- e === "__proto__" && (e = "#__proto__"), this.child.push({ [e]: t });
743
- }
744
- addChild(e, t) {
745
- e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({ [e.tagname]: e.child, ":@": e[":@"] }) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][Z] = { startIndex: t });
746
- }
747
- /** symbol used for metadata */
748
- static getMetaDataSymbol() {
749
- return Z;
750
- }
751
- }
752
- class Pt {
753
- constructor(e) {
754
- this.suppressValidationErr = !e;
755
- }
756
- readDocType(e, t) {
757
- const s = {};
758
- if (e[t + 3] === "O" && e[t + 4] === "C" && e[t + 5] === "T" && e[t + 6] === "Y" && e[t + 7] === "P" && e[t + 8] === "E") {
759
- t = t + 9;
760
- let r = 1, i = !1, o = !1, a = "";
761
- for (; t < e.length; t++)
762
- if (e[t] === "<" && !o) {
763
- if (i && H(e, "!ENTITY", t)) {
764
- t += 7;
765
- let f, c;
766
- if ([f, c, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr), c.indexOf("&") === -1) {
767
- const l = f.replace(/[.\-+*:]/g, "\\.");
768
- s[f] = {
769
- regx: RegExp(`&${l};`, "g"),
770
- val: c
771
- };
772
- }
773
- } else if (i && H(e, "!ELEMENT", t)) {
774
- t += 8;
775
- const { index: f } = this.readElementExp(e, t + 1);
776
- t = f;
777
- } else if (i && H(e, "!ATTLIST", t))
778
- t += 8;
779
- else if (i && H(e, "!NOTATION", t)) {
780
- t += 9;
781
- const { index: f } = this.readNotationExp(e, t + 1, this.suppressValidationErr);
782
- t = f;
783
- } else if (H(e, "!--", t)) o = !0;
784
- else throw new Error("Invalid DOCTYPE");
785
- r++, a = "";
786
- } else if (e[t] === ">") {
787
- if (o ? e[t - 1] === "-" && e[t - 2] === "-" && (o = !1, r--) : r--, r === 0)
788
- break;
789
- } else e[t] === "[" ? i = !0 : a += e[t];
790
- if (r !== 0)
791
- throw new Error("Unclosed DOCTYPE");
792
- } else
793
- throw new Error("Invalid Tag instead of DOCTYPE");
794
- return { entities: s, i: t };
795
- }
796
- readEntityExp(e, t) {
797
- t = I(e, t);
798
- let s = "";
799
- for (; t < e.length && !/\s/.test(e[t]) && e[t] !== '"' && e[t] !== "'"; )
800
- s += e[t], t++;
801
- if (M(s), t = I(e, t), !this.suppressValidationErr) {
802
- if (e.substring(t, t + 6).toUpperCase() === "SYSTEM")
803
- throw new Error("External entities are not supported");
804
- if (e[t] === "%")
805
- throw new Error("Parameter entities are not supported");
806
- }
807
- let r = "";
808
- return [t, r] = this.readIdentifierVal(e, t, "entity"), t--, [s, r, t];
809
- }
810
- readNotationExp(e, t) {
811
- t = I(e, t);
812
- let s = "";
813
- for (; t < e.length && !/\s/.test(e[t]); )
814
- s += e[t], t++;
815
- !this.suppressValidationErr && M(s), t = I(e, t);
816
- const r = e.substring(t, t + 6).toUpperCase();
817
- if (!this.suppressValidationErr && r !== "SYSTEM" && r !== "PUBLIC")
818
- throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);
819
- t += r.length, t = I(e, t);
820
- let i = null, o = null;
821
- if (r === "PUBLIC")
822
- [t, i] = this.readIdentifierVal(e, t, "publicIdentifier"), t = I(e, t), (e[t] === '"' || e[t] === "'") && ([t, o] = this.readIdentifierVal(e, t, "systemIdentifier"));
823
- else if (r === "SYSTEM" && ([t, o] = this.readIdentifierVal(e, t, "systemIdentifier"), !this.suppressValidationErr && !o))
824
- throw new Error("Missing mandatory system identifier for SYSTEM notation");
825
- return { notationName: s, publicIdentifier: i, systemIdentifier: o, index: --t };
826
- }
827
- readIdentifierVal(e, t, s) {
828
- let r = "";
829
- const i = e[t];
830
- if (i !== '"' && i !== "'")
831
- throw new Error(`Expected quoted string, found "${i}"`);
832
- for (t++; t < e.length && e[t] !== i; )
833
- r += e[t], t++;
834
- if (e[t] !== i)
835
- throw new Error(`Unterminated ${s} value`);
836
- return t++, [t, r];
837
- }
838
- readElementExp(e, t) {
839
- t = I(e, t);
840
- let s = "";
841
- for (; t < e.length && !/\s/.test(e[t]); )
842
- s += e[t], t++;
843
- if (!this.suppressValidationErr && !z(s))
844
- throw new Error(`Invalid element name: "${s}"`);
845
- t = I(e, t);
846
- let r = "";
847
- if (e[t] === "E" && H(e, "MPTY", t)) t += 4;
848
- else if (e[t] === "A" && H(e, "NY", t)) t += 2;
849
- else if (e[t] === "(") {
850
- for (t++; t < e.length && e[t] !== ")"; )
851
- r += e[t], t++;
852
- if (e[t] !== ")")
853
- throw new Error("Unterminated content model");
854
- } else if (!this.suppressValidationErr)
855
- throw new Error(`Invalid Element Expression, found "${e[t]}"`);
856
- return {
857
- elementName: s,
858
- contentModel: r.trim(),
859
- index: t
860
- };
861
- }
862
- readAttlistExp(e, t) {
863
- t = I(e, t);
864
- let s = "";
865
- for (; t < e.length && !/\s/.test(e[t]); )
866
- s += e[t], t++;
867
- M(s), t = I(e, t);
868
- let r = "";
869
- for (; t < e.length && !/\s/.test(e[t]); )
870
- r += e[t], t++;
871
- if (!M(r))
872
- throw new Error(`Invalid attribute name: "${r}"`);
873
- t = I(e, t);
874
- let i = "";
875
- if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
876
- if (i = "NOTATION", t += 8, t = I(e, t), e[t] !== "(")
877
- throw new Error(`Expected '(', found "${e[t]}"`);
878
- t++;
879
- let a = [];
880
- for (; t < e.length && e[t] !== ")"; ) {
881
- let f = "";
882
- for (; t < e.length && e[t] !== "|" && e[t] !== ")"; )
883
- f += e[t], t++;
884
- if (f = f.trim(), !M(f))
885
- throw new Error(`Invalid notation name: "${f}"`);
886
- a.push(f), e[t] === "|" && (t++, t = I(e, t));
887
- }
888
- if (e[t] !== ")")
889
- throw new Error("Unterminated list of notations");
890
- t++, i += " (" + a.join("|") + ")";
891
- } else {
892
- for (; t < e.length && !/\s/.test(e[t]); )
893
- i += e[t], t++;
894
- const a = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
895
- if (!this.suppressValidationErr && !a.includes(i.toUpperCase()))
896
- throw new Error(`Invalid attribute type: "${i}"`);
897
- }
898
- t = I(e, t);
899
- let o = "";
900
- return e.substring(t, t + 8).toUpperCase() === "#REQUIRED" ? (o = "#REQUIRED", t += 8) : e.substring(t, t + 7).toUpperCase() === "#IMPLIED" ? (o = "#IMPLIED", t += 7) : [t, o] = this.readIdentifierVal(e, t, "ATTLIST"), {
901
- elementName: s,
902
- attributeName: r,
903
- attributeType: i,
904
- defaultValue: o,
905
- index: t
906
- };
907
- }
908
- }
909
- const I = (n, e) => {
910
- for (; e < n.length && /\s/.test(n[e]); )
911
- e++;
912
- return e;
913
- };
914
- function H(n, e, t) {
915
- for (let s = 0; s < e.length; s++)
916
- if (e[s] !== n[t + s + 1]) return !1;
917
- return !0;
918
- }
919
- function M(n) {
920
- if (z(n))
921
- return n;
922
- throw new Error(`Invalid entity name ${n}`);
923
- }
924
- const Lt = /^[-+]?0x[a-fA-F0-9]+$/, vt = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Ht = {
925
- hex: !0,
926
- // oct: false,
927
- leadingZeros: !0,
928
- decimalPoint: ".",
929
- eNotation: !0
930
- //skipLike: /regex/
931
- };
932
- function _t(n, e = {}) {
933
- if (e = Object.assign({}, Ht, e), !n || typeof n != "string") return n;
934
- let t = n.trim();
935
- if (e.skipLike !== void 0 && e.skipLike.test(t)) return n;
936
- if (n === "0") return 0;
937
- if (e.hex && Lt.test(t))
938
- return Ut(t, 16);
939
- if (t.includes("e") || t.includes("E"))
940
- return kt(n, t, e);
941
- {
942
- const s = vt.exec(t);
943
- if (s) {
944
- const r = s[1] || "", i = s[2];
945
- let o = Ft(s[3]);
946
- const a = r ? (
947
- // 0., -00., 000.
948
- n[i.length + 1] === "."
949
- ) : n[i.length] === ".";
950
- if (!e.leadingZeros && (i.length > 1 || i.length === 1 && !a))
951
- return n;
952
- {
953
- const f = Number(t), c = String(f);
954
- if (f === 0) return f;
955
- if (c.search(/[eE]/) !== -1)
956
- return e.eNotation ? f : n;
957
- if (t.indexOf(".") !== -1)
958
- return c === "0" || c === o || c === `${r}${o}` ? f : n;
959
- let l = i ? o : t;
960
- return i ? l === c || r + l === c ? f : n : l === c || l === r + c ? f : n;
961
- }
962
- } else
963
- return n;
964
- }
965
- }
966
- const mt = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
967
- function kt(n, e, t) {
968
- if (!t.eNotation) return n;
969
- const s = e.match(mt);
970
- if (s) {
971
- let r = s[1] || "";
972
- const i = s[3].indexOf("e") === -1 ? "E" : "e", o = s[2], a = r ? (
973
- // 0E.
974
- n[o.length + 1] === i
975
- ) : n[o.length] === i;
976
- return o.length > 1 && a ? n : o.length === 1 && (s[3].startsWith(`.${i}`) || s[3][0] === i) ? Number(e) : t.leadingZeros && !a ? (e = (s[1] || "") + s[3], Number(e)) : n;
977
- } else
978
- return n;
979
- }
980
- function Ft(n) {
981
- return n && n.indexOf(".") !== -1 && (n = n.replace(/0+$/, ""), n === "." ? n = "0" : n[0] === "." ? n = "0" + n : n[n.length - 1] === "." && (n = n.substring(0, n.length - 1))), n;
982
- }
983
- function Ut(n, e) {
984
- if (parseInt) return parseInt(n, e);
985
- if (Number.parseInt) return Number.parseInt(n, e);
986
- if (window && window.parseInt) return window.parseInt(n, e);
987
- throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
988
- }
989
- function Mt(n) {
990
- return typeof n == "function" ? n : Array.isArray(n) ? (e) => {
991
- for (const t of n)
992
- if (typeof t == "string" && e === t || t instanceof RegExp && t.test(e))
993
- return !0;
994
- } : () => !1;
995
- }
996
- class Vt {
997
- constructor(e) {
998
- if (this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
999
- apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
1000
- gt: { regex: /&(gt|#62|#x3E);/g, val: ">" },
1001
- lt: { regex: /&(lt|#60|#x3C);/g, val: "<" },
1002
- quot: { regex: /&(quot|#34|#x22);/g, val: '"' }
1003
- }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = {
1004
- space: { regex: /&(nbsp|#160);/g, val: " " },
1005
- // "lt" : { regex: /&(lt|#60);/g, val: "<" },
1006
- // "gt" : { regex: /&(gt|#62);/g, val: ">" },
1007
- // "amp" : { regex: /&(amp|#38);/g, val: "&" },
1008
- // "quot" : { regex: /&(quot|#34);/g, val: "\"" },
1009
- // "apos" : { regex: /&(apos|#39);/g, val: "'" },
1010
- cent: { regex: /&(cent|#162);/g, val: "¢" },
1011
- pound: { regex: /&(pound|#163);/g, val: "£" },
1012
- yen: { regex: /&(yen|#165);/g, val: "¥" },
1013
- euro: { regex: /&(euro|#8364);/g, val: "€" },
1014
- copyright: { regex: /&(copy|#169);/g, val: "©" },
1015
- reg: { regex: /&(reg|#174);/g, val: "®" },
1016
- inr: { regex: /&(inr|#8377);/g, val: "₹" },
1017
- num_dec: { regex: /&#([0-9]{1,7});/g, val: (t, s) => he(s, 10, "&#") },
1018
- num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t, s) => he(s, 16, "&#x") }
1019
- }, this.addExternalEntities = Bt, this.parseXml = Gt, this.parseTextData = Rt, this.resolveNameSpace = $t, this.buildAttributesMap = jt, this.isItStopNode = Zt, this.replaceEntitiesValue = Yt, this.readStopNodeData = Jt, this.saveTextToParentTag = Wt, this.addChild = Xt, this.ignoreAttributesFn = Mt(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) {
1020
- this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set();
1021
- for (let t = 0; t < this.options.stopNodes.length; t++) {
1022
- const s = this.options.stopNodes[t];
1023
- typeof s == "string" && (s.startsWith("*.") ? this.stopNodesWildcard.add(s.substring(2)) : this.stopNodesExact.add(s));
1024
- }
1025
- }
1026
- }
1027
- }
1028
- function Bt(n) {
1029
- const e = Object.keys(n);
1030
- for (let t = 0; t < e.length; t++) {
1031
- const s = e[t], r = s.replace(/[.\-+*:]/g, "\\.");
1032
- this.lastEntities[s] = {
1033
- regex: new RegExp("&" + r + ";", "g"),
1034
- val: n[s]
1035
- };
1036
- }
1037
- }
1038
- function Rt(n, e, t, s, r, i, o) {
1039
- if (n !== void 0 && (this.options.trimValues && !s && (n = n.trim()), n.length > 0)) {
1040
- o || (n = this.replaceEntitiesValue(n));
1041
- const a = this.options.tagValueProcessor(e, n, t, r, i);
1042
- return a == null ? n : typeof a != typeof n || a !== n ? a : this.options.trimValues ? ne(n, this.options.parseTagValue, this.options.numberParseOptions) : n.trim() === n ? ne(n, this.options.parseTagValue, this.options.numberParseOptions) : n;
1043
- }
1044
- }
1045
- function $t(n) {
1046
- if (this.options.removeNSPrefix) {
1047
- const e = n.split(":"), t = n.charAt(0) === "/" ? "/" : "";
1048
- if (e[0] === "xmlns")
1049
- return "";
1050
- e.length === 2 && (n = t + e[1]);
1051
- }
1052
- return n;
1053
- }
1054
- const Kt = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
1055
- function jt(n, e) {
1056
- if (this.options.ignoreAttributes !== !0 && typeof n == "string") {
1057
- const t = Ie(n, Kt), s = t.length, r = {};
1058
- for (let i = 0; i < s; i++) {
1059
- const o = this.resolveNameSpace(t[i][1]);
1060
- if (this.ignoreAttributesFn(o, e))
1061
- continue;
1062
- let a = t[i][4], f = this.options.attributeNamePrefix + o;
1063
- if (o.length)
1064
- if (this.options.transformAttributeName && (f = this.options.transformAttributeName(f)), f === "__proto__" && (f = "#__proto__"), a !== void 0) {
1065
- this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
1066
- const c = this.options.attributeValueProcessor(o, a, e);
1067
- c == null ? r[f] = a : typeof c != typeof a || c !== a ? r[f] = c : r[f] = ne(
1068
- a,
1069
- this.options.parseAttributeValue,
1070
- this.options.numberParseOptions
1071
- );
1072
- } else this.options.allowBooleanAttributes && (r[f] = !0);
1073
- }
1074
- if (!Object.keys(r).length)
1075
- return;
1076
- if (this.options.attributesGroupName) {
1077
- const i = {};
1078
- return i[this.options.attributesGroupName] = r, i;
1079
- }
1080
- return r;
1081
- }
1082
- }
1083
- const Gt = function(n) {
1084
- n = n.replace(/\r\n?/g, `
1085
- `);
1086
- const e = new _("!xml");
1087
- let t = e, s = "", r = "";
1088
- const i = new Pt(this.options.processEntities);
1089
- for (let o = 0; o < n.length; o++)
1090
- if (n[o] === "<")
1091
- if (n[o + 1] === "/") {
1092
- const f = m(n, ">", o, "Closing Tag is not closed.");
1093
- let c = n.substring(o + 2, f).trim();
1094
- if (this.options.removeNSPrefix) {
1095
- const d = c.indexOf(":");
1096
- d !== -1 && (c = c.substr(d + 1));
1097
- }
1098
- this.options.transformTagName && (c = this.options.transformTagName(c)), t && (s = this.saveTextToParentTag(s, t, r));
1099
- const l = r.substring(r.lastIndexOf(".") + 1);
1100
- if (c && this.options.unpairedTags.indexOf(c) !== -1)
1101
- throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);
1102
- let u = 0;
1103
- l && this.options.unpairedTags.indexOf(l) !== -1 ? (u = r.lastIndexOf(".", r.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : u = r.lastIndexOf("."), r = r.substring(0, u), t = this.tagsNodeStack.pop(), s = "", o = f;
1104
- } else if (n[o + 1] === "?") {
1105
- let f = te(n, o, !1, "?>");
1106
- if (!f) throw new Error("Pi Tag is not closed.");
1107
- if (s = this.saveTextToParentTag(s, t, r), !(this.options.ignoreDeclaration && f.tagName === "?xml" || this.options.ignorePiTags)) {
1108
- const c = new _(f.tagName);
1109
- c.add(this.options.textNodeName, ""), f.tagName !== f.tagExp && f.attrExpPresent && (c[":@"] = this.buildAttributesMap(f.tagExp, r)), this.addChild(t, c, r, o);
1110
- }
1111
- o = f.closeIndex + 1;
1112
- } else if (n.substr(o + 1, 3) === "!--") {
1113
- const f = m(n, "-->", o + 4, "Comment is not closed.");
1114
- if (this.options.commentPropName) {
1115
- const c = n.substring(o + 4, f - 2);
1116
- s = this.saveTextToParentTag(s, t, r), t.add(this.options.commentPropName, [{ [this.options.textNodeName]: c }]);
1117
- }
1118
- o = f;
1119
- } else if (n.substr(o + 1, 2) === "!D") {
1120
- const f = i.readDocType(n, o);
1121
- this.docTypeEntities = f.entities, o = f.i;
1122
- } else if (n.substr(o + 1, 2) === "![") {
1123
- const f = m(n, "]]>", o, "CDATA is not closed.") - 2, c = n.substring(o + 9, f);
1124
- s = this.saveTextToParentTag(s, t, r);
1125
- let l = this.parseTextData(c, t.tagname, r, !0, !1, !0, !0);
1126
- l == null && (l = ""), this.options.cdataPropName ? t.add(this.options.cdataPropName, [{ [this.options.textNodeName]: c }]) : t.add(this.options.textNodeName, l), o = f + 2;
1127
- } else {
1128
- let f = te(n, o, this.options.removeNSPrefix), c = f.tagName;
1129
- const l = f.rawTagName;
1130
- let u = f.tagExp, d = f.attrExpPresent, w = f.closeIndex;
1131
- if (this.options.transformTagName) {
1132
- const h = this.options.transformTagName(c);
1133
- u === c && (u = h), c = h;
1134
- }
1135
- t && s && t.tagname !== "!xml" && (s = this.saveTextToParentTag(s, t, r, !1));
1136
- const E = t;
1137
- E && this.options.unpairedTags.indexOf(E.tagname) !== -1 && (t = this.tagsNodeStack.pop(), r = r.substring(0, r.lastIndexOf("."))), c !== e.tagname && (r += r ? "." + c : c);
1138
- const b = o;
1139
- if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, r, c)) {
1140
- let h = "";
1141
- if (u.length > 0 && u.lastIndexOf("/") === u.length - 1)
1142
- c[c.length - 1] === "/" ? (c = c.substr(0, c.length - 1), r = r.substr(0, r.length - 1), u = c) : u = u.substr(0, u.length - 1), o = f.closeIndex;
1143
- else if (this.options.unpairedTags.indexOf(c) !== -1)
1144
- o = f.closeIndex;
1145
- else {
1146
- const A = this.readStopNodeData(n, l, w + 1);
1147
- if (!A) throw new Error(`Unexpected end of ${l}`);
1148
- o = A.i, h = A.tagContent;
1149
- }
1150
- const y = new _(c);
1151
- c !== u && d && (y[":@"] = this.buildAttributesMap(
1152
- u,
1153
- r
1154
- )), h && (h = this.parseTextData(h, c, r, !0, d, !0, !0)), r = r.substr(0, r.lastIndexOf(".")), y.add(this.options.textNodeName, h), this.addChild(t, y, r, b);
1155
- } else {
1156
- if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
1157
- if (c[c.length - 1] === "/" ? (c = c.substr(0, c.length - 1), r = r.substr(0, r.length - 1), u = c) : u = u.substr(0, u.length - 1), this.options.transformTagName) {
1158
- const y = this.options.transformTagName(c);
1159
- u === c && (u = y), c = y;
1160
- }
1161
- const h = new _(c);
1162
- c !== u && d && (h[":@"] = this.buildAttributesMap(u, r)), this.addChild(t, h, r, b), r = r.substr(0, r.lastIndexOf("."));
1163
- } else {
1164
- const h = new _(c);
1165
- this.tagsNodeStack.push(t), c !== u && d && (h[":@"] = this.buildAttributesMap(u, r)), this.addChild(t, h, r, b), t = h;
1166
- }
1167
- s = "", o = w;
1168
- }
1169
- }
1170
- else
1171
- s += n[o];
1172
- return e.child;
1173
- };
1174
- function Xt(n, e, t, s) {
1175
- this.options.captureMetaData || (s = void 0);
1176
- const r = this.options.updateTag(e.tagname, t, e[":@"]);
1177
- r === !1 || (typeof r == "string" && (e.tagname = r), n.addChild(e, s));
1178
- }
1179
- const Yt = function(n) {
1180
- if (this.options.processEntities) {
1181
- for (let e in this.docTypeEntities) {
1182
- const t = this.docTypeEntities[e];
1183
- n = n.replace(t.regx, t.val);
1184
- }
1185
- for (let e in this.lastEntities) {
1186
- const t = this.lastEntities[e];
1187
- n = n.replace(t.regex, t.val);
1188
- }
1189
- if (this.options.htmlEntities)
1190
- for (let e in this.htmlEntities) {
1191
- const t = this.htmlEntities[e];
1192
- n = n.replace(t.regex, t.val);
1193
- }
1194
- n = n.replace(this.ampEntity.regex, this.ampEntity.val);
1195
- }
1196
- return n;
1197
- };
1198
- function Wt(n, e, t, s) {
1199
- return n && (s === void 0 && (s = e.child.length === 0), n = this.parseTextData(
1200
- n,
1201
- e.tagname,
1202
- t,
1203
- !1,
1204
- e[":@"] ? Object.keys(e[":@"]).length !== 0 : !1,
1205
- s
1206
- ), n !== void 0 && n !== "" && e.add(this.options.textNodeName, n), n = ""), n;
1207
- }
1208
- function Zt(n, e, t, s) {
1209
- return !!(e && e.has(s) || n && n.has(t));
1210
- }
1211
- function zt(n, e, t = ">") {
1212
- let s, r = "";
1213
- for (let i = e; i < n.length; i++) {
1214
- let o = n[i];
1215
- if (s)
1216
- o === s && (s = "");
1217
- else if (o === '"' || o === "'")
1218
- s = o;
1219
- else if (o === t[0])
1220
- if (t[1]) {
1221
- if (n[i + 1] === t[1])
1222
- return {
1223
- data: r,
1224
- index: i
1225
- };
1226
- } else
1227
- return {
1228
- data: r,
1229
- index: i
1230
- };
1231
- else o === " " && (o = " ");
1232
- r += o;
1233
- }
1234
- }
1235
- function m(n, e, t, s) {
1236
- const r = n.indexOf(e, t);
1237
- if (r === -1)
1238
- throw new Error(s);
1239
- return r + e.length - 1;
1240
- }
1241
- function te(n, e, t, s = ">") {
1242
- const r = zt(n, e + 1, s);
1243
- if (!r) return;
1244
- let i = r.data;
1245
- const o = r.index, a = i.search(/\s/);
1246
- let f = i, c = !0;
1247
- a !== -1 && (f = i.substring(0, a), i = i.substring(a + 1).trimStart());
1248
- const l = f;
1249
- if (t) {
1250
- const u = f.indexOf(":");
1251
- u !== -1 && (f = f.substr(u + 1), c = f !== r.data.substr(u + 1));
1252
- }
1253
- return {
1254
- tagName: f,
1255
- tagExp: i,
1256
- closeIndex: o,
1257
- attrExpPresent: c,
1258
- rawTagName: l
1259
- };
1260
- }
1261
- function Jt(n, e, t) {
1262
- const s = t;
1263
- let r = 1;
1264
- for (; t < n.length; t++)
1265
- if (n[t] === "<")
1266
- if (n[t + 1] === "/") {
1267
- const i = m(n, ">", t, `${e} is not closed`);
1268
- if (n.substring(t + 2, i).trim() === e && (r--, r === 0))
1269
- return {
1270
- tagContent: n.substring(s, t),
1271
- i
1272
- };
1273
- t = i;
1274
- } else if (n[t + 1] === "?")
1275
- t = m(n, "?>", t + 1, "StopNode is not closed.");
1276
- else if (n.substr(t + 1, 3) === "!--")
1277
- t = m(n, "-->", t + 3, "StopNode is not closed.");
1278
- else if (n.substr(t + 1, 2) === "![")
1279
- t = m(n, "]]>", t, "StopNode is not closed.") - 2;
1280
- else {
1281
- const i = te(n, t, ">");
1282
- i && ((i && i.tagName) === e && i.tagExp[i.tagExp.length - 1] !== "/" && r++, t = i.closeIndex);
1283
- }
1284
- }
1285
- function ne(n, e, t) {
1286
- if (e && typeof n == "string") {
1287
- const s = n.trim();
1288
- return s === "true" ? !0 : s === "false" ? !1 : _t(n, t);
1289
- } else
1290
- return pt(n) ? n : "";
1291
- }
1292
- function he(n, e, t) {
1293
- const s = Number.parseInt(n, e);
1294
- return s >= 0 && s <= 1114111 ? String.fromCodePoint(s) : t + n + ";";
1295
- }
1296
- const ee = _.getMetaDataSymbol();
1297
- function qt(n, e) {
1298
- return Ae(n, e);
1299
- }
1300
- function Ae(n, e, t) {
1301
- let s;
1302
- const r = {};
1303
- for (let i = 0; i < n.length; i++) {
1304
- const o = n[i], a = Qt(o);
1305
- let f = "";
1306
- if (t === void 0 ? f = a : f = t + "." + a, a === e.textNodeName)
1307
- s === void 0 ? s = o[a] : s += "" + o[a];
1308
- else {
1309
- if (a === void 0)
1310
- continue;
1311
- if (o[a]) {
1312
- let c = Ae(o[a], e, f);
1313
- const l = en(c, e);
1314
- o[ee] !== void 0 && (c[ee] = o[ee]), o[":@"] ? Dt(c, o[":@"], f, e) : Object.keys(c).length === 1 && c[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? c = c[e.textNodeName] : Object.keys(c).length === 0 && (e.alwaysCreateTextNode ? c[e.textNodeName] = "" : c = ""), r[a] !== void 0 && r.hasOwnProperty(a) ? (Array.isArray(r[a]) || (r[a] = [r[a]]), r[a].push(c)) : e.isArray(a, f, l) ? r[a] = [c] : r[a] = c;
1315
- }
1316
- }
1317
- }
1318
- return typeof s == "string" ? s.length > 0 && (r[e.textNodeName] = s) : s !== void 0 && (r[e.textNodeName] = s), r;
1319
- }
1320
- function Qt(n) {
1321
- const e = Object.keys(n);
1322
- for (let t = 0; t < e.length; t++) {
1323
- const s = e[t];
1324
- if (s !== ":@") return s;
1325
- }
1326
- }
1327
- function Dt(n, e, t, s) {
1328
- if (e) {
1329
- const r = Object.keys(e), i = r.length;
1330
- for (let o = 0; o < i; o++) {
1331
- const a = r[o];
1332
- s.isArray(a, t + "." + a, !0, !0) ? n[a] = [e[a]] : n[a] = e[a];
1333
- }
1334
- }
1335
- }
1336
- function en(n, e) {
1337
- const { textNodeName: t } = e, s = Object.keys(n).length;
1338
- return !!(s === 0 || s === 1 && (n[t] || typeof n[t] == "boolean" || n[t] === 0));
1339
- }
1340
- class tn {
1341
- constructor(e) {
1342
- this.externalEntities = {}, this.options = St(e);
1343
- }
1344
- /**
1345
- * Parse XML dats to JS object
1346
- * @param {string|Uint8Array} xmlData
1347
- * @param {boolean|Object} validationOption
1348
- */
1349
- parse(e, t) {
1350
- if (typeof e != "string" && e.toString)
1351
- e = e.toString();
1352
- else if (typeof e != "string")
1353
- throw new Error("XML data is accepted in String or Bytes[] form.");
1354
- if (t) {
1355
- t === !0 && (t = {});
1356
- const i = Et(e, t);
1357
- if (i !== !0)
1358
- throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`);
1359
- }
1360
- const s = new Vt(this.options);
1361
- s.addExternalEntities(this.externalEntities);
1362
- const r = s.parseXml(e);
1363
- return this.options.preserveOrder || r === void 0 ? r : qt(r, this.options);
1364
- }
1365
- /**
1366
- * Add Entity which is not by default supported by this library
1367
- * @param {string} key
1368
- * @param {string} value
1369
- */
1370
- addEntity(e, t) {
1371
- if (t.indexOf("&") !== -1)
1372
- throw new Error("Entity value can't have '&'");
1373
- if (e.indexOf("&") !== -1 || e.indexOf(";") !== -1)
1374
- throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1375
- if (t === "&")
1376
- throw new Error("An entity with value '&' is not permitted");
1377
- this.externalEntities[e] = t;
1378
- }
1379
- /**
1380
- * Returns a Symbol that can be used to access the metadata
1381
- * property on a node.
1382
- *
1383
- * If Symbol is not available in the environment, an ordinary property is used
1384
- * and the name of the property is here returned.
1385
- *
1386
- * The XMLMetaData property is only present when `captureMetaData`
1387
- * is true in the options.
1388
- */
1389
- static getMetaDataSymbol() {
1390
- return _.getMetaDataSymbol();
1391
- }
1392
- }
1393
- class nn {
1394
- axiosClient;
1395
- baseURI;
1396
- xmlParser;
1397
- signingKey;
1398
- ALGORITHM = "sha512";
1399
- TTL = 1200;
1400
- HASH_LENGTH = 32;
1401
- ITERATION_COUNT = 1e4;
1402
- constructor({ axiosClient: e, baseURI: t }) {
1403
- this.axiosClient = e, this.baseURI = t, this.xmlParser = new tn();
1404
- }
1405
- async signUrl(e, t) {
1406
- const s = new URL(e);
1407
- s.searchParams.set("OC-Credential", t), s.searchParams.set("OC-Date", (/* @__PURE__ */ new Date()).toISOString()), s.searchParams.set("OC-Expires", this.TTL.toString()), s.searchParams.set("OC-Verb", "GET");
1408
- const r = await this.createHashedKey(s.toString());
1409
- return s.searchParams.set("OC-Algo", `PBKDF2/${this.ITERATION_COUNT}-SHA512`), s.searchParams.set("OC-Signature", r), s.toString();
1410
- }
1411
- async getSignKey() {
1412
- if (this.signingKey)
1413
- return this.signingKey;
1414
- const e = await this.axiosClient.get(
1415
- Oe(this.baseURI, "ocs/v1.php/cloud/user/signing-key"),
1416
- {
1417
- headers: { "Content-Type": "application/x-www-form-urlencoded" }
1418
- }
1419
- ), t = this.xmlParser.parse(e.data);
1420
- return this.signingKey = t.ocs.data["signing-key"], this.signingKey;
1421
- }
1422
- async createHashedKey(e) {
1423
- const t = await this.getSignKey();
1424
- return lt(
1425
- e,
1426
- t,
1427
- this.ITERATION_COUNT,
1428
- this.HASH_LENGTH,
1429
- this.ALGORITHM
1430
- ).toString("hex");
1431
- }
1432
- }
1433
- const on = (n, e) => {
1434
- const t = new URL(n);
1435
- t.pathname = [...t.pathname.split("/"), "ocs", "v1.php"].filter(Boolean).join("/");
1436
- const s = t.href, r = $e(s, e), i = new nn({ baseURI: n, axiosClient: e });
1437
- return {
1438
- getCapabilities: () => r.getCapabilities(),
1439
- signUrl: (o, a) => i.signUrl(o, a)
1440
- };
1441
- };
1442
- export {
1443
- $e as G,
1444
- tn as X,
1445
- Mt as g,
1446
- on as o
1447
- };