@opencloud-eu/web-client 5.0.0 → 6.0.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.
@@ -0,0 +1,3874 @@
1
+ import { p as it, a as br } from "./index-Bjx4f50a.js";
2
+ import { y as se, I as ft, J as Et, e as lt, d as vr, l as qe, c as wr, K as Q } from "./functions-BBKWOL6l.js";
3
+ import { u as I } from "./toString-CKeGA2IK.js";
4
+ import { o as xr, X as Nr } from "./index-Dn8UfKx7.js";
5
+ import { g as St } from "./index-cttW6Cve.js";
6
+ const Ct = (r) => encodeURIComponent(r).split("%2F").join("/");
7
+ class Ge extends Error {
8
+ response;
9
+ statusCode;
10
+ constructor(t, e, n = null) {
11
+ super(t), this.response = e, this.statusCode = n;
12
+ }
13
+ }
14
+ class Pr extends Ge {
15
+ errorCode;
16
+ constructor(t, e, n, s = null) {
17
+ super(t, n, s), this.errorCode = e;
18
+ }
19
+ }
20
+ const Er = `
21
+ `;
22
+ function Ar(r, t) {
23
+ let e = "";
24
+ return t.format && t.indentBy.length > 0 && (e = Er), ze(r, t, "", e);
25
+ }
26
+ function ze(r, t, e, n) {
27
+ let s = "", o = !1;
28
+ if (!Array.isArray(r)) {
29
+ if (r != null) {
30
+ let i = r.toString();
31
+ return i = Yt(i, t), i;
32
+ }
33
+ return "";
34
+ }
35
+ for (let i = 0; i < r.length; i++) {
36
+ const a = r[i], l = Tr(a);
37
+ if (l === void 0) continue;
38
+ let c = "";
39
+ if (e.length === 0 ? c = l : c = `${e}.${l}`, l === t.textNodeName) {
40
+ let g = a[l];
41
+ Or(c, t) || (g = t.tagValueProcessor(l, g), g = Yt(g, t)), o && (s += n), s += g, o = !1;
42
+ continue;
43
+ } else if (l === t.cdataPropName) {
44
+ o && (s += n), s += `<![CDATA[${a[l][0][t.textNodeName]}]]>`, o = !1;
45
+ continue;
46
+ } else if (l === t.commentPropName) {
47
+ s += n + `<!--${a[l][0][t.textNodeName]}-->`, o = !0;
48
+ continue;
49
+ } else if (l[0] === "?") {
50
+ const g = pe(a[":@"], t), p = l === "?xml" ? "" : n;
51
+ let m = a[l][0][t.textNodeName];
52
+ m = m.length !== 0 ? " " + m : "", s += p + `<${l}${m}${g}?>`, o = !0;
53
+ continue;
54
+ }
55
+ let u = n;
56
+ u !== "" && (u += t.indentBy);
57
+ const f = pe(a[":@"], t), h = n + `<${l}${f}`, d = ze(a[l], t, c, u);
58
+ t.unpairedTags.indexOf(l) !== -1 ? t.suppressUnpairedNode ? s += h + ">" : s += h + "/>" : (!d || d.length === 0) && t.suppressEmptyNode ? s += h + "/>" : d && d.endsWith(">") ? s += h + `>${d}${n}</${l}>` : (s += h + ">", d && n !== "" && (d.includes("/>") || d.includes("</")) ? s += n + t.indentBy + d + n : s += d, s += `</${l}>`), o = !0;
59
+ }
60
+ return s;
61
+ }
62
+ function Tr(r) {
63
+ const t = Object.keys(r);
64
+ for (let e = 0; e < t.length; e++) {
65
+ const n = t[e];
66
+ if (Object.prototype.hasOwnProperty.call(r, n) && n !== ":@")
67
+ return n;
68
+ }
69
+ }
70
+ function pe(r, t) {
71
+ let e = "";
72
+ if (r && !t.ignoreAttributes)
73
+ for (let n in r) {
74
+ if (!Object.prototype.hasOwnProperty.call(r, n)) continue;
75
+ let s = t.attributeValueProcessor(n, r[n]);
76
+ s = Yt(s, t), s === !0 && t.suppressBooleanAttributes ? e += ` ${n.substr(t.attributeNamePrefix.length)}` : e += ` ${n.substr(t.attributeNamePrefix.length)}="${s}"`;
77
+ }
78
+ return e;
79
+ }
80
+ function Or(r, t) {
81
+ r = r.substr(0, r.length - t.textNodeName.length - 1);
82
+ let e = r.substr(r.lastIndexOf(".") + 1);
83
+ for (let n in t.stopNodes)
84
+ if (t.stopNodes[n] === r || t.stopNodes[n] === "*." + e) return !0;
85
+ return !1;
86
+ }
87
+ function Yt(r, t) {
88
+ if (r && r.length > 0 && t.processEntities)
89
+ for (let e = 0; e < t.entities.length; e++) {
90
+ const n = t.entities[e];
91
+ r = r.replace(n.regex, n.val);
92
+ }
93
+ return r;
94
+ }
95
+ function Sr(r) {
96
+ return typeof r == "function" ? r : Array.isArray(r) ? (t) => {
97
+ for (const e of r)
98
+ if (typeof e == "string" && t === e || e instanceof RegExp && e.test(t))
99
+ return !0;
100
+ } : () => !1;
101
+ }
102
+ const Cr = {
103
+ attributeNamePrefix: "@_",
104
+ attributesGroupName: !1,
105
+ textNodeName: "#text",
106
+ ignoreAttributes: !0,
107
+ cdataPropName: !1,
108
+ format: !1,
109
+ indentBy: " ",
110
+ suppressEmptyNode: !1,
111
+ suppressUnpairedNode: !0,
112
+ suppressBooleanAttributes: !0,
113
+ tagValueProcessor: function(r, t) {
114
+ return t;
115
+ },
116
+ attributeValueProcessor: function(r, t) {
117
+ return t;
118
+ },
119
+ preserveOrder: !1,
120
+ commentPropName: !1,
121
+ unpairedTags: [],
122
+ entities: [
123
+ { regex: new RegExp("&", "g"), val: "&amp;" },
124
+ //it must be on top
125
+ { regex: new RegExp(">", "g"), val: "&gt;" },
126
+ { regex: new RegExp("<", "g"), val: "&lt;" },
127
+ { regex: new RegExp("'", "g"), val: "&apos;" },
128
+ { regex: new RegExp('"', "g"), val: "&quot;" }
129
+ ],
130
+ processEntities: !0,
131
+ stopNodes: [],
132
+ // transformTagName: false,
133
+ // transformAttributeName: false,
134
+ oneListGroup: !1
135
+ };
136
+ function J(r) {
137
+ this.options = Object.assign({}, Cr, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
138
+ return !1;
139
+ } : (this.ignoreAttributesFn = Sr(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Fr), this.processTextOrObjNode = Ir, this.options.format ? (this.indentate = $r, this.tagEndChar = `>
140
+ `, this.newLine = `
141
+ `) : (this.indentate = function() {
142
+ return "";
143
+ }, this.tagEndChar = ">", this.newLine = "");
144
+ }
145
+ J.prototype.build = function(r) {
146
+ return this.options.preserveOrder ? Ar(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
147
+ [this.options.arrayNodeName]: r
148
+ }), this.j2x(r, 0, []).val);
149
+ };
150
+ J.prototype.j2x = function(r, t, e) {
151
+ let n = "", s = "";
152
+ const o = e.join(".");
153
+ for (let i in r)
154
+ if (Object.prototype.hasOwnProperty.call(r, i))
155
+ if (typeof r[i] > "u")
156
+ this.isAttribute(i) && (s += "");
157
+ else if (r[i] === null)
158
+ this.isAttribute(i) || i === this.options.cdataPropName ? s += "" : i[0] === "?" ? s += this.indentate(t) + "<" + i + "?" + this.tagEndChar : s += this.indentate(t) + "<" + i + "/" + this.tagEndChar;
159
+ else if (r[i] instanceof Date)
160
+ s += this.buildTextValNode(r[i], i, "", t);
161
+ else if (typeof r[i] != "object") {
162
+ const a = this.isAttribute(i);
163
+ if (a && !this.ignoreAttributesFn(a, o))
164
+ n += this.buildAttrPairStr(a, "" + r[i]);
165
+ else if (!a)
166
+ if (i === this.options.textNodeName) {
167
+ let l = this.options.tagValueProcessor(i, "" + r[i]);
168
+ s += this.replaceEntitiesValue(l);
169
+ } else
170
+ s += this.buildTextValNode(r[i], i, "", t);
171
+ } else if (Array.isArray(r[i])) {
172
+ const a = r[i].length;
173
+ let l = "", c = "";
174
+ for (let u = 0; u < a; u++) {
175
+ const f = r[i][u];
176
+ if (!(typeof f > "u")) if (f === null)
177
+ i[0] === "?" ? s += this.indentate(t) + "<" + i + "?" + this.tagEndChar : s += this.indentate(t) + "<" + i + "/" + this.tagEndChar;
178
+ else if (typeof f == "object")
179
+ if (this.options.oneListGroup) {
180
+ const h = this.j2x(f, t + 1, e.concat(i));
181
+ l += h.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (c += h.attrStr);
182
+ } else
183
+ l += this.processTextOrObjNode(f, i, t, e);
184
+ else if (this.options.oneListGroup) {
185
+ let h = this.options.tagValueProcessor(i, f);
186
+ h = this.replaceEntitiesValue(h), l += h;
187
+ } else
188
+ l += this.buildTextValNode(f, i, "", t);
189
+ }
190
+ this.options.oneListGroup && (l = this.buildObjectNode(l, i, c, t)), s += l;
191
+ } else if (this.options.attributesGroupName && i === this.options.attributesGroupName) {
192
+ const a = Object.keys(r[i]), l = a.length;
193
+ for (let c = 0; c < l; c++)
194
+ n += this.buildAttrPairStr(a[c], "" + r[i][a[c]]);
195
+ } else
196
+ s += this.processTextOrObjNode(r[i], i, t, e);
197
+ return { attrStr: n, val: s };
198
+ };
199
+ J.prototype.buildAttrPairStr = function(r, t) {
200
+ return t = this.options.attributeValueProcessor(r, "" + t), t = this.replaceEntitiesValue(t), this.options.suppressBooleanAttributes && t === "true" ? " " + r : " " + r + '="' + t + '"';
201
+ };
202
+ function Ir(r, t, e, n) {
203
+ const s = this.j2x(r, e + 1, n.concat(t));
204
+ return r[this.options.textNodeName] !== void 0 && Object.keys(r).length === 1 ? this.buildTextValNode(r[this.options.textNodeName], t, s.attrStr, e) : this.buildObjectNode(s.val, t, s.attrStr, e);
205
+ }
206
+ J.prototype.buildObjectNode = function(r, t, e, n) {
207
+ if (r === "")
208
+ return t[0] === "?" ? this.indentate(n) + "<" + t + e + "?" + this.tagEndChar : this.indentate(n) + "<" + t + e + this.closeTag(t) + this.tagEndChar;
209
+ {
210
+ let s = "</" + t + this.tagEndChar, o = "";
211
+ return t[0] === "?" && (o = "?", s = ""), (e || e === "") && r.indexOf("<") === -1 ? this.indentate(n) + "<" + t + e + o + ">" + r + s : this.options.commentPropName !== !1 && t === this.options.commentPropName && o.length === 0 ? this.indentate(n) + `<!--${r}-->` + this.newLine : this.indentate(n) + "<" + t + e + o + this.tagEndChar + r + this.indentate(n) + s;
212
+ }
213
+ };
214
+ J.prototype.closeTag = function(r) {
215
+ let t = "";
216
+ return this.options.unpairedTags.indexOf(r) !== -1 ? this.options.suppressUnpairedNode || (t = "/") : this.options.suppressEmptyNode ? t = "/" : t = `></${r}`, t;
217
+ };
218
+ J.prototype.buildTextValNode = function(r, t, e, n) {
219
+ if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName)
220
+ return this.indentate(n) + `<![CDATA[${r}]]>` + this.newLine;
221
+ if (this.options.commentPropName !== !1 && t === this.options.commentPropName)
222
+ return this.indentate(n) + `<!--${r}-->` + this.newLine;
223
+ if (t[0] === "?")
224
+ return this.indentate(n) + "<" + t + e + "?" + this.tagEndChar;
225
+ {
226
+ let s = this.options.tagValueProcessor(t, r);
227
+ return s = this.replaceEntitiesValue(s), s === "" ? this.indentate(n) + "<" + t + e + this.closeTag(t) + this.tagEndChar : this.indentate(n) + "<" + t + e + ">" + s + "</" + t + this.tagEndChar;
228
+ }
229
+ };
230
+ J.prototype.replaceEntitiesValue = function(r) {
231
+ if (r && r.length > 0 && this.options.processEntities)
232
+ for (let t = 0; t < this.options.entities.length; t++) {
233
+ const e = this.options.entities[t];
234
+ r = r.replace(e.regex, e.val);
235
+ }
236
+ return r;
237
+ };
238
+ function $r(r) {
239
+ return this.options.indentBy.repeat(r);
240
+ }
241
+ function Fr(r) {
242
+ return r.startsWith(this.options.attributeNamePrefix) && r !== this.options.textNodeName ? r.substr(this.attrPrefixLen) : !1;
243
+ }
244
+ const Z = (r, { fileId: t, path: e, name: n }) => {
245
+ if (e !== void 0)
246
+ return I(r.webDavPath, e);
247
+ if (t !== void 0) {
248
+ if (se(r))
249
+ throw new Error("public spaces need a path provided");
250
+ return I("spaces", t, n || "");
251
+ }
252
+ return r.webDavPath;
253
+ }, jr = (r, t) => ({
254
+ copyFiles(e, { path: n, fileId: s }, o, {
255
+ path: i,
256
+ parentFolderId: a,
257
+ name: l
258
+ }, { overwrite: c, ...u } = {}) {
259
+ const f = Z(e, {
260
+ fileId: s,
261
+ path: n
262
+ }), h = Z(o, {
263
+ fileId: a,
264
+ path: i,
265
+ name: l
266
+ });
267
+ return r.copy(f, h, {
268
+ overwrite: c || !1,
269
+ ...u
270
+ });
271
+ }
272
+ }), Rr = (r, t, e) => ({
273
+ async createFolder(n, { path: s, parentFolderId: o, folderName: i, fetchFolder: a = !0, ...l }) {
274
+ const c = Z(n, { fileId: o, path: s, name: i });
275
+ if (await r.mkcol(c), a)
276
+ return t.getFileInfo(n, { path: s }, l);
277
+ }
278
+ }), Lr = (r, { axiosClient: t }) => ({
279
+ async getFileContents(e, { fileId: n, path: s }, {
280
+ responseType: o = "text",
281
+ noCache: i = !0,
282
+ headers: a,
283
+ ...l
284
+ } = {}) {
285
+ try {
286
+ const c = Z(e, { fileId: n, path: s }), u = await t.get(r.getFileUrl(c), {
287
+ responseType: o,
288
+ headers: {
289
+ ...i && { "Cache-Control": "no-cache" },
290
+ ...a || {}
291
+ },
292
+ ...l
293
+ });
294
+ return {
295
+ response: u,
296
+ body: u.data,
297
+ headers: {
298
+ ETag: u.headers.etag,
299
+ "OC-ETag": u.headers["oc-etag"],
300
+ "OC-FileId": u.headers["oc-fileid"]
301
+ }
302
+ };
303
+ } catch (c) {
304
+ const { message: u, response: f } = c;
305
+ throw new Ge(u, f, f.status);
306
+ }
307
+ }
308
+ }), Ur = (r, t) => ({
309
+ async getFileInfo(e, n, s) {
310
+ return (await r.listFiles(e, n, {
311
+ depth: 0,
312
+ ...s
313
+ })).resource;
314
+ }
315
+ }), Dr = (r, t, e, { axiosClient: n, baseUrl: s }) => ({
316
+ async getFileUrl(o, i, {
317
+ disposition: a = "attachment",
318
+ version: l = null,
319
+ username: c = "",
320
+ ...u
321
+ }) {
322
+ if (a === "inline") {
323
+ const h = await t.getFileContents(o, i, {
324
+ responseType: "blob",
325
+ ...u
326
+ });
327
+ return URL.createObjectURL(h.body);
328
+ }
329
+ if (l) {
330
+ if (!c)
331
+ throw new Error("username is required for URL signing");
332
+ const h = r.getFileUrl(I("meta", i.fileId, "v", l));
333
+ return await xr(s, n).signUrl(h, c);
334
+ }
335
+ if (i.downloadURL)
336
+ return i.downloadURL;
337
+ const { downloadURL: f } = await e.getFileInfo(o, i, {
338
+ davProperties: [ft.DownloadURL]
339
+ });
340
+ return f;
341
+ },
342
+ revokeUrl: (o) => {
343
+ o && o.startsWith("blob:") && URL.revokeObjectURL(o);
344
+ }
345
+ }), kr = (r, t) => ({
346
+ getPublicFileUrl(e, n) {
347
+ return r.getFileUrl(I("public-files", n));
348
+ }
349
+ }), Mr = (r, t, e) => ({
350
+ async listFiles(n, { path: s, fileId: o } = {}, { depth: i = 1, davProperties: a, isTrash: l = !1, ...c } = {}) {
351
+ let u;
352
+ if (se(n)) {
353
+ u = await r.propfind(I(n.webDavPath, s), {
354
+ depth: i,
355
+ properties: a || Et.PublicLink,
356
+ ...c
357
+ }), u.forEach((g) => {
358
+ g.filename = g.filename.split("/").slice(1).join("/");
359
+ }), u.length === 1 && (u[0].filename = I(n.id, s, {
360
+ leadingSlash: !0
361
+ })), u.forEach((g) => {
362
+ g.filename = g.filename.split("/").slice(2).join("/");
363
+ });
364
+ const h = n.driveAlias.startsWith("ocm/") ? "ocm" : "public-link";
365
+ if ((!s || s === "/") && i > 0 && h === "ocm" && u[0].props[ft.PublicLinkItemType] === "file" && (u = [
366
+ {
367
+ basename: n.fileId,
368
+ type: "directory",
369
+ filename: "",
370
+ props: {}
371
+ },
372
+ ...u
373
+ ]), !s) {
374
+ const [g, ...p] = u;
375
+ return {
376
+ resource: vr({
377
+ ...g,
378
+ id: n.id,
379
+ driveAlias: n.driveAlias,
380
+ webDavPath: n.webDavPath,
381
+ publicLinkType: h
382
+ }),
383
+ children: p.map((m) => lt(m, r.extraProps))
384
+ };
385
+ }
386
+ const d = u.map((g) => lt(g, r.extraProps));
387
+ return { resource: d[0], children: d.slice(1) };
388
+ }
389
+ const f = async () => {
390
+ const h = await t.getPathForFileId(o);
391
+ return this.listFiles(n, { path: h }, { depth: i, davProperties: a });
392
+ };
393
+ try {
394
+ let h = "";
395
+ if (l ? h = qe(n.id) : h = Z(n, { fileId: o, path: s }), u = await r.propfind(h, {
396
+ depth: i,
397
+ properties: a || Et.Default,
398
+ ...c
399
+ }), l)
400
+ return {
401
+ resource: lt(u[0], r.extraProps),
402
+ children: u.slice(1).map(wr)
403
+ };
404
+ const d = u.map((p) => lt(p, r.extraProps)), g = o === n.id;
405
+ return o && !g && d[0].fileId && o !== d[0].fileId ? f() : { resource: d[0], children: d.slice(1) };
406
+ } catch (h) {
407
+ if (h.statusCode === 404 && o)
408
+ return f();
409
+ throw h;
410
+ }
411
+ }
412
+ }), _r = (r, t) => ({
413
+ moveFiles(e, { path: n, fileId: s }, o, {
414
+ path: i,
415
+ parentFolderId: a,
416
+ name: l
417
+ }, { overwrite: c, ...u } = {}) {
418
+ const f = Z(e, {
419
+ fileId: s,
420
+ path: n
421
+ }), h = Z(o, {
422
+ fileId: a,
423
+ path: i,
424
+ name: l
425
+ });
426
+ return r.move(f, h, {
427
+ overwrite: c || !1,
428
+ ...u
429
+ });
430
+ }
431
+ }), Vr = (r, t, e) => ({
432
+ async putFileContents(n, {
433
+ fileName: s,
434
+ path: o,
435
+ parentFolderId: i,
436
+ content: a = "",
437
+ previousEntityTag: l = "",
438
+ overwrite: c,
439
+ onUploadProgress: u = null,
440
+ ...f
441
+ }) {
442
+ const h = Z(n, { fileId: i, name: s, path: o }), { result: d } = await r.put(h, a, {
443
+ previousEntityTag: l,
444
+ overwrite: c,
445
+ onUploadProgress: u,
446
+ ...f
447
+ });
448
+ return t.getFileInfo(n, {
449
+ fileId: d.headers.get("Oc-Fileid"),
450
+ path: o
451
+ });
452
+ }
453
+ }), Br = (r, t) => ({
454
+ deleteFile(e, { path: n, ...s }) {
455
+ return r.delete(I(e.webDavPath, n), s);
456
+ }
457
+ }), Wr = (r, t) => ({
458
+ restoreFile(e, { id: n }, { path: s }, { overwrite: o, ...i } = {}) {
459
+ if (se(e))
460
+ return;
461
+ const a = I(e.webDavPath, s);
462
+ return r.move(I(e.webDavTrashPath, n), a, {
463
+ overwrite: o,
464
+ ...i
465
+ });
466
+ }
467
+ }), qr = (r, t) => ({
468
+ restoreFileVersion(e, { parentFolderId: n, name: s, path: o }, i, a = {}) {
469
+ const l = Z(e, { path: o, fileId: n, name: s }), c = I("meta", n, "v", i, { leadingSlash: !0 }), u = I("files", l, { leadingSlash: !0 });
470
+ return r.copy(c, u, a);
471
+ }
472
+ }), Gr = (r, t) => ({
473
+ clearTrashBin(e, { id: n, ...s } = {}) {
474
+ let o = qe(e.id);
475
+ return n && (o = I(o, n)), r.delete(o, s);
476
+ }
477
+ }), zr = (r, t) => ({
478
+ async search(e, { davProperties: n = Et.Default, searchLimit: s, ...o }) {
479
+ const i = "/spaces/", { range: a, results: l } = await r.report(i, {
480
+ pattern: e,
481
+ limit: s,
482
+ properties: n,
483
+ ...o
484
+ });
485
+ return {
486
+ resources: l.map((c) => ({
487
+ ...lt(c, r.extraProps),
488
+ highlights: c.props[ft.Highlights] || ""
489
+ })),
490
+ totalResults: a ? parseInt(a?.split("/")[1]) : null
491
+ };
492
+ }
493
+ }), Hr = (r, t) => ({
494
+ async getPathForFileId(e, n = {}) {
495
+ return (await r.propfind(I("meta", e, { leadingSlash: !0 }), {
496
+ properties: [ft.MetaPathForUser],
497
+ ...n
498
+ }))[0].props[ft.MetaPathForUser];
499
+ }
500
+ });
501
+ var Xr = { 2: (r) => {
502
+ function t(s, o, i) {
503
+ s instanceof RegExp && (s = e(s, i)), o instanceof RegExp && (o = e(o, i));
504
+ var a = n(s, o, i);
505
+ return a && { start: a[0], end: a[1], pre: i.slice(0, a[0]), body: i.slice(a[0] + s.length, a[1]), post: i.slice(a[1] + o.length) };
506
+ }
507
+ function e(s, o) {
508
+ var i = o.match(s);
509
+ return i ? i[0] : null;
510
+ }
511
+ function n(s, o, i) {
512
+ var a, l, c, u, f, h = i.indexOf(s), d = i.indexOf(o, h + 1), g = h;
513
+ if (h >= 0 && d > 0) {
514
+ for (a = [], c = i.length; g >= 0 && !f; ) g == h ? (a.push(g), h = i.indexOf(s, g + 1)) : a.length == 1 ? f = [a.pop(), d] : ((l = a.pop()) < c && (c = l, u = d), d = i.indexOf(o, g + 1)), g = h < d && h >= 0 ? h : d;
515
+ a.length && (f = [c, u]);
516
+ }
517
+ return f;
518
+ }
519
+ r.exports = t, t.range = n;
520
+ }, 47: (r, t, e) => {
521
+ var n = e(410), s = function(c) {
522
+ return typeof c == "string";
523
+ };
524
+ function o(c, u) {
525
+ for (var f = [], h = 0; h < c.length; h++) {
526
+ var d = c[h];
527
+ d && d !== "." && (d === ".." ? f.length && f[f.length - 1] !== ".." ? f.pop() : u && f.push("..") : f.push(d));
528
+ }
529
+ return f;
530
+ }
531
+ var i = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/, a = {};
532
+ function l(c) {
533
+ return i.exec(c).slice(1);
534
+ }
535
+ a.resolve = function() {
536
+ for (var c = "", u = !1, f = arguments.length - 1; f >= -1 && !u; f--) {
537
+ var h = f >= 0 ? arguments[f] : it.cwd();
538
+ if (!s(h)) throw new TypeError("Arguments to path.resolve must be strings");
539
+ h && (c = h + "/" + c, u = h.charAt(0) === "/");
540
+ }
541
+ return (u ? "/" : "") + (c = o(c.split("/"), !u).join("/")) || ".";
542
+ }, a.normalize = function(c) {
543
+ var u = a.isAbsolute(c), f = c.substr(-1) === "/";
544
+ return (c = o(c.split("/"), !u).join("/")) || u || (c = "."), c && f && (c += "/"), (u ? "/" : "") + c;
545
+ }, a.isAbsolute = function(c) {
546
+ return c.charAt(0) === "/";
547
+ }, a.join = function() {
548
+ for (var c = "", u = 0; u < arguments.length; u++) {
549
+ var f = arguments[u];
550
+ if (!s(f)) throw new TypeError("Arguments to path.join must be strings");
551
+ f && (c += c ? "/" + f : f);
552
+ }
553
+ return a.normalize(c);
554
+ }, a.relative = function(c, u) {
555
+ function f(y) {
556
+ for (var v = 0; v < y.length && y[v] === ""; v++) ;
557
+ for (var w = y.length - 1; w >= 0 && y[w] === ""; w--) ;
558
+ return v > w ? [] : y.slice(v, w + 1);
559
+ }
560
+ c = a.resolve(c).substr(1), u = a.resolve(u).substr(1);
561
+ for (var h = f(c.split("/")), d = f(u.split("/")), g = Math.min(h.length, d.length), p = g, m = 0; m < g; m++) if (h[m] !== d[m]) {
562
+ p = m;
563
+ break;
564
+ }
565
+ var b = [];
566
+ for (m = p; m < h.length; m++) b.push("..");
567
+ return (b = b.concat(d.slice(p))).join("/");
568
+ }, a._makeLong = function(c) {
569
+ return c;
570
+ }, a.dirname = function(c) {
571
+ var u = l(c), f = u[0], h = u[1];
572
+ return f || h ? (h && (h = h.substr(0, h.length - 1)), f + h) : ".";
573
+ }, a.basename = function(c, u) {
574
+ var f = l(c)[2];
575
+ return u && f.substr(-1 * u.length) === u && (f = f.substr(0, f.length - u.length)), f;
576
+ }, a.extname = function(c) {
577
+ return l(c)[3];
578
+ }, a.format = function(c) {
579
+ if (!n.isObject(c)) throw new TypeError("Parameter 'pathObject' must be an object, not " + typeof c);
580
+ var u = c.root || "";
581
+ if (!s(u)) throw new TypeError("'pathObject.root' must be a string or undefined, not " + typeof c.root);
582
+ return (c.dir ? c.dir + a.sep : "") + (c.base || "");
583
+ }, a.parse = function(c) {
584
+ if (!s(c)) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof c);
585
+ var u = l(c);
586
+ if (!u || u.length !== 4) throw new TypeError("Invalid path '" + c + "'");
587
+ return u[1] = u[1] || "", u[2] = u[2] || "", u[3] = u[3] || "", { root: u[0], dir: u[0] + u[1].slice(0, u[1].length - 1), base: u[2], ext: u[3], name: u[2].slice(0, u[2].length - u[3].length) };
588
+ }, a.sep = "/", a.delimiter = ":", r.exports = a;
589
+ }, 101: function(r, t, e) {
590
+ var n;
591
+ r = e.nmd(r), (function() {
592
+ var s = (r && r.exports, typeof St == "object" && St);
593
+ s.global !== s && s.window;
594
+ var o = function(u) {
595
+ this.message = u;
596
+ };
597
+ (o.prototype = new Error()).name = "InvalidCharacterError";
598
+ var i = function(u) {
599
+ throw new o(u);
600
+ }, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = /[\t\n\f\r ]/g, c = { encode: function(u) {
601
+ u = String(u), /[^\0-\xFF]/.test(u) && i("The string to be encoded contains characters outside of the Latin1 range.");
602
+ for (var f, h, d, g, p = u.length % 3, m = "", b = -1, y = u.length - p; ++b < y; ) f = u.charCodeAt(b) << 16, h = u.charCodeAt(++b) << 8, d = u.charCodeAt(++b), m += a.charAt((g = f + h + d) >> 18 & 63) + a.charAt(g >> 12 & 63) + a.charAt(g >> 6 & 63) + a.charAt(63 & g);
603
+ return p == 2 ? (f = u.charCodeAt(b) << 8, h = u.charCodeAt(++b), m += a.charAt((g = f + h) >> 10) + a.charAt(g >> 4 & 63) + a.charAt(g << 2 & 63) + "=") : p == 1 && (g = u.charCodeAt(b), m += a.charAt(g >> 2) + a.charAt(g << 4 & 63) + "=="), m;
604
+ }, decode: function(u) {
605
+ var f = (u = String(u).replace(l, "")).length;
606
+ f % 4 == 0 && (f = (u = u.replace(/==?$/, "")).length), (f % 4 == 1 || /[^+a-zA-Z0-9/]/.test(u)) && i("Invalid character: the string to be decoded is not correctly encoded.");
607
+ for (var h, d, g = 0, p = "", m = -1; ++m < f; ) d = a.indexOf(u.charAt(m)), h = g % 4 ? 64 * h + d : d, g++ % 4 && (p += String.fromCharCode(255 & h >> (-2 * g & 6)));
608
+ return p;
609
+ }, version: "1.0.0" };
610
+ (n = (function() {
611
+ return c;
612
+ }).call(t, e, t, r)) === void 0 || (r.exports = n);
613
+ })();
614
+ }, 135: (r) => {
615
+ function t(e) {
616
+ return !!e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
617
+ }
618
+ r.exports = function(e) {
619
+ return e != null && (t(e) || (function(n) {
620
+ return typeof n.readFloatLE == "function" && typeof n.slice == "function" && t(n.slice(0, 0));
621
+ })(e) || !!e._isBuffer);
622
+ };
623
+ }, 172: (r, t) => {
624
+ t.d = function(e) {
625
+ if (!e) return 0;
626
+ for (var n = (e = e.toString()).length, s = e.length; s--; ) {
627
+ var o = e.charCodeAt(s);
628
+ 56320 <= o && o <= 57343 && s--, 127 < o && o <= 2047 ? n++ : 2047 < o && o <= 65535 && (n += 2);
629
+ }
630
+ return n;
631
+ };
632
+ }, 285: (r, t, e) => {
633
+ var n = e(2);
634
+ r.exports = function(b) {
635
+ return b ? (b.substr(0, 2) === "{}" && (b = "\\{\\}" + b.substr(2)), m((function(y) {
636
+ return y.split("\\\\").join(s).split("\\{").join(o).split("\\}").join(i).split("\\,").join(a).split("\\.").join(l);
637
+ })(b), !0).map(u)) : [];
638
+ };
639
+ var s = "\0SLASH" + Math.random() + "\0", o = "\0OPEN" + Math.random() + "\0", i = "\0CLOSE" + Math.random() + "\0", a = "\0COMMA" + Math.random() + "\0", l = "\0PERIOD" + Math.random() + "\0";
640
+ function c(b) {
641
+ return parseInt(b, 10) == b ? parseInt(b, 10) : b.charCodeAt(0);
642
+ }
643
+ function u(b) {
644
+ return b.split(s).join("\\").split(o).join("{").split(i).join("}").split(a).join(",").split(l).join(".");
645
+ }
646
+ function f(b) {
647
+ if (!b) return [""];
648
+ var y = [], v = n("{", "}", b);
649
+ if (!v) return b.split(",");
650
+ var w = v.pre, x = v.body, P = v.post, E = w.split(",");
651
+ E[E.length - 1] += "{" + x + "}";
652
+ var T = f(P);
653
+ return P.length && (E[E.length - 1] += T.shift(), E.push.apply(E, T)), y.push.apply(y, E), y;
654
+ }
655
+ function h(b) {
656
+ return "{" + b + "}";
657
+ }
658
+ function d(b) {
659
+ return /^-?0\d/.test(b);
660
+ }
661
+ function g(b, y) {
662
+ return b <= y;
663
+ }
664
+ function p(b, y) {
665
+ return b >= y;
666
+ }
667
+ function m(b, y) {
668
+ var v = [], w = n("{", "}", b);
669
+ if (!w) return [b];
670
+ var x = w.pre, P = w.post.length ? m(w.post, !1) : [""];
671
+ if (/\$$/.test(w.pre)) for (var E = 0; E < P.length; E++) {
672
+ var T = x + "{" + w.body + "}" + P[E];
673
+ v.push(T);
674
+ }
675
+ else {
676
+ var A, F, rt = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body), nt = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body), N = rt || nt, gt = w.body.indexOf(",") >= 0;
677
+ if (!N && !gt) return w.post.match(/,(?!,).*\}/) ? m(b = w.pre + "{" + w.body + i + w.post) : [b];
678
+ if (N) A = w.body.split(/\.\./);
679
+ else if ((A = f(w.body)).length === 1 && (A = m(A[0], !1).map(h)).length === 1) return P.map((function(yr) {
680
+ return w.pre + A[0] + yr;
681
+ }));
682
+ if (N) {
683
+ var dt = c(A[0]), mt = c(A[1]), q = Math.max(A[0].length, A[1].length), H = A.length == 3 ? Math.abs(c(A[2])) : 1, yt = g;
684
+ mt < dt && (H *= -1, yt = p);
685
+ var Ot = A.some(d);
686
+ F = [];
687
+ for (var X = dt; yt(X, mt); X += H) {
688
+ var K;
689
+ if (nt) (K = String.fromCharCode(X)) === "\\" && (K = "");
690
+ else if (K = String(X), Ot) {
691
+ var he = q - K.length;
692
+ if (he > 0) {
693
+ var fe = new Array(he + 1).join("0");
694
+ K = X < 0 ? "-" + fe + K.slice(1) : fe + K;
695
+ }
696
+ }
697
+ F.push(K);
698
+ }
699
+ } else {
700
+ F = [];
701
+ for (var st = 0; st < A.length; st++) F.push.apply(F, m(A[st], !1));
702
+ }
703
+ for (st = 0; st < F.length; st++) for (E = 0; E < P.length; E++) T = x + F[st] + P[E], (!y || N || T) && v.push(T);
704
+ }
705
+ return v;
706
+ }
707
+ }, 298: (r) => {
708
+ var t, e;
709
+ t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = { rotl: function(n, s) {
710
+ return n << s | n >>> 32 - s;
711
+ }, rotr: function(n, s) {
712
+ return n << 32 - s | n >>> s;
713
+ }, endian: function(n) {
714
+ if (n.constructor == Number) return 16711935 & e.rotl(n, 8) | 4278255360 & e.rotl(n, 24);
715
+ for (var s = 0; s < n.length; s++) n[s] = e.endian(n[s]);
716
+ return n;
717
+ }, randomBytes: function(n) {
718
+ for (var s = []; n > 0; n--) s.push(Math.floor(256 * Math.random()));
719
+ return s;
720
+ }, bytesToWords: function(n) {
721
+ for (var s = [], o = 0, i = 0; o < n.length; o++, i += 8) s[i >>> 5] |= n[o] << 24 - i % 32;
722
+ return s;
723
+ }, wordsToBytes: function(n) {
724
+ for (var s = [], o = 0; o < 32 * n.length; o += 8) s.push(n[o >>> 5] >>> 24 - o % 32 & 255);
725
+ return s;
726
+ }, bytesToHex: function(n) {
727
+ for (var s = [], o = 0; o < n.length; o++) s.push((n[o] >>> 4).toString(16)), s.push((15 & n[o]).toString(16));
728
+ return s.join("");
729
+ }, hexToBytes: function(n) {
730
+ for (var s = [], o = 0; o < n.length; o += 2) s.push(parseInt(n.substr(o, 2), 16));
731
+ return s;
732
+ }, bytesToBase64: function(n) {
733
+ for (var s = [], o = 0; o < n.length; o += 3) for (var i = n[o] << 16 | n[o + 1] << 8 | n[o + 2], a = 0; a < 4; a++) 8 * o + 6 * a <= 8 * n.length ? s.push(t.charAt(i >>> 6 * (3 - a) & 63)) : s.push("=");
734
+ return s.join("");
735
+ }, base64ToBytes: function(n) {
736
+ n = n.replace(/[^A-Z0-9+\/]/gi, "");
737
+ for (var s = [], o = 0, i = 0; o < n.length; i = ++o % 4) i != 0 && s.push((t.indexOf(n.charAt(o - 1)) & Math.pow(2, -2 * i + 8) - 1) << 2 * i | t.indexOf(n.charAt(o)) >>> 6 - 2 * i);
738
+ return s;
739
+ } }, r.exports = e;
740
+ }, 345: () => {
741
+ }, 388: () => {
742
+ }, 410: () => {
743
+ }, 526: (r) => {
744
+ var t = { utf8: { stringToBytes: function(e) {
745
+ return t.bin.stringToBytes(unescape(encodeURIComponent(e)));
746
+ }, bytesToString: function(e) {
747
+ return decodeURIComponent(escape(t.bin.bytesToString(e)));
748
+ } }, bin: { stringToBytes: function(e) {
749
+ for (var n = [], s = 0; s < e.length; s++) n.push(255 & e.charCodeAt(s));
750
+ return n;
751
+ }, bytesToString: function(e) {
752
+ for (var n = [], s = 0; s < e.length; s++) n.push(String.fromCharCode(e[s]));
753
+ return n.join("");
754
+ } } };
755
+ r.exports = t;
756
+ }, 542: (r, t, e) => {
757
+ (function() {
758
+ var n = e(298), s = e(526).utf8, o = e(135), i = e(526).bin, a = function(l, c) {
759
+ l.constructor == String ? l = c && c.encoding === "binary" ? i.stringToBytes(l) : s.stringToBytes(l) : o(l) ? l = Array.prototype.slice.call(l, 0) : Array.isArray(l) || l.constructor === Uint8Array || (l = l.toString());
760
+ for (var u = n.bytesToWords(l), f = 8 * l.length, h = 1732584193, d = -271733879, g = -1732584194, p = 271733878, m = 0; m < u.length; m++) u[m] = 16711935 & (u[m] << 8 | u[m] >>> 24) | 4278255360 & (u[m] << 24 | u[m] >>> 8);
761
+ u[f >>> 5] |= 128 << f % 32, u[14 + (f + 64 >>> 9 << 4)] = f;
762
+ var b = a._ff, y = a._gg, v = a._hh, w = a._ii;
763
+ for (m = 0; m < u.length; m += 16) {
764
+ var x = h, P = d, E = g, T = p;
765
+ h = b(h, d, g, p, u[m + 0], 7, -680876936), p = b(p, h, d, g, u[m + 1], 12, -389564586), g = b(g, p, h, d, u[m + 2], 17, 606105819), d = b(d, g, p, h, u[m + 3], 22, -1044525330), h = b(h, d, g, p, u[m + 4], 7, -176418897), p = b(p, h, d, g, u[m + 5], 12, 1200080426), g = b(g, p, h, d, u[m + 6], 17, -1473231341), d = b(d, g, p, h, u[m + 7], 22, -45705983), h = b(h, d, g, p, u[m + 8], 7, 1770035416), p = b(p, h, d, g, u[m + 9], 12, -1958414417), g = b(g, p, h, d, u[m + 10], 17, -42063), d = b(d, g, p, h, u[m + 11], 22, -1990404162), h = b(h, d, g, p, u[m + 12], 7, 1804603682), p = b(p, h, d, g, u[m + 13], 12, -40341101), g = b(g, p, h, d, u[m + 14], 17, -1502002290), h = y(h, d = b(d, g, p, h, u[m + 15], 22, 1236535329), g, p, u[m + 1], 5, -165796510), p = y(p, h, d, g, u[m + 6], 9, -1069501632), g = y(g, p, h, d, u[m + 11], 14, 643717713), d = y(d, g, p, h, u[m + 0], 20, -373897302), h = y(h, d, g, p, u[m + 5], 5, -701558691), p = y(p, h, d, g, u[m + 10], 9, 38016083), g = y(g, p, h, d, u[m + 15], 14, -660478335), d = y(d, g, p, h, u[m + 4], 20, -405537848), h = y(h, d, g, p, u[m + 9], 5, 568446438), p = y(p, h, d, g, u[m + 14], 9, -1019803690), g = y(g, p, h, d, u[m + 3], 14, -187363961), d = y(d, g, p, h, u[m + 8], 20, 1163531501), h = y(h, d, g, p, u[m + 13], 5, -1444681467), p = y(p, h, d, g, u[m + 2], 9, -51403784), g = y(g, p, h, d, u[m + 7], 14, 1735328473), h = v(h, d = y(d, g, p, h, u[m + 12], 20, -1926607734), g, p, u[m + 5], 4, -378558), p = v(p, h, d, g, u[m + 8], 11, -2022574463), g = v(g, p, h, d, u[m + 11], 16, 1839030562), d = v(d, g, p, h, u[m + 14], 23, -35309556), h = v(h, d, g, p, u[m + 1], 4, -1530992060), p = v(p, h, d, g, u[m + 4], 11, 1272893353), g = v(g, p, h, d, u[m + 7], 16, -155497632), d = v(d, g, p, h, u[m + 10], 23, -1094730640), h = v(h, d, g, p, u[m + 13], 4, 681279174), p = v(p, h, d, g, u[m + 0], 11, -358537222), g = v(g, p, h, d, u[m + 3], 16, -722521979), d = v(d, g, p, h, u[m + 6], 23, 76029189), h = v(h, d, g, p, u[m + 9], 4, -640364487), p = v(p, h, d, g, u[m + 12], 11, -421815835), g = v(g, p, h, d, u[m + 15], 16, 530742520), h = w(h, d = v(d, g, p, h, u[m + 2], 23, -995338651), g, p, u[m + 0], 6, -198630844), p = w(p, h, d, g, u[m + 7], 10, 1126891415), g = w(g, p, h, d, u[m + 14], 15, -1416354905), d = w(d, g, p, h, u[m + 5], 21, -57434055), h = w(h, d, g, p, u[m + 12], 6, 1700485571), p = w(p, h, d, g, u[m + 3], 10, -1894986606), g = w(g, p, h, d, u[m + 10], 15, -1051523), d = w(d, g, p, h, u[m + 1], 21, -2054922799), h = w(h, d, g, p, u[m + 8], 6, 1873313359), p = w(p, h, d, g, u[m + 15], 10, -30611744), g = w(g, p, h, d, u[m + 6], 15, -1560198380), d = w(d, g, p, h, u[m + 13], 21, 1309151649), h = w(h, d, g, p, u[m + 4], 6, -145523070), p = w(p, h, d, g, u[m + 11], 10, -1120210379), g = w(g, p, h, d, u[m + 2], 15, 718787259), d = w(d, g, p, h, u[m + 9], 21, -343485551), h = h + x >>> 0, d = d + P >>> 0, g = g + E >>> 0, p = p + T >>> 0;
766
+ }
767
+ return n.endian([h, d, g, p]);
768
+ };
769
+ a._ff = function(l, c, u, f, h, d, g) {
770
+ var p = l + (c & u | ~c & f) + (h >>> 0) + g;
771
+ return (p << d | p >>> 32 - d) + c;
772
+ }, a._gg = function(l, c, u, f, h, d, g) {
773
+ var p = l + (c & f | u & ~f) + (h >>> 0) + g;
774
+ return (p << d | p >>> 32 - d) + c;
775
+ }, a._hh = function(l, c, u, f, h, d, g) {
776
+ var p = l + (c ^ u ^ f) + (h >>> 0) + g;
777
+ return (p << d | p >>> 32 - d) + c;
778
+ }, a._ii = function(l, c, u, f, h, d, g) {
779
+ var p = l + (u ^ (c | ~f)) + (h >>> 0) + g;
780
+ return (p << d | p >>> 32 - d) + c;
781
+ }, a._blocksize = 16, a._digestsize = 16, r.exports = function(l, c) {
782
+ if (l == null) throw new Error("Illegal argument " + l);
783
+ var u = n.wordsToBytes(a(l, c));
784
+ return c && c.asBytes ? u : c && c.asString ? i.bytesToString(u) : n.bytesToHex(u);
785
+ };
786
+ })();
787
+ }, 647: (r, t) => {
788
+ var e = Object.prototype.hasOwnProperty;
789
+ function n(o) {
790
+ try {
791
+ return decodeURIComponent(o.replace(/\+/g, " "));
792
+ } catch {
793
+ return null;
794
+ }
795
+ }
796
+ function s(o) {
797
+ try {
798
+ return encodeURIComponent(o);
799
+ } catch {
800
+ return null;
801
+ }
802
+ }
803
+ t.stringify = function(o, i) {
804
+ i = i || "";
805
+ var a, l, c = [];
806
+ for (l in typeof i != "string" && (i = "?"), o) if (e.call(o, l)) {
807
+ if ((a = o[l]) || a != null && !isNaN(a) || (a = ""), l = s(l), a = s(a), l === null || a === null) continue;
808
+ c.push(l + "=" + a);
809
+ }
810
+ return c.length ? i + c.join("&") : "";
811
+ }, t.parse = function(o) {
812
+ for (var i, a = /([^=?#&]+)=?([^&]*)/g, l = {}; i = a.exec(o); ) {
813
+ var c = n(i[1]), u = n(i[2]);
814
+ c === null || u === null || c in l || (l[c] = u);
815
+ }
816
+ return l;
817
+ };
818
+ }, 670: (r) => {
819
+ r.exports = function(t, e) {
820
+ if (e = e.split(":")[0], !(t = +t)) return !1;
821
+ switch (e) {
822
+ case "http":
823
+ case "ws":
824
+ return t !== 80;
825
+ case "https":
826
+ case "wss":
827
+ return t !== 443;
828
+ case "ftp":
829
+ return t !== 21;
830
+ case "gopher":
831
+ return t !== 70;
832
+ case "file":
833
+ return !1;
834
+ }
835
+ return t !== 0;
836
+ };
837
+ }, 737: (r, t, e) => {
838
+ var n = e(670), s = e(647), o = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, i = /[\n\r\t]/g, a = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, l = /:\d+$/, c = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, u = /^[a-zA-Z]:/;
839
+ function f(y) {
840
+ return (y || "").toString().replace(o, "");
841
+ }
842
+ var h = [["#", "hash"], ["?", "query"], function(y, v) {
843
+ return p(v.protocol) ? y.replace(/\\/g, "/") : y;
844
+ }, ["/", "pathname"], ["@", "auth", 1], [NaN, "host", void 0, 1, 1], [/:(\d*)$/, "port", void 0, 1], [NaN, "hostname", void 0, 1, 1]], d = { hash: 1, query: 1 };
845
+ function g(y) {
846
+ var v, w = (typeof window < "u" ? window : typeof St < "u" ? St : typeof self < "u" ? self : {}).location || {}, x = {}, P = typeof (y = y || w);
847
+ if (y.protocol === "blob:") x = new b(unescape(y.pathname), {});
848
+ else if (P === "string") for (v in x = new b(y, {}), d) delete x[v];
849
+ else if (P === "object") {
850
+ for (v in y) v in d || (x[v] = y[v]);
851
+ x.slashes === void 0 && (x.slashes = a.test(y.href));
852
+ }
853
+ return x;
854
+ }
855
+ function p(y) {
856
+ return y === "file:" || y === "ftp:" || y === "http:" || y === "https:" || y === "ws:" || y === "wss:";
857
+ }
858
+ function m(y, v) {
859
+ y = (y = f(y)).replace(i, ""), v = v || {};
860
+ var w, x = c.exec(y), P = x[1] ? x[1].toLowerCase() : "", E = !!x[2], T = !!x[3], A = 0;
861
+ return E ? T ? (w = x[2] + x[3] + x[4], A = x[2].length + x[3].length) : (w = x[2] + x[4], A = x[2].length) : T ? (w = x[3] + x[4], A = x[3].length) : w = x[4], P === "file:" ? A >= 2 && (w = w.slice(2)) : p(P) ? w = x[4] : P ? E && (w = w.slice(2)) : A >= 2 && p(v.protocol) && (w = x[4]), { protocol: P, slashes: E || p(P), slashesCount: A, rest: w };
862
+ }
863
+ function b(y, v, w) {
864
+ if (y = (y = f(y)).replace(i, ""), !(this instanceof b)) return new b(y, v, w);
865
+ var x, P, E, T, A, F, rt = h.slice(), nt = typeof v, N = this, gt = 0;
866
+ for (nt !== "object" && nt !== "string" && (w = v, v = null), w && typeof w != "function" && (w = s.parse), x = !(P = m(y || "", v = g(v))).protocol && !P.slashes, N.slashes = P.slashes || x && v.slashes, N.protocol = P.protocol || v.protocol || "", y = P.rest, (P.protocol === "file:" && (P.slashesCount !== 2 || u.test(y)) || !P.slashes && (P.protocol || P.slashesCount < 2 || !p(N.protocol))) && (rt[3] = [/(.*)/, "pathname"]); gt < rt.length; gt++) typeof (T = rt[gt]) != "function" ? (E = T[0], F = T[1], E != E ? N[F] = y : typeof E == "string" ? ~(A = E === "@" ? y.lastIndexOf(E) : y.indexOf(E)) && (typeof T[2] == "number" ? (N[F] = y.slice(0, A), y = y.slice(A + T[2])) : (N[F] = y.slice(A), y = y.slice(0, A))) : (A = E.exec(y)) && (N[F] = A[1], y = y.slice(0, A.index)), N[F] = N[F] || x && T[3] && v[F] || "", T[4] && (N[F] = N[F].toLowerCase())) : y = T(y, N);
867
+ w && (N.query = w(N.query)), x && v.slashes && N.pathname.charAt(0) !== "/" && (N.pathname !== "" || v.pathname !== "") && (N.pathname = (function(dt, mt) {
868
+ if (dt === "") return mt;
869
+ for (var q = (mt || "/").split("/").slice(0, -1).concat(dt.split("/")), H = q.length, yt = q[H - 1], Ot = !1, X = 0; H--; ) q[H] === "." ? q.splice(H, 1) : q[H] === ".." ? (q.splice(H, 1), X++) : X && (H === 0 && (Ot = !0), q.splice(H, 1), X--);
870
+ return Ot && q.unshift(""), yt !== "." && yt !== ".." || q.push(""), q.join("/");
871
+ })(N.pathname, v.pathname)), N.pathname.charAt(0) !== "/" && p(N.protocol) && (N.pathname = "/" + N.pathname), n(N.port, N.protocol) || (N.host = N.hostname, N.port = ""), N.username = N.password = "", N.auth && (~(A = N.auth.indexOf(":")) ? (N.username = N.auth.slice(0, A), N.username = encodeURIComponent(decodeURIComponent(N.username)), N.password = N.auth.slice(A + 1), N.password = encodeURIComponent(decodeURIComponent(N.password))) : N.username = encodeURIComponent(decodeURIComponent(N.auth)), N.auth = N.password ? N.username + ":" + N.password : N.username), N.origin = N.protocol !== "file:" && p(N.protocol) && N.host ? N.protocol + "//" + N.host : "null", N.href = N.toString();
872
+ }
873
+ b.prototype = { set: function(y, v, w) {
874
+ var x = this;
875
+ switch (y) {
876
+ case "query":
877
+ typeof v == "string" && v.length && (v = (w || s.parse)(v)), x[y] = v;
878
+ break;
879
+ case "port":
880
+ x[y] = v, n(v, x.protocol) ? v && (x.host = x.hostname + ":" + v) : (x.host = x.hostname, x[y] = "");
881
+ break;
882
+ case "hostname":
883
+ x[y] = v, x.port && (v += ":" + x.port), x.host = v;
884
+ break;
885
+ case "host":
886
+ x[y] = v, l.test(v) ? (v = v.split(":"), x.port = v.pop(), x.hostname = v.join(":")) : (x.hostname = v, x.port = "");
887
+ break;
888
+ case "protocol":
889
+ x.protocol = v.toLowerCase(), x.slashes = !w;
890
+ break;
891
+ case "pathname":
892
+ case "hash":
893
+ if (v) {
894
+ var P = y === "pathname" ? "/" : "#";
895
+ x[y] = v.charAt(0) !== P ? P + v : v;
896
+ } else x[y] = v;
897
+ break;
898
+ case "username":
899
+ case "password":
900
+ x[y] = encodeURIComponent(v);
901
+ break;
902
+ case "auth":
903
+ var E = v.indexOf(":");
904
+ ~E ? (x.username = v.slice(0, E), x.username = encodeURIComponent(decodeURIComponent(x.username)), x.password = v.slice(E + 1), x.password = encodeURIComponent(decodeURIComponent(x.password))) : x.username = encodeURIComponent(decodeURIComponent(v));
905
+ }
906
+ for (var T = 0; T < h.length; T++) {
907
+ var A = h[T];
908
+ A[4] && (x[A[1]] = x[A[1]].toLowerCase());
909
+ }
910
+ return x.auth = x.password ? x.username + ":" + x.password : x.username, x.origin = x.protocol !== "file:" && p(x.protocol) && x.host ? x.protocol + "//" + x.host : "null", x.href = x.toString(), x;
911
+ }, toString: function(y) {
912
+ y && typeof y == "function" || (y = s.stringify);
913
+ var v, w = this, x = w.host, P = w.protocol;
914
+ P && P.charAt(P.length - 1) !== ":" && (P += ":");
915
+ var E = P + (w.protocol && w.slashes || p(w.protocol) ? "//" : "");
916
+ return w.username ? (E += w.username, w.password && (E += ":" + w.password), E += "@") : w.password ? (E += ":" + w.password, E += "@") : w.protocol !== "file:" && p(w.protocol) && !x && w.pathname !== "/" && (E += "@"), (x[x.length - 1] === ":" || l.test(w.hostname) && !w.port) && (x += ":"), E += x + w.pathname, (v = typeof w.query == "object" ? y(w.query) : w.query) && (E += v.charAt(0) !== "?" ? "?" + v : v), w.hash && (E += w.hash), E;
917
+ } }, b.extractProtocol = m, b.location = g, b.trimLeft = f, b.qs = s, r.exports = b;
918
+ }, 800: () => {
919
+ }, 805: () => {
920
+ }, 829: (r) => {
921
+ function t(c) {
922
+ return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(u) {
923
+ return typeof u;
924
+ } : function(u) {
925
+ return u && typeof Symbol == "function" && u.constructor === Symbol && u !== Symbol.prototype ? "symbol" : typeof u;
926
+ }, t(c);
927
+ }
928
+ function e(c) {
929
+ var u = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
930
+ return e = function(f) {
931
+ if (f === null || (h = f, Function.toString.call(h).indexOf("[native code]") === -1)) return f;
932
+ var h;
933
+ if (typeof f != "function") throw new TypeError("Super expression must either be null or a function");
934
+ if (u !== void 0) {
935
+ if (u.has(f)) return u.get(f);
936
+ u.set(f, d);
937
+ }
938
+ function d() {
939
+ return n(f, arguments, o(this).constructor);
940
+ }
941
+ return d.prototype = Object.create(f.prototype, { constructor: { value: d, enumerable: !1, writable: !0, configurable: !0 } }), s(d, f);
942
+ }, e(c);
943
+ }
944
+ function n(c, u, f) {
945
+ return n = (function() {
946
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
947
+ if (typeof Proxy == "function") return !0;
948
+ try {
949
+ return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {
950
+ }))), !0;
951
+ } catch {
952
+ return !1;
953
+ }
954
+ })() ? Reflect.construct : function(h, d, g) {
955
+ var p = [null];
956
+ p.push.apply(p, d);
957
+ var m = new (Function.bind.apply(h, p))();
958
+ return g && s(m, g.prototype), m;
959
+ }, n.apply(null, arguments);
960
+ }
961
+ function s(c, u) {
962
+ return s = Object.setPrototypeOf || function(f, h) {
963
+ return f.__proto__ = h, f;
964
+ }, s(c, u);
965
+ }
966
+ function o(c) {
967
+ return o = Object.setPrototypeOf ? Object.getPrototypeOf : function(u) {
968
+ return u.__proto__ || Object.getPrototypeOf(u);
969
+ }, o(c);
970
+ }
971
+ var i = (function(c) {
972
+ function u(f) {
973
+ var h;
974
+ return (function(d, g) {
975
+ if (!(d instanceof g)) throw new TypeError("Cannot call a class as a function");
976
+ })(this, u), (h = (function(d, g) {
977
+ return !g || t(g) !== "object" && typeof g != "function" ? (function(p) {
978
+ if (p === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
979
+ return p;
980
+ })(d) : g;
981
+ })(this, o(u).call(this, f))).name = "ObjectPrototypeMutationError", h;
982
+ }
983
+ return (function(f, h) {
984
+ if (typeof h != "function" && h !== null) throw new TypeError("Super expression must either be null or a function");
985
+ f.prototype = Object.create(h && h.prototype, { constructor: { value: f, writable: !0, configurable: !0 } }), h && s(f, h);
986
+ })(u, c), u;
987
+ })(e(Error));
988
+ function a(c, u) {
989
+ for (var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {
990
+ }, h = u.split("."), d = h.length, g = function(b) {
991
+ var y = h[b];
992
+ if (!c) return { v: void 0 };
993
+ if (y === "+") {
994
+ if (Array.isArray(c)) return { v: c.map((function(w, x) {
995
+ var P = h.slice(b + 1);
996
+ return P.length > 0 ? a(w, P.join("."), f) : f(c, x, h, b);
997
+ })) };
998
+ var v = h.slice(0, b).join(".");
999
+ throw new Error("Object at wildcard (".concat(v, ") is not an array"));
1000
+ }
1001
+ c = f(c, y, h, b);
1002
+ }, p = 0; p < d; p++) {
1003
+ var m = g(p);
1004
+ if (t(m) === "object") return m.v;
1005
+ }
1006
+ return c;
1007
+ }
1008
+ function l(c, u) {
1009
+ return c.length === u + 1;
1010
+ }
1011
+ r.exports = { set: function(c, u, f) {
1012
+ if (t(c) != "object" || c === null || u === void 0) return c;
1013
+ if (typeof u == "number") return c[u] = f, c[u];
1014
+ try {
1015
+ return a(c, u, (function(h, d, g, p) {
1016
+ if (h === Reflect.getPrototypeOf({})) throw new i("Attempting to mutate Object.prototype");
1017
+ if (!h[d]) {
1018
+ var m = Number.isInteger(Number(g[p + 1])), b = g[p + 1] === "+";
1019
+ h[d] = m || b ? [] : {};
1020
+ }
1021
+ return l(g, p) && (h[d] = f), h[d];
1022
+ }));
1023
+ } catch (h) {
1024
+ if (h instanceof i) throw h;
1025
+ return c;
1026
+ }
1027
+ }, get: function(c, u) {
1028
+ if (t(c) != "object" || c === null || u === void 0) return c;
1029
+ if (typeof u == "number") return c[u];
1030
+ try {
1031
+ return a(c, u, (function(f, h) {
1032
+ return f[h];
1033
+ }));
1034
+ } catch {
1035
+ return c;
1036
+ }
1037
+ }, has: function(c, u) {
1038
+ var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1039
+ if (t(c) != "object" || c === null || u === void 0) return !1;
1040
+ if (typeof u == "number") return u in c;
1041
+ try {
1042
+ var h = !1;
1043
+ return a(c, u, (function(d, g, p, m) {
1044
+ if (!l(p, m)) return d && d[g];
1045
+ h = f.own ? d.hasOwnProperty(g) : g in d;
1046
+ })), h;
1047
+ } catch {
1048
+ return !1;
1049
+ }
1050
+ }, hasOwn: function(c, u, f) {
1051
+ return this.has(c, u, f || { own: !0 });
1052
+ }, isIn: function(c, u, f) {
1053
+ var h = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1054
+ if (t(c) != "object" || c === null || u === void 0) return !1;
1055
+ try {
1056
+ var d = !1, g = !1;
1057
+ return a(c, u, (function(p, m, b, y) {
1058
+ return d = d || p === f || !!p && p[m] === f, g = l(b, y) && t(p) === "object" && m in p, p && p[m];
1059
+ })), h.validPath ? d && g : d;
1060
+ } catch {
1061
+ return !1;
1062
+ }
1063
+ }, ObjectPrototypeMutationError: i };
1064
+ } }, ge = {};
1065
+ function O(r) {
1066
+ var t = ge[r];
1067
+ if (t !== void 0) return t.exports;
1068
+ var e = ge[r] = { id: r, loaded: !1, exports: {} };
1069
+ return Xr[r].call(e.exports, e, e.exports, O), e.loaded = !0, e.exports;
1070
+ }
1071
+ O.n = (r) => {
1072
+ var t = r && r.__esModule ? () => r.default : () => r;
1073
+ return O.d(t, { a: t }), t;
1074
+ }, O.d = (r, t) => {
1075
+ for (var e in t) O.o(t, e) && !O.o(r, e) && Object.defineProperty(r, e, { enumerable: !0, get: t[e] });
1076
+ }, O.o = (r, t) => Object.prototype.hasOwnProperty.call(r, t), O.nmd = (r) => (r.paths = [], r.children || (r.children = []), r);
1077
+ var Yr = O(737), Zr = O.n(Yr);
1078
+ function Mt(r) {
1079
+ if (!Zt(r)) throw new Error("Parameter was not an error");
1080
+ }
1081
+ function Zt(r) {
1082
+ return !!r && typeof r == "object" && (t = r, Object.prototype.toString.call(t) === "[object Error]") || r instanceof Error;
1083
+ var t;
1084
+ }
1085
+ class V extends Error {
1086
+ constructor(t, e) {
1087
+ const n = [...arguments], { options: s, shortMessage: o } = (function(a) {
1088
+ let l, c = "";
1089
+ if (a.length === 0) l = {};
1090
+ else if (Zt(a[0])) l = { cause: a[0] }, c = a.slice(1).join(" ") || "";
1091
+ else if (a[0] && typeof a[0] == "object") l = Object.assign({}, a[0]), c = a.slice(1).join(" ") || "";
1092
+ else {
1093
+ if (typeof a[0] != "string") throw new Error("Invalid arguments passed to Layerr");
1094
+ l = {}, c = c = a.join(" ") || "";
1095
+ }
1096
+ return { options: l, shortMessage: c };
1097
+ })(n);
1098
+ let i = o;
1099
+ if (s.cause && (i = `${i}: ${s.cause.message}`), super(i), this.message = i, s.name && typeof s.name == "string" ? this.name = s.name : this.name = "Layerr", s.cause && Object.defineProperty(this, "_cause", { value: s.cause }), Object.defineProperty(this, "_info", { value: {} }), s.info && typeof s.info == "object" && Object.assign(this._info, s.info), Error.captureStackTrace) {
1100
+ const a = s.constructorOpt || this.constructor;
1101
+ Error.captureStackTrace(this, a);
1102
+ }
1103
+ }
1104
+ static cause(t) {
1105
+ return Mt(t), t._cause && Zt(t._cause) ? t._cause : null;
1106
+ }
1107
+ static fullStack(t) {
1108
+ Mt(t);
1109
+ const e = V.cause(t);
1110
+ return e ? `${t.stack}
1111
+ caused by: ${V.fullStack(e)}` : t.stack ?? "";
1112
+ }
1113
+ static info(t) {
1114
+ Mt(t);
1115
+ const e = {}, n = V.cause(t);
1116
+ return n && Object.assign(e, V.info(n)), t._info && Object.assign(e, t._info), e;
1117
+ }
1118
+ toString() {
1119
+ let t = this.name || this.constructor.name || this.constructor.prototype.name;
1120
+ return this.message && (t = `${t}: ${this.message}`), t;
1121
+ }
1122
+ }
1123
+ var Jr = O(47), $t = O.n(Jr);
1124
+ const de = "__PATH_SEPARATOR_POSIX__", me = "__PATH_SEPARATOR_WINDOWS__";
1125
+ function S(r) {
1126
+ try {
1127
+ const t = r.replace(/\//g, de).replace(/\\\\/g, me);
1128
+ return encodeURIComponent(t).split(me).join("\\\\").split(de).join("/");
1129
+ } catch (t) {
1130
+ throw new V(t, "Failed encoding path");
1131
+ }
1132
+ }
1133
+ function ye(r) {
1134
+ return r.startsWith("/") ? r : "/" + r;
1135
+ }
1136
+ function At(r) {
1137
+ let t = r;
1138
+ return t[0] !== "/" && (t = "/" + t), /^.+\/$/.test(t) && (t = t.substr(0, t.length - 1)), t;
1139
+ }
1140
+ function Kr(r) {
1141
+ let t = new (Zr())(r).pathname;
1142
+ return t.length <= 0 && (t = "/"), At(t);
1143
+ }
1144
+ function C() {
1145
+ for (var r = arguments.length, t = new Array(r), e = 0; e < r; e++) t[e] = arguments[e];
1146
+ return (function() {
1147
+ return (function(n) {
1148
+ var s = [];
1149
+ if (n.length === 0) return "";
1150
+ if (typeof n[0] != "string") throw new TypeError("Url must be a string. Received " + n[0]);
1151
+ if (n[0].match(/^[^/:]+:\/*$/) && n.length > 1) {
1152
+ var o = n.shift();
1153
+ n[0] = o + n[0];
1154
+ }
1155
+ n[0].match(/^file:\/\/\//) ? n[0] = n[0].replace(/^([^/:]+):\/*/, "$1:///") : n[0] = n[0].replace(/^([^/:]+):\/*/, "$1://");
1156
+ for (var i = 0; i < n.length; i++) {
1157
+ var a = n[i];
1158
+ if (typeof a != "string") throw new TypeError("Url must be a string. Received " + a);
1159
+ a !== "" && (i > 0 && (a = a.replace(/^[\/]+/, "")), a = i < n.length - 1 ? a.replace(/[\/]+$/, "") : a.replace(/[\/]+$/, "/"), s.push(a));
1160
+ }
1161
+ var l = s.join("/"), c = (l = l.replace(/\/(\?|&|#[^!])/g, "$1")).split("?");
1162
+ return c.shift() + (c.length > 0 ? "?" : "") + c.join("&");
1163
+ })(typeof arguments[0] == "object" ? arguments[0] : [].slice.call(arguments));
1164
+ })(t.reduce(((n, s, o) => ((o === 0 || s !== "/" || s === "/" && n[n.length - 1] !== "/") && n.push(s), n)), []));
1165
+ }
1166
+ var Qr = O(542), bt = O.n(Qr);
1167
+ function be(r, t) {
1168
+ const e = r.url.replace("//", ""), n = e.indexOf("/") == -1 ? "/" : e.slice(e.indexOf("/")), s = r.method ? r.method.toUpperCase() : "GET", o = !!/(^|,)\s*auth\s*($|,)/.test(t.qop) && "auth", i = `00000000${t.nc}`.slice(-8), a = (function(h, d, g, p, m, b, y) {
1169
+ const v = y || bt()(`${d}:${g}:${p}`);
1170
+ return h && h.toLowerCase() === "md5-sess" ? bt()(`${v}:${m}:${b}`) : v;
1171
+ })(t.algorithm, t.username, t.realm, t.password, t.nonce, t.cnonce, t.ha1), l = bt()(`${s}:${n}`), c = o ? bt()(`${a}:${t.nonce}:${i}:${t.cnonce}:${o}:${l}`) : bt()(`${a}:${t.nonce}:${l}`), u = { username: t.username, realm: t.realm, nonce: t.nonce, uri: n, qop: o, response: c, nc: i, cnonce: t.cnonce, algorithm: t.algorithm, opaque: t.opaque }, f = [];
1172
+ for (const h in u) u[h] && (h === "qop" || h === "nc" || h === "algorithm" ? f.push(`${h}=${u[h]}`) : f.push(`${h}="${u[h]}"`));
1173
+ return `Digest ${f.join(", ")}`;
1174
+ }
1175
+ function He(r) {
1176
+ return (r.headers && r.headers.get("www-authenticate") || "").split(/\s/)[0].toLowerCase() === "digest";
1177
+ }
1178
+ var tn = O(101), Xe = O.n(tn);
1179
+ function ve(r) {
1180
+ return Xe().decode(r);
1181
+ }
1182
+ function we(r, t) {
1183
+ var e;
1184
+ return `Basic ${e = `${r}:${t}`, Xe().encode(e)}`;
1185
+ }
1186
+ const xe = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : typeof window < "u" ? window : globalThis, en = xe.fetch.bind(xe);
1187
+ let W = (function(r) {
1188
+ return r.Auto = "auto", r.Digest = "digest", r.None = "none", r.Password = "password", r.Token = "token", r;
1189
+ })({}), et = (function(r) {
1190
+ return r.DataTypeNoLength = "data-type-no-length", r.InvalidAuthType = "invalid-auth-type", r.InvalidOutputFormat = "invalid-output-format", r.LinkUnsupportedAuthType = "link-unsupported-auth", r.InvalidUpdateRange = "invalid-update-range", r.NotSupported = "not-supported", r;
1191
+ })({});
1192
+ function Ye(r, t, e, n, s) {
1193
+ switch (r.authType) {
1194
+ case W.Auto:
1195
+ t && e && (r.headers.Authorization = we(t, e));
1196
+ break;
1197
+ case W.Digest:
1198
+ r.digest = /* @__PURE__ */ (function(i, a, l) {
1199
+ return { username: i, password: a, ha1: l, nc: 0, algorithm: "md5", hasDigestAuth: !1 };
1200
+ })(t, e, s);
1201
+ break;
1202
+ case W.None:
1203
+ break;
1204
+ case W.Password:
1205
+ r.headers.Authorization = we(t, e);
1206
+ break;
1207
+ case W.Token:
1208
+ r.headers.Authorization = `${(o = n).token_type} ${o.access_token}`;
1209
+ break;
1210
+ default:
1211
+ throw new V({ info: { code: et.InvalidAuthType } }, `Invalid auth type: ${r.authType}`);
1212
+ }
1213
+ var o;
1214
+ }
1215
+ O(345), O(800);
1216
+ const Ne = "@@HOTPATCHER", rn = () => {
1217
+ };
1218
+ function _t(r) {
1219
+ return { original: r, methods: [r], final: !1 };
1220
+ }
1221
+ class nn {
1222
+ constructor() {
1223
+ this._configuration = { registry: {}, getEmptyAction: "null" }, this.__type__ = Ne;
1224
+ }
1225
+ get configuration() {
1226
+ return this._configuration;
1227
+ }
1228
+ get getEmptyAction() {
1229
+ return this.configuration.getEmptyAction;
1230
+ }
1231
+ set getEmptyAction(t) {
1232
+ this.configuration.getEmptyAction = t;
1233
+ }
1234
+ control(t) {
1235
+ let e = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
1236
+ if (!t || t.__type__ !== Ne) throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");
1237
+ return Object.keys(t.configuration.registry).forEach(((n) => {
1238
+ this.configuration.registry.hasOwnProperty(n) ? e && (this.configuration.registry[n] = Object.assign({}, t.configuration.registry[n])) : this.configuration.registry[n] = Object.assign({}, t.configuration.registry[n]);
1239
+ })), t._configuration = this.configuration, this;
1240
+ }
1241
+ execute(t) {
1242
+ const e = this.get(t) || rn;
1243
+ for (var n = arguments.length, s = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) s[o - 1] = arguments[o];
1244
+ return e(...s);
1245
+ }
1246
+ get(t) {
1247
+ const e = this.configuration.registry[t];
1248
+ if (!e) switch (this.getEmptyAction) {
1249
+ case "null":
1250
+ return null;
1251
+ case "throw":
1252
+ throw new Error(`Failed handling method request: No method provided for override: ${t}`);
1253
+ default:
1254
+ throw new Error(`Failed handling request which resulted in an empty method: Invalid empty-action specified: ${this.getEmptyAction}`);
1255
+ }
1256
+ return (function() {
1257
+ for (var n = arguments.length, s = new Array(n), o = 0; o < n; o++) s[o] = arguments[o];
1258
+ if (s.length === 0) throw new Error("Failed creating sequence: No functions provided");
1259
+ return function() {
1260
+ for (var i = arguments.length, a = new Array(i), l = 0; l < i; l++) a[l] = arguments[l];
1261
+ let c = a;
1262
+ const u = this;
1263
+ for (; s.length > 0; ) c = [s.shift().apply(u, c)];
1264
+ return c[0];
1265
+ };
1266
+ })(...e.methods);
1267
+ }
1268
+ isPatched(t) {
1269
+ return !!this.configuration.registry[t];
1270
+ }
1271
+ patch(t, e) {
1272
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1273
+ const { chain: s = !1 } = n;
1274
+ if (this.configuration.registry[t] && this.configuration.registry[t].final) throw new Error(`Failed patching '${t}': Method marked as being final`);
1275
+ if (typeof e != "function") throw new Error(`Failed patching '${t}': Provided method is not a function`);
1276
+ if (s) this.configuration.registry[t] ? this.configuration.registry[t].methods.push(e) : this.configuration.registry[t] = _t(e);
1277
+ else if (this.isPatched(t)) {
1278
+ const { original: o } = this.configuration.registry[t];
1279
+ this.configuration.registry[t] = Object.assign(_t(e), { original: o });
1280
+ } else this.configuration.registry[t] = _t(e);
1281
+ return this;
1282
+ }
1283
+ patchInline(t, e) {
1284
+ this.isPatched(t) || this.patch(t, e);
1285
+ for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), o = 2; o < n; o++) s[o - 2] = arguments[o];
1286
+ return this.execute(t, ...s);
1287
+ }
1288
+ plugin(t) {
1289
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++) n[s - 1] = arguments[s];
1290
+ return n.forEach(((o) => {
1291
+ this.patch(t, o, { chain: !0 });
1292
+ })), this;
1293
+ }
1294
+ restore(t) {
1295
+ if (!this.isPatched(t)) throw new Error(`Failed restoring method: No method present for key: ${t}`);
1296
+ if (typeof this.configuration.registry[t].original != "function") throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${t}`);
1297
+ return this.configuration.registry[t].methods = [this.configuration.registry[t].original], this;
1298
+ }
1299
+ setFinal(t) {
1300
+ if (!this.configuration.registry.hasOwnProperty(t)) throw new Error(`Failed marking '${t}' as final: No method found for key`);
1301
+ return this.configuration.registry[t].final = !0, this;
1302
+ }
1303
+ }
1304
+ let Vt = null;
1305
+ function sn() {
1306
+ return Vt || (Vt = new nn()), Vt;
1307
+ }
1308
+ function Ft(r) {
1309
+ return (function(t) {
1310
+ if (typeof t != "object" || t === null || Object.prototype.toString.call(t) != "[object Object]") return !1;
1311
+ if (Object.getPrototypeOf(t) === null) return !0;
1312
+ let e = t;
1313
+ for (; Object.getPrototypeOf(e) !== null; ) e = Object.getPrototypeOf(e);
1314
+ return Object.getPrototypeOf(t) === e;
1315
+ })(r) ? Object.assign({}, r) : Object.setPrototypeOf(Object.assign({}, r), Object.getPrototypeOf(r));
1316
+ }
1317
+ function Pe() {
1318
+ for (var r = arguments.length, t = new Array(r), e = 0; e < r; e++) t[e] = arguments[e];
1319
+ let n = null, s = [...t];
1320
+ for (; s.length > 0; ) {
1321
+ const o = s.shift();
1322
+ n = n ? Ze(n, o) : Ft(o);
1323
+ }
1324
+ return n;
1325
+ }
1326
+ function Ze(r, t) {
1327
+ const e = Ft(r);
1328
+ return Object.keys(t).forEach(((n) => {
1329
+ e.hasOwnProperty(n) ? Array.isArray(t[n]) ? e[n] = Array.isArray(e[n]) ? [...e[n], ...t[n]] : [...t[n]] : typeof t[n] == "object" && t[n] ? e[n] = typeof e[n] == "object" && e[n] ? Ze(e[n], t[n]) : Ft(t[n]) : e[n] = t[n] : e[n] = t[n];
1330
+ })), e;
1331
+ }
1332
+ function on(r) {
1333
+ const t = {};
1334
+ for (const e of r.keys()) t[e] = r.get(e);
1335
+ return t;
1336
+ }
1337
+ function Jt() {
1338
+ for (var r = arguments.length, t = new Array(r), e = 0; e < r; e++) t[e] = arguments[e];
1339
+ if (t.length === 0) return {};
1340
+ const n = {};
1341
+ return t.reduce(((s, o) => (Object.keys(o).forEach(((i) => {
1342
+ const a = i.toLowerCase();
1343
+ n.hasOwnProperty(a) ? s[n[a]] = o[i] : (n[a] = i, s[i] = o[i]);
1344
+ })), s)), {});
1345
+ }
1346
+ O(805);
1347
+ const an = typeof ArrayBuffer == "function", { toString: un } = Object.prototype;
1348
+ function Je(r) {
1349
+ return an && (r instanceof ArrayBuffer || un.call(r) === "[object ArrayBuffer]");
1350
+ }
1351
+ function Ke(r) {
1352
+ return r != null && r.constructor != null && typeof r.constructor.isBuffer == "function" && r.constructor.isBuffer(r);
1353
+ }
1354
+ function oe(r) {
1355
+ return function() {
1356
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
1357
+ try {
1358
+ return Promise.resolve(r.apply(this, t));
1359
+ } catch (n) {
1360
+ return Promise.reject(n);
1361
+ }
1362
+ };
1363
+ }
1364
+ function Kt(r, t, e) {
1365
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
1366
+ }
1367
+ const Qe = oe((function(r) {
1368
+ const t = r._digest;
1369
+ return delete r._digest, t.hasDigestAuth && (r = Pe(r, { headers: { Authorization: be(r, t) } })), Kt(jt(r), (function(e) {
1370
+ let n = !1;
1371
+ return s = function(i) {
1372
+ return n ? i : e;
1373
+ }, (o = (function() {
1374
+ if (e.status == 401) return t.hasDigestAuth = (function(i, a) {
1375
+ if (!He(i)) return !1;
1376
+ const l = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;
1377
+ for (; ; ) {
1378
+ const c = i.headers && i.headers.get("www-authenticate") || "", u = l.exec(c);
1379
+ if (!u) break;
1380
+ a[u[1]] = u[2] || u[3];
1381
+ }
1382
+ return a.nc += 1, a.cnonce = (function() {
1383
+ let c = "";
1384
+ for (let u = 0; u < 32; ++u) c = `${c}${"abcdef0123456789"[Math.floor(16 * Math.random())]}`;
1385
+ return c;
1386
+ })(), !0;
1387
+ })(e, t), (function() {
1388
+ if (t.hasDigestAuth) return Kt(jt(r = Pe(r, { headers: { Authorization: be(r, t) } })), (function(i) {
1389
+ return i.status == 401 ? t.hasDigestAuth = !1 : t.nc++, n = !0, i;
1390
+ }));
1391
+ })();
1392
+ t.nc++;
1393
+ })()) && o.then ? o.then(s) : s(o);
1394
+ var s, o;
1395
+ }));
1396
+ })), ln = oe((function(r, t) {
1397
+ return Kt(jt(r), (function(e) {
1398
+ return e.ok ? (t.authType = W.Password, e) : e.status == 401 && He(e) ? (t.authType = W.Digest, Ye(t, t.username, t.password, void 0, void 0), r._digest = t.digest, Qe(r)) : e;
1399
+ }));
1400
+ })), j = oe((function(r, t) {
1401
+ return t.authType === W.Auto ? ln(r, t) : r._digest ? Qe(r) : jt(r);
1402
+ }));
1403
+ function R(r, t, e) {
1404
+ const n = Ft(r);
1405
+ return n.headers = Jt(t.headers, n.headers || {}, e.headers || {}), e.data !== void 0 && (n.data = e.data), e.signal && (n.signal = e.signal), t.httpAgent && (n.httpAgent = t.httpAgent), t.httpsAgent && (n.httpsAgent = t.httpsAgent), t.digest && (n._digest = t.digest), typeof t.withCredentials == "boolean" && (n.withCredentials = t.withCredentials), n;
1406
+ }
1407
+ function jt(r) {
1408
+ const t = sn();
1409
+ return t.patchInline("request", ((e) => t.patchInline("fetch", en, e.url, (function(n) {
1410
+ let s = {};
1411
+ const o = { method: n.method };
1412
+ if (n.headers && (s = Jt(s, n.headers)), n.data !== void 0) {
1413
+ const [i, a] = (function(l) {
1414
+ if (typeof l == "string") return [l, {}];
1415
+ if (Ke(l)) return [l, {}];
1416
+ if (Je(l)) return [l, {}];
1417
+ if (l && typeof l == "object") return [JSON.stringify(l), { "content-type": "application/json" }];
1418
+ throw new Error("Unable to convert request body: Unexpected body type: " + typeof l);
1419
+ })(n.data);
1420
+ o.body = i, s = Jt(s, a);
1421
+ }
1422
+ return n.signal && (o.signal = n.signal), n.withCredentials && (o.credentials = "include"), o.headers = s, o;
1423
+ })(e))), r);
1424
+ }
1425
+ var cn = O(285);
1426
+ const Rt = (r) => {
1427
+ if (typeof r != "string") throw new TypeError("invalid pattern");
1428
+ if (r.length > 65536) throw new TypeError("pattern is too long");
1429
+ }, hn = { "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0], "[:alpha:]": ["\\p{L}\\p{Nl}", !0], "[:ascii:]": ["\\x00-\\x7f", !1], "[:blank:]": ["\\p{Zs}\\t", !0], "[:cntrl:]": ["\\p{Cc}", !0], "[:digit:]": ["\\p{Nd}", !0], "[:graph:]": ["\\p{Z}\\p{C}", !0, !0], "[:lower:]": ["\\p{Ll}", !0], "[:print:]": ["\\p{C}", !0], "[:punct:]": ["\\p{P}", !0], "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0], "[:upper:]": ["\\p{Lu}", !0], "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0], "[:xdigit:]": ["A-Fa-f0-9", !1] }, vt = (r) => r.replace(/[[\]\\-]/g, "\\$&"), Ee = (r) => r.join(""), fn = (r, t) => {
1430
+ const e = t;
1431
+ if (r.charAt(e) !== "[") throw new Error("not in a brace expression");
1432
+ const n = [], s = [];
1433
+ let o = e + 1, i = !1, a = !1, l = !1, c = !1, u = e, f = "";
1434
+ t: for (; o < r.length; ) {
1435
+ const p = r.charAt(o);
1436
+ if (p !== "!" && p !== "^" || o !== e + 1) {
1437
+ if (p === "]" && i && !l) {
1438
+ u = o + 1;
1439
+ break;
1440
+ }
1441
+ if (i = !0, p !== "\\" || l) {
1442
+ if (p === "[" && !l) {
1443
+ for (const [m, [b, y, v]] of Object.entries(hn)) if (r.startsWith(m, o)) {
1444
+ if (f) return ["$.", !1, r.length - e, !0];
1445
+ o += m.length, v ? s.push(b) : n.push(b), a = a || y;
1446
+ continue t;
1447
+ }
1448
+ }
1449
+ l = !1, f ? (p > f ? n.push(vt(f) + "-" + vt(p)) : p === f && n.push(vt(p)), f = "", o++) : r.startsWith("-]", o + 1) ? (n.push(vt(p + "-")), o += 2) : r.startsWith("-", o + 1) ? (f = p, o += 2) : (n.push(vt(p)), o++);
1450
+ } else l = !0, o++;
1451
+ } else c = !0, o++;
1452
+ }
1453
+ if (u < o) return ["", !1, 0, !1];
1454
+ if (!n.length && !s.length) return ["$.", !1, r.length - e, !0];
1455
+ if (s.length === 0 && n.length === 1 && /^\\?.$/.test(n[0]) && !c)
1456
+ return [(h = n[0].length === 2 ? n[0].slice(-1) : n[0], h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")), !1, u - e, !1];
1457
+ var h;
1458
+ const d = "[" + (c ? "^" : "") + Ee(n) + "]", g = "[" + (c ? "" : "^") + Ee(s) + "]";
1459
+ return [n.length && s.length ? "(" + d + "|" + g + ")" : n.length ? d : g, a, u - e, !0];
1460
+ }, Nt = function(r) {
1461
+ let { windowsPathsNoEscape: t = !1 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1462
+ return t ? r.replace(/\[([^\/\\])\]/g, "$1") : r.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
1463
+ }, pn = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), Ae = (r) => pn.has(r), Bt = "(?!\\.)", gn = /* @__PURE__ */ new Set(["[", "."]), dn = /* @__PURE__ */ new Set(["..", "."]), mn = new Set("().*{}+?[]^$\\!"), ie = "[^/]", Te = ie + "*?", Oe = ie + "+?";
1464
+ class M {
1465
+ type;
1466
+ #r;
1467
+ #n;
1468
+ #o = !1;
1469
+ #t = [];
1470
+ #e;
1471
+ #i;
1472
+ #u;
1473
+ #a = !1;
1474
+ #s;
1475
+ #l;
1476
+ #h = !1;
1477
+ constructor(t, e) {
1478
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1479
+ this.type = t, t && (this.#n = !0), this.#e = e, this.#r = this.#e ? this.#e.#r : this, this.#s = this.#r === this ? n : this.#r.#s, this.#u = this.#r === this ? [] : this.#r.#u, t !== "!" || this.#r.#a || this.#u.push(this), this.#i = this.#e ? this.#e.#t.length : 0;
1480
+ }
1481
+ get hasMagic() {
1482
+ if (this.#n !== void 0) return this.#n;
1483
+ for (const t of this.#t) if (typeof t != "string" && (t.type || t.hasMagic)) return this.#n = !0;
1484
+ return this.#n;
1485
+ }
1486
+ toString() {
1487
+ return this.#l !== void 0 ? this.#l : this.type ? this.#l = this.type + "(" + this.#t.map(((t) => String(t))).join("|") + ")" : this.#l = this.#t.map(((t) => String(t))).join("");
1488
+ }
1489
+ #p() {
1490
+ if (this !== this.#r) throw new Error("should only call on root");
1491
+ if (this.#a) return this;
1492
+ let t;
1493
+ for (this.toString(), this.#a = !0; t = this.#u.pop(); ) {
1494
+ if (t.type !== "!") continue;
1495
+ let e = t, n = e.#e;
1496
+ for (; n; ) {
1497
+ for (let s = e.#i + 1; !n.type && s < n.#t.length; s++) for (const o of t.#t) {
1498
+ if (typeof o == "string") throw new Error("string part in extglob AST??");
1499
+ o.copyIn(n.#t[s]);
1500
+ }
1501
+ e = n, n = e.#e;
1502
+ }
1503
+ }
1504
+ return this;
1505
+ }
1506
+ push() {
1507
+ for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
1508
+ for (const s of e) if (s !== "") {
1509
+ if (typeof s != "string" && !(s instanceof M && s.#e === this)) throw new Error("invalid part: " + s);
1510
+ this.#t.push(s);
1511
+ }
1512
+ }
1513
+ toJSON() {
1514
+ const t = this.type === null ? this.#t.slice().map(((e) => typeof e == "string" ? e : e.toJSON())) : [this.type, ...this.#t.map(((e) => e.toJSON()))];
1515
+ return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === this.#r || this.#r.#a && this.#e?.type === "!") && t.push({}), t;
1516
+ }
1517
+ isStart() {
1518
+ if (this.#r === this) return !0;
1519
+ if (!this.#e?.isStart()) return !1;
1520
+ if (this.#i === 0) return !0;
1521
+ const t = this.#e;
1522
+ for (let e = 0; e < this.#i; e++) {
1523
+ const n = t.#t[e];
1524
+ if (!(n instanceof M && n.type === "!")) return !1;
1525
+ }
1526
+ return !0;
1527
+ }
1528
+ isEnd() {
1529
+ if (this.#r === this || this.#e?.type === "!") return !0;
1530
+ if (!this.#e?.isEnd()) return !1;
1531
+ if (!this.type) return this.#e?.isEnd();
1532
+ const t = this.#e ? this.#e.#t.length : 0;
1533
+ return this.#i === t - 1;
1534
+ }
1535
+ copyIn(t) {
1536
+ typeof t == "string" ? this.push(t) : this.push(t.clone(this));
1537
+ }
1538
+ clone(t) {
1539
+ const e = new M(this.type, t);
1540
+ for (const n of this.#t) e.copyIn(n);
1541
+ return e;
1542
+ }
1543
+ static #c(t, e, n, s) {
1544
+ let o = !1, i = !1, a = -1, l = !1;
1545
+ if (e.type === null) {
1546
+ let d = n, g = "";
1547
+ for (; d < t.length; ) {
1548
+ const p = t.charAt(d++);
1549
+ if (o || p === "\\") o = !o, g += p;
1550
+ else if (i) d === a + 1 ? p !== "^" && p !== "!" || (l = !0) : p !== "]" || d === a + 2 && l || (i = !1), g += p;
1551
+ else if (p !== "[") if (s.noext || !Ae(p) || t.charAt(d) !== "(") g += p;
1552
+ else {
1553
+ e.push(g), g = "";
1554
+ const m = new M(p, e);
1555
+ d = M.#c(t, m, d, s), e.push(m);
1556
+ }
1557
+ else i = !0, a = d, l = !1, g += p;
1558
+ }
1559
+ return e.push(g), d;
1560
+ }
1561
+ let c = n + 1, u = new M(null, e);
1562
+ const f = [];
1563
+ let h = "";
1564
+ for (; c < t.length; ) {
1565
+ const d = t.charAt(c++);
1566
+ if (o || d === "\\") o = !o, h += d;
1567
+ else if (i) c === a + 1 ? d !== "^" && d !== "!" || (l = !0) : d !== "]" || c === a + 2 && l || (i = !1), h += d;
1568
+ else if (d !== "[") if (Ae(d) && t.charAt(c) === "(") {
1569
+ u.push(h), h = "";
1570
+ const g = new M(d, u);
1571
+ u.push(g), c = M.#c(t, g, c, s);
1572
+ } else if (d !== "|") {
1573
+ if (d === ")") return h === "" && e.#t.length === 0 && (e.#h = !0), u.push(h), h = "", e.push(...f, u), c;
1574
+ h += d;
1575
+ } else u.push(h), h = "", f.push(u), u = new M(null, e);
1576
+ else i = !0, a = c, l = !1, h += d;
1577
+ }
1578
+ return e.type = null, e.#n = void 0, e.#t = [t.substring(n - 1)], c;
1579
+ }
1580
+ static fromGlob(t) {
1581
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1582
+ const n = new M(null, void 0, e);
1583
+ return M.#c(t, n, 0, e), n;
1584
+ }
1585
+ toMMPattern() {
1586
+ if (this !== this.#r) return this.#r.toMMPattern();
1587
+ const t = this.toString(), [e, n, s, o] = this.toRegExpSource();
1588
+ if (!(s || this.#n || this.#s.nocase && !this.#s.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase())) return n;
1589
+ const i = (this.#s.nocase ? "i" : "") + (o ? "u" : "");
1590
+ return Object.assign(new RegExp(`^${e}$`, i), { _src: e, _glob: t });
1591
+ }
1592
+ get options() {
1593
+ return this.#s;
1594
+ }
1595
+ toRegExpSource(t) {
1596
+ const e = t ?? !!this.#s.dot;
1597
+ if (this.#r === this && this.#p(), !this.type) {
1598
+ const l = this.isStart() && this.isEnd(), c = this.#t.map(((h) => {
1599
+ const [d, g, p, m] = typeof h == "string" ? M.#g(h, this.#n, l) : h.toRegExpSource(t);
1600
+ return this.#n = this.#n || p, this.#o = this.#o || m, d;
1601
+ })).join("");
1602
+ let u = "";
1603
+ if (this.isStart() && typeof this.#t[0] == "string" && (this.#t.length !== 1 || !dn.has(this.#t[0]))) {
1604
+ const h = gn, d = e && h.has(c.charAt(0)) || c.startsWith("\\.") && h.has(c.charAt(2)) || c.startsWith("\\.\\.") && h.has(c.charAt(4)), g = !e && !t && h.has(c.charAt(0));
1605
+ u = d ? "(?!(?:^|/)\\.\\.?(?:$|/))" : g ? Bt : "";
1606
+ }
1607
+ let f = "";
1608
+ return this.isEnd() && this.#r.#a && this.#e?.type === "!" && (f = "(?:$|\\/)"), [u + c + f, Nt(c), this.#n = !!this.#n, this.#o];
1609
+ }
1610
+ const n = this.type === "*" || this.type === "+", s = this.type === "!" ? "(?:(?!(?:" : "(?:";
1611
+ let o = this.#f(e);
1612
+ if (this.isStart() && this.isEnd() && !o && this.type !== "!") {
1613
+ const l = this.toString();
1614
+ return this.#t = [l], this.type = null, this.#n = void 0, [l, Nt(this.toString()), !1, !1];
1615
+ }
1616
+ let i = !n || t || e ? "" : this.#f(!0);
1617
+ i === o && (i = ""), i && (o = `(?:${o})(?:${i})*?`);
1618
+ let a = "";
1619
+ return a = this.type === "!" && this.#h ? (this.isStart() && !e ? Bt : "") + Oe : s + o + (this.type === "!" ? "))" + (!this.isStart() || e || t ? "" : Bt) + Te + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && i ? ")" : this.type === "*" && i ? ")?" : `)${this.type}`), [a, Nt(o), this.#n = !!this.#n, this.#o];
1620
+ }
1621
+ #f(t) {
1622
+ return this.#t.map(((e) => {
1623
+ if (typeof e == "string") throw new Error("string type in extglob ast??");
1624
+ const [n, s, o, i] = e.toRegExpSource(t);
1625
+ return this.#o = this.#o || i, n;
1626
+ })).filter(((e) => !(this.isStart() && this.isEnd() && !e))).join("|");
1627
+ }
1628
+ static #g(t, e) {
1629
+ let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], s = !1, o = "", i = !1;
1630
+ for (let a = 0; a < t.length; a++) {
1631
+ const l = t.charAt(a);
1632
+ if (s) s = !1, o += (mn.has(l) ? "\\" : "") + l;
1633
+ else if (l !== "\\") {
1634
+ if (l === "[") {
1635
+ const [c, u, f, h] = fn(t, a);
1636
+ if (f) {
1637
+ o += c, i = i || u, a += f - 1, e = e || h;
1638
+ continue;
1639
+ }
1640
+ }
1641
+ l !== "*" ? l !== "?" ? o += l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") : (o += ie, e = !0) : (o += n && t === "*" ? Oe : Te, e = !0);
1642
+ } else a === t.length - 1 ? o += "\\\\" : s = !0;
1643
+ }
1644
+ return [o, Nt(t), !!e, i];
1645
+ }
1646
+ }
1647
+ const D = function(r, t) {
1648
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1649
+ return Rt(t), !(!e.nocomment && t.charAt(0) === "#") && new Lt(t, e).match(r);
1650
+ }, yn = /^\*+([^+@!?\*\[\(]*)$/, bn = (r) => (t) => !t.startsWith(".") && t.endsWith(r), vn = (r) => (t) => t.endsWith(r), wn = (r) => (r = r.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(r)), xn = (r) => (r = r.toLowerCase(), (t) => t.toLowerCase().endsWith(r)), Nn = /^\*+\.\*+$/, Pn = (r) => !r.startsWith(".") && r.includes("."), En = (r) => r !== "." && r !== ".." && r.includes("."), An = /^\.\*+$/, Tn = (r) => r !== "." && r !== ".." && r.startsWith("."), On = /^\*+$/, Sn = (r) => r.length !== 0 && !r.startsWith("."), Cn = (r) => r.length !== 0 && r !== "." && r !== "..", In = /^\?+([^+@!?\*\[\(]*)?$/, $n = (r) => {
1651
+ let [t, e = ""] = r;
1652
+ const n = tr([t]);
1653
+ return e ? (e = e.toLowerCase(), (s) => n(s) && s.toLowerCase().endsWith(e)) : n;
1654
+ }, Fn = (r) => {
1655
+ let [t, e = ""] = r;
1656
+ const n = er([t]);
1657
+ return e ? (e = e.toLowerCase(), (s) => n(s) && s.toLowerCase().endsWith(e)) : n;
1658
+ }, jn = (r) => {
1659
+ let [t, e = ""] = r;
1660
+ const n = er([t]);
1661
+ return e ? (s) => n(s) && s.endsWith(e) : n;
1662
+ }, Rn = (r) => {
1663
+ let [t, e = ""] = r;
1664
+ const n = tr([t]);
1665
+ return e ? (s) => n(s) && s.endsWith(e) : n;
1666
+ }, tr = (r) => {
1667
+ let [t] = r;
1668
+ const e = t.length;
1669
+ return (n) => n.length === e && !n.startsWith(".");
1670
+ }, er = (r) => {
1671
+ let [t] = r;
1672
+ const e = t.length;
1673
+ return (n) => n.length === e && n !== "." && n !== "..";
1674
+ }, rr = typeof it == "object" && it ? typeof it.env == "object" && it.env && it.env.__MINIMATCH_TESTING_PLATFORM__ || it.platform : "posix";
1675
+ D.sep = rr === "win32" ? "\\" : "/";
1676
+ const z = /* @__PURE__ */ Symbol("globstar **");
1677
+ D.GLOBSTAR = z, D.filter = function(r) {
1678
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1679
+ return (e) => D(e, r, t);
1680
+ };
1681
+ const G = function(r) {
1682
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1683
+ return Object.assign({}, r, t);
1684
+ };
1685
+ D.defaults = (r) => {
1686
+ if (!r || typeof r != "object" || !Object.keys(r).length) return D;
1687
+ const t = D;
1688
+ return Object.assign((function(e, n) {
1689
+ return t(e, n, G(r, arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}));
1690
+ }), { Minimatch: class extends t.Minimatch {
1691
+ constructor(e) {
1692
+ super(e, G(r, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}));
1693
+ }
1694
+ static defaults(e) {
1695
+ return t.defaults(G(r, e)).Minimatch;
1696
+ }
1697
+ }, AST: class extends t.AST {
1698
+ constructor(e, n) {
1699
+ super(e, n, G(r, arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}));
1700
+ }
1701
+ static fromGlob(e) {
1702
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1703
+ return t.AST.fromGlob(e, G(r, n));
1704
+ }
1705
+ }, unescape: function(e) {
1706
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1707
+ return t.unescape(e, G(r, n));
1708
+ }, escape: function(e) {
1709
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1710
+ return t.escape(e, G(r, n));
1711
+ }, filter: function(e) {
1712
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1713
+ return t.filter(e, G(r, n));
1714
+ }, defaults: (e) => t.defaults(G(r, e)), makeRe: function(e) {
1715
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1716
+ return t.makeRe(e, G(r, n));
1717
+ }, braceExpand: function(e) {
1718
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1719
+ return t.braceExpand(e, G(r, n));
1720
+ }, match: function(e, n) {
1721
+ let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1722
+ return t.match(e, n, G(r, s));
1723
+ }, sep: t.sep, GLOBSTAR: z });
1724
+ };
1725
+ const nr = function(r) {
1726
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1727
+ return Rt(r), t.nobrace || !/\{(?:(?!\{).)*\}/.test(r) ? [r] : cn(r);
1728
+ };
1729
+ D.braceExpand = nr, D.makeRe = function(r) {
1730
+ return new Lt(r, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}).makeRe();
1731
+ }, D.match = function(r, t) {
1732
+ const e = new Lt(t, arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {});
1733
+ return r = r.filter(((n) => e.match(n))), e.options.nonull && !r.length && r.push(t), r;
1734
+ };
1735
+ const Se = /[?*]|[+@!]\(.*?\)|\[|\]/;
1736
+ class Lt {
1737
+ options;
1738
+ set;
1739
+ pattern;
1740
+ windowsPathsNoEscape;
1741
+ nonegate;
1742
+ negate;
1743
+ comment;
1744
+ empty;
1745
+ preserveMultipleSlashes;
1746
+ partial;
1747
+ globSet;
1748
+ globParts;
1749
+ nocase;
1750
+ isWindows;
1751
+ platform;
1752
+ windowsNoMagicRoot;
1753
+ regexp;
1754
+ constructor(t) {
1755
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1756
+ Rt(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || rr, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !(!this.isWindows || !this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
1757
+ }
1758
+ hasMagic() {
1759
+ if (this.options.magicalBraces && this.set.length > 1) return !0;
1760
+ for (const t of this.set) for (const e of t) if (typeof e != "string") return !0;
1761
+ return !1;
1762
+ }
1763
+ debug() {
1764
+ }
1765
+ make() {
1766
+ const t = this.pattern, e = this.options;
1767
+ if (!e.nocomment && t.charAt(0) === "#") return void (this.comment = !0);
1768
+ if (!t) return void (this.empty = !0);
1769
+ this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = function() {
1770
+ return console.error(...arguments);
1771
+ }), this.debug(this.pattern, this.globSet);
1772
+ const n = this.globSet.map(((o) => this.slashSplit(o)));
1773
+ this.globParts = this.preprocess(n), this.debug(this.pattern, this.globParts);
1774
+ let s = this.globParts.map(((o, i, a) => {
1775
+ if (this.isWindows && this.windowsNoMagicRoot) {
1776
+ const l = !(o[0] !== "" || o[1] !== "" || o[2] !== "?" && Se.test(o[2]) || Se.test(o[3])), c = /^[a-z]:/i.test(o[0]);
1777
+ if (l) return [...o.slice(0, 4), ...o.slice(4).map(((u) => this.parse(u)))];
1778
+ if (c) return [o[0], ...o.slice(1).map(((u) => this.parse(u)))];
1779
+ }
1780
+ return o.map(((l) => this.parse(l)));
1781
+ }));
1782
+ if (this.debug(this.pattern, s), this.set = s.filter(((o) => o.indexOf(!1) === -1)), this.isWindows) for (let o = 0; o < this.set.length; o++) {
1783
+ const i = this.set[o];
1784
+ i[0] === "" && i[1] === "" && this.globParts[o][2] === "?" && typeof i[3] == "string" && /^[a-z]:$/i.test(i[3]) && (i[2] = "?");
1785
+ }
1786
+ this.debug(this.pattern, this.set);
1787
+ }
1788
+ preprocess(t) {
1789
+ if (this.options.noglobstar) for (let n = 0; n < t.length; n++) for (let s = 0; s < t[n].length; s++) t[n][s] === "**" && (t[n][s] = "*");
1790
+ const { optimizationLevel: e = 1 } = this.options;
1791
+ return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : t = e >= 1 ? this.levelOneOptimize(t) : this.adjascentGlobstarOptimize(t), t;
1792
+ }
1793
+ adjascentGlobstarOptimize(t) {
1794
+ return t.map(((e) => {
1795
+ let n = -1;
1796
+ for (; (n = e.indexOf("**", n + 1)) !== -1; ) {
1797
+ let s = n;
1798
+ for (; e[s + 1] === "**"; ) s++;
1799
+ s !== n && e.splice(n, s - n);
1800
+ }
1801
+ return e;
1802
+ }));
1803
+ }
1804
+ levelOneOptimize(t) {
1805
+ return t.map(((e) => (e = e.reduce(((n, s) => {
1806
+ const o = n[n.length - 1];
1807
+ return s === "**" && o === "**" ? n : s === ".." && o && o !== ".." && o !== "." && o !== "**" ? (n.pop(), n) : (n.push(s), n);
1808
+ }), [])).length === 0 ? [""] : e));
1809
+ }
1810
+ levelTwoFileOptimize(t) {
1811
+ Array.isArray(t) || (t = this.slashSplit(t));
1812
+ let e = !1;
1813
+ do {
1814
+ if (e = !1, !this.preserveMultipleSlashes) {
1815
+ for (let s = 1; s < t.length - 1; s++) {
1816
+ const o = t[s];
1817
+ s === 1 && o === "" && t[0] === "" || o !== "." && o !== "" || (e = !0, t.splice(s, 1), s--);
1818
+ }
1819
+ t[0] !== "." || t.length !== 2 || t[1] !== "." && t[1] !== "" || (e = !0, t.pop());
1820
+ }
1821
+ let n = 0;
1822
+ for (; (n = t.indexOf("..", n + 1)) !== -1; ) {
1823
+ const s = t[n - 1];
1824
+ s && s !== "." && s !== ".." && s !== "**" && (e = !0, t.splice(n - 1, 2), n -= 2);
1825
+ }
1826
+ } while (e);
1827
+ return t.length === 0 ? [""] : t;
1828
+ }
1829
+ firstPhasePreProcess(t) {
1830
+ let e = !1;
1831
+ do {
1832
+ e = !1;
1833
+ for (let n of t) {
1834
+ let s = -1;
1835
+ for (; (s = n.indexOf("**", s + 1)) !== -1; ) {
1836
+ let i = s;
1837
+ for (; n[i + 1] === "**"; ) i++;
1838
+ i > s && n.splice(s + 1, i - s);
1839
+ let a = n[s + 1];
1840
+ const l = n[s + 2], c = n[s + 3];
1841
+ if (a !== ".." || !l || l === "." || l === ".." || !c || c === "." || c === "..") continue;
1842
+ e = !0, n.splice(s, 1);
1843
+ const u = n.slice(0);
1844
+ u[s] = "**", t.push(u), s--;
1845
+ }
1846
+ if (!this.preserveMultipleSlashes) {
1847
+ for (let i = 1; i < n.length - 1; i++) {
1848
+ const a = n[i];
1849
+ i === 1 && a === "" && n[0] === "" || a !== "." && a !== "" || (e = !0, n.splice(i, 1), i--);
1850
+ }
1851
+ n[0] !== "." || n.length !== 2 || n[1] !== "." && n[1] !== "" || (e = !0, n.pop());
1852
+ }
1853
+ let o = 0;
1854
+ for (; (o = n.indexOf("..", o + 1)) !== -1; ) {
1855
+ const i = n[o - 1];
1856
+ if (i && i !== "." && i !== ".." && i !== "**") {
1857
+ e = !0;
1858
+ const a = o === 1 && n[o + 1] === "**" ? ["."] : [];
1859
+ n.splice(o - 1, 2, ...a), n.length === 0 && n.push(""), o -= 2;
1860
+ }
1861
+ }
1862
+ }
1863
+ } while (e);
1864
+ return t;
1865
+ }
1866
+ secondPhasePreProcess(t) {
1867
+ for (let e = 0; e < t.length - 1; e++) for (let n = e + 1; n < t.length; n++) {
1868
+ const s = this.partsMatch(t[e], t[n], !this.preserveMultipleSlashes);
1869
+ if (s) {
1870
+ t[e] = [], t[n] = s;
1871
+ break;
1872
+ }
1873
+ }
1874
+ return t.filter(((e) => e.length));
1875
+ }
1876
+ partsMatch(t, e) {
1877
+ let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], s = 0, o = 0, i = [], a = "";
1878
+ for (; s < t.length && o < e.length; ) if (t[s] === e[o]) i.push(a === "b" ? e[o] : t[s]), s++, o++;
1879
+ else if (n && t[s] === "**" && e[o] === t[s + 1]) i.push(t[s]), s++;
1880
+ else if (n && e[o] === "**" && t[s] === e[o + 1]) i.push(e[o]), o++;
1881
+ else if (t[s] !== "*" || !e[o] || !this.options.dot && e[o].startsWith(".") || e[o] === "**") {
1882
+ if (e[o] !== "*" || !t[s] || !this.options.dot && t[s].startsWith(".") || t[s] === "**" || a === "a") return !1;
1883
+ a = "b", i.push(e[o]), s++, o++;
1884
+ } else {
1885
+ if (a === "b") return !1;
1886
+ a = "a", i.push(t[s]), s++, o++;
1887
+ }
1888
+ return t.length === e.length && i;
1889
+ }
1890
+ parseNegate() {
1891
+ if (this.nonegate) return;
1892
+ const t = this.pattern;
1893
+ let e = !1, n = 0;
1894
+ for (let s = 0; s < t.length && t.charAt(s) === "!"; s++) e = !e, n++;
1895
+ n && (this.pattern = t.slice(n)), this.negate = e;
1896
+ }
1897
+ matchOne(t, e) {
1898
+ let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
1899
+ const s = this.options;
1900
+ if (this.isWindows) {
1901
+ const p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), m = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), b = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), y = m ? 3 : p ? 0 : void 0, v = !b && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]) ? 3 : b ? 0 : void 0;
1902
+ if (typeof y == "number" && typeof v == "number") {
1903
+ const [w, x] = [t[y], e[v]];
1904
+ w.toLowerCase() === x.toLowerCase() && (e[v] = w, v > y ? e = e.slice(v) : y > v && (t = t.slice(y)));
1905
+ }
1906
+ }
1907
+ const { optimizationLevel: o = 1 } = this.options;
1908
+ o >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
1909
+ for (var i = 0, a = 0, l = t.length, c = e.length; i < l && a < c; i++, a++) {
1910
+ this.debug("matchOne loop");
1911
+ var u = e[a], f = t[i];
1912
+ if (this.debug(e, u, f), u === !1) return !1;
1913
+ if (u === z) {
1914
+ this.debug("GLOBSTAR", [e, u, f]);
1915
+ var h = i, d = a + 1;
1916
+ if (d === c) {
1917
+ for (this.debug("** at the end"); i < l; i++) if (t[i] === "." || t[i] === ".." || !s.dot && t[i].charAt(0) === ".") return !1;
1918
+ return !0;
1919
+ }
1920
+ for (; h < l; ) {
1921
+ var g = t[h];
1922
+ if (this.debug(`
1923
+ globstar while`, t, h, e, d, g), this.matchOne(t.slice(h), e.slice(d), n)) return this.debug("globstar found match!", h, l, g), !0;
1924
+ if (g === "." || g === ".." || !s.dot && g.charAt(0) === ".") {
1925
+ this.debug("dot detected!", t, h, e, d);
1926
+ break;
1927
+ }
1928
+ this.debug("globstar swallow a segment, and continue"), h++;
1929
+ }
1930
+ return !(!n || (this.debug(`
1931
+ >>> no match, partial?`, t, h, e, d), h !== l));
1932
+ }
1933
+ let p;
1934
+ if (typeof u == "string" ? (p = f === u, this.debug("string match", u, f, p)) : (p = u.test(f), this.debug("pattern match", u, f, p)), !p) return !1;
1935
+ }
1936
+ if (i === l && a === c) return !0;
1937
+ if (i === l) return n;
1938
+ if (a === c) return i === l - 1 && t[i] === "";
1939
+ throw new Error("wtf?");
1940
+ }
1941
+ braceExpand() {
1942
+ return nr(this.pattern, this.options);
1943
+ }
1944
+ parse(t) {
1945
+ Rt(t);
1946
+ const e = this.options;
1947
+ if (t === "**") return z;
1948
+ if (t === "") return "";
1949
+ let n, s = null;
1950
+ (n = t.match(On)) ? s = e.dot ? Cn : Sn : (n = t.match(yn)) ? s = (e.nocase ? e.dot ? xn : wn : e.dot ? vn : bn)(n[1]) : (n = t.match(In)) ? s = (e.nocase ? e.dot ? Fn : $n : e.dot ? jn : Rn)(n) : (n = t.match(Nn)) ? s = e.dot ? En : Pn : (n = t.match(An)) && (s = Tn);
1951
+ const o = M.fromGlob(t, this.options).toMMPattern();
1952
+ return s && typeof o == "object" && Reflect.defineProperty(o, "test", { value: s }), o;
1953
+ }
1954
+ makeRe() {
1955
+ if (this.regexp || this.regexp === !1) return this.regexp;
1956
+ const t = this.set;
1957
+ if (!t.length) return this.regexp = !1, this.regexp;
1958
+ const e = this.options, n = e.noglobstar ? "[^/]*?" : e.dot ? "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?" : "(?:(?!(?:\\/|^)\\.).)*?", s = new Set(e.nocase ? ["i"] : []);
1959
+ let o = t.map(((l) => {
1960
+ const c = l.map(((u) => {
1961
+ if (u instanceof RegExp) for (const f of u.flags.split("")) s.add(f);
1962
+ return typeof u == "string" ? u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") : u === z ? z : u._src;
1963
+ }));
1964
+ return c.forEach(((u, f) => {
1965
+ const h = c[f + 1], d = c[f - 1];
1966
+ u === z && d !== z && (d === void 0 ? h !== void 0 && h !== z ? c[f + 1] = "(?:\\/|" + n + "\\/)?" + h : c[f] = n : h === void 0 ? c[f - 1] = d + "(?:\\/|" + n + ")?" : h !== z && (c[f - 1] = d + "(?:\\/|\\/" + n + "\\/)" + h, c[f + 1] = z));
1967
+ })), c.filter(((u) => u !== z)).join("/");
1968
+ })).join("|");
1969
+ const [i, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
1970
+ o = "^" + i + o + a + "$", this.negate && (o = "^(?!" + o + ").+$");
1971
+ try {
1972
+ this.regexp = new RegExp(o, [...s].join(""));
1973
+ } catch {
1974
+ this.regexp = !1;
1975
+ }
1976
+ return this.regexp;
1977
+ }
1978
+ slashSplit(t) {
1979
+ return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/);
1980
+ }
1981
+ match(t) {
1982
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.partial;
1983
+ if (this.debug("match", t, this.pattern), this.comment) return !1;
1984
+ if (this.empty) return t === "";
1985
+ if (t === "/" && e) return !0;
1986
+ const n = this.options;
1987
+ this.isWindows && (t = t.split("\\").join("/"));
1988
+ const s = this.slashSplit(t);
1989
+ this.debug(this.pattern, "split", s);
1990
+ const o = this.set;
1991
+ this.debug(this.pattern, "set", o);
1992
+ let i = s[s.length - 1];
1993
+ if (!i) for (let a = s.length - 2; !i && a >= 0; a--) i = s[a];
1994
+ for (let a = 0; a < o.length; a++) {
1995
+ const l = o[a];
1996
+ let c = s;
1997
+ if (n.matchBase && l.length === 1 && (c = [i]), this.matchOne(c, l, e)) return !!n.flipNegate || !this.negate;
1998
+ }
1999
+ return !n.flipNegate && this.negate;
2000
+ }
2001
+ static defaults(t) {
2002
+ return D.defaults(t).Minimatch;
2003
+ }
2004
+ }
2005
+ function ae(r) {
2006
+ const t = new Error(`${arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""}Invalid response: ${r.status} ${r.statusText}`);
2007
+ return t.status = r.status, t.response = r, t;
2008
+ }
2009
+ function L(r, t) {
2010
+ const { status: e } = t;
2011
+ if (e === 401 && r.digest) return t;
2012
+ if (e >= 400) throw ae(t);
2013
+ return t;
2014
+ }
2015
+ function pt(r, t) {
2016
+ return arguments.length > 2 && arguments[2] !== void 0 && arguments[2] ? { data: t, headers: r.headers ? on(r.headers) : {}, status: r.status, statusText: r.statusText } : t;
2017
+ }
2018
+ D.AST = M, D.Minimatch = Lt, D.escape = function(r) {
2019
+ let { windowsPathsNoEscape: t = !1 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2020
+ return t ? r.replace(/[?*()[\]]/g, "[$&]") : r.replace(/[?*()[\]\\]/g, "\\$&");
2021
+ }, D.unescape = Nt;
2022
+ const Ln = (Ce = function(r, t, e) {
2023
+ let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
2024
+ const s = R({ url: C(r.remoteURL, S(t)), method: "COPY", headers: { Destination: C(r.remoteURL, S(e)), Overwrite: n.overwrite === !1 ? "F" : "T", Depth: n.shallow ? "0" : "infinity" } }, r, n);
2025
+ return i = function(a) {
2026
+ L(r, a);
2027
+ }, (o = j(s, r)) && o.then || (o = Promise.resolve(o)), i ? o.then(i) : o;
2028
+ var o, i;
2029
+ }, function() {
2030
+ for (var r = [], t = 0; t < arguments.length; t++) r[t] = arguments[t];
2031
+ try {
2032
+ return Promise.resolve(Ce.apply(this, r));
2033
+ } catch (e) {
2034
+ return Promise.reject(e);
2035
+ }
2036
+ });
2037
+ var Ce;
2038
+ const Un = { preserveOrder: !1, attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, removeNSPrefix: !1, allowBooleanAttributes: !1, parseTagValue: !0, parseAttributeValue: !1, trimValues: !0, cdataPropName: !1, numberParseOptions: { hex: !0, leadingZeros: !0, eNotation: !0 }, tagValueProcessor: function(r, t) {
2039
+ return t;
2040
+ }, attributeValueProcessor: function(r, t) {
2041
+ return t;
2042
+ }, stopNodes: [], alwaysCreateTextNode: !1, isArray: () => !1, commentPropName: !1, unpairedTags: [], processEntities: !0, htmlEntities: !1, ignoreDeclaration: !1, ignorePiTags: !1, transformTagName: !1, transformAttributeName: !1, updateTag: function(r, t, e) {
2043
+ return r;
2044
+ }, captureMetaData: !1 }, Ie = ":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", Dn = new RegExp("^[" + Ie + "][" + Ie + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");
2045
+ function sr(r, t) {
2046
+ const e = [];
2047
+ let n = t.exec(r);
2048
+ for (; n; ) {
2049
+ const s = [];
2050
+ s.startIndex = t.lastIndex - n[0].length;
2051
+ const o = n.length;
2052
+ for (let i = 0; i < o; i++) s.push(n[i]);
2053
+ e.push(s), n = t.exec(r);
2054
+ }
2055
+ return e;
2056
+ }
2057
+ const Dt = function(r) {
2058
+ return Dn.exec(r) != null;
2059
+ };
2060
+ let Qt;
2061
+ Qt = typeof Symbol != "function" ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata");
2062
+ class at {
2063
+ constructor(t) {
2064
+ this.tagname = t, this.child = [], this[":@"] = {};
2065
+ }
2066
+ add(t, e) {
2067
+ t === "__proto__" && (t = "#__proto__"), this.child.push({ [t]: e });
2068
+ }
2069
+ addChild(t, e) {
2070
+ t.tagname === "__proto__" && (t.tagname = "#__proto__"), t[":@"] && Object.keys(t[":@"]).length > 0 ? this.child.push({ [t.tagname]: t.child, ":@": t[":@"] }) : this.child.push({ [t.tagname]: t.child }), e !== void 0 && (this.child[this.child.length - 1][Qt] = { startIndex: e });
2071
+ }
2072
+ static getMetaDataSymbol() {
2073
+ return Qt;
2074
+ }
2075
+ }
2076
+ class kn {
2077
+ constructor(t) {
2078
+ this.suppressValidationErr = !t;
2079
+ }
2080
+ readDocType(t, e) {
2081
+ const n = {};
2082
+ if (t[e + 3] !== "O" || t[e + 4] !== "C" || t[e + 5] !== "T" || t[e + 6] !== "Y" || t[e + 7] !== "P" || t[e + 8] !== "E") throw new Error("Invalid Tag instead of DOCTYPE");
2083
+ {
2084
+ e += 9;
2085
+ let s = 1, o = !1, i = !1, a = "";
2086
+ for (; e < t.length; e++) if (t[e] !== "<" || i) if (t[e] === ">") {
2087
+ if (i ? t[e - 1] === "-" && t[e - 2] === "-" && (i = !1, s--) : s--, s === 0) break;
2088
+ } else t[e] === "[" ? o = !0 : a += t[e];
2089
+ else {
2090
+ if (o && ot(t, "!ENTITY", e)) {
2091
+ let l, c;
2092
+ e += 7, [l, c, e] = this.readEntityExp(t, e + 1, this.suppressValidationErr), c.indexOf("&") === -1 && (n[l] = { regx: RegExp(`&${l};`, "g"), val: c });
2093
+ } else if (o && ot(t, "!ELEMENT", e)) {
2094
+ e += 8;
2095
+ const { index: l } = this.readElementExp(t, e + 1);
2096
+ e = l;
2097
+ } else if (o && ot(t, "!ATTLIST", e)) e += 8;
2098
+ else if (o && ot(t, "!NOTATION", e)) {
2099
+ e += 9;
2100
+ const { index: l } = this.readNotationExp(t, e + 1, this.suppressValidationErr);
2101
+ e = l;
2102
+ } else {
2103
+ if (!ot(t, "!--", e)) throw new Error("Invalid DOCTYPE");
2104
+ i = !0;
2105
+ }
2106
+ s++, a = "";
2107
+ }
2108
+ if (s !== 0) throw new Error("Unclosed DOCTYPE");
2109
+ }
2110
+ return { entities: n, i: e };
2111
+ }
2112
+ readEntityExp(t, e) {
2113
+ e = B(t, e);
2114
+ let n = "";
2115
+ for (; e < t.length && !/\s/.test(t[e]) && t[e] !== '"' && t[e] !== "'"; ) n += t[e], e++;
2116
+ if (wt(n), e = B(t, e), !this.suppressValidationErr) {
2117
+ if (t.substring(e, e + 6).toUpperCase() === "SYSTEM") throw new Error("External entities are not supported");
2118
+ if (t[e] === "%") throw new Error("Parameter entities are not supported");
2119
+ }
2120
+ let s = "";
2121
+ return [e, s] = this.readIdentifierVal(t, e, "entity"), [n, s, --e];
2122
+ }
2123
+ readNotationExp(t, e) {
2124
+ e = B(t, e);
2125
+ let n = "";
2126
+ for (; e < t.length && !/\s/.test(t[e]); ) n += t[e], e++;
2127
+ !this.suppressValidationErr && wt(n), e = B(t, e);
2128
+ const s = t.substring(e, e + 6).toUpperCase();
2129
+ if (!this.suppressValidationErr && s !== "SYSTEM" && s !== "PUBLIC") throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);
2130
+ e += s.length, e = B(t, e);
2131
+ let o = null, i = null;
2132
+ if (s === "PUBLIC") [e, o] = this.readIdentifierVal(t, e, "publicIdentifier"), t[e = B(t, e)] !== '"' && t[e] !== "'" || ([e, i] = this.readIdentifierVal(t, e, "systemIdentifier"));
2133
+ else if (s === "SYSTEM" && ([e, i] = this.readIdentifierVal(t, e, "systemIdentifier"), !this.suppressValidationErr && !i)) throw new Error("Missing mandatory system identifier for SYSTEM notation");
2134
+ return { notationName: n, publicIdentifier: o, systemIdentifier: i, index: --e };
2135
+ }
2136
+ readIdentifierVal(t, e, n) {
2137
+ let s = "";
2138
+ const o = t[e];
2139
+ if (o !== '"' && o !== "'") throw new Error(`Expected quoted string, found "${o}"`);
2140
+ for (e++; e < t.length && t[e] !== o; ) s += t[e], e++;
2141
+ if (t[e] !== o) throw new Error(`Unterminated ${n} value`);
2142
+ return [++e, s];
2143
+ }
2144
+ readElementExp(t, e) {
2145
+ e = B(t, e);
2146
+ let n = "";
2147
+ for (; e < t.length && !/\s/.test(t[e]); ) n += t[e], e++;
2148
+ if (!this.suppressValidationErr && !Dt(n)) throw new Error(`Invalid element name: "${n}"`);
2149
+ let s = "";
2150
+ if (t[e = B(t, e)] === "E" && ot(t, "MPTY", e)) e += 4;
2151
+ else if (t[e] === "A" && ot(t, "NY", e)) e += 2;
2152
+ else if (t[e] === "(") {
2153
+ for (e++; e < t.length && t[e] !== ")"; ) s += t[e], e++;
2154
+ if (t[e] !== ")") throw new Error("Unterminated content model");
2155
+ } else if (!this.suppressValidationErr) throw new Error(`Invalid Element Expression, found "${t[e]}"`);
2156
+ return { elementName: n, contentModel: s.trim(), index: e };
2157
+ }
2158
+ readAttlistExp(t, e) {
2159
+ e = B(t, e);
2160
+ let n = "";
2161
+ for (; e < t.length && !/\s/.test(t[e]); ) n += t[e], e++;
2162
+ wt(n), e = B(t, e);
2163
+ let s = "";
2164
+ for (; e < t.length && !/\s/.test(t[e]); ) s += t[e], e++;
2165
+ if (!wt(s)) throw new Error(`Invalid attribute name: "${s}"`);
2166
+ e = B(t, e);
2167
+ let o = "";
2168
+ if (t.substring(e, e + 8).toUpperCase() === "NOTATION") {
2169
+ if (o = "NOTATION", t[e = B(t, e += 8)] !== "(") throw new Error(`Expected '(', found "${t[e]}"`);
2170
+ e++;
2171
+ let a = [];
2172
+ for (; e < t.length && t[e] !== ")"; ) {
2173
+ let l = "";
2174
+ for (; e < t.length && t[e] !== "|" && t[e] !== ")"; ) l += t[e], e++;
2175
+ if (l = l.trim(), !wt(l)) throw new Error(`Invalid notation name: "${l}"`);
2176
+ a.push(l), t[e] === "|" && (e++, e = B(t, e));
2177
+ }
2178
+ if (t[e] !== ")") throw new Error("Unterminated list of notations");
2179
+ e++, o += " (" + a.join("|") + ")";
2180
+ } else {
2181
+ for (; e < t.length && !/\s/.test(t[e]); ) o += t[e], e++;
2182
+ const a = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
2183
+ if (!this.suppressValidationErr && !a.includes(o.toUpperCase())) throw new Error(`Invalid attribute type: "${o}"`);
2184
+ }
2185
+ e = B(t, e);
2186
+ let i = "";
2187
+ return t.substring(e, e + 8).toUpperCase() === "#REQUIRED" ? (i = "#REQUIRED", e += 8) : t.substring(e, e + 7).toUpperCase() === "#IMPLIED" ? (i = "#IMPLIED", e += 7) : [e, i] = this.readIdentifierVal(t, e, "ATTLIST"), { elementName: n, attributeName: s, attributeType: o, defaultValue: i, index: e };
2188
+ }
2189
+ }
2190
+ const B = (r, t) => {
2191
+ for (; t < r.length && /\s/.test(r[t]); ) t++;
2192
+ return t;
2193
+ };
2194
+ function ot(r, t, e) {
2195
+ for (let n = 0; n < t.length; n++) if (t[n] !== r[e + n + 1]) return !1;
2196
+ return !0;
2197
+ }
2198
+ function wt(r) {
2199
+ if (Dt(r)) return r;
2200
+ throw new Error(`Invalid entity name ${r}`);
2201
+ }
2202
+ const Mn = /^[-+]?0x[a-fA-F0-9]+$/, _n = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Vn = { hex: !0, leadingZeros: !0, decimalPoint: ".", eNotation: !0 }, Bn = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
2203
+ function or(r) {
2204
+ return typeof r == "function" ? r : Array.isArray(r) ? (t) => {
2205
+ for (const e of r)
2206
+ if (typeof e == "string" && t === e || e instanceof RegExp && e.test(t)) return !0;
2207
+ } : () => !1;
2208
+ }
2209
+ class Wn {
2210
+ constructor(t) {
2211
+ if (this.options = t, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "¢" }, pound: { regex: /&(pound|#163);/g, val: "£" }, yen: { regex: /&(yen|#165);/g, val: "¥" }, euro: { regex: /&(euro|#8364);/g, val: "€" }, copyright: { regex: /&(copy|#169);/g, val: "©" }, reg: { regex: /&(reg|#174);/g, val: "®" }, inr: { regex: /&(inr|#8377);/g, val: "₹" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (e, n) => $e(n, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (e, n) => $e(n, 16, "&#x") } }, this.addExternalEntities = qn, this.parseXml = Yn, this.parseTextData = Gn, this.resolveNameSpace = zn, this.buildAttributesMap = Xn, this.isItStopNode = Qn, this.replaceEntitiesValue = Jn, this.readStopNodeData = ts, this.saveTextToParentTag = Kn, this.addChild = Zn, this.ignoreAttributesFn = or(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) {
2212
+ this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set();
2213
+ for (let e = 0; e < this.options.stopNodes.length; e++) {
2214
+ const n = this.options.stopNodes[e];
2215
+ typeof n == "string" && (n.startsWith("*.") ? this.stopNodesWildcard.add(n.substring(2)) : this.stopNodesExact.add(n));
2216
+ }
2217
+ }
2218
+ }
2219
+ }
2220
+ function qn(r) {
2221
+ const t = Object.keys(r);
2222
+ for (let e = 0; e < t.length; e++) {
2223
+ const n = t[e];
2224
+ this.lastEntities[n] = { regex: new RegExp("&" + n + ";", "g"), val: r[n] };
2225
+ }
2226
+ }
2227
+ function Gn(r, t, e, n, s, o, i) {
2228
+ if (r !== void 0 && (this.options.trimValues && !n && (r = r.trim()), r.length > 0)) {
2229
+ i || (r = this.replaceEntitiesValue(r));
2230
+ const a = this.options.tagValueProcessor(t, r, e, s, o);
2231
+ return a == null ? r : typeof a != typeof r || a !== r ? a : this.options.trimValues || r.trim() === r ? ir(r, this.options.parseTagValue, this.options.numberParseOptions) : r;
2232
+ }
2233
+ }
2234
+ function zn(r) {
2235
+ if (this.options.removeNSPrefix) {
2236
+ const t = r.split(":"), e = r.charAt(0) === "/" ? "/" : "";
2237
+ if (t[0] === "xmlns") return "";
2238
+ t.length === 2 && (r = e + t[1]);
2239
+ }
2240
+ return r;
2241
+ }
2242
+ const Hn = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
2243
+ function Xn(r, t) {
2244
+ if (this.options.ignoreAttributes !== !0 && typeof r == "string") {
2245
+ const e = sr(r, Hn), n = e.length, s = {};
2246
+ for (let o = 0; o < n; o++) {
2247
+ const i = this.resolveNameSpace(e[o][1]);
2248
+ if (this.ignoreAttributesFn(i, t)) continue;
2249
+ let a = e[o][4], l = this.options.attributeNamePrefix + i;
2250
+ if (i.length) if (this.options.transformAttributeName && (l = this.options.transformAttributeName(l)), l === "__proto__" && (l = "#__proto__"), a !== void 0) {
2251
+ this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
2252
+ const c = this.options.attributeValueProcessor(i, a, t);
2253
+ s[l] = c == null ? a : typeof c != typeof a || c !== a ? c : ir(a, this.options.parseAttributeValue, this.options.numberParseOptions);
2254
+ } else this.options.allowBooleanAttributes && (s[l] = !0);
2255
+ }
2256
+ if (!Object.keys(s).length) return;
2257
+ if (this.options.attributesGroupName) {
2258
+ const o = {};
2259
+ return o[this.options.attributesGroupName] = s, o;
2260
+ }
2261
+ return s;
2262
+ }
2263
+ }
2264
+ const Yn = function(r) {
2265
+ r = r.replace(/\r\n?/g, `
2266
+ `);
2267
+ const t = new at("!xml");
2268
+ let e = t, n = "", s = "";
2269
+ const o = new kn(this.options.processEntities);
2270
+ for (let i = 0; i < r.length; i++) if (r[i] === "<") if (r[i + 1] === "/") {
2271
+ const a = ut(r, ">", i, "Closing Tag is not closed.");
2272
+ let l = r.substring(i + 2, a).trim();
2273
+ if (this.options.removeNSPrefix) {
2274
+ const f = l.indexOf(":");
2275
+ f !== -1 && (l = l.substr(f + 1));
2276
+ }
2277
+ this.options.transformTagName && (l = this.options.transformTagName(l)), e && (n = this.saveTextToParentTag(n, e, s));
2278
+ const c = s.substring(s.lastIndexOf(".") + 1);
2279
+ if (l && this.options.unpairedTags.indexOf(l) !== -1) throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`);
2280
+ let u = 0;
2281
+ c && this.options.unpairedTags.indexOf(c) !== -1 ? (u = s.lastIndexOf(".", s.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : u = s.lastIndexOf("."), s = s.substring(0, u), e = this.tagsNodeStack.pop(), n = "", i = a;
2282
+ } else if (r[i + 1] === "?") {
2283
+ let a = te(r, i, !1, "?>");
2284
+ if (!a) throw new Error("Pi Tag is not closed.");
2285
+ if (n = this.saveTextToParentTag(n, e, s), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
2286
+ const l = new at(a.tagName);
2287
+ l.add(this.options.textNodeName, ""), a.tagName !== a.tagExp && a.attrExpPresent && (l[":@"] = this.buildAttributesMap(a.tagExp, s)), this.addChild(e, l, s, i);
2288
+ }
2289
+ i = a.closeIndex + 1;
2290
+ } else if (r.substr(i + 1, 3) === "!--") {
2291
+ const a = ut(r, "-->", i + 4, "Comment is not closed.");
2292
+ if (this.options.commentPropName) {
2293
+ const l = r.substring(i + 4, a - 2);
2294
+ n = this.saveTextToParentTag(n, e, s), e.add(this.options.commentPropName, [{ [this.options.textNodeName]: l }]);
2295
+ }
2296
+ i = a;
2297
+ } else if (r.substr(i + 1, 2) === "!D") {
2298
+ const a = o.readDocType(r, i);
2299
+ this.docTypeEntities = a.entities, i = a.i;
2300
+ } else if (r.substr(i + 1, 2) === "![") {
2301
+ const a = ut(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
2302
+ n = this.saveTextToParentTag(n, e, s);
2303
+ let c = this.parseTextData(l, e.tagname, s, !0, !1, !0, !0);
2304
+ c == null && (c = ""), this.options.cdataPropName ? e.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : e.add(this.options.textNodeName, c), i = a + 2;
2305
+ } else {
2306
+ let a = te(r, i, this.options.removeNSPrefix), l = a.tagName;
2307
+ const c = a.rawTagName;
2308
+ let u = a.tagExp, f = a.attrExpPresent, h = a.closeIndex;
2309
+ if (this.options.transformTagName) {
2310
+ const p = this.options.transformTagName(l);
2311
+ u === l && (u = p), l = p;
2312
+ }
2313
+ e && n && e.tagname !== "!xml" && (n = this.saveTextToParentTag(n, e, s, !1));
2314
+ const d = e;
2315
+ d && this.options.unpairedTags.indexOf(d.tagname) !== -1 && (e = this.tagsNodeStack.pop(), s = s.substring(0, s.lastIndexOf("."))), l !== t.tagname && (s += s ? "." + l : l);
2316
+ const g = i;
2317
+ if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s, l)) {
2318
+ let p = "";
2319
+ if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), s = s.substr(0, s.length - 1), u = l) : u = u.substr(0, u.length - 1), i = a.closeIndex;
2320
+ else if (this.options.unpairedTags.indexOf(l) !== -1) i = a.closeIndex;
2321
+ else {
2322
+ const b = this.readStopNodeData(r, c, h + 1);
2323
+ if (!b) throw new Error(`Unexpected end of ${c}`);
2324
+ i = b.i, p = b.tagContent;
2325
+ }
2326
+ const m = new at(l);
2327
+ l !== u && f && (m[":@"] = this.buildAttributesMap(u, s)), p && (p = this.parseTextData(p, l, s, !0, f, !0, !0)), s = s.substr(0, s.lastIndexOf(".")), m.add(this.options.textNodeName, p), this.addChild(e, m, s, g);
2328
+ } else {
2329
+ if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
2330
+ if (l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), s = s.substr(0, s.length - 1), u = l) : u = u.substr(0, u.length - 1), this.options.transformTagName) {
2331
+ const m = this.options.transformTagName(l);
2332
+ u === l && (u = m), l = m;
2333
+ }
2334
+ const p = new at(l);
2335
+ l !== u && f && (p[":@"] = this.buildAttributesMap(u, s)), this.addChild(e, p, s, g), s = s.substr(0, s.lastIndexOf("."));
2336
+ } else {
2337
+ const p = new at(l);
2338
+ this.tagsNodeStack.push(e), l !== u && f && (p[":@"] = this.buildAttributesMap(u, s)), this.addChild(e, p, s, g), e = p;
2339
+ }
2340
+ n = "", i = h;
2341
+ }
2342
+ }
2343
+ else n += r[i];
2344
+ return t.child;
2345
+ };
2346
+ function Zn(r, t, e, n) {
2347
+ this.options.captureMetaData || (n = void 0);
2348
+ const s = this.options.updateTag(t.tagname, e, t[":@"]);
2349
+ s === !1 || (typeof s == "string" && (t.tagname = s), r.addChild(t, n));
2350
+ }
2351
+ const Jn = function(r) {
2352
+ if (this.options.processEntities) {
2353
+ for (let t in this.docTypeEntities) {
2354
+ const e = this.docTypeEntities[t];
2355
+ r = r.replace(e.regx, e.val);
2356
+ }
2357
+ for (let t in this.lastEntities) {
2358
+ const e = this.lastEntities[t];
2359
+ r = r.replace(e.regex, e.val);
2360
+ }
2361
+ if (this.options.htmlEntities) for (let t in this.htmlEntities) {
2362
+ const e = this.htmlEntities[t];
2363
+ r = r.replace(e.regex, e.val);
2364
+ }
2365
+ r = r.replace(this.ampEntity.regex, this.ampEntity.val);
2366
+ }
2367
+ return r;
2368
+ };
2369
+ function Kn(r, t, e, n) {
2370
+ return r && (n === void 0 && (n = t.child.length === 0), (r = this.parseTextData(r, t.tagname, e, !1, !!t[":@"] && Object.keys(t[":@"]).length !== 0, n)) !== void 0 && r !== "" && t.add(this.options.textNodeName, r), r = ""), r;
2371
+ }
2372
+ function Qn(r, t, e, n) {
2373
+ return !(!t || !t.has(n)) || !(!r || !r.has(e));
2374
+ }
2375
+ function ut(r, t, e, n) {
2376
+ const s = r.indexOf(t, e);
2377
+ if (s === -1) throw new Error(n);
2378
+ return s + t.length - 1;
2379
+ }
2380
+ function te(r, t, e) {
2381
+ const n = (function(u, f) {
2382
+ let h, d = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ">", g = "";
2383
+ for (let p = f; p < u.length; p++) {
2384
+ let m = u[p];
2385
+ if (h) m === h && (h = "");
2386
+ else if (m === '"' || m === "'") h = m;
2387
+ else if (m === d[0]) {
2388
+ if (!d[1]) return { data: g, index: p };
2389
+ if (u[p + 1] === d[1]) return { data: g, index: p };
2390
+ } else m === " " && (m = " ");
2391
+ g += m;
2392
+ }
2393
+ })(r, t + 1, arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ">");
2394
+ if (!n) return;
2395
+ let s = n.data;
2396
+ const o = n.index, i = s.search(/\s/);
2397
+ let a = s, l = !0;
2398
+ i !== -1 && (a = s.substring(0, i), s = s.substring(i + 1).trimStart());
2399
+ const c = a;
2400
+ if (e) {
2401
+ const u = a.indexOf(":");
2402
+ u !== -1 && (a = a.substr(u + 1), l = a !== n.data.substr(u + 1));
2403
+ }
2404
+ return { tagName: a, tagExp: s, closeIndex: o, attrExpPresent: l, rawTagName: c };
2405
+ }
2406
+ function ts(r, t, e) {
2407
+ const n = e;
2408
+ let s = 1;
2409
+ for (; e < r.length; e++) if (r[e] === "<") if (r[e + 1] === "/") {
2410
+ const o = ut(r, ">", e, `${t} is not closed`);
2411
+ if (r.substring(e + 2, o).trim() === t && (s--, s === 0)) return { tagContent: r.substring(n, e), i: o };
2412
+ e = o;
2413
+ } else if (r[e + 1] === "?") e = ut(r, "?>", e + 1, "StopNode is not closed.");
2414
+ else if (r.substr(e + 1, 3) === "!--") e = ut(r, "-->", e + 3, "StopNode is not closed.");
2415
+ else if (r.substr(e + 1, 2) === "![") e = ut(r, "]]>", e, "StopNode is not closed.") - 2;
2416
+ else {
2417
+ const o = te(r, e, ">");
2418
+ o && ((o && o.tagName) === t && o.tagExp[o.tagExp.length - 1] !== "/" && s++, e = o.closeIndex);
2419
+ }
2420
+ }
2421
+ function ir(r, t, e) {
2422
+ if (t && typeof r == "string") {
2423
+ const n = r.trim();
2424
+ return n === "true" || n !== "false" && (function(s) {
2425
+ let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2426
+ if (o = Object.assign({}, Vn, o), !s || typeof s != "string") return s;
2427
+ let i = s.trim();
2428
+ if (o.skipLike !== void 0 && o.skipLike.test(i)) return s;
2429
+ if (s === "0") return 0;
2430
+ if (o.hex && Mn.test(i)) return (function(l) {
2431
+ if (parseInt) return parseInt(l, 16);
2432
+ if (Number.parseInt) return Number.parseInt(l, 16);
2433
+ if (window && window.parseInt) return window.parseInt(l, 16);
2434
+ throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
2435
+ })(i);
2436
+ if (i.includes("e") || i.includes("E")) return (function(l, c, u) {
2437
+ if (!u.eNotation) return l;
2438
+ const f = c.match(Bn);
2439
+ if (f) {
2440
+ let h = f[1] || "";
2441
+ const d = f[3].indexOf("e") === -1 ? "E" : "e", g = f[2], p = h ? l[g.length + 1] === d : l[g.length] === d;
2442
+ return g.length > 1 && p ? l : g.length !== 1 || !f[3].startsWith(`.${d}`) && f[3][0] !== d ? u.leadingZeros && !p ? (c = (f[1] || "") + f[3], Number(c)) : l : Number(c);
2443
+ }
2444
+ return l;
2445
+ })(s, i, o);
2446
+ {
2447
+ const l = _n.exec(i);
2448
+ if (l) {
2449
+ const c = l[1] || "", u = l[2];
2450
+ let f = ((a = l[3]) && a.indexOf(".") !== -1 && ((a = a.replace(/0+$/, "")) === "." ? a = "0" : a[0] === "." ? a = "0" + a : a[a.length - 1] === "." && (a = a.substring(0, a.length - 1))), a);
2451
+ const h = c ? s[u.length + 1] === "." : s[u.length] === ".";
2452
+ if (!o.leadingZeros && (u.length > 1 || u.length === 1 && !h)) return s;
2453
+ {
2454
+ const d = Number(i), g = String(d);
2455
+ if (d === 0) return d;
2456
+ if (g.search(/[eE]/) !== -1) return o.eNotation ? d : s;
2457
+ if (i.indexOf(".") !== -1) return g === "0" || g === f || g === `${c}${f}` ? d : s;
2458
+ let p = u ? f : i;
2459
+ return u ? p === g || c + p === g ? d : s : p === g || p === c + g ? d : s;
2460
+ }
2461
+ }
2462
+ return s;
2463
+ }
2464
+ var a;
2465
+ })(r, e);
2466
+ }
2467
+ return r !== void 0 ? r : "";
2468
+ }
2469
+ function $e(r, t, e) {
2470
+ const n = Number.parseInt(r, t);
2471
+ return n >= 0 && n <= 1114111 ? String.fromCodePoint(n) : e + r + ";";
2472
+ }
2473
+ const Wt = at.getMetaDataSymbol();
2474
+ function es(r, t) {
2475
+ return ar(r, t);
2476
+ }
2477
+ function ar(r, t, e) {
2478
+ let n;
2479
+ const s = {};
2480
+ for (let o = 0; o < r.length; o++) {
2481
+ const i = r[o], a = rs(i);
2482
+ let l = "";
2483
+ if (l = e === void 0 ? a : e + "." + a, a === t.textNodeName) n === void 0 ? n = i[a] : n += "" + i[a];
2484
+ else {
2485
+ if (a === void 0) continue;
2486
+ if (i[a]) {
2487
+ let c = ar(i[a], t, l);
2488
+ const u = ss(c, t);
2489
+ i[Wt] !== void 0 && (c[Wt] = i[Wt]), i[":@"] ? ns(c, i[":@"], l, t) : Object.keys(c).length !== 1 || c[t.textNodeName] === void 0 || t.alwaysCreateTextNode ? Object.keys(c).length === 0 && (t.alwaysCreateTextNode ? c[t.textNodeName] = "" : c = "") : c = c[t.textNodeName], s[a] !== void 0 && s.hasOwnProperty(a) ? (Array.isArray(s[a]) || (s[a] = [s[a]]), s[a].push(c)) : t.isArray(a, l, u) ? s[a] = [c] : s[a] = c;
2490
+ }
2491
+ }
2492
+ }
2493
+ return typeof n == "string" ? n.length > 0 && (s[t.textNodeName] = n) : n !== void 0 && (s[t.textNodeName] = n), s;
2494
+ }
2495
+ function rs(r) {
2496
+ const t = Object.keys(r);
2497
+ for (let e = 0; e < t.length; e++) {
2498
+ const n = t[e];
2499
+ if (n !== ":@") return n;
2500
+ }
2501
+ }
2502
+ function ns(r, t, e, n) {
2503
+ if (t) {
2504
+ const s = Object.keys(t), o = s.length;
2505
+ for (let i = 0; i < o; i++) {
2506
+ const a = s[i];
2507
+ n.isArray(a, e + "." + a, !0, !0) ? r[a] = [t[a]] : r[a] = t[a];
2508
+ }
2509
+ }
2510
+ }
2511
+ function ss(r, t) {
2512
+ const { textNodeName: e } = t, n = Object.keys(r).length;
2513
+ return n === 0 || !(n !== 1 || !r[e] && typeof r[e] != "boolean" && r[e] !== 0);
2514
+ }
2515
+ const os = { allowBooleanAttributes: !1, unpairedTags: [] };
2516
+ function Fe(r) {
2517
+ return r === " " || r === " " || r === `
2518
+ ` || r === "\r";
2519
+ }
2520
+ function je(r, t) {
2521
+ const e = t;
2522
+ for (; t < r.length; t++) if (!(r[t] != "?" && r[t] != " ")) {
2523
+ const n = r.substr(e, t - e);
2524
+ if (t > 5 && n === "xml") return $("InvalidXml", "XML declaration allowed only at the start of the document.", k(r, t));
2525
+ if (r[t] == "?" && r[t + 1] == ">") {
2526
+ t++;
2527
+ break;
2528
+ }
2529
+ }
2530
+ return t;
2531
+ }
2532
+ function Re(r, t) {
2533
+ if (r.length > t + 5 && r[t + 1] === "-" && r[t + 2] === "-") {
2534
+ for (t += 3; t < r.length; t++) if (r[t] === "-" && r[t + 1] === "-" && r[t + 2] === ">") {
2535
+ t += 2;
2536
+ break;
2537
+ }
2538
+ } else if (r.length > t + 8 && r[t + 1] === "D" && r[t + 2] === "O" && r[t + 3] === "C" && r[t + 4] === "T" && r[t + 5] === "Y" && r[t + 6] === "P" && r[t + 7] === "E") {
2539
+ let e = 1;
2540
+ for (t += 8; t < r.length; t++) if (r[t] === "<") e++;
2541
+ else if (r[t] === ">" && (e--, e === 0)) break;
2542
+ } else if (r.length > t + 9 && r[t + 1] === "[" && r[t + 2] === "C" && r[t + 3] === "D" && r[t + 4] === "A" && r[t + 5] === "T" && r[t + 6] === "A" && r[t + 7] === "[") {
2543
+ for (t += 8; t < r.length; t++) if (r[t] === "]" && r[t + 1] === "]" && r[t + 2] === ">") {
2544
+ t += 2;
2545
+ break;
2546
+ }
2547
+ }
2548
+ return t;
2549
+ }
2550
+ function is(r, t) {
2551
+ let e = "", n = "", s = !1;
2552
+ for (; t < r.length; t++) {
2553
+ if (r[t] === '"' || r[t] === "'") n === "" ? n = r[t] : n !== r[t] || (n = "");
2554
+ else if (r[t] === ">" && n === "") {
2555
+ s = !0;
2556
+ break;
2557
+ }
2558
+ e += r[t];
2559
+ }
2560
+ return n === "" && { value: e, index: t, tagClosed: s };
2561
+ }
2562
+ const as = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2563
+ function Le(r, t) {
2564
+ const e = sr(r, as), n = {};
2565
+ for (let s = 0; s < e.length; s++) {
2566
+ if (e[s][1].length === 0) return $("InvalidAttr", "Attribute '" + e[s][2] + "' has no space in starting.", xt(e[s]));
2567
+ if (e[s][3] !== void 0 && e[s][4] === void 0) return $("InvalidAttr", "Attribute '" + e[s][2] + "' is without value.", xt(e[s]));
2568
+ if (e[s][3] === void 0 && !t.allowBooleanAttributes) return $("InvalidAttr", "boolean attribute '" + e[s][2] + "' is not allowed.", xt(e[s]));
2569
+ const o = e[s][2];
2570
+ if (!ls(o)) return $("InvalidAttr", "Attribute '" + o + "' is an invalid name.", xt(e[s]));
2571
+ if (n.hasOwnProperty(o)) return $("InvalidAttr", "Attribute '" + o + "' is repeated.", xt(e[s]));
2572
+ n[o] = 1;
2573
+ }
2574
+ return !0;
2575
+ }
2576
+ function us(r, t) {
2577
+ if (r[++t] === ";") return -1;
2578
+ if (r[t] === "#") return (function(n, s) {
2579
+ let o = /\d/;
2580
+ for (n[s] === "x" && (s++, o = /[\da-fA-F]/); s < n.length; s++) {
2581
+ if (n[s] === ";") return s;
2582
+ if (!n[s].match(o)) break;
2583
+ }
2584
+ return -1;
2585
+ })(r, ++t);
2586
+ let e = 0;
2587
+ for (; t < r.length; t++, e++) if (!(r[t].match(/\w/) && e < 20)) {
2588
+ if (r[t] === ";") break;
2589
+ return -1;
2590
+ }
2591
+ return t;
2592
+ }
2593
+ function $(r, t, e) {
2594
+ return { err: { code: r, msg: t, line: e.line || e, col: e.col } };
2595
+ }
2596
+ function ls(r) {
2597
+ return Dt(r);
2598
+ }
2599
+ function k(r, t) {
2600
+ const e = r.substring(0, t).split(/\r?\n/);
2601
+ return { line: e.length, col: e[e.length - 1].length + 1 };
2602
+ }
2603
+ function xt(r) {
2604
+ return r.startIndex + r[1].length;
2605
+ }
2606
+ class ur {
2607
+ constructor(t) {
2608
+ this.externalEntities = {}, this.options = (function(e) {
2609
+ return Object.assign({}, Un, e);
2610
+ })(t);
2611
+ }
2612
+ parse(t, e) {
2613
+ if (typeof t != "string" && t.toString) t = t.toString();
2614
+ else if (typeof t != "string") throw new Error("XML data is accepted in String or Bytes[] form.");
2615
+ if (e) {
2616
+ e === !0 && (e = {});
2617
+ const o = (function(i, a) {
2618
+ a = Object.assign({}, os, a);
2619
+ const l = [];
2620
+ let c = !1, u = !1;
2621
+ i[0] === "\uFEFF" && (i = i.substr(1));
2622
+ for (let f = 0; f < i.length; f++) if (i[f] === "<" && i[f + 1] === "?") {
2623
+ if (f += 2, f = je(i, f), f.err) return f;
2624
+ } else {
2625
+ if (i[f] !== "<") {
2626
+ if (Fe(i[f])) continue;
2627
+ return $("InvalidChar", "char '" + i[f] + "' is not expected.", k(i, f));
2628
+ }
2629
+ {
2630
+ let h = f;
2631
+ if (f++, i[f] === "!") {
2632
+ f = Re(i, f);
2633
+ continue;
2634
+ }
2635
+ {
2636
+ let d = !1;
2637
+ i[f] === "/" && (d = !0, f++);
2638
+ let g = "";
2639
+ for (; f < i.length && i[f] !== ">" && i[f] !== " " && i[f] !== " " && i[f] !== `
2640
+ ` && i[f] !== "\r"; f++) g += i[f];
2641
+ if (g = g.trim(), g[g.length - 1] === "/" && (g = g.substring(0, g.length - 1), f--), !Dt(g)) {
2642
+ let b;
2643
+ return b = g.trim().length === 0 ? "Invalid space after '<'." : "Tag '" + g + "' is an invalid name.", $("InvalidTag", b, k(i, f));
2644
+ }
2645
+ const p = is(i, f);
2646
+ if (p === !1) return $("InvalidAttr", "Attributes for '" + g + "' have open quote.", k(i, f));
2647
+ let m = p.value;
2648
+ if (f = p.index, m[m.length - 1] === "/") {
2649
+ const b = f - m.length;
2650
+ m = m.substring(0, m.length - 1);
2651
+ const y = Le(m, a);
2652
+ if (y !== !0) return $(y.err.code, y.err.msg, k(i, b + y.err.line));
2653
+ c = !0;
2654
+ } else if (d) {
2655
+ if (!p.tagClosed) return $("InvalidTag", "Closing tag '" + g + "' doesn't have proper closing.", k(i, f));
2656
+ if (m.trim().length > 0) return $("InvalidTag", "Closing tag '" + g + "' can't have attributes or invalid starting.", k(i, h));
2657
+ if (l.length === 0) return $("InvalidTag", "Closing tag '" + g + "' has not been opened.", k(i, h));
2658
+ {
2659
+ const b = l.pop();
2660
+ if (g !== b.tagName) {
2661
+ let y = k(i, b.tagStartPos);
2662
+ return $("InvalidTag", "Expected closing tag '" + b.tagName + "' (opened in line " + y.line + ", col " + y.col + ") instead of closing tag '" + g + "'.", k(i, h));
2663
+ }
2664
+ l.length == 0 && (u = !0);
2665
+ }
2666
+ } else {
2667
+ const b = Le(m, a);
2668
+ if (b !== !0) return $(b.err.code, b.err.msg, k(i, f - m.length + b.err.line));
2669
+ if (u === !0) return $("InvalidXml", "Multiple possible root nodes found.", k(i, f));
2670
+ a.unpairedTags.indexOf(g) !== -1 || l.push({ tagName: g, tagStartPos: h }), c = !0;
2671
+ }
2672
+ for (f++; f < i.length; f++) if (i[f] === "<") {
2673
+ if (i[f + 1] === "!") {
2674
+ f++, f = Re(i, f);
2675
+ continue;
2676
+ }
2677
+ if (i[f + 1] !== "?") break;
2678
+ if (f = je(i, ++f), f.err) return f;
2679
+ } else if (i[f] === "&") {
2680
+ const b = us(i, f);
2681
+ if (b == -1) return $("InvalidChar", "char '&' is not expected.", k(i, f));
2682
+ f = b;
2683
+ } else if (u === !0 && !Fe(i[f])) return $("InvalidXml", "Extra text at the end", k(i, f));
2684
+ i[f] === "<" && f--;
2685
+ }
2686
+ }
2687
+ }
2688
+ return c ? l.length == 1 ? $("InvalidTag", "Unclosed tag '" + l[0].tagName + "'.", k(i, l[0].tagStartPos)) : !(l.length > 0) || $("InvalidXml", "Invalid '" + JSON.stringify(l.map(((f) => f.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : $("InvalidXml", "Start tag expected.", 1);
2689
+ })(t, e);
2690
+ if (o !== !0) throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`);
2691
+ }
2692
+ const n = new Wn(this.options);
2693
+ n.addExternalEntities(this.externalEntities);
2694
+ const s = n.parseXml(t);
2695
+ return this.options.preserveOrder || s === void 0 ? s : es(s, this.options);
2696
+ }
2697
+ addEntity(t, e) {
2698
+ if (e.indexOf("&") !== -1) throw new Error("Entity value can't have '&'");
2699
+ if (t.indexOf("&") !== -1 || t.indexOf(";") !== -1) throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
2700
+ if (e === "&") throw new Error("An entity with value '&' is not permitted");
2701
+ this.externalEntities[t] = e;
2702
+ }
2703
+ static getMetaDataSymbol() {
2704
+ return at.getMetaDataSymbol();
2705
+ }
2706
+ }
2707
+ var cs = O(829), Y = O.n(cs), ct = (function(r) {
2708
+ return r.Array = "array", r.Object = "object", r.Original = "original", r;
2709
+ })(ct || {});
2710
+ function lr(r, t) {
2711
+ if (!r.endsWith("propstat.prop.displayname")) return t;
2712
+ }
2713
+ function It(r, t) {
2714
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ct.Original;
2715
+ const n = Y().get(r, t);
2716
+ return e === "array" && Array.isArray(n) === !1 ? [n] : e === "object" && Array.isArray(n) ? n[0] : n;
2717
+ }
2718
+ function Tt(r, t) {
2719
+ return t = t ?? { attributeNamePrefix: "@", attributeParsers: [], tagParsers: [lr] }, new Promise(((e) => {
2720
+ e((function(n) {
2721
+ const { multistatus: s } = n;
2722
+ if (s === "") return { multistatus: { response: [] } };
2723
+ if (!s) throw new Error("Invalid response: No root multistatus found");
2724
+ const o = { multistatus: Array.isArray(s) ? s[0] : s };
2725
+ return Y().set(o, "multistatus.response", It(o, "multistatus.response", ct.Array)), Y().set(o, "multistatus.response", Y().get(o, "multistatus.response").map(((i) => (function(a) {
2726
+ const l = Object.assign({}, a);
2727
+ return l.status ? Y().set(l, "status", It(l, "status", ct.Object)) : (Y().set(l, "propstat", It(l, "propstat", ct.Object)), Y().set(l, "propstat.prop", It(l, "propstat.prop", ct.Object))), l;
2728
+ })(i)))), o;
2729
+ })((function(n) {
2730
+ let { attributeNamePrefix: s, attributeParsers: o, tagParsers: i } = n;
2731
+ return new ur({ allowBooleanAttributes: !0, attributeNamePrefix: s, textNodeName: "text", ignoreAttributes: !1, removeNSPrefix: !0, numberParseOptions: { hex: !0, leadingZeros: !1 }, attributeValueProcessor(a, l, c) {
2732
+ for (const u of o) try {
2733
+ const f = u(c, l);
2734
+ if (f !== l) return f;
2735
+ } catch {
2736
+ }
2737
+ return l;
2738
+ }, tagValueProcessor(a, l, c) {
2739
+ for (const u of i) try {
2740
+ const f = u(c, l);
2741
+ if (f !== l) return f;
2742
+ } catch {
2743
+ }
2744
+ return l;
2745
+ } });
2746
+ })(t).parse(r)));
2747
+ }));
2748
+ }
2749
+ function kt(r, t) {
2750
+ let e = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
2751
+ const { getlastmodified: n = null, getcontentlength: s = "0", resourcetype: o = null, getcontenttype: i = null, getetag: a = null } = r, l = o && typeof o == "object" && o.collection !== void 0 ? "directory" : "file", c = { filename: t, basename: $t().basename(t), lastmod: n, size: parseInt(s, 10), type: l, etag: typeof a == "string" ? a.replace(/"/g, "") : null };
2752
+ return l === "file" && (c.mime = i && typeof i == "string" ? i.split(";")[0] : ""), e && (r.displayname !== void 0 && (r.displayname = String(r.displayname)), c.props = r), c;
2753
+ }
2754
+ function hs(r, t) {
2755
+ let e = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], n = null;
2756
+ try {
2757
+ r.multistatus.response[0].propstat && (n = r.multistatus.response[0]);
2758
+ } catch {
2759
+ }
2760
+ if (!n) throw new Error("Failed getting item stat: bad response");
2761
+ const { propstat: { prop: s, status: o } } = n, [i, a, l] = o.split(" ", 3), c = parseInt(a, 10);
2762
+ if (c >= 400) {
2763
+ const u = new Error(`Invalid response: ${c} ${l}`);
2764
+ throw u.status = c, u;
2765
+ }
2766
+ return kt(s, At(t), e);
2767
+ }
2768
+ function fs(r) {
2769
+ switch (String(r)) {
2770
+ case "-3":
2771
+ return "unlimited";
2772
+ case "-2":
2773
+ case "-1":
2774
+ return "unknown";
2775
+ default:
2776
+ return parseInt(String(r), 10);
2777
+ }
2778
+ }
2779
+ function qt(r, t, e) {
2780
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
2781
+ }
2782
+ const ue = /* @__PURE__ */ (function(r) {
2783
+ return function() {
2784
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2785
+ try {
2786
+ return Promise.resolve(r.apply(this, t));
2787
+ } catch (n) {
2788
+ return Promise.reject(n);
2789
+ }
2790
+ };
2791
+ })((function(r, t) {
2792
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2793
+ const { details: n = !1 } = e, s = R({ url: C(r.remoteURL, S(t)), method: "PROPFIND", headers: { Accept: "text/plain,application/xml", Depth: "0" } }, r, e);
2794
+ return qt(j(s, r), (function(o) {
2795
+ return L(r, o), qt(o.text(), (function(i) {
2796
+ return qt(Tt(i, r.parsing), (function(a) {
2797
+ const l = hs(a, t, n);
2798
+ return pt(o, l, n);
2799
+ }));
2800
+ }));
2801
+ }));
2802
+ }));
2803
+ function cr(r, t, e) {
2804
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
2805
+ }
2806
+ const ps = hr((function(r, t) {
2807
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2808
+ const n = (function(o) {
2809
+ if (!o || o === "/") return [];
2810
+ let i = o;
2811
+ const a = [];
2812
+ do
2813
+ a.push(i), i = $t().dirname(i);
2814
+ while (i && i !== "/");
2815
+ return a;
2816
+ })(At(t));
2817
+ n.sort(((o, i) => o.length > i.length ? 1 : i.length > o.length ? -1 : 0));
2818
+ let s = !1;
2819
+ return (function(o, i, a) {
2820
+ if (typeof o[De] == "function") {
2821
+ let p = function(m) {
2822
+ try {
2823
+ for (; !(l = f.next()).done; ) if ((m = i(l.value)) && m.then) {
2824
+ if (!ke(m)) return void m.then(p, u || (u = _.bind(null, c = new ht(), 2)));
2825
+ m = m.v;
2826
+ }
2827
+ c ? _(c, 1, m) : c = m;
2828
+ } catch (b) {
2829
+ _(c || (c = new ht()), 2, b);
2830
+ }
2831
+ };
2832
+ var l, c, u, f = o[De]();
2833
+ if (p(), f.return) {
2834
+ var h = function(m) {
2835
+ try {
2836
+ l.done || f.return();
2837
+ } catch {
2838
+ }
2839
+ return m;
2840
+ };
2841
+ if (c && c.then) return c.then(h, (function(m) {
2842
+ throw h(m);
2843
+ }));
2844
+ h();
2845
+ }
2846
+ return c;
2847
+ }
2848
+ if (!("length" in o)) throw new TypeError("Object is not iterable");
2849
+ for (var d = [], g = 0; g < o.length; g++) d.push(o[g]);
2850
+ return (function(p, m, b) {
2851
+ var y, v, w = -1;
2852
+ return (function x(P) {
2853
+ try {
2854
+ for (; ++w < p.length && (!b || !b()); ) if ((P = m(w)) && P.then) {
2855
+ if (!ke(P)) return void P.then(x, v || (v = _.bind(null, y = new ht(), 2)));
2856
+ P = P.v;
2857
+ }
2858
+ y ? _(y, 1, P) : y = P;
2859
+ } catch (E) {
2860
+ _(y || (y = new ht()), 2, E);
2861
+ }
2862
+ })(), y;
2863
+ })(d, (function(p) {
2864
+ return i(d[p]);
2865
+ }), a);
2866
+ })(n, (function(o) {
2867
+ return i = function() {
2868
+ return (function(l, c) {
2869
+ try {
2870
+ var u = cr(ue(r, o), (function(f) {
2871
+ if (f.type !== "directory") throw new Error(`Path includes a file: ${t}`);
2872
+ }));
2873
+ } catch (f) {
2874
+ return c(f);
2875
+ }
2876
+ return u && u.then ? u.then(void 0, c) : u;
2877
+ })(0, (function(l) {
2878
+ const c = l;
2879
+ return (function() {
2880
+ if (c.status === 404) return s = !0, Ue(ee(r, o, { ...e, recursive: !1 }));
2881
+ throw l;
2882
+ })();
2883
+ }));
2884
+ }, (a = (function() {
2885
+ if (s) return Ue(ee(r, o, { ...e, recursive: !1 }));
2886
+ })()) && a.then ? a.then(i) : i();
2887
+ var i, a;
2888
+ }), (function() {
2889
+ return !1;
2890
+ }));
2891
+ }));
2892
+ function hr(r) {
2893
+ return function() {
2894
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2895
+ try {
2896
+ return Promise.resolve(r.apply(this, t));
2897
+ } catch (n) {
2898
+ return Promise.reject(n);
2899
+ }
2900
+ };
2901
+ }
2902
+ function gs() {
2903
+ }
2904
+ function Ue(r, t) {
2905
+ return r && r.then ? r.then(gs) : Promise.resolve();
2906
+ }
2907
+ const De = typeof Symbol < "u" ? Symbol.iterator || (Symbol.iterator = /* @__PURE__ */ Symbol("Symbol.iterator")) : "@@iterator";
2908
+ function _(r, t, e) {
2909
+ if (!r.s) {
2910
+ if (e instanceof ht) {
2911
+ if (!e.s) return void (e.o = _.bind(null, r, t));
2912
+ 1 & t && (t = e.s), e = e.v;
2913
+ }
2914
+ if (e && e.then) return void e.then(_.bind(null, r, t), _.bind(null, r, 2));
2915
+ r.s = t, r.v = e;
2916
+ const n = r.o;
2917
+ n && n(r);
2918
+ }
2919
+ }
2920
+ const ht = (function() {
2921
+ function r() {
2922
+ }
2923
+ return r.prototype.then = function(t, e) {
2924
+ const n = new r(), s = this.s;
2925
+ if (s) {
2926
+ const o = 1 & s ? t : e;
2927
+ if (o) {
2928
+ try {
2929
+ _(n, 1, o(this.v));
2930
+ } catch (i) {
2931
+ _(n, 2, i);
2932
+ }
2933
+ return n;
2934
+ }
2935
+ return this;
2936
+ }
2937
+ return this.o = function(o) {
2938
+ try {
2939
+ const i = o.v;
2940
+ 1 & o.s ? _(n, 1, t ? t(i) : i) : e ? _(n, 1, e(i)) : _(n, 2, i);
2941
+ } catch (i) {
2942
+ _(n, 2, i);
2943
+ }
2944
+ }, n;
2945
+ }, r;
2946
+ })();
2947
+ function ke(r) {
2948
+ return r instanceof ht && 1 & r.s;
2949
+ }
2950
+ const ee = hr((function(r, t) {
2951
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2952
+ if (e.recursive === !0) return ps(r, t, e);
2953
+ const n = R({ url: C(r.remoteURL, (s = S(t), s.endsWith("/") ? s : s + "/")), method: "MKCOL" }, r, e);
2954
+ var s;
2955
+ return cr(j(n, r), (function(o) {
2956
+ L(r, o);
2957
+ }));
2958
+ }));
2959
+ var ds = O(388), Me = O.n(ds);
2960
+ const ms = /* @__PURE__ */ (function(r) {
2961
+ return function() {
2962
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2963
+ try {
2964
+ return Promise.resolve(r.apply(this, t));
2965
+ } catch (n) {
2966
+ return Promise.reject(n);
2967
+ }
2968
+ };
2969
+ })((function(r, t) {
2970
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2971
+ const n = {};
2972
+ if (typeof e.range == "object" && typeof e.range.start == "number") {
2973
+ let a = `bytes=${e.range.start}-`;
2974
+ typeof e.range.end == "number" && (a = `${a}${e.range.end}`), n.Range = a;
2975
+ }
2976
+ const s = R({ url: C(r.remoteURL, S(t)), method: "GET", headers: n }, r, e);
2977
+ return i = function(a) {
2978
+ if (L(r, a), n.Range && a.status !== 206) {
2979
+ const l = new Error(`Invalid response code for partial request: ${a.status}`);
2980
+ throw l.status = a.status, l;
2981
+ }
2982
+ return e.callback && setTimeout((() => {
2983
+ e.callback(a);
2984
+ }), 0), a.body;
2985
+ }, (o = j(s, r)) && o.then || (o = Promise.resolve(o)), i ? o.then(i) : o;
2986
+ var o, i;
2987
+ })), ys = () => {
2988
+ }, bs = /* @__PURE__ */ (function(r) {
2989
+ return function() {
2990
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2991
+ try {
2992
+ return Promise.resolve(r.apply(this, t));
2993
+ } catch (n) {
2994
+ return Promise.reject(n);
2995
+ }
2996
+ };
2997
+ })((function(r, t, e) {
2998
+ e.url || (e.url = C(r.remoteURL, S(t)));
2999
+ const n = R(e, r, {});
3000
+ return o = function(i) {
3001
+ return L(r, i), i;
3002
+ }, (s = j(n, r)) && s.then || (s = Promise.resolve(s)), o ? s.then(o) : s;
3003
+ var s, o;
3004
+ })), vs = /* @__PURE__ */ (function(r) {
3005
+ return function() {
3006
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3007
+ try {
3008
+ return Promise.resolve(r.apply(this, t));
3009
+ } catch (n) {
3010
+ return Promise.reject(n);
3011
+ }
3012
+ };
3013
+ })((function(r, t) {
3014
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3015
+ const n = R({ url: C(r.remoteURL, S(t)), method: "DELETE" }, r, e);
3016
+ return o = function(i) {
3017
+ L(r, i);
3018
+ }, (s = j(n, r)) && s.then || (s = Promise.resolve(s)), o ? s.then(o) : s;
3019
+ var s, o;
3020
+ })), ws = /* @__PURE__ */ (function(r) {
3021
+ return function() {
3022
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3023
+ try {
3024
+ return Promise.resolve(r.apply(this, t));
3025
+ } catch (n) {
3026
+ return Promise.reject(n);
3027
+ }
3028
+ };
3029
+ })((function(r, t) {
3030
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3031
+ return (function(n, s) {
3032
+ try {
3033
+ var o = (i = ue(r, t, e), a = function() {
3034
+ return !0;
3035
+ }, l ? a ? a(i) : i : (i && i.then || (i = Promise.resolve(i)), a ? i.then(a) : i));
3036
+ } catch (c) {
3037
+ return s(c);
3038
+ }
3039
+ var i, a, l;
3040
+ return o && o.then ? o.then(void 0, s) : o;
3041
+ })(0, (function(n) {
3042
+ if (n.status === 404) return !1;
3043
+ throw n;
3044
+ }));
3045
+ }));
3046
+ function Gt(r, t, e) {
3047
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3048
+ }
3049
+ const xs = /* @__PURE__ */ (function(r) {
3050
+ return function() {
3051
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3052
+ try {
3053
+ return Promise.resolve(r.apply(this, t));
3054
+ } catch (n) {
3055
+ return Promise.reject(n);
3056
+ }
3057
+ };
3058
+ })((function(r, t) {
3059
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3060
+ const n = R({ url: C(r.remoteURL, S(t), "/"), method: "PROPFIND", headers: { Accept: "text/plain,application/xml", Depth: e.deep ? "infinity" : "1" } }, r, e);
3061
+ return Gt(j(n, r), (function(s) {
3062
+ return L(r, s), Gt(s.text(), (function(o) {
3063
+ if (!o) throw new Error("Failed parsing directory contents: Empty response");
3064
+ return Gt(Tt(o, r.parsing), (function(i) {
3065
+ const a = ye(t);
3066
+ let l = (function(c, u, f) {
3067
+ let h = arguments.length > 3 && arguments[3] !== void 0 && arguments[3], d = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
3068
+ const g = $t().join(u, "/"), { multistatus: { response: p } } = c, m = p.map(((b) => {
3069
+ const y = (function(w) {
3070
+ try {
3071
+ return w.replace(/^https?:\/\/[^\/]+/, "");
3072
+ } catch (x) {
3073
+ throw new V(x, "Failed normalising HREF");
3074
+ }
3075
+ })(b.href), { propstat: { prop: v } } = b;
3076
+ return kt(v, g === "/" ? decodeURIComponent(At(y)) : At($t().relative(decodeURIComponent(g), decodeURIComponent(y))), h);
3077
+ }));
3078
+ return d ? m : m.filter(((b) => b.basename && (b.type === "file" || b.filename !== f.replace(/\/$/, ""))));
3079
+ })(i, ye(r.remoteBasePath || r.remotePath), a, e.details, e.includeSelf);
3080
+ return e.glob && (l = (function(c, u) {
3081
+ return c.filter(((f) => D(f.filename, u, { matchBase: !0 })));
3082
+ })(l, e.glob)), pt(s, l, e.details);
3083
+ }));
3084
+ }));
3085
+ }));
3086
+ }));
3087
+ function le(r) {
3088
+ return function() {
3089
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3090
+ try {
3091
+ return Promise.resolve(r.apply(this, t));
3092
+ } catch (n) {
3093
+ return Promise.reject(n);
3094
+ }
3095
+ };
3096
+ }
3097
+ const Ns = le((function(r, t) {
3098
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3099
+ const n = R({ url: C(r.remoteURL, S(t)), method: "GET", headers: { Accept: "text/plain" }, transformResponse: [As] }, r, e);
3100
+ return Ut(j(n, r), (function(s) {
3101
+ return L(r, s), Ut(s.text(), (function(o) {
3102
+ return pt(s, o, e.details);
3103
+ }));
3104
+ }));
3105
+ }));
3106
+ function Ut(r, t, e) {
3107
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3108
+ }
3109
+ const Ps = le((function(r, t) {
3110
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3111
+ const n = R({ url: C(r.remoteURL, S(t)), method: "GET" }, r, e);
3112
+ return Ut(j(n, r), (function(s) {
3113
+ let o;
3114
+ return L(r, s), (function(i, a) {
3115
+ var l = i();
3116
+ return l && l.then ? l.then(a) : a();
3117
+ })((function() {
3118
+ return Ut(s.arrayBuffer(), (function(i) {
3119
+ o = i;
3120
+ }));
3121
+ }), (function() {
3122
+ return pt(s, o, e.details);
3123
+ }));
3124
+ }));
3125
+ })), Es = le((function(r, t) {
3126
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3127
+ const { format: n = "binary" } = e;
3128
+ if (n !== "binary" && n !== "text") throw new V({ info: { code: et.InvalidOutputFormat } }, `Invalid output format: ${n}`);
3129
+ return n === "text" ? Ns(r, t, e) : Ps(r, t, e);
3130
+ })), As = (r) => r;
3131
+ function Ts(r, t) {
3132
+ let e = "";
3133
+ return t.format && t.indentBy.length > 0 && (e = `
3134
+ `), fr(r, t, "", e);
3135
+ }
3136
+ function fr(r, t, e, n) {
3137
+ let s = "", o = !1;
3138
+ for (let i = 0; i < r.length; i++) {
3139
+ const a = r[i], l = Os(a);
3140
+ if (l === void 0) continue;
3141
+ let c = "";
3142
+ if (c = e.length === 0 ? l : `${e}.${l}`, l === t.textNodeName) {
3143
+ let d = a[l];
3144
+ Ss(c, t) || (d = t.tagValueProcessor(l, d), d = pr(d, t)), o && (s += n), s += d, o = !1;
3145
+ continue;
3146
+ }
3147
+ if (l === t.cdataPropName) {
3148
+ o && (s += n), s += `<![CDATA[${a[l][0][t.textNodeName]}]]>`, o = !1;
3149
+ continue;
3150
+ }
3151
+ if (l === t.commentPropName) {
3152
+ s += n + `<!--${a[l][0][t.textNodeName]}-->`, o = !0;
3153
+ continue;
3154
+ }
3155
+ if (l[0] === "?") {
3156
+ const d = _e(a[":@"], t), g = l === "?xml" ? "" : n;
3157
+ let p = a[l][0][t.textNodeName];
3158
+ p = p.length !== 0 ? " " + p : "", s += g + `<${l}${p}${d}?>`, o = !0;
3159
+ continue;
3160
+ }
3161
+ let u = n;
3162
+ u !== "" && (u += t.indentBy);
3163
+ const f = n + `<${l}${_e(a[":@"], t)}`, h = fr(a[l], t, c, u);
3164
+ t.unpairedTags.indexOf(l) !== -1 ? t.suppressUnpairedNode ? s += f + ">" : s += f + "/>" : h && h.length !== 0 || !t.suppressEmptyNode ? h && h.endsWith(">") ? s += f + `>${h}${n}</${l}>` : (s += f + ">", h && n !== "" && (h.includes("/>") || h.includes("</")) ? s += n + t.indentBy + h + n : s += h, s += `</${l}>`) : s += f + "/>", o = !0;
3165
+ }
3166
+ return s;
3167
+ }
3168
+ function Os(r) {
3169
+ const t = Object.keys(r);
3170
+ for (let e = 0; e < t.length; e++) {
3171
+ const n = t[e];
3172
+ if (r.hasOwnProperty(n) && n !== ":@") return n;
3173
+ }
3174
+ }
3175
+ function _e(r, t) {
3176
+ let e = "";
3177
+ if (r && !t.ignoreAttributes) for (let n in r) {
3178
+ if (!r.hasOwnProperty(n)) continue;
3179
+ let s = t.attributeValueProcessor(n, r[n]);
3180
+ s = pr(s, t), s === !0 && t.suppressBooleanAttributes ? e += ` ${n.substr(t.attributeNamePrefix.length)}` : e += ` ${n.substr(t.attributeNamePrefix.length)}="${s}"`;
3181
+ }
3182
+ return e;
3183
+ }
3184
+ function Ss(r, t) {
3185
+ let e = (r = r.substr(0, r.length - t.textNodeName.length - 1)).substr(r.lastIndexOf(".") + 1);
3186
+ for (let n in t.stopNodes) if (t.stopNodes[n] === r || t.stopNodes[n] === "*." + e) return !0;
3187
+ return !1;
3188
+ }
3189
+ function pr(r, t) {
3190
+ if (r && r.length > 0 && t.processEntities) for (let e = 0; e < t.entities.length; e++) {
3191
+ const n = t.entities[e];
3192
+ r = r.replace(n.regex, n.val);
3193
+ }
3194
+ return r;
3195
+ }
3196
+ const Cs = { attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, cdataPropName: !1, format: !1, indentBy: " ", suppressEmptyNode: !1, suppressUnpairedNode: !0, suppressBooleanAttributes: !0, tagValueProcessor: function(r, t) {
3197
+ return t;
3198
+ }, attributeValueProcessor: function(r, t) {
3199
+ return t;
3200
+ }, preserveOrder: !1, commentPropName: !1, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&amp;" }, { regex: new RegExp(">", "g"), val: "&gt;" }, { regex: new RegExp("<", "g"), val: "&lt;" }, { regex: new RegExp("'", "g"), val: "&apos;" }, { regex: new RegExp('"', "g"), val: "&quot;" }], processEntities: !0, stopNodes: [], oneListGroup: !1 };
3201
+ function tt(r) {
3202
+ this.options = Object.assign({}, Cs, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3203
+ return !1;
3204
+ } : (this.ignoreAttributesFn = or(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Fs), this.processTextOrObjNode = Is, this.options.format ? (this.indentate = $s, this.tagEndChar = `>
3205
+ `, this.newLine = `
3206
+ `) : (this.indentate = function() {
3207
+ return "";
3208
+ }, this.tagEndChar = ">", this.newLine = "");
3209
+ }
3210
+ function Is(r, t, e, n) {
3211
+ const s = this.j2x(r, e + 1, n.concat(t));
3212
+ return r[this.options.textNodeName] !== void 0 && Object.keys(r).length === 1 ? this.buildTextValNode(r[this.options.textNodeName], t, s.attrStr, e) : this.buildObjectNode(s.val, t, s.attrStr, e);
3213
+ }
3214
+ function $s(r) {
3215
+ return this.options.indentBy.repeat(r);
3216
+ }
3217
+ function Fs(r) {
3218
+ return !(!r.startsWith(this.options.attributeNamePrefix) || r === this.options.textNodeName) && r.substr(this.attrPrefixLen);
3219
+ }
3220
+ function js(r) {
3221
+ return new tt({ attributeNamePrefix: "@_", format: !0, ignoreAttributes: !1, suppressEmptyNode: !0 }).build(gr({ lockinfo: { "@_xmlns:d": "DAV:", lockscope: { exclusive: {} }, locktype: { write: {} }, owner: { href: r } } }, "d"));
3222
+ }
3223
+ function gr(r, t) {
3224
+ const e = { ...r };
3225
+ for (const n in e) e.hasOwnProperty(n) && (e[n] && typeof e[n] == "object" && n.indexOf(":") === -1 ? (e[`${t}:${n}`] = gr(e[n], t), delete e[n]) : /^@_/.test(n) === !1 && (e[`${t}:${n}`] = e[n], delete e[n]));
3226
+ return e;
3227
+ }
3228
+ function re(r, t, e) {
3229
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3230
+ }
3231
+ function dr(r) {
3232
+ return function() {
3233
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3234
+ try {
3235
+ return Promise.resolve(r.apply(this, t));
3236
+ } catch (n) {
3237
+ return Promise.reject(n);
3238
+ }
3239
+ };
3240
+ }
3241
+ tt.prototype.build = function(r) {
3242
+ return this.options.preserveOrder ? Ts(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = { [this.options.arrayNodeName]: r }), this.j2x(r, 0, []).val);
3243
+ }, tt.prototype.j2x = function(r, t, e) {
3244
+ let n = "", s = "";
3245
+ const o = e.join(".");
3246
+ for (let i in r) if (Object.prototype.hasOwnProperty.call(r, i)) if (r[i] === void 0) this.isAttribute(i) && (s += "");
3247
+ else if (r[i] === null) this.isAttribute(i) || i === this.options.cdataPropName ? s += "" : i[0] === "?" ? s += this.indentate(t) + "<" + i + "?" + this.tagEndChar : s += this.indentate(t) + "<" + i + "/" + this.tagEndChar;
3248
+ else if (r[i] instanceof Date) s += this.buildTextValNode(r[i], i, "", t);
3249
+ else if (typeof r[i] != "object") {
3250
+ const a = this.isAttribute(i);
3251
+ if (a && !this.ignoreAttributesFn(a, o)) n += this.buildAttrPairStr(a, "" + r[i]);
3252
+ else if (!a) if (i === this.options.textNodeName) {
3253
+ let l = this.options.tagValueProcessor(i, "" + r[i]);
3254
+ s += this.replaceEntitiesValue(l);
3255
+ } else s += this.buildTextValNode(r[i], i, "", t);
3256
+ } else if (Array.isArray(r[i])) {
3257
+ const a = r[i].length;
3258
+ let l = "", c = "";
3259
+ for (let u = 0; u < a; u++) {
3260
+ const f = r[i][u];
3261
+ if (f !== void 0) if (f === null) i[0] === "?" ? s += this.indentate(t) + "<" + i + "?" + this.tagEndChar : s += this.indentate(t) + "<" + i + "/" + this.tagEndChar;
3262
+ else if (typeof f == "object") if (this.options.oneListGroup) {
3263
+ const h = this.j2x(f, t + 1, e.concat(i));
3264
+ l += h.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (c += h.attrStr);
3265
+ } else l += this.processTextOrObjNode(f, i, t, e);
3266
+ else if (this.options.oneListGroup) {
3267
+ let h = this.options.tagValueProcessor(i, f);
3268
+ h = this.replaceEntitiesValue(h), l += h;
3269
+ } else l += this.buildTextValNode(f, i, "", t);
3270
+ }
3271
+ this.options.oneListGroup && (l = this.buildObjectNode(l, i, c, t)), s += l;
3272
+ } else if (this.options.attributesGroupName && i === this.options.attributesGroupName) {
3273
+ const a = Object.keys(r[i]), l = a.length;
3274
+ for (let c = 0; c < l; c++) n += this.buildAttrPairStr(a[c], "" + r[i][a[c]]);
3275
+ } else s += this.processTextOrObjNode(r[i], i, t, e);
3276
+ return { attrStr: n, val: s };
3277
+ }, tt.prototype.buildAttrPairStr = function(r, t) {
3278
+ return t = this.options.attributeValueProcessor(r, "" + t), t = this.replaceEntitiesValue(t), this.options.suppressBooleanAttributes && t === "true" ? " " + r : " " + r + '="' + t + '"';
3279
+ }, tt.prototype.buildObjectNode = function(r, t, e, n) {
3280
+ if (r === "") return t[0] === "?" ? this.indentate(n) + "<" + t + e + "?" + this.tagEndChar : this.indentate(n) + "<" + t + e + this.closeTag(t) + this.tagEndChar;
3281
+ {
3282
+ let s = "</" + t + this.tagEndChar, o = "";
3283
+ return t[0] === "?" && (o = "?", s = ""), !e && e !== "" || r.indexOf("<") !== -1 ? this.options.commentPropName !== !1 && t === this.options.commentPropName && o.length === 0 ? this.indentate(n) + `<!--${r}-->` + this.newLine : this.indentate(n) + "<" + t + e + o + this.tagEndChar + r + this.indentate(n) + s : this.indentate(n) + "<" + t + e + o + ">" + r + s;
3284
+ }
3285
+ }, tt.prototype.closeTag = function(r) {
3286
+ let t = "";
3287
+ return this.options.unpairedTags.indexOf(r) !== -1 ? this.options.suppressUnpairedNode || (t = "/") : t = this.options.suppressEmptyNode ? "/" : `></${r}`, t;
3288
+ }, tt.prototype.buildTextValNode = function(r, t, e, n) {
3289
+ if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName) return this.indentate(n) + `<![CDATA[${r}]]>` + this.newLine;
3290
+ if (this.options.commentPropName !== !1 && t === this.options.commentPropName) return this.indentate(n) + `<!--${r}-->` + this.newLine;
3291
+ if (t[0] === "?") return this.indentate(n) + "<" + t + e + "?" + this.tagEndChar;
3292
+ {
3293
+ let s = this.options.tagValueProcessor(t, r);
3294
+ return s = this.replaceEntitiesValue(s), s === "" ? this.indentate(n) + "<" + t + e + this.closeTag(t) + this.tagEndChar : this.indentate(n) + "<" + t + e + ">" + s + "</" + t + this.tagEndChar;
3295
+ }
3296
+ }, tt.prototype.replaceEntitiesValue = function(r) {
3297
+ if (r && r.length > 0 && this.options.processEntities) for (let t = 0; t < this.options.entities.length; t++) {
3298
+ const e = this.options.entities[t];
3299
+ r = r.replace(e.regex, e.val);
3300
+ }
3301
+ return r;
3302
+ };
3303
+ const Rs = dr((function(r, t, e) {
3304
+ let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3305
+ const s = R({ url: C(r.remoteURL, S(t)), method: "UNLOCK", headers: { "Lock-Token": e } }, r, n);
3306
+ return re(j(s, r), (function(o) {
3307
+ if (L(r, o), o.status !== 204 && o.status !== 200) throw ae(o);
3308
+ }));
3309
+ })), Ls = dr((function(r, t) {
3310
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3311
+ const { refreshToken: n, timeout: s = Us } = e, o = { Accept: "text/plain,application/xml", Timeout: s };
3312
+ n && (o.If = n);
3313
+ const i = R({ url: C(r.remoteURL, S(t)), method: "LOCK", headers: o, data: js(r.contactHref) }, r, e);
3314
+ return re(j(i, r), (function(a) {
3315
+ return L(r, a), re(a.text(), (function(l) {
3316
+ const c = (h = l, new ur({ removeNSPrefix: !0, parseAttributeValue: !0, parseTagValue: !0 }).parse(h)), u = Y().get(c, "prop.lockdiscovery.activelock.locktoken.href"), f = Y().get(c, "prop.lockdiscovery.activelock.timeout");
3317
+ var h;
3318
+ if (!u) throw ae(a, "No lock token received: ");
3319
+ return { token: u, serverTimeout: f };
3320
+ }));
3321
+ }));
3322
+ })), Us = "Infinite, Second-4100000000";
3323
+ function zt(r, t, e) {
3324
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3325
+ }
3326
+ const Ds = /* @__PURE__ */ (function(r) {
3327
+ return function() {
3328
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3329
+ try {
3330
+ return Promise.resolve(r.apply(this, t));
3331
+ } catch (n) {
3332
+ return Promise.reject(n);
3333
+ }
3334
+ };
3335
+ })((function(r) {
3336
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3337
+ const e = t.path || "/", n = R({ url: C(r.remoteURL, e), method: "PROPFIND", headers: { Accept: "text/plain,application/xml", Depth: "0" } }, r, t);
3338
+ return zt(j(n, r), (function(s) {
3339
+ return L(r, s), zt(s.text(), (function(o) {
3340
+ return zt(Tt(o, r.parsing), (function(i) {
3341
+ const a = (function(l) {
3342
+ try {
3343
+ const [c] = l.multistatus.response, { propstat: { prop: { "quota-used-bytes": u, "quota-available-bytes": f } } } = c;
3344
+ return u !== void 0 && f !== void 0 ? { used: parseInt(String(u), 10), available: fs(f) } : null;
3345
+ } catch {
3346
+ }
3347
+ return null;
3348
+ })(i);
3349
+ return pt(s, a, t.details);
3350
+ }));
3351
+ }));
3352
+ }));
3353
+ }));
3354
+ function Ht(r, t, e) {
3355
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3356
+ }
3357
+ const ks = /* @__PURE__ */ (function(r) {
3358
+ return function() {
3359
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3360
+ try {
3361
+ return Promise.resolve(r.apply(this, t));
3362
+ } catch (n) {
3363
+ return Promise.reject(n);
3364
+ }
3365
+ };
3366
+ })((function(r, t) {
3367
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3368
+ const { details: n = !1 } = e, s = R({ url: C(r.remoteURL, S(t)), method: "SEARCH", headers: { Accept: "text/plain,application/xml", "Content-Type": r.headers["Content-Type"] || "application/xml; charset=utf-8" } }, r, e);
3369
+ return Ht(j(s, r), (function(o) {
3370
+ return L(r, o), Ht(o.text(), (function(i) {
3371
+ return Ht(Tt(i, r.parsing), (function(a) {
3372
+ const l = (function(c, u, f) {
3373
+ const h = { truncated: !1, results: [] };
3374
+ return h.truncated = c.multistatus.response.some(((d) => (d.status || d.propstat?.status).split(" ", 3)?.[1] === "507" && d.href.replace(/\/$/, "").endsWith(S(u).replace(/\/$/, "")))), c.multistatus.response.forEach(((d) => {
3375
+ if (d.propstat === void 0) return;
3376
+ const g = d.href.split("/").map(decodeURIComponent).join("/");
3377
+ h.results.push(kt(d.propstat.prop, g, f));
3378
+ })), h;
3379
+ })(a, t, n);
3380
+ return pt(o, l, n);
3381
+ }));
3382
+ }));
3383
+ }));
3384
+ })), Ms = /* @__PURE__ */ (function(r) {
3385
+ return function() {
3386
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3387
+ try {
3388
+ return Promise.resolve(r.apply(this, t));
3389
+ } catch (n) {
3390
+ return Promise.reject(n);
3391
+ }
3392
+ };
3393
+ })((function(r, t, e) {
3394
+ let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3395
+ const s = R({ url: C(r.remoteURL, S(t)), method: "MOVE", headers: { Destination: C(r.remoteURL, S(e)), Overwrite: n.overwrite === !1 ? "F" : "T" } }, r, n);
3396
+ return i = function(a) {
3397
+ L(r, a);
3398
+ }, (o = j(s, r)) && o.then || (o = Promise.resolve(o)), i ? o.then(i) : o;
3399
+ var o, i;
3400
+ }));
3401
+ var _s = O(172);
3402
+ function Vs(r) {
3403
+ if (Je(r)) return r.byteLength;
3404
+ if (Ke(r)) return r.length;
3405
+ if (typeof r == "string") return (0, _s.d)(r);
3406
+ throw new V({ info: { code: et.DataTypeNoLength } }, "Cannot calculate data length: Invalid type");
3407
+ }
3408
+ const Bs = /* @__PURE__ */ (function(r) {
3409
+ return function() {
3410
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3411
+ try {
3412
+ return Promise.resolve(r.apply(this, t));
3413
+ } catch (n) {
3414
+ return Promise.reject(n);
3415
+ }
3416
+ };
3417
+ })((function(r, t, e) {
3418
+ let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3419
+ const { contentLength: s = !0, overwrite: o = !0 } = n, i = { "Content-Type": "application/octet-stream" };
3420
+ s === !1 || (i["Content-Length"] = typeof s == "number" ? `${s}` : `${Vs(e)}`), o || (i["If-None-Match"] = "*");
3421
+ const a = R({ url: C(r.remoteURL, S(t)), method: "PUT", headers: i, data: e }, r, n);
3422
+ return c = function(u) {
3423
+ try {
3424
+ L(r, u);
3425
+ } catch (f) {
3426
+ const h = f;
3427
+ if (h.status !== 412 || o) throw h;
3428
+ return !1;
3429
+ }
3430
+ return !0;
3431
+ }, (l = j(a, r)) && l.then || (l = Promise.resolve(l)), c ? l.then(c) : l;
3432
+ var l, c;
3433
+ })), mr = /* @__PURE__ */ (function(r) {
3434
+ return function() {
3435
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3436
+ try {
3437
+ return Promise.resolve(r.apply(this, t));
3438
+ } catch (n) {
3439
+ return Promise.reject(n);
3440
+ }
3441
+ };
3442
+ })((function(r, t) {
3443
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3444
+ const n = R({ url: C(r.remoteURL, S(t)), method: "OPTIONS" }, r, e);
3445
+ return o = function(i) {
3446
+ try {
3447
+ L(r, i);
3448
+ } catch (a) {
3449
+ throw a;
3450
+ }
3451
+ return { compliance: (i.headers.get("DAV") ?? "").split(",").map(((a) => a.trim())), server: i.headers.get("Server") ?? "" };
3452
+ }, (s = j(n, r)) && s.then || (s = Promise.resolve(s)), o ? s.then(o) : s;
3453
+ var s, o;
3454
+ }));
3455
+ function Pt(r, t, e) {
3456
+ return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3457
+ }
3458
+ const Ws = ce((function(r, t, e, n, s) {
3459
+ let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
3460
+ if (e > n || e < 0) throw new V({ info: { code: et.InvalidUpdateRange } }, `Invalid update range ${e} for partial update`);
3461
+ const i = { "Content-Type": "application/octet-stream", "Content-Length": "" + (n - e + 1), "Content-Range": `bytes ${e}-${n}/*` }, a = R({ url: C(r.remoteURL, S(t)), method: "PUT", headers: i, data: s }, r, o);
3462
+ return Pt(j(a, r), (function(l) {
3463
+ L(r, l);
3464
+ }));
3465
+ }));
3466
+ function Ve(r, t) {
3467
+ var e = r();
3468
+ return e && e.then ? e.then(t) : t(e);
3469
+ }
3470
+ const qs = ce((function(r, t, e, n, s) {
3471
+ let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
3472
+ if (e > n || e < 0) throw new V({ info: { code: et.InvalidUpdateRange } }, `Invalid update range ${e} for partial update`);
3473
+ const i = { "Content-Type": "application/x-sabredav-partialupdate", "Content-Length": "" + (n - e + 1), "X-Update-Range": `bytes=${e}-${n}` }, a = R({ url: C(r.remoteURL, S(t)), method: "PATCH", headers: i, data: s }, r, o);
3474
+ return Pt(j(a, r), (function(l) {
3475
+ L(r, l);
3476
+ }));
3477
+ }));
3478
+ function ce(r) {
3479
+ return function() {
3480
+ for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3481
+ try {
3482
+ return Promise.resolve(r.apply(this, t));
3483
+ } catch (n) {
3484
+ return Promise.reject(n);
3485
+ }
3486
+ };
3487
+ }
3488
+ const Gs = ce((function(r, t, e, n, s) {
3489
+ let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
3490
+ return Pt(mr(r, t, o), (function(i) {
3491
+ let a = !1;
3492
+ return Ve((function() {
3493
+ if (i.compliance.includes("sabredav-partialupdate")) return Pt(qs(r, t, e, n, s, o), (function(l) {
3494
+ return a = !0, l;
3495
+ }));
3496
+ }), (function(l) {
3497
+ let c = !1;
3498
+ return a ? l : Ve((function() {
3499
+ if (i.server.includes("Apache") && i.compliance.includes("<http://apache.org/dav/propset/fs/1>")) return Pt(Ws(r, t, e, n, s, o), (function(u) {
3500
+ return c = !0, u;
3501
+ }));
3502
+ }), (function(u) {
3503
+ if (c) return u;
3504
+ throw new V({ info: { code: et.NotSupported } }, "Not supported");
3505
+ }));
3506
+ }));
3507
+ }));
3508
+ })), zs = "https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";
3509
+ function Hs(r) {
3510
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3511
+ const { authType: e = null, remoteBasePath: n, contactHref: s = zs, ha1: o, headers: i = {}, httpAgent: a, httpsAgent: l, password: c, token: u, username: f, withCredentials: h } = t;
3512
+ let d = e;
3513
+ d || (d = f || c ? W.Password : W.None);
3514
+ const g = { authType: d, remoteBasePath: n, contactHref: s, ha1: o, headers: Object.assign({}, i), httpAgent: a, httpsAgent: l, password: c, parsing: { attributeNamePrefix: t.attributeNamePrefix ?? "@", attributeParsers: [], tagParsers: [lr] }, remotePath: Kr(r), remoteURL: r, token: u, username: f, withCredentials: h };
3515
+ return Ye(g, f, c, u, o), { copyFile: (p, m, b) => Ln(g, p, m, b), createDirectory: (p, m) => ee(g, p, m), createReadStream: (p, m) => (function(b, y) {
3516
+ let v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3517
+ const w = new (Me()).PassThrough();
3518
+ return ms(b, y, v).then(((x) => {
3519
+ x.pipe(w);
3520
+ })).catch(((x) => {
3521
+ w.emit("error", x);
3522
+ })), w;
3523
+ })(g, p, m), createWriteStream: (p, m, b) => (function(y, v) {
3524
+ let w = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, x = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ys;
3525
+ const P = new (Me()).PassThrough(), E = {};
3526
+ w.overwrite === !1 && (E["If-None-Match"] = "*");
3527
+ const T = R({ url: C(y.remoteURL, S(v)), method: "PUT", headers: E, data: P, maxRedirects: 0 }, y, w);
3528
+ return j(T, y).then(((A) => L(y, A))).then(((A) => {
3529
+ setTimeout((() => {
3530
+ x(A);
3531
+ }), 0);
3532
+ })).catch(((A) => {
3533
+ P.emit("error", A);
3534
+ })), P;
3535
+ })(g, p, m, b), customRequest: (p, m) => bs(g, p, m), deleteFile: (p, m) => vs(g, p, m), exists: (p, m) => ws(g, p, m), getDirectoryContents: (p, m) => xs(g, p, m), getFileContents: (p, m) => Es(g, p, m), getFileDownloadLink: (p) => (function(m, b) {
3536
+ let y = C(m.remoteURL, S(b));
3537
+ const v = /^https:/i.test(y) ? "https" : "http";
3538
+ switch (m.authType) {
3539
+ case W.None:
3540
+ break;
3541
+ case W.Password: {
3542
+ const w = ve(m.headers.Authorization.replace(/^Basic /i, "").trim());
3543
+ y = y.replace(/^https?:\/\//, `${v}://${w}@`);
3544
+ break;
3545
+ }
3546
+ default:
3547
+ throw new V({ info: { code: et.LinkUnsupportedAuthType } }, `Unsupported auth type for file link: ${m.authType}`);
3548
+ }
3549
+ return y;
3550
+ })(g, p), getFileUploadLink: (p) => (function(m, b) {
3551
+ let y = `${C(m.remoteURL, S(b))}?Content-Type=application/octet-stream`;
3552
+ const v = /^https:/i.test(y) ? "https" : "http";
3553
+ switch (m.authType) {
3554
+ case W.None:
3555
+ break;
3556
+ case W.Password: {
3557
+ const w = ve(m.headers.Authorization.replace(/^Basic /i, "").trim());
3558
+ y = y.replace(/^https?:\/\//, `${v}://${w}@`);
3559
+ break;
3560
+ }
3561
+ default:
3562
+ throw new V({ info: { code: et.LinkUnsupportedAuthType } }, `Unsupported auth type for file link: ${m.authType}`);
3563
+ }
3564
+ return y;
3565
+ })(g, p), getHeaders: () => Object.assign({}, g.headers), getQuota: (p) => Ds(g, p), lock: (p, m) => Ls(g, p, m), moveFile: (p, m, b) => Ms(g, p, m, b), putFileContents: (p, m, b) => Bs(g, p, m, b), partialUpdateFileContents: (p, m, b, y, v) => Gs(g, p, m, b, y, v), getDAVCompliance: (p) => mr(g, p), search: (p, m) => ks(g, p, m), setHeaders: (p) => {
3566
+ g.headers = Object.assign({}, p);
3567
+ }, stat: (p, m) => ue(g, p, m), unlock: (p, m, b) => Rs(g, p, m, b), registerAttributeParser: (p) => {
3568
+ g.parsing.attributeParsers.push(p);
3569
+ }, registerTagParser: (p) => {
3570
+ g.parsing.tagParsers.push(p);
3571
+ } };
3572
+ }
3573
+ const U = [];
3574
+ for (let r = 0; r < 256; ++r)
3575
+ U.push((r + 256).toString(16).slice(1));
3576
+ function Xs(r, t = 0) {
3577
+ return (U[r[t + 0]] + U[r[t + 1]] + U[r[t + 2]] + U[r[t + 3]] + "-" + U[r[t + 4]] + U[r[t + 5]] + "-" + U[r[t + 6]] + U[r[t + 7]] + "-" + U[r[t + 8]] + U[r[t + 9]] + "-" + U[r[t + 10]] + U[r[t + 11]] + U[r[t + 12]] + U[r[t + 13]] + U[r[t + 14]] + U[r[t + 15]]).toLowerCase();
3578
+ }
3579
+ let Xt;
3580
+ const Ys = new Uint8Array(16);
3581
+ function Zs() {
3582
+ if (!Xt) {
3583
+ if (typeof crypto > "u" || !crypto.getRandomValues)
3584
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
3585
+ Xt = crypto.getRandomValues.bind(crypto);
3586
+ }
3587
+ return Xt(Ys);
3588
+ }
3589
+ const Js = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Be = { randomUUID: Js };
3590
+ function Ks(r, t, e) {
3591
+ r = r || {};
3592
+ const n = r.random ?? r.rng?.() ?? Zs();
3593
+ if (n.length < 16)
3594
+ throw new Error("Random bytes length must be >= 16");
3595
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Xs(n);
3596
+ }
3597
+ function Qs(r, t, e) {
3598
+ return Be.randomUUID && !r ? Be.randomUUID() : Ks(r);
3599
+ }
3600
+ const ne = (r, t) => Object.fromEntries(
3601
+ Object.entries(r).map(([e, n]) => t.includes(e) ? [e, n || ""] : [Et.DavNamespace.includes(e) ? `d:${e}` : `oc:${e}`, n || ""])
3602
+ ), We = (r = [], {
3603
+ pattern: t,
3604
+ filterRules: e,
3605
+ limit: n = 0,
3606
+ extraProps: s = []
3607
+ }) => {
3608
+ let o = "d:propfind";
3609
+ t && (o = "oc:search-files"), e && (o = "oc:filter-files");
3610
+ const i = r.reduce((u, f) => Object.assign(u, { [f]: null }), {}), a = ne(i, s), l = {
3611
+ [o]: {
3612
+ "d:prop": a,
3613
+ "@@xmlns:d": "DAV:",
3614
+ "@@xmlns:oc": "http://owncloud.org/ns",
3615
+ ...t && {
3616
+ "oc:search": { "oc:pattern": t, "oc:limit": n }
3617
+ },
3618
+ ...e && {
3619
+ "oc:filter-rules": ne(e, [])
3620
+ }
3621
+ }
3622
+ };
3623
+ return new J({
3624
+ format: !0,
3625
+ ignoreAttributes: !1,
3626
+ attributeNamePrefix: "@@",
3627
+ suppressEmptyNode: !0
3628
+ }).build(l);
3629
+ }, to = (r) => {
3630
+ const t = {
3631
+ "d:propertyupdate": {
3632
+ "d:set": { "d:prop": ne(r, []) },
3633
+ "@@xmlns:d": "DAV:",
3634
+ "@@xmlns:oc": "http://owncloud.org/ns"
3635
+ }
3636
+ };
3637
+ return new J({
3638
+ format: !0,
3639
+ ignoreAttributes: !1,
3640
+ attributeNamePrefix: "@@",
3641
+ suppressEmptyNode: !0
3642
+ }).build(t);
3643
+ }, eo = (r) => {
3644
+ const t = {}, e = r.get("tus-version");
3645
+ return e ? (t.version = e.split(","), r.get("tus-extension") && (t.extension = r.get("tus-extension").split(",")), r.get("tus-resumable") && (t.resumable = r.get("tus-resumable")), r.get("tus-max-size") && (t.maxSize = parseInt(r.get("tus-max-size"), 10)), t) : null;
3646
+ }, ro = async (r) => {
3647
+ const t = (n) => {
3648
+ const s = decodeURIComponent(n);
3649
+ return n?.startsWith("/remote.php/dav/") ? I(s.replace("/remote.php/dav/", ""), {
3650
+ leadingSlash: !0,
3651
+ trailingSlash: !1
3652
+ }) : s;
3653
+ };
3654
+ return (await Tt(r)).multistatus.response.map(({ href: n, propstat: s }) => {
3655
+ const o = {
3656
+ ...kt(s.prop, t(n), !0),
3657
+ processing: s.status === "HTTP/1.1 425 TOO EARLY"
3658
+ };
3659
+ return o.props.name && (o.props.name = o.props.name.toString()), o;
3660
+ });
3661
+ }, no = (r) => {
3662
+ const t = new Nr(), e = {
3663
+ message: "Unknown error",
3664
+ errorCode: void 0
3665
+ };
3666
+ try {
3667
+ const n = t.parse(r);
3668
+ if (!n["d:error"])
3669
+ return e;
3670
+ if (n["d:error"]["s:message"]) {
3671
+ const s = n["d:error"]["s:message"];
3672
+ typeof s == "string" && (e.message = s);
3673
+ }
3674
+ if (n["d:error"]["s:errorcode"]) {
3675
+ const s = n["d:error"]["s:errorcode"];
3676
+ typeof s == "string" && (e.errorCode = s);
3677
+ }
3678
+ } catch {
3679
+ return e;
3680
+ }
3681
+ return e;
3682
+ };
3683
+ class so {
3684
+ client;
3685
+ davPath;
3686
+ headers;
3687
+ extraProps;
3688
+ constructor({ baseUrl: t, headers: e }) {
3689
+ this.davPath = I(t, "remote.php/dav"), this.client = Hs(this.davPath, {}), this.headers = e, this.extraProps = [];
3690
+ }
3691
+ mkcol(t, e = {}) {
3692
+ return this.request(t, { method: Q.mkcol, ...e });
3693
+ }
3694
+ async propfind(t, {
3695
+ depth: e = 1,
3696
+ properties: n = [],
3697
+ headers: s = {},
3698
+ ...o
3699
+ } = {}) {
3700
+ const i = { ...s, Depth: e.toString() }, { body: a, result: l } = await this.request(t, {
3701
+ method: Q.propfind,
3702
+ data: We(n, { extraProps: this.extraProps }),
3703
+ headers: i,
3704
+ ...o
3705
+ });
3706
+ return a?.length && (a[0].tusSupport = eo(l.headers)), a;
3707
+ }
3708
+ async report(t, {
3709
+ pattern: e = "",
3710
+ filterRules: n = null,
3711
+ limit: s = 30,
3712
+ properties: o,
3713
+ ...i
3714
+ } = {}) {
3715
+ const { body: a, result: l } = await this.request(t, {
3716
+ method: Q.report,
3717
+ data: We(o, {
3718
+ pattern: e,
3719
+ filterRules: n,
3720
+ limit: s,
3721
+ extraProps: this.extraProps
3722
+ }),
3723
+ ...i
3724
+ });
3725
+ return {
3726
+ results: a,
3727
+ range: l.headers.get("content-range")
3728
+ };
3729
+ }
3730
+ copy(t, e, { overwrite: n = !1, headers: s = {}, ...o } = {}) {
3731
+ const i = I(this.davPath, Ct(e));
3732
+ return this.request(t, {
3733
+ method: Q.copy,
3734
+ headers: { ...s, Destination: i, overwrite: n ? "T" : "F" },
3735
+ ...o
3736
+ });
3737
+ }
3738
+ move(t, e, { overwrite: n = !1, headers: s = {}, ...o } = {}) {
3739
+ const i = I(this.davPath, Ct(e));
3740
+ return this.request(t, {
3741
+ method: Q.move,
3742
+ headers: { ...s, Destination: i, overwrite: n ? "T" : "F" },
3743
+ ...o
3744
+ });
3745
+ }
3746
+ put(t, e, {
3747
+ headers: n = {},
3748
+ onUploadProgress: s,
3749
+ previousEntityTag: o,
3750
+ overwrite: i,
3751
+ ...a
3752
+ } = {}) {
3753
+ const l = { ...n };
3754
+ return o ? l["If-Match"] = o : i || (l["If-None-Match"] = "*"), this.request(t, {
3755
+ method: Q.put,
3756
+ data: e,
3757
+ headers: l,
3758
+ onUploadProgress: s,
3759
+ ...a
3760
+ });
3761
+ }
3762
+ delete(t, e = {}) {
3763
+ return this.request(t, { method: Q.delete, ...e });
3764
+ }
3765
+ propPatch(t, e, n = {}) {
3766
+ const s = to(e);
3767
+ return this.request(t, { method: Q.proppatch, data: s, ...n });
3768
+ }
3769
+ getFileUrl(t) {
3770
+ return I(this.davPath, Ct(t));
3771
+ }
3772
+ buildHeaders(t = {}) {
3773
+ return {
3774
+ "Content-Type": "application/xml; charset=utf-8",
3775
+ "X-Requested-With": "XMLHttpRequest",
3776
+ "X-Request-ID": Qs(),
3777
+ ...this.headers && { ...this.headers() },
3778
+ ...t
3779
+ };
3780
+ }
3781
+ async request(t, e) {
3782
+ const n = I(this.davPath, Ct(t), { leadingSlash: !0 }), s = {
3783
+ ...e,
3784
+ url: n,
3785
+ headers: this.buildHeaders(e.headers || {})
3786
+ };
3787
+ try {
3788
+ const o = await this.client.customRequest("", s);
3789
+ let i;
3790
+ if (o.status === 207) {
3791
+ const a = await o.text();
3792
+ i = await ro(a);
3793
+ }
3794
+ return {
3795
+ body: i,
3796
+ status: o.status,
3797
+ result: o
3798
+ };
3799
+ } catch (o) {
3800
+ const { response: i } = o, a = await i.text(), l = no(a);
3801
+ throw new Pr(
3802
+ l.message,
3803
+ l.errorCode,
3804
+ i,
3805
+ i.status
3806
+ );
3807
+ }
3808
+ }
3809
+ }
3810
+ const oo = (r, t) => ({
3811
+ async listFileVersions(e, n = {}) {
3812
+ const [s, ...o] = await r.propfind(
3813
+ I("meta", e, "v", { leadingSlash: !0 }),
3814
+ n
3815
+ );
3816
+ return o.map((i) => lt(i, r.extraProps));
3817
+ }
3818
+ }), io = (r, t) => ({
3819
+ setFavorite(e, { path: n }, s, o = {}) {
3820
+ const i = { [ft.IsFavorite]: s ? "true" : "false" };
3821
+ return r.propPatch(I(e.webDavPath, n), i, o);
3822
+ }
3823
+ }), ao = (r, t) => ({
3824
+ listFavoriteFiles({
3825
+ davProperties: e = Et.Default,
3826
+ username: n = "",
3827
+ ...s
3828
+ } = {}) {
3829
+ return r.report(I("files", n), {
3830
+ properties: e,
3831
+ filterRules: { favorite: 1 },
3832
+ ...s
3833
+ });
3834
+ }
3835
+ }), po = (r, t) => {
3836
+ const e = br.create();
3837
+ t && e.interceptors.request.use((N) => (Object.assign(N.headers, t()), N));
3838
+ const n = { axiosClient: e, baseUrl: r }, s = new so({ baseUrl: r, headers: t }), o = (N) => {
3839
+ s.extraProps.push(N);
3840
+ }, i = Hr(s), { getPathForFileId: a } = i, l = Mr(s, i), { listFiles: c } = l, u = Ur(l), { getFileInfo: f } = u, { createFolder: h } = Rr(s, u), d = Lr(s, n), { getFileContents: g } = d, { putFileContents: p } = Vr(s, u), { getFileUrl: m, revokeUrl: b } = Dr(
3841
+ s,
3842
+ d,
3843
+ u,
3844
+ n
3845
+ ), { getPublicFileUrl: y } = kr(s), { copyFiles: v } = jr(s), { moveFiles: w } = _r(s), { deleteFile: x } = Br(s), { restoreFile: P } = Wr(s), { listFileVersions: E } = oo(s), { restoreFileVersion: T } = qr(s), { clearTrashBin: A } = Gr(s), { search: F } = zr(s), { listFavoriteFiles: rt } = ao(s), { setFavorite: nt } = io(s);
3846
+ return {
3847
+ copyFiles: v,
3848
+ createFolder: h,
3849
+ deleteFile: x,
3850
+ restoreFile: P,
3851
+ restoreFileVersion: T,
3852
+ getFileContents: g,
3853
+ getFileInfo: f,
3854
+ getFileUrl: m,
3855
+ getPublicFileUrl: y,
3856
+ getPathForFileId: a,
3857
+ listFiles: c,
3858
+ listFileVersions: E,
3859
+ moveFiles: w,
3860
+ putFileContents: p,
3861
+ revokeUrl: b,
3862
+ clearTrashBin: A,
3863
+ search: F,
3864
+ listFavoriteFiles: rt,
3865
+ setFavorite: nt,
3866
+ registerExtraProp: o
3867
+ };
3868
+ };
3869
+ export {
3870
+ Pr as D,
3871
+ Ge as H,
3872
+ Ct as e,
3873
+ po as w
3874
+ };