diff --git a/core/AppInfo/ConfigLexicon.php b/core/AppInfo/ConfigLexicon.php index 3bc2ebeba1bcf..f99c44e43a61f 100644 --- a/core/AppInfo/ConfigLexicon.php +++ b/core/AppInfo/ConfigLexicon.php @@ -39,6 +39,8 @@ class ConfigLexicon implements ILexicon { public const ON_DEMAND_PREVIEW_MIGRATION = 'on_demand_preview_migration'; + public const APPSTORE_LINK_SHOWN = 'appstore_link_shown'; + #[\Override] public function getStrictness(): Strictness { return Strictness::IGNORE; @@ -101,6 +103,16 @@ public function getAppConfigs(): array { defaultRaw: true, definition: 'Whether on demand preview migration is enabled.' ), + new Entry( + key: self::APPSTORE_LINK_SHOWN, + type: ValueType::BOOL, + defaultRaw: fn (Preset $p): bool => match ($p) { + Preset::NONE, Preset::PRIVATE, Preset::FAMILY, Preset::CLUB => true, + default => false, + }, + definition: 'Show the app store link in the app menu to accounts without admin rights', + note: 'When this key is not set, the link is also hidden while a valid subscription is available or while "appstoreenabled" is disabled. Setting this key explicitly takes precedence over both.', + ), ]; } diff --git a/core/src/components/AppMenu.vue b/core/src/components/AppMenu.vue index d099492510e44..f3edd32f22530 100644 --- a/core/src/components/AppMenu.vue +++ b/core/src/components/AppMenu.vue @@ -122,6 +122,8 @@ export default defineComponent({ return { appList, settingsList, + // Fail closed: a missing state must not leak the link. + appStoreLinkShown: loadState('core', 'appStoreLinkShown', false), isAdmin: getCurrentUser()?.isAdmin ?? false, // Roving tabindex: only this tile has tabindex=0; arrow keys move it. focusedIndex: 0, @@ -191,10 +193,16 @@ export default defineComponent({ // Stable-ordered list that focusedIndex indexes into. The trailing // utility tile is "More apps" (local app management) for admins and - // "App store" (apps.nextcloud.com) for everyone else. + // "App store" (apps.nextcloud.com) for everyone else when + // appstore_link_shown allows it. gridItems(): INavigationEntry[] { - const tail = this.isAdmin ? this.moreAppsEntry : this.appStoreEntry - return [...this.appList, tail] + const tail: INavigationEntry[] = [] + if (this.isAdmin) { + tail.push(this.moreAppsEntry) + } else if (this.appStoreLinkShown) { + tail.push(this.appStoreEntry) + } + return [...this.appList, ...tail] }, }, diff --git a/core/src/tests/components/AppMenu.spec.ts b/core/src/tests/components/AppMenu.spec.ts index 769351ad2d6d8..9f6530a775439 100644 --- a/core/src/tests/components/AppMenu.spec.ts +++ b/core/src/tests/components/AppMenu.spec.ts @@ -75,6 +75,13 @@ function eightApps(activeIndex: number = -1): INavigationEntry[] { })) } +// AppMenu hides the app store tile when the state is absent, so a default +// instance has to supply it. +function stateFor(states: Record) { + const all: Record = { appStoreLinkShown: true, ...states } + return (_app: string, key: string, fallback: unknown) => key in all ? all[key] : fallback +} + // Import AFTER mocks are registered. Static `import` would hoist above // vi.mock() and break the wiring; dynamic import in beforeAll/await is the // idiomatic Vitest workaround when you need to control mock state per test. @@ -86,7 +93,7 @@ beforeEach(async () => { for (const k of Object.keys(eventBus.__handlers)) { delete eventBus.__handlers[k] } - initialState.loadState.mockImplementation((_app: string, key: string, fallback: unknown) => key === 'apps' ? fakeApps() : fallback) + initialState.loadState.mockImplementation(stateFor({ apps: fakeApps() })) auth.getCurrentUser.mockReturnValue({ isAdmin: false }) AppMenu = (await import('../../components/AppMenu.vue')).default }) @@ -98,6 +105,11 @@ afterEach(() => { } }) +function gridLabels(): string[] { + return Array.from(document.querySelectorAll('.app-menu__grid [role="menuitem"]')) + .map((el) => el.querySelector('.app-item__label')?.textContent?.trim() ?? '') +} + // Click the waffle trigger and poll until the teleported menuitems are in the // DOM. NcPopover teleports to so wrapper.find() can't see them; vi.waitFor // retries the DOM query rather than relying on flaky nextTick/setTimeout flushes. @@ -137,8 +149,25 @@ describe('core: AppMenu', () => { expect(moreApps).toBeTruthy() }) + it('omits the "App store" tile when the instance does not offer it', async () => { + initialState.loadState.mockImplementation(stateFor({ apps: fakeApps(), appStoreLinkShown: false })) + const wrapper = mount(AppMenu, { attachTo: document.body }) + await openPopover(wrapper) + + expect(gridLabels()).toEqual(['Files', 'Mail', 'Calendar']) + }) + + it('keeps the "More apps" tile for admins when the app store link is hidden', async () => { + initialState.loadState.mockImplementation(stateFor({ apps: fakeApps(), appStoreLinkShown: false })) + auth.getCurrentUser.mockReturnValue({ isAdmin: true }) + const wrapper = mount(AppMenu, { attachTo: document.body }) + await openPopover(wrapper) + + expect(gridLabels()).toEqual(['Files', 'Mail', 'Calendar', 'More apps']) + }) + it('ArrowRight moves the roving stop from index 0 to index 1 and focuses it', async () => { - initialState.loadState.mockImplementation((_a: string, key: string, fallback: unknown) => key === 'apps' ? eightApps() : fallback) + initialState.loadState.mockImplementation(stateFor({ apps: eightApps() })) const wrapper = mount(AppMenu, { attachTo: document.body }) await openPopover(wrapper) @@ -221,15 +250,10 @@ describe('core: AppMenu', () => { // "current section" even though it carries type=settings. NavigationManager // today never marks it active, but a future regression shouldn't leak a // "Log out" label into the header. - initialState.loadState.mockImplementation((_a: string, key: string, fallback: unknown) => { - if (key === 'apps') { - return [makeApp({ id: 'files', name: 'Files', active: false })] - } - if (key === 'settingsNavEntries') { - return { logout: makeApp({ id: 'logout', name: 'Log out', type: 'settings', href: '/logout', active: true }) } - } - return fallback - }) + initialState.loadState.mockImplementation(stateFor({ + apps: [makeApp({ id: 'files', name: 'Files', active: false })], + settingsNavEntries: { logout: makeApp({ id: 'logout', name: 'Log out', type: 'settings', href: '/logout', active: true }) }, + })) const wrapper = mount(AppMenu, { attachTo: document.body }) expect(wrapper.find('.app-menu__current-app').exists()).toBe(false) }) diff --git a/dist/core-main.js b/dist/core-main.js index 55e6be80e2cba..6c0b5aafc6e32 100644 --- a/dist/core-main.js +++ b/dist/core-main.js @@ -1,2 +1,2 @@ -(()=>{var e={27906(e,r,n){"use strict";var o={};n.r(o),n.d(o,{VERSION:()=>f,after:()=>Ue,all:()=>ir,allKeys:()=>wt,any:()=>ar,assign:()=>Ut,before:()=>Fe,bind:()=>ke,bindAll:()=>Ie,chain:()=>Ce,chunk:()=>Hr,clone:()=>Vt,collect:()=>Ze,compact:()=>Rr,compose:()=>Be,constant:()=>it,contains:()=>sr,countBy:()=>wr,create:()=>Ht,debounce:()=>Pe,default:()=>Wr,defaults:()=>Ft,defer:()=>Me,delay:()=>je,detect:()=>Je,difference:()=>Mr,drop:()=>Tr,each:()=>Qe,escape:()=>fe,every:()=>ir,extend:()=>Bt,extendOwn:()=>Ut,filter:()=>nr,find:()=>Je,findIndex:()=>qe,findKey:()=>He,findLastIndex:()=>We,findWhere:()=>Xe,first:()=>Or,flatten:()=>jr,foldl:()=>er,foldr:()=>rr,forEach:()=>Qe,functions:()=>Lt,get:()=>Yt,groupBy:()=>Ar,has:()=>Kt,head:()=>Or,identity:()=>Jt,include:()=>sr,includes:()=>sr,indexBy:()=>br,indexOf:()=>Ye,initial:()=>kr,inject:()=>er,intersection:()=>Dr,invert:()=>Pt,invoke:()=>cr,isArguments:()=>rt,isArray:()=>Z,isArrayBuffer:()=>q,isBoolean:()=>P,isDataView:()=>Q,isDate:()=>F,isElement:()=>L,isEmpty:()=>vt,isEqual:()=>bt,isError:()=>H,isFinite:()=>nt,isFunction:()=>$,isMap:()=>Tt,isMatch:()=>gt,isNaN:()=>ot,isNull:()=>M,isNumber:()=>U,isObject:()=>j,isRegExp:()=>z,isSet:()=>Rt,isString:()=>B,isSymbol:()=>V,isTypedArray:()=>ft,isUndefined:()=>N,isWeakMap:()=>It,isWeakSet:()=>jt,iteratee:()=>ee,keys:()=>ht,last:()=>Ir,lastIndexOf:()=>Ke,map:()=>Ze,mapObject:()=>ne,matcher:()=>Xt,matches:()=>Xt,max:()=>fr,memoize:()=>Re,methods:()=>Lt,min:()=>pr,mixin:()=>qr,negate:()=>De,noop:()=>oe,now:()=>ce,object:()=>Fr,omit:()=>Er,once:()=>ze,pairs:()=>Nt,partial:()=>Ee,partition:()=>xr,pick:()=>Sr,pluck:()=>ur,property:()=>Qt,propertyOf:()=>ie,random:()=>se,range:()=>zr,reduce:()=>er,reduceRight:()=>rr,reject:()=>or,rest:()=>Tr,restArguments:()=>R,result:()=>be,sample:()=>vr,select:()=>nr,shuffle:()=>gr,size:()=>Cr,some:()=>ar,sortBy:()=>mr,sortedIndex:()=>Ge,tail:()=>Tr,take:()=>Or,tap:()=>qt,template:()=>Ae,templateSettings:()=>de,throttle:()=>Ne,times:()=>ae,toArray:()=>hr,toPath:()=>Wt,transpose:()=>Br,unescape:()=>pe,union:()=>Lr,uniq:()=>Pr,unique:()=>Pr,uniqueId:()=>xe,unzip:()=>Br,values:()=>Mt,where:()=>lr,without:()=>Nr,wrap:()=>Le,zip:()=>Ur});var i={};n.r(i),n.d(i,{clearIconCache:()=>hi,getIconUrl:()=>pi});var a={};n.r(a),n.d(a,{deleteKey:()=>Ni,getApps:()=>Ii,getKeys:()=>Ri,getValue:()=>ji,setValue:()=>Mi});var s={};n.r(s),n.d(s,{formatLinksPlain:()=>Vi,formatLinksRich:()=>Hi,plainToRich:()=>Fi,richToPlain:()=>zi});var c=n(21777),u=n(44368),l=n(63814),f="1.13.8",p="object"==typeof self&&self.self===self&&self||"object"==typeof globalThis&&globalThis.global===globalThis&&globalThis||Function("return this")()||{},d=Array.prototype,h=Object.prototype,v="undefined"!=typeof Symbol?Symbol.prototype:null,g=d.push,m=d.slice,y=h.toString,A=h.hasOwnProperty,b="undefined"!=typeof ArrayBuffer,w="undefined"!=typeof DataView,x=Array.isArray,C=Object.keys,_=Object.create,S=b&&ArrayBuffer.isView,E=isNaN,k=isFinite,O=!{toString:null}.propertyIsEnumerable("toString"),T=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],I=Math.pow(2,53)-1;function R(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),o=0;o=0&&r<=I}}function st(t){return function(e){return null==e?void 0:e[t]}}const ct=st("byteLength"),ut=at(ct);var lt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const ft=b?function(t){return S?S(t)&&!Q(t):ut(t)&<.test(y.call(t))}:it(!1),pt=st("length");function dt(t,e){e=function(t){for(var e={},r=t.length,n=0;n=0))if(n.push(t),o.push(e),r.push(!0),c){if((f=t.length)!==e.length)return!1;for(;f--;)r.push({a:t[f],b:e[f]})}else{var p,d=ht(t);if(f=d.length,ht(e).length!==f)return!1;for(;f--;){if(!tt(e,p=d[f]))return!1;r.push({a:t[p],b:e[p]})}}}else n.pop(),o.pop()}return!0}function wt(t){if(!j(t))return[];var e=[];for(var r in t)e.push(r);return O&&dt(t,e),e}function xt(t){var e=pt(t);return function(r){if(null==r)return!1;var n=wt(r);if(pt(n))return!1;for(var o=0;o":">",'"':""","'":"'","`":"`"},fe=ue(le),pe=ue(Pt(le)),de=mt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var he=/(.)^/,ve={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},ge=/\\|'|\r|\n|\u2028|\u2029/g;function me(t){return"\\"+ve[t]}var ye=/^\s*(\w|\$)+\s*$/;function Ae(t,e,r){!e&&r&&(e=r),e=Ft({},e,mt.templateSettings);var n=RegExp([(e.escape||he).source,(e.interpolate||he).source,(e.evaluate||he).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(n,function(e,r,n,a,s){return i+=t.slice(o,s).replace(ge,me),o=s+e.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?i+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),e}),i+="';\n";var a,s=e.variable;if(s){if(!ye.test(s))throw new Error("variable is not a bare identifier: "+s)}else i="with(obj||{}){\n"+i+"}\n",s="obj";i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{a=new Function(s,"_",i)}catch(t){throw t.source=i,t}var c=function(t){return a.call(this,t,mt)};return c.source="function("+s+"){\n"+i+"}",c}function be(t,e,r){var n=(e=Gt(e)).length;if(!n)return $(r)?r.call(t):r;for(var o=0;o=a){if(!s.length)break;var c=s.pop();i=c.i,t=c.v,a=pt(t)}else{var u=t[i++];s.length>=e?n[o++]=u:Oe(u)&&(Z(u)||rt(u))?(s.push({i,v:t}),i=0,a=pt(t=u)):r||(n[o++]=u)}return n}const Ie=R(function(t,e){var r=(e=Te(e,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=e[r];t[n]=ke(t[n],t)}return t});function Re(t,e){var r=function(n){var o=r.cache,i=""+(e?e.apply(this,arguments):n);return tt(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return r.cache={},r}const je=R(function(t,e,r){return setTimeout(function(){return t.apply(null,r)},e)}),Me=Ee(je,mt,1);function Ne(t,e,r){var n,o,i,a,s=0;r||(r={});var c=function(){s=!1===r.leading?0:ce(),n=null,a=t.apply(o,i),n||(o=i=null)},u=function(){var u=ce();s||!1!==r.leading||(s=u);var l=e-(u-s);return o=this,i=arguments,l<=0||l>e?(n&&(clearTimeout(n),n=null),s=u,a=t.apply(o,i),n||(o=i=null)):n||!1===r.trailing||(n=setTimeout(c,l)),a};return u.cancel=function(){clearTimeout(n),s=0,n=o=i=null},u}function Pe(t,e,r){var n,o,i,a,s,c=function(){var u=ce()-o;e>u?n=setTimeout(c,e-u):(n=null,r||(a=t.apply(s,i)),n||(i=s=null))},u=R(function(u){return s=this,i=u,o=ce(),n||(n=setTimeout(c,e),r&&(a=t.apply(s,i))),a});return u.cancel=function(){clearTimeout(n),n=i=s=null},u}function Le(t,e){return Ee(e,t)}function De(t){return function(){return!t.apply(this,arguments)}}function Be(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function Ue(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Fe(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}}const ze=Ee(Fe,2);function He(t,e,r){e=re(e,r);for(var n,o=ht(t),i=0,a=o.length;i0?0:o-1;i>=0&&i0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(r&&i&&s)return n[i=r(n,o)]===o?i:-1;if(o!=o)return(i=e(m.call(n,a,s),ot))>=0?i+a:-1;for(i=t>0?a:s-1;i>=0&&i=3;return function(e,r,n,o){var i=!Oe(e)&&ht(e),a=(i||e).length,s=t>0?0:a-1;for(o||(n=e[i?i[s]:s],s+=t);s>=0&&s=0}const cr=R(function(t,e,r){var n,o;return $(e)?o=e:(e=Gt(e),n=e.slice(0,-1),e=e[e.length-1]),Ze(t,function(t){var i=o;if(!i){if(n&&n.length&&(t=$t(t,n)),null==t)return;i=t[e]}return null==i?i:i.apply(t,r)})});function ur(t,e){return Ze(t,Qt(e))}function lr(t,e){return nr(t,Xt(e))}function fr(t,e,r){var n,o,i=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,c=(t=Oe(t)?t:Mt(t)).length;si&&(i=n);else e=re(e,r),Qe(t,function(t,r,n){((o=e(t,r,n))>a||o===-1/0&&i===-1/0)&&(i=t,a=o)});return i}function pr(t,e,r){var n,o,i=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,c=(t=Oe(t)?t:Mt(t)).length;sn||void 0===r)return 1;if(r1&&(n=Zt(n,e[1])),e=wt(t)):(n=_r,e=Te(e,!1,!1),t=Object(t));for(var o=0,i=e.length;o1&&(r=e[1])):(e=Ze(Te(e,!1,!1),String),n=function(t,r){return!sr(e,r)}),Sr(t,n,r)});function kr(t,e,r){return m.call(t,0,Math.max(0,t.length-(null==e||r?1:e)))}function Or(t,e,r){return null==t||t.length<1?null==e||r?void 0:[]:null==e||r?t[0]:kr(t,t.length-e)}function Tr(t,e,r){return m.call(t,null==e||r?1:e)}function Ir(t,e,r){return null==t||t.length<1?null==e||r?void 0:[]:null==e||r?t[t.length-1]:Tr(t,Math.max(0,t.length-e))}function Rr(t){return nr(t,Boolean)}function jr(t,e){return Te(t,e,!1)}const Mr=R(function(t,e){return e=Te(e,!0,!0),nr(t,function(t){return!sr(e,t)})}),Nr=R(function(t,e){return Mr(t,e)});function Pr(t,e,r,n){P(e)||(n=r,r=e,e=!1),null!=r&&(r=re(r,n));for(var o=[],i=[],a=0,s=pt(t);av.value.find(t=>t.teamId===g.value)?.displayName);async function y(t){p.value=""===t?(0,Yr.t)("core","Loading your contacts …"):(0,Yr.t)("core","Looking for {term} …",{term:t}),d.value=!1;try{const{data:e}=await u.Ay.post((0,l.Jv)("/contactsmenu/contacts"),{filter:t,teamId:"$_all_$"!==g.value?g.value:void 0});f.value=e.contacts,s.value=e.contactsAppEnabled,p.value=void 0}catch(e){jn.error("could not load contacts",{error:e,searchTerm:t}),d.value=!0}}(0,Xr.sV)(async()=>{const t=e.getItem("core:contacts:team");if(t&&(g.value=JSON.parse(t)),0===Nn.length)try{const{data:t}=await u.Ay.get((0,l.Jv)("/contactsmenu/teams"));Nn.push(...t)}catch(t){jn.error("could not load user teams",{error:t})}v.value=[...Nn]}),(0,Xr.wB)(g,()=>{e.setItem("core:contacts:team",JSON.stringify(g.value)),y(h.value)});const A=(0,tn.A)(function(){y(h.value)},500);function b(){(0,Xr.dY)(()=>{i.value?.focus(),i.value?.select()})}return{__sfc:!0,userTeams:Nn,storage:e,user:r,contactsAppURL:n,contactsAppMgmtURL:o,contactsMenuInput:i,actions:a,contactsAppEnabled:s,contacts:f,loadingText:p,hasError:d,searchTerm:h,teams:v,selectedTeam:g,selectedTeamName:m,onOpened:async function(){await y("")},getContacts:y,onInputDebounced:A,onReset:function(){h.value="",f.value=[],b()},focusInput:b,mdiAccountGroupOutline:Qr.dgQ,mdiContacts:Qr.aB4,mdiMagnify:Qr.U4M,t:Yr.t,NcActionButton:en.A,NcActions:rn.A,NcButton:nn.A,NcEmptyContent:on.A,NcHeaderMenu:an.A,NcIconSvgWrapper:sn.A,NcLoadingIcon:cn.A,NcTextField:un.A,ContactMenuEntry:In}}}),Ln=Pn;var Dn=n(62046),Bn={};Bn.styleTagTransform=En(),Bn.setAttributes=xn(),Bn.insert=bn().bind(null,"head"),Bn.domAPI=yn(),Bn.insertStyleElement=_n(),gn()(Dn.A,Bn),Dn.A&&Dn.A.locals&&Dn.A.locals;const Un=(0,Tn.A)(Ln,function(){var t=this,e=t._self._c,r=t._self._setupProxy;return e(r.NcHeaderMenu,{staticClass:"contactsmenu",attrs:{id:"contactsmenu","aria-label":r.t("core","Search contacts"),"exclude-click-outside-selectors":".v-popper__popper"},on:{open:r.onOpened},scopedSlots:t._u([{key:"trigger",fn:function(){return[e(r.NcIconSvgWrapper,{staticClass:"contactsmenu__trigger-icon",attrs:{path:r.mdiContacts}})]},proxy:!0}])},[t._v(" "),e("div",{staticClass:"contactsmenu__menu"},[e("div",{staticClass:"contactsmenu__menu__search-container"},[e("div",{staticClass:"contactsmenu__menu__input-wrapper"},[e(r.NcActions,{attrs:{"force-menu":"","aria-label":r.t("core","Filter by team"),variant:"tertiary"},scopedSlots:t._u([{key:"icon",fn:function(){return[e(r.NcIconSvgWrapper,{attrs:{path:r.mdiAccountGroupOutline}})]},proxy:!0},{key:"default",fn:function(){return[e(r.NcActionButton,{attrs:{modelValue:r.selectedTeam,value:"$_all_$",type:"radio"},on:{"update:modelValue":function(t){r.selectedTeam=t},"update:model-value":function(t){r.selectedTeam=t}}},[t._v("\n\t\t\t\t\t\t\t"+t._s(r.t("core","All teams"))+"\n\t\t\t\t\t\t")]),t._v(" "),t._l(r.teams,function(n){return e(r.NcActionButton,{key:n.teamId,attrs:{modelValue:r.selectedTeam,value:n.teamId,type:"radio"},on:{"update:modelValue":function(t){r.selectedTeam=t},"update:model-value":function(t){r.selectedTeam=t}}},[t._v("\n\t\t\t\t\t\t\t"+t._s(n.displayName)+"\n\t\t\t\t\t\t")])})]},proxy:!0}])}),t._v(" "),e(r.NcTextField,{ref:"contactsMenuInput",staticClass:"contactsmenu__menu__search",attrs:{id:"contactsmenu__menu__search","trailing-button-icon":"close",label:r.selectedTeamName?r.t("core","Search contacts in team {team}",{team:r.selectedTeamName}):r.t("core","Search contacts …"),"trailing-button-label":r.t("core","Reset search"),"show-trailing-button":""!==r.searchTerm,type:"search"},on:{input:r.onInputDebounced,"trailing-button-click":r.onReset},model:{value:r.searchTerm,callback:function(t){r.searchTerm=t},expression:"searchTerm"}})],1),t._v(" "),t._l(r.actions,function(n){return e(r.NcButton,{key:n.id,staticClass:"contactsmenu__menu__action",attrs:{"aria-label":n.label,title:n.label,variant:"tertiary-no-background"},on:{click:n.onClick},scopedSlots:t._u([{key:"icon",fn:function(){return[e(r.NcIconSvgWrapper,{attrs:{svg:n.icon}})]},proxy:!0}],null,!0)})})],2),t._v(" "),r.hasError?e(r.NcEmptyContent,{attrs:{name:r.t("core","Could not load your contacts")},scopedSlots:t._u([{key:"icon",fn:function(){return[e(r.NcIconSvgWrapper,{attrs:{path:r.mdiMagnify}})]},proxy:!0}],null,!1,1853740774)}):r.loadingText?e(r.NcEmptyContent,{attrs:{name:r.loadingText},scopedSlots:t._u([{key:"icon",fn:function(){return[e(r.NcLoadingIcon)]},proxy:!0}])}):0===r.contacts.length?e(r.NcEmptyContent,{attrs:{name:r.t("core","No contacts found")},scopedSlots:t._u([{key:"icon",fn:function(){return[e(r.NcIconSvgWrapper,{attrs:{path:r.mdiMagnify}})]},proxy:!0}])}):e("div",{staticClass:"contactsmenu__menu__content"},[e("div",{attrs:{id:"contactsmenu-contacts"}},[e("ul",{attrs:{"aria-label":r.t("core","Contacts list")}},t._l(r.contacts,function(t){return e(r.ContactMenuEntry,{key:t.id,attrs:{contact:t}})}),1)]),t._v(" "),r.contactsAppEnabled?e("div",{staticClass:"contactsmenu__menu__content__footer"},[e(r.NcButton,{attrs:{variant:"tertiary",href:r.contactsAppURL}},[t._v("\n\t\t\t\t\t"+t._s(r.t("core","Show all contacts"))+"\n\t\t\t\t")])],1):r.user.isAdmin?e("div",{staticClass:"contactsmenu__menu__content__footer"},[e(r.NcButton,{attrs:{variant:"tertiary",href:r.contactsAppMgmtURL}},[t._v("\n\t\t\t\t\t"+t._s(r.t("core","Install the Contacts app"))+"\n\t\t\t\t")])],1):t._e()])],1)])},[],!1,null,"253ecd69",null).exports;class Fn{constructor(){(function(t,e,r){(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r})(this,"_actions",void 0),this._actions=[]}get actions(){return this._actions}addAction(t){this._actions.push(t)}}var zn=n(61338),Hn=n(81222),Vn=n(54562);const qn={name:"CogIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Wn=(0,Tn.A)(qn,function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon cog-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])},[],!1,null,null,null).exports,Gn={name:"DotsGridIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},$n=(0,Tn.A)(Gn,function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon dots-grid-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 16C13.1 16 14 16.9 14 18S13.1 20 12 20 10 19.1 10 18 10.9 16 12 16M12 10C13.1 10 14 10.9 14 12S13.1 14 12 14 10 13.1 10 12 10.9 10 12 10M12 4C13.1 4 14 4.9 14 6S13.1 8 12 8 10 7.1 10 6 10.9 4 12 4M6 16C7.1 16 8 16.9 8 18S7.1 20 6 20 4 19.1 4 18 4.9 16 6 16M6 10C7.1 10 8 10.9 8 12S7.1 14 6 14 4 13.1 4 12 4.9 10 6 10M6 4C7.1 4 8 4.9 8 6S7.1 8 6 8 4 7.1 4 6 4.9 4 6 4M18 16C19.1 16 20 16.9 20 18S19.1 20 18 20 16 19.1 16 18 16.9 16 18 16M18 10C19.1 10 20 10.9 20 12S19.1 14 18 14 16 13.1 16 12 16.9 10 18 10M18 4C19.1 4 20 4.9 20 6S19.1 8 18 8 16 7.1 16 6 16.9 4 18 4Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])},[],!1,null,null,null).exports,Yn=(0,Xr.pM)({__name:"AppItem",props:{app:null,newTab:{type:Boolean},outlined:{type:Boolean},tabindex:{default:-1}},setup(t){const e=t,r=(0,Xr.EW)(()=>{if(e.app.unread)return(0,Yr.n)("core","{count} notification","{count} notifications",e.app.unread,{count:e.app.unread})});return{__sfc:!0,props:e,unreadLabel:r}}});var Kn=n(35132),Jn={};Jn.styleTagTransform=En(),Jn.setAttributes=xn(),Jn.insert=bn().bind(null,"head"),Jn.domAPI=yn(),Jn.insertStyleElement=_n(),gn()(Kn.A,Jn),Kn.A&&Kn.A.locals&&Kn.A.locals;const Xn=(0,Tn.A)(Yn,function(){var t=this,e=t._self._c,r=t._self._setupProxy;return e("a",{staticClass:"app-item",class:{"app-item--active":t.app.active,"app-item--outlined":t.outlined},attrs:{href:t.app.href,target:t.newTab?"_blank":void 0,rel:t.newTab?"noopener noreferrer":void 0,"aria-current":t.app.active?"page":void 0,tabindex:t.tabindex,title:t.app.name,role:"menuitem"}},[e("span",{staticClass:"app-item__circle"},[e("img",{staticClass:"app-item__icon",attrs:{src:t.app.icon,alt:"","aria-hidden":"true"}}),t._v(" "),t.app.unread?e("span",{staticClass:"app-item__unread",attrs:{"aria-hidden":"true"}}):t._e()]),t._v(" "),e("span",{staticClass:"app-item__label"},[t._v("\n\t\t"+t._s(t.app.name)+"\n\t\t"),t.app.unread?e("span",{staticClass:"hidden-visually"},[t._v(", "+t._s(r.unreadLabel))]):t._e()])])},[],!1,null,"278c0168",null).exports,Qn=new Set(["logout"]),Zn=(0,Xr.pM)({name:"AppMenu",components:{AppItem:Xn,IconCog:Wn,IconDotsGrid:$n,NcButton:nn.A,NcPopover:Vn.A},setup(){const t=(0,Xr.KR)(!1);return{t:Yr.t,n:Yr.n,opened:t}},data:()=>({appList:(0,Hn.C)("core","apps",[]),settingsList:(0,Hn.C)("core","settingsNavEntries",{}),isAdmin:(0,c.HW)()?.isAdmin??!1,focusedIndex:0,openedFrom:null,moreAppsEntry:{id:"more-apps",active:!1,order:Number.MAX_SAFE_INTEGER,href:(0,l.Jv)("/settings/apps"),icon:(0,l.d0)("core","actions/add.svg"),type:"link",name:(0,Yr.t)("core","More apps"),unread:0},appStoreEntry:{id:"app-store",active:!1,order:Number.MAX_SAFE_INTEGER,href:"https://apps.nextcloud.com/",icon:(0,l.d0)("core","actions/add.svg"),type:"link",name:(0,Yr.t)("core","App store"),unread:0},popoverSkidding:(0,Yr.V8)()?82:-82}),computed:{currentApp(){return this.appList.find(t=>t.active)??Object.values(this.settingsList).find(t=>t.active&&!Qn.has(t.id))},displayName(){return this.currentApp?"settings"===this.currentApp.type?(0,Yr.t)("core","Settings"):this.currentApp.name:""},currentAppLabel(){return this.currentApp?(0,Yr.t)("core","Open apps menu, currently in {app}",{app:this.displayName}):(0,Yr.t)("core","Open apps menu")},gridItems(){const t=this.isAdmin?this.moreAppsEntry:this.appStoreEntry;return[...this.appList,t]}},watch:{opened(t){t&&(this.focusedIndex=this.activeGridIndex(),this.tryRecomputeGridMaxHeight(5))}},mounted(){(0,zn.B1)("nextcloud:app-menu.refresh",this.setApps),this.focusedIndex=this.activeGridIndex(),this.$refs.popover.$on("after-hide",this.onPopoverAfterHide)},beforeUnmount(){(0,zn.al)("nextcloud:app-menu.refresh",this.setApps),this.$refs.popover?.$off("after-hide",this.onPopoverAfterHide)},methods:{returnFocusTarget(){return"currentApp"===this.openedFrom?this.$el.querySelector(".app-menu__current-app"):this.$el.querySelector(".app-menu__waffle")},onPopoverAfterHide(){this.openedFrom=null},onTriggerClick(t){this.openedFrom=t,this.opened=!this.opened},setNavigationCounter(t,e){const r=this.appList.find(({app:e})=>e===t);r?r.unread=e:jn.warn(`Could not find app "${t}" for setting navigation count`)},setApps({apps:t}){this.appList=t,this.focusedIndex>=this.gridItems.length&&(this.focusedIndex=this.activeGridIndex())},tryRecomputeGridMaxHeight(t){!this.opened||t<=0||(this.$refs.grid?this.recomputeGridMaxHeight():requestAnimationFrame(()=>this.tryRecomputeGridMaxHeight(t-1)))},recomputeGridMaxHeight(){const t=this.$refs.grid;if(!t)return;const e=t.children;if(e.length<=24)return void(t.style.maxHeight="");const r=e[24],n=e[0];if(!r||!n)return;const o=r.getBoundingClientRect().top-n.getBoundingClientRect().top,i=parseFloat(getComputedStyle(t).getPropertyValue("--default-grid-baseline"))||4;t.style.maxHeight=`${o+6*i}px`},activeGridIndex(){const t=this.gridItems.findIndex(t=>t.active);return-1===t?0:t},async onGridKeydown(t){if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey)return;if(0===this.gridItems.length)return;const e=this.gridItems.length,r=this.focusedIndex;let n=r;switch(t.key){case"ArrowRight":r%4!=3&&r+1=0&&(n=r-4);break;case"Home":n=0;break;case"End":n=e-1;break;case"Enter":case" ":{const e=this.$refs.items;return e?.[this.focusedIndex]?.$el?.click(),this.opened=!1,t.preventDefault(),void t.stopPropagation()}default:return}t.preventDefault(),t.stopPropagation(),n!==r&&(this.focusedIndex=n),await this.$nextTick();const o=this.$refs.items;o?.[this.focusedIndex]?.$el?.focus()}}});var to=n(43075),eo={};eo.styleTagTransform=En(),eo.setAttributes=xn(),eo.insert=bn().bind(null,"head"),eo.domAPI=yn(),eo.insertStyleElement=_n(),gn()(to.A,eo),to.A&&to.A.locals&&to.A.locals;var ro=n(71819),no={};no.styleTagTransform=En(),no.setAttributes=xn(),no.insert=bn().bind(null,"head"),no.domAPI=yn(),no.insertStyleElement=_n(),gn()(ro.A,no),ro.A&&ro.A.locals&&ro.A.locals;const oo=(0,Tn.A)(Zn,function(){var t=this,e=t._self._c;return t._self._setupProxy,e("nav",{staticClass:"app-menu",attrs:{"aria-label":t.t("core","Applications")}},[e("NcPopover",{ref:"popover",attrs:{shown:t.opened,triggers:[],placement:"bottom-start",skidding:t.popoverSkidding,"set-return-focus":t.returnFocusTarget,"popover-base-class":"app-menu__popover-base","popup-role":"menu"},on:{"update:shown":function(e){t.opened=e}},scopedSlots:t._u([{key:"trigger",fn:function(){return[e("NcButton",{staticClass:"app-menu__waffle",attrs:{variant:"tertiary-no-background","aria-label":t.t("core","Open apps menu"),"aria-haspopup":"menu","aria-expanded":t.opened?"true":"false"},on:{click:function(e){return t.onTriggerClick("waffle")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconDotsGrid",{attrs:{size:20}})]},proxy:!0}])})]},proxy:!0}])},[t._v(" "),e("div",{staticClass:"app-menu__popover",attrs:{role:"menu","aria-label":t.t("core","Apps")}},[e("div",{ref:"grid",staticClass:"app-menu__grid",on:{keydown:t.onGridKeydown}},t._l(t.gridItems,function(r,n){return e("AppItem",{key:r.id,ref:"items",refInFor:!0,attrs:{app:r,outlined:"more-apps"===r.id||"app-store"===r.id,"new-tab":"app-store"===r.id,tabindex:n===t.focusedIndex?0:-1}})}),1)])]),t._v(" "),t.currentApp?e("NcButton",{staticClass:"app-menu__current-app",attrs:{variant:"tertiary-no-background","aria-label":t.currentAppLabel,"aria-haspopup":"menu","aria-expanded":t.opened?"true":"false"},on:{click:function(e){return t.onTriggerClick("currentApp")}},scopedSlots:t._u([{key:"icon",fn:function(){return["settings"===t.currentApp.type?e("IconCog",{staticClass:"app-menu__current-app-cog",attrs:{size:20}}):e("img",{staticClass:"app-menu__current-app-icon",attrs:{src:t.currentApp.icon,alt:"","aria-hidden":"true"}})]},proxy:!0}],null,!1,3821102756)},[t._v(" "),e("span",{staticClass:"app-menu__current-app-name"},[t._v("\n\t\t\t"+t._s(t.displayName)+"\n\t\t")])]):t._e()],1)},[],!1,null,"20019127",null).exports;var io=n(87485),ao=n(1522);const so=(0,Hn.C)("core","versionHash",""),co=(0,Xr.pM)({name:"AccountMenuEntry",components:{NcListItem:ao.A,NcLoadingIcon:cn.A},props:{id:{type:String,required:!0},name:{type:String,required:!0},href:{type:String,required:!0},active:{type:Boolean,default:!1},icon:{type:String,default:""}},data:()=>({loading:!1}),computed:{iconSource(){return`${this.icon}?v=${so}`}},methods:{onClick(t){this.$emit("click",t),t.defaultPrevented||(this.loading=!0)}}});var uo=n(95977),lo={};lo.styleTagTransform=En(),lo.setAttributes=xn(),lo.insert=bn().bind(null,"head"),lo.domAPI=yn(),lo.insertStyleElement=_n(),gn()(uo.A,lo),uo.A&&uo.A.locals&&uo.A.locals;const fo=(0,Tn.A)(co,function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcListItem",{staticClass:"account-menu-entry",attrs:{id:t.href?void 0:t.id,"anchor-id":t.id,active:t.active,compact:"",href:t.href,name:t.name,target:"_self"},on:{click:t.onClick},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon",{staticClass:"account-menu-entry__loading",attrs:{size:20}}):t.$scopedSlots.icon?t._t("icon"):e("img",{staticClass:"account-menu-entry__icon",class:{"account-menu-entry__icon--active":t.active},attrs:{src:t.iconSource,alt:""}})]},proxy:!0}])})},[],!1,null,"bdb908d2",null).exports;var po=n(93346),ho=n(98469);const vo={name:"QrcodeScanIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},go=(0,Tn.A)(vo,function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon qrcode-scan-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M4,4H10V10H4V4M20,4V10H14V4H20M14,15H16V13H14V11H16V13H18V11H20V13H18V15H20V18H18V20H16V18H13V20H11V16H14V15M16,15V18H18V15H16M4,20V14H10V20H4M6,6V8H8V6H6M16,6V8H18V6H16M6,16V18H8V16H6M4,11H6V13H4V11M9,11H13V15H11V13H9V11M11,6H13V10H11V6M2,2V6H0V2A2,2 0 0,1 2,0H6V2H2M22,0A2,2 0 0,1 24,2V6H22V2H18V0H22M2,18V22H6V24H2A2,2 0 0,1 0,22V18H2M22,22V18H24V22A2,2 0 0,1 22,24H18V22H22Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])},[],!1,null,null,null).exports;var mo=n(17816),yo=n.n(mo),Ao=n(55581),bo=n(94219);const wo=(0,Xr.pM)({__name:"AccountQRLoginDialog",props:{data:null},emits:["close"],setup(t,{emit:e}){const r=t,n=window.OC.theme.productName,o=[{label:(0,Yr.t)("spreed","Done"),variant:"primary",callback:()=>{}}],i=3===(r.data?.deviceToken?.type??1),a=(0,Xr.EW)(()=>{const t=r.data?.loginName??"",e=r.data?.token??"";return`nc://${i?"onetime-login":"login"}/user:${t}&password:${e}&server:${(0,l.$_)()}`}),s=(r.data?.deviceToken?.lastActivity?1e3*r.data.deviceToken.lastActivity:Date.now())+12e4,c=setTimeout(()=>{f("expired")},s-Date.now()),u=(0,Ao.SX)(s);function f(t){clearTimeout(c),e("close",t)}return{__sfc:!0,props:r,emit:e,productName:n,buttons:o,isOneTimeToken:i,qrUrl:a,expirationTimestamp:s,expireTimeout:c,timeCountdown:u,onClosing:f,QR:yo(),t:Yr.t,NcDialog:bo.A}}}),xo=wo;var Co=n(11159),_o={};_o.styleTagTransform=En(),_o.setAttributes=xn(),_o.insert=bn().bind(null,"head"),_o.domAPI=yn(),_o.insertStyleElement=_n(),gn()(Co.A,_o),Co.A&&Co.A.locals&&Co.A.locals;const So=(0,Tn.A)(xo,function(){var t=this,e=t._self._c,r=t._self._setupProxy;return e(r.NcDialog,{attrs:{name:r.t("core","Scan QR code to log in"),buttons:r.buttons},on:{closing:r.onClosing}},[e("div",{staticClass:"qr-login__content"},[e("p",{staticClass:"qr-login__description"},[t._v("\n\t\t\t"+t._s(r.t("core","Use {productName} mobile client you want to connect to scan the code",{productName:r.productName}))+"\n\t\t")]),t._v(" "),e(r.QR,{attrs:{value:r.qrUrl}}),t._v(" "),r.isOneTimeToken?[t._v("\n\t\t\t"+t._s(r.t("core","Code will expire {timeCountdown} or after use",{timeCountdown:r.timeCountdown}))+"\n\t\t")]:t._e()],2)])},[],!1,null,null,null).exports;(0,po.IF)(u.Ay);const{profileEnabled:Eo}=(0,Hn.C)("user_status","profileEnabled",{profileEnabled:!1}),ko=(0,io.F)().core?.["can-create-app-token"]??!1,Oo=(0,Xr.pM)({name:"AccountMenuProfileEntry",components:{IconQrcodeScan:go,NcButton:nn.A,NcListItem:ao.A,NcLoadingIcon:cn.A},props:{id:{type:String,required:!0},name:{type:String,required:!0},href:{type:String,required:!0},active:{type:Boolean,required:!0}},setup:()=>({canCreateAppToken:ko,displayName:(0,c.HW)().displayName,profileEnabled:Eo,t:Yr.t}),data:()=>({loading:!1}),mounted(){(0,zn.B1)("settings:profile-enabled:updated",this.handleProfileEnabledUpdate),(0,zn.B1)("settings:display-name:updated",this.handleDisplayNameUpdate)},beforeDestroy(){(0,zn.al)("settings:profile-enabled:updated",this.handleProfileEnabledUpdate),(0,zn.al)("settings:display-name:updated",this.handleDisplayNameUpdate)},methods:{handleClick(){this.profileEnabled&&(this.loading=!0)},async handleQrCodeClick(){const{data:t}=await u.Ay.post((0,l.Jv)("/settings/personal/authtokens"),{qrcodeLogin:!0},{confirmPassword:po.mH.Strict});await(0,ho.S)(So,{data:t})},handleProfileEnabledUpdate(t){this.profileEnabled=t},handleDisplayNameUpdate(t){this.displayName=t}}}),To=Oo,Io=(0,Tn.A)(To,function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcListItem",{attrs:{id:t.profileEnabled?void 0:t.id,"anchor-id":t.id,active:t.active,compact:"",href:t.profileEnabled?t.href:void 0,name:t.displayName,target:"_self"},scopedSlots:t._u([t.profileEnabled?{key:"subname",fn:function(){return[t._v("\n\t\t"+t._s(t.name)+"\n\t")]},proxy:!0}:null,t.canCreateAppToken?{key:"extra-actions",fn:function(){return[e("NcButton",{attrs:{"aria-label":t.t("core","Show QR code for mobile app login"),variant:"secondary"},on:{click:t.handleQrCodeClick},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconQrcodeScan",{attrs:{size:20}})]},proxy:!0}],null,!1,3784924786)})]},proxy:!0}:null,t.loading?{key:"indicator",fn:function(){return[e("NcLoadingIcon")]},proxy:!0}:null],null,!0)})},[],!1,null,null,null).exports,Ro=[{type:"online",label:(0,Yr.t)("user_status","Online")},{type:"away",label:(0,Yr.t)("user_status","Away")},{type:"busy",label:(0,Yr.t)("user_status","Busy")},{type:"dnd",label:(0,Yr.t)("user_status","Do not disturb"),subline:(0,Yr.t)("user_status","Mute all notifications")},{type:"invisible",label:(0,Yr.t)("user_status","Invisible"),subline:(0,Yr.t)("user_status","Appear offline")}],jo=(0,Xr.pM)({name:"AccountMenu",components:{AccountMenuEntry:fo,AccountMenuProfileEntry:Io,NcAvatar:dn.A,NcHeaderMenu:an.A},setup(){const t=(0,Hn.C)("core","settingsNavEntries",{}),{profile:e,...r}=t;return{currentDisplayName:(0,c.HW)()?.displayName??(0,c.HW)().uid,currentUserId:(0,c.HW)().uid,profileEntry:e,otherEntries:r,t:Yr.t}},data:()=>({showUserStatus:!1,userStatus:{status:null,icon:null,message:null}}),computed:{translatedUserStatus(){return{...this.userStatus,status:this.translateStatus(this.userStatus.status)}},avatarDescription(){return[(0,Yr.t)("core","Avatar of {displayName}",{displayName:this.currentDisplayName}),...Object.values(this.translatedUserStatus).filter(Boolean)].join(" — ")}},async created(){if(!(0,io.F)()?.user_status?.enabled)return;const t=(0,l.KT)("/apps/user_status/api/v1/user_status");try{const e=await u.Ay.get(t),{status:r,icon:n,message:o}=e.data.ocs.data;this.userStatus={status:r,icon:n,message:o}}catch(t){jn.error("Failed to load user status",{error:t})}this.showUserStatus=!0},mounted(){(0,zn.B1)("user_status:status.updated",this.handleUserStatusUpdated),(0,zn.Ic)("core:user-menu:mounted")},methods:{handleUserStatusUpdated(t){this.currentUserId===t.userId&&(this.userStatus={status:t.status,icon:t.icon,message:t.message})},translateStatus(t){const e=Object.fromEntries(Ro.map(({type:t,label:e})=>[t,e]));return e[t]?e[t]:t}}});var Mo=n(95611),No={};No.styleTagTransform=En(),No.setAttributes=xn(),No.insert=bn().bind(null,"head"),No.domAPI=yn(),No.insertStyleElement=_n(),gn()(Mo.A,No),Mo.A&&Mo.A.locals&&Mo.A.locals;const Po=(0,Tn.A)(jo,function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcHeaderMenu",{staticClass:"account-menu",attrs:{id:"user-menu","is-nav":"","aria-label":t.t("core","Settings menu"),description:t.avatarDescription},scopedSlots:t._u([{key:"trigger",fn:function(){return[e("NcAvatar",{key:String(t.showUserStatus),staticClass:"account-menu__avatar",attrs:{"disable-menu":"","disable-tooltip":"","hide-user-status":!t.showUserStatus,user:t.currentUserId,"preloaded-user-status":t.userStatus}})]},proxy:!0}])},[t._v(" "),e("ul",{staticClass:"account-menu__list"},[e("AccountMenuProfileEntry",{attrs:{id:t.profileEntry.id,name:t.profileEntry.name,href:t.profileEntry.href,active:t.profileEntry.active}}),t._v(" "),t._l(t.otherEntries,function(t){return e("AccountMenuEntry",{key:t.id,attrs:{id:t.id,name:t.name,href:t.href,active:t.active,icon:t.icon}})})],2)])},[],!1,null,"6c007912",null).exports;function Lo(){return document.head.dataset.requesttoken}const{auto_logout:Do,session_keepalive:Bo,session_lifetime:Uo}=(0,Hn.C)("core","config",{});async function Fo(){try{await async function(){const t=(0,l.Jv)("/csrftoken"),e=await fetch(t);if(!e.ok)throw new Error("Could not fetch CSRF token from API",{cause:e});const{token:r}=await e.json();return function(t){if(!t||"string"!=typeof t)throw new Error("Invalid CSRF token given",{cause:{token:t}});document.head.dataset.requesttoken=t,(0,zn.Ic)("csrf-token-update",{token:t})}(r),r}()}catch(t){jn.error("session heartbeat failed",{error:t})}}function zo(){const t=window.setInterval(Fo,1e3*function(){const t=Uo?Math.floor(Uo/2):900;return Math.min(86400,Math.max(60,t))}());return jn.info("session heartbeat polling started"),t}function Ho(t){const e=document.createElement("textarea"),r=document.createTextNode(t);e.appendChild(r),document.body.appendChild(e),e.focus({preventScroll:!0}),e.select();try{document.execCommand("copy")}catch(e){window.prompt((0,Yr.t)("core","Clipboard not available, please copy manually"),t),jn.error("files Unable to copy to clipboard",{error:e})}document.body.removeChild(e)}function Vo(t){const e=window.location.protocol+"//"+window.location.host+(0,l.aU)();return t.startsWith(e)||function(t){return!t.startsWith("https://")&&!t.startsWith("http://")}(t)&&t.startsWith((0,l.aU)())}async function qo(){if(null!==(0,c.HW)()&&!0!==qo.running){qo.running=!0;try{const{status:t}=await window.fetch((0,l.Jv)("/apps/files"));401===t&&(jn.warn("User session was terminated, forwarding to login page."),await async function(){try{window.localStorage.clear(),window.sessionStorage.clear();const t=await window.indexedDB.databases();for(const e of t)await window.indexedDB.deleteDatabase(e.name);jn.debug("Browser storages cleared")}catch(t){jn.error("Could not clear browser storages",{error:t})}}(),window.location=(0,l.Jv)("/login?redirect_url={url}",{url:window.location.pathname+window.location.search+window.location.hash}))}catch(t){jn.warn("Could not check login-state",{error:t})}finally{delete qo.running}}}const Wo={zh:"zh-cn",zh_Hans:"zh-cn",zh_Hans_CN:"zh-cn",zh_Hans_HK:"zh-cn",zh_Hans_MO:"zh-cn",zh_Hans_SG:"zh-cn",zh_Hant:"zh-hk",zh_Hant_HK:"zh-hk",zh_Hant_MO:"zh-mo",zh_Hant_TW:"zh-tw"};let Go=(0,Yr.JK)();function $o(){var t;XMLHttpRequest.prototype.open=(t=XMLHttpRequest.prototype.open,function(e,r){t.apply(this,arguments),Vo(r)&&(this.getResponseHeader("X-Requested-With")||this.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.addEventListener("loadend",function(){401===this.status&&qo()}))}),window.fetch=function(t){return async(e,r)=>{if(!Vo(e.url??e.toString()))return await t(e,r);r||(r={}),r.headers||(r.headers=new Headers),r.headers instanceof Headers&&!r.headers.has("X-Requested-With")?r.headers.append("X-Requested-With","XMLHttpRequest"):r.headers instanceof Object&&!r.headers["X-Requested-With"]&&(r.headers["X-Requested-With"]="XMLHttpRequest");const n=await t(e,r);return 401===n.status&&qo(),n}}(window.fetch),window.navigator?.clipboard?.writeText||(jn.info("Clipboard API not available, using fallback"),Object.defineProperty(window.navigator,"clipboard",{value:{writeText:Ho},writable:!1})),function(){if(function(){if(!Do||!(0,c.HW)())return;let t=Date.now();window.addEventListener("mousemove",()=>{t=Date.now(),localStorage.setItem("lastActive",JSON.stringify(t))}),window.addEventListener("touchstart",()=>{t=Date.now(),localStorage.setItem("lastActive",JSON.stringify(t))}),window.addEventListener("storage",e=>{"lastActive"===e.key&&null!==e.newValue&&(t=JSON.parse(e.newValue))});let e=0;e=window.setInterval(()=>{const r=Date.now()-1e3*(Uo??86400);if(t{jn.info("Browser is online again, resuming heartbeat"),t=zo();try{await Fo(),jn.info("Session token successfully updated after resuming network"),(0,zn.Ic)("networkOnline",{success:!0})}catch(t){jn.error("could not update session token after resuming network",{error:t}),(0,zn.Ic)("networkOnline",{success:!1})}}),window.addEventListener("offline",()=>{jn.info("Browser is offline, stopping heartbeat"),(0,zn.Ic)("networkOffline",{}),clearInterval(t),jn.info("Session heartbeat polling stopped")})}(),function(){Xr.Ay.mixin({methods:{t:Yr.Tl,n:Yr.zw}});const t=document.getElementById("header-start__appmenu");if(!t)return;const e=new(Xr.Ay.extend(oo))({}).$mount(t);Object.assign(OC,{setNavigationCounter(t,r){e.setNavigationCounter(t,r)}})}(),function(){const t=document.getElementById("user-menu");t&&new Xr.Ay({name:"AccountMenuRoot",el:t,render:t=>t(Po)})}(),function(){const t=document.getElementById("contactsmenu");t&&(window.OC.ContactsMenu=new Fn,new Xr.Ay({name:"ContactsMenuRoot",el:t,render:t=>t(Un)}))}()}Object.hasOwn(Wo,Go)&&(Go=Wo[Go]),Jr().locale(Go);var Yo=n(71225);const Ko=!!window._oc_isadmin,Jo=window.oc_appconfig||{},Xo=void 0!==window._oc_appswebroots&&window._oc_appswebroots,Qo=window._oc_config||{},Zo=document.getElementsByTagName("head")[0].getAttribute("data-user"),ti=document.getElementsByTagName("head")[0].getAttribute("data-user-displayname"),ei=void 0!==Zo&&Zo,ri=window._oc_debug;var ni=n(21363),oi=n(85168),ii=n(43627);const ai={YES_NO_BUTTONS:70,OK_BUTTONS:71,FILEPICKER_TYPE_CHOOSE:1,FILEPICKER_TYPE_MOVE:2,FILEPICKER_TYPE_COPY:3,FILEPICKER_TYPE_COPY_MOVE:4,FILEPICKER_TYPE_CUSTOM:5,alert:function(t,e,r,n){this.message(t,e,"alert",ai.OK_BUTTON,r,n)},info:function(t,e,r,n){this.message(t,e,"info",ai.OK_BUTTON,r,n)},confirm:function(t,e,r,n){return this.message(t,e,"notice",ai.YES_NO_BUTTONS,r,n)},confirmDestructive:function(t,e,r=ai.OK_BUTTONS,n=()=>{}){return(new oi.ik).setName(e).setText(t).setButtons(r===ai.OK_BUTTONS?[{label:(0,Yr.t)("core","Yes"),variant:"error",callback:()=>{n.clicked=!0,n(!0)}}]:ai._getLegacyButtons(r,n)).build().show().then(()=>{n.clicked||n(!1)})},confirmHtml:function(t,e,r){return(new oi.ik).setName(e).setText("").setButtons([{label:(0,Yr.t)("core","No"),callback:()=>{}},{label:(0,Yr.t)("core","Yes"),variant:"primary",callback:()=>{r.clicked=!0,r(!0)}}]).build().setHTML(t).show().then(()=>{r.clicked||r(!1)})},prompt:function(t,e,r,o,i,a){return new Promise(o=>{(0,ho.S)((0,Xr.$V)(()=>Promise.all([n.e(4208),n.e(3108)]).then(n.bind(n,43108))),{text:t,name:e,callback:r,inputName:i,isPassword:!!a},(...t)=>{r(...t),o()})})},filepicker(t,e,r=!1,n=void 0,o=void 0,i=oi.bh.Choose,a=void 0,s=void 0){const c=(t,e)=>{const n=t=>{const e=t?.root||"";let r=t?.path||"";return r.startsWith(e)&&(r=r.slice(e.length)||"/"),r};return r?r=>t(r.map(n),e):r=>t(n(r[0]),e)},u=(0,oi.a1)(t);i===this.FILEPICKER_TYPE_CUSTOM?(s.buttons||[]).forEach(t=>{u.addButton({callback:c(e,t.type),label:t.text,variant:t.defaultButton?"primary":"secondary"})}):u.setButtonFactory((t,r)=>{const n=[],[o]=t,a=o?.displayname||o?.basename||(0,ii.basename)(r);return i===oi.bh.Choose&&n.push({callback:c(e,oi.bh.Choose),label:o&&!this.multiSelect?(0,Yr.t)("core","Choose {file}",{file:a}):(0,Yr.t)("core","Choose"),variant:"primary"}),i!==oi.bh.CopyMove&&i!==oi.bh.Copy||n.push({callback:c(e,oi.bh.Copy),label:a?(0,Yr.t)("core","Copy to {target}",{target:a}):(0,Yr.t)("core","Copy"),variant:"primary",icon:ni}),i!==oi.bh.Move&&i!==oi.bh.CopyMove||n.push({callback:c(e,oi.bh.Move),label:a?(0,Yr.t)("core","Move to {target}",{target:a}):(0,Yr.t)("core","Move"),variant:i===oi.bh.Move?"primary":"secondary",icon:''}),n}),n&&u.setMimeTypeFilter("string"==typeof n?[n]:n||[]),"function"==typeof s?.filter&&u.setFilter(t=>s.filter((t=>({id:t.fileid||null,path:t.path,mimetype:t.mime||null,mtime:t.mtime?.getTime()||null,permissions:t.permissions,name:t.attributes?.displayName||t.basename,etag:t.attributes?.etag||null,hasPreview:t.attributes?.hasPreview||null,mountType:t.attributes?.mountType||null,quotaAvailableBytes:t.attributes?.quotaAvailableBytes||null,icon:null,sharePermissions:null}))(t))),u.allowDirectories(!0===s?.allowDirectoryChooser||n?.includes("httpd/unix-directory")||!1).setMultiSelect(r).startAt(a).build().pick()},message:function(t,e,r,n,o=()=>{},i,a){const s=(new oi.ik).setName(e).setText(a?"":t).setButtons(ai._getLegacyButtons(n,o));switch(r){case"alert":s.setSeverity("warning");break;case"notice":s.setSeverity("info")}const c=s.build();return a&&c.setHTML(t),c.show().then(()=>{o._clicked||o(!1)})},_getLegacyButtons(t,e){const r=[];switch("object"==typeof t?t.type:t){case ai.YES_NO_BUTTONS:r.push({label:t?.cancel??(0,Yr.t)("core","No"),callback:()=>{e._clicked=!0,e(!1)}}),r.push({label:t?.confirm??(0,Yr.t)("core","Yes"),variant:"primary",callback:()=>{e._clicked=!0,e(!0)}});break;case ai.OK_BUTTONS:r.push({label:t?.confirm??(0,Yr.t)("core","OK"),variant:"primary",callback:()=>{e._clicked=!0,e(!0)}});break;default:jn.error("Invalid call to OC.dialogs")}return r}},si=ai;function ci(t,e){let r,n,o="";if(this.typelessListeners=[],this.closed=!1,e)for(r in e)o+=r+"="+encodeURIComponent(e[r])+"&";o+="requesttoken="+encodeURIComponent(Lo()),n="&",-1===t.indexOf("?")&&(n="?"),this.source=new EventSource(t+n+o),this.source.onmessage=function(t){for(let e=0;et.cancel()),r.style.display="block")},finishedSaving(t,e){this.finishedAction(t,e)},finishedAction(t,e){"success"===e.status?this.finishedSuccess(t,e.data.message):this.finishedError(t,e.data.message)},finishedSuccess(t,e){const r=document.querySelector(t);r&&r instanceof HTMLElement&&(r.textContent=e,r.classList.remove("error"),r.classList.add("success"),r.getAnimations?.().forEach(t=>t.cancel()),window.setTimeout(function(){if(!(r&&r instanceof HTMLElement))return;const t=r.animate?.([{opacity:1},{opacity:0}],{duration:900,fill:"forwards"});t?t.addEventListener("finish",()=>{r.style.display="none"}):window.setTimeout(()=>{r.style.display="none"},900)},3e3),r.style.display="block")},finishedError(t,e){const r=document.querySelector(t);r&&r instanceof HTMLElement&&(r.textContent=e,r.classList.remove("success"),r.classList.add("error"),r.style.display="block")}},gi={requiresPasswordConfirmation:()=>(0,po.oB)(),requirePasswordConfirmation(t,e,r){(0,po.C5)().then(t,r)}},mi={_plugins:{},register(t,e){let r=this._plugins[t];r||(r=this._plugins[t]=[]),r.push(e)},getPlugins(t){return this._plugins[t]||[]},attach(t,e,r){const n=this.getPlugins(t);for(let t=0;t="0"&&r<="9";a!==i&&(o++,e[o]="",i=a),e[o]+=r,n++}return e}const wi={History:{_handlers:[],_pushState(t,e,r){let n;if(n="string"==typeof t?t:_i.buildQueryString(t),window.history.pushState){if(e=e||location.pathname+"?"+n,navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&parseInt(navigator.userAgent.split("/").pop())<51){const t=document.querySelectorAll('[fill^="url(#"], [stroke^="url(#"], [filter^="url(#invert"]');for(let e,r=0,n=t.length;r=0?t.substr(e+1):t.length?t.substr(1):""},_decodeQuery:t=>t.replace(/\+/g," "),parseUrlQuery(){const t=this._parseHashQuery();let e;return t&&(e=_i.parseQueryString(this._decodeQuery(t))),e=$r.extend(e||{},_i.parseQueryString(this._decodeQuery(location.search))),e||{}},_onPopState(t){if(this._cancelPop)return void(this._cancelPop=!1);let e;if(this._handlers.length){e=t&&t.state,$r.isString(e)?e=_i.parseQueryString(e):e||(e=this.parseUrlQuery()||{});for(let t=0;t(void 0===window.TESTING&&_i.debug&&jn.warn("OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment"),e=e||"LLL",Jr()(t).format(e)),relativeModifiedDate(e){void 0===window.TESTING&&_i.debug&&jn.warn("OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment");const r=Jr()().diff(Jr()(e));return r>=0&&r<45e3?t("core","seconds ago"):Jr()(e).fromNow()},getScrollBarWidth(){if(this._scrollBarWidth)return this._scrollBarWidth;const t=document.createElement("p");t.style.width="100%",t.style.height="200px";const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);const r=t.offsetWidth;e.style.overflow="scroll";let n=t.offsetWidth;return r===n&&(n=e.clientWidth),document.body.removeChild(e),this._scrollBarWidth=r-n,this._scrollBarWidth},stripTime:t=>new Date(t.getFullYear(),t.getMonth(),t.getDate()),naturalSortCompare(t,e){let r;const n=bi(t),o=bi(e);for(r=0;n[r]&&o[r];r++)if(n[r]!==o[r]){const t=Number(n[r]),e=Number(o[r]);return t==n[r]&&e==o[r]?t-e:n[r].localeCompare(o[r],_i.getLanguage())}return n.length-o.length},waitFor(t,e){const r=function(){!0!==t()&&setTimeout(r,e)};r()},isCookieSetToValue(t,e){const r=document.cookie.split(";");for(let n=0;n!$_",appConfig:Jo,appswebroots:Xo,config:Qo,currentUser:ei,dialogs:si,EventSource:ui,MimeType:i,getCurrentUser:function(){return{uid:ei,displayName:ti}},isUserAdmin:()=>Ko,L10N:li,registerXHRForErrorProcessing:()=>{},getCapabilities:function(){return OC.debug&&jn.warn("OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities"),(0,io.F)()},basename:Yo.P8,encodePath:Yo.O0,dirname:Yo.pD,isSamePath:Yo.ys,joinPaths:Yo.fj,getCanonicalLocale:Yr.lO,getLocale:Yr.JK,getLanguage:Yr.Z0,buildQueryString:function(t){return t?new URLSearchParams(t).toString():""},parseQueryString:function(t){const e=new URLSearchParams(t);return Object.fromEntries(e.entries())},msg:vi,PasswordConfirmation:gi,Plugins:mi,theme:yi,Util:wi,debug:ri,filePath:l.fg,generateUrl:l.Jv,getRootPath:l.aU,imagePath:l.d0,requestToken:Lo(),linkTo:l.uM,linkToOCS:(t,e)=>(0,l.KT)(t,{},{ocsVersion:e||1})+"/",linkToRemote:l.dC,linkToRemoteBase:function(t){return(0,l.aU)()+"/remote.php/"+t},webroot:Ci};(0,zn.B1)("csrf-token-update",t=>{OC.requestToken=t.token,jn.info("OC.requestToken changed",{token:t.token})}),n(84315),n(7452);var Si=n(57576),Ei=n.n(Si),ki=n(78112);const Oi={disableKeyboardShortcuts:()=>(0,Hn.C)("theming","shortcutsDisabled",!1),setPageHeading:function(t){const e=document.getElementById("page-heading-level-1");e&&(e.textContent=t)}};async function Ti(t,e,r={}){"post"!==t&&"delete"!==t||!(0,po.oB)(po.mH.Lax)||await(0,po.C5)();try{const{data:n}=await u.Ay.request({method:t.toLowerCase(),url:(0,l.KT)("apps/provisioning_api/api/v1/config/apps")+e,data:r.data||{}});r.success?.(n.ocs.data)}catch(t){r.error?.(t)}}function Ii(t){Ti("get","",t)}function Ri(t,e){Ti("get","/"+t,e)}function ji(t,e,r,n){(n=n||{}).data={defaultValue:r},Ti("get","/"+t+"/"+e,n)}function Mi(t,e,r,n){(n=n||{}).data={value:r},Ti("post","/"+t+"/"+e,n)}function Ni(t,e,r){Ti("delete","/"+t+"/"+e,r)}var Pi=n(70580),Li=n.n(Pi);const Di={},Bi={registerType(t,e){Di[t]=e},trigger:t=>Di[t].action(),getTypes:()=>Object.keys(Di),getIcon:t=>Di[t].typeIconClass||"",getLabel:t=>Li()(Di[t].typeString||t),getLink:(t,e)=>void 0!==Di[t]?Di[t].link(e):""},Ui=/(\s|^)(https?:\/\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/gi;function Fi(t){return Hi(t)}function zi(t){return Vi(t)}function Hi(t){return t.replace(Ui,function(t,e,r,n,o){let i=n;return r?"http://"===r&&(i=r+n):r="https://",e+''+i+""+o})}function Vi(t){const e=document.createElement("div");return e.innerHTML=t,e.querySelectorAll("a").forEach(t=>{t.replaceWith(document.createTextNode(t.getAttribute("href")||""))}),e.innerHTML}const qi={},Wi={},Gi={loadScript(t,e){const r=t+e;return Object.hasOwn(qi,r)?Promise.resolve():(qi[r]=!0,new Promise(function(r,n){const o=(0,l.fg)(t,"js",e),i=document.createElement("script");i.src=o,i.setAttribute("nonce",btoa(OC.requestToken)),i.onload=()=>r(),i.onerror=()=>n(new Error(`Failed to load script from ${o}`)),document.head.appendChild(i)}))},loadStylesheet(t,e){const r=t+e;return Object.hasOwn(Wi,r)?Promise.resolve():(Wi[r]=!0,new Promise(function(r,n){const o=(0,l.fg)(t,"css",e),i=document.createElement("link");i.href=o,i.type="text/css",i.rel="stylesheet",i.onload=()=>r(),i.onerror=()=>n(new Error(`Failed to load stylesheet from ${o}`)),document.head.appendChild(i)}))}},$i={success:(t,e)=>(0,oi.Te)(t,e),warning:(t,e)=>(0,oi.I9)(t,e),error:(t,e)=>(0,oi.Qg)(t,e),info:(t,e)=>(0,oi.cf)(t,e),message:(t,e)=>(0,oi.rG)(t,e)},Yi={Accessibility:Oi,AppConfig:a,Collaboration:Bi,Comments:s,InitialState:{loadState:Hn.C},Loader:Gi,Toast:$i};function Ki(t,e,r){(Array.isArray(t)?t:[t]).forEach(t=>{void 0!==window[t]&&delete window[t],Object.defineProperty(window,t,{get:()=>(function(){void 0===window.TESTING&&_i.debug&&console.warn.apply(console,arguments)}(r?`${t} is deprecated: ${r}`:`${t} is deprecated`),e())})})}Ki(["_"],()=>$r,"The global underscore is deprecated. It will be removed in a later versions without another warning. Please ship your own."),Ki(["Clipboard","ClipboardJS"],()=>Ei(),"please ship your own, this will be removed in Nextcloud 20"),Ki(["dav"],()=>ki.dav,"please ship your own. It will be removed in a later versions without another warning. Please ship your own."),Ki("moment",()=>Jr(),"please ship your own, this will be removed in Nextcloud 20"),window.OC=_i,Ki("initCore",()=>$o,"this is an internal function"),Ki("oc_appswebroots",()=>_i.appswebroots,"use OC.appswebroots instead, this will be removed in Nextcloud 20"),Ki("oc_config",()=>_i.config,"use OC.config instead, this will be removed in Nextcloud 20"),Ki("oc_current_user",()=>_i.getCurrentUser().uid,"use OC.getCurrentUser().uid instead, this will be removed in Nextcloud 20"),Ki("oc_debug",()=>_i.debug,"use OC.debug instead, this will be removed in Nextcloud 20"),Ki("oc_defaults",()=>_i.theme,"use OC.theme instead, this will be removed in Nextcloud 20"),Ki("oc_isadmin",_i.isUserAdmin,"use OC.isUserAdmin() instead, this will be removed in Nextcloud 20"),Ki("oc_requesttoken",()=>Lo(),"use OC.requestToken instead, this will be removed in Nextcloud 20"),Ki("oc_webroot",()=>_i.webroot,"use OC.getRootPath() instead, this will be removed in Nextcloud 20"),Ki("OCDialogs",()=>_i.dialogs,"use OC.dialogs instead, this will be removed in Nextcloud 20"),window.OCP=Yi,window.OCA={},window.t=$r.bind(_i.L10N.translate,_i.L10N),window.n=$r.bind(_i.L10N.translatePlural,_i.L10N),n.nc=(0,c.aV)(),window.addEventListener("DOMContentLoaded",function(){$o(),window.history.pushState?window.onpopstate=$r.bind(_i.Util.History._onPopState,_i.Util.History):window.onhashchange=$r.bind(_i.Util.History._onPopState,_i.Util.History)}),document.addEventListener("DOMContentLoaded",function(){const t=document.getElementById("password-input-form");t&&t.addEventListener("submit",async function(e){e.preventDefault();const r=document.getElementById("requesttoken");if(r){const t=(0,l.Jv)("/csrftoken"),e=await u.Ay.get(t);r.value=e.data.token}t.submit()})})},57576(t){var e;e=function(){return function(){var t={686:function(t,e,r){"use strict";r.d(e,{default:function(){return b}});var n=r(279),o=r.n(n),i=r(370),a=r.n(i),s=r(817),c=r.n(s);function u(t){try{return document.execCommand(t)}catch(t){return!1}}var l=function(t){var e=c()(t);return u("cut"),e},f=function(t,e){var r=function(t){var e="rtl"===document.documentElement.getAttribute("dir"),r=document.createElement("textarea");r.style.fontSize="12pt",r.style.border="0",r.style.padding="0",r.style.margin="0",r.style.position="absolute",r.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;return r.style.top="".concat(n,"px"),r.setAttribute("readonly",""),r.value=t,r}(t);e.container.appendChild(r);var n=c()(r);return u("copy"),r.remove(),n},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},r="";return"string"==typeof t?r=f(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?r=f(t.value,e):(r=c()(t),u("copy")),r};function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function v(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===h(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=a()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,r=this.action(e)||"copy",n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.action,r=void 0===e?"copy":e,n=t.container,o=t.target,i=t.text;if("copy"!==r&&"cut"!==r)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==d(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===r&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===r&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return i?p(i,{container:n}):o?"cut"===r?l(o):p(o,{container:n}):void 0}({action:r,container:this.container,target:this.target(e),text:this.text(e)});this.emit(n?"success":"error",{action:r,text:n,trigger:e,clearSelection:function(){e&&e.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return y("action",t)}},{key:"defaultTarget",value:function(t){var e=y("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return y("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}],n=[{key:"copy",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return p(t,e)}},{key:"cut",value:function(t){return l(t)}},{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,r=!!document.queryCommandSupported;return e.forEach(function(t){r=r&&!!document.queryCommandSupported(t)}),r}}],r&&v(e.prototype,r),n&&v(e,n),c}(o()),b=A},828:function(t){if("undefined"!=typeof Element&&!Element.prototype.matches){var e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,r){var n=r(828);function o(t,e,r,n,o){var a=i.apply(this,arguments);return t.addEventListener(r,a,o),{destroy:function(){t.removeEventListener(r,a,o)}}}function i(t,e,r,o){return function(r){r.delegateTarget=n(r.target,e),r.delegateTarget&&o.call(t,r)}}t.exports=function(t,e,r,n,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof r?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,r,n,i)}))}},879:function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var r=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===r||"[object HTMLCollection]"===r)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,r){var n=r(879),o=r(438);t.exports=function(t,e,r){if(!t&&!e&&!r)throw new Error("Missing required arguments");if(!n.string(e))throw new TypeError("Second argument must be a String");if(!n.fn(r))throw new TypeError("Third argument must be a Function");if(n.node(t))return function(t,e,r){return t.addEventListener(e,r),{destroy:function(){t.removeEventListener(e,r)}}}(t,e,r);if(n.nodeList(t))return function(t,e,r){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,r)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,r)})}}}(t,e,r);if(n.string(t))return function(t,e,r){return o(document.body,t,e,r)}(t,e,r);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(t){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var r=t.hasAttribute("readonly");r||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),r||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o),e=n.toString()}return e}},279:function(t){function e(){}e.prototype={on:function(t,e,r){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:r}),this},once:function(t,e,r){var n=this;function o(){n.off(t,o),e.apply(r,arguments)}return o._=e,this.on(t,o,r)},emit:function(t){for(var e=[].slice.call(arguments,1),r=((this.e||(this.e={}))[t]||[]).slice(),n=0,o=r.length;n to actually break with a hyphen.\n\t\t-webkit-hyphens: auto;\n\t\thyphens: auto;\n\t\tword-break: normal;\n\t\toverflow-wrap: break-word;\n\t\tmax-width: 100%;\n\t\tletter-spacing: -0.3px;\n\t}\n\n\t&--active &__label {\n\t\tfont-weight: bold;\n\t}\n\n\t// Outlined variant: no fill or gradient.\n\t&--outlined &__circle {\n\t\tbackground: transparent;\n\t\tbackground-image: none;\n\t\tbox-shadow: inset 0 0 0 2px var(--color-border-maxcontrast);\n\t}\n\n\t&--outlined &__icon {\n\t\tfilter: var(--background-invert-if-dark);\n\t\tmask: none;\n\t}\n}\n"],sourceRoot:""}]);const s=a;r.d(e,["A",0,s])},43075(t,e,r){"use strict";var n=r(71354),o=r.n(n),i=r(76314),a=r.n(i)()(o());a.push([t.id,".app-menu[data-v-20019127]{display:flex;align-items:center}.app-menu__waffle[data-v-20019127]{--color-main-text: var(--color-background-plain-text);color:var(--color-background-plain-text)}.app-menu__waffle[data-v-20019127]:hover:not(:disabled){background-color:rgba(0,0,0,.1) !important}.app-menu__waffle[data-v-20019127]:active:not(:disabled){background-color:rgba(0,0,0,.15) !important}.app-menu__waffle[data-v-20019127]:focus-visible{background-color:rgba(0,0,0,.1) !important;outline:none !important;box-shadow:inset 0 0 0 2px var(--color-background-plain-text) !important}.app-menu__current-app[data-v-20019127]{--color-main-text: var(--color-background-plain-text);color:var(--color-background-plain-text)}.app-menu__current-app[data-v-20019127]:hover:not(:disabled){background-color:rgba(0,0,0,.1) !important}.app-menu__current-app[data-v-20019127]:active:not(:disabled){background-color:rgba(0,0,0,.15) !important}.app-menu__current-app[data-v-20019127]:focus-visible{background-color:rgba(0,0,0,.1) !important;outline:none !important;box-shadow:inset 0 0 0 2px var(--color-background-plain-text) !important}.app-menu__current-app[data-v-20019127] .button-vue__text{min-width:0}@media only screen and (max-width: 1024px){.app-menu__current-app[data-v-20019127]{display:none !important}}.app-menu__current-app-icon[data-v-20019127]{width:calc(var(--default-grid-baseline)*5);height:calc(var(--default-grid-baseline)*5);filter:var(--background-image-invert-if-bright);mask:var(--header-menu-icon-mask)}.app-menu__current-app-cog[data-v-20019127]{mask:var(--header-menu-icon-mask)}.app-menu__current-app-name[data-v-20019127]{display:inline-block;vertical-align:middle;font-size:var(--default-font-size);font-weight:500;white-space:nowrap;letter-spacing:-0.5px;overflow:hidden;text-overflow:ellipsis;max-width:clamp(80px,22vw,320px)}.app-menu__popover[data-v-20019127]{max-width:calc(100vw - var(--default-grid-baseline)*4);background-color:var(--color-main-background)}.app-menu__grid[data-v-20019127]{--app-item-col-width: 69px;--app-item-row-height: 64px;box-sizing:border-box;padding:calc(var(--default-grid-baseline)*2);display:grid;grid-template-columns:repeat(4, var(--app-item-col-width));grid-auto-rows:minmax(var(--app-item-row-height), max-content);overflow-y:auto}.app-menu__grid[data-v-20019127]>:nth-child(-n+4){padding-block-start:calc(var(--default-grid-baseline)*2) !important}.app-menu__grid[data-v-20019127]{scrollbar-width:thin;scrollbar-color:var(--color-scrollbar) rgba(0,0,0,0)}","",{version:3,sources:["webpack://./core/src/components/AppMenu.vue"],names:[],mappings:"AACA,2BACC,YAAA,CACA,kBAAA,CAEA,mCAIC,qDAAA,CACA,wCAAA,CAKA,wDACC,0CAAA,CAGD,yDACC,2CAAA,CAGD,iDACC,0CAAA,CACA,uBAAA,CACA,wEAAA,CAIF,wCAIC,qDAAA,CACA,wCAAA,CAMA,6DACC,0CAAA,CAGD,8DACC,2CAAA,CAGD,sDACC,0CAAA,CACA,uBAAA,CACA,wEAAA,CAKD,0DACC,WAAA,CAGD,2CA/BD,wCAgCE,uBAAA,CAAA,CAIF,6CACC,0CAAA,CACA,2CAAA,CAEA,+CAAA,CACA,iCAAA,CAGD,4CACC,iCAAA,CAGD,6CAEC,oBAAA,CACA,qBAAA,CACA,kCAAA,CACA,eAAA,CACA,kBAAA,CACA,qBAAA,CACA,eAAA,CACA,sBAAA,CAGA,gCAAA,CAGD,oCACC,sDAAA,CACA,6CAAA,CAGD,iCACC,0BAAA,CACA,2BAAA,CAGA,qBAAA,CACA,4CAAA,CACA,YAAA,CACA,0DAAA,CACA,8DAAA,CAEA,eAAA,CAKA,kDACC,mEAAA,CAjBF,iCAsBC,oBAAA,CACA,oDAAA",sourcesContent:["\n.app-menu {\n\tdisplay: flex;\n\talign-items: center;\n\n\t&__waffle {\n\t\t// NcButton's tertiary-no-background variant uses --color-main-text,\n\t\t// which is dark on light themes. The header sits on the theme primary\n\t\t// background, so override to use the matching plain-text color.\n\t\t--color-main-text: var(--color-background-plain-text);\n\t\tcolor: var(--color-background-plain-text);\n\n\t\t// Class merges onto NcButton's root