@nextcloud/files 3.1.0 → 3.2.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.
package/dist/index.mjs CHANGED
@@ -1,10 +1,11 @@
1
1
  import { getCurrentUser as A, onRequestTokenUpdate as ue, getRequestToken as de } from "@nextcloud/auth";
2
- import { getLoggerBuilder as q } from "@nextcloud/logger";
2
+ import { getLoggerBuilder as B } from "@nextcloud/logger";
3
3
  import { getCanonicalLocale as ae } from "@nextcloud/l10n";
4
4
  import { join as le, basename as fe, extname as ce, dirname as I } from "path";
5
5
  import { encodePath as he } from "@nextcloud/paths";
6
6
  import { generateRemoteUrl as pe } from "@nextcloud/router";
7
7
  import { createClient as ge, getPatcher as we } from "webdav";
8
+ import { CancelablePromise as me } from "cancelable-promise";
8
9
  /**
9
10
  * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
10
11
  *
@@ -26,7 +27,7 @@ import { createClient as ge, getPatcher as we } from "webdav";
26
27
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
27
28
  *
28
29
  */
29
- const me = (e) => e === null ? q().setApp("files").build() : q().setApp("files").setUid(e.uid).build(), m = me(A());
30
+ const Ne = (e) => e === null ? B().setApp("files").build() : B().setApp("files").setUid(e.uid).build(), m = Ne(A());
30
31
  /**
31
32
  * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>
32
33
  *
@@ -48,7 +49,7 @@ const me = (e) => e === null ? q().setApp("files").build() : q().setApp("files")
48
49
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
49
50
  *
50
51
  */
51
- class Ne {
52
+ class Ee {
52
53
  _entries = [];
53
54
  registerEntry(t) {
54
55
  this.validateEntry(t), this._entries.push(t);
@@ -90,7 +91,7 @@ class Ne {
90
91
  }
91
92
  }
92
93
  const F = function() {
93
- return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new Ne(), m.debug("NewFileMenu initialized")), window._nc_newfilemenu;
94
+ return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new Ee(), m.debug("NewFileMenu initialized")), window._nc_newfilemenu;
94
95
  };
95
96
  /**
96
97
  * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -114,16 +115,16 @@ const F = function() {
114
115
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
115
116
  *
116
117
  */
117
- const C = ["B", "KB", "MB", "GB", "TB", "PB"], P = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
118
- function Yt(e, t = !1, r = !1, s = !1) {
118
+ const O = ["B", "KB", "MB", "GB", "TB", "PB"], P = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
119
+ function Qt(e, t = !1, r = !1, s = !1) {
119
120
  r = r && !s, typeof e == "string" && (e = Number(e));
120
121
  let n = e > 0 ? Math.floor(Math.log(e) / Math.log(s ? 1e3 : 1024)) : 0;
121
- n = Math.min((r ? P.length : C.length) - 1, n);
122
- const i = r ? P[n] : C[n];
122
+ n = Math.min((r ? P.length : O.length) - 1, n);
123
+ const i = r ? P[n] : O[n];
123
124
  let d = (e / Math.pow(s ? 1e3 : 1024, n)).toFixed(1);
124
- return t === !0 && n === 0 ? (d !== "0.0" ? "< 1 " : "0 ") + (r ? P[1] : C[1]) : (n < 2 ? d = parseFloat(d).toFixed(0) : d = parseFloat(d).toLocaleString(ae()), d + " " + i);
125
+ return t === !0 && n === 0 ? (d !== "0.0" ? "< 1 " : "0 ") + (r ? P[1] : O[1]) : (n < 2 ? d = parseFloat(d).toFixed(0) : d = parseFloat(d).toLocaleString(ae()), d + " " + i);
125
126
  }
126
- function Jt(e, t = !1) {
127
+ function Dt(e, t = !1) {
127
128
  try {
128
129
  e = `${e}`.toLocaleLowerCase().replaceAll(/\s+/g, "").replaceAll(",", ".");
129
130
  } catch {
@@ -164,8 +165,8 @@ function Jt(e, t = !1) {
164
165
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
165
166
  *
166
167
  */
167
- var Z = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.HIDDEN = "hidden", e))(Z || {});
168
- class Qt {
168
+ var W = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.HIDDEN = "hidden", e))(W || {});
169
+ class er {
169
170
  _action;
170
171
  constructor(t) {
171
172
  this.validateAction(t), this._action = t;
@@ -225,7 +226,7 @@ class Qt {
225
226
  throw new Error("Invalid order");
226
227
  if ("parent" in t && typeof t.parent != "string")
227
228
  throw new Error("Invalid parent");
228
- if (t.default && !Object.values(Z).includes(t.default))
229
+ if (t.default && !Object.values(W).includes(t.default))
229
230
  throw new Error("Invalid default");
230
231
  if ("inline" in t && typeof t.inline != "function")
231
232
  throw new Error("Invalid inline function");
@@ -233,13 +234,13 @@ class Qt {
233
234
  throw new Error("Invalid renderInline function");
234
235
  }
235
236
  }
236
- const Dt = function(e) {
237
+ const tr = function(e) {
237
238
  if (typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions.find((t) => t.id === e.id)) {
238
239
  m.error(`FileAction ${e.id} already registered`, { action: e });
239
240
  return;
240
241
  }
241
242
  window._nc_fileactions.push(e);
242
- }, er = function() {
243
+ }, rr = function() {
243
244
  return typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions;
244
245
  };
245
246
  /**
@@ -263,7 +264,7 @@ const Dt = function(e) {
263
264
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
264
265
  *
265
266
  */
266
- class tr {
267
+ class nr {
267
268
  _header;
268
269
  constructor(t) {
269
270
  this.validateHeader(t), this._header = t;
@@ -296,13 +297,13 @@ class tr {
296
297
  throw new Error("Invalid updated property");
297
298
  }
298
299
  }
299
- const rr = function(e) {
300
+ const ir = function(e) {
300
301
  if (typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader.find((t) => t.id === e.id)) {
301
302
  m.error(`Header ${e.id} already registered`, { header: e });
302
303
  return;
303
304
  }
304
305
  window._nc_filelistheader.push(e);
305
- }, nr = function() {
306
+ }, sr = function() {
306
307
  return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader;
307
308
  };
308
309
  /**
@@ -349,7 +350,7 @@ var N = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.CREATE = 4] = "CREA
349
350
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
350
351
  *
351
352
  */
352
- const j = [
353
+ const Z = [
353
354
  "d:getcontentlength",
354
355
  "d:getcontenttype",
355
356
  "d:getetag",
@@ -359,44 +360,41 @@ const j = [
359
360
  "nc:has-preview",
360
361
  "nc:is-encrypted",
361
362
  "nc:mount-type",
362
- "nc:share-attributes",
363
363
  "oc:comments-unread",
364
364
  "oc:favorite",
365
365
  "oc:fileid",
366
366
  "oc:owner-display-name",
367
367
  "oc:owner-id",
368
368
  "oc:permissions",
369
- "oc:share-types",
370
- "oc:size",
371
- "ocs:share-permissions"
372
- ], Y = {
369
+ "oc:size"
370
+ ], j = {
373
371
  d: "DAV:",
374
372
  nc: "http://nextcloud.org/ns",
375
373
  oc: "http://owncloud.org/ns",
376
374
  ocs: "http://open-collaboration-services.org/ns"
377
- }, ir = function(e, t = { nc: "http://nextcloud.org/ns" }) {
378
- typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...j], window._nc_dav_namespaces = { ...Y });
375
+ }, or = function(e, t = { nc: "http://nextcloud.org/ns" }) {
376
+ typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...Z], window._nc_dav_namespaces = { ...j });
379
377
  const r = { ...window._nc_dav_namespaces, ...t };
380
378
  if (window._nc_dav_properties.find((n) => n === e))
381
- return m.error(`${e} already registered`, { prop: e }), !1;
379
+ return m.warn(`${e} already registered`, { prop: e }), !1;
382
380
  if (e.startsWith("<") || e.split(":").length !== 2)
383
381
  return m.error(`${e} is not valid. See example: 'oc:fileid'`, { prop: e }), !1;
384
382
  const s = e.split(":")[0];
385
383
  return r[s] ? (window._nc_dav_properties.push(e), window._nc_dav_namespaces = r, !0) : (m.error(`${e} namespace unknown`, { prop: e, namespaces: r }), !1);
386
384
  }, V = function() {
387
- return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...j]), window._nc_dav_properties.map((e) => `<${e} />`).join(" ");
388
- }, L = function() {
389
- return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...Y }), Object.keys(window._nc_dav_namespaces).map((e) => `xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ");
390
- }, sr = function() {
385
+ return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...Z]), window._nc_dav_properties.map((e) => `<${e} />`).join(" ");
386
+ }, S = function() {
387
+ return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...j }), Object.keys(window._nc_dav_namespaces).map((e) => `xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ");
388
+ }, ur = function() {
391
389
  return `<?xml version="1.0"?>
392
- <d:propfind ${L()}>
390
+ <d:propfind ${S()}>
393
391
  <d:prop>
394
392
  ${V()}
395
393
  </d:prop>
396
394
  </d:propfind>`;
397
- }, Ee = function() {
395
+ }, be = function() {
398
396
  return `<?xml version="1.0"?>
399
- <oc:filter-files ${L()}>
397
+ <oc:filter-files ${S()}>
400
398
  <d:prop>
401
399
  ${V()}
402
400
  </d:prop>
@@ -404,9 +402,9 @@ const j = [
404
402
  <oc:favorite>1</oc:favorite>
405
403
  </oc:filter-rules>
406
404
  </oc:filter-files>`;
407
- }, or = function(e) {
405
+ }, dr = function(e) {
408
406
  return `<?xml version="1.0" encoding="UTF-8"?>
409
- <d:searchrequest ${L()}
407
+ <d:searchrequest ${S()}
410
408
  xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
411
409
  <d:basicsearch>
412
410
  <d:select>
@@ -483,7 +481,7 @@ const j = [
483
481
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
484
482
  *
485
483
  */
486
- const be = function(e = "") {
484
+ const ye = function(e = "") {
487
485
  let t = N.NONE;
488
486
  return e && ((e.includes("C") || e.includes("K")) && (t |= N.CREATE), e.includes("G") && (t |= N.READ), (e.includes("W") || e.includes("N") || e.includes("V")) && (t |= N.UPDATE), e.includes("D") && (t |= N.DELETE), e.includes("R") && (t |= N.SHARE)), t;
489
487
  };
@@ -508,7 +506,7 @@ const be = function(e = "") {
508
506
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
509
507
  *
510
508
  */
511
- var R = /* @__PURE__ */ ((e) => (e.Folder = "folder", e.File = "file", e))(R || {});
509
+ var L = /* @__PURE__ */ ((e) => (e.Folder = "folder", e.File = "file", e))(L || {});
512
510
  /**
513
511
  * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
514
512
  *
@@ -530,9 +528,9 @@ var R = /* @__PURE__ */ ((e) => (e.Folder = "folder", e.File = "file", e))(R ||
530
528
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
531
529
  *
532
530
  */
533
- const J = function(e, t) {
531
+ const Y = function(e, t) {
534
532
  return e.match(t) !== null;
535
- }, X = (e, t) => {
533
+ }, q = (e, t) => {
536
534
  if (e.id && typeof e.id != "number")
537
535
  throw new Error("Invalid id type of value");
538
536
  if (!e.source)
@@ -564,12 +562,12 @@ const J = function(e, t) {
564
562
  throw new Error("Root must start with a leading slash");
565
563
  if (e.root && !e.source.includes(e.root))
566
564
  throw new Error("Root must be part of the source");
567
- if (e.root && J(e.source, t)) {
565
+ if (e.root && Y(e.source, t)) {
568
566
  const r = e.source.match(t)[0];
569
567
  if (!e.source.includes(le(r, e.root)))
570
568
  throw new Error("The root must be relative to the service. e.g /files/emma");
571
569
  }
572
- if (e.status && !Object.values(Q).includes(e.status))
570
+ if (e.status && !Object.values(J).includes(e.status))
573
571
  throw new Error("Status must be a valid NodeStatus");
574
572
  };
575
573
  /**
@@ -593,13 +591,13 @@ const J = function(e, t) {
593
591
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
594
592
  *
595
593
  */
596
- var Q = /* @__PURE__ */ ((e) => (e.NEW = "new", e.FAILED = "failed", e.LOADING = "loading", e.LOCKED = "locked", e))(Q || {});
597
- class D {
594
+ var J = /* @__PURE__ */ ((e) => (e.NEW = "new", e.FAILED = "failed", e.LOADING = "loading", e.LOCKED = "locked", e))(J || {});
595
+ class Q {
598
596
  _data;
599
597
  _attributes;
600
598
  _knownDavService = /(remote|public)\.php\/(web)?dav/i;
601
599
  constructor(t, r) {
602
- X(t, r || this._knownDavService), this._data = t;
600
+ q(t, r || this._knownDavService), this._data = t;
603
601
  const s = {
604
602
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
605
603
  set: (n, i, d) => (this.updateMtime(), Reflect.set(n, i, d)),
@@ -693,7 +691,7 @@ class D {
693
691
  * Is this a dav-related ressource ?
694
692
  */
695
693
  get isDavRessource() {
696
- return J(this.source, this._knownDavService);
694
+ return Y(this.source, this._knownDavService);
697
695
  }
698
696
  /**
699
697
  * Get the dav root of this object
@@ -739,7 +737,7 @@ class D {
739
737
  * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg
740
738
  */
741
739
  move(t) {
742
- X({ ...this._data, source: t }, this._knownDavService), this._data.source = t, this.updateMtime();
740
+ q({ ...this._data, source: t }, this._knownDavService), this._data.source = t, this.updateMtime();
743
741
  }
744
742
  /**
745
743
  * Rename the node
@@ -780,9 +778,9 @@ class D {
780
778
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
781
779
  *
782
780
  */
783
- class ye extends D {
781
+ class _e extends Q {
784
782
  get type() {
785
- return R.File;
783
+ return L.File;
786
784
  }
787
785
  }
788
786
  /**
@@ -806,7 +804,7 @@ class ye extends D {
806
804
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
807
805
  *
808
806
  */
809
- class _e extends D {
807
+ class ve extends Q {
810
808
  constructor(t) {
811
809
  super({
812
810
  ...t,
@@ -814,7 +812,7 @@ class _e extends D {
814
812
  });
815
813
  }
816
814
  get type() {
817
- return R.Folder;
815
+ return L.Folder;
818
816
  }
819
817
  get extension() {
820
818
  return null;
@@ -845,7 +843,7 @@ class _e extends D {
845
843
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
846
844
  *
847
845
  */
848
- const ee = `/files/${A()?.uid}`, te = pe("dav"), ur = function(e = te, t = {}) {
846
+ const D = `/files/${A()?.uid}`, ee = pe("dav"), ar = function(e = ee, t = {}) {
849
847
  const r = ge(e, { headers: t });
850
848
  function s(i) {
851
849
  r.setHeaders({
@@ -860,31 +858,46 @@ const ee = `/files/${A()?.uid}`, te = pe("dav"), ur = function(e = te, t = {}) {
860
858
  const u = d.headers;
861
859
  return u?.method && (d.method = u.method, delete u.method), fetch(i, d);
862
860
  }), r;
863
- }, dr = async (e, t = "/", r = ee) => (await e.getDirectoryContents(`${r}${t}`, {
864
- details: !0,
865
- data: Ee(),
866
- headers: {
867
- // see davGetClient for patched webdav client
868
- method: "REPORT"
869
- },
870
- includeSelf: !0
871
- })).data.filter((n) => n.filename !== t).map((n) => ve(n, r)), ve = function(e, t = ee, r = te) {
872
- const s = e.props, n = be(s?.permissions), i = s?.["owner-id"] || A()?.uid, d = {
873
- id: s?.fileid || 0,
861
+ }, lr = (e, t = "/", r = D) => {
862
+ const s = new AbortController();
863
+ return new me(async (n, i, d) => {
864
+ d(() => s.abort());
865
+ try {
866
+ const o = (await e.getDirectoryContents(`${r}${t}`, {
867
+ signal: s.signal,
868
+ details: !0,
869
+ data: be(),
870
+ headers: {
871
+ // see davGetClient for patched webdav client
872
+ method: "REPORT"
873
+ },
874
+ includeSelf: !0
875
+ })).data.filter((a) => a.filename !== t).map((a) => Te(a, r));
876
+ n(o);
877
+ } catch (u) {
878
+ i(u);
879
+ }
880
+ });
881
+ }, Te = function(e, t = D, r = ee) {
882
+ const s = A()?.uid;
883
+ if (!s)
884
+ throw new Error("No user id found");
885
+ const n = e.props, i = ye(n?.permissions), d = (n?.["owner-id"] || s).toString(), u = {
886
+ id: n?.fileid || 0,
874
887
  source: `${r}${e.filename}`,
875
888
  mtime: new Date(Date.parse(e.lastmod)),
876
- mime: e.mime,
877
- size: s?.size || Number.parseInt(s.getcontentlength || "0"),
878
- permissions: n,
879
- owner: i,
889
+ mime: e.mime || "application/octet-stream",
890
+ size: n?.size || Number.parseInt(n.getcontentlength || "0"),
891
+ permissions: i,
892
+ owner: d,
880
893
  root: t,
881
894
  attributes: {
882
895
  ...e,
883
- ...s,
884
- hasPreview: s?.["has-preview"]
896
+ ...n,
897
+ hasPreview: n?.["has-preview"]
885
898
  }
886
899
  };
887
- return delete d.attributes?.props, e.type === "file" ? new ye(d) : new _e(d);
900
+ return delete u.attributes?.props, e.type === "file" ? new _e(u) : new ve(u);
888
901
  };
889
902
  /**
890
903
  * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
@@ -907,7 +920,7 @@ const ee = `/files/${A()?.uid}`, te = pe("dav"), ur = function(e = te, t = {}) {
907
920
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
908
921
  *
909
922
  */
910
- class Te {
923
+ class Ie {
911
924
  _views = [];
912
925
  _currentView = null;
913
926
  register(t) {
@@ -929,8 +942,8 @@ class Te {
929
942
  return this._currentView;
930
943
  }
931
944
  }
932
- const ar = function() {
933
- return typeof window._nc_navigation > "u" && (window._nc_navigation = new Te(), m.debug("Navigation service initialized")), window._nc_navigation;
945
+ const fr = function() {
946
+ return typeof window._nc_navigation > "u" && (window._nc_navigation = new Ie(), m.debug("Navigation service initialized")), window._nc_navigation;
934
947
  };
935
948
  /**
936
949
  * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
@@ -953,10 +966,10 @@ const ar = function() {
953
966
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
954
967
  *
955
968
  */
956
- class Ie {
969
+ class Ae {
957
970
  _column;
958
971
  constructor(t) {
959
- Ae(t), this._column = t;
972
+ Ce(t), this._column = t;
960
973
  }
961
974
  get id() {
962
975
  return this._column.id;
@@ -974,7 +987,7 @@ class Ie {
974
987
  return this._column.summary;
975
988
  }
976
989
  }
977
- const Ae = function(e) {
990
+ const Ce = function(e) {
978
991
  if (!e.id || typeof e.id != "string")
979
992
  throw new Error("A column id is required");
980
993
  if (!e.title || typeof e.title != "string")
@@ -987,7 +1000,7 @@ const Ae = function(e) {
987
1000
  throw new Error("Column summary must be a function");
988
1001
  return !0;
989
1002
  };
990
- var S = {}, O = {};
1003
+ var R = {}, C = {};
991
1004
  (function(e) {
992
1005
  const t = ":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", r = t + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", s = "[" + t + "][" + r + "]*", n = new RegExp("^" + s + "$"), i = function(u, o) {
993
1006
  const a = [];
@@ -1018,25 +1031,25 @@ var S = {}, O = {};
1018
1031
  }, e.getValue = function(u) {
1019
1032
  return e.isExist(u) ? u : "";
1020
1033
  }, e.isName = d, e.getAllMatches = i, e.nameRegexp = s;
1021
- })(O);
1022
- const M = O, Oe = {
1034
+ })(C);
1035
+ const M = C, Oe = {
1023
1036
  allowBooleanAttributes: !1,
1024
1037
  //A tag can have attributes without any value
1025
1038
  unpairedTags: []
1026
1039
  };
1027
- S.validate = function(e, t) {
1040
+ R.validate = function(e, t) {
1028
1041
  t = Object.assign({}, Oe, t);
1029
1042
  const r = [];
1030
1043
  let s = !1, n = !1;
1031
1044
  e[0] === "\uFEFF" && (e = e.substr(1));
1032
1045
  for (let i = 0; i < e.length; i++)
1033
1046
  if (e[i] === "<" && e[i + 1] === "?") {
1034
- if (i += 2, i = G(e, i), i.err)
1047
+ if (i += 2, i = U(e, i), i.err)
1035
1048
  return i;
1036
1049
  } else if (e[i] === "<") {
1037
1050
  let d = i;
1038
1051
  if (i++, e[i] === "!") {
1039
- i = z(e, i);
1052
+ i = G(e, i);
1040
1053
  continue;
1041
1054
  } else {
1042
1055
  let u = !1;
@@ -1049,14 +1062,14 @@ S.validate = function(e, t) {
1049
1062
  let f;
1050
1063
  return o.trim().length === 0 ? f = "Invalid space after '<'." : f = "Tag '" + o + "' is an invalid name.", p("InvalidTag", f, w(e, i));
1051
1064
  }
1052
- const a = xe(e, i);
1065
+ const a = $e(e, i);
1053
1066
  if (a === !1)
1054
1067
  return p("InvalidAttr", "Attributes for '" + o + "' have open quote.", w(e, i));
1055
1068
  let l = a.value;
1056
1069
  if (i = a.index, l[l.length - 1] === "/") {
1057
1070
  const f = i - l.length;
1058
1071
  l = l.substring(0, l.length - 1);
1059
- const c = H(l, t);
1072
+ const c = z(l, t);
1060
1073
  if (c === !0)
1061
1074
  s = !0;
1062
1075
  else
@@ -1080,7 +1093,7 @@ S.validate = function(e, t) {
1080
1093
  } else
1081
1094
  return p("InvalidTag", "Closing tag '" + o + "' doesn't have proper closing.", w(e, i));
1082
1095
  else {
1083
- const f = H(l, t);
1096
+ const f = z(l, t);
1084
1097
  if (f !== !0)
1085
1098
  return p(f.err.code, f.err.msg, w(e, i - l.length + f.err.line));
1086
1099
  if (n === !0)
@@ -1090,24 +1103,24 @@ S.validate = function(e, t) {
1090
1103
  for (i++; i < e.length; i++)
1091
1104
  if (e[i] === "<")
1092
1105
  if (e[i + 1] === "!") {
1093
- i++, i = z(e, i);
1106
+ i++, i = G(e, i);
1094
1107
  continue;
1095
1108
  } else if (e[i + 1] === "?") {
1096
- if (i = G(e, ++i), i.err)
1109
+ if (i = U(e, ++i), i.err)
1097
1110
  return i;
1098
1111
  } else
1099
1112
  break;
1100
1113
  else if (e[i] === "&") {
1101
- const f = Ve(e, i);
1114
+ const f = Se(e, i);
1102
1115
  if (f == -1)
1103
1116
  return p("InvalidChar", "char '&' is not expected.", w(e, i));
1104
1117
  i = f;
1105
- } else if (n === !0 && !U(e[i]))
1118
+ } else if (n === !0 && !X(e[i]))
1106
1119
  return p("InvalidXml", "Extra text at the end", w(e, i));
1107
1120
  e[i] === "<" && i--;
1108
1121
  }
1109
1122
  } else {
1110
- if (U(e[i]))
1123
+ if (X(e[i]))
1111
1124
  continue;
1112
1125
  return p("InvalidChar", "char '" + e[i] + "' is not expected.", w(e, i));
1113
1126
  }
@@ -1120,11 +1133,11 @@ S.validate = function(e, t) {
1120
1133
  return p("InvalidXml", "Start tag expected.", 1);
1121
1134
  return !0;
1122
1135
  };
1123
- function U(e) {
1136
+ function X(e) {
1124
1137
  return e === " " || e === " " || e === `
1125
1138
  ` || e === "\r";
1126
1139
  }
1127
- function G(e, t) {
1140
+ function U(e, t) {
1128
1141
  const r = t;
1129
1142
  for (; t < e.length; t++)
1130
1143
  if (e[t] == "?" || e[t] == " ") {
@@ -1139,7 +1152,7 @@ function G(e, t) {
1139
1152
  }
1140
1153
  return t;
1141
1154
  }
1142
- function z(e, t) {
1155
+ function G(e, t) {
1143
1156
  if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
1144
1157
  for (t += 3; t < e.length; t++)
1145
1158
  if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
@@ -1162,11 +1175,11 @@ function z(e, t) {
1162
1175
  }
1163
1176
  return t;
1164
1177
  }
1165
- const Ce = '"', Pe = "'";
1166
- function xe(e, t) {
1178
+ const Pe = '"', xe = "'";
1179
+ function $e(e, t) {
1167
1180
  let r = "", s = "", n = !1;
1168
1181
  for (; t < e.length; t++) {
1169
- if (e[t] === Ce || e[t] === Pe)
1182
+ if (e[t] === Pe || e[t] === xe)
1170
1183
  s === "" ? s = e[t] : s !== e[t] || (s = "");
1171
1184
  else if (e[t] === ">" && s === "") {
1172
1185
  n = !0;
@@ -1180,9 +1193,9 @@ function xe(e, t) {
1180
1193
  tagClosed: n
1181
1194
  };
1182
1195
  }
1183
- const $e = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
1184
- function H(e, t) {
1185
- const r = M.getAllMatches(e, $e), s = {};
1196
+ const Fe = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
1197
+ function z(e, t) {
1198
+ const r = M.getAllMatches(e, Fe), s = {};
1186
1199
  for (let n = 0; n < r.length; n++) {
1187
1200
  if (r[n][1].length === 0)
1188
1201
  return p("InvalidAttr", "Attribute '" + r[n][2] + "' has no space in starting.", v(r[n]));
@@ -1200,7 +1213,7 @@ function H(e, t) {
1200
1213
  }
1201
1214
  return !0;
1202
1215
  }
1203
- function Fe(e, t) {
1216
+ function Ve(e, t) {
1204
1217
  let r = /\d/;
1205
1218
  for (e[t] === "x" && (t++, r = /[\da-fA-F]/); t < e.length; t++) {
1206
1219
  if (e[t] === ";")
@@ -1210,11 +1223,11 @@ function Fe(e, t) {
1210
1223
  }
1211
1224
  return -1;
1212
1225
  }
1213
- function Ve(e, t) {
1226
+ function Se(e, t) {
1214
1227
  if (t++, e[t] === ";")
1215
1228
  return -1;
1216
1229
  if (e[t] === "#")
1217
- return t++, Fe(e, t);
1230
+ return t++, Ve(e, t);
1218
1231
  let r = 0;
1219
1232
  for (; t < e.length; t++, r++)
1220
1233
  if (!(e[t].match(/\w/) && r < 20)) {
@@ -1252,7 +1265,7 @@ function v(e) {
1252
1265
  return e.startIndex + e[1].length;
1253
1266
  }
1254
1267
  var k = {};
1255
- const re = {
1268
+ const te = {
1256
1269
  preserveOrder: !1,
1257
1270
  attributeNamePrefix: "@_",
1258
1271
  attributesGroupName: !1,
@@ -1295,12 +1308,12 @@ const re = {
1295
1308
  return e;
1296
1309
  }
1297
1310
  // skipEmptyListItem: false
1298
- }, Se = function(e) {
1299
- return Object.assign({}, re, e);
1311
+ }, Me = function(e) {
1312
+ return Object.assign({}, te, e);
1300
1313
  };
1301
- k.buildOptions = Se;
1302
- k.defaultOptions = re;
1303
- class Me {
1314
+ k.buildOptions = Me;
1315
+ k.defaultOptions = te;
1316
+ class ke {
1304
1317
  constructor(t) {
1305
1318
  this.tagname = t, this.child = [], this[":@"] = {};
1306
1319
  }
@@ -1311,27 +1324,27 @@ class Me {
1311
1324
  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 });
1312
1325
  }
1313
1326
  }
1314
- var ke = Me;
1315
- const Be = O;
1316
- function qe(e, t) {
1327
+ var Be = ke;
1328
+ const qe = C;
1329
+ function Xe(e, t) {
1317
1330
  const r = {};
1318
1331
  if (e[t + 3] === "O" && e[t + 4] === "C" && e[t + 5] === "T" && e[t + 6] === "Y" && e[t + 7] === "P" && e[t + 8] === "E") {
1319
1332
  t = t + 9;
1320
1333
  let s = 1, n = !1, i = !1, d = "";
1321
1334
  for (; t < e.length; t++)
1322
1335
  if (e[t] === "<" && !i) {
1323
- if (n && Ge(e, t))
1324
- t += 7, [entityName, val, t] = Xe(e, t + 1), val.indexOf("&") === -1 && (r[We(entityName)] = {
1336
+ if (n && ze(e, t))
1337
+ t += 7, [entityName, val, t] = Ue(e, t + 1), val.indexOf("&") === -1 && (r[Ze(entityName)] = {
1325
1338
  regx: RegExp(`&${entityName};`, "g"),
1326
1339
  val
1327
1340
  });
1328
- else if (n && ze(e, t))
1329
- t += 8;
1330
1341
  else if (n && He(e, t))
1331
1342
  t += 8;
1332
1343
  else if (n && Ke(e, t))
1344
+ t += 8;
1345
+ else if (n && We(e, t))
1333
1346
  t += 9;
1334
- else if (Ue)
1347
+ else if (Ge)
1335
1348
  i = !0;
1336
1349
  else
1337
1350
  throw new Error("Invalid DOCTYPE");
@@ -1347,7 +1360,7 @@ function qe(e, t) {
1347
1360
  throw new Error("Invalid Tag instead of DOCTYPE");
1348
1361
  return { entities: r, i: t };
1349
1362
  }
1350
- function Xe(e, t) {
1363
+ function Ue(e, t) {
1351
1364
  let r = "";
1352
1365
  for (; t < e.length && e[t] !== "'" && e[t] !== '"'; t++)
1353
1366
  r += e[t];
@@ -1359,50 +1372,50 @@ function Xe(e, t) {
1359
1372
  n += e[t];
1360
1373
  return [r, n, t];
1361
1374
  }
1362
- function Ue(e, t) {
1375
+ function Ge(e, t) {
1363
1376
  return e[t + 1] === "!" && e[t + 2] === "-" && e[t + 3] === "-";
1364
1377
  }
1365
- function Ge(e, t) {
1378
+ function ze(e, t) {
1366
1379
  return e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "N" && e[t + 4] === "T" && e[t + 5] === "I" && e[t + 6] === "T" && e[t + 7] === "Y";
1367
1380
  }
1368
- function ze(e, t) {
1381
+ function He(e, t) {
1369
1382
  return e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "L" && e[t + 4] === "E" && e[t + 5] === "M" && e[t + 6] === "E" && e[t + 7] === "N" && e[t + 8] === "T";
1370
1383
  }
1371
- function He(e, t) {
1384
+ function Ke(e, t) {
1372
1385
  return e[t + 1] === "!" && e[t + 2] === "A" && e[t + 3] === "T" && e[t + 4] === "T" && e[t + 5] === "L" && e[t + 6] === "I" && e[t + 7] === "S" && e[t + 8] === "T";
1373
1386
  }
1374
- function Ke(e, t) {
1387
+ function We(e, t) {
1375
1388
  return e[t + 1] === "!" && e[t + 2] === "N" && e[t + 3] === "O" && e[t + 4] === "T" && e[t + 5] === "A" && e[t + 6] === "T" && e[t + 7] === "I" && e[t + 8] === "O" && e[t + 9] === "N";
1376
1389
  }
1377
- function We(e) {
1378
- if (Be.isName(e))
1390
+ function Ze(e) {
1391
+ if (qe.isName(e))
1379
1392
  return e;
1380
1393
  throw new Error(`Invalid entity name ${e}`);
1381
1394
  }
1382
- var Ze = qe;
1383
- const je = /^[-+]?0x[a-fA-F0-9]+$/, Ye = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
1395
+ var je = Xe;
1396
+ const Ye = /^[-+]?0x[a-fA-F0-9]+$/, Je = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
1384
1397
  !Number.parseInt && window.parseInt && (Number.parseInt = window.parseInt);
1385
1398
  !Number.parseFloat && window.parseFloat && (Number.parseFloat = window.parseFloat);
1386
- const Je = {
1399
+ const Qe = {
1387
1400
  hex: !0,
1388
1401
  leadingZeros: !0,
1389
1402
  decimalPoint: ".",
1390
1403
  eNotation: !0
1391
1404
  //skipLike: /regex/
1392
1405
  };
1393
- function Qe(e, t = {}) {
1394
- if (t = Object.assign({}, Je, t), !e || typeof e != "string")
1406
+ function De(e, t = {}) {
1407
+ if (t = Object.assign({}, Qe, t), !e || typeof e != "string")
1395
1408
  return e;
1396
1409
  let r = e.trim();
1397
1410
  if (t.skipLike !== void 0 && t.skipLike.test(r))
1398
1411
  return e;
1399
- if (t.hex && je.test(r))
1412
+ if (t.hex && Ye.test(r))
1400
1413
  return Number.parseInt(r, 16);
1401
1414
  {
1402
- const s = Ye.exec(r);
1415
+ const s = Je.exec(r);
1403
1416
  if (s) {
1404
1417
  const n = s[1], i = s[2];
1405
- let d = De(s[3]);
1418
+ let d = et(s[3]);
1406
1419
  const u = s[4] || s[6];
1407
1420
  if (!t.leadingZeros && i.length > 0 && n && r[2] !== ".")
1408
1421
  return e;
@@ -1416,13 +1429,12 @@ function Qe(e, t = {}) {
1416
1429
  return e;
1417
1430
  }
1418
1431
  }
1419
- function De(e) {
1432
+ function et(e) {
1420
1433
  return e && e.indexOf(".") !== -1 && (e = e.replace(/0+$/, ""), e === "." ? e = "0" : e[0] === "." ? e = "0" + e : e[e.length - 1] === "." && (e = e.substr(0, e.length - 1))), e;
1421
1434
  }
1422
- var et = Qe;
1423
- const B = O, T = ke, tt = Ze, rt = et;
1424
- "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, B.nameRegexp);
1425
- let nt = class {
1435
+ var tt = De;
1436
+ const re = C, T = Be, rt = je, nt = tt;
1437
+ let it = class {
1426
1438
  constructor(t) {
1427
1439
  this.options = t, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
1428
1440
  apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
@@ -1442,11 +1454,13 @@ let nt = class {
1442
1454
  euro: { regex: /&(euro|#8364);/g, val: "€" },
1443
1455
  copyright: { regex: /&(copy|#169);/g, val: "©" },
1444
1456
  reg: { regex: /&(reg|#174);/g, val: "®" },
1445
- inr: { regex: /&(inr|#8377);/g, val: "₹" }
1446
- }, this.addExternalEntities = it, this.parseXml = at, this.parseTextData = st, this.resolveNameSpace = ot, this.buildAttributesMap = dt, this.isItStopNode = ht, this.replaceEntitiesValue = ft, this.readStopNodeData = gt, this.saveTextToParentTag = ct, this.addChild = lt;
1457
+ inr: { regex: /&(inr|#8377);/g, val: "₹" },
1458
+ num_dec: { regex: /&#([0-9]{1,7});/g, val: (r, s) => String.fromCharCode(Number.parseInt(s, 10)) },
1459
+ num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (r, s) => String.fromCharCode(Number.parseInt(s, 16)) }
1460
+ }, this.addExternalEntities = st, this.parseXml = lt, this.parseTextData = ot, this.resolveNameSpace = ut, this.buildAttributesMap = at, this.isItStopNode = pt, this.replaceEntitiesValue = ct, this.readStopNodeData = wt, this.saveTextToParentTag = ht, this.addChild = ft;
1447
1461
  }
1448
1462
  };
1449
- function it(e) {
1463
+ function st(e) {
1450
1464
  const t = Object.keys(e);
1451
1465
  for (let r = 0; r < t.length; r++) {
1452
1466
  const s = t[r];
@@ -1456,14 +1470,14 @@ function it(e) {
1456
1470
  };
1457
1471
  }
1458
1472
  }
1459
- function st(e, t, r, s, n, i, d) {
1473
+ function ot(e, t, r, s, n, i, d) {
1460
1474
  if (e !== void 0 && (this.options.trimValues && !s && (e = e.trim()), e.length > 0)) {
1461
1475
  d || (e = this.replaceEntitiesValue(e));
1462
1476
  const u = this.options.tagValueProcessor(t, e, r, n, i);
1463
1477
  return u == null ? e : typeof u != typeof e || u !== e ? u : this.options.trimValues ? $(e, this.options.parseTagValue, this.options.numberParseOptions) : e.trim() === e ? $(e, this.options.parseTagValue, this.options.numberParseOptions) : e;
1464
1478
  }
1465
1479
  }
1466
- function ot(e) {
1480
+ function ut(e) {
1467
1481
  if (this.options.removeNSPrefix) {
1468
1482
  const t = e.split(":"), r = e.charAt(0) === "/" ? "/" : "";
1469
1483
  if (t[0] === "xmlns")
@@ -1472,10 +1486,10 @@ function ot(e) {
1472
1486
  }
1473
1487
  return e;
1474
1488
  }
1475
- const ut = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
1476
- function dt(e, t, r) {
1489
+ const dt = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
1490
+ function at(e, t, r) {
1477
1491
  if (!this.options.ignoreAttributes && typeof e == "string") {
1478
- const s = B.getAllMatches(e, ut), n = s.length, i = {};
1492
+ const s = re.getAllMatches(e, dt), n = s.length, i = {};
1479
1493
  for (let d = 0; d < n; d++) {
1480
1494
  const u = this.resolveNameSpace(s[d][1]);
1481
1495
  let o = s[d][4], a = this.options.attributeNamePrefix + u;
@@ -1500,7 +1514,7 @@ function dt(e, t, r) {
1500
1514
  return i;
1501
1515
  }
1502
1516
  }
1503
- const at = function(e) {
1517
+ const lt = function(e) {
1504
1518
  e = e.replace(/\r\n?/g, `
1505
1519
  `);
1506
1520
  const t = new T("!xml");
@@ -1537,17 +1551,13 @@ const at = function(e) {
1537
1551
  }
1538
1552
  i = u;
1539
1553
  } else if (e.substr(i + 1, 2) === "!D") {
1540
- const u = tt(e, i);
1554
+ const u = rt(e, i);
1541
1555
  this.docTypeEntities = u.entities, i = u.i;
1542
1556
  } else if (e.substr(i + 1, 2) === "![") {
1543
1557
  const u = y(e, "]]>", i, "CDATA is not closed.") - 2, o = e.substring(i + 9, u);
1544
- if (s = this.saveTextToParentTag(s, r, n), this.options.cdataPropName)
1545
- r.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o }]);
1546
- else {
1547
- let a = this.parseTextData(o, r.tagname, n, !0, !1, !0);
1548
- a == null && (a = ""), r.add(this.options.textNodeName, a);
1549
- }
1550
- i = u + 2;
1558
+ s = this.saveTextToParentTag(s, r, n);
1559
+ let a = this.parseTextData(o, r.tagname, n, !0, !1, !0, !0);
1560
+ a == null && (a = ""), this.options.cdataPropName ? r.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o }]) : r.add(this.options.textNodeName, a), i = u + 2;
1551
1561
  } else {
1552
1562
  let u = x(e, i, this.options.removeNSPrefix), o = u.tagName;
1553
1563
  const a = u.rawTagName;
@@ -1584,11 +1594,11 @@ const at = function(e) {
1584
1594
  s += e[i];
1585
1595
  return t.child;
1586
1596
  };
1587
- function lt(e, t, r) {
1597
+ function ft(e, t, r) {
1588
1598
  const s = this.options.updateTag(t.tagname, r, t[":@"]);
1589
1599
  s === !1 || (typeof s == "string" && (t.tagname = s), e.addChild(t));
1590
1600
  }
1591
- const ft = function(e) {
1601
+ const ct = function(e) {
1592
1602
  if (this.options.processEntities) {
1593
1603
  for (let t in this.docTypeEntities) {
1594
1604
  const r = this.docTypeEntities[t];
@@ -1607,7 +1617,7 @@ const ft = function(e) {
1607
1617
  }
1608
1618
  return e;
1609
1619
  };
1610
- function ct(e, t, r, s) {
1620
+ function ht(e, t, r, s) {
1611
1621
  return e && (s === void 0 && (s = Object.keys(t.child).length === 0), e = this.parseTextData(
1612
1622
  e,
1613
1623
  t.tagname,
@@ -1617,7 +1627,7 @@ function ct(e, t, r, s) {
1617
1627
  s
1618
1628
  ), e !== void 0 && e !== "" && t.add(this.options.textNodeName, e), e = ""), e;
1619
1629
  }
1620
- function ht(e, t, r) {
1630
+ function pt(e, t, r) {
1621
1631
  const s = "*." + r;
1622
1632
  for (const n in e) {
1623
1633
  const i = e[n];
@@ -1626,7 +1636,7 @@ function ht(e, t, r) {
1626
1636
  }
1627
1637
  return !1;
1628
1638
  }
1629
- function pt(e, t, r = ">") {
1639
+ function gt(e, t, r = ">") {
1630
1640
  let s, n = "";
1631
1641
  for (let i = t; i < e.length; i++) {
1632
1642
  let d = e[i];
@@ -1658,13 +1668,13 @@ function y(e, t, r, s) {
1658
1668
  return n + t.length - 1;
1659
1669
  }
1660
1670
  function x(e, t, r, s = ">") {
1661
- const n = pt(e, t + 1, s);
1671
+ const n = gt(e, t + 1, s);
1662
1672
  if (!n)
1663
1673
  return;
1664
1674
  let i = n.data;
1665
1675
  const d = n.index, u = i.search(/\s/);
1666
1676
  let o = i, a = !0;
1667
- u !== -1 && (o = i.substr(0, u).replace(/\s\s*$/, ""), i = i.substr(u + 1));
1677
+ u !== -1 && (o = i.substring(0, u), i = i.substring(u + 1).trimStart());
1668
1678
  const l = o;
1669
1679
  if (r) {
1670
1680
  const f = o.indexOf(":");
@@ -1678,7 +1688,7 @@ function x(e, t, r, s = ">") {
1678
1688
  rawTagName: l
1679
1689
  };
1680
1690
  }
1681
- function gt(e, t, r) {
1691
+ function wt(e, t, r) {
1682
1692
  const s = r;
1683
1693
  let n = 1;
1684
1694
  for (; r < e.length; r++)
@@ -1705,19 +1715,19 @@ function gt(e, t, r) {
1705
1715
  function $(e, t, r) {
1706
1716
  if (t && typeof e == "string") {
1707
1717
  const s = e.trim();
1708
- return s === "true" ? !0 : s === "false" ? !1 : rt(e, r);
1718
+ return s === "true" ? !0 : s === "false" ? !1 : nt(e, r);
1709
1719
  } else
1710
- return B.isExist(e) ? e : "";
1720
+ return re.isExist(e) ? e : "";
1711
1721
  }
1712
- var wt = nt, ne = {};
1713
- function mt(e, t) {
1722
+ var mt = it, ne = {};
1723
+ function Nt(e, t) {
1714
1724
  return ie(e, t);
1715
1725
  }
1716
1726
  function ie(e, t, r) {
1717
1727
  let s;
1718
1728
  const n = {};
1719
1729
  for (let i = 0; i < e.length; i++) {
1720
- const d = e[i], u = Nt(d);
1730
+ const d = e[i], u = Et(d);
1721
1731
  let o = "";
1722
1732
  if (r === void 0 ? o = u : o = r + "." + u, u === t.textNodeName)
1723
1733
  s === void 0 ? s = d[u] : s += "" + d[u];
@@ -1726,14 +1736,14 @@ function ie(e, t, r) {
1726
1736
  continue;
1727
1737
  if (d[u]) {
1728
1738
  let a = ie(d[u], t, o);
1729
- const l = bt(a, t);
1730
- d[":@"] ? Et(a, d[":@"], o, t) : Object.keys(a).length === 1 && a[t.textNodeName] !== void 0 && !t.alwaysCreateTextNode ? a = a[t.textNodeName] : Object.keys(a).length === 0 && (t.alwaysCreateTextNode ? a[t.textNodeName] = "" : a = ""), n[u] !== void 0 && n.hasOwnProperty(u) ? (Array.isArray(n[u]) || (n[u] = [n[u]]), n[u].push(a)) : t.isArray(u, o, l) ? n[u] = [a] : n[u] = a;
1739
+ const l = yt(a, t);
1740
+ d[":@"] ? bt(a, d[":@"], o, t) : Object.keys(a).length === 1 && a[t.textNodeName] !== void 0 && !t.alwaysCreateTextNode ? a = a[t.textNodeName] : Object.keys(a).length === 0 && (t.alwaysCreateTextNode ? a[t.textNodeName] = "" : a = ""), n[u] !== void 0 && n.hasOwnProperty(u) ? (Array.isArray(n[u]) || (n[u] = [n[u]]), n[u].push(a)) : t.isArray(u, o, l) ? n[u] = [a] : n[u] = a;
1731
1741
  }
1732
1742
  }
1733
1743
  }
1734
1744
  return typeof s == "string" ? s.length > 0 && (n[t.textNodeName] = s) : s !== void 0 && (n[t.textNodeName] = s), n;
1735
1745
  }
1736
- function Nt(e) {
1746
+ function Et(e) {
1737
1747
  const t = Object.keys(e);
1738
1748
  for (let r = 0; r < t.length; r++) {
1739
1749
  const s = t[r];
@@ -1741,7 +1751,7 @@ function Nt(e) {
1741
1751
  return s;
1742
1752
  }
1743
1753
  }
1744
- function Et(e, t, r, s) {
1754
+ function bt(e, t, r, s) {
1745
1755
  if (t) {
1746
1756
  const n = Object.keys(t), i = n.length;
1747
1757
  for (let d = 0; d < i; d++) {
@@ -1750,15 +1760,15 @@ function Et(e, t, r, s) {
1750
1760
  }
1751
1761
  }
1752
1762
  }
1753
- function bt(e, t) {
1763
+ function yt(e, t) {
1754
1764
  const { textNodeName: r } = t, s = Object.keys(e).length;
1755
1765
  return !!(s === 0 || s === 1 && (e[r] || typeof e[r] == "boolean" || e[r] === 0));
1756
1766
  }
1757
- ne.prettify = mt;
1758
- const { buildOptions: yt } = k, _t = wt, { prettify: vt } = ne, Tt = S;
1759
- let It = class {
1767
+ ne.prettify = Nt;
1768
+ const { buildOptions: _t } = k, vt = mt, { prettify: Tt } = ne, It = R;
1769
+ let At = class {
1760
1770
  constructor(t) {
1761
- this.externalEntities = {}, this.options = yt(t);
1771
+ this.externalEntities = {}, this.options = _t(t);
1762
1772
  }
1763
1773
  /**
1764
1774
  * Parse XML dats to JS object
@@ -1773,14 +1783,14 @@ let It = class {
1773
1783
  throw new Error("XML data is accepted in String or Bytes[] form.");
1774
1784
  if (r) {
1775
1785
  r === !0 && (r = {});
1776
- const i = Tt.validate(t, r);
1786
+ const i = It.validate(t, r);
1777
1787
  if (i !== !0)
1778
1788
  throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`);
1779
1789
  }
1780
- const s = new _t(this.options);
1790
+ const s = new vt(this.options);
1781
1791
  s.addExternalEntities(this.externalEntities);
1782
1792
  const n = s.parseXml(t);
1783
- return this.options.preserveOrder || n === void 0 ? n : vt(n, this.options);
1793
+ return this.options.preserveOrder || n === void 0 ? n : Tt(n, this.options);
1784
1794
  }
1785
1795
  /**
1786
1796
  * Add Entity which is not by default supported by this library
@@ -1797,23 +1807,23 @@ let It = class {
1797
1807
  this.externalEntities[t] = r;
1798
1808
  }
1799
1809
  };
1800
- var At = It;
1810
+ var Ct = At;
1801
1811
  const Ot = `
1802
1812
  `;
1803
- function Ct(e, t) {
1813
+ function Pt(e, t) {
1804
1814
  let r = "";
1805
1815
  return t.format && t.indentBy.length > 0 && (r = Ot), se(e, t, "", r);
1806
1816
  }
1807
1817
  function se(e, t, r, s) {
1808
1818
  let n = "", i = !1;
1809
1819
  for (let d = 0; d < e.length; d++) {
1810
- const u = e[d], o = Pt(u);
1820
+ const u = e[d], o = xt(u);
1811
1821
  if (o === void 0)
1812
1822
  continue;
1813
1823
  let a = "";
1814
1824
  if (r.length === 0 ? a = o : a = `${r}.${o}`, o === t.textNodeName) {
1815
1825
  let h = u[o];
1816
- xt(a, t) || (h = t.tagValueProcessor(o, h), h = oe(h, t)), i && (n += s), n += h, i = !1;
1826
+ $t(a, t) || (h = t.tagValueProcessor(o, h), h = oe(h, t)), i && (n += s), n += h, i = !1;
1817
1827
  continue;
1818
1828
  } else if (o === t.cdataPropName) {
1819
1829
  i && (n += s), n += `<![CDATA[${u[o][0][t.textNodeName]}]]>`, i = !1;
@@ -1822,19 +1832,19 @@ function se(e, t, r, s) {
1822
1832
  n += s + `<!--${u[o][0][t.textNodeName]}-->`, i = !0;
1823
1833
  continue;
1824
1834
  } else if (o[0] === "?") {
1825
- const h = K(u[":@"], t), _ = o === "?xml" ? "" : s;
1835
+ const h = H(u[":@"], t), _ = o === "?xml" ? "" : s;
1826
1836
  let E = u[o][0][t.textNodeName];
1827
1837
  E = E.length !== 0 ? " " + E : "", n += _ + `<${o}${E}${h}?>`, i = !0;
1828
1838
  continue;
1829
1839
  }
1830
1840
  let l = s;
1831
1841
  l !== "" && (l += t.indentBy);
1832
- const f = K(u[":@"], t), c = s + `<${o}${f}`, g = se(u[o], t, a, l);
1842
+ const f = H(u[":@"], t), c = s + `<${o}${f}`, g = se(u[o], t, a, l);
1833
1843
  t.unpairedTags.indexOf(o) !== -1 ? t.suppressUnpairedNode ? n += c + ">" : n += c + "/>" : (!g || g.length === 0) && t.suppressEmptyNode ? n += c + "/>" : g && g.endsWith(">") ? n += c + `>${g}${s}</${o}>` : (n += c + ">", g && s !== "" && (g.includes("/>") || g.includes("</")) ? n += s + t.indentBy + g + s : n += g, n += `</${o}>`), i = !0;
1834
1844
  }
1835
1845
  return n;
1836
1846
  }
1837
- function Pt(e) {
1847
+ function xt(e) {
1838
1848
  const t = Object.keys(e);
1839
1849
  for (let r = 0; r < t.length; r++) {
1840
1850
  const s = t[r];
@@ -1842,7 +1852,7 @@ function Pt(e) {
1842
1852
  return s;
1843
1853
  }
1844
1854
  }
1845
- function K(e, t) {
1855
+ function H(e, t) {
1846
1856
  let r = "";
1847
1857
  if (e && !t.ignoreAttributes)
1848
1858
  for (let s in e) {
@@ -1853,7 +1863,7 @@ function K(e, t) {
1853
1863
  }
1854
1864
  return r;
1855
1865
  }
1856
- function xt(e, t) {
1866
+ function $t(e, t) {
1857
1867
  e = e.substr(0, e.length - t.textNodeName.length - 1);
1858
1868
  let r = e.substr(e.lastIndexOf(".") + 1);
1859
1869
  for (let s in t.stopNodes)
@@ -1869,8 +1879,8 @@ function oe(e, t) {
1869
1879
  }
1870
1880
  return e;
1871
1881
  }
1872
- var $t = Ct;
1873
- const Ft = $t, Vt = {
1882
+ var Ft = Pt;
1883
+ const Vt = Ft, St = {
1874
1884
  attributeNamePrefix: "@_",
1875
1885
  attributesGroupName: !1,
1876
1886
  textNodeName: "#text",
@@ -1905,16 +1915,16 @@ const Ft = $t, Vt = {
1905
1915
  oneListGroup: !1
1906
1916
  };
1907
1917
  function b(e) {
1908
- this.options = Object.assign({}, Vt, e), this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
1918
+ this.options = Object.assign({}, St, e), this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
1909
1919
  return !1;
1910
- } : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = St), this.processTextOrObjNode = Lt, this.options.format ? (this.indentate = Rt, this.tagEndChar = `>
1920
+ } : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Mt), this.processTextOrObjNode = Lt, this.options.format ? (this.indentate = Rt, this.tagEndChar = `>
1911
1921
  `, this.newLine = `
1912
1922
  `) : (this.indentate = function() {
1913
1923
  return "";
1914
1924
  }, this.tagEndChar = ">", this.newLine = "");
1915
1925
  }
1916
1926
  b.prototype.build = function(e) {
1917
- return this.options.preserveOrder ? Ft(e, this.options) : (Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e = {
1927
+ return this.options.preserveOrder ? Vt(e, this.options) : (Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e = {
1918
1928
  [this.options.arrayNodeName]: e
1919
1929
  }), this.j2x(e, 0).val);
1920
1930
  };
@@ -1995,23 +2005,23 @@ b.prototype.replaceEntitiesValue = function(e) {
1995
2005
  function Rt(e) {
1996
2006
  return this.options.indentBy.repeat(e);
1997
2007
  }
1998
- function St(e) {
2008
+ function Mt(e) {
1999
2009
  return e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName ? e.substr(this.attrPrefixLen) : !1;
2000
2010
  }
2001
- var Mt = b;
2002
- const kt = S, Bt = At, qt = Mt;
2003
- var W = {
2004
- XMLParser: Bt,
2005
- XMLValidator: kt,
2006
- XMLBuilder: qt
2011
+ var kt = b;
2012
+ const Bt = R, qt = Ct, Xt = kt;
2013
+ var K = {
2014
+ XMLParser: qt,
2015
+ XMLValidator: Bt,
2016
+ XMLBuilder: Xt
2007
2017
  };
2008
- function Xt(e) {
2018
+ function Ut(e) {
2009
2019
  if (typeof e != "string")
2010
2020
  throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
2011
- if (e = e.trim(), e.length === 0 || W.XMLValidator.validate(e) !== !0)
2021
+ if (e = e.trim(), e.length === 0 || K.XMLValidator.validate(e) !== !0)
2012
2022
  return !1;
2013
2023
  let t;
2014
- const r = new W.XMLParser();
2024
+ const r = new K.XMLParser();
2015
2025
  try {
2016
2026
  t = r.parse(e);
2017
2027
  } catch {
@@ -2040,10 +2050,10 @@ function Xt(e) {
2040
2050
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
2041
2051
  *
2042
2052
  */
2043
- class cr {
2053
+ class pr {
2044
2054
  _view;
2045
2055
  constructor(t) {
2046
- Ut(t), this._view = t;
2056
+ Gt(t), this._view = t;
2047
2057
  }
2048
2058
  get id() {
2049
2059
  return this._view.id;
@@ -2103,7 +2113,7 @@ class cr {
2103
2113
  return this._view.defaultSortKey;
2104
2114
  }
2105
2115
  }
2106
- const Ut = function(e) {
2116
+ const Gt = function(e) {
2107
2117
  if (!e.id || typeof e.id != "string")
2108
2118
  throw new Error("View id is required and must be a string");
2109
2119
  if (!e.name || typeof e.name != "string")
@@ -2112,12 +2122,12 @@ const Ut = function(e) {
2112
2122
  throw new Error("View caption is required for top-level views and must be a string");
2113
2123
  if (!e.getContents || typeof e.getContents != "function")
2114
2124
  throw new Error("View getContents is required and must be a function");
2115
- if (!e.icon || typeof e.icon != "string" || !Xt(e.icon))
2125
+ if (!e.icon || typeof e.icon != "string" || !Ut(e.icon))
2116
2126
  throw new Error("View icon is required and must be a valid svg string");
2117
2127
  if (!("order" in e) || typeof e.order != "number")
2118
2128
  throw new Error("View order is required and must be a number");
2119
2129
  if (e.columns && e.columns.forEach((t) => {
2120
- if (!(t instanceof Ie))
2130
+ if (!(t instanceof Ae))
2121
2131
  throw new Error("View columns must be an array of Column. Invalid column found");
2122
2132
  }), e.emptyView && typeof e.emptyView != "function")
2123
2133
  throw new Error("View emptyView must be a function");
@@ -2153,48 +2163,48 @@ const Ut = function(e) {
2153
2163
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
2154
2164
  *
2155
2165
  */
2156
- const hr = function(e) {
2166
+ const gr = function(e) {
2157
2167
  return F().registerEntry(e);
2158
- }, pr = function(e) {
2168
+ }, wr = function(e) {
2159
2169
  return F().unregisterEntry(e);
2160
- }, gr = function(e) {
2170
+ }, mr = function(e) {
2161
2171
  return F().getEntries(e).sort((r, s) => r.order !== void 0 && s.order !== void 0 && r.order !== s.order ? r.order - s.order : r.displayName.localeCompare(s.displayName, void 0, { numeric: !0, sensitivity: "base" }));
2162
2172
  };
2163
2173
  export {
2164
- Ie as Column,
2165
- Z as DefaultType,
2166
- ye as File,
2167
- Qt as FileAction,
2168
- R as FileType,
2169
- _e as Folder,
2170
- tr as Header,
2171
- Te as Navigation,
2172
- D as Node,
2173
- Q as NodeStatus,
2174
+ Ae as Column,
2175
+ W as DefaultType,
2176
+ _e as File,
2177
+ er as FileAction,
2178
+ L as FileType,
2179
+ ve as Folder,
2180
+ nr as Header,
2181
+ Ie as Navigation,
2182
+ Q as Node,
2183
+ J as NodeStatus,
2174
2184
  N as Permission,
2175
- cr as View,
2176
- hr as addNewFileMenuEntry,
2177
- ur as davGetClient,
2178
- sr as davGetDefaultPropfind,
2179
- Ee as davGetFavoritesReport,
2180
- or as davGetRecentSearch,
2181
- be as davParsePermissions,
2182
- te as davRemoteURL,
2183
- ve as davResultToNode,
2184
- ee as davRootPath,
2185
- Y as defaultDavNamespaces,
2186
- j as defaultDavProperties,
2187
- Yt as formatFileSize,
2188
- L as getDavNameSpaces,
2185
+ pr as View,
2186
+ gr as addNewFileMenuEntry,
2187
+ ar as davGetClient,
2188
+ ur as davGetDefaultPropfind,
2189
+ be as davGetFavoritesReport,
2190
+ dr as davGetRecentSearch,
2191
+ ye as davParsePermissions,
2192
+ ee as davRemoteURL,
2193
+ Te as davResultToNode,
2194
+ D as davRootPath,
2195
+ j as defaultDavNamespaces,
2196
+ Z as defaultDavProperties,
2197
+ Qt as formatFileSize,
2198
+ S as getDavNameSpaces,
2189
2199
  V as getDavProperties,
2190
- dr as getFavoriteNodes,
2191
- er as getFileActions,
2192
- nr as getFileListHeaders,
2193
- ar as getNavigation,
2194
- gr as getNewFileMenuEntries,
2195
- Jt as parseFileSize,
2196
- ir as registerDavProperty,
2197
- Dt as registerFileAction,
2198
- rr as registerFileListHeaders,
2199
- pr as removeNewFileMenuEntry
2200
+ lr as getFavoriteNodes,
2201
+ rr as getFileActions,
2202
+ sr as getFileListHeaders,
2203
+ fr as getNavigation,
2204
+ mr as getNewFileMenuEntries,
2205
+ Dt as parseFileSize,
2206
+ or as registerDavProperty,
2207
+ tr as registerFileAction,
2208
+ ir as registerFileListHeaders,
2209
+ wr as removeNewFileMenuEntry
2200
2210
  };