]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(systemtags): Correctly set the display name for the Nextcloud node 46978/head
authorFerdinand Thiessen <opensource@fthiessen.de>
Wed, 31 Jul 2024 14:52:24 +0000 (16:52 +0200)
committernextcloud-command <nextcloud-command@users.noreply.github.com>
Fri, 2 Aug 2024 07:36:39 +0000 (07:36 +0000)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
apps/systemtags/src/services/systemtags.ts
dist/systemtags-init.js
dist/systemtags-init.js.LICENSE.txt
dist/systemtags-init.js.map

index 4e81ec7dce035e906df6657b78558bbe95b56508..27a8b1c6874bf2c8d06d4a1b5a2b585666c5d1f0 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  */
+import type { ContentsWithRoot } from '@nextcloud/files'
 import type { FileStat, ResponseDataDetailed } from 'webdav'
 import type { TagWithId } from '../types'
 
-import { Folder, type ContentsWithRoot, Permission, getDavNameSpaces, getDavProperties } 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'
-import { getClient } from '../../../files/src/services/WebdavClient'
-import { resultToNode } from '../../../files/src/services/Files'
+
+const rootPath = '/systemtags'
+
+const client = davGetClient()
+const resultToNode = (node: FileStat) => davResultToNode(node)
 
 const formatReportPayload = (tagId: number) => `<?xml version="1.0"?>
 <oc:filter-files ${getDavNameSpaces()}>
        <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,
@@ -62,16 +65,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) {
@@ -79,7 +82,7 @@ export const getContents = async (path = '/'): Promise<ContentsWithRoot> => {
        }
 
        const folder = tagToNode(tag)
-       const contentsResponse = await getClient().getDirectoryContents('/', {
+       const contentsResponse = await client.getDirectoryContents(davRootPath, {
                details: true,
                // Only filter favorites if we're at the root
                data: formatReportPayload(tagId),
index 3d755656fcd8159e14a54e9de718e81629928bc3..f9e0306be0db5064fe43908d16c879ca2eeff448 100644 (file)
@@ -1,3 +1,3 @@
 /*! For license information please see systemtags-init.js.LICENSE.txt */
-(()=>{"use strict";var e,t={93562:(e,t,n)=>{var s=n(92320),i=n(53334),r=n(85072),o=n.n(r),a=n(97825),l=n.n(a),d=n(77659),c=n.n(d),A=n(55056),u=n.n(A),p=n(10540),m=n.n(p),f=n(41113),g=n.n(f),h=n(73911),v={};v.styleTagTransform=g(),v.setAttributes=u(),v.insert=c().bind(null,"head"),v.domAPI=l(),v.insertStyleElement=m(),o()(h.A,v),h.A&&h.A.locals&&h.A.locals;const y=function(e){var t;const n=null===(t=e.attributes)||void 0===t||null===(t=t["system-tags"])||void 0===t?void 0:t["system-tag"];return void 0===n?[]:[n].flat()},C=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("li");return n.classList.add("files-list__system-tag"),n.textContent=e,t&&n.classList.add("files-list__system-tag--more"),n},w=new s.hY({id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled(e){if(1!==e.length)return!1;const t=e[0];return 0!==y(t).length},exec:async()=>null,async renderInline(e){const t=y(e);if(0===t.length)return null;const n=document.createElement("ul");if(n.classList.add("files-list__system-tags"),1===t.length)n.setAttribute("aria-label",(0,i.Tl)("files","This file has the tag {tag}",{tag:t[0]}));else{const e=t.slice(0,-1).join(", "),s=t[t.length-1];n.setAttribute("aria-label",(0,i.Tl)("files","This file has the tags {firstTags} and {lastTag}",{firstTags:e,lastTag:s}))}if(n.append(C(t[0])),t.length>1){const e=C("+"+(t.length-1),!0);e.setAttribute("title",t.slice(1).join(", ")),n.append(e)}return n},order:0});(0,s.Yc)("nc:system-tags"),(0,s.Gg)(w);var b=n(63814),x=n(21777),T=(n(26287),n(44719));const _=(0,b.dC)("dav"),L=(0,T.UU)(_),B=e=>{L.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=e?e:""})};(0,x.zo)(B),B((0,x.do)());var O=n(71654),P=n(53529);const S=(0,P.YK)().setApp("systemtags").detectUser().build();var E;const R="/files/".concat(null===(E=(0,x.HW)())||void 0===E?void 0:E.uid),j=(0,b.dC)("dav"+R),z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;const t=(0,T.UU)(e),n=e=>{null==t||t.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=e?e:""})};return(0,x.zo)(n),n((0,x.do)()),(0,T.Gu)().patch("fetch",((e,t)=>{const n=t.headers;return null!=n&&n.method&&(t.method=n.method,delete n.method),fetch(e,t)})),t};n(36117),(0,P.YK)().setApp("files").detectUser().build(),z();const I=function(e){var t;const n=null===(t=(0,x.HW)())||void 0===t?void 0:t.uid;if(!n)throw new Error("No user id found");const i=e.props,r=(0,s.vb)(null==i?void 0:i.permissions),o=String(i["owner-id"]||n),a=(0,b.dC)("dav"+R+e.filename),l={id:(null==i?void 0:i.fileid)<0?function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t>>>0}(a):(null==i?void 0:i.fileid)||0,source:a,mtime:new Date(e.lastmod),mime:e.mime||"application/octet-stream",size:(null==i?void 0:i.size)||0,permissions:r,owner:o,root:R,attributes:{...e,...i,"owner-id":o,"owner-display-name":String(i["owner-display-name"]),hasPreview:!(null==i||!i["has-preview"]),failed:(null==i?void 0:i.fileid)<0}};return delete l.attributes.props,"file"===e.type?new s.ZH(l):new s.vd(l)},N=e=>'<?xml version="1.0"?>\n<oc:filter-files '.concat((0,s.CP)(),">\n\t<d:prop>\n\t\t").concat((0,s.VX)(),"\n\t</d:prop>\n    <oc:filter-rules>\n        <oc:systemtag>").concat(e,"</oc:systemtag>\n    </oc:filter-rules>\n</oc:filter-files>"),U=function(e){var t;return new s.vd({id:e.id,source:(0,b.dC)("dav/systemtags/"+e.id),owner:null===(t=(0,x.HW)())||void 0===t?void 0:t.uid,root:"/systemtags",permissions:s.aX.READ,attributes:{...e,"is-tag":!0}})};(0,s.bh)().register(new s.Ss({id:"tags",name:(0,i.Tl)("systemtags","Tags"),caption:(0,i.Tl)("systemtags","List of tags and their associated files and folders."),emptyTitle:(0,i.Tl)("systemtags","No tags found"),emptyCaption:(0,i.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const t=(await(async()=>{try{const{data:e}=await L.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(e=>e.map((e=>{let{props:t}=e;return Object.fromEntries(Object.entries(t).map((e=>{let[t,n]=e;return[(0,O.A)(t),"displayName"===(0,O.A)(t)?String(n):n]})))})))(e)}catch(e){throw S.error((0,i.Tl)("systemtags","Failed to load tags"),{error:e}),new Error((0,i.Tl)("systemtags","Failed to load tags"))}})()).filter((e=>e.userVisible));var n;if("/"===e)return{folder:new s.vd({id:0,source:(0,b.dC)("dav/systemtags"),owner:null===(n=(0,x.HW)())||void 0===n?void 0:n.uid,root:"/systemtags",permissions:s.aX.NONE}),contents:t.map(U)};const r=parseInt(e.replace("/",""),10),o=t.find((e=>e.id===r));if(!o)throw new Error("Tag not found");return{folder:U(o),contents:(await z().getDirectoryContents("/",{details:!0,data:N(r),headers:{method:"REPORT"}})).data.map(I)}}}))},73911:(e,t,n)=>{n.d(t,{A:()=>a});var s=n(71354),i=n.n(s),r=n(76314),o=n.n(r)()(i());o.push([e.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:"AAsBA,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 * @copyright Copyright (c) 2023 Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @author Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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}},n={};function s(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=t,e=[],s.O=(t,n,i,r)=>{if(!n){var o=1/0;for(c=0;c<e.length;c++){n=e[c][0],i=e[c][1],r=e[c][2];for(var a=!0,l=0;l<n.length;l++)(!1&r||o>=r)&&Object.keys(s.O).every((e=>s.O[e](n[l])))?n.splice(l--,1):(a=!1,r<o&&(o=r));if(a){e.splice(c--,1);var d=i();void 0!==d&&(t=d)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[n,i,r]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.e=()=>Promise.resolve(),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.j=2766,(()=>{s.b=document.baseURI||self.location.href;var e={2766:0};s.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,o=n[0],a=n[1],l=n[2],d=0;if(o.some((t=>0!==e[t]))){for(i in a)s.o(a,i)&&(s.m[i]=a[i]);if(l)var c=l(s)}for(t&&t(n);d<o.length;d++)r=o[d],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return s.O(c)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),s.nc=void 0;var i=s.O(void 0,[4208],(()=>s(93562)));i=s.O(i)})();
-//# sourceMappingURL=systemtags-init.js.map?v=6bbc06778b6f02105ba8
\ No newline at end of file
+(()=>{"use strict";var t,e={49611:(t,e,n)=>{var s=n(92320),i=n(53334),r=n(85072),o=n.n(r),a=n(97825),l=n.n(a),d=n(77659),c=n.n(d),A=n(55056),g=n.n(A),p=n(10540),u=n.n(p),m=n(41113),f=n.n(m),h=n(73911),v={};v.styleTagTransform=f(),v.setAttributes=g(),v.insert=c().bind(null,"head"),v.domAPI=l(),v.insertStyleElement=u(),o()(h.A,v),h.A&&h.A.locals&&h.A.locals;const y=function(t){var e;const n=null===(e=t.attributes)||void 0===e||null===(e=e["system-tags"])||void 0===e?void 0:e["system-tag"];return void 0===n?[]:[n].flat()},C=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("li");return n.classList.add("files-list__system-tag"),n.textContent=t,e&&n.classList.add("files-list__system-tag--more"),n},b=new s.hY({id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled(t){if(1!==t.length)return!1;const e=t[0];return 0!==y(e).length},exec:async()=>null,async renderInline(t){const e=y(t);if(0===e.length)return null;const n=document.createElement("ul");if(n.classList.add("files-list__system-tags"),1===e.length)n.setAttribute("aria-label",(0,i.Tl)("files","This file has the tag {tag}",{tag:e[0]}));else{const t=e.slice(0,-1).join(", "),s=e[e.length-1];n.setAttribute("aria-label",(0,i.Tl)("files","This file has the tags {firstTags} and {lastTag}",{firstTags:t,lastTag:s}))}if(n.append(C(e[0])),e.length>1){const t=C("+"+(e.length-1),!0);t.setAttribute("title",e.slice(1).join(", ")),n.append(t)}return n},order:0});(0,s.Yc)("nc:system-tags"),(0,s.Gg)(b);var w=n(21777),x=(n(26287),n(44719));const T=(0,n(63814).dC)("dav"),_=(0,x.UU)(T),L=t=>{_.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=t?t:""})};(0,w.zo)(L),L((0,w.do)());var B=n(71654);const O=(0,n(53529).YK)().setApp("systemtags").detectUser().build(),P="/systemtags",S=(0,s.H4)(),j=t=>(0,s.Al)(t),E=t=>'<?xml version="1.0"?>\n<oc:filter-files '.concat((0,s.CP)(),">\n\t<d:prop>\n\t\t").concat((0,s.VX)(),"\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>"),I=function(t){var e,n;return new s.vd({id:t.id,source:"".concat(s.PY).concat(P,"/").concat(t.id),owner:String(null!==(e=null===(n=(0,w.HW)())||void 0===n?void 0:n.uid)&&void 0!==e?e:"anonymous"),root:P,displayname:t.displayName,permissions:s.aX.READ,attributes:{...t,"is-tag":!0}})};(0,s.bh)().register(new s.Ss({id:"tags",name:(0,i.Tl)("systemtags","Tags"),caption:(0,i.Tl)("systemtags","List of tags and their associated files and folders."),emptyTitle:(0,i.Tl)("systemtags","No tags found"),emptyCaption:(0,i.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 _.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,n]=t;return[(0,B.A)(e),"displayName"===(0,B.A)(e)?String(n):n]})))})))(t)}catch(t){throw O.error((0,i.Tl)("systemtags","Failed to load tags"),{error:t}),new Error((0,i.Tl)("systemtags","Failed to load tags"))}})()).filter((t=>t.userVisible));var n;if("/"===t)return{folder:new s.vd({id:0,source:"".concat(s.PY).concat(P),owner:null===(n=(0,w.HW)())||void 0===n?void 0:n.uid,root:P,permissions:s.aX.NONE}),contents:e.map(I)};const r=parseInt(t.split("/",2)[0]),o=e.find((t=>t.id===r));if(!o)throw new Error("Tag not found");return{folder:I(o),contents:(await S.getDirectoryContents(s.lJ,{details:!0,data:E(r),headers:{method:"REPORT"}})).data.map(j)}}}))},73911:(t,e,n)=>{n.d(e,{A:()=>a});var s=n(71354),i=n.n(s),r=n(76314),o=n.n(r)()(i());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:"AAsBA,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 * @copyright Copyright (c) 2023 Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @author Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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}},n={};function s(t){var i=n[t];if(void 0!==i)return i.exports;var r=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=e,t=[],s.O=(e,n,i,r)=>{if(!n){var o=1/0;for(c=0;c<t.length;c++){n=t[c][0],i=t[c][1],r=t[c][2];for(var a=!0,l=0;l<n.length;l++)(!1&r||o>=r)&&Object.keys(s.O).every((t=>s.O[t](n[l])))?n.splice(l--,1):(a=!1,r<o&&(o=r));if(a){t.splice(c--,1);var d=i();void 0!==d&&(e=d)}}return e}r=r||0;for(var c=t.length;c>0&&t[c-1][2]>r;c--)t[c]=t[c-1];t[c]=[n,i,r]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.e=()=>Promise.resolve(),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s.j=2766,(()=>{s.b=document.baseURI||self.location.href;var t={2766:0};s.O.j=e=>0===t[e];var e=(e,n)=>{var i,r,o=n[0],a=n[1],l=n[2],d=0;if(o.some((e=>0!==t[e]))){for(i in a)s.o(a,i)&&(s.m[i]=a[i]);if(l)var c=l(s)}for(e&&e(n);d<o.length;d++)r=o[d],s.o(t,r)&&t[r]&&t[r][0](),t[r]=0;return s.O(c)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),s.nc=void 0;var i=s.O(void 0,[4208],(()=>s(49611)));i=s.O(i)})();
+//# sourceMappingURL=systemtags-init.js.map?v=5a1e047867ad9b4b5e93
\ No newline at end of file
index 94216e469b4ccb3e77dd9af10984539721cd9db8..e8e4083ede2463ecf3361625abb1d4fc3e827cf0 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  */
-
-/**
- * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>
- *
- * @author John Molakvoæ <skjnldsv@protonmail.com>
- *
- * @license AGPL-3.0-or-later
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
index 72e78171e8f8925d30d176a144b7535417abc278..cf95aa32d14924248d6cbd578e0b859c33362ff3 100644 (file)
@@ -1 +1 @@
-{"version":3,"file":"systemtags-init.js?v=6bbc06778b6f02105ba8","mappings":";uBAAIA,kLCWAC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM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EAAO,EAGjCmD,EAAqBV,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FU,EAAmBC,QAAQN,EAAqBO,KAAK,KAAM,IAC3DF,EAAmB/D,KAAO0D,EAAqBO,KAAK,KAAMF,EAAmB/D,KAAKiE,KAAKF,QClDvF5D,EAAoB+D,QAAKzM,ECGzB,IAAI0M,EAAsBhE,EAAoBQ,OAAElJ,EAAW,CAAC,OAAO,IAAO0I,EAAoB,SAC9FgE,EAAsBhE,EAAoBQ,EAAEwD","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","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/logger.ts","webpack:///nextcloud/apps/files/src/services/WebdavClient.ts","webpack:///nextcloud/apps/files/src/logger.js","webpack:///nextcloud/apps/files/src/services/Files.ts","webpack:///nextcloud/apps/files/src/utils/hashUtils.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/utils.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};","\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 * @copyright Copyright (c) 2023 Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @author Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @copyright 2023 Christopher Ng <chrng8@gmail.com>\n *\n * @author Christopher Ng <chrng8@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @copyright 2023 Christopher Ng <chrng8@gmail.com>\n *\n * @author Christopher Ng <chrng8@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport const logger = getLoggerBuilder()\n    .setApp('systemtags')\n    .detectUser()\n    .build();\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { createClient, getPatcher } from 'webdav';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getCurrentUser, getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth';\nexport const rootPath = `/files/${getCurrentUser()?.uid}`;\nexport const defaultRootUrl = generateRemoteUrl('dav' + rootPath);\nexport const getClient = (rootUrl = defaultRootUrl) => {\n    const client = createClient(rootUrl);\n    // set CSRF token header\n    const setHeaders = (token) => {\n        client?.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\n    onRequestTokenUpdate(setHeaders);\n    setHeaders(getRequestToken());\n    /**\n     * Allow to override the METHOD to support dav REPORT\n     *\n     * @see https://github.com/perry-mitchell/webdav-client/blob/8d9694613c978ce7404e26a401c39a41f125f87f/source/request.ts\n     */\n    const patcher = getPatcher();\n    // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n    // @ts-ignore\n    // https://github.com/perry-mitchell/hot-patcher/issues/6\n    patcher.patch('fetch', (url, options) => {\n        const headers = options.headers;\n        if (headers?.method) {\n            options.method = headers.method;\n            delete headers.method;\n        }\n        return fetch(url, options);\n    });\n    return client;\n};\n","/**\n * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('files')\n\t.detectUser()\n\t.build()\n","import { CancelablePromise } from 'cancelable-promise';\nimport { File, Folder, davParsePermissions, davGetDefaultPropfind } from '@nextcloud/files';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { getClient, rootPath } from './WebdavClient.ts';\nimport { hashCode } from '../utils/hashUtils';\nimport logger from '../logger';\nconst client = getClient();\nexport const resultToNode = function (node) {\n    const userId = getCurrentUser()?.uid;\n    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 source = generateRemoteUrl('dav' + rootPath + node.filename);\n    const id = props?.fileid < 0\n        ? hashCode(source)\n        : props?.fileid || 0;\n    const nodeData = {\n        id,\n        source,\n        mtime: new Date(node.lastmod),\n        mime: node.mime || 'application/octet-stream',\n        size: props?.size || 0,\n        permissions,\n        owner,\n        root: rootPath,\n        attributes: {\n            ...node,\n            ...props,\n            'owner-id': owner,\n            'owner-display-name': String(props['owner-display-name']),\n            hasPreview: !!props?.['has-preview'],\n            failed: props?.fileid < 0,\n        },\n    };\n    delete nodeData.attributes.props;\n    return node.type === 'file'\n        ? new File(nodeData)\n        : new Folder(nodeData);\n};\nexport const getContents = (path = '/') => {\n    const controller = new AbortController();\n    const propfindPayload = davGetDefaultPropfind();\n    return new CancelablePromise(async (resolve, reject, onCancel) => {\n        onCancel(() => controller.abort());\n        try {\n            const contentsResponse = await client.getDirectoryContents(path, {\n                details: true,\n                data: propfindPayload,\n                includeSelf: true,\n                signal: controller.signal,\n            });\n            const root = contentsResponse.data[0];\n            const contents = contentsResponse.data.slice(1);\n            if (root.filename !== path) {\n                throw new Error('Root node does not match requested path');\n            }\n            resolve({\n                folder: resultToNode(root),\n                contents: contents.map(result => {\n                    try {\n                        return resultToNode(result);\n                    }\n                    catch (error) {\n                        logger.error(`Invalid node detected '${result.basename}'`, { error });\n                        return null;\n                    }\n                }).filter(Boolean),\n            });\n        }\n        catch (error) {\n            reject(error);\n        }\n    });\n};\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nexport const hashCode = function (str) {\n    let hash = 0;\n    for (let i = 0; i < str.length; i++) {\n        hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0;\n    }\n    return (hash >>> 0);\n};\n","import { Folder, Permission, getDavNameSpaces, getDavProperties } from '@nextcloud/files';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { fetchTags } from './api';\nimport { getClient } from '../../../files/src/services/WebdavClient';\nimport { resultToNode } from '../../../files/src/services/Files';\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 getClient().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 * @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @copyright 2023 Christopher Ng <chrng8@gmail.com>\n *\n * @author Christopher Ng <chrng8@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @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","/**\n * @copyright 2023 Christopher Ng <chrng8@gmail.com>\n *\n * @author Christopher Ng <chrng8@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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    const tag = { ...initialTag };\n    if (tag.name && !tag.displayName) {\n        return tag;\n    }\n    tag.name = tag.displayName;\n    delete tag.displayName;\n    return tag;\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\":\"AAsBA,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 * @copyright Copyright (c) 2023 Lucas Azevedo <lhs_azevedo@hotmail.com>\\n *\\n * @author Lucas Azevedo <lhs_azevedo@hotmail.com>\\n *\\n * @license AGPL-3.0-or-later\\n *\\n * This program is free software: you can redistribute it and/or modify\\n * it under the terms of the GNU Affero General Public License as\\n * published by the Free Software Foundation, either version 3 of the\\n * License, or (at your option) any later version.\\n *\\n * This program is distributed in the hope that it will be useful,\\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\n * GNU Affero General Public License for more details.\\n *\\n * You should have received a copy of the GNU Affero General Public License\\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\\n *\\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__(93562)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","getNodeSystemTags","node","_node$attributes","tags","attributes","undefined","flat","renderTag","tag","isMore","arguments","length","tagElement","document","createElement","classList","add","textContent","action","FileAction","id","displayName","iconSvgInline","enabled","nodes","exec","async","renderInline","systemTagsElement","setAttribute","t","firstTags","slice","join","lastTag","append","moreTagElement","order","registerDavProperty","registerFileAction","rootUrl","generateRemoteUrl","davClient","createClient","setHeaders","token","requesttoken","onRequestTokenUpdate","getRequestToken","logger","getLoggerBuilder","setApp","detectUser","build","rootPath","concat","_getCurrentUser","getCurrentUser","uid","defaultRootUrl","getClient","client","getPatcher","patch","url","headers","method","fetch","resultToNode","userId","Error","props","permissions","davParsePermissions","owner","String","source","filename","nodeData","fileid","str","hash","i","charCodeAt","hashCode","mtime","Date","lastmod","mime","size","root","hasPreview","failed","type","File","Folder","formatReportPayload","tagId","getDavNameSpaces","getDavProperties","tagToNode","Permission","READ","getNavigation","register","View","name","caption","emptyTitle","emptyCaption","icon","getContents","path","tagsCache","data","getDirectoryContents","details","glob","map","_ref","Object","fromEntries","entries","_ref2","key","value","camelCase","parseTags","error","fetchTags","filter","userVisible","_getCurrentUser2","folder","NONE","contents","parseInt","replace","find","___CSS_LOADER_EXPORT___","push","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","e","Promise","resolve","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","bind","nc","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"systemtags-init.js?v=5a1e047867ad9b4b5e93","mappings":";uBAAIA,kLCWAC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,OAAnD,MCFDC,EAAoB,SAAUC,GAAM,IAAAC,EACtC,MAAMC,EAAsB,QAAlBD,EAAGD,EAAKG,kBAAU,IAAAF,GAAiB,QAAjBA,EAAfA,EAAkB,sBAAc,IAAAA,OAAA,EAAhCA,EAAmC,cAChD,YAAaG,IAATF,EACO,GAEJ,CAACA,GAAMG,MAClB,EACMC,EAAY,SAAUC,GAAqB,IAAhBC,EAAMC,UAAAC,OAAA,QAAAN,IAAAK,UAAA,IAAAA,UAAA,GACnC,MAAME,EAAaC,SAASC,cAAc,MAM1C,OALAF,EAAWG,UAAUC,IAAI,0BACzBJ,EAAWK,YAAcT,EACrBC,GACAG,EAAWG,UAAUC,IAAI,gCAEtBJ,CACX,EACaM,EAAS,IAAIC,EAAAA,GAAW,CACjCC,GAAI,cACJC,YAAaA,IAAM,GACnBC,cAAeA,IAAM,GACrBC,OAAAA,CAAQC,GAEJ,GAAqB,IAAjBA,EAAMb,OACN,OAAO,EAEX,MAAMV,EAAOuB,EAAM,GAGnB,OAAoB,IAFPxB,EAAkBC,GAEtBU,MAIb,EACAc,KAAMC,SAAY,KAClB,kBAAMC,CAAa1B,GAEf,MAAME,EAAOH,EAAkBC,GAC/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IACzBwC,EAAU7C,EAASK,GAChBf,EAAoB4B,EAAE0B,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOvD,EAAoBQ,EAAEC,EAAO,EAGjCoD,EAAqBV,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FU,EAAmBC,QAAQN,EAAqBO,KAAK,KAAM,IAC3DF,EAAmBhE,KAAO2D,EAAqBO,KAAK,KAAMF,EAAmBhE,KAAKkE,KAAKF,QClDvF7D,EAAoBgE,QAAKvL,ECGzB,IAAIwL,EAAsBjE,EAAoBQ,OAAE/H,EAAW,CAAC,OAAO,IAAOuH,EAAoB,SAC9FiE,EAAsBjE,EAAoBQ,EAAEyD","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","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/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/utils.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};","\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 * @copyright Copyright (c) 2023 Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @author Lucas Azevedo <lhs_azevedo@hotmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @copyright 2023 Christopher Ng <chrng8@gmail.com>\n *\n * @author Christopher Ng <chrng8@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @copyright 2023 Christopher Ng <chrng8@gmail.com>\n *\n * @author Christopher Ng <chrng8@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Roeland Jago Douma <roeland@famdouma.nl>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @copyright 2023 Christopher Ng <chrng8@gmail.com>\n *\n * @author Christopher Ng <chrng8@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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 * @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","/**\n * @copyright 2023 Christopher Ng <chrng8@gmail.com>\n *\n * @author Christopher Ng <chrng8@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\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    const tag = { ...initialTag };\n    if (tag.name && !tag.displayName) {\n        return tag;\n    }\n    tag.name = tag.displayName;\n    delete tag.displayName;\n    return tag;\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\":\"AAsBA,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 * @copyright Copyright (c) 2023 Lucas Azevedo <lhs_azevedo@hotmail.com>\\n *\\n * @author Lucas Azevedo <lhs_azevedo@hotmail.com>\\n *\\n * @license AGPL-3.0-or-later\\n *\\n * This program is free software: you can redistribute it and/or modify\\n * it under the terms of the GNU Affero General Public License as\\n * published by the Free Software Foundation, either version 3 of the\\n * License, or (at your option) any later version.\\n *\\n * This program is distributed in the hope that it will be useful,\\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\n * GNU Affero General Public License for more details.\\n *\\n * You should have received a copy of the GNU Affero General Public License\\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\\n *\\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__(49611)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","getNodeSystemTags","node","_node$attributes","tags","attributes","undefined","flat","renderTag","tag","isMore","arguments","length","tagElement","document","createElement","classList","add","textContent","action","FileAction","id","displayName","iconSvgInline","enabled","nodes","exec","async","renderInline","systemTagsElement","setAttribute","t","firstTags","slice","join","lastTag","append","moreTagElement","order","registerDavProperty","registerFileAction","rootUrl","generateRemoteUrl","davClient","createClient","setHeaders","token","requesttoken","onRequestTokenUpdate","getRequestToken","logger","getLoggerBuilder","setApp","detectUser","build","rootPath","client","davGetClient","resultToNode","davResultToNode","formatReportPayload","tagId","concat","getDavNameSpaces","getDavProperties","tagToNode","_getCurrentUser$uid","_getCurrentUser","Folder","source","davRemoteURL","owner","String","getCurrentUser","uid","root","displayname","permissions","Permission","READ","getNavigation","register","View","name","caption","emptyTitle","emptyCaption","icon","getContents","path","tagsCache","data","getDirectoryContents","details","glob","map","_ref","props","Object","fromEntries","entries","_ref2","key","value","camelCase","parseTags","error","Error","fetchTags","filter","userVisible","_getCurrentUser2","folder","NONE","contents","parseInt","split","find","davRootPath","headers","method","___CSS_LOADER_EXPORT___","push","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","e","Promise","resolve","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","bind","nc","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file