PNG
IHDR ; IDATxܻn0K
)(pA7LeG{ §㻢|ذaÆ
6lذaÆ
6lذaÆ
6lom$^yذag5 bÆ
6lذaÆ
6lذa{
6lذaÆ
`}HFkm,mӪôô!x|'ܢ˟;E:9&ᶒ}{v]n&6
h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%tMז -lG6mrz2s%9s@-k9=)kB5\+͂ZsٲRn~GRCwIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL /F*\Ԕ#"5m2[S=gnaPeғL
lذaÆ
6l^ḵaÆ
6lذaÆ
6lذa;
_ذaÆ
6lذaÆ
6lذaÆ
R IENDB`
define(["./chunks/vendor-22992e2c","./chunks/useSpacesLoading-b404aeae","./chunks/visibility-c7f197c2","./chunks/base-fbc1ccef","./chunks/functions-f74c7f04","./chunks/filesize-506c5ef4","./chunks/useGraphClient-6c0c047b","./chunks/List-7b7e3ab3","./chunks/error-cc50dafd","./chunks/_rollupPluginBabelHelpers-d0b0ebba","./chunks/client-aa4fd000","./chunks/useLocalStorage-9756f032","./chunks/AppLoadingSpinner-348c6387","./chunks/QuotaSelect-f6082d31","./chunks/useDriveResolver-be2aa3cc","./chunks/useUserContext-a419a918","./chunks/loadPreview-dfef3918","./chunks/useTranslations-561064a5","./web-client-c170d434"],(function(e,t,i,s,a,r,n,o,l,c,d,u,p,h,m,f,g,v,b){"use strict";const S=e.defineComponent({setup(){const s=i.useStore();e.watch(t.useRoute(),(()=>{s.dispatch("Files/resetFileSelection")}))},data:()=>({dragareaEnabled:!1}),created(){const e=i.eventBus.subscribe("drag-over",this.onDragOver),t=i.eventBus.subscribe("drag-out",this.hideDropzone),s=i.eventBus.subscribe("drop",this.hideDropzone);this.$on("beforeDestroy",(()=>{i.eventBus.unsubscribe("drag-over",e),i.eventBus.unsubscribe("drag-out",t),i.eventBus.unsubscribe("drop",s)}))},methods:{hideDropzone(){this.dragareaEnabled=!1},onDragOver(e){this.dragareaEnabled=(e.dataTransfer.types||[]).some((e=>"Files"===e))}}});var _=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("main",{staticClass:"oc-flex oc-height-1-1",attrs:{id:"files"}},[e.dragareaEnabled?i("div",{staticClass:"dragarea"}):e._e(),e._v(" "),i("router-view",{staticClass:"oc-width-expand",attrs:{tabindex:"0"}})],1)};_._withStripped=!0;const y=e.normalizeComponent({render:_,staticRenderFns:[]},undefined,S,"data-v-3a1c04ea",false,undefined,!1,void 0,void 0,void 0);class w{static Thumbnail=[36,36];static Preview=[1200,1200];static Avatar=64}class x{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}class C{static perPageDefault="100";static perPageQueryName="items-per-page"}function k(t){const i=function(t){if(t.perPage)return e.computed((()=>e.unref(t.perPage)));const i=r.useRouteQueryPersisted({name:C.perPageQueryName,defaultValue:C.perPageDefault});return e.computed((()=>parseInt(String(e.unref(i)))))}(t),s=e.ref(t.page),a=e.computed((()=>Math.ceil(e.unref(t.items).length/e.unref(i))||1));return{items:e.computed((()=>{if(!e.unref(i))return e.unref(t.items);const a=(e.unref(s)-1)*e.unref(i),r=a+e.unref(i);return e.unref(t.items).slice(a,r)})),total:a,perPage:i}}const F=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const i=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${i.path||i.name}" instead.`),i}}),E={path:"/",redirect:e=>o.createLocationSpaces("files-spaces-generic",e)};function $(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=s.urlJoin(e,{leadingSlash:!0});if("/"===i)return[];var a=[],r=i.split("/");for(t&&a.push(i),r.pop();r.length>0;)r.join("/")?(a.push(r.join("/")),r.pop()):r.pop();return a}var I={cs:{"%{name} already exists":"%{name} již existuje",Accept:"Přijmout",Actions:"Akce","Add people":"Přidat lidi","All files":"Všechny soubory","An error occurred while loading the public link":"Při načítání veřejného odkazu došlo k chybě",Cancel:"Zrušit",Confirm:"Potvrdit",Copy:{"Action in the files list row to initiate copying resources":"Kopírovat","":"Kopírovat"},Create:"Vytvořit",Decline:"Odmítnout",Delete:"Odstranit",Download:"Stáhnout","Drop files here to upload or click to select file":"Sem přetáhněte soubory, které chcete nahrát, nebo kliknutím vyberte soubor","Error while sharing.":"Sdílení selhalo.",Favorites:"Oblíbené","File name":"Název souboru","File name cannot be empty":"Jméno souboru nemůže být prázdné",'File name cannot be equal to ".."':'Název souboru nemůže být ".."','File name cannot be equal to "."':'Název souboru nemůže být "."','File name cannot contain "/"':'Název souboru nemůže obsahovat "/"',"File name cannot end with whitespace":"Název souboru nemůže končit mezerou",Files:"Soubory","Folder name":"Jméno složky","Folder name cannot be empty":"Jméno složky nemůže být prázdný",'Folder name cannot be equal to ".."':'Název složky nemůže být ".."','Folder name cannot be equal to "."':'Název složky nemůže být "."','Folder name cannot contain "/"':'Název složky nemůže obsahovat "/"',"Folder name cannot end with whitespace":"Název složky nemůže končit mezerou",Folders:"Složky",Group:"Skupina","Loading public link…":"Načítání veřejného odkazu...",Name:"Název",New:"Nový","New file":"Nový soubor","New folder":"Nová složka","No Versions available for this file":"Pro tento soubor nejsou dostupné žádné verze",Owner:"Vlastník",Password:"Heslo","Public link":"Veřejný odkaz","Remove password":"Odstranit heslo",Rename:"Přejmenovat","Rename file %{name}":"Přejmenovat soubor %{name}","Rename folder %{name}":"Přejmenovat složku %{name}",Restore:"Obnovit",Save:"Uložit",Share:"Sdílet","Shared with me":"Sdíleno se mnou",Size:"Velikost",Status:"Stav",'The name "%{name}" is already taken':'Jméno "%{name}" je již obsazeno','The name cannot be equal to ".."':'Název nemůže být ".."','The name cannot be equal to "."':'Název nemůže být "."','The name cannot contain "/"':'Název nemůže obsahovat "/"',"The name cannot end with whitespace":"Název nemůže končit mezerou","The private link has been copied to your clipboard.":"Soukromý odkaz byl úspěšně zkopírován",Upload:"Nahrát",User:"Uživatel",Versions:"Verze","You have no permission to upload!":"Nemáte oprávnění nahrávat soubory."},de:{'"%{file}" was deleted successfully':'"%{file}" wurde erfolgreich gelöscht','"%{fileName}" was created successfully':'"%{fileName}" wurde erfolgreich erstellt','"%{folderName}" was created successfully':'"%{folderName}" wurde erfolgreich erstellt',"“via folder”":'"durch Ordner"',"(me)":"(ich)","(Opens in new window)":"(Öffnet in neuem Fenster)","%{ amount } item selected. Actions are available above the table.":["%{ amount } Element ausgewählt. Aktionen sind oberhalb der Tabelle verfügbar.","%{ amount } Elemente ausgewählt. Aktionen sind oberhalb der Tabelle verfügbar."],"%{ filesCount } file":["%{ filesCount } Datei","%{ filesCount } Dateien"],"%{ foldersCount } folder":["%{ foldersCount } Ordner","%{ foldersCount } Ordner"],"%{ itemCount } item selected":["%{ itemCount } Datei ausgewählt","%{ itemCount } Elemente ausgewählt"],"%{ itemsCount } item in total (%{ filesStr}, %{foldersStr})":["%{ itemsCount } Datei gesamt (%{ filesStr}, %{foldersStr})","%{ itemsCount } Elemente gesamt (%{ filesStr}, %{foldersStr})"],"%{ itemsCount } item with %{ itemSize } in total (%{ filesStr}, %{foldersStr})":["%{ itemsCount } Datei mit %{ itemSize } gesamt (%{ filesStr}, %{foldersStr})","%{ itemsCount } Elemente mit %{ itemSize } gesamt (%{ filesStr}, %{foldersStr})"],"%{collaboratorName} (me)":"%{collaboratorName} (Ich)","%{count} item was copied successfully":["%{count} Dateie wurde erfolgreich kopiert","%{count} Elemente wurden erfolgreich kopiert"],"%{count} item was moved successfully":["%{count} Datei wurde erfolgreich verschoben","%{count} Elemente wurden erfolgreich verschoben"],"%{count} member":["%{count} Mitglied","%{count} Mitglieder"],"%{displayName} (me)":"%{displayName} (ich)","%{linkShareCount} link giving access.":["%{linkShareCount} Link gewährt Zugriff.","%{linkShareCount} Links gewähren Zugriff."],"%{name}":"%{name}","%{name} already exists":"%{name} existiert bereits","%{owner} shared this folder with you for uploading":"%{owner} hat diesen Ordner zum Upload geteilt.","%{resource} was restored successfully":"%{resource} erfolgreich wiederhergestellt","%{resourceCount} files restored successfully":"%{resourceCount} Dateien erfolgreich wiederhergestellt","%{used} of %{total} used (%{percentage}% used)":"%{used} von %{total} benutzt (%{percentage}% used)","%{used} used (no restriction)":"%{used} benutzt (unbegrenzt)","⌘ + C":{"Keyboard shortcut for macOS for copying files":"⌘ + C"},"⌘ + V":{"Keyboard shortcut for macOS for pasting files":"⌘ + V"},"⌘ + X":{"Keyboard shortcut for macOS for cutting files":"⌘ + X"},Accept:"Annehmen","Accept share":["Freigabe annehmen","Freigaben annehmen"],"Accepted shares":"Angenommene Freigaben","Access details":"Zugriffdetails","Access expires":"Freigabe endet",'Account and login is required. Only people from the list "Invited people" can access.':'Konto und Anmeldung sind erforderlich. Nur Personen aus der Liste "Geteilt mit" haben Zugang.',Actions:"Aktionen",Add:"Hinzufügen","Add expiration date":"Ablaufdatum setzen","Add link":"Link hinzufügen","Add members":"Mitglieder hinzufügen","Add members to this Space":"Mitglieder zu diesem Space hinzufügen","Add password":"Passwort setzen","Add people":"Personen hinzufügen","Add to favorites":"Zu Favoriten hinzufügen","Additional info":"Zusatzinfo","All Actions":"Alle Interaktionen","All deleted files were removed":"Alle gelöschten Dateien wurden entfernt","All files":"Alle Dateien","All files and folders":"Alle Dateien und Ordner","An error occurred while loading the public link":"Beim Laden des öffentlichen Links ist ein Fehler aufgetreten",Apply:"Anwenden","Apply to all %{count} conflicts":"Auf alle %{count} Konflikte anwenden","Are you sure you want to delete all selected resources?":"Sollen die gewählten Elemente wirklich gelöscht werden?","Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.":"Sollen die gewählten Elemente wirklich gelöscht werden? Der gesamte Inhalt wird endgültig gelöscht. Diese Aktion kann nicht rückgängig gemacht werden.","Are you sure you want to delete this file?":"Soll diese Datei wirklich gelöscht werden?","Are you sure you want to delete this file? All it’s content will be permanently removed. This action cannot be undone.":"Soll diese Datei wirklich gelöscht werden? Der gesamte Inhalt wird endgültig gelöscht. Diese Aktion kann nicht rückgängig gemacht werden.","Are you sure you want to delete this folder?":"Soll dieser Ordner wirklich gelöscht werden?","Are you sure you want to delete this folder? All it’s content will be permanently removed. This action cannot be undone.":"Soll dieser Ordner wirklich gelöscht werden? Der gesamte Inhalt wird endgültig gelöscht. Diese Aktion kann nicht rückgängig gemacht werden.","Are you sure you want to delete this link? Recreating the same link again is not possible.":"Soll der ausgewählte Link wirklich gelöscht werden? Derselbe Link kann danach nicht wieder erzeugt werden.","Are you sure you want to delete this space?":"Sicher, dass du diesen Space löschen möchtest?","Are you sure you want to permanently delete your items in the trash bin? You can’t undo this action.":"Sicher, dass Dateien im Papierkorb endgültig gelöscht werden sollen? Die Aktion kann nicht rückgängig gemacht werden.","Are you sure you want to remove this share?":"Sicher, dass die Freigabe entfernt werden soll?",Cancel:"Abbrechen","Change quota for space %{name}":"Ändere Quota für den Space %{name}","Change subtitle for space":"Untertitel für diesen Space ändern","Choose how access is granted":"Bitte auswählen wie der Zugriff erteilt wird","Clear selection":"Auswahl aufheben","Close filter":"Filter schließen","Close sidebar to hide details":"Seitenleiste schließen um Details zu verbergen",Confirm:"Bestätigen","Context menu of the share":"Kontextmenü der Freigabe",Copied:"Kopiert","Copied to clipboard!":"In die Zwischenablage kopiert!",Copy:{"Action in the files list row to initiate copying resources":"Kopieren","":"Kopieren"},"Copy direct link":"Direkten Link kopieren","Copy EOS path":"EOS-Pfad kopieren","Copy here":"Hierher kopieren","Copy here?":"Hierher kopieren?","Copy link to clipboard":"Link in die Zwischenablage kopieren","Copy private link to clipboard":"Privaten Link in die Zwischenablage kopieren","Copy quicklink":"Quicklink kopieren",Create:"Erstellen","Create a new file":"Neue Datei erstellen","Create a new folder":"Neuen Ordner erstellen","Create a new space":"Neuen Space erzeugen","Create link":"Link erzeugen","Create new files or folders":"Neue Dateien oder Ordner erstellen","Create quick link":"Quicklink erzeugen","Creating share":"Freigabe wird erzeugt","Creating space failed…":"Anlegen des Space fehlgeschlagen...","Ctrl + C":{"Keyboard shortcut for non-macOS systems for copying files":"Strg + C"},"Ctrl + V":{"Keyboard shortcut for non-macOS systems for pasting files":"Strg + V"},"Ctrl + X":{"Keyboard shortcut for non-macOS systems for cutting files":"Strg + X"},Cut:{"Action in the files list row to initiate cutting resources":"Ausschneiden"},"Cut to clipboard!":"In die Zwischenablage ausgeschnitten",Decline:"Ablehnen","Decline share":["Freigabe ablehnen","Freigaben ablehnen"],"Declined shares":"Abgelehnte Freigaben",Delete:"Löschen","Delete file %{name}":"Datei %{name} löschen","Delete folder %{name}":"Ordner %{name} löschen","Delete link":"Link löschen","Delete selected resource?":["Ausgewählte Ressource löschen?","%{amount} ausgewählte Elemente löschen?"],"Delete space":"Space löschen",Deleted:"Gelöscht","Deleted files":"Gelöschte Dateien","Deny access":"Verweigere Zugriff","Deselect %{name}":"Auswahl für %{name} aufheben",Details:"Details","Direct link":"Direkter Link","Direct link copied":"Direkter Link kopiert",Disable:"Deaktivieren","Disable Space?":"Space deaktivieren?",Disabled:"Deaktiviert","Disabled spaces cannot be entered":"Deaktivierte Spaces können nicht betreten werden","Display customization options of the files list":"Anpassungsoptionen für die Dateienliste anzeigen",Download:"Herunterladen","Download older version":"Ältere Version herunterladen",'Drag files and folders here or use the "New" or "Upload" buttons to add files':'Dateien oder Ordner hierherziehen oder die "Neu" oder "Hochladen" Buttons nutzen, um Dateien hinzuzufügen',"Drop files here to upload or click to select file":"Dateien hier fallenlassen oder zum Selektieren anklicken","Edit description":"Beschreibung bearbeiten","Edit description for space %{name}":"Beschreibung für Space %{name} bearbeiten","Edit expiration date":"Ablaufdatum bearbeiten","Edit image":"Bild bearbeiten","Edit name":"Namen bearbeiten","Edit password":"Passwort bearbeiten","Edit quota":"Quota ändern","Edit subtitle":"Untertitel bearbeiten","Empty trash bin":"Papierkorb leeren",Enable:"Aktivieren","Enable Space?":"Space aktivieren?","Enter a name or group to share this item.":"Name oder Gruppe eingeben, um die Datei freizugeben.","Enter a name to add people or groups as members to this Space.":"Geben Sie einen Namen ein, um Personen oder Gruppen als Mitglieder zu diesem Space hinzuzufügen.","EOS Path":"EOS-Pfad","EOS path copied":"EOS-Pfad kopiert","Error while editing the share.":"Fehler beim Bearbeiten der Freigabe.","Error while sharing.":"Fehler beim Teilen.","Everyone with the link":"Jeder der den Link kennt","Expires %{expires}":"Läuft ab: %{expires}","Expires in %{timeToExpiry} (%{expiryDate})":"Läuft ab in %{timeToExpiry} (%{expiryDate})","Failed to accept the selected share.":["Fehler beim Annehmen der ausgewählten Freigabe.","Fehler beim Annehmen der ausgewählten Freigaben."],"Failed to apply expiration date":"Fehler beim Anwenden des Ablaufdatums","Failed to apply new permissions":"Fehler beim Anwenden der neuen Rechte",'Failed to change favorite state of "%{file}"':'Fehler beim Ändern des Favoriten-Status von "%{file}"',"Failed to change space quota":"Fehler beim Ändern der Space-Quota","Failed to change space subtitle":"Fehler beim Ändern des Space-Untertitels",'Failed to copy "%{name}"':'Fehler beim Kopieren von "%{name}"',"Failed to copy %{count} resources":"Fehler beim Kopieren von %{count} Dateien","Failed to create file":"Fehler beim Erzeugen der Datei","Failed to create folder":"Fehler beim Erzeugen des Ordners","Failed to create link":"Link konnte nicht erstellt werden","Failed to decline the selected share":["Fehler beim Ablehnen der ausgewählten Freigabe","Fehler beim Ablehnen der ausgewählten Freigaben"],'Failed to delete "%{file}"':'Fehler beim Löschen von "%{file}"','Failed to delete "%{file}" - the file is locked':'Fehler beim Löschen von "%{file}" - die Datei ist gesperrt',"Failed to delete all files permanently":{"Error message in case clearing the trash bin fails":"Fehler beim endgültigen Löschen aller Dateien"},"Failed to delete link":"Fehler beim Löschen des Links","Failed to delete space":"Fehler beim Löschen des Space","Failed to disable space":"Fehler beim Deaktivieren des Space","Failed to download the selected folder.":["Fehler beim Herunterladen der ausgewählten Datei.","Fehler beim Herunterladen der ausgewählten Dateien."],"Failed to edit space description":"Fehler beim Ändern der Space-Beschreibung",'Failed to move "%{name}"':'Fehler beim Verschieben von "%{name}"',"Failed to move %{count} resources":"Fehler beim Verschieben von %{count} Dateien","Failed to remove share":"Fehler beim Löschen der Freigabe",'Failed to rename "%{file}" to "%{newName}"':'Fehler beim Umbenennen von "%{file}" zu "%{newName}"','Failed to rename "%{file}" to "%{newName}" - the file is locked':'Fehler beim Umbenennen von "%{file}" zu "%{newName}" - die Datei ist gesperrt',"Failed to rename space":"Fehler beim Umbenennen des Space",'Failed to restore "%{resource}"':'Fehler beim Wiederherstellen von "%{resource}"',"Failed to restore %{resourceCount} files":"Fehler beim Wiederherstellen von %{resourceCount} Dateien","Failed to restore space":"Fehler beim Wiederherstellen des Space","Failed to set space description":"Fehler beim Speichern der Space-Beschreibung","Failed to set space image":"Fehler beim Speichern des Space-Bildes","Failed to update link":"Fehler beim Bearbeiten des Links","Failed to upload space image":"Fehler beim Hochladen des Space-Bildes","Favorite files":"Favorisierte Dateien",Favorites:"Favoriten",file:"Datei","File already exists":"Die Datei existiert bereits","File name":"Dateiname","File name cannot be empty":"Der Dateiname darf nicht leer sein.",'File name cannot be equal to ".."':'Der Dateiname darf nicht ".." sein.','File name cannot be equal to "."':'Der Dateiname darf nicht "." sein.','File name cannot contain "/"':'Der Dateiname darf kein "/" enthalten.',"File name cannot end with whitespace":"Der Dateiname darf nicht mit einem Leerzeichen enden.","File with name %{name} already exists.":"Datei %{name} existiert bereits.",Files:"Dateien","Files shared via link":"Per Link geteilte Dateien","Files shared with me":"Mit mir geteilte Dateien","Files shared with others":"Mit anderen geteilten Dateien","Filter members":"Mitglieder filtern",folder:"Ordner",Folder:"Ordner","Folder name":"Ordnername","Folder name cannot be empty":"Der Ordnername darf nicht leer sein.",'Folder name cannot be equal to ".."':'Der Ordnername darf nicht ".." sein.','Folder name cannot be equal to "."':'Der Ordnername darf nicht "." sein.','Folder name cannot contain "/"':'Der Ordnername darf kein "/" enthalten.',"Folder name cannot end with whitespace":"Der Ordnername darf nicht mit einem Leerzeichen enden.","Folder with name %{name} already exists.":"Der Ordner %{name} existiert bereits.",Folders:"Ordner","Found %{totalResults}, showing the %{itemCount} best matching results":"Gefunden %{totalResults}, zeige die %{itemCount} besten passenden Treffer","Go to »Personal« page":"Persönliche Seite anzeigen","Go to »Spaces Overview«":"Zur »Spaces Übersicht« gehen",Group:"Gruppe",Guest:"Gast","Guest user":"Gastnutzer","Here you can add a description for this Space.":"Hier können Sie eine Beschreibung für diesen Space hinzufügen.",Hide:"Ausblenden","How to edit indirect links":"Bearbeiten von indirekten Links",'If you disable the space "%{spaceName}", it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.':'Wenn Sie den Space "%{spaceName}" deaktivieren, kann auf ihn nicht mehr zugegriffen werden. Nur Space-Manager haben noch Zugriff.\nHinweis: Es werden keine Dateien von dem Server gelöscht.','If you enable the space "%{spaceName}", it can be accessed again.':'Wenn Sie den Space "%{spaceName}" aktivieren, kann darauf wieder zugegriffen werden.',"If you share a folder, all of its contents and subfolders will be shared as well.":"Wenn Sie einen Ordner teilen, werden alle seine Inhalte und Unterordner ebenfalls geteilt.",Incognito:"Inkognito","Indirect links (%{ count })":"Indirekte Links (%{ count })","Indirect links are links giving access by a parent folder.":"Indirekte Links sind Links, die den Zugriff durch einen übergeordneten Ordner ermöglichen.","Indirect links can only be edited in their parent folder. Click on the folder icon below the link to navgate to the parent folder.":"Indirekte Links können nur in ihrem übergeordneten Ordner bearbeitet werden. Klicken Sie auf das Ordnersymbol unter dem Link, um zum übergeordneten Ordner zu navigieren.",Invite:"Einladen","Invite as %{ name }":"Als %{ name } einladen","Invite specific people":"Bestimmte Personen einladen","Invite with custom permissions":"Mit benutzerdefinierten Rechten einladen","Invited by":"Eingeladen von","Invited people can not see who else has access..":"Eingeladene Personen können nicht sehen wer sonst noch eingeladen ist.","Invited people will be notified via email or in-app notification.":"Eingeladene Personen werden per E-Mail oder In-App-Benachrichtigung benachrichtigt.","Items per page":"Dateien pro Seite","Keep both":"Beide behalten","Last activity":"Letzte Aktivitäten","Last modified":"Zuletzt bearbeitet",Link:"Link","Link name":"Link-Name","Link was created successfully":"Der Link wurde erfolgreich erstellt","Link was deleted successfully":"Der Link wurde erfolgreich gelöscht","Link was updated successfully":"Der Link wurde erfolgreich bearbeitet","Loading list of shares":"Lade die Liste der Freigaben","Loading public link…":"Lade öffentlichen Link…",Manager:"Manager",Members:"Mitglieder","Members can see who else has access to this space and can access all files in this space. Read or write permissions can be set by the member’s role such as “Viewer” or “Editor”.":'Mitglieder können sehen, wer sonst noch Zugang zu diesem Space hat und können auf alle Dateien in diesem Space zugreifen. Die Lese- oder Schreibberechtigung kann durch die Rolle des Mitglieds wie "Betrachter" oder "Bearbeiter" festgelegt werden.',"Members with the Manager role can edit all properties and content of a Space, such as adding or removing members, sharing subfolders with non-members, or creating links to share.":"Mitglieder mit der Rolle Manager können alle Eigenschaften und Inhalte eines Spaces bearbeiten, z.B. Mitglieder hinzufügen oder entfernen, Unterordner für Nicht-Mitglieder freigeben oder Links zum Teilen erstellen.",Merge:"Zusammenführen",Modified:"Bearbeitet",msg:"Nachricht",Name:"Name","Navigate to '%{folder}'":"Zu '%{folder}' navigieren","Navigate to parent folder":"In den übergeordneten Ordner navigieren","Navigate to space":"In den Space navigieren","Navigate to the parent (%{folderName})":"In den übergeordneten Ordner (%{folderName}) navigieren",New:"Neu","New file":"Neue Datei","New folder":"Neuer Ordner","New Folder":"Neuer Ordner","New space":"Neuer Space","New Space":"Neuer Space",no:"nein","No information to display":"Keine Informationen anzeigbar","No items selected.":"Keine Elemente ausgewählt.","No link":"Kein Link",'No login required. Everyone with the link can access. If you share this link with people from the list "Invited people", they need to login so that their individual assigned permissions can take effect. If they are not logged-in, the permissions of the link take effect.':'Keine Anmeldung erforderlich. Jeder, der den Link kennt, kann zugreifen. Wenn Sie diesen Link für Personen aus der Liste "Geteilt mit" teilen, müssen sich diese anmelden, damit ihre individuell zugewiesenen Berechtigungen wirksam sind. Wenn sie nicht eingeloggt sind, werden die Berechtigungen des Links wirksam.',"No resources found":"Keine Dateien gefunden","No results found":"Keine Ergebnisse gefunden","No search term entered":"Kein Suchbegriff eingegeben","No users found.":"Keine Nutzer gefunden.","No users or groups found.":"Keine Benutzer oder Gruppen gefunden.","No Versions available for this file":"Für diese Datei sind keine Versionen verfügbar. ","Not enough quota":"Zu wenig Speicherplatz",Notification:"Benachrichtigung","Only invited people can access":"Nur eingeladene Personen haben Zugriff","Open context menu and show members":"Kontextmenü anzeigen und Mitglieder anzeigen","Open folder":{"Action in the files list row to open a folder":"Ordner öffnen"},"Open in %{ appName }":"In %{ appName } öffnen","Open in %{app}":"In %{app} öffnen","Open link list in share panel":"Liste der Linkfreigaben in der Seitenleiste öffnen","Open member list in share panel":"Liste der Mitglieder in der Seitenleiste öffnen","Open share panel":"Geteilt-mit Bereich öffnen","Open sidebar to view details":"Seitenleiste schließen um Details anzuzeigen","Overview of the information about the selected file":"Übersicht der Informationen für die ausgewählte Datei","Overview of the information about the selected files":"Überblick der Informationen zu den ausgewählten Dateien","Overview of the information about the selected space":"Alle Infos zum ausgewählten Space",Owner:"Besitzer",Password:"Passwort","Password can't be empty":"Das Passwort darf nicht leer sein","Password cannot be empty":"Das Passwort darf nicht leer sein","Passwords for links are required.":"Für Links müssen Passwörter gesetzt werden.",Paste:{"Action in the files list row to initiate pasting resources":"Einfügen"},"Paste here":"Hier einfügen","Pending shares":"Ausstehende Freigaben","Permanently delete file %{name}":"Datei %{name} endgültig löschen?","Permanently delete folder %{name}":"Ordner %{name} endgültig löschen?","Permanently delete selected resource?":["Ausgewählte Ressource endgültig löschen?","%{amount} ausgewählte Dateien endgültig löschen?"],"Person was added":"Person hinzugefügt",Personal:"Persönlich","Please, accept this share first to display available actions":"Um die verfügbaren Aktionen anzuzeigen, muss diese Freigabe zuerst akzeptiert werden.","Private link":"Privater Link","Private link copied":"Privater Link kopiert","Public file upload":"Öffentlicher Datei-Upload","Public link":"Öffentlicher Link","Quick link":"Quicklink",Quicklink:"Quicklink",Quota:"Quota","Reload public link":"Öffentlichen Link neu laden","Remote user":"Remote-Benutzer",Remove:"Entfernen","Remove expiration date":"Entferne Ablaufdatum","Remove from favorites":"Von Favoriten entfernen","Remove password":"Entferne Passwort","Remove share":"Freigabe entfernen",Rename:"Umbenennen","Rename file %{name}":"Datei %{name} umbenennen","Rename folder %{name}":"Ordner %{name} umbenennen","Rename space":"Space umbenennen",Replace:"Ersetzen","Resource not found":"Datei nicht gefunden",Restore:"Wiederherstellen","Restore older version":"Ältere Version wiederherstellen",Save:"Speichern","Search for service or secondary Account":"Suche nach Dienst oder Zweitkonto","Search results":"Suchergebnisse","See all versions":"Alle Versionen ansehen","Select a file or folder to view details.":"Dateien oder Ordner auswählen um Details zu sehen","Select all resources":"Alle auswählen","Select file":"Datei auswählen","Select folder":"Ordner auswählen","Select role for the invitation":"Rolle für Freigabe-Einladung auswählen",Set:"Festlegen","Set as space description":"Als Space-Beschreibung festlegen","Set as space image":"Als Space Bild festlegen","Set expiration date":"Ablaufdatum setzen","Set password":"Passwort festlegen",Share:"Teilen","Share expires %{ expiryDateRelative } (%{ expiryDate })":"Freigabe läuft ab %{ expiryDateRelative } (%{ expiryDate })","Share receiver name: %{ displayName }":"Freigabe-Empfänger: %{ displayName }","Share receiver name: %{ displayName } (%{ additionalInfo })":"Freigabe-Empfänger: %{ displayName } (%{ additionalInfo })","Share receivers":"Empfänger der Freigabe","Share via link":"Per Link teilen","Share via public link":"Per öffentlichem Link teilen","Share was removed successfully":"Freigabe wurde erfolgreich entfernt","Share with people":"Mit anderen teilen","Shared by":"Geteilt von","Shared on":"Geteilt am","Shared via":"Geteilt durch","Shared via link":"Per Link geteilt","Shared with":"Geteilt mit","Shared with me":"Mit mir geteilt","Shared with others":"Mit anderen geteilt",Shares:"Geteilt","Shares pages navigation":"Navigation der geteilten Dateien Seiten",Show:"Anzeigen","Show all":"Alle anzeigen","Show context menu":"Kontextmenü anzeigen","Show file extensions":"Dateiendungen anzeigen","Show hidden files":"Versteckte Dateien anzeigen","Show invited people":"Zeige eingeladene Personen","Show less":"Weniger anzeigen","Show links":"Links anzeigen","Show members":"Mitglieder anzeigen","Show more":"Mehr anzeigen","Showing up to %{searchLimit} results":"Zeige bis zu %{searchLimit} Ergebnisse",Size:"Größe",Skip:"Überspringen","Space description":"Space Beschreibung","Space description was edited successfully":"Die Space Beschreibung wurde erfolgreich bearbeitet","Space description was set successfully":"Die Space Beschreibung wurde erfolgreich festgelegt","Space has no deleted files":"Der Space hat keine gelöschten Dateien","Space image was set successfully":"Das Space Bild wurde erfolgreich festgelegt","Space image was uploaded successfully":"Das Space Bild wurde erfolgreich hochgeladen","Space members":"Space Mitglieder","Space name":"Name des Space","Space name cannot be empty":"Der Name des Spaces darf nicht leer sein",'Space name cannot contain the following characters: / \\ . : ? * " > < |':'Space Namen dürfen folgende Zeichen nicht enthalten: / \\ . : ? * " > < |',"Space name cannot exceed 255 characters":"Der Space Name darf nicht länger als 255 Zeichen lang sein.","Space name was changed successfully":"Der Space Name wurde erfolgreich geändert","Space quota":"Space Quota","Space quota was changed successfully":"Die Space Quota wurde erfolgreich geändert","Space subtitle":"Space Untertitel","Space subtitle was changed successfully":"Der Space Untertitel wurde erfolgreich geändert","Space was deleted successfully":"Der Space wurde erfolgreich gelöscht","Space was disabled successfully":"Der Space wurde erfolgreich deaktiviert","Space was restored successfully":"Der Space wurde erfolgreich wiederhergestellt",Spaces:"Spaces",Status:"Status",Subfolders:"Unterordner",Subtitle:"Untertitel","The “via folder” is shown next to a share, if access has already been given via a parent folder. Click on the “via folder” to edit the share on its parent folder.":'Das Symbol "durch Ordner" wird neben einer Freigabe angezeigt, wenn die Freigabe bereits über einen übergeordneten Ordner gewährt wurde. Klicken Sie auf "via Ordner", um die Freigabe in ihrem übergeordneten Ordner zu bearbeiten.',"The direct link has been copied to your clipboard.":"Der direkte Link wurde in die Zwischenablage kopiert.","The EOS path has been copied to your clipboard.":"Der EOS-Pfad wurde kopiert.","The file type is unsupported":"Der Dateityp wird nicht unterstützt",'The link "%{linkName}" has been copied to your clipboard.':'Der Link "%{linkName}" wurde in die Zwischenablage kopiert.','The name "%{name}" is already taken':'Der Name "%{name}" ist bereits vergeben',"The name cannot be empty":"Der Name darf nicht leer sein",'The name cannot be equal to ".."':'Der Name darf nicht ".." sein.','The name cannot be equal to "."':'Der Name darf nicht "." sein.','The name cannot contain "/"':'Der Name darf kein "/" enthalten.',"The name cannot end with whitespace":"Der Name darf nicht mit einem Leerzeichen enden","The private link has been copied to your clipboard.":"Der private Link wurde in die Zwichenablage kopiert.","The quicklink has been copied to your clipboard.":"Der Quicklink wurde kopiert.",'The quicklink is the default link that is copied when you select "Get link” from the context menu.':'Der Quicklink ist der Standardlink, der kopiert wird, wenn Sie "Quicklink kopieren" aus dem Kontextmenü wählen.',"The selected share was accepted successfully":["Die ausgewählte Freigabe wurde erfolgreich angenommen.","Die ausgewählten Freigaben wurden erfolgreich angenommen."],"The selected share was declined successfully":["Die ausgewählte Freigabe wurde abgelehnt","Die ausgewählten Freigaben wurden abgelehnt"],"There are no resources marked as favorite":"Keine Elemente als Favoriten ausgewählt","There are no resources with a public link at the moment":"Aktuell gibt es keine Dateien mit öffentlichen Links","There is not enough quota on %{spaceName}, you need additional %{missingSpace} to upload these files":"Zu wenig Speicherplatz in %{spaceName}, weitere %{missingSpace} benötigt um diese Dateien hochzuladen","This %{ resourceType } is owned by %{ ownerName }":"Diese(r) %{ resourceType } gehört %{ ownerName }","This %{ resourceType } is shared via %{ linkCount } link":["Der/die %{ resourceType } ist via %{ linkCount } Link geteilt","Der/die %{ resourceType } ist durch %{ linkCount } Links geteilt"],"This %{ resourceType } is shared via %{ shareCount } invite":["Der/die %{ resourceType } ist via %{ linkCount } Freigabe geteilt","Der/die %{ resourceType } ist durch %{ linkCount } Freigaben geteilt"],"This file has been shared.":"Diese Datei wurde geteilt.","This folder contains %{ amount } item.":["Der Ordner enthält %{ amount } Datei.","Der Ordner enthält %{ amount } Dateien."],"This folder has been shared.":"Dieser Ordner wurde geteilt.","This folder has no content.":"Dieser Ordner ist leer.","This item is directly shared via links.":"Dieses Element wurde direkt über Links geteilt.","This item is directly shared with others.":"Dieses Element wurde direkt mit anderen Personen geteilt.","This item is shared via links through one of the parent folders.":"Dieses Element wurde durch einen übergeordneten Ordner über Links geteilt.","This item is shared with others through one of the parent folders.":"Dieses Element wurde durch einen übergeordneten Ordner mit anderen Personen geteilt.","This link is password-protected":"Dieser Link ist passwortgeschützt","This space has %{memberShareCount} member.":["Dieser Space hat %{memberShareCount} Mitglied.","Dieser Space hat %{memberShareCount} Mitglieder."],"This space has one member and %{linkShareCount} link.":["Dieser Space hat ein Mitglied und %{linkShareCount} Link.","Dieser Space hat ein Mitglied und %{linkShareCount} Links."],'To search for service or secondary accounts prefix the username with "a:" (like "a:doe") and for guest accounts prefix the username with "l:" (like "l:doe").':'Für die Suche nach Service- oder Zweitaccounts muss ein "a:" (Beispielsweise "a:doe") vor den Nutzernamen hinzugefügt werden, für Gastaccounts ein "l:" (Beispielsweise "l:doe")',Type:"Typ",Upload:"Hochladen","Upload files or folders":"Dateien oder Ordner hochladen",User:"Benutzer",Versions:"Versionen",via:"durch","We went looking everywhere, but were unable to find the selected resource.":"Wir haben überall gesucht, konnten das ausgewählte Element aber nicht finden.","What are indirect links?":"Was sind indirekte Links?","What members can do":"Was Mitglieder tun können","What Space managers can do":"Was Space Manager tun können","You are currently not collaborating on any of your resources with other people":"Es sind keine Inhalte mit anderen Personen zur Zusammenarbeit geteilt","You are not collaborating on other people's resources.":"Sie arbeiten aktuell nicht an Elementen (Dateien oder Ordner) anderer Personen.","You can't paste the selected file at this location because you can't paste an item into itself.":["Ordner können nicht in sich selbst eingefügt werden.","Ordner können nicht in sich selbst eingefügt werden."],"You don't have access to any spaces":"Sie haben aktuell keinen Zugriff auf einen Space","You don't have any previously declined shares.":"Sie haben bisher keine abgelehnten Freigaben.","You don't have permission to share this file.":"Sie haben keine Berechtigung diese Datei zu teilen.","You don't have permission to share this folder.":"Sie haben keine Berechtigung diesen Ordner zu teilen.","You have no deleted files":"Sie haben keine gelöschten Dateien","You have no permission to create new files!":"Sie haben keine Berechtigung um neue Dateien zu erzeugen!","You have no permission to upload!":"Sie haben keine Berechtigung zum Hochladen!"},es:{'"%{file}" was deleted successfully':'"%{file}" fue borrado correctamente','"%{fileName}" was created successfully':'"%{fileName}" fue creado correctamente','"%{folderName}" was created successfully':'"%{folderName}" fue creado correctamente',"(me)":"(yo)","(Opens in new window)":"(Abre en nueva ventana)","%{ amount } item selected. Actions are available above the table.":["%{ amount } objeto seleccionado. Las acciones están disponibles sobre la tabla.","%{ amount } objetos seleccionados. Las acciones están disponibles sobre la tabla.","%{ amount } objetos seleccionados. Las acciones están disponibles sobre la tabla."],"%{name} already exists":"%{name} ya existe","%{owner} shared this folder with you for uploading":"%{owner} compartió esta carpeta con usted para subir archivos.",Accept:"Aceptar",Actions:"Acciones","All files":"Todos los archivos","An error occurred while loading the public link":"Se ha producido un error al cargar el enlace público",Cancel:"Cancelar",Create:"Crear",Decline:"Rechazar",Delete:"Eliminar","Deleted files":"Archivos borrados","Deny access":"Acceso denegado",Download:"Descargar","Drop files here to upload or click to select file":"Arrastra archivos aquí o haz clic para seleccionar un archivo","Empty trash bin":"Vaciar papelera","Error while sharing.":"Error al compartir","Expires %{expires}":"Expira %{expires}",Favorites:"Favoritos","File name":"Nombre de archivo","File name cannot be empty":"El nombre de archivo no puede ser vacío",'File name cannot be equal to ".."':'El nombre de archivo no puede ser igual a ".."','File name cannot be equal to "."':'El nombre de archivo no puede ser igual a "."','File name cannot contain "/"':'El nombre del archivo no puede contener "/"',"File name cannot end with whitespace":"El nombre del archivo no puede terminar con un espacio en blanco",Files:"Archivos","Folder name":"Nombre de carpeta","Folder name cannot be empty":"El nombre de carpeta no puede ser vacío",'Folder name cannot be equal to ".."':'El nombre de carpeta no puede ser igual a ".."','Folder name cannot be equal to "."':'El nombre de carpeta no puede ser igual a "."','Folder name cannot contain "/"':'El nombre de la carpeta no puede contener "/"',"Folder name cannot end with whitespace":"El nombre de la carpeta no puede terminar con un espacio en blanco",Folders:"Carpetas",Group:"Grupo",Guest:"Invitado",Link:"Enlace","Loading public link…":"Cargando enlace público...",Manager:"gerente",msg:"msg",Name:"Nombre","New file":"Nuevo archivo","New folder":"Nueva carpeta","No Versions available for this file":"No hay versiones disponibles para este archivo",Owner:"Propietario",Password:"Contraseña","Private link":"Enlace privado","Public link":"Enlace público","Remove expiration date":"Eliminar fecha de vencimiento","Remove password":"Eliminar contraseña",Rename:"Renombrar","Rename file %{name}":"Renombrar archivo %{name}","Rename folder %{name}":"Renombrar carpeta %{name}",Restore:"Restaurar",Save:"Guardar",Share:"cuota","Shared with":"Compartido con","Shared with me":"Compartido conmigo","Shared with others":"Compartido con otros",Size:"Tamaño",Status:"Estado",'The name "%{name}" is already taken':'El nombre "%{name}" ya está tomado','The name cannot be equal to ".."':'El nombre no puede ser igual a ".."','The name cannot be equal to "."':'El nombre no puede ser igual a "."','The name cannot contain "/"':'El nombre no puede contener "/"',"The name cannot end with whitespace":"El nombre no puede terminar con un espacio en blanco","The private link has been copied to your clipboard.":"El enlace privado ha sido copiado al portapapeles",Upload:"Subir",User:"Usuario",Versions:"Versiones","You have no permission to upload!":"No tienes permisos para subir."},fr:{'"%{file}" was deleted successfully':'"%{file}" a été supprimé correctement','"%{fileName}" was created successfully':'"%{fileName}" a été créé correctement','"%{folderName}" was created successfully':'"%{folderName}" a été créé correctement',"“via folder”":"Via le dossier","(me)":"(moi)","(Opens in new window)":"(ouvre dans une nouvelle fenêtre)","%{ amount } item selected. Actions are available above the table.":["%{ amount } élément sélectionné. Les actions sont disponibles sous le tableau.","%{ amount } éléments sélectionnés. Les actions sont disponibles sous le tableau.","%{ amount } éléments sélectionnés. Les actions sont disponibles sous le tableau."],"%{ filesCount } file":["%{ filesCount } fichier","%{ filesCount } fichier","%{ filesCount } fichiers"],"%{ foldersCount } folder":["%{ filesCount } dossier","%{ filesCount } dossiers","%{ filesCount } dossiers"],"%{ itemCount } item selected":["%{ itemCount } fichier sélectionner","%{ itemCount } fichiers sélectionnés","%{ itemCount } fichiers sélectionnés"],"%{collaboratorName} (me)":"%{collaboratorName} (Moi)","%{count} item was copied successfully":["%{count} fichier a été copié","%{count} fichier ont été copiés","%{count} fichier ont été copiés"],"%{count} item was moved successfully":["%{count} fichier a été déplacé","%{count} fichiers ont été déplacés","%{count} fichier ont été copiés"],"%{count} member":["%{count} membre","%{count} membres","%{count} membres"],"%{displayName} (me)":"%{displayName} (Moi)","%{linkShareCount} link giving access.":["%{linkShareCount} lien donnant accès.","%{linkShareCount} liens donnant accès","%{linkShareCount} liens donnant accès"],"%{name}":"%{name}","%{name} already exists":"%{name} existe déjà","%{owner} shared this folder with you for uploading":"%{owner} a partagé ce dossier avec vous pour uploader.","%{resource} was restored successfully":"%{resource} a été restauré avec succès","%{resourceCount} files restored successfully":"%{resourceCount} fichier restauré","%{used} of %{total} used (%{percentage}% used)":"%{used} utilisé sur %{total} (%{percentage}% utilisée)","%{used} used (no restriction)":"%{used} utilisée (Pas de restriction)","⌘ + C":{"Keyboard shortcut for macOS for copying files":"⌘ + C"},"⌘ + V":{"Keyboard shortcut for macOS for pasting files":"⌘ + V"},"⌘ + X":{"Keyboard shortcut for macOS for cutting files":"⌘ + X"},Accept:"Accepter","Accept share":["Accepter le partage","Accepter les partages","Accepter les partages"],"Accepted shares":"Partages acceptés","Access details":"Détails de l'accès","Access expires":"Accès expirée",'Account and login is required. Only people from the list "Invited people" can access.':'Compte obligatoire. Seuls les utilisateurs dans la liste des "Invité" dispose d\'un accès.',Actions:"Actions",Add:"Ajouter","Add expiration date":"Ajouter une date d'expiration","Add link":"Ajouter un lien","Add members":"Ajouter des membres","Add members to this Space":"Ajouter des membres a l'Espace","Add password":"Ajouter un mot de passe","Add people":"Ajouter des personnes ","Add to favorites":"Ajouter aux favoris","Additional info":"Information additionnel","All Actions":"Toutes les actions","All deleted files were removed":"Tous les fichiers supprimés ont été retirés","All files":"Tous les fichiers","All files and folders":"Tous les fichiers et dossiers","An error occurred while loading the public link":"Une erreur est apparue lors du chargement du lien public",Apply:"Appliquer","Apply to all %{count} conflicts":"Appliquer aux %{count} conflits","Are you sure you want to delete all selected resources?":"Êtes vous sûr de vouloir supprimer les ressources selectionnées?","Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.":"Êtes-vous sûr de vouloir supprimer toutes les ressources sélectionnées ? Tout leur contenu sera définitivement supprimé. Cette action ne peut pas être annulée. ","Are you sure you want to delete this file?":"Êtes-vous sûr de vouloir supprimer ce fichier ?","Are you sure you want to delete this file? All it’s content will be permanently removed. This action cannot be undone.":"Êtes-vous sûr de vouloir supprimer ce fichier ? Tout son contenu sera supprimé de manière permanente. Cette action ne peut pas être annulée.","Are you sure you want to delete this folder?":"Êtes-vous sûr de vouloir supprimer ce dossier?","Are you sure you want to delete this folder? All it’s content will be permanently removed. This action cannot be undone.":"Êtes-vous sûr de vouloir supprimer ce dossier? Tout son contenu sera supprimé de manière permanente. Cette action ne peut pas être annulée.","Are you sure you want to delete this link? Recreating the same link again is not possible.":"Êtes-vous sûr de vouloir supprimer ce lien ? Recréer le même lien ne sera pas possibe à l'avenir.","Are you sure you want to delete this space?":"Êtes-vous sûr de vouloir supprimer cet Espace ?","Are you sure you want to permanently delete your items in the trash bin? You can’t undo this action.":"Êtes-vous sûr de vouloir supprimer définitivement les fichiers de votre poubelle ? Cette action est irréversible.","Are you sure you want to remove this share?":"Êtes-vous sûr de vouloir supprimer ce partage ?",Cancel:"Annuler","Change quota for space %{name}":"Changer le quota de l'espace %{name}","Change subtitle for space":"Changer les sous-titres de l''espace","Choose how access is granted":"Choisissez qu'elle accès sont accordés","Clear selection":"Annuler la sélection","Close sidebar to hide details":"Fermer le panneau latéral pour cacher les détails",Confirm:"Confirmer","Context menu of the share":"Menu contextuel de partage",Copied:"Copié","Copied to clipboard!":"Copier dans le presse papier",Copy:{"Action in the files list row to initiate copying resources":"Copier","":"Copier"},"Copy direct link":"Copier le lien direct","Copy EOS path":"Copier l'emplacement d'EOS","Copy here":"Copier ici","Copy link to clipboard":"Copier le lien dans le presse papier","Copy private link to clipboard":"Copier le lien privé vers le presse papier","Copy quicklink":"Copier le lien de partage rapide",Create:"Créer","Create a new file":"Créer un nouveau fichier...","Create a new folder":"Créer un nouveau dossier...","Create a new space":"Créer un nouvel espace","Create link":"Créer un lien","Create new files or folders":"Créer de nouveaux fichiers ou dossiers","Create quick link":"Créer un lien de partage rapide","Creating share":"Créer un partage","Creating space failed…":"Erreur lors de la création de l'espace...","Ctrl + C":{"Keyboard shortcut for non-macOS systems for copying files":"Ctrl + C"},"Ctrl + V":{"Keyboard shortcut for non-macOS systems for pasting files":"Ctrl + V"},"Ctrl + X":{"Keyboard shortcut for non-macOS systems for cutting files":"Ctrl + X"},Cut:{"Action in the files list row to initiate cutting resources":"Couper"},Decline:"Décliner","Decline share":["Refuser le partage","Refuser les partages","Refuser les partages"],"Declined shares":"Partages refusés",Delete:"Supprimer","Delete file %{name}":"Supprimer le fichier %{name}","Delete folder %{name}":"Supprimer le dossier %{name}","Delete link":"Supprimer le lien","Delete selected resource?":[" Supprimer la ressource sélectionnée?"," Supprimer les %{amount} ressources sélectionnées?"," Supprimer les %{amount} ressources sélectionnées?"],"Delete space":"Supprimer l'espace",Deleted:"Supprimé","Deleted files":"Fichiers supprimés","Deselect %{name}":"désélectionner %{name}",Details:"Détails","Direct link":"Lien direct","Direct link copied":"Lien direct copié",Disable:"Désactiver",Disabled:"Désactivé","Display customization options of the files list":"Afficher les options de customisation de la liste de fichier",Download:"Télécharger","Download older version":"Télécharger une ancienne version","Drop files here to upload or click to select file":"Déposer des fichiers ici pour uploader ou cliquer pour sélectionner des fichiers","Edit description":"Modifier la description","Edit expiration date":"Modifier la date d'expiration","Edit image":"Modifier l'image","Edit name":"Modifier le nom","Edit password":"Modifier le mot de passe","Edit quota":"Modifier le quota","Edit subtitle":"Modifier les sous-titres","Empty trash bin":"Vider la corbeille",Enable:"Activer","Error while sharing.":"Erreur apparue lors du partage.","Everyone with the link":"Tous les utilisateurs disposant du lieu","Expires %{expires}":"Expire le %{expires}","Favorite files":"Fichiers favoris",Favorites:"Favoris",file:"fichier","File name":"Nom de fichier","File name cannot be empty":"Nom de fichier ne peut pas être vide",'File name cannot be equal to ".."':'Le nom du fichier ne peut pas être ".."','File name cannot be equal to "."':'Le nom du fichier ne peut pas être "."','File name cannot contain "/"':'Le nom du fichier ne peut pas contenir "/"',"File name cannot end with whitespace":"Le nom du fichier ne peut pas se terminer avec un espace",Files:"Fichiers","Files shared via link":"Fichier partagé avec un lien","Files shared with me":"Fichiers partagés avec moi","Files shared with others":"Fichiers partagés avec d'autres personnes",folder:"dossier",Folder:"Dossier","Folder name":"Nom de dossier","Folder name cannot be empty":"Nom de dossier ne peut pas être vide",'Folder name cannot be equal to ".."':'Le nom du dossier ne peut pas être ".."','Folder name cannot be equal to "."':'Le nom du dossier ne peut pas être "."','Folder name cannot contain "/"':'Le nom du dossier ne peut pas contenir "/"',"Folder name cannot end with whitespace":"Le nom du dossier ne peut pas se terminer avec un espace",Folders:"Dossiers",Group:"Groupe",Guest:" Invité","Guest user":"Utilisateur invité",Hide:"Masquer",Invite:"Inviter","Items per page":"Éléments par page","Keep both":"Garder les deux","Last activity":"Dernière activité","Last modified":"Dernière modification",Link:"Lien","Link name":"Nom du lien","Loading public link…":"Chargement du lien public...",Members:"Membres",Modified:"Modifié",msg:"msg",Name:"Nom","Navigate to '%{folder}'":'Aller à "%{folder}"',New:"Nouveau","New file":"Nouveau fichier","New folder":"Nouveau dossier","New space":"Nouvel espace","New Space":"Nouvel Espace","No information to display":"Aucune information à afficher","No items selected.":"Aucun élément séléctionné","No link":"Aucun lien","No resources found":"Aucune ressource trouvée","No search term entered":"Aucun terme de recherche n'a été saisi","No users found.":"Aucun utilisateur trouvé.","No users or groups found.":"Aucun utilisateur ou groupe n'a été trouvé","No Versions available for this file":"Aucune version n'existe pour ce fichier","Not enough quota":"Quota insuffisant","Open folder":{"Action in the files list row to open a folder":"Ouvrir le dossie"},"Open in %{app}":"Ouvrir avec %{app}","Open sidebar to view details":"Ouvrir le panneau latéral pour voir les détails","Overview of the information about the selected file":"Aperçu des informations sur le fichier sélectionné","Overview of the information about the selected files":"Aperçu des informations sur les fichiers sélectionnés",Owner:"Propriétaire",Password:"Mot de passe","Password can't be empty":"Le mot de passe ne peut pas être vide","Password cannot be empty":"Le mot de passe ne peut pas être vide","Paste here":"Coller ici","Permanently delete file %{name}":"Supprimer définitivement le fichier %{name}","Permanently delete folder %{name}":" Supprimer définitivement le dossier %{name}","Permanently delete selected resource?":["Supprimer définitivement la ressource sélectionnée ?"," Supprimer définitivement les %{amount} ressources sélectionnées?"," Supprimer définitivement les %{amount} ressources sélectionnées?"],"Person was added":"Une personne a été ajoutée",Personal:"Personnel","Please, accept this share first to display available actions":"S’il vous plaît, acceptez ce partage pour afficher les actions disponibles ","Private link":"Lien privé","Private link copied":"Lien privé copié","Public file upload":"Fichier public téléchargé","Public link":"Lien public","Quick link":"Lien rapide",Quota:"Quota","Reload public link":"Recharger le lien public","Remote user":"Utilisateur distant",Remove:"Retirer","Remove expiration date":"Supprimer date d'expiration","Remove from favorites":"Retirer des favoris","Remove password":"Supprimer mot de passe",Rename:"Renommer","Rename file %{name}":"Renommer fichier %{name}","Rename folder %{name}":"Renommer dossier %{name}","Resource not found":" Ressource introuvable ",Restore:"Restaurer","Restore older version":"Restaurer une ancienne version",Save:"Sauvegarder","See all versions":"Voir toutes les versions","Select a file or folder to view details.":"Séléctionnez un fichier ou un dossier pour voir les détails","Select all resources":"Sélectionner toutes les ressources","Select file":"Sélectionnez un fichier","Select folder":"Sélectionnez un dossier",Set:"Définir","Set expiration date":"Définir la date d'expiration","Set password":"Définir le mot de passe",Share:"Partager","Share via link":"Partager par lien","Share via public link":"Partager par lien public","Share with people":"Partager avec des personnes","Shared by":"Partagé par","Shared via link":"Partagé par lien","Shared with":"Partagé avec","Shared with me":"Partagé avec moi","Shared with others":"Partagé avec autres",Shares:"Partages","Show all":"Tout afficher","Show file extensions":"Afficher les extensions du fichier","Show hidden files":"Afficher les fichiers masqués","Show invited people":"Voir les personnes invitées","Show less":"Afficher moins","Show links":"Afficher les liens","Show members":"Afficher les membres","Show more":"Afficher plus",Size:"Taille",Skip:"Passer","Space has no deleted files":"L’espace n'a pas de fichier supprimé",Spaces:"Espaces",Status:"État",Subtitle:"Sous-titre","The file type is unsupported":"Type de fichier non supporté",'The name "%{name}" is already taken':'Le nom "%{name}" existe déjà',"The name cannot be empty":"Le nom ne peut pas être vide",'The name cannot be equal to ".."':'Le nom ne peut pas être ".."','The name cannot be equal to "."':'Le nom ne peut pas être "."','The name cannot contain "/"':'Le nom ne peut pas contenir "/"',"The name cannot end with whitespace":"Le nom ne peut pas finir avec un espace","The private link has been copied to your clipboard.":"Le lien privé a été copié dans le presse-papier.","There are no resources marked as favorite":"Il n'y a aucun élément marqué comme favoris","There are no resources with a public link at the moment":"Il n'y a pas d'élément avec un lien public pour le moment.","This file has been shared.":"Ce fichier a été partagé","This folder has been shared.":"Ce dossier est partagé.","This folder has no content.":"Ce dossier est vide.","This item is directly shared via links.":"Cet élément est diretement partagé par lien.","This item is directly shared with others.":"Cet élément est directement partagé avec d'autres.","This item is shared via links through one of the parent folders.":"Cet élément est partagé par lien au travers de l'un des dossiers parents","This item is shared with others through one of the parent folders.":"Cet élément est partagé avec d'autres par lien au travers de l'un des dossiers parents",Upload:"Envoyer","Upload files or folders":"Envoyer des fichiers ou des dossiers",User:"Utilisateur",Versions:"Versions",via:"via","We went looking everywhere, but were unable to find the selected resource.":"Nous avons cherché partout, mais nous n’avons pas pu trouver la ressource sélectionnée.","You are currently not collaborating on any of your resources with other people":"Vous ne collaborez actuellement sur aucun des éléments avec d'autres personnes.","You don't have permission to share this file.":"Vous n'avez pas la permission de partager ce fichier.","You don't have permission to share this folder.":"Vous n'avez pas la permission de partager ce dossier.","You have no deleted files":"Vous n'avez aucun fichier supprimé","You have no permission to create new files!":"Vous n'avez pas les droits pour créer de nouveaux fichiers !","You have no permission to upload!":"Vous n'avez pas la permission d'uploader !"},gl:{"(me)":"(eu)","%{name} already exists":"%{name} xa existe","%{owner} shared this folder with you for uploading":"%{owner} compartiu este cartafol con vostede para envialo",Accept:"Aceptar",Actions:"Accións","Add people":"Engadir xente","All deleted files were removed":"Retiráronse todos os ficheiros eliminados","All files":"Todos os ficheiros","An error occurred while loading the public link":"Produciuse un erro ao cargar a ligazón pública","Are you sure you want to delete all selected resources?":"Confirma que quere eliminar todos os recursos seleccionados?","Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.":" \nConfirma que quere eliminar todos os recursos seleccionados? Todo o seu contido eliminarase definitivamente. Esta acción non se pode desfacer.","Are you sure you want to delete this file?":"Confirma que quere eliminar este ficheiro?","Are you sure you want to delete this file? All it’s content will be permanently removed. This action cannot be undone.":"Confirma que quere eliminar este ficheiro? Todo o seu contido eliminarase definitivamente. Esta acción non se pode desfacer.","Are you sure you want to delete this folder?":"Confirma que quere eliminar este cartafol?","Are you sure you want to delete this folder? All it’s content will be permanently removed. This action cannot be undone.":"Confirma que quere eliminar este cartafol? Todo o seu contido eliminarase definitivamente. Esta acción non se pode desfacer.",Cancel:"Cancelar","Clear selection":"Limpar a selección",Confirm:"Confirmar",Copy:{"Action in the files list row to initiate copying resources":"Copiar","":"Copiar"},Create:"Crear","Create a new file":"Crear un novo ficheiro","Create a new folder":"Crear un novo cartafol",Decline:"Declinar",Delete:"Eliminar","Delete file %{name}":"Eliminar o ficheiro %{name}","Delete folder %{name}":"Eliminar o cartafol %{name}","Delete selected resource?":["Eliminar o recurso seleccionado?","Eliminar os %{amount} recursos seleccionados?"],"Deleted files":"Ficheiros eliminados",Download:"Descargar","Drop files here to upload or click to select file":"Solte os ficheiros aquí para envialos ou prema para seleccionar ficheiro","Empty trash bin":"Cesto do lixo baleiro","Error while sharing.":"Produciuse un erro durante a compartición.","Expires %{expires}":"Caduca %{expires}",Favorites:"Favoritos","File name":"Nome de ficheiro","File name cannot be empty":"O nome do ficheiro non pode estar baleiro",'File name cannot be equal to ".."':"O nome do ficheiro non pode ser igual a «..»",'File name cannot be equal to "."':"O nome do ficheiro non pode ser igual a «.»",'File name cannot contain "/"':"O nome do ficheiro non pode conter unha «/»","File name cannot end with whitespace":"O nome do ficheiro non pode rematar cun espazo en branco",Files:"Ficheiros","Folder name":"Nome do cartafol","Folder name cannot be empty":"O nome do cartafol non pode estar baleiro",'Folder name cannot be equal to ".."':"O nome do cartafol non pode ser igual a «..»",'Folder name cannot be equal to "."':"O nome do cartafol non pode ser igual a «.»",'Folder name cannot contain "/"':"O nome do cartafol non pode conter unha «/»","Folder name cannot end with whitespace":"O nome do cartafol non pode rematar cun espazo en branco",Folders:"Cartafoles",Group:"Grupo",Guest:"Convidado","Loading public link…":"Cargando a ligazón pública…",msg:"msx",Name:"Nome",New:"Novo","New file":"Novo ficheiro","New folder":"Novo cartafol","No Versions available for this file":"Non hai versións dispoñíbeis para este ficheiro","Open folder":{"Action in the files list row to open a folder":"Abrir cartafol"},Owner:"Propietario",Password:"Contrasinal","Paste here":"Pegar aquí","Permanently delete file %{name}":"Eliminar de xeito permanente o ficheiro %{name}","Permanently delete folder %{name}":"Eliminar de xeito permanente o cartafol %{name}","Permanently delete selected resource?":["Eliminar de xeito permanente o recurso seleccionado?","Eliminar de xeito permanente os %{amount} recursos seleccionados?"],"Person was added":"Engadiuse a persoa","Please, accept this share first to display available actions":"Acepte primeiro esta compartición para amosar as accións dispoñíbeis","Public link":"Ligazón pública","Reload public link":"Volvendo cargar a ligazón pública","Remote user":"Usuario remoto","Remove expiration date":"Retirar a data de caducidade","Remove password":"Retirar o contrasinal",Rename:"Renomear","Rename file %{name}":"Renomear o ficheiro %{name}","Rename folder %{name}":"Renomear o cartafol %{name}","Resource not found":"Non se atopou o recurso",Restore:"Restaurar",Save:"Gardar",Share:"Compartir","Shared with":"Compartido con","Shared with me":"Compartido comigo","Shared with others":"Compartido con outros",Size:"Tamaño",Status:"Estado",'The name "%{name}" is already taken':"O nome «%{name}» xa está ocupado","The name cannot be empty":"O nome non pode estar baleiro",'The name cannot be equal to ".."':"O nome non pode ser igual a «..»",'The name cannot be equal to "."':"O nome non pode ser igual a «.»",'The name cannot contain "/"':"O nome non pode conter unha «/»","The name cannot end with whitespace":"O nome non pode rematar cun espazo en branco","The private link has been copied to your clipboard.":"A ligazón privada foi copiada no portapapeis.",Upload:"Envío",User:"Usuario",Versions:"Versións","We went looking everywhere, but were unable to find the selected resource.":"Buscamos por todas partes, mais non puidemos atopar o recurso seleccionado.","You don't have permission to share this file.":"Non ten permiso para compartir este ficheiro.","You don't have permission to share this folder.":"Non ten permiso para compartir este cartafol.","You have no permission to upload!":"Non ten permiso para facer envíos!"},it:{'"%{file}" was deleted successfully':'"%{file}" è stato cancellato con successo','"%{fileName}" was created successfully':'"%{fileName}" è stato creato con successo','"%{folderName}" was created successfully':'La cartella "%{folderName}" è stata creata con successo',"(Opens in new window)":"(Apre in una nuova finestra)","Private link":"Link privato","Public link":"Link pubblico"}};e.vueGettext.translate.initTranslations(I,{language:"en",getTextPluginSilent:!1,getTextPluginMuteLanguages:[],silent:!1});var T=e.vueGettext.translate.gettext;e.vueGettext.translate.ngettext;var R=e.vueGettext.translate.gettextInterpolate;class L{static open="app.files.sidebar.open";static close="app.files.sidebar.close";static toggle="app.files.sidebar.toggle";static openWithPanel="app.files.sidebar.openWithPanel";static setActivePanel="app.files.sidebar.setActivePanel"}const D=t=>{const s=t?.bus||i.eventBus,a=e.ref(!1),r=e.ref(null),n=s.subscribe(L.toggle,(()=>{a.value=!e.unref(a)})),o=s.subscribe(L.close,(()=>{a.value=!1,r.value=null})),l=s.subscribe(L.open,(()=>{a.value=!0,r.value=null})),c=s.subscribe(L.openWithPanel,(e=>{a.value=!0,r.value=e})),d=s.subscribe(L.setActivePanel,(e=>{r.value=e}));return e.onBeforeUnmount((()=>{s.unsubscribe(L.toggle,n),s.unsubscribe(L.close,o),s.unsubscribe(L.open,l),s.unsubscribe(L.openWithPanel,c),s.unsubscribe(L.setActivePanel,d)})),{sideBarOpen:a,sideBarActivePanel:r}};var A=function(e){return void 0!==e.shareTypes?e.shareTypes:e.shares?Array.from(new Set(e.shares.map((function(e){return parseInt(e.type)})))):[]},P=function(e){return s.ShareTypes.containsAnyValue(s.ShareTypes.authenticated,A(e))},M=function(e){return s.ShareTypes.containsAnyValue(s.ShareTypes.unauthenticated,A(e))},O=function(e,t,i){return P(e)||function(e,t,i){return e.isReceivedShare()&&!i||s.ShareTypes.containsAnyValue(s.ShareTypes.authenticated,U(e.path,t))}(e,t,i)},N=function(e,t){return M(e)||function(e,t){return s.ShareTypes.containsAnyValue(s.ShareTypes.unauthenticated,U(e.path,t))}(e,t)},B=function(e){return P(e)?T("This item is directly shared with others."):T("This item is shared with others through one of the parent folders.")},z=function(e){return M(e)?T("This item is directly shared via links."):T("This item is shared via links through one of the parent folders.")},U=function(e,t){var i=$(e,!0);if(0===i.length)return[];var s={};return i.forEach((function(e){var i=t[e];i&&i.forEach((function(e){s[e.shareType]=!0}))})),Object.keys(s).map((function(e){return parseInt(e,10)}))},q=function(e,t){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[{id:"files-sharing-".concat(e.getDomSelector()),accessibleDescription:B(e),label:T("Show invited people"),visible:O(e,t,s),icon:"group",target:"sharing-item",type:P(e)?"user-direct":"user-indirect",handler:function(e,t){i.eventBus.publish(L.openWithPanel,"".concat(t,"#peopleShares"))}},{id:"file-link-".concat(e.getDomSelector()),accessibleDescription:z(e),label:T("Show links"),visible:N(e,t),icon:"link",target:"sharing-item",type:M(e)?"link-direct":"link-indirect",handler:function(e,t){i.eventBus.publish(L.openWithPanel,"".concat(t,"#linkShares"))}}];return a.filter((function(e){return e.visible}))};function j(t,i,s){return i.name=e.basename(s),i.path=s,i.webDavPath=e.join(t.webDavPath,s),i.extension=a.extractExtensionFromFile(i),i}function V(e,t){return"/"+`files/${e}/${t}`.split("/").filter(Boolean).join("/")}function G(e,t=""){return"/"+`trash-bin/${e}/${t}`.split("/").filter(Boolean).join("/")}function H(t,i=!1,s,r,n=[]){if(t.sort(((e,t)=>e.path.localeCompare(t.path))),n.length&&(t=function(e,t){const i=[];for(const s of e){let e;if("/"===s.path){const i=a.extractStorageId(s.item_source);e=t.find((e=>e.id===i&&"project"===e.driveType))}i.push({...s,matchingSpace:e})}return i}(t,n)),i)return t=W(t),e.orderBy(t,["file_target","permissions"],["asc","desc"]).map((e=>{const t=Q(e,i,s,r);return t.shareId=e.id,t}));return W(t).map((e=>Q(e,i,s,r)))}function W(e){const t=[];let i=null;for(const a of e)i?.storage_id!==a.storage_id||i?.file_source!==a.file_source?(s.ShareTypes.containsAnyValue(s.ShareTypes.authenticated,[parseInt(a.share_type)])?a.sharedWith=[{username:a.share_with,displayName:a.share_with_displayname,name:a.share_with_displayname,avatar:void 0,shareType:parseInt(a.share_type)}]:parseInt(a.share_type)===s.ShareTypes.link.value&&(a.sharedWith=[{name:a.name||a.token,link:!0,shareType:parseInt(a.share_type)}]),i=a,t.push(a)):s.ShareTypes.containsAnyValue(s.ShareTypes.authenticated,[parseInt(a.share_type)])?i.sharedWith.push({username:a.share_with,name:a.share_with_displayname,displayName:a.share_with_displayname,avatar:void 0,shareType:parseInt(a.share_type)}):parseInt(a.share_type)===s.ShareTypes.link.value&&i.sharedWith.push({name:a.name||a.token,link:!0,shareType:parseInt(a.share_type)});return t}function Q(t,i=!1,r=!0,n=!1){const o="folder"===t.item_type;let l={id:t.id,fileId:t.item_source,storageId:a.extractStorageId(t.item_source),parentFolderId:t.file_parent,type:t.item_type,mimeType:t.mimetype,isFolder:o,sdate:e.DateTime_1.fromSeconds(parseInt(t.stime)).toRFC2822(),indicators:[],path:void 0,webDavPath:void 0};return i?(l.resourceOwner={username:t.uid_file_owner,displayName:t.displayname_file_owner},l.owner=[{username:t.uid_owner,displayName:t.displayname_owner,avatar:void 0,shareType:s.ShareTypes.user.value}],l.sharedWith=t.sharedWith||[],l.status=parseInt(t.state),l.name=e.pathUtil.basename(t.file_target),n?(l.path="/",l.webDavPath=a.buildWebDavSpacesPath([a.SHARE_JAIL_ID,l.id].join("!"),"/")):(l.path=t.file_target,l.webDavPath=V(t.share_with,t.file_target)),l.canDownload=()=>parseInt(t.state)===s.ShareStatus.accepted,l.canShare=()=>s.SharePermissions.share.enabled(t.permissions),l.canRename=()=>parseInt(t.state)===s.ShareStatus.accepted,l.canBeDeleted=()=>s.SharePermissions.delete.enabled(t.permissions)):(l.sharedWith=t.sharedWith||[],l.shareOwner=t.uid_owner,l.shareOwnerDisplayname=t.displayname_owner,l.name=e.pathUtil.basename(t.path),l.path=t.path,l.webDavPath=n?a.buildWebDavSpacesPath(l.storageId,t.path):V(t.uid_owner,t.path),l.canDownload=()=>!0,l.canShare=()=>!0,l.canRename=()=>!0,l.canBeDeleted=()=>!0),l.extension=a.extractExtensionFromFile(l),l.isReceivedShare=()=>i,l.canUpload=()=>s.SharePermissions.create.enabled(t.permissions),l.isMounted=()=>!1,l.share=J(t,l,r),l.canDeny=()=>s.SharePermissions.denied.enabled(t.permissions),l.getDomSelector=()=>a.extractDomSelector(t.id),t.matchingSpace&&(l={...l,...t.matchingSpace}),l}function J(t,i,a){return parseInt(t.share_type)===s.ShareTypes.link.value?function(t){let i="";const a=parseInt(t.permissions),r=s.LinkShareRoles.getByBitmask(a,"folder"===t.item_type);r&&(i=r.label);const n="string"==typeof t.attributes&&"true"===JSON.parse(t.attributes||"[]").find((e=>"isQuickLink"===e.key))?.enabled,o="true"===t.quicklink,l=n||o;return{shareType:parseInt(t.share_type),id:t.id,token:t.token,url:t.url,path:t.path,permissions:a,description:i,quicklink:l,stime:t.stime,name:"string"==typeof t.name?t.name:t.token,password:!(!t.share_with||!t.share_with_displayname),expiration:"string"==typeof t.expiration?e.DateTime_1.fromFormat(t.expiration,"yyyy-MM-dd HH:mm:ss").toFormat("yyyy-MM-dd"):null,itemSource:t.item_source,file:{parent:t.file_parent,source:t.file_source,target:t.file_target}}}(t):parseInt(t.share_type)===s.ShareTypes.space.value?function(e,t){let i,a;switch(e.role){case s.spaceRoleManager.name:i=s.spaceRoleManager.bitmask(!0),a=s.spaceRoleManager;break;case s.spaceRoleEditor.name:i=s.spaceRoleEditor.bitmask(!0),a=s.spaceRoleEditor;break;case s.spaceRoleViewer.name:i=s.spaceRoleViewer.bitmask(!0),a=s.spaceRoleViewer}return{shareType:s.ShareTypes.space.value,id:t,collaborator:{name:e.onPremisesSamAccountName,displayName:e.displayName,additionalInfo:null},permissions:i,role:a}}(t,i):K(t,i,a)}function Y(e){return"string"!=typeof e?null:e}function K(e,t,i){const a={shareType:parseInt(e.share_type),id:e.id,itemSource:e.item_source,file:{parent:e.file_parent,source:e.file_source,target:e.file_target}};return s.ShareTypes.containsAnyValue([s.ShareTypes.user,s.ShareTypes.remote,s.ShareTypes.group,s.ShareTypes.guest],[a.shareType])&&(a.collaborator={name:e.share_with,displayName:e.share_with_displayname,additionalInfo:Y(e.share_with_additional_info)},a.owner={name:e.uid_owner,displayName:e.displayname_owner,additionalInfo:Y(e.additional_info_owner)},a.fileOwner={name:e.uid_file_owner,displayName:e.displayname_file_owner,additionalInfo:Y(e.additional_info_file_owner)},a.stime=e.stime,a.permissions=parseInt(e.permissions),a.customPermissions=s.SharePermissions.bitmaskToPermissions(e.permissions),a.role=s.PeopleShareRoles.getByBitmask(parseInt(e.permissions),t.isFolder||"folder"===t.type,i)),("string"==typeof e.expiration||e.expiration instanceof String)&&(a.expires=new Date(e.expiration)),a.path=e.path,a}function Z(t){const i="dir"===t.type||"folder"===t.type,r=t.fileInfo[s.DavProperty.TrashbinOriginalFilename],n=a.extractExtensionFromFile({name:r,type:t.type}),o=e.pathUtil.basename(t.name);return{type:i?"folder":t.type,isFolder:i,ddate:t.fileInfo[s.DavProperty.TrashbinDeletedDate],name:e.pathUtil.basename(r),extension:n,path:s.urlJoin(t.fileInfo[s.DavProperty.TrashbinOriginalLocation],{leadingSlash:!0}),id:o,parentFolderId:t.fileInfo[s.DavProperty.FileParent],indicators:[],webDavPath:"",canUpload:()=>!1,canDownload:()=>!1,canBeDeleted:()=>!0,canBeRestored:function(){return!0},canRename:()=>!1,canShare:()=>!1,canCreate:()=>!1,isMounted:()=>!1,isReceivedShare:()=>!1,getDomSelector:()=>a.extractDomSelector(o)}}class X{isEnabled(){return!0}isActive(e){return!o.isLocationSpacesActive(e,"files-spaces-projects")&&(o.isLocationSpacesActive(e,"files-spaces-generic")||o.isLocationPublicActive(e,"files-public-link"))}getTask(i){const{store:s,router:a,clientService:{owncloudSdk:r,webdav:n}}=i,{replaceInvalidFileRoute:o}=t.useFileRouteReplace({router:a}),c=t.useCapabilityShareJailEnabled(s),d=t.useCapabilityFilesSharingResharing(s),u=t.useCapabilitySpacesEnabled(s);return e.C((function*(t,i,p,h=null,m=null,f={}){try{s.commit("Files/CLEAR_CURRENT_FILES_LIST");let{resource:t,children:i}=yield n.listFiles(p,{path:h,fileId:m});if(o({space:p,resource:t,path:h,fileId:m}),"/"===h)if("share"===p.driveType){const i=yield r.shares.getShare(p.shareId);t=H([i.shareInfo],!0,e.unref(d),!0)[0]}else["personal","public"].includes(p.driveType)||(t=p);if(f.loadShares){yield s.dispatch("Files/loadSharesTree",{client:r,path:t.path,...e.unref(u)&&{storageId:t.fileId},includeRoot:"/"===t.path&&"personal"!==p.driveType});for(const t of i)t.indicators=q(t,s.state.Files.sharesTree,e.unref(c))}s.commit("Files/LOAD_FILES",{currentFolder:t,files:i})}catch(e){if(s.commit("Files/SET_CURRENT_FOLDER",null),console.error(e),401===e.statusCode)return l.authService.handleAuthError(a.currentRoute)}})).restartable()}}class ee{isEnabled(){return!0}isActive(e){return o.isLocationCommonActive(e,"files-common-favorites")}getTask(t){const{store:i,clientService:{owncloudSdk:r}}=t;return e.C((function*(e,t){i.commit("Files/CLEAR_CURRENT_FILES_LIST");let n=yield r.files.getFavoriteFiles(s.DavProperties.Default);n=n.map((e=>{const t=a.buildResource(e);return t.storageId||(t.storageId=i.getters.user.id),t})),i.commit("Files/LOAD_FILES",{currentFolder:null,files:n}),i.dispatch("Files/loadIndicators",{client:r,currentFolder:"/"})}))}}class te{isEnabled(e){return!0}isActive(e){return o.isLocationSharesActive(e,"files-shares-via-link")}getTask(i){const{store:a,clientService:{owncloudSdk:r}}=i,n=t.useCapabilityFilesSharingResharing(a),o=t.useCapabilityShareJailEnabled(a);return e.C((function*(t,i){a.commit("Files/CLEAR_CURRENT_FILES_LIST");let l=yield r.shares.getShares("",{share_types:s.ShareTypes.link.value.toString(),include_tags:!1});l=l.map((e=>e.shareInfo));const c=a.getters["runtime/spaces/spaces"];l.length&&(l=H(l,!1,e.unref(n),e.unref(o),c).map((e=>(e.storageId||(e.storageId=a.getters.user.id),e)))),a.commit("Files/LOAD_FILES",{currentFolder:null,files:l})}))}}class ie{isEnabled(e){return!0}isActive(e){return o.isLocationSharesActive(e,"files-shares-with-me")}getTask(i){const{store:s,clientService:a}=i,r=t.useCapabilityFilesSharingResharing(s),n=t.useCapabilityShareJailEnabled(s);return e.C((function*(t,i){s.commit("Files/CLEAR_CURRENT_FILES_LIST");let o=yield a.owncloudSdk.shares.getShares("",{state:"all",include_tags:!1,shared_with_me:!0});o=o.map((e=>e.shareInfo)),o.length&&(o=H(o,!0,e.unref(r),e.unref(n)).map((e=>(e.storageId||(e.storageId=s.getters.user.id),e)))),s.commit("Files/LOAD_FILES",{currentFolder:null,files:o})}))}}class se{isEnabled(e){return!0}isActive(e){return o.isLocationSharesActive(e,"files-shares-with-others")}getTask(i){const{store:a,clientService:{owncloudSdk:r}}=i,n=t.useCapabilityFilesSharingResharing(a),o=t.useCapabilityShareJailEnabled(a);return e.C((function*(t,i){a.commit("Files/CLEAR_CURRENT_FILES_LIST");const l=s.ShareTypes.authenticated.filter((e=>e.value!==s.ShareTypes.space.value)).map((e=>e.value)).join(",");let c=yield r.shares.getShares("",{share_types:l,reshares:!0,include_tags:!1});c=c.map((e=>e.shareInfo)),c.length&&(c=H(c,!1,e.unref(n),e.unref(o)).map((e=>(e.storageId||(e.storageId=a.getters.user.id),e)))),a.commit("Files/LOAD_FILES",{currentFolder:null,files:c})}))}}class ae{isEnabled(e){return!0}isActive(e){return o.isLocationTrashActive(e,"files-trash-generic")}getTask(i){const{store:r,clientService:{owncloudSdk:n}}=i,o=t.useCapabilityShareJailEnabled(r);return e.C((function*(t,i,l){r.commit("Files/CLEAR_CURRENT_FILES_LIST");const c=e.unref(o)?a.buildWebDavSpacesTrashPath(l.id):G(l.id),d=yield n.fileTrash.list(c,"1",s.DavProperties.Trashbin);r.commit("Files/LOAD_FILES",{currentFolder:a.buildResource(d[0]),files:d.slice(1).map(Z)})}))}}const re=new class{loaders;constructor(){this.loaders=[new X,new ee,new te,new ie,new se,new ae]}getTask(){const s=i.useStore(),a=t.useRouter(),r=n.useClientService(),o=this.loaders.find((t=>t.isEnabled(e.unref(s))&&t.isActive(e.unref(a))));if(o)return e.C((function*(...e){const t={clientService:r,store:s,router:a};try{yield o.getTask(t).perform(...e)}catch(e){console.error(e)}}));console.error("No folder loader found for route")}};class ne{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}var oe;function le(t){const i=function(t){if(t.sortBy)return e.isRef(t.sortBy)?t.sortBy:e.ref(t.sortBy);return r.useRouteQueryPersisted({name:e.unref(t.sortByQueryName)||ne.sortByQueryName,defaultValue:e.unref(ce(e.unref(t.fields))?.name),routeName:e.unref(t.routeName)||e.unref(r.useRouteName())})}(t),s=function(t){if(t.sortDir)return e.isRef(t.sortDir)?t.sortDir:e.ref(t.sortDir);return r.useRouteQueryPersisted({name:e.unref(t.sortDirQueryName)||ne.sortDirQueryName,defaultValue:e.unref(ce(e.unref(t.fields))?.sortDir),routeName:e.unref(t.routeName)||e.unref(r.useRouteName())})}(t),a=e.computed((()=>he(e.unref(i))||e.unref(ce(e.unref(o))?.name))),n=e.computed((()=>me(e.unref(s))||de(e.unref(a),e.unref(o)))),o=t.fields;return{items:e.computed((()=>{const i=e.unref(t.items);return e.unref(a)?ue(i,e.unref(o),e.unref(a),e.unref(n)):i})),sortBy:a,sortDir:n,handleSort:({sortBy:e,sortDir:t})=>{i.value=e,s.value=t}}}!function(e){e.Desc="desc",e.Asc="asc"}(oe||(oe={}));const ce=e=>{const t=e.filter((e=>e.sortable));return t?t[0]:null},de=(t,i)=>{const s=i.find((e=>e.name===t));return s&&s.sortDir?e.unref(s.sortDir):oe.Desc},ue=(e,t,i,s)=>{const a=t.find((e=>e.name===i));if(!a)return e;const{sortable:r}=a,n=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if("name"===i){const t=[...e.filter((e=>"folder"===e.type))].sort(((e,t)=>pe(e,t,n,i,s,r))),a=[...e.filter((e=>"folder"!==e.type))].sort(((e,t)=>pe(e,t,n,i,s,r)));return s===oe.Asc?t.concat(a):a.concat(t)}return[...e].sort(((e,t)=>pe(e,t,n,i,s,r)))},pe=(e,t,i,s,a,r)=>{let n=e[s],o=t[s];const l=a===oe.Asc?1:-1;if(r)if("string"==typeof r){const e=e=>e.map((e=>e[r])).join("");n=e(n),o=e(o)}else"function"==typeof r&&(n=r(n),o=r(o));if(!isNaN(n)&&!isNaN(o))return(n-o)*l;return i.compare((n||"").toString(),(o||"").toString())*l},he=e=>Array.isArray(e)?e[0]:e,me=e=>{switch(he(e)){case oe.Asc:return oe.Asc;case oe.Desc:return oe.Desc}return null},fe=t=>e.DateTime_1.fromRFC2822(t).toUTC().valueOf(),ge=e=>e?[{name:"name",sortable:!0,sortDir:oe.Asc},{name:"size",sortable:!0,sortDir:oe.Desc},{name:"sharedWith",sortable:e=>e.length>0&&e[0].displayName,sortDir:oe.Asc},{name:"owner",sortable:"displayName",sortDir:oe.Asc},{name:"mdate",sortable:e=>fe(e),sortDir:oe.Desc},{name:"sdate",sortable:e=>fe(e),sortDir:oe.Desc},{name:"ddate",sortable:e=>fe(e),sortDir:oe.Desc}].filter((t=>Object.prototype.hasOwnProperty.call(e,t.name))):[],ve=t=>{const s=t.store||i.useStore(),r=e.computed({get:()=>s.getters["Files/selectedFiles"],set(e){s.commit("Files/SET_FILE_SELECTION",e)}}),n=e.computed({get:()=>s.state.Files.selectedIds,set(e){s.commit("Files/SET_SELECTED_IDS",e)}}),o=e.computed((()=>{if(1!==e.unref(r).length)return null;const t=e.unref(r)[0],n=t.storageId,o=s.getters["runtime/spaces/spaces"].find((e=>e.id===n));return o||a.buildShareSpaceResource({shareId:t.shareId,shareName:t.name,serverUrl:i.configurationManager.serverUrl})}));return{selectedResources:r,selectedResourcesIds:n,isResourceInSelection:t=>e.unref(n).includes(t.id),selectedResourceSpace:o}},be=(s={})=>{const a=s.loadResourcesTask||re.getTask(),n=e.computed((()=>a.isRunning||!a.last)),o=i.useStore(),{refresh:l,y:c}=(()=>{const t=e.ref(0),i=async()=>{await e.nextTick();const i=document.querySelector("#files-app-bar"),s=i?i.getBoundingClientRect().height:0;t.value!==s&&(t.value=s)};return window.onresize=i,e.onMounted(i),{y:t,refresh:i}})(),d=e.computed((()=>o.getters["Files/activeFiles"]||[])),u=e.computed((()=>ge(e.unref(d)[0]))),{sortBy:p,sortDir:h,items:m,handleSort:f}=le({items:d,fields:u}),g=t.useRouteQuery("page","1"),v=e.computed((()=>parseInt(String(g.value)))),{items:b,total:S}=k({page:v,items:m});return r.useMutationSubscription(["Files/UPSERT_RESOURCE"],(async({payload:t})=>{await e.nextTick(),((e,t=3500)=>{const i=document.querySelectorAll(`[data-item-id='${e}']`)[0];i&&(i.classList.add("oc-table-accentuated"),setTimeout((()=>{i.classList.remove("oc-table-accentuated")}),t))})(t.id)})),{fileListHeaderY:c,refreshFileListHeaderPosition:l,loadResourcesTask:a,areResourcesLoading:n,storeItems:d,fields:u,paginatedResources:b,paginationPages:S,paginationPage:v,handleSort:f,sortBy:p,sortDir:h,...ve({store:o}),...D()}},Se=(i,...s)=>{const a=e.ref(!1),r=t.useRouter(),n=t.useRoute();return e.watch(n,(()=>{a.value=i(r,...s)}),{immediate:!0}),a},_e=(e,t)=>!(!e||!t)&&e.id===t.id;class ye{createModal;hideModal;showMessage;$gettext;$ngettext;$gettextInterpolate;constructor(e,t,i,s,a,r){this.createModal=e,this.hideModal=t,this.showMessage=i,this.$gettext=s,this.$ngettext=a,this.$gettextInterpolate=r}async resolveAllConflicts(t,i,s,a){const r=[];for(const i of t){const t=e.join(s.path,i.name);a.some((e=>e.path===t))&&r.push({resource:i,strategy:null})}let n=0,o=!1,l=null;const c=[];for(const e of r){if(o){e.strategy=l,c.push(e);continue}const t=r.length-n,i=await this.resolveFileExists(e.resource,t,1===t);e.strategy=i.strategy,c.push(e),n+=1,i.doForAllConflicts&&(o=!0,l=i.strategy)}return c}async resolveFileExists(e,t,i,s=!1){return new Promise((a=>{let r=!1;const n={variation:"danger",icon:"alarm-warning",title:this.$gettext("File already exists"),message:this.$gettextInterpolate(e.isFolder?this.$gettext("Folder with name %{name} already exists."):this.$gettext("File with name %{name} already exists."),{name:e.name},!0),cancelText:this.$gettext("Skip"),confirmText:this.$gettext("Keep both"),buttonSecondaryText:s?this.$gettext("Merge"):this.$gettext("Replace"),checkboxLabel:i?"":this.$gettextInterpolate(this.$gettext("Apply to all %{count} conflicts"),{count:t},!0),onCheckboxValueChanged:e=>{r=e},onCancel:()=>{this.hideModal(),a({strategy:Ce.SKIP,doForAllConflicts:r})},onConfirmSecondary:()=>{this.hideModal();const e=s?Ce.MERGE:Ce.REPLACE;a({strategy:e,doForAllConflicts:r})},onConfirm:()=>{this.hideModal(),a({strategy:Ce.KEEP_BOTH,doForAllConflicts:r})}};this.createModal(n)}))}resolveDoCopyInsteadOfMoveForSpaces(){return new Promise((e=>{const t={variation:"danger",icon:"alarm-warning",title:this.$gettext("Copy here?"),customContent:"
Moving files from one space to another is not possible. Do you want to copy instead?
Note: Links and shares of the original file are not copied.
",cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Copy here"),onCancel:()=>{this.hideModal(),e(!1)},onConfirm:()=>{this.hideModal(),e(!0)}};this.createModal(t)}))}}const we=(e,t,i,s=1)=>{let r;if(0===t.length)r=`${e} (${s})`;else{const i=a.extractNameWithoutExtension({name:e,extension:t});r=`${i} (${s}).${t}`}return i.some((e=>e.name===r))?we(e,t,i,s+1):r},xe=(t,i,s,a)=>t.id===s.id&&e.dirname(i.path)===a.path;var Ce,ke;!function(e){e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE"}(Ce||(Ce={}));class Fe extends ye{sourceSpace;resourcesToMove;targetSpace;targetFolder;clientService;constructor(e,t,i,s,a,r,n,o,l,c,d){super(r,n,o,l,c,d),this.sourceSpace=e,this.resourcesToMove=t,this.targetSpace=i,this.targetFolder=s,this.clientService=a}hasRecursion(){return this.sourceSpace.id===this.targetSpace.id&&this.resourcesToMove.some((e=>this.targetFolder.path===e.path))}showRecursionErrorMessage(){const e=this.resourcesToMove.length,t=this.$ngettext("You can't paste the selected file at this location because you can't paste an item into itself.","You can't paste the selected files at this location because you can't paste an item into itself.",e);this.showMessage({title:t,status:"danger"})}showResultMessage(e,t,i){if(0===e.length){const e=t.length;if(0===e)return;const s=i===ke.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",e):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",e),a=this.$gettextInterpolate(s,{count:e},!0);return void this.showMessage({title:a,status:"success"})}let s=this.$gettextInterpolate(i===ke.COPY?this.$gettext("Failed to copy %{count} resources"):this.$gettext("Failed to move %{count} resources"),{count:e.length},!0);1===e.length&&(s=this.$gettextInterpolate(i===ke.COPY?this.$gettext('Failed to copy "%{name}"'):this.$gettext('Failed to move "%{name}"'),{name:e[0]?.resourceName},!0)),this.showMessage({title:s,status:"danger"})}async perform(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===ke.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=ke.COPY}const i=[],s=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,a=await this.resolveAllConflicts(this.resourcesToMove,this.targetSpace,this.targetFolder,s),r=[];for(let n of this.resourcesToMove){n={...n};const o=a.some((e=>e.resource.id===n.id));let l=n.name,c=!1;if(o){const e=a.find((e=>e.resource.id===n.id))?.strategy;if(e===Ce.SKIP)continue;e===Ce.REPLACE&&(c=!0),e===Ce.KEEP_BOTH&&(l=we(n.name,n.extension,[...r,...s]),n.name=l)}try{if(xe(this.sourceSpace,n,this.targetSpace,this.targetFolder)&&c)continue;t===ke.COPY?(await this.clientService.webdav.copyFiles(this.sourceSpace,n,this.targetSpace,{path:e.join(this.targetFolder.path,l)},{overwrite:c}),n.id=void 0,n.fileId=void 0):t===ke.MOVE&&await this.clientService.webdav.moveFiles(this.sourceSpace,n,this.targetSpace,{path:e.join(this.targetFolder.path,l)},{overwrite:c}),n.path=e.join(this.targetFolder.path,n.name),n.webDavPath=e.join(this.targetFolder.webDavPath,n.name),r.push(n)}catch(e){console.error(e),e.resourceName=n.name,i.push(e)}}return this.showResultMessage(i,r,t),r}}class Ee extends ye{filesToUpload;currentFiles;inputFilesToUppyFiles;$uppyService;space;currentFolder;currentFolderId;spaces;hasSpaces;createDirectoryTree;constructor(e,t,i,s,a,r,n,o,l,c,d,u,p,h,m,f){super(d,u,p,h,m,f),this.filesToUpload=e,this.currentFiles=t,this.inputFilesToUppyFiles=i,this.$uppyService=s,this.space=a,this.currentFolder=r,this.currentFolderId=n,this.spaces=o,this.hasSpaces=l,this.createDirectoryTree=c}async perform(){const e=[],t=this.inputFilesToUppyFiles(this.filesToUpload);if(this.checkQuotaExceeded(t))return this.$uppyService.clearInputs();for(const i of t){const t=i.meta.relativePath;if(t){const i=t.replace(/^\/+/,"").split("/")[0];if(this.currentFiles.find((e=>e.name===i))){if(e.some((e=>e.name===i)))continue;e.push({name:i,type:"folder"});continue}}this.currentFiles.find((e=>e.name===i.name&&!i.meta.relativeFolder))&&e.push({name:i.name,type:"file"})}e.length?await this.displayOverwriteDialog(t,e):this.handleUppyFileUpload(this.space,this.currentFolder,t)}async handleUppyFileUpload(e,t,i){this.$uppyService.publish("uploadStarted");const s=await this.createDirectoryTree(e,t,i,this.currentFolderId);let a=i;s.failed.length&&(a=i.filter((e=>!s.failed.some((t=>e.meta.relativeFolder.startsWith(t)))))),a.length?(this.$uppyService.publish("addedForUpload",a),this.$uppyService.uploadFiles(a)):this.$uppyService.publish("uploadCompleted",{successful:[]})}async displayOverwriteDialog(e,t){let i=0;const s=t.length,r=[],n=[];let o,l,c=!1,d=!1;for(const e of t){const t="folder"===e.type,a=t?n:r;if(c&&!t){a.push({name:e.name,strategy:o});continue}if(d&&t){a.push({name:e.name,strategy:l});continue}const u=s-i,p=await this.resolveFileExists({name:e.name,isFolder:t},u,1===u,t);i++,p.doForAllConflicts&&(t?(d=!0,l=p.strategy):(c=!0,o=p.strategy)),a.push({name:e.name,strategy:p.strategy})}const u=r.filter((e=>e.strategy===Ce.SKIP)).map((e=>e.name)),p=n.filter((e=>e.strategy===Ce.SKIP)).map((e=>e.name));e=(e=e.filter((e=>!u.includes(e.name)))).filter((e=>!p.some((t=>e.meta.relativeFolder.split("/")[1]===t))));const h=r.filter((e=>e.strategy===Ce.KEEP_BOTH)).map((e=>e.name)),m=n.filter((e=>e.strategy===Ce.KEEP_BOTH)).map((e=>e.name));for(const t of h){const i=e.find((e=>e.name===t&&!e.meta.relativeFolder)),s=a.extractExtensionFromFile({name:t});i.name=we(t,s,this.currentFiles)}for(const t of m){const i=e.filter((e=>e.meta.relativeFolder.split("/")[1]===t));for(const e of i){const i=we(t,"",this.currentFiles);e.meta.relativeFolder=e.meta.relativeFolder.replace(new RegExp(`/${t}`),`/${i}`),e.meta.relativePath=e.meta.relativePath.replace(new RegExp(`/${t}/`),`/${i}/`),e.meta.tusEndpoint=e.meta.tusEndpoint.replace(new RegExp(`/${t}`),`/${i}`)}}if(0===e.length)return this.$uppyService.clearInputs();this.handleUppyFileUpload(this.space,this.currentFolder,e)}checkQuotaExceeded(t){if(!this.hasSpaces)return!1;let i=!1;return t.reduce(((e,t)=>{let i;if(t.meta.routeName===o.locationPublicLink.name)return e;if(t.meta.routeName===o.locationSpacesGeneric.name&&(i=this.spaces.find((e=>e.id===t.meta.spaceId))),!i||a.isShareSpaceResource(i))return e;const s=this.currentFiles.find((e=>!t.meta.relativeFolder&&e.name===t.name)),r=s?Number(s.size):0,n=e.find((e=>e.space.id===i.id));return n?(n.uploadSize=t.data.size-r,e):(e.push({space:i,uploadSize:t.data.size-r}),e)}),[]).forEach((({space:t,uploadSize:s})=>{if(t.spaceQuota.remaining&&t.spaceQuota.remainingthis.$gettext("Rename"),handler:this.$_rename_trigger,isEnabled:({resources:e})=>{if(o.isLocationTrashActive(this.$router,"files-trash-generic"))return!1;if(o.isLocationSharesActive(this.$router,"files-shares-with-me")&&!1===this.capabilities?.files_sharing?.can_rename)return!1;if(1!==e.length)return!1;if(e.some((e=>e.shareId&&"/"===e.path)))return!1;return!e.some((e=>!e.canRename()))},componentType:"button",class:"oc-files-actions-rename-trigger"}]}},methods:{...e.mapActions(["createModal","hideModal","setModalInputErrorMessage","showMessage","toggleModalConfirmButton"]),...e.mapMutations("Files",["UPSERT_RESOURCE","SET_CURRENT_FOLDER"]),async $_rename_trigger({resources:t},i){let s;if(_e(t[0],this.currentFolder)){const t=e.dirname(this.currentFolder.path);s=(await this.$clientService.webdav.listFiles(i||this.space,{path:t})).children}const r=a.extractNameWithoutExtension(t[0]),n=t[0].isFolder||this.areFileExtensionsShown?t[0].name:r,o=this.$gettextInterpolate(t[0].isFolder?this.$gettext("Rename folder %{name}"):this.$gettext("Rename file %{name}"),{name:n}),l=t[0].isFolder||this.areFileExtensionsShown?t[0].name:r,c=t[0].isFolder||!this.areFileExtensionsShown?null:[0,r.length],d={variation:"passive",title:o,cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Rename"),hasInput:!0,inputValue:l,inputSelectionRange:c,inputLabel:t[0].isFolder?this.$gettext("Folder name"):this.$gettext("File name"),onCancel:this.hideModal,onConfirm:e=>{this.areFileExtensionsShown||(e=`${e}.${t[0].extension}`),this.$_rename_renameResource(t[0],e,i)},onInput:e=>{this.areFileExtensionsShown||(e=`${e}.${t[0].extension}`),this.$_rename_checkNewName(t[0],e,s)}};this.createModal(d)},$_rename_checkNewName(e,t,i){const s=e.path.substring(0,e.path.length-e.name.length)+t;if(!t)return this.setModalInputErrorMessage(this.$gettext("The name cannot be empty"));if(/[/]/.test(t))return this.setModalInputErrorMessage(this.$gettext('The name cannot contain "/"'));if("."===t)return this.setModalInputErrorMessage(this.$gettext('The name cannot be equal to "."'));if(".."===t)return this.setModalInputErrorMessage(this.$gettext('The name cannot be equal to ".."'));if(/\s+$/.test(t))return this.setModalInputErrorMessage(this.$gettext("The name cannot end with whitespace"));if(this.files.find((i=>i.path===s&&e.name!==t))){const e=this.$gettext('The name "%{name}" is already taken');return this.setModalInputErrorMessage(this.$gettextInterpolate(e,{name:t},!0))}if(i){if(i.find((i=>i.path===s&&e.name!==t))){const e=this.$gettext('The name "%{name}" is already taken');return this.setModalInputErrorMessage(this.$gettextInterpolate(e,{name:t},!0))}}this.setModalInputErrorMessage(null)},async $_rename_renameResource(i,s,r){this.toggleModalConfirmButton();try{r=r||this.space;const n=e.join(e.dirname(i.path),s);await this.$clientService.webdav.moveFiles(r,i,r,{path:n}),this.hideModal();const o=_e(i,this.currentFolder);if(a.isShareSpaceResource(r)&&i.isReceivedShare()){if(r.rename(s),o){const e={...this.currentFolder};return e.name=s,this.SET_CURRENT_FOLDER(e),this.$router.push(t.createFileRouteOptions(r,{path:"",fileId:i.fileId}))}const e={...i};return e.name=s,void this.UPSERT_RESOURCE(e)}if(o){const e={...this.currentFolder};return j(r,e,n),this.SET_CURRENT_FOLDER(e),this.$router.push(t.createFileRouteOptions(this.space,{path:n,fileId:i.fileId}))}const l={...i};j(r,l,n),this.UPSERT_RESOURCE(l)}catch(e){console.error(e),this.toggleModalConfirmButton();let t=this.$gettext('Failed to rename "%{file}" to "%{newName}"');423===e.statusCode&&(t=this.$gettext('Failed to rename "%{file}" to "%{newName}" - the file is locked'));const a=this.$gettextInterpolate(t,{file:i.name,newName:s},!0);this.showMessage({title:a,status:"danger"})}}}};class Ie{static Cut="cut";static Copy="copy"}const Te=e.defineComponent({mixins:[$e],model:{prop:"selectedIds",event:"select"},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>a.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},disabled:{type:[String,Array],required:!1,default:null},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>void 0===e||[oe.Asc.toString(),oe.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null}},setup:()=>({hasShareJail:t.useCapabilityShareJailEnabled(),hasProjectSpaces:t.useCapabilityProjectSpacesEnabled()}),data:()=>({constants:{EVENT_TROW_MOUNTED:"rowMounted"}}),computed:{...e.mapGetters(["configuration"]),...e.mapState("Files",["areFileExtensionsShown","latestSelectedId","clipboardResources","clipboardAction"]),...e.mapState("runtime/spaces",["spaces"]),popperOptions:()=>({modifiers:[e.maxSize,{name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:e}){const{height:t}=e.modifiersData.maxSize;e.styles.popper.overflowY="auto",e.styles.popper.maxHeight=t-5+"px"}}]}),fields(){if(0===this.resources.length)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const i=ge(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"indicators",title:this.$gettext("Shares"),type:"slot",alignH:"right",wrap:"nowrap"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap"},{name:"status",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap"},{name:"owner",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",accessibleLabelCallback:e=>this.formatDateRelative(e.mdate)+" ("+this.formatDate(e.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",accessibleLabelCallback:e=>this.formatDateRelative(e.sdate)+" ("+this.formatDate(e.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",accessibleLabelCallback:e=>this.formatDateRelative(e.ddate)+" ("+this.formatDate(e.ddate)+")"}].filter((t=>{const i=Object.prototype.hasOwnProperty.call(e,t.name);return this.fieldsDisplayed?i&&this.fieldsDisplayed.includes(t.name):i})).map((e=>{const t=i.find((t=>t.name===e.name));return t&&Object.assign(e,{sortable:t.sortable,sortDir:t.sortDir}),e}))),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap"}),t},lazyLoading(){return this.configuration?.options?.displayResourcesLazy},areAllResourcesSelected(){return this.selectedIds.length===this.resources.length},selectedResources(){return this.resources.filter((e=>this.selectedIds.includes(e.id)))},allResourcesCheckboxLabel(){return this.$gettext("Select all resources")},contextMenuLabel(){return this.$gettext("Show context menu")},hoverableQuickActions(){return this.configuration?.options?.hoverableQuickActions}},methods:{...e.mapActions("Files",["toggleFileSelection"]),isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction===Ie.Cut&&this.clipboardResources.some((t=>t.id===e.id))},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return this.$_rename_items.filter((t=>t.isEnabled({resources:[e]}))).length},openRenameDialog(e){this.$_rename_trigger({resources:[e]},this.getMatchingSpace(e))},openSharingSidebar(e){let t;t="space"===e.type?"space-share-item":e.share?.shareType===s.ShareTypes.link.value?"sharing-item#linkShares":"sharing-item#peopleShares",i.eventBus.publish(L.openWithPanel,t)},folderLink(e){return this.createFolderLink({path:e.path,fileId:e.fileId,resource:e})},parentFolderLink(t){return t.shareId&&"/"===t.path?o.createLocationShares("files-shares-with-me"):this.createFolderLink({path:e.dirname(t.path),...t.parentFolderId&&{fileId:t.parentFolderId},resource:t})},createFolderLink(s){if(this.targetRouteCallback)return this.targetRouteCallback(s);const{path:r,fileId:n,resource:l}=s;let c;if(l.shareId)c=a.buildShareSpaceResource({shareId:l.shareId,shareName:e.basename(l.shareRoot),serverUrl:i.configurationManager.serverUrl});else{if(!l.shareId&&!this.getInternalSpace(l.storageId))return"/"===r?o.createLocationShares("files-shares-with-me"):{name:"resolvePrivateLink",params:{fileId:n}};c=this.getMatchingSpace(l)}return c?o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(c,{path:r,fileId:n})):{}},fileDragged(e){this.addSelectedResource(e)},fileDropped(e){this.$emit("fileDropped",e)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleFileSelection(e)},resetDropPosition(e,t,i){const s=this.$refs[e].tippy;void 0!==s&&(this.isResourceSelected(i)||this.emitSelect([i.id]),this.displayPositionedDropdown(s,t))},showContextMenu(e,t,i){t.preventDefault();const s=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];void 0!==s&&(this.isResourceSelected(i)||this.emitSelect([i.id]),this.displayPositionedDropdown(s._tippy,t))},displayPositionedDropdown(e,t){const i=this.$refs.contextMenuButton.$el.getBoundingClientRect();e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:t.clientY,bottom:t.clientY,left:"contextmenu"===t.type?t.clientX:i.x,right:"contextmenu"===t.type?t.clientX:i.x})}),e.show()},rowMounted(e,t){this.$emit("rowMounted",e,t)},fileClicked(e){const t=e[0],s=e[1];return s&&s.metaKey?i.eventBus.publish("app.files.list.clicked.meta",t):s&&s.shiftKey?i.eventBus.publish("app.files.list.clicked.shift",t):this.emitSelect([t.id])},formatDate(e){return r.formatDateFromJSDate(new Date(e),this.$language.current)},formatDateRelative(e){return r.formatRelativeDateFromJSDate(new Date(e),this.$language.current)},setSelection(e,t){e?this.emitSelect([...this.selectedIds,t.id]):this.emitSelect(this.selectedIds.filter((e=>e!==t.id)))},emitSelect(e){i.eventBus.publish("app.files.list.clicked"),this.$emit("select",e)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.map((e=>e.id)))},emitFileClick(e){let t=this.getMatchingSpace(e);t||(t=a.buildShareSpaceResource({shareId:e.shareId,shareName:e.name,serverUrl:i.configurationManager.serverUrl})),this.$emit("fileClick",{space:t,resources:[e]})},isResourceClickable(e){return!!this.areResourcesClickable&&(Array.isArray(this.disabled)?!this.disabled.includes(e):this.disabled!==e)},getResourceCheckboxLabel(e){return"folder"===e.type?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){const t="folder"===e.type?this.$gettext("folder"):this.$gettext("file"),i=e.sharedWith.filter((e=>!e.link)).length,s=e.sharedWith.filter((e=>!!e.link)).length,a=[i>0?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",i):"",s>0?this.$ngettext("This %{ resourceType } is shared via %{ linkCount } link","This %{ resourceType } is shared via %{ linkCount } links",s):""].join(" ");return this.$gettextInterpolate(a,{resourceType:t,shareCount:i,linkCount:s})},getOwnerAvatarDescription(e){const t=this.$gettext("This %{ resourceType } is owned by %{ ownerName }"),i="folder"===e.type?this.$gettext("folder"):this.$gettext("file");return this.$gettextInterpolate(t,{resourceType:i,ownerName:e.owner[0].displayName})},getInternalSpace(e){return this.space||this.spaces.find((t=>t.id===e))},getMatchingSpace(e){return this.getInternalSpace(e.storageId)||a.buildShareSpaceResource({shareId:e.shareId,shareName:e.name,serverUrl:i.configurationManager.serverUrl})},getDefaultParentFolderName(t){if(this.hasProjectSpaces){const e=this.getMatchingSpace(t);if("project"===e?.driveType)return e.name}return this.hasShareJail?t.shareId?"/"===t.path?this.$gettext("Shared with me"):e.basename(t.shareRoot):this.getInternalSpace(t.storageId)?this.$gettext("Personal"):this.$gettext("Shared with me"):this.$gettext("All files and folders")},getArePathsDisplayed(e){return this.arePathsDisplayed&&"space"!==e.type}}});var Re=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("oc-table",{class:e.hoverableQuickActions&&"hoverable-quick-actions",attrs:{data:e.resources,fields:e.fields,highlighted:e.selectedIds,disabled:e.disabled,sticky:!0,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazyLoading,"padding-x":"medium"},on:{highlight:e.fileClicked,rowMounted:e.rowMounted,contextmenuClicked:e.showContextMenu,itemDropped:e.fileDropped,itemDragged:e.fileDragged,sort:e.sort},scopedSlots:e._u([{key:"selectHeader",fn:function(){return[i("div",{staticClass:"resource-table-select-all"},[i("oc-checkbox",{attrs:{id:"resource-table-select-all",size:"large",label:e.allResourcesCheckboxLabel,"hide-label":!0,value:e.areAllResourcesSelected},on:{input:e.toggleSelectionAll}})],1)]},proxy:!0},{key:"select",fn:function(t){var s=t.item;return[i("oc-checkbox",{attrs:{id:"resource-table-select-"+e.resourceDomSelector(s),label:e.getResourceCheckboxLabel(s),"hide-label":!0,size:"large",value:e.isResourceSelected(s),outline:e.isLatestSelectedItem(s)},on:{input:function(t){return e.setSelection(t,s)}},nativeOn:{click:function(e){e.stopPropagation()}}})]}},{key:"name",fn:function(t){var s=t.item;return[i("div",{staticClass:"resource-table-resource-wrapper",class:[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(s)}]},[i("oc-resource",{key:s.path+"-"+e.resourceDomSelector(s)+"-"+s.thumbnail,class:{"resource-table-resource-cut":e.isResourceCut(s)},attrs:{resource:s,"is-path-displayed":e.getArePathsDisplayed(s),"parent-folder-name-default":e.getDefaultParentFolderName(s),"is-thumbnail-displayed":e.areThumbnailsDisplayed,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(s.id),"folder-link":e.folderLink(s),"parent-folder-link":e.parentFolderLink(s)},on:{click:function(t){return e.emitFileClick(s)}}}),e._v(" "),e.hasRenameAction(s)?i("oc-button",{staticClass:"resource-table-edit-name",attrs:{appearance:"raw"},on:{click:function(t){return e.openRenameDialog(s)}}},[i("oc-icon",{attrs:{name:"edit-2","fill-type":"line",size:"small"}})],1):e._e()],1)]}},{key:"status",fn:function(t){var i=t.item;return[e._t("status",null,{resource:i})]}},{key:"size",fn:function(e){var t=e.item;return[i("oc-resource-size",{attrs:{size:t.size||Number.NaN}})]}},{key:"mdate",fn:function(t){var s=t.item;return[i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.formatDate(s.mdate),expression:"formatDate(item.mdate)"}],attrs:{tabindex:"0"},domProps:{textContent:e._s(e.formatDateRelative(s.mdate))}})]}},{key:"indicators",fn:function(t){var s=t.item;return[s.indicators.length?i("oc-status-indicators",{attrs:{resource:s,indicators:s.indicators}}):e._e()]}},{key:"sdate",fn:function(t){var s=t.item;return[i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.formatDate(s.sdate),expression:"formatDate(item.sdate)"}],attrs:{tabindex:"0"},domProps:{textContent:e._s(e.formatDateRelative(s.sdate))}})]}},{key:"ddate",fn:function(t){var s=t.item;return[i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.formatDate(s.ddate),expression:"formatDate(item.ddate)"}],attrs:{tabindex:"0"},domProps:{textContent:e._s(e.formatDateRelative(s.ddate))}})]}},{key:"owner",fn:function(t){var s=t.item;return[i("oc-button",{attrs:{appearance:"raw",variation:"inverse"},on:{click:function(t){return e.openSharingSidebar(s)}}},[i("oc-avatars",{staticClass:"resource-table-people",attrs:{items:s.owner,"is-tooltip-displayed":!0,"accessible-description":e.getOwnerAvatarDescription(s)}})],1)]}},{key:"sharedWith",fn:function(t){var s=t.item;return[i("oc-button",{attrs:{appearance:"raw",variation:"inverse"},on:{click:function(t){return e.openSharingSidebar(s)}}},[i("oc-avatars",{staticClass:"resource-table-people",attrs:{items:s.sharedWith,stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(s)}})],1)]}},{key:"actions",fn:function(t){var s=t.item;return[i("div",{staticClass:"resource-table-actions"},[e._t("quickActions",null,{resource:s}),e._v(" "),i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.contextMenuLabel,expression:"contextMenuLabel"}],ref:"contextMenuButton",staticClass:"resource-table-btn-action-dropdown",attrs:{id:"context-menu-trigger-"+e.resourceDomSelector(s),"aria-label":e.contextMenuLabel,appearance:"raw"},on:{click:function(t){t.stopPropagation(),t.preventDefault(),e.resetDropPosition("context-menu-drop-ref-"+e.resourceDomSelector(s),t,s)}}},[i("oc-icon",{attrs:{name:"more-2"}})],1),e._v(" "),i("oc-drop",{ref:"context-menu-drop-ref-"+e.resourceDomSelector(s),attrs:{"drop-id":"context-menu-drop-"+e.resourceDomSelector(s),toggle:"#context-menu-trigger-"+e.resourceDomSelector(s),"popper-options":e.popperOptions,mode:"click","close-on-click":"","padding-size":"small"},nativeOn:{click:function(e){e.stopPropagation(),e.preventDefault()}}},[e._t("contextMenu",null,{resource:s})],2)],2)]}},e.$slots.footer?{key:"footer",fn:function(){return[e._t("footer")]},proxy:!0}:null],null,!0)})};Re._withStripped=!0;const Le=e.normalizeComponent({render:Re,staticRenderFns:[]},undefined,Te,undefined,false,undefined,!1,void 0,void 0,void 0);async function De(e,t,i,a,r){const n=function(e){switch(e){case s.ShareStatus.accepted:return"POST";case s.ShareStatus.declined:return"DELETE";default:return null}}(t);if(!n)throw new Error("invalid new share status");let o=await r.requests.ocs({service:"apps/files_sharing",action:`api/v1/shares/pending/${e.share.id}`,method:n});if(200!==o.status)throw new Error(o.statusText);if(parseInt(o.headers.get("content-length"))>0&&(o=await o.json(),o.ocs.data.length>0)){return H([o.ocs.data[0]],!0,i,a)[0]}return null}var Ae={computed:{...e.mapGetters(["capabilities"]),$_acceptShare_hasResharing(){return e.get(this.capabilities,"files_sharing.resharing",!0)},$_acceptShare_hasShareJail(){return e.get(this.capabilities,"spaces.share_jail",!1)},$_acceptShare_items(){return[{name:"accept-share",icon:"check",handler:this.$_acceptShare_trigger,label:({resources:e})=>this.$ngettext("Accept share","Accept shares",e.length),isEnabled:({resources:e})=>{if(!o.isLocationSharesActive(this.$router,"files-shares-with-me")&&!o.isLocationSpacesActive(this.$router,"files-spaces-generic"))return!1;if(0===e.length)return!1;if(o.isLocationSpacesActive(this.$router,"files-spaces-generic")&&("share"!==this.space?.driveType||e.length>1||"/"!==e[0].path))return!1;return!e.some((e=>e.status===s.ShareStatus.accepted))},componentType:"button",class:"oc-files-actions-accept-share-trigger"}]}},methods:{...e.mapMutations("Files",["UPDATE_RESOURCE"]),...e.mapActions(["showMessage"]),...e.mapActions("Files",["resetFileSelection"]),async $_acceptShare_trigger({resources:t}){const i=[],a=[],r=new e._default({concurrency:4});if(t.forEach((e=>{a.push(r.add((async()=>{try{const t=await De(e,s.ShareStatus.accepted,this.$_acceptShare_hasResharing,this.$_acceptShare_hasShareJail,this.$client);t&&this.UPDATE_RESOURCE(t)}catch(e){console.error(e),i.push(e)}})))})),await Promise.all(a),0===i.length)return this.resetFileSelection(),void(o.isLocationSpacesActive(this.$router,"files-spaces-generic")&&this.showMessage({title:this.$ngettext("The selected share was accepted successfully","The selected shares were accepted successfully",t.length)}));this.showMessage({title:this.$ngettext("Failed to accept the selected share.","Failed to accept selected shares.",t.length),status:"danger"})}}},Pe={computed:{isMacOs:function(){return window.navigator.platform.match("Mac")},getCopyShortcutString:function(){return this.isMacOs?this.$pgettext("Keyboard shortcut for macOS for copying files","⌘ + C"):this.$pgettext("Keyboard shortcut for non-macOS systems for copying files","Ctrl + C")},$_copy_items:function(){var e=this;return[{name:"copy",icon:"file-copy-2",handler:this.$_copy_trigger,shortcut:this.getCopyShortcutString,label:function(){return e.$pgettext("Action in the files list row to initiate copying resources","Copy")},isEnabled:function(t){var i=t.resources;return!!(o.isLocationSpacesActive(e.$router,"files-spaces-generic")||o.isLocationPublicActive(e.$router,"files-public-link")||o.isLocationCommonActive(e.$router,"files-common-favorites"))&&(0!==i.length&&(!o.isLocationPublicActive(e.$router,"files-public-link")||e.currentFolder.canCreate()))},componentType:"button",class:"oc-files-actions-copy-trigger"}]}},methods:c._objectSpread2(c._objectSpread2({},e.mapActions("Files",["copySelectedFiles"])),{},{$_copy_trigger:function(e){var t=e.resources;this.copySelectedFiles({space:this.space,resources:t})}})},Me={...e.mapGetters(["capabilities"]),$_declineShare_hasResharing(){return e.get(this.capabilities,"files_sharing.resharing",!0)},$_declineShare_hasShareJail(){return e.get(this.capabilities,"spaces.share_jail",!1)},computed:{$_declineShare_items(){return[{name:"decline-share",icon:"spam-3",handler:this.$_declineShare_trigger,label:({resources:e})=>this.$ngettext("Decline share","Decline shares",e.length),isEnabled:({resources:e})=>{if(!o.isLocationSharesActive(this.$router,"files-shares-with-me")&&!o.isLocationSpacesActive(this.$router,"files-spaces-generic"))return!1;if(0===e.length)return!1;if(o.isLocationSpacesActive(this.$router,"files-spaces-generic")&&("share"!==this.space?.driveType||e.length>1||"/"!==e[0].path))return!1;return!e.some((e=>e.status===s.ShareStatus.declined))},componentType:"button",class:"oc-files-actions-decline-share-trigger"}]}},methods:{...e.mapMutations("Files",["UPDATE_RESOURCE"]),...e.mapActions(["showMessage"]),...e.mapActions("Files",["resetFileSelection"]),async $_declineShare_trigger({resources:t}){const i=[],a=[],r=new e._default({concurrency:4});if(t.forEach((e=>{a.push(r.add((async()=>{try{const t=await De(e,s.ShareStatus.declined,this.$_declineShare_hasResharing,this.$_declineShare_hasShareJail,this.$client);t&&this.UPDATE_RESOURCE(t)}catch(e){console.error(e),i.push(e)}})))})),await Promise.all(a),0===i.length)return this.resetFileSelection(),void(o.isLocationSpacesActive(this.$router,"files-spaces-generic")&&(this.showMessage({title:this.$ngettext("The selected share was declined successfully","The selected shares were declined successfully",t.length)}),this.$router.push(o.createLocationShares("files-shares-with-me"))));this.showMessage({title:this.$ngettext("Failed to decline the selected share","Failed to decline selected shares",t.length),status:"danger"})}}};function Oe(e){if(void 0===e)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}var Ne={mixins:[{data:()=>({deleteResources_queue:new e._default({concurrency:4}),deleteResources_deleteOps:[],resourcesToDelete:[]}),computed:{...e.mapGetters("Files",["selectedFiles","currentFolder"]),...e.mapGetters(["user","configuration","capabilities"]),$_deleteResources_isInTrashbin(){return o.isLocationTrashActive(this.$router,"files-trash-generic")},$_deleteResources_resources(){return Oe(this.resourcesToDelete)},$_deleteResources_dialogTitle(){const e=this.$_deleteResources_resources,t="folder"===e[0].type;let i=null;return 1===e.length?(i=t?this.$_deleteResources_isInTrashbin?this.$gettext("Permanently delete folder %{name}"):this.$gettext("Delete folder %{name}"):this.$_deleteResources_isInTrashbin?this.$gettext("Permanently delete file %{name}"):this.$gettext("Delete file %{name}"),this.$gettextInterpolate(i,{name:e[0].name},!0)):(i=this.$_deleteResources_isInTrashbin?this.$ngettext("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",e.length):this.$ngettext("Delete selected resource?","Delete %{amount} selected resources?",e.length),this.$gettextInterpolate(i,{amount:e.length},!1))},$_deleteResources_dialogMessage(){const e=this.$_deleteResources_resources,t="folder"===e[0].type;return 1===e.length?t?this.$_deleteResources_isInTrashbin?this.$gettext("Are you sure you want to delete this folder? All it’s content will be permanently removed. This action cannot be undone."):this.$gettext("Are you sure you want to delete this folder?"):this.$_deleteResources_isInTrashbin?this.$gettext("Are you sure you want to delete this file? All it’s content will be permanently removed. This action cannot be undone."):this.$gettext("Are you sure you want to delete this file?"):this.$_deleteResources_isInTrashbin?this.$gettext("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone."):this.$gettext("Are you sure you want to delete all selected resources?")}},methods:{...e.mapActions("Files",["pushResourcesToDeleteList","removeFilesFromTrashbin","deleteFiles"]),...e.mapActions(["showMessage","toggleModalConfirmButton","hideModal","createModal"]),...e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"]),...e.mapMutations(["SET_QUOTA"]),$_deleteResources_trashbin_deleteOp(e){const t=!0===this.capabilities?.spaces?.share_jail?a.buildWebDavSpacesTrashPath(this.space.id):G(this.user.id);return this.$client.fileTrash.clearTrashBin(t,e.id).then((()=>{this.removeFilesFromTrashbin([e]);const t=this.$gettext('"%{file}" was deleted successfully');this.showMessage({title:this.$gettextInterpolate(t,{file:e.name},!0)})})).catch((t=>{if(423===t.statusCode){const t=this.deleteResources_queue.add((()=>this.$_deleteResources_trashbin_deleteOp(e)));return void this.deleteResources_deleteOps.push(t)}console.error(t);const i=this.$gettext('Failed to delete "%{file}"');this.showMessage({title:this.$gettextInterpolate(i,{file:e.name},!0),status:"danger"})}))},$_deleteResources_trashbin_delete(){this.toggleModalConfirmButton();for(const e of this.$_deleteResources_resources){const t=this.deleteResources_queue.add((()=>this.$_deleteResources_trashbin_deleteOp(e)));this.deleteResources_deleteOps.push(t)}Promise.all(this.deleteResources_deleteOps).then((()=>{this.hideModal(),this.toggleModalConfirmButton()}))},$_deleteResources_filesList_delete(){this.deleteFiles({space:this.space,files:this.$_deleteResources_resources,clientService:this.$clientService,$gettext:this.$gettext,$gettextInterpolate:this.$gettextInterpolate}).then((async()=>{if(this.hideModal(),this.toggleModalConfirmButton(),o.isLocationSpacesActive(this.$router,"files-spaces-generic")&&!["public","share"].includes(this.space?.driveType))if(this.capabilities?.spaces?.enabled){const e=this.$store.getters["runtime/auth/accessToken"],t=d.clientService.graphAuthenticated(this.configuration.server,e),i=await t.drives.getDrive(this.$_deleteResources_resources[0].storageId);this.UPDATE_SPACE_FIELD({id:i.data.id,field:"spaceQuota",value:i.data.quota})}else{const e=await this.$client.users.getUser(this.user.id);this.SET_QUOTA(e.quota)}if(this.resourcesToDelete.length&&_e(this.resourcesToDelete[0],this.currentFolder))return this.$router.push(t.createFileRouteOptions(this.space,{path:e.dirname(this.resourcesToDelete[0].path),fileId:this.resourcesToDelete[0].parentFolderId}))}))},$_deleteResources_delete(){this.toggleModalConfirmButton(),this.$_deleteResources_isInTrashbin?this.$_deleteResources_trashbin_delete():this.$_deleteResources_filesList_delete()},$_deleteResources_displayDialog(e){this.resourcesToDelete=[...e];const t={variation:"danger",icon:"alarm-warning",title:this.$_deleteResources_dialogTitle,message:this.$_deleteResources_dialogMessage,cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Delete"),onCancel:this.hideModal,onConfirm:this.$_deleteResources_delete};this.createModal(t)}}}],computed:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapState("Files",["currentFolder"])),e.mapGetters(["capabilities","user"])),{},{$_delete_items:function(){var e=this;return[{name:"delete",icon:"delete-bin-5",label:function(){return e.$gettext("Delete")},handler:this.$_delete_trigger,isEnabled:function(t){var i,s=t.resources;return!!(o.isLocationSpacesActive(e.$router,"files-spaces-generic")||o.isLocationPublicActive(e.$router,"files-public-link")||o.isLocationCommonActive(e.$router,"files-common-search"))&&(0!==s.length&&((!o.isLocationSpacesActive(e.$router,"files-spaces-generic")||"share"!==(null===(i=e.space)||void 0===i?void 0:i.driveType)||"/"!==s[0].path)&&!s.some((function(e){return!e.canBeDeleted()}))))},componentType:"button",class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:function(){return e.$gettext("Delete")},handler:this.$_delete_trigger,isEnabled:function(t){var i,s,r=t.resources;return!!o.isLocationTrashActive(e.$router,"files-trash-generic")&&(!1!==(null===(i=e.capabilities)||void 0===i||null===(s=i.files)||void 0===s?void 0:s.permanent_deletion)&&(!(a.isProjectSpaceResource(e.space)&&!e.space.isEditor(e.user.uuid)&&!e.space.isManager(e.user.uuid))&&r.length>0))},componentType:"button",class:"oc-files-actions-delete-permanent-trigger"}]}}),methods:{$_delete_trigger:function(e){var t=e.resources;this.$_deleteResources_displayDialog(t)}}};var Be={computed:{$_isFilesAppActive(){return"files"===u.activeApp(this.$route)}}};const ze=new class{serverUrl;capability;initialize(t,i=[]){this.serverUrl=t;const s=i.filter((e=>e.enabled)).sort(((t,i)=>e.rcompare_1(t.version,i.version)));this.capability=s.length?s[0]:null}get available(){return!!this.capability?.version}get fileIdsSupported(){return e.major_1(this.capability?.version)>=2}async triggerDownload(e){const t=e.clientService||d.clientService;if(!this.available)throw new l.RuntimeError("no archiver available");if((e.fileIds?.length||0)+(e.files?.length||0)===0)throw new l.RuntimeError("requested archive with empty list of resources");const i=this.buildDownloadUrl({...e,clientService:t});if(!i)throw new l.RuntimeError("download url could not be built");const s=e.publicToken?i:await t.owncloudSdk.signUrl(i);return window.location=s,s}buildDownloadUrl(t){const i=[];t.publicToken&&i.push(`public-token=${t.publicToken}`);switch(e.major_1(this.capability.version)){case 2:return i.push(...t.fileIds.map((e=>`id=${e}`))),this.url+"?"+i.join("&");case 1:{const e=Math.random().toString(36).substring(2);return i.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map((e=>`files[]=${encodeURIComponent(e)}`)),`downloadStartSecret=${e}`),this.url+"?"+i.join("&")}default:return}}get url(){if(!this.available)throw new l.RuntimeError("no archiver available");return/^https?:\/\//i.test(this.capability.archiver_url)?this.capability.archiver_url:s.urlJoin(i.configurationManager.serverUrl,this.capability.archiver_url)}};const Ue=new class{serverUrl;capability;initialize(e=null){this.capability=e}get available(){return!!this.capability?.version}get supportedMimeTypes(){return this.capability?.supportedMimeTypes||[]}isMimetypeSupported(e,t=!1){if(!this.supportedMimeTypes.length)return!0;return this.getSupportedMimeTypes(t?"image/":null).includes(e)}getSupportedMimeTypes(e){return e?this.supportedMimeTypes.filter((t=>t.startsWith(e))):this.supportedMimeTypes}};class qe{static sdkSearch}var je={mixins:[Be],computed:{$_downloadArchive_items:function(){var e=this;return[{name:"download-archive",icon:"inbox-archive",handler:this.$_downloadArchive_trigger,label:function(){return e.$gettext("Download")},isEnabled:function(t){var i=t.resources;return!!(!e.$_isFilesAppActive||o.isLocationSpacesActive(e.$router,"files-spaces-generic")||o.isLocationPublicActive(e.$router,"files-public-link")||o.isLocationCommonActive(e.$router,"files-common-favorites")||o.isLocationCommonActive(e.$router,"files-common-search")||o.isLocationSharesActive(e.$router,"files-shares-with-me")||o.isLocationSharesActive(e.$router,"files-shares-with-others")||o.isLocationSharesActive(e.$router,"files-shares-via-link"))&&(0!==i.length&&(!(1===i.length&&!i[0].isFolder)&&(!!ze.available&&(!(!ze.fileIdsSupported&&o.isLocationCommonActive(e.$router,"files-common-favorites"))&&!i.some((function(e){return!e.canDownload()}))))))},canBeDefault:!0,componentType:"button",class:"oc-files-actions-download-archive-trigger"}]}},methods:{$_downloadArchive_trigger:function(t){var i=this;return c._asyncToGenerator(c._regeneratorRuntime().mark((function s(){var r,n;return c._regeneratorRuntime().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return r=t.resources,n=ze.fileIdsSupported?{fileIds:r.map((function(e){return e.fileId}))}:{dir:e.pathUtil.dirname(e.head(r).path)||"/",files:r.map((function(e){return e.name}))},s.next=4,ze.triggerDownload(c._objectSpread2(c._objectSpread2({},n),a.isPublicSpaceResource(i.space)&&{publicToken:i.space.id})).catch((function(e){console.error(e),i.showMessage({title:i.$ngettext("Failed to download the selected folder.","Failed to download the selected files.",i.selectedFiles.length),status:"danger"})}));case 4:case"end":return s.stop()}}),s)})))()}}},Ve={computed:{$_isSearchActive:()=>!!document.getElementById("files-global-search-options")}},Ge={mixins:[Be,Ve],computed:{$_downloadFile_items:function(){var e=this;return[{name:"download-file",icon:"file-download",handler:this.$_downloadFile_trigger,label:function(){return e.$gettext("Download")},isEnabled:function(t){var i=t.resources;return!!(!e.$_isFilesAppActive||e.$_isSearchActive||o.isLocationSpacesActive(e.$router,"files-spaces-generic")||o.isLocationPublicActive(e.$router,"files-public-link")||o.isLocationCommonActive(e.$router,"files-common-favorites")||o.isLocationCommonActive(e.$router,"files-common-search")||o.isLocationSharesActive(e.$router,"files-shares-with-me")||o.isLocationSharesActive(e.$router,"files-shares-with-others")||o.isLocationSharesActive(e.$router,"files-shares-via-link"))&&(1===i.length&&(!i[0].isFolder&&i[0].canDownload()))},canBeDefault:!0,componentType:"button",class:"oc-files-actions-download-file-trigger"}]}},methods:{$_downloadFile_trigger:function(e){var t=e.resources;this.downloadFile(t[0])}}},He={mixins:[Be],computed:{$_favorite_items:function(){var e=this;return[{name:"favorite",icon:"star",handler:this.$_favorite_trigger,label:function(t){return t.resources[0].starred?e.$gettext("Remove from favorites"):e.$gettext("Add to favorites")},isEnabled:function(t){var i,s,a=t.resources;return!(e.$_isFilesAppActive&&!o.isLocationSpacesActive(e.$router,"files-spaces-generic")&&!o.isLocationCommonActive(e.$router,"files-common-favorites"))&&(1===a.length&&(null===(i=e.capabilities)||void 0===i||null===(s=i.files)||void 0===s?void 0:s.favorites))},componentType:"button",class:"oc-files-actions-favorite-trigger"}]}},methods:c._objectSpread2(c._objectSpread2({},e.mapActions("Files",["markFavorite"])),{},{$_favorite_trigger:function(e){var t=this,i=e.resources;this.markFavorite({client:this.$client,file:i[0]}).catch((function(){var e=t.$gettext('Failed to change favorite state of "%{file}"'),s=t.$gettextInterpolate(e,{file:i[0].name},!0);t.showMessage({title:s,status:"danger"})}))}})};var We={computed:{isMacOs:function(){return window.navigator.platform.match("Mac")},getCutShortcutString:function(){return this.isMacOs?this.$pgettext("Keyboard shortcut for macOS for cutting files","⌘ + X"):this.$pgettext("Keyboard shortcut for non-macOS systems for cutting files","Ctrl + X")},$_move_items:function(){var e=this;return[{name:"cut",icon:"scissors",handler:this.$_move_trigger,shortcut:this.getCutShortcutString,label:function(){return e.$pgettext("Action in the files list row to initiate cutting resources","Cut")},isEnabled:function(t){var i=t.resources;return!!(o.isLocationSpacesActive(e.$router,"files-spaces-generic")||o.isLocationPublicActive(e.$router,"files-public-link")||o.isLocationCommonActive(e.$router,"files-common-favorites"))&&(0!==i.length&&(!!e.currentFolder&&!i.some((function(t){return!1===function(e,t){var i=e.isReceivedShare()||e.isMounted(),s=""===t&&i;return e.canBeDeleted()&&!s}(t,e.currentFolder.path)}))))},componentType:"button",class:"oc-files-actions-move-trigger"}]}},methods:c._objectSpread2(c._objectSpread2({},e.mapActions("Files",["cutSelectedFiles"])),{},{$_move_trigger:function(e){var t=e.resources;this.cutSelectedFiles({space:this.space,resources:t})}})},Qe={computed:{...e.mapGetters(["capabilities"]),...e.mapState("Files",["currentFolder"]),$_navigate_items(){return[{name:"navigate",icon:"folder-open",label:()=>this.$pgettext("Action in the files list row to open a folder","Open folder"),isEnabled:({resources:e})=>!o.isLocationTrashActive(this.$router,"files-trash-generic")&&(1===e.length&&((null===this.currentFolder||!_e(e[0],this.currentFolder))&&(!(!e[0].isFolder||"space"===e[0].type)&&(!o.isLocationSharesActive(this.$router,"files-shares-with-me")||e[0].status===s.ShareStatus.accepted)))),canBeDefault:!0,componentType:"router-link",route:({resources:i})=>a.isShareSpaceResource(this.space)&&(o.isLocationSharesActive(this.$router,"files-shares-with-others")||o.isLocationSharesActive(this.$router,"files-shares-via-link"))?{name:"resolvePrivateLink",params:{fileId:i[0].fileId}}:e.merge({},this.routeName,t.createFileRouteOptions(this.$_navigate_getSpace(i[0]),{path:i[0].path,fileId:i[0].fileId})),class:"oc-files-actions-navigate-trigger"}]},routeName(){return o.isLocationPublicActive(this.$router,"files-public-link")?o.createLocationPublic("files-public-link"):o.createLocationSpaces("files-spaces-generic")}},methods:{$_navigate_getSpace(e){if(this.space)return this.space;const t=e.storageId,s=this.$store.getters["runtime/spaces/spaces"].find((e=>e.id===t));return s||a.buildShareSpaceResource({shareId:e.shareId,shareName:e.name,serverUrl:i.configurationManager.serverUrl})}}},Je={computed:{...e.mapState(["user"]),...e.mapState("runtime/spaces",["spaces"]),...e.mapGetters(["configuration","capabilities"]),$_restore_items(){return[{name:"restore",icon:"arrow-go-back",label:()=>this.$gettext("Restore"),handler:this.$_restore_trigger,isEnabled:({resources:e})=>!!o.isLocationTrashActive(this.$router,"files-trash-generic")&&(!!e.every((e=>e.canBeRestored()))&&(!(a.isProjectSpaceResource(this.space)&&!this.space.isEditor(this.user.uuid)&&!this.space.isManager(this.user.uuid))&&e.length>0)),componentType:"button",class:"oc-files-actions-restore-trigger"}]}},methods:{...e.mapActions("Files",["removeFilesFromTrashbin"]),...e.mapActions(["showMessage"]),...e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"]),...e.mapMutations(["SET_QUOTA"]),async $_restore_collectConflicts(t){const i={},s=[],a=[],r=[];for(const n of t){const t=e.dirname(n.path);let o=[];if(t in i)o=i[t];else{try{o=(await this.$clientService.webdav.listFiles(this.space,{path:t})).children}catch(e){r.push(t)}i[t]=o}o.some((e=>e.name===n.name))||a.filter((e=>e.id!==n.id)).some((e=>e.path===n.path))?s.push(n):a.push(n)}return{existingResourcesByPath:i,conflicts:s,resolvedResources:a,missingFolderPaths:r.filter((e=>!i[e]?.length))}},async $_restore_collectResolveStrategies(e){let t=0;const i=[],s=e.length;let a,r=!1;for(const n of e){const e="folder"===n.type;if(r){i.push({resource:n,strategy:a});continue}const o=s-t,l=new ye(this.createModal,this.hideModal,this.showMessage,this.$gettext,this.$ngettext,this.$gettextInterpolate),c=await l.resolveFileExists({name:n.name,isFolder:e},o,o<=1,!1);t++,c.doForAllConflicts&&(r=!0,a=c.strategy),i.push({resource:n,strategy:c.strategy})}return i},async $_restore_createFolderStructure(e,t){const{webdav:i}=d.clientService,a=e.split("/").filter(Boolean);let r="";for(const e of a){const a=s.urlJoin(r,e);if(t.includes(a))r=s.urlJoin(r,e);else{try{await i.createFolder(this.space,{path:a})}catch(e){}t.push(a),r=a}}return{existingPaths:t}},async $_restore_restoreResources(t,i){const s=[],a=[];let r=[];for(const n of t){const t=e.dirname(n.path);if(i.includes(t)){const{existingPaths:e}=await this.$_restore_createFolderStructure(t,r);r=e}try{await this.$clientService.webdav.restoreFile(this.space,n,n,{overwrite:!0}),s.push(n)}catch(e){console.error(e),a.push(n)}}if(s.length){let e;this.removeFilesFromTrashbin(s);const t={};1===s.length?(e=this.$gettext("%{resource} was restored successfully"),t.resource=s[0].name):(e=this.$gettext("%{resourceCount} files restored successfully"),t.resourceCount=s.length),this.showMessage({title:this.$gettextInterpolate(e,t,!0)})}if(a.length){let e;const t={};1===a.length?(e=this.$gettext('Failed to restore "%{resource}"'),t.resource=a[0].name):(e=this.$gettext("Failed to restore %{resourceCount} files"),t.resourceCount=a.length),this.showMessage({title:this.$gettextInterpolate(e,t,!0),status:"danger"})}if(this.capabilities?.spaces?.enabled){const e=this.$store.getters["runtime/auth/accessToken"],t=d.clientService.graphAuthenticated(this.configuration.server,e),i=await t.drives.getDrive(this.space.id);this.UPDATE_SPACE_FIELD({id:i.data.id,field:"spaceQuota",value:i.data.quota})}else{const e=await this.$client.users.getUser(this.user.id);this.SET_QUOTA(e.quota)}},async $_restore_trigger({resources:t}){const i=t.sort(((e,t)=>e.path.length-t.path.length)),{existingResourcesByPath:r,conflicts:n,resolvedResources:o,missingFolderPaths:l}=await this.$_restore_collectConflicts(i),c=await this.$_restore_collectResolveStrategies(n),d=c.filter((e=>e.strategy===Ce.REPLACE)).map((e=>e.resource));o.push(...d);const u=c.filter((e=>e.strategy===Ce.KEEP_BOTH)).map((e=>e.resource));for(let t of u){t={...t};const i=e.dirname(t.path),n=r[i]||[],l=a.extractExtensionFromFile(t),d=we(t.name,l,[...n,...c.map((e=>e.resource)),...o]);t.name=d,t.path=s.urlJoin(i,d),o.push(t)}return this.$_restore_restoreResources(o,l)}}};const Ye=["navigate","downloadArchive","downloadFile","favorite","copy","move","rename","restore","delete","acceptShare","declineShare"];var Ke={mixins:[Ae,Pe,Me,Ne,Ge,je,He,We,Qe,$e,Je,Ve],computed:{...e.mapState(["apps"]),...e.mapGetters("Files",["highlightedFile","currentFolder"]),...e.mapGetters(["capabilities","configuration"]),$_fileActions_systemActions(){return Ye.flatMap((e=>this[`$_${e}_items`]))},$_fileActions_editorActions(){return this.apps.fileEditors.map((t=>({label:()=>{if(t.label)return this.$gettext(t.label);const e=this.$gettext("Open in %{app}");return this.$gettextInterpolate(e,{app:this.apps.meta[t.app].name},!0)},icon:this.apps.meta[t.app].icon,...this.apps.meta[t.app].iconFillType&&{iconFillType:this.apps.meta[t.app].iconFillType},img:this.apps.meta[t.app].img,handler:e=>this.$_fileActions_openEditor(t,e.space.getDriveAliasAndItem(e.resources[0]),e.resources[0].webDavPath,e.resources[0].fileId,"edit",e.space.shareId),isEnabled:({resources:e})=>1===e.length&&(!(!this.$_isSearchActive&&(o.isLocationTrashActive(this.$router,"files-trash-generic")||o.isLocationSharesActive(this.$router,"files-shares-with-me")&&e[0].status!==s.ShareStatus.accepted))&&(e[0].extension&&t.extension?e[0].extension.toLowerCase()===t.extension.toLowerCase():!(!e[0].mimeType||!t.mimeType)&&(e[0].mimeType.toLowerCase()===t.mimeType.toLowerCase()||e[0].mimeType.split("/")[0].toLowerCase()===t.mimeType.toLowerCase()))),canBeDefault:t.canBeDefault,componentType:"button",class:`oc-files-actions-${e.kebabCase(this.apps.meta[t.app].name).toLowerCase()}-trigger`}))).sort(((e,t)=>t.canBeDefault!==e.canBeDefault&&t.canBeDefault?1:0))}},methods:{$_fileActions_openEditor(e,t,i,s,a,r){if(e.handler)return e.handler({config:this.configuration,extensionConfig:e.config,driveAliasAndItem:t,filePath:i,fileId:s,mode:a,...r&&{shareId:r}});const n=this.$_fileActions__routeOpts(e,t,i,s,a,r);if(e.newTab){const t=this.$router.resolve(n).href,s=`${e.routeName}-${i}`,a=window.open(t,s);a&&a.focus()}else this.$router.push(n)},$_fileActions__routeOpts(e,s,a,r,n,o){return{name:e.routeName||e.app,params:{driveAliasAndItem:s,filePath:a,fileId:r,mode:n},query:{...o&&{shareId:o},...r&&i.configurationManager.options.routing.idBased&&{fileId:r},...t.routeToContextQuery(this.$route)}}},$_fileActions_triggerDefaultAction(e){const t=this.$_fileActions_getDefaultAction(e);t.handler({...e,...t.handlerData})},$_fileActions_getDefaultAction(e){const t=t=>t.canBeDefault&&t.isEnabled({...e,parent:this.currentFolder}),i=this.$_fileActions_editorActions.filter(t);if(i.length)return i[0];const s=this.$_fileActions_loadExternalAppActions(e).filter(t);return s.length?s[0]:this.$_fileActions_systemActions.filter(t)[0]},$_fileActions_getAllAvailableActions(e){return[...this.$_fileActions_editorActions,...this.$_fileActions_loadExternalAppActions(e),...this.$_fileActions_systemActions].filter((t=>t.isEnabled(e)))},$_fileActions_loadExternalAppActions(t){if(o.isLocationTrashActive(this.$router,"files-trash-generic"))return[];if(1!==t.resources.length)return[];const i=t.resources[0],{mimeType:s,webDavPath:a,fileId:r}=i,n=t.space.getDriveAliasAndItem(i),l=this.$store.getters["External/mimeTypes"]||[];if(void 0===s||!e.get(this,"capabilities.files.app_providers")||!l.length)return[];const c=l.find((e=>e.mime_type===s));if(void 0===c)return[];const{app_providers:d=[],default_application:u}=c;return d.map((e=>{const i=this.$gettext("Open in %{ appName }");return{name:e.name,icon:e.icon,img:e.img,componentType:"button",class:`oc-files-actions-${e.name}-trigger`,isEnabled:()=>!0,canBeDefault:u===e.name,handler:()=>this.$_fileActions_openExternalApp(e.name,n,a,r,t.space.shareId),label:()=>this.$gettextInterpolate(i,{appName:e.name})}}))},$_fileActions_openExternalApp(e,t,i,s,a){const r=this.$_fileActions__routeOpts({routeName:"external-apps"},t,i,void 0,void 0,a);r.query={app:e,fileId:s,...r.query},window.open(this.$router.resolve(r).href,"_blank")}}};const Ze=e.defineComponent({name:"ActionMenuItem",props:{action:{type:Object,required:!0},items:{type:Array,required:!0},space:{type:Object,required:!1,default:null},appearance:{type:String,default:"raw"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1}},computed:{filterParams(){return{space:this.space,resources:this.items}},hasExternalImageIcon(){return this.action.icon&&/^https?:\/\//i.test(this.action.icon)},componentProps(){const e={appearance:this.appearance,...this.action.isDisabled&&{disabled:this.action.isDisabled()},...this.action.variation&&{variation:this.action.variation}};return"router-link"===this.action.componentType&&this.action.route?{...e,to:this.action.route(this.filterParams)}:e},componentListeners(){if("function"!=typeof this.action.handler||"button"!==this.action.componentType)return{};const e=()=>this.action.handler({...this.filterParams,...this.action.handlerData});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}});var Xe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",[i("oc-button",e._g(e._b({directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.showTooltip||e.action.hideLabel?e.action.label(e.filterParams):"",expression:"showTooltip || action.hideLabel ? action.label(filterParams) : ''"}],class:[e.action.class,"action-menu-item"],attrs:{type:e.action.componentType,"data-testid":"action-handler",size:"small"}},"oc-button",e.componentProps,!1),e.componentListeners),[e.action.img?i("oc-img",{staticClass:"oc-icon oc-icon-m",attrs:{"data-testid":"action-img",src:e.action.img,alt:""}}):e.hasExternalImageIcon?i("oc-img",{staticClass:"oc-icon oc-icon-m",attrs:{"data-testid":"action-img",src:e.action.icon,alt:""}}):e.action.icon?i("oc-icon",{attrs:{"data-testid":"action-icon",name:e.action.icon,"fill-type":e.action.iconFillType||"line",size:"medium"}}):e._e(),e._v(" "),e.action.hideLabel?e._e():i("span",{staticClass:"oc-files-context-action-label",attrs:{"data-testid":"action-label"}},[e._v(e._s(e.action.label(e.filterParams)))]),e._v(" "),e.action.shortcut&&e.shortcutHint?i("span",{staticClass:"oc-files-context-action-shortcut",domProps:{textContent:e._s(e.action.shortcut)}}):e._e(),e._v(" "),e.action.opensInNewWindow?i("span",{staticClass:"oc-invisible-sr",attrs:{"data-testid":"action-sr-hint"},domProps:{textContent:e._s(e.$gettext("(Opens in new window)"))}}):e._e()],1)],1)};Xe._withStripped=!0;const et=e.normalizeComponent({render:Xe,staticRenderFns:[]},undefined,Ze,undefined,false,undefined,!1,void 0,void 0,void 0);var tt={computed:c._objectSpread2(c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapGetters("Files",["activeFiles"])),e.mapGetters(["capabilities"])),e.mapState(["user"])),{},{$_emptyTrashBin_items:function(){var e=this;return[{name:"empty-trash-bin",icon:"delete-bin-5",label:function(){return e.$gettext("Empty trash bin")},handler:this.$_emptyTrashBin_trigger,isEnabled:function(t){var i,s,r=t.resources;return!!o.isLocationTrashActive(e.$router,"files-trash-generic")&&(!1!==(null===(i=e.capabilities)||void 0===i||null===(s=i.files)||void 0===s?void 0:s.permanent_deletion)&&(!(a.isProjectSpaceResource(e.space)&&!e.space.isEditor(e.user.uuid)&&!e.space.isManager(e.user.uuid))&&0===r.length))},isDisabled:function(){return 0===e.activeFiles.length},componentType:"button",class:"oc-files-actions-empty-trash-bin-trigger",variation:"danger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapActions(["showMessage","createModal","hideModal","toggleModalConfirmButton"])),e.mapActions("Files",["clearTrashBin"])),{},{$_emptyTrashBin_trigger:function(){var e=this,t={variation:"danger",icon:"alarm-warning",title:this.$gettext("Empty trash bin"),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Delete"),message:this.$gettext("Are you sure you want to permanently delete your items in the trash bin? You can’t undo this action."),hasInput:!1,onCancel:this.hideModal,onConfirm:function(){return e.$_emptyTrashBin_emptyTrashBin()}};this.createModal(t)},$_emptyTrashBin_emptyTrashBin:function(){var e,t,i=this,s=!0===(null===(e=this.capabilities)||void 0===e||null===(t=e.spaces)||void 0===t?void 0:t.share_jail)?a.buildWebDavSpacesTrashPath(this.space.id):G(this.user.id);return this.$client.fileTrash.clearTrashBin(s).then((function(){i.showMessage({title:i.$gettext("All deleted files were removed")}),i.clearTrashBin()})).catch((function(e){console.error(e),i.showMessage({title:i.$pgettext("Error message in case clearing the trash bin fails","Failed to delete all files permanently"),status:"danger"})})).finally((function(){i.hideModal()}))}})},it={computed:{$_clearSelection_items:function(){var e=this;return[{name:"clear-selection",icon:"close",label:function(){return e.$gettext("Clear selection")},hideLabel:!0,handler:this.$_clearSelection_trigger,isEnabled:function(e){return e.resources.length>0},componentType:"button",class:"oc-files-actions-clear-selection-trigger"}]}},methods:c._objectSpread2(c._objectSpread2({},e.mapMutations("Files",["RESET_SELECTION"])),{},{$_clearSelection_trigger:function(){this.RESET_SELECTION()}})};const st=e.defineComponent({name:"BatchActions",components:{ActionMenuItem:et},mixins:[Ae,Pe,Me,Ne,je,Ge,tt,We,Je,it],props:{showTooltips:{type:Boolean,default:!1,required:!1},space:{type:Object,required:!1,default:null}},computed:{...e.mapGetters("Files",["selectedFiles"]),filterParams(){return{resources:this.selectedFiles}},menuItemsBatchActions(){return[...this.$_clearSelection_items,...this.$_acceptShare_items,...this.$_declineShare_items,...this.$_downloadArchive_items,...this.$_downloadFile_items,...this.$_move_items,...this.$_copy_items,...this.$_emptyTrashBin_items,...this.$_delete_items,...this.$_restore_items].filter((e=>e.isEnabled({resources:this.selectedFiles})))}}});var at=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("oc-list",{staticClass:"oc-files-appbar-batch-actions oc-width-1-1"},e._l(e.menuItemsBatchActions,(function(t,s){return i("action-menu-item",{key:"batch-action-"+s,staticClass:"oc-mr-s",attrs:{action:t,items:e.selectedFiles,space:e.space,appearance:"outline","shortcut-hint":!1,"show-tooltip":e.showTooltips}})})),1)};at._withStripped=!0;const rt=e.normalizeComponent({render:at,staticRenderFns:[]},undefined,st,undefined,false,undefined,!1,void 0,void 0,void 0);const nt=e.defineComponent({name:"ContextActionMenu",components:{ActionMenuItem:et},props:{menuSections:{type:Array,required:!0},items:{type:Array,required:!0},space:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length?(e0&&t.push("oc-pt-s"),e{const{resource:i,store:s,password:a,$gettext:r}=t,n={name:r("Quicklink"),permissions:1,quicklink:!0};a&&(n.password=a);const o=s.state.user.capabilities.files_sharing.public.expire_date;o.enforced&&(n.expireDate=e.DateTime_1.now().plus({days:parseInt(o.days,10)}).endOf("day").toISO()),n.spaceRef=i.fileId||i.id;const l=await s.dispatch("Files/addLink",{path:i.path,client:d.clientService.owncloudSdk,params:n,storageId:i.fileId||i.id});return e.copyToClipboard(l.url),await s.dispatch("showMessage",{title:r("The quicklink has been copied to your clipboard.")}),l};function dt(e,t){var i=t.state.user.capabilities;return!(!i.files_sharing||!i.files_sharing.api_enabled)&&(!(e.isReceivedShare()&&!i.files_sharing.resharing)&&e.canShare())}function ut(e,t){var i,s={variation:"passive",title:T("Set password"),cancelText:T("Cancel"),confirmText:T("Set"),hasInput:!0,inputDescription:T("Passwords for links are required."),inputLabel:T("Password"),inputType:"password",onCancel:function(){return e.store.dispatch("hideModal")},onConfirm:(i=c._asyncToGenerator(c._regeneratorRuntime().mark((function i(s){return c._regeneratorRuntime().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(s&&""!==s.trim()){i.next=4;break}e.store.dispatch("showMessage",{title:T("Password cannot be empty"),status:"danger"}),i.next=7;break;case 4:return i.next=6,e.store.dispatch("hideModal");case 6:t(s);case 7:case"end":return i.stop()}}),i)}))),function(e){return i.apply(this,arguments)}),onInput:function(t){return""===t.trim()?e.store.dispatch("setModalInputErrorMessage",T("Password cannot be empty")):e.store.dispatch("setModalInputErrorMessage",null)}};return e.store.dispatch("createModal",s)}var pt,ht={collaborators:{id:"collaborators",label:function(e){return e("Add people")},icon:"user-add",handler:function(){return i.eventBus.publish(L.openWithPanel,"sharing-item#peopleShares")},displayed:dt},quicklink:{id:"quicklink",label:function(e){return e("Copy quicklink")},icon:"link",handler:(pt=c._asyncToGenerator(c._regeneratorRuntime().mark((function e(t){var s,a,r,n,o;return c._regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==(null===(s=t.store.getters.capabilities)||void 0===s||null===(a=s.files_sharing)||void 0===a||null===(r=a.public)||void 0===r||null===(n=r.password)||void 0===n||null===(o=n.enforced_for)||void 0===o?void 0:o.read_only)){e.next=3;break}return e.abrupt("return",ut(t,function(){var e=c._asyncToGenerator(c._regeneratorRuntime().mark((function e(s){return c._regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ct(c._objectSpread2(c._objectSpread2({},t),{},{resource:t.item,password:s}));case 2:i.eventBus.publish(L.openWithPanel,"sharing-item#linkShares");case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:return e.next=5,ct(c._objectSpread2(c._objectSpread2({},t),{},{resource:t.item}));case 5:i.eventBus.publish(L.openWithPanel,"sharing-item#linkShares");case 6:case"end":return e.stop()}}),e)}))),function(e){return pt.apply(this,arguments)}),displayed:dt}},mt={computed:{$_createQuicklink_items(){return[{name:"create-quicklink",icon:ht.quicklink.icon,iconFillType:ht.quicklink.iconFillType,label:()=>this.$gettext("Copy quicklink"),handler:this.$_createQuicklink_trigger,isEnabled:({resources:e})=>1===e.length&&((!o.isLocationSharesActive(this.$router,"files-shares-with-me")||e[0].status===s.ShareStatus.accepted)&&dt(e[0],this.$store)),componentType:"button",class:"oc-files-actions-create-quicklink-trigger"}]}},methods:{async $_createQuicklink_trigger({resources:e}){const t=this.$store,[s]=e;await ct({resource:s,storageId:this.space?.id||s?.fileId||s?.id,store:t,$gettext:this.$gettext}),i.eventBus.publish(L.openWithPanel,"sharing-item#linkShares")}}},ft={computed:c._objectSpread2(c._objectSpread2({},e.mapGetters("Files",["clipboardResources"])),{},{isMacOs:function(){return window.navigator.platform.match("Mac")},getPasteShortcutString:function(){return this.isMacOs?this.$pgettext("Keyboard shortcut for macOS for pasting files","⌘ + V"):this.$pgettext("Keyboard shortcut for non-macOS systems for pasting files","Ctrl + V")},$_paste_items:function(){var e=this;return[{name:"paste",icon:"clipboard",handler:this.$_paste_trigger,label:function(){return e.$pgettext("Action in the files list row to initiate pasting resources","Paste")},shortcut:this.getPasteShortcutString,isEnabled:function(t){var i=t.resources;return 0!==e.clipboardResources.length&&(!!(o.isLocationSpacesActive(e.$router,"files-spaces-generic")||o.isLocationPublicActive(e.$router,"files-public-link")||o.isLocationCommonActive(e.$router,"files-common-favorites"))&&(0!==i.length&&(!o.isLocationPublicActive(e.$router,"files-public-link")||e.currentFolder.canCreate())))},componentType:"button",class:"oc-files-actions-copy-trigger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapActions(["showMessage","createModal","hideModal"])),e.mapActions("Files",["pasteSelectedFiles"])),{},{$_paste_trigger:function(){this.pasteSelectedFiles({targetSpace:this.space,clientService:this.$clientService,createModal:this.createModal,hideModal:this.hideModal,showMessage:this.showMessage,$gettext:this.$gettext,$gettextInterpolate:this.$gettextInterpolate,$ngettext:this.$ngettext})}})},gt={mixins:[Be],computed:{$_showActions_items:function(){var e=this;return[{name:"show-actions",icon:"slideshow-3",label:function(){return e.$gettext("All Actions")},handler:this.$_showActions_trigger,isEnabled:function(t){var i=t.resources;return!!e.$_isFilesAppActive&&1===i.length},componentType:"button",class:"oc-files-actions-show-actions-trigger"}]}},methods:{$_showActions_trigger:function(){var e=o.isLocationTrashActive(this.$router,"files-trash-generic")?null:"actions-item";i.eventBus.publish(L.openWithPanel,e)}}},vt={setup:()=>({...n.useGraphClient()}),mixins:[Be],computed:{$_showDetails_items(){return[{name:"show-details",icon:"information",label:()=>this.$gettext("Details"),handler:this.$_showDetails_trigger,isEnabled:({resources:e})=>!!this.$_isFilesAppActive&&(!o.isLocationTrashActive(this.$router,"files-trash-generic")&&e.length>0),componentType:"button",class:"oc-files-actions-show-details-trigger"}]}},methods:{...e.mapMutations("Files",["SET_FILE_SELECTION"]),$_showDetails_trigger({resources:e}){this.SET_FILE_SELECTION(e),i.eventBus.publish(L.open)}}};const bt={name:"ContextActions",components:{ContextActionMenu:lt},mixins:[Ke,Ae,Pe,mt,Me,Ne,je,Ge,tt,He,We,ft,Qe,$e,Je,gt,vt,{mixins:[Be],computed:{$_showShares_items(){return[{name:"show-shares",icon:ht.collaborators.icon,iconFillType:ht.collaborators.iconFillType,label:()=>this.$gettext("Share"),handler:this.$_showShares_trigger,isEnabled:({resources:e})=>!!this.$_isFilesAppActive&&(!o.isLocationTrashActive(this.$router,"files-trash-generic")&&(1===e.length&&((!o.isLocationSharesActive(this.$router,"files-shares-with-me")||e[0].status===s.ShareStatus.accepted)&&dt(e[0],this.$store)))),componentType:"button",class:"oc-files-actions-show-shares-trigger"}]}},methods:{...e.mapMutations("Files",["SET_FILE_SELECTION"]),$_showShares_trigger({resources:e}){this.SET_FILE_SELECTION(e),i.eventBus.publish(L.openWithPanel,"sharing-item#peopleShares")}}},{computed:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapGetters(["configuration"])),e.mapState(["user"])),{},{$_setSpaceImage_items:function(){var e=this;return[{name:"set-space-image",icon:"image-edit",handler:this.$_setSpaceImage_trigger,label:function(){return e.$gettext("Set as space image")},isEnabled:function(t){var i=t.resources;return 1===i.length&&(!!i[0].mimeType&&(!!Ue.isMimetypeSupported(i[0].mimeType,!0)&&(!!o.isLocationSpacesActive(e.$router,"files-spaces-generic")&&(!!e.space&&e.space.canEditImage({user:e.user})))))},canBeDefault:!1,componentType:"button",class:"oc-files-actions-set-space-image-trigger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"])),e.mapActions(["showMessage"])),{},{$_setSpaceImage_trigger:function(e){var t=this;return c._asyncToGenerator(c._regeneratorRuntime().mark((function i(){var s,r,n,o,l,u,p,h,m,f,g;return c._regeneratorRuntime().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(r=e.resources,n=t.$store.getters["runtime/auth/accessToken"],o=d.clientService.graphAuthenticated(t.configuration.server,n),l=null===(s=t.space)||void 0===s?void 0:s.id,u=r[0].webDavPath,p="/spaces/".concat(l,"/.space/").concat(r[0].name),i.prev=6,u===p){i.next=10;break}return i.next=10,t.$client.files.copy(u,p);case 10:return i.next=12,t.$client.files.fileInfo(p);case 12:return h=i.sent,m=a.buildResource(h),i.next=16,o.drives.updateDrive(l,{special:[{specialFolder:{name:"image"},id:m.id}]},{});case 16:f=i.sent,g=f.data,t.UPDATE_SPACE_FIELD({id:l,field:"spaceImageData",value:g.special.find((function(e){return"image"===e.specialFolder.name}))}),t.showMessage({title:t.$gettext("Space image was set successfully")}),i.next=26;break;case 22:i.prev=22,i.t0=i.catch(6),console.error(i.t0),t.showMessage({title:t.$gettext("Failed to set space image"),status:"danger"});case 26:case"end":return i.stop()}}),i,null,[[6,22]])})))()}})},{computed:c._objectSpread2(c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapState("Files",["currentFolder"])),e.mapState("runtime/spaces",["spaces"])),e.mapState(["user"])),{},{$_setSpaceReadme_items:function(){var e=this;return[{name:"set-space-readme",icon:"markdown",handler:this.$_setSpaceReadme_trigger,label:function(){return e.$gettext("Set as space description")},isEnabled:function(t){var i,s=t.resources;return 1===s.length&&(!(null===(i=s[0].mimeType)||void 0===i||!i.startsWith("text/"))&&(!!o.isLocationSpacesActive(e.$router,"files-spaces-generic")&&(!!e.space&&e.space.canEditReadme({user:e.user}))))},canBeDefault:!1,componentType:"button",class:"oc-files-actions-set-space-readme-trigger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"])),e.mapActions(["showMessage"])),{},{$_setSpaceReadme_trigger:function(e){var t=this;return c._asyncToGenerator(c._regeneratorRuntime().mark((function i(){var s,a,r;return c._regeneratorRuntime().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return s=e.resources,i.prev=1,i.next=4,t.$client.files.getFileContents(s[0].webDavPath);case 4:return a=i.sent,i.next=7,t.$client.files.putFileContents("/spaces/".concat(t.space.id,"/.space/readme.md"),a);case 7:r=i.sent,t.UPDATE_SPACE_FIELD({id:t.space.id,field:"spaceReadmeData",value:c._objectSpread2(c._objectSpread2({},t.space.spaceReadmeData),{etag:null==r?void 0:r.ETag})}),t.showMessage({title:t.$gettext("Space description was set successfully")}),i.next=16;break;case 12:i.prev=12,i.t0=i.catch(1),console.error(i.t0),t.showMessage({title:t.$gettext("Failed to set space description"),status:"danger"});case 16:case"end":return i.stop()}}),i,null,[[1,12]])})))()}})},{computed:{$_navigate_space_items:function(){var e=this;return[{name:"navigate",icon:"layout-grid",label:function(){return e.$gettext("Navigate to space")},handler:this.$_navigate_space_trigger,isEnabled:function(t){var i;return!t.resources.length&&(!!o.isLocationTrashActive(e.$router,"files-trash-generic")&&"personal"!==(null===(i=e.space)||void 0===i?void 0:i.driveType))},componentType:"button",class:"oc-files-actions-navigate-trigger"}]}},methods:{$_navigate_space_trigger:function(){if(this.space)return this.$router.push(o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(this.space,{fileId:this.space.fileId})))}}}],props:{space:{type:Object,required:!0},items:{type:Array,required:!0}},computed:{menuSections(){const e=[];return this.items.length>1?(this.menuItemsBatchActions.length&&e.push({name:"batch-actions",items:[...this.menuItemsBatchActions]}),e.push({name:"batch-details",items:[...this.$_showDetails_items]}),e):(this.menuItemsContext.length&&e.push({name:"context",items:this.menuItemsContext}),this.menuItemsShare.length&&e.push({name:"share",items:this.menuItemsShare}),this.menuItemsActions.length&&e.push({name:"actions",items:this.menuItemsActions}),this.menuItemsSidebar.length&&e.push({name:"sidebar",items:this.menuItemsSidebar}),e)},filterParams(){return{space:this.space,resources:this.items}},menuItemsBatchActions(){return[...this.$_acceptShare_items,...this.$_declineShare_items,...this.$_downloadArchive_items,...this.$_delete_items,...this.$_move_items,...this.$_copy_items,...this.$_emptyTrashBin_items,...this.$_restore_items].filter((e=>e.isEnabled(this.filterParams)))},menuItemsContext(){return[...[...this.$_fileActions_editorActions,...this.$_fileActions_loadExternalAppActions(this.filterParams)]].filter((e=>e.isEnabled(this.filterParams))).sort(((e,t)=>Number(t.canBeDefault)-Number(e.canBeDefault)))},menuItemsShare(){return[...this.$_showShares_items,...this.$_createQuicklink_items].filter((e=>e.isEnabled(this.filterParams)))},menuItemsActions(){return[...this.$_downloadArchive_items,...this.$_downloadFile_items,...this.$_delete_items,...this.$_move_items,...this.$_copy_items,...this.$_paste_items,...this.$_rename_items,...this.$_restore_items,...this.$_acceptShare_items,...this.$_declineShare_items,...this.$_setSpaceImage_items,...this.$_setSpaceReadme_items,...this.$_navigate_space_items].filter((e=>e.isEnabled(this.filterParams)))},menuItemsSidebar(){const e=[...this.$_navigate_items];return[...this.$_favorite_items.map((e=>(e.keepOpen=!0,e))),...e,...this.$_showDetails_items].filter((e=>e.isEnabled(this.filterParams)))}}};var St=function(){var e=this,t=e.$createElement;return(e._self._c||t)("context-action-menu",{attrs:{"menu-sections":e.menuSections,items:e.items,space:e.space}})};St._withStripped=!0;const _t=e.normalizeComponent({render:St,staticRenderFns:[]},undefined,bt,undefined,false,undefined,!1,void 0,void 0,void 0);const yt={setup:function(){var i=e.getCurrentInstance().proxy.$gettext,s=t.useRouter(),a=[o.locationSharesWithMe,o.locationSharesWithOthers,o.locationSharesViaLink].reduce((function(e,t){return e[t.name]=s.getRoutes().find((function(e){return e.name===t.name})),e}),{}),r=Se(o.isLocationSharesActive,o.locationSharesWithMe.name),n=Se(o.isLocationSharesActive,o.locationSharesWithOthers.name),l=Se(o.isLocationSharesActive,o.locationSharesViaLink.name),c=e.computed((function(){return[{icon:"share-forward",to:a[o.locationSharesWithMe.name].path,text:i("Shared with me"),active:e.unref(r)},{icon:"reply",to:a[o.locationSharesWithOthers.name].path,text:i("Shared with others"),active:e.unref(n)},{icon:"link",to:a[o.locationSharesViaLink.name].path,text:i("Shared via link"),active:e.unref(l)}]}));return{currentNavItem:e.computed((function(){return e.unref(c).find((function(e){return e.active}))})),navItems:c}}};var wt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("nav",{staticClass:"oc-py-s",attrs:{id:"shares-navigation","aria-label":e.$gettext("Shares pages navigation")}},[i("oc-list",{staticClass:"oc-flex oc-visible@s"},e._l(e.navItems,(function(t){return i("li",{key:"shares-navigation-desktop-"+t.to},[i("oc-button",{staticClass:"oc-mr-m oc-py-s shares-nav-desktop",attrs:{type:"router-link",appearance:"raw",to:t.to}},[i("oc-icon",{attrs:{size:"small",name:t.icon}}),e._v(" "),i("span",{domProps:{textContent:e._s(t.text)}})],1)],1)})),0),e._v(" "),i("div",{staticClass:"oc-hidden@s"},[i("oc-button",{attrs:{id:"shares_navigation_mobile",appearance:"raw"}},[i("span",{domProps:{textContent:e._s(e.currentNavItem.text)}}),e._v(" "),i("oc-icon",{attrs:{name:"arrow-down-s","fill-type":"line",size:"small"}})],1),e._v(" "),i("oc-drop",{attrs:{toggle:"#shares_navigation_mobile",mode:"click","close-on-click":"","padding-size":"small"}},[i("oc-list",e._l(e.navItems,(function(t){return i("li",{key:"shares-navigation-mobile-"+t.to},[i("oc-button",{staticClass:"oc-my-xs shares-nav-mobile",class:{"oc-background-primary-gradient":t.active},attrs:{type:"router-link",appearance:"raw",to:t.to,variation:t.active?"inverse":"passive"}},[i("span",{staticClass:"icon-box",class:{"icon-box-active":t.active}},[i("oc-icon",{attrs:{name:t.icon}})],1),e._v(" "),i("span",{domProps:{textContent:e._s(t.text)}})])],1)})),0)],1)],1)],1)};wt._withStripped=!0;const xt=e.normalizeComponent({render:wt,staticRenderFns:[]},undefined,yt,"data-v-18dfdb62",false,undefined,!1,void 0,void 0,void 0);const Ct=e.defineComponent({props:{sideBarOpen:{type:Boolean,default:!1}},computed:{toggleSidebarButtonLabel(){return this.sideBarOpen?this.$gettext("Close sidebar to hide details"):this.$gettext("Open sidebar to view details")},toggleSidebarButtonIconFillType(){return this.sideBarOpen?"fill":"line"}},methods:{toggleSideBar(){i.eventBus.publish(L.toggle)}}});var kt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.toggleSidebarButtonLabel,expression:"toggleSidebarButtonLabel"}],staticClass:"oc-my-s oc-p-xs",attrs:{id:"files-toggle-sidebar","aria-label":e.toggleSidebarButtonLabel,appearance:"raw"},on:{click:function(t){return t.stopPropagation(),e.toggleSideBar.apply(null,arguments)}}},[i("oc-icon",{attrs:{name:"side-bar-right","fill-type":e.toggleSidebarButtonIconFillType}})],1)};kt._withStripped=!0;const Ft=e.normalizeComponent({render:kt,staticRenderFns:[]},undefined,Ct,"data-v-07154b45",false,undefined,!1,void 0,void 0,void 0);const Et={setup:function(){return{itemsPerPage:r.useRouteQueryPersisted({name:C.perPageQueryName,defaultValue:C.perPageDefault})}},computed:c._objectSpread2(c._objectSpread2({},e.mapState("Files",["areHiddenFilesShown","areFileExtensionsShown"])),{},{viewOptionsButtonLabel:function(){return this.$gettext("Display customization options of the files list")},hiddenFilesShownModel:{get:function(){return this.areHiddenFilesShown},set:function(e){this.SET_HIDDEN_FILES_VISIBILITY(e)}},fileExtensionsShownModel:{get:function(){return this.areFileExtensionsShown},set:function(e){this.SET_FILE_EXTENSIONS_VISIBILITY(e)}}}),methods:c._objectSpread2({},e.mapMutations("Files",["SET_HIDDEN_FILES_VISIBILITY","SET_FILE_EXTENSIONS_VISIBILITY"]))};var $t=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.viewOptionsButtonLabel,expression:"viewOptionsButtonLabel"}],key:"files-view-options-btn",staticClass:"oc-my-s oc-p-xs",attrs:{id:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":e.viewOptionsButtonLabel,appearance:"raw"}},[i("oc-icon",{attrs:{name:"settings-3","fill-type":"line"}})],1),e._v(" "),i("oc-drop",{staticClass:"oc-width-auto",attrs:{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click","padding-size":"medium"}},[i("oc-list",[i("li",{staticClass:"files-view-options-list-item oc-mb-m"},[i("oc-switch",{attrs:{"data-testid":"files-switch-hidden-files",label:e.$gettext("Show hidden files")},model:{value:e.hiddenFilesShownModel,callback:function(t){e.hiddenFilesShownModel=t},expression:"hiddenFilesShownModel"}})],1),e._v(" "),i("li",{staticClass:"files-view-options-list-item oc-my-m"},[i("oc-switch",{attrs:{"data-testid":"files-switch-files-extensions-files",label:e.$gettext("Show file extensions")},model:{value:e.fileExtensionsShownModel,callback:function(t){e.fileExtensionsShownModel=t},expression:"fileExtensionsShownModel"}})],1),e._v(" "),i("li",{staticClass:"files-view-options-list-item oc-mt-m"},[i("oc-page-size",{staticClass:"files-pagination-size",attrs:{"data-testid":"files-pagination-size",label:e.$gettext("Items per page"),options:[100,500]},model:{value:e.itemsPerPage,callback:function(t){e.itemsPerPage=t},expression:"itemsPerPage"}})],1)])],1)],1)};$t._withStripped=!0;const It=e.normalizeComponent({render:$t,staticRenderFns:[]},undefined,Et,"data-v-4224e29b",false,undefined,!1,void 0,void 0,void 0);const Tt=e.defineComponent({components:{BatchActions:rt,ContextActions:_t,SharesNavigation:xt,SidebarToggle:Ft,ViewOptions:It},mixins:[Ke],props:{breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasSharesNavigation:{type:Boolean,default:!1},hasSidebarToggle:{type:Boolean,default:!0},hasViewOptions:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},sideBarOpen:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{...e.mapGetters("Files",["files","selectedFiles"]),...e.mapState("Files",["areHiddenFilesShown","areFileExtensionsShown"]),pageTitle(){const e=this.$route.meta.title;return this.$gettext(e)},showContextActions(){return e.last(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedFiles.length>1||o.isLocationTrashActive(this.$router,"files-trash-generic"))},selectedResourcesAnnouncement(){if(0===this.selectedFiles.length)return this.$gettext("No items selected.");const e=this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedFiles.length);return this.$gettextInterpolate(e,{amount:this.selectedFiles.length})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar)},beforeDestroy(){this.resizeObserver.unobserve(this.$refs.filesAppBar)},created(){const e="true"===(window.localStorage.getItem("oc_hiddenFilesShown")||"false");e!==this.areHiddenFilesShown&&this.SET_HIDDEN_FILES_VISIBILITY(e);const t="true"===(window.localStorage.getItem("oc_fileExtensionsShown")||"true");t!==this.areFileExtensionsShown&&this.SET_FILE_EXTENSIONS_VISIBILITY(t)},methods:{...e.mapMutations("Files",["SET_HIDDEN_FILES_VISIBILITY","SET_FILE_EXTENSIONS_VISIBILITY"]),onResize(){this.limitedScreenSpace=this.sideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}});var Rt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"filesAppBar",class:{"files-app-bar-squashed":e.sideBarOpen},attrs:{id:"files-app-bar"}},[i("oc-hidden-announcer",{attrs:{announcement:e.selectedResourcesAnnouncement,level:"polite"}}),e._v(" "),i("div",{staticClass:"files-topbar oc-py-s"},[i("h1",{staticClass:"oc-invisible-sr",domProps:{textContent:e._s(e.pageTitle)}}),e._v(" "),i("div",{staticClass:"oc-flex",class:{"oc-flex-between":e.breadcrumbs.length||e.hasSharesNavigation,"oc-flex-right":!e.breadcrumbs.length&&!e.hasSharesNavigation}},[e.breadcrumbs.length?i("oc-breadcrumb",{staticClass:"oc-flex oc-flex-middle",attrs:{id:"files-breadcrumb","data-testid":"files-breadcrumbs","context-menu-padding":"small",items:e.breadcrumbs},scopedSlots:e._u([{key:"contextMenu",fn:function(){return[e.showContextActions?i("context-actions",{attrs:{space:e.space,items:e.breadcrumbsContextActionsItems.filter(Boolean)}}):e._e()]},proxy:!0}],null,!1,2371464158)}):e._e(),e._v(" "),e.hasSharesNavigation?i("shares-navigation"):e._e(),e._v(" "),e.hasViewOptions||e.hasSidebarToggle?i("div",{staticClass:"oc-flex"},[e.hasViewOptions?i("view-options"):e._e(),e._v(" "),e.hasSidebarToggle?i("sidebar-toggle",{attrs:{"side-bar-open":e.sideBarOpen}}):e._e()],1):e._e()],1),e._v(" "),i("div",{staticClass:"files-app-bar-actions oc-mt-xs"},[i("div",{staticClass:"oc-flex-1 oc-flex oc-flex-start"},[!e.selectedFiles.length||e.showActionsOnSelection&&1===e.selectedFiles.length?e._t("actions",null,{limitedScreenSpace:e.limitedScreenSpace}):e._e(),e._v(" "),e.showBatchActions?i("batch-actions",{attrs:{"show-tooltips":e.limitedScreenSpace,space:e.space}}):e._e()],2)]),e._v(" "),e._t("content")],2)],1)};Rt._withStripped=!0;const Lt=e.normalizeComponent({render:Rt,staticRenderFns:[]},undefined,Tt,"data-v-515063b3",false,undefined,!1,void 0,void 0,void 0);const Dt=e.defineComponent({name:"QuickActions",props:{actions:{type:Object,required:!0},item:{type:Object,required:!0}},computed:{filteredActions(){return e.pickBy(this.actions,(e=>!0===e.displayed(this.item,this.$store)))}}});var At=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex"},e._l(e.filteredActions,(function(t){return i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:t.label(e.$gettext),expression:"action.label($gettext)"}],key:t.label(e.$gettext),staticClass:"oc-mr-xs quick-action-button oc-p-xs",class:"files-quick-action-"+t.id,attrs:{"aria-label":t.label(e.$gettext),appearance:"raw"},on:{click:function(i){return t.handler({item:e.item,client:e.$client,store:e.$store,$gettext:e.$gettext})}}},[i("oc-icon",{attrs:{name:t.icon,"fill-type":"line"}})],1)})),1)};At._withStripped=!0;const Pt=e.normalizeComponent({render:At,staticRenderFns:[]},undefined,Dt,undefined,false,undefined,!1,void 0,void 0,void 0);const Mt={props:{files:{type:Number,required:!0},folders:{type:Number,required:!0},size:{type:[String,Number],required:!1,default:null}},computed:{items:function(){return this.files+this.folders},text:function(){var e=this.$gettextInterpolate(this.$ngettext("%{ filesCount } file","%{ filesCount } files",this.files),{filesCount:this.files}),t=this.$gettextInterpolate(this.$ngettext("%{ foldersCount } folder","%{ foldersCount } folders",this.folders),{foldersCount:this.folders}),i=r.formatFileSize(this.size,this.$language.current),s=this.size>0?this.$ngettext("%{ itemsCount } item with %{ itemSize } in total (%{ filesStr}, %{foldersStr})","%{ itemsCount } items with %{ itemSize } in total (%{ filesStr}, %{foldersStr})",this.items):this.$ngettext("%{ itemsCount } item in total (%{ filesStr}, %{foldersStr})","%{ itemsCount } items in total (%{ filesStr}, %{foldersStr})",this.items);return this.$gettextInterpolate(s,{itemsCount:this.items,itemSize:i,filesStr:e,foldersStr:t})}}};var Ot=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-text-nowrap oc-text-center"},[i("p",{staticClass:"oc-text-muted",attrs:{"data-testid":"files-list-footer-info","data-test-items":e.items,"data-test-files":e.files,"data-test-folders":e.folders,"data-test-size":e.size}},[e._v("\n "+e._s(e.text)+"\n ")])])};Ot._withStripped=!0;const Nt=e.normalizeComponent({render:Ot,staticRenderFns:[]},undefined,Mt,undefined,false,undefined,!1,void 0,void 0,void 0);const Bt={props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){var e;null===(e=document.getElementsByClassName("files-view-wrapper")[0])||void 0===e||e.scrollTo(0,0)}}}};var zt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.pages>1?i("oc-pagination",{staticClass:"files-pagination oc-flex oc-flex-center oc-my-s",attrs:{pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route}}):e._e()};zt._withStripped=!0;const Ut=e.normalizeComponent({render:zt,staticRenderFns:[]},undefined,Bt,undefined,false,undefined,!1,void 0,void 0,void 0);const qt={name:"PrivateLinkItem",inject:["displayedItem"],data:function(){return{copied:!1,timeout:null}},computed:{buttonText:function(){return this.$gettext("Private link")},buttonLabel:function(){return this.$gettext("Copy private link to clipboard")}},methods:c._objectSpread2(c._objectSpread2({},e.mapActions(["showMessage"])),{},{copyPrivateLinkToClipboard:function(){e.copyToClipboard(e.unref(this.displayedItem).privateLink),this.clipboardSuccessHandler(),this.showMessage({title:this.$gettext("Private link copied"),desc:this.$gettext("The private link has been copied to your clipboard.")})},clipboardSuccessHandler:function(){var e=this;this.copied=!0,clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.copied=!1}),550)}})};var jt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.buttonLabel,expression:"buttonLabel"}],staticClass:"oc-files-private-link-copy-url",attrs:{appearance:"raw","aria-label":e.buttonLabel,variation:e.copied?"success":"passive"},on:{click:e.copyPrivateLinkToClipboard}},[i("span",{domProps:{textContent:e._s(e.buttonText)}}),e._v(" "),e.copied?i("oc-icon",{key:"oc-copy-to-clipboard-copied",staticClass:"_clipboard-success-animation",attrs:{name:"checkbox-circle"}}):i("oc-icon",{key:"oc-copy-to-clipboard-copy",attrs:{name:"clipboard"}})],1)};jt._withStripped=!0;const Vt={name:"FileInfo",components:{PrivateLinkItem:e.normalizeComponent({render:jt,staticRenderFns:[]},undefined,qt,undefined,false,undefined,!1,void 0,void 0,void 0)},props:{isSubPanelActive:{type:Boolean,default:!0}},computed:c._objectSpread2(c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapGetters(["capabilities"])),e.mapGetters("Files",["highlightedFile"])),e.mapState("Files",["areFileExtensionsShown"])),{},{privateLinkEnabled:function(){var e,t;return(null===(e=this.capabilities.files_sharing)||void 0===e||null===(t=e.public)||void 0===t||!t.alias)&&(this.capabilities.files.privateLinks&&this.file.privateLink)},file:function(){return this.highlightedFile}})};var Gt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"file_info oc-flex oc-flex-between"},[i("div",{staticClass:"oc-flex oc-flex-middle"},[e.isSubPanelActive?i("oc-resource-icon",{staticClass:"file_info__icon oc-mr-s",attrs:{resource:e.file,size:"large"}}):e._e(),e._v(" "),i("div",{staticClass:"file_info__body oc-text-overflow"},[i("h3",{attrs:{"data-testid":"files-info-name"}},[i("oc-resource-name",{attrs:{name:e.file.name,extension:e.file.extension,type:e.file.type,"full-path":e.file.webDavPath,"is-extension-displayed":e.areFileExtensionsShown,"is-path-displayed":!1,"truncate-name":!1}})],1)])],1),e._v(" "),e.privateLinkEnabled?i("private-link-item",{staticClass:"oc-ml-s"}):e._e()],1)};Gt._withStripped=!0;const Ht=e.normalizeComponent({render:Gt,staticRenderFns:[]},undefined,Vt,undefined,false,undefined,!1,void 0,void 0,void 0);const Wt={name:"SpaceInfo",computed:c._objectSpread2(c._objectSpread2({},e.mapGetters("Files",["highlightedFile"])),{},{space:function(){return this.highlightedFile}})};var Qt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"space_info"},[i("div",{staticClass:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},[i("div",{staticClass:"oc-mr-s"},[i("oc-icon",{staticClass:"oc-display-block",attrs:{name:"layout-grid",size:e.space.description?"large":"medium"}})],1),e._v(" "),i("div",[i("h3",{attrs:{"data-testid":"space-info-name"},domProps:{textContent:e._s(e.space.name)}}),e._v(" "),i("span",{attrs:{"data-testid":"space-info-subtitle"},domProps:{textContent:e._s(e.space.description)}})])])])};Qt._withStripped=!0;const Jt=e.normalizeComponent({render:Qt,staticRenderFns:[]},undefined,Wt,undefined,false,undefined,!1,void 0,void 0,void 0);const Yt=e.defineComponent({components:{FileInfo:Ht,SpaceInfo:Jt,SideBar:h.__vue_component__},provide(){return{displayedItem:e.computed((()=>this.selectedFile)),activePanel:e.computed((()=>this.activePanel)),displayedSpace:e.computed((()=>this.space))}},props:{open:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(){const e=i.useStore(),s=(e,t)=>{e.focus({from:document.activeElement,to:e.sidebar?.$el,revert:"beforeDestroy"===t})},{webdav:a}=n.useClientService();return{...n.useGraphClient(),isSharedWithMeLocation:Se(o.isLocationSharesActive,"files-shares-with-me"),isSharedWithOthersLocation:Se(o.isLocationSharesActive,"files-shares-with-others"),isSharedViaLinkLocation:Se(o.isLocationSharesActive,"files-shares-via-link"),isFavoritesLocation:Se(o.isLocationCommonActive,"files-common-favorites"),isSearchLocation:Se(o.isLocationCommonActive,"files-common-search"),isPublicFilesLocation:Se(o.isLocationPublicActive,"files-public-link"),isTrashLocation:Se(o.isLocationTrashActive,"files-trash-generic"),hasShareJail:t.useCapabilityShareJailEnabled(),publicLinkPassword:m.usePublicLinkPassword({store:e}),setActiveSideBarPanel:e=>{i.eventBus.publish(L.setActivePanel,e)},closeSideBar:()=>{i.eventBus.publish(L.close)},destroySideBar:(e,t)=>{s(e,t),i.eventBus.publish(L.close)},focusSideBar:s,webdav:a}},data:()=>({focused:void 0,oldPanelName:null,selectedFile:{},loading:!1}),computed:{...e.mapGetters("Files",["highlightedFile","selectedFiles","currentFolder"]),...e.mapGetters(["fileSideBars","capabilities"]),...e.mapGetters("runtime/spaces",["spaces"]),...e.mapState(["user"]),availablePanels(){const{panels:e}=this.fileSideBars.reduce(((e,t)=>{const i=t({capabilities:this.capabilities,highlightedFile:this.highlightedFile,route:this.$route,router:this.$router,multipleSelection:this.areMultipleSelected,rootFolder:this.isRootFolder,user:this.user});return i.enabled&&e.panels.push(i),e}),{panels:[]});return e},isShareAccepted(){return 0===this.highlightedFile?.status},isContentDisplayed(){return!o.isLocationSharesActive(this.$router,"files-shares-with-me")||this.isShareAccepted},warningMessage(){return this.isShareAccepted?null:this.$gettext("Please, accept this share first to display available actions")},isSingleResource(){return!this.areMultipleSelected&&(!this.isRootFolder||this.highlightedFileIsSpace)},areMultipleSelected(){return this.selectedFiles&&this.selectedFiles.length>1},isRootFolder(){const e=this.highlightedFile?.path?.split("/").filter(Boolean)||[];return this.isSharedWithMeLocation||this.isSearchLocation?!this.highlightedFile:(!this.hasShareJail||"share"!==this.space?.driveType)&&(!(!this.isTrashLocation||this.highlightedFile?.id)||!e.length)},highlightedFileIsSpace(){return"space"===this.highlightedFile?.type},sharesLoadingDisabledOnCurrentRoute(){return this.isPublicFilesLocation||this.isTrashLocation},isShareLocation(){return this.isSharedWithMeLocation||this.isSharedWithOthersLocation||this.isSharedViaLinkLocation}},watch:{highlightedFile:{handler(t,i){if(!this.isSingleResource||!this.highlightedFile)return;const s=i&&e.isEqual(t,i);!(s||this.sharesLoadingDisabledOnCurrentRoute||!i&&this.currentFolder)&&this.loadShares(),a.isProjectSpaceResource(this.highlightedFile)&&this.loadSpaceMembers({graphClient:this.graphClient,space:this.highlightedFile}),!this.isShareLocation&&s||this.fetchFileInfo()},deep:!0}},methods:{...e.mapActions("Files",["loadSharesTree"]),...e.mapActions("runtime/spaces",["loadSpaceMembers"]),async fetchFileInfo(){if(this.loading=!0,!this.isShareLocation)return this.selectedFile={...this.highlightedFile},void(this.loading=!1);try{this.selectedFile=await this.webdav.getFileInfo(this.space,{path:this.highlightedFile.path})}catch(e){this.selectedFile={...this.highlightedFile},console.error(e)}this.loading=!1},loadShares(){this.loadSharesTree({client:this.$client,path:this.highlightedFile.path,storageId:this.highlightedFile.fileId,includeRoot:!0,useCached:!(this.isSharedWithMeLocation||this.isSharedWithOthersLocation||this.isSharedViaLinkLocation||this.isSearchLocation||this.isFavoritesLocation)})}}});var Kt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.open?i("SideBar",e._g(e._b({ref:"sidebar",staticClass:"files-side-bar",attrs:{tabindex:"-1",open:e.open,"active-panel":e.activePanel,"available-panels":e.availablePanels,"warning-message":e.warningMessage,"is-content-displayed":e.isContentDisplayed,loading:e.loading,"is-header-compact":e.isSingleResource,"data-custom-key-bindings":"true"},on:{beforeDestroy:e.destroySideBar,mounted:e.focusSideBar,fileChanged:e.focusSideBar,selectPanel:e.setActiveSideBarPanel,close:e.closeSideBar},scopedSlots:e._u([{key:"header",fn:function(){return[e.highlightedFile&&e.isSingleResource&&!e.highlightedFileIsSpace?i("file-info",{staticClass:"sidebar-panel__file_info",attrs:{"is-sub-panel-active":!!e.activePanel}}):e._e(),e._v(" "),e.isSingleResource&&e.highlightedFileIsSpace?i("space-info",{staticClass:"sidebar-panel__space_info"}):e._e()]},proxy:!0}],null,!1,2548287437)},"SideBar",e.$attrs,!1),e.$listeners)):e._e()};Kt._withStripped=!0;const Zt=e.normalizeComponent({render:Kt,staticRenderFns:[]},undefined,Yt,undefined,false,undefined,!1,void 0,void 0,void 0);const Xt=e.defineComponent({inheritAttrs:!1});var ei=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"files-view-wrapper oc-width-expand"},[i("div",e._b({attrs:{id:"files-view"}},"div",e.$attrs,!1),[e._t("default")],2)])};ei._withStripped=!0;const ti=e.normalizeComponent({render:ei,staticRenderFns:[]},undefined,Xt,"data-v-3d80ab9a",false,undefined,!1,void 0,void 0,void 0),ii=new i.VisibilityObserver;const si=e.defineComponent({components:{FilesViewWrapper:ti,AppBar:Lt,ResourceTable:Le,QuickActions:Pt,AppLoadingSpinner:p.__vue_component__,Pagination:Ut,NoContentMessage:h.__vue_component__$1,ListInfo:Nt,ContextActions:_t,SideBar:Zt},mixins:[Ke],setup(){const e=i.useStore();return{...be(),getSpace:t=>{const s=t.storageId,r=e.getters["runtime/spaces/spaces"].find((e=>e.id===s));return r||a.buildShareSpaceResource({shareId:t.shareId,shareName:t.name,serverUrl:i.configurationManager.serverUrl})}}},computed:{...e.mapState(["app"]),...e.mapState("Files",["files"]),...e.mapGetters("Files",["highlightedFile","totalFilesCount","totalFilesSize"]),...e.mapGetters(["user","configuration"]),isEmpty(){return this.paginatedResources.length<1},displayThumbnails(){return!this.configuration?.options?.disablePreviews}},created(){this.loadResourcesTask.perform()},beforeDestroy(){ii.disconnect()},methods:{...e.mapActions("Files",["loadPreview"]),rowMounted(t,i){if(!this.displayThumbnails)return;const s=e.debounce((({unobserve:e})=>{e(),this.loadPreview({resource:t,isPublic:!1,dimensions:w.Thumbnail,type:x.Thumbnail})}),250);ii.observe(i.$el,{onEnter:s,onExit:s.cancel})}}});var ai=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex"},[i("files-view-wrapper",[i("app-bar",{attrs:{"side-bar-open":e.sideBarOpen}}),e._v(" "),e.areResourcesLoading?i("app-loading-spinner"):[e.isEmpty?i("no-content-message",{staticClass:"files-empty",attrs:{id:"files-favorites-empty",icon:"star"},scopedSlots:e._u([{key:"message",fn:function(){return[i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("There are no resources marked as favorite")])]},proxy:!0}],null,!1,2464274424)}):i("resource-table",{staticClass:"files-table",class:{"files-table-squashed":e.sideBarOpen},attrs:{id:"files-favorites-table","are-paths-displayed":!0,"are-thumbnails-displayed":e.displayThumbnails,resources:e.paginatedResources,"header-position":e.fileListHeaderY,"sort-by":e.sortBy,"sort-dir":e.sortDir},on:{fileClick:e.$_fileActions_triggerDefaultAction,rowMounted:e.rowMounted,sort:e.handleSort},scopedSlots:e._u([{key:"quickActions",fn:function(t){return[i("quick-actions",{staticClass:"oc-visible@s",attrs:{item:t.resource,actions:e.app.quickActions}})]}},{key:"contextMenu",fn:function(t){var s=t.resource;return[e.isResourceInSelection(s)?i("context-actions",{attrs:{items:e.selectedResources,space:e.getSpace(s)}}):e._e()]}},{key:"footer",fn:function(){return[i("pagination",{attrs:{pages:e.paginationPages,"current-page":e.paginationPage}}),e._v(" "),e.paginatedResources.length>0?i("list-info",{staticClass:"oc-width-1-1 oc-my-s",attrs:{files:e.totalFilesCount.files,folders:e.totalFilesCount.folders,size:e.totalFilesSize}}):e._e()]},proxy:!0}]),model:{value:e.selectedResourcesIds,callback:function(t){e.selectedResourcesIds=t},expression:"selectedResourcesIds"}})]],2),e._v(" "),i("side-bar",{attrs:{open:e.sideBarOpen,"active-panel":e.sideBarActivePanel,space:e.selectedResourceSpace}})],1)};ai._withStripped=!0;const ri=e.normalizeComponent({render:ai,staticRenderFns:[]},undefined,si,undefined,false,undefined,!1,void 0,void 0,void 0);const ni={props:{btnLabel:{type:String,required:!1,default:""},btnClass:{type:String,required:!1,default:""},isFolder:{type:Boolean,required:!1,default:!1}},computed:{inputId:function(){return this.isFolder?"files-folder-upload-input":"files-file-upload-input"},uploadLabelId:function(){return this.isFolder?"files-folder-upload-button":"files-file-upload-button"},buttonLabel:function(){return this.btnLabel?this.btnLabel:this.isFolder?this.$gettext("Folder"):this.$gettext("Files")},inputAttrs:function(){return this.isFolder?{webkitdirectory:!0,mozdirectory:!0,allowdirs:!0}:{multiple:!0}}},mounted:function(){this.$uppyService.registerUploadInput(this.$refs.input)},beforeDestroy:function(){this.$uppyService.removeUploadInput(this.$refs.input)},methods:{triggerUpload:function(){this.$refs.input.click()}}};var oi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("oc-button",{class:e.btnClass,attrs:{"justify-content":"left",appearance:"raw"},on:{click:e.triggerUpload}},[i("oc-resource-icon",{attrs:{resource:{extension:"",isFolder:e.isFolder},size:"medium"}}),e._v(" "),i("span",{attrs:{id:e.uploadLabelId}},[e._v(e._s(e.buttonLabel))])],1),e._v(" "),i("input",e._b({ref:"input",staticClass:"upload-input-target",attrs:{id:e.inputId,type:"file","aria-labelledby":e.uploadLabelId,name:e.isFolder?"file":"folder",tabindex:"-1"}},"input",e.inputAttrs,!1))],1)};oi._withStripped=!0;const li=e.normalizeComponent({render:oi,staticRenderFns:[]},undefined,ni,"data-v-f9430d86",false,undefined,!1,void 0,void 0,void 0);function ci(s){const a=i.useStore(),r=n.useClientService(),o=m.usePublicLinkPassword({store:a}),l=m.usePublicLinkContext({store:a}),c=n.useAccessToken({store:a}),d=t.useCapabilityFilesTusSupportHttpMethodOverride(),u=t.useCapabilityFilesTusSupportMaxChunkSize(),p=t.useCapabilityFilesTusExtension(),h=e.computed((()=>{const t={"X-Request-ID":e.v4()};if(e.unref(l)){const i=e.unref(o);return i?{...t,Authorization:"Basic "+e.Buffer.from("public:"+i).toString("base64")}:t}return{...t,Authorization:"Bearer "+e.unref(c)}})),f=e.computed((()=>{const t=e.unref(u)>0;return{isTusSupported:t,onBeforeRequest:t=>{t.setHeader("Authorization",e.unref(h).Authorization),t.setHeader("X-Request-ID",e.unref(h)["X-Request-ID"])},headers:t=>({"x-oc-mtime":t.data.lastModified/1e3,...e.unref(h)}),...t&&{tusMaxChunkSize:e.unref(u),tusHttpMethodOverride:e.unref(d),tusExtension:e.unref(p)},...!t&&{xhrTimeout:a.getters.configuration?.options?.upload?.xhr?.timeout||6e4}}}));return e.watch(f,(()=>{e.unref(f).isTusSupported?s.uppyService.useTus(e.unref(f)):s.uppyService.useXhr(e.unref(f))}),{immediate:!0}),{createDirectoryTree:di({clientService:r,uppyService:s.uppyService})}}const di=({clientService:t,uppyService:i})=>async(s,a,r,n)=>{const{webdav:o}=t,l=[],c=[];for(const t of r){const r=t.meta.relativeFolder;if(!r||l.includes(r))continue;const d=r.split("/");let u="";for(const r of d){if(!r)continue;const d=`${u}/${r}`;if(l.includes(d)){u+=`/${r}`,l.push(u);continue}if(c.includes(d))break;const p=u?e.v4():t.meta.topLevelFolderId,h={id:e.v4(),name:r,isFolder:!0,type:"folder",meta:{spaceId:s.id,spaceName:s.name,driveAlias:s.driveAlias,driveType:s.driveType,currentFolder:a,currentFolderId:n,relativeFolder:u,uploadId:p,routeName:t.meta.routeName,routeDriveAliasAndItem:t.meta.routeDriveAliasAndItem,routeShareId:t.meta.routeShareId}};i.publish("addedForUpload",[h]);try{const t=await o.createFolder(s,{path:e.join(a,d)});i.publish("uploadSuccess",{...h,meta:{...h.meta,fileId:t?.fileId}}),u+=`/${r}`,l.push(u)}catch(e){console.error(e),c.push(d),i.publish("uploadError",{file:h,error:e})}}}return{successful:l,failed:c}};const ui=e.defineComponent({components:{ResourceUpload:li},setup(){const t=e.getCurrentInstance().proxy,s=t.$uppyService,a=i.useStore();return e.onMounted((()=>{const e=s.subscribe("filesSelected",t.onFilesSelected);s.useDropTarget({targetSelector:"#files-drop-container",uppyService:s}),t.$on("beforeDestroy",(()=>{s.unsubscribe("filesSelected",e),s.removeDropTarget()}))})),{...ci({uppyService:s}),publicLinkPassword:m.usePublicLinkPassword({store:a})}},data:()=>({loading:!0,errorMessage:null,dragareaEnabled:!1}),computed:{...e.mapGetters(["configuration"]),pageTitle(){return this.$gettext(this.$route.meta.title)},publicLinkToken(){return this.$route.params.token},title(){if(this.share){const e=this.$gettext("%{owner} shared this folder with you for uploading");return this.$gettextInterpolate(e,{owner:this.share.getProperty(this.$client.publicFiles.PUBLIC_LINK_SHARE_OWNER)},!0)}return""},url(){return this.$client.publicFiles.getFileUrl(this.publicLinkToken)+"/"}},mounted(){const e=i.eventBus.subscribe("drag-over",this.onDragOver),t=i.eventBus.subscribe("drag-out",this.hideDropzone),s=i.eventBus.subscribe("drop",this.hideDropzone);this.$on("beforeDestroy",(()=>{i.eventBus.unsubscribe("drag-over",e),i.eventBus.unsubscribe("drag-out",t),i.eventBus.unsubscribe("drop",s)})),this.resolvePublicLink()},methods:{...e.mapActions(["showMessage"]),hideDropzone(){this.dragareaEnabled=!1},onDragOver(e){this.dragareaEnabled=(e.dataTransfer.types||[]).some((e=>"Files"===e))},resolvePublicLink(){this.loading=!0,this.$client.publicFiles.list(this.publicLinkToken,this.publicLinkPassword,s.DavProperties.PublicLink,"0").then((e=>{const t=parseInt(e[0].getProperty(s.DavProperty.PublicLinkPermission));s.linkRoleUploaderFolder.bitmask(!1)===t?this.share=e[0]:this.$router.replace(o.createLocationPublic("files-public-link",{params:{driveAliasAndItem:`public/${this.publicLinkToken}`}}))})).catch((e=>{if(401===e.statusCode)return this.$authService.handleAuthError(this.$router.currentRoute);console.error(e),this.errorMessage=e})).finally((()=>{this.loading=!1}))},onFilesSelected(t){this.$uppyService.publish("uploadStarted");const i=t.map((t=>({source:"FileDrop",name:t.name,type:t.type,data:t,meta:{tusEndpoint:this.url,relativePath:t.webkitRelativePath||t.relativePath||"",uploadId:e.v4()}})));this.$uppyService.publish("addedForUpload",i),this.$uppyService.uploadFiles(i)}}});var pi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-height-1-1 oc-flex oc-flex-column oc-flex-between",attrs:{id:"files-drop-container"}},[e.dragareaEnabled?i("div",{staticClass:"dragarea"}):e._e(),e._v(" "),i("h1",{staticClass:"oc-invisible-sr"},[e._v(e._s(e.pageTitle))]),e._v(" "),i("div",{staticClass:"oc-p oc-height-1-1"},[e.loading?i("div",{key:"loading-drop",staticClass:"oc-flex oc-flex-column oc-flex-middle"},[i("h2",{staticClass:"oc-login-card-title"},[i("translate",[e._v("Loading public link…")])],1),e._v(" "),i("oc-spinner",{attrs:{"aria-hidden":!0}})],1):i("div",{key:"loaded-drop",staticClass:"oc-flex oc-flex-column oc-flex-middle oc-height-1-1"},[i("div",{staticClass:"oc-text-center oc-width-1-1 oc-width-xxlarge@m"},[i("h2",{domProps:{textContent:e._s(e.title)}}),e._v(" "),i("resource-upload",{ref:"fileUpload",staticClass:"oc-flex oc-flex-middle oc-flex-center oc-placeholder",attrs:{id:"files-drop-zone","btn-label":e.$gettext("Drop files here to upload or click to select file")}}),e._v(" "),i("div",{attrs:{id:"previews",hidden:""}})],1),e._v(" "),e.errorMessage?i("div",{staticClass:"oc-text-center"},[i("h2",[i("translate",[e._v("An error occurred while loading the public link")])],1),e._v(" "),i("p",{staticClass:"oc-m-rm",domProps:{textContent:e._s(e.errorMessage)}})]):e._e()])]),e._v(" "),i("div",{staticClass:"oc-text-center"},[i("p",{domProps:{textContent:e._s(e.configuration.currentTheme.general.slogan)}})])])};pi._withStripped=!0;const hi=e.normalizeComponent({render:pi,staticRenderFns:[]},undefined,ui,undefined,false,undefined,!1,void 0,void 0,void 0),mi=new i.VisibilityObserver;const fi=e.defineComponent({components:{ResourceTable:Le,ContextActions:_t,ListInfo:Nt,NoContentMessage:h.__vue_component__$1},mixins:[Ke,Ae,Me],props:{title:{type:String,required:!0},emptyMessage:{type:String,required:!1,default:""},items:{type:Array,required:!0},shareStatus:{type:Number,required:!0},sortBy:{type:String,required:!1,default:void 0},sortDir:{type:String,required:!1,default:void 0,validator:e=>void 0===e||[oe.Asc.toString(),oe.Desc.toString()].includes(e)},sortHandler:{type:Function,required:!0},showMoreToggle:{type:Boolean,default:!1},showMoreToggleCount:{type:Number,default:3},resourceClickable:{type:Boolean,default:!0},displayThumbnails:{type:Boolean,default:!0},sideBarOpen:{type:Boolean,default:!1},fileListHeaderY:{type:Number,default:0}},setup(){const s=i.useStore(),r=t.useCapabilityShareJailEnabled(),n=e.computed((()=>s.getters["runtime/spaces/spaces"].find((e=>"personal"===e.driveType))));return{resourceTargetRouteCallback:({path:n,fileId:l,resource:c})=>{if(e.unref(r)){const e=a.buildShareSpaceResource({shareId:c.id,shareName:c.name,serverUrl:i.configurationManager.serverUrl});return o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(e,{path:n,fileId:l}))}const d=s.getters["runtime/spaces/spaces"].find((e=>"personal"===e.driveType));return o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(d,{path:n,fileId:l}))},...ve({store:s}),hasShareJail:t.useCapabilityShareJailEnabled(),personalSpace:n}},data:()=>({ShareStatus:s.ShareStatus,showMore:!1}),computed:{...e.mapGetters(["configuration"]),displayedFields:()=>["name","status","owner","sdate","sharedWith"],countFiles(){return this.items.filter((e=>"folder"!==e.type)).length},countFolders(){return this.items.filter((e=>"folder"===e.type)).length},toggleMoreLabel(){return this.showMore?this.$gettext("Show less"):this.$gettext("Show more")},hasMore(){return this.items.length>this.showMoreToggleCount},resourceItems(){return!this.showMoreToggle||this.showMore?this.items:this.items.slice(0,this.showMoreToggleCount)}},beforeDestroy(){mi.disconnect()},methods:{...e.mapActions("Files",["loadIndicators","loadPreview","loadAvatars"]),...e.mapMutations("Files",["LOAD_FILES","CLEAR_CURRENT_FILES_LIST"]),rowMounted(t,i){const s=e.debounce((({unobserve:e})=>{e(),this.loadAvatars({resource:t}),this.displayThumbnails&&this.loadPreview({resource:t,isPublic:!1,dimensions:w.Thumbnail,type:x.Thumbnail})}),250);mi.observe(i.$el,{onEnter:s,onExit:s.cancel})},getShowAcceptButton:e=>e.status===s.ShareStatus.declined||e.status===s.ShareStatus.pending,getShowDeclineButton:e=>e.status===s.ShareStatus.accepted||e.status===s.ShareStatus.pending,toggleShowMore(){this.showMore=!this.showMore},createShareSpace(e){return this.hasShareJail?a.buildShareSpaceResource({shareId:e.shareId,shareName:e.name,serverUrl:i.configurationManager.serverUrl}):this.personalSpace}}});var gi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("h2",{staticClass:"oc-px-m oc-py-s"},[e._v("\n "+e._s(e.title)+"\n "),i("span",{staticClass:"oc-text-medium"},[e._v("("+e._s(e.items.length)+")")])]),e._v(" "),e.items.length?i("resource-table",{staticClass:"files-table",class:{"files-table-squashed":e.sideBarOpen},attrs:{"data-test-share-status":e.shareStatus,"fields-displayed":e.displayedFields,"sidebar-closed":"","are-thumbnails-displayed":e.displayThumbnails,resources:e.resourceItems,"are-resources-clickable":e.resourceClickable,"target-route-callback":e.resourceTargetRouteCallback,"header-position":e.fileListHeaderY,"sort-by":e.sortBy,"sort-dir":e.sortDir},on:{fileClick:e.$_fileActions_triggerDefaultAction,rowMounted:e.rowMounted,sort:e.sortHandler},scopedSlots:e._u([{key:"status",fn:function(t){var s=t.resource;return[i("div",{key:s.getDomSelector()+s.status,staticClass:"oc-text-nowrap oc-flex oc-flex-middle oc-flex-right"},[e.getShowAcceptButton(s)?i("oc-button",{staticClass:"file-row-share-status-accept",attrs:{size:"small",variation:"success"},on:{click:function(t){return t.stopPropagation(),e.$_acceptShare_trigger({resources:[s]})}}},[i("oc-icon",{attrs:{size:"small",name:"check"}}),e._v(" "),i("translate",[e._v("Accept")])],1):e._e(),e._v(" "),e.getShowDeclineButton(s)?i("oc-button",{staticClass:"file-row-share-decline oc-ml-s",attrs:{size:"small"},on:{click:function(t){return t.stopPropagation(),e.$_declineShare_trigger({resources:[s]})}}},[i("oc-icon",{attrs:{size:"small",name:"spam-3","fill-type":"line"}}),e._v(" "),i("translate",[e._v("Decline")])],1):e._e()],1)]}},{key:"contextMenu",fn:function(t){var s=t.resource;return[e.isResourceInSelection(s)?i("context-actions",{attrs:{items:e.selectedResources,space:e.createShareSpace(s)}}):e._e()]}},{key:"footer",fn:function(){return[e.showMoreToggle&&e.hasMore?i("div",{staticClass:"oc-width-1-1 oc-text-center oc-mt"},[i("oc-button",{attrs:{id:"files-shared-with-me-show-all",appearance:"raw","gap-size":"xsmall",size:"small","data-test-expand":(!e.showMore).toString()},on:{click:e.toggleShowMore}},[e._v("\n "+e._s(e.toggleMoreLabel)+"\n "),i("oc-icon",{attrs:{name:"arrow-"+(e.showMore?"up":"down")+"-s","fill-type":"line"}})],1)],1):i("list-info",{staticClass:"oc-width-1-1 oc-my-s",attrs:{files:e.countFiles,folders:e.countFolders}})]},proxy:!0}]),model:{value:e.selectedResourcesIds,callback:function(t){e.selectedResourcesIds=t},expression:"selectedResourcesIds"}}):i("no-content-message",{staticClass:"files-empty oc-flex-stretch",attrs:{icon:"group"},scopedSlots:e._u([{key:"message",fn:function(){return[i("span",[e._v(e._s(e.emptyMessage))])]},proxy:!0}],null,!1,1699937534)})],1)};gi._withStripped=!0;const vi=e.normalizeComponent({render:gi,staticRenderFns:[]},undefined,fi,"data-v-04372fdc",false,undefined,!1,void 0,void 0,void 0);const bi=e.defineComponent({components:{FilesViewWrapper:ti,AppBar:Lt,AppLoadingSpinner:p.__vue_component__,SharedWithMeSection:vi,SideBar:Zt},setup(){const{areResourcesLoading:r,fields:n,fileListHeaderY:o,loadResourcesTask:l,selectedResources:c,selectedResourcesIds:d,sideBarActivePanel:u,sideBarOpen:p,storeItems:h}=be(),m=e.computed((()=>e.unref(h).filter((e=>e.status===s.ShareStatus.pending)))),{sortBy:f,sortDir:g,items:v,handleSort:b}=le({items:m,fields:n,sortByQueryName:"pending-sort-by",sortDirQueryName:"pending-sort-dir"}),S=e.computed((()=>e.unref(h).filter((e=>e.status===s.ShareStatus.accepted)))),{sortBy:_,sortDir:y,items:w,handleSort:x}=le({items:S,fields:n,sortByQueryName:"accepted-sort-by",sortDirQueryName:"accepted-sort-dir"}),C=e.computed((()=>e.unref(h).filter((e=>e.status===s.ShareStatus.declined)))),{sortBy:k,sortDir:F,items:E,handleSort:$}=le({items:C,fields:n,sortByQueryName:"declined-sort-by",sortDirQueryName:"declined-sort-dir"}),I=i.useStore(),T=t.useCapabilityShareJailEnabled(),R=e.computed((()=>{if(1!==e.unref(c).length)return null;const t=e.unref(c)[0];return e.unref(T)?a.buildShareSpaceResource({shareId:t.shareId,shareName:t.name,serverUrl:i.configurationManager.serverUrl}):I.getters["runtime/spaces/spaces"].find((e=>"personal"===e.driveType))}));return{loadResourcesTask:l,areResourcesLoading:r,selectedResources:c,selectedResourcesIds:d,fileListHeaderY:o,sideBarOpen:p,sideBarActivePanel:u,selectedShareSpace:R,pendingHandleSort:b,pendingSortBy:f,pendingSortDir:g,pendingItems:v,acceptedHandleSort:x,acceptedSortBy:_,acceptedSortDir:y,acceptedItems:w,declinedHandleSort:$,declinedSortBy:k,declinedSortDir:F,declinedItems:E}},data:()=>({ShareStatus:s.ShareStatus}),computed:{...e.mapGetters(["configuration"]),pendingTitle(){return this.$gettext("Pending shares")},acceptedTitle(){return this.$gettext("Accepted shares")},acceptedEmptyMessage(){return this.$gettext("You are not collaborating on other people's resources.")},declinedTitle(){return this.$gettext("Declined shares")},declinedEmptyMessage(){return this.$gettext("You don't have any previously declined shares.")},displayThumbnails(){return!this.configuration?.options?.disablePreviews}},created(){this.loadResourcesTask.perform()}});var Si=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex"},[i("files-view-wrapper",{staticClass:"oc-flex-column"},[i("app-bar",{attrs:{"has-shares-navigation":!0,"has-bulk-actions":!0,"side-bar-open":e.sideBarOpen}}),e._v(" "),e.areResourcesLoading?i("app-loading-spinner"):[e.pendingItems.length>0?i("shared-with-me-section",{attrs:{id:"files-shared-with-me-pending-section","display-thumbnails":!1,"file-list-header-y":e.fileListHeaderY,items:e.pendingItems,"resource-clickable":!1,"share-status":e.ShareStatus.pending,"show-more-toggle":!0,"side-bar-open":e.sideBarOpen,"sort-by":e.pendingSortBy,"sort-dir":e.pendingSortDir,"sort-handler":e.pendingHandleSort,title:e.pendingTitle}}):e._e(),e._v(" "),i("shared-with-me-section",{attrs:{id:"files-shared-with-me-accepted-section","display-thumbnails":e.displayThumbnails,"empty-message":e.acceptedEmptyMessage,"file-list-header-y":e.fileListHeaderY,items:e.acceptedItems,"resource-clickable":!0,"share-status":e.ShareStatus.accepted,"side-bar-open":e.sideBarOpen,"sort-by":e.acceptedSortBy,"sort-dir":e.acceptedSortDir,"sort-handler":e.acceptedHandleSort,title:e.acceptedTitle}}),e._v(" "),i("shared-with-me-section",{attrs:{id:"files-shared-with-me-declined-section","display-thumbnails":!1,"empty-message":e.declinedEmptyMessage,"file-list-header-y":e.fileListHeaderY,items:e.declinedItems,"resource-clickable":!1,"share-status":e.ShareStatus.declined,"show-more-toggle":!0,"side-bar-open":e.sideBarOpen,"sort-by":e.declinedSortBy,"sort-dir":e.declinedSortDir,"sort-handler":e.declinedHandleSort,title:e.declinedTitle}})]],2),e._v(" "),i("side-bar",{attrs:{open:e.sideBarOpen,"active-panel":e.sideBarActivePanel,space:e.selectedShareSpace}})],1)};Si._withStripped=!0;const _i=e.normalizeComponent({render:Si,staticRenderFns:[]},undefined,bi,undefined,false,undefined,!1,void 0,void 0,void 0),yi=new i.VisibilityObserver;const wi=e.defineComponent({components:{FilesViewWrapper:ti,AppBar:Lt,ResourceTable:Le,AppLoadingSpinner:p.__vue_component__,NoContentMessage:h.__vue_component__$1,ListInfo:Nt,Pagination:Ut,ContextActions:_t,SideBar:Zt},mixins:[Ke],setup(){const e=i.useStore();return{...be(),getSpace:t=>{const s=t.storageId,r=e.getters["runtime/spaces/spaces"].find((e=>e.id===s));return r||a.buildShareSpaceResource({shareId:t.shareId,shareName:t.name,serverUrl:i.configurationManager.serverUrl})}}},computed:{...e.mapState(["app"]),...e.mapState("Files",["files"]),...e.mapGetters("Files",["highlightedFile","totalFilesCount"]),...e.mapGetters(["configuration","user"]),isEmpty(){return this.paginatedResources.length<1},displayThumbnails(){return!this.configuration?.options?.disablePreviews}},created(){this.loadResourcesTask.perform()},beforeDestroy(){yi.disconnect()},methods:{...e.mapActions("Files",["loadIndicators","loadPreview","loadAvatars"]),...e.mapMutations("Files",["LOAD_FILES","CLEAR_CURRENT_FILES_LIST"]),rowMounted(t,i){const s=e.debounce((({unobserve:e})=>{e(),this.loadAvatars({resource:t}),this.displayThumbnails&&this.loadPreview({resource:t,isPublic:!1,dimensions:w.Thumbnail,type:x.Thumbnail})}),250);yi.observe(i.$el,{onEnter:s,onExit:s.cancel})}}});var xi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex"},[i("files-view-wrapper",[i("app-bar",{attrs:{"has-shares-navigation":!0,"side-bar-open":e.sideBarOpen}}),e._v(" "),e.areResourcesLoading?i("app-loading-spinner"):[e.isEmpty?i("no-content-message",{staticClass:"files-empty",attrs:{id:"files-shared-with-others-empty",icon:"group"},scopedSlots:e._u([{key:"message",fn:function(){return[i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("\n You are currently not collaborating on any of your resources with other people\n ")])]},proxy:!0}],null,!1,2890156898)}):i("resource-table",{staticClass:"files-table",class:{"files-table-squashed":e.sideBarOpen},attrs:{id:"files-shared-with-others-table","fields-displayed":["name","sharedWith","sdate"],"are-thumbnails-displayed":e.displayThumbnails,"are-paths-displayed":!0,resources:e.paginatedResources,"header-position":e.fileListHeaderY,"sort-by":e.sortBy,"sort-dir":e.sortDir},on:{fileClick:e.$_fileActions_triggerDefaultAction,rowMounted:e.rowMounted,sort:e.handleSort},scopedSlots:e._u([{key:"contextMenu",fn:function(t){var s=t.resource;return[e.isResourceInSelection(s)?i("context-actions",{attrs:{items:e.selectedResources,space:e.getSpace(s)}}):e._e()]}},{key:"footer",fn:function(){return[i("pagination",{attrs:{pages:e.paginationPages,"current-page":e.paginationPage}}),e._v(" "),e.paginatedResources.length>0?i("list-info",{staticClass:"oc-width-1-1 oc-my-s",attrs:{files:e.totalFilesCount.files,folders:e.totalFilesCount.folders}}):e._e()]},proxy:!0}]),model:{value:e.selectedResourcesIds,callback:function(t){e.selectedResourcesIds=t},expression:"selectedResourcesIds"}})]],2),e._v(" "),i("side-bar",{attrs:{open:e.sideBarOpen,"active-panel":e.sideBarActivePanel,space:e.selectedResourceSpace}})],1)};xi._withStripped=!0;const Ci=e.normalizeComponent({render:xi,staticRenderFns:[]},undefined,wi,undefined,false,undefined,!1,void 0,void 0,void 0),ki=new i.VisibilityObserver;const Fi=e.defineComponent({components:{FilesViewWrapper:ti,AppBar:Lt,ResourceTable:Le,AppLoadingSpinner:p.__vue_component__,NoContentMessage:h.__vue_component__$1,ListInfo:Nt,Pagination:Ut,ContextActions:_t,SideBar:Zt},mixins:[Ke],setup(){const e=i.useStore();return{...be(),getSpace:t=>{const s=t.storageId,r=e.getters["runtime/spaces/spaces"].find((e=>e.id===s));return r||a.buildShareSpaceResource({shareId:t.shareId,shareName:t.name,serverUrl:i.configurationManager.serverUrl})}}},computed:{...e.mapState(["app"]),...e.mapState("Files",["files"]),...e.mapGetters("Files",["highlightedFile","totalFilesCount"]),...e.mapGetters(["configuration"]),helpersEnabled(){return this.configuration?.options?.contextHelpers},isEmpty(){return this.paginatedResources.length<1},displayThumbnails(){return!this.configuration?.options?.disablePreviews}},created(){this.loadResourcesTask.perform()},beforeDestroy(){ki.disconnect()},methods:{...e.mapActions("Files",["loadIndicators","loadPreview"]),...e.mapMutations("Files",["LOAD_FILES","CLEAR_CURRENT_FILES_LIST"]),rowMounted(t,i){if(!this.displayThumbnails)return;const s=e.debounce((({unobserve:e})=>{e(),this.loadPreview({resource:t,isPublic:!1,dimensions:w.Thumbnail,type:x.Thumbnail})}),250);ki.observe(i.$el,{onEnter:s,onExit:s.cancel})}}});var Ei=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex"},[i("files-view-wrapper",[i("app-bar",{attrs:{"has-shares-navigation":!0,"side-bar-open":e.sideBarOpen}}),e._v(" "),e.areResourcesLoading?i("app-loading-spinner"):[e.isEmpty?i("no-content-message",{staticClass:"files-empty",attrs:{id:"files-shared-via-link-empty",icon:"link"},scopedSlots:e._u([{key:"message",fn:function(){return[i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("There are no resources with a public link at the moment")])]},proxy:!0}],null,!1,2205227924)}):i("resource-table",{staticClass:"files-table",class:{"files-table-squashed":e.sideBarOpen},attrs:{id:"files-shared-via-link-table","fields-displayed":["name","sharedWith","sdate"],"are-thumbnails-displayed":e.displayThumbnails,"are-paths-displayed":!0,resources:e.paginatedResources,"header-position":e.fileListHeaderY,"sort-by":e.sortBy,"sort-dir":e.sortDir},on:{fileClick:e.$_fileActions_triggerDefaultAction,rowMounted:e.rowMounted,sort:e.handleSort},scopedSlots:e._u([{key:"contextMenu",fn:function(t){var s=t.resource;return[e.isResourceInSelection(s)?i("context-actions",{attrs:{items:e.selectedResources,space:e.getSpace(s)}}):e._e()]}},{key:"footer",fn:function(){return[i("pagination",{attrs:{pages:e.paginationPages,"current-page":e.paginationPage}}),e._v(" "),e.paginatedResources.length>0?i("list-info",{staticClass:"oc-width-1-1 oc-my-s",attrs:{files:e.totalFilesCount.files,folders:e.totalFilesCount.folders}}):e._e()]},proxy:!0}]),model:{value:e.selectedResourcesIds,callback:function(t){e.selectedResourcesIds=t},expression:"selectedResourcesIds"}})]],2),e._v(" "),i("side-bar",{attrs:{open:e.sideBarOpen,"active-panel":e.sideBarActivePanel,space:e.selectedResourceSpace}})],1)};Ei._withStripped=!0;const $i=e.normalizeComponent({render:Ei,staticRenderFns:[]},undefined,Fi,undefined,false,undefined,!1,void 0,void 0,void 0),Ii="personal/home";const Ti=e.defineComponent({name:"DriveRedirect",components:{AppLoadingSpinner:p.__vue_component__},props:{driveAliasAndItem:{type:String,required:!1,default:""},appendHomeFolder:{type:Boolean,required:!1,default:!1}},setup(a){const r=i.useStore(),n=t.useRouter(),o=t.useRoute(),l=e.computed((()=>r.getters["runtime/spaces/spaces"].find((e=>"personal"===e.driveType)))),c=e.computed((()=>{if(!a.appendHomeFolder)return"";const e=a.driveAliasAndItem.startsWith(Ii)?s.urlJoin(a.driveAliasAndItem.slice(Ii.length)):"/";return"/"!==e?e:r.getters.homeFolder})),{params:d,query:u}=t.createFileRouteOptions(e.unref(l),{path:e.unref(c)});return n.replace({...e.unref(o),params:{...e.unref(o).params,...d},query:u}).catch((()=>{}))}});var Ri=function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"oc-flex oc-width-1-1"},[t("app-loading-spinner")],1)};Ri._withStripped=!0;const Li=e.normalizeComponent({render:Ri,staticRenderFns:[]},undefined,Ti,undefined,false,undefined,!1,void 0,void 0,void 0);var Di={computed:c._objectSpread2({},e.mapGetters("Files",["totalFilesCount"])),methods:{accessibleBreadcrumb_focusAndAnnounceBreadcrumb:function(t){var i=document.getElementById("files-breadcrumb");if(i){var s=e.last(i.children[0].children),a=s.getElementsByTagName("button")[0];if(a){var r=this.totalFilesCount.files+this.totalFilesCount.folders,n=this.$gettextInterpolate(this.$ngettext("This folder contains %{ amount } item.","This folder contains %{ amount } items.",r),{amount:r}),o=r>0?n:this.$gettext("This folder has no content.");document.querySelectorAll(".oc-breadcrumb-sr").forEach((function(e){return e.remove()}));var l=document.createElement("p");l.className="oc-invisible-sr oc-breadcrumb-sr",l.innerHTML=o,s.append(l),t&&a.focus()}}}}},Ai={methods:{scrollToResource:function(e){var t=document.querySelectorAll("[data-item-id='".concat(e.id,"']"))[0];if(t.getBoundingClientRect().bottom>window.innerHeight)t.scrollIntoView(!1);else{var i=document.getElementsByClassName("files-topbar")[0].offsetHeight+2*t.offsetHeight;if(t.getBoundingClientRect().top{const t=e.webkitRelativePath||e.relativePath;if(t)return s.urlJoin(t)},Mi=({route:t,space:i,currentFolder:a,currentFolderId:r})=>n=>{const o=[],{name:l,params:c,query:d}=e.unref(t),u=e.unref(i).getWebDavUrl({path:e.unref(a)}),p={};for(const t of n){const n=Pi(t),h=n&&"."!==e.pathUtil.dirname(n)?e.pathUtil.dirname(n):"",m=s.urlJoin(u,h);let f;if(n){const t=n.split("/").filter(Boolean)[0];p[t]||(p[t]=e.v4()),f=p[t]}o.push({source:"file input",name:t.name,type:t.type,data:t,meta:{spaceId:e.unref(i).id,spaceName:e.unref(i).name,driveAlias:e.unref(i).driveAlias,driveType:e.unref(i).driveType,currentFolder:e.unref(a),currentFolderId:e.unref(r),relativeFolder:h,relativePath:n,tusEndpoint:m,uploadId:e.v4(),topLevelFolderId:f,routeName:l,routeDriveAliasAndItem:c?.driveAliasAndItem||"",routeShareId:d?.shareId||""}})}return o};const Oi=e.defineComponent({components:{ResourceUpload:li},mixins:[Ke],props:{space:{type:Object,required:!0},item:{type:String,required:!1,default:null},limitedScreenSpace:{type:Boolean,default:!1,required:!1},itemId:{type:[String,Number],required:!1,default:null}},setup(s){const a=e.getCurrentInstance().proxy,r=a.$uppyService,l=i.useStore();return e.onMounted((()=>{const e=r.subscribe("filesSelected",a.onFilesSelected),t=r.subscribe("uploadCompleted",a.onUploadComplete);r.useDropTarget({targetSelector:"#files-view",uppyService:r}),a.$on("beforeDestroy",(()=>{r.unsubscribe("filesSelected",e),r.unsubscribe("uploadCompleted",t),r.removeDropTarget()}))})),{...ci({uppyService:r}),...(c={space:e.computed((()=>s.space)),currentFolder:e.computed((()=>s.item)),currentFolderId:e.computed((()=>s.itemId))},{inputFilesToUppyFiles:Mi({route:t.useRoute(),space:c.space,currentFolder:c.currentFolder,currentFolderId:c.currentFolderId})}),...m.useRequest(),...n.useGraphClient(),isPublicLocation:Se(o.isLocationPublicActive,"files-public-link"),isSpacesGenericLocation:Se(o.isLocationSpacesActive,"files-spaces-generic"),hasShareJail:t.useCapabilityShareJailEnabled(),hasSpaces:t.useCapabilitySpacesEnabled(),isUserContext:f.useUserContext({store:l})};var c},data:()=>({newFileAction:null}),computed:{...e.mapGetters(["capabilities","configuration","newFileHandlers","user"]),...e.mapGetters("Files",["files","currentFolder","selectedFiles","clipboardResources"]),...e.mapState("Files",["areFileExtensionsShown"]),...e.mapGetters("runtime/spaces",["spaces"]),showPasteHereButton(){return this.clipboardResources&&0!==this.clipboardResources.length},hideButtonLabels(){return this.limitedScreenSpace&&this.showPasteHereButton},mimetypesAllowedForCreation(){const e=this.$store.getters["External/mimeTypes"];return e&&e.filter((e=>e.allow_creation))||[]},showActions(){return!(this.uploadOrFileCreationBlocked&&this.isPublicLocation)},createFileActionsAvailable(){return this.newFileHandlers.length>0||this.mimetypesAllowedForCreation.length>0},newButtonTooltip(){return this.canUpload?null:this.$gettext("You have no permission to create new files!")},newButtonAriaLabel(){const e=this.newButtonTooltip;return e||(this.createFileActionsAvailable?this.$gettext("Create new files or folders"):this.$gettext("Create a new folder"))},uploadButtonTooltip(){return this.canUpload?null:this.$gettext("You have no permission to upload!")},uploadButtonAriaLabel(){const e=this.uploadButtonTooltip;return e||this.$gettext("Upload files or folders")},uploadOrFileCreationBlocked(){return!this.canUpload},canUpload(){return!!this.currentFolder&&this.currentFolder.canUpload({user:this.user})}},methods:{...e.mapActions("Files",["loadPreview","loadIndicators","clearClipboardFiles","pasteSelectedFiles"]),...e.mapActions(["showMessage","createModal","setModalInputErrorMessage","hideModal"]),...e.mapMutations("Files",["UPSERT_RESOURCE"]),...e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"]),...e.mapMutations(["SET_QUOTA"]),pasteFilesHere(){this.pasteSelectedFiles({targetSpace:this.space,clientService:this.$clientService,createModal:this.createModal,hideModal:this.hideModal,showMessage:this.showMessage,$gettext:this.$gettext,$gettextInterpolate:this.$gettextInterpolate,$ngettext:this.$ngettext}).then((()=>{document.activeElement.blur()}))},async onUploadComplete(e){if(e.successful){const t=e.successful[0];if(!t)return;const{spaceId:s,currentFolder:a,currentFolderId:r}=t.meta;if(!["public","share"].includes(t.meta.driveType))if(this.hasSpaces){const e=await this.graphClient.drives.getDrive(s);this.UPDATE_SPACE_FIELD({id:e.data.id,field:"spaceQuota",value:e.data.quota})}else{const e=await this.$client.users.getUser(this.user.id);this.SET_QUOTA(e.quota)}const n=this.itemId?r===this.itemId:a===this.item;s===this.space.id&&n&&i.eventBus.publish("app.files.list.load")}},showCreateResourceModal(e=!0,t="txt",i=null,s=!1){let r=e?this.$gettext("New folder"):this.$gettext("New file")+`.${t}`;this.files.some((e=>e.name===r))&&(r=we(r,e?"":t,this.files)),this.areFileExtensionsShown||(r=a.extractNameWithoutExtension({name:r,extension:t})),e||(this.newFileAction=i);const n=e||!this.areFileExtensionsShown?null:[0,r.length-(t.length+1)],o={variation:"passive",title:e?this.$gettext("Create a new folder"):this.$gettext("Create a new file"),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Create"),hasInput:!0,inputValue:r,inputLabel:e?this.$gettext("Folder name"):this.$gettext("File name"),inputError:e?this.checkNewFolderName(r):this.checkNewFileName(this.areFileExtensionsShown?r:`${r}.${t}`),inputSelectionRange:n,onCancel:this.hideModal,onConfirm:e?this.addNewFolder:s?this.addAppProviderFile:e=>{this.areFileExtensionsShown||(e=`${e}.${t}`),this.addNewFile(e)},onInput:i=>{this.setModalInputErrorMessage(e?this.checkNewFolderName(i):this.checkNewFileName(this.areFileExtensionsShown?i:`${i}.${t}`))}};this.createModal(o)},async addNewFolder(t){if(""!==t)try{const i=e.pathUtil.join(this.item,t),s=await this.$clientService.webdav.createFolder(this.space,{path:i});this.UPSERT_RESOURCE(s),this.hideModal(),this.isSpacesGenericLocation&&"share"!==this.space.driveType&&this.loadIndicators({client:this.$client,currentFolder:this.currentFolder.path}),this.showMessage({title:this.$gettextInterpolate(this.$gettext('"%{folderName}" was created successfully'),{folderName:t})})}catch(e){console.error(e),this.showMessage({title:this.$gettext("Failed to create folder"),status:"danger"})}},checkNewFolderName(e){if(""===e)return this.$gettext("Folder name cannot be empty");if(/[/]/.test(e))return this.$gettext('Folder name cannot contain "/"');if("."===e)return this.$gettext('Folder name cannot be equal to "."');if(".."===e)return this.$gettext('Folder name cannot be equal to ".."');if(/\s+$/.test(e))return this.$gettext("Folder name cannot end with whitespace");if(this.files.find((t=>t.name===e))){const t=this.$gettext("%{name} already exists");return this.$gettextInterpolate(t,{name:e},!0)}return null},async addNewFile(t){if(""!==t)try{const i=e.pathUtil.join(this.item,t),s=await this.$clientService.webdav.putFileContents(this.space,{path:i});if(this.UPSERT_RESOURCE(s),this.newFileAction)return this.$_fileActions_openEditor(this.newFileAction,this.space.getDriveAliasAndItem(s),s.webDavPath,s.fileId,"create"),void this.hideModal();this.hideModal(),this.isSpacesGenericLocation&&"share"!==this.space.driveType&&this.loadIndicators({client:this.$client,currentFolder:this.currentFolder.path}),this.showMessage({title:this.$gettextInterpolate(this.$gettext('"%{fileName}" was created successfully'),{fileName:t})})}catch(e){console.error(e),this.showMessage({title:this.$gettext("Failed to create file"),status:"danger"})}},async addAppProviderFile(t){if(""!==t)try{const a=s.urlJoin(i.configurationManager.serverUrl,this.capabilities.files.app_providers[0].new_url),r=`${a}?${e.lib.stringify({parent_container_id:this.currentFolder.fileId,filename:t})}`,n=await this.makeRequest("POST",r);if(200!==n.status)throw new Error(`An error has occurred: ${n.status}`);const o=e.pathUtil.join(this.item,t)||"",l=await this.$clientService.webdav.getFileInfo(this.space,{path:o});this.$_fileActions_triggerDefaultAction({space:this.space,resources:[l]}),this.UPSERT_RESOURCE(l),this.hideModal(),this.isSpacesGenericLocation&&"share"!==this.space.driveType&&this.loadIndicators({client:this.$client,currentFolder:this.currentFolder.path}),this.showMessage({title:this.$gettextInterpolate(this.$gettext('"%{fileName}" was created successfully'),{fileName:t})})}catch(e){console.error(e),this.showMessage({title:this.$gettext("Failed to create file"),status:"danger"})}},checkNewFileName(e){if(""===e)return this.$gettext("File name cannot be empty");if(/[/]/.test(e))return this.$gettext('File name cannot contain "/"');if("."===e)return this.$gettext('File name cannot be equal to "."');if(".."===e)return this.$gettext('File name cannot be equal to ".."');if(/\s+$/.test(e))return this.$gettext("File name cannot end with whitespace");if(this.files.find((t=>t.name===e))){const t=this.$gettext("%{name} already exists");return this.$gettextInterpolate(t,{name:e},!0)}return null},onFilesSelected(e){new Ee(e,this.files,this.inputFilesToUppyFiles,this.$uppyService,this.space,this.item,this.itemId,this.spaces,this.hasSpaces,this.createDirectoryTree,this.createModal,this.hideModal,this.showMessage,this.$gettext,this.$ngettext,this.$gettextInterpolate).perform()}}});var Ni=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.showActions?i("div",{staticClass:"create-and-upload-actions oc-flex-inline oc-width-1-1"},[e.createFileActionsAvailable?[i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.newButtonTooltip,expression:"newButtonTooltip"}]},[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.hideButtonLabels?e.$gettext("New"):"",expression:"hideButtonLabels ? $gettext('New') : ''"}],key:"new-file-menu-btn-enabled",attrs:{id:"new-file-menu-btn","aria-label":e.newButtonAriaLabel,appearance:"filled",variation:"primary",disabled:e.uploadOrFileCreationBlocked}},[i("oc-icon",{attrs:{name:"add"}}),e._v(" "),e.hideButtonLabels?e._e():i("span",{domProps:{textContent:e._s(e.$gettext("New"))}})],1)],1),e._v(" "),i("oc-drop",{staticClass:"oc-width-auto",attrs:{"drop-id":"new-file-menu-drop",toggle:"#new-file-menu-btn",mode:"click","close-on-click":"","padding-size":"small"}},[i("oc-list",{attrs:{id:"create-list"}},[i("li",{staticClass:"create-list-folder oc-menu-item-hover"},[i("oc-button",{attrs:{id:"new-folder-btn",appearance:"raw"},on:{click:e.showCreateResourceModal}},[i("oc-resource-icon",{attrs:{resource:{isFolder:!0,extension:""},size:"medium"}}),e._v(" "),i("translate",[e._v("Folder")])],1)],1),e._v(" "),e._l(e.newFileHandlers,(function(t,s){return i("li",{key:"file-creation-item-"+s,staticClass:"create-list-file oc-menu-item-hover"},[i("oc-button",{class:["new-file-btn-"+t.ext],attrs:{appearance:"raw"},on:{click:function(i){return e.showCreateResourceModal(!1,t.ext,t.action)}}},[i("oc-resource-icon",{attrs:{resource:{type:"file",extension:t.ext},size:"medium"}}),e._v(" "),i("span",[e._v(e._s(t.menuTitle(e.$gettext)))])],1)],1)})),e._v(" "),e.mimetypesAllowedForCreation?e._l(e.mimetypesAllowedForCreation,(function(t,s){return i("li",{key:"file-creation-item-external-"+s,staticClass:"create-list-file oc-menu-item-hover"},[i("oc-button",{attrs:{appearance:"raw"},on:{click:function(i){return e.showCreateResourceModal(!1,t.ext,!1,!0)}}},[i("oc-resource-icon",{attrs:{resource:{type:"file",extension:t.ext},size:"medium"}}),e._v(" "),i("translate",{attrs:{"translate-params":{name:t.name}}},[e._v("%{name}")])],1)],1)})):e._e()],2)],1)]:[i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.newButtonTooltip,expression:"newButtonTooltip"}]},[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.hideButtonLabels?e.$gettext("New Folder"):"",expression:"hideButtonLabels ? $gettext('New Folder') : ''"}],attrs:{id:"new-folder-btn",appearance:"filled",variation:"primary","aria-label":e.newButtonAriaLabel,disabled:e.uploadOrFileCreationBlocked},on:{click:e.showCreateResourceModal}},[i("oc-icon",{attrs:{name:"resource-type-folder"}}),e._v(" "),e.hideButtonLabels?e._e():i("span",{domProps:{textContent:e._s(e.$gettext("New Folder"))}})],1)],1)],e._v(" "),i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.uploadButtonTooltip,expression:"uploadButtonTooltip"}]},[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.hideButtonLabels?e.$gettext("Upload"):"",expression:"hideButtonLabels ? $gettext('Upload') : ''"}],key:"upload-menu-btn-enabled",attrs:{id:"upload-menu-btn","aria-label":e.uploadButtonAriaLabel,disabled:e.uploadOrFileCreationBlocked}},[i("oc-icon",{attrs:{name:"upload","fill-type":"line"}}),e._v(" "),e.hideButtonLabels?e._e():i("span",{domProps:{textContent:e._s(e.$gettext("Upload"))}})],1)],1),e._v(" "),i("oc-drop",{staticClass:"oc-width-auto",attrs:{"drop-id":"upload-menu-drop",toggle:"#upload-menu-btn",mode:"click","close-on-click":"","padding-size":"small"}},[i("oc-list",{attrs:{id:"upload-list"}},[i("li",{staticClass:"oc-menu-item-hover"},[i("resource-upload",{ref:"folder-upload",attrs:{"btn-class":"oc-width-1-1"}})],1),e._v(" "),i("li",{staticClass:"oc-menu-item-hover"},[i("resource-upload",{ref:"file-upload",attrs:{"btn-class":"oc-width-1-1","is-folder":!0}})],1)])],1),e._v(" "),i("div",{staticClass:"oc-button-group",attrs:{id:"clipboard-btns"}},[e.showPasteHereButton?i("oc-button",{on:{click:e.pasteFilesHere}},[i("oc-icon",{attrs:{"fill-type":"line",name:"clipboard"}}),e._v(" "),i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Paste here")])],1):e._e(),e._v(" "),e.showPasteHereButton?i("oc-button",{on:{click:e.clearClipboardFiles}},[i("oc-icon",{attrs:{"fill-type":"line",name:"close"}})],1):e._e()],1)],2):e._e()};Ni._withStripped=!0;const Bi=e.normalizeComponent({render:Ni,staticRenderFns:[]},undefined,Oi,undefined,false,undefined,!1,void 0,void 0,void 0);const zi=e.defineComponent({mixins:[Ai],props:{paginatedResources:{type:Array,required:!0},keybindOnElementId:{type:String,required:!1,default:"files-view"},space:{type:Object,required:!0}},data:()=>({selectionCursor:0}),computed:{...e.mapState("Files",["latestSelectedId"]),...e.mapGetters("Files",["selectedFiles"])},mounted(){const e=document.getElementById(this.keybindOnElementId);e&&e.addEventListener("keydown",this.handelLocalShortcuts,!1),document.addEventListener("keydown",this.handleGlobalShortcuts);const t=i.eventBus.subscribe("app.files.list.clicked",this.resetSelectionCursor),s=i.eventBus.subscribe("app.files.list.clicked.meta",this.handleCtrlClickAction),a=i.eventBus.subscribe("app.files.list.clicked.shift",this.handleShiftClickAction);this.$on("beforeDestroy",(()=>{i.eventBus.unsubscribe("app.files.list.clicked",t),i.eventBus.unsubscribe("app.files.list.clicked.meta",s),i.eventBus.unsubscribe("app.files.list.clicked.shift",a);const e=document.getElementById(this.keybindOnElementId);e&&e.removeEventListener("keydown",this.handelLocalShortcuts),document.removeEventListener("keydown",this.handleGlobalShortcuts)}))},methods:{...e.mapActions(["showMessage","createModal","hideModal"]),...e.mapActions("Files",["copySelectedFiles","cutSelectedFiles","pasteSelectedFiles","resetFileSelection","toggleFileSelection"]),...e.mapMutations("Files",{setLatestSelectedFile:"SET_LATEST_SELECTED_FILE_ID",setFileSelection:"SET_FILE_SELECTION",addFileSelection:"ADD_FILE_SELECTION"}),areCustomKeyBindingsEnabled(){const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&"checkbox"!==t)return!0;const i=window.getSelection().focusNode;if(!i)return!1;let s;try{s=i?.closest("[data-custom-key-bindings='true']")}catch{s=i?.parentElement.closest("[data-custom-key-bindings='true']")}return!!s},handelLocalShortcuts(t){if((t.keyCode||t.which)===e.keycode("space"))return this.handleSpaceAction(t)},handleGlobalShortcuts(t){const i=t.keyCode||t.which,s=t.shiftKey,a=window.navigator.platform.match("Mac")?t.metaKey:t.ctrlKey,r="Range"===window.getSelection().type;if(!this.areCustomKeyBindingsEnabled()&&!r)return i===e.keycode("c")&&a?this.copySelectedFiles({space:this.space,resources:this.selectedFiles}):i===e.keycode("v")&&a?this.handlePasteAction():i===e.keycode("x")&&a?this.cutSelectedFiles({space:this.space,resources:this.selectedFiles}):i!==e.keycode("down")||s?i!==e.keycode("up")||s?i===e.keycode("esc")?this.handleEscapeAction():i===e.keycode("down")&&s?this.handleShiftDownAction(t):i===e.keycode("up")&&s?this.handleShiftUpAction(t):i===e.keycode("a")&&a?this.handleSelectAllAction(t):void 0:this.handleNavigateAction(t,!0):this.handleNavigateAction(t)},handleNavigateAction(e,t=!1){let i;e.preventDefault(),i=this.latestSelectedId?this.getNextResourceId(t):this.getFirstResourceId(),-1!==i&&(this.resetSelectionCursor(),this.resetFileSelection(),this.addFileSelection({id:i}),this.scrollToResource({id:i}))},handleShiftClickAction(e){const t=document.querySelectorAll(`[data-item-id='${e.id}']`)[0],i=Object.values(t.parentNode.childNodes),s=i.find((e=>e.getAttribute("data-item-id")===this.latestSelectedId)),a=i.find((t=>t.getAttribute("data-item-id")===e.id));let r=i.indexOf(s);r=-1===r?0:r;const n=i.indexOf(a),o=Math.min(r,n),l=Math.max(r,n);for(let e=o;e<=l;e++){const t=i[e].getAttribute("data-item-id");this.addFileSelection({id:t})}this.setLatestSelectedFile(e.id)},handleCtrlClickAction(e){this.toggleFileSelection({id:e.id})},handleEscapeAction(){this.resetSelectionCursor(),this.resetFileSelection()},handleSelectAllAction(e){e.preventDefault(),this.resetSelectionCursor(),this.setFileSelection(this.paginatedResources)},handleSpaceAction(e){e.preventDefault(),this.toggleFileSelection({id:this.latestSelectedId})},handleShiftUpAction(){const e=this.getNextResourceId(!0);-1!==e&&(this.selectionCursor>0?(this.toggleFileSelection({id:this.latestSelectedId}),this.setLatestSelectedFile(e)):this.addFileSelection({id:e}),this.scrollToResource({id:e}),this.selectionCursor=this.selectionCursor-1)},handleShiftDownAction(){const e=this.getNextResourceId();-1!==e&&(this.selectionCursor<0?(this.toggleFileSelection({id:this.latestSelectedId}),this.setLatestSelectedFile(e)):this.addFileSelection({id:e}),this.scrollToResource({id:e}),this.selectionCursor=this.selectionCursor+1)},handlePasteAction(){this.pasteSelectedFiles({targetSpace:this.space,clientService:this.$clientService,createModal:this.createModal,hideModal:this.hideModal,showMessage:this.showMessage,$gettext:this.$gettext,$gettextInterpolate:this.$gettextInterpolate,$ngettext:this.$ngettext})},resetSelectionCursor(){this.selectionCursor=0},getNextResourceId(e=!1){const t=document.querySelectorAll(`[data-item-id='${this.latestSelectedId}']`)[0];let i;try{i=e?t.previousSibling:t.nextSibling}catch{return-1}return null===i?-1:i.getAttribute("data-item-id")},getFirstResourceId(){const e=document.getElementsByClassName("oc-tbody-tr")[0];return e?e.getAttribute("data-item-id"):-1}}});var Ui=function(){var e=this.$createElement;return(this._self._c||e)("div")};Ui._withStripped=!0;const qi=e.normalizeComponent({render:Ui,staticRenderFns:[]},undefined,zi,undefined,false,undefined,!1,void 0,void 0,void 0);const ji=e.defineComponent({name:"NotFoundMessage",props:{space:{type:Object,required:!1,default:null}},setup(e){const i=t.useRouter(),s="project"===e.space?.driveType;return{showPublicLinkButton:o.isLocationPublicActive(i,"files-public-link"),showHomeButton:o.isLocationSpacesActive(i,"files-spaces-generic")&&!s,showSpacesButton:o.isLocationSpacesActive(i,"files-spaces-generic")&&s,homeRoute:o.createLocationSpaces("files-spaces-generic",{params:{driveAliasAndItem:"personal"}}),publicLinkRoute:o.createLocationPublic("files-public-link",t.createFileRouteOptions(e.space,{})),spacesRoute:o.createLocationSpaces("files-spaces-projects")}}});var Vi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-text-center oc-flex-middle oc-flex oc-flex-center oc-flex-column",attrs:{id:"files-list-not-found-message"}},[i("oc-icon",{attrs:{name:"cloud",type:"div",size:"xxlarge"}}),e._v(" "),i("div",{staticClass:"oc-text-muted oc-text-xlarge"},[i("translate",[e._v("Resource not found")])],1),e._v(" "),i("div",{staticClass:"oc-text-muted"},[i("translate",[e._v("\n We went looking everywhere, but were unable to find the selected resource.\n ")])],1),e._v(" "),i("div",{staticClass:"oc-mt-s"},[e.showSpacesButton?i("oc-button",{attrs:{id:"space-not-found-button-go-spaces",type:"router-link",appearance:"raw",to:e.spacesRoute}},[i("translate",[e._v("Go to »Spaces Overview«")])],1):e._e(),e._v(" "),e.showHomeButton?i("oc-button",{attrs:{id:"files-list-not-found-button-go-home",type:"router-link",appearance:"raw",to:e.homeRoute}},[i("translate",[e._v("Go to »Personal« page")])],1):e._e(),e._v(" "),e.showPublicLinkButton?i("oc-button",{attrs:{id:"files-list-not-found-button-reload-link",type:"router-link",appearance:"raw",to:e.publicLinkRoute}},[i("translate",[e._v("Reload public link")])],1):e._e()],1)],1)};Vi._withStripped=!0;const Gi=e.normalizeComponent({render:Vi,staticRenderFns:[]},undefined,ji,undefined,false,undefined,!1,void 0,void 0,void 0);const Hi=e.defineComponent({name:"SpaceQuotaModal",components:{QuotaSelect:h.__vue_component__$2},props:{space:{type:Object,required:!0},cancel:{type:Function,required:!0}},setup:()=>({...n.useGraphClient()}),data:function(){return{selectedOption:0}},computed:{confirmButtonDisabled(){return this.space.spaceQuota.total===this.selectedOption},modalTitle(){return this.$gettextInterpolate(this.$gettext("Change quota for space %{name}"),{name:this.space.name})}},mounted(){this.selectedOption=this.space.spaceQuota.total||0},methods:{...e.mapActions(["showMessage"]),...e.mapMutations("Files",["UPDATE_RESOURCE_FIELD"]),...e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"]),changeSelectedQuotaOption(e){this.selectedOption=e.value},editQuota(){return this.graphClient.drives.updateDrive(this.space.id,{quota:{total:this.selectedOption}},{}).then((({data:e})=>{this.cancel(),this.UPDATE_SPACE_FIELD({id:this.space.id,field:"spaceQuota",value:e.quota}),this.UPDATE_RESOURCE_FIELD({id:this.space.id,field:"spaceQuota",value:e.quota}),this.showMessage({title:this.$gettext("Space quota was changed successfully")})})).catch((e=>{console.error(e),this.showMessage({title:this.$gettext("Failed to change space quota"),status:"danger"})}))}}});var Wi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("portal",{attrs:{to:"app.runtime.modal"}},[i("oc-modal",{attrs:{title:e.modalTitle,"button-cancel-text":e.$gettext("Cancel"),"button-confirm-text":e.$gettext("Confirm"),"button-confirm-disabled":e.confirmButtonDisabled},on:{confirm:e.editQuota,cancel:e.cancel},scopedSlots:e._u([{key:"content",fn:function(){return[i("quota-select",{attrs:{title:e.$gettext("Space quota"),"total-quota":e.selectedOption},on:{selectedOptionChange:e.changeSelectedQuotaOption}})]},proxy:!0}])})],1)};Wi._withStripped=!0;const Qi=e.normalizeComponent({render:Wi,staticRenderFns:[]},undefined,Hi,undefined,false,undefined,!1,void 0,void 0,void 0);const Ji={name:"SpaceReadmeContentModal",props:{space:{type:Object,required:!0},cancel:{type:Function,required:!0}},data:function(){return{readmeContent:""}},computed:{modalTitle:function(){return this.$gettextInterpolate(this.$gettext("Edit description for space %{name}"),{name:this.space.name})}},watch:{"space.spaceQuota":{handler:function(e){e&&this.setOptions()},deep:!0}},mounted:function(){var e=this;return c._asyncToGenerator(c._regeneratorRuntime().mark((function t(){var i,s;return c._regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.space.spaceReadmeData.webDavUrl.split("/"),s=i.slice(i.indexOf("dav")+1).join("/"),t.next=4,e.$client.files.getFileContents(decodeURI(s));case 4:e.readmeContent=t.sent;case 5:case"end":return t.stop()}}),t)})))()},methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapActions(["showMessage"])),e.mapMutations("Files",["UPDATE_RESOURCE_FIELD"])),{},{editReadme:function(){var e=this,t=this.space.spaceReadmeData.webDavUrl.split("/"),i=t.slice(t.indexOf("dav")+1).join("/");return this.$client.files.putFileContents(decodeURI(i),this.readmeContent).then((function(t){e.cancel(),e.UPDATE_RESOURCE_FIELD({id:e.space.id,field:"spaceReadmeData",value:c._objectSpread2(c._objectSpread2({},e.space.spaceReadmeData),{etag:t.ETag})}),e.showMessage({title:e.$gettext("Space description was edited successfully")})})).catch((function(t){console.error(t),e.showMessage({title:e.$gettext("Failed to edit space description"),status:"danger"})}))}})};var Yi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("portal",{attrs:{to:"app.runtime.modal"}},[i("oc-modal",{attrs:{"focus-trap-initial":"#description-input-area",title:e.modalTitle,"button-cancel-text":e.$gettext("Cancel"),"button-confirm-text":e.$gettext("Confirm")},on:{confirm:e.editReadme,cancel:e.cancel},scopedSlots:e._u([{key:"content",fn:function(){return[i("label",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"oc-label",attrs:{for:"description-input-area"}},[e._v("Space description")]),e._v(" "),i("textarea",{directives:[{name:"model",rawName:"v-model",value:e.readmeContent,expression:"readmeContent"}],staticClass:"oc-width-1-1 oc-height-1-1 oc-text-input",attrs:{id:"description-input-area",rows:"30"},domProps:{value:e.readmeContent},on:{input:function(t){t.target.composing||(e.readmeContent=t.target.value)}}})]},proxy:!0}])})],1)};Yi._withStripped=!0;const Ki=e.normalizeComponent({render:Yi,staticRenderFns:[]},undefined,Ji,undefined,false,undefined,!1,void 0,void 0,void 0);var Zi={computed:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapGetters(["configuration"])),e.mapState(["user"])),{},{$_delete_items:function(){var e=this;return[{name:"delete",icon:"close-circle",label:function(){return e.$gettext("Delete")},handler:this.$_delete_trigger,isEnabled:function(t){var i=t.resources;return 1===i.length&&i[0].canBeDeleted({user:e.user})},componentType:"button",class:"oc-files-actions-delete-trigger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapActions(["createModal","hideModal","setModalInputErrorMessage","showMessage","toggleModalConfirmButton"])),e.mapMutations("Files",["REMOVE_FILES"])),e.mapMutations("runtime/spaces",["REMOVE_SPACE"])),{},{$_delete_trigger:function(e){var t=this,i=e.resources;if(1===i.length){var s={variation:"danger",icon:"alarm-warning",title:this.$gettext("Delete space")+" "+i[0].name,cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Delete"),message:this.$gettext("Are you sure you want to delete this space?"),hasInput:!1,onCancel:this.hideModal,onConfirm:function(){return t.$_delete_deleteSpace(i[0].id)}};this.createModal(s)}},$_delete_deleteSpace:function(e){var t=this,i=this.$store.getters["runtime/auth/accessToken"];return d.clientService.graphAuthenticated(this.configuration.server,i).drives.deleteDrive(e,"",{headers:{Purge:"T"}}).then((function(){t.hideModal(),t.REMOVE_FILES([{id:e}]),t.REMOVE_SPACE({id:e}),t.showMessage({title:t.$gettext("Space was deleted successfully")})})).catch((function(e){console.error(e),t.showMessage({title:t.$gettext("Failed to delete space"),status:"danger"})}))}})},Xi={computed:c._objectSpread2(c._objectSpread2({},e.mapGetters(["configuration","user"])),{},{$_rename_items:function(){var e=this;return[{name:"rename",icon:"pencil",label:function(){return e.$gettext("Rename")},handler:this.$_rename_trigger,isEnabled:function(t){var i=t.resources;return 1===i.length&&i[0].canRename({user:e.user})},componentType:"button",class:"oc-files-actions-rename-trigger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapActions(["createModal","hideModal","setModalInputErrorMessage","showMessage","toggleModalConfirmButton"])),e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"])),{},{$_rename_trigger:function(e){var t=this,i=e.resources;if(1===i.length){var s={variation:"passive",title:this.$gettext("Rename space")+" "+i[0].name,cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Rename"),hasInput:!0,inputLabel:this.$gettext("Space name"),inputValue:i[0].name,onCancel:this.hideModal,onConfirm:function(e){return t.$_rename_renameSpace(i[0].id,e)},onInput:this.$_rename_checkName};this.createModal(s)}},$_rename_checkName:function(e){return""===e.trim()?this.setModalInputErrorMessage(this.$gettext("Space name cannot be empty")):e.length>255?this.setModalInputErrorMessage(this.$gettext("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.test(e)?this.setModalInputErrorMessage(this.$gettext('Space name cannot contain the following characters: / \\ . : ? * " > < |')):this.setModalInputErrorMessage(null)},$_rename_renameSpace:function(e,t){var i=this,s=this.$store.getters["runtime/auth/accessToken"];return d.clientService.graphAuthenticated(this.configuration.server,s).drives.updateDrive(e,{name:t},{}).then((function(){i.hideModal(),i.UPDATE_SPACE_FIELD({id:e,field:"name",value:t}),i.showMessage({title:i.$gettext("Space name was changed successfully")})})).catch((function(e){console.error(e),i.showMessage({title:i.$gettext("Failed to rename space"),status:"danger"})}))}})},es={computed:{...e.mapGetters(["configuration"]),...e.mapState(["user"]),$_restore_items(){return[{name:"restore",icon:"play-circle",label:()=>this.$gettext("Enable"),handler:this.$_restore_trigger,isEnabled:({resources:e})=>1===e.length&&e[0].canRestore({user:this.user}),componentType:"button",class:"oc-files-actions-restore-trigger"}]}},methods:{...e.mapActions(["createModal","hideModal","setModalInputErrorMessage","showMessage","toggleModalConfirmButton"]),...e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"]),$_restore_trigger({resources:e}){if(1!==e.length)return;const t=this.$gettextInterpolate(this.$gettext('If you enable the space "%{spaceName}", it can be accessed again.'),{spaceName:e[0].name}),i={variation:"passive",title:this.$gettext("Enable Space?"),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Enable"),icon:"alarm-warning",message:t,hasInput:!1,onCancel:this.hideModal,onConfirm:()=>this.$_restore_restoreSpace(e[0].id)};this.createModal(i)},$_restore_restoreSpace(e){const t=this.$store.getters["runtime/auth/accessToken"];return d.clientService.graphAuthenticated(this.configuration.server,t).drives.updateDrive(e,{},{headers:{Restore:!0}}).then((()=>{this.hideModal(),this.UPDATE_SPACE_FIELD({id:e,field:"disabled",value:!1}),this.showMessage({title:this.$gettext("Space was restored successfully")})})).catch((e=>{console.error(e),this.showMessage({title:this.$gettext("Failed to restore space"),status:"danger"})}))}}},ts={computed:c._objectSpread2(c._objectSpread2({},e.mapGetters(["configuration"])),{},{$_editDescription_items:function(){var e=this;return[{name:"editDescription",icon:"h-2",iconFillType:"none",label:function(){return e.$gettext("Edit subtitle")},handler:this.$_editDescription_trigger,isEnabled:function(t){var i=t.resources;return 1===i.length&&i[0].canEditDescription({user:e.user})},componentType:"button",class:"oc-files-actions-edit-description-trigger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapActions(["createModal","hideModal","setModalInputErrorMessage","showMessage","toggleModalConfirmButton"])),e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"])),{},{$_editDescription_trigger:function(e){var t=this,i=e.resources;if(1===i.length){var s={variation:"passive",title:this.$gettext("Change subtitle for space")+" "+i[0].name,cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Confirm"),hasInput:!0,inputLabel:this.$gettext("Space subtitle"),inputValue:i[0].description,onCancel:this.hideModal,onConfirm:function(e){return t.$_editDescription_editDescriptionSpace(i[0].id,e)}};this.createModal(s)}},$_editDescription_editDescriptionSpace:function(e,t){var i=this,s=this.$store.getters["runtime/auth/accessToken"];return d.clientService.graphAuthenticated(this.configuration.server,s).drives.updateDrive(e,{description:t},{}).then((function(){i.hideModal(),i.UPDATE_SPACE_FIELD({id:e,field:"description",value:t}),i.showMessage({title:i.$gettext("Space subtitle was changed successfully")})})).catch((function(e){console.error(e),i.showMessage({title:i.$gettext("Failed to change space subtitle"),status:"danger"})}))}})},is={data:function(){return{$_editQuota_modalOpen:!1,$_editQuota_selectedSpace:null}},computed:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapState("Files",["currentFolder"])),e.mapState(["user"])),{},{$_editQuota_items:function(){var e=this;return[{name:"editQuota",icon:"cloud",label:function(){return e.$gettext("Edit quota")},handler:this.$_editQuota_trigger,isEnabled:function(t){var i=t.resources;return 1===i.length&&(!!i[0].spaceQuota&&e.$permissionManager.canEditSpaceQuota())},componentType:"button",class:"oc-files-actions-edit-quota-trigger"}]}}),methods:{$_editQuota_trigger:function(e){var t=e.resources;this.$data.$_editQuota_selectedSpace=t[0],this.$data.$_editQuota_modalOpen=!0},$_editQuota_closeModal:function(){this.$data.$_editQuota_modalOpen=!1}}},ss={computed:{$_deletedFiles_items:function(){var e=this;return[{name:"deletedFiles",icon:"delete-bin-5",label:function(){return e.$gettext("Deleted files")},handler:this.$_deletedFiles_trigger,isEnabled:function(e){return 1===e.resources.length},componentType:"button",class:"oc-files-actions-delete-trigger"}]}},methods:{$_deletedFiles_trigger:function(){return this.$router.push(o.createLocationTrash("files-trash-generic",t.createFileRouteOptions(this.space,{fileId:this.space.fileId})))}}},as={computed:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapGetters(["configuration"])),e.mapState(["user"])),{},{$_disable_items:function(){var e=this;return[{name:"disable",icon:"stop-circle",label:function(){return e.$gettext("Disable")},handler:this.$_disable_trigger,isEnabled:function(t){var i=t.resources;return 1===i.length&&i[0].canDisable({user:e.user})},componentType:"button",class:"oc-files-actions-disable-trigger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapActions(["createModal","hideModal","setModalInputErrorMessage","showMessage","toggleModalConfirmButton"])),e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"])),{},{$_disable_trigger:function(e){var t=this,i=e.resources;if(1===i.length){var s=this.$gettextInterpolate(this.$gettext('If you disable the space "%{spaceName}", it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.'),{spaceName:i[0].name}),a={variation:"danger",icon:"alarm-warning",title:this.$gettext("Disable Space?"),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Disable"),message:s,hasInput:!1,onCancel:this.hideModal,onConfirm:function(){return t.$_disable_disableSpace(i[0].id)}};this.createModal(a)}},$_disable_disableSpace:function(e){var t=this,i=this.$store.getters["runtime/auth/accessToken"];return d.clientService.graphAuthenticated(this.configuration.server,i).drives.deleteDrive(e).then((function(){if(t.hideModal(),t.UPDATE_SPACE_FIELD({id:e,field:"disabled",value:!0}),t.showMessage({title:t.$gettext("Space was disabled successfully")}),!o.isLocationSpacesActive(t.$router,"files-spaces-projects"))return o.isLocationSpacesActive(t.$router,"files-spaces-generic")?t.$router.push(o.createLocationSpaces("files-spaces-projects")):void 0})).catch((function(e){console.error(e),t.showMessage({title:t.$gettext("Failed to disable space"),status:"danger"})}))},isDisabled:function(e){return!1}})},rs={setup:function(){return c._objectSpread2({},n.useGraphClient())},computed:{$_showMembers_items:function(){var e=this;return[{name:"show-members",icon:"group",label:function(){return e.$gettext("Members")},handler:this.$_showMembers_trigger,isEnabled:function(e){return 1===e.resources.length},componentType:"button",class:"oc-files-actions-show-details-trigger"}]}},methods:c._objectSpread2(c._objectSpread2({},e.mapMutations("Files",["SET_FILE_SELECTION"])),{},{$_showMembers_trigger:function(e){var t=e.resources;this.SET_FILE_SELECTION(t),i.eventBus.publish(L.openWithPanel,"space-share-item")}})},ns={data:function(){return{$_uploadImage_selectedSpace:null}},computed:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapState("Files",["currentFolder"])),e.mapGetters(["configuration"])),{},{$_uploadImage_items:function(){var e=this;return[{name:"upload-space-image",icon:"image-add",handler:this.$_uploadImage_trigger,label:function(){return e.$gettext("Edit image")},isEnabled:function(t){var i=t.resources;return 1===i.length&&i[0].canEditImage({user:e.user})},componentType:"button",class:"oc-files-actions-upload-space-image-trigger"}]}}),methods:c._objectSpread2(c._objectSpread2(c._objectSpread2({},e.mapMutations("runtime/spaces",["UPDATE_SPACE_FIELD"])),e.mapActions(["showMessage"])),{},{$_uploadImage_trigger:function(e){var t=e.resources;1===t.length&&(this.$data.$_uploadImage_selectedSpace=t[0],this.$refs.spaceImageInput.click())},$_uploadImage_uploadImageSpace:function(e){var t=this,s=this.$store.getters["runtime/auth/accessToken"],a=d.clientService.graphAuthenticated(this.configuration.server,s),r=e.currentTarget.files[0];if(r){if(!Ue.isMimetypeSupported(r.type,!0))return this.showMessage({title:this.$gettext("The file type is unsupported"),status:"danger"});var n={};return r.lastModifiedDate?n["X-OC-Mtime"]=""+r.lastModifiedDate.getTime()/1e3:r.lastModified&&(n["X-OC-Mtime"]=""+r.lastModified/1e3),this.$client.files.putFileContents("/spaces/".concat(this.$data.$_uploadImage_selectedSpace.id,"/.space/").concat(r.name),r,{headers:n,overwrite:!0}).then((function(e){return a.drives.updateDrive(t.$data.$_uploadImage_selectedSpace.id,{special:[{specialFolder:{name:"image"},id:e["OC-FileId"]}]},{}).then((function(e){var s=e.data;t.UPDATE_SPACE_FIELD({id:t.$data.$_uploadImage_selectedSpace.id,field:"spaceImageData",value:s.special.find((function(e){return"image"===e.specialFolder.name}))}),t.showMessage({title:t.$gettext("Space image was uploaded successfully")}),i.eventBus.publish("app.files.list.load")}))})).catch((function(e){console.error(e),t.showMessage({title:t.$gettext("Failed to upload space image"),status:"danger"})}))}}})},os={data:function(){return{$_editReadmeContent_modalOpen:!1}},computed:c._objectSpread2(c._objectSpread2({},e.mapState(["user"])),{},{$_editReadmeContent_items:function(){var e=this;return[{name:"editReadmeContent",icon:"article",label:function(){return e.$gettext("Edit description")},handler:this.$_editReadmeContent_trigger,isEnabled:function(t){var i=t.resources;return 1===i.length&&(!!i[0].canEditReadme({user:e.user})&&!!i[0].spaceReadmeData)},componentType:"button",class:"oc-files-actions-edit-readme-content-trigger"}]}}),methods:{$_editReadmeContent_trigger:function(){this.$data.$_editReadmeContent_modalOpen=!0},$_editReadmeContent_closeModal:function(){this.$data.$_editReadmeContent_modalOpen=!1}}};const ls=e.defineComponent({name:"SpaceContextActions",components:{ContextActionMenu:lt,QuotaModal:Qi,ReadmeContentModal:Ki},mixins:[Xi,Zi,ts,is,ss,as,vt,rs,es,ns,os],props:{space:{type:Object,required:!0},items:{type:Array,required:!0}},computed:{quotaModalSelectedSpace(){return this.$data.$_editQuota_selectedSpace},quotaModalIsOpen(){return this.$data.$_editQuota_modalOpen},readmeContentModalIsOpen(){return this.$data.$_editReadmeContent_modalOpen},menuSections(){const e=[];return this.menuItemsMembers.length&&e.push({name:"members",items:this.menuItemsMembers}),this.menuItemsPrimaryActions.length&&e.push({name:"primaryActions",items:this.menuItemsPrimaryActions}),this.menuItemsSecondaryActions.length&&e.push({name:"secondaryActions",items:this.menuItemsSecondaryActions}),this.menuItemsTrashBin.length&&e.push({name:"trashBin",items:this.menuItemsTrashBin}),this.menuItemsSidebar.length&&e.push({name:"sidebar",items:this.menuItemsSidebar}),e},filterParams(){return{resources:this.items}},menuItemsMembers(){return[...[...this.$_showMembers_items]].filter((e=>e.isEnabled(this.filterParams)))},menuItemsPrimaryActions(){const e=[...this.$_rename_items,...this.$_editDescription_items,...this.$_uploadImage_items];return o.isLocationSpacesActive(this.$router,"files-spaces-generic")&&e.splice(2,0,...this.$_editReadmeContent_items),[...e].filter((e=>e.isEnabled(this.filterParams)))},menuItemsSecondaryActions(){return[...[...this.$_editQuota_items,...this.$_disable_items,...this.$_restore_items,...this.$_delete_items]].filter((e=>e.isEnabled(this.filterParams)))},menuItemsTrashBin(){return[...[...this.$_deletedFiles_items]].filter((e=>e.isEnabled(this.filterParams)))},menuItemsSidebar(){return[...[...this.$_showDetails_items]].filter((e=>e.isEnabled(this.filterParams)))}},methods:{closeQuotaModal(){this.$_editQuota_closeModal()},closeReadmeContentModal(){this.$_editReadmeContent_closeModal()}}});var cs=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("context-action-menu",{attrs:{"menu-sections":e.menuSections,items:e.items,space:e.space}}),e._v(" "),e.quotaModalIsOpen?i("quota-modal",{attrs:{cancel:e.closeQuotaModal,space:e.quotaModalSelectedSpace}}):e._e(),e._v(" "),e.readmeContentModalIsOpen?i("readme-content-modal",{attrs:{cancel:e.closeReadmeContentModal,space:e.items[0]}}):e._e(),e._v(" "),i("input",{ref:"spaceImageInput",attrs:{id:"space-image-upload-input",type:"file",name:"file",multiple:"",tabindex:"-1",accept:"image/*"},on:{change:e.$_uploadImage_uploadImageSpace}})],1)};cs._withStripped=!0;const ds=e.normalizeComponent({render:cs,staticRenderFns:[]},undefined,ls,undefined,false,undefined,!1,void 0,void 0,void 0),us=new i.VisibilityObserver,ps="collapsed";const hs=e.defineComponent({name:"SpaceHeader",components:{SpaceContextActions:ds},props:{space:{type:Object,required:!0},sideBarOpen:{type:Boolean,default:!1}},setup(t){const{$gettext:s,$ngettext:a,$gettextInterpolate:r}=v.useTranslations(),{getFileContents:o,getFileInfo:l}=n.useClientService().webdav,c=i.useStore(),d=e.computed((()=>c.getters.user?.id)),u=n.useAccessToken({store:c}),p=e.ref(null),h=e.ref(""),m=e.ref(!0),f=e.ref(!1),b=e.computed((()=>e.unref(m)?"add":"subtract")),S=e.computed((()=>e.unref(m)?s("Show more"):s("Show less"))),_=new ResizeObserver((()=>{if(!e.unref(p))return;e.unref(p).classList.remove(ps);e.unref(p).offsetHeight<150?f.value=!1:(f.value=!0,e.unref(m)&&e.unref(p).classList.add(ps))})),y=()=>{_&&e.unref(p)&&(_.unobserve(e.unref(p)),_.observe(e.unref(p)))},x=()=>{_&&e.unref(p)&&_.unobserve(e.unref(p))};e.onMounted(y),e.onBeforeUnmount((()=>{us.disconnect(),x()})),e.watch(e.computed((()=>t.space.spaceReadmeData)),(async i=>{if(!i)return;const s=decodeURI(i.webDavUrl).split("/"),a=s.find((e=>e.startsWith(t.space.id)));if(!a)return;const r=s.slice(s.indexOf(a)+1).join("/"),n=await o(t.space,{path:decodeURIComponent(r)});x();const l=e.marked_umd.marked.parse(n.body);h.value=e.sanitizeHtml_1(l),e.unref(h)&&y()}),{deep:!0,immediate:!0});const C=e.ref(null),k=e.ref(!1);e.watch(e.computed((()=>t.space.spaceImageData)),(async s=>{if(!s)return;const a=decodeURI(t.space.spaceImageData.webDavUrl).split("/"),r=a.find((e=>e.startsWith(t.space.id)));if(!r)return;const n=a.slice(a.indexOf(r)+1).join("/"),o=await l(t.space,{path:decodeURIComponent(n)});C.value=await g.loadPreview({resource:o,isPublic:!1,dimensions:w.Preview,server:i.configurationManager.serverUrl,userId:e.unref(d),token:e.unref(u)})}),{deep:!0,immediate:!0});const F=e.computed((()=>t.space?.spaceImageData)),E=e.computed((()=>c.getters["runtime/spaces/spaceMembers"].length)),$=e.computed((()=>{const t=a("%{count} member","%{count} members",e.unref(E));return r(t,{count:e.unref(E)})}));return{markdownContainerRef:p,markdownContent:h,markdownCollapsed:m,showMarkdownCollapse:f,toggleMarkdownCollapsedIcon:b,toggleMarkdownCollapsedText:S,toggleMarkdownCollapsed:()=>{m.value=!e.unref(m),e.unref(p).classList.toggle(ps)},imageContent:C,imageExpanded:k,toggleImageExpanded:()=>{k.value=!e.unref(k)},hasImage:F,memberCount:E,memberCountString:$,openSideBarSharePanel:()=>{c.commit("Files/SET_SELECTED_IDS",[]),i.eventBus.publish(L.openWithPanel,"space-share-item")}}}});var ms=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"space-header oc-p-m",class:{"oc-flex":!e.imageExpanded,"space-header-squashed":e.sideBarOpen}},[i("div",{staticClass:"space-header-image",class:{"space-header-image-expanded":e.imageExpanded}},[e.hasImage?i("img",{staticClass:"oc-cursor-pointer",attrs:{alt:"",src:e.imageContent},on:{click:e.toggleImageExpanded}}):i("div",{staticClass:"space-header-image-default oc-flex oc-flex-middle oc-flex-center"},[i("oc-icon",{staticClass:"oc-px-m oc-py-m",attrs:{name:"layout-grid",size:"xxlarge"}})],1)]),e._v(" "),i("div",{staticClass:"space-header-infos"},[i("div",{staticClass:"oc-flex oc-mb-s oc-flex-middle oc-flex-between"},[i("div",{staticClass:"oc-flex oc-flex-middle space-header-infos-heading"},[i("h1",{staticClass:"space-header-name"},[e._v(e._s(e.space.name))]),e._v(" "),i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Show context menu"),expression:"$gettext('Show context menu')"}],staticClass:"oc-ml-s",attrs:{id:"space-context-btn","aria-label":e.$gettext("Show context menu"),appearance:"raw"}},[i("oc-icon",{attrs:{name:"more-2"}})],1),e._v(" "),i("oc-drop",{attrs:{"drop-id":"space-context-drop",toggle:"#space-context-btn",mode:"click","close-on-click":"",options:{delayHide:0},"padding-size":"small",position:"right-start"}},[i("space-context-actions",{attrs:{items:[e.space],space:e.space}})],1)],1),e._v(" "),e.memberCount?i("oc-button",{attrs:{"aria-label":e.$gettext("Open context menu and show members"),appearance:"raw"},on:{click:e.openSideBarSharePanel}},[i("oc-icon",{attrs:{name:"group","fill-type":"line",size:"small"}}),e._v(" "),i("span",{staticClass:"space-header-people-count oc-text-small",domProps:{textContent:e._s(e.memberCountString)}})],1):e._e()],1),e._v(" "),e.space.description?i("p",{staticClass:"oc-mt-rm oc-text-bold"},[e._v(e._s(e.space.description))]):e._e(),e._v(" "),i("div",[i("div",{ref:"markdownContainerRef",staticClass:"markdown-container",domProps:{innerHTML:e._s(e.markdownContent)}}),e._v(" "),e.showMarkdownCollapse?i("div",{staticClass:"markdown-collapse oc-text-center oc-mt-s"},[i("oc-button",{attrs:{appearance:"raw"},on:{click:e.toggleMarkdownCollapsed}},[i("oc-icon",{attrs:{name:e.toggleMarkdownCollapsedIcon}}),e._v(" "),i("span",[e._v(e._s(e.toggleMarkdownCollapsedText))])],1)],1):e._e()])])])};ms._withStripped=!0;const fs=e.normalizeComponent({render:ms,staticRenderFns:[]},undefined,hs,undefined,false,undefined,!1,void 0,void 0,void 0),gs=new i.VisibilityObserver;const vs=e.defineComponent({name:"GenericSpace",components:{AppBar:Lt,AppLoadingSpinner:p.__vue_component__,ContextActions:_t,CreateAndUpload:Bi,FilesViewWrapper:ti,KeyboardActions:qi,ListInfo:Nt,NoContentMessage:h.__vue_component__$1,NotFoundMessage:Gi,Pagination:Ut,QuickActions:Pt,ResourceTable:Le,SideBar:Zt,SpaceHeader:fs},mixins:[Di,Ke,Ai],props:{space:{type:Object,required:!1,default:null},item:{type:String,required:!1,default:null},itemId:{type:[String,Number],required:!1,default:null}},setup(s){const r=e.computed((()=>"project"===s.space.driveType&&"/"===s.item)),n=e.computed((()=>{const t=[s.space.name];return"/"!==s.item&&t.unshift(e.basename(s.item)),t}));m.useDocumentTitle({titleSegments:n});const{$gettext:l}=v.useTranslations(),c=t.useRoute(),d=e.computed((()=>{const n=s.space,d=[];let u;a.isProjectSpaceResource(n)?d.push({text:l("Spaces"),to:o.createLocationSpaces("files-spaces-projects")}):a.isShareSpaceResource(n)&&d.push({text:l("Shares"),to:{path:"/files/shares"}},{text:l("Shared with me"),to:{path:"/files/shares/with-me"}});let{params:p,query:h}=t.createFileRouteOptions(n,{fileId:n.fileId});return h={...e.unref(c).query,...h},u=a.isPersonalSpaceResource(n)?{text:n.name,to:o.createLocationSpaces("files-spaces-generic",{params:p,query:h})}:a.isShareSpaceResource(n)?{allowContextActions:!0,text:n.name,to:o.createLocationSpaces("files-spaces-generic",{params:p,query:e.omit(h,"fileId")})}:a.isPublicSpaceResource(n)?{text:l("Public link"),to:o.createLocationPublic("files-public-link",{params:p,query:h})}:{allowContextActions:!e.unref(r),text:n.name,to:o.createLocationSpaces("files-spaces-generic",{params:p,query:h})},((...e)=>{const t=e.pop();return[...e,{allowContextActions:t.allowContextActions,text:t.text,onClick:()=>i.eventBus.publish("app.files.list.load")}]})(...d,u,...((t,i)=>{const s=(e="")=>e.split("/").filter(Boolean),a=s(t.path),r=s(i);return r.map(((i,s)=>({allowContextActions:!0,text:i,to:{path:"/"+[...a].splice(0,a.length-r.length+s+1).join("/"),query:e.omit(t.query,"fileId")}})))})(e.unref(c),s.item))}));return{...be(),resourceTargetRouteCallback:({path:e,fileId:i})=>{const{params:r,query:n}=t.createFileRouteOptions(s.space,{path:e,fileId:i});return a.isPublicSpaceResource(s.space)?o.createLocationPublic("files-public-link",{params:r,query:n}):o.createLocationSpaces("files-spaces-generic",{params:r,query:n})},breadcrumbs:d,hasSpaceHeader:r}},computed:{...e.mapState(["app"]),...e.mapState("Files",["files"]),...e.mapGetters("Files",["highlightedFile","currentFolder","totalFilesCount","totalFilesSize"]),...e.mapGetters(["user","configuration"]),isEmpty(){return this.paginatedResources.length<1},folderNotFound(){return null===this.currentFolder},displayThumbnails(){return!this.configuration?.options?.disablePreviews},isSpaceFrontpage(){return a.isProjectSpaceResource(this.space)&&"/"===this.item}},watch:{item:{handler:function(){this.performLoaderTask(!0)}}},mounted(){this.performLoaderTask(!1);const e=i.eventBus.subscribe("app.files.list.load",((e,t)=>{this.performLoaderTask(!0,e,t)}));this.$on("beforeDestroy",(()=>i.eventBus.unsubscribe("app.files.list.load",e)))},beforeDestroy(){gs.disconnect()},methods:{...e.mapActions("Files",["loadPreview"]),...e.mapActions(["showMessage","createModal","hideModal"]),...e.mapMutations("Files",["REMOVE_FILES","REMOVE_FILES_FROM_SEARCHED","REMOVE_FILE_SELECTION"]),async performLoaderTask(e,t,i){const s={loadShares:!a.isPublicSpaceResource(this.space)};await this.loadResourcesTask.perform(this.space,t||this.item,i||this.itemId,s),this.scrollToResourceFromRoute(),this.refreshFileListHeaderPosition(),this.accessibleBreadcrumb_focusAndAnnounceBreadcrumb(e)},async fileDropped(e){const t=[...this.selectedResources],i=this.paginatedResources.find((t=>t.id===e));if(t.some((t=>t.id===e)))return;if("folder"!==i.type)return;const s=new Fe(this.space,t,this.space,i,this.$clientService,this.createModal,this.hideModal,this.showMessage,this.$gettext,this.$ngettext,this.$gettextInterpolate),a=await s.perform(ke.MOVE);for(const e of a)this.REMOVE_FILES([e]),this.REMOVE_FILES_FROM_SEARCHED([e]),this.REMOVE_FILE_SELECTION(e)},rowMounted(t,i){if(!this.displayThumbnails)return;const s=e.debounce((({unobserve:e})=>{e(),this.loadPreview({resource:t,isPublic:!1,dimensions:w.Thumbnail,type:x.Thumbnail})}),250);gs.observe(i.$el,{onEnter:s,onExit:s.cancel})},scrollToResourceFromRoute(){const e=this.$route.query.scrollTo;if(e&&this.paginatedResources.length>0){const t=this.paginatedResources.find((t=>t.name===e));t&&(this.selectedResources=[t],this.scrollToResource(t))}}}});var bs=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex oc-width-1-1",class:{"space-frontpage":e.isSpaceFrontpage}},[i("keyboard-actions",{attrs:{"paginated-resources":e.paginatedResources,space:e.space}}),e._v(" "),i("files-view-wrapper",[i("app-bar",{attrs:{"has-bulk-actions":!0,breadcrumbs:e.breadcrumbs,"breadcrumbs-context-actions-items":[e.currentFolder],"show-actions-on-selection":!0,"side-bar-open":e.sideBarOpen,space:e.space},scopedSlots:e._u([{key:"actions",fn:function(t){var s=t.limitedScreenSpace;return[i("create-and-upload",{attrs:{space:e.space,item:e.item,"item-id":e.itemId,"limited-screen-space":s}})]}}])}),e._v(" "),e.areResourcesLoading?i("app-loading-spinner"):[e.folderNotFound?i("not-found-message",{staticClass:"files-not-found oc-height-1-1",attrs:{space:e.space}}):e.hasSpaceHeader?i("space-header",{staticClass:"oc-px-m oc-mt-m",attrs:{space:e.space,"side-bar-open":e.sideBarOpen}}):e._e(),e._v(" "),e.isEmpty?i("no-content-message",{staticClass:"files-empty",attrs:{id:"files-space-empty",icon:"folder"},scopedSlots:e._u([{key:"message",fn:function(){return[i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("No resources found")])]},proxy:!0},{key:"callToAction",fn:function(){return[i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v('\n Drag files and folders here or use the "New" or "Upload" buttons to add files\n ')])]},proxy:!0}],null,!1,3846670965)}):i("resource-table",{staticClass:"files-table",class:{"files-table-squashed":e.sideBarOpen},attrs:{id:"files-space-table","are-thumbnails-displayed":e.displayThumbnails,resources:e.paginatedResources,"target-route-callback":e.resourceTargetRouteCallback,"header-position":e.fileListHeaderY,"drag-drop":!0,"sort-by":e.sortBy,"sort-dir":e.sortDir,space:e.space},on:{fileDropped:e.fileDropped,fileClick:e.$_fileActions_triggerDefaultAction,rowMounted:e.rowMounted,sort:e.handleSort},scopedSlots:e._u([{key:"quickActions",fn:function(t){var s=t.resource;return[i("quick-actions",{staticClass:"oc-visible@s",class:s.preview,attrs:{item:s,actions:e.app.quickActions}})]}},{key:"contextMenu",fn:function(t){var s=t.resource;return[e.isResourceInSelection(s)?i("context-actions",{attrs:{space:e.space,items:e.selectedResources}}):e._e()]}},{key:"footer",fn:function(){return[i("pagination",{attrs:{pages:e.paginationPages,"current-page":e.paginationPage}}),e._v(" "),e.paginatedResources.length>0?i("list-info",{staticClass:"oc-width-1-1 oc-my-s",attrs:{files:e.totalFilesCount.files,folders:e.totalFilesCount.folders,size:e.totalFilesSize}}):e._e()]},proxy:!0}]),model:{value:e.selectedResourcesIds,callback:function(t){e.selectedResourcesIds=t},expression:"selectedResourcesIds"}})]],2),e._v(" "),i("side-bar",{attrs:{open:e.sideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space}})],1)};bs._withStripped=!0;const Ss=e.normalizeComponent({render:bs,staticRenderFns:[]},undefined,vs,undefined,false,undefined,!1,void 0,void 0,void 0);const _s=e.defineComponent({name:"GenericTrash",components:{AppBar:Lt,AppLoadingSpinner:p.__vue_component__,ContextActions:_t,FilesViewWrapper:ti,ListInfo:Nt,NoContentMessage:h.__vue_component__$1,Pagination:Ut,ResourceTable:Le,SideBar:Zt},props:{space:{type:Object,required:!1,default:null},itemId:{type:[String,Number],required:!1,default:null}},setup(i){const{$gettext:s}=v.useTranslations(),a=e.computed((()=>"personal"===i.space.driveType?s("You have no deleted files"):s("Space has no deleted files"))),r=t.useCapabilitySpacesEnabled(),n=e.computed((()=>{const t=[s("Deleted files")];return e.unref(r)&&t.unshift(i.space.name),t}));return m.useDocumentTitle({titleSegments:n}),{...be(),hasShareJail:t.useCapabilityShareJailEnabled(),noContentMessage:a}},computed:{...e.mapState("Files",["files"]),...e.mapGetters("Files",["highlightedFile","totalFilesCount"]),...e.mapGetters(["user"]),isEmpty(){return this.paginatedResources.length<1},breadcrumbs(){let e=!0,t=this.space?.name;return"personal"===this.space.driveType&&(t=this.hasShareJail?this.$gettext("Personal"):this.$gettext("All files"),e=!1),[{text:this.$gettext("Deleted files"),to:o.createLocationTrash("files-trash-generic")},{allowContextActions:e,text:t,onClick:()=>i.eventBus.publish("app.files.list.load")}]},showActions(){return!a.isProjectSpaceResource(this.space)||this.space.isEditor(this.user.uuid)||this.space.isManager(this.user.uuid)}},created(){this.performLoaderTask();const e=i.eventBus.subscribe("app.files.list.load",(()=>{this.performLoaderTask()}));this.$on("beforeDestroy",(()=>{i.eventBus.unsubscribe("app.files.list.load",e)}))},methods:{async performLoaderTask(){await this.loadResourcesTask.perform(this.space),this.refreshFileListHeaderPosition()}}});var ys=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex oc-width-1-1"},[i("files-view-wrapper",[i("app-bar",{attrs:{breadcrumbs:e.breadcrumbs,"has-bulk-actions":!0,"side-bar-open":e.sideBarOpen,space:e.space}}),e._v(" "),e.areResourcesLoading?i("app-loading-spinner"):[e.isEmpty?i("no-content-message",{staticClass:"files-empty",attrs:{id:"files-trashbin-empty",icon:"delete-bin-5"},scopedSlots:e._u([{key:"message",fn:function(){return[i("span",[e._v(e._s(e.noContentMessage))])]},proxy:!0}],null,!1,3695763555)}):i("resource-table",{staticClass:"files-table",class:{"files-table-squashed":e.sideBarOpen},attrs:{id:"files-trashbin-table","fields-displayed":["name","ddate"],"are-paths-displayed":!0,"are-thumbnails-displayed":!1,resources:e.paginatedResources,"are-resources-clickable":!1,"header-position":e.fileListHeaderY,"sort-by":e.sortBy,"sort-dir":e.sortDir,space:e.space,"has-actions":e.showActions},on:{sort:e.handleSort},scopedSlots:e._u([{key:"contextMenu",fn:function(t){var s=t.resource;return[e.isResourceInSelection(s)?i("context-actions",{attrs:{items:e.selectedResources,space:e.space}}):e._e()]}},{key:"footer",fn:function(){return[i("pagination",{attrs:{pages:e.paginationPages,"current-page":e.paginationPage}}),e._v(" "),e.paginatedResources.length>0?i("list-info",{staticClass:"oc-width-1-1 oc-my-s",attrs:{files:e.totalFilesCount.files,folders:e.totalFilesCount.folders}}):e._e()]},proxy:!0}]),model:{value:e.selectedResourcesIds,callback:function(t){e.selectedResourcesIds=t},expression:"selectedResourcesIds"}})]],2),e._v(" "),i("side-bar",{attrs:{open:e.sideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space}})],1)};ys._withStripped=!0;const ws=e.normalizeComponent({render:ys,staticRenderFns:[]},undefined,_s,undefined,false,undefined,!1,void 0,void 0,void 0);const xs=e.defineComponent({components:{DriveRedirect:Li,GenericSpace:Ss,GenericTrash:ws},setup(){const r=i.useStore(),l=n.useClientService(),c=t.useRouter(),d=t.useRouteParam("driveAliasAndItem"),u=Se(o.isLocationSpacesActive,"files-spaces-generic"),p=Se(o.isLocationTrashActive,"files-trash-generic"),h=m.useDriveResolver({store:r,driveAliasAndItem:d});return e.onMounted((async()=>{const t=e.unref(h.space);if(t&&a.isPublicSpaceResource(t)){let i=await(async()=>{const t=e.unref(h.space);try{return await l.webdav.getFileInfo(t)}catch(e){return console.error(e),t}})();s.linkRoleUploaderFolder.bitmask(!1)===i.publicLinkPermission&&c.push({name:o.locationPublicUpload.name,params:{token:t.id.toString()}})}})),{...h,driveAliasAndItem:d,isSpaceRoute:u,isTrashRoute:p}}});var Cs=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex oc-width-1-1"},[e.space?e.isTrashRoute?i("generic-trash",{attrs:{space:e.space,"item-id":e.itemId}}):i("generic-space",{attrs:{space:e.space,item:e.item,"item-id":e.itemId}}):i("drive-redirect",{attrs:{"drive-alias-and-item":e.driveAliasAndItem,"append-home-folder":e.isSpaceRoute}})],1)};Cs._withStripped=!0;const ks=e.normalizeComponent({render:Cs,staticRenderFns:[]},undefined,xs,undefined,false,undefined,!1,void 0,void 0,void 0);const Fs=e.defineComponent({setup:()=>({...n.useGraphClient()}),methods:{...e.mapActions(["showMessage","createModal","hideModal","setModalInputErrorMessage"]),...e.mapMutations("runtime/spaces",["UPSERT_SPACE"]),...e.mapMutations("Files",["SET_CURRENT_FOLDER","LOAD_FILES","CLEAR_CURRENT_FILES_LIST","SET_FILE_SELECTION","UPSERT_RESOURCE","UPDATE_RESOURCE_FIELD"]),showCreateSpaceModal(){const e={variation:"passive",title:this.$gettext("Create a new space"),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Create"),hasInput:!0,inputLabel:this.$gettext("Space name"),inputValue:this.$gettext("New space"),onCancel:this.hideModal,onConfirm:this.addNewSpace,onInput:this.checkSpaceName};this.createModal(e)},checkSpaceName(e){return""===e.trim()?this.setModalInputErrorMessage(this.$gettext("Space name cannot be empty")):e.length>255?this.setModalInputErrorMessage(this.$gettext("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.test(e)?this.setModalInputErrorMessage(this.$gettext('Space name cannot contain the following characters: / \\ . : ? * " > < |')):this.setModalInputErrorMessage(null)},async addNewSpace(e){try{const{data:t}=await this.graphClient.drives.createDrive({name:e},{});this.hideModal();const s=a.buildSpace({...t,serverUrl:i.configurationManager.serverUrl});this.UPSERT_RESOURCE(s),this.UPSERT_SPACE(s),await this.$clientService.webdav.createFolder(s,{path:".space"});const r=await this.$clientService.webdav.putFileContents(s,{path:".space/readme.md",content:this.$gettext("Here you can add a description for this Space.")}),{data:n}=await this.graphClient.drives.updateDrive(t.id,{special:[{specialFolder:{name:"readme"},id:r.id}]},{});this.UPDATE_RESOURCE_FIELD({id:t.id,field:"spaceReadmeData",value:n.special.find((e=>"readme"===e.specialFolder.name))})}catch(e){console.error(e),this.showMessage({title:this.$gettext("Creating space failed…"),status:"danger"})}}}});var Es=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Create a new space"),expression:"$gettext('Create a new space')"}],key:"new-space-menu-btn-enabled",attrs:{id:"new-space-menu-btn","aria-label":e.$gettext("Create a new space"),appearance:"filled",variation:"primary"},on:{click:e.showCreateSpaceModal}},[i("oc-icon",{attrs:{name:"add"}}),e._v(" "),i("translate",[e._v("New Space")])],1)};Es._withStripped=!0;const $s=e.normalizeComponent({render:Es,staticRenderFns:[]},undefined,Fs,undefined,false,undefined,!1,void 0,void 0,void 0);const Is=e.defineComponent({components:{FilesViewWrapper:ti,SideBar:Zt,AppBar:Lt,AppLoadingSpinner:p.__vue_component__,CreateSpace:$s,NoContentMessage:h.__vue_component__$1,SpaceContextActions:ds},setup(){const t=i.useStore(),s=e.computed((()=>t.getters["runtime/spaces/spaces"].filter((e=>a.isProjectSpaceResource(e))).sort(((e,t)=>e.name.localeCompare(t.name)))||[])),r=n.useAccessToken({store:t}),{graphClient:o}=n.useGraphClient(),l=e.C((function*(){t.commit("Files/CLEAR_FILES_SEARCHED"),t.commit("Files/CLEAR_CURRENT_FILES_LIST"),yield t.dispatch("runtime/spaces/reloadProjectSpaces",{graphClient:e.unref(o)}),t.commit("Files/LOAD_FILES",{currentFolder:null,files:e.unref(s)})})),c=e.computed((()=>l.isRunning||!l.last));return{...D(),spaces:s,graphClient:o,loadResourcesTask:l,areResourcesLoading:c,accessToken:r}},data:function(){return{imageContentObject:{}}},computed:{...e.mapGetters(["user"]),...e.mapGetters("Files",["highlightedFile"]),breadcrumbs(){return[{text:this.$gettext("Spaces"),onClick:()=>this.loadResourcesTask.perform()}]},hasCreatePermission(){return this.$permissionManager.hasSpaceManagement()}},watch:{spaces:{handler:async function(e){if(e)for(const e of this.spaces){if(!e.spaceImageData)continue;if(this.imageContentObject[e.id]?.fileId===e.spaceImageData?.id)continue;const t=decodeURI(e.spaceImageData.webDavUrl).split("/"),s=t.find((t=>t.startsWith(`${e.id}`)));if(!s)return;const a=t.slice(t.indexOf(s)+1).join("/"),r=await this.$clientService.webdav.getFileInfo(e,{path:a});g.loadPreview({resource:r,isPublic:!1,dimensions:w.Preview,server:i.configurationManager.serverUrl,userId:this.user.id,token:this.accessToken}).then((t=>{this.$set(this.imageContentObject,e.id,{fileId:e.spaceImageData.id,data:t})}))}},deep:!0,immediate:!0}},created(){this.loadResourcesTask.perform()},methods:{...e.mapActions(["showMessage"]),...e.mapMutations("Files",["SET_CURRENT_FOLDER","SET_FILE_SELECTION"]),getSpaceProjectRoute:e=>e.disabled?"#":o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(e,{path:"",fileId:e.fileId})),getSpaceCardAdditionalClass:e=>e.disabled?"state-trashed":"",openSidebarSharePanel(e){this.SET_FILE_SELECTION([e]),i.eventBus.publish(L.openWithPanel,"space-share-item")},getSpaceLinkProps(e){return e.disabled?{appearance:"raw"}:{to:this.getSpaceProjectRoute(e)}},getSpaceLinkListeners(e){return e.disabled?{click:()=>{this.showMessage({title:this.$gettext("Disabled spaces cannot be entered"),status:"warning"})}}:{}}}});var Ts=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex"},[i("files-view-wrapper",[i("app-bar",{attrs:{breadcrumbs:e.breadcrumbs,"has-view-options":!1,"has-sidebar-toggle":!0,"show-actions-on-selection":!0,"side-bar-open":e.sideBarOpen},scopedSlots:e._u([{key:"actions",fn:function(){return[e.hasCreatePermission?i("create-space"):e._e()]},proxy:!0}])}),e._v(" "),e.areResourcesLoading?i("app-loading-spinner"):[e.spaces.length?i("div",{staticClass:"spaces-list oc-px-m oc-mt-l"},[i("oc-list",{staticClass:"oc-flex"},e._l(e.spaces,(function(t){return i("li",{key:t.getDomSelector(),staticClass:"spaces-list-item oc-mb-m oc-mr-m"},[i("div",{staticClass:"spaces-list-card oc-card oc-card-default oc-rounded",class:e.getSpaceCardAdditionalClass(t),attrs:{"data-space-id":t.id}},[i("div",{staticClass:"oc-card-media-top oc-border-b"},[i(t.disabled?"oc-button":"router-link",e._g(e._b({tag:"component"},"component",e.getSpaceLinkProps(t),!1),e.getSpaceLinkListeners(t)),[t.disabled?i("oc-tag",{staticClass:"oc-position-absolute space-disabled-indicator",attrs:{type:"span"}},[i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Disabled")])]):e._e(),e._v(" "),e.imageContentObject[t.id]?i("img",{staticClass:"space-image oc-rounded-top",attrs:{src:e.imageContentObject[t.id].data,alt:""}}):i("oc-icon",{staticClass:"space-default-image oc-px-m oc-py-m",attrs:{name:"layout-grid",size:"xxlarge"}})],1)],1),e._v(" "),i("div",{staticClass:"oc-card-body oc-p-s"},[i("div",{staticClass:"oc-flex oc-flex-between oc-flex-middle"},[i("div",{staticClass:"oc-flex oc-flex-middle oc-text-truncate"},[i("oc-icon",{staticClass:"oc-mr-s",attrs:{name:"layout-grid"}}),e._v(" "),i(t.disabled?"oc-button":"router-link",e._g(e._b({tag:"component",staticClass:"space-name oc-text-left oc-text-truncate"},"component",e.getSpaceLinkProps(t),!1),e.getSpaceLinkListeners(t)),[i("span",{domProps:{textContent:e._s(t.name)}})])],1),e._v(" "),i("div",{staticClass:"oc-flex oc-flex-middle"},[i("div",[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Show members"),expression:"$gettext('Show members')"}],attrs:{"aria-label":e.$gettext("Show members"),appearance:"raw"},on:{click:function(i){return e.openSidebarSharePanel(t)}}},[i("oc-icon",{attrs:{name:"group","fill-type":"line"}})],1)],1),e._v(" "),i("div",[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Show context menu"),expression:"$gettext('Show context menu')"}],attrs:{id:"space-context-btn-"+t.getDomSelector(),"aria-label":e.$gettext("Show context menu"),appearance:"raw"}},[i("oc-icon",{attrs:{name:"more-2"}})],1),e._v(" "),i("oc-drop",{attrs:{"drop-id":"space-context-drop-"+t.getDomSelector(),toggle:"#space-context-btn-"+t.getDomSelector(),mode:"click","close-on-click":"",options:{delayHide:0},"padding-size":"small",position:"bottom-end"}},[i("space-context-actions",{attrs:{items:[t],space:t}})],1)],1)])]),e._v(" "),t.description?i("p",{staticClass:"oc-text-left oc-ml-xs oc-mt-xs oc-mb-rm oc-text-truncate"},[i("small",{domProps:{textContent:e._s(t.description)}})]):e._e()])])])})),0)],1):i("no-content-message",{staticClass:"files-empty",attrs:{id:"files-spaces-empty",icon:"layout-grid"},scopedSlots:e._u([{key:"message",fn:function(){return[i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("You don't have access to any spaces")])]},proxy:!0}],null,!1,960882363)})]],2),e._v(" "),i("side-bar",{attrs:{open:e.sideBarOpen,"active-panel":e.sideBarActivePanel,space:e.highlightedFile}})],1)};Ts._withStripped=!0;const Rs=e.normalizeComponent({render:Ts,staticRenderFns:[]},undefined,Is,undefined,false,undefined,!1,void 0,void 0,void 0);const Ls=async(e,t=!1)=>{const i=e.size||w.Avatar;if(t)return Ds({...e,size:i});const s=[e.server,"remote.php/dav/avatars/",e.username,`/${i}.png`].join(""),{status:a,statusText:r}=await e.clientService.httpAuthenticated(e.token).head(s);if(200!==a)throw new Error(r);const{owncloudSdk:n}=e.clientService;return n&&"function"==typeof n.signUrl?n.signUrl(s):s},Ds=async e=>{const t=i.cacheService.avatarUrl.get(e.username);if(t&&t.size===e.size)return t.src;try{const t=await Ls(e);return i.cacheService.avatarUrl.set(e.username,{src:t,size:e.size},0).src}catch(e){}},As=t=>e.get(t,"capabilities.files_sharing.resharing",!0);function Ps(e){const t=new Set;return e.forEach((e=>{t.add(e.shareType)})),Array.from(t)}function Ms(e,t,i){const s=[...e.files];let a=s.findIndex((e=>e.id===t.id));t.webDavPath&&t.webDavPath.length&&-1===a&&(a=s.findIndex((e=>e.webDavPath===t.webDavPath)));const r=a>-1;e.filesSearched=null,(r||i)&&(r?s.splice(a,1,t):s.push(t),e.files=s)}var Os={namespaced:!0,state:{currentFolder:null,files:[],filesSearched:null,selectedIds:[],latestSelectedId:null,clipboardSpace:null,clipboardResources:[],clipboardAction:null,versions:[],currentFileOutgoingShares:[],incomingShares:[],sharesTree:{},sharesTreeError:null,sharesTreeLoading:!1,areHiddenFilesShown:!0,areFileExtensionsShown:!0},getters:{selectedFiles:(e,t)=>t.filesAll.filter((t=>e.selectedIds.includes(t.id))),files:e=>e.files,filesAll:e=>e.filesSearched||e.files,currentFolder:e=>e.currentFolder,clipboardResources:e=>e.clipboardResources,clipboardAction:e=>e.clipboardAction,activeFiles:(e,t)=>{let i=[].concat(t.filesAll);return e.areHiddenFilesShown||(i=i.filter((e=>!e.name.startsWith(".")))),i},totalFilesSize:(e,t)=>t.filesAll.map((e=>parseInt(e.size))).reduce(((e,t)=>e+t),0),totalFilesCount:(e,t)=>({files:t.filesAll.filter((e=>"file"===e.type)).length,folders:t.filesAll.filter((e=>"folder"===e.type)).length}),currentFileOutgoingCollaborators:e=>e.currentFileOutgoingShares.filter((e=>s.ShareTypes.containsAnyValue(s.ShareTypes.authenticated,[e.shareType]))),currentFileOutgoingLinks:e=>e.currentFileOutgoingShares.filter((e=>s.ShareTypes.containsAnyValue(s.ShareTypes.unauthenticated,[e.shareType]))),sharesTree:e=>e.sharesTree,sharesTreeLoading:e=>e.sharesTreeLoading,quota:e=>e.quota,highlightedFile:(e,t)=>t.selectedFiles.length>0?t.selectedFiles[0]:e.currentFolder,versions:e=>e.versions},actions:{loadFiles(e,{currentFolder:t,files:i}){t&&(t=a.buildResource(t)),i=i.map(a.buildResource),e.commit("LOAD_FILES",{currentFolder:t,files:i})},toggleFileSelection(e,t){e.state.selectedIds.includes(t.id)?e.commit("REMOVE_FILE_SELECTION",t):e.commit("ADD_FILE_SELECTION",t)},copySelectedFiles(e,t){e.commit("CLIPBOARD_SELECTED",t),e.commit("SET_CLIPBOARD_ACTION",Ie.Copy),e.dispatch("showMessage",{title:T("Copied to clipboard!"),status:"success"},{root:!0})},cutSelectedFiles(e,t){e.commit("CLIPBOARD_SELECTED",t),e.commit("SET_CLIPBOARD_ACTION",Ie.Cut),e.dispatch("showMessage",{title:T("Cut to clipboard!"),status:"success"},{root:!0})},clearClipboardFiles(e){e.commit("CLEAR_CLIPBOARD")},async pasteSelectedFiles(e,{targetSpace:t,clientService:i,createModal:s,hideModal:a,showMessage:r,$gettext:n,$gettextInterpolate:o,$ngettext:l}){const c=new Fe(e.state.clipboardSpace,e.state.clipboardResources,t,e.state.currentFolder,i,s,a,r,n,l,o);let d=[];e.state.clipboardAction===Ie.Cut&&(d=await c.perform(ke.MOVE)),e.state.clipboardAction===Ie.Copy&&(d=await c.perform(ke.COPY)),e.commit("CLEAR_CLIPBOARD");const u=[];for(const s of d)u.push((async()=>{const a=await i.webdav.getFileInfo(t,s);e.commit("UPSERT_RESOURCE",a)})());await Promise.all(u)},resetFileSelection(e){e.commit("RESET_SELECTION")},markFavorite(e,t){const i=t.file,s=t.client,a=!i.starred;return s.files.favorite(i.webDavPath,a).then((()=>{e.commit("UPDATE_RESOURCE_FIELD",{id:i.id,field:"starred",value:a})})).catch((e=>{throw new Error(e)}))},deleteFiles(e,{space:t,files:i,clientService:s,firstRun:a=!0}){const r=[],n=[];for(const o of i){const i=s.webdav.deleteFile(t,o).then((()=>{n.push(o)})).catch((i=>{let r=T('Failed to delete "%{file}"');if(423===i.statusCode){if(a)return e.dispatch("deleteFiles",{space:t,files:[o],clientService:s,firstRun:!1});r=T('Failed to delete "%{file}" - the file is locked')}const n=R(r,{file:o.name},!0);e.dispatch("showMessage",{title:n,status:"danger"},{root:!0})}));r.push(i)}return Promise.all(r).then((()=>{e.commit("REMOVE_FILES",n),e.commit("REMOVE_FILES_FROM_SEARCHED",n),e.commit("RESET_SELECTION")}))},clearTrashBin(e){e.commit("CLEAR_FILES"),e.commit("RESET_SELECTION"),e.commit("CLEAR_FILES_SEARCHED")},removeFilesFromTrashbin(e,t){e.commit("REMOVE_FILES",t),e.commit("REMOVE_FILES_FROM_SEARCHED",t),e.commit("RESET_SELECTION")},updateCurrentFileShareTypes({state:e,getters:t,commit:i}){const s=t.highlightedFile;s&&i("UPDATE_RESOURCE_FIELD",{id:s.id,field:"shareTypes",value:Ps(e.currentFileOutgoingShares)})},async changeShare({commit:e,dispatch:t,getters:i,rootGetters:s},{client:a,share:r,permissions:n,expirationDate:o,role:l}){if(!n&&!l)throw new Error("Nothing changed");try{e("CURRENT_FILE_OUTGOING_SHARES_UPSERT",K((await a.shares.updateShare(r.id,{role:l.name,permissions:n,expireDate:o})).shareInfo,i.highlightedFile,As(s)))}catch(e){t("showMessage",{title:T("Error while editing the share."),status:"danger"},{root:!0})}},addShare(e,{client:t,path:i,shareWith:a,shareType:r,permissions:n,role:o,expirationDate:l,storageId:c}){const d=r===s.ShareTypes.group.value,u={permissions:n,role:o.name,expirationDate:l,spaceRef:c,remoteUser:void 0};d||(u.remoteUser=r===s.ShareTypes.remote.value);const p=d?"shareFileWithGroup":"shareFileWithUser";return t.shares[p](i,a,u).then((s=>{e.commit("CURRENT_FILE_OUTGOING_SHARES_UPSERT",K(s.shareInfo,e.getters.highlightedFile,As(e.rootGetters))),e.dispatch("updateCurrentFileShareTypes"),e.dispatch("loadIndicators",{client:t,currentFolder:i,storageId:c})})).catch((t=>{e.dispatch("showMessage",{title:T("Error while sharing."),desc:t,status:"danger"},{root:!0})}))},deleteShare:(e,{client:t,share:i,path:s,storageId:a,loadIndicators:r=!1})=>t.shares.deleteShare(i.id,{}).then((()=>{e.commit("CURRENT_FILE_OUTGOING_SHARES_REMOVE",i),e.dispatch("updateCurrentFileShareTypes"),r&&e.dispatch("loadIndicators",{client:t,currentFolder:s,storageId:a})})),pruneSharesTreeOutsidePath(e,t){e.commit("SHARESTREE_PRUNE_OUTSIDE_PATH",t)},loadSharesTree(t,{client:i,path:s,storageId:a,includeRoot:r=!1,useCached:n=!0}){t.commit("SHARESTREE_ERROR",null),t.dispatch("pruneSharesTreeOutsidePath",s),t.commit("INCOMING_SHARES_LOAD",[]),t.commit("CURRENT_FILE_OUTGOING_SHARES_SET",[]),t.commit("SHARESTREE_LOADING",!0);const o="/"===s&&r?["/"]:$(s,!0),l={},c=[],d=[],u=new e._default({concurrency:2}),p=[],{highlightedFile:h}=t.getters,m=(e,s,a,r)=>{const n=r?J:K,o=s||!h?{type:"folder"}:h,u=r?c:d,p=As(t.rootGetters);return l[e]||(l[e]=[]),i.shares.getShares(e,a).then((t=>{t.forEach((t=>{const i={...n(t.shareInfo,o,p),outgoing:r,indirect:s};l[e].push(i),s||u.push(i)}))})).catch((e=>{console.error("SHARESTREE_ERROR",e),t.commit("SHARESTREE_ERROR",e.message)}))};return s||p.push(m(s,!1,{reshares:!0,spaceRef:a},!0)),o.forEach((e=>{const i=s!==e,r=i?null:a;t.getters.sharesTree[e]&&n?l[e]=t.getters.sharesTree[e].map((e=>{if(!i){(e.outgoing?c:d).push({...e,indirect:i})}return{...e,indirect:i}})):(p.push(u.add((()=>m(e,i,{reshares:!0,spaceRef:r},!0)))),p.push(u.add((()=>m(e,i,{shared_with_me:!0,spaceRef:r},!1)))))})),Promise.all(p).then((()=>{t.commit("SHARESTREE_ADD",l),t.commit("SHARESTREE_LOADING",!1),t.commit("CURRENT_FILE_OUTGOING_SHARES_SET",c),t.commit("INCOMING_SHARES_LOAD",d)}))},async loadVersions(e,{client:t,fileId:i}){let s;try{s=await t.fileVersions.listVersions(i)}catch(e){console.error(e),s=[]}e.commit("SET_VERSIONS",s)},addLink:(e,{path:t,client:i,params:s,storageId:a})=>new Promise(((r,n)=>{i.shares.shareFileWithLink(t,{...s,spaceRef:a}).then((s=>{const n=J(s.shareInfo,null,As(e.rootGetters));e.commit("CURRENT_FILE_OUTGOING_SHARES_UPSERT",n),e.dispatch("updateCurrentFileShareTypes"),e.dispatch("loadIndicators",{client:i,currentFolder:t,storageId:a}),r(n)})).catch((e=>{n(e)}))})),updateLink:(e,{id:t,client:i,params:s})=>new Promise(((a,r)=>{i.shares.updateShare(t,s).then((t=>{const i=J(t.shareInfo,null,As(e.rootGetters));e.commit("CURRENT_FILE_OUTGOING_SHARES_UPSERT",i),a(i)})).catch((e=>{r(e)}))})),removeLink:(e,{share:t,client:i,path:s,storageId:a,loadIndicators:r=!1})=>i.shares.deleteShare(t.id).then((()=>{e.commit("CURRENT_FILE_OUTGOING_SHARES_REMOVE",t),e.dispatch("updateCurrentFileShareTypes"),r&&e.dispatch("loadIndicators",{client:i,currentFolder:s,storageId:a})})),pushResourcesToDeleteList({commit:e},t){e("PUSH_RESOURCES_TO_DELETE_LIST",t)},async loadIndicators({dispatch:t,commit:i},{client:s,currentFolder:a,storageId:r}){i("SHARESTREE_PRUNE_OUTSIDE_PATH",e.dirname(a)),await t("loadSharesTree",{client:s,path:a,storageId:r,includeRoot:"/"===a}),i("LOAD_INDICATORS",a)},loadAvatars({commit:t,rootGetters:i},{resource:s}){i.capabilities.files_sharing.user.profile_picture&&["sharedWith","owner"].forEach((a=>{(s[a]||[]).forEach(((r,n)=>{e.has(r,"avatar")&&Ls({clientService:this.$clientService,username:r.username,server:i.configuration.server,token:i["runtime/auth/accessToken"]},!0).then((e=>t("UPDATE_RESOURCE_FIELD",{id:s.id,field:`${a}.[${n}].avatar`,value:e})))}))}))},async loadPreview({commit:e,rootGetters:t},{resource:i,isPublic:s,dimensions:a,type:r}){if(!Ue.available||!Ue.isMimetypeSupported(i.mimeType))return;const n=await g.loadPreview({resource:i,isPublic:s,dimensions:a,server:t.configuration.server,userId:t.user.id,token:t["runtime/auth/accessToken"]},!0);n&&e("UPDATE_RESOURCE_FIELD",{id:i.id,field:r,value:n})}},mutations:{LOAD_FILES(e,{currentFolder:t,files:i}){e.currentFolder=t,e.files=i},SET_CURRENT_FOLDER(e,t){e.currentFolder=t},CLEAR_FILES(e){e.files=[]},LOAD_FILES_SEARCHED(e,t){e.filesSearched=t},REMOVE_FILES_FROM_SEARCHED(e,t){e.filesSearched&&(e.filesSearched=e.filesSearched.filter((e=>!t.find((t=>t.id===e.id)))))},CLEAR_FILES_SEARCHED(e){e.filesSearched=null},CLEAR_CLIPBOARD(e){e.clipboardSpace=null,e.clipboardResources=[],e.clipboardAction=null},CLIPBOARD_SELECTED(e,{space:t,resources:i}){e.clipboardSpace=t,e.clipboardResources=i},SET_CLIPBOARD_ACTION(e,t){e.clipboardAction=t},SET_LATEST_SELECTED_FILE_ID(e,t){e.latestSelectedId=t},SET_FILE_SELECTION(e,t){const i=t.find((t=>!e.selectedIds.includes(t.id)));i&&(e.latestSelectedId=i.id),e.selectedIds=t.map((e=>e.id))},SET_SELECTED_IDS(e,t){const i=t.find((t=>!e.selectedIds.includes(t)));i&&(e.latestSelectedId=i),e.selectedIds=t},ADD_FILE_SELECTION(e,t){const i=[...e.selectedIds],s=i.findIndex((e=>e===t.id));e.latestSelectedId=t.id,-1===s&&(i.push(t.id),e.selectedIds=i)},REMOVE_FILE_SELECTION(e,t){const i=[...e.selectedIds];e.latestSelectedId=t.id,i.length>1?e.selectedIds=i.filter((e=>t.id!==e)):e.selectedIds=[]},RESET_SELECTION(e){e.selectedIds=[]},REMOVE_FILES(e,t){e.files=[...e.files].filter((e=>!t.find((t=>t.id===e.id))))},CURRENT_FILE_OUTGOING_SHARES_SET(e,t){e.currentFileOutgoingShares=t},CURRENT_FILE_OUTGOING_SHARES_REMOVE(e,t){e.currentFileOutgoingShares=e.currentFileOutgoingShares.filter((e=>t.id!==e.id))},CURRENT_FILE_OUTGOING_SHARES_UPSERT(t,i){const s=t.currentFileOutgoingShares.findIndex((e=>e.id===i.id));s>=0?e.Vue.set(t.currentFileOutgoingShares,s,i):t.currentFileOutgoingShares.push(i)},INCOMING_SHARES_LOAD(e,t){e.incomingShares=t},SHARESTREE_PRUNE_OUTSIDE_PATH(t,i){""!==i&&"/"!==i?("/"!==(i+="/").charAt(0)&&(i="/"+i),t.sharesTree=e.pickBy(t.sharesTree,((e,t)=>i.startsWith(t+"/")))):t.sharesTree={}},SHARESTREE_ADD(e,t){e.sharesTree=Object.assign({},e.sharesTree,t)},SHARESTREE_ERROR(e,t){e.sharesTreeError=t},SHARESTREE_LOADING(e,t){e.sharesTreeLoading=t},CLEAR_CURRENT_FILES_LIST(e){e.currentFolder=null,e.selectedIds=[],e.files.forEach((e=>{e.previewUrl&&e.previewUrl.startsWith("blob:")&&window.URL.revokeObjectURL(e.previewUrl)})),e.files=[]},SET_VERSIONS(e,t){e.versions=t},LOAD_INDICATORS(e,t){const i=e.files.filter((e=>e.path.startsWith(t)));for(const t of i){const i=q(t,e.sharesTree);(i.length||t.indicators.length)&&this.commit("Files/UPDATE_RESOURCE_FIELD",{id:t.id,field:"indicators",value:i})}},UPSERT_RESOURCE(e,t){Ms(e,t,!0)},UPDATE_RESOURCE(e,t){Ms(e,t,!1)},UPDATE_RESOURCE_FIELD(t,i){let s=t.filesSearched||t.files,a=s.findIndex((e=>e.id===i.id));if(a<0){if(t.currentFolder?.id!==i.id)return;s=[t.currentFolder],a=0}const r=s[a],n=e.has(r,i.field),o=e.set(r,i.field,i.value);n||e.Vue.set(s,a,o)},SET_HIDDEN_FILES_VISIBILITY(e,t){e.areHiddenFilesShown=t,window.localStorage.setItem("oc_hiddenFilesShown",t)},SET_FILE_EXTENSIONS_VISIBILITY(e,t){e.areFileExtensionsShown=t,window.localStorage.setItem("oc_fileExtensionsShown",t)}}};const Ns=new i.VisibilityObserver;const Bs=e.defineComponent({mixins:[Ke],props:{searchResult:{type:Object,default:function(){return{}}},provider:{type:Object,default:function(){return{}}}},setup(){const e=i.useStore();return{hasShareJail:t.useCapabilityShareJailEnabled(),accessToken:n.useAccessToken({store:e})}},computed:{...e.mapGetters(["configuration","user"]),...e.mapState("runtime/spaces",["spaces"]),attrs(){return this.resource.isFolder?{to:this.createFolderLink(this.resource.path,this.resource.fileId)}:{}},listeners(){return this.resource.isFolder?{}:{click:()=>this.$_fileActions_triggerDefaultAction({space:this.matchingSpace,resources:[this.resource]})}},resource(){return this.searchResult.data},matchingSpace(){const t=this.spaces.find((e=>e.id===this.resource.storageId));return t||a.buildShareSpaceResource({shareId:this.resource.shareId,shareName:e.basename(this.resource.shareRoot),serverUrl:i.configurationManager.serverUrl})},defaultParentFolderName(){return this.resource.shareId?"/"===this.resource.path?this.$gettext("Shared with me"):e.basename(this.resource.shareRoot):this.hasShareJail?"project"===this.matchingSpace?.driveType?this.matchingSpace.name:this.$gettext("Personal"):this.$gettext("All files and folders")},displayThumbnails(){return!this.configuration?.options?.disablePreviews},folderLink(){return this.createFolderLink(this.resource.path,this.resource.fileId)},parentFolderLink(){return this.resource.shareId&&"/"===this.resource.path?o.createLocationShares("files-shares-with-me"):this.createFolderLink(e.dirname(this.resource.path),this.resource.parentFolderId)}},mounted(){if(!this.displayThumbnails)return;const t=e.debounce((async({unobserve:t})=>{t();const i=await g.loadPreview({resource:this.resource,isPublic:!1,dimensions:w.Thumbnail,server:this.configuration.server,userId:this.user.id,token:this.accessToken},!0);i&&e.Vue.set(this.resource,x.Thumbnail,i)}),250);Ns.observe(this.$el,{onEnter:t,onExit:t.cancel})},beforeDestroy(){Ns.disconnect()},methods:{parentFolderClicked(){i.eventBus.publish("app.search.options-drop.hide")},createFolderLink(e,i){return this.matchingSpace?o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(this.matchingSpace,{path:e,fileId:i})):{}}}});var zs=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("oc-button",e._g(e._b({staticClass:"files-search-preview oc-flex oc-width-1-1",attrs:{type:e.resource.isFolder?"router-link":"button","justify-content":"left",appearance:"raw"}},"oc-button",e.attrs,!1),e.listeners),[i("oc-resource",{attrs:{resource:e.resource,"is-path-displayed":!0,"is-resource-clickable":!1,"parent-folder-link":e.parentFolderLink,"parent-folder-name-default":e.defaultParentFolderName,"is-thumbnail-displayed":e.displayThumbnails},on:{parentFolderClicked:e.parentFolderClicked}})],1)};zs._withStripped=!0;const Us=e.normalizeComponent({render:zs,staticRenderFns:[]},undefined,Bs,undefined,false,undefined,!1,void 0,void 0,void 0);class qs{component;cache;router;store;constructor(e,t){this.component=Us,this.router=t,this.store=e,this.cache=new i.Cache({ttl:1e4,capacity:100})}async search(e){if(!e)return{totalResults:null,values:[]};if(this.cache.has(e))return this.cache.get(e);const t=this.store.state.Files?.areHiddenFilesShown,{range:i,results:r}=await d.clientService.owncloudSdk.files.search(e,8,s.DavProperties.Default),n=r.reduce(((e,i)=>{const s=a.buildResource(i);return s.storageId||(s.storageId=this.store.getters.user.id),s.name.startsWith(".")&&!t||e.push({id:s.id,data:{...s}}),e}),[]);return this.cache.set(e,{totalResults:i?parseInt(i?.split("/")[1]):null,values:n})}get available(){return"search-provider-list"!==this.router.currentRoute.name}}const js=new i.VisibilityObserver;const Vs=e.defineComponent({components:{AppBar:Lt,SideBar:Zt,AppLoadingSpinner:p.__vue_component__,ContextActions:_t,ListInfo:Nt,Pagination:Ut,NoContentMessage:h.__vue_component__$1,ResourceTable:Le,FilesViewWrapper:ti},mixins:[Ke,Ai],props:{searchResult:{type:Object,default:function(){return{totalResults:null,values:[]}}},loading:{type:Boolean,default:!1}},setup(){const t=i.useStore();return{...be(),getSpace:s=>s.shareId?a.buildShareSpaceResource({shareId:s.shareId,shareName:e.basename(s.shareRoot),serverUrl:i.configurationManager.serverUrl}):t.getters["runtime/spaces/spaces"].find((e=>e.id===s.storageId))}},computed:{...e.mapGetters(["configuration"]),...e.mapGetters("Files",["highlightedFile","totalFilesCount","totalFilesSize"]),displayThumbnails(){return!this.configuration?.options?.disablePreviews},itemCount(){return this.totalFilesCount.files+this.totalFilesCount.folders},rangeSupported(){return this.searchResult.totalResults},searchResultExceedsLimit(){return!this.rangeSupported||this.searchResult.totalResults&&this.searchResult.totalResults>Ws},searchResultExceedsLimitText(){if(!this.rangeSupported){const e=this.$gettext("Showing up to %{searchLimit} results");return this.$gettextInterpolate(e,{searchLimit:Ws})}const e=this.$gettext("Found %{totalResults}, showing the %{itemCount} best matching results");return this.$gettextInterpolate(e,{itemCount:this.itemCount,totalResults:this.searchResult.totalResults})}},watch:{searchResult:{handler:function(){this.searchResult&&(this.CLEAR_CURRENT_FILES_LIST(),this.LOAD_FILES({currentFolder:null,files:this.searchResult.values.length?this.searchResult.values.map((e=>e.data)):[]}))}}},beforeDestroy(){js.disconnect()},methods:{...e.mapMutations("Files",["CLEAR_CURRENT_FILES_LIST","LOAD_FILES"]),...e.mapActions("Files",["loadPreview"]),rowMounted(t,i){if(!this.displayThumbnails)return;const s=e.debounce((({unobserve:e})=>{e(),this.loadPreview({resource:t,isPublic:!1,dimensions:w.Thumbnail,type:x.Thumbnail})}),250);js.observe(i.$el,{onEnter:s,onExit:s.cancel})}}});var Gs=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"files-search-result oc-flex"},[i("files-view-wrapper",[i("app-bar",{attrs:{"has-bulk-actions":!1,"side-bar-open":e.sideBarOpen}}),e._v(" "),e.loading?i("app-loading-spinner"):[e.paginatedResources.length?i("resource-table",{staticClass:"files-table",class:{"files-table-squashed":!1},attrs:{resources:e.paginatedResources,"are-paths-displayed":!0,"are-thumbnails-displayed":e.displayThumbnails,"has-actions":!0,"is-selectable":!1,"sort-by":e.sortBy,"sort-dir":e.sortDir},on:{fileClick:e.$_fileActions_triggerDefaultAction,rowMounted:e.rowMounted,sort:e.handleSort},scopedSlots:e._u([{key:"contextMenu",fn:function(t){var s=t.resource;return[e.isResourceInSelection(s)?i("context-actions",{attrs:{items:e.selectedResources,space:e.getSpace(s)}}):e._e()]}},{key:"footer",fn:function(){return[i("pagination",{attrs:{pages:e.paginationPages,"current-page":e.paginationPage}}),e._v(" "),e.searchResultExceedsLimit?i("div",{staticClass:"oc-text-nowrap oc-text-center oc-width-1-1 oc-my-s",domProps:{textContent:e._s(e.searchResultExceedsLimitText)}}):e.paginatedResources.length>0?i("list-info",{staticClass:"oc-width-1-1 oc-my-s",attrs:{files:e.totalFilesCount.files,folders:e.totalFilesCount.folders,size:e.totalFilesSize}}):e._e()]},proxy:!0}]),model:{value:e.selectedResourcesIds,callback:function(t){e.selectedResourcesIds=t},expression:"selectedResourcesIds"}}):i("no-content-message",{staticClass:"files-empty",attrs:{icon:"search","icon-fill-type":"line"},scopedSlots:e._u([{key:"message",fn:function(){return[i("p",{staticClass:"oc-text-muted"},[e.$route.query.term?i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("No results found")]):i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("No search term entered")])])]},proxy:!0}],null,!1,495847131)})]],2),e._v(" "),i("side-bar",{attrs:{open:e.sideBarOpen,"active-panel":e.sideBarActivePanel,space:e.selectedResourceSpace}})],1)};Gs._withStripped=!0;const Hs=e.normalizeComponent({render:Gs,staticRenderFns:[]},undefined,Vs,undefined,false,undefined,!1,void 0,void 0,void 0),Ws=200;class Qs{component;store;constructor(e){this.component=Hs,this.store=e}async search(e){if(!e)return{totalResults:null,values:[]};const{range:t,results:i}=await d.clientService.owncloudSdk.files.search(e,Ws,s.DavProperties.Default);return{totalResults:t?parseInt(t?.split("/")[1]):null,values:i.map((e=>{const t=a.buildResource(e);return t.storageId||(t.storageId=this.store.getters.user.id),{id:t.id,data:t}}))}}}class Js extends i.EventBus{id;displayName;previewSearch;listSearch;store;router;constructor(e,t){super(),this.id="files.sdk",this.displayName="Files",this.previewSearch=new qs(e,t),this.listSearch=new Qs(e),this.store=e,this.router=t}get available(){return this.store.getters.capabilities?.dav?.reports?.includes("search-files")}}const Ys=e.defineComponent({name:"FileDetails",setup(){const t=i.useStore();return{isPublicLinkContext:m.usePublicLinkContext({store:t}),accessToken:n.useAccessToken({store:t}),space:e.inject("displayedSpace"),file:e.inject("displayedItem")}},data:()=>({loading:!1,copiedDirect:!1,copiedEos:!1,timeout:null}),computed:{...e.mapGetters("runtime/spaces",["spaces"]),...e.mapGetters("Files",["versions","sharesTree","sharesTreeLoading","highlightedFile"]),...e.mapGetters(["user","configuration"]),matchingSpace(){return this.space||this.spaces.find((e=>e.id===this.file.storageId))},runningOnEos(){return!!this.configuration?.options?.runningOnEos},hasContent(){return this.hasTimestamp||this.ownerDisplayName||this.showSize||this.showShares||this.showVersions},noContentText(){return this.$gettext("No information to display")},detailsTableLabel(){return this.$gettext("Overview of the information about the selected file")},sharedViaLabel(){return this.$gettext("Shared via")},sharedViaTooltip(){return this.$gettextInterpolate(this.$gettext("Navigate to '%{folder}'"),{folder:this.sharedParentDir||""},!0)},showSharedBy(){return this.showShares&&!this.ownedByCurrentUser&&!this.sharesTreeLoading&&this.sharedByDisplayName&&this.sharedByName!==this.file.ownerId},showSharedVia(){return this.showShares&&!this.sharesTreeLoading&&this.file.path!==this.sharedParentDir&&this.sharedParentDir},sharedParentRoute(){if(this.file.shareId){if(""===this.file.path)return{};const s=a.buildShareSpaceResource({shareId:this.file.shareId,shareName:e.basename(this.file.shareRoot),serverUrl:i.configurationManager.serverUrl});return o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(s,{path:this.file.path,fileId:this.file.fileId}))}return this.matchingSpace?o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(this.matchingSpace,{path:this.sharedParentDir,fileId:this.sharedParentFileId})):{}},showShares(){return!this.isPublicLinkContext&&this.hasAnyShares},detailSharingInformation(){return"folder"===this.file.type?this.$gettext("This folder has been shared."):this.$gettext("This file has been shared.")},sharedByLabel(){return this.$gettext("Shared by")},hasTimestamp(){return this.file.mdate?.length>0},timestampLabel(){return this.$gettext("Last modified")},ownerLabel(){return this.$gettext("Owner")},ownerDisplayName(){return this.file.ownerDisplayName||this.file.shareOwnerDisplayname||this.file.owner?.[0].displayName},ownerAdditionalInfo(){return this.file.owner?.[0].additionalInfo},directLink(){return`${this.configuration.server}files/spaces/personal/home${d.encodePath(this.file.path)}`},directLinkLabel(){return this.$gettext("Direct link")},copyDirectLinkLabel(){return this.$gettext("Copy direct link")},eosPathLabel(){return this.$gettext("EOS Path")},copyEosPathLabel(){return this.$gettext("Copy EOS path")},resourceSize(){return r.formatFileSize(this.file.size,this.$language.current)},showSize(){return"?"!==this.resourceSize},sizeLabel(){return this.$gettext("Size")},showVersions(){if("folder"!==this.file.type&&!this.isPublicLinkContext)return this.versions.length>0},versionsLabel(){return this.$gettext("Versions")},seeVersionsLabel(){return this.$gettext("See all versions")},capitalizedTimestamp(){const t=r.formatDateFromHTTP(this.file.mdate,this.$language.current);return e.upperFirst(t)},hasAnyShares(){return this.file.shareTypes?.length>0||this.file.indicators?.length>0||null!==this.sharedItem},ownedByCurrentUser(){return this.file.ownerId===this.user.id||this.file.owner?.[0].username===this.user.id||this.file.shareOwner===this.user.id},shareIndicators(){return q(this.file,this.sharesTree)},shares(){return null===this.sharedParentDir?[]:this.sharesTree[this.sharedParentDir]?.filter((e=>s.ShareTypes.containsAnyValue([...s.ShareTypes.individuals,...s.ShareTypes.unauthenticated],[e.shareType])))},sharedItem(){return this.shares.length?this.shares[0]:null},sharedByName(){return this.sharedItem?.owner?.name},sharedByDisplayName(){let e=this.sharedItem?.owner?.displayName;return this.sharedItem?.owner?.additionalInfo&&(e+=" ("+this.sharedItem.owner.additionalInfo+")"),e},sharedParentDir(){return this.getParentSharePath(this.file.path,this.sharesTree)},sharedParentFileId(){return this.sharedItem?.file?.source}},watch:{file:{handler:function(){this.loadData()},immediate:!0}},asyncComputed:{preview:{async get(){return await new Promise((e=>setTimeout(e,500))),g.loadPreview({resource:this.file,isPublic:this.isPublicLinkContext,dimensions:w.Preview,server:this.configuration.server,userId:this.user.id,token:this.accessToken})},lazy:!0,watch:["file.id"]}},methods:{...e.mapActions("Files",["loadPreview","loadVersions"]),getParentSharePath(t,i){let s=t;if(!s)return null;for(;"/"!==s;){const t=i[s];if(void 0!==t&&void 0!==t[0])return s;s=e.dirname(s)}return null},expandVersionsPanel(){i.eventBus.publish(L.setActivePanel,"versions-item")},async loadData(){const e=[];"file"!==this.file.type||this.isPublicLinkContext||e.push(this.loadVersions({client:this.$client,fileId:this.file.id})),await Promise.all(e.map((e=>e.catch((e=>e))))),this.loading=!1},copyEosPathToClipboard(){e.copyToClipboard(this.file.path),this.copiedEos=!0,this.clipboardSuccessHandler(),this.showMessage({title:this.$gettext("EOS path copied"),desc:this.$gettext("The EOS path has been copied to your clipboard.")})},copyDirectLinkToClipboard(){e.copyToClipboard(this.directLink),this.copiedDirect=!0,this.clipboardSuccessHandler(),this.showMessage({title:this.$gettext("Direct link copied"),desc:this.$gettext("The direct link has been copied to your clipboard.")})},clipboardSuccessHandler(){clearTimeout(this.timeout),this.timeout=setTimeout((()=>{this.copiedDirect=!1,this.copiedEos=!1}),550)}}});var Ks=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"oc-file-details-sidebar"}},[e.hasContent?i("div",[e.file.thumbnail?i("div",{key:"file-thumbnail",staticClass:"details-preview oc-flex oc-flex-middle oc-flex-center oc-mb",style:{"background-image":e.$asyncComputed.preview.updating?"none":"url("+e.preview+")"},attrs:{"data-testid":"preview"}},[e.$asyncComputed.preview.updating?i("oc-spinner"):e._e()],1):i("div",{staticClass:"details-icon-wrapper oc-width-1-1 oc-flex oc-flex-middle oc-flex-center oc-mb"},[i("oc-resource-icon",{staticClass:"details-icon",attrs:{resource:e.file,size:"xxxlarge"}})],1),e._v(" "),!e.isPublicLinkContext&&e.shareIndicators.length?i("div",{key:"file-shares",staticClass:"oc-flex oc-flex-middle oc-my-m",attrs:{"data-testid":"sharingInfo"}},[i("oc-status-indicators",{attrs:{resource:e.file,indicators:e.shareIndicators}}),e._v(" "),i("p",{staticClass:"oc-my-rm oc-mx-s",domProps:{textContent:e._s(e.detailSharingInformation)}})],1):e._e(),e._v(" "),i("table",{staticClass:"details-table",attrs:{"aria-label":e.detailsTableLabel}},[e.hasTimestamp?i("tr",{attrs:{"data-testid":"timestamp"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.timestampLabel)}}),e._v(" "),i("td",[e.showVersions?i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.seeVersionsLabel,expression:"seeVersionsLabel"}],attrs:{appearance:"raw","aria-label":e.seeVersionsLabel},domProps:{textContent:e._s(e.capitalizedTimestamp)},on:{click:e.expandVersionsPanel}}):i("span",{domProps:{textContent:e._s(e.capitalizedTimestamp)}})],1)]):e._e(),e._v(" "),e.showSharedVia?i("tr",{attrs:{"data-testid":"shared-via"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.sharedViaLabel)}}),e._v(" "),i("td",[i("router-link",{attrs:{to:e.sharedParentRoute}},[i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.sharedViaTooltip,expression:"sharedViaTooltip"}],domProps:{textContent:e._s(e.sharedParentDir)}})])],1)]):e._e(),e._v(" "),e.showSharedBy?i("tr",{attrs:{"data-testid":"shared-by"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.sharedByLabel)}}),e._v(" "),i("td",[i("span",{domProps:{textContent:e._s(e.sharedByDisplayName)}})])]):e._e(),e._v(" "),e.ownerDisplayName?i("tr",{attrs:{"data-testid":"ownerDisplayName"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.ownerLabel)}}),e._v(" "),i("td",[i("p",{staticClass:"oc-m-rm"},[e._v("\n "+e._s(e.ownerDisplayName)+"\n "),e.ownedByCurrentUser?i("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("(me)")]):e._e(),e._v(" "),!e.ownedByCurrentUser&&e.ownerAdditionalInfo?i("span",[e._v("("+e._s(e.ownerAdditionalInfo)+")")]):e._e()])])]):e._e(),e._v(" "),e.showSize?i("tr",{attrs:{"data-testid":"sizeInfo"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.sizeLabel)}}),e._v(" "),i("td",{domProps:{textContent:e._s(e.resourceSize)}})]):e._e(),e._v(" "),e.showVersions?i("tr",{attrs:{"data-testid":"versionsInfo"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.versionsLabel)}}),e._v(" "),i("td",[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.seeVersionsLabel,expression:"seeVersionsLabel"}],attrs:{appearance:"raw","aria-label":e.seeVersionsLabel},domProps:{textContent:e._s(e.versions.length)},on:{click:e.expandVersionsPanel}})],1)]):e._e(),e._v(" "),e.runningOnEos?i("tr",[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.eosPathLabel)}}),e._v(" "),i("td",[i("div",{staticClass:"oc-flex oc-flex-middle oc-flex-between oc-width-1-1"},[i("p",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.file.path,expression:"file.path"}],ref:"filePath",staticClass:"oc-my-rm oc-text-truncate",domProps:{textContent:e._s(e.file.path)}}),e._v(" "),i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.copyEosPathLabel,expression:"copyEosPathLabel"}],attrs:{"aria-label":e.copyEosPathLabel,appearance:"raw",variation:e.copiedEos?"success":"passive"},on:{click:e.copyEosPathToClipboard}},[e.copiedEos?i("oc-icon",{key:"oc-copy-to-clipboard-copied",staticClass:"_clipboard-success-animation",attrs:{name:"checkbox-circle"}}):i("oc-icon",{key:"oc-copy-to-clipboard-copy",attrs:{name:"clipboard"}})],1)],1)])]):e._e(),e._v(" "),e.runningOnEos?i("tr",[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.directLinkLabel)}}),e._v(" "),i("td",[i("div",{staticClass:"oc-flex oc-flex-middle oc-flex-between oc-width-1-1"},[i("p",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.directLink,expression:"directLink"}],ref:"directLink",staticClass:"oc-my-rm oc-text-truncate",domProps:{textContent:e._s(e.directLink)}}),e._v(" "),i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.copyDirectLinkLabel,expression:"copyDirectLinkLabel"}],attrs:{"aria-label":e.copyDirectLinkLabel,appearance:"raw",variation:e.copiedDirect?"success":"passive"},on:{click:e.copyDirectLinkToClipboard}},[e.copiedDirect?i("oc-icon",{key:"oc-copy-to-clipboard-copied",staticClass:"_clipboard-success-animation",attrs:{name:"checkbox-circle"}}):i("oc-icon",{key:"oc-copy-to-clipboard-copy",attrs:{name:"clipboard"}})],1)],1)])]):e._e()])]):i("p",{attrs:{"data-testid":"noContentText"},domProps:{textContent:e._s(e.noContentText)}})])};Ks._withStripped=!0;const Zs=e.normalizeComponent({render:Ks,staticRenderFns:[]},undefined,Ys,"data-v-7def95c4",false,undefined,!1,void 0,void 0,void 0);const Xs=e.defineComponent({name:"FileDetailsMultiple",props:{showSpaceCount:{type:Boolean,default:!1}},computed:{...e.mapGetters("Files",["selectedFiles"]),selectedFilesCount(){return this.selectedFiles.length},selectedFilesString(){return this.$gettextInterpolate(this.$ngettext("%{ itemCount } item selected","%{ itemCount } items selected",this.selectedFilesCount),{itemCount:this.selectedFilesCount})},sizeValue(){let e=0;return this.selectedFiles.forEach((t=>e+=parseInt(t.size))),r.formatFileSize(e,this.$language.current)},sizeText(){return this.$gettext("Size")},filesCount(){return this.selectedFiles.filter((e=>"file"===e.type)).length},filesText(){return this.$gettext("Files")},foldersCount(){return this.selectedFiles.filter((e=>"folder"===e.type)).length},foldersText(){return this.$gettext("Folders")},spacesCount(){return this.selectedFiles.filter((e=>"space"===e.type)).length},spacesText(){return this.$gettext("Spaces")},detailsTableLabel(){return this.$gettext("Overview of the information about the selected files")}}});var ea=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"oc-file-details-multiple-sidebar"}},[i("div",{staticClass:"files-preview oc-mb"},[i("div",{staticClass:"files-preview-body"},[i("oc-icon",{staticClass:"preview-icon",attrs:{size:"xxlarge",variation:"passive",name:"file-copy"}}),e._v(" "),i("p",{staticClass:"preview-text",attrs:{"data-testid":"selectedFilesText"},domProps:{textContent:e._s(e.selectedFilesString)}})],1)]),e._v(" "),i("div",[i("table",{staticClass:"details-table",attrs:{"aria-label":e.detailsTableLabel}},[i("tr",{attrs:{"data-testid":"filesCount"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.filesText)}}),e._v(" "),i("td",{domProps:{textContent:e._s(e.filesCount)}})]),e._v(" "),i("tr",{attrs:{"data-testid":"foldersCount"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.foldersText)}}),e._v(" "),i("td",{domProps:{textContent:e._s(e.foldersCount)}})]),e._v(" "),e.showSpaceCount?i("tr",{attrs:{"data-testid":"spacesCount"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.spacesText)}}),e._v(" "),i("td",{domProps:{textContent:e._s(e.spacesCount)}})]):e._e(),e._v(" "),i("tr",{attrs:{"data-testid":"size"}},[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.sizeText)}}),e._v(" "),i("td",{domProps:{textContent:e._s(e.sizeValue)}})])])])])};ea._withStripped=!0;const ta=e.normalizeComponent({render:ea,staticRenderFns:[]},undefined,Xs,"data-v-85a4b70c",false,undefined,!1,void 0,void 0,void 0);const ia=e.defineComponent({name:"FileActions",components:{ActionMenuItem:et},mixins:[Ke],setup:()=>({space:e.inject("displayedSpace")}),computed:{...e.mapGetters("Files",["highlightedFile"]),resources(){return[this.highlightedFile]},actions(){return this.$_fileActions_getAllAvailableActions({space:this.space,resources:this.resources})}}});var sa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("oc-list",{staticClass:"oc-mt-s",attrs:{id:"oc-files-actions-sidebar"}},e._l(e.actions,(function(t,s){return i("action-menu-item",{key:"action-"+s,staticClass:"oc-py-xs",attrs:{action:t,items:e.resources,space:e.space}})})),1)};sa._withStripped=!0;const aa=e.normalizeComponent({render:sa,staticRenderFns:[]},undefined,ia,undefined,false,undefined,!1,void 0,void 0,void 0);const ra=e.defineComponent({name:"FileVersions",setup:()=>({space:e.inject("displayedSpace")}),data:()=>({loading:!1,DavProperty:s.DavProperty}),computed:{...e.mapGetters("Files",["highlightedFile","versions"]),hasVersion(){return this.versions.length>0}},watch:{highlightedFile(){this.fetchFileVersions()}},mounted(){this.fetchFileVersions()},methods:{...e.mapActions("Files",["loadVersions"]),...e.mapMutations("Files",["UPDATE_RESOURCE_FIELD"]),currentVersionId(e){const t=e.name.split("/");return t[t.length-1]},async fetchFileVersions(){this.loading=!0,await this.loadVersions({client:this.$client,fileId:this.highlightedFile.fileId}),this.loading=!1},async revertVersion(e){const{fileId:t,id:i,path:s}=this.highlightedFile;await this.$client.fileVersions.restoreFileVersion(t,this.currentVersionId(e),s);const a=await this.$clientService.webdav.getFileInfo(this.space,this.highlightedFile),r=["size","mdate"];for(const e of r)this.highlightedFile[e]&&this.UPDATE_RESOURCE_FIELD({id:i,field:e,value:a[e]});this.fetchFileVersions()},downloadVersion(e){const t=this.currentVersionId(e);return this.downloadFile(this.highlightedFile,t)},formatVersionDate(e){return r.formatRelativeDateFromHTTP(e.fileInfo[s.DavProperty.LastModifiedDate],this.$language.current)},formatVersionFileSize(e){return r.formatFileSize(e.fileInfo[s.DavProperty.ContentLength],this.$language.current)}}});var na=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"oc-file-versions-sidebar"}},[e.loading?i("oc-loader"):e._e(),e._v(" "),!e.loading&&e.hasVersion?i("oc-table-simple",[i("oc-tbody",e._l(e.versions,(function(t,s){return i("oc-tr",{key:s,staticClass:"file-row"},[i("oc-td",{attrs:{width:"shrink","data-testid":"file-versions-file-icon"}},[i("oc-resource-icon",{attrs:{resource:e.highlightedFile,size:"medium"}})],1),e._v(" "),i("oc-td",{staticClass:"oc-text-muted oc-text-nowrap",attrs:{width:"shrink","data-testid":"file-versions-file-last-modified-date"}},[e._v("\n "+e._s(e.formatVersionDate(t))+"\n ")]),e._v(" "),i("oc-td",{staticClass:"oc-text-muted oc-text-nowrap",attrs:{"data-testid":"file-versions-file-size"}},[e._v("\n "+e._s(e.formatVersionFileSize(t))+"\n ")]),e._v(" "),i("oc-td",{attrs:{width:"shrink"}},[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Restore older version"),expression:"$gettext('Restore older version')"}],attrs:{"data-testid":"file-versions-revert-button",appearance:"raw","aria-label":e.$gettext("Restore older version")},on:{click:function(i){return e.revertVersion(t)}}},[i("oc-icon",{attrs:{name:"restart","fill-type":"line"}})],1)],1),e._v(" "),i("oc-td",{attrs:{width:"shrink"}},[i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Download older version"),expression:"$gettext('Download older version')"}],attrs:{"data-testid":"file-versions-download-button",appearance:"raw","aria-label":e.$gettext("Download older version")},on:{click:function(i){return e.downloadVersion(t)}}},[i("oc-icon",{attrs:{name:"download-cloud","fill-type":"line"}})],1)],1)],1)})),1)],1):i("div",[i("p",{directives:[{name:"translate",rawName:"v-translate"}],attrs:{"data-testid":"file-versions-no-versions"}},[e._v("No Versions available for this file")])])],1)};na._withStripped=!0;const oa=e.normalizeComponent({render:na,staticRenderFns:[]},undefined,ra,undefined,false,undefined,!1,void 0,void 0,void 0);var la={title:"Invite specific people",text:"Enter a name or group to share this item.",list:[{text:"Subfolders",headline:!0},{text:"If you share a folder, all of its contents and subfolders will be shared as well."},{text:"Notification",headline:!0},{text:"Invited people will be notified via email or in-app notification."},{text:"Incognito",headline:!0},{text:"Invited people can not see who else has access.."},{text:"“via folder”",headline:!0},{text:"The “via folder” is shown next to a share, if access has already been given via a parent folder. Click on the “via folder” to edit the share on its parent folder."}],readMoreLink:"https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing"},ca={list:[{text:"Search for service or secondary Account",headline:!0},{text:'To search for service or secondary accounts prefix the username with "a:" (like "a:doe") and for guest accounts prefix the username with "l:" (like "l:doe").'}]},da={title:"Add members to this Space",text:"Enter a name to add people or groups as members to this Space.",list:[{text:"What members can do",headline:!0},{text:"Members can see who else has access to this space and can access all files in this space. Read or write permissions can be set by the member’s role such as “Viewer” or “Editor”."},{text:"What Space managers can do",headline:!0},{text:"Members with the Manager role can edit all properties and content of a Space, such as adding or removing members, sharing subfolders with non-members, or creating links to share."}],readMoreLink:"https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing"},ua={title:"Choose how access is granted",list:[{text:"Only invited people can access",headline:!0},{text:'Account and login is required. Only people from the list "Invited people" can access.'},{text:"Everyone with the link",headline:!0},{text:'No login required. Everyone with the link can access. If you share this link with people from the list "Invited people", they need to login so that their individual assigned permissions can take effect. If they are not logged-in, the permissions of the link take effect.'},{text:"Quicklink",headline:!0},{text:'The quicklink is the default link that is copied when you select "Get link” from the context menu.'}],readMoreLink:"https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing"},pa={title:"What are indirect links?",text:"Indirect links are links giving access by a parent folder.",list:[{text:"How to edit indirect links",headline:!0},{text:"Indirect links can only be edited in their parent folder. Click on the folder icon below the link to navgate to the parent folder."}],readMoreLink:"https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing"};const ha=e.defineComponent({name:"DetailsAndEdit",props:{availableRoleOptions:{type:Array,required:!0},canRename:{type:Boolean,default:!1},expirationDate:{type:Object,default:()=>({}),required:!0},isFolderShare:{type:Boolean,default:!1},isModifiable:{type:Boolean,default:!1},isPasswordEnforced:{type:Boolean,default:!1},link:{type:Object,required:!0},file:{type:Object,required:!0},space:{type:Object,required:!1,default:null}},data(){return{newExpiration:this.link.expiration}},computed:{...e.mapGetters("runtime/spaces",["spaces"]),currentLinkRole(){return s.LinkShareRoles.getByBitmask(this.link.permissions,this.isFolderShare)},currentLinkRoleDescription(){return this.currentLinkRole.description(!1)},currentLinkRoleLabel(){return this.currentLinkRole.label},editOptions(){const e=[];return this.canRename&&e.push({id:"rename",title:this.$gettext("Rename"),icon:"pencil",method:this.showRenameModal}),this.link.expiration?(e.push({id:"edit-expiration",title:this.$gettext("Edit expiration date"),method:this.updateLink,icon:"calendar-event",showDatepicker:!0}),this.expirationDate.enforced||e.push({id:"remove-expiration",title:this.$gettext("Remove expiration date"),icon:"calendar",method:()=>this.updateLink({link:{...this.link,expiration:""}})})):e.push({id:"add-expiration",title:this.$gettext("Add expiration date"),method:this.updateLink,icon:"calendar-event",showDatepicker:!0}),this.link.password&&(e.push({id:"edit-password",title:this.$gettext("Edit password"),icon:"lock-password",method:this.showPasswordModal}),this.isPasswordEnforced||e.push({id:"remove-password",title:this.$gettext("Remove password"),icon:"lock-unlock",method:()=>this.updateLink({link:{...this.link,password:""}})})),this.isPasswordEnforced||this.link.password||this.isAliasLink||e.push({id:"add-password",title:this.$gettext("Add password"),icon:"lock-password",method:this.showPasswordModal}),e},deleteOption(){return{id:"delete",title:this.$gettext("Delete link"),method:this.deleteLink,icon:"delete-bin-5",variation:"danger"}},viaRouterParams(){const e=this.space||this.spaces.find((e=>e.id===this.file.storageId));return e?o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(e,{path:this.link.path,fileId:this.link.file.source})):{}},localExpirationDate(){return r.formatDateFromDateTime(e.DateTime_1.fromISO(this.link.expiration).endOf("day"),this.$language.current)},expirationDateRelative(){return r.formatRelativeDateFromDateTime(e.DateTime_1.fromISO(this.link.expiration).endOf("day"),this.$language.current)},expirationDateTooltip(){return this.$gettextInterpolate(this.$gettext("Expires in %{timeToExpiry} (%{expiryDate})"),{timeToExpiry:this.expirationDateRelative,expiryDate:this.localExpirationDate},!0)},viaTooltip(){return this.link.indirect?this.$gettextInterpolate(this.$gettext("Navigate to the parent (%{folderName})"),{folderName:e.basename(this.link.path)},!0):null},passwortProtectionTooltip(){return this.$gettext("This link is password-protected")},isAliasLink(){return[s.linkRoleInternalFolder,s.linkRoleInternalFile].includes(this.currentLinkRole)}},watch:{newExpiration(e){this.updateLink({link:{...this.link,expiration:e}})}},methods:{...e.mapActions(["createModal","hideModal","setModalInputErrorMessage"]),updateLink({link:e=this.link,dropRef:t=this.$refs.editPublicLinkDropdown,onSuccess:i=(()=>{})}){this.$emit("updateLink",{link:e,onSuccess:i}),t.hide()},deleteLink(){this.$emit("removePublicLink",{link:this.link}),this.$refs.editPublicLinkDropdown.hide()},showRenameModal(){const e={variation:"passive",title:this.$gettext("Edit name"),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Save"),hasInput:!0,inputValue:this.link.name,inputLabel:this.$gettext("Link name"),onCancel:this.hideModal,onConfirm:e=>this.updateLink({link:{...this.link,name:e},onSuccess:()=>{this.hideModal()}})};this.createModal(e)},checkPasswordNotEmpty(e){return""===e?this.setModalInputErrorMessage(this.$gettext("Password can't be empty")):this.setModalInputErrorMessage(null)},showPasswordModal(){const e={variation:"passive",title:this.link.password?this.$gettext("Edit password"):this.$gettext("Add password"),cancelText:this.$gettext("Cancel"),confirmText:this.link.password?this.$gettext("Apply"):this.$gettext("Set"),hasInput:!0,inputDescription:this.$gettext("Password can't be empty"),inputLabel:this.$gettext("Password"),inputType:"password",onCancel:this.hideModal,onInput:e=>this.checkPasswordNotEmpty(e),onConfirm:e=>{this.updateLink({link:{...this.link,password:e},onSuccess:()=>{this.hideModal()}})}};this.createModal(e)}}});var ma=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"link-details oc-flex oc-flex-between oc-flex-middle oc-pl-s"},[e.isModifiable?i("div",[i("oc-button",{staticClass:"edit-public-link-role-dropdown-toggle oc-text-left",attrs:{id:"edit-public-link-role-dropdown-toggle-"+e.link.id,appearance:"raw","gap-size":"none"}},[i("span",{staticClass:"link-current-role",domProps:{textContent:e._s(e.$gettext(e.currentLinkRoleLabel))}}),e._v(" "),i("oc-icon",{attrs:{name:"arrow-down-s"}})],1),e._v(" "),i("oc-drop",{ref:"editPublicLinkRoleDropdown",staticClass:"edit-public-link-role-dropdown",attrs:{"drop-id":"edit-public-link-role-dropdown",toggle:"#edit-public-link-role-dropdown-toggle-"+e.link.id,"padding-size":"small",offset:"0",mode:"click"}},[i("oc-list",{staticClass:"roleDropdownList"},e._l(e.availableRoleOptions,(function(t){return i("li",{key:"role-dropdown-"+t.label.toLowerCase()},[i("oc-button",{staticClass:"oc-p-s",class:{selected:e.link.permissions===t.bitmask(!1),"oc-background-primary-gradient":e.link.permissions===t.bitmask(!1)},attrs:{id:"files-role-"+t.label.toLowerCase(),appearance:"raw",variation:e.link.permissions===t.bitmask(!1)?"inverse":"passive","justify-content":"space-between"},on:{click:function(i){e.updateLink({link:Object.assign({},e.link,{permissions:t.bitmask(!1)}),dropRef:e.$refs.editPublicLinkRoleDropdown})}}},[i("span",{staticClass:"oc-flex oc-flex-middle"},[i("oc-icon",{staticClass:"oc-pl-s oc-pr-m",attrs:{name:t.icon}}),e._v(" "),i("span",[i("span",{staticClass:"oc-text-bold oc-display-block oc-width-1-1",domProps:{textContent:e._s(e.$gettext(t.label))}}),e._v(" "),i("span",{staticClass:"oc-text-small"},[e._v(e._s(e.$gettext(t.description())))])])],1),e._v(" "),i("span",{staticClass:"oc-flex"},[e.link.permissions===t.bitmask(!1)?i("oc-icon",{attrs:{name:"check"}}):e._e()],1)])],1)})),0)],1)],1):i("p",{staticClass:"oc-my-rm"},[i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext(e.currentLinkRoleDescription),expression:"$gettext(currentLinkRoleDescription)"}],staticClass:"link-current-role",domProps:{textContent:e._s(e.$gettext(e.currentLinkRoleLabel))}})]),e._v(" "),i("div",{staticClass:"details-buttons",class:{"oc-pr-s":!e.isModifiable}},[e.link.indirect?i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.viaTooltip,expression:"viaTooltip"}],staticClass:"oc-files-file-link-via",attrs:{"area-label":e.viaTooltip,type:"router-link",appearance:"raw",to:e.viaRouterParams}},[i("oc-icon",{attrs:{name:"folder-shared","fill-type":"line"}})],1):e._e(),e._v(" "),e.link.password?i("oc-icon",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.passwortProtectionTooltip,expression:"passwortProtectionTooltip"}],attrs:{name:"lock-password","fill-type":"line","aria-label":e.passwortProtectionTooltip}}):e._e(),e._v(" "),e.link.expiration?i("oc-icon",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.expirationDateTooltip,expression:"expirationDateTooltip"}],staticClass:"oc-files-public-link-expires",attrs:{"data-testid":"files-link-id-"+e.link.id+"-expiration-date","aria-label":e.expirationDateTooltip,name:"calendar-event","fill-type":"line"}}):e._e(),e._v(" "),e.isModifiable?i("div",[i("oc-button",{staticClass:"edit-drop-trigger",attrs:{id:"edit-public-link-dropdown-toggl-"+e.link.id,appearance:"raw","data-testid":"files-link-id-"+e.link.id+"-btn-edit"}},[i("oc-icon",{attrs:{name:"more-2"}})],1),e._v(" "),i("oc-drop",{ref:"editPublicLinkDropdown",attrs:{"drop-id":"edit-public-link-dropdown",toggle:"#edit-public-link-dropdown-toggl-"+e.link.id,"padding-size":"small",mode:"click"}},[i("oc-list",{staticClass:"edit-public-link-dropdown-menu oc-files-context-actions-border oc-pb-s"},e._l(e.editOptions,(function(t,s){return i("li",{key:"public-link-edit-option-"+s,staticClass:"oc-rounded oc-menu-item-hover"},[t.showDatepicker?i("oc-datepicker",{staticClass:"link-expiry-picker",attrs:{"min-date":e.expirationDate.min,"max-date":e.expirationDate.max,locale:e.$language.current,"is-required":e.expirationDate.enforce},scopedSlots:e._u([{key:"default",fn:function(s){var a=s.togglePopover;return[i("oc-button",{staticClass:"oc-p-s action-menu-item",attrs:{"data-testid":"files-link-id-"+e.link.id+"-edit-"+t.id,appearance:"raw",variation:t.variation},on:{click:a}},[i("oc-icon",{attrs:{name:t.icon,"fill-type":"line",size:"medium"}}),e._v(" "),i("span",{domProps:{textContent:e._s(t.title)}})],1)]}}],null,!0),model:{value:e.newExpiration,callback:function(t){e.newExpiration=t},expression:"newExpiration"}}):i("oc-button",{staticClass:"oc-p-s action-menu-item",attrs:{appearance:"raw","data-testid":"files-link-id-"+e.link.id+"-edit-"+t.id},on:{click:t.method}},[i("oc-icon",{attrs:{name:t.icon,"fill-type":"line",size:"medium"}}),e._v(" "),i("span",{domProps:{textContent:e._s(t.title)}})],1)],1)})),0),e._v(" "),i("oc-list",{staticClass:"edit-public-link-dropdown-menu oc-pt-s"},[i("li",{staticClass:"oc-rounded oc-menu-item-hover"},[i("oc-button",{staticClass:"oc-p-s action-menu-item",attrs:{appearance:"raw","data-testid":"files-link-id-"+e.link.id+"-edit-"+e.deleteOption.id},on:{click:e.deleteOption.method}},[i("oc-icon",{attrs:{name:e.deleteOption.icon,"fill-type":"line",size:"medium"}}),e._v(" "),i("span",{domProps:{textContent:e._s(e.deleteOption.title)}})],1)],1)])],1)],1):e._e()],1)])};ma._withStripped=!0;const fa=e.normalizeComponent({render:ma,staticRenderFns:[]},undefined,ha,"data-v-019e39d7",false,undefined,!1,void 0,void 0,void 0);const ga=e.defineComponent({name:"NameAndCopy",props:{link:{type:Object,required:!0}},data:function(){return{copied:!1,timeout:null}},computed:{linkName:function(){return this.link.name},copyBtnLabel:function(){return this.$gettext("Copy")},copyBtnHint:function(){return this.$gettext("Copy link to clipboard")},copiedLabel:function(){return this.$gettext("Copied")}},methods:c._objectSpread2(c._objectSpread2({},e.mapActions(["showMessage"])),{},{copyLinkToClipboard:function(){e.copyToClipboard(this.link.url),this.clipboardSuccessHandler(),this.showMessage({title:this.link.quicklink?this.$gettext("The quicklink has been copied to your clipboard."):this.$gettextInterpolate(this.$gettext('The link "%{linkName}" has been copied to your clipboard.'),{linkName:this.linkName},!0)})},clipboardSuccessHandler:function(){var e=this;this.copied=!0,clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.copied=!1}),550)}})});var va=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-mb-s oc-width-1-1"},[i("h4",{staticClass:"oc-text-truncate oc-text-normal oc-files-file-link-name oc-m-rm",domProps:{textContent:e._s(e.linkName)}}),e._v(" "),i("div",{staticClass:"oc-flex oc-flex-middle oc-flex-between oc-width-1-1 oc-p-s link-name-container"},[e.copied?i("div",{staticClass:"oc-flex oc-flex-middle oc-text-truncate"},[i("oc-icon",{attrs:{variation:"success",name:"checkbox-circle"}}),e._v(" "),i("p",{staticClass:"oc-files-file-link-url url-copied oc-ml-s oc-my-rm",domProps:{textContent:e._s(e.copiedLabel)}})],1):i("div",{staticClass:"oc-flex oc-flex-middle oc-text-truncate"},[i("oc-icon",{attrs:{name:"link","fill-type":"line"}}),e._v(" "),i("p",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.link.url,expression:"link.url"}],staticClass:"oc-files-file-link-url oc-ml-s oc-text-truncate oc-my-rm",domProps:{textContent:e._s(e.link.url)}})],1),e._v(" "),i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.copyBtnHint,expression:"copyBtnHint"}],staticClass:"oc-files-public-link-copy-url",attrs:{appearance:"raw","aria-label":e.copyBtnHint},domProps:{textContent:e._s(e.copyBtnLabel)},on:{click:e.copyLinkToClipboard}})],1)])};va._withStripped=!0;const ba=e.normalizeComponent({render:va,staticRenderFns:[]},undefined,ga,"data-v-5a7f4db4",false,undefined,!1,void 0,void 0,void 0);const Sa=e.defineComponent({name:"CreateQuickLink",props:{expirationDate:{type:Object,default:function(){},required:!0}},computed:{heading:function(){return this.$gettext("Quick link")},createLinkHint:function(){return this.$gettext("Create quick link")},createLinkLabel:function(){return this.$gettext("Create link")},noLinkLabel:function(){return this.$gettext("No link")}},methods:{createQuickLink:function(){this.$emit("createPublicLink",{link:{name:this.$gettext("Quicklink"),permissions:1,expiration:this.expirationDate.enforced?this.expirationDate.default:null,quicklink:!0,password:!1}})}}});var _a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-mb-s oc-width-1-1 oc-mb-l"},[i("h4",{staticClass:"oc-text-truncate oc-text-normal oc-files-file-link-name oc-my-rm",domProps:{textContent:e._s(e.heading)}}),e._v(" "),i("div",{staticClass:"oc-flex oc-flex-middle oc-flex-between oc-width-1-1 oc-p-s link-name-container"},[i("div",{staticClass:"oc-flex oc-flex-middle oc-text-truncate"},[i("oc-icon",{attrs:{name:"link","fill-type":"line"}}),e._v(" "),i("p",{staticClass:"oc-files-file-link-url oc-ml-s oc-text-truncate oc-my-rm",domProps:{textContent:e._s(e.noLinkLabel)}})],1),e._v(" "),i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.createLinkHint,expression:"createLinkHint"}],attrs:{appearance:"raw","aria-label":e.createLinkHint},domProps:{textContent:e._s(e.createLinkLabel)},on:{click:e.createQuickLink}})],1)])};_a._withStripped=!0;const ya=e.normalizeComponent({render:_a,staticRenderFns:[]},undefined,Sa,undefined,false,undefined,!1,void 0,void 0,void 0);const wa=e.defineComponent({name:"FileLinks",components:{CreateQuickLink:ya,DetailsAndEdit:fa,NameAndCopy:ba},inject:["displayedItem","incomingParentShare"],props:{space:{type:Object,required:!1,default:null}},setup(){const e=i.useStore(),s=!e.getters.configuration.options.sidebar.shares.showAllOnLoad,a=!e.getters.configuration.options.sidebar.shares.showAllOnLoad;return{...n.useGraphClient(),hasSpaces:t.useCapabilitySpacesEnabled(),hasShareJail:t.useCapabilityShareJailEnabled(),hasResharing:t.useCapabilityFilesSharingResharing(),hasPublicLinkEditing:t.useCapabilityFilesSharingPublicCanEdit(),hasPublicLinkAliasSupport:t.useCapabilityFilesSharingPublicAlias(),indirectLinkListCollapsed:a,linkListCollapsed:s}},computed:{...e.mapGetters("Files",["highlightedFile","currentFileOutgoingLinks"]),...e.mapGetters(["capabilities","configuration"]),...e.mapState(["user"]),...e.mapState("Files",["sharesTree"]),file(){return e.unref(this.displayedItem)},addButtonLabel(){return this.$gettext("Add link")},collapseButtonTitle(){return this.linkListCollapsed?this.$gettext("Show all"):this.$gettext("Show less")},collapseButtonIcon(){return this.linkListCollapsed?"arrow-down-s":"arrow-up-s"},indirectCollapseButtonTitle(){return this.indirectLinkListCollapsed?this.$gettext("Show"):this.$gettext("Hide")},indirectCollapseButtonIcon(){return this.indirectLinkListCollapsed?"arrow-down-s":"arrow-up-s"},quicklink(){return this.currentFileOutgoingLinks.find((e=>!0===e.quicklink))},expirationDate(){const t=this.capabilities.files_sharing.public.expire_date;let i=null,s=null;if(t.days){const s=parseInt(t.days);i=e.DateTime_1.now().setLocale(r.getLocaleFromLanguage(this.$language.current)).plus({days:s}).toJSDate()}if(t.enforced){const i=parseInt(t.days);s=e.DateTime_1.now().setLocale(r.getLocaleFromLanguage(this.$language.current)).plus({days:i}).toJSDate()}return{enforced:t.enforced,default:i,min:e.DateTime_1.now().setLocale(r.getLocaleFromLanguage(this.$language.current)).toJSDate(),max:s}},passwordEnforced(){return this.capabilities.files_sharing.public.password?.enforced_for||{read_only:!1,upload_only:!1,read_write:!1}},helpersEnabled(){return this.configuration?.options?.contextHelpers},viaLinkHelp:()=>ua,indirectLinkHelp:()=>pa,canCreatePublicLinks(){if(this.highlightedFile.isReceivedShare()&&!this.hasResharing)return!1;return!("share"===this.space?.driveType&&!this.hasResharing)&&this.highlightedFile.canShare({user:this.user})},canEdit(){return this.canCreatePublicLinks},noResharePermsMessage(){const e=this.$gettext("You don't have permission to share this file."),t=this.$gettext("You don't have permission to share this folder.");return"file"===this.highlightedFile.type?e:t},linksHeading(){return this.hasSpaces?this.$gettext("Share via link"):this.$gettext("Share via public link")},indirectLinksHeading(){const e=this.$gettext("Indirect links (%{ count })");return this.$gettextInterpolate(e,{count:this.indirectLinks.length})},links(){return this.currentFileOutgoingLinks.filter((e=>!e.quicklink)).map((e=>(e.key="direct-link-"+e.id,e))).sort(((e,t)=>t.stime-e.stime))},displayLinks(){return this.links.length>3&&this.linkListCollapsed?this.links.slice(0,3):this.links},displayIndirectLinks(){return this.indirectLinkListCollapsed?[]:this.indirectLinks},indirectLinks(){const e=[],t=$(this.highlightedFile.path,!1);return 0===t.length?[]:(t.forEach((t=>{const i=Oe(this.sharesTree[t]);i&&i.forEach((t=>{t.outgoing&&t.shareType===s.ShareTypes.link.value&&(t.key="indirect-link-"+t.id,e.push(t))}))})),e.sort(((e,t)=>t.stime-e.stime)))},resourceIsSpace(){return"space"===this.highlightedFile.type},currentStorageId(){return this.resourceIsSpace?this.highlightedFile.id:this.space?this.space.id:null}},methods:{...e.mapActions("Files",["addLink","updateLink","removeLink"]),...e.mapActions(["showMessage","createModal","hideModal"]),...e.mapMutations("Files",["REMOVE_FILES"]),toggleLinkListCollapsed(){this.linkListCollapsed=!this.linkListCollapsed},toggleIndirectLinkListCollapsed(){this.indirectLinkListCollapsed=!this.indirectLinkListCollapsed},isPasswordEnforcedFor(e){const t=s.LinkShareRoles.getByBitmask(e.permissions,e.indirect||this.highlightedFile.isFolder),i=t.hasPermission(s.SharePermissions.read),a=t.hasPermission(s.SharePermissions.update),r=t.hasPermission(s.SharePermissions.create),n=t.hasPermission(s.SharePermissions.delete);return!0===this.passwordEnforced.read_only?i&&!a&&!r&&!n:!0===this.passwordEnforced.upload_only?!i&&!a&&r&&!n:!0===this.passwordEnforced.read_write?i&&!a&&r&&!n:!0===this.passwordEnforced.read_write_delete&&(i&&a&&r&&n)},addNewLink(){this.checkLinkToCreate({link:{name:this.$gettext("Link"),permissions:1,expiration:this.expirationDate.default,password:!1}})},checkLinkToCreate({link:e,onError:t=(()=>{})}){const i=this.getParamsForLink(e);this.isPasswordEnforcedFor(e)?ut({store:this.$store},(e=>{this.createLink({params:{...i,password:e},onError:t})})):this.createLink({params:i,onError:t})},checkLinkToUpdate({link:e,onSuccess:t=(()=>{})}){const i=this.getParamsForLink(e);!e.password&&this.isPasswordEnforcedFor(e)?ut({store:this.$store},(e=>{this.updatePublicLink({params:{...i,password:e},onSuccess:t})})):this.updatePublicLink({params:i,onSuccess:t})},getParamsForLink(t){let i,s="";switch(t.expiration&&(s=("string"==typeof t.expiration?e.DateTime_1.fromISO(t.expiration):e.DateTime_1.fromJSDate(t.expiration)).setLocale(r.getLocaleFromLanguage(this.$language.current)).endOf("day").toFormat("yyyy-MM-dd'T'HH:mm:ssZZZ")),t.password){case!1:i=void 0;break;case"":i="";break;case!0:i=void 0;break;default:i=t.password}return{expireDate:s,password:i,id:t.id,permissions:t.permissions.toString(),quicklink:t.quicklink,name:t.name,spaceRef:this.highlightedFile.fileId,...this.currentStorageId&&{storageId:this.currentStorageId}}},async createLink({params:e,onError:t=(e=>{})}){let i=this.highlightedFile.path;this.hasShareJail&&"/"===i&&(i=`/${this.highlightedFile.name}`),await this.addLink({path:i,client:this.$client,$gettext:this.$gettext,storageId:this.highlightedFile.fileId||this.highlightedFile.id,params:e}).catch((e=>{t(e),console.error(e),this.showMessage({title:this.$gettext("Failed to create link"),status:"danger"})})),this.showMessage({title:this.$gettext("Link was created successfully")})},async updatePublicLink({params:e,onSuccess:t=(()=>{}),onError:i=(e=>{})}){await this.updateLink({id:e.id,client:this.$client,params:e}).then(t).catch((e=>{i(e),console.error(e),this.showMessage({title:this.$gettext("Failed to update link"),status:"danger"})})),this.showMessage({title:this.$gettext("Link was updated successfully")})},deleteLinkConfirmation({link:e}){const t={variation:"danger",icon:"alarm-warning",title:this.$gettext("Delete link"),message:this.$gettext("Are you sure you want to delete this link? Recreating the same link again is not possible."),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Delete"),onCancel:this.hideModal,onConfirm:()=>this.deleteLink({client:this.$client,share:e,resource:this.highlightedFile})};this.createModal(t)},async deleteLink({client:e,share:t,resource:i}){this.hideModal();let s=i.path;this.hasShareJail&&"/"===s&&(s=`/${i.name}`);const a=1===this.currentFileOutgoingLinks.length?this.currentFileOutgoingLinks[0].id:void 0;try{await this.removeLink({client:e,share:t,path:s,storageId:i.fileId,loadIndicators:!!a}),this.showMessage({title:this.$gettext("Link was deleted successfully")}),a&&o.isLocationSharesActive(this.$router,"files-shares-via-link")&&this.REMOVE_FILES([{id:a}])}catch(e){console.error(e),this.showMessage({title:this.$gettext("Failed to delete link"),status:"danger"})}},getAvailableRoleOptions(e){return this.incomingParentShare.value&&this.canCreatePublicLinks?s.LinkShareRoles.filterByBitmask(this.incomingParentShare.value.permissions,this.highlightedFile.isFolder,this.hasPublicLinkEditing,this.hasPublicLinkAliasSupport,!!e.password):s.LinkShareRoles.list(this.highlightedFile.isFolder,this.hasPublicLinkEditing,this.hasPublicLinkAliasSupport,!!e.password)}}});var xa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-position-relative",attrs:{id:"oc-files-file-link"}},[i("div",{staticClass:"oc-flex"},[i("h3",{staticClass:"oc-text-bold oc-text-medium oc-m-rm",domProps:{textContent:e._s(e.linksHeading)}}),e._v(" "),e.helpersEnabled?i("oc-contextual-helper",e._b({staticClass:"oc-pl-xs"},"oc-contextual-helper",e.viaLinkHelp,!1)):e._e()],1),e._v(" "),e.canCreatePublicLinks?e._e():i("p",{staticClass:"oc-mt-m",attrs:{"data-testid":"files-links-no-reshare-permissions-message"},domProps:{textContent:e._s(e.noResharePermsMessage)}}),e._v(" "),i("div",{staticClass:"oc-mt-m"},[e.quicklink?i("name-and-copy",{attrs:{link:e.quicklink}}):e.canCreatePublicLinks?i("create-quick-link",{attrs:{"expiration-date":e.expirationDate},on:{createPublicLink:e.checkLinkToCreate}}):e._e(),e._v(" "),e.quicklink?i("details-and-edit",{attrs:{"available-role-options":e.getAvailableRoleOptions(e.quicklink),"can-rename":!1,"expiration-date":e.expirationDate,"is-folder-share":e.highlightedFile.isFolder,"is-modifiable":e.canEdit,"is-password-enforced":e.isPasswordEnforcedFor(e.quicklink),link:e.quicklink,file:e.file,space:e.space},on:{updateLink:e.checkLinkToUpdate,removePublicLink:e.deleteLinkConfirmation}}):e._e(),e._v(" "),i("hr",{staticClass:"oc-my-m"}),e._v(" "),e.canCreatePublicLinks?i("oc-button",{attrs:{id:"files-file-link-add",variation:"primary",appearance:"raw","data-testid":"files-link-add-btn"},domProps:{textContent:e._s(e.addButtonLabel)},on:{click:e.addNewLink}}):e._e()],1),e._v(" "),e.links.length?i("oc-list",{staticClass:"oc-overflow-hidden oc-my-m"},e._l(e.displayLinks,(function(t){return i("li",{key:t.key,staticClass:"oc-py-s",attrs:{"data-testid":"files-link-id-"+t.id}},[i("name-and-copy",{attrs:{link:t}}),e._v(" "),i("details-and-edit",{attrs:{"available-role-options":e.getAvailableRoleOptions(t),"can-rename":!0,"expiration-date":e.expirationDate,"is-folder-share":e.highlightedFile.isFolder,"is-modifiable":e.canEdit,"is-password-enforced":e.isPasswordEnforcedFor(t),link:t,file:e.file,space:e.space},on:{updateLink:e.checkLinkToUpdate,removePublicLink:e.deleteLinkConfirmation}})],1)})),0):e._e(),e._v(" "),e.links.length>3?i("div",{staticClass:"oc-flex oc-flex-center"},[i("oc-button",{attrs:{appearance:"raw"},on:{click:e.toggleLinkListCollapsed}},[i("span",{domProps:{textContent:e._s(e.collapseButtonTitle)}}),e._v(" "),i("oc-icon",{attrs:{name:e.collapseButtonIcon,"fill-type":"line"}})],1)],1):e._e(),e._v(" "),e.indirectLinks.length?i("div",{attrs:{id:"indirect-link-list"}},[i("hr",{staticClass:"oc-my-m"}),e._v(" "),i("div",{staticClass:"oc-flex"},[i("h3",{staticClass:"oc-text-bold oc-m-rm oc-text-medium"},[i("span",{domProps:{textContent:e._s(e.indirectLinksHeading)}})]),e._v(" "),e.helpersEnabled?i("oc-contextual-helper",e._b({staticClass:"oc-pl-xs"},"oc-contextual-helper",e.indirectLinkHelp,!1)):e._e()],1),e._v(" "),e.indirectLinkListCollapsed?e._e():i("oc-list",{staticClass:"oc-overflow-hidden oc-my-m"},e._l(e.displayIndirectLinks,(function(t){return i("li",{key:t.key,staticClass:"oc-py-s",attrs:{"data-testid":"files-link-id-"+t.id}},[i("name-and-copy",{attrs:{link:t}}),e._v(" "),i("details-and-edit",{attrs:{"available-role-options":e.getAvailableRoleOptions(t),"expiration-date":e.expirationDate,"is-folder-share":!0,"is-modifiable":!1,link:t,file:e.file,space:e.space}})],1)})),0),e._v(" "),i("div",{staticClass:"oc-flex oc-flex-center"},[i("oc-button",{attrs:{id:"indirect-link-list-toggle",appearance:"raw"},on:{click:e.toggleIndirectLinkListCollapsed}},[i("span",{domProps:{textContent:e._s(e.indirectCollapseButtonTitle)}}),e._v(" "),i("oc-icon",{attrs:{name:e.indirectCollapseButtonIcon,"fill-type":"line"}})],1)],1)],1):e._e()],1)};xa._withStripped=!0;const Ca=e.normalizeComponent({render:xa,staticRenderFns:[]},undefined,wa,undefined,false,undefined,!1,void 0,void 0,void 0);function ka(e){for(var t,i=[],s=0,a=-1,r=0;s="0"&&t<="9";n!==r&&(i[++a]="",r=n),i[a]+=t,s++}return i}var Fa={naturalSortCompare:function(e,t){var i,s,a,r=ka(e),n=ka(t);for(i=0;r[i]&&n[i];i++)if(r[i]!==n[i])return s=Number(r[i]),a=Number(n[i]),s==r[i]&&a==n[i]?s-a:r[i].localeCompare(n[i],"en");return r.length-n.length}};const Ea={name:"AutocompleteItem",props:{item:{type:Object,required:!0}},data:()=>({loading:!1}),computed:{shareType(){return s.ShareTypes.getByValue(this.item.value.shareType)},isUser(){return this.shareType===s.ShareTypes.user},isSpace(){return this.shareType===s.ShareTypes.space},isGuest(){return this.shareType===s.ShareTypes.guest},isGroup(){return this.shareType===s.ShareTypes.group},collaboratorClass(){return`files-collaborators-search-${this.shareType.key}`}}};var $a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-flex oc-flex-middle oc-py-xs",class:e.collaboratorClass,attrs:{"data-testid":"recipient-autocomplete-item-"+e.item.label}},[e.isUser||e.isSpace?i("avatar-image",{staticClass:"oc-mr-s",attrs:{width:36,userid:e.item.value.shareWith,"user-name":e.item.label}}):e.isGuest?i("oc-icon",{key:"avatar-guest",staticClass:"oc-mr-s files-recipient-suggestion-avatar",attrs:{name:"global",size:"large","accessible-label":e.$gettext("Guest")}}):e.isGroup?i("oc-icon",{key:"avatar-group",staticClass:"oc-mr-s files-recipient-suggestion-avatar",attrs:{name:"group",size:"large","accessible-label":e.$gettext("Group")}}):i("oc-icon",{key:"avatar-generic-person",staticClass:"oc-mr-s files-recipient-suggestion-avatar",attrs:{name:"person",size:"large","accessible-label":e.$gettext("User")}}),e._v(" "),i("div",{staticClass:"files-collaborators-autocomplete-user-text oc-text-truncate"},[i("span",{staticClass:"files-collaborators-autocomplete-username",domProps:{textContent:e._s(e.item.label)}}),e._v(" "),e.item.value.shareWithAdditionalInfo?i("span",{staticClass:"files-collaborators-autocomplete-additional-info",domProps:{textContent:e._s("("+e.item.value.shareWithAdditionalInfo+")")}}):e._e(),e._v(" "),i("div",{staticClass:"files-collaborators-autocomplete-share-type",domProps:{textContent:e._s(e.$gettext(e.shareType.label))}})])],1)};$a._withStripped=!0;const Ia=e.normalizeComponent({render:$a,staticRenderFns:[]},undefined,Ea,undefined,false,undefined,!1,void 0,void 0,void 0);const Ta=e.defineComponent({name:"RoleItem",props:{role:{type:Object,required:!0},allowSharePermission:{type:Boolean,required:!0}}});var Ra=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",{staticClass:"roles-select-role-item",attrs:{id:"files-role-"+e.role.name}},[i("span",{staticClass:"oc-text-bold oc-display-block oc-width-1-1",domProps:{textContent:e._s(e.$gettext(e.role.label))}}),e._v(" "),i("span",{staticClass:"oc-m-rm oc-text-small oc-display-block",domProps:{textContent:e._s(e.$gettext(e.role.description(e.allowSharePermission)))}})])};Ra._withStripped=!0;const La=e.normalizeComponent({render:Ra,staticRenderFns:[]},undefined,Ta,"data-v-387b3d78",false,undefined,!1,void 0,void 0,void 0);const Da=e.defineComponent({name:"RoleDropdown",components:{RoleItem:La},inject:["incomingParentShare"],props:{resource:{type:Object,required:!0},existingRole:{type:Object,required:!1,default:void 0},existingPermissions:{type:Array,required:!1,default:()=>[]},domSelector:{type:String,required:!1,default:void 0},allowSharePermission:{type:Boolean,required:!0}},setup(){const e=i.useStore();return{hasRoleDenyAccess:t.useCapabilityFilesSharingCanDenyAccess(e),hasRoleCustomPermissions:t.useCapabilityFilesSharingAllowCustomPermissions(e)}},data:()=>({selectedRole:null,customPermissions:[]}),computed:{...e.mapState("Files",["sharesTree"]),roleButtonId(){return this.domSelector?`files-collaborators-role-button-${this.domSelector}-${e.v4()}`:"files-collaborators-role-button-new"},rolesListAriaLabel(){return this.$gettext("Select role for the invitation")},inviteLabel(){return this.selectedRole.hasCustomPermissions?this.$gettext("Invite with custom permissions"):this.selectedRole.permissions().includes(s.SharePermissions.denied)?this.$gettext("Deny access"):this.$gettextInterpolate(this.$gettext("Invite as %{ name }"),{name:this.$gettext(this.selectedRole.inlineLabel)||""})},customPermissionsRole(){return s.PeopleShareRoles.custom(this.resource.isFolder)},resourceIsSharable(){return this.allowSharePermission&&this.resource.canShare()},availableRoles(){if(this.resourceIsSpace)return s.SpacePeopleShareRoles.list();if(this.incomingParentShare.value&&this.resourceIsSharable)return s.PeopleShareRoles.filterByBitmask(parseInt(this.incomingParentShare.value.permissions),this.resource.isFolder,this.allowSharePermission,this.hasRoleCustomPermissions);const e=this.resource.canDeny()&&this.hasRoleDenyAccess;return s.PeopleShareRoles.list(this.resource.isFolder,this.hasRoleCustomPermissions,e)},availablePermissions(){return this.incomingParentShare.value&&this.resourceIsSharable?s.SharePermissions.bitmaskToPermissions(parseInt(this.incomingParentShare.value.permissions)):this.customPermissionsRole.permissions(this.allowSharePermission)},resourceIsSpace(){return"space"===this.resource.type}},created(){this.applyRoleAndPermissions()},beforeDestroy(){window.removeEventListener("keydown",this.cycleRoles)},mounted(){this.applyRoleAndPermissions(),window.addEventListener("keydown",this.cycleRoles)},methods:{applyRoleAndPermissions(){if(this.existingRole)this.selectedRole=this.existingRole;else if(this.resourceIsSpace)this.selectedRole=s.SpacePeopleShareRoles.list()[0];else{const e=this.resource.canDeny()&&this.hasRoleDenyAccess;this.selectedRole=s.PeopleShareRoles.list(this.resource.isFolder,this.hasRoleCustomPermissions,e)[0]}this.selectedRole.hasCustomPermissions?this.customPermissions=this.existingPermissions:this.customPermissions=[...this.selectedRole.permissions(this.allowSharePermission)]},publishChange(){this.$emit("optionChange",{role:this.selectedRole,permissions:this.customPermissions})},selectRole(e){e.hasCustomPermissions?this.$refs.customPermissionsDrop.show():(this.selectedRole=e,this.customPermissions=e.permissions(this.allowSharePermission),this.publishChange())},isSelectedRole(e){return this.selectedRole.name===e.name},isPermissionDisabled:e=>e.bit===s.SharePermissions.read.bit,confirmCustomPermissions(){this.$refs.customPermissionsDrop.hide();const e=s.SharePermissions.permissionsToBitmask(this.customPermissions);this.selectedRole=s.PeopleShareRoles.getByBitmask(e,this.resource.isFolder,this.allowSharePermission),this.publishChange()},cancelCustomPermissions(){this.customPermissions=this.existingPermissions,this.$refs.customPermissionsDrop.hide(),this.$refs.rolesDrop.show()},cycleRoles(t){if(!e.get(this.$refs.rolesDrop,"tippy.state.isShown",!1))return;const{keyCode:i}=t,s=38===i,a=40===i;if(!s&&!a)return;const r=this.$refs.roleSelect||[];if(r.length<=1)return;const n=r.find((e=>e.$el===document.activeElement))||r.find((e=>e.$el.classList.contains("selected")))||r[0],o=r.indexOf(n),l=e=>r[e].$el.focus();s&&o-1<0?l(r.length-1):a&&o+1>=r.length?l(0):l(o+(s?-1:1))}}});var Aa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.selectedRole?i("span",{staticClass:"oc-flex oc-flex-middle"},[1===e.availableRoles.length?i("span",[e.existingRole?i("span",[e._v(e._s(e.$gettext(e.selectedRole.label)))]):i("span",{domProps:{textContent:e._s(e.inviteLabel)}})]):i("oc-button",{staticClass:"files-recipient-role-select-btn",attrs:{id:e.roleButtonId,appearance:"raw","gap-size":"none"}},[e.existingRole?i("span",[e._v(e._s(e.$gettext(e.selectedRole.label)))]):i("span",{domProps:{textContent:e._s(e.inviteLabel)}}),e._v(" "),i("oc-icon",{attrs:{name:"arrow-down-s"}})],1),e._v(" "),e.availableRoles.length>1?i("oc-drop",{ref:"rolesDrop",staticClass:"files-recipient-role-drop",attrs:{toggle:"#"+e.roleButtonId,mode:"click","padding-size":"small",offset:"0","close-on-click":""}},[i("oc-list",{staticClass:"files-recipient-role-drop-list",attrs:{"aria-label":e.rolesListAriaLabel}},e._l(e.availableRoles,(function(t){return i("li",{key:t.key},[i("oc-button",{ref:"roleSelect",refInFor:!0,staticClass:"files-recipient-role-drop-btn oc-p-s",class:{"oc-background-primary-gradient":e.isSelectedRole(t),selected:e.isSelectedRole(t)},attrs:{id:"files-recipient-role-drop-btn-"+t.name,appearance:"raw","justify-content":"space-between",variation:e.isSelectedRole(t)?"inverse":"passive"},on:{click:function(i){return e.selectRole(t)}}},[i("span",{staticClass:"oc-flex oc-flex-middle"},[i("oc-icon",{staticClass:"oc-pl-s oc-pr-m",attrs:{name:t.icon}}),e._v(" "),i("role-item",{attrs:{role:t,"allow-share-permission":e.allowSharePermission}})],1),e._v(" "),i("span",{staticClass:"oc-flex"},[e.isSelectedRole(t)?i("oc-icon",{attrs:{name:"check"}}):e._e()],1)])],1)})),0)],1):e._e(),e._v(" "),e.availableRoles.length>1?i("oc-drop",{ref:"customPermissionsDrop",staticClass:"files-recipient-custom-permissions-drop",attrs:{mode:"manual",target:"#"+e.roleButtonId,"padding-size":"remove"}},[i("h4",{staticClass:"oc-text-bold oc-m-rm oc-px-m oc-pt-m oc-pb-s",domProps:{textContent:e._s(e.$gettext(e.customPermissionsRole.label))}}),e._v(" "),i("oc-list",e._l(e.availablePermissions,(function(t){return i("li",{key:"files-collaborators-permission-"+t.key,staticClass:"oc-my-s oc-px-m"},[i("oc-checkbox",{key:"files-collaborators-permission-checkbox-"+t.key,staticClass:"oc-mr-xs files-collaborators-permission-checkbox",attrs:{id:"files-collaborators-permission-"+t.key,size:"large","data-testid":"files-collaborators-permission-"+t.key,label:e.$gettext(t.label),option:t,disabled:e.isPermissionDisabled(t)},model:{value:e.customPermissions,callback:function(t){e.customPermissions=t},expression:"customPermissions"}})],1)})),0),e._v(" "),i("div",{staticClass:"files-recipient-custom-permissions-drop-cancel-confirm-btns oc-px-m oc-py-s oc-mt-m oc-rounded-bottom"},[i("oc-button",{attrs:{size:"small"},domProps:{textContent:e._s(e.$gettext("Cancel"))},on:{click:e.cancelCustomPermissions}}),i("oc-button",{staticClass:"oc-ml-s",attrs:{size:"small",variation:"primary",appearance:"filled"},domProps:{textContent:e._s(e.$gettext("Apply"))},on:{click:e.confirmCustomPermissions}})],1)],1):e._e()],1):e._e()};Aa._withStripped=!0;const Pa=e.normalizeComponent({render:Aa,staticRenderFns:[]},undefined,Da,"data-v-79452aed",false,undefined,!1,void 0,void 0,void 0);const Ma={props:{recipient:{type:Object,required:!0},deselect:{type:Function,required:!1,default:null}},setup(){const e=i.useStore();return{accessToken:n.useAccessToken({store:e})}},data(){return{formattedRecipient:{name:this.recipient.label,icon:this.getRecipientIcon(),hasAvatar:[s.ShareTypes.user.value,s.ShareTypes.space.value].includes(this.recipient.value.shareType),isLoadingAvatar:!0}}},computed:{...e.mapGetters(["configuration","capabilities"]),btnDeselectRecipientLabel(){const e=this.$gettext("Deselect %{name}");return this.$gettextInterpolate(e,{name:this.recipient.label})}},async created(){if(this.capabilities.files_sharing.user.profile_picture&&this.hasAvatar)try{this.formattedRecipient.avatar=await Ls({clientService:this.$clientService,server:this.configuration.server,username:this.recipient.value.shareWith,token:this.accessToken})}catch(e){console.error(e)}this.formattedRecipient.isLoadingAvatar=!1},methods:{getRecipientIcon(){switch(this.recipient.value.shareType){case s.ShareTypes.group.value:return{name:s.ShareTypes.group.icon,label:this.$gettext("Group")};case s.ShareTypes.guest.value:return{name:s.ShareTypes.guest.icon,label:this.$gettext("Guest user")};case s.ShareTypes.remote.value:return{name:s.ShareTypes.remote.icon,label:this.$gettext("Remote user")};default:return{name:s.ShareTypes.user.icon,label:this.$gettext("User")}}}}};var Oa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("oc-recipient",{staticClass:"files-share-invite-recipient",attrs:{"data-testid":"recipient-container-"+e.formattedRecipient.name,recipient:e.formattedRecipient},scopedSlots:e._u([{key:"append",fn:function(){return[i("oc-button",{staticClass:"files-share-invite-recipient-btn-remove",attrs:{appearance:"raw","aria-label":e.btnDeselectRecipientLabel},on:{click:function(t){return t.stopPropagation(),e.deselect(e.recipient)}}},[i("oc-icon",{attrs:{name:"close",size:"small"}})],1)]},proxy:!0}])})};Oa._withStripped=!0;const Na=e.normalizeComponent({render:Oa,staticRenderFns:[]},undefined,Ma,undefined,false,undefined,!1,void 0,void 0,void 0);const Ba=e.defineComponent({name:"DateCurrentpicker",props:{shareTypes:{type:Array,required:!1,default:()=>[]}},setup(t,{emit:a}){const n=e.getCurrentInstance().proxy,o=e.computed((()=>n.$language)),l=i.useStore(),c=e.computed((()=>l.getters.capabilities)),d=e.computed((()=>c.value.files_sharing.user?.expire_date)),u=e.computed((()=>c.value.files_sharing.group?.expire_date)),p=e.computed((()=>d.value||u.value)),h=e.computed((()=>d.value?.enforced||u.value?.enforced)),m=e.DateTime_1.now().setLocale(o.value.current).toJSDate(),f=e.computed((()=>{const i=t.shareTypes.includes(s.ShareTypes.user.value),a=t.shareTypes.includes(s.ShareTypes.group.value),n=parseInt(d.value?.days),l=parseInt(u.value?.days);if(!d.value?.enabled&&!u.value?.enabled)return null;let c=0;return n&&i&&l&&a?c=Math.min(n,l):n&&i?c=n:l&&a&&(c=l),c?e.DateTime_1.now().setLocale(r.getLocaleFromLanguage(o.value.current)).plus({days:c}).toJSDate():null})),g=e.computed((()=>h.value?f.value:null)),v=e.customRef(((e,t)=>{let i=null;return{get:()=>(e(),i||f.value),set(e){i=e,t()}}})),b=e.computed((()=>r.formatRelativeDateFromDateTime(e.DateTime_1.fromJSDate(v.value).endOf("day"),o.value.current)));return e.watch(v,(t=>{const i=e.DateTime_1.fromJSDate(t).setLocale(r.getLocaleFromLanguage(o.value.current)).endOf("day");a("optionChange",{expirationDate:i.isValid?i.toFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"):null})})),e.watch(g,(e=>{!e||v.value"Share"},inviteLabel:{type:String,required:!1,default:""}},setup(){const e=i.useStore();return{hasResharing:t.useCapabilityFilesSharingResharing(e),hasShareJail:t.useCapabilityShareJailEnabled(e),hasRoleCustomPermissions:t.useCapabilityFilesSharingAllowCustomPermissions(e),hasRoleDenyAccess:t.useCapabilityFilesSharingCanDenyAccess(e),...n.useGraphClient()}},data:()=>({autocompleteResults:[],announcement:"",searchInProgress:!1,selectedCollaborators:[],selectedRole:null,customPermissions:null,saving:!1,expirationDate:null,searchQuery:""}),computed:{...e.mapGetters("Files",["currentFileOutgoingCollaborators","highlightedFile"]),...e.mapGetters("runtime/spaces",["spaceMembers"]),...e.mapGetters(["configuration","user","capabilities"]),$_announcementWhenCollaboratorAdded(){return this.$gettext("Person was added")},$_isValid(){return this.selectedCollaborators.length>0},minSearchLength(){return parseInt(this.user.capabilities.files_sharing.search_min_length,10)},selectedCollaboratorsLabel(){return this.inviteLabel||this.$gettext("Invite")},resourceIsSpace(){return"space"===this.highlightedFile.type}},mounted(){if(this.fetchRecipients=e.debounce(this.fetchRecipients,500),this.resourceIsSpace)this.selectedRole=s.SpacePeopleShareRoles.list()[0];else{const e=this.highlightedFile.canDeny()&&this.hasRoleDenyAccess;this.selectedRole=s.PeopleShareRoles.list(this.highlightedFile.isFolder,this.hasRoleCustomPermissions,e)[0]}},methods:{...e.mapActions("Files",["addShare"]),...e.mapActions("runtime/spaces",["addSpaceMember"]),async fetchRecipients(e){try{const t=await this.$client.shares.getRecipients(e,"folder",1,this.configuration?.options?.sharingRecipientsPerPage),i=t.exact.users.concat(t.users).filter((e=>e.value.shareWith!==this.user.id)).map((e=>{const t=this.resourceIsSpace?s.ShareTypes.space.value:e.value.shareType;return{...e,value:{...e.value,shareType:t}}}));let a=[];this.resourceIsSpace||(a=t.exact.groups.concat(t.groups));const r=t.exact.remotes.concat(t.remotes);this.autocompleteResults=i.concat(a,r).filter((e=>{const t=this.selectedCollaborators.find((t=>e.value.shareWith===t.value.shareWith&&parseInt(e.value.shareType,10)===parseInt(t.value.shareType,10))),i=(this.resourceIsSpace?this.spaceMembers:this.currentFileOutgoingCollaborators).find((t=>e.value.shareWith===t.collaborator.name&&parseInt(e.value.shareType,10)===t.shareType));return!t&&!i&&(this.announcement=this.$_announcementWhenCollaboratorAdded,!0)}))}catch(e){console.error(e)}this.searchInProgress=!1},onSearch(e){this.autocompleteResults=[],this.searchQuery=e,e.lengthe.length<1?[]:(t=t.split(":")[1]||t,e.filter((e=>e.value.shareType===s.ShareTypes.remote.value||e.label.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1||e.value.shareWith.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1||(e.value.shareWithAdditionalInfo||"").toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1))),collaboratorRoleChanged({role:e,permissions:t}){this.selectedRole=e,this.customPermissions=t},collaboratorExpiryChanged({expirationDate:e}){this.expirationDate=e},async share(){this.saving=!0;const t=new e._default({concurrency:4}),i=[];this.selectedCollaborators.forEach((e=>{i.push(t.add((()=>{const t=this.selectedRole.hasCustomPermissions?s.SharePermissions.permissionsToBitmask(this.customPermissions):s.SharePermissions.permissionsToBitmask(this.selectedRole.permissions(this.hasResharing||this.resourceIsSpace));let i=this.highlightedFile.path;this.hasShareJail&&"/"===i&&(i=`/${this.highlightedFile.name}`);(this.resourceIsSpace?this.addSpaceMember:this.addShare)({client:this.$client,graphClient:this.graphClient,path:i,$gettext:this.$gettext,shareWith:e.value.shareWith,displayName:e.label,shareType:e.value.shareType,permissions:t,role:this.selectedRole,expirationDate:this.expirationDate,storageId:this.highlightedFile.fileId||this.highlightedFile.id})})))})),await Promise.all(i),this.selectedCollaborators=[],this.saving=!1},resetFocusOnInvite(){this.autocompleteResults=[],this.$nextTick((()=>{document.getElementById("files-share-invite-input").focus()}))}}});var ja=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"new-collaborators-form","data-testid":"new-collaborators-form"}},[i("oc-select",{ref:"ocSharingAutocomplete",attrs:{id:"files-share-invite-input",options:e.autocompleteResults,loading:e.searchInProgress,multiple:!0,filter:e.filterRecipients,label:e.selectedCollaboratorsLabel,"aria-describedby":"files-share-invite-hint","dropdown-should-open":function(t){var i=t.open,s=t.search;return i&&s.length>=e.minSearchLength&&!e.searchInProgress}},on:{"search:input":e.onSearch,input:e.resetFocusOnInvite},scopedSlots:e._u([{key:"option",fn:function(e){return[i("autocomplete-item",{attrs:{item:e}})]}},{key:"no-options",fn:function(){return[e.resourceIsSpace?i("translate",[e._v(" No users found. ")]):i("translate",[e._v(" No users or groups found. ")])]},proxy:!0},{key:"selected-option-container",fn:function(e){var t=e.option,s=e.deselect;return[i("recipient-container",{key:t.value.shareWith,attrs:{recipient:t,deselect:s}})]}},{key:"open-indicator",fn:function(){return[i("span")]},proxy:!0}]),model:{value:e.selectedCollaborators,callback:function(t){e.selectedCollaborators=t},expression:"selectedCollaborators"}}),e._v(" "),i("div",{staticClass:"oc-flex oc-flex-middle oc-flex-between oc-mb-l oc-mt-s"},[i("role-dropdown",{attrs:{resource:e.highlightedFile,"allow-share-permission":e.hasResharing||e.resourceIsSpace},on:{optionChange:e.collaboratorRoleChanged}}),e._v(" "),i("expiration-datepicker",{attrs:{"share-types":e.selectedCollaborators.map((function(e){return e.value.shareType}))},on:{optionChange:e.collaboratorExpiryChanged}}),e._v(" "),e.saving?i("oc-button",{key:"new-collaborator-saving-button",attrs:{disabled:!0}},[i("oc-spinner",{attrs:{"aria-label":e.$gettext("Creating share"),size:"small"}}),e._v(" "),i("span",{directives:[{name:"translate",rawName:"v-translate"}],attrs:{"aria-hidden":!0},domProps:{textContent:e._s(e.saveButtonLabel)}})],1):i("oc-button",{key:"new-collaborator-save-button",attrs:{id:"new-collaborators-form-create-button","data-testid":"new-collaborators-form-create-button",disabled:!e.$_isValid,variation:"primary",appearance:"filled",submit:"submit"},domProps:{textContent:e._s(e.$gettext(e.saveButtonLabel))},on:{click:e.share}})],1),e._v(" "),i("oc-hidden-announcer",{attrs:{level:"assertive",announcement:e.announcement}})],1)};ja._withStripped=!0;const Va=e.normalizeComponent({render:ja,staticRenderFns:[]},undefined,qa,undefined,false,undefined,!1,void 0,void 0,void 0);const Ga={name:"EditDropdown",props:{expirationDate:{type:Date,required:!1,default:void 0},shareCategory:{type:String,required:!1,default:null,validator:function(e){return["user","group"].includes(e)||!e}},canEditOrDelete:{type:Boolean,required:!0}},data:function(){return{enteredExpirationDate:null}},computed:c._objectSpread2(c._objectSpread2({},e.mapGetters(["capabilities"])),{},{options:function(){var e=[];return this.isRemoveExpirationPossible&&e.push({title:this.$gettext("Remove expiration date"),method:this.removeExpirationDate,class:"remove-expiration-date",enabled:this.canEditOrDelete,icon:"calendar",additionalAttributes:{"data-testid":"collaborator-remove-expiration-btn"}}),[].concat(e,[{title:this.$gettext("Remove share"),method:this.removeShare,class:"remove-share",enabled:this.canEditOrDelete,icon:"delete-bin-5",additionalAttributes:{"data-testid":"collaborator-remove-share-btn"}},{title:this.$gettext("Access details"),method:this.showAccessDetails,enabled:!0,icon:"information",class:"show-access-details"}])},editShareBtnId:function(){return"files-collaborators-edit-button-"+this._uid},shareEditOptions:function(){return this.$gettext("Context menu of the share")},editingUser:function(){return"user"===this.shareCategory},editingGroup:function(){return"group"===this.shareCategory},isExpirationSupported:function(){return this.editingUser&&this.userExpirationDate||this.editingGroup&&this.groupExpirationDate},isExpirationDateSet:function(){return!!this.expirationDate},isRemoveExpirationPossible:function(){return this.isExpirationSupported&&this.isExpirationDateSet&&!this.isExpirationDateEnforced},isDefaultExpirationEnabled:function(){return this.editingUser?this.userExpirationDate.enabled:this.editingGroup?this.groupExpirationDate.enabled:this.userExpirationDate.enabled||this.groupExpirationDate.enabled},userExpirationDate:function(){return this.capabilities.files_sharing.user.expire_date},groupExpirationDate:function(){var e;return null===(e=this.capabilities.files_sharing.group)||void 0===e?void 0:e.expire_date},defaultExpirationDate:function(){if(!this.isDefaultExpirationEnabled)return null;var e=parseInt(this.userExpirationDate.days),t=parseInt(this.groupExpirationDate.days),i=0;i=this.editingUser?e:this.editingGroup?t:e&&t?Math.min(e,t):e||t;var s=new Date;return s.setDate((new Date).getDate()+i),s},isExpirationDateEnforced:function(){return this.editingUser?this.userExpirationDate.enforced:this.editingGroup?this.groupExpirationDate.enforced:this.userExpirationDate.enforced||this.groupExpirationDate.enforced},maxExpirationDate:function(){return this.isExpirationDateEnforced?this.defaultExpirationDate:null},minExpirationDate:function(){var e=new Date;return e.setDate((new Date).getDate()+1),e},relativeExpirationDate:function(){return r.formatRelativeDateFromDateTime(e.DateTime_1.fromJSDate(this.enteredExpirationDate).endOf("day"),this.$language.current)}}),watch:{enteredExpirationDate:{handler:"updateExpirationDate"}},methods:{updateExpirationDate:function(){this.$emit("expirationDateChanged",{expirationDate:e.DateTime_1.fromJSDate(this.enteredExpirationDate).endOf("day").toISO()}),this.$refs.expirationDateDrop.hide()},removeExpirationDate:function(){this.$emit("expirationDateChanged",{expirationDate:null}),this.$refs.expirationDateDrop.hide()},removeShare:function(){this.$emit("removeShare")},showAccessDetails:function(){this.$emit("showAccessDetails")}}};var Ha=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",{staticClass:"oc-flex oc-flex-middle"},[i("oc-button",{staticClass:"collaborator-edit-dropdown-options-btn",attrs:{id:e.editShareBtnId,appearance:"raw"}},[i("oc-icon",{attrs:{name:"more-2"}})],1),e._v(" "),i("oc-drop",{ref:"expirationDateDrop",attrs:{toggle:"#"+e.editShareBtnId,mode:"click","padding-size":"small"}},[i("oc-list",{staticClass:"collaborator-edit-dropdown-options-list",attrs:{"aria-label":e.shareEditOptions}},[e.isExpirationSupported?i("li",{staticClass:"oc-rounded oc-menu-item-hover"},[i("oc-datepicker",{staticClass:"files-recipient-expiration-datepicker",attrs:{"min-date":e.minExpirationDate,"max-date":e.maxExpirationDate,locale:e.$language.current,"is-required":e.isExpirationDateEnforced,"data-testid":"recipient-datepicker"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.togglePopover;return[i("oc-button",{staticClass:"files-collaborators-expiration-button oc-p-s action-menu-item",attrs:{"data-testid":"recipient-datepicker-btn",appearance:"raw"},on:{click:s}},[i("oc-icon",{attrs:{name:"calendar-event","fill-type":"line",size:"medium",variation:"passive"}}),e._v(" "),e.isExpirationDateSet?i("span",{domProps:{textContent:e._s(e.$gettext("Edit expiration date"))}}):i("span",{domProps:{textContent:e._s(e.$gettext("Set expiration date"))}})],1)]}}],null,!1,2455376250),model:{value:e.enteredExpirationDate,callback:function(t){e.enteredExpirationDate=t},expression:"enteredExpirationDate"}})],1):e._e(),e._v(" "),e._l(e.options,(function(t,s){return i("li",{key:s,staticClass:"oc-rounded oc-menu-item-hover"},[t.enabled?i("oc-button",e._b({staticClass:"oc-p-s action-menu-item",class:t.class,attrs:{appearance:"raw"},on:{click:function(e){return t.method()}}},"oc-button",t.additionalAttributes||{},!1),[i("oc-icon",{attrs:{name:t.icon,"fill-type":"line",size:"medium",variation:"passive"}}),e._v(" "),i("span",{domProps:{textContent:e._s(t.title)}})],1):e._e()],1)}))],2)],1)],1)};Ha._withStripped=!0;const Wa=e.normalizeComponent({render:Ha,staticRenderFns:[]},undefined,Ga,undefined,false,undefined,!1,void 0,void 0,void 0);const Qa=e.defineComponent({name:"ListItem",components:{EditDropdown:Wa,RoleDropdown:Pa},props:{share:{type:Object,required:!0},modifiable:{type:Boolean,default:!1},sharedParentRoute:{type:Object,default:null}},setup:()=>({hasResharing:t.useCapabilityFilesSharingResharing(),...n.useGraphClient()}),computed:{...e.mapGetters("Files",["highlightedFile"]),...e.mapState(["user"]),shareType(){return s.ShareTypes.getByValue(this.share.shareType)},shareTypeIcon(){return this.shareType.icon},shareTypeKey(){return this.shareType.key},shareDomSelector(){if(this.share.id)return a.extractDomSelector(this.share.id)},isGroup(){return this.shareType===s.ShareTypes.group},isUser(){return this.shareType===s.ShareTypes.user},isSpace(){return this.shareType===s.ShareTypes.space},shareTypeText(){return this.$gettext(this.shareType.label)},shareCategory(){return s.ShareTypes.isIndividual(this.shareType)?"user":"group"},shareDisplayName(){return this.user.id===this.share.collaborator.name?this.$gettextInterpolate(this.$gettext("%{collaboratorName} (me)"),{collaboratorName:this.share.collaborator.displayName}):this.share.collaborator.displayName},shareAdditionalInfo(){return this.share.collaborator.additionalInfo},shareDisplayNameTooltip(){return this.shareDisplayName+(this.shareAdditionalInfo?`(${this.shareAdditionalInfo})`:"")},screenreaderShareDisplayName(){const e={displayName:this.share.collaborator.displayName,...this.share.collaborator.additionalInfo&&{additionalInfo:this.share.collaborator.additionalInfo}};let t=this.$gettext("Share receiver name: %{ displayName }");return this.shareAdditionalInfo&&(t=this.$gettext("Share receiver name: %{ displayName } (%{ additionalInfo })")),this.$gettextInterpolate(t,e)},screenreaderShareExpiration(){const e=this.$gettext("Share expires %{ expiryDateRelative } (%{ expiryDate })");return this.$gettextInterpolate(e,{expiryDateRelative:this.expirationDateRelative,expiryDate:this.expirationDate})},canEditOrDelete(){return this.modifiable},hasExpirationDate(){return this.share.expires},expirationDate(){return r.formatDateFromDateTime(e.DateTime_1.fromJSDate(this.share.expires).endOf("day"),this.$language.current)},expirationDateRelative(){return r.formatRelativeDateFromDateTime(e.DateTime_1.fromJSDate(this.share.expires).endOf("day"),this.$language.current)},sharedParentDir(){return this.sharedParentRoute?.params?.driveAliasAndItem.split("/").pop()},editDropDownToggleId:()=>e.v4(),shareDate(){return r.formatDateFromDateTime(e.DateTime_1.fromSeconds(parseInt(this.share.stime)),this.$language.current)},shareOwnerDisplayName(){return this.share.owner.displayName},shareOwnerAdditionalInfo(){return this.share.owner.additionalInfo},accessDetailsPropsSpace(){const e=[];return e.push({text:this.$gettext("Name"),headline:!0},{text:this.shareDisplayName}),this.shareAdditionalInfo&&e.push({text:this.$gettext("Additional info"),headline:!0},{text:this.shareAdditionalInfo}),e.push({text:this.$gettext("Type"),headline:!0},{text:this.shareTypeText}),{title:this.$gettext("Access details"),list:e}},accessDetailsProps(){const e=[];return e.push({text:this.$gettext("Name"),headline:!0},{text:this.shareDisplayName}),this.shareAdditionalInfo&&e.push({text:this.$gettext("Additional info"),headline:!0},{text:this.shareAdditionalInfo}),e.push({text:this.$gettext("Type"),headline:!0},{text:this.shareTypeText}),e.push({text:this.$gettext("Access expires"),headline:!0},{text:this.hasExpirationDate?this.expirationDate:this.$gettext("no")}),e.push({text:this.$gettext("Shared on"),headline:!0},{text:this.shareDate}),e.push({text:this.$gettext("Invited by"),headline:!0},{text:this.shareOwnerAdditionalInfo?`${this.shareOwnerDisplayName} (${this.shareOwnerAdditionalInfo})`:this.shareOwnerDisplayName}),{title:this.$gettext("Access details"),list:e}}},methods:{...e.mapActions(["showMessage"]),...e.mapActions("Files",["changeShare"]),...e.mapActions("runtime/spaces",["changeSpaceMember"]),removeShare(){this.$emit("onDelete",this.share)},showAccessDetails(){this.$refs.accessDetailsDrop.$refs.drop.show()},shareRoleChanged({role:e,permissions:t}){const i=this.share.expires;try{this.saveShareChanges({role:e,permissions:t,expirationDate:i})}catch(e){console.error(e),this.showMessage({title:this.$gettext("Failed to apply new permissions"),status:"danger"})}},shareExpirationChanged({expirationDate:e}){const t=this.share.role,i=this.share.customPermissions;try{this.saveShareChanges({role:t,permissions:i,expirationDate:e})}catch(e){console.error(e),this.showMessage({title:this.$gettext("Failed to apply expiration date"),status:"danger"})}},saveShareChanges({role:e,permissions:t,expirationDate:i}){const a=e.hasCustomPermissions?s.SharePermissions.permissionsToBitmask(t):s.SharePermissions.permissionsToBitmask(e.permissions(this.hasResharing||this.isSpace));(this.isSpace?this.changeSpaceMember:this.changeShare)({client:this.$client,graphClient:this.graphClient,share:this.share,permissions:a,expirationDate:i||"",role:e})}}});var Ja=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"files-collaborators-collaborator oc-py-xs",attrs:{"data-testid":"collaborator-"+(e.isUser||e.isSpace?"user":"group")+"-item-"+e.share.collaborator.name}},[i("div",{staticClass:"oc-width-1-1 oc-flex oc-flex-middle files-collaborators-collaborator-details"},[i("div",{staticClass:"oc-width-2-3 oc-flex oc-flex-middle"},[i("div",[e.isUser||e.isSpace?i("avatar-image",{staticClass:"files-collaborators-collaborator-indicator",attrs:{userid:e.share.collaborator.name,"user-name":e.share.collaborator.displayName,width:36}}):i("oc-avatar-item",{staticClass:"files-collaborators-collaborator-indicator",attrs:{width:36,"icon-size":"medium",icon:e.shareTypeIcon,name:e.shareTypeKey}})],1),e._v(" "),i("div",{staticClass:"oc-pl-s oc-text-truncate"},[i("div",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.shareDisplayNameTooltip,expression:"shareDisplayNameTooltip"}],staticClass:"oc-text-truncate"},[i("span",{staticClass:"files-collaborators-collaborator-name",attrs:{"aria-hidden":"true"},domProps:{textContent:e._s(e.shareDisplayName)}}),e._v(" "),i("span",{staticClass:"oc-invisible-sr",domProps:{textContent:e._s(e.screenreaderShareDisplayName)}})]),e._v(" "),i("div",[e.canEditOrDelete?i("div",{staticClass:"oc-flex oc-flex-nowrap oc-flex-middle"},[i("role-dropdown",{staticClass:"files-collaborators-collaborator-role",attrs:{resource:e.highlightedFile,"dom-selector":e.shareDomSelector,"existing-permissions":e.share.customPermissions,"existing-role":e.share.role,"allow-share-permission":e.hasResharing||e.isSpace},on:{optionChange:e.shareRoleChanged}})],1):e.share.role?i("div",[i("span",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext(e.share.role.description(!1)),expression:"$gettext(share.role.description(false))"}],staticClass:"oc-mr-xs",domProps:{textContent:e._s(e.$gettext(e.share.role.label))}})]):e._e()])])]),e._v(" "),i("div",{staticClass:"oc-flex flex-en oc-flex-middle oc-width-1-3",staticStyle:{"justify-content":"end"}},[e.sharedParentRoute?i("div",{staticClass:"oc-resource-indicators oc-text-truncate"},[i("router-link",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Navigate to parent folder"),expression:"$gettext('Navigate to parent folder')"}],staticClass:"parent-folder oc-text-truncate",attrs:{to:e.sharedParentRoute}},[i("span",{staticClass:"text",domProps:{textContent:e._s(e.$gettext("via"))}}),e._v(" "),i("oc-icon",{staticClass:"oc-px-xs",attrs:{name:"folder-2",size:"small","fill-type":"line"}}),e._v(" "),i("span",{staticClass:"text oc-text-truncate",domProps:{textContent:e._s(e.sharedParentDir)}})],1)],1):e._e(),e._v(" "),e.hasExpirationDate?i("span",[i("oc-icon",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.expirationDate,expression:"expirationDate"}],staticClass:"files-collaborators-collaborator-expiration",attrs:{"data-testid":"recipient-info-expiration-date","aria-label":e.expirationDate,name:"calendar","fill-type":"line"}}),e._v(" "),i("span",{staticClass:"oc-invisible-sr",domProps:{textContent:e._s(e.screenreaderShareExpiration)}})],1):e._e(),e._v(" "),i("edit-dropdown",{staticClass:"files-collaborators-collaborator-edit",attrs:{id:"edit-drop-down-"+e.editDropDownToggleId,"data-testid":"collaborator-edit","expiration-date":e.share.expires?e.share.expires:null,"share-category":e.shareCategory,"can-edit-or-delete":e.canEditOrDelete},on:{expirationDateChanged:e.shareExpirationChanged,removeShare:e.removeShare,showAccessDetails:e.showAccessDetails}}),e._v(" "),i("oc-info-drop",e._b({ref:"accessDetailsDrop",staticClass:"share-access-details-drop",attrs:{mode:"manual",target:"#edit-drop-down-"+e.editDropDownToggleId}},"oc-info-drop",e.isSpace?e.accessDetailsPropsSpace:e.accessDetailsProps,!1))],1)])])};Ja._withStripped=!0;const Ya=e.normalizeComponent({render:Ja,staticRenderFns:[]},undefined,Qa,"data-v-516956a4",false,undefined,!1,void 0,void 0,void 0);const Ka=e.defineComponent({name:"FileShares",components:{InviteCollaboratorForm:Va,CollaboratorListItem:Ya},props:{space:{type:Object,required:!1,default:null}},setup(){const s=i.useStore();return{sharesListCollapsed:!s.getters.configuration.options.sidebar.shares.showAllOnLoad,currentUserIsMemberOfSpace:e.computed((()=>{const e=s.getters.user?.id;return!!e&&s.getters["runtime/spaces/spaceMembers"].some((t=>t.collaborator?.name===e))})),hasProjectSpaces:t.useCapabilityProjectSpacesEnabled(),hasShareJail:t.useCapabilityShareJailEnabled(),hasResharing:t.useCapabilityFilesSharingResharing()}},computed:{...e.mapGetters("Files",["highlightedFile","currentFileOutgoingCollaborators"]),...e.mapGetters(["configuration"]),...e.mapGetters("runtime/spaces",["spaceMembers"]),...e.mapState("Files",["incomingShares","sharesTree"]),...e.mapState(["user"]),inviteCollaboratorHelp(){if(!!this.configuration?.options?.cernFeatures){const e=la;return e.list=[...ca.list,...la.list],e}return la},helpersEnabled(){return this.configuration?.options?.contextHelpers},sharedWithLabel(){return this.$gettext("Shared with")},spaceMemberLabel(){return this.$gettext("Space members")},collapseButtonTitle(){return this.sharesListCollapsed?this.$gettext("Show more"):this.$gettext("Show less")},hasSharees(){return this.collaborators.length>0},collaborators(){return[...this.currentFileOutgoingCollaborators,...this.indirectOutgoingShares].sort(this.collaboratorsComparator).map((e=>(e.key="collaborator-"+e.id,e.owner.name!==e.fileOwner.name&&e.owner.name!==this.user.id&&(e.resharers=[e.owner]),e)))},displayCollaborators(){return this.collaborators.length>3&&this.sharesListCollapsed?this.collaborators.slice(0,3):this.collaborators},displaySpaceMembers(){return this.spaceMembers.length>3&&this.sharesListCollapsed?this.spaceMembers.slice(0,3):this.spaceMembers},showShareToggle(){return this.spaceMembers.length>3||this.collaborators.length>3},indirectOutgoingShares(){const e=[],t=$(this.highlightedFile.path,!1);return 0===t.length?[]:(t.forEach((t=>{const i=this.sharesTree[t];i&&i.forEach((t=>{t.outgoing&&this.$_isCollaboratorShare(t)&&e.push({...t,key:"indirect-collaborator-"+t.id})}))})),e)},currentUserCanShare(){if(this.highlightedFile.isReceivedShare()&&!this.hasResharing)return!1;return!("share"===this.space?.driveType&&!this.hasResharing)&&this.highlightedFile.canShare({user:this.user})},noResharePermsMessage(){const e=this.$gettext("You don't have permission to share this file."),t=this.$gettext("You don't have permission to share this folder.");return"file"===this.highlightedFile.type?e:t},showSpaceMembers(){return"project"===this.space?.driveType&&"space"!==this.highlightedFile.type&&this.currentUserIsMemberOfSpace}},methods:{...e.mapActions("Files",["deleteShare"]),...e.mapActions(["createModal","hideModal","showMessage"]),...e.mapMutations("Files",["REMOVE_FILES"]),toggleShareesListCollapsed(){this.sharesListCollapsed=!this.sharesListCollapsed},$_isCollaboratorShare:e=>s.ShareTypes.containsAnyValue(s.ShareTypes.authenticated,[e.shareType]),collaboratorsComparator(e,t){const i=e.collaborator?e.collaborator.displayName:e.displayName,a=t.collaborator?t.collaborator.displayName:t.displayName,r=i.toLowerCase().trim(),n=a.toLowerCase().trim(),o=s.ShareTypes.containsAnyValue(s.ShareTypes.individuals,[e.shareType]),l=s.ShareTypes.containsAnyValue(s.ShareTypes.individuals,[t.shareType]),c=!e.indirect,d=!t.indirect;return o===l?c===d?r===n?Fa.naturalSortCompare(e.stime+"",t.stime+""):Fa.naturalSortCompare(r,n):c?-1:1:o?-1:1},$_ocCollaborators_deleteShare_trigger(e){const t={variation:"danger",icon:"alarm-warning",title:this.$gettext("Remove share"),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Remove"),message:this.$gettext("Are you sure you want to remove this share?"),hasInput:!1,onCancel:this.hideModal,onConfirm:()=>this.$_ocCollaborators_deleteShare(e)};this.createModal(t)},async $_ocCollaborators_deleteShare(e){let t=this.highlightedFile.path;this.hasShareJail&&"/"===t&&(t=`/${this.highlightedFile.name}`);const i=1===this.currentFileOutgoingCollaborators.length?this.currentFileOutgoingCollaborators[0].id:void 0;try{await this.deleteShare({client:this.$client,share:e,path:t,storageId:this.highlightedFile.fileId,loadIndicators:!!i}),this.hideModal(),this.showMessage({title:this.$gettext("Share was removed successfully")}),i&&o.isLocationSharesActive(this.$router,"files-shares-with-others")&&this.REMOVE_FILES([{id:i}])}catch(e){console.error(e),this.showMessage({title:this.$gettext("Failed to remove share"),status:"danger"})}},getSharedParentRoute(e){return e.indirect&&this.space&&this.sharesTree[e.path]?o.createLocationSpaces("files-spaces-generic",t.createFileRouteOptions(this.space,{path:e.path,fileId:e.file.source})):null},isShareModifiable(e){return!(this.space&&a.isProjectSpaceResource(this.space)&&this.currentUserIsMemberOfSpace&&!this.space?.spaceRoles.manager.includes(this.user.uuid))&&!e.indirect}}});var Za=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-position-relative",attrs:{id:"oc-files-sharing-sidebar"}},[i("div",{staticClass:"oc-flex"},[i("h3",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"oc-text-bold oc-text-medium oc-m-rm"},[e._v("Share with people")]),e._v(" "),e.helpersEnabled?i("oc-contextual-helper",e._b({staticClass:"oc-pl-xs"},"oc-contextual-helper",e.inviteCollaboratorHelp,!1)):e._e()],1),e._v(" "),e.currentUserCanShare?i("invite-collaborator-form",{key:"new-collaborator",staticClass:"oc-my-s"}):i("p",{key:"no-reshare-permissions-message",attrs:{"data-testid":"files-collaborators-no-reshare-permissions-message"},domProps:{textContent:e._s(e.noResharePermsMessage)}}),e._v(" "),e.hasSharees?i("div",{staticClass:"avatars-wrapper oc-flex oc-flex-middle oc-flex-between"},[i("h4",{staticClass:"oc-text-bold oc-my-rm",domProps:{textContent:e._s(e.sharedWithLabel)}})]):e._e(),e._v(" "),e.hasSharees?[i("ul",{staticClass:"oc-list oc-list-divider oc-overflow-hidden",class:{"oc-mb-l":e.showSpaceMembers,"oc-m-rm":!e.showSpaceMembers},attrs:{id:"files-collaborators-list","aria-label":e.$gettext("Share receivers")}},e._l(e.displayCollaborators,(function(t){return i("li",{key:t.key},[i("collaborator-list-item",{attrs:{share:t,modifiable:e.isShareModifiable(t),"shared-parent-route":e.getSharedParentRoute(t)},on:{onDelete:e.$_ocCollaborators_deleteShare_trigger}})],1)})),0),e._v(" "),e.showShareToggle?i("div",{staticClass:"oc-flex oc-flex-center"},[i("oc-button",{attrs:{appearance:"raw"},domProps:{textContent:e._s(e.collapseButtonTitle)},on:{click:e.toggleShareesListCollapsed}})],1):e._e()]:e._e(),e._v(" "),e.showSpaceMembers?[i("h4",{staticClass:"oc-text-bold oc-my-s",domProps:{textContent:e._s(e.spaceMemberLabel)}}),e._v(" "),i("ul",{staticClass:"oc-list oc-list-divider oc-overflow-hidden oc-m-rm",attrs:{id:"space-collaborators-list","aria-label":e.spaceMemberLabel}},e._l(e.displaySpaceMembers,(function(e){return i("li",{key:e.key},[i("collaborator-list-item",{attrs:{share:e,modifiable:!1}})],1)})),0),e._v(" "),e.showShareToggle?i("div",{staticClass:"oc-flex oc-flex-center"},[i("oc-button",{attrs:{appearance:"raw"},domProps:{textContent:e._s(e.collapseButtonTitle)},on:{click:e.toggleShareesListCollapsed}})],1):e._e()]:e._e()],2)};Za._withStripped=!0;const Xa=e.normalizeComponent({render:Za,staticRenderFns:[]},undefined,Ka,undefined,false,undefined,!1,void 0,void 0,void 0);const er=e.defineComponent({name:"SpaceMembers",components:{CollaboratorListItem:Ya,InviteCollaboratorForm:Va},props:{space:{type:Object,required:!1,default:null}},setup:()=>({...n.useGraphClient()}),data:()=>({filterTerm:"",isFilterOpen:!1,markInstance:null}),computed:{...e.mapGetters(["configuration"]),...e.mapGetters("runtime/spaces",["spaceMembers"]),...e.mapState(["user"]),filteredSpaceMembers(){return this.filter(this.spaceMembers,this.filterTerm)},helpersEnabled(){return this.configuration?.options?.contextHelpers},spaceAddMemberHelp:()=>da,hasCollaborators(){return this.spaceMembers.length>0},currentUserCanShare(){return this.currentUserIsManager},currentUserIsManager(){return this.spaceMembers.find((e=>e.collaborator.name===this.user.id))?.role?.name===s.spaceRoleManager.name}},watch:{isFilterOpen(){this.filterTerm=""},filterTerm(){this.$nextTick((()=>{this.$refs.collaboratorList&&(this.markInstance=new e.mark(this.$refs.collaboratorList),this.markInstance.unmark(),this.markInstance.mark(this.filterTerm,{element:"span",className:"highlight-mark"}))}))}},methods:{...e.mapActions("runtime/spaces",["deleteSpaceMember"]),...e.mapActions(["createModal","hideModal","showMessage"]),filter(t,i){if(!(i||"").trim())return t;return new e.Fuse(t,{includeScore:!0,useExtendedSearch:!0,threshold:.3,keys:["collaborator.displayName","collaborator.name"]}).search(i).map((e=>e.item))},toggleFilter(){this.isFilterOpen=!this.isFilterOpen},isModifiable(e){if(!this.currentUserIsManager)return!1;if(e.role.name!==s.spaceRoleManager.name)return!0;return this.spaceMembers.filter((e=>e.role.name===s.spaceRoleManager.name)).length>1},$_ocCollaborators_deleteShare_trigger(e){const t={variation:"danger",icon:"alarm-warning",title:this.$gettext("Remove share"),cancelText:this.$gettext("Cancel"),confirmText:this.$gettext("Remove"),message:this.$gettext("Are you sure you want to remove this share?"),hasInput:!1,onCancel:this.hideModal,onConfirm:()=>this.$_ocCollaborators_deleteShare(e)};this.createModal(t)},async $_ocCollaborators_deleteShare(e){try{const t=e.collaborator.name===this.user.id;if(await this.deleteSpaceMember({client:this.$client,graphClient:this.graphClient,share:e,reloadSpace:!t}),this.showMessage({title:this.$gettext("Share was removed successfully")}),t)return o.isLocationSpacesActive(this.$router,"files-spaces-projects")?this.$router.go():this.$router.push(o.createLocationSpaces("files-spaces-projects"))}catch(e){console.error(e),this.showMessage({title:this.$gettext("Failed to remove share"),status:"danger"})}finally{this.hideModal()}}}});var tr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-position-relative",attrs:{id:"oc-files-sharing-sidebar"}},[i("div",{staticClass:"oc-flex oc-flex-between oc-flex-center oc-flex-middle"},[i("div",{staticClass:"oc-flex oc-py-s"},[i("h3",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"oc-text-bold oc-text-medium oc-m-rm"},[e._v("Members")]),e._v(" "),e.helpersEnabled?i("oc-contextual-helper",e._b({staticClass:"oc-pl-xs"},"oc-contextual-helper",e.spaceAddMemberHelp,!1)):e._e()],1),e._v(" "),i("div",{staticClass:"oc-flex"},[e.isFilterOpen?i("div",{staticClass:"oc-flex"},[i("oc-text-input",{staticClass:"oc-text-truncate space-members-filter oc-mr-s",attrs:{label:"",placeholder:e.$gettext("Filter members")},model:{value:e.filterTerm,callback:function(t){e.filterTerm=t},expression:"filterTerm"}}),e._v(" "),i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Close filter"),expression:"$gettext('Close filter')"}],attrs:{"aria-label":e.$gettext("Close filter"),appearance:"raw"},on:{click:e.toggleFilter}},[i("oc-icon",{attrs:{name:"close","fill-type":"line",size:"small"}})],1)],1):i("oc-button",{directives:[{name:"oc-tooltip",rawName:"v-oc-tooltip",value:e.$gettext("Filter members"),expression:"$gettext('Filter members')"}],attrs:{"aria-label":e.$gettext("Filter members"),appearance:"raw"},on:{click:e.toggleFilter}},[i("oc-icon",{attrs:{name:"search","fill-type":"line",size:"small"}})],1)],1)]),e._v(" "),e.currentUserCanShare?i("invite-collaborator-form",{key:"new-collaborator",staticClass:"oc-my-s",attrs:{"save-button-label":e.$gettext("Add"),"invite-label":e.$gettext("Add members")}}):e._e(),e._v(" "),e.hasCollaborators?[i("ul",{ref:"collaboratorList",staticClass:"oc-list oc-list-divider oc-overflow-hidden oc-m-rm",attrs:{id:"files-collaborators-list","aria-label":e.$gettext("Space members")}},e._l(e.filteredSpaceMembers,(function(t){return i("li",{key:t.key},[i("collaborator-list-item",{attrs:{share:t,modifiable:e.isModifiable(t)},on:{onDelete:function(i){return e.$_ocCollaborators_deleteShare_trigger(t)}}})],1)})),0)]:e._e()],2)};tr._withStripped=!0;const ir=e.normalizeComponent({render:tr,staticRenderFns:[]},undefined,er,undefined,false,undefined,!1,void 0,void 0,void 0);function sr(){const r=i.useStore(),n=e.ref(null),o=e.computed((()=>r.getters["Files/sharesTree"])),l=t.useCapabilitySpacesEnabled(r),c=e.C((function*(t,i){let s;for(const t of Object.values(e.unref(o)))if(s=t.find((e=>!e.outgoing)),s)return void(n.value=s);if(i.shareId&&(s=yield d.clientService.owncloudSdk.shares.getShare(i.shareId),s))return void(n.value=J(s.shareInfo,i,!0));if(p(i.id))n.value=null;else try{n.value=yield u(i)}catch(e){return void(n.value=null)}})),u=async e=>{let t=m(e.id);const i=t?[]:[e.name];let s=e;for(;!t;)s=await h(s.parentFolderId),t=m(s.id),t||i.unshift(s.name);return J((await d.clientService.owncloudSdk.shares.getShare(t.nodeId)).shareInfo,s,!0)},p=t=>e.unref(l)?r.getters["runtime/spaces/spaces"].find((e=>t.startsWith(e.id))):r.getters["runtime/spaces/spaces"].find((e=>a.isPersonalSpaceResource(e))),h=async e=>{const t=a.buildSpace({id:e,webDavPath:a.buildWebDavSpacesPath(e)});return await d.clientService.webdav.getFileInfo(t,{},{davProperties:[s.DavProperty.FileId,s.DavProperty.FileParent,s.DavProperty.Name,s.DavProperty.ResourceType]})},m=e=>r.getters["runtime/spaces/spaces"].find((t=>a.isMountPointSpaceResource(t)&&t.root?.remoteItem?.id===e));return{loadIncomingParentShare:c,incomingParentShare:n}}const ar=e.defineComponent({name:"SharesPanel",components:{FileLinks:Ca,FileShares:Xa,SpaceMembers:ir},provide(){return{incomingParentShare:e.computed((()=>this.incomingParentShare))}},props:{showSpaceMembers:{type:Boolean,default:!1},showLinks:{type:Boolean,default:!1}},setup(){const t=i.useStore(),s=e.computed((()=>t.getters["Files/sharesTreeLoading"]));return{...sr(),sharesLoading:s,space:e.inject("displayedSpace"),file:e.inject("displayedItem"),activePanel:e.inject("activePanel")}},watch:{sharesLoading:{handler:function(e,t){e||this.loadIncomingParentShare.perform(this.file),!this.loading&&this.activePanel&&t&&this.$nextTick((()=>{const[e,t]=this.activePanel.split("#");t&&this.$refs[t]&&this.$emit("scrollToElement",{element:this.$refs[t].$el,panelName:e})}))},immediate:!0}}});var rr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.sharesLoading?i("oc-loader",{attrs:{"aria-label":e.$gettext("Loading list of shares")}}):[e.showSpaceMembers?i("space-members",{ref:"peopleShares",staticClass:"oc-background-highlight oc-p-m oc-mb-s",attrs:{space:e.space}}):i("file-shares",{ref:"peopleShares",staticClass:"oc-background-highlight oc-p-m oc-mb-s",attrs:{space:e.space}}),e._v(" "),e.showLinks?i("file-links",{ref:"linkShares",staticClass:"oc-background-highlight oc-p-m",attrs:{space:e.space}}):e._e()]],2)};rr._withStripped=!0;const nr=e.normalizeComponent({render:rr,staticRenderFns:[]},undefined,ar,undefined,false,undefined,!1,void 0,void 0,void 0);const or=e.defineComponent({name:"NoSelection",computed:{selectedFilesString(){return this.$gettext("Select a file or folder to view details.")}}});var lr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oc-text-center oc-mt-xl",attrs:{id:"oc-no-selection"}},[i("oc-icon",{attrs:{size:"xxlarge",name:"drag-drop","fill-type":"line"}}),e._v(" "),i("p",{attrs:{"data-testid":"selectedFilesText"},domProps:{textContent:e._s(e.selectedFilesString)}})],1)};lr._withStripped=!0;const cr=e.normalizeComponent({render:lr,staticRenderFns:[]},undefined,or,undefined,false,undefined,!1,void 0,void 0,void 0);const dr=e.defineComponent({name:"SpaceActions",components:{ActionMenuItem:et,QuotaModal:Qi,ReadmeContentModal:Ki},mixins:[Xi,Zi,ss,ts,os,as,es,ns,is],setup:()=>({space:e.inject("displayedSpace")}),computed:{...e.mapGetters("Files",["highlightedFile"]),resources(){return[this.highlightedFile]},actions(){return[...this.$_rename_items,...this.$_editDescription_items,...this.$_uploadImage_items,...this.$_editReadmeContent_items,...this.$_editQuota_items,...this.$_deletedFiles_items,...this.$_restore_items,...this.$_delete_items,...this.$_disable_items].filter((e=>e.isEnabled({resources:this.resources})))},readmeContentModalIsOpen(){return this.$data.$_editReadmeContent_modalOpen},quotaModalIsOpen(){return this.$data.$_editQuota_modalOpen},supportedSpaceImageMimeTypes:()=>Ue.getSupportedMimeTypes("image/").join(",")},methods:{closeReadmeContentModal(){this.$_editReadmeContent_closeModal()},closeQuotaModal(){this.$_editQuota_closeModal()}}});var ur=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.readmeContentModalIsOpen?i("readme-content-modal",{attrs:{cancel:e.closeReadmeContentModal,space:e.resources[0]}}):e._e(),e._v(" "),e.quotaModalIsOpen?i("quota-modal",{attrs:{cancel:e.closeQuotaModal,space:e.resources[0]}}):e._e(),e._v(" "),i("input",{ref:"spaceImageInput",attrs:{id:"space-image-upload-input",type:"file",name:"file",tabindex:"-1",accept:e.supportedSpaceImageMimeTypes},on:{change:e.$_uploadImage_uploadImageSpace}}),e._v(" "),i("oc-list",{attrs:{id:"oc-spaces-actions-sidebar","class-name":"oc-mt-s"}},e._l(e.actions,(function(t,s){return i("action-menu-item",{key:"action-"+s,staticClass:"oc-py-xs",attrs:{action:t,items:e.resources,space:e.space}})})),1)],1)};ur._withStripped=!0;const pr=e.normalizeComponent({render:ur,staticRenderFns:[]},undefined,dr,undefined,false,undefined,!1,void 0,void 0,void 0);const hr={name:"SpaceQuota",props:{spaceQuota:{type:Object,required:!0}},computed:{spaceStorageDetailsLabel:function(){return this.spaceQuota.total?this.$gettextInterpolate(this.$gettext("%{used} of %{total} used (%{percentage}% used)"),{used:this.quotaUsed,total:this.quotaTotal,percentage:this.quotaUsagePercent}):this.$gettextInterpolate(this.$gettext("%{used} used (no restriction)"),{used:this.quotaUsed})},quotaTotal:function(){return e.filesize_min(this.spaceQuota.total)},quotaUsed:function(){return e.filesize_min(this.spaceQuota.used)},quotaUsagePercent:function(){return parseFloat((this.spaceQuota.used/this.spaceQuota.total*100).toFixed(2))},quotaProgressVariant:function(){switch(this.spaceQuota.state){case"normal":return"primary";case"nearing":case"critical":return"warning";default:return"danger"}}}};var mr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"space-quota"},[i("p",{staticClass:"oc-mb-s oc-mt-rm",domProps:{textContent:e._s(e.spaceStorageDetailsLabel)}}),e._v(" "),i("oc-progress",{attrs:{value:e.quotaUsagePercent,max:100,size:"small",variation:e.quotaProgressVariant}})],1)};mr._withStripped=!0;const fr=e.normalizeComponent({render:mr,staticRenderFns:[]},undefined,hr,undefined,false,undefined,!1,void 0,void 0,void 0);const gr=e.defineComponent({name:"SpaceDetails",components:{SpaceQuota:fr},setup(){const t=i.useStore(),s=n.useAccessToken({store:t}),r=e.ref("");return{loadImageTask:e.C((function*(t,n){if(!n.space?.spaceImageData)return void(r.value=void 0);const o=decodeURI(n.space.spaceImageData.webDavUrl).split("/"),l=o.find((e=>e.startsWith(n.space.id)));if(!l)return;const c=o.slice(o.indexOf(l)+1).join("/"),d=yield n.$client.files.fileInfo(a.buildWebDavSpacesPath(l,decodeURIComponent(c))),u=a.buildResource(d);r.value=yield g.loadPreview({resource:u,isPublic:!1,dimensions:w.Preview,server:i.configurationManager.serverUrl,userId:n.user.id,token:e.unref(s)})})),spaceImage:r}},computed:{...e.mapGetters("Files",["currentFileOutgoingLinks","highlightedFile"]),...e.mapGetters("runtime/spaces",["spaceMembers"]),...e.mapGetters(["user"]),space(){return this.highlightedFile},hasShares(){return this.hasMemberShares||this.hasLinkShares},shareLabel(){if(this.hasMemberShares&&!this.hasLinkShares)return this.memberShareLabel;if(!this.hasMemberShares&&this.hasLinkShares)return this.linkShareLabel;switch(this.memberShareCount){case 1:return this.$gettextInterpolate(this.$ngettext("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",this.linkShareCount),{linkShareCount:this.linkShareCount});default:return 1===this.linkShareCount?this.$gettextInterpolate("This space has %{memberShareCount} members and one link.",{memberShareCount:this.memberShareCount}):this.$gettextInterpolate("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:this.memberShareCount,linkShareCount:this.linkShareCount})}},openSharesPanelHint(){return this.$gettext("Open share panel")},openSharesPanelLinkHint(){return this.$gettext("Open link list in share panel")},openSharesPanelMembersHint(){return this.$gettext("Open member list in share panel")},detailsTableLabel(){return this.$gettext("Overview of the information about the selected space")},lastModifiedDate(){return r.formatDateFromISO(this.space.mdate,this.$language.current)},ownerUsernames(){const e=this.user?.id;return this.spaceMembers.filter((e=>e.role.name===s.spaceRoleManager.name)).map((t=>t.collaborator.name===e?this.$gettextInterpolate(this.$gettext("%{displayName} (me)"),{displayName:t.collaborator.displayName}):t.collaborator.displayName)).join(", ")},hasMemberShares(){return this.memberShareCount>0},hasLinkShares(){return this.linkShareCount>0},memberShareCount(){return this.spaceMembers.length},linkShareCount(){return this.currentFileOutgoingLinks.length},memberShareLabel(){return this.$gettextInterpolate(this.$ngettext("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",this.memberShareCount),{memberShareCount:this.memberShareCount})},linkShareLabel(){return this.$gettextInterpolate(this.$ngettext("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",this.linkShareCount),{linkShareCount:this.linkShareCount})}},watch:{"space.spaceImageData":{handler(){this.loadImageTask.perform(this)},deep:!0}},mounted(){this.loadImageTask.perform(this)},methods:{expandSharesPanel(){i.eventBus.publish(L.setActivePanel,"space-share-item")}}});var vr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"oc-space-details-sidebar"}},[i("div",{staticClass:"oc-space-details-sidebar-image oc-text-center"},[e.loadImageTask.isRunning?i("oc-spinner"):e.spaceImage?i("div",{staticClass:"oc-position-relative"},[i("img",{staticClass:"oc-mb-m",attrs:{src:e.spaceImage,alt:""}})]):i("oc-icon",{staticClass:"space-default-image oc-px-m oc-py-m",attrs:{name:"layout-grid",size:"xxlarge"}})],1),e._v(" "),e.hasShares?i("div",{staticClass:"oc-flex oc-flex-middle oc-mb-m oc-text-small",staticStyle:{gap:"15px"}},[e.hasMemberShares?i("oc-button",{attrs:{appearance:"raw","aria-label":e.openSharesPanelMembersHint},on:{click:e.expandSharesPanel}},[i("oc-icon",{attrs:{name:"group"}})],1):e._e(),e._v(" "),e.hasLinkShares?i("oc-button",{attrs:{appearance:"raw","aria-label":e.openSharesPanelLinkHint},on:{click:e.expandSharesPanel}},[i("oc-icon",{attrs:{name:"link"}})],1):e._e(),e._v(" "),i("p",{domProps:{textContent:e._s(e.shareLabel)}}),e._v(" "),i("oc-button",{attrs:{appearance:"raw","aria-label":e.openSharesPanelHint,size:"small"},on:{click:e.expandSharesPanel}},[i("span",{staticClass:"oc-text-small",domProps:{textContent:e._s(e.$gettext("Show"))}})])],1):e._e(),e._v(" "),i("table",{staticClass:"details-table",attrs:{"aria-label":e.detailsTableLabel}},[i("tr",[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.$gettext("Last activity"))}}),e._v(" "),i("td",{domProps:{textContent:e._s(e.lastModifiedDate)}})]),e._v(" "),e.space.description?i("tr",[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.$gettext("Subtitle"))}}),e._v(" "),i("td",{domProps:{textContent:e._s(e.space.description)}})]):e._e(),e._v(" "),i("tr",[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.$gettext("Manager"))}}),e._v(" "),i("td",[i("span",{domProps:{textContent:e._s(e.ownerUsernames)}})])]),e._v(" "),i("tr",[i("th",{staticClass:"oc-pr-s",attrs:{scope:"col"},domProps:{textContent:e._s(e.$gettext("Quota"))}}),e._v(" "),i("td",[i("space-quota",{attrs:{"space-quota":e.space.spaceQuota}})],1)])])])};vr._withStripped=!0;const br=e.normalizeComponent({render:vr,staticRenderFns:[]},undefined,gr,"data-v-805a224e",false,undefined,!1,void 0,void 0,void 0);var Sr,_r={name:"Files",id:"files",icon:"resource-type-folder",isFileEditor:!1,extensions:[],fileSideBars:[({rootFolder:e,highlightedFile:t})=>({app:"no-selection-item",icon:"questionnaire-line",title:"Details",component:cr,default:()=>!0,get enabled(){return!t||e&&"space"!==t?.type}}),({router:e,multipleSelection:t,rootFolder:i,highlightedFile:s})=>({app:"details-item",icon:"questionnaire-line",title:"Details",component:Zs,default:!o.isLocationTrashActive(e,"files-trash-generic"),get enabled(){return!o.isLocationTrashActive(e,"files-trash-generic")&&!t&&!i&&s}}),({multipleSelection:e,rootFolder:t,highlightedFile:i,router:s})=>({app:"details-multiple-item",icon:"questionnaire-line",title:"Details",component:ta,componentAttrs:{get showSpaceCount(){return!o.isLocationSpacesActive(s,"files-spaces-generic")&&!o.isLocationSharesActive(s,"files-shares-with-me")&&!o.isLocationTrashActive(s,"files-trash-generic")}},default:()=>!0,get enabled(){return e&&(!t||"space"===i?.type)}}),({multipleSelection:e,highlightedFile:t})=>({app:"details-space-item",icon:"questionnaire-line",title:"Details",component:br,default:()=>!0,get enabled(){return"space"===t?.type&&!e}}),({router:e,multipleSelection:t,rootFolder:i,highlightedFile:s})=>({app:"actions-item",icon:"slideshow-3",title:"Actions",component:aa,default:o.isLocationTrashActive(e,"files-trash-generic"),get enabled(){return!t&&!i&&s}}),({multipleSelection:e,highlightedFile:t,user:i})=>({app:"space-actions-item",icon:"slideshow-3",title:"Actions",component:pr,get enabled(){return!e&&("space"===t?.type&&[...t.spaceRoles[s.spaceRoleManager.name],...t.spaceRoles[s.spaceRoleEditor.name]].includes(i.uuid))}}),({capabilities:e,router:t,multipleSelection:i,rootFolder:s,highlightedFile:a})=>({app:"sharing-item",icon:"user-add",iconFillType:"line",title:"Shares",component:nr,componentAttrs:{showSpaceMembers:!1,get showLinks(){return!!e.files_sharing&&e.files_sharing.public.enabled}},get enabled(){return!(i||s||!a)&&(!o.isLocationTrashActive(t,"files-trash-generic")&&!o.isLocationPublicActive(t,"files-public-link")&&(!!e.files_sharing&&e.files_sharing.api_enabled))}}),({multipleSelection:e,highlightedFile:t,capabilities:i})=>({app:"space-share-item",icon:"group",title:"Members",component:nr,componentAttrs:{showSpaceMembers:!0,get showLinks(){return!!i.files_sharing&&i.files_sharing.public.enabled}},get enabled(){return"space"===t?.type&&!e}}),({capabilities:e,highlightedFile:t,router:i,multipleSelection:s,rootFolder:a})=>({app:"versions-item",icon:"git-branch",title:"Versions",component:oa,get enabled(){return!s&&!a&&(!o.isLocationTrashActive(i,"files-trash-generic")&&!o.isLocationPublicActive(i,"files-public-link")&&(!!e.core&&t&&"folder"!==t.type))}})]},yr=[{name:function(e){var t;return null!==(t=e.spaces)&&void 0!==t&&t.enabled?"Personal":"All files"},icon:_r.icon,route:{path:"/".concat(_r.id,"/spaces/personal")}},{name:"Favorites",icon:"star",route:{path:"/".concat(_r.id,"/favorites")},enabled:function(e){return e.files&&e.files.favorites}},{name:"Shares",icon:"share-forward",route:{path:"/".concat(_r.id,"/shares")},activeFor:[{path:"/".concat(_r.id,"/spaces/share")}],enabled:function(e){var t;return!1!==(null===(t=e.files_sharing)||void 0===t?void 0:t.api_enabled)}},{name:"Spaces",icon:"layout-grid",route:{path:"/".concat(_r.id,"/spaces/projects")},activeFor:[{path:"/".concat(_r.id,"/spaces/project")}],enabled:function(e){return e.spaces&&!0===e.spaces.projects}},{name:"Deleted files",icon:"delete-bin-5",route:{path:"/".concat(_r.id,"/trash")},enabled:function(e){return e.dav&&"1.0"===e.dav.trashbin}}];return{appInfo:_r,store:Os,routes:(Sr={App:y,Favorites:ri,FilesDrop:hi,SearchResults:o.__vue_component__,Shares:{SharedViaLink:$i,SharedWithMe:_i,SharedWithOthers:Ci},Spaces:{DriveResolver:ks,Projects:Rs}},[E,...o.buildRoutes(Sr),...o.buildRoutes$1(Sr),...o.buildRoutes$2(Sr),...o.buildRoutes$3(Sr),...o.buildRoutes$4(Sr),...[{path:"/list",redirect:e=>o.createLocationSpaces("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item*",redirect:e=>o.createLocationSpaces("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:s.urlJoin("personal/home",e.params.item,{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>o.createLocationCommon("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>o.createLocationShares("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>o.createLocationShares("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>o.createLocationShares("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>o.createLocationTrash("files-trash-generic",e)},{path:"/public/list/:item*",redirect:e=>o.createLocationPublic("files-public-link",e)},{path:"/private-link/:fileId",redirect:e=>({name:"resolvePrivateLink",params:{fileId:e.params.fileId}})},{path:"/public-link/:token",redirect:e=>({name:"resolvePublicLink",params:{token:e.params.token}})}].map(F)]),navItems:yr,quickActions:ht,translations:I,ready:function(t){var s,a,r=t.router,n=t.store;qe.sdkSearch=new Js(n,r),i.eventBus.publish("app.search.register.provider",qe.sdkSearch),ze.initialize(n.getters.configuration.server||window.location.origin,e.get(n,"getters.capabilities.files.archivers",[{enabled:!0,version:"1.0.0",formats:["tar","zip"],archiver_url:"".concat(n.getters.configuration.server,"index.php/apps/files/ajax/download.php")}])),Ue.initialize(e.get(n,"getters.capabilities.files.thumbnail",{enabled:!0,version:"v0.1",supportedMimeTypes:(null===(s=n.getters.configuration)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.previewFileMimeTypes)||[]}))}}}));