@nextcloud/files 3.0.0-beta.2 → 3.0.0-beta.21

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 ADDED
@@ -0,0 +1,1454 @@
1
+ import { getCurrentUser as A, getRequestToken as at } from "@nextcloud/auth";
2
+ import { getLoggerBuilder as j } from "@nextcloud/logger";
3
+ import { getCanonicalLocale as lt } from "@nextcloud/l10n";
4
+ import { join as dt, basename as ut, extname as ct, dirname as _ } from "path";
5
+ import { generateRemoteUrl as ht } from "@nextcloud/router";
6
+ import { createClient as pt, getPatcher as ft } from "webdav";
7
+ import { request as gt } from "webdav/dist/node/request.js";
8
+ const mt = (t) => t === null ? j().setApp("files").build() : j().setApp("files").setUid(t.uid).build(), m = mt(A());
9
+ class wt {
10
+ _entries = [];
11
+ registerEntry(e) {
12
+ this.validateEntry(e), this._entries.push(e);
13
+ }
14
+ unregisterEntry(e) {
15
+ const i = typeof e == "string" ? this.getEntryIndex(e) : this.getEntryIndex(e.id);
16
+ if (i === -1) {
17
+ m.warn("Entry not found, nothing removed", { entry: e, entries: this.getEntries() });
18
+ return;
19
+ }
20
+ this._entries.splice(i, 1);
21
+ }
22
+ getEntries(e) {
23
+ return e ? this._entries.filter((i) => typeof i.if == "function" ? i.if(e) : !0) : this._entries;
24
+ }
25
+ getEntryIndex(e) {
26
+ return this._entries.findIndex((i) => i.id === e);
27
+ }
28
+ validateEntry(e) {
29
+ if (!e.id || !e.displayName || !(e.iconSvgInline || e.iconClass || e.handler))
30
+ throw new Error("Invalid entry");
31
+ if (typeof e.id != "string" || typeof e.displayName != "string")
32
+ throw new Error("Invalid id or displayName property");
33
+ if (e.iconClass && typeof e.iconClass != "string" || e.iconSvgInline && typeof e.iconSvgInline != "string")
34
+ throw new Error("Invalid icon provided");
35
+ if (e.if !== void 0 && typeof e.if != "function")
36
+ throw new Error("Invalid if property");
37
+ if (e.templateName && typeof e.templateName != "string")
38
+ throw new Error("Invalid templateName property");
39
+ if (e.handler && typeof e.handler != "function")
40
+ throw new Error("Invalid handler property");
41
+ if (!e.templateName && !e.handler)
42
+ throw new Error("At least a templateName or a handler must be provided");
43
+ if (this.getEntryIndex(e.id) !== -1)
44
+ throw new Error("Duplicate entry");
45
+ }
46
+ }
47
+ const S = function() {
48
+ return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new wt(), m.debug("NewFileMenu initialized")), window._nc_newfilemenu;
49
+ }, I = ["B", "KB", "MB", "GB", "TB", "PB"], O = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
50
+ function We(t, e = !1, i = !1) {
51
+ typeof t == "string" && (t = Number(t));
52
+ let s = t > 0 ? Math.floor(Math.log(t) / Math.log(i ? 1024 : 1e3)) : 0;
53
+ s = Math.min((i ? O.length : I.length) - 1, s);
54
+ const n = i ? O[s] : I[s];
55
+ let r = (t / Math.pow(i ? 1024 : 1e3, s)).toFixed(1);
56
+ return e === !0 && s === 0 ? (r !== "0.0" ? "< 1 " : "0 ") + (i ? O[1] : I[1]) : (s < 2 ? r = parseFloat(r).toFixed(0) : r = parseFloat(r).toLocaleString(lt()), r + " " + n);
57
+ }
58
+ var H = ((t) => (t.DEFAULT = "default", t.HIDDEN = "hidden", t))(H || {});
59
+ class Ye {
60
+ _action;
61
+ constructor(e) {
62
+ this.validateAction(e), this._action = e;
63
+ }
64
+ get id() {
65
+ return this._action.id;
66
+ }
67
+ get displayName() {
68
+ return this._action.displayName;
69
+ }
70
+ get iconSvgInline() {
71
+ return this._action.iconSvgInline;
72
+ }
73
+ get enabled() {
74
+ return this._action.enabled;
75
+ }
76
+ get exec() {
77
+ return this._action.exec;
78
+ }
79
+ get execBatch() {
80
+ return this._action.execBatch;
81
+ }
82
+ get order() {
83
+ return this._action.order;
84
+ }
85
+ get default() {
86
+ return this._action.default;
87
+ }
88
+ get inline() {
89
+ return this._action.inline;
90
+ }
91
+ get renderInline() {
92
+ return this._action.renderInline;
93
+ }
94
+ validateAction(e) {
95
+ if (!e.id || typeof e.id != "string")
96
+ throw new Error("Invalid id");
97
+ if (!e.displayName || typeof e.displayName != "function")
98
+ throw new Error("Invalid displayName function");
99
+ if (!e.iconSvgInline || typeof e.iconSvgInline != "function")
100
+ throw new Error("Invalid iconSvgInline function");
101
+ if (!e.exec || typeof e.exec != "function")
102
+ throw new Error("Invalid exec function");
103
+ if ("enabled" in e && typeof e.enabled != "function")
104
+ throw new Error("Invalid enabled function");
105
+ if ("execBatch" in e && typeof e.execBatch != "function")
106
+ throw new Error("Invalid execBatch function");
107
+ if ("order" in e && typeof e.order != "number")
108
+ throw new Error("Invalid order");
109
+ if (e.default && !Object.values(H).includes(e.default))
110
+ throw new Error("Invalid default");
111
+ if ("inline" in e && typeof e.inline != "function")
112
+ throw new Error("Invalid inline function");
113
+ if ("renderInline" in e && typeof e.renderInline != "function")
114
+ throw new Error("Invalid renderInline function");
115
+ }
116
+ }
117
+ const Ze = function(t) {
118
+ if (typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions.find((e) => e.id === t.id)) {
119
+ m.error(`FileAction ${t.id} already registered`, { action: t });
120
+ return;
121
+ }
122
+ window._nc_fileactions.push(t);
123
+ }, Je = function() {
124
+ return typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions;
125
+ };
126
+ class Qe {
127
+ _header;
128
+ constructor(e) {
129
+ this.validateHeader(e), this._header = e;
130
+ }
131
+ get id() {
132
+ return this._header.id;
133
+ }
134
+ get order() {
135
+ return this._header.order;
136
+ }
137
+ get enabled() {
138
+ return this._header.enabled;
139
+ }
140
+ get render() {
141
+ return this._header.render;
142
+ }
143
+ get updated() {
144
+ return this._header.updated;
145
+ }
146
+ validateHeader(e) {
147
+ if (!e.id || !e.render || !e.updated)
148
+ throw new Error("Invalid header: id, render and updated are required");
149
+ if (typeof e.id != "string")
150
+ throw new Error("Invalid id property");
151
+ if (e.enabled !== void 0 && typeof e.enabled != "function")
152
+ throw new Error("Invalid enabled property");
153
+ if (e.render && typeof e.render != "function")
154
+ throw new Error("Invalid render property");
155
+ if (e.updated && typeof e.updated != "function")
156
+ throw new Error("Invalid updated property");
157
+ }
158
+ }
159
+ const ti = function(t) {
160
+ if (typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader.find((e) => e.id === t.id)) {
161
+ m.error(`Header ${t.id} already registered`, { header: t });
162
+ return;
163
+ }
164
+ window._nc_filelistheader.push(t);
165
+ }, ei = function() {
166
+ return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader;
167
+ };
168
+ var v = ((t) => (t[t.NONE = 0] = "NONE", t[t.CREATE = 4] = "CREATE", t[t.READ = 1] = "READ", t[t.UPDATE = 2] = "UPDATE", t[t.DELETE = 8] = "DELETE", t[t.SHARE = 16] = "SHARE", t[t.ALL = 31] = "ALL", t))(v || {});
169
+ const K = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodified", "d:quota-available-bytes", "d:resourcetype", "nc:has-preview", "nc:is-encrypted", "nc:mount-type", "nc:share-attributes", "oc:comments-unread", "oc:favorite", "oc:fileid", "oc:owner-display-name", "oc:owner-id", "oc:permissions", "oc:share-types", "oc:size", "ocs:share-permissions"], W = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" }, ii = function(t, e = { nc: "http://nextcloud.org/ns" }) {
170
+ typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...K], window._nc_dav_namespaces = { ...W });
171
+ const i = { ...window._nc_dav_namespaces, ...e };
172
+ if (window._nc_dav_properties.find((n) => n === t))
173
+ return m.error(`${t} already registered`, { prop: t }), !1;
174
+ if (t.startsWith("<") || t.split(":").length !== 2)
175
+ return m.error(`${t} is not valid. See example: 'oc:fileid'`, { prop: t }), !1;
176
+ const s = t.split(":")[0];
177
+ return i[s] ? (window._nc_dav_properties.push(t), window._nc_dav_namespaces = i, !0) : (m.error(`${t} namespace unknown`, { prop: t, namespaces: i }), !1);
178
+ }, F = function() {
179
+ return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...K]), window._nc_dav_properties.map((t) => `<${t} />`).join(" ");
180
+ }, V = function() {
181
+ return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...W }), Object.keys(window._nc_dav_namespaces).map((t) => `xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`).join(" ");
182
+ }, ni = function() {
183
+ return `<?xml version="1.0"?>
184
+ <d:propfind ${V()}>
185
+ <d:prop>
186
+ ${F()}
187
+ </d:prop>
188
+ </d:propfind>`;
189
+ }, vt = function() {
190
+ return `<?xml version="1.0"?>
191
+ <oc:filter-files ${V()}>
192
+ <d:prop>
193
+ ${F()}
194
+ </d:prop>
195
+ <oc:filter-rules>
196
+ <oc:favorite>1</oc:favorite>
197
+ </oc:filter-rules>
198
+ </oc:filter-files>`;
199
+ }, ri = function(t) {
200
+ return `<?xml version="1.0" encoding="UTF-8"?>
201
+ <d:searchrequest ${V()}
202
+ xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
203
+ <d:basicsearch>
204
+ <d:select>
205
+ <d:prop>
206
+ ${F()}
207
+ </d:prop>
208
+ </d:select>
209
+ <d:from>
210
+ <d:scope>
211
+ <d:href>/files/${A()?.uid}/</d:href>
212
+ <d:depth>infinity</d:depth>
213
+ </d:scope>
214
+ </d:from>
215
+ <d:where>
216
+ <d:and>
217
+ <d:or>
218
+ <d:not>
219
+ <d:eq>
220
+ <d:prop>
221
+ <d:getcontenttype/>
222
+ </d:prop>
223
+ <d:literal>httpd/unix-directory</d:literal>
224
+ </d:eq>
225
+ </d:not>
226
+ <d:eq>
227
+ <d:prop>
228
+ <oc:size/>
229
+ </d:prop>
230
+ <d:literal>0</d:literal>
231
+ </d:eq>
232
+ </d:or>
233
+ <d:gt>
234
+ <d:prop>
235
+ <d:getlastmodified/>
236
+ </d:prop>
237
+ <d:literal>${t}</d:literal>
238
+ </d:gt>
239
+ </d:and>
240
+ </d:where>
241
+ <d:orderby>
242
+ <d:order>
243
+ <d:prop>
244
+ <d:getlastmodified/>
245
+ </d:prop>
246
+ <d:descending/>
247
+ </d:order>
248
+ </d:orderby>
249
+ <d:limit>
250
+ <d:nresults>100</d:nresults>
251
+ <ns:firstresult>0</ns:firstresult>
252
+ </d:limit>
253
+ </d:basicsearch>
254
+ </d:searchrequest>`;
255
+ }, yt = function(t = "") {
256
+ let e = v.NONE;
257
+ return t && ((t.includes("C") || t.includes("K")) && (e |= v.CREATE), t.includes("G") && (e |= v.READ), (t.includes("W") || t.includes("N") || t.includes("V")) && (e |= v.UPDATE), t.includes("D") && (e |= v.DELETE), t.includes("R") && (e |= v.SHARE)), e;
258
+ };
259
+ var $ = ((t) => (t.Folder = "folder", t.File = "file", t))($ || {});
260
+ const Y = function(t, e) {
261
+ return t.match(e) !== null;
262
+ }, M = (t, e) => {
263
+ if (t.id && typeof t.id != "number")
264
+ throw new Error("Invalid id type of value");
265
+ if (!t.source)
266
+ throw new Error("Missing mandatory source");
267
+ try {
268
+ new URL(t.source);
269
+ } catch {
270
+ throw new Error("Invalid source format, source must be a valid URL");
271
+ }
272
+ if (!t.source.startsWith("http"))
273
+ throw new Error("Invalid source format, only http(s) is supported");
274
+ if (t.mtime && !(t.mtime instanceof Date))
275
+ throw new Error("Invalid mtime type");
276
+ if (t.crtime && !(t.crtime instanceof Date))
277
+ throw new Error("Invalid crtime type");
278
+ if (!t.mime || typeof t.mime != "string" || !t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))
279
+ throw new Error("Missing or invalid mandatory mime");
280
+ if ("size" in t && typeof t.size != "number" && t.size !== void 0)
281
+ throw new Error("Invalid size type");
282
+ if ("permissions" in t && t.permissions !== void 0 && !(typeof t.permissions == "number" && t.permissions >= v.NONE && t.permissions <= v.ALL))
283
+ throw new Error("Invalid permissions");
284
+ if (t.owner && t.owner !== null && typeof t.owner != "string")
285
+ throw new Error("Invalid owner type");
286
+ if (t.attributes && typeof t.attributes != "object")
287
+ throw new Error("Invalid attributes type");
288
+ if (t.root && typeof t.root != "string")
289
+ throw new Error("Invalid root type");
290
+ if (t.root && !t.root.startsWith("/"))
291
+ throw new Error("Root must start with a leading slash");
292
+ if (t.root && !t.source.includes(t.root))
293
+ throw new Error("Root must be part of the source");
294
+ if (t.root && Y(t.source, e)) {
295
+ const i = t.source.match(e)[0];
296
+ if (!t.source.includes(dt(i, t.root)))
297
+ throw new Error("The root must be relative to the service. e.g /files/emma");
298
+ }
299
+ if (t.status && !Object.values(Z).includes(t.status))
300
+ throw new Error("Status must be a valid NodeStatus");
301
+ };
302
+ var Z = ((t) => (t.NEW = "new", t.FAILED = "failed", t.LOADING = "loading", t.LOCKED = "locked", t))(Z || {});
303
+ class J {
304
+ _data;
305
+ _attributes;
306
+ _knownDavService = /(remote|public)\.php\/(web)?dav/i;
307
+ constructor(e, i) {
308
+ M(e, i || this._knownDavService), this._data = e;
309
+ const s = { set: (n, r, l) => (this.updateMtime(), Reflect.set(n, r, l)), deleteProperty: (n, r) => (this.updateMtime(), Reflect.deleteProperty(n, r)) };
310
+ this._attributes = new Proxy(e.attributes || {}, s), delete this._data.attributes, i && (this._knownDavService = i);
311
+ }
312
+ get source() {
313
+ return this._data.source.replace(/\/$/i, "");
314
+ }
315
+ get basename() {
316
+ return ut(this.source);
317
+ }
318
+ get extension() {
319
+ return ct(this.source);
320
+ }
321
+ get dirname() {
322
+ if (this.root) {
323
+ const i = this.source.indexOf(this.root);
324
+ return _(this.source.slice(i + this.root.length) || "/");
325
+ }
326
+ const e = new URL(this.source);
327
+ return _(e.pathname);
328
+ }
329
+ get mime() {
330
+ return this._data.mime;
331
+ }
332
+ get mtime() {
333
+ return this._data.mtime;
334
+ }
335
+ get crtime() {
336
+ return this._data.crtime;
337
+ }
338
+ get size() {
339
+ return this._data.size;
340
+ }
341
+ get attributes() {
342
+ return this._attributes;
343
+ }
344
+ get permissions() {
345
+ return this.owner === null && !this.isDavRessource ? v.READ : this._data.permissions !== void 0 ? this._data.permissions : v.NONE;
346
+ }
347
+ get owner() {
348
+ return this.isDavRessource ? this._data.owner : null;
349
+ }
350
+ get isDavRessource() {
351
+ return Y(this.source, this._knownDavService);
352
+ }
353
+ get root() {
354
+ return this._data.root ? this._data.root.replace(/^(.+)\/$/, "$1") : this.isDavRessource && _(this.source).split(this._knownDavService).pop() || null;
355
+ }
356
+ get path() {
357
+ if (this.root) {
358
+ const e = this.source.indexOf(this.root);
359
+ return this.source.slice(e + this.root.length) || "/";
360
+ }
361
+ return (this.dirname + "/" + this.basename).replace(/\/\//g, "/");
362
+ }
363
+ get fileid() {
364
+ return this._data?.id || this.attributes?.fileid;
365
+ }
366
+ get status() {
367
+ return this._data?.status;
368
+ }
369
+ set status(e) {
370
+ this._data.status = e;
371
+ }
372
+ move(e) {
373
+ M({ ...this._data, source: e }, this._knownDavService), this._data.source = e, this.updateMtime();
374
+ }
375
+ rename(e) {
376
+ if (e.includes("/"))
377
+ throw new Error("Invalid basename");
378
+ this.move(_(this.source) + "/" + e);
379
+ }
380
+ updateMtime() {
381
+ this._data.mtime && (this._data.mtime = /* @__PURE__ */ new Date());
382
+ }
383
+ }
384
+ class xt extends J {
385
+ get type() {
386
+ return $.File;
387
+ }
388
+ }
389
+ class bt extends J {
390
+ constructor(e) {
391
+ super({ ...e, mime: "httpd/unix-directory" });
392
+ }
393
+ get type() {
394
+ return $.Folder;
395
+ }
396
+ get extension() {
397
+ return null;
398
+ }
399
+ get mime() {
400
+ return "httpd/unix-directory";
401
+ }
402
+ }
403
+ const Q = `/files/${A()?.uid}`, tt = ht("dav"), si = function(t = tt) {
404
+ const e = pt(t, { headers: { requesttoken: at() || "" } });
405
+ return ft().patch("request", (i) => (i.headers?.method && (i.method = i.headers.method, delete i.headers.method), gt(i))), e;
406
+ }, oi = async (t, e = "/", i = Q) => (await t.getDirectoryContents(`${i}${e}`, { details: !0, data: vt(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((s) => s.filename !== e).map((s) => Et(s, i)), Et = function(t, e = Q, i = tt) {
407
+ const s = t.props, n = yt(s?.permissions), r = A()?.uid, l = { id: s?.fileid || 0, source: `${i}${t.filename}`, mtime: new Date(Date.parse(t.lastmod)), mime: t.mime, size: s?.size || Number.parseInt(s.getcontentlength || "0"), permissions: n, owner: r, root: e, attributes: { ...t, ...s, hasPreview: s?.["has-preview"] } };
408
+ return delete l.attributes?.props, t.type === "file" ? new xt(l) : new bt(l);
409
+ };
410
+ class Nt {
411
+ _views = [];
412
+ _currentView = null;
413
+ register(e) {
414
+ if (this._views.find((i) => i.id === e.id))
415
+ throw new Error(`View id ${e.id} is already registered`);
416
+ this._views.push(e);
417
+ }
418
+ remove(e) {
419
+ const i = this._views.findIndex((s) => s.id === e);
420
+ i !== -1 && this._views.splice(i, 1);
421
+ }
422
+ get views() {
423
+ return this._views;
424
+ }
425
+ setActive(e) {
426
+ this._currentView = e;
427
+ }
428
+ get active() {
429
+ return this._currentView;
430
+ }
431
+ }
432
+ const ai = function() {
433
+ return typeof window._nc_navigation > "u" && (window._nc_navigation = new Nt(), m.debug("Navigation service initialized")), window._nc_navigation;
434
+ };
435
+ class _t {
436
+ _column;
437
+ constructor(e) {
438
+ At(e), this._column = e;
439
+ }
440
+ get id() {
441
+ return this._column.id;
442
+ }
443
+ get title() {
444
+ return this._column.title;
445
+ }
446
+ get render() {
447
+ return this._column.render;
448
+ }
449
+ get sort() {
450
+ return this._column.sort;
451
+ }
452
+ get summary() {
453
+ return this._column.summary;
454
+ }
455
+ }
456
+ const At = function(t) {
457
+ if (!t.id || typeof t.id != "string")
458
+ throw new Error("A column id is required");
459
+ if (!t.title || typeof t.title != "string")
460
+ throw new Error("A column title is required");
461
+ if (!t.render || typeof t.render != "function")
462
+ throw new Error("A render function is required");
463
+ if (t.sort && typeof t.sort != "function")
464
+ throw new Error("Column sortFunction must be a function");
465
+ if (t.summary && typeof t.summary != "function")
466
+ throw new Error("Column summary must be a function");
467
+ return !0;
468
+ };
469
+ var k = {}, T = {};
470
+ (function(t) {
471
+ const e = ":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", i = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", s = "[" + e + "][" + i + "]*", n = new RegExp("^" + s + "$"), r = function(o, a) {
472
+ const d = [];
473
+ let u = a.exec(o);
474
+ for (; u; ) {
475
+ const h = [];
476
+ h.startIndex = a.lastIndex - u[0].length;
477
+ const c = u.length;
478
+ for (let f = 0; f < c; f++)
479
+ h.push(u[f]);
480
+ d.push(h), u = a.exec(o);
481
+ }
482
+ return d;
483
+ }, l = function(o) {
484
+ const a = n.exec(o);
485
+ return !(a === null || typeof a > "u");
486
+ };
487
+ t.isExist = function(o) {
488
+ return typeof o < "u";
489
+ }, t.isEmptyObject = function(o) {
490
+ return Object.keys(o).length === 0;
491
+ }, t.merge = function(o, a, d) {
492
+ if (a) {
493
+ const u = Object.keys(a), h = u.length;
494
+ for (let c = 0; c < h; c++)
495
+ d === "strict" ? o[u[c]] = [a[u[c]]] : o[u[c]] = a[u[c]];
496
+ }
497
+ }, t.getValue = function(o) {
498
+ return t.isExist(o) ? o : "";
499
+ }, t.isName = l, t.getAllMatches = r, t.nameRegexp = s;
500
+ })(T);
501
+ const L = T, Tt = { allowBooleanAttributes: !1, unpairedTags: [] };
502
+ k.validate = function(t, e) {
503
+ e = Object.assign({}, Tt, e);
504
+ const i = [];
505
+ let s = !1, n = !1;
506
+ t[0] === "\uFEFF" && (t = t.substr(1));
507
+ for (let r = 0; r < t.length; r++)
508
+ if (t[r] === "<" && t[r + 1] === "?") {
509
+ if (r += 2, r = q(t, r), r.err)
510
+ return r;
511
+ } else if (t[r] === "<") {
512
+ let l = r;
513
+ if (r++, t[r] === "!") {
514
+ r = U(t, r);
515
+ continue;
516
+ } else {
517
+ let o = !1;
518
+ t[r] === "/" && (o = !0, r++);
519
+ let a = "";
520
+ for (; r < t.length && t[r] !== ">" && t[r] !== " " && t[r] !== " " && t[r] !== `
521
+ ` && t[r] !== "\r"; r++)
522
+ a += t[r];
523
+ if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), r--), !Vt(a)) {
524
+ let h;
525
+ return a.trim().length === 0 ? h = "Invalid space after '<'." : h = "Tag '" + a + "' is an invalid name.", p("InvalidTag", h, g(t, r));
526
+ }
527
+ const d = Pt(t, r);
528
+ if (d === !1)
529
+ return p("InvalidAttr", "Attributes for '" + a + "' have open quote.", g(t, r));
530
+ let u = d.value;
531
+ if (r = d.index, u[u.length - 1] === "/") {
532
+ const h = r - u.length;
533
+ u = u.substring(0, u.length - 1);
534
+ const c = z(u, e);
535
+ if (c === !0)
536
+ s = !0;
537
+ else
538
+ return p(c.err.code, c.err.msg, g(t, h + c.err.line));
539
+ } else if (o)
540
+ if (d.tagClosed) {
541
+ if (u.trim().length > 0)
542
+ return p("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", g(t, l));
543
+ {
544
+ const h = i.pop();
545
+ if (a !== h.tagName) {
546
+ let c = g(t, h.tagStartPos);
547
+ return p("InvalidTag", "Expected closing tag '" + h.tagName + "' (opened in line " + c.line + ", col " + c.col + ") instead of closing tag '" + a + "'.", g(t, l));
548
+ }
549
+ i.length == 0 && (n = !0);
550
+ }
551
+ } else
552
+ return p("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", g(t, r));
553
+ else {
554
+ const h = z(u, e);
555
+ if (h !== !0)
556
+ return p(h.err.code, h.err.msg, g(t, r - u.length + h.err.line));
557
+ if (n === !0)
558
+ return p("InvalidXml", "Multiple possible root nodes found.", g(t, r));
559
+ e.unpairedTags.indexOf(a) !== -1 || i.push({ tagName: a, tagStartPos: l }), s = !0;
560
+ }
561
+ for (r++; r < t.length; r++)
562
+ if (t[r] === "<")
563
+ if (t[r + 1] === "!") {
564
+ r++, r = U(t, r);
565
+ continue;
566
+ } else if (t[r + 1] === "?") {
567
+ if (r = q(t, ++r), r.err)
568
+ return r;
569
+ } else
570
+ break;
571
+ else if (t[r] === "&") {
572
+ const h = St(t, r);
573
+ if (h == -1)
574
+ return p("InvalidChar", "char '&' is not expected.", g(t, r));
575
+ r = h;
576
+ } else if (n === !0 && !B(t[r]))
577
+ return p("InvalidXml", "Extra text at the end", g(t, r));
578
+ t[r] === "<" && r--;
579
+ }
580
+ } else {
581
+ if (B(t[r]))
582
+ continue;
583
+ return p("InvalidChar", "char '" + t[r] + "' is not expected.", g(t, r));
584
+ }
585
+ if (s) {
586
+ if (i.length == 1)
587
+ return p("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", g(t, i[0].tagStartPos));
588
+ if (i.length > 0)
589
+ return p("InvalidXml", "Invalid '" + JSON.stringify(i.map((r) => r.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
590
+ } else
591
+ return p("InvalidXml", "Start tag expected.", 1);
592
+ return !0;
593
+ };
594
+ function B(t) {
595
+ return t === " " || t === " " || t === `
596
+ ` || t === "\r";
597
+ }
598
+ function q(t, e) {
599
+ const i = e;
600
+ for (; e < t.length; e++)
601
+ if (t[e] == "?" || t[e] == " ") {
602
+ const s = t.substr(i, e - i);
603
+ if (e > 5 && s === "xml")
604
+ return p("InvalidXml", "XML declaration allowed only at the start of the document.", g(t, e));
605
+ if (t[e] == "?" && t[e + 1] == ">") {
606
+ e++;
607
+ break;
608
+ } else
609
+ continue;
610
+ }
611
+ return e;
612
+ }
613
+ function U(t, e) {
614
+ if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
615
+ for (e += 3; e < t.length; e++)
616
+ if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
617
+ e += 2;
618
+ break;
619
+ }
620
+ } else if (t.length > e + 8 && t[e + 1] === "D" && t[e + 2] === "O" && t[e + 3] === "C" && t[e + 4] === "T" && t[e + 5] === "Y" && t[e + 6] === "P" && t[e + 7] === "E") {
621
+ let i = 1;
622
+ for (e += 8; e < t.length; e++)
623
+ if (t[e] === "<")
624
+ i++;
625
+ else if (t[e] === ">" && (i--, i === 0))
626
+ break;
627
+ } else if (t.length > e + 9 && t[e + 1] === "[" && t[e + 2] === "C" && t[e + 3] === "D" && t[e + 4] === "A" && t[e + 5] === "T" && t[e + 6] === "A" && t[e + 7] === "[") {
628
+ for (e += 8; e < t.length; e++)
629
+ if (t[e] === "]" && t[e + 1] === "]" && t[e + 2] === ">") {
630
+ e += 2;
631
+ break;
632
+ }
633
+ }
634
+ return e;
635
+ }
636
+ const It = '"', Ot = "'";
637
+ function Pt(t, e) {
638
+ let i = "", s = "", n = !1;
639
+ for (; e < t.length; e++) {
640
+ if (t[e] === It || t[e] === Ot)
641
+ s === "" ? s = t[e] : s !== t[e] || (s = "");
642
+ else if (t[e] === ">" && s === "") {
643
+ n = !0;
644
+ break;
645
+ }
646
+ i += t[e];
647
+ }
648
+ return s !== "" ? !1 : { value: i, index: e, tagClosed: n };
649
+ }
650
+ const Ct = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
651
+ function z(t, e) {
652
+ const i = L.getAllMatches(t, Ct), s = {};
653
+ for (let n = 0; n < i.length; n++) {
654
+ if (i[n][1].length === 0)
655
+ return p("InvalidAttr", "Attribute '" + i[n][2] + "' has no space in starting.", b(i[n]));
656
+ if (i[n][3] !== void 0 && i[n][4] === void 0)
657
+ return p("InvalidAttr", "Attribute '" + i[n][2] + "' is without value.", b(i[n]));
658
+ if (i[n][3] === void 0 && !e.allowBooleanAttributes)
659
+ return p("InvalidAttr", "boolean attribute '" + i[n][2] + "' is not allowed.", b(i[n]));
660
+ const r = i[n][2];
661
+ if (!Ft(r))
662
+ return p("InvalidAttr", "Attribute '" + r + "' is an invalid name.", b(i[n]));
663
+ if (!s.hasOwnProperty(r))
664
+ s[r] = 1;
665
+ else
666
+ return p("InvalidAttr", "Attribute '" + r + "' is repeated.", b(i[n]));
667
+ }
668
+ return !0;
669
+ }
670
+ function Dt(t, e) {
671
+ let i = /\d/;
672
+ for (t[e] === "x" && (e++, i = /[\da-fA-F]/); e < t.length; e++) {
673
+ if (t[e] === ";")
674
+ return e;
675
+ if (!t[e].match(i))
676
+ break;
677
+ }
678
+ return -1;
679
+ }
680
+ function St(t, e) {
681
+ if (e++, t[e] === ";")
682
+ return -1;
683
+ if (t[e] === "#")
684
+ return e++, Dt(t, e);
685
+ let i = 0;
686
+ for (; e < t.length; e++, i++)
687
+ if (!(t[e].match(/\w/) && i < 20)) {
688
+ if (t[e] === ";")
689
+ break;
690
+ return -1;
691
+ }
692
+ return e;
693
+ }
694
+ function p(t, e, i) {
695
+ return { err: { code: t, msg: e, line: i.line || i, col: i.col } };
696
+ }
697
+ function Ft(t) {
698
+ return L.isName(t);
699
+ }
700
+ function Vt(t) {
701
+ return L.isName(t);
702
+ }
703
+ function g(t, e) {
704
+ const i = t.substring(0, e).split(/\r?\n/);
705
+ return { line: i.length, col: i[i.length - 1].length + 1 };
706
+ }
707
+ function b(t) {
708
+ return t.startIndex + t[1].length;
709
+ }
710
+ var P = {};
711
+ const et = { 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(t, e) {
712
+ return e;
713
+ }, attributeValueProcessor: function(t, e) {
714
+ return e;
715
+ }, stopNodes: [], alwaysCreateTextNode: !1, isArray: () => !1, commentPropName: !1, unpairedTags: [], processEntities: !0, htmlEntities: !1, ignoreDeclaration: !1, ignorePiTags: !1, transformTagName: !1, transformAttributeName: !1, updateTag: function(t, e, i) {
716
+ return t;
717
+ } }, $t = function(t) {
718
+ return Object.assign({}, et, t);
719
+ };
720
+ P.buildOptions = $t, P.defaultOptions = et;
721
+ class kt {
722
+ constructor(e) {
723
+ this.tagname = e, this.child = [], this[":@"] = {};
724
+ }
725
+ add(e, i) {
726
+ e === "__proto__" && (e = "#__proto__"), this.child.push({ [e]: i });
727
+ }
728
+ addChild(e) {
729
+ e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({ [e.tagname]: e.child, ":@": e[":@"] }) : this.child.push({ [e.tagname]: e.child });
730
+ }
731
+ }
732
+ var Lt = kt;
733
+ const Rt = T;
734
+ function jt(t, e) {
735
+ const i = {};
736
+ 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") {
737
+ e = e + 9;
738
+ let s = 1, n = !1, r = !1, l = "";
739
+ for (; e < t.length; e++)
740
+ if (t[e] === "<" && !r) {
741
+ if (n && qt(t, e))
742
+ e += 7, [entityName, val, e] = Mt(t, e + 1), val.indexOf("&") === -1 && (i[Xt(entityName)] = { regx: RegExp(`&${entityName};`, "g"), val });
743
+ else if (n && Ut(t, e))
744
+ e += 8;
745
+ else if (n && zt(t, e))
746
+ e += 8;
747
+ else if (n && Gt(t, e))
748
+ e += 9;
749
+ else if (Bt)
750
+ r = !0;
751
+ else
752
+ throw new Error("Invalid DOCTYPE");
753
+ s++, l = "";
754
+ } else if (t[e] === ">") {
755
+ if (r ? t[e - 1] === "-" && t[e - 2] === "-" && (r = !1, s--) : s--, s === 0)
756
+ break;
757
+ } else
758
+ t[e] === "[" ? n = !0 : l += t[e];
759
+ if (s !== 0)
760
+ throw new Error("Unclosed DOCTYPE");
761
+ } else
762
+ throw new Error("Invalid Tag instead of DOCTYPE");
763
+ return { entities: i, i: e };
764
+ }
765
+ function Mt(t, e) {
766
+ let i = "";
767
+ for (; e < t.length && t[e] !== "'" && t[e] !== '"'; e++)
768
+ i += t[e];
769
+ if (i = i.trim(), i.indexOf(" ") !== -1)
770
+ throw new Error("External entites are not supported");
771
+ const s = t[e++];
772
+ let n = "";
773
+ for (; e < t.length && t[e] !== s; e++)
774
+ n += t[e];
775
+ return [i, n, e];
776
+ }
777
+ function Bt(t, e) {
778
+ return t[e + 1] === "!" && t[e + 2] === "-" && t[e + 3] === "-";
779
+ }
780
+ function qt(t, e) {
781
+ return t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "N" && t[e + 4] === "T" && t[e + 5] === "I" && t[e + 6] === "T" && t[e + 7] === "Y";
782
+ }
783
+ function Ut(t, e) {
784
+ return t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "L" && t[e + 4] === "E" && t[e + 5] === "M" && t[e + 6] === "E" && t[e + 7] === "N" && t[e + 8] === "T";
785
+ }
786
+ function zt(t, e) {
787
+ return t[e + 1] === "!" && t[e + 2] === "A" && t[e + 3] === "T" && t[e + 4] === "T" && t[e + 5] === "L" && t[e + 6] === "I" && t[e + 7] === "S" && t[e + 8] === "T";
788
+ }
789
+ function Gt(t, e) {
790
+ return t[e + 1] === "!" && t[e + 2] === "N" && t[e + 3] === "O" && t[e + 4] === "T" && t[e + 5] === "A" && t[e + 6] === "T" && t[e + 7] === "I" && t[e + 8] === "O" && t[e + 9] === "N";
791
+ }
792
+ function Xt(t) {
793
+ if (Rt.isName(t))
794
+ return t;
795
+ throw new Error(`Invalid entity name ${t}`);
796
+ }
797
+ var Ht = jt;
798
+ const Kt = /^[-+]?0x[a-fA-F0-9]+$/, Wt = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
799
+ !Number.parseInt && window.parseInt && (Number.parseInt = window.parseInt), !Number.parseFloat && window.parseFloat && (Number.parseFloat = window.parseFloat);
800
+ const Yt = { hex: !0, leadingZeros: !0, decimalPoint: ".", eNotation: !0 };
801
+ function Zt(t, e = {}) {
802
+ if (e = Object.assign({}, Yt, e), !t || typeof t != "string")
803
+ return t;
804
+ let i = t.trim();
805
+ if (e.skipLike !== void 0 && e.skipLike.test(i))
806
+ return t;
807
+ if (e.hex && Kt.test(i))
808
+ return Number.parseInt(i, 16);
809
+ {
810
+ const s = Wt.exec(i);
811
+ if (s) {
812
+ const n = s[1], r = s[2];
813
+ let l = Jt(s[3]);
814
+ const o = s[4] || s[6];
815
+ if (!e.leadingZeros && r.length > 0 && n && i[2] !== "." || !e.leadingZeros && r.length > 0 && !n && i[1] !== ".")
816
+ return t;
817
+ {
818
+ const a = Number(i), d = "" + a;
819
+ return d.search(/[eE]/) !== -1 || o ? e.eNotation ? a : t : i.indexOf(".") !== -1 ? d === "0" && l === "" || d === l || n && d === "-" + l ? a : t : r ? l === d || n + l === d ? a : t : i === d || i === n + d ? a : t;
820
+ }
821
+ } else
822
+ return t;
823
+ }
824
+ }
825
+ function Jt(t) {
826
+ return t && t.indexOf(".") !== -1 && (t = t.replace(/0+$/, ""), t === "." ? t = "0" : t[0] === "." ? t = "0" + t : t[t.length - 1] === "." && (t = t.substr(0, t.length - 1))), t;
827
+ }
828
+ var Qt = Zt;
829
+ const R = T, E = Lt, te = Ht, ee = Qt;
830
+ "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, R.nameRegexp);
831
+ let ie = class {
832
+ constructor(t) {
833
+ 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: "₹" } }, this.addExternalEntities = ne, this.parseXml = le, this.parseTextData = re, this.resolveNameSpace = se, this.buildAttributesMap = ae, this.isItStopNode = he, this.replaceEntitiesValue = ue, this.readStopNodeData = fe, this.saveTextToParentTag = ce, this.addChild = de;
834
+ }
835
+ };
836
+ function ne(t) {
837
+ const e = Object.keys(t);
838
+ for (let i = 0; i < e.length; i++) {
839
+ const s = e[i];
840
+ this.lastEntities[s] = { regex: new RegExp("&" + s + ";", "g"), val: t[s] };
841
+ }
842
+ }
843
+ function re(t, e, i, s, n, r, l) {
844
+ if (t !== void 0 && (this.options.trimValues && !s && (t = t.trim()), t.length > 0)) {
845
+ l || (t = this.replaceEntitiesValue(t));
846
+ const o = this.options.tagValueProcessor(e, t, i, n, r);
847
+ return o == null ? t : typeof o != typeof t || o !== t ? o : this.options.trimValues ? D(t, this.options.parseTagValue, this.options.numberParseOptions) : t.trim() === t ? D(t, this.options.parseTagValue, this.options.numberParseOptions) : t;
848
+ }
849
+ }
850
+ function se(t) {
851
+ if (this.options.removeNSPrefix) {
852
+ const e = t.split(":"), i = t.charAt(0) === "/" ? "/" : "";
853
+ if (e[0] === "xmlns")
854
+ return "";
855
+ e.length === 2 && (t = i + e[1]);
856
+ }
857
+ return t;
858
+ }
859
+ const oe = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
860
+ function ae(t, e, i) {
861
+ if (!this.options.ignoreAttributes && typeof t == "string") {
862
+ const s = R.getAllMatches(t, oe), n = s.length, r = {};
863
+ for (let l = 0; l < n; l++) {
864
+ const o = this.resolveNameSpace(s[l][1]);
865
+ let a = s[l][4], d = this.options.attributeNamePrefix + o;
866
+ if (o.length)
867
+ if (this.options.transformAttributeName && (d = this.options.transformAttributeName(d)), d === "__proto__" && (d = "#__proto__"), a !== void 0) {
868
+ this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
869
+ const u = this.options.attributeValueProcessor(o, a, e);
870
+ u == null ? r[d] = a : typeof u != typeof a || u !== a ? r[d] = u : r[d] = D(a, this.options.parseAttributeValue, this.options.numberParseOptions);
871
+ } else
872
+ this.options.allowBooleanAttributes && (r[d] = !0);
873
+ }
874
+ if (!Object.keys(r).length)
875
+ return;
876
+ if (this.options.attributesGroupName) {
877
+ const l = {};
878
+ return l[this.options.attributesGroupName] = r, l;
879
+ }
880
+ return r;
881
+ }
882
+ }
883
+ const le = function(t) {
884
+ t = t.replace(/\r\n?/g, `
885
+ `);
886
+ const e = new E("!xml");
887
+ let i = e, s = "", n = "";
888
+ for (let r = 0; r < t.length; r++)
889
+ if (t[r] === "<")
890
+ if (t[r + 1] === "/") {
891
+ const l = x(t, ">", r, "Closing Tag is not closed.");
892
+ let o = t.substring(r + 2, l).trim();
893
+ if (this.options.removeNSPrefix) {
894
+ const u = o.indexOf(":");
895
+ u !== -1 && (o = o.substr(u + 1));
896
+ }
897
+ this.options.transformTagName && (o = this.options.transformTagName(o)), i && (s = this.saveTextToParentTag(s, i, n));
898
+ const a = n.substring(n.lastIndexOf(".") + 1);
899
+ if (o && this.options.unpairedTags.indexOf(o) !== -1)
900
+ throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);
901
+ let d = 0;
902
+ a && this.options.unpairedTags.indexOf(a) !== -1 ? (d = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : d = n.lastIndexOf("."), n = n.substring(0, d), i = this.tagsNodeStack.pop(), s = "", r = l;
903
+ } else if (t[r + 1] === "?") {
904
+ let l = C(t, r, !1, "?>");
905
+ if (!l)
906
+ throw new Error("Pi Tag is not closed.");
907
+ if (s = this.saveTextToParentTag(s, i, n), !(this.options.ignoreDeclaration && l.tagName === "?xml" || this.options.ignorePiTags)) {
908
+ const o = new E(l.tagName);
909
+ o.add(this.options.textNodeName, ""), l.tagName !== l.tagExp && l.attrExpPresent && (o[":@"] = this.buildAttributesMap(l.tagExp, n, l.tagName)), this.addChild(i, o, n);
910
+ }
911
+ r = l.closeIndex + 1;
912
+ } else if (t.substr(r + 1, 3) === "!--") {
913
+ const l = x(t, "-->", r + 4, "Comment is not closed.");
914
+ if (this.options.commentPropName) {
915
+ const o = t.substring(r + 4, l - 2);
916
+ s = this.saveTextToParentTag(s, i, n), i.add(this.options.commentPropName, [{ [this.options.textNodeName]: o }]);
917
+ }
918
+ r = l;
919
+ } else if (t.substr(r + 1, 2) === "!D") {
920
+ const l = te(t, r);
921
+ this.docTypeEntities = l.entities, r = l.i;
922
+ } else if (t.substr(r + 1, 2) === "![") {
923
+ const l = x(t, "]]>", r, "CDATA is not closed.") - 2, o = t.substring(r + 9, l);
924
+ if (s = this.saveTextToParentTag(s, i, n), this.options.cdataPropName)
925
+ i.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o }]);
926
+ else {
927
+ let a = this.parseTextData(o, i.tagname, n, !0, !1, !0);
928
+ a == null && (a = ""), i.add(this.options.textNodeName, a);
929
+ }
930
+ r = l + 2;
931
+ } else {
932
+ let l = C(t, r, this.options.removeNSPrefix), o = l.tagName, a = l.tagExp, d = l.attrExpPresent, u = l.closeIndex;
933
+ this.options.transformTagName && (o = this.options.transformTagName(o)), i && s && i.tagname !== "!xml" && (s = this.saveTextToParentTag(s, i, n, !1));
934
+ const h = i;
935
+ if (h && this.options.unpairedTags.indexOf(h.tagname) !== -1 && (i = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), o !== e.tagname && (n += n ? "." + o : o), this.isItStopNode(this.options.stopNodes, n, o)) {
936
+ let c = "";
937
+ if (a.length > 0 && a.lastIndexOf("/") === a.length - 1)
938
+ r = l.closeIndex;
939
+ else if (this.options.unpairedTags.indexOf(o) !== -1)
940
+ r = l.closeIndex;
941
+ else {
942
+ const w = this.readStopNodeData(t, o, u + 1);
943
+ if (!w)
944
+ throw new Error(`Unexpected end of ${o}`);
945
+ r = w.i, c = w.tagContent;
946
+ }
947
+ const f = new E(o);
948
+ o !== a && d && (f[":@"] = this.buildAttributesMap(a, n, o)), c && (c = this.parseTextData(c, o, n, !0, d, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), f.add(this.options.textNodeName, c), this.addChild(i, f, n);
949
+ } else {
950
+ if (a.length > 0 && a.lastIndexOf("/") === a.length - 1) {
951
+ o[o.length - 1] === "/" ? (o = o.substr(0, o.length - 1), n = n.substr(0, n.length - 1), a = o) : a = a.substr(0, a.length - 1), this.options.transformTagName && (o = this.options.transformTagName(o));
952
+ const c = new E(o);
953
+ o !== a && d && (c[":@"] = this.buildAttributesMap(a, n, o)), this.addChild(i, c, n), n = n.substr(0, n.lastIndexOf("."));
954
+ } else {
955
+ const c = new E(o);
956
+ this.tagsNodeStack.push(i), o !== a && d && (c[":@"] = this.buildAttributesMap(a, n, o)), this.addChild(i, c, n), i = c;
957
+ }
958
+ s = "", r = u;
959
+ }
960
+ }
961
+ else
962
+ s += t[r];
963
+ return e.child;
964
+ };
965
+ function de(t, e, i) {
966
+ const s = this.options.updateTag(e.tagname, i, e[":@"]);
967
+ s === !1 || (typeof s == "string" && (e.tagname = s), t.addChild(e));
968
+ }
969
+ const ue = function(t) {
970
+ if (this.options.processEntities) {
971
+ for (let e in this.docTypeEntities) {
972
+ const i = this.docTypeEntities[e];
973
+ t = t.replace(i.regx, i.val);
974
+ }
975
+ for (let e in this.lastEntities) {
976
+ const i = this.lastEntities[e];
977
+ t = t.replace(i.regex, i.val);
978
+ }
979
+ if (this.options.htmlEntities)
980
+ for (let e in this.htmlEntities) {
981
+ const i = this.htmlEntities[e];
982
+ t = t.replace(i.regex, i.val);
983
+ }
984
+ t = t.replace(this.ampEntity.regex, this.ampEntity.val);
985
+ }
986
+ return t;
987
+ };
988
+ function ce(t, e, i, s) {
989
+ return t && (s === void 0 && (s = Object.keys(e.child).length === 0), t = this.parseTextData(t, e.tagname, i, !1, e[":@"] ? Object.keys(e[":@"]).length !== 0 : !1, s), t !== void 0 && t !== "" && e.add(this.options.textNodeName, t), t = ""), t;
990
+ }
991
+ function he(t, e, i) {
992
+ const s = "*." + i;
993
+ for (const n in t) {
994
+ const r = t[n];
995
+ if (s === r || e === r)
996
+ return !0;
997
+ }
998
+ return !1;
999
+ }
1000
+ function pe(t, e, i = ">") {
1001
+ let s, n = "";
1002
+ for (let r = e; r < t.length; r++) {
1003
+ let l = t[r];
1004
+ if (s)
1005
+ l === s && (s = "");
1006
+ else if (l === '"' || l === "'")
1007
+ s = l;
1008
+ else if (l === i[0])
1009
+ if (i[1]) {
1010
+ if (t[r + 1] === i[1])
1011
+ return { data: n, index: r };
1012
+ } else
1013
+ return { data: n, index: r };
1014
+ else
1015
+ l === " " && (l = " ");
1016
+ n += l;
1017
+ }
1018
+ }
1019
+ function x(t, e, i, s) {
1020
+ const n = t.indexOf(e, i);
1021
+ if (n === -1)
1022
+ throw new Error(s);
1023
+ return n + e.length - 1;
1024
+ }
1025
+ function C(t, e, i, s = ">") {
1026
+ const n = pe(t, e + 1, s);
1027
+ if (!n)
1028
+ return;
1029
+ let r = n.data;
1030
+ const l = n.index, o = r.search(/\s/);
1031
+ let a = r, d = !0;
1032
+ if (o !== -1 && (a = r.substr(0, o).replace(/\s\s*$/, ""), r = r.substr(o + 1)), i) {
1033
+ const u = a.indexOf(":");
1034
+ u !== -1 && (a = a.substr(u + 1), d = a !== n.data.substr(u + 1));
1035
+ }
1036
+ return { tagName: a, tagExp: r, closeIndex: l, attrExpPresent: d };
1037
+ }
1038
+ function fe(t, e, i) {
1039
+ const s = i;
1040
+ let n = 1;
1041
+ for (; i < t.length; i++)
1042
+ if (t[i] === "<")
1043
+ if (t[i + 1] === "/") {
1044
+ const r = x(t, ">", i, `${e} is not closed`);
1045
+ if (t.substring(i + 2, r).trim() === e && (n--, n === 0))
1046
+ return { tagContent: t.substring(s, i), i: r };
1047
+ i = r;
1048
+ } else if (t[i + 1] === "?")
1049
+ i = x(t, "?>", i + 1, "StopNode is not closed.");
1050
+ else if (t.substr(i + 1, 3) === "!--")
1051
+ i = x(t, "-->", i + 3, "StopNode is not closed.");
1052
+ else if (t.substr(i + 1, 2) === "![")
1053
+ i = x(t, "]]>", i, "StopNode is not closed.") - 2;
1054
+ else {
1055
+ const r = C(t, i, ">");
1056
+ r && ((r && r.tagName) === e && r.tagExp[r.tagExp.length - 1] !== "/" && n++, i = r.closeIndex);
1057
+ }
1058
+ }
1059
+ function D(t, e, i) {
1060
+ if (e && typeof t == "string") {
1061
+ const s = t.trim();
1062
+ return s === "true" ? !0 : s === "false" ? !1 : ee(t, i);
1063
+ } else
1064
+ return R.isExist(t) ? t : "";
1065
+ }
1066
+ var ge = ie, it = {};
1067
+ function me(t, e) {
1068
+ return nt(t, e);
1069
+ }
1070
+ function nt(t, e, i) {
1071
+ let s;
1072
+ const n = {};
1073
+ for (let r = 0; r < t.length; r++) {
1074
+ const l = t[r], o = we(l);
1075
+ let a = "";
1076
+ if (i === void 0 ? a = o : a = i + "." + o, o === e.textNodeName)
1077
+ s === void 0 ? s = l[o] : s += "" + l[o];
1078
+ else {
1079
+ if (o === void 0)
1080
+ continue;
1081
+ if (l[o]) {
1082
+ let d = nt(l[o], e, a);
1083
+ const u = ye(d, e);
1084
+ l[":@"] ? ve(d, l[":@"], a, e) : Object.keys(d).length === 1 && d[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? d = d[e.textNodeName] : Object.keys(d).length === 0 && (e.alwaysCreateTextNode ? d[e.textNodeName] = "" : d = ""), n[o] !== void 0 && n.hasOwnProperty(o) ? (Array.isArray(n[o]) || (n[o] = [n[o]]), n[o].push(d)) : e.isArray(o, a, u) ? n[o] = [d] : n[o] = d;
1085
+ }
1086
+ }
1087
+ }
1088
+ return typeof s == "string" ? s.length > 0 && (n[e.textNodeName] = s) : s !== void 0 && (n[e.textNodeName] = s), n;
1089
+ }
1090
+ function we(t) {
1091
+ const e = Object.keys(t);
1092
+ for (let i = 0; i < e.length; i++) {
1093
+ const s = e[i];
1094
+ if (s !== ":@")
1095
+ return s;
1096
+ }
1097
+ }
1098
+ function ve(t, e, i, s) {
1099
+ if (e) {
1100
+ const n = Object.keys(e), r = n.length;
1101
+ for (let l = 0; l < r; l++) {
1102
+ const o = n[l];
1103
+ s.isArray(o, i + "." + o, !0, !0) ? t[o] = [e[o]] : t[o] = e[o];
1104
+ }
1105
+ }
1106
+ }
1107
+ function ye(t, e) {
1108
+ const { textNodeName: i } = e, s = Object.keys(t).length;
1109
+ return !!(s === 0 || s === 1 && (t[i] || typeof t[i] == "boolean" || t[i] === 0));
1110
+ }
1111
+ it.prettify = me;
1112
+ const { buildOptions: xe } = P, be = ge, { prettify: Ee } = it, Ne = k;
1113
+ let _e = class {
1114
+ constructor(t) {
1115
+ this.externalEntities = {}, this.options = xe(t);
1116
+ }
1117
+ parse(t, e) {
1118
+ if (typeof t != "string")
1119
+ if (t.toString)
1120
+ t = t.toString();
1121
+ else
1122
+ throw new Error("XML data is accepted in String or Bytes[] form.");
1123
+ if (e) {
1124
+ e === !0 && (e = {});
1125
+ const n = Ne.validate(t, e);
1126
+ if (n !== !0)
1127
+ throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
1128
+ }
1129
+ const i = new be(this.options);
1130
+ i.addExternalEntities(this.externalEntities);
1131
+ const s = i.parseXml(t);
1132
+ return this.options.preserveOrder || s === void 0 ? s : Ee(s, this.options);
1133
+ }
1134
+ addEntity(t, e) {
1135
+ if (e.indexOf("&") !== -1)
1136
+ throw new Error("Entity value can't have '&'");
1137
+ if (t.indexOf("&") !== -1 || t.indexOf(";") !== -1)
1138
+ throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1139
+ if (e === "&")
1140
+ throw new Error("An entity with value '&' is not permitted");
1141
+ this.externalEntities[t] = e;
1142
+ }
1143
+ };
1144
+ var Ae = _e;
1145
+ const Te = `
1146
+ `;
1147
+ function Ie(t, e) {
1148
+ let i = "";
1149
+ return e.format && e.indentBy.length > 0 && (i = Te), rt(t, e, "", i);
1150
+ }
1151
+ function rt(t, e, i, s) {
1152
+ let n = "", r = !1;
1153
+ for (let l = 0; l < t.length; l++) {
1154
+ const o = t[l], a = Oe(o);
1155
+ let d = "";
1156
+ if (i.length === 0 ? d = a : d = `${i}.${a}`, a === e.textNodeName) {
1157
+ let w = o[a];
1158
+ Pe(d, e) || (w = e.tagValueProcessor(a, w), w = st(w, e)), r && (n += s), n += w, r = !1;
1159
+ continue;
1160
+ } else if (a === e.cdataPropName) {
1161
+ r && (n += s), n += `<![CDATA[${o[a][0][e.textNodeName]}]]>`, r = !1;
1162
+ continue;
1163
+ } else if (a === e.commentPropName) {
1164
+ n += s + `<!--${o[a][0][e.textNodeName]}-->`, r = !0;
1165
+ continue;
1166
+ } else if (a[0] === "?") {
1167
+ const w = G(o[":@"], e), ot = a === "?xml" ? "" : s;
1168
+ let N = o[a][0][e.textNodeName];
1169
+ N = N.length !== 0 ? " " + N : "", n += ot + `<${a}${N}${w}?>`, r = !0;
1170
+ continue;
1171
+ }
1172
+ let u = s;
1173
+ u !== "" && (u += e.indentBy);
1174
+ const h = G(o[":@"], e), c = s + `<${a}${h}`, f = rt(o[a], e, d, u);
1175
+ e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += c + ">" : n += c + "/>" : (!f || f.length === 0) && e.suppressEmptyNode ? n += c + "/>" : f && f.endsWith(">") ? n += c + `>${f}${s}</${a}>` : (n += c + ">", f && s !== "" && (f.includes("/>") || f.includes("</")) ? n += s + e.indentBy + f + s : n += f, n += `</${a}>`), r = !0;
1176
+ }
1177
+ return n;
1178
+ }
1179
+ function Oe(t) {
1180
+ const e = Object.keys(t);
1181
+ for (let i = 0; i < e.length; i++) {
1182
+ const s = e[i];
1183
+ if (s !== ":@")
1184
+ return s;
1185
+ }
1186
+ }
1187
+ function G(t, e) {
1188
+ let i = "";
1189
+ if (t && !e.ignoreAttributes)
1190
+ for (let s in t) {
1191
+ let n = e.attributeValueProcessor(s, t[s]);
1192
+ n = st(n, e), n === !0 && e.suppressBooleanAttributes ? i += ` ${s.substr(e.attributeNamePrefix.length)}` : i += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
1193
+ }
1194
+ return i;
1195
+ }
1196
+ function Pe(t, e) {
1197
+ t = t.substr(0, t.length - e.textNodeName.length - 1);
1198
+ let i = t.substr(t.lastIndexOf(".") + 1);
1199
+ for (let s in e.stopNodes)
1200
+ if (e.stopNodes[s] === t || e.stopNodes[s] === "*." + i)
1201
+ return !0;
1202
+ return !1;
1203
+ }
1204
+ function st(t, e) {
1205
+ if (t && t.length > 0 && e.processEntities)
1206
+ for (let i = 0; i < e.entities.length; i++) {
1207
+ const s = e.entities[i];
1208
+ t = t.replace(s.regex, s.val);
1209
+ }
1210
+ return t;
1211
+ }
1212
+ var Ce = Ie;
1213
+ const De = Ce, Se = { attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, cdataPropName: !1, format: !1, indentBy: " ", suppressEmptyNode: !1, suppressUnpairedNode: !0, suppressBooleanAttributes: !0, tagValueProcessor: function(t, e) {
1214
+ return e;
1215
+ }, attributeValueProcessor: function(t, e) {
1216
+ return e;
1217
+ }, 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 };
1218
+ function y(t) {
1219
+ this.options = Object.assign({}, Se, t), this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
1220
+ return !1;
1221
+ } : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = $e), this.processTextOrObjNode = Fe, this.options.format ? (this.indentate = Ve, this.tagEndChar = `>
1222
+ `, this.newLine = `
1223
+ `) : (this.indentate = function() {
1224
+ return "";
1225
+ }, this.tagEndChar = ">", this.newLine = "");
1226
+ }
1227
+ y.prototype.build = function(t) {
1228
+ return this.options.preserveOrder ? De(t, this.options) : (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t = { [this.options.arrayNodeName]: t }), this.j2x(t, 0).val);
1229
+ }, y.prototype.j2x = function(t, e) {
1230
+ let i = "", s = "";
1231
+ for (let n in t)
1232
+ if (typeof t[n] > "u")
1233
+ this.isAttribute(n) && (s += "");
1234
+ else if (t[n] === null)
1235
+ this.isAttribute(n) ? s += "" : n[0] === "?" ? s += this.indentate(e) + "<" + n + "?" + this.tagEndChar : s += this.indentate(e) + "<" + n + "/" + this.tagEndChar;
1236
+ else if (t[n] instanceof Date)
1237
+ s += this.buildTextValNode(t[n], n, "", e);
1238
+ else if (typeof t[n] != "object") {
1239
+ const r = this.isAttribute(n);
1240
+ if (r)
1241
+ i += this.buildAttrPairStr(r, "" + t[n]);
1242
+ else if (n === this.options.textNodeName) {
1243
+ let l = this.options.tagValueProcessor(n, "" + t[n]);
1244
+ s += this.replaceEntitiesValue(l);
1245
+ } else
1246
+ s += this.buildTextValNode(t[n], n, "", e);
1247
+ } else if (Array.isArray(t[n])) {
1248
+ const r = t[n].length;
1249
+ let l = "";
1250
+ for (let o = 0; o < r; o++) {
1251
+ const a = t[n][o];
1252
+ typeof a > "u" || (a === null ? n[0] === "?" ? s += this.indentate(e) + "<" + n + "?" + this.tagEndChar : s += this.indentate(e) + "<" + n + "/" + this.tagEndChar : typeof a == "object" ? this.options.oneListGroup ? l += this.j2x(a, e + 1).val : l += this.processTextOrObjNode(a, n, e) : l += this.buildTextValNode(a, n, "", e));
1253
+ }
1254
+ this.options.oneListGroup && (l = this.buildObjectNode(l, n, "", e)), s += l;
1255
+ } else if (this.options.attributesGroupName && n === this.options.attributesGroupName) {
1256
+ const r = Object.keys(t[n]), l = r.length;
1257
+ for (let o = 0; o < l; o++)
1258
+ i += this.buildAttrPairStr(r[o], "" + t[n][r[o]]);
1259
+ } else
1260
+ s += this.processTextOrObjNode(t[n], n, e);
1261
+ return { attrStr: i, val: s };
1262
+ }, y.prototype.buildAttrPairStr = function(t, e) {
1263
+ return e = this.options.attributeValueProcessor(t, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + t : " " + t + '="' + e + '"';
1264
+ };
1265
+ function Fe(t, e, i) {
1266
+ const s = this.j2x(t, i + 1);
1267
+ return t[this.options.textNodeName] !== void 0 && Object.keys(t).length === 1 ? this.buildTextValNode(t[this.options.textNodeName], e, s.attrStr, i) : this.buildObjectNode(s.val, e, s.attrStr, i);
1268
+ }
1269
+ y.prototype.buildObjectNode = function(t, e, i, s) {
1270
+ if (t === "")
1271
+ return e[0] === "?" ? this.indentate(s) + "<" + e + i + "?" + this.tagEndChar : this.indentate(s) + "<" + e + i + this.closeTag(e) + this.tagEndChar;
1272
+ {
1273
+ let n = "</" + e + this.tagEndChar, r = "";
1274
+ return e[0] === "?" && (r = "?", n = ""), (i || i === "") && t.indexOf("<") === -1 ? this.indentate(s) + "<" + e + i + r + ">" + t + n : this.options.commentPropName !== !1 && e === this.options.commentPropName && r.length === 0 ? this.indentate(s) + `<!--${t}-->` + this.newLine : this.indentate(s) + "<" + e + i + r + this.tagEndChar + t + this.indentate(s) + n;
1275
+ }
1276
+ }, y.prototype.closeTag = function(t) {
1277
+ let e = "";
1278
+ return this.options.unpairedTags.indexOf(t) !== -1 ? this.options.suppressUnpairedNode || (e = "/") : this.options.suppressEmptyNode ? e = "/" : e = `></${t}`, e;
1279
+ }, y.prototype.buildTextValNode = function(t, e, i, s) {
1280
+ if (this.options.cdataPropName !== !1 && e === this.options.cdataPropName)
1281
+ return this.indentate(s) + `<![CDATA[${t}]]>` + this.newLine;
1282
+ if (this.options.commentPropName !== !1 && e === this.options.commentPropName)
1283
+ return this.indentate(s) + `<!--${t}-->` + this.newLine;
1284
+ if (e[0] === "?")
1285
+ return this.indentate(s) + "<" + e + i + "?" + this.tagEndChar;
1286
+ {
1287
+ let n = this.options.tagValueProcessor(e, t);
1288
+ return n = this.replaceEntitiesValue(n), n === "" ? this.indentate(s) + "<" + e + i + this.closeTag(e) + this.tagEndChar : this.indentate(s) + "<" + e + i + ">" + n + "</" + e + this.tagEndChar;
1289
+ }
1290
+ }, y.prototype.replaceEntitiesValue = function(t) {
1291
+ if (t && t.length > 0 && this.options.processEntities)
1292
+ for (let e = 0; e < this.options.entities.length; e++) {
1293
+ const i = this.options.entities[e];
1294
+ t = t.replace(i.regex, i.val);
1295
+ }
1296
+ return t;
1297
+ };
1298
+ function Ve(t) {
1299
+ return this.options.indentBy.repeat(t);
1300
+ }
1301
+ function $e(t) {
1302
+ return t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName ? t.substr(this.attrPrefixLen) : !1;
1303
+ }
1304
+ var ke = y;
1305
+ const Le = k, Re = Ae, je = ke;
1306
+ var X = { XMLParser: Re, XMLValidator: Le, XMLBuilder: je };
1307
+ function Me(t) {
1308
+ if (typeof t != "string")
1309
+ throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
1310
+ if (t = t.trim(), t.length === 0 || X.XMLValidator.validate(t) !== !0)
1311
+ return !1;
1312
+ let e;
1313
+ const i = new X.XMLParser();
1314
+ try {
1315
+ e = i.parse(t);
1316
+ } catch {
1317
+ return !1;
1318
+ }
1319
+ return !(!e || !("svg" in e));
1320
+ }
1321
+ class li {
1322
+ _view;
1323
+ constructor(e) {
1324
+ Be(e), this._view = e;
1325
+ }
1326
+ get id() {
1327
+ return this._view.id;
1328
+ }
1329
+ get name() {
1330
+ return this._view.name;
1331
+ }
1332
+ get caption() {
1333
+ return this._view.caption;
1334
+ }
1335
+ get emptyTitle() {
1336
+ return this._view.emptyTitle;
1337
+ }
1338
+ get emptyCaption() {
1339
+ return this._view.emptyCaption;
1340
+ }
1341
+ get getContents() {
1342
+ return this._view.getContents;
1343
+ }
1344
+ get icon() {
1345
+ return this._view.icon;
1346
+ }
1347
+ set icon(e) {
1348
+ this._view.icon = e;
1349
+ }
1350
+ get order() {
1351
+ return this._view.order;
1352
+ }
1353
+ set order(e) {
1354
+ this._view.order = e;
1355
+ }
1356
+ get params() {
1357
+ return this._view.params;
1358
+ }
1359
+ set params(e) {
1360
+ this._view.params = e;
1361
+ }
1362
+ get columns() {
1363
+ return this._view.columns;
1364
+ }
1365
+ get emptyView() {
1366
+ return this._view.emptyView;
1367
+ }
1368
+ get parent() {
1369
+ return this._view.parent;
1370
+ }
1371
+ get sticky() {
1372
+ return this._view.sticky;
1373
+ }
1374
+ get expanded() {
1375
+ return this._view.expanded;
1376
+ }
1377
+ set expanded(e) {
1378
+ this._view.expanded = e;
1379
+ }
1380
+ get defaultSortKey() {
1381
+ return this._view.defaultSortKey;
1382
+ }
1383
+ }
1384
+ const Be = function(t) {
1385
+ if (!t.id || typeof t.id != "string")
1386
+ throw new Error("View id is required and must be a string");
1387
+ if (!t.name || typeof t.name != "string")
1388
+ throw new Error("View name is required and must be a string");
1389
+ if (t.columns && t.columns.length > 0 && (!t.caption || typeof t.caption != "string"))
1390
+ throw new Error("View caption is required for top-level views and must be a string");
1391
+ if (!t.getContents || typeof t.getContents != "function")
1392
+ throw new Error("View getContents is required and must be a function");
1393
+ if (!t.icon || typeof t.icon != "string" || !Me(t.icon))
1394
+ throw new Error("View icon is required and must be a valid svg string");
1395
+ if (!("order" in t) || typeof t.order != "number")
1396
+ throw new Error("View order is required and must be a number");
1397
+ if (t.columns && t.columns.forEach((e) => {
1398
+ if (!(e instanceof _t))
1399
+ throw new Error("View columns must be an array of Column. Invalid column found");
1400
+ }), t.emptyView && typeof t.emptyView != "function")
1401
+ throw new Error("View emptyView must be a function");
1402
+ if (t.parent && typeof t.parent != "string")
1403
+ throw new Error("View parent must be a string");
1404
+ if ("sticky" in t && typeof t.sticky != "boolean")
1405
+ throw new Error("View sticky must be a boolean");
1406
+ if ("expanded" in t && typeof t.expanded != "boolean")
1407
+ throw new Error("View expanded must be a boolean");
1408
+ if (t.defaultSortKey && typeof t.defaultSortKey != "string")
1409
+ throw new Error("View defaultSortKey must be a string");
1410
+ return !0;
1411
+ }, di = function(t) {
1412
+ return S().registerEntry(t);
1413
+ }, ui = function(t) {
1414
+ return S().unregisterEntry(t);
1415
+ }, ci = function(t) {
1416
+ return S().getEntries(t);
1417
+ };
1418
+ export {
1419
+ _t as Column,
1420
+ H as DefaultType,
1421
+ xt as File,
1422
+ Ye as FileAction,
1423
+ $ as FileType,
1424
+ bt as Folder,
1425
+ Qe as Header,
1426
+ Nt as Navigation,
1427
+ J as Node,
1428
+ Z as NodeStatus,
1429
+ v as Permission,
1430
+ li as View,
1431
+ di as addNewFileMenuEntry,
1432
+ si as davGetClient,
1433
+ ni as davGetDefaultPropfind,
1434
+ vt as davGetFavoritesReport,
1435
+ ri as davGetRecentSearch,
1436
+ yt as davParsePermissions,
1437
+ tt as davRemoteURL,
1438
+ Et as davResultToNode,
1439
+ Q as davRootPath,
1440
+ W as defaultDavNamespaces,
1441
+ K as defaultDavProperties,
1442
+ We as formatFileSize,
1443
+ V as getDavNameSpaces,
1444
+ F as getDavProperties,
1445
+ oi as getFavoriteNodes,
1446
+ Je as getFileActions,
1447
+ ei as getFileListHeaders,
1448
+ ai as getNavigation,
1449
+ ci as getNewFileMenuEntries,
1450
+ ii as registerDavProperty,
1451
+ Ze as registerFileAction,
1452
+ ti as registerFileListHeaders,
1453
+ ui as removeNewFileMenuEntry
1454
+ };