From 835d357c8512ddb18afd0042e2cd0905c6ce9150 Mon Sep 17 00:00:00 2001
From: Ferdinand Thiessen <opensource@fthiessen.de>
Date: Wed, 31 Jul 2024 16:52:24 +0200
Subject: [PATCH] fix(systemtags): Correctly set the display name for the
 Nextcloud node

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
---
 apps/systemtags/src/services/systemtags.ts | 27 +++++++++++-----------
 dist/systemtags-init.js                    |  4 ++--
 dist/systemtags-init.js.map                |  2 +-
 3 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/apps/systemtags/src/services/systemtags.ts b/apps/systemtags/src/services/systemtags.ts
index 8e318f13adc9d..f29bb83984b28 100644
--- a/apps/systemtags/src/services/systemtags.ts
+++ b/apps/systemtags/src/services/systemtags.ts
@@ -6,12 +6,12 @@ import type { ContentsWithRoot } from '@nextcloud/files'
 import type { FileStat, ResponseDataDetailed } from 'webdav'
 import type { TagWithId } from '../types'
 
-import { Folder, Permission, getDavNameSpaces, getDavProperties, davGetClient, davResultToNode } from '@nextcloud/files'
-import { generateRemoteUrl } from '@nextcloud/router'
 import { getCurrentUser } from '@nextcloud/auth'
-
+import { Folder, Permission, getDavNameSpaces, getDavProperties, davGetClient, davResultToNode, davRemoteURL, davRootPath } from '@nextcloud/files'
 import { fetchTags } from './api'
 
+const rootPath = '/systemtags'
+
 const client = davGetClient()
 const resultToNode = (node: FileStat) => davResultToNode(node)
 
@@ -20,17 +20,18 @@ const formatReportPayload = (tagId: number) => `<?xml version="1.0"?>
 	<d:prop>
 		${getDavProperties()}
 	</d:prop>
-    <oc:filter-rules>
-        <oc:systemtag>${tagId}</oc:systemtag>
-    </oc:filter-rules>
+	<oc:filter-rules>
+		<oc:systemtag>${tagId}</oc:systemtag>
+	</oc:filter-rules>
 </oc:filter-files>`
 
 const tagToNode = function(tag: TagWithId): Folder {
 	return new Folder({
 		id: tag.id,
-		source: generateRemoteUrl('dav/systemtags/' + tag.id),
-		owner: getCurrentUser()?.uid as string,
-		root: '/systemtags',
+		source: `${davRemoteURL}${rootPath}/${tag.id}`,
+		owner: String(getCurrentUser()?.uid ?? 'anonymous'),
+		root: rootPath,
+		displayname: tag.displayName,
 		permissions: Permission.READ,
 		attributes: {
 			...tag,
@@ -47,16 +48,16 @@ export const getContents = async (path = '/'): Promise<ContentsWithRoot> => {
 		return {
 			folder: new Folder({
 				id: 0,
-				source: generateRemoteUrl('dav/systemtags'),
+				source: `${davRemoteURL}${rootPath}`,
 				owner: getCurrentUser()?.uid as string,
-				root: '/systemtags',
+				root: rootPath,
 				permissions: Permission.NONE,
 			}),
 			contents: tagsCache.map(tagToNode),
 		}
 	}
 
-	const tagId = parseInt(path.replace('/', ''), 10)
+	const tagId = parseInt(path.split('/', 2)[0])
 	const tag = tagsCache.find(tag => tag.id === tagId)
 
 	if (!tag) {
@@ -64,7 +65,7 @@ export const getContents = async (path = '/'): Promise<ContentsWithRoot> => {
 	}
 
 	const folder = tagToNode(tag)
-	const contentsResponse = await client.getDirectoryContents('/', {
+	const contentsResponse = await client.getDirectoryContents(davRootPath, {
 		details: true,
 		// Only filter favorites if we're at the root
 		data: formatReportPayload(tagId),
diff --git a/dist/systemtags-init.js b/dist/systemtags-init.js
index 1bf0d3d64d138..f43765c48a46b 100644
--- a/dist/systemtags-init.js
+++ b/dist/systemtags-init.js
@@ -1,2 +1,2 @@
-(()=>{var t,e={27560:(t,e,i)=>{"use strict";var n=i(35947),r=i(21777),s=i(43627),o=i(71225),a=i(63814),l=(i(36117),i(44719)),d=i(82680),u=(i(87485),i(53334)),c=i(380),p=i(65606),h=i(96763);const f=(0,n.YK)().setApp("@nextcloud/files").detectUser().build();var g=(t=>(t.DEFAULT="default",t.HIDDEN="hidden",t))(g||{}),m=(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))(m||{});const E=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],w={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"};var v=(t=>(t.Folder="folder",t.File="file",t))(v||{});const N=function(t,e){return null!==t.match(e)},A=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch(t){throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.displayname&&"string"!=typeof t.displayname)throw new Error("Invalid displayname type");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=m.NONE&&t.permissions<=m.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&N(t.source,e)){const i=t.source.match(e)[0];if(!t.source.includes((0,s.join)(i,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(b).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var b=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(b||{});class x{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(x.prototype)).filter((t=>"function"==typeof t[1].get&&"__proto__"!==t[0])).map((t=>t[0]));handler={set:(t,e,i)=>!this.readonlyAttributes.includes(e)&&Reflect.set(t,e,i),deleteProperty:(t,e)=>!this.readonlyAttributes.includes(e)&&Reflect.deleteProperty(t,e),get:(t,e,i)=>this.readonlyAttributes.includes(e)?(f.warn(`Accessing "Node.attributes.${e}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,e)):Reflect.get(t,e,i)};constructor(t,e){A(t,e||this._knownDavService),this._data={displayname:t.attributes?.displayname,...t,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(t.attributes??{}),e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+(0,o.O0)(this.source.slice(t.length))}get basename(){return(0,s.basename)(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(t){this._data.displayname=t}get extension(){return(0,s.extname)(this.source)}get dirname(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return(0,s.dirname)(t.slice(e+i.length)||"/")}const t=new URL(this.source);return(0,s.dirname)(t.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}set mtime(t){this._data.mtime=t}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(t){this.updateMtime(),this._data.size=t}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:m.NONE:m.READ}set permissions(t){this.updateMtime(),this._data.permissions=t}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return N(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,s.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return t.slice(e+i.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(t){this._data.status=t}move(t){A({...this._data,source:t},this._knownDavService);const e=this.basename;this._data.source=t,this.displayname===e&&this.basename!==e&&(this.displayname=this.basename),this.updateMtime()}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move((0,s.dirname)(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(t){for(const[e,i]of Object.entries(t))try{void 0===i?delete this.attributes[e]:this.attributes[e]=i}catch(t){if(t instanceof TypeError)continue;throw t}}}class y extends x{get type(){return v.File}}class I extends x{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return v.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const _=(0,d.f)()?`/files/${(0,d.G)()}`:`/files/${(0,r.HW)()?.uid}`,O=function(){const t=(0,a.dC)("dav");return(0,d.f)()?t.replace("remote.php","public.php"):t}();Error;class T extends c.m{_views=[];_currentView=null;register(t){if(this._views.find((e=>e.id===t.id)))throw new Error(`View id ${t.id} is already registered`);this._views.push(t),this.dispatchTypedEvent("update",new CustomEvent("update"))}remove(t){const e=this._views.findIndex((e=>e.id===t));-1!==e&&(this._views.splice(e,1),this.dispatchTypedEvent("update",new CustomEvent("update")))}setActive(t){this._currentView=t;const e=new CustomEvent("updateActive",{detail:t});this.dispatchTypedEvent("updateActive",e)}get active(){return this._currentView}get views(){return this._views}}class C{_column;constructor(t){R(t),this._column=t}get id(){return this._column.id}get title(){return this._column.title}get render(){return this._column.render}get sort(){return this._column.sort}get summary(){return this._column.summary}}const R=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("A column id is required");if(!t.title||"string"!=typeof t.title)throw new Error("A column title is required");if(!t.render||"function"!=typeof t.render)throw new Error("A render function is required");if(t.sort&&"function"!=typeof t.sort)throw new Error("Column sortFunction must be a function");if(t.summary&&"function"!=typeof t.summary)throw new Error("Column summary must be a function");return!0};var L={},$={};!function(t){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+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",n=new RegExp("^"+i+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,i){if(e){const n=Object.keys(e),r=n.length;for(let s=0;s<r;s++)t[n[s]]="strict"===i?[e[n[s]]]:e[n[s]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){return!(null==n.exec(t))},t.getAllMatches=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t<s;t++)r.push(n[t]);i.push(r),n=e.exec(t)}return i},t.nameRegexp=i}($);const S=$,P={allowBooleanAttributes:!1,unpairedTags:[]};function D(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function F(t,e){const i=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const n=t.substr(i,e-i);if(e>5&&"xml"===n)return B("InvalidXml","XML declaration allowed only at the start of the document.",H(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function M(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let i=1;for(e+=8;e<t.length;e++)if("<"===t[e])i++;else if(">"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}L.validate=function(t,e){e=Object.assign({},P,e);const i=[];let n=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=F(t,o),o.err)return o}else{if("<"!==t[o]){if(D(t[o]))continue;return B("InvalidChar","char '"+t[o]+"' is not expected.",H(t,o))}{let a=o;if(o++,"!"===t[o]){o=M(t,o);continue}{let l=!1;"/"===t[o]&&(l=!0,o++);let d="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)d+=t[o];if(d=d.trim(),"/"===d[d.length-1]&&(d=d.substring(0,d.length-1),o--),s=d,!S.isName(s)){let e;return e=0===d.trim().length?"Invalid space after '<'.":"Tag '"+d+"' is an invalid name.",B("InvalidTag",e,H(t,o))}const u=G(t,o);if(!1===u)return B("InvalidAttr","Attributes for '"+d+"' have open quote.",H(t,o));let c=u.value;if(o=u.index,"/"===c[c.length-1]){const i=o-c.length;c=c.substring(0,c.length-1);const r=U(c,e);if(!0!==r)return B(r.err.code,r.err.msg,H(t,i+r.err.line));n=!0}else if(l){if(!u.tagClosed)return B("InvalidTag","Closing tag '"+d+"' doesn't have proper closing.",H(t,o));if(c.trim().length>0)return B("InvalidTag","Closing tag '"+d+"' can't have attributes or invalid starting.",H(t,a));if(0===i.length)return B("InvalidTag","Closing tag '"+d+"' has not been opened.",H(t,a));{const e=i.pop();if(d!==e.tagName){let i=H(t,e.tagStartPos);return B("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+i.line+", col "+i.col+") instead of closing tag '"+d+"'.",H(t,a))}0==i.length&&(r=!0)}}else{const s=U(c,e);if(!0!==s)return B(s.err.code,s.err.msg,H(t,o-c.length+s.err.line));if(!0===r)return B("InvalidXml","Multiple possible root nodes found.",H(t,o));-1!==e.unpairedTags.indexOf(d)||i.push({tagName:d,tagStartPos:a}),n=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=M(t,o);continue}if("?"!==t[o+1])break;if(o=F(t,++o),o.err)return o}else if("&"===t[o]){const e=X(t,o);if(-1==e)return B("InvalidChar","char '&' is not expected.",H(t,o));o=e}else if(!0===r&&!D(t[o]))return B("InvalidXml","Extra text at the end",H(t,o));"<"===t[o]&&o--}}}var s;return n?1==i.length?B("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",H(t,i[0].tagStartPos)):!(i.length>0)||B("InvalidXml","Invalid '"+JSON.stringify(i.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):B("InvalidXml","Start tag expected.",1)};const V='"',j="'";function G(t,e){let i="",n="",r=!1;for(;e<t.length;e++){if(t[e]===V||t[e]===j)""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){r=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:r}}const k=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function U(t,e){const i=S.getAllMatches(t,k),n={};for(let t=0;t<i.length;t++){if(0===i[t][1].length)return B("InvalidAttr","Attribute '"+i[t][2]+"' has no space in starting.",q(i[t]));if(void 0!==i[t][3]&&void 0===i[t][4])return B("InvalidAttr","Attribute '"+i[t][2]+"' is without value.",q(i[t]));if(void 0===i[t][3]&&!e.allowBooleanAttributes)return B("InvalidAttr","boolean attribute '"+i[t][2]+"' is not allowed.",q(i[t]));const r=i[t][2];if(!z(r))return B("InvalidAttr","Attribute '"+r+"' is an invalid name.",q(i[t]));if(n.hasOwnProperty(r))return B("InvalidAttr","Attribute '"+r+"' is repeated.",q(i[t]));n[r]=1}return!0}function X(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let i=/\d/;for("x"===t[e]&&(e++,i=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(i))break}return-1}(t,++e);let i=0;for(;e<t.length;e++,i++)if(!(t[e].match(/\w/)&&i<20)){if(";"===t[e])break;return-1}return e}function B(t,e,i){return{err:{code:t,msg:e,line:i.line||i,col:i.col}}}function z(t){return S.isName(t)}function H(t,e){const i=t.substring(0,e).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function q(t){return t.startIndex+t[1].length}var W={};const Y={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){return e},attributeValueProcessor:function(t,e){return e},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){return t}};W.buildOptions=function(t){return Object.assign({},Y,t)},W.defaultOptions=Y;const K=$;function Z(t,e){let i="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)i+=t[e];if(i=i.trim(),-1!==i.indexOf(" "))throw new Error("External entites are not supported");const n=t[e++];let r="";for(;e<t.length&&t[e]!==n;e++)r+=t[e];return[i,r,e]}function J(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function Q(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function tt(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function et(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function it(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function nt(t){if(K.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}const rt=/^[-+]?0x[a-fA-F0-9]+$/,st=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const ot={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const at=$,lt=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}},dt=function(t,e){const i={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let n=1,r=!1,s=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,n--):n--,0===n)break}else"["===t[e]?r=!0:o+=t[e];else{if(r&&Q(t,e))e+=7,[entityName,val,e]=Z(t,e+1),-1===val.indexOf("&")&&(i[nt(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(r&&tt(t,e))e+=8;else if(r&&et(t,e))e+=8;else if(r&&it(t,e))e+=9;else{if(!J)throw new Error("Invalid DOCTYPE");s=!0}n++,o=""}if(0!==n)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:e}},ut=function(t,e={}){if(e=Object.assign({},ot,e),!t||"string"!=typeof t)return t;let i=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(i))return t;if(e.hex&&rt.test(i))return Number.parseInt(i,16);{const r=st.exec(i);if(r){const s=r[1],o=r[2];let a=(n=r[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substr(0,n.length-1)),n):n;const l=r[4]||r[6];if(!e.leadingZeros&&o.length>0&&s&&"."!==i[2])return t;if(!e.leadingZeros&&o.length>0&&!s&&"."!==i[1])return t;{const n=Number(i),r=""+n;return-1!==r.search(/[eE]/)||l?e.eNotation?n:t:-1!==i.indexOf(".")?"0"===r&&""===a||r===a||s&&r==="-"+a?n:t:o?a===r||s+a===r?n:t:i===r||i===s+r?n:t}}return t}var n};function ct(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function pt(t,e,i,n,r,s,o){if(void 0!==t&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const n=this.options.tagValueProcessor(e,t,i,r,s);return null==n?t:typeof n!=typeof t||n!==t?n:this.options.trimValues||t.trim()===t?yt(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function ht(t){if(this.options.removeNSPrefix){const e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}const ft=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function gt(t,e,i){if(!this.options.ignoreAttributes&&"string"==typeof t){const i=at.getAllMatches(t,ft),n=i.length,r={};for(let t=0;t<n;t++){const n=this.resolveNameSpace(i[t][1]);let s=i[t][4],o=this.options.attributeNamePrefix+n;if(n.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(n,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:yt(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const mt=function(t){t=t.replace(/\r\n?/g,"\n");const e=new lt("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=At(t,">",s,"Closing Tag is not closed.");let o=t.substring(s+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),i&&(n=this.saveTextToParentTag(n,i,r));const a=r.substring(r.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),i=this.tagsNodeStack.pop(),n="",s=e}else if("?"===t[s+1]){let e=bt(t,s,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new lt(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(i,t,r)}s=e.closeIndex+1}else if("!--"===t.substr(s+1,3)){const e=At(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(s+4,e-2);n=this.saveTextToParentTag(n,i,r),i.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=e}else if("!D"===t.substr(s+1,2)){const e=dt(t,s);this.docTypeEntities=e.entities,s=e.i}else if("!["===t.substr(s+1,2)){const e=At(t,"]]>",s,"CDATA is not closed.")-2,o=t.substring(s+9,e);n=this.saveTextToParentTag(n,i,r);let a=this.parseTextData(o,i.tagname,r,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):i.add(this.options.textNodeName,a),s=e+2}else{let o=bt(t,s,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let d=o.tagExp,u=o.attrExpPresent,c=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),i&&n&&"!xml"!==i.tagname&&(n=this.saveTextToParentTag(n,i,r,!1));const p=i;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(i=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let e="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),d=a):d=d.substr(0,d.length-1),s=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))s=o.closeIndex;else{const i=this.readStopNodeData(t,l,c+1);if(!i)throw new Error(`Unexpected end of ${l}`);s=i.i,e=i.tagContent}const n=new lt(a);a!==d&&u&&(n[":@"]=this.buildAttributesMap(d,r,a)),e&&(e=this.parseTextData(e,a,r,!0,u,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),n.add(this.options.textNodeName,e),this.addChild(i,n,r)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),d=a):d=d.substr(0,d.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new lt(a);a!==d&&u&&(t[":@"]=this.buildAttributesMap(d,r,a)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new lt(a);this.tagsNodeStack.push(i),a!==d&&u&&(t[":@"]=this.buildAttributesMap(d,r,a)),this.addChild(i,t,r),i=t}n="",s=c}}else n+=t[s];return e.child};function Et(t,e,i){const n=this.options.updateTag(e.tagname,i,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e))}const wt=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const i=this.docTypeEntities[e];t=t.replace(i.regx,i.val)}for(let e in this.lastEntities){const i=this.lastEntities[e];t=t.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const i=this.htmlEntities[e];t=t.replace(i.regex,i.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function vt(t,e,i,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,i,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Nt(t,e,i){const n="*."+i;for(const i in t){const r=t[i];if(n===r||e===r)return!0}return!1}function At(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function bt(t,e,i,n=">"){const r=function(t,e,i=">"){let n,r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,n);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let l=s,d=!0;-1!==a&&(l=s.substring(0,a),s=s.substring(a+1).trimStart());const u=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),d=l!==r.data.substr(t+1))}return{tagName:l,tagExp:s,closeIndex:o,attrExpPresent:d,rawTagName:u}}function xt(t,e,i){const n=i;let r=1;for(;i<t.length;i++)if("<"===t[i])if("/"===t[i+1]){const s=At(t,">",i,`${e} is not closed`);if(t.substring(i+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(n,i),i:s};i=s}else if("?"===t[i+1])i=At(t,"?>",i+1,"StopNode is not closed.");else if("!--"===t.substr(i+1,3))i=At(t,"--\x3e",i+3,"StopNode is not closed.");else if("!["===t.substr(i+1,2))i=At(t,"]]>",i,"StopNode is not closed.")-2;else{const n=bt(t,i,">");n&&((n&&n.tagName)===e&&"/"!==n.tagExp[n.tagExp.length-1]&&r++,i=n.closeIndex)}}function yt(t,e,i){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&ut(t,i)}return at.isExist(t)?t:""}var It={};function _t(t,e,i){let n;const r={};for(let s=0;s<t.length;s++){const o=t[s],a=Ot(o);let l="";if(l=void 0===i?a:i+"."+a,a===e.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=_t(o[a],e,l);const i=Ct(t,e);o[":@"]?Tt(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,l,i)?r[a]=[t]:r[a]=t}}}return"string"==typeof n?n.length>0&&(r[e.textNodeName]=n):void 0!==n&&(r[e.textNodeName]=n),r}function Ot(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Tt(t,e,i,n){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o];n.isArray(s,i+"."+s,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function Ct(t,e){const{textNodeName:i}=e,n=Object.keys(t).length;return 0===n||!(1!==n||!t[i]&&"boolean"!=typeof t[i]&&0!==t[i])}It.prettify=function(t,e){return _t(t,e)};const{buildOptions:Rt}=W,Lt=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=ct,this.parseXml=mt,this.parseTextData=pt,this.resolveNameSpace=ht,this.buildAttributesMap=gt,this.isItStopNode=Nt,this.replaceEntitiesValue=wt,this.readStopNodeData=xt,this.saveTextToParentTag=vt,this.addChild=Et}},{prettify:$t}=It,St=L;function Pt(t,e,i,n){let r="",s=!1;for(let o=0;o<t.length;o++){const a=t[o],l=Dt(a);if(void 0===l)continue;let d="";if(d=0===i.length?l:`${i}.${l}`,l===e.textNodeName){let t=a[l];Mt(d,e)||(t=e.tagValueProcessor(l,t),t=Vt(t,e)),s&&(r+=n),r+=t,s=!1;continue}if(l===e.cdataPropName){s&&(r+=n),r+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,s=!1;continue}if(l===e.commentPropName){r+=n+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,s=!0;continue}if("?"===l[0]){const t=Ft(a[":@"],e),i="?xml"===l?"":n;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",r+=i+`<${l}${o}${t}?>`,s=!0;continue}let u=n;""!==u&&(u+=e.indentBy);const c=n+`<${l}${Ft(a[":@"],e)}`,p=Pt(a[l],e,d,u);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=c+">":r+=c+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?r+=c+`>${p}${n}</${l}>`:(r+=c+">",p&&""!==n&&(p.includes("/>")||p.includes("</"))?r+=n+e.indentBy+p+n:r+=p,r+=`</${l}>`):r+=c+"/>",s=!0}return r}function Dt(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];if(t.hasOwnProperty(n)&&":@"!==n)return n}}function Ft(t,e){let i="";if(t&&!e.ignoreAttributes)for(let n in t){if(!t.hasOwnProperty(n))continue;let r=e.attributeValueProcessor(n,t[n]);r=Vt(r,e),!0===r&&e.suppressBooleanAttributes?i+=` ${n.substr(e.attributeNamePrefix.length)}`:i+=` ${n.substr(e.attributeNamePrefix.length)}="${r}"`}return i}function Mt(t,e){let i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+i)return!0;return!1}function Vt(t,e){if(t&&t.length>0&&e.processEntities)for(let i=0;i<e.entities.length;i++){const n=e.entities[i];t=t.replace(n.regex,n.val)}return t}const jt=function(t,e){let i="";return e.format&&e.indentBy.length>0&&(i="\n"),Pt(t,e,"",i)},Gt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:"  ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},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};function kt(t){this.options=Object.assign({},Gt,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Bt),this.processTextOrObjNode=Ut,this.options.format?(this.indentate=Xt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Ut(t,e,i){const n=this.j2x(t,i+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,i):this.buildObjectNode(n.val,e,n.attrStr,i)}function Xt(t){return this.options.indentBy.repeat(t)}function Bt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}kt.prototype.build=function(t){return this.options.preserveOrder?jt(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},kt.prototype.j2x=function(t,e){let i="",n="";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))if(void 0===t[r])this.isAttribute(r)&&(n+="");else if(null===t[r])this.isAttribute(r)?n+="":"?"===r[0]?n+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)n+=this.buildTextValNode(t[r],r,"",e);else if("object"!=typeof t[r]){const s=this.isAttribute(r);if(s)i+=this.buildAttrPairStr(s,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);n+=this.replaceEntitiesValue(e)}else n+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const i=t[r].length;let s="";for(let o=0;o<i;o++){const i=t[r][o];void 0===i||(null===i?"?"===r[0]?n+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+r+"/"+this.tagEndChar:"object"==typeof i?this.options.oneListGroup?s+=this.j2x(i,e+1).val:s+=this.processTextOrObjNode(i,r,e):s+=this.buildTextValNode(i,r,"",e))}this.options.oneListGroup&&(s=this.buildObjectNode(s,r,"",e)),n+=s}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),n=e.length;for(let s=0;s<n;s++)i+=this.buildAttrPairStr(e[s],""+t[r][e[s]])}else n+=this.processTextOrObjNode(t[r],r,e);return{attrStr:i,val:n}},kt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},kt.prototype.buildObjectNode=function(t,e,i,n){if(""===t)return"?"===e[0]?this.indentate(n)+"<"+e+i+"?"+this.tagEndChar:this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",r=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(n)+"<"+e+i+s+this.tagEndChar+t+this.indentate(n)+r:this.indentate(n)+"<"+e+i+s+">"+t+r}},kt.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},kt.prototype.buildTextValNode=function(t,e,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+i+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+i+">"+r+"</"+e+this.tagEndChar}},kt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t};var zt={XMLParser:class{constructor(t){this.externalEntities={},this.options=Rt(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const i=St.validate(t,e);if(!0!==i)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}const i=new Lt(this.options);i.addExternalEntities(this.externalEntities);const n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:$t(n,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}},XMLValidator:L,XMLBuilder:kt};var Ht="object"==typeof p&&p.env&&p.env.NODE_DEBUG&&/\bsemver\b/i.test(p.env.NODE_DEBUG)?(...t)=>h.error("SEMVER",...t):()=>{},qt={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Wt={exports:{}};!function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:r}=qt,s=Ht,o=(e=t.exports={}).re=[],a=e.safeRe=[],l=e.src=[],d=e.t={};let u=0;const c="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",r],[c,n]],h=(t,e,i)=>{const n=(t=>{for(const[e,i]of p)t=t.split(`${e}*`).join(`${e}{0,${i}}`).split(`${e}+`).join(`${e}{1,${i}}`);return t})(e),r=u++;s(t,r,e),d[t]=r,l[r]=e,o[r]=new RegExp(e,i?"g":void 0),a[r]=new RegExp(n,i?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${c}*`),h("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${l[d.NUMERICIDENTIFIER]}|${l[d.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NUMERICIDENTIFIERLOOSE]}|${l[d.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${c}+`),h("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),h("FULL",`^${l[d.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),h("LOOSE",`^${l[d.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),h("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),h("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?(?:${l[d.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",l[d.COERCE],!0),h("COERCERTLFULL",l[d.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",h("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",h("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Wt,Wt.exports);var Yt=Wt.exports;Object.freeze({loose:!0}),Object.freeze({});const Kt=/^[0-9]+$/,Zt=(t,e)=>{const i=Kt.test(t),n=Kt.test(e);return i&&n&&(t=+t,e=+e),t===e?0:i&&!n?-1:n&&!i?1:t<e?-1:1};var Jt={compareIdentifiers:Zt,rcompareIdentifiers:(t,e)=>Zt(e,t)};const{MAX_LENGTH:Qt,MAX_SAFE_INTEGER:te}=qt,{safeRe:ee,t:ie}=Yt,{compareIdentifiers:ne}=Jt;c.m;var re=i(85072),se=i.n(re),oe=i(97825),ae=i.n(oe),le=i(77659),de=i.n(le),ue=i(55056),ce=i.n(ue),pe=i(10540),he=i.n(pe),fe=i(41113),ge=i.n(fe),me=i(73911),Ee={};Ee.styleTagTransform=ge(),Ee.setAttributes=ce(),Ee.insert=de().bind(null,"head"),Ee.domAPI=ae(),Ee.insertStyleElement=he(),se()(me.A,Ee),me.A&&me.A.locals&&me.A.locals;const we=function(t){var e;const i=null===(e=t.attributes)||void 0===e||null===(e=e["system-tags"])||void 0===e?void 0:e["system-tag"];return void 0===i?[]:[i].flat()},ve=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("li");return i.classList.add("files-list__system-tag"),i.textContent=t,e&&i.classList.add("files-list__system-tag--more"),i},Ne=new class{_action;constructor(t){this.validateAction(t),this._action=t}get id(){return this._action.id}get displayName(){return this._action.displayName}get title(){return this._action.title}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get order(){return this._action.order}get parent(){return this._action.parent}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(t){if(!t.id||"string"!=typeof t.id)throw new Error("Invalid id");if(!t.displayName||"function"!=typeof t.displayName)throw new Error("Invalid displayName function");if("title"in t&&"function"!=typeof t.title)throw new Error("Invalid title function");if(!t.iconSvgInline||"function"!=typeof t.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!t.exec||"function"!=typeof t.exec)throw new Error("Invalid exec function");if("enabled"in t&&"function"!=typeof t.enabled)throw new Error("Invalid enabled function");if("execBatch"in t&&"function"!=typeof t.execBatch)throw new Error("Invalid execBatch function");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order");if("parent"in t&&"string"!=typeof t.parent)throw new Error("Invalid parent");if(t.default&&!Object.values(g).includes(t.default))throw new Error("Invalid default");if("inline"in t&&"function"!=typeof t.inline)throw new Error("Invalid inline function");if("renderInline"in t&&"function"!=typeof t.renderInline)throw new Error("Invalid renderInline function")}}({id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled(t){if(1!==t.length)return!1;const e=t[0];return 0!==we(e).length},exec:async()=>null,async renderInline(t){const e=we(t);if(0===e.length)return null;const i=document.createElement("ul");if(i.classList.add("files-list__system-tags"),1===e.length)i.setAttribute("aria-label",(0,u.Tl)("files","This file has the tag {tag}",{tag:e[0]}));else{const t=e.slice(0,-1).join(", "),n=e[e.length-1];i.setAttribute("aria-label",(0,u.Tl)("files","This file has the tags {firstTags} and {lastTag}",{firstTags:t,lastTag:n}))}if(i.append(ve(e[0])),e.length>1){const t=ve("+"+(e.length-1),!0);t.setAttribute("title",e.slice(1).join(", ")),i.append(t)}return i},order:0});!function(t,e={nc:"http://nextcloud.org/ns"}){void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...E],window._nc_dav_namespaces={...w});const i={...window._nc_dav_namespaces,...e};window._nc_dav_properties.find((e=>e===t))?f.warn(`${t} already registered`,{prop:t}):t.startsWith("<")||2!==t.split(":").length?f.error(`${t} is not valid. See example: 'oc:fileid'`,{prop:t}):i[t.split(":")[0]]?(window._nc_dav_properties.push(t),window._nc_dav_namespaces=i):f.error(`${t} namespace unknown`,{prop:t,namespaces:i})}("nc:system-tags"),function(t){void 0===window._nc_fileactions&&(window._nc_fileactions=[],f.debug("FileActions initialized")),window._nc_fileactions.find((e=>e.id===t.id))?f.error(`FileAction ${t.id} already registered`,{action:t}):window._nc_fileactions.push(t)}(Ne),i(65043);var Ae=i(63623);const be=(0,a.dC)("dav"),xe=(0,Ae.UU)(be),ye=t=>{xe.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=t?t:""})};(0,r.zo)(ye),ye((0,r.do)());var Ie=i(71654);const _e=(0,n.YK)().setApp("systemtags").detectUser().build(),Oe=function(t=O,e={}){const i=(0,l.UU)(t,{headers:e});function n(t){i.setHeaders({...e,"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}return(0,r.zo)(n),n((0,r.do)()),(0,l.Gu)().patch("fetch",((t,e)=>{const i=e.headers;return i?.method&&(e.method=i.method,delete i.method),fetch(t,e)})),i}(),Te=t=>function(t,e=_,i=O){let n=(0,r.HW)()?.uid;if((0,d.f)())n=n??"anonymous";else if(!n)throw new Error("No user id found");const s=t.props,o=function(t=""){let e=m.NONE;return t?((t.includes("C")||t.includes("K"))&&(e|=m.CREATE),t.includes("G")&&(e|=m.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=m.UPDATE),t.includes("D")&&(e|=m.DELETE),t.includes("R")&&(e|=m.SHARE),e):e}(s?.permissions),a=String(s?.["owner-id"]||n),l=s.fileid||0,u={id:l,source:`${i}${t.filename}`,mtime:new Date(Date.parse(t.lastmod)),mime:t.mime||"application/octet-stream",displayname:void 0!==s.displayname?String(s.displayname):void 0,size:s?.size||Number.parseInt(s.getcontentlength||"0"),status:l<0?b.FAILED:void 0,permissions:o,owner:a,root:e,attributes:{...t,...s,hasPreview:s?.["has-preview"]}};return delete u.attributes?.props,"file"===t.type?new y(u):new I(u)}(t),Ce=t=>'<?xml version="1.0"?>\n<oc:filter-files '.concat((void 0===window._nc_dav_namespaces&&(window._nc_dav_namespaces={...w}),Object.keys(window._nc_dav_namespaces).map((t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`)).join(" ")),">\n\t<d:prop>\n\t\t").concat((void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...E]),window._nc_dav_properties.map((t=>`<${t} />`)).join(" ")),"\n\t</d:prop>\n    <oc:filter-rules>\n        <oc:systemtag>").concat(t,"</oc:systemtag>\n    </oc:filter-rules>\n</oc:filter-files>"),Re=function(t){var e;return new I({id:t.id,source:(0,a.dC)("dav/systemtags/"+t.id),owner:null===(e=(0,r.HW)())||void 0===e?void 0:e.uid,root:"/systemtags",permissions:m.READ,attributes:{...t,"is-tag":!0}})};(void 0===window._nc_navigation&&(window._nc_navigation=new T,f.debug("Navigation service initialized")),window._nc_navigation).register(new class{_view;constructor(t){(function(t){if(!t.id||"string"!=typeof t.id)throw new Error("View id is required and must be a string");if(!t.name||"string"!=typeof t.name)throw new Error("View name is required and must be a string");if(t.columns&&t.columns.length>0&&(!t.caption||"string"!=typeof t.caption))throw new Error("View caption is required for top-level views and must be a string");if(!t.getContents||"function"!=typeof t.getContents)throw new Error("View getContents is required and must be a function");if(!t.icon||"string"!=typeof t.icon||!function(t){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(0===(t=t.trim()).length)return!1;if(!0!==zt.XMLValidator.validate(t))return!1;let e;const i=new zt.XMLParser;try{e=i.parse(t)}catch{return!1}return!!e&&!!Object.keys(e).some((t=>"svg"===t.toLowerCase()))}(t.icon))throw new Error("View icon is required and must be a valid svg string");if(!("order"in t)||"number"!=typeof t.order)throw new Error("View order is required and must be a number");if(t.columns&&t.columns.forEach((t=>{if(!(t instanceof C))throw new Error("View columns must be an array of Column. Invalid column found")})),t.emptyView&&"function"!=typeof t.emptyView)throw new Error("View emptyView must be a function");if(t.parent&&"string"!=typeof t.parent)throw new Error("View parent must be a string");if("sticky"in t&&"boolean"!=typeof t.sticky)throw new Error("View sticky must be a boolean");if("expanded"in t&&"boolean"!=typeof t.expanded)throw new Error("View expanded must be a boolean");if(t.defaultSortKey&&"string"!=typeof t.defaultSortKey)throw new Error("View defaultSortKey must be a string")})(t),this._view=t}get id(){return this._view.id}get name(){return this._view.name}get caption(){return this._view.caption}get emptyTitle(){return this._view.emptyTitle}get emptyCaption(){return this._view.emptyCaption}get getContents(){return this._view.getContents}get icon(){return this._view.icon}set icon(t){this._view.icon=t}get order(){return this._view.order}set order(t){this._view.order=t}get params(){return this._view.params}set params(t){this._view.params=t}get columns(){return this._view.columns}get emptyView(){return this._view.emptyView}get parent(){return this._view.parent}get sticky(){return this._view.sticky}get expanded(){return this._view.expanded}set expanded(t){this._view.expanded=t}get defaultSortKey(){return this._view.defaultSortKey}}({id:"tags",name:(0,u.Tl)("systemtags","Tags"),caption:(0,u.Tl)("systemtags","List of tags and their associated files and folders."),emptyTitle:(0,u.Tl)("systemtags","No tags found"),emptyCaption:(0,u.Tl)("systemtags","Tags you have created will show up here."),icon:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-tag-multiple" viewBox="0 0 24 24"><path d="M5.5,9A1.5,1.5 0 0,0 7,7.5A1.5,1.5 0 0,0 5.5,6A1.5,1.5 0 0,0 4,7.5A1.5,1.5 0 0,0 5.5,9M17.41,11.58C17.77,11.94 18,12.44 18,13C18,13.55 17.78,14.05 17.41,14.41L12.41,19.41C12.05,19.77 11.55,20 11,20C10.45,20 9.95,19.78 9.58,19.41L2.59,12.42C2.22,12.05 2,11.55 2,11V6C2,4.89 2.89,4 4,4H9C9.55,4 10.05,4.22 10.41,4.58L17.41,11.58M13.54,5.71L14.54,4.71L21.41,11.58C21.78,11.94 22,12.45 22,13C22,13.55 21.78,14.05 21.42,14.41L16.04,19.79L15.04,18.79L20.75,13L13.54,5.71Z" /></svg>',order:25,getContents:async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const e=(await(async()=>{try{const{data:t}=await xe.getDirectoryContents("/systemtags",{data:'<?xml version="1.0"?>\n<d:propfind  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>',details:!0,glob:"/systemtags/*"});return(t=>t.map((t=>{let{props:e}=t;return Object.fromEntries(Object.entries(e).map((t=>{let[e,i]=t;return[(0,Ie.A)(e),"displayName"===(0,Ie.A)(e)?String(i):i]})))})))(t)}catch(t){throw _e.error((0,u.Tl)("systemtags","Failed to load tags"),{error:t}),new Error((0,u.Tl)("systemtags","Failed to load tags"))}})()).filter((t=>t.userVisible));var i;if("/"===t)return{folder:new I({id:0,source:(0,a.dC)("dav/systemtags"),owner:null===(i=(0,r.HW)())||void 0===i?void 0:i.uid,root:"/systemtags",permissions:m.NONE}),contents:e.map(Re)};const n=parseInt(t.replace("/",""),10),s=e.find((t=>t.id===n));if(!s)throw new Error("Tag not found");return{folder:Re(s),contents:(await Oe.getDirectoryContents("/",{details:!0,data:Ce(n),headers:{method:"REPORT"}})).data.map(Te)}}}))},73911:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=i(71354),r=i.n(n),s=i(76314),o=i.n(s)()(r());o.push([t.id,".files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:22px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-left:5px}@media(min-width: 512px){.files-list__system-tags{display:flex}}","",{version:3,sources:["webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss"],names:[],mappings:"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,eAAA,CAIF,yBACC,yBACC,YAAA,CAAA",sourcesContent:["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n.files-list__system-tags {\n\t--min-size: 32px;\n\tdisplay: none;\n\tjustify-content: center;\n\talign-items: center;\n\tmin-width: calc(var(--min-size) * 2);\n\tmax-width: 300px;\n}\n\n.files-list__system-tag {\n\tpadding: 5px 10px;\n\tborder: 1px solid;\n\tborder-radius: var(--border-radius-pill);\n\tborder-color: var(--color-border);\n\tcolor: var(--color-text-maxcontrast);\n\theight: var(--min-size);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tline-height: 22px; // min-size - 2 * 5px padding\n\ttext-align: center;\n\n\t&--more {\n\t\toverflow: visible;\n\t\ttext-overflow: initial;\n\t}\n\n\t// Proper spacing if multiple shown\n\t& + .files-list__system-tag {\n\t\tmargin-left: 5px;\n\t}\n}\n\n@media (min-width: 512px) {\n\t.files-list__system-tags {\n\t\tdisplay: flex;\n\t}\n}\n"],sourceRoot:""}]);const a=o},42634:()=>{},15340:()=>{},79838:()=>{}},i={};function n(t){var r=i[t];if(void 0!==r)return r.exports;var s=i[t]={id:t,loaded:!1,exports:{}};return e[t].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.m=e,t=[],n.O=(e,i,r,s)=>{if(!i){var o=1/0;for(u=0;u<t.length;u++){i=t[u][0],r=t[u][1],s=t[u][2];for(var a=!0,l=0;l<i.length;l++)(!1&s||o>=s)&&Object.keys(n.O).every((t=>n.O[t](i[l])))?i.splice(l--,1):(a=!1,s<o&&(o=s));if(a){t.splice(u--,1);var d=r();void 0!==d&&(e=d)}}return e}s=s||0;for(var u=t.length;u>0&&t[u-1][2]>s;u--)t[u]=t[u-1];t[u]=[i,r,s]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n.j=2766,(()=>{n.b=document.baseURI||self.location.href;var t={2766:0};n.O.j=e=>0===t[e];var e=(e,i)=>{var r,s,o=i[0],a=i[1],l=i[2],d=0;if(o.some((e=>0!==t[e]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(l)var u=l(n)}for(e&&e(i);d<o.length;d++)s=o[d],n.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return n.O(u)},i=self.webpackChunknextcloud=self.webpackChunknextcloud||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})(),n.nc=void 0;var r=n.O(void 0,[4208],(()=>n(27560)));r=n.O(r)})();
-//# sourceMappingURL=systemtags-init.js.map?v=29ac96ed1b17f6d6322d
\ No newline at end of file
+(()=>{var t,e={27560:(t,e,i)=>{"use strict";var n=i(35947),r=i(21777),s=i(43627),o=i(71225),a=i(63814),l=(i(36117),i(44719)),d=i(82680),c=(i(87485),i(53334)),u=i(380),p=i(65606),h=i(96763);const f=(0,n.YK)().setApp("@nextcloud/files").detectUser().build();var g=(t=>(t.DEFAULT="default",t.HIDDEN="hidden",t))(g||{}),m=(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))(m||{});const E=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],w={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"};var v=(t=>(t.Folder="folder",t.File="file",t))(v||{});const N=function(t,e){return null!==t.match(e)},A=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch(t){throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.displayname&&"string"!=typeof t.displayname)throw new Error("Invalid displayname type");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=m.NONE&&t.permissions<=m.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&N(t.source,e)){const i=t.source.match(e)[0];if(!t.source.includes((0,s.join)(i,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(b).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var b=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(b||{});class x{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(x.prototype)).filter((t=>"function"==typeof t[1].get&&"__proto__"!==t[0])).map((t=>t[0]));handler={set:(t,e,i)=>!this.readonlyAttributes.includes(e)&&Reflect.set(t,e,i),deleteProperty:(t,e)=>!this.readonlyAttributes.includes(e)&&Reflect.deleteProperty(t,e),get:(t,e,i)=>this.readonlyAttributes.includes(e)?(f.warn(`Accessing "Node.attributes.${e}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,e)):Reflect.get(t,e,i)};constructor(t,e){A(t,e||this._knownDavService),this._data={displayname:t.attributes?.displayname,...t,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(t.attributes??{}),e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+(0,o.O0)(this.source.slice(t.length))}get basename(){return(0,s.basename)(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(t){this._data.displayname=t}get extension(){return(0,s.extname)(this.source)}get dirname(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return(0,s.dirname)(t.slice(e+i.length)||"/")}const t=new URL(this.source);return(0,s.dirname)(t.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}set mtime(t){this._data.mtime=t}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(t){this.updateMtime(),this._data.size=t}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:m.NONE:m.READ}set permissions(t){this.updateMtime(),this._data.permissions=t}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return N(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,s.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return t.slice(e+i.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(t){this._data.status=t}move(t){A({...this._data,source:t},this._knownDavService);const e=this.basename;this._data.source=t,this.displayname===e&&this.basename!==e&&(this.displayname=this.basename),this.updateMtime()}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move((0,s.dirname)(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(t){for(const[e,i]of Object.entries(t))try{void 0===i?delete this.attributes[e]:this.attributes[e]=i}catch(t){if(t instanceof TypeError)continue;throw t}}}class y extends x{get type(){return v.File}}class I extends x{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return v.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const _=(0,d.f)()?`/files/${(0,d.G)()}`:`/files/${(0,r.HW)()?.uid}`,O=function(){const t=(0,a.dC)("dav");return(0,d.f)()?t.replace("remote.php","public.php"):t}();Error;class T extends u.m{_views=[];_currentView=null;register(t){if(this._views.find((e=>e.id===t.id)))throw new Error(`View id ${t.id} is already registered`);this._views.push(t),this.dispatchTypedEvent("update",new CustomEvent("update"))}remove(t){const e=this._views.findIndex((e=>e.id===t));-1!==e&&(this._views.splice(e,1),this.dispatchTypedEvent("update",new CustomEvent("update")))}setActive(t){this._currentView=t;const e=new CustomEvent("updateActive",{detail:t});this.dispatchTypedEvent("updateActive",e)}get active(){return this._currentView}get views(){return this._views}}class R{_column;constructor(t){C(t),this._column=t}get id(){return this._column.id}get title(){return this._column.title}get render(){return this._column.render}get sort(){return this._column.sort}get summary(){return this._column.summary}}const C=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("A column id is required");if(!t.title||"string"!=typeof t.title)throw new Error("A column title is required");if(!t.render||"function"!=typeof t.render)throw new Error("A render function is required");if(t.sort&&"function"!=typeof t.sort)throw new Error("Column sortFunction must be a function");if(t.summary&&"function"!=typeof t.summary)throw new Error("Column summary must be a function");return!0};var L={},$={};!function(t){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+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",n=new RegExp("^"+i+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,i){if(e){const n=Object.keys(e),r=n.length;for(let s=0;s<r;s++)t[n[s]]="strict"===i?[e[n[s]]]:e[n[s]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){return!(null==n.exec(t))},t.getAllMatches=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t<s;t++)r.push(n[t]);i.push(r),n=e.exec(t)}return i},t.nameRegexp=i}($);const S=$,P={allowBooleanAttributes:!1,unpairedTags:[]};function D(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function F(t,e){const i=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const n=t.substr(i,e-i);if(e>5&&"xml"===n)return B("InvalidXml","XML declaration allowed only at the start of the document.",H(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function M(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let i=1;for(e+=8;e<t.length;e++)if("<"===t[e])i++;else if(">"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}L.validate=function(t,e){e=Object.assign({},P,e);const i=[];let n=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=F(t,o),o.err)return o}else{if("<"!==t[o]){if(D(t[o]))continue;return B("InvalidChar","char '"+t[o]+"' is not expected.",H(t,o))}{let a=o;if(o++,"!"===t[o]){o=M(t,o);continue}{let l=!1;"/"===t[o]&&(l=!0,o++);let d="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)d+=t[o];if(d=d.trim(),"/"===d[d.length-1]&&(d=d.substring(0,d.length-1),o--),s=d,!S.isName(s)){let e;return e=0===d.trim().length?"Invalid space after '<'.":"Tag '"+d+"' is an invalid name.",B("InvalidTag",e,H(t,o))}const c=G(t,o);if(!1===c)return B("InvalidAttr","Attributes for '"+d+"' have open quote.",H(t,o));let u=c.value;if(o=c.index,"/"===u[u.length-1]){const i=o-u.length;u=u.substring(0,u.length-1);const r=U(u,e);if(!0!==r)return B(r.err.code,r.err.msg,H(t,i+r.err.line));n=!0}else if(l){if(!c.tagClosed)return B("InvalidTag","Closing tag '"+d+"' doesn't have proper closing.",H(t,o));if(u.trim().length>0)return B("InvalidTag","Closing tag '"+d+"' can't have attributes or invalid starting.",H(t,a));if(0===i.length)return B("InvalidTag","Closing tag '"+d+"' has not been opened.",H(t,a));{const e=i.pop();if(d!==e.tagName){let i=H(t,e.tagStartPos);return B("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+i.line+", col "+i.col+") instead of closing tag '"+d+"'.",H(t,a))}0==i.length&&(r=!0)}}else{const s=U(u,e);if(!0!==s)return B(s.err.code,s.err.msg,H(t,o-u.length+s.err.line));if(!0===r)return B("InvalidXml","Multiple possible root nodes found.",H(t,o));-1!==e.unpairedTags.indexOf(d)||i.push({tagName:d,tagStartPos:a}),n=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=M(t,o);continue}if("?"!==t[o+1])break;if(o=F(t,++o),o.err)return o}else if("&"===t[o]){const e=X(t,o);if(-1==e)return B("InvalidChar","char '&' is not expected.",H(t,o));o=e}else if(!0===r&&!D(t[o]))return B("InvalidXml","Extra text at the end",H(t,o));"<"===t[o]&&o--}}}var s;return n?1==i.length?B("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",H(t,i[0].tagStartPos)):!(i.length>0)||B("InvalidXml","Invalid '"+JSON.stringify(i.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):B("InvalidXml","Start tag expected.",1)};const V='"',j="'";function G(t,e){let i="",n="",r=!1;for(;e<t.length;e++){if(t[e]===V||t[e]===j)""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){r=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:r}}const k=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function U(t,e){const i=S.getAllMatches(t,k),n={};for(let t=0;t<i.length;t++){if(0===i[t][1].length)return B("InvalidAttr","Attribute '"+i[t][2]+"' has no space in starting.",q(i[t]));if(void 0!==i[t][3]&&void 0===i[t][4])return B("InvalidAttr","Attribute '"+i[t][2]+"' is without value.",q(i[t]));if(void 0===i[t][3]&&!e.allowBooleanAttributes)return B("InvalidAttr","boolean attribute '"+i[t][2]+"' is not allowed.",q(i[t]));const r=i[t][2];if(!z(r))return B("InvalidAttr","Attribute '"+r+"' is an invalid name.",q(i[t]));if(n.hasOwnProperty(r))return B("InvalidAttr","Attribute '"+r+"' is repeated.",q(i[t]));n[r]=1}return!0}function X(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let i=/\d/;for("x"===t[e]&&(e++,i=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(i))break}return-1}(t,++e);let i=0;for(;e<t.length;e++,i++)if(!(t[e].match(/\w/)&&i<20)){if(";"===t[e])break;return-1}return e}function B(t,e,i){return{err:{code:t,msg:e,line:i.line||i,col:i.col}}}function z(t){return S.isName(t)}function H(t,e){const i=t.substring(0,e).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function q(t){return t.startIndex+t[1].length}var W={};const Y={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){return e},attributeValueProcessor:function(t,e){return e},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){return t}};W.buildOptions=function(t){return Object.assign({},Y,t)},W.defaultOptions=Y;const K=$;function Z(t,e){let i="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)i+=t[e];if(i=i.trim(),-1!==i.indexOf(" "))throw new Error("External entites are not supported");const n=t[e++];let r="";for(;e<t.length&&t[e]!==n;e++)r+=t[e];return[i,r,e]}function J(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function Q(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function tt(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function et(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function it(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function nt(t){if(K.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}const rt=/^[-+]?0x[a-fA-F0-9]+$/,st=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const ot={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const at=$,lt=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}},dt=function(t,e){const i={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let n=1,r=!1,s=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,n--):n--,0===n)break}else"["===t[e]?r=!0:o+=t[e];else{if(r&&Q(t,e))e+=7,[entityName,val,e]=Z(t,e+1),-1===val.indexOf("&")&&(i[nt(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(r&&tt(t,e))e+=8;else if(r&&et(t,e))e+=8;else if(r&&it(t,e))e+=9;else{if(!J)throw new Error("Invalid DOCTYPE");s=!0}n++,o=""}if(0!==n)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:e}},ct=function(t,e={}){if(e=Object.assign({},ot,e),!t||"string"!=typeof t)return t;let i=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(i))return t;if(e.hex&&rt.test(i))return Number.parseInt(i,16);{const r=st.exec(i);if(r){const s=r[1],o=r[2];let a=(n=r[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substr(0,n.length-1)),n):n;const l=r[4]||r[6];if(!e.leadingZeros&&o.length>0&&s&&"."!==i[2])return t;if(!e.leadingZeros&&o.length>0&&!s&&"."!==i[1])return t;{const n=Number(i),r=""+n;return-1!==r.search(/[eE]/)||l?e.eNotation?n:t:-1!==i.indexOf(".")?"0"===r&&""===a||r===a||s&&r==="-"+a?n:t:o?a===r||s+a===r?n:t:i===r||i===s+r?n:t}}return t}var n};function ut(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function pt(t,e,i,n,r,s,o){if(void 0!==t&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const n=this.options.tagValueProcessor(e,t,i,r,s);return null==n?t:typeof n!=typeof t||n!==t?n:this.options.trimValues||t.trim()===t?yt(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function ht(t){if(this.options.removeNSPrefix){const e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}const ft=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function gt(t,e,i){if(!this.options.ignoreAttributes&&"string"==typeof t){const i=at.getAllMatches(t,ft),n=i.length,r={};for(let t=0;t<n;t++){const n=this.resolveNameSpace(i[t][1]);let s=i[t][4],o=this.options.attributeNamePrefix+n;if(n.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(n,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:yt(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const mt=function(t){t=t.replace(/\r\n?/g,"\n");const e=new lt("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=At(t,">",s,"Closing Tag is not closed.");let o=t.substring(s+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),i&&(n=this.saveTextToParentTag(n,i,r));const a=r.substring(r.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),i=this.tagsNodeStack.pop(),n="",s=e}else if("?"===t[s+1]){let e=bt(t,s,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new lt(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(i,t,r)}s=e.closeIndex+1}else if("!--"===t.substr(s+1,3)){const e=At(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(s+4,e-2);n=this.saveTextToParentTag(n,i,r),i.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=e}else if("!D"===t.substr(s+1,2)){const e=dt(t,s);this.docTypeEntities=e.entities,s=e.i}else if("!["===t.substr(s+1,2)){const e=At(t,"]]>",s,"CDATA is not closed.")-2,o=t.substring(s+9,e);n=this.saveTextToParentTag(n,i,r);let a=this.parseTextData(o,i.tagname,r,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):i.add(this.options.textNodeName,a),s=e+2}else{let o=bt(t,s,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let d=o.tagExp,c=o.attrExpPresent,u=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),i&&n&&"!xml"!==i.tagname&&(n=this.saveTextToParentTag(n,i,r,!1));const p=i;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(i=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let e="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),d=a):d=d.substr(0,d.length-1),s=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))s=o.closeIndex;else{const i=this.readStopNodeData(t,l,u+1);if(!i)throw new Error(`Unexpected end of ${l}`);s=i.i,e=i.tagContent}const n=new lt(a);a!==d&&c&&(n[":@"]=this.buildAttributesMap(d,r,a)),e&&(e=this.parseTextData(e,a,r,!0,c,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),n.add(this.options.textNodeName,e),this.addChild(i,n,r)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),d=a):d=d.substr(0,d.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new lt(a);a!==d&&c&&(t[":@"]=this.buildAttributesMap(d,r,a)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new lt(a);this.tagsNodeStack.push(i),a!==d&&c&&(t[":@"]=this.buildAttributesMap(d,r,a)),this.addChild(i,t,r),i=t}n="",s=u}}else n+=t[s];return e.child};function Et(t,e,i){const n=this.options.updateTag(e.tagname,i,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e))}const wt=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const i=this.docTypeEntities[e];t=t.replace(i.regx,i.val)}for(let e in this.lastEntities){const i=this.lastEntities[e];t=t.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const i=this.htmlEntities[e];t=t.replace(i.regex,i.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function vt(t,e,i,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,i,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Nt(t,e,i){const n="*."+i;for(const i in t){const r=t[i];if(n===r||e===r)return!0}return!1}function At(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function bt(t,e,i,n=">"){const r=function(t,e,i=">"){let n,r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,n);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let l=s,d=!0;-1!==a&&(l=s.substring(0,a),s=s.substring(a+1).trimStart());const c=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),d=l!==r.data.substr(t+1))}return{tagName:l,tagExp:s,closeIndex:o,attrExpPresent:d,rawTagName:c}}function xt(t,e,i){const n=i;let r=1;for(;i<t.length;i++)if("<"===t[i])if("/"===t[i+1]){const s=At(t,">",i,`${e} is not closed`);if(t.substring(i+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(n,i),i:s};i=s}else if("?"===t[i+1])i=At(t,"?>",i+1,"StopNode is not closed.");else if("!--"===t.substr(i+1,3))i=At(t,"--\x3e",i+3,"StopNode is not closed.");else if("!["===t.substr(i+1,2))i=At(t,"]]>",i,"StopNode is not closed.")-2;else{const n=bt(t,i,">");n&&((n&&n.tagName)===e&&"/"!==n.tagExp[n.tagExp.length-1]&&r++,i=n.closeIndex)}}function yt(t,e,i){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&ct(t,i)}return at.isExist(t)?t:""}var It={};function _t(t,e,i){let n;const r={};for(let s=0;s<t.length;s++){const o=t[s],a=Ot(o);let l="";if(l=void 0===i?a:i+"."+a,a===e.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=_t(o[a],e,l);const i=Rt(t,e);o[":@"]?Tt(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,l,i)?r[a]=[t]:r[a]=t}}}return"string"==typeof n?n.length>0&&(r[e.textNodeName]=n):void 0!==n&&(r[e.textNodeName]=n),r}function Ot(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Tt(t,e,i,n){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o];n.isArray(s,i+"."+s,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function Rt(t,e){const{textNodeName:i}=e,n=Object.keys(t).length;return 0===n||!(1!==n||!t[i]&&"boolean"!=typeof t[i]&&0!==t[i])}It.prettify=function(t,e){return _t(t,e)};const{buildOptions:Ct}=W,Lt=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=ut,this.parseXml=mt,this.parseTextData=pt,this.resolveNameSpace=ht,this.buildAttributesMap=gt,this.isItStopNode=Nt,this.replaceEntitiesValue=wt,this.readStopNodeData=xt,this.saveTextToParentTag=vt,this.addChild=Et}},{prettify:$t}=It,St=L;function Pt(t,e,i,n){let r="",s=!1;for(let o=0;o<t.length;o++){const a=t[o],l=Dt(a);if(void 0===l)continue;let d="";if(d=0===i.length?l:`${i}.${l}`,l===e.textNodeName){let t=a[l];Mt(d,e)||(t=e.tagValueProcessor(l,t),t=Vt(t,e)),s&&(r+=n),r+=t,s=!1;continue}if(l===e.cdataPropName){s&&(r+=n),r+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,s=!1;continue}if(l===e.commentPropName){r+=n+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,s=!0;continue}if("?"===l[0]){const t=Ft(a[":@"],e),i="?xml"===l?"":n;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",r+=i+`<${l}${o}${t}?>`,s=!0;continue}let c=n;""!==c&&(c+=e.indentBy);const u=n+`<${l}${Ft(a[":@"],e)}`,p=Pt(a[l],e,d,c);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=u+">":r+=u+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?r+=u+`>${p}${n}</${l}>`:(r+=u+">",p&&""!==n&&(p.includes("/>")||p.includes("</"))?r+=n+e.indentBy+p+n:r+=p,r+=`</${l}>`):r+=u+"/>",s=!0}return r}function Dt(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];if(t.hasOwnProperty(n)&&":@"!==n)return n}}function Ft(t,e){let i="";if(t&&!e.ignoreAttributes)for(let n in t){if(!t.hasOwnProperty(n))continue;let r=e.attributeValueProcessor(n,t[n]);r=Vt(r,e),!0===r&&e.suppressBooleanAttributes?i+=` ${n.substr(e.attributeNamePrefix.length)}`:i+=` ${n.substr(e.attributeNamePrefix.length)}="${r}"`}return i}function Mt(t,e){let i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+i)return!0;return!1}function Vt(t,e){if(t&&t.length>0&&e.processEntities)for(let i=0;i<e.entities.length;i++){const n=e.entities[i];t=t.replace(n.regex,n.val)}return t}const jt=function(t,e){let i="";return e.format&&e.indentBy.length>0&&(i="\n"),Pt(t,e,"",i)},Gt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:"  ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},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};function kt(t){this.options=Object.assign({},Gt,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Bt),this.processTextOrObjNode=Ut,this.options.format?(this.indentate=Xt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Ut(t,e,i){const n=this.j2x(t,i+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,i):this.buildObjectNode(n.val,e,n.attrStr,i)}function Xt(t){return this.options.indentBy.repeat(t)}function Bt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}kt.prototype.build=function(t){return this.options.preserveOrder?jt(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},kt.prototype.j2x=function(t,e){let i="",n="";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))if(void 0===t[r])this.isAttribute(r)&&(n+="");else if(null===t[r])this.isAttribute(r)?n+="":"?"===r[0]?n+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)n+=this.buildTextValNode(t[r],r,"",e);else if("object"!=typeof t[r]){const s=this.isAttribute(r);if(s)i+=this.buildAttrPairStr(s,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);n+=this.replaceEntitiesValue(e)}else n+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const i=t[r].length;let s="";for(let o=0;o<i;o++){const i=t[r][o];void 0===i||(null===i?"?"===r[0]?n+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+r+"/"+this.tagEndChar:"object"==typeof i?this.options.oneListGroup?s+=this.j2x(i,e+1).val:s+=this.processTextOrObjNode(i,r,e):s+=this.buildTextValNode(i,r,"",e))}this.options.oneListGroup&&(s=this.buildObjectNode(s,r,"",e)),n+=s}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),n=e.length;for(let s=0;s<n;s++)i+=this.buildAttrPairStr(e[s],""+t[r][e[s]])}else n+=this.processTextOrObjNode(t[r],r,e);return{attrStr:i,val:n}},kt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},kt.prototype.buildObjectNode=function(t,e,i,n){if(""===t)return"?"===e[0]?this.indentate(n)+"<"+e+i+"?"+this.tagEndChar:this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",r=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(n)+"<"+e+i+s+this.tagEndChar+t+this.indentate(n)+r:this.indentate(n)+"<"+e+i+s+">"+t+r}},kt.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},kt.prototype.buildTextValNode=function(t,e,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+i+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+i+">"+r+"</"+e+this.tagEndChar}},kt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t};var zt={XMLParser:class{constructor(t){this.externalEntities={},this.options=Ct(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const i=St.validate(t,e);if(!0!==i)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}const i=new Lt(this.options);i.addExternalEntities(this.externalEntities);const n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:$t(n,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}},XMLValidator:L,XMLBuilder:kt};var Ht="object"==typeof p&&p.env&&p.env.NODE_DEBUG&&/\bsemver\b/i.test(p.env.NODE_DEBUG)?(...t)=>h.error("SEMVER",...t):()=>{},qt={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Wt={exports:{}};!function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:r}=qt,s=Ht,o=(e=t.exports={}).re=[],a=e.safeRe=[],l=e.src=[],d=e.t={};let c=0;const u="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",r],[u,n]],h=(t,e,i)=>{const n=(t=>{for(const[e,i]of p)t=t.split(`${e}*`).join(`${e}{0,${i}}`).split(`${e}+`).join(`${e}{1,${i}}`);return t})(e),r=c++;s(t,r,e),d[t]=r,l[r]=e,o[r]=new RegExp(e,i?"g":void 0),a[r]=new RegExp(n,i?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),h("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${l[d.NUMERICIDENTIFIER]}|${l[d.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NUMERICIDENTIFIERLOOSE]}|${l[d.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${u}+`),h("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),h("FULL",`^${l[d.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),h("LOOSE",`^${l[d.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),h("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),h("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?(?:${l[d.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",l[d.COERCE],!0),h("COERCERTLFULL",l[d.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",h("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",h("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Wt,Wt.exports);var Yt=Wt.exports;Object.freeze({loose:!0}),Object.freeze({});const Kt=/^[0-9]+$/,Zt=(t,e)=>{const i=Kt.test(t),n=Kt.test(e);return i&&n&&(t=+t,e=+e),t===e?0:i&&!n?-1:n&&!i?1:t<e?-1:1};var Jt={compareIdentifiers:Zt,rcompareIdentifiers:(t,e)=>Zt(e,t)};const{MAX_LENGTH:Qt,MAX_SAFE_INTEGER:te}=qt,{safeRe:ee,t:ie}=Yt,{compareIdentifiers:ne}=Jt;u.m;var re=i(85072),se=i.n(re),oe=i(97825),ae=i.n(oe),le=i(77659),de=i.n(le),ce=i(55056),ue=i.n(ce),pe=i(10540),he=i.n(pe),fe=i(41113),ge=i.n(fe),me=i(73911),Ee={};Ee.styleTagTransform=ge(),Ee.setAttributes=ue(),Ee.insert=de().bind(null,"head"),Ee.domAPI=ae(),Ee.insertStyleElement=he(),se()(me.A,Ee),me.A&&me.A.locals&&me.A.locals;const we=function(t){var e;const i=null===(e=t.attributes)||void 0===e||null===(e=e["system-tags"])||void 0===e?void 0:e["system-tag"];return void 0===i?[]:[i].flat()},ve=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("li");return i.classList.add("files-list__system-tag"),i.textContent=t,e&&i.classList.add("files-list__system-tag--more"),i},Ne=new class{_action;constructor(t){this.validateAction(t),this._action=t}get id(){return this._action.id}get displayName(){return this._action.displayName}get title(){return this._action.title}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get order(){return this._action.order}get parent(){return this._action.parent}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(t){if(!t.id||"string"!=typeof t.id)throw new Error("Invalid id");if(!t.displayName||"function"!=typeof t.displayName)throw new Error("Invalid displayName function");if("title"in t&&"function"!=typeof t.title)throw new Error("Invalid title function");if(!t.iconSvgInline||"function"!=typeof t.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!t.exec||"function"!=typeof t.exec)throw new Error("Invalid exec function");if("enabled"in t&&"function"!=typeof t.enabled)throw new Error("Invalid enabled function");if("execBatch"in t&&"function"!=typeof t.execBatch)throw new Error("Invalid execBatch function");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order");if("parent"in t&&"string"!=typeof t.parent)throw new Error("Invalid parent");if(t.default&&!Object.values(g).includes(t.default))throw new Error("Invalid default");if("inline"in t&&"function"!=typeof t.inline)throw new Error("Invalid inline function");if("renderInline"in t&&"function"!=typeof t.renderInline)throw new Error("Invalid renderInline function")}}({id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled(t){if(1!==t.length)return!1;const e=t[0];return 0!==we(e).length},exec:async()=>null,async renderInline(t){const e=we(t);if(0===e.length)return null;const i=document.createElement("ul");if(i.classList.add("files-list__system-tags"),1===e.length)i.setAttribute("aria-label",(0,c.Tl)("files","This file has the tag {tag}",{tag:e[0]}));else{const t=e.slice(0,-1).join(", "),n=e[e.length-1];i.setAttribute("aria-label",(0,c.Tl)("files","This file has the tags {firstTags} and {lastTag}",{firstTags:t,lastTag:n}))}if(i.append(ve(e[0])),e.length>1){const t=ve("+"+(e.length-1),!0);t.setAttribute("title",e.slice(1).join(", ")),i.append(t)}return i},order:0});!function(t,e={nc:"http://nextcloud.org/ns"}){void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...E],window._nc_dav_namespaces={...w});const i={...window._nc_dav_namespaces,...e};window._nc_dav_properties.find((e=>e===t))?f.warn(`${t} already registered`,{prop:t}):t.startsWith("<")||2!==t.split(":").length?f.error(`${t} is not valid. See example: 'oc:fileid'`,{prop:t}):i[t.split(":")[0]]?(window._nc_dav_properties.push(t),window._nc_dav_namespaces=i):f.error(`${t} namespace unknown`,{prop:t,namespaces:i})}("nc:system-tags"),function(t){void 0===window._nc_fileactions&&(window._nc_fileactions=[],f.debug("FileActions initialized")),window._nc_fileactions.find((e=>e.id===t.id))?f.error(`FileAction ${t.id} already registered`,{action:t}):window._nc_fileactions.push(t)}(Ne),i(65043);var Ae=i(63623);const be=(0,a.dC)("dav"),xe=(0,Ae.UU)(be),ye=t=>{xe.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=t?t:""})};(0,r.zo)(ye),ye((0,r.do)());var Ie=i(71654);const _e=(0,n.YK)().setApp("systemtags").detectUser().build(),Oe="/systemtags",Te=function(t=O,e={}){const i=(0,l.UU)(t,{headers:e});function n(t){i.setHeaders({...e,"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}return(0,r.zo)(n),n((0,r.do)()),(0,l.Gu)().patch("fetch",((t,e)=>{const i=e.headers;return i?.method&&(e.method=i.method,delete i.method),fetch(t,e)})),i}(),Re=t=>function(t,e=_,i=O){let n=(0,r.HW)()?.uid;if((0,d.f)())n=n??"anonymous";else if(!n)throw new Error("No user id found");const s=t.props,o=function(t=""){let e=m.NONE;return t?((t.includes("C")||t.includes("K"))&&(e|=m.CREATE),t.includes("G")&&(e|=m.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=m.UPDATE),t.includes("D")&&(e|=m.DELETE),t.includes("R")&&(e|=m.SHARE),e):e}(s?.permissions),a=String(s?.["owner-id"]||n),l=s.fileid||0,c={id:l,source:`${i}${t.filename}`,mtime:new Date(Date.parse(t.lastmod)),mime:t.mime||"application/octet-stream",displayname:void 0!==s.displayname?String(s.displayname):void 0,size:s?.size||Number.parseInt(s.getcontentlength||"0"),status:l<0?b.FAILED:void 0,permissions:o,owner:a,root:e,attributes:{...t,...s,hasPreview:s?.["has-preview"]}};return delete c.attributes?.props,"file"===t.type?new y(c):new I(c)}(t),Ce=t=>'<?xml version="1.0"?>\n<oc:filter-files '.concat((void 0===window._nc_dav_namespaces&&(window._nc_dav_namespaces={...w}),Object.keys(window._nc_dav_namespaces).map((t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`)).join(" ")),">\n\t<d:prop>\n\t\t").concat((void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...E]),window._nc_dav_properties.map((t=>`<${t} />`)).join(" ")),"\n\t</d:prop>\n\t<oc:filter-rules>\n\t\t<oc:systemtag>").concat(t,"</oc:systemtag>\n\t</oc:filter-rules>\n</oc:filter-files>"),Le=function(t){var e,i;return new I({id:t.id,source:"".concat(O).concat(Oe,"/").concat(t.id),owner:String(null!==(e=null===(i=(0,r.HW)())||void 0===i?void 0:i.uid)&&void 0!==e?e:"anonymous"),root:Oe,displayname:t.displayName,permissions:m.READ,attributes:{...t,"is-tag":!0}})};(void 0===window._nc_navigation&&(window._nc_navigation=new T,f.debug("Navigation service initialized")),window._nc_navigation).register(new class{_view;constructor(t){(function(t){if(!t.id||"string"!=typeof t.id)throw new Error("View id is required and must be a string");if(!t.name||"string"!=typeof t.name)throw new Error("View name is required and must be a string");if(t.columns&&t.columns.length>0&&(!t.caption||"string"!=typeof t.caption))throw new Error("View caption is required for top-level views and must be a string");if(!t.getContents||"function"!=typeof t.getContents)throw new Error("View getContents is required and must be a function");if(!t.icon||"string"!=typeof t.icon||!function(t){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(0===(t=t.trim()).length)return!1;if(!0!==zt.XMLValidator.validate(t))return!1;let e;const i=new zt.XMLParser;try{e=i.parse(t)}catch{return!1}return!!e&&!!Object.keys(e).some((t=>"svg"===t.toLowerCase()))}(t.icon))throw new Error("View icon is required and must be a valid svg string");if(!("order"in t)||"number"!=typeof t.order)throw new Error("View order is required and must be a number");if(t.columns&&t.columns.forEach((t=>{if(!(t instanceof R))throw new Error("View columns must be an array of Column. Invalid column found")})),t.emptyView&&"function"!=typeof t.emptyView)throw new Error("View emptyView must be a function");if(t.parent&&"string"!=typeof t.parent)throw new Error("View parent must be a string");if("sticky"in t&&"boolean"!=typeof t.sticky)throw new Error("View sticky must be a boolean");if("expanded"in t&&"boolean"!=typeof t.expanded)throw new Error("View expanded must be a boolean");if(t.defaultSortKey&&"string"!=typeof t.defaultSortKey)throw new Error("View defaultSortKey must be a string")})(t),this._view=t}get id(){return this._view.id}get name(){return this._view.name}get caption(){return this._view.caption}get emptyTitle(){return this._view.emptyTitle}get emptyCaption(){return this._view.emptyCaption}get getContents(){return this._view.getContents}get icon(){return this._view.icon}set icon(t){this._view.icon=t}get order(){return this._view.order}set order(t){this._view.order=t}get params(){return this._view.params}set params(t){this._view.params=t}get columns(){return this._view.columns}get emptyView(){return this._view.emptyView}get parent(){return this._view.parent}get sticky(){return this._view.sticky}get expanded(){return this._view.expanded}set expanded(t){this._view.expanded=t}get defaultSortKey(){return this._view.defaultSortKey}}({id:"tags",name:(0,c.Tl)("systemtags","Tags"),caption:(0,c.Tl)("systemtags","List of tags and their associated files and folders."),emptyTitle:(0,c.Tl)("systemtags","No tags found"),emptyCaption:(0,c.Tl)("systemtags","Tags you have created will show up here."),icon:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-tag-multiple" viewBox="0 0 24 24"><path d="M5.5,9A1.5,1.5 0 0,0 7,7.5A1.5,1.5 0 0,0 5.5,6A1.5,1.5 0 0,0 4,7.5A1.5,1.5 0 0,0 5.5,9M17.41,11.58C17.77,11.94 18,12.44 18,13C18,13.55 17.78,14.05 17.41,14.41L12.41,19.41C12.05,19.77 11.55,20 11,20C10.45,20 9.95,19.78 9.58,19.41L2.59,12.42C2.22,12.05 2,11.55 2,11V6C2,4.89 2.89,4 4,4H9C9.55,4 10.05,4.22 10.41,4.58L17.41,11.58M13.54,5.71L14.54,4.71L21.41,11.58C21.78,11.94 22,12.45 22,13C22,13.55 21.78,14.05 21.42,14.41L16.04,19.79L15.04,18.79L20.75,13L13.54,5.71Z" /></svg>',order:25,getContents:async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const e=(await(async()=>{try{const{data:t}=await xe.getDirectoryContents("/systemtags",{data:'<?xml version="1.0"?>\n<d:propfind  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>',details:!0,glob:"/systemtags/*"});return(t=>t.map((t=>{let{props:e}=t;return Object.fromEntries(Object.entries(e).map((t=>{let[e,i]=t;return[(0,Ie.A)(e),"displayName"===(0,Ie.A)(e)?String(i):i]})))})))(t)}catch(t){throw _e.error((0,c.Tl)("systemtags","Failed to load tags"),{error:t}),new Error((0,c.Tl)("systemtags","Failed to load tags"))}})()).filter((t=>t.userVisible));var i;if("/"===t)return{folder:new I({id:0,source:"".concat(O).concat(Oe),owner:null===(i=(0,r.HW)())||void 0===i?void 0:i.uid,root:Oe,permissions:m.NONE}),contents:e.map(Le)};const n=parseInt(t.split("/",2)[0]),s=e.find((t=>t.id===n));if(!s)throw new Error("Tag not found");return{folder:Le(s),contents:(await Te.getDirectoryContents(_,{details:!0,data:Ce(n),headers:{method:"REPORT"}})).data.map(Re)}}}))},73911:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=i(71354),r=i.n(n),s=i(76314),o=i.n(s)()(r());o.push([t.id,".files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:22px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-left:5px}@media(min-width: 512px){.files-list__system-tags{display:flex}}","",{version:3,sources:["webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss"],names:[],mappings:"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,eAAA,CAIF,yBACC,yBACC,YAAA,CAAA",sourcesContent:["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n.files-list__system-tags {\n\t--min-size: 32px;\n\tdisplay: none;\n\tjustify-content: center;\n\talign-items: center;\n\tmin-width: calc(var(--min-size) * 2);\n\tmax-width: 300px;\n}\n\n.files-list__system-tag {\n\tpadding: 5px 10px;\n\tborder: 1px solid;\n\tborder-radius: var(--border-radius-pill);\n\tborder-color: var(--color-border);\n\tcolor: var(--color-text-maxcontrast);\n\theight: var(--min-size);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tline-height: 22px; // min-size - 2 * 5px padding\n\ttext-align: center;\n\n\t&--more {\n\t\toverflow: visible;\n\t\ttext-overflow: initial;\n\t}\n\n\t// Proper spacing if multiple shown\n\t& + .files-list__system-tag {\n\t\tmargin-left: 5px;\n\t}\n}\n\n@media (min-width: 512px) {\n\t.files-list__system-tags {\n\t\tdisplay: flex;\n\t}\n}\n"],sourceRoot:""}]);const a=o},42634:()=>{},15340:()=>{},79838:()=>{}},i={};function n(t){var r=i[t];if(void 0!==r)return r.exports;var s=i[t]={id:t,loaded:!1,exports:{}};return e[t].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.m=e,t=[],n.O=(e,i,r,s)=>{if(!i){var o=1/0;for(c=0;c<t.length;c++){i=t[c][0],r=t[c][1],s=t[c][2];for(var a=!0,l=0;l<i.length;l++)(!1&s||o>=s)&&Object.keys(n.O).every((t=>n.O[t](i[l])))?i.splice(l--,1):(a=!1,s<o&&(o=s));if(a){t.splice(c--,1);var d=r();void 0!==d&&(e=d)}}return e}s=s||0;for(var c=t.length;c>0&&t[c-1][2]>s;c--)t[c]=t[c-1];t[c]=[i,r,s]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n.j=2766,(()=>{n.b=document.baseURI||self.location.href;var t={2766:0};n.O.j=e=>0===t[e];var e=(e,i)=>{var r,s,o=i[0],a=i[1],l=i[2],d=0;if(o.some((e=>0!==t[e]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(l)var c=l(n)}for(e&&e(i);d<o.length;d++)s=o[d],n.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return n.O(c)},i=self.webpackChunknextcloud=self.webpackChunknextcloud||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})(),n.nc=void 0;var r=n.O(void 0,[4208],(()=>n(27560)));r=n.O(r)})();
+//# sourceMappingURL=systemtags-init.js.map?v=746d8edfbd0035fbbf62
\ No newline at end of file
diff --git a/dist/systemtags-init.js.map b/dist/systemtags-init.js.map
index f76df2a219d71..ea1fdf1a44fe6 100644
--- a/dist/systemtags-init.js.map
+++ b/dist/systemtags-init.js.map
@@ -1 +1 @@
-{"version":3,"file":"systemtags-init.js?v=29ac96ed1b17f6d6322d","mappings":"UAAIA,E,iLCWJ,MAAM,GAAS,UAAmBC,OAAO,oBAAoBC,aAAaC,QAmE1E,IAAIC,EAA8B,CAAEC,IAClCA,EAAsB,QAAI,UAC1BA,EAAqB,OAAI,SAClBA,GAHyB,CAI/BD,GAAe,CAAC,GA6JfE,EAA6B,CAAEC,IACjCA,EAAYA,EAAkB,KAAI,GAAK,OACvCA,EAAYA,EAAoB,OAAI,GAAK,SACzCA,EAAYA,EAAkB,KAAI,GAAK,OACvCA,EAAYA,EAAoB,OAAI,GAAK,SACzCA,EAAYA,EAAoB,OAAI,GAAK,SACzCA,EAAYA,EAAmB,MAAI,IAAM,QACzCA,EAAYA,EAAiB,IAAI,IAAM,MAChCA,GARwB,CAS9BD,GAAc,CAAC,GAClB,MAAME,EAAuB,CAC3B,qBACA,mBACA,YACA,oBACA,iBACA,gBACA,0BACA,iBACA,iBACA,kBACA,gBACA,qBACA,cACA,YACA,wBACA,cACA,iBACA,WAEIC,EAAuB,CAC3BC,EAAG,OACHC,GAAI,0BACJC,GAAI,yBACJC,IAAK,6CAuIP,IAAIC,EAA2B,CAAEC,IAC/BA,EAAkB,OAAI,SACtBA,EAAgB,KAAI,OACbA,GAHsB,CAI5BD,GAAY,CAAC,GAChB,MAAME,EAAiB,SAASC,EAAQC,GACtC,OAAoC,OAA7BD,EAAOE,MAAMD,EACtB,EACME,EAAe,CAACC,EAAMH,KAC1B,GAAIG,EAAKC,IAAyB,iBAAZD,EAAKC,GACzB,MAAM,IAAIC,MAAM,4BAElB,IAAKF,EAAKJ,OACR,MAAM,IAAIM,MAAM,4BAElB,IACE,IAAIC,IAAIH,EAAKJ,OACf,CAAE,MAAOQ,GACP,MAAM,IAA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","webpack:///nextcloud/node_modules/@nextcloud/files/dist/index.mjs","webpack://nextcloud/./apps/systemtags/src/css/fileEntryInlineSystemTags.scss?0a01","webpack:///nextcloud/apps/systemtags/src/actions/inlineSystemTagsAction.ts","webpack:///nextcloud/apps/systemtags/src/services/davClient.ts","webpack:///nextcloud/apps/systemtags/src/utils.ts","webpack:///nextcloud/apps/systemtags/src/logger.ts","webpack:///nextcloud/apps/systemtags/src/services/systemtags.ts","webpack:///nextcloud/apps/systemtags/src/init.ts","webpack:///nextcloud/apps/systemtags/src/services/api.ts","webpack:///nextcloud/apps/systemtags/src/css/fileEntryInlineSystemTags.scss","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import { getLoggerBuilder } from \"@nextcloud/logger\";\nimport { getCurrentUser, onRequestTokenUpdate, getRequestToken } from \"@nextcloud/auth\";\nimport { join, basename, extname, dirname } from \"path\";\nimport { encodePath } from \"@nextcloud/paths\";\nimport { generateRemoteUrl } from \"@nextcloud/router\";\nimport { CancelablePromise } from \"cancelable-promise\";\nimport { createClient, getPatcher } from \"webdav\";\nimport { isPublicShare, getSharingToken } from \"@nextcloud/sharing/public\";\nimport { getCapabilities } from \"@nextcloud/capabilities\";\nimport { getCanonicalLocale, getLanguage } from \"@nextcloud/l10n\";\nimport { TypedEventTarget } from \"typescript-event-target\";\nconst logger = getLoggerBuilder().setApp(\"@nextcloud/files\").detectUser().build();\nvar NewMenuEntryCategory = /* @__PURE__ */ ((NewMenuEntryCategory2) => {\n  NewMenuEntryCategory2[NewMenuEntryCategory2[\"UploadFromDevice\"] = 0] = \"UploadFromDevice\";\n  NewMenuEntryCategory2[NewMenuEntryCategory2[\"CreateNew\"] = 1] = \"CreateNew\";\n  NewMenuEntryCategory2[NewMenuEntryCategory2[\"Other\"] = 2] = \"Other\";\n  return NewMenuEntryCategory2;\n})(NewMenuEntryCategory || {});\nclass NewFileMenu {\n  _entries = [];\n  registerEntry(entry) {\n    this.validateEntry(entry);\n    entry.category = entry.category ?? 1;\n    this._entries.push(entry);\n  }\n  unregisterEntry(entry) {\n    const entryIndex = typeof entry === \"string\" ? this.getEntryIndex(entry) : this.getEntryIndex(entry.id);\n    if (entryIndex === -1) {\n      logger.warn(\"Entry not found, nothing removed\", { entry, entries: this.getEntries() });\n      return;\n    }\n    this._entries.splice(entryIndex, 1);\n  }\n  /**\n   * Get the list of registered entries\n   *\n   * @param {Folder} context the creation context. Usually the current folder\n   */\n  getEntries(context) {\n    if (context) {\n      return this._entries.filter((entry) => typeof entry.enabled === \"function\" ? entry.enabled(context) : true);\n    }\n    return this._entries;\n  }\n  getEntryIndex(id) {\n    return this._entries.findIndex((entry) => entry.id === id);\n  }\n  validateEntry(entry) {\n    if (!entry.id || !entry.displayName || !(entry.iconSvgInline || entry.iconClass) || !entry.handler) {\n      throw new Error(\"Invalid entry\");\n    }\n    if (typeof entry.id !== \"string\" || typeof entry.displayName !== \"string\") {\n      throw new Error(\"Invalid id or displayName property\");\n    }\n    if (entry.iconClass && typeof entry.iconClass !== \"string\" || entry.iconSvgInline && typeof entry.iconSvgInline !== \"string\") {\n      throw new Error(\"Invalid icon provided\");\n    }\n    if (entry.enabled !== void 0 && typeof entry.enabled !== \"function\") {\n      throw new Error(\"Invalid enabled property\");\n    }\n    if (typeof entry.handler !== \"function\") {\n      throw new Error(\"Invalid handler property\");\n    }\n    if (\"order\" in entry && typeof entry.order !== \"number\") {\n      throw new Error(\"Invalid order property\");\n    }\n    if (this.getEntryIndex(entry.id) !== -1) {\n      throw new Error(\"Duplicate entry\");\n    }\n  }\n}\nconst getNewFileMenu = function() {\n  if (typeof window._nc_newfilemenu === \"undefined\") {\n    window._nc_newfilemenu = new NewFileMenu();\n    logger.debug(\"NewFileMenu initialized\");\n  }\n  return window._nc_newfilemenu;\n};\nvar DefaultType = /* @__PURE__ */ ((DefaultType2) => {\n  DefaultType2[\"DEFAULT\"] = \"default\";\n  DefaultType2[\"HIDDEN\"] = \"hidden\";\n  return DefaultType2;\n})(DefaultType || {});\nclass FileAction {\n  _action;\n  constructor(action) {\n    this.validateAction(action);\n    this._action = action;\n  }\n  get id() {\n    return this._action.id;\n  }\n  get displayName() {\n    return this._action.displayName;\n  }\n  get title() {\n    return this._action.title;\n  }\n  get iconSvgInline() {\n    return this._action.iconSvgInline;\n  }\n  get enabled() {\n    return this._action.enabled;\n  }\n  get exec() {\n    return this._action.exec;\n  }\n  get execBatch() {\n    return this._action.execBatch;\n  }\n  get order() {\n    return this._action.order;\n  }\n  get parent() {\n    return this._action.parent;\n  }\n  get default() {\n    return this._action.default;\n  }\n  get inline() {\n    return this._action.inline;\n  }\n  get renderInline() {\n    return this._action.renderInline;\n  }\n  validateAction(action) {\n    if (!action.id || typeof action.id !== \"string\") {\n      throw new Error(\"Invalid id\");\n    }\n    if (!action.displayName || typeof action.displayName !== \"function\") {\n      throw new Error(\"Invalid displayName function\");\n    }\n    if (\"title\" in action && typeof action.title !== \"function\") {\n      throw new Error(\"Invalid title function\");\n    }\n    if (!action.iconSvgInline || typeof action.iconSvgInline !== \"function\") {\n      throw new Error(\"Invalid iconSvgInline function\");\n    }\n    if (!action.exec || typeof action.exec !== \"function\") {\n      throw new Error(\"Invalid exec function\");\n    }\n    if (\"enabled\" in action && typeof action.enabled !== \"function\") {\n      throw new Error(\"Invalid enabled function\");\n    }\n    if (\"execBatch\" in action && typeof action.execBatch !== \"function\") {\n      throw new Error(\"Invalid execBatch function\");\n    }\n    if (\"order\" in action && typeof action.order !== \"number\") {\n      throw new Error(\"Invalid order\");\n    }\n    if (\"parent\" in action && typeof action.parent !== \"string\") {\n      throw new Error(\"Invalid parent\");\n    }\n    if (action.default && !Object.values(DefaultType).includes(action.default)) {\n      throw new Error(\"Invalid default\");\n    }\n    if (\"inline\" in action && typeof action.inline !== \"function\") {\n      throw new Error(\"Invalid inline function\");\n    }\n    if (\"renderInline\" in action && typeof action.renderInline !== \"function\") {\n      throw new Error(\"Invalid renderInline function\");\n    }\n  }\n}\nconst registerFileAction = function(action) {\n  if (typeof window._nc_fileactions === \"undefined\") {\n    window._nc_fileactions = [];\n    logger.debug(\"FileActions initialized\");\n  }\n  if (window._nc_fileactions.find((search) => search.id === action.id)) {\n    logger.error(`FileAction ${action.id} already registered`, { action });\n    return;\n  }\n  window._nc_fileactions.push(action);\n};\nconst getFileActions = function() {\n  if (typeof window._nc_fileactions === \"undefined\") {\n    window._nc_fileactions = [];\n    logger.debug(\"FileActions initialized\");\n  }\n  return window._nc_fileactions;\n};\nclass Header {\n  _header;\n  constructor(header) {\n    this.validateHeader(header);\n    this._header = header;\n  }\n  get id() {\n    return this._header.id;\n  }\n  get order() {\n    return this._header.order;\n  }\n  get enabled() {\n    return this._header.enabled;\n  }\n  get render() {\n    return this._header.render;\n  }\n  get updated() {\n    return this._header.updated;\n  }\n  validateHeader(header) {\n    if (!header.id || !header.render || !header.updated) {\n      throw new Error(\"Invalid header: id, render and updated are required\");\n    }\n    if (typeof header.id !== \"string\") {\n      throw new Error(\"Invalid id property\");\n    }\n    if (header.enabled !== void 0 && typeof header.enabled !== \"function\") {\n      throw new Error(\"Invalid enabled property\");\n    }\n    if (header.render && typeof header.render !== \"function\") {\n      throw new Error(\"Invalid render property\");\n    }\n    if (header.updated && typeof header.updated !== \"function\") {\n      throw new Error(\"Invalid updated property\");\n    }\n  }\n}\nconst registerFileListHeaders = function(header) {\n  if (typeof window._nc_filelistheader === \"undefined\") {\n    window._nc_filelistheader = [];\n    logger.debug(\"FileListHeaders initialized\");\n  }\n  if (window._nc_filelistheader.find((search) => search.id === header.id)) {\n    logger.error(`Header ${header.id} already registered`, { header });\n    return;\n  }\n  window._nc_filelistheader.push(header);\n};\nconst getFileListHeaders = function() {\n  if (typeof window._nc_filelistheader === \"undefined\") {\n    window._nc_filelistheader = [];\n    logger.debug(\"FileListHeaders initialized\");\n  }\n  return window._nc_filelistheader;\n};\nvar Permission = /* @__PURE__ */ ((Permission2) => {\n  Permission2[Permission2[\"NONE\"] = 0] = \"NONE\";\n  Permission2[Permission2[\"CREATE\"] = 4] = \"CREATE\";\n  Permission2[Permission2[\"READ\"] = 1] = \"READ\";\n  Permission2[Permission2[\"UPDATE\"] = 2] = \"UPDATE\";\n  Permission2[Permission2[\"DELETE\"] = 8] = \"DELETE\";\n  Permission2[Permission2[\"SHARE\"] = 16] = \"SHARE\";\n  Permission2[Permission2[\"ALL\"] = 31] = \"ALL\";\n  return Permission2;\n})(Permission || {});\nconst defaultDavProperties = [\n  \"d:getcontentlength\",\n  \"d:getcontenttype\",\n  \"d:getetag\",\n  \"d:getlastmodified\",\n  \"d:creationdate\",\n  \"d:displayname\",\n  \"d:quota-available-bytes\",\n  \"d:resourcetype\",\n  \"nc:has-preview\",\n  \"nc:is-encrypted\",\n  \"nc:mount-type\",\n  \"oc:comments-unread\",\n  \"oc:favorite\",\n  \"oc:fileid\",\n  \"oc:owner-display-name\",\n  \"oc:owner-id\",\n  \"oc:permissions\",\n  \"oc:size\"\n];\nconst defaultDavNamespaces = {\n  d: \"DAV:\",\n  nc: \"http://nextcloud.org/ns\",\n  oc: \"http://owncloud.org/ns\",\n  ocs: \"http://open-collaboration-services.org/ns\"\n};\nconst registerDavProperty = function(prop, namespace = { nc: \"http://nextcloud.org/ns\" }) {\n  if (typeof window._nc_dav_properties === \"undefined\") {\n    window._nc_dav_properties = [...defaultDavProperties];\n    window._nc_dav_namespaces = { ...defaultDavNamespaces };\n  }\n  const namespaces = { ...window._nc_dav_namespaces, ...namespace };\n  if (window._nc_dav_properties.find((search) => search === prop)) {\n    logger.warn(`${prop} already registered`, { prop });\n    return false;\n  }\n  if (prop.startsWith(\"<\") || prop.split(\":\").length !== 2) {\n    logger.error(`${prop} is not valid. See example: 'oc:fileid'`, { prop });\n    return false;\n  }\n  const ns = prop.split(\":\")[0];\n  if (!namespaces[ns]) {\n    logger.error(`${prop} namespace unknown`, { prop, namespaces });\n    return false;\n  }\n  window._nc_dav_properties.push(prop);\n  window._nc_dav_namespaces = namespaces;\n  return true;\n};\nconst getDavProperties = function() {\n  if (typeof window._nc_dav_properties === \"undefined\") {\n    window._nc_dav_properties = [...defaultDavProperties];\n  }\n  return window._nc_dav_properties.map((prop) => `<${prop} />`).join(\" \");\n};\nconst getDavNameSpaces = function() {\n  if (typeof window._nc_dav_namespaces === \"undefined\") {\n    window._nc_dav_namespaces = { ...defaultDavNamespaces };\n  }\n  return Object.keys(window._nc_dav_namespaces).map((ns) => `xmlns:${ns}=\"${window._nc_dav_namespaces?.[ns]}\"`).join(\" \");\n};\nconst davGetDefaultPropfind = function() {\n  return `<?xml version=\"1.0\"?>\n\t\t<d:propfind ${getDavNameSpaces()}>\n\t\t\t<d:prop>\n\t\t\t\t${getDavProperties()}\n\t\t\t</d:prop>\n\t\t</d:propfind>`;\n};\nconst davGetFavoritesReport = function() {\n  return `<?xml version=\"1.0\"?>\n\t\t<oc:filter-files ${getDavNameSpaces()}>\n\t\t\t<d:prop>\n\t\t\t\t${getDavProperties()}\n\t\t\t</d:prop>\n\t\t\t<oc:filter-rules>\n\t\t\t\t<oc:favorite>1</oc:favorite>\n\t\t\t</oc:filter-rules>\n\t\t</oc:filter-files>`;\n};\nconst davGetRecentSearch = function(lastModified) {\n  return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<d:searchrequest ${getDavNameSpaces()}\n\txmlns:ns=\"https://github.com/icewind1991/SearchDAV/ns\">\n\t<d:basicsearch>\n\t\t<d:select>\n\t\t\t<d:prop>\n\t\t\t\t${getDavProperties()}\n\t\t\t</d:prop>\n\t\t</d:select>\n\t\t<d:from>\n\t\t\t<d:scope>\n\t\t\t\t<d:href>/files/${getCurrentUser()?.uid}/</d:href>\n\t\t\t\t<d:depth>infinity</d:depth>\n\t\t\t</d:scope>\n\t\t</d:from>\n\t\t<d:where>\n\t\t\t<d:and>\n\t\t\t\t<d:or>\n\t\t\t\t\t<d:not>\n\t\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t<d:getcontenttype/>\n\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t\t<d:literal>httpd/unix-directory</d:literal>\n\t\t\t\t\t\t</d:eq>\n\t\t\t\t\t</d:not>\n\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t<oc:size/>\n\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t<d:literal>0</d:literal>\n\t\t\t\t\t</d:eq>\n\t\t\t\t</d:or>\n\t\t\t\t<d:gt>\n\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t\t</d:prop>\n\t\t\t\t\t<d:literal>${lastModified}</d:literal>\n\t\t\t\t</d:gt>\n\t\t\t</d:and>\n\t\t</d:where>\n\t\t<d:orderby>\n\t\t\t<d:order>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t</d:prop>\n\t\t\t\t<d:descending/>\n\t\t\t</d:order>\n\t\t</d:orderby>\n\t\t<d:limit>\n\t\t\t<d:nresults>100</d:nresults>\n\t\t\t<ns:firstresult>0</ns:firstresult>\n\t\t</d:limit>\n\t</d:basicsearch>\n</d:searchrequest>`;\n};\nconst davParsePermissions = function(permString = \"\") {\n  let permissions = Permission.NONE;\n  if (!permString) {\n    return permissions;\n  }\n  if (permString.includes(\"C\") || permString.includes(\"K\")) {\n    permissions |= Permission.CREATE;\n  }\n  if (permString.includes(\"G\")) {\n    permissions |= Permission.READ;\n  }\n  if (permString.includes(\"W\") || permString.includes(\"N\") || permString.includes(\"V\")) {\n    permissions |= Permission.UPDATE;\n  }\n  if (permString.includes(\"D\")) {\n    permissions |= Permission.DELETE;\n  }\n  if (permString.includes(\"R\")) {\n    permissions |= Permission.SHARE;\n  }\n  return permissions;\n};\nvar FileType = /* @__PURE__ */ ((FileType2) => {\n  FileType2[\"Folder\"] = \"folder\";\n  FileType2[\"File\"] = \"file\";\n  return FileType2;\n})(FileType || {});\nconst isDavRessource = function(source, davService) {\n  return source.match(davService) !== null;\n};\nconst validateData = (data, davService) => {\n  if (data.id && typeof data.id !== \"number\") {\n    throw new Error(\"Invalid id type of value\");\n  }\n  if (!data.source) {\n    throw new Error(\"Missing mandatory source\");\n  }\n  try {\n    new URL(data.source);\n  } catch (e) {\n    throw new Error(\"Invalid source format, source must be a valid URL\");\n  }\n  if (!data.source.startsWith(\"http\")) {\n    throw new Error(\"Invalid source format, only http(s) is supported\");\n  }\n  if (data.displayname && typeof data.displayname !== \"string\") {\n    throw new Error(\"Invalid displayname type\");\n  }\n  if (data.mtime && !(data.mtime instanceof Date)) {\n    throw new Error(\"Invalid mtime type\");\n  }\n  if (data.crtime && !(data.crtime instanceof Date)) {\n    throw new Error(\"Invalid crtime type\");\n  }\n  if (!data.mime || typeof data.mime !== \"string\" || !data.mime.match(/^[-\\w.]+\\/[-+\\w.]+$/gi)) {\n    throw new Error(\"Missing or invalid mandatory mime\");\n  }\n  if (\"size\" in data && typeof data.size !== \"number\" && data.size !== void 0) {\n    throw new Error(\"Invalid size type\");\n  }\n  if (\"permissions\" in data && data.permissions !== void 0 && !(typeof data.permissions === \"number\" && data.permissions >= Permission.NONE && data.permissions <= Permission.ALL)) {\n    throw new Error(\"Invalid permissions\");\n  }\n  if (data.owner && data.owner !== null && typeof data.owner !== \"string\") {\n    throw new Error(\"Invalid owner type\");\n  }\n  if (data.attributes && typeof data.attributes !== \"object\") {\n    throw new Error(\"Invalid attributes type\");\n  }\n  if (data.root && typeof data.root !== \"string\") {\n    throw new Error(\"Invalid root type\");\n  }\n  if (data.root && !data.root.startsWith(\"/\")) {\n    throw new Error(\"Root must start with a leading slash\");\n  }\n  if (data.root && !data.source.includes(data.root)) {\n    throw new Error(\"Root must be part of the source\");\n  }\n  if (data.root && isDavRessource(data.source, davService)) {\n    const service = data.source.match(davService)[0];\n    if (!data.source.includes(join(service, data.root))) {\n      throw new Error(\"The root must be relative to the service. e.g /files/emma\");\n    }\n  }\n  if (data.status && !Object.values(NodeStatus).includes(data.status)) {\n    throw new Error(\"Status must be a valid NodeStatus\");\n  }\n};\nvar NodeStatus = /* @__PURE__ */ ((NodeStatus2) => {\n  NodeStatus2[\"NEW\"] = \"new\";\n  NodeStatus2[\"FAILED\"] = \"failed\";\n  NodeStatus2[\"LOADING\"] = \"loading\";\n  NodeStatus2[\"LOCKED\"] = \"locked\";\n  return NodeStatus2;\n})(NodeStatus || {});\nclass Node {\n  _data;\n  _attributes;\n  _knownDavService = /(remote|public)\\.php\\/(web)?dav/i;\n  readonlyAttributes = Object.entries(Object.getOwnPropertyDescriptors(Node.prototype)).filter((e) => typeof e[1].get === \"function\" && e[0] !== \"__proto__\").map((e) => e[0]);\n  handler = {\n    set: (target, prop, value) => {\n      if (this.readonlyAttributes.includes(prop)) {\n        return false;\n      }\n      return Reflect.set(target, prop, value);\n    },\n    deleteProperty: (target, prop) => {\n      if (this.readonlyAttributes.includes(prop)) {\n        return false;\n      }\n      return Reflect.deleteProperty(target, prop);\n    },\n    // TODO: This is deprecated and only needed for files v3\n    get: (target, prop, receiver) => {\n      if (this.readonlyAttributes.includes(prop)) {\n        logger.warn(`Accessing \"Node.attributes.${prop}\" is deprecated, access it directly on the Node instance.`);\n        return Reflect.get(this, prop);\n      }\n      return Reflect.get(target, prop, receiver);\n    }\n  };\n  constructor(data, davService) {\n    validateData(data, davService || this._knownDavService);\n    this._data = {\n      // TODO: Remove with next major release, this is just for compatibility\n      displayname: data.attributes?.displayname,\n      ...data,\n      attributes: {}\n    };\n    this._attributes = new Proxy(this._data.attributes, this.handler);\n    this.update(data.attributes ?? {});\n    if (davService) {\n      this._knownDavService = davService;\n    }\n  }\n  /**\n   * Get the source url to this object\n   * There is no setter as the source is not meant to be changed manually.\n   * You can use the rename or move method to change the source.\n   */\n  get source() {\n    return this._data.source.replace(/\\/$/i, \"\");\n  }\n  /**\n   * Get the encoded source url to this object for requests purposes\n   */\n  get encodedSource() {\n    const { origin } = new URL(this.source);\n    return origin + encodePath(this.source.slice(origin.length));\n  }\n  /**\n   * Get this object name\n   * There is no setter as the source is not meant to be changed manually.\n   * You can use the rename or move method to change the source.\n   */\n  get basename() {\n    return basename(this.source);\n  }\n  /**\n   * The nodes displayname\n   * By default the display name and the `basename` are identical,\n   * but it is possible to have a different name. This happens\n   * on the files app for example for shared folders.\n   */\n  get displayname() {\n    return this._data.displayname || this.basename;\n  }\n  /**\n   * Set the displayname\n   */\n  set displayname(displayname) {\n    this._data.displayname = displayname;\n  }\n  /**\n   * Get this object's extension\n   * There is no setter as the source is not meant to be changed manually.\n   * You can use the rename or move method to change the source.\n   */\n  get extension() {\n    return extname(this.source);\n  }\n  /**\n   * Get the directory path leading to this object\n   * Will use the relative path to root if available\n   *\n   * There is no setter as the source is not meant to be changed manually.\n   * You can use the rename or move method to change the source.\n   */\n  get dirname() {\n    if (this.root) {\n      let source = this.source;\n      if (this.isDavRessource) {\n        source = source.split(this._knownDavService).pop();\n      }\n      const firstMatch = source.indexOf(this.root);\n      const root = this.root.replace(/\\/$/, \"\");\n      return dirname(source.slice(firstMatch + root.length) || \"/\");\n    }\n    const url = new URL(this.source);\n    return dirname(url.pathname);\n  }\n  /**\n   * Get the file mime\n   * There is no setter as the mime is not meant to be changed\n   */\n  get mime() {\n    return this._data.mime;\n  }\n  /**\n   * Get the file modification time\n   */\n  get mtime() {\n    return this._data.mtime;\n  }\n  /**\n   * Set the file modification time\n   */\n  set mtime(mtime) {\n    this._data.mtime = mtime;\n  }\n  /**\n   * Get the file creation time\n   * There is no setter as the creation time is not meant to be changed\n   */\n  get crtime() {\n    return this._data.crtime;\n  }\n  /**\n   * Get the file size\n   */\n  get size() {\n    return this._data.size;\n  }\n  /**\n   * Set the file size\n   */\n  set size(size) {\n    this.updateMtime();\n    this._data.size = size;\n  }\n  /**\n   * Get the file attribute\n   * This contains all additional attributes not provided by the Node class\n   */\n  get attributes() {\n    return this._attributes;\n  }\n  /**\n   * Get the file permissions\n   */\n  get permissions() {\n    if (this.owner === null && !this.isDavRessource) {\n      return Permission.READ;\n    }\n    return this._data.permissions !== void 0 ? this._data.permissions : Permission.NONE;\n  }\n  /**\n   * Set the file permissions\n   */\n  set permissions(permissions) {\n    this.updateMtime();\n    this._data.permissions = permissions;\n  }\n  /**\n   * Get the file owner\n   * There is no setter as the owner is not meant to be changed\n   */\n  get owner() {\n    if (!this.isDavRessource) {\n      return null;\n    }\n    return this._data.owner;\n  }\n  /**\n   * Is this a dav-related ressource ?\n   */\n  get isDavRessource() {\n    return isDavRessource(this.source, this._knownDavService);\n  }\n  /**\n   * Get the dav root of this object\n   * There is no setter as the root is not meant to be changed\n   */\n  get root() {\n    if (this._data.root) {\n      return this._data.root.replace(/^(.+)\\/$/, \"$1\");\n    }\n    if (this.isDavRessource) {\n      const root = dirname(this.source);\n      return root.split(this._knownDavService).pop() || null;\n    }\n    return null;\n  }\n  /**\n   * Get the absolute path of this object relative to the root\n   */\n  get path() {\n    if (this.root) {\n      let source = this.source;\n      if (this.isDavRessource) {\n        source = source.split(this._knownDavService).pop();\n      }\n      const firstMatch = source.indexOf(this.root);\n      const root = this.root.replace(/\\/$/, \"\");\n      return source.slice(firstMatch + root.length) || \"/\";\n    }\n    return (this.dirname + \"/\" + this.basename).replace(/\\/\\//g, \"/\");\n  }\n  /**\n   * Get the node id if defined.\n   * There is no setter as the fileid is not meant to be changed\n   */\n  get fileid() {\n    return this._data?.id;\n  }\n  /**\n   * Get the node status.\n   */\n  get status() {\n    return this._data?.status;\n  }\n  /**\n   * Set the node status.\n   */\n  set status(status) {\n    this._data.status = status;\n  }\n  /**\n   * Move the node to a new destination\n   *\n   * @param {string} destination the new source.\n   * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg\n   */\n  move(destination) {\n    validateData({ ...this._data, source: destination }, this._knownDavService);\n    const oldBasename = this.basename;\n    this._data.source = destination;\n    if (this.displayname === oldBasename && this.basename !== oldBasename) {\n      this.displayname = this.basename;\n    }\n    this.updateMtime();\n  }\n  /**\n   * Rename the node\n   * This aliases the move method for easier usage\n   *\n   * @param basename The new name of the node\n   */\n  rename(basename2) {\n    if (basename2.includes(\"/\")) {\n      throw new Error(\"Invalid basename\");\n    }\n    this.move(dirname(this.source) + \"/\" + basename2);\n  }\n  /**\n   * Update the mtime if exists\n   */\n  updateMtime() {\n    if (this._data.mtime) {\n      this._data.mtime = /* @__PURE__ */ new Date();\n    }\n  }\n  /**\n   * Update the attributes of the node\n   * Warning, updating attributes will NOT automatically update the mtime.\n   *\n   * @param attributes The new attributes to update on the Node attributes\n   */\n  update(attributes) {\n    for (const [name, value] of Object.entries(attributes)) {\n      try {\n        if (value === void 0) {\n          delete this.attributes[name];\n        } else {\n          this.attributes[name] = value;\n        }\n      } catch (e) {\n        if (e instanceof TypeError) {\n          continue;\n        }\n        throw e;\n      }\n    }\n  }\n}\nclass File extends Node {\n  get type() {\n    return FileType.File;\n  }\n}\nclass Folder extends Node {\n  constructor(data) {\n    super({\n      ...data,\n      mime: \"httpd/unix-directory\"\n    });\n  }\n  get type() {\n    return FileType.Folder;\n  }\n  get extension() {\n    return null;\n  }\n  get mime() {\n    return \"httpd/unix-directory\";\n  }\n}\nfunction davGetRootPath() {\n  if (isPublicShare()) {\n    return `/files/${getSharingToken()}`;\n  }\n  return `/files/${getCurrentUser()?.uid}`;\n}\nconst davRootPath = davGetRootPath();\nfunction davGetRemoteURL() {\n  const url = generateRemoteUrl(\"dav\");\n  if (isPublicShare()) {\n    return url.replace(\"remote.php\", \"public.php\");\n  }\n  return url;\n}\nconst davRemoteURL = davGetRemoteURL();\nconst davGetClient = function(remoteURL = davRemoteURL, headers = {}) {\n  const client = createClient(remoteURL, { headers });\n  function setHeaders(token) {\n    client.setHeaders({\n      ...headers,\n      // Add this so the server knows it is an request from the browser\n      \"X-Requested-With\": \"XMLHttpRequest\",\n      // Inject user auth\n      requesttoken: token ?? \"\"\n    });\n  }\n  onRequestTokenUpdate(setHeaders);\n  setHeaders(getRequestToken());\n  const patcher = getPatcher();\n  patcher.patch(\"fetch\", (url, options) => {\n    const headers2 = options.headers;\n    if (headers2?.method) {\n      options.method = headers2.method;\n      delete headers2.method;\n    }\n    return fetch(url, options);\n  });\n  return client;\n};\nconst getFavoriteNodes = (davClient, path = \"/\", davRoot = davRootPath) => {\n  const controller = new AbortController();\n  return new CancelablePromise(async (resolve, reject, onCancel) => {\n    onCancel(() => controller.abort());\n    try {\n      const contentsResponse = await davClient.getDirectoryContents(`${davRoot}${path}`, {\n        signal: controller.signal,\n        details: true,\n        data: davGetFavoritesReport(),\n        headers: {\n          // see davGetClient for patched webdav client\n          method: \"REPORT\"\n        },\n        includeSelf: true\n      });\n      const nodes = contentsResponse.data.filter((node) => node.filename !== path).map((result) => davResultToNode(result, davRoot));\n      resolve(nodes);\n    } catch (error) {\n      reject(error);\n    }\n  });\n};\nconst davResultToNode = function(node, filesRoot = davRootPath, remoteURL = davRemoteURL) {\n  let userId = getCurrentUser()?.uid;\n  if (isPublicShare()) {\n    userId = userId ?? \"anonymous\";\n  } else if (!userId) {\n    throw new Error(\"No user id found\");\n  }\n  const props = node.props;\n  const permissions = davParsePermissions(props?.permissions);\n  const owner = String(props?.[\"owner-id\"] || userId);\n  const id = props.fileid || 0;\n  const nodeData = {\n    id,\n    source: `${remoteURL}${node.filename}`,\n    mtime: new Date(Date.parse(node.lastmod)),\n    mime: node.mime || \"application/octet-stream\",\n    // Manually cast to work around for https://github.com/perry-mitchell/webdav-client/pull/380\n    displayname: props.displayname !== void 0 ? String(props.displayname) : void 0,\n    size: props?.size || Number.parseInt(props.getcontentlength || \"0\"),\n    // The fileid is set to -1 for failed requests\n    status: id < 0 ? NodeStatus.FAILED : void 0,\n    permissions,\n    owner,\n    root: filesRoot,\n    attributes: {\n      ...node,\n      ...props,\n      hasPreview: props?.[\"has-preview\"]\n    }\n  };\n  delete nodeData.attributes?.props;\n  return node.type === \"file\" ? new File(nodeData) : new Folder(nodeData);\n};\nvar InvalidFilenameErrorReason = /* @__PURE__ */ ((InvalidFilenameErrorReason2) => {\n  InvalidFilenameErrorReason2[\"ReservedName\"] = \"reserved name\";\n  InvalidFilenameErrorReason2[\"Character\"] = \"character\";\n  InvalidFilenameErrorReason2[\"Extension\"] = \"extension\";\n  return InvalidFilenameErrorReason2;\n})(InvalidFilenameErrorReason || {});\nclass InvalidFilenameError extends Error {\n  constructor(options) {\n    super(`Invalid ${options.reason} '${options.segment}' in filename '${options.filename}'`, { cause: options });\n  }\n  /**\n   * The filename that was validated\n   */\n  get filename() {\n    return this.cause.filename;\n  }\n  /**\n   * Reason why the validation failed\n   */\n  get reason() {\n    return this.cause.reason;\n  }\n  /**\n   * Part of the filename that caused this error\n   */\n  get segment() {\n    return this.cause.segment;\n  }\n}\nfunction validateFilename(filename) {\n  const capabilities = getCapabilities().files;\n  const forbiddenCharacters = capabilities.forbidden_filename_characters ?? window._oc_config?.forbidden_filenames_characters ?? [\"/\", \"\\\\\"];\n  for (const character of forbiddenCharacters) {\n    if (filename.includes(character)) {\n      throw new InvalidFilenameError({ segment: character, reason: \"character\", filename });\n    }\n  }\n  filename = filename.toLocaleLowerCase();\n  const forbiddenFilenames = capabilities.forbidden_filenames ?? [\".htaccess\"];\n  if (forbiddenFilenames.includes(filename)) {\n    throw new InvalidFilenameError({\n      filename,\n      segment: filename,\n      reason: \"reserved name\"\n      /* ReservedName */\n    });\n  }\n  const endOfBasename = filename.indexOf(\".\", 1);\n  const basename2 = filename.substring(0, endOfBasename === -1 ? void 0 : endOfBasename);\n  const forbiddenFilenameBasenames = capabilities.forbidden_filename_basenames ?? [];\n  if (forbiddenFilenameBasenames.includes(basename2)) {\n    throw new InvalidFilenameError({\n      filename,\n      segment: basename2,\n      reason: \"reserved name\"\n      /* ReservedName */\n    });\n  }\n  const forbiddenFilenameExtensions = capabilities.forbidden_filename_extensions ?? [\".part\", \".filepart\"];\n  for (const extension of forbiddenFilenameExtensions) {\n    if (filename.length > extension.length && filename.endsWith(extension)) {\n      throw new InvalidFilenameError({ segment: extension, reason: \"extension\", filename });\n    }\n  }\n}\nfunction isFilenameValid(filename) {\n  try {\n    validateFilename(filename);\n    return true;\n  } catch (error) {\n    if (error instanceof InvalidFilenameError) {\n      return false;\n    }\n    throw error;\n  }\n}\nfunction getUniqueName(name, otherNames, options) {\n  const opts = {\n    suffix: (n) => `(${n})`,\n    ignoreFileExtension: false,\n    ...options\n  };\n  let newName = name;\n  let i = 1;\n  while (otherNames.includes(newName)) {\n    const ext = opts.ignoreFileExtension ? \"\" : extname(name);\n    const base = basename(name, ext);\n    newName = `${base} ${opts.suffix(i++)}${ext}`;\n  }\n  return newName;\n}\nconst humanList = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\"];\nconst humanListBinary = [\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\"];\nfunction formatFileSize(size, skipSmallSizes = false, binaryPrefixes = false, base1000 = false) {\n  binaryPrefixes = binaryPrefixes && !base1000;\n  if (typeof size === \"string\") {\n    size = Number(size);\n  }\n  let order = size > 0 ? Math.floor(Math.log(size) / Math.log(base1000 ? 1e3 : 1024)) : 0;\n  order = Math.min((binaryPrefixes ? humanListBinary.length : humanList.length) - 1, order);\n  const readableFormat = binaryPrefixes ? humanListBinary[order] : humanList[order];\n  let relativeSize = (size / Math.pow(base1000 ? 1e3 : 1024, order)).toFixed(1);\n  if (skipSmallSizes === true && order === 0) {\n    return (relativeSize !== \"0.0\" ? \"< 1 \" : \"0 \") + (binaryPrefixes ? humanListBinary[1] : humanList[1]);\n  }\n  if (order < 2) {\n    relativeSize = parseFloat(relativeSize).toFixed(0);\n  } else {\n    relativeSize = parseFloat(relativeSize).toLocaleString(getCanonicalLocale());\n  }\n  return relativeSize + \" \" + readableFormat;\n}\nfunction parseFileSize(value, forceBinary = false) {\n  try {\n    value = `${value}`.toLocaleLowerCase().replaceAll(/\\s+/g, \"\").replaceAll(\",\", \".\");\n  } catch (e) {\n    return null;\n  }\n  const match = value.match(/^([0-9]*(\\.[0-9]*)?)([kmgtp]?)(i?)b?$/);\n  if (match === null || match[1] === \".\" || match[1] === \"\") {\n    return null;\n  }\n  const bytesArray = {\n    \"\": 0,\n    k: 1,\n    m: 2,\n    g: 3,\n    t: 4,\n    p: 5,\n    e: 6\n  };\n  const decimalString = `${match[1]}`;\n  const base = match[4] === \"i\" || forceBinary ? 1024 : 1e3;\n  return Math.round(Number.parseFloat(decimalString) * base ** bytesArray[match[3]]);\n}\nfunction stringify(value) {\n  if (value instanceof Date) {\n    return value.toISOString();\n  }\n  return String(value);\n}\nfunction orderBy(collection, identifiers2, orders) {\n  identifiers2 = identifiers2 ?? [(value) => value];\n  orders = orders ?? [];\n  const sorting = identifiers2.map((_, index) => (orders[index] ?? \"asc\") === \"asc\" ? 1 : -1);\n  const collator = Intl.Collator(\n    [getLanguage(), getCanonicalLocale()],\n    {\n      // handle 10 as ten and not as one-zero\n      numeric: true,\n      usage: \"sort\"\n    }\n  );\n  return [...collection].sort((a, b) => {\n    for (const [index, identifier] of identifiers2.entries()) {\n      const value = collator.compare(stringify(identifier(a)), stringify(identifier(b)));\n      if (value !== 0) {\n        return value * sorting[index];\n      }\n    }\n    return 0;\n  });\n}\nvar FilesSortingMode = /* @__PURE__ */ ((FilesSortingMode2) => {\n  FilesSortingMode2[\"Name\"] = \"basename\";\n  FilesSortingMode2[\"Modified\"] = \"mtime\";\n  FilesSortingMode2[\"Size\"] = \"size\";\n  return FilesSortingMode2;\n})(FilesSortingMode || {});\nfunction sortNodes(nodes, options = {}) {\n  const sortingOptions = {\n    // Default to sort by name\n    sortingMode: \"basename\",\n    // Default to sort ascending\n    sortingOrder: \"asc\",\n    ...options\n  };\n  const basename2 = (name) => name.lastIndexOf(\".\") > 0 ? name.slice(0, name.lastIndexOf(\".\")) : name;\n  const identifiers2 = [\n    // 1: Sort favorites first if enabled\n    ...sortingOptions.sortFavoritesFirst ? [(v) => v.attributes?.favorite !== 1] : [],\n    // 2: Sort folders first if sorting by name\n    ...sortingOptions.sortFoldersFirst ? [(v) => v.type !== \"folder\"] : [],\n    // 3: Use sorting mode if NOT basename (to be able to use display name too)\n    ...sortingOptions.sortingMode !== \"basename\" ? [(v) => v[sortingOptions.sortingMode]] : [],\n    // 4: Use display name if available, fallback to name\n    (v) => basename2(v.attributes?.displayname || v.basename),\n    // 5: Finally, use basename if all previous sorting methods failed\n    (v) => v.basename\n  ];\n  const orders = [\n    // (for 1): always sort favorites before normal files\n    ...sortingOptions.sortFavoritesFirst ? [\"asc\"] : [],\n    // (for 2): always sort folders before files\n    ...sortingOptions.sortFoldersFirst ? [\"asc\"] : [],\n    // (for 3): Reverse if sorting by mtime as mtime higher means edited more recent -> lower\n    ...sortingOptions.sortingMode === \"mtime\" ? [sortingOptions.sortingOrder === \"asc\" ? \"desc\" : \"asc\"] : [],\n    // (also for 3 so make sure not to conflict with 2 and 3)\n    ...sortingOptions.sortingMode !== \"mtime\" && sortingOptions.sortingMode !== \"basename\" ? [sortingOptions.sortingOrder] : [],\n    // for 4: use configured sorting direction\n    sortingOptions.sortingOrder,\n    // for 5: use configured sorting direction\n    sortingOptions.sortingOrder\n  ];\n  return orderBy(nodes, identifiers2, orders);\n}\nclass Navigation extends TypedEventTarget {\n  _views = [];\n  _currentView = null;\n  /**\n   * Register a new view on the navigation\n   * @param view The view to register\n   * @throws `Error` is thrown if a view with the same id is already registered\n   */\n  register(view) {\n    if (this._views.find((search) => search.id === view.id)) {\n      throw new Error(`View id ${view.id} is already registered`);\n    }\n    this._views.push(view);\n    this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n  }\n  /**\n   * Remove a registered view\n   * @param id The id of the view to remove\n   */\n  remove(id) {\n    const index = this._views.findIndex((view) => view.id === id);\n    if (index !== -1) {\n      this._views.splice(index, 1);\n      this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n    }\n  }\n  /**\n   * Set the currently active view\n   * @fires UpdateActiveViewEvent\n   * @param view New active view\n   */\n  setActive(view) {\n    this._currentView = view;\n    const event = new CustomEvent(\"updateActive\", { detail: view });\n    this.dispatchTypedEvent(\"updateActive\", event);\n  }\n  /**\n   * The currently active files view\n   */\n  get active() {\n    return this._currentView;\n  }\n  /**\n   * All registered views\n   */\n  get views() {\n    return this._views;\n  }\n}\nconst getNavigation = function() {\n  if (typeof window._nc_navigation === \"undefined\") {\n    window._nc_navigation = new Navigation();\n    logger.debug(\"Navigation service initialized\");\n  }\n  return window._nc_navigation;\n};\nclass Column {\n  _column;\n  constructor(column) {\n    isValidColumn(column);\n    this._column = column;\n  }\n  get id() {\n    return this._column.id;\n  }\n  get title() {\n    return this._column.title;\n  }\n  get render() {\n    return this._column.render;\n  }\n  get sort() {\n    return this._column.sort;\n  }\n  get summary() {\n    return this._column.summary;\n  }\n}\nconst isValidColumn = function(column) {\n  if (!column.id || typeof column.id !== \"string\") {\n    throw new Error(\"A column id is required\");\n  }\n  if (!column.title || typeof column.title !== \"string\") {\n    throw new Error(\"A column title is required\");\n  }\n  if (!column.render || typeof column.render !== \"function\") {\n    throw new Error(\"A render function is required\");\n  }\n  if (column.sort && typeof column.sort !== \"function\") {\n    throw new Error(\"Column sortFunction must be a function\");\n  }\n  if (column.summary && typeof column.summary !== \"function\") {\n    throw new Error(\"Column summary must be a function\");\n  }\n  return true;\n};\nfunction getDefaultExportFromCjs(x) {\n  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, \"default\") ? x[\"default\"] : x;\n}\nvar validator$2 = {};\nvar util$3 = {};\n(function(exports) {\n  const nameStartChar = \":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\";\n  const nameChar = nameStartChar + \"\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n  const nameRegexp = \"[\" + nameStartChar + \"][\" + nameChar + \"]*\";\n  const regexName = new RegExp(\"^\" + nameRegexp + \"$\");\n  const getAllMatches = function(string, regex) {\n    const matches = [];\n    let match = regex.exec(string);\n    while (match) {\n      const allmatches = [];\n      allmatches.startIndex = regex.lastIndex - match[0].length;\n      const len = match.length;\n      for (let index = 0; index < len; index++) {\n        allmatches.push(match[index]);\n      }\n      matches.push(allmatches);\n      match = regex.exec(string);\n    }\n    return matches;\n  };\n  const isName = function(string) {\n    const match = regexName.exec(string);\n    return !(match === null || typeof match === \"undefined\");\n  };\n  exports.isExist = function(v) {\n    return typeof v !== \"undefined\";\n  };\n  exports.isEmptyObject = function(obj) {\n    return Object.keys(obj).length === 0;\n  };\n  exports.merge = function(target, a, arrayMode) {\n    if (a) {\n      const keys = Object.keys(a);\n      const len = keys.length;\n      for (let i = 0; i < len; i++) {\n        if (arrayMode === \"strict\") {\n          target[keys[i]] = [a[keys[i]]];\n        } else {\n          target[keys[i]] = a[keys[i]];\n        }\n      }\n    }\n  };\n  exports.getValue = function(v) {\n    if (exports.isExist(v)) {\n      return v;\n    } else {\n      return \"\";\n    }\n  };\n  exports.isName = isName;\n  exports.getAllMatches = getAllMatches;\n  exports.nameRegexp = nameRegexp;\n})(util$3);\nconst util$2 = util$3;\nconst defaultOptions$2 = {\n  allowBooleanAttributes: false,\n  //A tag can have attributes without any value\n  unpairedTags: []\n};\nvalidator$2.validate = function(xmlData, options) {\n  options = Object.assign({}, defaultOptions$2, options);\n  const tags = [];\n  let tagFound = false;\n  let reachedRoot = false;\n  if (xmlData[0] === \"\\uFEFF\") {\n    xmlData = xmlData.substr(1);\n  }\n  for (let i = 0; i < xmlData.length; i++) {\n    if (xmlData[i] === \"<\" && xmlData[i + 1] === \"?\") {\n      i += 2;\n      i = readPI(xmlData, i);\n      if (i.err) return i;\n    } else if (xmlData[i] === \"<\") {\n      let tagStartPos = i;\n      i++;\n      if (xmlData[i] === \"!\") {\n        i = readCommentAndCDATA(xmlData, i);\n        continue;\n      } else {\n        let closingTag = false;\n        if (xmlData[i] === \"/\") {\n          closingTag = true;\n          i++;\n        }\n        let tagName = \"\";\n        for (; i < xmlData.length && xmlData[i] !== \">\" && xmlData[i] !== \" \" && xmlData[i] !== \"\t\" && xmlData[i] !== \"\\n\" && xmlData[i] !== \"\\r\"; i++) {\n          tagName += xmlData[i];\n        }\n        tagName = tagName.trim();\n        if (tagName[tagName.length - 1] === \"/\") {\n          tagName = tagName.substring(0, tagName.length - 1);\n          i--;\n        }\n        if (!validateTagName(tagName)) {\n          let msg;\n          if (tagName.trim().length === 0) {\n            msg = \"Invalid space after '<'.\";\n          } else {\n            msg = \"Tag '\" + tagName + \"' is an invalid name.\";\n          }\n          return getErrorObject(\"InvalidTag\", msg, getLineNumberForPosition(xmlData, i));\n        }\n        const result = readAttributeStr(xmlData, i);\n        if (result === false) {\n          return getErrorObject(\"InvalidAttr\", \"Attributes for '\" + tagName + \"' have open quote.\", getLineNumberForPosition(xmlData, i));\n        }\n        let attrStr = result.value;\n        i = result.index;\n        if (attrStr[attrStr.length - 1] === \"/\") {\n          const attrStrStart = i - attrStr.length;\n          attrStr = attrStr.substring(0, attrStr.length - 1);\n          const isValid = validateAttributeString(attrStr, options);\n          if (isValid === true) {\n            tagFound = true;\n          } else {\n            return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));\n          }\n        } else if (closingTag) {\n          if (!result.tagClosed) {\n            return getErrorObject(\"InvalidTag\", \"Closing tag '\" + tagName + \"' doesn't have proper closing.\", getLineNumberForPosition(xmlData, i));\n          } else if (attrStr.trim().length > 0) {\n            return getErrorObject(\"InvalidTag\", \"Closing tag '\" + tagName + \"' can't have attributes or invalid starting.\", getLineNumberForPosition(xmlData, tagStartPos));\n          } else if (tags.length === 0) {\n            return getErrorObject(\"InvalidTag\", \"Closing tag '\" + tagName + \"' has not been opened.\", getLineNumberForPosition(xmlData, tagStartPos));\n          } else {\n            const otg = tags.pop();\n            if (tagName !== otg.tagName) {\n              let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);\n              return getErrorObject(\n                \"InvalidTag\",\n                \"Expected closing tag '\" + otg.tagName + \"' (opened in line \" + openPos.line + \", col \" + openPos.col + \") instead of closing tag '\" + tagName + \"'.\",\n                getLineNumberForPosition(xmlData, tagStartPos)\n              );\n            }\n            if (tags.length == 0) {\n              reachedRoot = true;\n            }\n          }\n        } else {\n          const isValid = validateAttributeString(attrStr, options);\n          if (isValid !== true) {\n            return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));\n          }\n          if (reachedRoot === true) {\n            return getErrorObject(\"InvalidXml\", \"Multiple possible root nodes found.\", getLineNumberForPosition(xmlData, i));\n          } else if (options.unpairedTags.indexOf(tagName) !== -1) ;\n          else {\n            tags.push({ tagName, tagStartPos });\n          }\n          tagFound = true;\n        }\n        for (i++; i < xmlData.length; i++) {\n          if (xmlData[i] === \"<\") {\n            if (xmlData[i + 1] === \"!\") {\n              i++;\n              i = readCommentAndCDATA(xmlData, i);\n              continue;\n            } else if (xmlData[i + 1] === \"?\") {\n              i = readPI(xmlData, ++i);\n              if (i.err) return i;\n            } else {\n              break;\n            }\n          } else if (xmlData[i] === \"&\") {\n            const afterAmp = validateAmpersand(xmlData, i);\n            if (afterAmp == -1)\n              return getErrorObject(\"InvalidChar\", \"char '&' is not expected.\", getLineNumberForPosition(xmlData, i));\n            i = afterAmp;\n          } else {\n            if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {\n              return getErrorObject(\"InvalidXml\", \"Extra text at the end\", getLineNumberForPosition(xmlData, i));\n            }\n          }\n        }\n        if (xmlData[i] === \"<\") {\n          i--;\n        }\n      }\n    } else {\n      if (isWhiteSpace(xmlData[i])) {\n        continue;\n      }\n      return getErrorObject(\"InvalidChar\", \"char '\" + xmlData[i] + \"' is not expected.\", getLineNumberForPosition(xmlData, i));\n    }\n  }\n  if (!tagFound) {\n    return getErrorObject(\"InvalidXml\", \"Start tag expected.\", 1);\n  } else if (tags.length == 1) {\n    return getErrorObject(\"InvalidTag\", \"Unclosed tag '\" + tags[0].tagName + \"'.\", getLineNumberForPosition(xmlData, tags[0].tagStartPos));\n  } else if (tags.length > 0) {\n    return getErrorObject(\"InvalidXml\", \"Invalid '\" + JSON.stringify(tags.map((t2) => t2.tagName), null, 4).replace(/\\r?\\n/g, \"\") + \"' found.\", { line: 1, col: 1 });\n  }\n  return true;\n};\nfunction isWhiteSpace(char) {\n  return char === \" \" || char === \"\t\" || char === \"\\n\" || char === \"\\r\";\n}\nfunction readPI(xmlData, i) {\n  const start = i;\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] == \"?\" || xmlData[i] == \" \") {\n      const tagname = xmlData.substr(start, i - start);\n      if (i > 5 && tagname === \"xml\") {\n        return getErrorObject(\"InvalidXml\", \"XML declaration allowed only at the start of the document.\", getLineNumberForPosition(xmlData, i));\n      } else if (xmlData[i] == \"?\" && xmlData[i + 1] == \">\") {\n        i++;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  return i;\n}\nfunction readCommentAndCDATA(xmlData, i) {\n  if (xmlData.length > i + 5 && xmlData[i + 1] === \"-\" && xmlData[i + 2] === \"-\") {\n    for (i += 3; i < xmlData.length; i++) {\n      if (xmlData[i] === \"-\" && xmlData[i + 1] === \"-\" && xmlData[i + 2] === \">\") {\n        i += 2;\n        break;\n      }\n    }\n  } else if (xmlData.length > i + 8 && xmlData[i + 1] === \"D\" && xmlData[i + 2] === \"O\" && xmlData[i + 3] === \"C\" && xmlData[i + 4] === \"T\" && xmlData[i + 5] === \"Y\" && xmlData[i + 6] === \"P\" && xmlData[i + 7] === \"E\") {\n    let angleBracketsCount = 1;\n    for (i += 8; i < xmlData.length; i++) {\n      if (xmlData[i] === \"<\") {\n        angleBracketsCount++;\n      } else if (xmlData[i] === \">\") {\n        angleBracketsCount--;\n        if (angleBracketsCount === 0) {\n          break;\n        }\n      }\n    }\n  } else if (xmlData.length > i + 9 && xmlData[i + 1] === \"[\" && xmlData[i + 2] === \"C\" && xmlData[i + 3] === \"D\" && xmlData[i + 4] === \"A\" && xmlData[i + 5] === \"T\" && xmlData[i + 6] === \"A\" && xmlData[i + 7] === \"[\") {\n    for (i += 8; i < xmlData.length; i++) {\n      if (xmlData[i] === \"]\" && xmlData[i + 1] === \"]\" && xmlData[i + 2] === \">\") {\n        i += 2;\n        break;\n      }\n    }\n  }\n  return i;\n}\nconst doubleQuote = '\"';\nconst singleQuote = \"'\";\nfunction readAttributeStr(xmlData, i) {\n  let attrStr = \"\";\n  let startChar = \"\";\n  let tagClosed = false;\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {\n      if (startChar === \"\") {\n        startChar = xmlData[i];\n      } else if (startChar !== xmlData[i]) ;\n      else {\n        startChar = \"\";\n      }\n    } else if (xmlData[i] === \">\") {\n      if (startChar === \"\") {\n        tagClosed = true;\n        break;\n      }\n    }\n    attrStr += xmlData[i];\n  }\n  if (startChar !== \"\") {\n    return false;\n  }\n  return {\n    value: attrStr,\n    index: i,\n    tagClosed\n  };\n}\nconst validAttrStrRegxp = new RegExp(`(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*(['\"])(([\\\\s\\\\S])*?)\\\\5)?`, \"g\");\nfunction validateAttributeString(attrStr, options) {\n  const matches = util$2.getAllMatches(attrStr, validAttrStrRegxp);\n  const attrNames = {};\n  for (let i = 0; i < matches.length; i++) {\n    if (matches[i][1].length === 0) {\n      return getErrorObject(\"InvalidAttr\", \"Attribute '\" + matches[i][2] + \"' has no space in starting.\", getPositionFromMatch(matches[i]));\n    } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) {\n      return getErrorObject(\"InvalidAttr\", \"Attribute '\" + matches[i][2] + \"' is without value.\", getPositionFromMatch(matches[i]));\n    } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) {\n      return getErrorObject(\"InvalidAttr\", \"boolean attribute '\" + matches[i][2] + \"' is not allowed.\", getPositionFromMatch(matches[i]));\n    }\n    const attrName = matches[i][2];\n    if (!validateAttrName(attrName)) {\n      return getErrorObject(\"InvalidAttr\", \"Attribute '\" + attrName + \"' is an invalid name.\", getPositionFromMatch(matches[i]));\n    }\n    if (!attrNames.hasOwnProperty(attrName)) {\n      attrNames[attrName] = 1;\n    } else {\n      return getErrorObject(\"InvalidAttr\", \"Attribute '\" + attrName + \"' is repeated.\", getPositionFromMatch(matches[i]));\n    }\n  }\n  return true;\n}\nfunction validateNumberAmpersand(xmlData, i) {\n  let re2 = /\\d/;\n  if (xmlData[i] === \"x\") {\n    i++;\n    re2 = /[\\da-fA-F]/;\n  }\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] === \";\")\n      return i;\n    if (!xmlData[i].match(re2))\n      break;\n  }\n  return -1;\n}\nfunction validateAmpersand(xmlData, i) {\n  i++;\n  if (xmlData[i] === \";\")\n    return -1;\n  if (xmlData[i] === \"#\") {\n    i++;\n    return validateNumberAmpersand(xmlData, i);\n  }\n  let count = 0;\n  for (; i < xmlData.length; i++, count++) {\n    if (xmlData[i].match(/\\w/) && count < 20)\n      continue;\n    if (xmlData[i] === \";\")\n      break;\n    return -1;\n  }\n  return i;\n}\nfunction getErrorObject(code, message, lineNumber) {\n  return {\n    err: {\n      code,\n      msg: message,\n      line: lineNumber.line || lineNumber,\n      col: lineNumber.col\n    }\n  };\n}\nfunction validateAttrName(attrName) {\n  return util$2.isName(attrName);\n}\nfunction validateTagName(tagname) {\n  return util$2.isName(tagname);\n}\nfunction getLineNumberForPosition(xmlData, index) {\n  const lines = xmlData.substring(0, index).split(/\\r?\\n/);\n  return {\n    line: lines.length,\n    // column number is last line's length + 1, because column numbering starts at 1:\n    col: lines[lines.length - 1].length + 1\n  };\n}\nfunction getPositionFromMatch(match) {\n  return match.startIndex + match[1].length;\n}\nvar OptionsBuilder = {};\nconst defaultOptions$1 = {\n  preserveOrder: false,\n  attributeNamePrefix: \"@_\",\n  attributesGroupName: false,\n  textNodeName: \"#text\",\n  ignoreAttributes: true,\n  removeNSPrefix: false,\n  // remove NS from tag name or attribute name if true\n  allowBooleanAttributes: false,\n  //a tag can have attributes without any value\n  //ignoreRootElement : false,\n  parseTagValue: true,\n  parseAttributeValue: false,\n  trimValues: true,\n  //Trim string values of tag and attributes\n  cdataPropName: false,\n  numberParseOptions: {\n    hex: true,\n    leadingZeros: true,\n    eNotation: true\n  },\n  tagValueProcessor: function(tagName, val2) {\n    return val2;\n  },\n  attributeValueProcessor: function(attrName, val2) {\n    return val2;\n  },\n  stopNodes: [],\n  //nested tags will not be parsed even for errors\n  alwaysCreateTextNode: false,\n  isArray: () => false,\n  commentPropName: false,\n  unpairedTags: [],\n  processEntities: true,\n  htmlEntities: false,\n  ignoreDeclaration: false,\n  ignorePiTags: false,\n  transformTagName: false,\n  transformAttributeName: false,\n  updateTag: function(tagName, jPath, attrs) {\n    return tagName;\n  }\n  // skipEmptyListItem: false\n};\nconst buildOptions$1 = function(options) {\n  return Object.assign({}, defaultOptions$1, options);\n};\nOptionsBuilder.buildOptions = buildOptions$1;\nOptionsBuilder.defaultOptions = defaultOptions$1;\nclass XmlNode {\n  constructor(tagname) {\n    this.tagname = tagname;\n    this.child = [];\n    this[\":@\"] = {};\n  }\n  add(key, val2) {\n    if (key === \"__proto__\") key = \"#__proto__\";\n    this.child.push({ [key]: val2 });\n  }\n  addChild(node) {\n    if (node.tagname === \"__proto__\") node.tagname = \"#__proto__\";\n    if (node[\":@\"] && Object.keys(node[\":@\"]).length > 0) {\n      this.child.push({ [node.tagname]: node.child, [\":@\"]: node[\":@\"] });\n    } else {\n      this.child.push({ [node.tagname]: node.child });\n    }\n  }\n}\nvar xmlNode$1 = XmlNode;\nconst util$1 = util$3;\nfunction readDocType$1(xmlData, i) {\n  const entities = {};\n  if (xmlData[i + 3] === \"O\" && xmlData[i + 4] === \"C\" && xmlData[i + 5] === \"T\" && xmlData[i + 6] === \"Y\" && xmlData[i + 7] === \"P\" && xmlData[i + 8] === \"E\") {\n    i = i + 9;\n    let angleBracketsCount = 1;\n    let hasBody = false, comment = false;\n    let exp = \"\";\n    for (; i < xmlData.length; i++) {\n      if (xmlData[i] === \"<\" && !comment) {\n        if (hasBody && isEntity(xmlData, i)) {\n          i += 7;\n          [entityName, val, i] = readEntityExp(xmlData, i + 1);\n          if (val.indexOf(\"&\") === -1)\n            entities[validateEntityName(entityName)] = {\n              regx: RegExp(`&${entityName};`, \"g\"),\n              val\n            };\n        } else if (hasBody && isElement(xmlData, i)) i += 8;\n        else if (hasBody && isAttlist(xmlData, i)) i += 8;\n        else if (hasBody && isNotation(xmlData, i)) i += 9;\n        else if (isComment) comment = true;\n        else throw new Error(\"Invalid DOCTYPE\");\n        angleBracketsCount++;\n        exp = \"\";\n      } else if (xmlData[i] === \">\") {\n        if (comment) {\n          if (xmlData[i - 1] === \"-\" && xmlData[i - 2] === \"-\") {\n            comment = false;\n            angleBracketsCount--;\n          }\n        } else {\n          angleBracketsCount--;\n        }\n        if (angleBracketsCount === 0) {\n          break;\n        }\n      } else if (xmlData[i] === \"[\") {\n        hasBody = true;\n      } else {\n        exp += xmlData[i];\n      }\n    }\n    if (angleBracketsCount !== 0) {\n      throw new Error(`Unclosed DOCTYPE`);\n    }\n  } else {\n    throw new Error(`Invalid Tag instead of DOCTYPE`);\n  }\n  return { entities, i };\n}\nfunction readEntityExp(xmlData, i) {\n  let entityName2 = \"\";\n  for (; i < xmlData.length && (xmlData[i] !== \"'\" && xmlData[i] !== '\"'); i++) {\n    entityName2 += xmlData[i];\n  }\n  entityName2 = entityName2.trim();\n  if (entityName2.indexOf(\" \") !== -1) throw new Error(\"External entites are not supported\");\n  const startChar = xmlData[i++];\n  let val2 = \"\";\n  for (; i < xmlData.length && xmlData[i] !== startChar; i++) {\n    val2 += xmlData[i];\n  }\n  return [entityName2, val2, i];\n}\nfunction isComment(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"-\" && xmlData[i + 3] === \"-\") return true;\n  return false;\n}\nfunction isEntity(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"E\" && xmlData[i + 3] === \"N\" && xmlData[i + 4] === \"T\" && xmlData[i + 5] === \"I\" && xmlData[i + 6] === \"T\" && xmlData[i + 7] === \"Y\") return true;\n  return false;\n}\nfunction isElement(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"E\" && xmlData[i + 3] === \"L\" && xmlData[i + 4] === \"E\" && xmlData[i + 5] === \"M\" && xmlData[i + 6] === \"E\" && xmlData[i + 7] === \"N\" && xmlData[i + 8] === \"T\") return true;\n  return false;\n}\nfunction isAttlist(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"A\" && xmlData[i + 3] === \"T\" && xmlData[i + 4] === \"T\" && xmlData[i + 5] === \"L\" && xmlData[i + 6] === \"I\" && xmlData[i + 7] === \"S\" && xmlData[i + 8] === \"T\") return true;\n  return false;\n}\nfunction isNotation(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"N\" && xmlData[i + 3] === \"O\" && xmlData[i + 4] === \"T\" && xmlData[i + 5] === \"A\" && xmlData[i + 6] === \"T\" && xmlData[i + 7] === \"I\" && xmlData[i + 8] === \"O\" && xmlData[i + 9] === \"N\") return true;\n  return false;\n}\nfunction validateEntityName(name) {\n  if (util$1.isName(name))\n    return name;\n  else\n    throw new Error(`Invalid entity name ${name}`);\n}\nvar DocTypeReader = readDocType$1;\nconst hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;\nconst numRegex = /^([\\-\\+])?(0*)(\\.[0-9]+([eE]\\-?[0-9]+)?|[0-9]+(\\.[0-9]+([eE]\\-?[0-9]+)?)?)$/;\nif (!Number.parseInt && window.parseInt) {\n  Number.parseInt = window.parseInt;\n}\nif (!Number.parseFloat && window.parseFloat) {\n  Number.parseFloat = window.parseFloat;\n}\nconst consider = {\n  hex: true,\n  leadingZeros: true,\n  decimalPoint: \".\",\n  eNotation: true\n  //skipLike: /regex/\n};\nfunction toNumber$1(str, options = {}) {\n  options = Object.assign({}, consider, options);\n  if (!str || typeof str !== \"string\") return str;\n  let trimmedStr = str.trim();\n  if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str;\n  else if (options.hex && hexRegex.test(trimmedStr)) {\n    return Number.parseInt(trimmedStr, 16);\n  } else {\n    const match = numRegex.exec(trimmedStr);\n    if (match) {\n      const sign = match[1];\n      const leadingZeros = match[2];\n      let numTrimmedByZeros = trimZeros(match[3]);\n      const eNotation = match[4] || match[6];\n      if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== \".\") return str;\n      else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== \".\") return str;\n      else {\n        const num = Number(trimmedStr);\n        const numStr = \"\" + num;\n        if (numStr.search(/[eE]/) !== -1) {\n          if (options.eNotation) return num;\n          else return str;\n        } else if (eNotation) {\n          if (options.eNotation) return num;\n          else return str;\n        } else if (trimmedStr.indexOf(\".\") !== -1) {\n          if (numStr === \"0\" && numTrimmedByZeros === \"\") return num;\n          else if (numStr === numTrimmedByZeros) return num;\n          else if (sign && numStr === \"-\" + numTrimmedByZeros) return num;\n          else return str;\n        }\n        if (leadingZeros) {\n          if (numTrimmedByZeros === numStr) return num;\n          else if (sign + numTrimmedByZeros === numStr) return num;\n          else return str;\n        }\n        if (trimmedStr === numStr) return num;\n        else if (trimmedStr === sign + numStr) return num;\n        return str;\n      }\n    } else {\n      return str;\n    }\n  }\n}\nfunction trimZeros(numStr) {\n  if (numStr && numStr.indexOf(\".\") !== -1) {\n    numStr = numStr.replace(/0+$/, \"\");\n    if (numStr === \".\") numStr = \"0\";\n    else if (numStr[0] === \".\") numStr = \"0\" + numStr;\n    else if (numStr[numStr.length - 1] === \".\") numStr = numStr.substr(0, numStr.length - 1);\n    return numStr;\n  }\n  return numStr;\n}\nvar strnum = toNumber$1;\nconst util = util$3;\nconst xmlNode = xmlNode$1;\nconst readDocType = DocTypeReader;\nconst toNumber = strnum;\nlet OrderedObjParser$1 = class OrderedObjParser {\n  constructor(options) {\n    this.options = options;\n    this.currentNode = null;\n    this.tagsNodeStack = [];\n    this.docTypeEntities = {};\n    this.lastEntities = {\n      \"apos\": { regex: /&(apos|#39|#x27);/g, val: \"'\" },\n      \"gt\": { regex: /&(gt|#62|#x3E);/g, val: \">\" },\n      \"lt\": { regex: /&(lt|#60|#x3C);/g, val: \"<\" },\n      \"quot\": { regex: /&(quot|#34|#x22);/g, val: '\"' }\n    };\n    this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: \"&\" };\n    this.htmlEntities = {\n      \"space\": { regex: /&(nbsp|#160);/g, val: \" \" },\n      // \"lt\" : { regex: /&(lt|#60);/g, val: \"<\" },\n      // \"gt\" : { regex: /&(gt|#62);/g, val: \">\" },\n      // \"amp\" : { regex: /&(amp|#38);/g, val: \"&\" },\n      // \"quot\" : { regex: /&(quot|#34);/g, val: \"\\\"\" },\n      // \"apos\" : { regex: /&(apos|#39);/g, val: \"'\" },\n      \"cent\": { regex: /&(cent|#162);/g, val: \"¢\" },\n      \"pound\": { regex: /&(pound|#163);/g, val: \"£\" },\n      \"yen\": { regex: /&(yen|#165);/g, val: \"¥\" },\n      \"euro\": { regex: /&(euro|#8364);/g, val: \"€\" },\n      \"copyright\": { regex: /&(copy|#169);/g, val: \"©\" },\n      \"reg\": { regex: /&(reg|#174);/g, val: \"®\" },\n      \"inr\": { regex: /&(inr|#8377);/g, val: \"₹\" },\n      \"num_dec\": { regex: /&#([0-9]{1,7});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 10)) },\n      \"num_hex\": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 16)) }\n    };\n    this.addExternalEntities = addExternalEntities;\n    this.parseXml = parseXml;\n    this.parseTextData = parseTextData;\n    this.resolveNameSpace = resolveNameSpace;\n    this.buildAttributesMap = buildAttributesMap;\n    this.isItStopNode = isItStopNode;\n    this.replaceEntitiesValue = replaceEntitiesValue$1;\n    this.readStopNodeData = readStopNodeData;\n    this.saveTextToParentTag = saveTextToParentTag;\n    this.addChild = addChild;\n  }\n};\nfunction addExternalEntities(externalEntities) {\n  const entKeys = Object.keys(externalEntities);\n  for (let i = 0; i < entKeys.length; i++) {\n    const ent = entKeys[i];\n    this.lastEntities[ent] = {\n      regex: new RegExp(\"&\" + ent + \";\", \"g\"),\n      val: externalEntities[ent]\n    };\n  }\n}\nfunction parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {\n  if (val2 !== void 0) {\n    if (this.options.trimValues && !dontTrim) {\n      val2 = val2.trim();\n    }\n    if (val2.length > 0) {\n      if (!escapeEntities) val2 = this.replaceEntitiesValue(val2);\n      const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode);\n      if (newval === null || newval === void 0) {\n        return val2;\n      } else if (typeof newval !== typeof val2 || newval !== val2) {\n        return newval;\n      } else if (this.options.trimValues) {\n        return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions);\n      } else {\n        const trimmedVal = val2.trim();\n        if (trimmedVal === val2) {\n          return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions);\n        } else {\n          return val2;\n        }\n      }\n    }\n  }\n}\nfunction resolveNameSpace(tagname) {\n  if (this.options.removeNSPrefix) {\n    const tags = tagname.split(\":\");\n    const prefix = tagname.charAt(0) === \"/\" ? \"/\" : \"\";\n    if (tags[0] === \"xmlns\") {\n      return \"\";\n    }\n    if (tags.length === 2) {\n      tagname = prefix + tags[1];\n    }\n  }\n  return tagname;\n}\nconst attrsRegx = new RegExp(`([^\\\\s=]+)\\\\s*(=\\\\s*(['\"])([\\\\s\\\\S]*?)\\\\3)?`, \"gm\");\nfunction buildAttributesMap(attrStr, jPath, tagName) {\n  if (!this.options.ignoreAttributes && typeof attrStr === \"string\") {\n    const matches = util.getAllMatches(attrStr, attrsRegx);\n    const len = matches.length;\n    const attrs = {};\n    for (let i = 0; i < len; i++) {\n      const attrName = this.resolveNameSpace(matches[i][1]);\n      let oldVal = matches[i][4];\n      let aName = this.options.attributeNamePrefix + attrName;\n      if (attrName.length) {\n        if (this.options.transformAttributeName) {\n          aName = this.options.transformAttributeName(aName);\n        }\n        if (aName === \"__proto__\") aName = \"#__proto__\";\n        if (oldVal !== void 0) {\n          if (this.options.trimValues) {\n            oldVal = oldVal.trim();\n          }\n          oldVal = this.replaceEntitiesValue(oldVal);\n          const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);\n          if (newVal === null || newVal === void 0) {\n            attrs[aName] = oldVal;\n          } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {\n            attrs[aName] = newVal;\n          } else {\n            attrs[aName] = parseValue(\n              oldVal,\n              this.options.parseAttributeValue,\n              this.options.numberParseOptions\n            );\n          }\n        } else if (this.options.allowBooleanAttributes) {\n          attrs[aName] = true;\n        }\n      }\n    }\n    if (!Object.keys(attrs).length) {\n      return;\n    }\n    if (this.options.attributesGroupName) {\n      const attrCollection = {};\n      attrCollection[this.options.attributesGroupName] = attrs;\n      return attrCollection;\n    }\n    return attrs;\n  }\n}\nconst parseXml = function(xmlData) {\n  xmlData = xmlData.replace(/\\r\\n?/g, \"\\n\");\n  const xmlObj = new xmlNode(\"!xml\");\n  let currentNode = xmlObj;\n  let textData = \"\";\n  let jPath = \"\";\n  for (let i = 0; i < xmlData.length; i++) {\n    const ch = xmlData[i];\n    if (ch === \"<\") {\n      if (xmlData[i + 1] === \"/\") {\n        const closeIndex = findClosingIndex(xmlData, \">\", i, \"Closing Tag is not closed.\");\n        let tagName = xmlData.substring(i + 2, closeIndex).trim();\n        if (this.options.removeNSPrefix) {\n          const colonIndex = tagName.indexOf(\":\");\n          if (colonIndex !== -1) {\n            tagName = tagName.substr(colonIndex + 1);\n          }\n        }\n        if (this.options.transformTagName) {\n          tagName = this.options.transformTagName(tagName);\n        }\n        if (currentNode) {\n          textData = this.saveTextToParentTag(textData, currentNode, jPath);\n        }\n        const lastTagName = jPath.substring(jPath.lastIndexOf(\".\") + 1);\n        if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) {\n          throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);\n        }\n        let propIndex = 0;\n        if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) {\n          propIndex = jPath.lastIndexOf(\".\", jPath.lastIndexOf(\".\") - 1);\n          this.tagsNodeStack.pop();\n        } else {\n          propIndex = jPath.lastIndexOf(\".\");\n        }\n        jPath = jPath.substring(0, propIndex);\n        currentNode = this.tagsNodeStack.pop();\n        textData = \"\";\n        i = closeIndex;\n      } else if (xmlData[i + 1] === \"?\") {\n        let tagData = readTagExp(xmlData, i, false, \"?>\");\n        if (!tagData) throw new Error(\"Pi Tag is not closed.\");\n        textData = this.saveTextToParentTag(textData, currentNode, jPath);\n        if (this.options.ignoreDeclaration && tagData.tagName === \"?xml\" || this.options.ignorePiTags) ;\n        else {\n          const childNode = new xmlNode(tagData.tagName);\n          childNode.add(this.options.textNodeName, \"\");\n          if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) {\n            childNode[\":@\"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);\n          }\n          this.addChild(currentNode, childNode, jPath);\n        }\n        i = tagData.closeIndex + 1;\n      } else if (xmlData.substr(i + 1, 3) === \"!--\") {\n        const endIndex = findClosingIndex(xmlData, \"-->\", i + 4, \"Comment is not closed.\");\n        if (this.options.commentPropName) {\n          const comment = xmlData.substring(i + 4, endIndex - 2);\n          textData = this.saveTextToParentTag(textData, currentNode, jPath);\n          currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);\n        }\n        i = endIndex;\n      } else if (xmlData.substr(i + 1, 2) === \"!D\") {\n        const result = readDocType(xmlData, i);\n        this.docTypeEntities = result.entities;\n        i = result.i;\n      } else if (xmlData.substr(i + 1, 2) === \"![\") {\n        const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"CDATA is not closed.\") - 2;\n        const tagExp = xmlData.substring(i + 9, closeIndex);\n        textData = this.saveTextToParentTag(textData, currentNode, jPath);\n        let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);\n        if (val2 == void 0) val2 = \"\";\n        if (this.options.cdataPropName) {\n          currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]);\n        } else {\n          currentNode.add(this.options.textNodeName, val2);\n        }\n        i = closeIndex + 2;\n      } else {\n        let result = readTagExp(xmlData, i, this.options.removeNSPrefix);\n        let tagName = result.tagName;\n        const rawTagName = result.rawTagName;\n        let tagExp = result.tagExp;\n        let attrExpPresent = result.attrExpPresent;\n        let closeIndex = result.closeIndex;\n        if (this.options.transformTagName) {\n          tagName = this.options.transformTagName(tagName);\n        }\n        if (currentNode && textData) {\n          if (currentNode.tagname !== \"!xml\") {\n            textData = this.saveTextToParentTag(textData, currentNode, jPath, false);\n          }\n        }\n        const lastTag = currentNode;\n        if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) {\n          currentNode = this.tagsNodeStack.pop();\n          jPath = jPath.substring(0, jPath.lastIndexOf(\".\"));\n        }\n        if (tagName !== xmlObj.tagname) {\n          jPath += jPath ? \".\" + tagName : tagName;\n        }\n        if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) {\n          let tagContent = \"\";\n          if (tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1) {\n            if (tagName[tagName.length - 1] === \"/\") {\n              tagName = tagName.substr(0, tagName.length - 1);\n              jPath = jPath.substr(0, jPath.length - 1);\n              tagExp = tagName;\n            } else {\n              tagExp = tagExp.substr(0, tagExp.length - 1);\n            }\n            i = result.closeIndex;\n          } else if (this.options.unpairedTags.indexOf(tagName) !== -1) {\n            i = result.closeIndex;\n          } else {\n            const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);\n            if (!result2) throw new Error(`Unexpected end of ${rawTagName}`);\n            i = result2.i;\n            tagContent = result2.tagContent;\n          }\n          const childNode = new xmlNode(tagName);\n          if (tagName !== tagExp && attrExpPresent) {\n            childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n          }\n          if (tagContent) {\n            tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);\n          }\n          jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n          childNode.add(this.options.textNodeName, tagContent);\n          this.addChild(currentNode, childNode, jPath);\n        } else {\n          if (tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1) {\n            if (tagName[tagName.length - 1] === \"/\") {\n              tagName = tagName.substr(0, tagName.length - 1);\n              jPath = jPath.substr(0, jPath.length - 1);\n              tagExp = tagName;\n            } else {\n              tagExp = tagExp.substr(0, tagExp.length - 1);\n            }\n            if (this.options.transformTagName) {\n              tagName = this.options.transformTagName(tagName);\n            }\n            const childNode = new xmlNode(tagName);\n            if (tagName !== tagExp && attrExpPresent) {\n              childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n            }\n            this.addChild(currentNode, childNode, jPath);\n            jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n          } else {\n            const childNode = new xmlNode(tagName);\n            this.tagsNodeStack.push(currentNode);\n            if (tagName !== tagExp && attrExpPresent) {\n              childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n            }\n            this.addChild(currentNode, childNode, jPath);\n            currentNode = childNode;\n          }\n          textData = \"\";\n          i = closeIndex;\n        }\n      }\n    } else {\n      textData += xmlData[i];\n    }\n  }\n  return xmlObj.child;\n};\nfunction addChild(currentNode, childNode, jPath) {\n  const result = this.options.updateTag(childNode.tagname, jPath, childNode[\":@\"]);\n  if (result === false) ;\n  else if (typeof result === \"string\") {\n    childNode.tagname = result;\n    currentNode.addChild(childNode);\n  } else {\n    currentNode.addChild(childNode);\n  }\n}\nconst replaceEntitiesValue$1 = function(val2) {\n  if (this.options.processEntities) {\n    for (let entityName2 in this.docTypeEntities) {\n      const entity = this.docTypeEntities[entityName2];\n      val2 = val2.replace(entity.regx, entity.val);\n    }\n    for (let entityName2 in this.lastEntities) {\n      const entity = this.lastEntities[entityName2];\n      val2 = val2.replace(entity.regex, entity.val);\n    }\n    if (this.options.htmlEntities) {\n      for (let entityName2 in this.htmlEntities) {\n        const entity = this.htmlEntities[entityName2];\n        val2 = val2.replace(entity.regex, entity.val);\n      }\n    }\n    val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val);\n  }\n  return val2;\n};\nfunction saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {\n  if (textData) {\n    if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0;\n    textData = this.parseTextData(\n      textData,\n      currentNode.tagname,\n      jPath,\n      false,\n      currentNode[\":@\"] ? Object.keys(currentNode[\":@\"]).length !== 0 : false,\n      isLeafNode\n    );\n    if (textData !== void 0 && textData !== \"\")\n      currentNode.add(this.options.textNodeName, textData);\n    textData = \"\";\n  }\n  return textData;\n}\nfunction isItStopNode(stopNodes, jPath, currentTagName) {\n  const allNodesExp = \"*.\" + currentTagName;\n  for (const stopNodePath in stopNodes) {\n    const stopNodeExp = stopNodes[stopNodePath];\n    if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true;\n  }\n  return false;\n}\nfunction tagExpWithClosingIndex(xmlData, i, closingChar = \">\") {\n  let attrBoundary;\n  let tagExp = \"\";\n  for (let index = i; index < xmlData.length; index++) {\n    let ch = xmlData[index];\n    if (attrBoundary) {\n      if (ch === attrBoundary) attrBoundary = \"\";\n    } else if (ch === '\"' || ch === \"'\") {\n      attrBoundary = ch;\n    } else if (ch === closingChar[0]) {\n      if (closingChar[1]) {\n        if (xmlData[index + 1] === closingChar[1]) {\n          return {\n            data: tagExp,\n            index\n          };\n        }\n      } else {\n        return {\n          data: tagExp,\n          index\n        };\n      }\n    } else if (ch === \"\t\") {\n      ch = \" \";\n    }\n    tagExp += ch;\n  }\n}\nfunction findClosingIndex(xmlData, str, i, errMsg) {\n  const closingIndex = xmlData.indexOf(str, i);\n  if (closingIndex === -1) {\n    throw new Error(errMsg);\n  } else {\n    return closingIndex + str.length - 1;\n  }\n}\nfunction readTagExp(xmlData, i, removeNSPrefix, closingChar = \">\") {\n  const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);\n  if (!result) return;\n  let tagExp = result.data;\n  const closeIndex = result.index;\n  const separatorIndex = tagExp.search(/\\s/);\n  let tagName = tagExp;\n  let attrExpPresent = true;\n  if (separatorIndex !== -1) {\n    tagName = tagExp.substring(0, separatorIndex);\n    tagExp = tagExp.substring(separatorIndex + 1).trimStart();\n  }\n  const rawTagName = tagName;\n  if (removeNSPrefix) {\n    const colonIndex = tagName.indexOf(\":\");\n    if (colonIndex !== -1) {\n      tagName = tagName.substr(colonIndex + 1);\n      attrExpPresent = tagName !== result.data.substr(colonIndex + 1);\n    }\n  }\n  return {\n    tagName,\n    tagExp,\n    closeIndex,\n    attrExpPresent,\n    rawTagName\n  };\n}\nfunction readStopNodeData(xmlData, tagName, i) {\n  const startIndex = i;\n  let openTagCount = 1;\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] === \"<\") {\n      if (xmlData[i + 1] === \"/\") {\n        const closeIndex = findClosingIndex(xmlData, \">\", i, `${tagName} is not closed`);\n        let closeTagName = xmlData.substring(i + 2, closeIndex).trim();\n        if (closeTagName === tagName) {\n          openTagCount--;\n          if (openTagCount === 0) {\n            return {\n              tagContent: xmlData.substring(startIndex, i),\n              i: closeIndex\n            };\n          }\n        }\n        i = closeIndex;\n      } else if (xmlData[i + 1] === \"?\") {\n        const closeIndex = findClosingIndex(xmlData, \"?>\", i + 1, \"StopNode is not closed.\");\n        i = closeIndex;\n      } else if (xmlData.substr(i + 1, 3) === \"!--\") {\n        const closeIndex = findClosingIndex(xmlData, \"-->\", i + 3, \"StopNode is not closed.\");\n        i = closeIndex;\n      } else if (xmlData.substr(i + 1, 2) === \"![\") {\n        const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"StopNode is not closed.\") - 2;\n        i = closeIndex;\n      } else {\n        const tagData = readTagExp(xmlData, i, \">\");\n        if (tagData) {\n          const openTagName = tagData && tagData.tagName;\n          if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== \"/\") {\n            openTagCount++;\n          }\n          i = tagData.closeIndex;\n        }\n      }\n    }\n  }\n}\nfunction parseValue(val2, shouldParse, options) {\n  if (shouldParse && typeof val2 === \"string\") {\n    const newval = val2.trim();\n    if (newval === \"true\") return true;\n    else if (newval === \"false\") return false;\n    else return toNumber(val2, options);\n  } else {\n    if (util.isExist(val2)) {\n      return val2;\n    } else {\n      return \"\";\n    }\n  }\n}\nvar OrderedObjParser_1 = OrderedObjParser$1;\nvar node2json = {};\nfunction prettify$1(node, options) {\n  return compress(node, options);\n}\nfunction compress(arr, options, jPath) {\n  let text;\n  const compressedObj = {};\n  for (let i = 0; i < arr.length; i++) {\n    const tagObj = arr[i];\n    const property = propName$1(tagObj);\n    let newJpath = \"\";\n    if (jPath === void 0) newJpath = property;\n    else newJpath = jPath + \".\" + property;\n    if (property === options.textNodeName) {\n      if (text === void 0) text = tagObj[property];\n      else text += \"\" + tagObj[property];\n    } else if (property === void 0) {\n      continue;\n    } else if (tagObj[property]) {\n      let val2 = compress(tagObj[property], options, newJpath);\n      const isLeaf = isLeafTag(val2, options);\n      if (tagObj[\":@\"]) {\n        assignAttributes(val2, tagObj[\":@\"], newJpath, options);\n      } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) {\n        val2 = val2[options.textNodeName];\n      } else if (Object.keys(val2).length === 0) {\n        if (options.alwaysCreateTextNode) val2[options.textNodeName] = \"\";\n        else val2 = \"\";\n      }\n      if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) {\n        if (!Array.isArray(compressedObj[property])) {\n          compressedObj[property] = [compressedObj[property]];\n        }\n        compressedObj[property].push(val2);\n      } else {\n        if (options.isArray(property, newJpath, isLeaf)) {\n          compressedObj[property] = [val2];\n        } else {\n          compressedObj[property] = val2;\n        }\n      }\n    }\n  }\n  if (typeof text === \"string\") {\n    if (text.length > 0) compressedObj[options.textNodeName] = text;\n  } else if (text !== void 0) compressedObj[options.textNodeName] = text;\n  return compressedObj;\n}\nfunction propName$1(obj) {\n  const keys = Object.keys(obj);\n  for (let i = 0; i < keys.length; i++) {\n    const key = keys[i];\n    if (key !== \":@\") return key;\n  }\n}\nfunction assignAttributes(obj, attrMap, jpath, options) {\n  if (attrMap) {\n    const keys = Object.keys(attrMap);\n    const len = keys.length;\n    for (let i = 0; i < len; i++) {\n      const atrrName = keys[i];\n      if (options.isArray(atrrName, jpath + \".\" + atrrName, true, true)) {\n        obj[atrrName] = [attrMap[atrrName]];\n      } else {\n        obj[atrrName] = attrMap[atrrName];\n      }\n    }\n  }\n}\nfunction isLeafTag(obj, options) {\n  const { textNodeName } = options;\n  const propCount = Object.keys(obj).length;\n  if (propCount === 0) {\n    return true;\n  }\n  if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === \"boolean\" || obj[textNodeName] === 0)) {\n    return true;\n  }\n  return false;\n}\nnode2json.prettify = prettify$1;\nconst { buildOptions } = OptionsBuilder;\nconst OrderedObjParser2 = OrderedObjParser_1;\nconst { prettify } = node2json;\nconst validator$1 = validator$2;\nlet XMLParser$1 = class XMLParser {\n  constructor(options) {\n    this.externalEntities = {};\n    this.options = buildOptions(options);\n  }\n  /**\n   * Parse XML dats to JS object \n   * @param {string|Buffer} xmlData \n   * @param {boolean|Object} validationOption \n   */\n  parse(xmlData, validationOption) {\n    if (typeof xmlData === \"string\") ;\n    else if (xmlData.toString) {\n      xmlData = xmlData.toString();\n    } else {\n      throw new Error(\"XML data is accepted in String or Bytes[] form.\");\n    }\n    if (validationOption) {\n      if (validationOption === true) validationOption = {};\n      const result = validator$1.validate(xmlData, validationOption);\n      if (result !== true) {\n        throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);\n      }\n    }\n    const orderedObjParser = new OrderedObjParser2(this.options);\n    orderedObjParser.addExternalEntities(this.externalEntities);\n    const orderedResult = orderedObjParser.parseXml(xmlData);\n    if (this.options.preserveOrder || orderedResult === void 0) return orderedResult;\n    else return prettify(orderedResult, this.options);\n  }\n  /**\n   * Add Entity which is not by default supported by this library\n   * @param {string} key \n   * @param {string} value \n   */\n  addEntity(key, value) {\n    if (value.indexOf(\"&\") !== -1) {\n      throw new Error(\"Entity value can't have '&'\");\n    } else if (key.indexOf(\"&\") !== -1 || key.indexOf(\";\") !== -1) {\n      throw new Error(\"An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'\");\n    } else if (value === \"&\") {\n      throw new Error(\"An entity with value '&' is not permitted\");\n    } else {\n      this.externalEntities[key] = value;\n    }\n  }\n};\nvar XMLParser_1 = XMLParser$1;\nconst EOL = \"\\n\";\nfunction toXml(jArray, options) {\n  let indentation = \"\";\n  if (options.format && options.indentBy.length > 0) {\n    indentation = EOL;\n  }\n  return arrToStr(jArray, options, \"\", indentation);\n}\nfunction arrToStr(arr, options, jPath, indentation) {\n  let xmlStr = \"\";\n  let isPreviousElementTag = false;\n  for (let i = 0; i < arr.length; i++) {\n    const tagObj = arr[i];\n    const tagName = propName(tagObj);\n    if (tagName === void 0) continue;\n    let newJPath = \"\";\n    if (jPath.length === 0) newJPath = tagName;\n    else newJPath = `${jPath}.${tagName}`;\n    if (tagName === options.textNodeName) {\n      let tagText = tagObj[tagName];\n      if (!isStopNode(newJPath, options)) {\n        tagText = options.tagValueProcessor(tagName, tagText);\n        tagText = replaceEntitiesValue(tagText, options);\n      }\n      if (isPreviousElementTag) {\n        xmlStr += indentation;\n      }\n      xmlStr += tagText;\n      isPreviousElementTag = false;\n      continue;\n    } else if (tagName === options.cdataPropName) {\n      if (isPreviousElementTag) {\n        xmlStr += indentation;\n      }\n      xmlStr += `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;\n      isPreviousElementTag = false;\n      continue;\n    } else if (tagName === options.commentPropName) {\n      xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;\n      isPreviousElementTag = true;\n      continue;\n    } else if (tagName[0] === \"?\") {\n      const attStr2 = attr_to_str(tagObj[\":@\"], options);\n      const tempInd = tagName === \"?xml\" ? \"\" : indentation;\n      let piTextNodeName = tagObj[tagName][0][options.textNodeName];\n      piTextNodeName = piTextNodeName.length !== 0 ? \" \" + piTextNodeName : \"\";\n      xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`;\n      isPreviousElementTag = true;\n      continue;\n    }\n    let newIdentation = indentation;\n    if (newIdentation !== \"\") {\n      newIdentation += options.indentBy;\n    }\n    const attStr = attr_to_str(tagObj[\":@\"], options);\n    const tagStart = indentation + `<${tagName}${attStr}`;\n    const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation);\n    if (options.unpairedTags.indexOf(tagName) !== -1) {\n      if (options.suppressUnpairedNode) xmlStr += tagStart + \">\";\n      else xmlStr += tagStart + \"/>\";\n    } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) {\n      xmlStr += tagStart + \"/>\";\n    } else if (tagValue && tagValue.endsWith(\">\")) {\n      xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>`;\n    } else {\n      xmlStr += tagStart + \">\";\n      if (tagValue && indentation !== \"\" && (tagValue.includes(\"/>\") || tagValue.includes(\"</\"))) {\n        xmlStr += indentation + options.indentBy + tagValue + indentation;\n      } else {\n        xmlStr += tagValue;\n      }\n      xmlStr += `</${tagName}>`;\n    }\n    isPreviousElementTag = true;\n  }\n  return xmlStr;\n}\nfunction propName(obj) {\n  const keys = Object.keys(obj);\n  for (let i = 0; i < keys.length; i++) {\n    const key = keys[i];\n    if (!obj.hasOwnProperty(key)) continue;\n    if (key !== \":@\") return key;\n  }\n}\nfunction attr_to_str(attrMap, options) {\n  let attrStr = \"\";\n  if (attrMap && !options.ignoreAttributes) {\n    for (let attr in attrMap) {\n      if (!attrMap.hasOwnProperty(attr)) continue;\n      let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);\n      attrVal = replaceEntitiesValue(attrVal, options);\n      if (attrVal === true && options.suppressBooleanAttributes) {\n        attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;\n      } else {\n        attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}=\"${attrVal}\"`;\n      }\n    }\n  }\n  return attrStr;\n}\nfunction isStopNode(jPath, options) {\n  jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1);\n  let tagName = jPath.substr(jPath.lastIndexOf(\".\") + 1);\n  for (let index in options.stopNodes) {\n    if (options.stopNodes[index] === jPath || options.stopNodes[index] === \"*.\" + tagName) return true;\n  }\n  return false;\n}\nfunction replaceEntitiesValue(textValue, options) {\n  if (textValue && textValue.length > 0 && options.processEntities) {\n    for (let i = 0; i < options.entities.length; i++) {\n      const entity = options.entities[i];\n      textValue = textValue.replace(entity.regex, entity.val);\n    }\n  }\n  return textValue;\n}\nvar orderedJs2Xml = toXml;\nconst buildFromOrderedJs = orderedJs2Xml;\nconst defaultOptions = {\n  attributeNamePrefix: \"@_\",\n  attributesGroupName: false,\n  textNodeName: \"#text\",\n  ignoreAttributes: true,\n  cdataPropName: false,\n  format: false,\n  indentBy: \"  \",\n  suppressEmptyNode: false,\n  suppressUnpairedNode: true,\n  suppressBooleanAttributes: true,\n  tagValueProcessor: function(key, a) {\n    return a;\n  },\n  attributeValueProcessor: function(attrName, a) {\n    return a;\n  },\n  preserveOrder: false,\n  commentPropName: false,\n  unpairedTags: [],\n  entities: [\n    { regex: new RegExp(\"&\", \"g\"), val: \"&amp;\" },\n    //it must be on top\n    { regex: new RegExp(\">\", \"g\"), val: \"&gt;\" },\n    { regex: new RegExp(\"<\", \"g\"), val: \"&lt;\" },\n    { regex: new RegExp(\"'\", \"g\"), val: \"&apos;\" },\n    { regex: new RegExp('\"', \"g\"), val: \"&quot;\" }\n  ],\n  processEntities: true,\n  stopNodes: [],\n  // transformTagName: false,\n  // transformAttributeName: false,\n  oneListGroup: false\n};\nfunction Builder(options) {\n  this.options = Object.assign({}, defaultOptions, options);\n  if (this.options.ignoreAttributes || this.options.attributesGroupName) {\n    this.isAttribute = function() {\n      return false;\n    };\n  } else {\n    this.attrPrefixLen = this.options.attributeNamePrefix.length;\n    this.isAttribute = isAttribute;\n  }\n  this.processTextOrObjNode = processTextOrObjNode;\n  if (this.options.format) {\n    this.indentate = indentate;\n    this.tagEndChar = \">\\n\";\n    this.newLine = \"\\n\";\n  } else {\n    this.indentate = function() {\n      return \"\";\n    };\n    this.tagEndChar = \">\";\n    this.newLine = \"\";\n  }\n}\nBuilder.prototype.build = function(jObj) {\n  if (this.options.preserveOrder) {\n    return buildFromOrderedJs(jObj, this.options);\n  } else {\n    if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {\n      jObj = {\n        [this.options.arrayNodeName]: jObj\n      };\n    }\n    return this.j2x(jObj, 0).val;\n  }\n};\nBuilder.prototype.j2x = function(jObj, level) {\n  let attrStr = \"\";\n  let val2 = \"\";\n  for (let key in jObj) {\n    if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue;\n    if (typeof jObj[key] === \"undefined\") {\n      if (this.isAttribute(key)) {\n        val2 += \"\";\n      }\n    } else if (jObj[key] === null) {\n      if (this.isAttribute(key)) {\n        val2 += \"\";\n      } else if (key[0] === \"?\") {\n        val2 += this.indentate(level) + \"<\" + key + \"?\" + this.tagEndChar;\n      } else {\n        val2 += this.indentate(level) + \"<\" + key + \"/\" + this.tagEndChar;\n      }\n    } else if (jObj[key] instanceof Date) {\n      val2 += this.buildTextValNode(jObj[key], key, \"\", level);\n    } else if (typeof jObj[key] !== \"object\") {\n      const attr = this.isAttribute(key);\n      if (attr) {\n        attrStr += this.buildAttrPairStr(attr, \"\" + jObj[key]);\n      } else {\n        if (key === this.options.textNodeName) {\n          let newval = this.options.tagValueProcessor(key, \"\" + jObj[key]);\n          val2 += this.replaceEntitiesValue(newval);\n        } else {\n          val2 += this.buildTextValNode(jObj[key], key, \"\", level);\n        }\n      }\n    } else if (Array.isArray(jObj[key])) {\n      const arrLen = jObj[key].length;\n      let listTagVal = \"\";\n      for (let j = 0; j < arrLen; j++) {\n        const item = jObj[key][j];\n        if (typeof item === \"undefined\") ;\n        else if (item === null) {\n          if (key[0] === \"?\") val2 += this.indentate(level) + \"<\" + key + \"?\" + this.tagEndChar;\n          else val2 += this.indentate(level) + \"<\" + key + \"/\" + this.tagEndChar;\n        } else if (typeof item === \"object\") {\n          if (this.options.oneListGroup) {\n            listTagVal += this.j2x(item, level + 1).val;\n          } else {\n            listTagVal += this.processTextOrObjNode(item, key, level);\n          }\n        } else {\n          listTagVal += this.buildTextValNode(item, key, \"\", level);\n        }\n      }\n      if (this.options.oneListGroup) {\n        listTagVal = this.buildObjectNode(listTagVal, key, \"\", level);\n      }\n      val2 += listTagVal;\n    } else {\n      if (this.options.attributesGroupName && key === this.options.attributesGroupName) {\n        const Ks = Object.keys(jObj[key]);\n        const L = Ks.length;\n        for (let j = 0; j < L; j++) {\n          attrStr += this.buildAttrPairStr(Ks[j], \"\" + jObj[key][Ks[j]]);\n        }\n      } else {\n        val2 += this.processTextOrObjNode(jObj[key], key, level);\n      }\n    }\n  }\n  return { attrStr, val: val2 };\n};\nBuilder.prototype.buildAttrPairStr = function(attrName, val2) {\n  val2 = this.options.attributeValueProcessor(attrName, \"\" + val2);\n  val2 = this.replaceEntitiesValue(val2);\n  if (this.options.suppressBooleanAttributes && val2 === \"true\") {\n    return \" \" + attrName;\n  } else return \" \" + attrName + '=\"' + val2 + '\"';\n};\nfunction processTextOrObjNode(object, key, level) {\n  const result = this.j2x(object, level + 1);\n  if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) {\n    return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);\n  } else {\n    return this.buildObjectNode(result.val, key, result.attrStr, level);\n  }\n}\nBuilder.prototype.buildObjectNode = function(val2, key, attrStr, level) {\n  if (val2 === \"\") {\n    if (key[0] === \"?\") return this.indentate(level) + \"<\" + key + attrStr + \"?\" + this.tagEndChar;\n    else {\n      return this.indentate(level) + \"<\" + key + attrStr + this.closeTag(key) + this.tagEndChar;\n    }\n  } else {\n    let tagEndExp = \"</\" + key + this.tagEndChar;\n    let piClosingChar = \"\";\n    if (key[0] === \"?\") {\n      piClosingChar = \"?\";\n      tagEndExp = \"\";\n    }\n    if ((attrStr || attrStr === \"\") && val2.indexOf(\"<\") === -1) {\n      return this.indentate(level) + \"<\" + key + attrStr + piClosingChar + \">\" + val2 + tagEndExp;\n    } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {\n      return this.indentate(level) + `<!--${val2}-->` + this.newLine;\n    } else {\n      return this.indentate(level) + \"<\" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp;\n    }\n  }\n};\nBuilder.prototype.closeTag = function(key) {\n  let closeTag = \"\";\n  if (this.options.unpairedTags.indexOf(key) !== -1) {\n    if (!this.options.suppressUnpairedNode) closeTag = \"/\";\n  } else if (this.options.suppressEmptyNode) {\n    closeTag = \"/\";\n  } else {\n    closeTag = `></${key}`;\n  }\n  return closeTag;\n};\nBuilder.prototype.buildTextValNode = function(val2, key, attrStr, level) {\n  if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {\n    return this.indentate(level) + `<![CDATA[${val2}]]>` + this.newLine;\n  } else if (this.options.commentPropName !== false && key === this.options.commentPropName) {\n    return this.indentate(level) + `<!--${val2}-->` + this.newLine;\n  } else if (key[0] === \"?\") {\n    return this.indentate(level) + \"<\" + key + attrStr + \"?\" + this.tagEndChar;\n  } else {\n    let textValue = this.options.tagValueProcessor(key, val2);\n    textValue = this.replaceEntitiesValue(textValue);\n    if (textValue === \"\") {\n      return this.indentate(level) + \"<\" + key + attrStr + this.closeTag(key) + this.tagEndChar;\n    } else {\n      return this.indentate(level) + \"<\" + key + attrStr + \">\" + textValue + \"</\" + key + this.tagEndChar;\n    }\n  }\n};\nBuilder.prototype.replaceEntitiesValue = function(textValue) {\n  if (textValue && textValue.length > 0 && this.options.processEntities) {\n    for (let i = 0; i < this.options.entities.length; i++) {\n      const entity = this.options.entities[i];\n      textValue = textValue.replace(entity.regex, entity.val);\n    }\n  }\n  return textValue;\n};\nfunction indentate(level) {\n  return this.options.indentBy.repeat(level);\n}\nfunction isAttribute(name) {\n  if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) {\n    return name.substr(this.attrPrefixLen);\n  } else {\n    return false;\n  }\n}\nvar json2xml = Builder;\nconst validator = validator$2;\nconst XMLParser2 = XMLParser_1;\nconst XMLBuilder = json2xml;\nvar fxp = {\n  XMLParser: XMLParser2,\n  XMLValidator: validator,\n  XMLBuilder\n};\nfunction isSvg(string) {\n  if (typeof string !== \"string\") {\n    throw new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n  }\n  string = string.trim();\n  if (string.length === 0) {\n    return false;\n  }\n  if (fxp.XMLValidator.validate(string) !== true) {\n    return false;\n  }\n  let jsonObject;\n  const parser = new fxp.XMLParser();\n  try {\n    jsonObject = parser.parse(string);\n  } catch {\n    return false;\n  }\n  if (!jsonObject) {\n    return false;\n  }\n  if (!Object.keys(jsonObject).some((x) => x.toLowerCase() === \"svg\")) {\n    return false;\n  }\n  return true;\n}\nclass View {\n  _view;\n  constructor(view) {\n    isValidView(view);\n    this._view = view;\n  }\n  get id() {\n    return this._view.id;\n  }\n  get name() {\n    return this._view.name;\n  }\n  get caption() {\n    return this._view.caption;\n  }\n  get emptyTitle() {\n    return this._view.emptyTitle;\n  }\n  get emptyCaption() {\n    return this._view.emptyCaption;\n  }\n  get getContents() {\n    return this._view.getContents;\n  }\n  get icon() {\n    return this._view.icon;\n  }\n  set icon(icon) {\n    this._view.icon = icon;\n  }\n  get order() {\n    return this._view.order;\n  }\n  set order(order) {\n    this._view.order = order;\n  }\n  get params() {\n    return this._view.params;\n  }\n  set params(params) {\n    this._view.params = params;\n  }\n  get columns() {\n    return this._view.columns;\n  }\n  get emptyView() {\n    return this._view.emptyView;\n  }\n  get parent() {\n    return this._view.parent;\n  }\n  get sticky() {\n    return this._view.sticky;\n  }\n  get expanded() {\n    return this._view.expanded;\n  }\n  set expanded(expanded) {\n    this._view.expanded = expanded;\n  }\n  get defaultSortKey() {\n    return this._view.defaultSortKey;\n  }\n}\nconst isValidView = function(view) {\n  if (!view.id || typeof view.id !== \"string\") {\n    throw new Error(\"View id is required and must be a string\");\n  }\n  if (!view.name || typeof view.name !== \"string\") {\n    throw new Error(\"View name is required and must be a string\");\n  }\n  if (view.columns && view.columns.length > 0 && (!view.caption || typeof view.caption !== \"string\")) {\n    throw new Error(\"View caption is required for top-level views and must be a string\");\n  }\n  if (!view.getContents || typeof view.getContents !== \"function\") {\n    throw new Error(\"View getContents is required and must be a function\");\n  }\n  if (!view.icon || typeof view.icon !== \"string\" || !isSvg(view.icon)) {\n    throw new Error(\"View icon is required and must be a valid svg string\");\n  }\n  if (!(\"order\" in view) || typeof view.order !== \"number\") {\n    throw new Error(\"View order is required and must be a number\");\n  }\n  if (view.columns) {\n    view.columns.forEach((column) => {\n      if (!(column instanceof Column)) {\n        throw new Error(\"View columns must be an array of Column. Invalid column found\");\n      }\n    });\n  }\n  if (view.emptyView && typeof view.emptyView !== \"function\") {\n    throw new Error(\"View emptyView must be a function\");\n  }\n  if (view.parent && typeof view.parent !== \"string\") {\n    throw new Error(\"View parent must be a string\");\n  }\n  if (\"sticky\" in view && typeof view.sticky !== \"boolean\") {\n    throw new Error(\"View sticky must be a boolean\");\n  }\n  if (\"expanded\" in view && typeof view.expanded !== \"boolean\") {\n    throw new Error(\"View expanded must be a boolean\");\n  }\n  if (view.defaultSortKey && typeof view.defaultSortKey !== \"string\") {\n    throw new Error(\"View defaultSortKey must be a string\");\n  }\n  return true;\n};\nconst debug$1 = typeof process === \"object\" && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error(\"SEMVER\", ...args) : () => {\n};\nvar debug_1 = debug$1;\nconst SEMVER_SPEC_VERSION = \"2.0.0\";\nconst MAX_LENGTH$1 = 256;\nconst MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */\n9007199254740991;\nconst MAX_SAFE_COMPONENT_LENGTH = 16;\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;\nconst RELEASE_TYPES = [\n  \"major\",\n  \"premajor\",\n  \"minor\",\n  \"preminor\",\n  \"patch\",\n  \"prepatch\",\n  \"prerelease\"\n];\nvar constants = {\n  MAX_LENGTH: MAX_LENGTH$1,\n  MAX_SAFE_COMPONENT_LENGTH,\n  MAX_SAFE_BUILD_LENGTH,\n  MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,\n  RELEASE_TYPES,\n  SEMVER_SPEC_VERSION,\n  FLAG_INCLUDE_PRERELEASE: 1,\n  FLAG_LOOSE: 2\n};\nvar re$1 = { exports: {} };\n(function(module, exports) {\n  const {\n    MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH2,\n    MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH2,\n    MAX_LENGTH: MAX_LENGTH2\n  } = constants;\n  const debug2 = debug_1;\n  exports = module.exports = {};\n  const re2 = exports.re = [];\n  const safeRe = exports.safeRe = [];\n  const src = exports.src = [];\n  const t2 = exports.t = {};\n  let R = 0;\n  const LETTERDASHNUMBER = \"[a-zA-Z0-9-]\";\n  const safeRegexReplacements = [\n    [\"\\\\s\", 1],\n    [\"\\\\d\", MAX_LENGTH2],\n    [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH2]\n  ];\n  const makeSafeRegex = (value) => {\n    for (const [token, max] of safeRegexReplacements) {\n      value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);\n    }\n    return value;\n  };\n  const createToken = (name, value, isGlobal) => {\n    const safe = makeSafeRegex(value);\n    const index = R++;\n    debug2(name, index, value);\n    t2[name] = index;\n    src[index] = value;\n    re2[index] = new RegExp(value, isGlobal ? \"g\" : void 0);\n    safeRe[index] = new RegExp(safe, isGlobal ? \"g\" : void 0);\n  };\n  createToken(\"NUMERICIDENTIFIER\", \"0|[1-9]\\\\d*\");\n  createToken(\"NUMERICIDENTIFIERLOOSE\", \"\\\\d+\");\n  createToken(\"NONNUMERICIDENTIFIER\", `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);\n  createToken(\"MAINVERSION\", `(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})`);\n  createToken(\"MAINVERSIONLOOSE\", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`);\n  createToken(\"PRERELEASEIDENTIFIER\", `(?:${src[t2.NUMERICIDENTIFIER]}|${src[t2.NONNUMERICIDENTIFIER]})`);\n  createToken(\"PRERELEASEIDENTIFIERLOOSE\", `(?:${src[t2.NUMERICIDENTIFIERLOOSE]}|${src[t2.NONNUMERICIDENTIFIER]})`);\n  createToken(\"PRERELEASE\", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIER]})*))`);\n  createToken(\"PRERELEASELOOSE\", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`);\n  createToken(\"BUILDIDENTIFIER\", `${LETTERDASHNUMBER}+`);\n  createToken(\"BUILD\", `(?:\\\\+(${src[t2.BUILDIDENTIFIER]}(?:\\\\.${src[t2.BUILDIDENTIFIER]})*))`);\n  createToken(\"FULLPLAIN\", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`);\n  createToken(\"FULL\", `^${src[t2.FULLPLAIN]}$`);\n  createToken(\"LOOSEPLAIN\", `[v=\\\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`);\n  createToken(\"LOOSE\", `^${src[t2.LOOSEPLAIN]}$`);\n  createToken(\"GTLT\", \"((?:<|>)?=?)\");\n  createToken(\"XRANGEIDENTIFIERLOOSE\", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);\n  createToken(\"XRANGEIDENTIFIER\", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\\\*`);\n  createToken(\"XRANGEPLAIN\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`);\n  createToken(\"XRANGEPLAINLOOSE\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`);\n  createToken(\"XRANGE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAIN]}$`);\n  createToken(\"XRANGELOOSE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAINLOOSE]}$`);\n  createToken(\"COERCEPLAIN\", `${\"(^|[^\\\\d])(\\\\d{1,\"}${MAX_SAFE_COMPONENT_LENGTH2}})(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?`);\n  createToken(\"COERCE\", `${src[t2.COERCEPLAIN]}(?:$|[^\\\\d])`);\n  createToken(\"COERCEFULL\", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\\\d])`);\n  createToken(\"COERCERTL\", src[t2.COERCE], true);\n  createToken(\"COERCERTLFULL\", src[t2.COERCEFULL], true);\n  createToken(\"LONETILDE\", \"(?:~>?)\");\n  createToken(\"TILDETRIM\", `(\\\\s*)${src[t2.LONETILDE]}\\\\s+`, true);\n  exports.tildeTrimReplace = \"$1~\";\n  createToken(\"TILDE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);\n  createToken(\"TILDELOOSE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);\n  createToken(\"LONECARET\", \"(?:\\\\^)\");\n  createToken(\"CARETTRIM\", `(\\\\s*)${src[t2.LONECARET]}\\\\s+`, true);\n  exports.caretTrimReplace = \"$1^\";\n  createToken(\"CARET\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);\n  createToken(\"CARETLOOSE\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);\n  createToken(\"COMPARATORLOOSE\", `^${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]})$|^$`);\n  createToken(\"COMPARATOR\", `^${src[t2.GTLT]}\\\\s*(${src[t2.FULLPLAIN]})$|^$`);\n  createToken(\"COMPARATORTRIM\", `(\\\\s*)${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);\n  exports.comparatorTrimReplace = \"$1$2$3\";\n  createToken(\"HYPHENRANGE\", `^\\\\s*(${src[t2.XRANGEPLAIN]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAIN]})\\\\s*$`);\n  createToken(\"HYPHENRANGELOOSE\", `^\\\\s*(${src[t2.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAINLOOSE]})\\\\s*$`);\n  createToken(\"STAR\", \"(<|>)?=?\\\\s*\\\\*\");\n  createToken(\"GTE0\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$\");\n  createToken(\"GTE0PRE\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$\");\n})(re$1, re$1.exports);\nvar reExports = re$1.exports;\nconst looseOption = Object.freeze({ loose: true });\nconst emptyOpts = Object.freeze({});\nconst parseOptions$1 = (options) => {\n  if (!options) {\n    return emptyOpts;\n  }\n  if (typeof options !== \"object\") {\n    return looseOption;\n  }\n  return options;\n};\nvar parseOptions_1 = parseOptions$1;\nconst numeric = /^[0-9]+$/;\nconst compareIdentifiers$1 = (a, b) => {\n  const anum = numeric.test(a);\n  const bnum = numeric.test(b);\n  if (anum && bnum) {\n    a = +a;\n    b = +b;\n  }\n  return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;\n};\nconst rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);\nvar identifiers = {\n  compareIdentifiers: compareIdentifiers$1,\n  rcompareIdentifiers\n};\nconst debug = debug_1;\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = constants;\nconst { safeRe: re, t } = reExports;\nconst parseOptions = parseOptions_1;\nconst { compareIdentifiers } = identifiers;\nlet SemVer$2 = class SemVer {\n  constructor(version, options) {\n    options = parseOptions(options);\n    if (version instanceof SemVer) {\n      if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n        return version;\n      } else {\n        version = version.version;\n      }\n    } else if (typeof version !== \"string\") {\n      throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`);\n    }\n    if (version.length > MAX_LENGTH) {\n      throw new TypeError(\n        `version is longer than ${MAX_LENGTH} characters`\n      );\n    }\n    debug(\"SemVer\", version, options);\n    this.options = options;\n    this.loose = !!options.loose;\n    this.includePrerelease = !!options.includePrerelease;\n    const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);\n    if (!m) {\n      throw new TypeError(`Invalid Version: ${version}`);\n    }\n    this.raw = version;\n    this.major = +m[1];\n    this.minor = +m[2];\n    this.patch = +m[3];\n    if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n      throw new TypeError(\"Invalid major version\");\n    }\n    if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n      throw new TypeError(\"Invalid minor version\");\n    }\n    if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n      throw new TypeError(\"Invalid patch version\");\n    }\n    if (!m[4]) {\n      this.prerelease = [];\n    } else {\n      this.prerelease = m[4].split(\".\").map((id) => {\n        if (/^[0-9]+$/.test(id)) {\n          const num = +id;\n          if (num >= 0 && num < MAX_SAFE_INTEGER) {\n            return num;\n          }\n        }\n        return id;\n      });\n    }\n    this.build = m[5] ? m[5].split(\".\") : [];\n    this.format();\n  }\n  format() {\n    this.version = `${this.major}.${this.minor}.${this.patch}`;\n    if (this.prerelease.length) {\n      this.version += `-${this.prerelease.join(\".\")}`;\n    }\n    return this.version;\n  }\n  toString() {\n    return this.version;\n  }\n  compare(other) {\n    debug(\"SemVer.compare\", this.version, this.options, other);\n    if (!(other instanceof SemVer)) {\n      if (typeof other === \"string\" && other === this.version) {\n        return 0;\n      }\n      other = new SemVer(other, this.options);\n    }\n    if (other.version === this.version) {\n      return 0;\n    }\n    return this.compareMain(other) || this.comparePre(other);\n  }\n  compareMain(other) {\n    if (!(other instanceof SemVer)) {\n      other = new SemVer(other, this.options);\n    }\n    return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);\n  }\n  comparePre(other) {\n    if (!(other instanceof SemVer)) {\n      other = new SemVer(other, this.options);\n    }\n    if (this.prerelease.length && !other.prerelease.length) {\n      return -1;\n    } else if (!this.prerelease.length && other.prerelease.length) {\n      return 1;\n    } else if (!this.prerelease.length && !other.prerelease.length) {\n      return 0;\n    }\n    let i = 0;\n    do {\n      const a = this.prerelease[i];\n      const b = other.prerelease[i];\n      debug(\"prerelease compare\", i, a, b);\n      if (a === void 0 && b === void 0) {\n        return 0;\n      } else if (b === void 0) {\n        return 1;\n      } else if (a === void 0) {\n        return -1;\n      } else if (a === b) {\n        continue;\n      } else {\n        return compareIdentifiers(a, b);\n      }\n    } while (++i);\n  }\n  compareBuild(other) {\n    if (!(other instanceof SemVer)) {\n      other = new SemVer(other, this.options);\n    }\n    let i = 0;\n    do {\n      const a = this.build[i];\n      const b = other.build[i];\n      debug(\"build compare\", i, a, b);\n      if (a === void 0 && b === void 0) {\n        return 0;\n      } else if (b === void 0) {\n        return 1;\n      } else if (a === void 0) {\n        return -1;\n      } else if (a === b) {\n        continue;\n      } else {\n        return compareIdentifiers(a, b);\n      }\n    } while (++i);\n  }\n  // preminor will bump the version up to the next minor release, and immediately\n  // down to pre-release. premajor and prepatch work the same way.\n  inc(release, identifier, identifierBase) {\n    switch (release) {\n      case \"premajor\":\n        this.prerelease.length = 0;\n        this.patch = 0;\n        this.minor = 0;\n        this.major++;\n        this.inc(\"pre\", identifier, identifierBase);\n        break;\n      case \"preminor\":\n        this.prerelease.length = 0;\n        this.patch = 0;\n        this.minor++;\n        this.inc(\"pre\", identifier, identifierBase);\n        break;\n      case \"prepatch\":\n        this.prerelease.length = 0;\n        this.inc(\"patch\", identifier, identifierBase);\n        this.inc(\"pre\", identifier, identifierBase);\n        break;\n      case \"prerelease\":\n        if (this.prerelease.length === 0) {\n          this.inc(\"patch\", identifier, identifierBase);\n        }\n        this.inc(\"pre\", identifier, identifierBase);\n        break;\n      case \"major\":\n        if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n          this.major++;\n        }\n        this.minor = 0;\n        this.patch = 0;\n        this.prerelease = [];\n        break;\n      case \"minor\":\n        if (this.patch !== 0 || this.prerelease.length === 0) {\n          this.minor++;\n        }\n        this.patch = 0;\n        this.prerelease = [];\n        break;\n      case \"patch\":\n        if (this.prerelease.length === 0) {\n          this.patch++;\n        }\n        this.prerelease = [];\n        break;\n      case \"pre\": {\n        const base = Number(identifierBase) ? 1 : 0;\n        if (!identifier && identifierBase === false) {\n          throw new Error(\"invalid increment argument: identifier is empty\");\n        }\n        if (this.prerelease.length === 0) {\n          this.prerelease = [base];\n        } else {\n          let i = this.prerelease.length;\n          while (--i >= 0) {\n            if (typeof this.prerelease[i] === \"number\") {\n              this.prerelease[i]++;\n              i = -2;\n            }\n          }\n          if (i === -1) {\n            if (identifier === this.prerelease.join(\".\") && identifierBase === false) {\n              throw new Error(\"invalid increment argument: identifier already exists\");\n            }\n            this.prerelease.push(base);\n          }\n        }\n        if (identifier) {\n          let prerelease = [identifier, base];\n          if (identifierBase === false) {\n            prerelease = [identifier];\n          }\n          if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n            if (isNaN(this.prerelease[1])) {\n              this.prerelease = prerelease;\n            }\n          } else {\n            this.prerelease = prerelease;\n          }\n        }\n        break;\n      }\n      default:\n        throw new Error(`invalid increment argument: ${release}`);\n    }\n    this.raw = this.format();\n    if (this.build.length) {\n      this.raw += `+${this.build.join(\".\")}`;\n    }\n    return this;\n  }\n};\nvar semver = SemVer$2;\nconst SemVer$1 = semver;\nconst parse$1 = (version, options, throwErrors = false) => {\n  if (version instanceof SemVer$1) {\n    return version;\n  }\n  try {\n    return new SemVer$1(version, options);\n  } catch (er) {\n    if (!throwErrors) {\n      return null;\n    }\n    throw er;\n  }\n};\nvar parse_1 = parse$1;\nconst parse = parse_1;\nconst valid = (version, options) => {\n  const v = parse(version, options);\n  return v ? v.version : null;\n};\nvar valid_1 = valid;\nconst valid$1 = /* @__PURE__ */ getDefaultExportFromCjs(valid_1);\nconst SemVer2 = semver;\nconst major = (a, loose) => new SemVer2(a, loose).major;\nvar major_1 = major;\nconst major$1 = /* @__PURE__ */ getDefaultExportFromCjs(major_1);\nclass ProxyBus {\n  bus;\n  constructor(bus2) {\n    if (typeof bus2.getVersion !== \"function\" || !valid$1(bus2.getVersion())) {\n      console.warn(\"Proxying an event bus with an unknown or invalid version\");\n    } else if (major$1(bus2.getVersion()) !== major$1(this.getVersion())) {\n      console.warn(\n        \"Proxying an event bus of version \" + bus2.getVersion() + \" with \" + this.getVersion()\n      );\n    }\n    this.bus = bus2;\n  }\n  getVersion() {\n    return \"3.3.1\";\n  }\n  subscribe(name, handler) {\n    this.bus.subscribe(name, handler);\n  }\n  unsubscribe(name, handler) {\n    this.bus.unsubscribe(name, handler);\n  }\n  emit(name, event) {\n    this.bus.emit(name, event);\n  }\n}\nclass SimpleBus {\n  handlers = /* @__PURE__ */ new Map();\n  getVersion() {\n    return \"3.3.1\";\n  }\n  subscribe(name, handler) {\n    this.handlers.set(\n      name,\n      (this.handlers.get(name) || []).concat(\n        handler\n      )\n    );\n  }\n  unsubscribe(name, handler) {\n    this.handlers.set(\n      name,\n      (this.handlers.get(name) || []).filter((h) => h !== handler)\n    );\n  }\n  emit(name, event) {\n    (this.handlers.get(name) || []).forEach((h) => {\n      try {\n        h(event);\n      } catch (e) {\n        console.error(\"could not invoke event listener\", e);\n      }\n    });\n  }\n}\nlet bus = null;\nfunction getBus() {\n  if (bus !== null) {\n    return bus;\n  }\n  if (typeof window === \"undefined\") {\n    return new Proxy({}, {\n      get: () => {\n        return () => console.error(\n          \"Window not available, EventBus can not be established!\"\n        );\n      }\n    });\n  }\n  if (window.OC?._eventBus && typeof window._nc_event_bus === \"undefined\") {\n    console.warn(\n      \"found old event bus instance at OC._eventBus. Update your version!\"\n    );\n    window._nc_event_bus = window.OC._eventBus;\n  }\n  if (typeof window?._nc_event_bus !== \"undefined\") {\n    bus = new ProxyBus(window._nc_event_bus);\n  } else {\n    bus = window._nc_event_bus = new SimpleBus();\n  }\n  return bus;\n}\nfunction emit(name, event) {\n  getBus().emit(name, event);\n}\n/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nclass FileListFilter extends TypedEventTarget {\n  id;\n  order;\n  constructor(id, order = 100) {\n    super();\n    this.id = id;\n    this.order = order;\n  }\n  filter(nodes) {\n    throw new Error(\"Not implemented\");\n  }\n  updateChips(chips) {\n    this.dispatchTypedEvent(\"update:chips\", new CustomEvent(\"update:chips\", { detail: chips }));\n  }\n  filterUpdated() {\n    this.dispatchTypedEvent(\"update:filter\", new CustomEvent(\"update:filter\"));\n  }\n}\nfunction registerFileListFilter(filter) {\n  if (!window._nc_filelist_filters) {\n    window._nc_filelist_filters = /* @__PURE__ */ new Map();\n  }\n  if (window._nc_filelist_filters.has(filter.id)) {\n    throw new Error(`File list filter \"${filter.id}\" already registered`);\n  }\n  window._nc_filelist_filters.set(filter.id, filter);\n  emit(\"files:filter:added\", filter);\n}\nfunction unregisterFileListFilter(filterId) {\n  if (window._nc_filelist_filters && window._nc_filelist_filters.has(filterId)) {\n    window._nc_filelist_filters.delete(filterId);\n    emit(\"files:filter:removed\", filterId);\n  }\n}\nfunction getFileListFilters() {\n  if (!window._nc_filelist_filters) {\n    return [];\n  }\n  return [...window._nc_filelist_filters.values()];\n}\nconst addNewFileMenuEntry = function(entry) {\n  const newFileMenu = getNewFileMenu();\n  return newFileMenu.registerEntry(entry);\n};\nconst removeNewFileMenuEntry = function(entry) {\n  const newFileMenu = getNewFileMenu();\n  return newFileMenu.unregisterEntry(entry);\n};\nconst getNewFileMenuEntries = function(context) {\n  const newFileMenu = getNewFileMenu();\n  return newFileMenu.getEntries(context).sort((a, b) => {\n    if (a.order !== void 0 && b.order !== void 0 && a.order !== b.order) {\n      return a.order - b.order;\n    }\n    return a.displayName.localeCompare(b.displayName, void 0, { numeric: true, sensitivity: \"base\" });\n  });\n};\nexport {\n  Column,\n  DefaultType,\n  File,\n  FileAction,\n  FileListFilter,\n  FileType,\n  FilesSortingMode,\n  Folder,\n  Header,\n  InvalidFilenameError,\n  InvalidFilenameErrorReason,\n  Navigation,\n  NewMenuEntryCategory,\n  Node,\n  NodeStatus,\n  Permission,\n  View,\n  addNewFileMenuEntry,\n  davGetClient,\n  davGetDefaultPropfind,\n  davGetFavoritesReport,\n  davGetRecentSearch,\n  davGetRemoteURL,\n  davGetRootPath,\n  davParsePermissions,\n  davRemoteURL,\n  davResultToNode,\n  davRootPath,\n  defaultDavNamespaces,\n  defaultDavProperties,\n  formatFileSize,\n  getDavNameSpaces,\n  getDavProperties,\n  getFavoriteNodes,\n  getFileActions,\n  getFileListFilters,\n  getFileListHeaders,\n  getNavigation,\n  getNewFileMenuEntries,\n  getUniqueName,\n  isFilenameValid,\n  orderBy,\n  parseFileSize,\n  registerDavProperty,\n  registerFileAction,\n  registerFileListFilter,\n  registerFileListHeaders,\n  removeNewFileMenuEntry,\n  sortNodes,\n  unregisterFileListFilter,\n  validateFilename\n};\n","\n      import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n      import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n      import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n      import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n      import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n      import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n      import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n      \n      \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n      options.insert = insertFn.bind(null, \"head\");\n    \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n       export default content && content.locals ? content.locals : undefined;\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FileAction, Node, registerDavProperty, registerFileAction } from '@nextcloud/files';\nimport { translate as t } from '@nextcloud/l10n';\nimport '../css/fileEntryInlineSystemTags.scss';\nconst getNodeSystemTags = function (node) {\n    const tags = node.attributes?.['system-tags']?.['system-tag'];\n    if (tags === undefined) {\n        return [];\n    }\n    return [tags].flat();\n};\nconst renderTag = function (tag, isMore = false) {\n    const tagElement = document.createElement('li');\n    tagElement.classList.add('files-list__system-tag');\n    tagElement.textContent = tag;\n    if (isMore) {\n        tagElement.classList.add('files-list__system-tag--more');\n    }\n    return tagElement;\n};\nexport const action = new FileAction({\n    id: 'system-tags',\n    displayName: () => '',\n    iconSvgInline: () => '',\n    enabled(nodes) {\n        // Only show the action on single nodes\n        if (nodes.length !== 1) {\n            return false;\n        }\n        const node = nodes[0];\n        const tags = getNodeSystemTags(node);\n        // Only show the action if the node has system tags\n        if (tags.length === 0) {\n            return false;\n        }\n        return true;\n    },\n    exec: async () => null,\n    async renderInline(node) {\n        // Ensure we have the system tags as an array\n        const tags = getNodeSystemTags(node);\n        if (tags.length === 0) {\n            return null;\n        }\n        const systemTagsElement = document.createElement('ul');\n        systemTagsElement.classList.add('files-list__system-tags');\n        if (tags.length === 1) {\n            systemTagsElement.setAttribute('aria-label', t('files', 'This file has the tag {tag}', { tag: tags[0] }));\n        }\n        else {\n            const firstTags = tags.slice(0, -1).join(', ');\n            const lastTag = tags[tags.length - 1];\n            systemTagsElement.setAttribute('aria-label', t('files', 'This file has the tags {firstTags} and {lastTag}', { firstTags, lastTag }));\n        }\n        systemTagsElement.append(renderTag(tags[0]));\n        // More tags than the one we're showing\n        if (tags.length > 1) {\n            const moreTagElement = renderTag('+' + (tags.length - 1), true);\n            moreTagElement.setAttribute('title', tags.slice(1).join(', '));\n            systemTagsElement.append(moreTagElement);\n        }\n        return systemTagsElement;\n    },\n    order: 0,\n});\nregisterDavProperty('nc:system-tags');\nregisterFileAction(action);\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { createClient } from 'webdav';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth';\n// init webdav client\nconst rootUrl = generateRemoteUrl('dav');\nexport const davClient = createClient(rootUrl);\n// set CSRF token header\nconst setHeaders = (token) => {\n    davClient.setHeaders({\n        // Add this so the server knows it is an request from the browser\n        'X-Requested-With': 'XMLHttpRequest',\n        // Inject user auth\n        requesttoken: token ?? '',\n    });\n};\n// refresh headers when request token changes\nonRequestTokenUpdate(setHeaders);\nsetHeaders(getRequestToken());\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport camelCase from 'camelcase';\nexport const defaultBaseTag = {\n    userVisible: true,\n    userAssignable: true,\n    canAssign: true,\n};\nexport const parseTags = (tags) => {\n    return tags.map(({ props }) => Object.fromEntries(Object.entries(props)\n        .map(([key, value]) => [camelCase(key), camelCase(key) === 'displayName' ? String(value) : value])));\n};\n/**\n * Parse id from `Content-Location` header\n * @param url URL to parse\n */\nexport const parseIdFromLocation = (url) => {\n    const queryPos = url.indexOf('?');\n    if (queryPos > 0) {\n        url = url.substring(0, queryPos);\n    }\n    const parts = url.split('/');\n    let result;\n    do {\n        result = parts[parts.length - 1];\n        parts.pop();\n        // note: first result can be empty when there is a trailing slash,\n        // so we take the part before that\n    } while (!result && parts.length > 0);\n    return Number(result);\n};\nexport const formatTag = (initialTag) => {\n    if ('name' in initialTag && !('displayName' in initialTag)) {\n        return { ...initialTag };\n    }\n    const tag = { ...initialTag };\n    tag.name = tag.displayName;\n    delete tag.displayName;\n    return tag;\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport const logger = getLoggerBuilder()\n    .setApp('systemtags')\n    .detectUser()\n    .build();\n","import { Folder, Permission, getDavNameSpaces, getDavProperties, davGetClient, davResultToNode } from '@nextcloud/files';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { fetchTags } from './api';\nconst client = davGetClient();\nconst resultToNode = (node) => davResultToNode(node);\nconst formatReportPayload = (tagId) => `<?xml version=\"1.0\"?>\n<oc:filter-files ${getDavNameSpaces()}>\n\t<d:prop>\n\t\t${getDavProperties()}\n\t</d:prop>\n    <oc:filter-rules>\n        <oc:systemtag>${tagId}</oc:systemtag>\n    </oc:filter-rules>\n</oc:filter-files>`;\nconst tagToNode = function (tag) {\n    return new Folder({\n        id: tag.id,\n        source: generateRemoteUrl('dav/systemtags/' + tag.id),\n        owner: getCurrentUser()?.uid,\n        root: '/systemtags',\n        permissions: Permission.READ,\n        attributes: {\n            ...tag,\n            'is-tag': true,\n        },\n    });\n};\nexport const getContents = async (path = '/') => {\n    // List tags in the root\n    const tagsCache = (await fetchTags()).filter(tag => tag.userVisible);\n    if (path === '/') {\n        return {\n            folder: new Folder({\n                id: 0,\n                source: generateRemoteUrl('dav/systemtags'),\n                owner: getCurrentUser()?.uid,\n                root: '/systemtags',\n                permissions: Permission.NONE,\n            }),\n            contents: tagsCache.map(tagToNode),\n        };\n    }\n    const tagId = parseInt(path.replace('/', ''), 10);\n    const tag = tagsCache.find(tag => tag.id === tagId);\n    if (!tag) {\n        throw new Error('Tag not found');\n    }\n    const folder = tagToNode(tag);\n    const contentsResponse = await client.getDirectoryContents('/', {\n        details: true,\n        // Only filter favorites if we're at the root\n        data: formatReportPayload(tagId),\n        headers: {\n            // Patched in WebdavClient.ts\n            method: 'REPORT',\n        },\n    });\n    return {\n        folder,\n        contents: contentsResponse.data.map(resultToNode),\n    };\n};\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport './actions/inlineSystemTagsAction.js';\nimport { translate as t } from '@nextcloud/l10n';\nimport { View, getNavigation } from '@nextcloud/files';\nimport TagMultipleSvg from '@mdi/svg/svg/tag-multiple.svg?raw';\nimport { getContents } from './services/systemtags.js';\nconst Navigation = getNavigation();\nNavigation.register(new View({\n    id: 'tags',\n    name: t('systemtags', 'Tags'),\n    caption: t('systemtags', 'List of tags and their associated files and folders.'),\n    emptyTitle: t('systemtags', 'No tags found'),\n    emptyCaption: t('systemtags', 'Tags you have created will show up here.'),\n    icon: TagMultipleSvg,\n    order: 25,\n    getContents,\n}));\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport axios from '@nextcloud/axios';\nimport { generateUrl } from '@nextcloud/router';\nimport { translate as t } from '@nextcloud/l10n';\nimport { davClient } from './davClient.js';\nimport { formatTag, parseIdFromLocation, parseTags } from '../utils';\nimport { logger } from '../logger.js';\nexport const fetchTagsPayload = `<?xml version=\"1.0\"?>\n<d:propfind  xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>`;\nexport const fetchTags = async () => {\n    const path = '/systemtags';\n    try {\n        const { data: tags } = await davClient.getDirectoryContents(path, {\n            data: fetchTagsPayload,\n            details: true,\n            glob: '/systemtags/*', // Filter out first empty tag\n        });\n        return parseTags(tags);\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to load tags'), { error });\n        throw new Error(t('systemtags', 'Failed to load tags'));\n    }\n};\nexport const fetchLastUsedTagIds = async () => {\n    const url = generateUrl('/apps/systemtags/lastused');\n    try {\n        const { data: lastUsedTagIds } = await axios.get(url);\n        return lastUsedTagIds.map(Number);\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to load last used tags'), { error });\n        throw new Error(t('systemtags', 'Failed to load last used tags'));\n    }\n};\n/**\n * @param tag\n * @return created tag id\n */\nexport const createTag = async (tag) => {\n    const path = '/systemtags';\n    const tagToPost = formatTag(tag);\n    try {\n        const { headers } = await davClient.customRequest(path, {\n            method: 'POST',\n            data: tagToPost,\n        });\n        const contentLocation = headers.get('content-location');\n        if (contentLocation) {\n            return parseIdFromLocation(contentLocation);\n        }\n        logger.error(t('systemtags', 'Missing \"Content-Location\" header'));\n        throw new Error(t('systemtags', 'Missing \"Content-Location\" header'));\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to create tag'), { error });\n        throw new Error(t('systemtags', 'Failed to create tag'));\n    }\n};\nexport const updateTag = async (tag) => {\n    const path = '/systemtags/' + tag.id;\n    const data = `<?xml version=\"1.0\"?>\n\t<d:propertyupdate  xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\n\t\t<d:set>\n\t\t\t<d:prop>\n\t\t\t\t<oc:display-name>${tag.displayName}</oc:display-name>\n\t\t\t\t<oc:user-visible>${tag.userVisible}</oc:user-visible>\n\t\t\t\t<oc:user-assignable>${tag.userAssignable}</oc:user-assignable>\n\t\t\t</d:prop>\n\t\t</d:set>\n\t</d:propertyupdate>`;\n    try {\n        await davClient.customRequest(path, {\n            method: 'PROPPATCH',\n            data,\n        });\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to update tag'), { error });\n        throw new Error(t('systemtags', 'Failed to update tag'));\n    }\n};\nexport const deleteTag = async (tag) => {\n    const path = '/systemtags/' + tag.id;\n    try {\n        await davClient.deleteFile(path);\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to delete tag'), { error });\n        throw new Error(t('systemtags', 'Failed to delete tag'));\n    }\n};\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:22px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-left:5px}@media(min-width: 512px){.files-list__system-tags{display:flex}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss\"],\"names\":[],\"mappings\":\"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,eAAA,CAIF,yBACC,yBACC,YAAA,CAAA\",\"sourcesContent\":[\"/**\\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n * SPDX-License-Identifier: AGPL-3.0-or-later\\n */\\n\\n.files-list__system-tags {\\n\\t--min-size: 32px;\\n\\tdisplay: none;\\n\\tjustify-content: center;\\n\\talign-items: center;\\n\\tmin-width: calc(var(--min-size) * 2);\\n\\tmax-width: 300px;\\n}\\n\\n.files-list__system-tag {\\n\\tpadding: 5px 10px;\\n\\tborder: 1px solid;\\n\\tborder-radius: var(--border-radius-pill);\\n\\tborder-color: var(--color-border);\\n\\tcolor: var(--color-text-maxcontrast);\\n\\theight: var(--min-size);\\n\\twhite-space: nowrap;\\n\\toverflow: hidden;\\n\\ttext-overflow: ellipsis;\\n\\tline-height: 22px; // min-size - 2 * 5px padding\\n\\ttext-align: center;\\n\\n\\t&--more {\\n\\t\\toverflow: visible;\\n\\t\\ttext-overflow: initial;\\n\\t}\\n\\n\\t// Proper spacing if multiple shown\\n\\t& + .files-list__system-tag {\\n\\t\\tmargin-left: 5px;\\n\\t}\\n}\\n\\n@media (min-width: 512px) {\\n\\t.files-list__system-tags {\\n\\t\\tdisplay: flex;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2766;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2766: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(27560)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","setApp","detectUser","build","DefaultType","DefaultType2","Permission","Permission2","defaultDavProperties","defaultDavNamespaces","d","nc","oc","ocs","FileType","FileType2","isDavRessource","source","davService","match","validateData","data","id","Error","URL","e","startsWith","displayname","mtime","Date","crtime","mime","size","permissions","NONE","ALL","owner","attributes","root","includes","service","join","status","Object","values","NodeStatus","NodeStatus2","Node","_data","_attributes","_knownDavService","readonlyAttributes","entries","getOwnPropertyDescriptors","prototype","filter","get","map","handler","set","target","prop","value","this","Reflect","deleteProperty","receiver","warn","constructor","Proxy","update","replace","encodedSource","origin","slice","length","basename","extension","extname","dirname","split","pop","firstMatch","indexOf","url","pathname","updateMtime","READ","path","fileid","move","destination","oldBasename","rename","basename2","name","TypeError","File","type","Folder","super","davRootPath","uid","davRemoteURL","davGetRemoteURL","Navigation","_views","_currentView","register","view","find","search","push","dispatchTypedEvent","CustomEvent","remove","index","findIndex","splice","setActive","event","detail","active","views","Column","_column","column","isValidColumn","title","render","sort","summary","validator$2","util$3","exports","nameStartChar","nameRegexp","regexName","RegExp","isExist","v","isEmptyObject","obj","keys","merge","a","arrayMode","len","i","getValue","isName","string","exec","getAllMatches","regex","matches","allmatches","startIndex","lastIndex","util$2","defaultOptions$2","allowBooleanAttributes","unpairedTags","isWhiteSpace","char","readPI","xmlData","start","tagname","substr","getErrorObject","getLineNumberForPosition","readCommentAndCDATA","angleBracketsCount","validate","options","assign","tags","tagFound","reachedRoot","err","tagStartPos","closingTag","tagName","trim","substring","msg","result","readAttributeStr","attrStr","attrStrStart","isValid","validateAttributeString","code","line","tagClosed","otg","openPos","col","afterAmp","validateAmpersand","JSON","stringify","t2","doubleQuote","singleQuote","startChar","validAttrStrRegxp","attrNames","getPositionFromMatch","attrName","validateAttrName","hasOwnProperty","re2","validateNumberAmpersand","count","message","lineNumber","lines","OptionsBuilder","defaultOptions$1","preserveOrder","attributeNamePrefix","attributesGroupName","textNodeName","ignoreAttributes","removeNSPrefix","parseTagValue","parseAttributeValue","trimValues","cdataPropName","numberParseOptions","hex","leadingZeros","eNotation","tagValueProcessor","val2","attributeValueProcessor","stopNodes","alwaysCreateTextNode","isArray","commentPropName","processEntities","htmlEntities","ignoreDeclaration","ignorePiTags","transformTagName","transformAttributeName","updateTag","jPath","attrs","buildOptions","defaultOptions","util$1","readEntityExp","entityName2","isComment","isEntity","isElement","isAttlist","isNotation","validateEntityName","hexRegex","numRegex","Number","parseInt","window","parseFloat","consider","decimalPoint","util","xmlNode","child","add","key","addChild","node","readDocType","entities","hasBody","comment","exp","entityName","val","regx","toNumber","str","trimmedStr","skipLike","test","sign","numTrimmedByZeros","numStr","num","addExternalEntities","externalEntities","entKeys","ent","lastEntities","parseTextData","dontTrim","hasAttributes","isLeafNode","escapeEntities","replaceEntitiesValue","newval","parseValue","resolveNameSpace","prefix","charAt","attrsRegx","buildAttributesMap","oldVal","aName","newVal","attrCollection","parseXml","xmlObj","currentNode","textData","closeIndex","findClosingIndex","colonIndex","saveTextToParentTag","lastTagName","lastIndexOf","propIndex","tagsNodeStack","tagData","readTagExp","childNode","tagExp","attrExpPresent","endIndex","docTypeEntities","rawTagName","lastTag","isItStopNode","tagContent","result2","readStopNodeData","replaceEntitiesValue$1","entity","ampEntity","currentTagName","allNodesExp","stopNodePath","stopNodeExp","errMsg","closingIndex","closingChar","attrBoundary","ch","tagExpWithClosingIndex","separatorIndex","trimStart","openTagCount","shouldParse","node2json","compress","arr","text","compressedObj","tagObj","property","propName$1","newJpath","isLeaf","isLeafTag","assignAttributes","Array","attrMap","jpath","atrrName","propCount","prettify","OrderedObjParser2","_","String","fromCharCode","validator$1","arrToStr","indentation","xmlStr","isPreviousElementTag","propName","newJPath","tagText","isStopNode","attStr2","attr_to_str","tempInd","piTextNodeName","newIdentation","indentBy","tagStart","tagValue","suppressUnpairedNode","suppressEmptyNode","endsWith","attr","attrVal","suppressBooleanAttributes","textValue","buildFromOrderedJs","jArray","format","oneListGroup","Builder","isAttribute","attrPrefixLen","processTextOrObjNode","indentate","tagEndChar","newLine","object","level","j2x","buildTextValNode","buildObjectNode","repeat","jObj","arrayNodeName","call","buildAttrPairStr","arrLen","listTagVal","j","item","Ks","L","closeTag","tagEndExp","piClosingChar","fxp","XMLParser","parse","validationOption","toString","orderedObjParser","orderedResult","addEntity","XMLValidator","XMLBuilder","debug_1","process","env","NODE_DEBUG","args","console","error","constants","MAX_LENGTH","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","MAX_LENGTH$1","MAX_SAFE_INTEGER","RELEASE_TYPES","SEMVER_SPEC_VERSION","FLAG_INCLUDE_PRERELEASE","FLAG_LOOSE","re$1","module","MAX_SAFE_COMPONENT_LENGTH2","MAX_SAFE_BUILD_LENGTH2","MAX_LENGTH2","debug2","re","safeRe","src","t","R","LETTERDASHNUMBER","safeRegexReplacements","createToken","isGlobal","safe","token","max","makeSafeRegex","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCEPLAIN","COERCE","COERCEFULL","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","reExports","freeze","loose","numeric","compareIdentifiers$1","b","anum","bnum","identifiers","compareIdentifiers","rcompareIdentifiers","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","getNodeSystemTags","_node$attributes","undefined","flat","renderTag","tag","isMore","arguments","tagElement","document","createElement","classList","textContent","action","_action","validateAction","displayName","iconSvgInline","enabled","execBatch","order","parent","default","inline","renderInline","nodes","async","systemTagsElement","setAttribute","firstTags","append","moreTagElement","namespace","_nc_dav_properties","_nc_dav_namespaces","namespaces","registerDavProperty","_nc_fileactions","debug","registerFileAction","rootUrl","generateRemoteUrl","davClient","createClient","setHeaders","requesttoken","onRequestTokenUpdate","getRequestToken","logger","getLoggerBuilder","client","remoteURL","headers","patch","headers2","method","fetch","davGetClient","resultToNode","filesRoot","userId","props","permString","CREATE","UPDATE","DELETE","SHARE","davParsePermissions","nodeData","filename","lastmod","getcontentlength","FAILED","hasPreview","davResultToNode","formatReportPayload","tagId","concat","ns","tagToNode","_getCurrentUser","getCurrentUser","_nc_navigation","_view","columns","caption","getContents","icon","jsonObject","parser","some","x","toLowerCase","isSvg","forEach","emptyView","sticky","expanded","defaultSortKey","isValidView","emptyTitle","emptyCaption","params","tagsCache","getDirectoryContents","details","glob","_ref","fromEntries","_ref2","camelCase","parseTags","fetchTags","userVisible","_getCurrentUser2","folder","contents","___CSS_LOADER_EXPORT___","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","m","O","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","every","r","n","getter","__esModule","definition","o","defineProperty","enumerable","Promise","resolve","g","globalThis","Function","Symbol","toStringTag","nmd","paths","children","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","bind","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"systemtags-init.js?v=746d8edfbd0035fbbf62","mappings":"UAAIA,E,iLCWJ,MAAM,GAAS,UAAmBC,OAAO,oBAAoBC,aAAaC,QAmE1E,IAAIC,EAA8B,CAAEC,IAClCA,EAAsB,QAAI,UAC1BA,EAAqB,OAAI,SAClBA,GAHyB,CAI/BD,GAAe,CAAC,GA6JfE,EAA6B,CAAEC,IACjCA,EAAYA,EAAkB,KAAI,GAAK,OACvCA,EAAYA,EAAoB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AAuB,CAACC,EAA4BtpB,KACvD,IAKIgnB,EAAUoC,EALV9B,EAAWtnB,EAAK,GAChBupB,EAAcvpB,EAAK,GACnBwpB,EAAUxpB,EAAK,GAGI+H,EAAI,EAC3B,GAAGuf,EAASpC,MAAMjlB,GAAgC,IAAxBkpB,EAAgBlpB,KAAa,CACtD,IAAI+mB,KAAYuC,EACZxC,EAAoBmB,EAAEqB,EAAavC,KACrCD,EAAoBK,EAAEJ,GAAYuC,EAAYvC,IAGhD,GAAGwC,EAAS,IAAIlf,EAASkf,EAAQzC,EAClC,CAEA,IADGuC,GAA4BA,EAA2BtpB,GACrD+H,EAAIuf,EAAShkB,OAAQyE,IACzBqhB,EAAU9B,EAASvf,GAChBgf,EAAoBmB,EAAEiB,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOrC,EAAoBM,EAAE/c,EAAO,EAGjCmf,EAAqBT,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FS,EAAmBnE,QAAQ+D,EAAqBK,KAAK,KAAM,IAC3DD,EAAmB9jB,KAAO0jB,EAAqBK,KAAK,KAAMD,EAAmB9jB,KAAK+jB,KAAKD,G,KClDvF1C,EAAoBznB,QAAKkgB,ECGzB,IAAImK,EAAsB5C,EAAoBM,OAAE7H,EAAW,CAAC,OAAO,IAAOuH,EAAoB,SAC9F4C,EAAsB5C,EAAoBM,EAAEsC,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/node_modules/@nextcloud/files/dist/index.mjs","webpack://nextcloud/./apps/systemtags/src/css/fileEntryInlineSystemTags.scss?0a01","webpack:///nextcloud/apps/systemtags/src/actions/inlineSystemTagsAction.ts","webpack:///nextcloud/apps/systemtags/src/services/davClient.ts","webpack:///nextcloud/apps/systemtags/src/utils.ts","webpack:///nextcloud/apps/systemtags/src/logger.ts","webpack:///nextcloud/apps/systemtags/src/services/systemtags.ts","webpack:///nextcloud/apps/systemtags/src/init.ts","webpack:///nextcloud/apps/systemtags/src/services/api.ts","webpack:///nextcloud/apps/systemtags/src/css/fileEntryInlineSystemTags.scss","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import { getLoggerBuilder } from \"@nextcloud/logger\";\nimport { getCurrentUser, onRequestTokenUpdate, getRequestToken } from \"@nextcloud/auth\";\nimport { join, basename, extname, dirname } from \"path\";\nimport { encodePath } from \"@nextcloud/paths\";\nimport { generateRemoteUrl } from \"@nextcloud/router\";\nimport { CancelablePromise } from \"cancelable-promise\";\nimport { createClient, getPatcher } from \"webdav\";\nimport { isPublicShare, getSharingToken } from \"@nextcloud/sharing/public\";\nimport { getCapabilities } from \"@nextcloud/capabilities\";\nimport { getCanonicalLocale, getLanguage } from \"@nextcloud/l10n\";\nimport { TypedEventTarget } from \"typescript-event-target\";\nconst logger = getLoggerBuilder().setApp(\"@nextcloud/files\").detectUser().build();\nvar NewMenuEntryCategory = /* @__PURE__ */ ((NewMenuEntryCategory2) => {\n  NewMenuEntryCategory2[NewMenuEntryCategory2[\"UploadFromDevice\"] = 0] = \"UploadFromDevice\";\n  NewMenuEntryCategory2[NewMenuEntryCategory2[\"CreateNew\"] = 1] = \"CreateNew\";\n  NewMenuEntryCategory2[NewMenuEntryCategory2[\"Other\"] = 2] = \"Other\";\n  return NewMenuEntryCategory2;\n})(NewMenuEntryCategory || {});\nclass NewFileMenu {\n  _entries = [];\n  registerEntry(entry) {\n    this.validateEntry(entry);\n    entry.category = entry.category ?? 1;\n    this._entries.push(entry);\n  }\n  unregisterEntry(entry) {\n    const entryIndex = typeof entry === \"string\" ? this.getEntryIndex(entry) : this.getEntryIndex(entry.id);\n    if (entryIndex === -1) {\n      logger.warn(\"Entry not found, nothing removed\", { entry, entries: this.getEntries() });\n      return;\n    }\n    this._entries.splice(entryIndex, 1);\n  }\n  /**\n   * Get the list of registered entries\n   *\n   * @param {Folder} context the creation context. Usually the current folder\n   */\n  getEntries(context) {\n    if (context) {\n      return this._entries.filter((entry) => typeof entry.enabled === \"function\" ? entry.enabled(context) : true);\n    }\n    return this._entries;\n  }\n  getEntryIndex(id) {\n    return this._entries.findIndex((entry) => entry.id === id);\n  }\n  validateEntry(entry) {\n    if (!entry.id || !entry.displayName || !(entry.iconSvgInline || entry.iconClass) || !entry.handler) {\n      throw new Error(\"Invalid entry\");\n    }\n    if (typeof entry.id !== \"string\" || typeof entry.displayName !== \"string\") {\n      throw new Error(\"Invalid id or displayName property\");\n    }\n    if (entry.iconClass && typeof entry.iconClass !== \"string\" || entry.iconSvgInline && typeof entry.iconSvgInline !== \"string\") {\n      throw new Error(\"Invalid icon provided\");\n    }\n    if (entry.enabled !== void 0 && typeof entry.enabled !== \"function\") {\n      throw new Error(\"Invalid enabled property\");\n    }\n    if (typeof entry.handler !== \"function\") {\n      throw new Error(\"Invalid handler property\");\n    }\n    if (\"order\" in entry && typeof entry.order !== \"number\") {\n      throw new Error(\"Invalid order property\");\n    }\n    if (this.getEntryIndex(entry.id) !== -1) {\n      throw new Error(\"Duplicate entry\");\n    }\n  }\n}\nconst getNewFileMenu = function() {\n  if (typeof window._nc_newfilemenu === \"undefined\") {\n    window._nc_newfilemenu = new NewFileMenu();\n    logger.debug(\"NewFileMenu initialized\");\n  }\n  return window._nc_newfilemenu;\n};\nvar DefaultType = /* @__PURE__ */ ((DefaultType2) => {\n  DefaultType2[\"DEFAULT\"] = \"default\";\n  DefaultType2[\"HIDDEN\"] = \"hidden\";\n  return DefaultType2;\n})(DefaultType || {});\nclass FileAction {\n  _action;\n  constructor(action) {\n    this.validateAction(action);\n    this._action = action;\n  }\n  get id() {\n    return this._action.id;\n  }\n  get displayName() {\n    return this._action.displayName;\n  }\n  get title() {\n    return this._action.title;\n  }\n  get iconSvgInline() {\n    return this._action.iconSvgInline;\n  }\n  get enabled() {\n    return this._action.enabled;\n  }\n  get exec() {\n    return this._action.exec;\n  }\n  get execBatch() {\n    return this._action.execBatch;\n  }\n  get order() {\n    return this._action.order;\n  }\n  get parent() {\n    return this._action.parent;\n  }\n  get default() {\n    return this._action.default;\n  }\n  get inline() {\n    return this._action.inline;\n  }\n  get renderInline() {\n    return this._action.renderInline;\n  }\n  validateAction(action) {\n    if (!action.id || typeof action.id !== \"string\") {\n      throw new Error(\"Invalid id\");\n    }\n    if (!action.displayName || typeof action.displayName !== \"function\") {\n      throw new Error(\"Invalid displayName function\");\n    }\n    if (\"title\" in action && typeof action.title !== \"function\") {\n      throw new Error(\"Invalid title function\");\n    }\n    if (!action.iconSvgInline || typeof action.iconSvgInline !== \"function\") {\n      throw new Error(\"Invalid iconSvgInline function\");\n    }\n    if (!action.exec || typeof action.exec !== \"function\") {\n      throw new Error(\"Invalid exec function\");\n    }\n    if (\"enabled\" in action && typeof action.enabled !== \"function\") {\n      throw new Error(\"Invalid enabled function\");\n    }\n    if (\"execBatch\" in action && typeof action.execBatch !== \"function\") {\n      throw new Error(\"Invalid execBatch function\");\n    }\n    if (\"order\" in action && typeof action.order !== \"number\") {\n      throw new Error(\"Invalid order\");\n    }\n    if (\"parent\" in action && typeof action.parent !== \"string\") {\n      throw new Error(\"Invalid parent\");\n    }\n    if (action.default && !Object.values(DefaultType).includes(action.default)) {\n      throw new Error(\"Invalid default\");\n    }\n    if (\"inline\" in action && typeof action.inline !== \"function\") {\n      throw new Error(\"Invalid inline function\");\n    }\n    if (\"renderInline\" in action && typeof action.renderInline !== \"function\") {\n      throw new Error(\"Invalid renderInline function\");\n    }\n  }\n}\nconst registerFileAction = function(action) {\n  if (typeof window._nc_fileactions === \"undefined\") {\n    window._nc_fileactions = [];\n    logger.debug(\"FileActions initialized\");\n  }\n  if (window._nc_fileactions.find((search) => search.id === action.id)) {\n    logger.error(`FileAction ${action.id} already registered`, { action });\n    return;\n  }\n  window._nc_fileactions.push(action);\n};\nconst getFileActions = function() {\n  if (typeof window._nc_fileactions === \"undefined\") {\n    window._nc_fileactions = [];\n    logger.debug(\"FileActions initialized\");\n  }\n  return window._nc_fileactions;\n};\nclass Header {\n  _header;\n  constructor(header) {\n    this.validateHeader(header);\n    this._header = header;\n  }\n  get id() {\n    return this._header.id;\n  }\n  get order() {\n    return this._header.order;\n  }\n  get enabled() {\n    return this._header.enabled;\n  }\n  get render() {\n    return this._header.render;\n  }\n  get updated() {\n    return this._header.updated;\n  }\n  validateHeader(header) {\n    if (!header.id || !header.render || !header.updated) {\n      throw new Error(\"Invalid header: id, render and updated are required\");\n    }\n    if (typeof header.id !== \"string\") {\n      throw new Error(\"Invalid id property\");\n    }\n    if (header.enabled !== void 0 && typeof header.enabled !== \"function\") {\n      throw new Error(\"Invalid enabled property\");\n    }\n    if (header.render && typeof header.render !== \"function\") {\n      throw new Error(\"Invalid render property\");\n    }\n    if (header.updated && typeof header.updated !== \"function\") {\n      throw new Error(\"Invalid updated property\");\n    }\n  }\n}\nconst registerFileListHeaders = function(header) {\n  if (typeof window._nc_filelistheader === \"undefined\") {\n    window._nc_filelistheader = [];\n    logger.debug(\"FileListHeaders initialized\");\n  }\n  if (window._nc_filelistheader.find((search) => search.id === header.id)) {\n    logger.error(`Header ${header.id} already registered`, { header });\n    return;\n  }\n  window._nc_filelistheader.push(header);\n};\nconst getFileListHeaders = function() {\n  if (typeof window._nc_filelistheader === \"undefined\") {\n    window._nc_filelistheader = [];\n    logger.debug(\"FileListHeaders initialized\");\n  }\n  return window._nc_filelistheader;\n};\nvar Permission = /* @__PURE__ */ ((Permission2) => {\n  Permission2[Permission2[\"NONE\"] = 0] = \"NONE\";\n  Permission2[Permission2[\"CREATE\"] = 4] = \"CREATE\";\n  Permission2[Permission2[\"READ\"] = 1] = \"READ\";\n  Permission2[Permission2[\"UPDATE\"] = 2] = \"UPDATE\";\n  Permission2[Permission2[\"DELETE\"] = 8] = \"DELETE\";\n  Permission2[Permission2[\"SHARE\"] = 16] = \"SHARE\";\n  Permission2[Permission2[\"ALL\"] = 31] = \"ALL\";\n  return Permission2;\n})(Permission || {});\nconst defaultDavProperties = [\n  \"d:getcontentlength\",\n  \"d:getcontenttype\",\n  \"d:getetag\",\n  \"d:getlastmodified\",\n  \"d:creationdate\",\n  \"d:displayname\",\n  \"d:quota-available-bytes\",\n  \"d:resourcetype\",\n  \"nc:has-preview\",\n  \"nc:is-encrypted\",\n  \"nc:mount-type\",\n  \"oc:comments-unread\",\n  \"oc:favorite\",\n  \"oc:fileid\",\n  \"oc:owner-display-name\",\n  \"oc:owner-id\",\n  \"oc:permissions\",\n  \"oc:size\"\n];\nconst defaultDavNamespaces = {\n  d: \"DAV:\",\n  nc: \"http://nextcloud.org/ns\",\n  oc: \"http://owncloud.org/ns\",\n  ocs: \"http://open-collaboration-services.org/ns\"\n};\nconst registerDavProperty = function(prop, namespace = { nc: \"http://nextcloud.org/ns\" }) {\n  if (typeof window._nc_dav_properties === \"undefined\") {\n    window._nc_dav_properties = [...defaultDavProperties];\n    window._nc_dav_namespaces = { ...defaultDavNamespaces };\n  }\n  const namespaces = { ...window._nc_dav_namespaces, ...namespace };\n  if (window._nc_dav_properties.find((search) => search === prop)) {\n    logger.warn(`${prop} already registered`, { prop });\n    return false;\n  }\n  if (prop.startsWith(\"<\") || prop.split(\":\").length !== 2) {\n    logger.error(`${prop} is not valid. See example: 'oc:fileid'`, { prop });\n    return false;\n  }\n  const ns = prop.split(\":\")[0];\n  if (!namespaces[ns]) {\n    logger.error(`${prop} namespace unknown`, { prop, namespaces });\n    return false;\n  }\n  window._nc_dav_properties.push(prop);\n  window._nc_dav_namespaces = namespaces;\n  return true;\n};\nconst getDavProperties = function() {\n  if (typeof window._nc_dav_properties === \"undefined\") {\n    window._nc_dav_properties = [...defaultDavProperties];\n  }\n  return window._nc_dav_properties.map((prop) => `<${prop} />`).join(\" \");\n};\nconst getDavNameSpaces = function() {\n  if (typeof window._nc_dav_namespaces === \"undefined\") {\n    window._nc_dav_namespaces = { ...defaultDavNamespaces };\n  }\n  return Object.keys(window._nc_dav_namespaces).map((ns) => `xmlns:${ns}=\"${window._nc_dav_namespaces?.[ns]}\"`).join(\" \");\n};\nconst davGetDefaultPropfind = function() {\n  return `<?xml version=\"1.0\"?>\n\t\t<d:propfind ${getDavNameSpaces()}>\n\t\t\t<d:prop>\n\t\t\t\t${getDavProperties()}\n\t\t\t</d:prop>\n\t\t</d:propfind>`;\n};\nconst davGetFavoritesReport = function() {\n  return `<?xml version=\"1.0\"?>\n\t\t<oc:filter-files ${getDavNameSpaces()}>\n\t\t\t<d:prop>\n\t\t\t\t${getDavProperties()}\n\t\t\t</d:prop>\n\t\t\t<oc:filter-rules>\n\t\t\t\t<oc:favorite>1</oc:favorite>\n\t\t\t</oc:filter-rules>\n\t\t</oc:filter-files>`;\n};\nconst davGetRecentSearch = function(lastModified) {\n  return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<d:searchrequest ${getDavNameSpaces()}\n\txmlns:ns=\"https://github.com/icewind1991/SearchDAV/ns\">\n\t<d:basicsearch>\n\t\t<d:select>\n\t\t\t<d:prop>\n\t\t\t\t${getDavProperties()}\n\t\t\t</d:prop>\n\t\t</d:select>\n\t\t<d:from>\n\t\t\t<d:scope>\n\t\t\t\t<d:href>/files/${getCurrentUser()?.uid}/</d:href>\n\t\t\t\t<d:depth>infinity</d:depth>\n\t\t\t</d:scope>\n\t\t</d:from>\n\t\t<d:where>\n\t\t\t<d:and>\n\t\t\t\t<d:or>\n\t\t\t\t\t<d:not>\n\t\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t<d:getcontenttype/>\n\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t\t<d:literal>httpd/unix-directory</d:literal>\n\t\t\t\t\t\t</d:eq>\n\t\t\t\t\t</d:not>\n\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t<oc:size/>\n\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t<d:literal>0</d:literal>\n\t\t\t\t\t</d:eq>\n\t\t\t\t</d:or>\n\t\t\t\t<d:gt>\n\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t\t</d:prop>\n\t\t\t\t\t<d:literal>${lastModified}</d:literal>\n\t\t\t\t</d:gt>\n\t\t\t</d:and>\n\t\t</d:where>\n\t\t<d:orderby>\n\t\t\t<d:order>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t</d:prop>\n\t\t\t\t<d:descending/>\n\t\t\t</d:order>\n\t\t</d:orderby>\n\t\t<d:limit>\n\t\t\t<d:nresults>100</d:nresults>\n\t\t\t<ns:firstresult>0</ns:firstresult>\n\t\t</d:limit>\n\t</d:basicsearch>\n</d:searchrequest>`;\n};\nconst davParsePermissions = function(permString = \"\") {\n  let permissions = Permission.NONE;\n  if (!permString) {\n    return permissions;\n  }\n  if (permString.includes(\"C\") || permString.includes(\"K\")) {\n    permissions |= Permission.CREATE;\n  }\n  if (permString.includes(\"G\")) {\n    permissions |= Permission.READ;\n  }\n  if (permString.includes(\"W\") || permString.includes(\"N\") || permString.includes(\"V\")) {\n    permissions |= Permission.UPDATE;\n  }\n  if (permString.includes(\"D\")) {\n    permissions |= Permission.DELETE;\n  }\n  if (permString.includes(\"R\")) {\n    permissions |= Permission.SHARE;\n  }\n  return permissions;\n};\nvar FileType = /* @__PURE__ */ ((FileType2) => {\n  FileType2[\"Folder\"] = \"folder\";\n  FileType2[\"File\"] = \"file\";\n  return FileType2;\n})(FileType || {});\nconst isDavRessource = function(source, davService) {\n  return source.match(davService) !== null;\n};\nconst validateData = (data, davService) => {\n  if (data.id && typeof data.id !== \"number\") {\n    throw new Error(\"Invalid id type of value\");\n  }\n  if (!data.source) {\n    throw new Error(\"Missing mandatory source\");\n  }\n  try {\n    new URL(data.source);\n  } catch (e) {\n    throw new Error(\"Invalid source format, source must be a valid URL\");\n  }\n  if (!data.source.startsWith(\"http\")) {\n    throw new Error(\"Invalid source format, only http(s) is supported\");\n  }\n  if (data.displayname && typeof data.displayname !== \"string\") {\n    throw new Error(\"Invalid displayname type\");\n  }\n  if (data.mtime && !(data.mtime instanceof Date)) {\n    throw new Error(\"Invalid mtime type\");\n  }\n  if (data.crtime && !(data.crtime instanceof Date)) {\n    throw new Error(\"Invalid crtime type\");\n  }\n  if (!data.mime || typeof data.mime !== \"string\" || !data.mime.match(/^[-\\w.]+\\/[-+\\w.]+$/gi)) {\n    throw new Error(\"Missing or invalid mandatory mime\");\n  }\n  if (\"size\" in data && typeof data.size !== \"number\" && data.size !== void 0) {\n    throw new Error(\"Invalid size type\");\n  }\n  if (\"permissions\" in data && data.permissions !== void 0 && !(typeof data.permissions === \"number\" && data.permissions >= Permission.NONE && data.permissions <= Permission.ALL)) {\n    throw new Error(\"Invalid permissions\");\n  }\n  if (data.owner && data.owner !== null && typeof data.owner !== \"string\") {\n    throw new Error(\"Invalid owner type\");\n  }\n  if (data.attributes && typeof data.attributes !== \"object\") {\n    throw new Error(\"Invalid attributes type\");\n  }\n  if (data.root && typeof data.root !== \"string\") {\n    throw new Error(\"Invalid root type\");\n  }\n  if (data.root && !data.root.startsWith(\"/\")) {\n    throw new Error(\"Root must start with a leading slash\");\n  }\n  if (data.root && !data.source.includes(data.root)) {\n    throw new Error(\"Root must be part of the source\");\n  }\n  if (data.root && isDavRessource(data.source, davService)) {\n    const service = data.source.match(davService)[0];\n    if (!data.source.includes(join(service, data.root))) {\n      throw new Error(\"The root must be relative to the service. e.g /files/emma\");\n    }\n  }\n  if (data.status && !Object.values(NodeStatus).includes(data.status)) {\n    throw new Error(\"Status must be a valid NodeStatus\");\n  }\n};\nvar NodeStatus = /* @__PURE__ */ ((NodeStatus2) => {\n  NodeStatus2[\"NEW\"] = \"new\";\n  NodeStatus2[\"FAILED\"] = \"failed\";\n  NodeStatus2[\"LOADING\"] = \"loading\";\n  NodeStatus2[\"LOCKED\"] = \"locked\";\n  return NodeStatus2;\n})(NodeStatus || {});\nclass Node {\n  _data;\n  _attributes;\n  _knownDavService = /(remote|public)\\.php\\/(web)?dav/i;\n  readonlyAttributes = Object.entries(Object.getOwnPropertyDescriptors(Node.prototype)).filter((e) => typeof e[1].get === \"function\" && e[0] !== \"__proto__\").map((e) => e[0]);\n  handler = {\n    set: (target, prop, value) => {\n      if (this.readonlyAttributes.includes(prop)) {\n        return false;\n      }\n      return Reflect.set(target, prop, value);\n    },\n    deleteProperty: (target, prop) => {\n      if (this.readonlyAttributes.includes(prop)) {\n        return false;\n      }\n      return Reflect.deleteProperty(target, prop);\n    },\n    // TODO: This is deprecated and only needed for files v3\n    get: (target, prop, receiver) => {\n      if (this.readonlyAttributes.includes(prop)) {\n        logger.warn(`Accessing \"Node.attributes.${prop}\" is deprecated, access it directly on the Node instance.`);\n        return Reflect.get(this, prop);\n      }\n      return Reflect.get(target, prop, receiver);\n    }\n  };\n  constructor(data, davService) {\n    validateData(data, davService || this._knownDavService);\n    this._data = {\n      // TODO: Remove with next major release, this is just for compatibility\n      displayname: data.attributes?.displayname,\n      ...data,\n      attributes: {}\n    };\n    this._attributes = new Proxy(this._data.attributes, this.handler);\n    this.update(data.attributes ?? {});\n    if (davService) {\n      this._knownDavService = davService;\n    }\n  }\n  /**\n   * Get the source url to this object\n   * There is no setter as the source is not meant to be changed manually.\n   * You can use the rename or move method to change the source.\n   */\n  get source() {\n    return this._data.source.replace(/\\/$/i, \"\");\n  }\n  /**\n   * Get the encoded source url to this object for requests purposes\n   */\n  get encodedSource() {\n    const { origin } = new URL(this.source);\n    return origin + encodePath(this.source.slice(origin.length));\n  }\n  /**\n   * Get this object name\n   * There is no setter as the source is not meant to be changed manually.\n   * You can use the rename or move method to change the source.\n   */\n  get basename() {\n    return basename(this.source);\n  }\n  /**\n   * The nodes displayname\n   * By default the display name and the `basename` are identical,\n   * but it is possible to have a different name. This happens\n   * on the files app for example for shared folders.\n   */\n  get displayname() {\n    return this._data.displayname || this.basename;\n  }\n  /**\n   * Set the displayname\n   */\n  set displayname(displayname) {\n    this._data.displayname = displayname;\n  }\n  /**\n   * Get this object's extension\n   * There is no setter as the source is not meant to be changed manually.\n   * You can use the rename or move method to change the source.\n   */\n  get extension() {\n    return extname(this.source);\n  }\n  /**\n   * Get the directory path leading to this object\n   * Will use the relative path to root if available\n   *\n   * There is no setter as the source is not meant to be changed manually.\n   * You can use the rename or move method to change the source.\n   */\n  get dirname() {\n    if (this.root) {\n      let source = this.source;\n      if (this.isDavRessource) {\n        source = source.split(this._knownDavService).pop();\n      }\n      const firstMatch = source.indexOf(this.root);\n      const root = this.root.replace(/\\/$/, \"\");\n      return dirname(source.slice(firstMatch + root.length) || \"/\");\n    }\n    const url = new URL(this.source);\n    return dirname(url.pathname);\n  }\n  /**\n   * Get the file mime\n   * There is no setter as the mime is not meant to be changed\n   */\n  get mime() {\n    return this._data.mime;\n  }\n  /**\n   * Get the file modification time\n   */\n  get mtime() {\n    return this._data.mtime;\n  }\n  /**\n   * Set the file modification time\n   */\n  set mtime(mtime) {\n    this._data.mtime = mtime;\n  }\n  /**\n   * Get the file creation time\n   * There is no setter as the creation time is not meant to be changed\n   */\n  get crtime() {\n    return this._data.crtime;\n  }\n  /**\n   * Get the file size\n   */\n  get size() {\n    return this._data.size;\n  }\n  /**\n   * Set the file size\n   */\n  set size(size) {\n    this.updateMtime();\n    this._data.size = size;\n  }\n  /**\n   * Get the file attribute\n   * This contains all additional attributes not provided by the Node class\n   */\n  get attributes() {\n    return this._attributes;\n  }\n  /**\n   * Get the file permissions\n   */\n  get permissions() {\n    if (this.owner === null && !this.isDavRessource) {\n      return Permission.READ;\n    }\n    return this._data.permissions !== void 0 ? this._data.permissions : Permission.NONE;\n  }\n  /**\n   * Set the file permissions\n   */\n  set permissions(permissions) {\n    this.updateMtime();\n    this._data.permissions = permissions;\n  }\n  /**\n   * Get the file owner\n   * There is no setter as the owner is not meant to be changed\n   */\n  get owner() {\n    if (!this.isDavRessource) {\n      return null;\n    }\n    return this._data.owner;\n  }\n  /**\n   * Is this a dav-related ressource ?\n   */\n  get isDavRessource() {\n    return isDavRessource(this.source, this._knownDavService);\n  }\n  /**\n   * Get the dav root of this object\n   * There is no setter as the root is not meant to be changed\n   */\n  get root() {\n    if (this._data.root) {\n      return this._data.root.replace(/^(.+)\\/$/, \"$1\");\n    }\n    if (this.isDavRessource) {\n      const root = dirname(this.source);\n      return root.split(this._knownDavService).pop() || null;\n    }\n    return null;\n  }\n  /**\n   * Get the absolute path of this object relative to the root\n   */\n  get path() {\n    if (this.root) {\n      let source = this.source;\n      if (this.isDavRessource) {\n        source = source.split(this._knownDavService).pop();\n      }\n      const firstMatch = source.indexOf(this.root);\n      const root = this.root.replace(/\\/$/, \"\");\n      return source.slice(firstMatch + root.length) || \"/\";\n    }\n    return (this.dirname + \"/\" + this.basename).replace(/\\/\\//g, \"/\");\n  }\n  /**\n   * Get the node id if defined.\n   * There is no setter as the fileid is not meant to be changed\n   */\n  get fileid() {\n    return this._data?.id;\n  }\n  /**\n   * Get the node status.\n   */\n  get status() {\n    return this._data?.status;\n  }\n  /**\n   * Set the node status.\n   */\n  set status(status) {\n    this._data.status = status;\n  }\n  /**\n   * Move the node to a new destination\n   *\n   * @param {string} destination the new source.\n   * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg\n   */\n  move(destination) {\n    validateData({ ...this._data, source: destination }, this._knownDavService);\n    const oldBasename = this.basename;\n    this._data.source = destination;\n    if (this.displayname === oldBasename && this.basename !== oldBasename) {\n      this.displayname = this.basename;\n    }\n    this.updateMtime();\n  }\n  /**\n   * Rename the node\n   * This aliases the move method for easier usage\n   *\n   * @param basename The new name of the node\n   */\n  rename(basename2) {\n    if (basename2.includes(\"/\")) {\n      throw new Error(\"Invalid basename\");\n    }\n    this.move(dirname(this.source) + \"/\" + basename2);\n  }\n  /**\n   * Update the mtime if exists\n   */\n  updateMtime() {\n    if (this._data.mtime) {\n      this._data.mtime = /* @__PURE__ */ new Date();\n    }\n  }\n  /**\n   * Update the attributes of the node\n   * Warning, updating attributes will NOT automatically update the mtime.\n   *\n   * @param attributes The new attributes to update on the Node attributes\n   */\n  update(attributes) {\n    for (const [name, value] of Object.entries(attributes)) {\n      try {\n        if (value === void 0) {\n          delete this.attributes[name];\n        } else {\n          this.attributes[name] = value;\n        }\n      } catch (e) {\n        if (e instanceof TypeError) {\n          continue;\n        }\n        throw e;\n      }\n    }\n  }\n}\nclass File extends Node {\n  get type() {\n    return FileType.File;\n  }\n}\nclass Folder extends Node {\n  constructor(data) {\n    super({\n      ...data,\n      mime: \"httpd/unix-directory\"\n    });\n  }\n  get type() {\n    return FileType.Folder;\n  }\n  get extension() {\n    return null;\n  }\n  get mime() {\n    return \"httpd/unix-directory\";\n  }\n}\nfunction davGetRootPath() {\n  if (isPublicShare()) {\n    return `/files/${getSharingToken()}`;\n  }\n  return `/files/${getCurrentUser()?.uid}`;\n}\nconst davRootPath = davGetRootPath();\nfunction davGetRemoteURL() {\n  const url = generateRemoteUrl(\"dav\");\n  if (isPublicShare()) {\n    return url.replace(\"remote.php\", \"public.php\");\n  }\n  return url;\n}\nconst davRemoteURL = davGetRemoteURL();\nconst davGetClient = function(remoteURL = davRemoteURL, headers = {}) {\n  const client = createClient(remoteURL, { headers });\n  function setHeaders(token) {\n    client.setHeaders({\n      ...headers,\n      // Add this so the server knows it is an request from the browser\n      \"X-Requested-With\": \"XMLHttpRequest\",\n      // Inject user auth\n      requesttoken: token ?? \"\"\n    });\n  }\n  onRequestTokenUpdate(setHeaders);\n  setHeaders(getRequestToken());\n  const patcher = getPatcher();\n  patcher.patch(\"fetch\", (url, options) => {\n    const headers2 = options.headers;\n    if (headers2?.method) {\n      options.method = headers2.method;\n      delete headers2.method;\n    }\n    return fetch(url, options);\n  });\n  return client;\n};\nconst getFavoriteNodes = (davClient, path = \"/\", davRoot = davRootPath) => {\n  const controller = new AbortController();\n  return new CancelablePromise(async (resolve, reject, onCancel) => {\n    onCancel(() => controller.abort());\n    try {\n      const contentsResponse = await davClient.getDirectoryContents(`${davRoot}${path}`, {\n        signal: controller.signal,\n        details: true,\n        data: davGetFavoritesReport(),\n        headers: {\n          // see davGetClient for patched webdav client\n          method: \"REPORT\"\n        },\n        includeSelf: true\n      });\n      const nodes = contentsResponse.data.filter((node) => node.filename !== path).map((result) => davResultToNode(result, davRoot));\n      resolve(nodes);\n    } catch (error) {\n      reject(error);\n    }\n  });\n};\nconst davResultToNode = function(node, filesRoot = davRootPath, remoteURL = davRemoteURL) {\n  let userId = getCurrentUser()?.uid;\n  if (isPublicShare()) {\n    userId = userId ?? \"anonymous\";\n  } else if (!userId) {\n    throw new Error(\"No user id found\");\n  }\n  const props = node.props;\n  const permissions = davParsePermissions(props?.permissions);\n  const owner = String(props?.[\"owner-id\"] || userId);\n  const id = props.fileid || 0;\n  const nodeData = {\n    id,\n    source: `${remoteURL}${node.filename}`,\n    mtime: new Date(Date.parse(node.lastmod)),\n    mime: node.mime || \"application/octet-stream\",\n    // Manually cast to work around for https://github.com/perry-mitchell/webdav-client/pull/380\n    displayname: props.displayname !== void 0 ? String(props.displayname) : void 0,\n    size: props?.size || Number.parseInt(props.getcontentlength || \"0\"),\n    // The fileid is set to -1 for failed requests\n    status: id < 0 ? NodeStatus.FAILED : void 0,\n    permissions,\n    owner,\n    root: filesRoot,\n    attributes: {\n      ...node,\n      ...props,\n      hasPreview: props?.[\"has-preview\"]\n    }\n  };\n  delete nodeData.attributes?.props;\n  return node.type === \"file\" ? new File(nodeData) : new Folder(nodeData);\n};\nvar InvalidFilenameErrorReason = /* @__PURE__ */ ((InvalidFilenameErrorReason2) => {\n  InvalidFilenameErrorReason2[\"ReservedName\"] = \"reserved name\";\n  InvalidFilenameErrorReason2[\"Character\"] = \"character\";\n  InvalidFilenameErrorReason2[\"Extension\"] = \"extension\";\n  return InvalidFilenameErrorReason2;\n})(InvalidFilenameErrorReason || {});\nclass InvalidFilenameError extends Error {\n  constructor(options) {\n    super(`Invalid ${options.reason} '${options.segment}' in filename '${options.filename}'`, { cause: options });\n  }\n  /**\n   * The filename that was validated\n   */\n  get filename() {\n    return this.cause.filename;\n  }\n  /**\n   * Reason why the validation failed\n   */\n  get reason() {\n    return this.cause.reason;\n  }\n  /**\n   * Part of the filename that caused this error\n   */\n  get segment() {\n    return this.cause.segment;\n  }\n}\nfunction validateFilename(filename) {\n  const capabilities = getCapabilities().files;\n  const forbiddenCharacters = capabilities.forbidden_filename_characters ?? window._oc_config?.forbidden_filenames_characters ?? [\"/\", \"\\\\\"];\n  for (const character of forbiddenCharacters) {\n    if (filename.includes(character)) {\n      throw new InvalidFilenameError({ segment: character, reason: \"character\", filename });\n    }\n  }\n  filename = filename.toLocaleLowerCase();\n  const forbiddenFilenames = capabilities.forbidden_filenames ?? [\".htaccess\"];\n  if (forbiddenFilenames.includes(filename)) {\n    throw new InvalidFilenameError({\n      filename,\n      segment: filename,\n      reason: \"reserved name\"\n      /* ReservedName */\n    });\n  }\n  const endOfBasename = filename.indexOf(\".\", 1);\n  const basename2 = filename.substring(0, endOfBasename === -1 ? void 0 : endOfBasename);\n  const forbiddenFilenameBasenames = capabilities.forbidden_filename_basenames ?? [];\n  if (forbiddenFilenameBasenames.includes(basename2)) {\n    throw new InvalidFilenameError({\n      filename,\n      segment: basename2,\n      reason: \"reserved name\"\n      /* ReservedName */\n    });\n  }\n  const forbiddenFilenameExtensions = capabilities.forbidden_filename_extensions ?? [\".part\", \".filepart\"];\n  for (const extension of forbiddenFilenameExtensions) {\n    if (filename.length > extension.length && filename.endsWith(extension)) {\n      throw new InvalidFilenameError({ segment: extension, reason: \"extension\", filename });\n    }\n  }\n}\nfunction isFilenameValid(filename) {\n  try {\n    validateFilename(filename);\n    return true;\n  } catch (error) {\n    if (error instanceof InvalidFilenameError) {\n      return false;\n    }\n    throw error;\n  }\n}\nfunction getUniqueName(name, otherNames, options) {\n  const opts = {\n    suffix: (n) => `(${n})`,\n    ignoreFileExtension: false,\n    ...options\n  };\n  let newName = name;\n  let i = 1;\n  while (otherNames.includes(newName)) {\n    const ext = opts.ignoreFileExtension ? \"\" : extname(name);\n    const base = basename(name, ext);\n    newName = `${base} ${opts.suffix(i++)}${ext}`;\n  }\n  return newName;\n}\nconst humanList = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\"];\nconst humanListBinary = [\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\"];\nfunction formatFileSize(size, skipSmallSizes = false, binaryPrefixes = false, base1000 = false) {\n  binaryPrefixes = binaryPrefixes && !base1000;\n  if (typeof size === \"string\") {\n    size = Number(size);\n  }\n  let order = size > 0 ? Math.floor(Math.log(size) / Math.log(base1000 ? 1e3 : 1024)) : 0;\n  order = Math.min((binaryPrefixes ? humanListBinary.length : humanList.length) - 1, order);\n  const readableFormat = binaryPrefixes ? humanListBinary[order] : humanList[order];\n  let relativeSize = (size / Math.pow(base1000 ? 1e3 : 1024, order)).toFixed(1);\n  if (skipSmallSizes === true && order === 0) {\n    return (relativeSize !== \"0.0\" ? \"< 1 \" : \"0 \") + (binaryPrefixes ? humanListBinary[1] : humanList[1]);\n  }\n  if (order < 2) {\n    relativeSize = parseFloat(relativeSize).toFixed(0);\n  } else {\n    relativeSize = parseFloat(relativeSize).toLocaleString(getCanonicalLocale());\n  }\n  return relativeSize + \" \" + readableFormat;\n}\nfunction parseFileSize(value, forceBinary = false) {\n  try {\n    value = `${value}`.toLocaleLowerCase().replaceAll(/\\s+/g, \"\").replaceAll(\",\", \".\");\n  } catch (e) {\n    return null;\n  }\n  const match = value.match(/^([0-9]*(\\.[0-9]*)?)([kmgtp]?)(i?)b?$/);\n  if (match === null || match[1] === \".\" || match[1] === \"\") {\n    return null;\n  }\n  const bytesArray = {\n    \"\": 0,\n    k: 1,\n    m: 2,\n    g: 3,\n    t: 4,\n    p: 5,\n    e: 6\n  };\n  const decimalString = `${match[1]}`;\n  const base = match[4] === \"i\" || forceBinary ? 1024 : 1e3;\n  return Math.round(Number.parseFloat(decimalString) * base ** bytesArray[match[3]]);\n}\nfunction stringify(value) {\n  if (value instanceof Date) {\n    return value.toISOString();\n  }\n  return String(value);\n}\nfunction orderBy(collection, identifiers2, orders) {\n  identifiers2 = identifiers2 ?? [(value) => value];\n  orders = orders ?? [];\n  const sorting = identifiers2.map((_, index) => (orders[index] ?? \"asc\") === \"asc\" ? 1 : -1);\n  const collator = Intl.Collator(\n    [getLanguage(), getCanonicalLocale()],\n    {\n      // handle 10 as ten and not as one-zero\n      numeric: true,\n      usage: \"sort\"\n    }\n  );\n  return [...collection].sort((a, b) => {\n    for (const [index, identifier] of identifiers2.entries()) {\n      const value = collator.compare(stringify(identifier(a)), stringify(identifier(b)));\n      if (value !== 0) {\n        return value * sorting[index];\n      }\n    }\n    return 0;\n  });\n}\nvar FilesSortingMode = /* @__PURE__ */ ((FilesSortingMode2) => {\n  FilesSortingMode2[\"Name\"] = \"basename\";\n  FilesSortingMode2[\"Modified\"] = \"mtime\";\n  FilesSortingMode2[\"Size\"] = \"size\";\n  return FilesSortingMode2;\n})(FilesSortingMode || {});\nfunction sortNodes(nodes, options = {}) {\n  const sortingOptions = {\n    // Default to sort by name\n    sortingMode: \"basename\",\n    // Default to sort ascending\n    sortingOrder: \"asc\",\n    ...options\n  };\n  const basename2 = (name) => name.lastIndexOf(\".\") > 0 ? name.slice(0, name.lastIndexOf(\".\")) : name;\n  const identifiers2 = [\n    // 1: Sort favorites first if enabled\n    ...sortingOptions.sortFavoritesFirst ? [(v) => v.attributes?.favorite !== 1] : [],\n    // 2: Sort folders first if sorting by name\n    ...sortingOptions.sortFoldersFirst ? [(v) => v.type !== \"folder\"] : [],\n    // 3: Use sorting mode if NOT basename (to be able to use display name too)\n    ...sortingOptions.sortingMode !== \"basename\" ? [(v) => v[sortingOptions.sortingMode]] : [],\n    // 4: Use display name if available, fallback to name\n    (v) => basename2(v.attributes?.displayname || v.basename),\n    // 5: Finally, use basename if all previous sorting methods failed\n    (v) => v.basename\n  ];\n  const orders = [\n    // (for 1): always sort favorites before normal files\n    ...sortingOptions.sortFavoritesFirst ? [\"asc\"] : [],\n    // (for 2): always sort folders before files\n    ...sortingOptions.sortFoldersFirst ? [\"asc\"] : [],\n    // (for 3): Reverse if sorting by mtime as mtime higher means edited more recent -> lower\n    ...sortingOptions.sortingMode === \"mtime\" ? [sortingOptions.sortingOrder === \"asc\" ? \"desc\" : \"asc\"] : [],\n    // (also for 3 so make sure not to conflict with 2 and 3)\n    ...sortingOptions.sortingMode !== \"mtime\" && sortingOptions.sortingMode !== \"basename\" ? [sortingOptions.sortingOrder] : [],\n    // for 4: use configured sorting direction\n    sortingOptions.sortingOrder,\n    // for 5: use configured sorting direction\n    sortingOptions.sortingOrder\n  ];\n  return orderBy(nodes, identifiers2, orders);\n}\nclass Navigation extends TypedEventTarget {\n  _views = [];\n  _currentView = null;\n  /**\n   * Register a new view on the navigation\n   * @param view The view to register\n   * @throws `Error` is thrown if a view with the same id is already registered\n   */\n  register(view) {\n    if (this._views.find((search) => search.id === view.id)) {\n      throw new Error(`View id ${view.id} is already registered`);\n    }\n    this._views.push(view);\n    this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n  }\n  /**\n   * Remove a registered view\n   * @param id The id of the view to remove\n   */\n  remove(id) {\n    const index = this._views.findIndex((view) => view.id === id);\n    if (index !== -1) {\n      this._views.splice(index, 1);\n      this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n    }\n  }\n  /**\n   * Set the currently active view\n   * @fires UpdateActiveViewEvent\n   * @param view New active view\n   */\n  setActive(view) {\n    this._currentView = view;\n    const event = new CustomEvent(\"updateActive\", { detail: view });\n    this.dispatchTypedEvent(\"updateActive\", event);\n  }\n  /**\n   * The currently active files view\n   */\n  get active() {\n    return this._currentView;\n  }\n  /**\n   * All registered views\n   */\n  get views() {\n    return this._views;\n  }\n}\nconst getNavigation = function() {\n  if (typeof window._nc_navigation === \"undefined\") {\n    window._nc_navigation = new Navigation();\n    logger.debug(\"Navigation service initialized\");\n  }\n  return window._nc_navigation;\n};\nclass Column {\n  _column;\n  constructor(column) {\n    isValidColumn(column);\n    this._column = column;\n  }\n  get id() {\n    return this._column.id;\n  }\n  get title() {\n    return this._column.title;\n  }\n  get render() {\n    return this._column.render;\n  }\n  get sort() {\n    return this._column.sort;\n  }\n  get summary() {\n    return this._column.summary;\n  }\n}\nconst isValidColumn = function(column) {\n  if (!column.id || typeof column.id !== \"string\") {\n    throw new Error(\"A column id is required\");\n  }\n  if (!column.title || typeof column.title !== \"string\") {\n    throw new Error(\"A column title is required\");\n  }\n  if (!column.render || typeof column.render !== \"function\") {\n    throw new Error(\"A render function is required\");\n  }\n  if (column.sort && typeof column.sort !== \"function\") {\n    throw new Error(\"Column sortFunction must be a function\");\n  }\n  if (column.summary && typeof column.summary !== \"function\") {\n    throw new Error(\"Column summary must be a function\");\n  }\n  return true;\n};\nfunction getDefaultExportFromCjs(x) {\n  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, \"default\") ? x[\"default\"] : x;\n}\nvar validator$2 = {};\nvar util$3 = {};\n(function(exports) {\n  const nameStartChar = \":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\";\n  const nameChar = nameStartChar + \"\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n  const nameRegexp = \"[\" + nameStartChar + \"][\" + nameChar + \"]*\";\n  const regexName = new RegExp(\"^\" + nameRegexp + \"$\");\n  const getAllMatches = function(string, regex) {\n    const matches = [];\n    let match = regex.exec(string);\n    while (match) {\n      const allmatches = [];\n      allmatches.startIndex = regex.lastIndex - match[0].length;\n      const len = match.length;\n      for (let index = 0; index < len; index++) {\n        allmatches.push(match[index]);\n      }\n      matches.push(allmatches);\n      match = regex.exec(string);\n    }\n    return matches;\n  };\n  const isName = function(string) {\n    const match = regexName.exec(string);\n    return !(match === null || typeof match === \"undefined\");\n  };\n  exports.isExist = function(v) {\n    return typeof v !== \"undefined\";\n  };\n  exports.isEmptyObject = function(obj) {\n    return Object.keys(obj).length === 0;\n  };\n  exports.merge = function(target, a, arrayMode) {\n    if (a) {\n      const keys = Object.keys(a);\n      const len = keys.length;\n      for (let i = 0; i < len; i++) {\n        if (arrayMode === \"strict\") {\n          target[keys[i]] = [a[keys[i]]];\n        } else {\n          target[keys[i]] = a[keys[i]];\n        }\n      }\n    }\n  };\n  exports.getValue = function(v) {\n    if (exports.isExist(v)) {\n      return v;\n    } else {\n      return \"\";\n    }\n  };\n  exports.isName = isName;\n  exports.getAllMatches = getAllMatches;\n  exports.nameRegexp = nameRegexp;\n})(util$3);\nconst util$2 = util$3;\nconst defaultOptions$2 = {\n  allowBooleanAttributes: false,\n  //A tag can have attributes without any value\n  unpairedTags: []\n};\nvalidator$2.validate = function(xmlData, options) {\n  options = Object.assign({}, defaultOptions$2, options);\n  const tags = [];\n  let tagFound = false;\n  let reachedRoot = false;\n  if (xmlData[0] === \"\\uFEFF\") {\n    xmlData = xmlData.substr(1);\n  }\n  for (let i = 0; i < xmlData.length; i++) {\n    if (xmlData[i] === \"<\" && xmlData[i + 1] === \"?\") {\n      i += 2;\n      i = readPI(xmlData, i);\n      if (i.err) return i;\n    } else if (xmlData[i] === \"<\") {\n      let tagStartPos = i;\n      i++;\n      if (xmlData[i] === \"!\") {\n        i = readCommentAndCDATA(xmlData, i);\n        continue;\n      } else {\n        let closingTag = false;\n        if (xmlData[i] === \"/\") {\n          closingTag = true;\n          i++;\n        }\n        let tagName = \"\";\n        for (; i < xmlData.length && xmlData[i] !== \">\" && xmlData[i] !== \" \" && xmlData[i] !== \"\t\" && xmlData[i] !== \"\\n\" && xmlData[i] !== \"\\r\"; i++) {\n          tagName += xmlData[i];\n        }\n        tagName = tagName.trim();\n        if (tagName[tagName.length - 1] === \"/\") {\n          tagName = tagName.substring(0, tagName.length - 1);\n          i--;\n        }\n        if (!validateTagName(tagName)) {\n          let msg;\n          if (tagName.trim().length === 0) {\n            msg = \"Invalid space after '<'.\";\n          } else {\n            msg = \"Tag '\" + tagName + \"' is an invalid name.\";\n          }\n          return getErrorObject(\"InvalidTag\", msg, getLineNumberForPosition(xmlData, i));\n        }\n        const result = readAttributeStr(xmlData, i);\n        if (result === false) {\n          return getErrorObject(\"InvalidAttr\", \"Attributes for '\" + tagName + \"' have open quote.\", getLineNumberForPosition(xmlData, i));\n        }\n        let attrStr = result.value;\n        i = result.index;\n        if (attrStr[attrStr.length - 1] === \"/\") {\n          const attrStrStart = i - attrStr.length;\n          attrStr = attrStr.substring(0, attrStr.length - 1);\n          const isValid = validateAttributeString(attrStr, options);\n          if (isValid === true) {\n            tagFound = true;\n          } else {\n            return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));\n          }\n        } else if (closingTag) {\n          if (!result.tagClosed) {\n            return getErrorObject(\"InvalidTag\", \"Closing tag '\" + tagName + \"' doesn't have proper closing.\", getLineNumberForPosition(xmlData, i));\n          } else if (attrStr.trim().length > 0) {\n            return getErrorObject(\"InvalidTag\", \"Closing tag '\" + tagName + \"' can't have attributes or invalid starting.\", getLineNumberForPosition(xmlData, tagStartPos));\n          } else if (tags.length === 0) {\n            return getErrorObject(\"InvalidTag\", \"Closing tag '\" + tagName + \"' has not been opened.\", getLineNumberForPosition(xmlData, tagStartPos));\n          } else {\n            const otg = tags.pop();\n            if (tagName !== otg.tagName) {\n              let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);\n              return getErrorObject(\n                \"InvalidTag\",\n                \"Expected closing tag '\" + otg.tagName + \"' (opened in line \" + openPos.line + \", col \" + openPos.col + \") instead of closing tag '\" + tagName + \"'.\",\n                getLineNumberForPosition(xmlData, tagStartPos)\n              );\n            }\n            if (tags.length == 0) {\n              reachedRoot = true;\n            }\n          }\n        } else {\n          const isValid = validateAttributeString(attrStr, options);\n          if (isValid !== true) {\n            return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));\n          }\n          if (reachedRoot === true) {\n            return getErrorObject(\"InvalidXml\", \"Multiple possible root nodes found.\", getLineNumberForPosition(xmlData, i));\n          } else if (options.unpairedTags.indexOf(tagName) !== -1) ;\n          else {\n            tags.push({ tagName, tagStartPos });\n          }\n          tagFound = true;\n        }\n        for (i++; i < xmlData.length; i++) {\n          if (xmlData[i] === \"<\") {\n            if (xmlData[i + 1] === \"!\") {\n              i++;\n              i = readCommentAndCDATA(xmlData, i);\n              continue;\n            } else if (xmlData[i + 1] === \"?\") {\n              i = readPI(xmlData, ++i);\n              if (i.err) return i;\n            } else {\n              break;\n            }\n          } else if (xmlData[i] === \"&\") {\n            const afterAmp = validateAmpersand(xmlData, i);\n            if (afterAmp == -1)\n              return getErrorObject(\"InvalidChar\", \"char '&' is not expected.\", getLineNumberForPosition(xmlData, i));\n            i = afterAmp;\n          } else {\n            if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {\n              return getErrorObject(\"InvalidXml\", \"Extra text at the end\", getLineNumberForPosition(xmlData, i));\n            }\n          }\n        }\n        if (xmlData[i] === \"<\") {\n          i--;\n        }\n      }\n    } else {\n      if (isWhiteSpace(xmlData[i])) {\n        continue;\n      }\n      return getErrorObject(\"InvalidChar\", \"char '\" + xmlData[i] + \"' is not expected.\", getLineNumberForPosition(xmlData, i));\n    }\n  }\n  if (!tagFound) {\n    return getErrorObject(\"InvalidXml\", \"Start tag expected.\", 1);\n  } else if (tags.length == 1) {\n    return getErrorObject(\"InvalidTag\", \"Unclosed tag '\" + tags[0].tagName + \"'.\", getLineNumberForPosition(xmlData, tags[0].tagStartPos));\n  } else if (tags.length > 0) {\n    return getErrorObject(\"InvalidXml\", \"Invalid '\" + JSON.stringify(tags.map((t2) => t2.tagName), null, 4).replace(/\\r?\\n/g, \"\") + \"' found.\", { line: 1, col: 1 });\n  }\n  return true;\n};\nfunction isWhiteSpace(char) {\n  return char === \" \" || char === \"\t\" || char === \"\\n\" || char === \"\\r\";\n}\nfunction readPI(xmlData, i) {\n  const start = i;\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] == \"?\" || xmlData[i] == \" \") {\n      const tagname = xmlData.substr(start, i - start);\n      if (i > 5 && tagname === \"xml\") {\n        return getErrorObject(\"InvalidXml\", \"XML declaration allowed only at the start of the document.\", getLineNumberForPosition(xmlData, i));\n      } else if (xmlData[i] == \"?\" && xmlData[i + 1] == \">\") {\n        i++;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  return i;\n}\nfunction readCommentAndCDATA(xmlData, i) {\n  if (xmlData.length > i + 5 && xmlData[i + 1] === \"-\" && xmlData[i + 2] === \"-\") {\n    for (i += 3; i < xmlData.length; i++) {\n      if (xmlData[i] === \"-\" && xmlData[i + 1] === \"-\" && xmlData[i + 2] === \">\") {\n        i += 2;\n        break;\n      }\n    }\n  } else if (xmlData.length > i + 8 && xmlData[i + 1] === \"D\" && xmlData[i + 2] === \"O\" && xmlData[i + 3] === \"C\" && xmlData[i + 4] === \"T\" && xmlData[i + 5] === \"Y\" && xmlData[i + 6] === \"P\" && xmlData[i + 7] === \"E\") {\n    let angleBracketsCount = 1;\n    for (i += 8; i < xmlData.length; i++) {\n      if (xmlData[i] === \"<\") {\n        angleBracketsCount++;\n      } else if (xmlData[i] === \">\") {\n        angleBracketsCount--;\n        if (angleBracketsCount === 0) {\n          break;\n        }\n      }\n    }\n  } else if (xmlData.length > i + 9 && xmlData[i + 1] === \"[\" && xmlData[i + 2] === \"C\" && xmlData[i + 3] === \"D\" && xmlData[i + 4] === \"A\" && xmlData[i + 5] === \"T\" && xmlData[i + 6] === \"A\" && xmlData[i + 7] === \"[\") {\n    for (i += 8; i < xmlData.length; i++) {\n      if (xmlData[i] === \"]\" && xmlData[i + 1] === \"]\" && xmlData[i + 2] === \">\") {\n        i += 2;\n        break;\n      }\n    }\n  }\n  return i;\n}\nconst doubleQuote = '\"';\nconst singleQuote = \"'\";\nfunction readAttributeStr(xmlData, i) {\n  let attrStr = \"\";\n  let startChar = \"\";\n  let tagClosed = false;\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {\n      if (startChar === \"\") {\n        startChar = xmlData[i];\n      } else if (startChar !== xmlData[i]) ;\n      else {\n        startChar = \"\";\n      }\n    } else if (xmlData[i] === \">\") {\n      if (startChar === \"\") {\n        tagClosed = true;\n        break;\n      }\n    }\n    attrStr += xmlData[i];\n  }\n  if (startChar !== \"\") {\n    return false;\n  }\n  return {\n    value: attrStr,\n    index: i,\n    tagClosed\n  };\n}\nconst validAttrStrRegxp = new RegExp(`(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*(['\"])(([\\\\s\\\\S])*?)\\\\5)?`, \"g\");\nfunction validateAttributeString(attrStr, options) {\n  const matches = util$2.getAllMatches(attrStr, validAttrStrRegxp);\n  const attrNames = {};\n  for (let i = 0; i < matches.length; i++) {\n    if (matches[i][1].length === 0) {\n      return getErrorObject(\"InvalidAttr\", \"Attribute '\" + matches[i][2] + \"' has no space in starting.\", getPositionFromMatch(matches[i]));\n    } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) {\n      return getErrorObject(\"InvalidAttr\", \"Attribute '\" + matches[i][2] + \"' is without value.\", getPositionFromMatch(matches[i]));\n    } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) {\n      return getErrorObject(\"InvalidAttr\", \"boolean attribute '\" + matches[i][2] + \"' is not allowed.\", getPositionFromMatch(matches[i]));\n    }\n    const attrName = matches[i][2];\n    if (!validateAttrName(attrName)) {\n      return getErrorObject(\"InvalidAttr\", \"Attribute '\" + attrName + \"' is an invalid name.\", getPositionFromMatch(matches[i]));\n    }\n    if (!attrNames.hasOwnProperty(attrName)) {\n      attrNames[attrName] = 1;\n    } else {\n      return getErrorObject(\"InvalidAttr\", \"Attribute '\" + attrName + \"' is repeated.\", getPositionFromMatch(matches[i]));\n    }\n  }\n  return true;\n}\nfunction validateNumberAmpersand(xmlData, i) {\n  let re2 = /\\d/;\n  if (xmlData[i] === \"x\") {\n    i++;\n    re2 = /[\\da-fA-F]/;\n  }\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] === \";\")\n      return i;\n    if (!xmlData[i].match(re2))\n      break;\n  }\n  return -1;\n}\nfunction validateAmpersand(xmlData, i) {\n  i++;\n  if (xmlData[i] === \";\")\n    return -1;\n  if (xmlData[i] === \"#\") {\n    i++;\n    return validateNumberAmpersand(xmlData, i);\n  }\n  let count = 0;\n  for (; i < xmlData.length; i++, count++) {\n    if (xmlData[i].match(/\\w/) && count < 20)\n      continue;\n    if (xmlData[i] === \";\")\n      break;\n    return -1;\n  }\n  return i;\n}\nfunction getErrorObject(code, message, lineNumber) {\n  return {\n    err: {\n      code,\n      msg: message,\n      line: lineNumber.line || lineNumber,\n      col: lineNumber.col\n    }\n  };\n}\nfunction validateAttrName(attrName) {\n  return util$2.isName(attrName);\n}\nfunction validateTagName(tagname) {\n  return util$2.isName(tagname);\n}\nfunction getLineNumberForPosition(xmlData, index) {\n  const lines = xmlData.substring(0, index).split(/\\r?\\n/);\n  return {\n    line: lines.length,\n    // column number is last line's length + 1, because column numbering starts at 1:\n    col: lines[lines.length - 1].length + 1\n  };\n}\nfunction getPositionFromMatch(match) {\n  return match.startIndex + match[1].length;\n}\nvar OptionsBuilder = {};\nconst defaultOptions$1 = {\n  preserveOrder: false,\n  attributeNamePrefix: \"@_\",\n  attributesGroupName: false,\n  textNodeName: \"#text\",\n  ignoreAttributes: true,\n  removeNSPrefix: false,\n  // remove NS from tag name or attribute name if true\n  allowBooleanAttributes: false,\n  //a tag can have attributes without any value\n  //ignoreRootElement : false,\n  parseTagValue: true,\n  parseAttributeValue: false,\n  trimValues: true,\n  //Trim string values of tag and attributes\n  cdataPropName: false,\n  numberParseOptions: {\n    hex: true,\n    leadingZeros: true,\n    eNotation: true\n  },\n  tagValueProcessor: function(tagName, val2) {\n    return val2;\n  },\n  attributeValueProcessor: function(attrName, val2) {\n    return val2;\n  },\n  stopNodes: [],\n  //nested tags will not be parsed even for errors\n  alwaysCreateTextNode: false,\n  isArray: () => false,\n  commentPropName: false,\n  unpairedTags: [],\n  processEntities: true,\n  htmlEntities: false,\n  ignoreDeclaration: false,\n  ignorePiTags: false,\n  transformTagName: false,\n  transformAttributeName: false,\n  updateTag: function(tagName, jPath, attrs) {\n    return tagName;\n  }\n  // skipEmptyListItem: false\n};\nconst buildOptions$1 = function(options) {\n  return Object.assign({}, defaultOptions$1, options);\n};\nOptionsBuilder.buildOptions = buildOptions$1;\nOptionsBuilder.defaultOptions = defaultOptions$1;\nclass XmlNode {\n  constructor(tagname) {\n    this.tagname = tagname;\n    this.child = [];\n    this[\":@\"] = {};\n  }\n  add(key, val2) {\n    if (key === \"__proto__\") key = \"#__proto__\";\n    this.child.push({ [key]: val2 });\n  }\n  addChild(node) {\n    if (node.tagname === \"__proto__\") node.tagname = \"#__proto__\";\n    if (node[\":@\"] && Object.keys(node[\":@\"]).length > 0) {\n      this.child.push({ [node.tagname]: node.child, [\":@\"]: node[\":@\"] });\n    } else {\n      this.child.push({ [node.tagname]: node.child });\n    }\n  }\n}\nvar xmlNode$1 = XmlNode;\nconst util$1 = util$3;\nfunction readDocType$1(xmlData, i) {\n  const entities = {};\n  if (xmlData[i + 3] === \"O\" && xmlData[i + 4] === \"C\" && xmlData[i + 5] === \"T\" && xmlData[i + 6] === \"Y\" && xmlData[i + 7] === \"P\" && xmlData[i + 8] === \"E\") {\n    i = i + 9;\n    let angleBracketsCount = 1;\n    let hasBody = false, comment = false;\n    let exp = \"\";\n    for (; i < xmlData.length; i++) {\n      if (xmlData[i] === \"<\" && !comment) {\n        if (hasBody && isEntity(xmlData, i)) {\n          i += 7;\n          [entityName, val, i] = readEntityExp(xmlData, i + 1);\n          if (val.indexOf(\"&\") === -1)\n            entities[validateEntityName(entityName)] = {\n              regx: RegExp(`&${entityName};`, \"g\"),\n              val\n            };\n        } else if (hasBody && isElement(xmlData, i)) i += 8;\n        else if (hasBody && isAttlist(xmlData, i)) i += 8;\n        else if (hasBody && isNotation(xmlData, i)) i += 9;\n        else if (isComment) comment = true;\n        else throw new Error(\"Invalid DOCTYPE\");\n        angleBracketsCount++;\n        exp = \"\";\n      } else if (xmlData[i] === \">\") {\n        if (comment) {\n          if (xmlData[i - 1] === \"-\" && xmlData[i - 2] === \"-\") {\n            comment = false;\n            angleBracketsCount--;\n          }\n        } else {\n          angleBracketsCount--;\n        }\n        if (angleBracketsCount === 0) {\n          break;\n        }\n      } else if (xmlData[i] === \"[\") {\n        hasBody = true;\n      } else {\n        exp += xmlData[i];\n      }\n    }\n    if (angleBracketsCount !== 0) {\n      throw new Error(`Unclosed DOCTYPE`);\n    }\n  } else {\n    throw new Error(`Invalid Tag instead of DOCTYPE`);\n  }\n  return { entities, i };\n}\nfunction readEntityExp(xmlData, i) {\n  let entityName2 = \"\";\n  for (; i < xmlData.length && (xmlData[i] !== \"'\" && xmlData[i] !== '\"'); i++) {\n    entityName2 += xmlData[i];\n  }\n  entityName2 = entityName2.trim();\n  if (entityName2.indexOf(\" \") !== -1) throw new Error(\"External entites are not supported\");\n  const startChar = xmlData[i++];\n  let val2 = \"\";\n  for (; i < xmlData.length && xmlData[i] !== startChar; i++) {\n    val2 += xmlData[i];\n  }\n  return [entityName2, val2, i];\n}\nfunction isComment(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"-\" && xmlData[i + 3] === \"-\") return true;\n  return false;\n}\nfunction isEntity(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"E\" && xmlData[i + 3] === \"N\" && xmlData[i + 4] === \"T\" && xmlData[i + 5] === \"I\" && xmlData[i + 6] === \"T\" && xmlData[i + 7] === \"Y\") return true;\n  return false;\n}\nfunction isElement(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"E\" && xmlData[i + 3] === \"L\" && xmlData[i + 4] === \"E\" && xmlData[i + 5] === \"M\" && xmlData[i + 6] === \"E\" && xmlData[i + 7] === \"N\" && xmlData[i + 8] === \"T\") return true;\n  return false;\n}\nfunction isAttlist(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"A\" && xmlData[i + 3] === \"T\" && xmlData[i + 4] === \"T\" && xmlData[i + 5] === \"L\" && xmlData[i + 6] === \"I\" && xmlData[i + 7] === \"S\" && xmlData[i + 8] === \"T\") return true;\n  return false;\n}\nfunction isNotation(xmlData, i) {\n  if (xmlData[i + 1] === \"!\" && xmlData[i + 2] === \"N\" && xmlData[i + 3] === \"O\" && xmlData[i + 4] === \"T\" && xmlData[i + 5] === \"A\" && xmlData[i + 6] === \"T\" && xmlData[i + 7] === \"I\" && xmlData[i + 8] === \"O\" && xmlData[i + 9] === \"N\") return true;\n  return false;\n}\nfunction validateEntityName(name) {\n  if (util$1.isName(name))\n    return name;\n  else\n    throw new Error(`Invalid entity name ${name}`);\n}\nvar DocTypeReader = readDocType$1;\nconst hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;\nconst numRegex = /^([\\-\\+])?(0*)(\\.[0-9]+([eE]\\-?[0-9]+)?|[0-9]+(\\.[0-9]+([eE]\\-?[0-9]+)?)?)$/;\nif (!Number.parseInt && window.parseInt) {\n  Number.parseInt = window.parseInt;\n}\nif (!Number.parseFloat && window.parseFloat) {\n  Number.parseFloat = window.parseFloat;\n}\nconst consider = {\n  hex: true,\n  leadingZeros: true,\n  decimalPoint: \".\",\n  eNotation: true\n  //skipLike: /regex/\n};\nfunction toNumber$1(str, options = {}) {\n  options = Object.assign({}, consider, options);\n  if (!str || typeof str !== \"string\") return str;\n  let trimmedStr = str.trim();\n  if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str;\n  else if (options.hex && hexRegex.test(trimmedStr)) {\n    return Number.parseInt(trimmedStr, 16);\n  } else {\n    const match = numRegex.exec(trimmedStr);\n    if (match) {\n      const sign = match[1];\n      const leadingZeros = match[2];\n      let numTrimmedByZeros = trimZeros(match[3]);\n      const eNotation = match[4] || match[6];\n      if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== \".\") return str;\n      else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== \".\") return str;\n      else {\n        const num = Number(trimmedStr);\n        const numStr = \"\" + num;\n        if (numStr.search(/[eE]/) !== -1) {\n          if (options.eNotation) return num;\n          else return str;\n        } else if (eNotation) {\n          if (options.eNotation) return num;\n          else return str;\n        } else if (trimmedStr.indexOf(\".\") !== -1) {\n          if (numStr === \"0\" && numTrimmedByZeros === \"\") return num;\n          else if (numStr === numTrimmedByZeros) return num;\n          else if (sign && numStr === \"-\" + numTrimmedByZeros) return num;\n          else return str;\n        }\n        if (leadingZeros) {\n          if (numTrimmedByZeros === numStr) return num;\n          else if (sign + numTrimmedByZeros === numStr) return num;\n          else return str;\n        }\n        if (trimmedStr === numStr) return num;\n        else if (trimmedStr === sign + numStr) return num;\n        return str;\n      }\n    } else {\n      return str;\n    }\n  }\n}\nfunction trimZeros(numStr) {\n  if (numStr && numStr.indexOf(\".\") !== -1) {\n    numStr = numStr.replace(/0+$/, \"\");\n    if (numStr === \".\") numStr = \"0\";\n    else if (numStr[0] === \".\") numStr = \"0\" + numStr;\n    else if (numStr[numStr.length - 1] === \".\") numStr = numStr.substr(0, numStr.length - 1);\n    return numStr;\n  }\n  return numStr;\n}\nvar strnum = toNumber$1;\nconst util = util$3;\nconst xmlNode = xmlNode$1;\nconst readDocType = DocTypeReader;\nconst toNumber = strnum;\nlet OrderedObjParser$1 = class OrderedObjParser {\n  constructor(options) {\n    this.options = options;\n    this.currentNode = null;\n    this.tagsNodeStack = [];\n    this.docTypeEntities = {};\n    this.lastEntities = {\n      \"apos\": { regex: /&(apos|#39|#x27);/g, val: \"'\" },\n      \"gt\": { regex: /&(gt|#62|#x3E);/g, val: \">\" },\n      \"lt\": { regex: /&(lt|#60|#x3C);/g, val: \"<\" },\n      \"quot\": { regex: /&(quot|#34|#x22);/g, val: '\"' }\n    };\n    this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: \"&\" };\n    this.htmlEntities = {\n      \"space\": { regex: /&(nbsp|#160);/g, val: \" \" },\n      // \"lt\" : { regex: /&(lt|#60);/g, val: \"<\" },\n      // \"gt\" : { regex: /&(gt|#62);/g, val: \">\" },\n      // \"amp\" : { regex: /&(amp|#38);/g, val: \"&\" },\n      // \"quot\" : { regex: /&(quot|#34);/g, val: \"\\\"\" },\n      // \"apos\" : { regex: /&(apos|#39);/g, val: \"'\" },\n      \"cent\": { regex: /&(cent|#162);/g, val: \"¢\" },\n      \"pound\": { regex: /&(pound|#163);/g, val: \"£\" },\n      \"yen\": { regex: /&(yen|#165);/g, val: \"¥\" },\n      \"euro\": { regex: /&(euro|#8364);/g, val: \"€\" },\n      \"copyright\": { regex: /&(copy|#169);/g, val: \"©\" },\n      \"reg\": { regex: /&(reg|#174);/g, val: \"®\" },\n      \"inr\": { regex: /&(inr|#8377);/g, val: \"₹\" },\n      \"num_dec\": { regex: /&#([0-9]{1,7});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 10)) },\n      \"num_hex\": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => String.fromCharCode(Number.parseInt(str, 16)) }\n    };\n    this.addExternalEntities = addExternalEntities;\n    this.parseXml = parseXml;\n    this.parseTextData = parseTextData;\n    this.resolveNameSpace = resolveNameSpace;\n    this.buildAttributesMap = buildAttributesMap;\n    this.isItStopNode = isItStopNode;\n    this.replaceEntitiesValue = replaceEntitiesValue$1;\n    this.readStopNodeData = readStopNodeData;\n    this.saveTextToParentTag = saveTextToParentTag;\n    this.addChild = addChild;\n  }\n};\nfunction addExternalEntities(externalEntities) {\n  const entKeys = Object.keys(externalEntities);\n  for (let i = 0; i < entKeys.length; i++) {\n    const ent = entKeys[i];\n    this.lastEntities[ent] = {\n      regex: new RegExp(\"&\" + ent + \";\", \"g\"),\n      val: externalEntities[ent]\n    };\n  }\n}\nfunction parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {\n  if (val2 !== void 0) {\n    if (this.options.trimValues && !dontTrim) {\n      val2 = val2.trim();\n    }\n    if (val2.length > 0) {\n      if (!escapeEntities) val2 = this.replaceEntitiesValue(val2);\n      const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode);\n      if (newval === null || newval === void 0) {\n        return val2;\n      } else if (typeof newval !== typeof val2 || newval !== val2) {\n        return newval;\n      } else if (this.options.trimValues) {\n        return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions);\n      } else {\n        const trimmedVal = val2.trim();\n        if (trimmedVal === val2) {\n          return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions);\n        } else {\n          return val2;\n        }\n      }\n    }\n  }\n}\nfunction resolveNameSpace(tagname) {\n  if (this.options.removeNSPrefix) {\n    const tags = tagname.split(\":\");\n    const prefix = tagname.charAt(0) === \"/\" ? \"/\" : \"\";\n    if (tags[0] === \"xmlns\") {\n      return \"\";\n    }\n    if (tags.length === 2) {\n      tagname = prefix + tags[1];\n    }\n  }\n  return tagname;\n}\nconst attrsRegx = new RegExp(`([^\\\\s=]+)\\\\s*(=\\\\s*(['\"])([\\\\s\\\\S]*?)\\\\3)?`, \"gm\");\nfunction buildAttributesMap(attrStr, jPath, tagName) {\n  if (!this.options.ignoreAttributes && typeof attrStr === \"string\") {\n    const matches = util.getAllMatches(attrStr, attrsRegx);\n    const len = matches.length;\n    const attrs = {};\n    for (let i = 0; i < len; i++) {\n      const attrName = this.resolveNameSpace(matches[i][1]);\n      let oldVal = matches[i][4];\n      let aName = this.options.attributeNamePrefix + attrName;\n      if (attrName.length) {\n        if (this.options.transformAttributeName) {\n          aName = this.options.transformAttributeName(aName);\n        }\n        if (aName === \"__proto__\") aName = \"#__proto__\";\n        if (oldVal !== void 0) {\n          if (this.options.trimValues) {\n            oldVal = oldVal.trim();\n          }\n          oldVal = this.replaceEntitiesValue(oldVal);\n          const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);\n          if (newVal === null || newVal === void 0) {\n            attrs[aName] = oldVal;\n          } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {\n            attrs[aName] = newVal;\n          } else {\n            attrs[aName] = parseValue(\n              oldVal,\n              this.options.parseAttributeValue,\n              this.options.numberParseOptions\n            );\n          }\n        } else if (this.options.allowBooleanAttributes) {\n          attrs[aName] = true;\n        }\n      }\n    }\n    if (!Object.keys(attrs).length) {\n      return;\n    }\n    if (this.options.attributesGroupName) {\n      const attrCollection = {};\n      attrCollection[this.options.attributesGroupName] = attrs;\n      return attrCollection;\n    }\n    return attrs;\n  }\n}\nconst parseXml = function(xmlData) {\n  xmlData = xmlData.replace(/\\r\\n?/g, \"\\n\");\n  const xmlObj = new xmlNode(\"!xml\");\n  let currentNode = xmlObj;\n  let textData = \"\";\n  let jPath = \"\";\n  for (let i = 0; i < xmlData.length; i++) {\n    const ch = xmlData[i];\n    if (ch === \"<\") {\n      if (xmlData[i + 1] === \"/\") {\n        const closeIndex = findClosingIndex(xmlData, \">\", i, \"Closing Tag is not closed.\");\n        let tagName = xmlData.substring(i + 2, closeIndex).trim();\n        if (this.options.removeNSPrefix) {\n          const colonIndex = tagName.indexOf(\":\");\n          if (colonIndex !== -1) {\n            tagName = tagName.substr(colonIndex + 1);\n          }\n        }\n        if (this.options.transformTagName) {\n          tagName = this.options.transformTagName(tagName);\n        }\n        if (currentNode) {\n          textData = this.saveTextToParentTag(textData, currentNode, jPath);\n        }\n        const lastTagName = jPath.substring(jPath.lastIndexOf(\".\") + 1);\n        if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) {\n          throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);\n        }\n        let propIndex = 0;\n        if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) {\n          propIndex = jPath.lastIndexOf(\".\", jPath.lastIndexOf(\".\") - 1);\n          this.tagsNodeStack.pop();\n        } else {\n          propIndex = jPath.lastIndexOf(\".\");\n        }\n        jPath = jPath.substring(0, propIndex);\n        currentNode = this.tagsNodeStack.pop();\n        textData = \"\";\n        i = closeIndex;\n      } else if (xmlData[i + 1] === \"?\") {\n        let tagData = readTagExp(xmlData, i, false, \"?>\");\n        if (!tagData) throw new Error(\"Pi Tag is not closed.\");\n        textData = this.saveTextToParentTag(textData, currentNode, jPath);\n        if (this.options.ignoreDeclaration && tagData.tagName === \"?xml\" || this.options.ignorePiTags) ;\n        else {\n          const childNode = new xmlNode(tagData.tagName);\n          childNode.add(this.options.textNodeName, \"\");\n          if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) {\n            childNode[\":@\"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);\n          }\n          this.addChild(currentNode, childNode, jPath);\n        }\n        i = tagData.closeIndex + 1;\n      } else if (xmlData.substr(i + 1, 3) === \"!--\") {\n        const endIndex = findClosingIndex(xmlData, \"-->\", i + 4, \"Comment is not closed.\");\n        if (this.options.commentPropName) {\n          const comment = xmlData.substring(i + 4, endIndex - 2);\n          textData = this.saveTextToParentTag(textData, currentNode, jPath);\n          currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);\n        }\n        i = endIndex;\n      } else if (xmlData.substr(i + 1, 2) === \"!D\") {\n        const result = readDocType(xmlData, i);\n        this.docTypeEntities = result.entities;\n        i = result.i;\n      } else if (xmlData.substr(i + 1, 2) === \"![\") {\n        const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"CDATA is not closed.\") - 2;\n        const tagExp = xmlData.substring(i + 9, closeIndex);\n        textData = this.saveTextToParentTag(textData, currentNode, jPath);\n        let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);\n        if (val2 == void 0) val2 = \"\";\n        if (this.options.cdataPropName) {\n          currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]);\n        } else {\n          currentNode.add(this.options.textNodeName, val2);\n        }\n        i = closeIndex + 2;\n      } else {\n        let result = readTagExp(xmlData, i, this.options.removeNSPrefix);\n        let tagName = result.tagName;\n        const rawTagName = result.rawTagName;\n        let tagExp = result.tagExp;\n        let attrExpPresent = result.attrExpPresent;\n        let closeIndex = result.closeIndex;\n        if (this.options.transformTagName) {\n          tagName = this.options.transformTagName(tagName);\n        }\n        if (currentNode && textData) {\n          if (currentNode.tagname !== \"!xml\") {\n            textData = this.saveTextToParentTag(textData, currentNode, jPath, false);\n          }\n        }\n        const lastTag = currentNode;\n        if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) {\n          currentNode = this.tagsNodeStack.pop();\n          jPath = jPath.substring(0, jPath.lastIndexOf(\".\"));\n        }\n        if (tagName !== xmlObj.tagname) {\n          jPath += jPath ? \".\" + tagName : tagName;\n        }\n        if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) {\n          let tagContent = \"\";\n          if (tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1) {\n            if (tagName[tagName.length - 1] === \"/\") {\n              tagName = tagName.substr(0, tagName.length - 1);\n              jPath = jPath.substr(0, jPath.length - 1);\n              tagExp = tagName;\n            } else {\n              tagExp = tagExp.substr(0, tagExp.length - 1);\n            }\n            i = result.closeIndex;\n          } else if (this.options.unpairedTags.indexOf(tagName) !== -1) {\n            i = result.closeIndex;\n          } else {\n            const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);\n            if (!result2) throw new Error(`Unexpected end of ${rawTagName}`);\n            i = result2.i;\n            tagContent = result2.tagContent;\n          }\n          const childNode = new xmlNode(tagName);\n          if (tagName !== tagExp && attrExpPresent) {\n            childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n          }\n          if (tagContent) {\n            tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);\n          }\n          jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n          childNode.add(this.options.textNodeName, tagContent);\n          this.addChild(currentNode, childNode, jPath);\n        } else {\n          if (tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1) {\n            if (tagName[tagName.length - 1] === \"/\") {\n              tagName = tagName.substr(0, tagName.length - 1);\n              jPath = jPath.substr(0, jPath.length - 1);\n              tagExp = tagName;\n            } else {\n              tagExp = tagExp.substr(0, tagExp.length - 1);\n            }\n            if (this.options.transformTagName) {\n              tagName = this.options.transformTagName(tagName);\n            }\n            const childNode = new xmlNode(tagName);\n            if (tagName !== tagExp && attrExpPresent) {\n              childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n            }\n            this.addChild(currentNode, childNode, jPath);\n            jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n          } else {\n            const childNode = new xmlNode(tagName);\n            this.tagsNodeStack.push(currentNode);\n            if (tagName !== tagExp && attrExpPresent) {\n              childNode[\":@\"] = this.buildAttributesMap(tagExp, jPath, tagName);\n            }\n            this.addChild(currentNode, childNode, jPath);\n            currentNode = childNode;\n          }\n          textData = \"\";\n          i = closeIndex;\n        }\n      }\n    } else {\n      textData += xmlData[i];\n    }\n  }\n  return xmlObj.child;\n};\nfunction addChild(currentNode, childNode, jPath) {\n  const result = this.options.updateTag(childNode.tagname, jPath, childNode[\":@\"]);\n  if (result === false) ;\n  else if (typeof result === \"string\") {\n    childNode.tagname = result;\n    currentNode.addChild(childNode);\n  } else {\n    currentNode.addChild(childNode);\n  }\n}\nconst replaceEntitiesValue$1 = function(val2) {\n  if (this.options.processEntities) {\n    for (let entityName2 in this.docTypeEntities) {\n      const entity = this.docTypeEntities[entityName2];\n      val2 = val2.replace(entity.regx, entity.val);\n    }\n    for (let entityName2 in this.lastEntities) {\n      const entity = this.lastEntities[entityName2];\n      val2 = val2.replace(entity.regex, entity.val);\n    }\n    if (this.options.htmlEntities) {\n      for (let entityName2 in this.htmlEntities) {\n        const entity = this.htmlEntities[entityName2];\n        val2 = val2.replace(entity.regex, entity.val);\n      }\n    }\n    val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val);\n  }\n  return val2;\n};\nfunction saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {\n  if (textData) {\n    if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0;\n    textData = this.parseTextData(\n      textData,\n      currentNode.tagname,\n      jPath,\n      false,\n      currentNode[\":@\"] ? Object.keys(currentNode[\":@\"]).length !== 0 : false,\n      isLeafNode\n    );\n    if (textData !== void 0 && textData !== \"\")\n      currentNode.add(this.options.textNodeName, textData);\n    textData = \"\";\n  }\n  return textData;\n}\nfunction isItStopNode(stopNodes, jPath, currentTagName) {\n  const allNodesExp = \"*.\" + currentTagName;\n  for (const stopNodePath in stopNodes) {\n    const stopNodeExp = stopNodes[stopNodePath];\n    if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true;\n  }\n  return false;\n}\nfunction tagExpWithClosingIndex(xmlData, i, closingChar = \">\") {\n  let attrBoundary;\n  let tagExp = \"\";\n  for (let index = i; index < xmlData.length; index++) {\n    let ch = xmlData[index];\n    if (attrBoundary) {\n      if (ch === attrBoundary) attrBoundary = \"\";\n    } else if (ch === '\"' || ch === \"'\") {\n      attrBoundary = ch;\n    } else if (ch === closingChar[0]) {\n      if (closingChar[1]) {\n        if (xmlData[index + 1] === closingChar[1]) {\n          return {\n            data: tagExp,\n            index\n          };\n        }\n      } else {\n        return {\n          data: tagExp,\n          index\n        };\n      }\n    } else if (ch === \"\t\") {\n      ch = \" \";\n    }\n    tagExp += ch;\n  }\n}\nfunction findClosingIndex(xmlData, str, i, errMsg) {\n  const closingIndex = xmlData.indexOf(str, i);\n  if (closingIndex === -1) {\n    throw new Error(errMsg);\n  } else {\n    return closingIndex + str.length - 1;\n  }\n}\nfunction readTagExp(xmlData, i, removeNSPrefix, closingChar = \">\") {\n  const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);\n  if (!result) return;\n  let tagExp = result.data;\n  const closeIndex = result.index;\n  const separatorIndex = tagExp.search(/\\s/);\n  let tagName = tagExp;\n  let attrExpPresent = true;\n  if (separatorIndex !== -1) {\n    tagName = tagExp.substring(0, separatorIndex);\n    tagExp = tagExp.substring(separatorIndex + 1).trimStart();\n  }\n  const rawTagName = tagName;\n  if (removeNSPrefix) {\n    const colonIndex = tagName.indexOf(\":\");\n    if (colonIndex !== -1) {\n      tagName = tagName.substr(colonIndex + 1);\n      attrExpPresent = tagName !== result.data.substr(colonIndex + 1);\n    }\n  }\n  return {\n    tagName,\n    tagExp,\n    closeIndex,\n    attrExpPresent,\n    rawTagName\n  };\n}\nfunction readStopNodeData(xmlData, tagName, i) {\n  const startIndex = i;\n  let openTagCount = 1;\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] === \"<\") {\n      if (xmlData[i + 1] === \"/\") {\n        const closeIndex = findClosingIndex(xmlData, \">\", i, `${tagName} is not closed`);\n        let closeTagName = xmlData.substring(i + 2, closeIndex).trim();\n        if (closeTagName === tagName) {\n          openTagCount--;\n          if (openTagCount === 0) {\n            return {\n              tagContent: xmlData.substring(startIndex, i),\n              i: closeIndex\n            };\n          }\n        }\n        i = closeIndex;\n      } else if (xmlData[i + 1] === \"?\") {\n        const closeIndex = findClosingIndex(xmlData, \"?>\", i + 1, \"StopNode is not closed.\");\n        i = closeIndex;\n      } else if (xmlData.substr(i + 1, 3) === \"!--\") {\n        const closeIndex = findClosingIndex(xmlData, \"-->\", i + 3, \"StopNode is not closed.\");\n        i = closeIndex;\n      } else if (xmlData.substr(i + 1, 2) === \"![\") {\n        const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"StopNode is not closed.\") - 2;\n        i = closeIndex;\n      } else {\n        const tagData = readTagExp(xmlData, i, \">\");\n        if (tagData) {\n          const openTagName = tagData && tagData.tagName;\n          if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== \"/\") {\n            openTagCount++;\n          }\n          i = tagData.closeIndex;\n        }\n      }\n    }\n  }\n}\nfunction parseValue(val2, shouldParse, options) {\n  if (shouldParse && typeof val2 === \"string\") {\n    const newval = val2.trim();\n    if (newval === \"true\") return true;\n    else if (newval === \"false\") return false;\n    else return toNumber(val2, options);\n  } else {\n    if (util.isExist(val2)) {\n      return val2;\n    } else {\n      return \"\";\n    }\n  }\n}\nvar OrderedObjParser_1 = OrderedObjParser$1;\nvar node2json = {};\nfunction prettify$1(node, options) {\n  return compress(node, options);\n}\nfunction compress(arr, options, jPath) {\n  let text;\n  const compressedObj = {};\n  for (let i = 0; i < arr.length; i++) {\n    const tagObj = arr[i];\n    const property = propName$1(tagObj);\n    let newJpath = \"\";\n    if (jPath === void 0) newJpath = property;\n    else newJpath = jPath + \".\" + property;\n    if (property === options.textNodeName) {\n      if (text === void 0) text = tagObj[property];\n      else text += \"\" + tagObj[property];\n    } else if (property === void 0) {\n      continue;\n    } else if (tagObj[property]) {\n      let val2 = compress(tagObj[property], options, newJpath);\n      const isLeaf = isLeafTag(val2, options);\n      if (tagObj[\":@\"]) {\n        assignAttributes(val2, tagObj[\":@\"], newJpath, options);\n      } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) {\n        val2 = val2[options.textNodeName];\n      } else if (Object.keys(val2).length === 0) {\n        if (options.alwaysCreateTextNode) val2[options.textNodeName] = \"\";\n        else val2 = \"\";\n      }\n      if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) {\n        if (!Array.isArray(compressedObj[property])) {\n          compressedObj[property] = [compressedObj[property]];\n        }\n        compressedObj[property].push(val2);\n      } else {\n        if (options.isArray(property, newJpath, isLeaf)) {\n          compressedObj[property] = [val2];\n        } else {\n          compressedObj[property] = val2;\n        }\n      }\n    }\n  }\n  if (typeof text === \"string\") {\n    if (text.length > 0) compressedObj[options.textNodeName] = text;\n  } else if (text !== void 0) compressedObj[options.textNodeName] = text;\n  return compressedObj;\n}\nfunction propName$1(obj) {\n  const keys = Object.keys(obj);\n  for (let i = 0; i < keys.length; i++) {\n    const key = keys[i];\n    if (key !== \":@\") return key;\n  }\n}\nfunction assignAttributes(obj, attrMap, jpath, options) {\n  if (attrMap) {\n    const keys = Object.keys(attrMap);\n    const len = keys.length;\n    for (let i = 0; i < len; i++) {\n      const atrrName = keys[i];\n      if (options.isArray(atrrName, jpath + \".\" + atrrName, true, true)) {\n        obj[atrrName] = [attrMap[atrrName]];\n      } else {\n        obj[atrrName] = attrMap[atrrName];\n      }\n    }\n  }\n}\nfunction isLeafTag(obj, options) {\n  const { textNodeName } = options;\n  const propCount = Object.keys(obj).length;\n  if (propCount === 0) {\n    return true;\n  }\n  if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === \"boolean\" || obj[textNodeName] === 0)) {\n    return true;\n  }\n  return false;\n}\nnode2json.prettify = prettify$1;\nconst { buildOptions } = OptionsBuilder;\nconst OrderedObjParser2 = OrderedObjParser_1;\nconst { prettify } = node2json;\nconst validator$1 = validator$2;\nlet XMLParser$1 = class XMLParser {\n  constructor(options) {\n    this.externalEntities = {};\n    this.options = buildOptions(options);\n  }\n  /**\n   * Parse XML dats to JS object \n   * @param {string|Buffer} xmlData \n   * @param {boolean|Object} validationOption \n   */\n  parse(xmlData, validationOption) {\n    if (typeof xmlData === \"string\") ;\n    else if (xmlData.toString) {\n      xmlData = xmlData.toString();\n    } else {\n      throw new Error(\"XML data is accepted in String or Bytes[] form.\");\n    }\n    if (validationOption) {\n      if (validationOption === true) validationOption = {};\n      const result = validator$1.validate(xmlData, validationOption);\n      if (result !== true) {\n        throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);\n      }\n    }\n    const orderedObjParser = new OrderedObjParser2(this.options);\n    orderedObjParser.addExternalEntities(this.externalEntities);\n    const orderedResult = orderedObjParser.parseXml(xmlData);\n    if (this.options.preserveOrder || orderedResult === void 0) return orderedResult;\n    else return prettify(orderedResult, this.options);\n  }\n  /**\n   * Add Entity which is not by default supported by this library\n   * @param {string} key \n   * @param {string} value \n   */\n  addEntity(key, value) {\n    if (value.indexOf(\"&\") !== -1) {\n      throw new Error(\"Entity value can't have '&'\");\n    } else if (key.indexOf(\"&\") !== -1 || key.indexOf(\";\") !== -1) {\n      throw new Error(\"An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'\");\n    } else if (value === \"&\") {\n      throw new Error(\"An entity with value '&' is not permitted\");\n    } else {\n      this.externalEntities[key] = value;\n    }\n  }\n};\nvar XMLParser_1 = XMLParser$1;\nconst EOL = \"\\n\";\nfunction toXml(jArray, options) {\n  let indentation = \"\";\n  if (options.format && options.indentBy.length > 0) {\n    indentation = EOL;\n  }\n  return arrToStr(jArray, options, \"\", indentation);\n}\nfunction arrToStr(arr, options, jPath, indentation) {\n  let xmlStr = \"\";\n  let isPreviousElementTag = false;\n  for (let i = 0; i < arr.length; i++) {\n    const tagObj = arr[i];\n    const tagName = propName(tagObj);\n    if (tagName === void 0) continue;\n    let newJPath = \"\";\n    if (jPath.length === 0) newJPath = tagName;\n    else newJPath = `${jPath}.${tagName}`;\n    if (tagName === options.textNodeName) {\n      let tagText = tagObj[tagName];\n      if (!isStopNode(newJPath, options)) {\n        tagText = options.tagValueProcessor(tagName, tagText);\n        tagText = replaceEntitiesValue(tagText, options);\n      }\n      if (isPreviousElementTag) {\n        xmlStr += indentation;\n      }\n      xmlStr += tagText;\n      isPreviousElementTag = false;\n      continue;\n    } else if (tagName === options.cdataPropName) {\n      if (isPreviousElementTag) {\n        xmlStr += indentation;\n      }\n      xmlStr += `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;\n      isPreviousElementTag = false;\n      continue;\n    } else if (tagName === options.commentPropName) {\n      xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;\n      isPreviousElementTag = true;\n      continue;\n    } else if (tagName[0] === \"?\") {\n      const attStr2 = attr_to_str(tagObj[\":@\"], options);\n      const tempInd = tagName === \"?xml\" ? \"\" : indentation;\n      let piTextNodeName = tagObj[tagName][0][options.textNodeName];\n      piTextNodeName = piTextNodeName.length !== 0 ? \" \" + piTextNodeName : \"\";\n      xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`;\n      isPreviousElementTag = true;\n      continue;\n    }\n    let newIdentation = indentation;\n    if (newIdentation !== \"\") {\n      newIdentation += options.indentBy;\n    }\n    const attStr = attr_to_str(tagObj[\":@\"], options);\n    const tagStart = indentation + `<${tagName}${attStr}`;\n    const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation);\n    if (options.unpairedTags.indexOf(tagName) !== -1) {\n      if (options.suppressUnpairedNode) xmlStr += tagStart + \">\";\n      else xmlStr += tagStart + \"/>\";\n    } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) {\n      xmlStr += tagStart + \"/>\";\n    } else if (tagValue && tagValue.endsWith(\">\")) {\n      xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>`;\n    } else {\n      xmlStr += tagStart + \">\";\n      if (tagValue && indentation !== \"\" && (tagValue.includes(\"/>\") || tagValue.includes(\"</\"))) {\n        xmlStr += indentation + options.indentBy + tagValue + indentation;\n      } else {\n        xmlStr += tagValue;\n      }\n      xmlStr += `</${tagName}>`;\n    }\n    isPreviousElementTag = true;\n  }\n  return xmlStr;\n}\nfunction propName(obj) {\n  const keys = Object.keys(obj);\n  for (let i = 0; i < keys.length; i++) {\n    const key = keys[i];\n    if (!obj.hasOwnProperty(key)) continue;\n    if (key !== \":@\") return key;\n  }\n}\nfunction attr_to_str(attrMap, options) {\n  let attrStr = \"\";\n  if (attrMap && !options.ignoreAttributes) {\n    for (let attr in attrMap) {\n      if (!attrMap.hasOwnProperty(attr)) continue;\n      let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);\n      attrVal = replaceEntitiesValue(attrVal, options);\n      if (attrVal === true && options.suppressBooleanAttributes) {\n        attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;\n      } else {\n        attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}=\"${attrVal}\"`;\n      }\n    }\n  }\n  return attrStr;\n}\nfunction isStopNode(jPath, options) {\n  jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1);\n  let tagName = jPath.substr(jPath.lastIndexOf(\".\") + 1);\n  for (let index in options.stopNodes) {\n    if (options.stopNodes[index] === jPath || options.stopNodes[index] === \"*.\" + tagName) return true;\n  }\n  return false;\n}\nfunction replaceEntitiesValue(textValue, options) {\n  if (textValue && textValue.length > 0 && options.processEntities) {\n    for (let i = 0; i < options.entities.length; i++) {\n      const entity = options.entities[i];\n      textValue = textValue.replace(entity.regex, entity.val);\n    }\n  }\n  return textValue;\n}\nvar orderedJs2Xml = toXml;\nconst buildFromOrderedJs = orderedJs2Xml;\nconst defaultOptions = {\n  attributeNamePrefix: \"@_\",\n  attributesGroupName: false,\n  textNodeName: \"#text\",\n  ignoreAttributes: true,\n  cdataPropName: false,\n  format: false,\n  indentBy: \"  \",\n  suppressEmptyNode: false,\n  suppressUnpairedNode: true,\n  suppressBooleanAttributes: true,\n  tagValueProcessor: function(key, a) {\n    return a;\n  },\n  attributeValueProcessor: function(attrName, a) {\n    return a;\n  },\n  preserveOrder: false,\n  commentPropName: false,\n  unpairedTags: [],\n  entities: [\n    { regex: new RegExp(\"&\", \"g\"), val: \"&amp;\" },\n    //it must be on top\n    { regex: new RegExp(\">\", \"g\"), val: \"&gt;\" },\n    { regex: new RegExp(\"<\", \"g\"), val: \"&lt;\" },\n    { regex: new RegExp(\"'\", \"g\"), val: \"&apos;\" },\n    { regex: new RegExp('\"', \"g\"), val: \"&quot;\" }\n  ],\n  processEntities: true,\n  stopNodes: [],\n  // transformTagName: false,\n  // transformAttributeName: false,\n  oneListGroup: false\n};\nfunction Builder(options) {\n  this.options = Object.assign({}, defaultOptions, options);\n  if (this.options.ignoreAttributes || this.options.attributesGroupName) {\n    this.isAttribute = function() {\n      return false;\n    };\n  } else {\n    this.attrPrefixLen = this.options.attributeNamePrefix.length;\n    this.isAttribute = isAttribute;\n  }\n  this.processTextOrObjNode = processTextOrObjNode;\n  if (this.options.format) {\n    this.indentate = indentate;\n    this.tagEndChar = \">\\n\";\n    this.newLine = \"\\n\";\n  } else {\n    this.indentate = function() {\n      return \"\";\n    };\n    this.tagEndChar = \">\";\n    this.newLine = \"\";\n  }\n}\nBuilder.prototype.build = function(jObj) {\n  if (this.options.preserveOrder) {\n    return buildFromOrderedJs(jObj, this.options);\n  } else {\n    if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {\n      jObj = {\n        [this.options.arrayNodeName]: jObj\n      };\n    }\n    return this.j2x(jObj, 0).val;\n  }\n};\nBuilder.prototype.j2x = function(jObj, level) {\n  let attrStr = \"\";\n  let val2 = \"\";\n  for (let key in jObj) {\n    if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue;\n    if (typeof jObj[key] === \"undefined\") {\n      if (this.isAttribute(key)) {\n        val2 += \"\";\n      }\n    } else if (jObj[key] === null) {\n      if (this.isAttribute(key)) {\n        val2 += \"\";\n      } else if (key[0] === \"?\") {\n        val2 += this.indentate(level) + \"<\" + key + \"?\" + this.tagEndChar;\n      } else {\n        val2 += this.indentate(level) + \"<\" + key + \"/\" + this.tagEndChar;\n      }\n    } else if (jObj[key] instanceof Date) {\n      val2 += this.buildTextValNode(jObj[key], key, \"\", level);\n    } else if (typeof jObj[key] !== \"object\") {\n      const attr = this.isAttribute(key);\n      if (attr) {\n        attrStr += this.buildAttrPairStr(attr, \"\" + jObj[key]);\n      } else {\n        if (key === this.options.textNodeName) {\n          let newval = this.options.tagValueProcessor(key, \"\" + jObj[key]);\n          val2 += this.replaceEntitiesValue(newval);\n        } else {\n          val2 += this.buildTextValNode(jObj[key], key, \"\", level);\n        }\n      }\n    } else if (Array.isArray(jObj[key])) {\n      const arrLen = jObj[key].length;\n      let listTagVal = \"\";\n      for (let j = 0; j < arrLen; j++) {\n        const item = jObj[key][j];\n        if (typeof item === \"undefined\") ;\n        else if (item === null) {\n          if (key[0] === \"?\") val2 += this.indentate(level) + \"<\" + key + \"?\" + this.tagEndChar;\n          else val2 += this.indentate(level) + \"<\" + key + \"/\" + this.tagEndChar;\n        } else if (typeof item === \"object\") {\n          if (this.options.oneListGroup) {\n            listTagVal += this.j2x(item, level + 1).val;\n          } else {\n            listTagVal += this.processTextOrObjNode(item, key, level);\n          }\n        } else {\n          listTagVal += this.buildTextValNode(item, key, \"\", level);\n        }\n      }\n      if (this.options.oneListGroup) {\n        listTagVal = this.buildObjectNode(listTagVal, key, \"\", level);\n      }\n      val2 += listTagVal;\n    } else {\n      if (this.options.attributesGroupName && key === this.options.attributesGroupName) {\n        const Ks = Object.keys(jObj[key]);\n        const L = Ks.length;\n        for (let j = 0; j < L; j++) {\n          attrStr += this.buildAttrPairStr(Ks[j], \"\" + jObj[key][Ks[j]]);\n        }\n      } else {\n        val2 += this.processTextOrObjNode(jObj[key], key, level);\n      }\n    }\n  }\n  return { attrStr, val: val2 };\n};\nBuilder.prototype.buildAttrPairStr = function(attrName, val2) {\n  val2 = this.options.attributeValueProcessor(attrName, \"\" + val2);\n  val2 = this.replaceEntitiesValue(val2);\n  if (this.options.suppressBooleanAttributes && val2 === \"true\") {\n    return \" \" + attrName;\n  } else return \" \" + attrName + '=\"' + val2 + '\"';\n};\nfunction processTextOrObjNode(object, key, level) {\n  const result = this.j2x(object, level + 1);\n  if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) {\n    return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);\n  } else {\n    return this.buildObjectNode(result.val, key, result.attrStr, level);\n  }\n}\nBuilder.prototype.buildObjectNode = function(val2, key, attrStr, level) {\n  if (val2 === \"\") {\n    if (key[0] === \"?\") return this.indentate(level) + \"<\" + key + attrStr + \"?\" + this.tagEndChar;\n    else {\n      return this.indentate(level) + \"<\" + key + attrStr + this.closeTag(key) + this.tagEndChar;\n    }\n  } else {\n    let tagEndExp = \"</\" + key + this.tagEndChar;\n    let piClosingChar = \"\";\n    if (key[0] === \"?\") {\n      piClosingChar = \"?\";\n      tagEndExp = \"\";\n    }\n    if ((attrStr || attrStr === \"\") && val2.indexOf(\"<\") === -1) {\n      return this.indentate(level) + \"<\" + key + attrStr + piClosingChar + \">\" + val2 + tagEndExp;\n    } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {\n      return this.indentate(level) + `<!--${val2}-->` + this.newLine;\n    } else {\n      return this.indentate(level) + \"<\" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp;\n    }\n  }\n};\nBuilder.prototype.closeTag = function(key) {\n  let closeTag = \"\";\n  if (this.options.unpairedTags.indexOf(key) !== -1) {\n    if (!this.options.suppressUnpairedNode) closeTag = \"/\";\n  } else if (this.options.suppressEmptyNode) {\n    closeTag = \"/\";\n  } else {\n    closeTag = `></${key}`;\n  }\n  return closeTag;\n};\nBuilder.prototype.buildTextValNode = function(val2, key, attrStr, level) {\n  if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {\n    return this.indentate(level) + `<![CDATA[${val2}]]>` + this.newLine;\n  } else if (this.options.commentPropName !== false && key === this.options.commentPropName) {\n    return this.indentate(level) + `<!--${val2}-->` + this.newLine;\n  } else if (key[0] === \"?\") {\n    return this.indentate(level) + \"<\" + key + attrStr + \"?\" + this.tagEndChar;\n  } else {\n    let textValue = this.options.tagValueProcessor(key, val2);\n    textValue = this.replaceEntitiesValue(textValue);\n    if (textValue === \"\") {\n      return this.indentate(level) + \"<\" + key + attrStr + this.closeTag(key) + this.tagEndChar;\n    } else {\n      return this.indentate(level) + \"<\" + key + attrStr + \">\" + textValue + \"</\" + key + this.tagEndChar;\n    }\n  }\n};\nBuilder.prototype.replaceEntitiesValue = function(textValue) {\n  if (textValue && textValue.length > 0 && this.options.processEntities) {\n    for (let i = 0; i < this.options.entities.length; i++) {\n      const entity = this.options.entities[i];\n      textValue = textValue.replace(entity.regex, entity.val);\n    }\n  }\n  return textValue;\n};\nfunction indentate(level) {\n  return this.options.indentBy.repeat(level);\n}\nfunction isAttribute(name) {\n  if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) {\n    return name.substr(this.attrPrefixLen);\n  } else {\n    return false;\n  }\n}\nvar json2xml = Builder;\nconst validator = validator$2;\nconst XMLParser2 = XMLParser_1;\nconst XMLBuilder = json2xml;\nvar fxp = {\n  XMLParser: XMLParser2,\n  XMLValidator: validator,\n  XMLBuilder\n};\nfunction isSvg(string) {\n  if (typeof string !== \"string\") {\n    throw new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n  }\n  string = string.trim();\n  if (string.length === 0) {\n    return false;\n  }\n  if (fxp.XMLValidator.validate(string) !== true) {\n    return false;\n  }\n  let jsonObject;\n  const parser = new fxp.XMLParser();\n  try {\n    jsonObject = parser.parse(string);\n  } catch {\n    return false;\n  }\n  if (!jsonObject) {\n    return false;\n  }\n  if (!Object.keys(jsonObject).some((x) => x.toLowerCase() === \"svg\")) {\n    return false;\n  }\n  return true;\n}\nclass View {\n  _view;\n  constructor(view) {\n    isValidView(view);\n    this._view = view;\n  }\n  get id() {\n    return this._view.id;\n  }\n  get name() {\n    return this._view.name;\n  }\n  get caption() {\n    return this._view.caption;\n  }\n  get emptyTitle() {\n    return this._view.emptyTitle;\n  }\n  get emptyCaption() {\n    return this._view.emptyCaption;\n  }\n  get getContents() {\n    return this._view.getContents;\n  }\n  get icon() {\n    return this._view.icon;\n  }\n  set icon(icon) {\n    this._view.icon = icon;\n  }\n  get order() {\n    return this._view.order;\n  }\n  set order(order) {\n    this._view.order = order;\n  }\n  get params() {\n    return this._view.params;\n  }\n  set params(params) {\n    this._view.params = params;\n  }\n  get columns() {\n    return this._view.columns;\n  }\n  get emptyView() {\n    return this._view.emptyView;\n  }\n  get parent() {\n    return this._view.parent;\n  }\n  get sticky() {\n    return this._view.sticky;\n  }\n  get expanded() {\n    return this._view.expanded;\n  }\n  set expanded(expanded) {\n    this._view.expanded = expanded;\n  }\n  get defaultSortKey() {\n    return this._view.defaultSortKey;\n  }\n}\nconst isValidView = function(view) {\n  if (!view.id || typeof view.id !== \"string\") {\n    throw new Error(\"View id is required and must be a string\");\n  }\n  if (!view.name || typeof view.name !== \"string\") {\n    throw new Error(\"View name is required and must be a string\");\n  }\n  if (view.columns && view.columns.length > 0 && (!view.caption || typeof view.caption !== \"string\")) {\n    throw new Error(\"View caption is required for top-level views and must be a string\");\n  }\n  if (!view.getContents || typeof view.getContents !== \"function\") {\n    throw new Error(\"View getContents is required and must be a function\");\n  }\n  if (!view.icon || typeof view.icon !== \"string\" || !isSvg(view.icon)) {\n    throw new Error(\"View icon is required and must be a valid svg string\");\n  }\n  if (!(\"order\" in view) || typeof view.order !== \"number\") {\n    throw new Error(\"View order is required and must be a number\");\n  }\n  if (view.columns) {\n    view.columns.forEach((column) => {\n      if (!(column instanceof Column)) {\n        throw new Error(\"View columns must be an array of Column. Invalid column found\");\n      }\n    });\n  }\n  if (view.emptyView && typeof view.emptyView !== \"function\") {\n    throw new Error(\"View emptyView must be a function\");\n  }\n  if (view.parent && typeof view.parent !== \"string\") {\n    throw new Error(\"View parent must be a string\");\n  }\n  if (\"sticky\" in view && typeof view.sticky !== \"boolean\") {\n    throw new Error(\"View sticky must be a boolean\");\n  }\n  if (\"expanded\" in view && typeof view.expanded !== \"boolean\") {\n    throw new Error(\"View expanded must be a boolean\");\n  }\n  if (view.defaultSortKey && typeof view.defaultSortKey !== \"string\") {\n    throw new Error(\"View defaultSortKey must be a string\");\n  }\n  return true;\n};\nconst debug$1 = typeof process === \"object\" && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error(\"SEMVER\", ...args) : () => {\n};\nvar debug_1 = debug$1;\nconst SEMVER_SPEC_VERSION = \"2.0.0\";\nconst MAX_LENGTH$1 = 256;\nconst MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */\n9007199254740991;\nconst MAX_SAFE_COMPONENT_LENGTH = 16;\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;\nconst RELEASE_TYPES = [\n  \"major\",\n  \"premajor\",\n  \"minor\",\n  \"preminor\",\n  \"patch\",\n  \"prepatch\",\n  \"prerelease\"\n];\nvar constants = {\n  MAX_LENGTH: MAX_LENGTH$1,\n  MAX_SAFE_COMPONENT_LENGTH,\n  MAX_SAFE_BUILD_LENGTH,\n  MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,\n  RELEASE_TYPES,\n  SEMVER_SPEC_VERSION,\n  FLAG_INCLUDE_PRERELEASE: 1,\n  FLAG_LOOSE: 2\n};\nvar re$1 = { exports: {} };\n(function(module, exports) {\n  const {\n    MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH2,\n    MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH2,\n    MAX_LENGTH: MAX_LENGTH2\n  } = constants;\n  const debug2 = debug_1;\n  exports = module.exports = {};\n  const re2 = exports.re = [];\n  const safeRe = exports.safeRe = [];\n  const src = exports.src = [];\n  const t2 = exports.t = {};\n  let R = 0;\n  const LETTERDASHNUMBER = \"[a-zA-Z0-9-]\";\n  const safeRegexReplacements = [\n    [\"\\\\s\", 1],\n    [\"\\\\d\", MAX_LENGTH2],\n    [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH2]\n  ];\n  const makeSafeRegex = (value) => {\n    for (const [token, max] of safeRegexReplacements) {\n      value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);\n    }\n    return value;\n  };\n  const createToken = (name, value, isGlobal) => {\n    const safe = makeSafeRegex(value);\n    const index = R++;\n    debug2(name, index, value);\n    t2[name] = index;\n    src[index] = value;\n    re2[index] = new RegExp(value, isGlobal ? \"g\" : void 0);\n    safeRe[index] = new RegExp(safe, isGlobal ? \"g\" : void 0);\n  };\n  createToken(\"NUMERICIDENTIFIER\", \"0|[1-9]\\\\d*\");\n  createToken(\"NUMERICIDENTIFIERLOOSE\", \"\\\\d+\");\n  createToken(\"NONNUMERICIDENTIFIER\", `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);\n  createToken(\"MAINVERSION\", `(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})`);\n  createToken(\"MAINVERSIONLOOSE\", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`);\n  createToken(\"PRERELEASEIDENTIFIER\", `(?:${src[t2.NUMERICIDENTIFIER]}|${src[t2.NONNUMERICIDENTIFIER]})`);\n  createToken(\"PRERELEASEIDENTIFIERLOOSE\", `(?:${src[t2.NUMERICIDENTIFIERLOOSE]}|${src[t2.NONNUMERICIDENTIFIER]})`);\n  createToken(\"PRERELEASE\", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIER]})*))`);\n  createToken(\"PRERELEASELOOSE\", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`);\n  createToken(\"BUILDIDENTIFIER\", `${LETTERDASHNUMBER}+`);\n  createToken(\"BUILD\", `(?:\\\\+(${src[t2.BUILDIDENTIFIER]}(?:\\\\.${src[t2.BUILDIDENTIFIER]})*))`);\n  createToken(\"FULLPLAIN\", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`);\n  createToken(\"FULL\", `^${src[t2.FULLPLAIN]}$`);\n  createToken(\"LOOSEPLAIN\", `[v=\\\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`);\n  createToken(\"LOOSE\", `^${src[t2.LOOSEPLAIN]}$`);\n  createToken(\"GTLT\", \"((?:<|>)?=?)\");\n  createToken(\"XRANGEIDENTIFIERLOOSE\", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);\n  createToken(\"XRANGEIDENTIFIER\", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\\\*`);\n  createToken(\"XRANGEPLAIN\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`);\n  createToken(\"XRANGEPLAINLOOSE\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`);\n  createToken(\"XRANGE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAIN]}$`);\n  createToken(\"XRANGELOOSE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAINLOOSE]}$`);\n  createToken(\"COERCEPLAIN\", `${\"(^|[^\\\\d])(\\\\d{1,\"}${MAX_SAFE_COMPONENT_LENGTH2}})(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?`);\n  createToken(\"COERCE\", `${src[t2.COERCEPLAIN]}(?:$|[^\\\\d])`);\n  createToken(\"COERCEFULL\", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\\\d])`);\n  createToken(\"COERCERTL\", src[t2.COERCE], true);\n  createToken(\"COERCERTLFULL\", src[t2.COERCEFULL], true);\n  createToken(\"LONETILDE\", \"(?:~>?)\");\n  createToken(\"TILDETRIM\", `(\\\\s*)${src[t2.LONETILDE]}\\\\s+`, true);\n  exports.tildeTrimReplace = \"$1~\";\n  createToken(\"TILDE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);\n  createToken(\"TILDELOOSE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);\n  createToken(\"LONECARET\", \"(?:\\\\^)\");\n  createToken(\"CARETTRIM\", `(\\\\s*)${src[t2.LONECARET]}\\\\s+`, true);\n  exports.caretTrimReplace = \"$1^\";\n  createToken(\"CARET\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);\n  createToken(\"CARETLOOSE\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);\n  createToken(\"COMPARATORLOOSE\", `^${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]})$|^$`);\n  createToken(\"COMPARATOR\", `^${src[t2.GTLT]}\\\\s*(${src[t2.FULLPLAIN]})$|^$`);\n  createToken(\"COMPARATORTRIM\", `(\\\\s*)${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);\n  exports.comparatorTrimReplace = \"$1$2$3\";\n  createToken(\"HYPHENRANGE\", `^\\\\s*(${src[t2.XRANGEPLAIN]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAIN]})\\\\s*$`);\n  createToken(\"HYPHENRANGELOOSE\", `^\\\\s*(${src[t2.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAINLOOSE]})\\\\s*$`);\n  createToken(\"STAR\", \"(<|>)?=?\\\\s*\\\\*\");\n  createToken(\"GTE0\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$\");\n  createToken(\"GTE0PRE\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$\");\n})(re$1, re$1.exports);\nvar reExports = re$1.exports;\nconst looseOption = Object.freeze({ loose: true });\nconst emptyOpts = Object.freeze({});\nconst parseOptions$1 = (options) => {\n  if (!options) {\n    return emptyOpts;\n  }\n  if (typeof options !== \"object\") {\n    return looseOption;\n  }\n  return options;\n};\nvar parseOptions_1 = parseOptions$1;\nconst numeric = /^[0-9]+$/;\nconst compareIdentifiers$1 = (a, b) => {\n  const anum = numeric.test(a);\n  const bnum = numeric.test(b);\n  if (anum && bnum) {\n    a = +a;\n    b = +b;\n  }\n  return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;\n};\nconst rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);\nvar identifiers = {\n  compareIdentifiers: compareIdentifiers$1,\n  rcompareIdentifiers\n};\nconst debug = debug_1;\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = constants;\nconst { safeRe: re, t } = reExports;\nconst parseOptions = parseOptions_1;\nconst { compareIdentifiers } = identifiers;\nlet SemVer$2 = class SemVer {\n  constructor(version, options) {\n    options = parseOptions(options);\n    if (version instanceof SemVer) {\n      if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n        return version;\n      } else {\n        version = version.version;\n      }\n    } else if (typeof version !== \"string\") {\n      throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`);\n    }\n    if (version.length > MAX_LENGTH) {\n      throw new TypeError(\n        `version is longer than ${MAX_LENGTH} characters`\n      );\n    }\n    debug(\"SemVer\", version, options);\n    this.options = options;\n    this.loose = !!options.loose;\n    this.includePrerelease = !!options.includePrerelease;\n    const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);\n    if (!m) {\n      throw new TypeError(`Invalid Version: ${version}`);\n    }\n    this.raw = version;\n    this.major = +m[1];\n    this.minor = +m[2];\n    this.patch = +m[3];\n    if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n      throw new TypeError(\"Invalid major version\");\n    }\n    if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n      throw new TypeError(\"Invalid minor version\");\n    }\n    if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n      throw new TypeError(\"Invalid patch version\");\n    }\n    if (!m[4]) {\n      this.prerelease = [];\n    } else {\n      this.prerelease = m[4].split(\".\").map((id) => {\n        if (/^[0-9]+$/.test(id)) {\n          const num = +id;\n          if (num >= 0 && num < MAX_SAFE_INTEGER) {\n            return num;\n          }\n        }\n        return id;\n      });\n    }\n    this.build = m[5] ? m[5].split(\".\") : [];\n    this.format();\n  }\n  format() {\n    this.version = `${this.major}.${this.minor}.${this.patch}`;\n    if (this.prerelease.length) {\n      this.version += `-${this.prerelease.join(\".\")}`;\n    }\n    return this.version;\n  }\n  toString() {\n    return this.version;\n  }\n  compare(other) {\n    debug(\"SemVer.compare\", this.version, this.options, other);\n    if (!(other instanceof SemVer)) {\n      if (typeof other === \"string\" && other === this.version) {\n        return 0;\n      }\n      other = new SemVer(other, this.options);\n    }\n    if (other.version === this.version) {\n      return 0;\n    }\n    return this.compareMain(other) || this.comparePre(other);\n  }\n  compareMain(other) {\n    if (!(other instanceof SemVer)) {\n      other = new SemVer(other, this.options);\n    }\n    return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);\n  }\n  comparePre(other) {\n    if (!(other instanceof SemVer)) {\n      other = new SemVer(other, this.options);\n    }\n    if (this.prerelease.length && !other.prerelease.length) {\n      return -1;\n    } else if (!this.prerelease.length && other.prerelease.length) {\n      return 1;\n    } else if (!this.prerelease.length && !other.prerelease.length) {\n      return 0;\n    }\n    let i = 0;\n    do {\n      const a = this.prerelease[i];\n      const b = other.prerelease[i];\n      debug(\"prerelease compare\", i, a, b);\n      if (a === void 0 && b === void 0) {\n        return 0;\n      } else if (b === void 0) {\n        return 1;\n      } else if (a === void 0) {\n        return -1;\n      } else if (a === b) {\n        continue;\n      } else {\n        return compareIdentifiers(a, b);\n      }\n    } while (++i);\n  }\n  compareBuild(other) {\n    if (!(other instanceof SemVer)) {\n      other = new SemVer(other, this.options);\n    }\n    let i = 0;\n    do {\n      const a = this.build[i];\n      const b = other.build[i];\n      debug(\"build compare\", i, a, b);\n      if (a === void 0 && b === void 0) {\n        return 0;\n      } else if (b === void 0) {\n        return 1;\n      } else if (a === void 0) {\n        return -1;\n      } else if (a === b) {\n        continue;\n      } else {\n        return compareIdentifiers(a, b);\n      }\n    } while (++i);\n  }\n  // preminor will bump the version up to the next minor release, and immediately\n  // down to pre-release. premajor and prepatch work the same way.\n  inc(release, identifier, identifierBase) {\n    switch (release) {\n      case \"premajor\":\n        this.prerelease.length = 0;\n        this.patch = 0;\n        this.minor = 0;\n        this.major++;\n        this.inc(\"pre\", identifier, identifierBase);\n        break;\n      case \"preminor\":\n        this.prerelease.length = 0;\n        this.patch = 0;\n        this.minor++;\n        this.inc(\"pre\", identifier, identifierBase);\n        break;\n      case \"prepatch\":\n        this.prerelease.length = 0;\n        this.inc(\"patch\", identifier, identifierBase);\n        this.inc(\"pre\", identifier, identifierBase);\n        break;\n      case \"prerelease\":\n        if (this.prerelease.length === 0) {\n          this.inc(\"patch\", identifier, identifierBase);\n        }\n        this.inc(\"pre\", identifier, identifierBase);\n        break;\n      case \"major\":\n        if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n          this.major++;\n        }\n        this.minor = 0;\n        this.patch = 0;\n        this.prerelease = [];\n        break;\n      case \"minor\":\n        if (this.patch !== 0 || this.prerelease.length === 0) {\n          this.minor++;\n        }\n        this.patch = 0;\n        this.prerelease = [];\n        break;\n      case \"patch\":\n        if (this.prerelease.length === 0) {\n          this.patch++;\n        }\n        this.prerelease = [];\n        break;\n      case \"pre\": {\n        const base = Number(identifierBase) ? 1 : 0;\n        if (!identifier && identifierBase === false) {\n          throw new Error(\"invalid increment argument: identifier is empty\");\n        }\n        if (this.prerelease.length === 0) {\n          this.prerelease = [base];\n        } else {\n          let i = this.prerelease.length;\n          while (--i >= 0) {\n            if (typeof this.prerelease[i] === \"number\") {\n              this.prerelease[i]++;\n              i = -2;\n            }\n          }\n          if (i === -1) {\n            if (identifier === this.prerelease.join(\".\") && identifierBase === false) {\n              throw new Error(\"invalid increment argument: identifier already exists\");\n            }\n            this.prerelease.push(base);\n          }\n        }\n        if (identifier) {\n          let prerelease = [identifier, base];\n          if (identifierBase === false) {\n            prerelease = [identifier];\n          }\n          if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n            if (isNaN(this.prerelease[1])) {\n              this.prerelease = prerelease;\n            }\n          } else {\n            this.prerelease = prerelease;\n          }\n        }\n        break;\n      }\n      default:\n        throw new Error(`invalid increment argument: ${release}`);\n    }\n    this.raw = this.format();\n    if (this.build.length) {\n      this.raw += `+${this.build.join(\".\")}`;\n    }\n    return this;\n  }\n};\nvar semver = SemVer$2;\nconst SemVer$1 = semver;\nconst parse$1 = (version, options, throwErrors = false) => {\n  if (version instanceof SemVer$1) {\n    return version;\n  }\n  try {\n    return new SemVer$1(version, options);\n  } catch (er) {\n    if (!throwErrors) {\n      return null;\n    }\n    throw er;\n  }\n};\nvar parse_1 = parse$1;\nconst parse = parse_1;\nconst valid = (version, options) => {\n  const v = parse(version, options);\n  return v ? v.version : null;\n};\nvar valid_1 = valid;\nconst valid$1 = /* @__PURE__ */ getDefaultExportFromCjs(valid_1);\nconst SemVer2 = semver;\nconst major = (a, loose) => new SemVer2(a, loose).major;\nvar major_1 = major;\nconst major$1 = /* @__PURE__ */ getDefaultExportFromCjs(major_1);\nclass ProxyBus {\n  bus;\n  constructor(bus2) {\n    if (typeof bus2.getVersion !== \"function\" || !valid$1(bus2.getVersion())) {\n      console.warn(\"Proxying an event bus with an unknown or invalid version\");\n    } else if (major$1(bus2.getVersion()) !== major$1(this.getVersion())) {\n      console.warn(\n        \"Proxying an event bus of version \" + bus2.getVersion() + \" with \" + this.getVersion()\n      );\n    }\n    this.bus = bus2;\n  }\n  getVersion() {\n    return \"3.3.1\";\n  }\n  subscribe(name, handler) {\n    this.bus.subscribe(name, handler);\n  }\n  unsubscribe(name, handler) {\n    this.bus.unsubscribe(name, handler);\n  }\n  emit(name, event) {\n    this.bus.emit(name, event);\n  }\n}\nclass SimpleBus {\n  handlers = /* @__PURE__ */ new Map();\n  getVersion() {\n    return \"3.3.1\";\n  }\n  subscribe(name, handler) {\n    this.handlers.set(\n      name,\n      (this.handlers.get(name) || []).concat(\n        handler\n      )\n    );\n  }\n  unsubscribe(name, handler) {\n    this.handlers.set(\n      name,\n      (this.handlers.get(name) || []).filter((h) => h !== handler)\n    );\n  }\n  emit(name, event) {\n    (this.handlers.get(name) || []).forEach((h) => {\n      try {\n        h(event);\n      } catch (e) {\n        console.error(\"could not invoke event listener\", e);\n      }\n    });\n  }\n}\nlet bus = null;\nfunction getBus() {\n  if (bus !== null) {\n    return bus;\n  }\n  if (typeof window === \"undefined\") {\n    return new Proxy({}, {\n      get: () => {\n        return () => console.error(\n          \"Window not available, EventBus can not be established!\"\n        );\n      }\n    });\n  }\n  if (window.OC?._eventBus && typeof window._nc_event_bus === \"undefined\") {\n    console.warn(\n      \"found old event bus instance at OC._eventBus. Update your version!\"\n    );\n    window._nc_event_bus = window.OC._eventBus;\n  }\n  if (typeof window?._nc_event_bus !== \"undefined\") {\n    bus = new ProxyBus(window._nc_event_bus);\n  } else {\n    bus = window._nc_event_bus = new SimpleBus();\n  }\n  return bus;\n}\nfunction emit(name, event) {\n  getBus().emit(name, event);\n}\n/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nclass FileListFilter extends TypedEventTarget {\n  id;\n  order;\n  constructor(id, order = 100) {\n    super();\n    this.id = id;\n    this.order = order;\n  }\n  filter(nodes) {\n    throw new Error(\"Not implemented\");\n  }\n  updateChips(chips) {\n    this.dispatchTypedEvent(\"update:chips\", new CustomEvent(\"update:chips\", { detail: chips }));\n  }\n  filterUpdated() {\n    this.dispatchTypedEvent(\"update:filter\", new CustomEvent(\"update:filter\"));\n  }\n}\nfunction registerFileListFilter(filter) {\n  if (!window._nc_filelist_filters) {\n    window._nc_filelist_filters = /* @__PURE__ */ new Map();\n  }\n  if (window._nc_filelist_filters.has(filter.id)) {\n    throw new Error(`File list filter \"${filter.id}\" already registered`);\n  }\n  window._nc_filelist_filters.set(filter.id, filter);\n  emit(\"files:filter:added\", filter);\n}\nfunction unregisterFileListFilter(filterId) {\n  if (window._nc_filelist_filters && window._nc_filelist_filters.has(filterId)) {\n    window._nc_filelist_filters.delete(filterId);\n    emit(\"files:filter:removed\", filterId);\n  }\n}\nfunction getFileListFilters() {\n  if (!window._nc_filelist_filters) {\n    return [];\n  }\n  return [...window._nc_filelist_filters.values()];\n}\nconst addNewFileMenuEntry = function(entry) {\n  const newFileMenu = getNewFileMenu();\n  return newFileMenu.registerEntry(entry);\n};\nconst removeNewFileMenuEntry = function(entry) {\n  const newFileMenu = getNewFileMenu();\n  return newFileMenu.unregisterEntry(entry);\n};\nconst getNewFileMenuEntries = function(context) {\n  const newFileMenu = getNewFileMenu();\n  return newFileMenu.getEntries(context).sort((a, b) => {\n    if (a.order !== void 0 && b.order !== void 0 && a.order !== b.order) {\n      return a.order - b.order;\n    }\n    return a.displayName.localeCompare(b.displayName, void 0, { numeric: true, sensitivity: \"base\" });\n  });\n};\nexport {\n  Column,\n  DefaultType,\n  File,\n  FileAction,\n  FileListFilter,\n  FileType,\n  FilesSortingMode,\n  Folder,\n  Header,\n  InvalidFilenameError,\n  InvalidFilenameErrorReason,\n  Navigation,\n  NewMenuEntryCategory,\n  Node,\n  NodeStatus,\n  Permission,\n  View,\n  addNewFileMenuEntry,\n  davGetClient,\n  davGetDefaultPropfind,\n  davGetFavoritesReport,\n  davGetRecentSearch,\n  davGetRemoteURL,\n  davGetRootPath,\n  davParsePermissions,\n  davRemoteURL,\n  davResultToNode,\n  davRootPath,\n  defaultDavNamespaces,\n  defaultDavProperties,\n  formatFileSize,\n  getDavNameSpaces,\n  getDavProperties,\n  getFavoriteNodes,\n  getFileActions,\n  getFileListFilters,\n  getFileListHeaders,\n  getNavigation,\n  getNewFileMenuEntries,\n  getUniqueName,\n  isFilenameValid,\n  orderBy,\n  parseFileSize,\n  registerDavProperty,\n  registerFileAction,\n  registerFileListFilter,\n  registerFileListHeaders,\n  removeNewFileMenuEntry,\n  sortNodes,\n  unregisterFileListFilter,\n  validateFilename\n};\n","\n      import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n      import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n      import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n      import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n      import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n      import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n      import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n      \n      \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n      options.insert = insertFn.bind(null, \"head\");\n    \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n       export default content && content.locals ? content.locals : undefined;\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FileAction, Node, registerDavProperty, registerFileAction } from '@nextcloud/files';\nimport { translate as t } from '@nextcloud/l10n';\nimport '../css/fileEntryInlineSystemTags.scss';\nconst getNodeSystemTags = function (node) {\n    const tags = node.attributes?.['system-tags']?.['system-tag'];\n    if (tags === undefined) {\n        return [];\n    }\n    return [tags].flat();\n};\nconst renderTag = function (tag, isMore = false) {\n    const tagElement = document.createElement('li');\n    tagElement.classList.add('files-list__system-tag');\n    tagElement.textContent = tag;\n    if (isMore) {\n        tagElement.classList.add('files-list__system-tag--more');\n    }\n    return tagElement;\n};\nexport const action = new FileAction({\n    id: 'system-tags',\n    displayName: () => '',\n    iconSvgInline: () => '',\n    enabled(nodes) {\n        // Only show the action on single nodes\n        if (nodes.length !== 1) {\n            return false;\n        }\n        const node = nodes[0];\n        const tags = getNodeSystemTags(node);\n        // Only show the action if the node has system tags\n        if (tags.length === 0) {\n            return false;\n        }\n        return true;\n    },\n    exec: async () => null,\n    async renderInline(node) {\n        // Ensure we have the system tags as an array\n        const tags = getNodeSystemTags(node);\n        if (tags.length === 0) {\n            return null;\n        }\n        const systemTagsElement = document.createElement('ul');\n        systemTagsElement.classList.add('files-list__system-tags');\n        if (tags.length === 1) {\n            systemTagsElement.setAttribute('aria-label', t('files', 'This file has the tag {tag}', { tag: tags[0] }));\n        }\n        else {\n            const firstTags = tags.slice(0, -1).join(', ');\n            const lastTag = tags[tags.length - 1];\n            systemTagsElement.setAttribute('aria-label', t('files', 'This file has the tags {firstTags} and {lastTag}', { firstTags, lastTag }));\n        }\n        systemTagsElement.append(renderTag(tags[0]));\n        // More tags than the one we're showing\n        if (tags.length > 1) {\n            const moreTagElement = renderTag('+' + (tags.length - 1), true);\n            moreTagElement.setAttribute('title', tags.slice(1).join(', '));\n            systemTagsElement.append(moreTagElement);\n        }\n        return systemTagsElement;\n    },\n    order: 0,\n});\nregisterDavProperty('nc:system-tags');\nregisterFileAction(action);\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { createClient } from 'webdav';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth';\n// init webdav client\nconst rootUrl = generateRemoteUrl('dav');\nexport const davClient = createClient(rootUrl);\n// set CSRF token header\nconst setHeaders = (token) => {\n    davClient.setHeaders({\n        // Add this so the server knows it is an request from the browser\n        'X-Requested-With': 'XMLHttpRequest',\n        // Inject user auth\n        requesttoken: token ?? '',\n    });\n};\n// refresh headers when request token changes\nonRequestTokenUpdate(setHeaders);\nsetHeaders(getRequestToken());\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport camelCase from 'camelcase';\nexport const defaultBaseTag = {\n    userVisible: true,\n    userAssignable: true,\n    canAssign: true,\n};\nexport const parseTags = (tags) => {\n    return tags.map(({ props }) => Object.fromEntries(Object.entries(props)\n        .map(([key, value]) => [camelCase(key), camelCase(key) === 'displayName' ? String(value) : value])));\n};\n/**\n * Parse id from `Content-Location` header\n * @param url URL to parse\n */\nexport const parseIdFromLocation = (url) => {\n    const queryPos = url.indexOf('?');\n    if (queryPos > 0) {\n        url = url.substring(0, queryPos);\n    }\n    const parts = url.split('/');\n    let result;\n    do {\n        result = parts[parts.length - 1];\n        parts.pop();\n        // note: first result can be empty when there is a trailing slash,\n        // so we take the part before that\n    } while (!result && parts.length > 0);\n    return Number(result);\n};\nexport const formatTag = (initialTag) => {\n    if ('name' in initialTag && !('displayName' in initialTag)) {\n        return { ...initialTag };\n    }\n    const tag = { ...initialTag };\n    tag.name = tag.displayName;\n    delete tag.displayName;\n    return tag;\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport const logger = getLoggerBuilder()\n    .setApp('systemtags')\n    .detectUser()\n    .build();\n","import { getCurrentUser } from '@nextcloud/auth';\nimport { Folder, Permission, getDavNameSpaces, getDavProperties, davGetClient, davResultToNode, davRemoteURL, davRootPath } from '@nextcloud/files';\nimport { fetchTags } from './api';\nconst rootPath = '/systemtags';\nconst client = davGetClient();\nconst resultToNode = (node) => davResultToNode(node);\nconst formatReportPayload = (tagId) => `<?xml version=\"1.0\"?>\n<oc:filter-files ${getDavNameSpaces()}>\n\t<d:prop>\n\t\t${getDavProperties()}\n\t</d:prop>\n\t<oc:filter-rules>\n\t\t<oc:systemtag>${tagId}</oc:systemtag>\n\t</oc:filter-rules>\n</oc:filter-files>`;\nconst tagToNode = function (tag) {\n    return new Folder({\n        id: tag.id,\n        source: `${davRemoteURL}${rootPath}/${tag.id}`,\n        owner: String(getCurrentUser()?.uid ?? 'anonymous'),\n        root: rootPath,\n        displayname: tag.displayName,\n        permissions: Permission.READ,\n        attributes: {\n            ...tag,\n            'is-tag': true,\n        },\n    });\n};\nexport const getContents = async (path = '/') => {\n    // List tags in the root\n    const tagsCache = (await fetchTags()).filter(tag => tag.userVisible);\n    if (path === '/') {\n        return {\n            folder: new Folder({\n                id: 0,\n                source: `${davRemoteURL}${rootPath}`,\n                owner: getCurrentUser()?.uid,\n                root: rootPath,\n                permissions: Permission.NONE,\n            }),\n            contents: tagsCache.map(tagToNode),\n        };\n    }\n    const tagId = parseInt(path.split('/', 2)[0]);\n    const tag = tagsCache.find(tag => tag.id === tagId);\n    if (!tag) {\n        throw new Error('Tag not found');\n    }\n    const folder = tagToNode(tag);\n    const contentsResponse = await client.getDirectoryContents(davRootPath, {\n        details: true,\n        // Only filter favorites if we're at the root\n        data: formatReportPayload(tagId),\n        headers: {\n            // Patched in WebdavClient.ts\n            method: 'REPORT',\n        },\n    });\n    return {\n        folder,\n        contents: contentsResponse.data.map(resultToNode),\n    };\n};\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport './actions/inlineSystemTagsAction.js';\nimport { translate as t } from '@nextcloud/l10n';\nimport { View, getNavigation } from '@nextcloud/files';\nimport TagMultipleSvg from '@mdi/svg/svg/tag-multiple.svg?raw';\nimport { getContents } from './services/systemtags.js';\nconst Navigation = getNavigation();\nNavigation.register(new View({\n    id: 'tags',\n    name: t('systemtags', 'Tags'),\n    caption: t('systemtags', 'List of tags and their associated files and folders.'),\n    emptyTitle: t('systemtags', 'No tags found'),\n    emptyCaption: t('systemtags', 'Tags you have created will show up here.'),\n    icon: TagMultipleSvg,\n    order: 25,\n    getContents,\n}));\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport axios from '@nextcloud/axios';\nimport { generateUrl } from '@nextcloud/router';\nimport { translate as t } from '@nextcloud/l10n';\nimport { davClient } from './davClient.js';\nimport { formatTag, parseIdFromLocation, parseTags } from '../utils';\nimport { logger } from '../logger.js';\nexport const fetchTagsPayload = `<?xml version=\"1.0\"?>\n<d:propfind  xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>`;\nexport const fetchTags = async () => {\n    const path = '/systemtags';\n    try {\n        const { data: tags } = await davClient.getDirectoryContents(path, {\n            data: fetchTagsPayload,\n            details: true,\n            glob: '/systemtags/*', // Filter out first empty tag\n        });\n        return parseTags(tags);\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to load tags'), { error });\n        throw new Error(t('systemtags', 'Failed to load tags'));\n    }\n};\nexport const fetchLastUsedTagIds = async () => {\n    const url = generateUrl('/apps/systemtags/lastused');\n    try {\n        const { data: lastUsedTagIds } = await axios.get(url);\n        return lastUsedTagIds.map(Number);\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to load last used tags'), { error });\n        throw new Error(t('systemtags', 'Failed to load last used tags'));\n    }\n};\n/**\n * @param tag\n * @return created tag id\n */\nexport const createTag = async (tag) => {\n    const path = '/systemtags';\n    const tagToPost = formatTag(tag);\n    try {\n        const { headers } = await davClient.customRequest(path, {\n            method: 'POST',\n            data: tagToPost,\n        });\n        const contentLocation = headers.get('content-location');\n        if (contentLocation) {\n            return parseIdFromLocation(contentLocation);\n        }\n        logger.error(t('systemtags', 'Missing \"Content-Location\" header'));\n        throw new Error(t('systemtags', 'Missing \"Content-Location\" header'));\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to create tag'), { error });\n        throw new Error(t('systemtags', 'Failed to create tag'));\n    }\n};\nexport const updateTag = async (tag) => {\n    const path = '/systemtags/' + tag.id;\n    const data = `<?xml version=\"1.0\"?>\n\t<d:propertyupdate  xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\n\t\t<d:set>\n\t\t\t<d:prop>\n\t\t\t\t<oc:display-name>${tag.displayName}</oc:display-name>\n\t\t\t\t<oc:user-visible>${tag.userVisible}</oc:user-visible>\n\t\t\t\t<oc:user-assignable>${tag.userAssignable}</oc:user-assignable>\n\t\t\t</d:prop>\n\t\t</d:set>\n\t</d:propertyupdate>`;\n    try {\n        await davClient.customRequest(path, {\n            method: 'PROPPATCH',\n            data,\n        });\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to update tag'), { error });\n        throw new Error(t('systemtags', 'Failed to update tag'));\n    }\n};\nexport const deleteTag = async (tag) => {\n    const path = '/systemtags/' + tag.id;\n    try {\n        await davClient.deleteFile(path);\n    }\n    catch (error) {\n        logger.error(t('systemtags', 'Failed to delete tag'), { error });\n        throw new Error(t('systemtags', 'Failed to delete tag'));\n    }\n};\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:22px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-left:5px}@media(min-width: 512px){.files-list__system-tags{display:flex}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss\"],\"names\":[],\"mappings\":\"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,eAAA,CAIF,yBACC,yBACC,YAAA,CAAA\",\"sourcesContent\":[\"/**\\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n * SPDX-License-Identifier: AGPL-3.0-or-later\\n */\\n\\n.files-list__system-tags {\\n\\t--min-size: 32px;\\n\\tdisplay: none;\\n\\tjustify-content: center;\\n\\talign-items: center;\\n\\tmin-width: calc(var(--min-size) * 2);\\n\\tmax-width: 300px;\\n}\\n\\n.files-list__system-tag {\\n\\tpadding: 5px 10px;\\n\\tborder: 1px solid;\\n\\tborder-radius: var(--border-radius-pill);\\n\\tborder-color: var(--color-border);\\n\\tcolor: var(--color-text-maxcontrast);\\n\\theight: var(--min-size);\\n\\twhite-space: nowrap;\\n\\toverflow: hidden;\\n\\ttext-overflow: ellipsis;\\n\\tline-height: 22px; // min-size - 2 * 5px padding\\n\\ttext-align: center;\\n\\n\\t&--more {\\n\\t\\toverflow: visible;\\n\\t\\ttext-overflow: initial;\\n\\t}\\n\\n\\t// Proper spacing if multiple shown\\n\\t& + .files-list__system-tag {\\n\\t\\tmargin-left: 5px;\\n\\t}\\n}\\n\\n@media (min-width: 512px) {\\n\\t.files-list__system-tags {\\n\\t\\tdisplay: flex;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2766;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2766: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(27560)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","setApp","detectUser","build","DefaultType","DefaultType2","Permission","Permission2","defaultDavProperties","defaultDavNamespaces","d","nc","oc","ocs","FileType","FileType2","isDavRessource","source","davService","match","validateData","data","id","Error","URL","e","startsWith","displayname","mtime","Date","crtime","mime","size","permissions","NONE","ALL","owner","attributes","root","includes","service","join","status","Object","values","NodeStatus","NodeStatus2","Node","_data","_attributes","_knownDavService","readonlyAttributes","entries","getOwnPropertyDescriptors","prototype","filter","get","map","handler","set","target","prop","value","this","Reflect","deleteProperty","receiver","warn","constructor","Proxy","update","replace","encodedSource","origin","slice","length","basename","extension","extname","dirname","split","pop","firstMatch","indexOf","url","pathname","updateMtime","READ","path","fileid","move","destination","oldBasename","rename","basename2","name","TypeError","File","type","Folder","super","davRootPath","uid","davRemoteURL","davGetRemoteURL","Navigation","_views","_currentView","register","view","find","search","push","dispatchTypedEvent","CustomEvent","remove","index","findIndex","splice","setActive","event","detail","active","views","Column","_column","column","isValidColumn","title","render","sort","summary","validator$2","util$3","exports","nameStartChar","nameRegexp","regexName","RegExp","isExist","v","isEmptyObject","obj","keys","merge","a","arrayMode","len","i","getValue","isName","string","exec","getAllMatches","regex","matches","allmatches","startIndex","lastIndex","util$2","defaultOptions$2","allowBooleanAttributes","unpairedTags","isWhiteSpace","char","readPI","xmlData","start","tagname","substr","getErrorObject","getLineNumberForPosition","readCommentAndCDATA","angleBracketsCount","validate","options","assign","tags","tagFound","reachedRoot","err","tagStartPos","closingTag","tagName","trim","substring","msg","result","readAttributeStr","attrStr","attrStrStart","isValid","validateAttributeString","code","line","tagClosed","otg","openPos","col","afterAmp","validateAmpersand","JSON","stringify","t2","doubleQuote","singleQuote","startChar","validAttrStrRegxp","attrNames","getPositionFromMatch","attrName","validateAttrName","hasOwnProperty","re2","validateNumberAmpersand","count","message","lineNumber","lines","OptionsBuilder","defaultOptions$1","preserveOrder","attributeNamePrefix","attributesGroupName","textNodeName","ignoreAttributes","removeNSPrefix","parseTagValue","parseAttributeValue","trimValues","cdataPropName","numberParseOptions","hex","leadingZeros","eNotation","tagValueProcessor","val2","attributeValueProcessor","stopNodes","alwaysCreateTextNode","isArray","commentPropName","processEntities","htmlEntities","ignoreDeclaration","ignorePiTags","transformTagName","transformAttributeName","updateTag","jPath","attrs","buildOptions","defaultOptions","util$1","readEntityExp","entityName2","isComment","isEntity","isElement","isAttlist","isNotation","validateEntityName","hexRegex","numRegex","Number","parseInt","window","parseFloat","consider","decimalPoint","util","xmlNode","child","add","key","addChild","node","readDocType","entities","hasBody","comment","exp","entityName","val","regx","toNumber","str","trimmedStr","skipLike","test","sign","numTrimmedByZeros","numStr","num","addExternalEntities","externalEntities","entKeys","ent","lastEntities","parseTextData","dontTrim","hasAttributes","isLeafNode","escapeEntities","replaceEntitiesValue","newval","parseValue","resolveNameSpace","prefix","charAt","attrsRegx","buildAttributesMap","oldVal","aName","newVal","attrCollection","parseXml","xmlObj","currentNode","textData","closeIndex","findClosingIndex","colonIndex","saveTextToParentTag","lastTagName","lastIndexOf","propIndex","tagsNodeStack","tagData","readTagExp","childNode","tagExp","attrExpPresent","endIndex","docTypeEntities","rawTagName","lastTag","isItStopNode","tagContent","result2","readStopNodeData","replaceEntitiesValue$1","entity","ampEntity","currentTagName","allNodesExp","stopNodePath","stopNodeExp","errMsg","closingIndex","closingChar","attrBoundary","ch","tagExpWithClosingIndex","separatorIndex","trimStart","openTagCount","shouldParse","node2json","compress","arr","text","compressedObj","tagObj","property","propName$1","newJpath","isLeaf","isLeafTag","assignAttributes","Array","attrMap","jpath","atrrName","propCount","prettify","OrderedObjParser2","_","String","fromCharCode","validator$1","arrToStr","indentation","xmlStr","isPreviousElementTag","propName","newJPath","tagText","isStopNode","attStr2","attr_to_str","tempInd","piTextNodeName","newIdentation","indentBy","tagStart","tagValue","suppressUnpairedNode","suppressEmptyNode","endsWith","attr","attrVal","suppressBooleanAttributes","textValue","buildFromOrderedJs","jArray","format","oneListGroup","Builder","isAttribute","attrPrefixLen","processTextOrObjNode","indentate","tagEndChar","newLine","object","level","j2x","buildTextValNode","buildObjectNode","repeat","jObj","arrayNodeName","call","buildAttrPairStr","arrLen","listTagVal","j","item","Ks","L","closeTag","tagEndExp","piClosingChar","fxp","XMLParser","parse","validationOption","toString","orderedObjParser","orderedResult","addEntity","XMLValidator","XMLBuilder","debug_1","process","env","NODE_DEBUG","args","console","error","constants","MAX_LENGTH","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","MAX_LENGTH$1","MAX_SAFE_INTEGER","RELEASE_TYPES","SEMVER_SPEC_VERSION","FLAG_INCLUDE_PRERELEASE","FLAG_LOOSE","re$1","module","MAX_SAFE_COMPONENT_LENGTH2","MAX_SAFE_BUILD_LENGTH2","MAX_LENGTH2","debug2","re","safeRe","src","t","R","LETTERDASHNUMBER","safeRegexReplacements","createToken","isGlobal","safe","token","max","makeSafeRegex","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCEPLAIN","COERCE","COERCEFULL","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","reExports","freeze","loose","numeric","compareIdentifiers$1","b","anum","bnum","identifiers","compareIdentifiers","rcompareIdentifiers","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","getNodeSystemTags","_node$attributes","undefined","flat","renderTag","tag","isMore","arguments","tagElement","document","createElement","classList","textContent","action","_action","validateAction","displayName","iconSvgInline","enabled","execBatch","order","parent","default","inline","renderInline","nodes","async","systemTagsElement","setAttribute","firstTags","append","moreTagElement","namespace","_nc_dav_properties","_nc_dav_namespaces","namespaces","registerDavProperty","_nc_fileactions","debug","registerFileAction","rootUrl","generateRemoteUrl","davClient","createClient","setHeaders","requesttoken","onRequestTokenUpdate","getRequestToken","logger","getLoggerBuilder","rootPath","client","remoteURL","headers","patch","headers2","method","fetch","davGetClient","resultToNode","filesRoot","userId","props","permString","CREATE","UPDATE","DELETE","SHARE","davParsePermissions","nodeData","filename","lastmod","getcontentlength","FAILED","hasPreview","davResultToNode","formatReportPayload","tagId","concat","ns","tagToNode","_getCurrentUser$uid","_getCurrentUser","getCurrentUser","_nc_navigation","_view","columns","caption","getContents","icon","jsonObject","parser","some","x","toLowerCase","isSvg","forEach","emptyView","sticky","expanded","defaultSortKey","isValidView","emptyTitle","emptyCaption","params","tagsCache","getDirectoryContents","details","glob","_ref","fromEntries","_ref2","camelCase","parseTags","fetchTags","userVisible","_getCurrentUser2","folder","contents","___CSS_LOADER_EXPORT___","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","m","O","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","every","r","n","getter","__esModule","definition","o","defineProperty","enumerable","Promise","resolve","g","globalThis","Function","Symbol","toStringTag","nmd","paths","children","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","bind","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file
