@opencloud-eu/web-pkg 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/TextEditor-B0ZZfO_w.js +819 -0
  2. package/dist/assets/worker-BVTM6bn-.js +1 -0
  3. package/dist/assets/worker-C-Nrpmiq.js +24 -0
  4. package/dist/assets/worker-CzI1mBNb.js +24 -0
  5. package/dist/assets/worker-DDmV-och.js +24 -0
  6. package/dist/composables-TkULFBg4.js +20165 -0
  7. package/dist/src/apps/types.d.ts +9 -9
  8. package/dist/src/components/AppBar/AppBar.vue.d.ts +154 -97
  9. package/dist/src/components/AppLoadingSpinner.vue.d.ts +2 -1
  10. package/dist/src/components/AppTemplates/AppWrapper.vue.d.ts +37 -33
  11. package/dist/src/components/AppTemplates/AppWrapperRoute.d.ts +1 -1
  12. package/dist/src/components/AppTemplates/PartialViews/ErrorScreen.vue.d.ts +5 -4
  13. package/dist/src/components/AppTemplates/PartialViews/LoadingScreen.vue.d.ts +2 -1
  14. package/dist/src/components/AppTopBar.vue.d.ts +13 -4
  15. package/dist/src/components/Avatars/AvatarUpload.vue.d.ts +3 -4
  16. package/dist/src/components/Avatars/UserAvatar.vue.d.ts +11 -1
  17. package/dist/src/components/BatchActions.vue.d.ts +16 -15
  18. package/dist/src/components/ContextActions/ActionMenuDropItem.vue.d.ts +11 -2
  19. package/dist/src/components/ContextActions/ActionMenuItem.vue.d.ts +9 -8
  20. package/dist/src/components/ContextActions/ContextActionMenu.vue.d.ts +41 -22
  21. package/dist/src/components/ContextActions/ContextMenuQuickAction.vue.d.ts +143 -388
  22. package/dist/src/components/CreateLinkModal.vue.d.ts +17 -7
  23. package/dist/src/components/CreateShortcutModal.vue.d.ts +160 -149
  24. package/dist/src/components/CustomComponentTarget.vue.d.ts +10 -1
  25. package/dist/src/components/FilesList/ContextActions.vue.d.ts +56 -37
  26. package/dist/src/components/FilesList/ResourceGhostElement.vue.d.ts +22 -11
  27. package/dist/src/components/FilesList/ResourceIcon.vue.d.ts +10 -1
  28. package/dist/src/components/FilesList/ResourceLink.vue.d.ts +7 -6
  29. package/dist/src/components/FilesList/ResourceListItem.vue.d.ts +13 -4
  30. package/dist/src/components/FilesList/ResourceName.vue.d.ts +10 -1
  31. package/dist/src/components/FilesList/ResourceSize.vue.d.ts +6 -5
  32. package/dist/src/components/FilesList/ResourceStatusIndicators.vue.d.ts +10 -1
  33. package/dist/src/components/FilesList/ResourceTable.vue.d.ts +51 -154
  34. package/dist/src/components/FilesList/ResourceTile.vue.d.ts +37 -153
  35. package/dist/src/components/FilesList/ResourceTiles.vue.d.ts +34 -119
  36. package/dist/src/components/Filters/DateFilter.vue.d.ts +32 -495
  37. package/dist/src/components/Filters/ItemFilterInline.vue.d.ts +6 -5
  38. package/dist/src/components/Groupware/Accounts/AccountsSwitch.vue.d.ts +3 -0
  39. package/dist/src/components/Groupware/Accounts/index.d.ts +1 -0
  40. package/dist/src/components/Groupware/index.d.ts +1 -0
  41. package/dist/src/components/ItemFilter.vue.d.ts +19 -204
  42. package/dist/src/components/ItemFilterToggle.vue.d.ts +6 -5
  43. package/dist/src/components/LinkRoleDropdown.vue.d.ts +7 -6
  44. package/dist/src/components/LoadingIndicator.vue.d.ts +5 -4
  45. package/dist/src/components/Modals/DatePickerModal.vue.d.ts +8 -7
  46. package/dist/src/components/Modals/EmojiPickerModal.vue.d.ts +6 -5
  47. package/dist/src/components/Modals/FilePickerModal.vue.d.ts +8 -7
  48. package/dist/src/components/Modals/ResourceConflictModal.vue.d.ts +9 -8
  49. package/dist/src/components/Modals/SaveAsModal.vue.d.ts +8 -7
  50. package/dist/src/components/Modals/SpaceMoveInfoModal.vue.d.ts +5 -4
  51. package/dist/src/components/Modals/UnsavedChangesModal.vue.d.ts +5 -4
  52. package/dist/src/components/Navigation/MobileNav.vue.d.ts +2 -1
  53. package/dist/src/components/NoContentMessage.vue.d.ts +17 -12
  54. package/dist/src/components/Pagination.vue.d.ts +5 -4
  55. package/dist/src/components/QuotaSelect.vue.d.ts +7 -6
  56. package/dist/src/components/Search/ResourcePreview.vue.d.ts +10 -41
  57. package/dist/src/components/SearchBarFilter.vue.d.ts +7 -6
  58. package/dist/src/components/SideBar/CompareSaveDialog.vue.d.ts +6 -5
  59. package/dist/src/components/SideBar/FileSideBar.vue.d.ts +10 -76
  60. package/dist/src/components/SideBar/Files/FileInfo.vue.d.ts +10 -1
  61. package/dist/src/components/SideBar/SideBar.vue.d.ts +20 -21
  62. package/dist/src/components/SideBar/SideBarPanels.vue.d.ts +21 -22
  63. package/dist/src/components/SideBar/Spaces/Details/SpaceDetails.vue.d.ts +10 -1
  64. package/dist/src/components/SideBar/Spaces/Details/SpaceDetailsMultiple.vue.d.ts +10 -1
  65. package/dist/src/components/SideBar/Spaces/SpaceInfo.vue.d.ts +2 -1
  66. package/dist/src/components/SideBar/Spaces/SpaceNoSelection.vue.d.ts +2 -1
  67. package/dist/src/components/SideBar/WebDavDetails.vue.d.ts +7 -6
  68. package/dist/src/components/SpaceQuota.vue.d.ts +10 -1
  69. package/dist/src/components/Spaces/QuotaModal.vue.d.ts +13 -4
  70. package/dist/src/components/Spaces/SpaceImageModal.vue.d.ts +12 -4
  71. package/dist/src/components/TextEditor/TextEditor.vue.d.ts +26 -0
  72. package/dist/src/components/TextEditor/index.d.ts +39 -0
  73. package/dist/src/components/VersionCheck.vue.d.ts +2 -1
  74. package/dist/src/components/ViewOptions.vue.d.ts +10 -1
  75. package/dist/src/components/index.d.ts +1 -0
  76. package/dist/src/composables/actions/files/useFileActionFallbackToDownload.d.ts +1 -1
  77. package/dist/src/composables/actions/files/useFileActions.d.ts +2 -2
  78. package/dist/src/composables/actions/files/useFileActionsCopy.d.ts +1 -1
  79. package/dist/src/composables/actions/files/useFileActionsCopyPermanentLink.d.ts +1 -1
  80. package/dist/src/composables/actions/files/useFileActionsCreateLink.d.ts +1 -1
  81. package/dist/src/composables/actions/files/useFileActionsCreateNewFile.d.ts +1 -1
  82. package/dist/src/composables/actions/files/useFileActionsCreateNewFolder.d.ts +1 -1
  83. package/dist/src/composables/actions/files/useFileActionsCreateNewShortcut.d.ts +1 -1
  84. package/dist/src/composables/actions/files/useFileActionsCreateSpaceFromResource.d.ts +1 -1
  85. package/dist/src/composables/actions/files/useFileActionsDelete.d.ts +1 -1
  86. package/dist/src/composables/actions/files/useFileActionsDisableSync.d.ts +1 -1
  87. package/dist/src/composables/actions/files/useFileActionsDownloadArchive.d.ts +1 -1
  88. package/dist/src/composables/actions/files/useFileActionsDownloadFile.d.ts +1 -1
  89. package/dist/src/composables/actions/files/useFileActionsEmptyTrashBin.d.ts +1 -1
  90. package/dist/src/composables/actions/files/useFileActionsEnableSync.d.ts +1 -1
  91. package/dist/src/composables/actions/files/useFileActionsFavorite.d.ts +1 -1
  92. package/dist/src/composables/actions/files/useFileActionsMove.d.ts +1 -1
  93. package/dist/src/composables/actions/files/useFileActionsNavigate.d.ts +1 -1
  94. package/dist/src/composables/actions/files/useFileActionsOpenShortcut.d.ts +1 -1
  95. package/dist/src/composables/actions/files/useFileActionsOpenWithApp.d.ts +1 -1
  96. package/dist/src/composables/actions/files/useFileActionsOpenWithDefault.d.ts +1 -1
  97. package/dist/src/composables/actions/files/useFileActionsPaste.d.ts +1 -1
  98. package/dist/src/composables/actions/files/useFileActionsRename.d.ts +2 -2
  99. package/dist/src/composables/actions/files/useFileActionsRestore.d.ts +2 -2
  100. package/dist/src/composables/actions/files/useFileActionsSaveAs.d.ts +1 -1
  101. package/dist/src/composables/actions/files/useFileActionsSetImage.d.ts +1 -1
  102. package/dist/src/composables/actions/files/useFileActionsShowActions.d.ts +1 -1
  103. package/dist/src/composables/actions/files/useFileActionsShowDetails.d.ts +1 -1
  104. package/dist/src/composables/actions/files/useFileActionsShowShares.d.ts +1 -1
  105. package/dist/src/composables/actions/files/useFileActionsToggleHideShare.d.ts +1 -1
  106. package/dist/src/composables/actions/files/useFileActionsUndoDelete.d.ts +2 -2
  107. package/dist/src/composables/actions/helpers/useIsAppActive.d.ts +1 -1
  108. package/dist/src/composables/actions/helpers/useIsFilesAppActive.d.ts +1 -1
  109. package/dist/src/composables/actions/helpers/useIsSearchActive.d.ts +1 -1
  110. package/dist/src/composables/actions/spaces/useSpaceActionsCreate.d.ts +1 -1
  111. package/dist/src/composables/actions/spaces/useSpaceActionsDelete.d.ts +1 -1
  112. package/dist/src/composables/actions/spaces/useSpaceActionsDeleteImage.d.ts +1 -1
  113. package/dist/src/composables/actions/spaces/useSpaceActionsDisable.d.ts +1 -1
  114. package/dist/src/composables/actions/spaces/useSpaceActionsDuplicate.d.ts +1 -1
  115. package/dist/src/composables/actions/spaces/useSpaceActionsEditDescription.d.ts +1 -1
  116. package/dist/src/composables/actions/spaces/useSpaceActionsEditQuota.d.ts +1 -1
  117. package/dist/src/composables/actions/spaces/useSpaceActionsEditReadmeContent.d.ts +1 -1
  118. package/dist/src/composables/actions/spaces/useSpaceActionsNavigateToTrash.d.ts +1 -1
  119. package/dist/src/composables/actions/spaces/useSpaceActionsRename.d.ts +1 -1
  120. package/dist/src/composables/actions/spaces/useSpaceActionsRestore.d.ts +1 -1
  121. package/dist/src/composables/actions/spaces/useSpaceActionsSetIcon.d.ts +1 -1
  122. package/dist/src/composables/actions/spaces/useSpaceActionsShowMembers.d.ts +1 -1
  123. package/dist/src/composables/actions/useActionsShowDetails.d.ts +1 -1
  124. package/dist/src/composables/appDefaults/useAppConfig.d.ts +1 -1
  125. package/dist/src/composables/appDefaults/useAppDocumentTitle.d.ts +2 -1
  126. package/dist/src/composables/appDefaults/useAppFileHandling.d.ts +4 -2
  127. package/dist/src/composables/appDefaults/useAppMeta.d.ts +1 -1
  128. package/dist/src/composables/authContext/useAuthService.d.ts +3 -1
  129. package/dist/src/composables/authContext/useRequest.d.ts +2 -2
  130. package/dist/src/composables/driveResolver/useSpacesLoading.d.ts +1 -1
  131. package/dist/src/composables/embedMode/useEmbedMode.d.ts +8 -8
  132. package/dist/src/composables/eventBus/useEventBus.d.ts +1 -1
  133. package/dist/src/composables/filesList/useResourceRouteResolver.d.ts +1 -1
  134. package/dist/src/composables/folderLink/useFolderLink.d.ts +2 -2
  135. package/dist/src/composables/isTopBarSticky/useIsTopBarSticky.d.ts +1 -1
  136. package/dist/src/composables/keyboardActions/useInterceptModifierClick.d.ts +1 -1
  137. package/dist/src/composables/links/useLinkTypes.d.ts +1 -1
  138. package/dist/src/composables/localStorage/useLocalStorage.d.ts +1 -1
  139. package/dist/src/composables/navItems/useNavItems.d.ts +1 -1
  140. package/dist/src/composables/piniaStores/apps.d.ts +31 -31
  141. package/dist/src/composables/piniaStores/auth.d.ts +25 -25
  142. package/dist/src/composables/piniaStores/avatars.d.ts +9 -9
  143. package/dist/src/composables/piniaStores/capabilities.d.ts +160 -160
  144. package/dist/src/composables/piniaStores/clipboard.d.ts +49 -49
  145. package/dist/src/composables/piniaStores/config/config.d.ts +135 -141
  146. package/dist/src/composables/piniaStores/config/types.d.ts +6 -20
  147. package/dist/src/composables/piniaStores/extensionRegistry/extensionPreferences.d.ts +4 -4
  148. package/dist/src/composables/piniaStores/extensionRegistry/extensionRegistry.d.ts +1 -1
  149. package/dist/src/composables/piniaStores/groupware/accounts.d.ts +511 -0
  150. package/dist/src/composables/piniaStores/{groupwareConfig/groupwareConfig.d.ts → groupware/config.d.ts} +107 -80
  151. package/dist/src/composables/piniaStores/groupware/index.d.ts +3 -0
  152. package/dist/src/composables/piniaStores/{groupwareConfig → groupware}/types.d.ts +30 -18
  153. package/dist/src/composables/piniaStores/index.d.ts +1 -1
  154. package/dist/src/composables/piniaStores/messages.d.ts +70 -70
  155. package/dist/src/composables/piniaStores/modals.d.ts +197 -209
  156. package/dist/src/composables/piniaStores/resources.d.ts +11 -11
  157. package/dist/src/composables/piniaStores/shares/shares.d.ts +1 -1
  158. package/dist/src/composables/piniaStores/shares/types.d.ts +2 -1
  159. package/dist/src/composables/piniaStores/sideBar.d.ts +7 -7
  160. package/dist/src/composables/piniaStores/spaces.d.ts +189 -188
  161. package/dist/src/composables/piniaStores/theme.d.ts +10 -10
  162. package/dist/src/composables/piniaStores/updates.d.ts +10 -10
  163. package/dist/src/composables/piniaStores/user.d.ts +5 -5
  164. package/dist/src/composables/piniaStores/webWorkers.d.ts +1 -1
  165. package/dist/src/composables/requestHeaders/useRequestHeaders.d.ts +1 -1
  166. package/dist/src/composables/resources/useGetResourceContext.d.ts +26 -26
  167. package/dist/src/composables/resources/useLoadPreview.d.ts +1 -1
  168. package/dist/src/composables/resources/useResourceContents.d.ts +1 -1
  169. package/dist/src/composables/resources/useResourceIndicators.d.ts +12 -1
  170. package/dist/src/composables/resources/useResourceViewDrag.d.ts +23 -13
  171. package/dist/src/composables/resources/useResourceViewHelpers.d.ts +30 -20
  172. package/dist/src/composables/resources/useResourceViewSelection.d.ts +2 -2
  173. package/dist/src/composables/selection/useSelectedResources.d.ts +2 -1
  174. package/dist/src/composables/spaces/useCreateSpace.d.ts +1 -1
  175. package/dist/src/composables/spaces/useSpaceHelpers.d.ts +1 -1
  176. package/dist/src/composables/webWorkers/deleteWorker/useDeleteWorker.d.ts +1 -1
  177. package/dist/src/composables/webWorkers/pasteWorker/usePasteWorker.d.ts +2 -2
  178. package/dist/src/composables/webWorkers/restoreWorker/useRestoreWorker.d.ts +1 -1
  179. package/dist/src/composables/webWorkers/tokenTimerWorker/useTokenTimerWorker.d.ts +3 -1
  180. package/dist/src/extensionPoints.d.ts +1 -1
  181. package/dist/src/helpers/resource/conflictHandling/conflictDialog.d.ts +1 -1
  182. package/dist/src/helpers/resource/conflictHandling/transfer.d.ts +4 -4
  183. package/dist/src/helpers/resource/conflictHandling/types.d.ts +1 -1
  184. package/dist/src/helpers/share/driveItem.d.ts +1 -1
  185. package/dist/src/router/common.d.ts +1 -1
  186. package/dist/src/router/index.d.ts +2 -1
  187. package/dist/src/router/public.d.ts +1 -1
  188. package/dist/src/router/shares.d.ts +1 -1
  189. package/dist/src/router/spaces.d.ts +1 -1
  190. package/dist/src/router/trash.d.ts +1 -1
  191. package/dist/src/services/passwordPolicy/rules.d.ts +63 -0
  192. package/dist/src/services/preview/types.d.ts +1 -1
  193. package/dist/src/services/uppy/DropTarget/plugin.d.ts +2 -1
  194. package/dist/src/services/uppy/uppyService.d.ts +3 -3
  195. package/dist/web-pkg.js +4251 -352
  196. package/package.json +36 -37
  197. package/dist/TextEditor-D-HQDUkm.js +0 -865
  198. package/dist/assets/worker-BBQqm_-D.js +0 -1
  199. package/dist/assets/worker-CVwKToFD.js +0 -21
  200. package/dist/assets/worker-DJbU-qfq.js +0 -21
  201. package/dist/assets/worker-DyU7W9CZ.js +0 -21
  202. package/dist/index-OU30YA6H.js +0 -25032
  203. package/dist/src/composables/piniaStores/groupwareConfig/index.d.ts +0 -2
  204. package/dist/web-pkg.umd.cjs +0 -16
@@ -1,16 +0,0 @@
1
- (function(x,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@opencloud-eu/web-client"),require("@casl/vue"),require("vue3-gettext"),require("fuse.js"),require("lodash-es"),require("axios"),require("uuid"),require("@microsoft/fetch-event-source"),require("vue-concurrency"),require("luxon"),require("filesize"),require("qs"),require("password-sheriff"),require("@uppy/core"),require("@uppy/tus"),require("@uppy/xhr-upload"),require("@uppy/utils"),require("pinia"),require("oidc-client-ts"),require("@vueuse/core"),require("dompurify"),require("mark.js"),require("p-queue"),require("cropperjs"),require("vue-router"),require("@vue/shared"),require("md-editor-v3"),require("zod"),require("deepmerge"),require("@sentry/vue"),require("screenfull"),require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@opencloud-eu/web-client","@casl/vue","vue3-gettext","fuse.js","lodash-es","axios","uuid","@microsoft/fetch-event-source","vue-concurrency","luxon","filesize","qs","password-sheriff","@uppy/core","@uppy/tus","@uppy/xhr-upload","@uppy/utils","pinia","oidc-client-ts","@vueuse/core","dompurify","mark.js","p-queue","cropperjs","vue-router","@vue/shared","md-editor-v3","zod","deepmerge","@sentry/vue","screenfull","@codemirror/view"],z):(x=typeof globalThis<"u"?globalThis:x||self,z(x["web-pkg"]={},x.webClient,x.vue,x.vue3Gettext,x.Fuse,x.lodashEs,x.globalAxios,x.uuid,x.fetchEventSource,x.vueConcurrency,x.luxon,x.filesize,x.qs,x.passwordSheriff,x.Uppy,x.Tus,x.XHRUpload,x.utils,x.pinia,x.oidcClientTs,x.core,x.DOMPurify,x.Mark,x.PQueue,x.Cropper,x.vueRouter,x.shared,x.mdEditorV3,x.zod,x.merge$1,x.vue$1,x.screenfull,x.view))})(this,(function(x,z,wc,de,Sc,et,wo,wt,gg,Ft,ht,yg,vg,bg,kc,wg,Sg,Cc,ve,kg,Cn,Tc,xc,sr,ra,Kr,R,ks,G,Ac,Cg,Tg,xg){"use strict";const Ag=e=>e;function Rc(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Rg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ec={exports:{}},dt=Ec.exports={},Tn,xn;function sa(){throw new Error("setTimeout has not been defined")}function oa(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Tn=setTimeout:Tn=sa}catch{Tn=sa}try{typeof clearTimeout=="function"?xn=clearTimeout:xn=oa}catch{xn=oa}})();function Dc(e){if(Tn===setTimeout)return setTimeout(e,0);if((Tn===sa||!Tn)&&setTimeout)return Tn=setTimeout,setTimeout(e,0);try{return Tn(e,0)}catch{try{return Tn.call(null,e,0)}catch{return Tn.call(this,e,0)}}}function Eg(e){if(xn===clearTimeout)return clearTimeout(e);if((xn===oa||!xn)&&clearTimeout)return xn=clearTimeout,clearTimeout(e);try{return xn(e)}catch{try{return xn.call(null,e)}catch{return xn.call(this,e)}}}var Nn=[],Gr=!1,Ar,So=-1;function Dg(){!Gr||!Ar||(Gr=!1,Ar.length?Nn=Ar.concat(Nn):So=-1,Nn.length&&Fc())}function Fc(){if(!Gr){var e=Dc(Dg);Gr=!0;for(var t=Nn.length;t;){for(Ar=Nn,Nn=[];++So<t;)Ar&&Ar[So].run();So=-1,t=Nn.length}Ar=null,Gr=!1,Eg(e)}}dt.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Nn.push(new Ic(e,t)),Nn.length===1&&!Gr&&Dc(Fc)};function Ic(e,t){this.fun=e,this.array=t}Ic.prototype.run=function(){this.fun.apply(null,this.array)},dt.title="browser",dt.browser=!0,dt.env={},dt.argv=[],dt.version="",dt.versions={};function Bn(){}dt.on=Bn,dt.addListener=Bn,dt.once=Bn,dt.off=Bn,dt.removeListener=Bn,dt.removeAllListeners=Bn,dt.emit=Bn,dt.prependListener=Bn,dt.prependOnceListener=Bn,dt.listeners=function(e){return[]},dt.binding=function(e){throw new Error("process.binding is not supported")},dt.cwd=function(){return"/"},dt.chdir=function(e){throw new Error("process.chdir is not supported")},dt.umask=function(){return 0};var Fg=Ec.exports;const ce=Rg(Fg);function An(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let He;const ia=new WeakSet;class Ig{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ia.has(this)&&(ia.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$c(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Nc(this),Oc(this);const t=He,n=un;He=this,un=!0;try{return this.fn()}finally{ce.env.NODE_ENV!=="production"&&He!==this&&An("Active effect was not restored correctly - this is likely a Vue internal bug."),Lc(this),He=t,un=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ua(t);this.deps=this.depsTail=void 0,Nc(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ia.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ca(this)&&this.run()}get dirty(){return ca(this)}}let Pc=0,Cs,Ts;function $c(e,t=!1){if(e.flags|=8,t){e.next=Ts,Ts=e;return}e.next=Cs,Cs=e}function aa(){Pc++}function la(){if(--Pc>0)return;if(Ts){let t=Ts;for(Ts=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Cs;){let t=Cs;for(Cs=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Oc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Lc(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),ua(r),Pg(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function ca(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_c(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _c(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===xs)||(e.globalVersion=xs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ca(e))))return;e.flags|=2;const t=e.dep,n=He,r=un;He=e,un=!0;try{Oc(e);const s=e.fn(e._value);(t.version===0||R.hasChanged(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{He=n,un=r,Lc(e),e.flags&=-3}}function ua(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),ce.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=s),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)ua(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Pg(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let un=!0;const Mc=[];function Jr(){Mc.push(un),un=!1}function Xr(){const e=Mc.pop();un=e===void 0?!0:e}function Nc(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=He;He=void 0;try{t()}finally{He=n}}}let xs=0;class $g{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ko{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,ce.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!He||!un||He===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==He)n=this.activeLink=new $g(He,this),He.deps?(n.prevDep=He.depsTail,He.depsTail.nextDep=n,He.depsTail=n):He.deps=He.depsTail=n,Bc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=He.depsTail,n.nextDep=void 0,He.depsTail.nextDep=n,He.depsTail=n,He.deps===n&&(He.deps=r)}return ce.env.NODE_ENV!=="production"&&He.onTrack&&He.onTrack(R.extend({effect:He},t)),n}trigger(t){this.version++,xs++,this.notify(t)}notify(t){aa();try{if(ce.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(R.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{la()}}}function Bc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Bc(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),ce.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Co=new WeakMap,Rr=Symbol(ce.env.NODE_ENV!=="production"?"Object iterate":""),da=Symbol(ce.env.NODE_ENV!=="production"?"Map keys iterate":""),As=Symbol(ce.env.NODE_ENV!=="production"?"Array iterate":"");function Tt(e,t,n){if(un&&He){let r=Co.get(e);r||Co.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new ko),s.map=r,s.key=n),ce.env.NODE_ENV!=="production"?s.track({target:e,type:t,key:n}):s.track()}}function or(e,t,n,r,s,o){const i=Co.get(e);if(!i){xs++;return}const l=u=>{u&&(ce.env.NODE_ENV!=="production"?u.trigger({target:e,type:t,key:n,newValue:r,oldValue:s,oldTarget:o}):u.trigger())};if(aa(),t==="clear")i.forEach(l);else{const u=R.isArray(e),d=u&&R.isIntegerKey(n);if(u&&n==="length"){const c=Number(r);i.forEach((f,p)=>{(p==="length"||p===As||!R.isSymbol(p)&&p>=c)&&l(f)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(As)),t){case"add":u?d&&l(i.get("length")):(l(i.get(Rr)),R.isMap(e)&&l(i.get(da)));break;case"delete":u||(l(i.get(Rr)),R.isMap(e)&&l(i.get(da)));break;case"set":R.isMap(e)&&l(i.get(Rr));break}}la()}function Og(e,t){const n=Co.get(e);return n&&n.get(t)}function Yr(e){const t=Ne(e);return t===e?t:(Tt(t,"iterate",As),It(e)?t:t.map(fn))}function To(e){return Tt(e=Ne(e),"iterate",As),e}function ir(e,t){return dn(e)?Zr(lr(e)?fn(t):t):fn(t)}const Lg={__proto__:null,[Symbol.iterator](){return fa(this,Symbol.iterator,e=>ir(this,e))},concat(...e){return Yr(this).concat(...e.map(t=>R.isArray(t)?Yr(t):t))},entries(){return fa(this,"entries",e=>(e[1]=ir(this,e[1]),e))},every(e,t){return jn(this,"every",e,t,void 0,arguments)},filter(e,t){return jn(this,"filter",e,t,n=>n.map(r=>ir(this,r)),arguments)},find(e,t){return jn(this,"find",e,t,n=>ir(this,n),arguments)},findIndex(e,t){return jn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return jn(this,"findLast",e,t,n=>ir(this,n),arguments)},findLastIndex(e,t){return jn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return jn(this,"forEach",e,t,void 0,arguments)},includes(...e){return pa(this,"includes",e)},indexOf(...e){return pa(this,"indexOf",e)},join(e){return Yr(this).join(e)},lastIndexOf(...e){return pa(this,"lastIndexOf",e)},map(e,t){return jn(this,"map",e,t,void 0,arguments)},pop(){return Rs(this,"pop")},push(...e){return Rs(this,"push",e)},reduce(e,...t){return jc(this,"reduce",e,t)},reduceRight(e,...t){return jc(this,"reduceRight",e,t)},shift(){return Rs(this,"shift")},some(e,t){return jn(this,"some",e,t,void 0,arguments)},splice(...e){return Rs(this,"splice",e)},toReversed(){return Yr(this).toReversed()},toSorted(e){return Yr(this).toSorted(e)},toSpliced(...e){return Yr(this).toSpliced(...e)},unshift(...e){return Rs(this,"unshift",e)},values(){return fa(this,"values",e=>ir(this,e))}};function fa(e,t,n){const r=To(e),s=r[t]();return r!==e&&!It(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const _g=Array.prototype;function jn(e,t,n,r,s,o){const i=To(e),l=i!==e&&!It(e),u=i[t];if(u!==_g[t]){const f=u.apply(e,o);return l?fn(f):f}let d=n;i!==e&&(l?d=function(f,p){return n.call(this,ir(e,f),p,e)}:n.length>2&&(d=function(f,p){return n.call(this,f,p,e)}));const c=u.call(i,d,r);return l&&s?s(c):c}function jc(e,t,n,r){const s=To(e);let o=n;return s!==e&&(It(e)?n.length>3&&(o=function(i,l,u){return n.call(this,i,l,u,e)}):o=function(i,l,u){return n.call(this,i,ir(e,l),u,e)}),s[t](o,...r)}function pa(e,t,n){const r=Ne(e);Tt(r,"iterate",As);const s=r[t](...n);return(s===-1||s===!1)&&Es(n[0])?(n[0]=Ne(n[0]),r[t](...n)):s}function Rs(e,t,n=[]){Jr(),aa();const r=Ne(e)[t].apply(e,n);return la(),Xr(),r}const Mg=R.makeMap("__proto__,__v_isRef,__isVue"),zc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(R.isSymbol));function Ng(e){R.isSymbol(e)||(e=String(e));const t=Ne(this);return Tt(t,"has",e),t.hasOwnProperty(e)}class Vc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Qc:Wc:o?Kg:Hc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=R.isArray(t);if(!s){let u;if(i&&(u=Lg[n]))return u;if(n==="hasOwnProperty")return Ng}const l=Reflect.get(t,n,ct(t)?t:r);if((R.isSymbol(n)?zc.has(n):Mg(n))||(s||Tt(t,"get",n),o))return l;if(ct(l)){const u=i&&R.isIntegerKey(n)?l:l.value;return s&&R.isObject(u)?ar(u):u}return R.isObject(l)?s?ar(l):ga(l):l}}class Bg extends Vc{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=R.isArray(t)&&R.isIntegerKey(n);if(!this._isShallow){const d=dn(o);if(!It(r)&&!dn(r)&&(o=Ne(o),r=Ne(r)),!i&&ct(o)&&!ct(r))return d?(ce.env.NODE_ENV!=="production"&&An(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(o.value=r,!0)}const l=i?Number(n)<t.length:R.hasOwn(t,n),u=Reflect.set(t,n,r,ct(t)?t:s);return t===Ne(s)&&(l?R.hasChanged(r,o)&&or(t,"set",n,r,o):or(t,"add",n,r)),u}deleteProperty(t,n){const r=R.hasOwn(t,n),s=t[n],o=Reflect.deleteProperty(t,n);return o&&r&&or(t,"delete",n,void 0,s),o}has(t,n){const r=Reflect.has(t,n);return(!R.isSymbol(n)||!zc.has(n))&&Tt(t,"has",n),r}ownKeys(t){return Tt(t,"iterate",R.isArray(t)?"length":Rr),Reflect.ownKeys(t)}}class Uc extends Vc{constructor(t=!1){super(!0,t)}set(t,n){return ce.env.NODE_ENV!=="production"&&An(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return ce.env.NODE_ENV!=="production"&&An(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const jg=new Bg,zg=new Uc,Vg=new Uc(!0),ha=e=>e,xo=e=>Reflect.getPrototypeOf(e);function Ug(e,t,n){return function(...r){const s=this.__v_raw,o=Ne(s),i=R.isMap(o),l=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,d=s[e](...r),c=n?ha:t?Zr:fn;return!t&&Tt(o,"iterate",u?da:Rr),R.extend(Object.create(d),{next(){const{value:f,done:p}=d.next();return p?{value:f,done:p}:{value:l?[c(f[0]),c(f[1])]:c(f),done:p}}})}}function Ao(e){return function(...t){if(ce.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";An(`${R.capitalize(e)} operation ${n}failed: target is readonly.`,Ne(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function qg(e,t){const n={get(s){const o=this.__v_raw,i=Ne(o),l=Ne(s);e||(R.hasChanged(s,l)&&Tt(i,"get",s),Tt(i,"get",l));const{has:u}=xo(i),d=t?ha:e?Zr:fn;if(u.call(i,s))return d(o.get(s));if(u.call(i,l))return d(o.get(l));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Tt(Ne(s),"iterate",Rr),s.size},has(s){const o=this.__v_raw,i=Ne(o),l=Ne(s);return e||(R.hasChanged(s,l)&&Tt(i,"has",s),Tt(i,"has",l)),s===l?o.has(s):o.has(s)||o.has(l)},forEach(s,o){const i=this,l=i.__v_raw,u=Ne(l),d=t?ha:e?Zr:fn;return!e&&Tt(u,"iterate",Rr),l.forEach((c,f)=>s.call(o,d(c),d(f),i))}};return R.extend(n,e?{add:Ao("add"),set:Ao("set"),delete:Ao("delete"),clear:Ao("clear")}:{add(s){!t&&!It(s)&&!dn(s)&&(s=Ne(s));const o=Ne(this);return xo(o).has.call(o,s)||(o.add(s),or(o,"add",s,s)),this},set(s,o){!t&&!It(o)&&!dn(o)&&(o=Ne(o));const i=Ne(this),{has:l,get:u}=xo(i);let d=l.call(i,s);d?ce.env.NODE_ENV!=="production"&&qc(i,l,s):(s=Ne(s),d=l.call(i,s));const c=u.call(i,s);return i.set(s,o),d?R.hasChanged(o,c)&&or(i,"set",s,o,c):or(i,"add",s,o),this},delete(s){const o=Ne(this),{has:i,get:l}=xo(o);let u=i.call(o,s);u?ce.env.NODE_ENV!=="production"&&qc(o,i,s):(s=Ne(s),u=i.call(o,s));const d=l?l.call(o,s):void 0,c=o.delete(s);return u&&or(o,"delete",s,void 0,d),c},clear(){const s=Ne(this),o=s.size!==0,i=ce.env.NODE_ENV!=="production"?R.isMap(s)?new Map(s):new Set(s):void 0,l=s.clear();return o&&or(s,"clear",void 0,void 0,i),l}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Ug(s,e,t)}),n}function ma(e,t){const n=qg(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(R.hasOwn(n,s)&&s in r?n:r,s,o)}const Hg={get:ma(!1,!1)},Wg={get:ma(!0,!1)},Qg={get:ma(!0,!0)};function qc(e,t,n){const r=Ne(n);if(r!==n&&t.call(e,r)){const s=R.toRawType(e);An(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Hc=new WeakMap,Kg=new WeakMap,Wc=new WeakMap,Qc=new WeakMap;function Gg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Jg(e){return e.__v_skip||!Object.isExtensible(e)?0:Gg(R.toRawType(e))}function ga(e){return dn(e)?e:ya(e,!1,jg,Hg,Hc)}function ar(e){return ya(e,!0,zg,Wg,Wc)}function Ro(e){return ya(e,!0,Vg,Qg,Qc)}function ya(e,t,n,r,s){if(!R.isObject(e))return ce.env.NODE_ENV!=="production"&&An(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Jg(e);if(o===0)return e;const i=s.get(e);if(i)return i;const l=new Proxy(e,o===2?r:n);return s.set(e,l),l}function lr(e){return dn(e)?lr(e.__v_raw):!!(e&&e.__v_isReactive)}function dn(e){return!!(e&&e.__v_isReadonly)}function It(e){return!!(e&&e.__v_isShallow)}function Es(e){return e?!!e.__v_raw:!1}function Ne(e){const t=e&&e.__v_raw;return t?Ne(t):e}function Kc(e){return!R.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&R.def(e,"__v_skip",!0),e}const fn=e=>R.isObject(e)?ga(e):e,Zr=e=>R.isObject(e)?ar(e):e;function ct(e){return e?e.__v_isRef===!0:!1}function H(e){return Gc(e,!1)}function Xg(e){return Gc(e,!0)}function Gc(e,t){return ct(e)?e:new Yg(e,t)}class Yg{constructor(t,n){this.dep=new ko,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ne(t),this._value=n?t:fn(t),this.__v_isShallow=n}get value(){return ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||It(t)||dn(t);t=r?t:Ne(t),R.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:fn(t),ce.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function a(e){return ct(e)?e.value:e}const Zg={get:(e,t,n)=>t==="__v_raw"?e:a(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return ct(s)&&!ct(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function ey(e){return lr(e)?e:new Proxy(e,Zg)}class ty{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ko,{get:r,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function ny(e){return new ty(e)}class ry{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=Ne(t);let s=!0,o=t;if(!R.isArray(t)||!R.isIntegerKey(String(n)))do s=!Es(o)||It(o);while(s&&(o=o.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=a(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ct(this._raw[this._key])){const n=this._object[this._key];if(ct(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Og(this._raw,this._key)}}class sy{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function oy(e,t,n){return ct(e)?e:R.isFunction(e)?new sy(e):R.isObject(e)&&arguments.length>1?iy(e,t,n):H(e)}function iy(e,t,n){return new ry(e,t,n)}class ay{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ko(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&He!==this)return $c(this,!0),!0;ce.env.NODE_ENV}get value(){const t=ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return _c(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ce.env.NODE_ENV!=="production"&&An("Write operation failed: computed value is readonly")}}function ly(e,t,n=!1){let r,s;R.isFunction(e)?r=e:(r=e.get,s=e.set);const o=new ay(r,s,n);return ce.env.NODE_ENV,o}const Eo={},Do=new WeakMap;let Er;function cy(e,t=!1,n=Er){if(n){let r=Do.get(n);r||Do.set(n,r=[]),r.push(e)}else ce.env.NODE_ENV!=="production"&&!t&&An("onWatcherCleanup() was called when there was no active watcher to associate with.")}function uy(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:l,call:u}=n,d=C=>{(n.onWarn||An)("Invalid watch source: ",C,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=C=>s?C:It(C)||s===!1||s===0?zn(C,1):zn(C);let f,p,h,g,m=!1,b=!1;if(ct(e)?(p=()=>e.value,m=It(e)):lr(e)?(p=()=>c(e),m=!0):R.isArray(e)?(b=!0,m=e.some(C=>lr(C)||It(C)),p=()=>e.map(C=>{if(ct(C))return C.value;if(lr(C))return c(C);if(R.isFunction(C))return u?u(C,2):C();ce.env.NODE_ENV!=="production"&&d(C)})):R.isFunction(e)?t?p=u?()=>u(e,2):e:p=()=>{if(h){Jr();try{h()}finally{Xr()}}const C=Er;Er=f;try{return u?u(e,3,[g]):e(g)}finally{Er=C}}:(p=R.NOOP,ce.env.NODE_ENV!=="production"&&d(e)),t&&s){const C=p,A=s===!0?1/0:s;p=()=>zn(C(),A)}const S=()=>{f.stop()};if(o&&t){const C=t;t=(...A)=>{C(...A),S()}}let k=b?new Array(e.length).fill(Eo):Eo;const w=C=>{if(!(!(f.flags&1)||!f.dirty&&!C))if(t){const A=f.run();if(s||m||(b?A.some((I,N)=>R.hasChanged(I,k[N])):R.hasChanged(A,k))){h&&h();const I=Er;Er=f;try{const N=[A,k===Eo?void 0:b&&k[0]===Eo?[]:k,g];k=A,u?u(t,3,N):t(...N)}finally{Er=I}}}else f.run()};return l&&l(w),f=new Ig(p),f.scheduler=i?()=>i(w,!1):w,g=C=>cy(C,!1,f),h=f.onStop=()=>{const C=Do.get(f);if(C){if(u)u(C,4);else for(const A of C)A();Do.delete(f)}},ce.env.NODE_ENV!=="production"&&(f.onTrack=n.onTrack,f.onTrigger=n.onTrigger),t?r?w(!0):k=f.run():i?i(w.bind(null,!0),!0):f.run(),S.pause=f.pause.bind(f),S.resume=f.resume.bind(f),S.stop=S,S}function zn(e,t=1/0,n){if(t<=0||!R.isObject(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ct(e))zn(e.value,t,n);else if(R.isArray(e))for(let r=0;r<e.length;r++)zn(e[r],t,n);else if(R.isSet(e)||R.isMap(e))e.forEach(r=>{zn(r,t,n)});else if(R.isPlainObject(e)){for(const r in e)zn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&zn(e[r],t,n)}return e}const Dr=[];function dy(e){Dr.push(e)}function fy(){Dr.pop()}let va=!1;function Pe(e,...t){if(va)return;va=!0,Jr();const n=Dr.length?Dr[Dr.length-1].component:null,r=n&&n.appContext.config.warnHandler,s=py();if(r)Fo(r,n,11,[e+t.map(o=>{var i,l;return(l=(i=o.toString)==null?void 0:i.call(o))!=null?l:JSON.stringify(o)}).join(""),n&&n.proxy,s.map(({vnode:o})=>`at <${zu(n,o.type)}>`).join(`
2
- `),s]);else{const o=[`[Vue warn]: ${e}`,...t];s.length&&o.push(`
3
- `,...hy(s)),console.warn(...o)}Xr(),va=!1}function py(){let e=Dr[Dr.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function hy(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
- `],...my(n))}),t}function my({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,s=` at <${zu(e.component,e.type,r)}`,o=">"+n;return e.props?[s,...gy(e.props),o]:[s+o]}function gy(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...Jc(r,e[r]))}),n.length>3&&t.push(" ..."),t}function Jc(e,t,n){return R.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:ct(t)?(t=Jc(e,Ne(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):R.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Ne(t),n?t:[`${e}=`,t])}function yy(e,t){ce.env.NODE_ENV!=="production"&&e!==void 0&&(typeof e!="number"?Pe(`${t} is not a valid number - got ${JSON.stringify(e)}.`):isNaN(e)&&Pe(`${t} is NaN - the duration expression might be incorrect.`))}const ba={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Fo(e,t,n,r){try{return r?e(...r):e()}catch(s){Po(s,t,n)}}function Io(e,t,n,r){if(R.isFunction(e)){const s=Fo(e,t,n,r);return s&&R.isPromise(s)&&s.catch(o=>{Po(o,t,n)}),s}if(R.isArray(e)){const s=[];for(let o=0;o<e.length;o++)s.push(Io(e[o],t,n,r));return s}else ce.env.NODE_ENV!=="production"&&Pe(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Po(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||R.EMPTY_OBJ;if(t){let l=t.parent;const u=t.proxy,d=ce.env.NODE_ENV!=="production"?ba[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,u,d)===!1)return}l=l.parent}if(o){Jr(),Fo(o,null,10,[e,u,d]),Xr();return}}vy(e,n,s,r,i)}function vy(e,t,n,r=!0,s=!1){if(ce.env.NODE_ENV!=="production"){const o=ba[t];if(n&&dy(n),Pe(`Unhandled error${o?` during execution of ${o}`:""}`),n&&fy(),r)throw e;console.error(e)}else{if(s)throw e;console.error(e)}}const Gt=[];let Vn=-1;const es=[];let cr=null,ts=0;const Xc=Promise.resolve();let $o=null;const by=100;function St(e){const t=$o||Xc;return e?t.then(this?e.bind(this):e):t}function wy(e){let t=Vn+1,n=Gt.length;for(;t<n;){const r=t+n>>>1,s=Gt[r],o=Ds(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function wa(e){if(!(e.flags&1)){const t=Ds(e),n=Gt[Gt.length-1];!n||!(e.flags&2)&&t>=Ds(n)?Gt.push(e):Gt.splice(wy(t),0,e),e.flags|=1,Yc()}}function Yc(){$o||($o=Xc.then(eu))}function Zc(e){R.isArray(e)?es.push(...e):cr&&e.id===-1?cr.splice(ts+1,0,e):e.flags&1||(es.push(e),e.flags|=1),Yc()}function Sy(e){if(es.length){const t=[...new Set(es)].sort((n,r)=>Ds(n)-Ds(r));if(es.length=0,cr){cr.push(...t);return}for(cr=t,ce.env.NODE_ENV!=="production"&&(e=e||new Map),ts=0;ts<cr.length;ts++){const n=cr[ts];ce.env.NODE_ENV!=="production"&&tu(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}cr=null,ts=0}}const Ds=e=>e.id==null?e.flags&2?-1:1/0:e.id;function eu(e){ce.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ce.env.NODE_ENV!=="production"?n=>tu(e,n):R.NOOP;try{for(Vn=0;Vn<Gt.length;Vn++){const n=Gt[Vn];if(n&&!(n.flags&8)){if(ce.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Fo(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;Vn<Gt.length;Vn++){const n=Gt[Vn];n&&(n.flags&=-2)}Vn=-1,Gt.length=0,Sy(e),$o=null,(Gt.length||es.length)&&eu(e)}}function tu(e,t){const n=e.get(t)||0;if(n>by){const r=t.i,s=r&&Jo(r.type);return Po(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}let Fs=!1;const Oo=new Map;ce.env.NODE_ENV!=="production"&&(R.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Sa(ky),rerender:Sa(Cy),reload:Sa(Ty)});const Lo=new Map;function ky(e,t){return Lo.has(e)?!1:(Lo.set(e,{initialDef:_o(t),instances:new Set}),!0)}function _o(e){return Vu(e)?e.__vccOpts:e}function Cy(e,t){const n=Lo.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,_o(r.type).render=t),r.renderCache=[],Fs=!0,r.job.flags&8||r.update(),Fs=!1}))}function Ty(e,t){const n=Lo.get(e);if(!n)return;t=_o(t),nu(n.initialDef,t);const r=[...n.instances];for(let s=0;s<r.length;s++){const o=r[s],i=_o(o.type);let l=Oo.get(i);l||(i!==n.initialDef&&nu(i,t),Oo.set(i,l=new Set)),l.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(l.add(o),o.ceReload(t.styles),l.delete(o)):o.parent?wa(()=>{o.job.flags&8||(Fs=!0,o.parent.update(),Fs=!1,l.delete(o))}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(i)}Zc(()=>{Oo.clear()})}function nu(e,t){R.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Sa(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let ur,Is=[],ka=!1;function xy(e,...t){ur?ur.emit(e,...t):ka||Is.push({event:e,args:t})}function ru(e,t){var n,r;ur=e,ur?(ur.enabled=!0,Is.forEach(({event:s,args:o})=>ur.emit(s,...o)),Is=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{ru(o,t)}),setTimeout(()=>{ur||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ka=!0,Is=[])},3e3)):(ka=!0,Is=[])}const Ay=Ry("component:updated");function Ry(e){return t=>{xy(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let xt=null,su=null;function ou(e){const t=xt;return xt=e,su=e&&e.type.__scopeId||null,t}function X(e,t=xt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Qo(-1);const o=ou(t);let i;try{i=e(...s)}finally{ou(o),r._d&&Qo(1)}return ce.env.NODE_ENV!=="production"&&Ay(t),i};return r._n=!0,r._c=!0,r._d=!0,r}function je(e,t){if(xt===null)return ce.env.NODE_ENV!=="production"&&Pe("withDirectives can only be used inside render functions."),e;const n=ju(xt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,l,u=R.EMPTY_OBJ]=t[s];o&&(R.isFunction(o)&&(o={mounted:o,updated:o}),o.deep&&zn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:l,modifiers:u}))}return e}function ns(e,t){if(ce.env.NODE_ENV!=="production"&&(!Ot||Ot.isMounted)&&Pe("provide() can only be used inside setup()."),Ot){let n=Ot.provides;const r=Ot.parent&&Ot.parent.provides;r===n&&(n=Ot.provides=Object.create(r)),n[e]=t}}function Un(e,t,n=!1){const r=rs();if(r||Xy){let s=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&R.isFunction(t)?t.call(r&&r.proxy):t;ce.env.NODE_ENV!=="production"&&Pe(`injection "${String(e)}" not found.`)}else ce.env.NODE_ENV!=="production"&&Pe("inject() can only be used inside setup() or functional components.")}const Ey=Symbol.for("v-scx"),Dy=()=>{{const e=Un(Ey);return e||ce.env.NODE_ENV!=="production"&&Pe("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function ze(e,t,n){return ce.env.NODE_ENV!=="production"&&!R.isFunction(t)&&Pe("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),iu(e,t,n)}function iu(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:s,flush:o,once:i}=n;ce.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&Pe('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&Pe('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&Pe('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const l=R.extend({},n);ce.env.NODE_ENV!=="production"&&(l.onWarn=Pe);const u=t&&r||!t&&o!=="post";let d;if(ss){if(o==="sync"){const h=Dy();d=h.__watcherHandles||(h.__watcherHandles=[])}else if(!u){const h=()=>{};return h.stop=R.NOOP,h.resume=R.NOOP,h.pause=R.NOOP,h}}const c=Ot;l.call=(h,g,m)=>Io(h,c,g,m);let f=!1;o==="post"?l.scheduler=h=>{Pa(h,c&&c.suspense)}:o!=="sync"&&(f=!0,l.scheduler=(h,g)=>{g?h():wa(h)}),l.augmentJob=h=>{t&&(h.flags|=4),f&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const p=uy(e,t,l);return ss&&(d?d.push(p):u&&p()),p}function Fy(e,t,n){const r=this.proxy,s=R.isString(e)?e.includes(".")?Iy(r,e):()=>r[e]:e.bind(r,r);let o;R.isFunction(t)?o=t:(o=t.handler,n=t);const i=Nu(this),l=iu(s,o.bind(r),n);return i(),l}function Iy(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Py=Symbol("_vte"),au=e=>e.__isTeleport,Fr=e=>e&&(e.disabled||e.disabled===""),lu=e=>e&&(e.defer||e.defer===""),cu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,uu=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ca=(e,t)=>{const n=e&&e.to;if(R.isString(n))if(t){const r=t(n);return ce.env.NODE_ENV!=="production"&&!r&&!Fr(e)&&Pe(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return ce.env.NODE_ENV!=="production"&&Pe("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ce.env.NODE_ENV!=="production"&&!n&&!Fr(e)&&Pe(`Invalid Teleport target: ${n}`),n},du={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,l,u,d){const{mc:c,pc:f,pbc:p,o:{insert:h,querySelector:g,createText:m,createComment:b}}=d,S=Fr(t.props);let{shapeFlag:k,children:w,dynamicChildren:C}=t;if(ce.env.NODE_ENV!=="production"&&Fs&&(u=!1,C=null),e==null){const A=t.el=ce.env.NODE_ENV!=="production"?b("teleport start"):m(""),I=t.anchor=ce.env.NODE_ENV!=="production"?b("teleport end"):m("");h(A,n,r),h(I,n,r);const N=(F,V)=>{k&16&&c(w,F,V,s,o,i,l,u)},_=()=>{const F=t.target=Ca(t.props,g),V=Ta(F,t,m,h);F?(i!=="svg"&&cu(F)?i="svg":i!=="mathml"&&uu(F)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(F),S||(N(F,V),No(t,!1))):ce.env.NODE_ENV!=="production"&&!S&&Pe("Invalid Teleport target on mount:",F,`(${typeof F})`)};S&&(N(n,I),No(t,!0)),lu(t.props)?(t.el.__isMounted=!1,Pa(()=>{_(),delete t.el.__isMounted},o)):_()}else{if(lu(t.props)&&e.el.__isMounted===!1){Pa(()=>{du.process(e,t,n,r,s,o,i,l,u,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const A=t.anchor=e.anchor,I=t.target=e.target,N=t.targetAnchor=e.targetAnchor,_=Fr(e.props),F=_?n:I,V=_?A:N;if(i==="svg"||cu(I)?i="svg":(i==="mathml"||uu(I))&&(i="mathml"),C?(p(e.dynamicChildren,C,F,s,o,i,l),Fu(e,t,ce.env.NODE_ENV==="production")):u||f(e,t,F,V,s,o,i,l,!1),S)_?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Mo(t,n,A,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Z=t.target=Ca(t.props,g);Z?Mo(t,Z,null,d,0):ce.env.NODE_ENV!=="production"&&Pe("Invalid Teleport target on update:",I,`(${typeof I})`)}else _&&Mo(t,I,N,d,1);No(t,S)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:l,anchor:u,targetStart:d,targetAnchor:c,target:f,props:p}=e;if(f&&(s(d),s(c)),o&&s(u),i&16){const h=o||!Fr(p);for(let g=0;g<l.length;g++){const m=l[g];r(m,t,n,h,!!m.dynamicChildren)}}},move:Mo,hydrate:$y};function Mo(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:u,children:d,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Fr(c))&&u&16)for(let p=0;p<d.length;p++)s(d[p],t,n,2);f&&r(l,t,n)}function $y(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:l,querySelector:u,insert:d,createText:c}},f){function p(b,S){let k=S;for(;k;){if(k&&k.nodeType===8){if(k.data==="teleport start anchor")t.targetStart=k;else if(k.data==="teleport anchor"){t.targetAnchor=k,b._lpa=t.targetAnchor&&i(t.targetAnchor);break}}k=i(k)}}function h(b,S){S.anchor=f(i(b),S,l(b),n,r,s,o)}const g=t.target=Ca(t.props,u),m=Fr(t.props);if(g){const b=g._lpa||g.firstChild;t.shapeFlag&16&&(m?(h(e,t),p(g,b),t.targetAnchor||Ta(g,t,c,d,l(e)===g?e:null)):(t.anchor=i(e),p(g,b),t.targetAnchor||Ta(g,t,c,d),f(b&&i(b),t,g,n,r,s,o))),No(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Ps=du;function No(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Ta(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Py]=i,e&&(r(o,e,s),r(i,e,s)),i}const qn=Symbol("_leaveCb"),$s=Symbol("_enterCb");function Oy(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ft(()=>{e.isMounted=!0}),Xt(()=>{e.isUnmounting=!0}),e}const Jt=[Function,Array],fu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Jt,onEnter:Jt,onAfterEnter:Jt,onEnterCancelled:Jt,onBeforeLeave:Jt,onLeave:Jt,onAfterLeave:Jt,onLeaveCancelled:Jt,onBeforeAppear:Jt,onAppear:Jt,onAfterAppear:Jt,onAppearCancelled:Jt},pu=e=>{const t=e.subTree;return t.component?pu(t.component):t},Ly={name:"BaseTransition",props:fu,setup(e,{slots:t}){const n=rs(),r=Oy();return()=>{const s=t.default&&yu(t.default(),!0);if(!s||!s.length)return;const o=hu(s),i=Ne(e),{mode:l}=i;if(ce.env.NODE_ENV!=="production"&&l&&l!=="in-out"&&l!=="out-in"&&l!=="default"&&Pe(`invalid <transition> mode: ${l}`),r.isLeaving)return Aa(o);const u=gu(o);if(!u)return Aa(o);let d=xa(u,i,r,n,f=>d=f);u.type!==Ht&&Bo(u,d);let c=n.subTree&&gu(n.subTree);if(c&&c.type!==Ht&&!$u(c,u)&&pu(n).type!==Ht){let f=xa(c,i,r,n);if(Bo(c,f),l==="out-in"&&u.type!==Ht)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},Aa(o);l==="in-out"&&u.type!==Ht?f.delayLeave=(p,h,g)=>{const m=mu(r,c);m[String(c.key)]=c,p[qn]=()=>{h(),p[qn]=void 0,delete d.delayedLeave,c=void 0},d.delayedLeave=()=>{g(),delete d.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function hu(e){let t=e[0];if(e.length>1){let n=!1;for(const r of e)if(r.type!==Ht){if(ce.env.NODE_ENV!=="production"&&n){Pe("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}if(t=r,n=!0,ce.env.NODE_ENV==="production")break}}return t}const _y=Ly;function mu(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function xa(e,t,n,r,s){const{appear:o,mode:i,persisted:l=!1,onBeforeEnter:u,onEnter:d,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:h,onAfterLeave:g,onLeaveCancelled:m,onBeforeAppear:b,onAppear:S,onAfterAppear:k,onAppearCancelled:w}=t,C=String(e.key),A=mu(n,e),I=(F,V)=>{F&&Io(F,r,9,V)},N=(F,V)=>{const Z=V[1];I(F,V),R.isArray(F)?F.every(P=>P.length<=1)&&Z():F.length<=1&&Z()},_={mode:i,persisted:l,beforeEnter(F){let V=u;if(!n.isMounted)if(o)V=b||u;else return;F[qn]&&F[qn](!0);const Z=A[C];Z&&$u(e,Z)&&Z.el[qn]&&Z.el[qn](),I(V,[F])},enter(F){if(A[C]===e)return;let V=d,Z=c,P=f;if(!n.isMounted)if(o)V=S||d,Z=k||c,P=w||f;else return;let $=!1;F[$s]=M=>{$||($=!0,M?I(P,[F]):I(Z,[F]),_.delayedLeave&&_.delayedLeave(),F[$s]=void 0)};const L=F[$s].bind(null,!1);V?N(V,[F,L]):L()},leave(F,V){const Z=String(e.key);if(F[$s]&&F[$s](!0),n.isUnmounting)return V();I(p,[F]);let P=!1;F[qn]=L=>{P||(P=!0,V(),L?I(m,[F]):I(g,[F]),F[qn]=void 0,A[Z]===e&&delete A[Z])};const $=F[qn].bind(null,!1);A[Z]=e,h?N(h,[F,$]):$()},clone(F){const V=xa(F,t,n,r,s);return s&&s(V),V}};return _}function Aa(e){if(Ra(e))return e=dr(e),e.children=null,e}function gu(e){if(!Ra(e))return au(e.type)&&e.children?hu(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&R.isFunction(n.default))return n.default()}}function Bo(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Bo(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function yu(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const l=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===ke?(i.patchFlag&128&&s++,r=r.concat(yu(i.children,t,l))):(t||i.type!==Ht)&&r.push(l!=null?dr(i,{key:l}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function ge(e,t){return R.isFunction(e)?R.extend({name:e.name},t,{setup:e}):e}function My(){const e=rs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:(ce.env.NODE_ENV!=="production"&&Pe("useId() is called when there is no active component instance to be associated with."),"")}function Ny(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const By=new WeakSet;function qt(e){const t=rs(),n=Xg(null);if(t){const s=t.refs===R.EMPTY_OBJ?t.refs={}:t.refs;ce.env.NODE_ENV!=="production"&&jy(s,e)?Pe(`useTemplateRef('${e}') already exists.`):Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:o=>n.value=o})}else ce.env.NODE_ENV!=="production"&&Pe("useTemplateRef() is called when there is no active component instance to be associated with.");const r=ce.env.NODE_ENV!=="production"?ar(n):n;return ce.env.NODE_ENV!=="production"&&By.add(r),r}function jy(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const vu=e=>e.nodeType===8;R.getGlobalThis().requestIdleCallback,R.getGlobalThis().cancelIdleCallback;function zy(e,t){if(vu(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(vu(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Vy=e=>!!e.type.__asyncLoader;function Uy(e){R.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:s=200,hydrate:o,timeout:i,suspensible:l=!0,onError:u}=e;let d=null,c,f=0;const p=()=>(f++,d=null,h()),h=()=>{let g;return d||(g=d=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),u)return new Promise((b,S)=>{u(m,()=>b(p()),()=>S(m),f+1)});throw m}).then(m=>{if(g!==d&&d)return d;if(ce.env.NODE_ENV!=="production"&&!m&&Pe("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),ce.env.NODE_ENV!=="production"&&m&&!R.isObject(m)&&!R.isFunction(m))throw new Error(`Invalid async component load result: ${m}`);return c=m,m}))};return ge({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(g,m,b){let S=!1;(m.bu||(m.bu=[])).push(()=>S=!0);const k=()=>{if(S){ce.env.NODE_ENV!=="production"&&Pe(`Skipping lazy hydration for component '${Jo(c)||c.__file}': it was updated before lazy hydration performed.`);return}b()},w=o?()=>{const C=o(k,A=>zy(g,A));C&&(m.bum||(m.bum=[])).push(C)}:k;c?w():h().then(()=>!m.isUnmounted&&w())},get __asyncResolved(){return c},setup(){const g=Ot;if(Ny(g),c)return()=>jo(c,g);const m=w=>{d=null,Po(w,g,13,!r)};if(l&&g.suspense||ss)return h().then(w=>()=>jo(w,g)).catch(w=>(m(w),()=>r?Q(r,{error:w}):null));const b=H(!1),S=H(),k=H(!!s);return s&&setTimeout(()=>{k.value=!1},s),i!=null&&setTimeout(()=>{if(!b.value&&!S.value){const w=new Error(`Async component timed out after ${i}ms.`);m(w),S.value=w}},i),h().then(()=>{b.value=!0,g.parent&&Ra(g.parent.vnode)&&g.parent.update()}).catch(w=>{m(w),S.value=w}),()=>{if(b.value&&c)return jo(c,g);if(S.value&&r)return Q(r,{error:S.value});if(n&&!k.value)return jo(n,g)}}})}function jo(e,t){const{ref:n,props:r,children:s,ce:o}=t.vnode,i=Q(e,r,s);return i.ref=n,i.ce=o,delete t.vnode.ce,i}const Ra=e=>e.type.__isKeepAlive;function qy(e,t,n=Ot,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Jr();const l=Nu(n),u=Io(t,n,e,i);return l(),Xr(),u});return r?s.unshift(o):s.push(o),o}else if(ce.env.NODE_ENV!=="production"){const s=R.toHandlerKey(ba[e].replace(/ hook$/,""));Pe(`${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Ea=e=>(t,n=Ot)=>{(!ss||e==="sp")&&qy(e,(...r)=>t(...r),n)},ft=Ea("m"),Xt=Ea("bum"),zo=Ea("um"),Vo="components",Hy="directives";function te(e,t){return Da(Vo,e,!0,t)||e}const bu=Symbol.for("v-ndc");function Yt(e){return R.isString(e)?Da(Vo,e,!1)||e:e||bu}function Bt(e){return Da(Hy,e)}function Da(e,t,n=!0,r=!1){const s=xt||Ot;if(s){const o=s.type;if(e===Vo){const l=Jo(o,!1);if(l&&(l===t||l===R.camelize(t)||l===R.capitalize(R.camelize(t))))return o}const i=wu(s[e]||o[e],t)||wu(s.appContext[e],t);if(!i&&r)return o;if(ce.env.NODE_ENV!=="production"&&n&&!i){const l=e===Vo?`
5
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";Pe(`Failed to resolve ${e.slice(0,-1)}: ${t}${l}`)}return i}else ce.env.NODE_ENV!=="production"&&Pe(`resolve${R.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function wu(e,t){return e&&(e[t]||e[R.camelize(t)]||e[R.capitalize(R.camelize(t))])}function Ge(e,t,n,r){let s;const o=n,i=R.isArray(e);if(i||R.isString(e)){const l=i&&lr(e);let u=!1,d=!1;l&&(u=!It(e),d=dn(e),e=To(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(u?d?Zr(fn(e[c])):fn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){ce.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&Pe(`The v-for range expect an integer value but got ${e}.`),s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,o)}else if(R.isObject(e))if(e[Symbol.iterator])s=Array.from(e,(l,u)=>t(l,u,void 0,o));else{const l=Object.keys(e);s=new Array(l.length);for(let u=0,d=l.length;u<d;u++){const c=l[u];s[u]=t(e[c],c,u,o)}}else s=[];return s}function Su(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(R.isArray(r))for(let s=0;s<r.length;s++)e[r[s].name]=r[s].fn;else r&&(e[r.name]=r.key?(...s)=>{const o=r.fn(...s);return o&&(o.key=r.key),o}:r.fn)}return e}function Se(e,t,n={},r,s){if(xt.ce||xt.parent&&Vy(xt.parent)&&xt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),D(),ee(ke,null,[Q("slot",n,r&&r())],d?-2:64)}let o=e[t];ce.env.NODE_ENV!=="production"&&o&&o.length>1&&(Pe("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),o=()=>[]),o&&o._c&&(o._d=!1),D();const i=o&&ku(o(n)),l=n.key||i&&i.key,u=ee(ke,{key:(l&&!R.isSymbol(l)?l:`_${t}`)+(!i&&r?"_fb":"")},i||(r?r():[]),i&&e._===1?64:-2);return!s&&u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),o&&o._c&&(o._d=!0),u}function ku(e){return e.some(t=>Ko(t)?!(t.type===Ht||t.type===ke&&!ku(t.children)):!0)?e:null}function Uo(e,t){const n={};if(ce.env.NODE_ENV!=="production"&&!R.isObject(e))return Pe("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:R.toHandlerKey(r)]=e[r];return n}const Fa=e=>e?sv(e)?ju(e):Fa(e.parent):null,Ia=R.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ce.env.NODE_ENV!=="production"?Ro(e.props):e.props,$attrs:e=>ce.env.NODE_ENV!=="production"?Ro(e.attrs):e.attrs,$slots:e=>ce.env.NODE_ENV!=="production"?Ro(e.slots):e.slots,$refs:e=>ce.env.NODE_ENV!=="production"?Ro(e.refs):e.refs,$parent:e=>Fa(e.parent),$root:e=>Fa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Qy(e),$forceUpdate:e=>e.f||(e.f=()=>{wa(e.update)}),$nextTick:e=>e.n||(e.n=St.bind(e.proxy)),$watch:e=>Fy.bind(e)}),Wy={};ce.env.NODE_ENV!=="production"&&(Wy.ownKeys=e=>(Pe("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function Cu(){return Tu("useSlots").slots}function qo(){return Tu("useAttrs").attrs}function Tu(e){const t=rs();return ce.env.NODE_ENV!=="production"&&!t&&Pe(`${e}() called without active instance.`),t.setupContext||(t.setupContext=iv(t))}function xu(e){return R.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Qy(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let u;return l?u=l:!s.length&&!n&&!r?u=t:(u={},s.length&&s.forEach(d=>Ho(u,d,i,!0)),Ho(u,t,i)),R.isObject(t)&&o.set(t,u),u}function Ho(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Ho(e,o,n,!0),s&&s.forEach(i=>Ho(e,i,n,!0));for(const i in t)if(r&&i==="expose")ce.env.NODE_ENV!=="production"&&Pe('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const l=Ky[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const Ky={data:Au,props:Eu,emits:Eu,methods:Os,computed:Os,beforeCreate:$t,created:$t,beforeMount:$t,mounted:$t,beforeUpdate:$t,updated:$t,beforeDestroy:$t,beforeUnmount:$t,destroyed:$t,unmounted:$t,activated:$t,deactivated:$t,errorCaptured:$t,serverPrefetch:$t,components:Os,directives:Os,watch:Jy,provide:Au,inject:Gy};function Au(e,t){return t?e?function(){return R.extend(R.isFunction(e)?e.call(this,this):e,R.isFunction(t)?t.call(this,this):t)}:t:e}function Gy(e,t){return Os(Ru(e),Ru(t))}function Ru(e){if(R.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function $t(e,t){return e?[...new Set([].concat(e,t))]:t}function Os(e,t){return e?R.extend(Object.create(null),e,t):t}function Eu(e,t){return e?R.isArray(e)&&R.isArray(t)?[...new Set([...e,...t])]:R.extend(Object.create(null),xu(e),xu(t??{})):t}function Jy(e,t){if(!e)return t;if(!t)return e;const n=R.extend(Object.create(null),e);for(const r in t)n[r]=$t(e[r],t[r]);return n}let Xy=null;const Yy={},Du=e=>Object.getPrototypeOf(e)===Yy,Pa=ev;function Fu(e,t,n=!1){const r=e.children,s=t.children;if(R.isArray(r)&&R.isArray(s))for(let o=0;o<r.length;o++){const i=r[o];let l=s[o];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[o]=Mu(s[o]),l.el=i.el),!n&&l.patchFlag!==-2&&Fu(i,l)),l.type===Iu&&(l.patchFlag===-1&&(l=s[o]=Mu(l)),l.el=i.el),l.type===Ht&&!l.el&&(l.el=i.el),ce.env.NODE_ENV!=="production"&&l.el&&(l.el.__vnode=l)}}const Zy=e=>e.__isSuspense;function ev(e,t){t&&t.pendingBranch?R.isArray(e)?t.effects.push(...e):t.effects.push(e):Zc(e)}const ke=Symbol.for("v-fgt"),Iu=Symbol.for("v-txt"),Ht=Symbol.for("v-cmt"),Wo=[];let Wt=null;function D(e=!1){Wo.push(Wt=e?null:[])}function tv(){Wo.pop(),Wt=Wo[Wo.length-1]||null}let Ls=1;function Qo(e,t=!1){Ls+=e,e<0&&Wt&&t&&(Wt.hasOnce=!0)}function Pu(e){return e.dynamicChildren=Ls>0?Wt||R.EMPTY_ARR:null,tv(),Ls>0&&Wt&&Wt.push(e),e}function K(e,t,n,r,s,o){return Pu(W(e,t,n,r,s,o,!0))}function ee(e,t,n,r,s){return Pu(Q(e,t,n,r,s,!0))}function Ko(e){return e?e.__v_isVNode===!0:!1}function $u(e,t){if(ce.env.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const n=Oo.get(t.type);if(n&&n.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const nv=(...e)=>Lu(...e),Ou=({key:e})=>e??null,Go=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?R.isString(e)||ct(e)||R.isFunction(e)?{i:xt,r:e,k:t,f:!!n}:e:null);function W(e,t=null,n=null,r=0,s=null,o=e===ke?0:1,i=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ou(t),ref:t&&Go(t),scopeId:su,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:xt};return l?($a(u,n),o&128&&e.normalize(u)):n&&(u.shapeFlag|=R.isString(n)?8:16),ce.env.NODE_ENV!=="production"&&u.key!==u.key&&Pe("VNode created with invalid key (NaN). VNode type:",u.type),Ls>0&&!i&&Wt&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&Wt.push(u),u}const Q=ce.env.NODE_ENV!=="production"?nv:Lu;function Lu(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===bu)&&(ce.env.NODE_ENV!=="production"&&!e&&Pe(`Invalid vnode type when creating vnode: ${e}.`),e=Ht),Ko(e)){const l=dr(e,t,!0);return n&&$a(l,n),Ls>0&&!o&&Wt&&(l.shapeFlag&6?Wt[Wt.indexOf(e)]=l:Wt.push(l)),l.patchFlag=-2,l}if(Vu(e)&&(e=e.__vccOpts),t){t=rv(t);let{class:l,style:u}=t;l&&!R.isString(l)&&(t.class=R.normalizeClass(l)),R.isObject(u)&&(Es(u)&&!R.isArray(u)&&(u=R.extend({},u)),t.style=R.normalizeStyle(u))}const i=R.isString(e)?1:Zy(e)?128:au(e)?64:R.isObject(e)?4:R.isFunction(e)?2:0;return ce.env.NODE_ENV!=="production"&&i&4&&Es(e)&&(e=Ne(e),Pe("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
6
- Component that was made reactive: `,e)),W(e,t,n,r,s,i,o,!0)}function rv(e){return e?Es(e)||Du(e)?R.extend({},e):e:null}function dr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:l,transition:u}=e,d=t?at(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Ou(d),ref:t&&t.ref?n&&o?R.isArray(o)?o.concat(Go(t)):[o,Go(t)]:Go(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ce.env.NODE_ENV!=="production"&&i===-1&&R.isArray(l)?l.map(_u):l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ke?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&dr(e.ssContent),ssFallback:e.ssFallback&&dr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&r&&Bo(c,u.clone(c)),c}function _u(e){const t=dr(e);return R.isArray(e.children)&&(t.children=e.children.map(_u)),t}function it(e=" ",t=0){return Q(Iu,null,e,t)}function ie(e="",t=!1){return t?(D(),ee(Ht,null,e)):Q(Ht,null,e)}function Mu(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:dr(e)}function $a(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(R.isArray(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),$a(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Du(t)?t._ctx=xt:s===3&&xt&&(xt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else R.isFunction(t)?(t={default:t,_ctx:xt},n=32):(t=String(t),r&64?(n=16,t=[it(t)]):n=8);e.children=t,e.shapeFlag|=n}function at(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=R.normalizeClass([t.class,r.class]));else if(s==="style")t.style=R.normalizeStyle([t.style,r.style]);else if(R.isOn(s)){const o=t[s],i=r[s];i&&o!==i&&!(R.isArray(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}let Ot=null;const rs=()=>Ot||xt;let Oa;{const e=R.getGlobalThis(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Oa=t("__VUE_INSTANCE_SETTERS__",n=>Ot=n),t("__VUE_SSR_SETTERS__",n=>ss=n)}const Nu=e=>{const t=Ot;return Oa(e),e.scope.on(),()=>{e.scope.off(),Oa(t)}};function sv(e){return e.vnode.shapeFlag&4}let ss=!1;const Bu=ce.env.NODE_ENV!=="production"?{get(e,t){return Tt(e,"get",""),e[t]},set(){return Pe("setupContext.attrs is readonly."),!1},deleteProperty(){return Pe("setupContext.attrs is readonly."),!1}}:{get(e,t){return Tt(e,"get",""),e[t]}};function ov(e){return new Proxy(e.slots,{get(t,n){return Tt(e,"get","$slots"),t[n]}})}function iv(e){const t=n=>{if(ce.env.NODE_ENV!=="production"&&(e.exposed&&Pe("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(R.isArray(n)?r="array":ct(n)&&(r="ref")),r!=="object"&&Pe(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(ce.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Bu))},get slots(){return r||(r=ov(e))},get emit(){return(s,...o)=>e.emit(s,...o)},expose:t})}else return{attrs:new Proxy(e.attrs,Bu),slots:e.slots,emit:e.emit,expose:t}}function ju(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ey(Kc(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ia)return Ia[n](e)},has(t,n){return n in t||n in Ia}})):e.proxy}const av=/(?:^|[-_])\w/g,lv=e=>e.replace(av,t=>t.toUpperCase()).replace(/[-_]/g,"");function Jo(e,t=!0){return R.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function zu(e,t,n=!1){let r=Jo(t);if(!r&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(r=s[1])}if(!r&&e){const s=o=>{for(const i in o)if(o[i]===t)return i};r=s(e.components)||e.parent&&s(e.parent.type.components)||s(e.appContext.components)}return r?lv(r):n?"App":"Anonymous"}function Vu(e){return R.isFunction(e)&&"__vccOpts"in e}const T=(e,t)=>{const n=ly(e,t,ss);if(ce.env.NODE_ENV!=="production"){const r=rs();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Xo(e,t,n){try{Qo(-1);const r=arguments.length;return r===2?R.isObject(t)&&!R.isArray(t)?Ko(t)?Q(e,null,[t]):Q(e,t):Q(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ko(n)&&(n=[n]),Q(e,t,n))}finally{Qo(1)}}function cv(){if(ce.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},s={__vue_custom_formatter:!0,header(f){if(!R.isObject(f))return null;if(f.__isVue)return["div",e,"VueInstance"];if(ct(f)){Jr();const p=f.value;return Xr(),["div",{},["span",e,c(f)],"<",l(p),">"]}else{if(lr(f))return["div",{},["span",e,It(f)?"ShallowReactive":"Reactive"],"<",l(f),`>${dn(f)?" (readonly)":""}`];if(dn(f))return["div",{},["span",e,It(f)?"ShallowReadonly":"Readonly"],"<",l(f),">"]}return null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...o(f.$)]}};function o(f){const p=[];f.type.props&&f.props&&p.push(i("props",Ne(f.props))),f.setupState!==R.EMPTY_OBJ&&p.push(i("setup",f.setupState)),f.data!==R.EMPTY_OBJ&&p.push(i("data",Ne(f.data)));const h=u(f,"computed");h&&p.push(i("computed",h));const g=u(f,"inject");return g&&p.push(i("injected",g)),p.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),p}function i(f,p){return p=R.extend({},p),Object.keys(p).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(p).map(h=>["div",{},["span",r,h+": "],l(p[h],!1)])]]:["span",{}]}function l(f,p=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",n,JSON.stringify(f)]:typeof f=="boolean"?["span",r,f]:R.isObject(f)?["object",{object:p?Ne(f):f}]:["span",n,String(f)]}function u(f,p){const h=f.type;if(R.isFunction(h))return;const g={};for(const m in f.ctx)d(h,m,p)&&(g[m]=f.ctx[m]);return g}function d(f,p,h){const g=f[h];if(R.isArray(g)&&g.includes(p)||R.isObject(g)&&p in g||f.extends&&d(f.extends,p,h)||f.mixins&&f.mixins.some(m=>d(m,p,h)))return!0}function c(f){return It(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}const Uu=ce.env.NODE_ENV!=="production"?Pe:R.NOOP;ce.env.NODE_ENV,ce.env.NODE_ENV;let uv;const qu=typeof window<"u"&&window.trustedTypes;if(qu)try{uv=qu.createPolicy("vue",{createHTML:e=>e})}catch(e){ce.env.NODE_ENV!=="production"&&Uu(`Error creating trusted types policy: ${e}`)}const fr="transition",_s="animation",Yo=Symbol("_vtc"),Hu={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},dv=R.extend({},fu,Hu),fv=(e=>(e.displayName="Transition",e.props=dv,e))((e,{slots:t})=>Xo(_y,pv(e),t)),Ir=(e,t=[])=>{R.isArray(e)?e.forEach(n=>n(...t)):e&&e(...t)},Wu=e=>e?R.isArray(e)?e.some(t=>t.length>1):e.length>1:!1;function pv(e){const t={};for(const P in e)P in Hu||(t[P]=e[P]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:u=o,appearActiveClass:d=i,appearToClass:c=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,g=hv(s),m=g&&g[0],b=g&&g[1],{onBeforeEnter:S,onEnter:k,onEnterCancelled:w,onLeave:C,onLeaveCancelled:A,onBeforeAppear:I=S,onAppear:N=k,onAppearCancelled:_=w}=t,F=(P,$,L,M)=>{P._enterCancelled=M,Pr(P,$?c:l),Pr(P,$?d:i),L&&L()},V=(P,$)=>{P._isLeaving=!1,Pr(P,f),Pr(P,h),Pr(P,p),$&&$()},Z=P=>($,L)=>{const M=P?N:k,j=()=>F($,P,L);Ir(M,[$,j]),Qu(()=>{Pr($,P?u:o),Hn($,P?c:l),Wu(M)||Ku($,r,m,j)})};return R.extend(t,{onBeforeEnter(P){Ir(S,[P]),Hn(P,o),Hn(P,i)},onBeforeAppear(P){Ir(I,[P]),Hn(P,u),Hn(P,d)},onEnter:Z(!1),onAppear:Z(!0),onLeave(P,$){P._isLeaving=!0;const L=()=>V(P,$);Hn(P,f),P._enterCancelled?(Hn(P,p),Xu(P)):(Xu(P),Hn(P,p)),Qu(()=>{P._isLeaving&&(Pr(P,f),Hn(P,h),Wu(C)||Ku(P,r,b,L))}),Ir(C,[P,L])},onEnterCancelled(P){F(P,!1,void 0,!0),Ir(w,[P])},onAppearCancelled(P){F(P,!0,void 0,!0),Ir(_,[P])},onLeaveCancelled(P){V(P),Ir(A,[P])}})}function hv(e){if(e==null)return null;if(R.isObject(e))return[La(e.enter),La(e.leave)];{const t=La(e);return[t,t]}}function La(e){const t=R.toNumber(e);return ce.env.NODE_ENV!=="production"&&yy(t,"<transition> explicit duration"),t}function Hn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Yo]||(e[Yo]=new Set)).add(t)}function Pr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Yo];n&&(n.delete(t),n.size||(e[Yo]=void 0))}function Qu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let mv=0;function Ku(e,t,n,r){const s=e._endId=++mv,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:l,propCount:u}=gv(e,t);if(!i)return r();const d=i+"end";let c=0;const f=()=>{e.removeEventListener(d,p),o()},p=h=>{h.target===e&&++c>=u&&f()};setTimeout(()=>{c<u&&f()},l+1),e.addEventListener(d,p)}function gv(e,t){const n=window.getComputedStyle(e),r=g=>(n[g]||"").split(", "),s=r(`${fr}Delay`),o=r(`${fr}Duration`),i=Gu(s,o),l=r(`${_s}Delay`),u=r(`${_s}Duration`),d=Gu(l,u);let c=null,f=0,p=0;t===fr?i>0&&(c=fr,f=i,p=o.length):t===_s?d>0&&(c=_s,f=d,p=u.length):(f=Math.max(i,d),c=f>0?i>d?fr:_s:null,p=c?c===fr?o.length:u.length:0);const h=c===fr&&/\b(?:transform|all)(?:,|$)/.test(r(`${fr}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:h}}function Gu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Ju(n)+Ju(e[r])))}function Ju(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Xu(e){return(e?e.ownerDocument:document).body.offsetHeight}const Yu=Symbol("_vod"),yv=Symbol("_vsh"),Zu={name:"show",beforeMount(e,{value:t},{transition:n}){e[Yu]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ms(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Ms(e,!0),r.enter(e)):r.leave(e,()=>{Ms(e,!1)}):Ms(e,t))},beforeUnmount(e,{value:t}){Ms(e,t)}};function Ms(e,t){e.style.display=t?e[Yu]:"none",e[yv]=!t}ce.env.NODE_ENV;function pr(e,t,n,r){e.addEventListener(t,n,r)}const hr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return R.isArray(t)?n=>R.invokeArrayFns(t,n):t};function vv(e){e.target.composing=!0}function ed(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Zt=Symbol("_assign");function td(e,t,n){return t&&(e=e.trim()),n&&(e=R.looseToNumber(e)),e}const _a={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Zt]=hr(s);const o=r||s.props&&s.props.type==="number";pr(e,t?"change":"input",i=>{i.target.composing||e[Zt](td(e.value,n,o))}),(n||o)&&pr(e,"change",()=>{e.value=td(e.value,n,o)}),t||(pr(e,"compositionstart",vv),pr(e,"compositionend",ed),pr(e,"change",ed))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Zt]=hr(i),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?R.looseToNumber(e.value):e.value,u=t??"";l!==u&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===u)||(e.value=u))}},bv={deep:!0,created(e,t,n){e[Zt]=hr(n),pr(e,"change",()=>{const r=e._modelValue,s=os(e),o=e.checked,i=e[Zt];if(R.isArray(r)){const l=R.looseIndexOf(r,s),u=l!==-1;if(o&&!u)i(r.concat(s));else if(!o&&u){const d=[...r];d.splice(l,1),i(d)}}else if(R.isSet(r)){const l=new Set(r);o?l.add(s):l.delete(s),i(l)}else i(sd(e,o))})},mounted:nd,beforeUpdate(e,t,n){e[Zt]=hr(n),nd(e,t,n)}};function nd(e,{value:t,oldValue:n},r){e._modelValue=t;let s;if(R.isArray(t))s=R.looseIndexOf(t,r.props.value)>-1;else if(R.isSet(t))s=t.has(r.props.value);else{if(t===n)return;s=R.looseEqual(t,sd(e,!0))}e.checked!==s&&(e.checked=s)}const wv={created(e,{value:t},n){e.checked=R.looseEqual(t,n.props.value),e[Zt]=hr(n),pr(e,"change",()=>{e[Zt](os(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Zt]=hr(r),t!==n&&(e.checked=R.looseEqual(t,r.props.value))}},Sv={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const s=R.isSet(t);pr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?R.looseToNumber(os(i)):os(i));e[Zt](e.multiple?s?new Set(o):o:o[0]),e._assigning=!0,St(()=>{e._assigning=!1})}),e[Zt]=hr(r)},mounted(e,{value:t}){rd(e,t)},beforeUpdate(e,t,n){e[Zt]=hr(n)},updated(e,{value:t}){e._assigning||rd(e,t)}};function rd(e,t){const n=e.multiple,r=R.isArray(t);if(n&&!r&&!R.isSet(t)){ce.env.NODE_ENV!=="production"&&Uu(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let s=0,o=e.options.length;s<o;s++){const i=e.options[s],l=os(i);if(n)if(r){const u=typeof l;u==="string"||u==="number"?i.selected=t.some(d=>String(d)===String(l)):i.selected=R.looseIndexOf(t,l)>-1}else i.selected=t.has(l);else if(R.looseEqual(os(i),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function os(e){return"_value"in e?e._value:e.value}function sd(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const kv={created(e,t,n){Zo(e,t,n,null,"created")},mounted(e,t,n){Zo(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){Zo(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){Zo(e,t,n,r,"updated")}};function Cv(e,t){switch(e){case"SELECT":return Sv;case"TEXTAREA":return _a;default:switch(t){case"checkbox":return bv;case"radio":return wv;default:return _a}}}function Zo(e,t,n,r,s){const i=Cv(e.tagName,n.props&&n.props.type)[s];i&&i(e,t,n,r)}const Tv=["ctrl","shift","alt","meta"],xv={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Tv.some(n=>e[`${n}Key`]&&!t.includes(n))},kt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const l=xv[t[i]];if(l&&l(s,t))return}return e(s,...o)}))},Av={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ns=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=R.hyphenate(s.key);if(t.some(i=>i===o||Av[i]===o))return e(s)}))};function Rv(){cv()}ce.env.NODE_ENV!=="production"&&Rv();const Lt=()=>wc.useAbility();function od(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const Bs=(e,t)=>!e||!t?!1:e.id===t.id;function Ev(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ma,id;function Dv(){if(id)return Ma;id=1;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function t(s,o){for(var i="",l=0,u=-1,d=0,c,f=0;f<=s.length;++f){if(f<s.length)c=s.charCodeAt(f);else{if(c===47)break;c=47}if(c===47){if(!(u===f-1||d===1))if(u!==f-1&&d===2){if(i.length<2||l!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var p=i.lastIndexOf("/");if(p!==i.length-1){p===-1?(i="",l=0):(i=i.slice(0,p),l=i.length-1-i.lastIndexOf("/")),u=f,d=0;continue}}else if(i.length===2||i.length===1){i="",l=0,u=f,d=0;continue}}o&&(i.length>0?i+="/..":i="..",l=2)}else i.length>0?i+="/"+s.slice(u+1,f):i=s.slice(u+1,f),l=f-u-1;u=f,d=0}else c===46&&d!==-1?++d:d=-1}return i}function n(s,o){var i=o.dir||o.root,l=o.base||(o.name||"")+(o.ext||"");return i?i===o.root?i+l:i+s+l:l}var r={resolve:function(){for(var o="",i=!1,l,u=arguments.length-1;u>=-1&&!i;u--){var d;u>=0?d=arguments[u]:(l===void 0&&(l=ce.cwd()),d=l),e(d),d.length!==0&&(o=d+"/"+o,i=d.charCodeAt(0)===47)}return o=t(o,!i),i?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return".";var i=o.charCodeAt(0)===47,l=o.charCodeAt(o.length-1)===47;return o=t(o,!i),o.length===0&&!i&&(o="."),o.length>0&&l&&(o+="/"),i?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,i=0;i<arguments.length;++i){var l=arguments[i];e(l),l.length>0&&(o===void 0?o=l:o+="/"+l)}return o===void 0?".":r.normalize(o)},relative:function(o,i){if(e(o),e(i),o===i||(o=r.resolve(o),i=r.resolve(i),o===i))return"";for(var l=1;l<o.length&&o.charCodeAt(l)===47;++l);for(var u=o.length,d=u-l,c=1;c<i.length&&i.charCodeAt(c)===47;++c);for(var f=i.length,p=f-c,h=d<p?d:p,g=-1,m=0;m<=h;++m){if(m===h){if(p>h){if(i.charCodeAt(c+m)===47)return i.slice(c+m+1);if(m===0)return i.slice(c+m)}else d>h&&(o.charCodeAt(l+m)===47?g=m:m===0&&(g=0));break}var b=o.charCodeAt(l+m),S=i.charCodeAt(c+m);if(b!==S)break;b===47&&(g=m)}var k="";for(m=l+g+1;m<=u;++m)(m===u||o.charCodeAt(m)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+i.slice(c+g):(c+=g,i.charCodeAt(c)===47&&++c,i.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var i=o.charCodeAt(0),l=i===47,u=-1,d=!0,c=o.length-1;c>=1;--c)if(i=o.charCodeAt(c),i===47){if(!d){u=c;break}}else d=!1;return u===-1?l?"/":".":l&&u===1?"//":o.slice(0,u)},basename:function(o,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(o);var l=0,u=-1,d=!0,c;if(i!==void 0&&i.length>0&&i.length<=o.length){if(i.length===o.length&&i===o)return"";var f=i.length-1,p=-1;for(c=o.length-1;c>=0;--c){var h=o.charCodeAt(c);if(h===47){if(!d){l=c+1;break}}else p===-1&&(d=!1,p=c+1),f>=0&&(h===i.charCodeAt(f)?--f===-1&&(u=c):(f=-1,u=p))}return l===u?u=p:u===-1&&(u=o.length),o.slice(l,u)}else{for(c=o.length-1;c>=0;--c)if(o.charCodeAt(c)===47){if(!d){l=c+1;break}}else u===-1&&(d=!1,u=c+1);return u===-1?"":o.slice(l,u)}},extname:function(o){e(o);for(var i=-1,l=0,u=-1,d=!0,c=0,f=o.length-1;f>=0;--f){var p=o.charCodeAt(f);if(p===47){if(!d){l=f+1;break}continue}u===-1&&(d=!1,u=f+1),p===46?i===-1?i=f:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||u===-1||c===0||c===1&&i===u-1&&i===l+1?"":o.slice(i,u)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return n("/",o)},parse:function(o){e(o);var i={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return i;var l=o.charCodeAt(0),u=l===47,d;u?(i.root="/",d=1):d=0;for(var c=-1,f=0,p=-1,h=!0,g=o.length-1,m=0;g>=d;--g){if(l=o.charCodeAt(g),l===47){if(!h){f=g+1;break}continue}p===-1&&(h=!1,p=g+1),l===46?c===-1?c=g:m!==1&&(m=1):c!==-1&&(m=-1)}return c===-1||p===-1||m===0||m===1&&c===p-1&&c===f+1?p!==-1&&(f===0&&u?i.base=i.name=o.slice(1,p):i.base=i.name=o.slice(f,p)):(f===0&&u?(i.name=o.slice(1,c),i.base=o.slice(1,p)):(i.name=o.slice(f,c),i.base=o.slice(f,p)),i.ext=o.slice(c,p)),f>0?i.dir=o.slice(0,f-1):u&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Ma=r,Ma}var We=Dv();const Na=Ev(We),Fv=ge({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Le=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Iv=["textContent"],Pv=["textContent"];function $v(e,t,n,r,s,o){return D(),K(ke,null,[W("p",{class:"mt-0",textContent:R.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,Iv),W("p",{class:"mb-0",textContent:R.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,Pv)],64)}const ad=Le(Fv,[["render",$v]]),Ov=ge({name:"ResourceConflictModal",props:{modal:{type:Object,required:!0},resource:{type:Object,required:!0},conflictCount:{type:Number,required:!0},callbackFn:{type:Function,required:!0},suggestMerge:{type:Boolean,default:!0},separateSkipHandling:{type:Boolean,default:!1},confirmSecondaryTextOverwrite:{type:String,default:null}},setup(e){const{removeModal:t}=Ke(),{$gettext:n}=de.useGettext(),r=H(!1),s=T(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?n("Apply to all %{count} folders",{count:e.conflictCount.toString()}):n("Apply to all %{count} files",{count:e.conflictCount.toString()}):n("Apply to all %{count} conflicts",{count:e.conflictCount.toString()})),o=T(()=>e.resource.isFolder?n("Folder with name »%{name}« already exists.",{name:e.resource.name}):n("File with name »%{name}« already exists.",{name:e.resource.name})),i=T(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:o,checkboxValue:r,checkboxLabel:s,confirmSecondaryText:i,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:hn.KEEP_BOTH,doForAllConflicts:a(r)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?hn.MERGE:hn.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:a(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:hn.SKIP,doForAllConflicts:a(r)})}}}}),Lv=["textContent"],_v={class:"my-4"},Mv={class:"flex justify-end items-center mt-4"},Nv={class:"oc-modal-body-actions-grid"};function Bv(e,t,n,r,s,o){const i=te("oc-checkbox"),l=te("oc-button");return D(),K(ke,null,[W("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.message)},null,8,Lv),W("div",_v,[e.conflictCount>1?(D(),ee(i,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=u=>e.checkboxValue=u),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):ie("",!0)]),W("div",Mv,[W("div",Nv,[Q(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:X(()=>[it(R.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),Q(l,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:X(()=>[it(R.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),Q(l,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:X(()=>[it(R.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const ld=Le(Ov,[["render",Bv]]);class Ba{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const s=[];for(const d of t){const c=We.join(n.path,d.name);r.some(p=>p.path===c)&&s.push({resource:d,strategy:null})}let o=0,i=!1,l=null;const u=[];for(const d of s){if(i){d.strategy=l,u.push(d);continue}const c=s.length-o,f=await this.resolveFileExists(d.resource,c);d.strategy=f.strategy,u.push(d),o+=1,f.doForAllConflicts&&(i=!0,l=f.strategy)}return u}resolveFileExists(t,n,r=!1,s=!1){const{dispatchModal:o}=Ke();return new Promise(i=>{o({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:ld,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:s,callbackFn:l=>{i(l)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=Ke();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:ad,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const pn=(e,t,n,r=1)=>{let s;return t?s=`${z.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:s=`${e} (${r})`,n.some(i=>i.name===s)?pn(e,t,n,r+1):s},cd=(e,t,n,r)=>e.id===n.id&&We.dirname(t.path)===r.path;var hn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(hn||{}),Wn=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(Wn||{});class ud extends Ba{constructor(t,n,r,s,o,i,l,u){super(l,u),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=s,this.currentFolder=o,this.clientService=i}hasRecursion(){return this.sourceSpace.id!==this.targetSpace.id?!1:this.resourcesToMove.some(t=>this.targetFolder.path===t.path)}showRecursionErrorMessage(){const t=this.resourcesToMove.length,n=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.",t);Me().showErrorMessage({title:n})}showResultMessage(t,n,r){if(t.length===0){const l=n.length;if(l===0)return;const u=r===Wn.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",l,{count:l.toString()}):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",l,{count:l.toString()});Me().showMessage({title:u,status:"success"});return}let s=r===Wn.COPY?this.$gettext("Failed to copy %{count} resources",{count:t.length.toString()}):this.$gettext("Failed to move %{count} resources",{count:t.length.toString()});t.length===1&&(s=r===Wn.COPY?this.$gettext("Failed to copy »%{name}«",{name:t[0]?.resourceName}):this.$gettext("Failed to move »%{name}«",{name:t[0]?.resourceName}));let o="";t.some(({error:l})=>l instanceof z.HttpError&&l.statusCode===507)&&(o=this.$gettext("Insufficient quota")),Me().showErrorMessage({title:s,...o&&{desc:o},errors:t.map(({error:l})=>l)})}async getTransferData(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===Wn.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=Wn.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),s=[];for(const o of this.resourcesToMove){const i={...o},{id:l,name:u,extension:d}=i,c=r.some(h=>h.resource.id===l);let f=u,p=!1;if(c){const h=r.find(g=>g.resource.id===l)?.strategy;if(h===hn.SKIP)continue;if(h===hn.REPLACE){if(this.isOverwritingParentFolder(i,this.targetFolder,n)){const g=new Error;this.showResultMessage([{error:g,resourceName:u}],[],t);continue}p=!0}h===hn.KEEP_BOTH&&(f=pn(u,d,n),i.name=f)}cd(this.sourceSpace,i,this.targetSpace,this.targetFolder)&&p||s.push({resource:i,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:We.join(this.targetFolder.path,f),overwrite:p,transferType:t})}return s}isOverwritingParentFolder(t,n,r){if(t.type!=="folder")return!1;const s=a(this.currentFolder)?.path;if(!s||n.path===s)return!1;const o=We.basename(t.path),i=We.join(n.path,o);return s.split("/").length<i.split("/").length?!1:r.some(l=>l.path===i)}}const ja={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},jv=(e,t,n)=>new Sc(e,{...ja,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(s=>s.item),dd="oc-resource-icon-mapping",zv={archive:{icon:{name:"resource-type-archive",color:"var(--oc-color-icon-archive)"},extensions:["7z","apk","bz2","deb","gz","gzip","rar","tar","tar.bz2","tar.gz","tar.xz","tbz2","tgz","zip"]},audio:{icon:{name:"resource-type-audio",color:"var(--oc-color-icon-audio)"},extensions:["3gp","8svx","aa","aac","aax","act","aiff","alac","amr","ape","au","awb","cda","dss","dvf","flac","gsm","iklax","ivs","m4a","m4b","m4p","mmf","mogg","movpkg","mp3","mpc","msv","nmf","oga","ogga","opus","ra","raw","rf64","rm","sln","tta","voc","vox","wav","wma","wv"]},code:{icon:{name:"resource-type-code",color:"var(--oc-role-on-surface)"},extensions:["bash","c++","c","cc","cpp","css","feature","go","h","hh","hpp","htm","html","java","js","json","php","pl","py","scss","sh","sh-lib","sql","ts","xml","yaml","yml"]},default:{icon:{name:"resource-type-file",color:"var(--oc-role-on-surface)"},extensions:["accdb","rss","swf"]},drawio:{icon:{name:"resource-type-drawio",color:"var(--oc-color-icon-drawio)"},extensions:["drawio"]},document:{icon:{name:"resource-type-document",color:"var(--oc-color-icon-document)"},extensions:["doc","docm","docx","dot","dotx","lwp","odt","one","vsd","wpd"]},ifc:{icon:{name:"resource-type-ifc",color:"var(--oc-color-icon-ifc)"},extensions:["ifc"]},ipynb:{icon:{name:"resource-type-jupyter",color:"var(--oc-color-icon-jupyter)"},extensions:["ipynb"]},image:{icon:{name:"resource-type-image",color:"var(--oc-color-icon-image)"},extensions:["ai","cdr","eot","eps","gif","jpeg","jpg","otf","pfb","png","ps","psd","svg","ttf","webp","woff","xcf"]},form:{icon:{name:"resource-type-form",color:"var(--oc-color-icon-form)"},extensions:["docf","docxf","oform"]},markdown:{icon:{name:"resource-type-markdown",color:"var(--oc-color-icon-markdown)"},extensions:["md","markdown"]},odg:{icon:{name:"resource-type-graphic",color:"var(--oc-color-icon-graphic)"},extensions:["odg"]},pdf:{icon:{name:"resource-type-pdf",color:"var(--oc-color-icon-pdf)"},extensions:["pdf"]},presentation:{icon:{name:"resource-type-presentation",color:"var(--oc-color-icon-presentation)"},extensions:["odp","otp","pot","potm","potx","ppa","ppam","pps","ppsm","ppsx","ppt","pptm","pptx"]},root:{icon:{name:"resource-type-root",color:"var(--oc-color-icon-root)"},extensions:["root"]},spreadsheet:{icon:{name:"resource-type-spreadsheet",color:"var(--oc-color-icon-spreadsheet)"},extensions:["csv","ods","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx"]},text:{icon:{name:"resource-type-text",color:"var(--oc-role-on-surface)"},extensions:["cb7","cba","cbr","cbt","cbtc","cbz","cvbdl","eml","mdb","tex","txt"]},url:{icon:{name:"resource-type-url",color:"var(--oc-role-on-surface)"},extensions:["url"]},video:{icon:{name:"resource-type-video",color:"var(--oc-color-icon-video)"},extensions:["mov","mp4","webm","wmv"]},epub:{icon:{name:"resource-type-book",color:"var(--oc-color-icon-epub)"},extensions:["epub"]},board:{icon:{name:"resource-type-board"},extensions:["ggs"]},notes:{icon:{name:"resource-type-sticky-note",color:"var(--oc-color-icon-notes)"},extensions:["ocnb"]}};function fd(){const e={};return Object.values(zv).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}const pd=({resourcesStore:e,parentFolderId:t})=>{const n=e.currentFolder;if(!n||!n.id)return!1;if(z.extractNodeId(n.id)){if(n.id!==t)return!1}else{const r=n.id.split("$")[1];if(`${n.id}!${r}`!==t)return!1}return!0};function za(e,t,n){return t.name=We.basename(n),t.path=n,t.webDavPath=We.join(e.webDavPath,n),t.extension=z.extractExtensionFromFile(t),t}function Vv(){this.__data__=[],this.size=0}function js(e,t){return e===t||e!==e&&t!==t}function ei(e,t){for(var n=e.length;n--;)if(js(e[n][0],t))return n;return-1}var Uv=Array.prototype,qv=Uv.splice;function Hv(e){var t=this.__data__,n=ei(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():qv.call(t,n,1),--this.size,!0}function Wv(e){var t=this.__data__,n=ei(t,e);return n<0?void 0:t[n][1]}function Qv(e){return ei(this.__data__,e)>-1}function Kv(e,t){var n=this.__data__,r=ei(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Qn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qn.prototype.clear=Vv,Qn.prototype.delete=Hv,Qn.prototype.get=Wv,Qn.prototype.has=Qv,Qn.prototype.set=Kv;function Gv(){this.__data__=new Qn,this.size=0}function Jv(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Xv(e){return this.__data__.get(e)}function Yv(e){return this.__data__.has(e)}const mr=globalThis||void 0||self;var hd=typeof mr=="object"&&mr&&mr.Object===Object&&mr,Zv=typeof self=="object"&&self&&self.Object===Object&&self,Rn=hd||Zv||Function("return this")(),en=Rn.Symbol,md=Object.prototype,eb=md.hasOwnProperty,tb=md.toString,zs=en?en.toStringTag:void 0;function nb(e){var t=eb.call(e,zs),n=e[zs];try{e[zs]=void 0;var r=!0}catch{}var s=tb.call(e);return r&&(t?e[zs]=n:delete e[zs]),s}var rb=Object.prototype,sb=rb.toString;function ob(e){return sb.call(e)}var ib="[object Null]",ab="[object Undefined]",gd=en?en.toStringTag:void 0;function $r(e){return e==null?e===void 0?ab:ib:gd&&gd in Object(e)?nb(e):ob(e)}function En(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var lb="[object AsyncFunction]",cb="[object Function]",ub="[object GeneratorFunction]",db="[object Proxy]";function Va(e){if(!En(e))return!1;var t=$r(e);return t==cb||t==ub||t==lb||t==db}var Ua=Rn["__core-js_shared__"],yd=(function(){var e=/[^.]+$/.exec(Ua&&Ua.keys&&Ua.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function fb(e){return!!yd&&yd in e}var pb=Function.prototype,hb=pb.toString;function Or(e){if(e!=null){try{return hb.call(e)}catch{}try{return e+""}catch{}}return""}var mb=/[\\^$.*+?()[\]{}|]/g,gb=/^\[object .+?Constructor\]$/,yb=Function.prototype,vb=Object.prototype,bb=yb.toString,wb=vb.hasOwnProperty,Sb=RegExp("^"+bb.call(wb).replace(mb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kb(e){if(!En(e)||fb(e))return!1;var t=Va(e)?Sb:gb;return t.test(Or(e))}function Cb(e,t){return e?.[t]}function Lr(e,t){var n=Cb(e,t);return kb(n)?n:void 0}var Vs=Lr(Rn,"Map"),Us=Lr(Object,"create");function Tb(){this.__data__=Us?Us(null):{},this.size=0}function xb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ab="__lodash_hash_undefined__",Rb=Object.prototype,Eb=Rb.hasOwnProperty;function Db(e){var t=this.__data__;if(Us){var n=t[e];return n===Ab?void 0:n}return Eb.call(t,e)?t[e]:void 0}var Fb=Object.prototype,Ib=Fb.hasOwnProperty;function Pb(e){var t=this.__data__;return Us?t[e]!==void 0:Ib.call(t,e)}var $b="__lodash_hash_undefined__";function Ob(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Us&&t===void 0?$b:t,this}function _r(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_r.prototype.clear=Tb,_r.prototype.delete=xb,_r.prototype.get=Db,_r.prototype.has=Pb,_r.prototype.set=Ob;function Lb(){this.size=0,this.__data__={hash:new _r,map:new(Vs||Qn),string:new _r}}function _b(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ti(e,t){var n=e.__data__;return _b(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Mb(e){var t=ti(this,e).delete(e);return this.size-=t?1:0,t}function Nb(e){return ti(this,e).get(e)}function Bb(e){return ti(this,e).has(e)}function jb(e,t){var n=ti(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Kn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Kn.prototype.clear=Lb,Kn.prototype.delete=Mb,Kn.prototype.get=Nb,Kn.prototype.has=Bb,Kn.prototype.set=jb;var zb=200;function Vb(e,t){var n=this.__data__;if(n instanceof Qn){var r=n.__data__;if(!Vs||r.length<zb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Kn(r)}return n.set(e,t),this.size=n.size,this}function Dn(e){var t=this.__data__=new Qn(e);this.size=t.size}Dn.prototype.clear=Gv,Dn.prototype.delete=Jv,Dn.prototype.get=Xv,Dn.prototype.has=Yv,Dn.prototype.set=Vb;var ni=(function(){try{var e=Lr(Object,"defineProperty");return e({},"",{}),e}catch{}})();function qa(e,t,n){t=="__proto__"&&ni?ni(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ha(e,t,n){(n!==void 0&&!js(e[t],n)||n===void 0&&!(t in e))&&qa(e,t,n)}function Ub(e){return function(t,n,r){for(var s=-1,o=Object(t),i=r(t),l=i.length;l--;){var u=i[++s];if(n(o[u],u,o)===!1)break}return t}}var qb=Ub(),vd=typeof x=="object"&&x&&!x.nodeType&&x,bd=vd&&typeof module=="object"&&module&&!module.nodeType&&module,Hb=bd&&bd.exports===vd,wd=Hb?Rn.Buffer:void 0,Sd=wd?wd.allocUnsafe:void 0;function kd(e,t){if(t)return e.slice();var n=e.length,r=Sd?Sd(n):new e.constructor(n);return e.copy(r),r}var ri=Rn.Uint8Array;function Wa(e){var t=new e.constructor(e.byteLength);return new ri(t).set(new ri(e)),t}function Cd(e,t){var n=t?Wa(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Wb(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Td=Object.create,Qb=(function(){function e(){}return function(t){if(!En(t))return{};if(Td)return Td(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function xd(e,t){return function(n){return e(t(n))}}var Qa=xd(Object.getPrototypeOf,Object),Kb=Object.prototype;function Ka(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Kb;return e===n}function Gb(e){return typeof e.constructor=="function"&&!Ka(e)?Qb(Qa(e)):{}}function Fn(e){return e!=null&&typeof e=="object"}var Jb="[object Arguments]";function Ad(e){return Fn(e)&&$r(e)==Jb}var Rd=Object.prototype,Xb=Rd.hasOwnProperty,Yb=Rd.propertyIsEnumerable,si=Ad((function(){return arguments})())?Ad:function(e){return Fn(e)&&Xb.call(e,"callee")&&!Yb.call(e,"callee")},mn=Array.isArray,Zb=9007199254740991;function Ed(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Zb}function oi(e){return e!=null&&Ed(e.length)&&!Va(e)}function ew(e){return Fn(e)&&oi(e)}function tw(){return!1}var Dd=typeof x=="object"&&x&&!x.nodeType&&x,Fd=Dd&&typeof module=="object"&&module&&!module.nodeType&&module,nw=Fd&&Fd.exports===Dd,Id=nw?Rn.Buffer:void 0,rw=Id?Id.isBuffer:void 0,qs=rw||tw,sw="[object Object]",ow=Function.prototype,iw=Object.prototype,Pd=ow.toString,aw=iw.hasOwnProperty,lw=Pd.call(Object);function Ga(e){if(!Fn(e)||$r(e)!=sw)return!1;var t=Qa(e);if(t===null)return!0;var n=aw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Pd.call(n)==lw}var cw="[object Arguments]",uw="[object Array]",dw="[object Boolean]",fw="[object Date]",pw="[object Error]",hw="[object Function]",mw="[object Map]",gw="[object Number]",yw="[object Object]",vw="[object RegExp]",bw="[object Set]",ww="[object String]",Sw="[object WeakMap]",kw="[object ArrayBuffer]",Cw="[object DataView]",Tw="[object Float32Array]",xw="[object Float64Array]",Aw="[object Int8Array]",Rw="[object Int16Array]",Ew="[object Int32Array]",Dw="[object Uint8Array]",Fw="[object Uint8ClampedArray]",Iw="[object Uint16Array]",Pw="[object Uint32Array]",nt={};nt[Tw]=nt[xw]=nt[Aw]=nt[Rw]=nt[Ew]=nt[Dw]=nt[Fw]=nt[Iw]=nt[Pw]=!0,nt[cw]=nt[uw]=nt[kw]=nt[dw]=nt[Cw]=nt[fw]=nt[pw]=nt[hw]=nt[mw]=nt[gw]=nt[yw]=nt[vw]=nt[bw]=nt[ww]=nt[Sw]=!1;function $w(e){return Fn(e)&&Ed(e.length)&&!!nt[$r(e)]}function Ja(e){return function(t){return e(t)}}var $d=typeof x=="object"&&x&&!x.nodeType&&x,Hs=$d&&typeof module=="object"&&module&&!module.nodeType&&module,Ow=Hs&&Hs.exports===$d,Xa=Ow&&hd.process,is=(function(){try{var e=Hs&&Hs.require&&Hs.require("util").types;return e||Xa&&Xa.binding&&Xa.binding("util")}catch{}})(),Od=is&&is.isTypedArray,Ya=Od?Ja(Od):$w;function Za(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Lw=Object.prototype,_w=Lw.hasOwnProperty;function Ld(e,t,n){var r=e[t];(!(_w.call(e,t)&&js(r,n))||n===void 0&&!(t in e))&&qa(e,t,n)}function _d(e,t,n,r){var s=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var l=t[o],u=void 0;u===void 0&&(u=e[l]),s?qa(n,l,u):Ld(n,l,u)}return n}function Mw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Nw=9007199254740991,Bw=/^(?:0|[1-9]\d*)$/;function Md(e,t){var n=typeof e;return t=t??Nw,!!t&&(n=="number"||n!="symbol"&&Bw.test(e))&&e>-1&&e%1==0&&e<t}var jw=Object.prototype,zw=jw.hasOwnProperty;function Nd(e,t){var n=mn(e),r=!n&&si(e),s=!n&&!r&&qs(e),o=!n&&!r&&!s&&Ya(e),i=n||r||s||o,l=i?Mw(e.length,String):[],u=l.length;for(var d in e)(t||zw.call(e,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Md(d,u)))&&l.push(d);return l}function Vw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Uw=Object.prototype,qw=Uw.hasOwnProperty;function Hw(e){if(!En(e))return Vw(e);var t=Ka(e),n=[];for(var r in e)r=="constructor"&&(t||!qw.call(e,r))||n.push(r);return n}function el(e){return oi(e)?Nd(e,!0):Hw(e)}function Ww(e){return _d(e,el(e))}function Qw(e,t,n,r,s,o,i){var l=Za(e,n),u=Za(t,n),d=i.get(u);if(d){Ha(e,n,d);return}var c=o?o(l,u,n+"",e,t,i):void 0,f=c===void 0;if(f){var p=mn(u),h=!p&&qs(u),g=!p&&!h&&Ya(u);c=u,p||h||g?mn(l)?c=l:ew(l)?c=Wb(l):h?(f=!1,c=kd(u,!0)):g?(f=!1,c=Cd(u,!0)):c=[]:Ga(u)||si(u)?(c=l,si(l)?c=Ww(l):(!En(l)||Va(l))&&(c=Gb(u))):f=!1}f&&(i.set(u,c),s(c,u,r,o,i),i.delete(u)),Ha(e,n,c)}function Bd(e,t,n,r,s){e!==t&&qb(t,function(o,i){if(s||(s=new Dn),En(o))Qw(e,t,i,n,Bd,r,s);else{var l=r?r(Za(e,i),o,i+"",e,t,s):void 0;l===void 0&&(l=o),Ha(e,i,l)}},el)}function jd(e){return e}function Kw(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var zd=Math.max;function Vd(e,t,n){return t=zd(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,o=zd(r.length-t,0),i=Array(o);++s<o;)i[s]=r[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=r[s];return l[t]=n(i),Kw(e,this,l)}}function Gw(e){return function(){return e}}var Jw=ni?function(e,t){return ni(e,"toString",{configurable:!0,enumerable:!1,value:Gw(t),writable:!0})}:jd,Xw=800,Yw=16,Zw=Date.now;function eS(e){var t=0,n=0;return function(){var r=Zw(),s=Yw-(r-n);if(n=r,s>0){if(++t>=Xw)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ud=eS(Jw);function tS(e,t){return Ud(Vd(e,t,jd),e+"")}function nS(e,t,n){if(!En(n))return!1;var r=typeof t;return(r=="number"?oi(n)&&Md(t,n.length):r=="string"&&t in n)?js(n[t],e):!1}function rS(e){return tS(function(t,n){var r=-1,s=n.length,o=s>1?n[s-1]:void 0,i=s>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,i&&nS(n[0],n[1],i)&&(o=s<3?void 0:o,s=1),t=Object(t);++r<s;){var l=n[r];l&&e(t,l,r,o)}return t})}var Ws=rS(function(e,t,n){Bd(e,t,n)});const tl=(e,...t)=>{const{href:n}=e.resolve(a(e.currentRoute));return t.map(r=>{const{href:s}=e.resolve({...r});return s==="/"||s==="#/"?!1:n.startsWith(s)}).some(Boolean)},as=(...e)=>(t,...n)=>{if(!n.length)return tl(t,...e);const[r,...s]=n.map(o=>{const i=e.find(l=>l.name===o);if(!i)throw new Error(`unknown comparative '${o}'`);return i});return tl(t,r,...s)};function $$(e){return e}const ls=(e,...t)=>Ws({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),cs=(e,t={})=>ls(e,t),qd=cs("files-common-favorites"),Hd=cs("files-common-search"),mt=as(qd,Hd),sS=e=>[{path:"/search",component:e.App,children:[{name:Hd.name,path:"list/:page?",component:e.SearchResults,meta:{authContext:"user",title:"Search results",contextQueryItems:["term","provider","q_tags","q_lastModified","q_titleOnly","q_mediaType","scope","useScope","sort-by","sort-dir"]}}]},{path:"/favorites",component:e.App,children:[{name:qd.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],gn=(e,t={})=>ls(e,t),Wd=gn("files-spaces-projects"),nl=gn("files-spaces-generic"),rt=as(Wd,nl),oS=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:Wd.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:nl.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],tn=(e,t={})=>ls(e,t),iS=tn("files-shares"),ii=tn("files-shares-with-me"),rl=tn("files-shares-with-others"),sl=tn("files-shares-via-link"),pt=as(ii,rl,sl),aS=e=>[{name:iS.name,path:"/shares",component:e.App,redirect:ii,children:[{name:ii.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:rl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:sl.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],us=(e,t={})=>ls(e,t),ol=us("files-public-link"),il=us("files-public-upload"),nn=as(ol,il),lS=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:ol.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:il.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],gr=(e,t={})=>ls(e,t),Qd=gr("files-trash-generic"),Kd=gr("files-trash-overview"),jt=as(Qd,Kd),cS=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:Kd.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:Qd.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function Gd(e){return{applicationConfig:T(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const uS=["anonymous","user","idp","publicLink","hybrid"],Gn=e=>Un(e),Ae=()=>Gn("$router"),yt=()=>Ae().currentRoute,al=e=>e.path.split("/")[1],Jd=()=>{const e=yt();return T(()=>al(a(e)))},In=(e,t={},n)=>{const r=n?.configStore||Qe();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...z.isShareSpaceResource(e)&&{shareId:e.id},...r?.options?.routing?.idBased&&!et.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},dS=(e,t)=>{const n=document.querySelector("base"),r=!!n,s=new URL(window.location.href.split("#")[0]);return s.search="",r?s.pathname=new URL(n.href).pathname:s.pathname.endsWith("/index.html")&&(s.pathname=s.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?s.pathname=[...s.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):s[r?"pathname":"hash"]=e.resolve(t).href,s.href},Pn=ve.defineStore("apps",()=>{const e=H({}),t=H({}),n=H([]),r=T(()=>Object.keys(a(e))),s=(u,d)=>{u.id&&(u.extensions&&u.extensions.forEach(c=>{o({appId:u.id,data:c})}),a(e)[u.id]={defaultExtension:u.defaultExtension||"",icon:"check_box_outline_blank",name:u.name||u.id,translations:d,...u})},o=({appId:u,data:d})=>{a(n).push({...d,app:u,hasPriority:d.hasPriority||a(t)?.[u]?.priorityExtensions?.includes(d.extension)||!1,secureView:d.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:s,registerFileExtension:o,loadExternalAppConfig:({appId:u,config:d})=>{t.value={...a(t),[u]:d}},isAppEnabled:u=>a(r).includes(u)}}),yr=ve.defineStore("auth",()=>{const e=H(),t=H(),n=H(!1),r=H(!1),s=H(),o=H(),i=H(),l=H(!1),u=m=>{e.value=m},d=m=>{t.value=m},c=m=>{n.value=m},f=m=>{r.value=m},p=m=>{s.value=m.publicLinkToken,o.value=m.publicLinkPassword,i.value=m.publicLinkType,l.value=m.publicLinkContextReady};return{accessToken:e,sessionId:t,idpContextReady:n,userContextReady:r,publicLinkToken:s,publicLinkPassword:o,publicLinkType:i,publicLinkContextReady:l,setAccessToken:u,setSessionId:d,setIdpContextReady:c,setUserContextReady:f,setPublicLinkContext:p,clearUserContext:()=>{u(null),d(null),c(null),f(null)},clearPublicLinkContext:()=>{p({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),Xd={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultAppId:"files",disabledExtensions:[],disableFeedbackLink:!1,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},Qe=ve.defineStore("config",()=>{const e=Pn(),t=H(""),n=H(""),r=H({...Xd}),s=H([]),o=H([]),i=H([]),l=H(),u=H(),d=H(),c=H([]),f=H([]),p=T(()=>z.urlJoin(a(t)||window.location.origin,{trailingSlash:!0})),h=T(()=>z.urlJoin(a(p),"groupware",{trailingSlash:!0})),g=T(()=>!!a(l)),m=T(()=>!!a(u));return{options:r,oAuth2:l,openIdConnect:u,isOAuth2:g,isOIDC:m,customTranslations:i,apps:s,externalApps:o,sentry:d,theme:n,scripts:c,styles:f,serverUrl:p,groupwareUrl:h,loadConfig:S=>{S.server&&(t.value=S.server?.endsWith("/")?S.server:S.server+"/"),s.value=S.apps||[],i.value=S.customTranslations||[],l.value=S.auth,u.value=S.openIdConnect,d.value=S.sentry,c.value=S.scripts||[],f.value=S.styles||[],n.value=S.theme,S.options&&(r.value=Ws({...Xd},S.options),a(r).ocm.openRemotely=a(r).cernFeatures,a(r).routing.idBased=!a(r).cernFeatures,a(r).routing.fullShareOwnerPaths=a(r).cernFeatures),S.external_apps&&(o.value=S.external_apps,S.external_apps.filter(Boolean).forEach(k=>{e.loadExternalAppConfig({appId:k.id,config:k.config})}))}}}),fS=G.z.object({url:G.z.string()}),pS=G.z.object({apiUrl:G.z.string().optional(),authUrl:G.z.string().optional(),clientId:G.z.string().optional(),clientSecret:G.z.string().optional(),logoutUrl:G.z.string().optional(),metaDataUrl:G.z.string().optional(),url:G.z.string().optional()}),hS=G.z.object({authority:G.z.string().optional(),client_id:G.z.string().optional(),client_secret:G.z.string().optional(),dynamic:G.z.string().optional(),metadata_url:G.z.string().optional(),post_logout_redirect_uri:G.z.string().optional(),response_type:G.z.string().optional(),scope:G.z.string().optional()}).passthrough(),mS=G.z.record(G.z.any(),G.z.any()),gS=G.z.object({href:G.z.string().optional()}),yS=G.z.object({async:G.z.boolean().optional(),src:G.z.string().optional()}),vS=G.z.object({cernFeatures:G.z.boolean().optional(),concurrentRequests:G.z.object({resourceBatchActions:G.z.number().optional(),sse:G.z.number().optional(),shares:G.z.object({create:G.z.number().optional(),list:G.z.number().optional()}).optional(),avatars:G.z.number().optional()}).optional(),contextHelpers:G.z.boolean().optional(),contextHelpersReadMore:G.z.boolean().optional(),defaultAppId:G.z.string().optional(),disabledExtensions:G.z.array(G.z.string()).optional(),disableFeedbackLink:G.z.boolean().optional(),accountEditLink:G.z.object({href:G.z.string().optional()}).optional(),editor:G.z.object({autosaveEnabled:G.z.boolean().optional(),autosaveInterval:G.z.number().optional(),openAsPreview:G.z.union([G.z.boolean(),G.z.array(G.z.string())]).optional()}).optional(),embed:G.z.object({enabled:G.z.boolean().optional(),target:G.z.string().optional(),messagesOrigin:G.z.string().optional(),delegateAuthentication:G.z.boolean().optional(),delegateAuthenticationOrigin:G.z.string().optional(),fileTypes:G.z.array(G.z.string()).optional(),chooseFileName:G.z.boolean().optional(),chooseFileNameSuggestion:G.z.string().optional()}).optional(),feedbackLink:G.z.object({ariaLabel:G.z.string().optional(),description:G.z.string().optional(),href:G.z.string().optional()}).optional(),isRunningOnEos:G.z.boolean().optional(),loginUrl:G.z.string().optional(),logoutUrl:G.z.string().optional(),ocm:G.z.object({openRemotely:G.z.boolean().optional()}).optional(),routing:G.z.object({fullShareOwnerPaths:G.z.boolean().optional(),idBased:G.z.boolean().optional()}).optional(),runningOnEos:G.z.boolean().optional(),tokenStorageLocal:G.z.boolean().optional(),upload:G.z.object({companionUrl:G.z.string().optional()}).optional(),userListRequiresFilter:G.z.boolean().optional(),hideLogo:G.z.boolean().optional()}),bS=G.z.object({id:G.z.string(),path:G.z.string(),config:G.z.record(G.z.string(),G.z.unknown()).optional()}),wS=G.z.object({server:G.z.string(),theme:G.z.string(),options:vS,apps:G.z.array(G.z.string()).optional(),external_apps:G.z.array(bS).optional(),customTranslations:G.z.array(fS).optional(),auth:pS.optional(),openIdConnect:hS.optional(),sentry:mS.optional(),scripts:G.z.array(yS).optional(),styles:G.z.array(gS).optional()}),ai=ve.defineStore("avatars",()=>{const e=Qe(),t=H({}),n=Kc(new sr({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:u=>a(t)[u],addAvatar:(u,d)=>{t.value[u]=d},removeAvatar:u=>{t.value[u]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),Yd={core:{"support-sse":!1},dav:{},files:{app_providers:[],favorites:!1,permanent_deletion:!0,tags:!1,privateLinks:!1,tus_support:{extension:"",http_method_override:!1,max_chunk_size:0}},files_sharing:{allow_custom:!0,api_enabled:!0,can_rename:!0,deny_access:!1,public:{alias:!1,can_contribute:!0,can_edit:!1,default_permissions:z.SharePermissionBit.Read,enabled:!0,password:{enforced_for:{read_only:!1,upload_only:!1,read_write:!1}}}},graph:{"personal-data-export":!1,users:{change_password_self_disabled:!0,create_disabled:!1,delete_disabled:!1,read_only_attributes:[],edit_login_allowed_disabled:!1}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},Ct=ve.defineStore("capabilities",()=>{const e=H(!1),t=H(Yd),n=$e=>{t.value=Ws({...Yd},$e.capabilities),e.value=!0},r=T(()=>a(t).core["support-sse"]),s=T(()=>a(t).core["support-radicale"]),o=T(()=>a(t).graph["personal-data-export"]),i=T(()=>a(t).core.status),l=T(()=>a(t).dav.reports),u=T(()=>a(t).dav.trashbin),d=T(()=>a(t).spaces.max_quota),c=T(()=>a(t).spaces.projects),f=T(()=>a(t).graph.users.create_disabled),p=T(()=>a(t).graph.users.delete_disabled),h=T(()=>a(t).graph.users.change_password_self_disabled),g=T(()=>a(t).graph.users.read_only_attributes),m=T(()=>a(t).graph.users.edit_login_allowed_disabled),b=T(()=>a(t).files.app_providers),S=T(()=>a(t).files.favorites),k=T(()=>a(t).files.archivers),w=T(()=>a(t).files.privateLinks),C=T(()=>a(t).files.permanent_deletion),A=T(()=>a(t).files.tags),I=T(()=>a(t).files.undelete),N=T(()=>a(t).files_sharing.api_enabled),_=T(()=>a(t).files_sharing.can_rename),F=T(()=>a(t).files_sharing.allow_custom),V=T(()=>a(t).files_sharing.public?.enabled),Z=T(()=>a(t).files_sharing.public?.can_edit),P=T(()=>a(t).files_sharing.public?.can_contribute),$=T(()=>a(t).files_sharing.public?.alias),L=T(()=>a(t).files_sharing.public?.default_permissions),M=T(()=>a(t).files_sharing.public?.password.enforced_for),j=T(()=>a(t).files_sharing.search_min_length),B=T(()=>a(t).files_sharing.user?.profile_picture),q=T(()=>a(t).files.tus_support?.max_chunk_size),re=T(()=>a(t).files.tus_support?.extension),J=T(()=>a(t).files.tus_support?.http_method_override),oe=T(()=>a(t).notifications["ocs-endpoints"]),ne=T(()=>a(t).password_policy),pe=T(()=>a(t).search.property?.mtime),fe=T(()=>a(t).search.property?.mediatype),we=T(()=>a(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:n,status:i,supportSSE:r,supportRadicale:s,personalDataExport:o,davReports:l,davTrashbin:u,spacesMaxQuota:d,spacesProjects:c,graphUsersCreateDisabled:f,graphUsersDeleteDisabled:p,graphUsersChangeSelfPasswordDisabled:h,graphUsersEditLoginAllowedDisabled:m,graphUsersReadOnlyAttributes:g,filesAppProviders:b,filesFavorites:S,filesArchivers:k,filesPrivateLinks:w,filesPermanentDeletion:C,filesTags:A,filesUndelete:I,sharingApiEnabled:N,sharingCanRename:_,sharingAllowCustom:F,sharingPublicEnabled:V,sharingPublicCanEdit:Z,sharingPublicCanContribute:P,sharingPublicAlias:$,sharingPublicDefaultPermissions:L,sharingPublicPasswordEnforcedFor:M,sharingSearchMinLength:j,sharingUserProfilePicture:B,tusMaxChunkSize:q,tusExtension:re,tusHttpMethodOverride:J,notificationsOcsEndpoints:oe,passwordPolicy:ne,searchLastMofifiedDate:pe,searchMediaType:fe,searchContent:we}});class SS{value;expires;constructor(t,n){this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class Zd{map;ttl;capacity;constructor(t){this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,n,r){return this.evict(),this.map.set(t,new SS(n,isNaN(r)?this.ttl:r)),n}get(t){this.evict();const n=this.map.get(t);if(n)return n.value}delete(t){return this.map.delete(t)}clear(){return this.map.clear()}entries(){return this.evict(),[...this.map.entries()].map(t=>[t[0],t[1].value])}keys(){return this.evict(),[...this.map.keys()]}has(t){return this.evict(),this.map.has(t)}values(){return this.evict(),[...this.map.values()].map(t=>t.value)}evict(){if(this.map.forEach((t,n)=>{t.expired&&this.delete(n)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const li=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const s=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!s)return null;const{id:o}=s;return e.driveItems.getDriveItem(o.split("!")[0],o)},kS=({sharedAncestor:e,matchingSpace:t})=>t?gn("files-spaces-generic",In(t,{path:e.path,fileId:e.id})):{},ef=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{const s=r?.remoteItem?.permissions||[];if(!s.length)return;const o=[];s.forEach(i=>{if(i["@libre.graph.permissions.actions"]){o.push(...i["@libre.graph.permissions.actions"]);return}const l=e.graphRoles[i.roles[0]];if(!l)return;const u=l.rolePermissions.flatMap(d=>d.allowedResourceActions);o.push(...u)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(o)]})},CS=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()},ci=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},TS="thead-clicked",xS="highlight",AS="rowMounted",RS="contextmenuClicked",tf="itemDropped",ES="itemDragged";let DS="";const FS=()=>DS,IS=e=>({"gap-0":e==="none","gap-0.5":e==="xsmall","gap-1":e==="small","gap-2":e==="medium","gap-4":e==="large","gap-5":e==="xlarge","gap-6":e==="xxlarge","gap-7":e==="xxxlarge"}),PS=e=>({"justify-start":e==="left","justify-center":e==="center","justify-end":e==="right","justify-around":e==="space-around","justify-between":e==="space-between","justify-evenly":e==="space-evenly"}),$S=e=>({"p-0":e==="remove","p-1":e==="xsmall","p-2":e==="small","p-4":e==="medium","p-6":e==="large","p-12":e==="xlarge","p-24":e==="xxlarge"});var Je=(e=>(e.Desc="desc",e.Asc="asc",e))(Je||{});let nf=0;const Mr=(e="")=>(e=e||"",nf+=1,e+nf),rf=e=>e?[{name:"name",sortable:!0,sortDir:Je.Asc},{name:"size",sortable:!0,sortDir:Je.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((n,r)=>n.shareType!==r.shareType?n.shareType<r.shareType?-1:1:n.displayName<r.displayName?-1:1).map(n=>n.displayName).join():!1,sortDir:Je.Asc},{name:"owner",sortable:"displayName",sortDir:Je.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Je.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Je.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Je.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function O$(e){return e}const sf=[{label:"A-Z",name:"name",sortable:!0,sortDir:Je.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Je.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Je.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Je.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Je.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Je.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Je.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Je.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Je.Desc}],OS=e=>e?sf.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],LS=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),_S=G.z.object({icon:G.z.string(),name:G.z.string(),secure_view:G.z.boolean().optional().default(!1),target_ext:G.z.string().optional()}),MS=G.z.object({allow_creation:G.z.boolean().optional(),app_providers:G.z.array(_S),default_application:G.z.string().optional(),description:G.z.string().optional(),ext:G.z.string().optional(),mime_type:G.z.string(),name:G.z.string().optional()}),of=G.z.object({"mime-types":G.z.array(MS)});class NS{_mimeTypes=H([]);serverUrl;clientService;constructor(t,n){this.serverUrl=t,this.clientService=n}async loadData(){const t=z.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:of});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return a(this._mimeTypes)}get templateMimeTypes(){return a(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(a(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return a(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var af={},ui={};ui.byteLength=zS,ui.toByteArray=US,ui.fromByteArray=WS;for(var $n=[],rn=[],BS=typeof Uint8Array<"u"?Uint8Array:Array,ll="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ds=0,jS=ll.length;ds<jS;++ds)$n[ds]=ll[ds],rn[ll.charCodeAt(ds)]=ds;rn[45]=62,rn[95]=63;function lf(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function zS(e){var t=lf(e),n=t[0],r=t[1];return(n+r)*3/4-r}function VS(e,t,n){return(t+n)*3/4-n}function US(e){var t,n=lf(e),r=n[0],s=n[1],o=new BS(VS(e,r,s)),i=0,l=s>0?r-4:r,u;for(u=0;u<l;u+=4)t=rn[e.charCodeAt(u)]<<18|rn[e.charCodeAt(u+1)]<<12|rn[e.charCodeAt(u+2)]<<6|rn[e.charCodeAt(u+3)],o[i++]=t>>16&255,o[i++]=t>>8&255,o[i++]=t&255;return s===2&&(t=rn[e.charCodeAt(u)]<<2|rn[e.charCodeAt(u+1)]>>4,o[i++]=t&255),s===1&&(t=rn[e.charCodeAt(u)]<<10|rn[e.charCodeAt(u+1)]<<4|rn[e.charCodeAt(u+2)]>>2,o[i++]=t>>8&255,o[i++]=t&255),o}function qS(e){return $n[e>>18&63]+$n[e>>12&63]+$n[e>>6&63]+$n[e&63]}function HS(e,t,n){for(var r,s=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),s.push(qS(r));return s.join("")}function WS(e){for(var t,n=e.length,r=n%3,s=[],o=16383,i=0,l=n-r;i<l;i+=o)s.push(HS(e,i,i+o>l?l:i+o));return r===1?(t=e[n-1],s.push($n[t>>2]+$n[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],s.push($n[t>>10]+$n[t>>4&63]+$n[t<<2&63]+"=")),s.join("")}var cl={};cl.read=function(e,t,n,r,s){var o,i,l=s*8-r-1,u=(1<<l)-1,d=u>>1,c=-7,f=n?s-1:0,p=n?-1:1,h=e[t+f];for(f+=p,o=h&(1<<-c)-1,h>>=-c,c+=l;c>0;o=o*256+e[t+f],f+=p,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=r;c>0;i=i*256+e[t+f],f+=p,c-=8);if(o===0)o=1-d;else{if(o===u)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),o=o-d}return(h?-1:1)*i*Math.pow(2,o-r)},cl.write=function(e,t,n,r,s,o){var i,l,u,d=o*8-s-1,c=(1<<d)-1,f=c>>1,p=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,g=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),i+f>=1?t+=p/u:t+=p*Math.pow(2,1-f),t*u>=2&&(i++,u/=2),i+f>=c?(l=0,i=c):i+f>=1?(l=(t*u-1)*Math.pow(2,s),i=i+f):(l=t*Math.pow(2,f-1)*Math.pow(2,s),i=0));s>=8;e[n+h]=l&255,h+=g,l/=256,s-=8);for(i=i<<s|l,d+=s;d>0;e[n+h]=i&255,h+=g,i/=256,d-=8);e[n+h-g]|=m*128};(function(e){const t=ui,n=cl,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s;const{Uint8Array:o,ArrayBuffer:i,SharedArrayBuffer:l}=globalThis;c.TYPED_ARRAY_SUPPORT=u(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const E=new o(1),y={foo:function(){return 42}};return Object.setPrototypeOf(y,o.prototype),Object.setPrototypeOf(E,y),E.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function d(E){if(E>s)throw new RangeError('The value "'+E+'" is invalid for option "size"');const y=new o(E);return Object.setPrototypeOf(y,c.prototype),y}function c(E,y,v){if(typeof E=="number"){if(typeof y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(E)}return f(E,y,v)}c.poolSize=8192;function f(E,y,v){if(typeof E=="string")return m(E,y);if(i.isView(E))return S(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(bt(E,i)||E&&bt(E.buffer,i)||typeof l<"u"&&(bt(E,l)||E&&bt(E.buffer,l)))return k(E,y,v);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const O=E.valueOf&&E.valueOf();if(O!=null&&O!==E)return c.from(O,y,v);const U=w(E);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return c.from(E[Symbol.toPrimitive]("string"),y,v);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}c.from=function(E,y,v){return f(E,y,v)},Object.setPrototypeOf(c.prototype,o.prototype),Object.setPrototypeOf(c,o);function p(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function h(E,y,v){return p(E),E<=0?d(E):y!==void 0?typeof v=="string"?d(E).fill(y,v):d(E).fill(y):d(E)}c.alloc=function(E,y,v){return h(E,y,v)};function g(E){return p(E),d(E<0?0:C(E)|0)}c.allocUnsafe=function(E){return g(E)},c.allocUnsafeSlow=function(E){return g(E)};function m(E,y){if((typeof y!="string"||y==="")&&(y="utf8"),!c.isEncoding(y))throw new TypeError("Unknown encoding: "+y);const v=I(E,y)|0;let O=d(v);const U=O.write(E,y);return U!==v&&(O=O.slice(0,U)),O}function b(E){const y=E.length<0?0:C(E.length)|0,v=d(y);for(let O=0;O<y;O+=1)v[O]=E[O]&255;return v}function S(E){if(bt(E,o)){const y=new o(E);return k(y.buffer,y.byteOffset,y.byteLength)}return b(E)}function k(E,y,v){if(y<0||E.byteLength<y)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<y+(v||0))throw new RangeError('"length" is outside of buffer bounds');let O;return y===void 0&&v===void 0?O=new o(E):v===void 0?O=new o(E,y):O=new o(E,y,v),Object.setPrototypeOf(O,c.prototype),O}function w(E){if(c.isBuffer(E)){const y=C(E.length)|0,v=d(y);return v.length===0||E.copy(v,0,0,y),v}if(E.length!==void 0)return typeof E.length!="number"||ln(E.length)?d(0):b(E);if(E.type==="Buffer"&&Array.isArray(E.data))return b(E.data)}function C(E){if(E>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return E|0}function A(E){return+E!=E&&(E=0),c.alloc(+E)}c.isBuffer=function(y){return y!=null&&y._isBuffer===!0&&y!==c.prototype},c.compare=function(y,v){if(bt(y,o)&&(y=c.from(y,y.offset,y.byteLength)),bt(v,o)&&(v=c.from(v,v.offset,v.byteLength)),!c.isBuffer(y)||!c.isBuffer(v))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(y===v)return 0;let O=y.length,U=v.length;for(let Y=0,se=Math.min(O,U);Y<se;++Y)if(y[Y]!==v[Y]){O=y[Y],U=v[Y];break}return O<U?-1:U<O?1:0},c.isEncoding=function(y){switch(String(y).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(y,v){if(!Array.isArray(y))throw new TypeError('"list" argument must be an Array of Buffers');if(y.length===0)return c.alloc(0);let O;if(v===void 0)for(v=0,O=0;O<y.length;++O)v+=y[O].length;const U=c.allocUnsafe(v);let Y=0;for(O=0;O<y.length;++O){let se=y[O];if(bt(se,o))Y+se.length>U.length?(c.isBuffer(se)||(se=c.from(se)),se.copy(U,Y)):o.prototype.set.call(U,se,Y);else if(c.isBuffer(se))se.copy(U,Y);else throw new TypeError('"list" argument must be an Array of Buffers');Y+=se.length}return U};function I(E,y){if(c.isBuffer(E))return E.length;if(i.isView(E)||bt(E,i))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const v=E.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&v===0)return 0;let U=!1;for(;;)switch(y){case"ascii":case"latin1":case"binary":return v;case"utf8":case"utf-8":return Fe(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v*2;case"hex":return v>>>1;case"base64":return xr(E).length;default:if(U)return O?-1:Fe(E).length;y=(""+y).toLowerCase(),U=!0}}c.byteLength=I;function N(E,y,v){let O=!1;if((y===void 0||y<0)&&(y=0),y>this.length||((v===void 0||v>this.length)&&(v=this.length),v<=0)||(v>>>=0,y>>>=0,v<=y))return"";for(E||(E="utf8");;)switch(E){case"hex":return ne(this,y,v);case"utf8":case"utf-8":return B(this,y,v);case"ascii":return J(this,y,v);case"latin1":case"binary":return oe(this,y,v);case"base64":return j(this,y,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,y,v);default:if(O)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),O=!0}}c.prototype._isBuffer=!0;function _(E,y,v){const O=E[y];E[y]=E[v],E[v]=O}c.prototype.swap16=function(){const y=this.length;if(y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let v=0;v<y;v+=2)_(this,v,v+1);return this},c.prototype.swap32=function(){const y=this.length;if(y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let v=0;v<y;v+=4)_(this,v,v+3),_(this,v+1,v+2);return this},c.prototype.swap64=function(){const y=this.length;if(y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let v=0;v<y;v+=8)_(this,v,v+7),_(this,v+1,v+6),_(this,v+2,v+5),_(this,v+3,v+4);return this},c.prototype.toString=function(){const y=this.length;return y===0?"":arguments.length===0?B(this,0,y):N.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(y){if(!c.isBuffer(y))throw new TypeError("Argument must be a Buffer");return this===y?!0:c.compare(this,y)===0},c.prototype.inspect=function(){let y="";const v=e.INSPECT_MAX_BYTES;return y=this.toString("hex",0,v).replace(/(.{2})/g,"$1 ").trim(),this.length>v&&(y+=" ... "),"<Buffer "+y+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(y,v,O,U,Y){if(bt(y,o)&&(y=c.from(y,y.offset,y.byteLength)),!c.isBuffer(y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof y);if(v===void 0&&(v=0),O===void 0&&(O=y?y.length:0),U===void 0&&(U=0),Y===void 0&&(Y=this.length),v<0||O>y.length||U<0||Y>this.length)throw new RangeError("out of range index");if(U>=Y&&v>=O)return 0;if(U>=Y)return-1;if(v>=O)return 1;if(v>>>=0,O>>>=0,U>>>=0,Y>>>=0,this===y)return 0;let se=Y-U,Ie=O-v;const le=Math.min(se,Ie),xe=this.slice(U,Y),qe=y.slice(v,O);for(let Be=0;Be<le;++Be)if(xe[Be]!==qe[Be]){se=xe[Be],Ie=qe[Be];break}return se<Ie?-1:Ie<se?1:0};function F(E,y,v,O,U){if(E.length===0)return-1;if(typeof v=="string"?(O=v,v=0):v>2147483647?v=2147483647:v<-2147483648&&(v=-2147483648),v=+v,ln(v)&&(v=U?0:E.length-1),v<0&&(v=E.length+v),v>=E.length){if(U)return-1;v=E.length-1}else if(v<0)if(U)v=0;else return-1;if(typeof y=="string"&&(y=c.from(y,O)),c.isBuffer(y))return y.length===0?-1:V(E,y,v,O,U);if(typeof y=="number")return y=y&255,typeof o.prototype.indexOf=="function"?U?o.prototype.indexOf.call(E,y,v):o.prototype.lastIndexOf.call(E,y,v):V(E,[y],v,O,U);throw new TypeError("val must be string, number or Buffer")}function V(E,y,v,O,U){let Y=1,se=E.length,Ie=y.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(E.length<2||y.length<2)return-1;Y=2,se/=2,Ie/=2,v/=2}function le(qe,Be){return Y===1?qe[Be]:qe.readUInt16BE(Be*Y)}let xe;if(U){let qe=-1;for(xe=v;xe<se;xe++)if(le(E,xe)===le(y,qe===-1?0:xe-qe)){if(qe===-1&&(qe=xe),xe-qe+1===Ie)return qe*Y}else qe!==-1&&(xe-=xe-qe),qe=-1}else for(v+Ie>se&&(v=se-Ie),xe=v;xe>=0;xe--){let qe=!0;for(let Be=0;Be<Ie;Be++)if(le(E,xe+Be)!==le(y,Be)){qe=!1;break}if(qe)return xe}return-1}c.prototype.includes=function(y,v,O){return this.indexOf(y,v,O)!==-1},c.prototype.indexOf=function(y,v,O){return F(this,y,v,O,!0)},c.prototype.lastIndexOf=function(y,v,O){return F(this,y,v,O,!1)};function Z(E,y,v,O){v=Number(v)||0;const U=E.length-v;O?(O=Number(O),O>U&&(O=U)):O=U;const Y=y.length;O>Y/2&&(O=Y/2);let se;for(se=0;se<O;++se){const Ie=parseInt(y.substr(se*2,2),16);if(ln(Ie))return se;E[v+se]=Ie}return se}function P(E,y,v,O){return kn(Fe(y,E.length-v),E,v,O)}function $(E,y,v,O){return kn(gt(y),E,v,O)}function L(E,y,v,O){return kn(xr(y),E,v,O)}function M(E,y,v,O){return kn(Qr(y,E.length-v),E,v,O)}c.prototype.write=function(y,v,O,U){if(v===void 0)U="utf8",O=this.length,v=0;else if(O===void 0&&typeof v=="string")U=v,O=this.length,v=0;else if(isFinite(v))v=v>>>0,isFinite(O)?(O=O>>>0,U===void 0&&(U="utf8")):(U=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Y=this.length-v;if((O===void 0||O>Y)&&(O=Y),y.length>0&&(O<0||v<0)||v>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let se=!1;for(;;)switch(U){case"hex":return Z(this,y,v,O);case"utf8":case"utf-8":return P(this,y,v,O);case"ascii":case"latin1":case"binary":return $(this,y,v,O);case"base64":return L(this,y,v,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,y,v,O);default:if(se)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),se=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(E,y,v){return y===0&&v===E.length?t.fromByteArray(E):t.fromByteArray(E.slice(y,v))}function B(E,y,v){v=Math.min(E.length,v);const O=[];let U=y;for(;U<v;){const Y=E[U];let se=null,Ie=Y>239?4:Y>223?3:Y>191?2:1;if(U+Ie<=v){let le,xe,qe,Be;switch(Ie){case 1:Y<128&&(se=Y);break;case 2:le=E[U+1],(le&192)===128&&(Be=(Y&31)<<6|le&63,Be>127&&(se=Be));break;case 3:le=E[U+1],xe=E[U+2],(le&192)===128&&(xe&192)===128&&(Be=(Y&15)<<12|(le&63)<<6|xe&63,Be>2047&&(Be<55296||Be>57343)&&(se=Be));break;case 4:le=E[U+1],xe=E[U+2],qe=E[U+3],(le&192)===128&&(xe&192)===128&&(qe&192)===128&&(Be=(Y&15)<<18|(le&63)<<12|(xe&63)<<6|qe&63,Be>65535&&Be<1114112&&(se=Be))}}se===null?(se=65533,Ie=1):se>65535&&(se-=65536,O.push(se>>>10&1023|55296),se=56320|se&1023),O.push(se),U+=Ie}return re(O)}const q=4096;function re(E){const y=E.length;if(y<=q)return String.fromCharCode.apply(String,E);let v="",O=0;for(;O<y;)v+=String.fromCharCode.apply(String,E.slice(O,O+=q));return v}function J(E,y,v){let O="";v=Math.min(E.length,v);for(let U=y;U<v;++U)O+=String.fromCharCode(E[U]&127);return O}function oe(E,y,v){let O="";v=Math.min(E.length,v);for(let U=y;U<v;++U)O+=String.fromCharCode(E[U]);return O}function ne(E,y,v){const O=E.length;(!y||y<0)&&(y=0),(!v||v<0||v>O)&&(v=O);let U="";for(let Y=y;Y<v;++Y)U+=vo[E[Y]];return U}function pe(E,y,v){const O=E.slice(y,v);let U="";for(let Y=0;Y<O.length-1;Y+=2)U+=String.fromCharCode(O[Y]+O[Y+1]*256);return U}c.prototype.slice=function(y,v){const O=this.length;y=~~y,v=v===void 0?O:~~v,y<0?(y+=O,y<0&&(y=0)):y>O&&(y=O),v<0?(v+=O,v<0&&(v=0)):v>O&&(v=O),v<y&&(v=y);const U=this.subarray(y,v);return Object.setPrototypeOf(U,c.prototype),U};function fe(E,y,v){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+y>v)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(y,v,O){y=y>>>0,v=v>>>0,O||fe(y,v,this.length);let U=this[y],Y=1,se=0;for(;++se<v&&(Y*=256);)U+=this[y+se]*Y;return U},c.prototype.readUintBE=c.prototype.readUIntBE=function(y,v,O){y=y>>>0,v=v>>>0,O||fe(y,v,this.length);let U=this[y+--v],Y=1;for(;v>0&&(Y*=256);)U+=this[y+--v]*Y;return U},c.prototype.readUint8=c.prototype.readUInt8=function(y,v){return y=y>>>0,v||fe(y,1,this.length),this[y]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(y,v){return y=y>>>0,v||fe(y,2,this.length),this[y]|this[y+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(y,v){return y=y>>>0,v||fe(y,2,this.length),this[y]<<8|this[y+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),(this[y]|this[y+1]<<8|this[y+2]<<16)+this[y+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),this[y]*16777216+(this[y+1]<<16|this[y+2]<<8|this[y+3])},c.prototype.readBigUInt64LE=cn(function(y){y=y>>>0,vt(y,"offset");const v=this[y],O=this[y+7];(v===void 0||O===void 0)&&Dt(y,this.length-8);const U=v+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24,Y=this[++y]+this[++y]*2**8+this[++y]*2**16+O*2**24;return BigInt(U)+(BigInt(Y)<<BigInt(32))}),c.prototype.readBigUInt64BE=cn(function(y){y=y>>>0,vt(y,"offset");const v=this[y],O=this[y+7];(v===void 0||O===void 0)&&Dt(y,this.length-8);const U=v*2**24+this[++y]*2**16+this[++y]*2**8+this[++y],Y=this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+O;return(BigInt(U)<<BigInt(32))+BigInt(Y)}),c.prototype.readIntLE=function(y,v,O){y=y>>>0,v=v>>>0,O||fe(y,v,this.length);let U=this[y],Y=1,se=0;for(;++se<v&&(Y*=256);)U+=this[y+se]*Y;return Y*=128,U>=Y&&(U-=Math.pow(2,8*v)),U},c.prototype.readIntBE=function(y,v,O){y=y>>>0,v=v>>>0,O||fe(y,v,this.length);let U=v,Y=1,se=this[y+--U];for(;U>0&&(Y*=256);)se+=this[y+--U]*Y;return Y*=128,se>=Y&&(se-=Math.pow(2,8*v)),se},c.prototype.readInt8=function(y,v){return y=y>>>0,v||fe(y,1,this.length),this[y]&128?(255-this[y]+1)*-1:this[y]},c.prototype.readInt16LE=function(y,v){y=y>>>0,v||fe(y,2,this.length);const O=this[y]|this[y+1]<<8;return O&32768?O|4294901760:O},c.prototype.readInt16BE=function(y,v){y=y>>>0,v||fe(y,2,this.length);const O=this[y+1]|this[y]<<8;return O&32768?O|4294901760:O},c.prototype.readInt32LE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),this[y]|this[y+1]<<8|this[y+2]<<16|this[y+3]<<24},c.prototype.readInt32BE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),this[y]<<24|this[y+1]<<16|this[y+2]<<8|this[y+3]},c.prototype.readBigInt64LE=cn(function(y){y=y>>>0,vt(y,"offset");const v=this[y],O=this[y+7];(v===void 0||O===void 0)&&Dt(y,this.length-8);const U=this[y+4]+this[y+5]*2**8+this[y+6]*2**16+(O<<24);return(BigInt(U)<<BigInt(32))+BigInt(v+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24)}),c.prototype.readBigInt64BE=cn(function(y){y=y>>>0,vt(y,"offset");const v=this[y],O=this[y+7];(v===void 0||O===void 0)&&Dt(y,this.length-8);const U=(v<<24)+this[++y]*2**16+this[++y]*2**8+this[++y];return(BigInt(U)<<BigInt(32))+BigInt(this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+O)}),c.prototype.readFloatLE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),n.read(this,y,!0,23,4)},c.prototype.readFloatBE=function(y,v){return y=y>>>0,v||fe(y,4,this.length),n.read(this,y,!1,23,4)},c.prototype.readDoubleLE=function(y,v){return y=y>>>0,v||fe(y,8,this.length),n.read(this,y,!0,52,8)},c.prototype.readDoubleBE=function(y,v){return y=y>>>0,v||fe(y,8,this.length),n.read(this,y,!1,52,8)};function we(E,y,v,O,U,Y){if(!c.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(y>U||y<Y)throw new RangeError('"value" argument is out of bounds');if(v+O>E.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(y,v,O,U){if(y=+y,v=v>>>0,O=O>>>0,!U){const Ie=Math.pow(2,8*O)-1;we(this,y,v,O,Ie,0)}let Y=1,se=0;for(this[v]=y&255;++se<O&&(Y*=256);)this[v+se]=y/Y&255;return v+O},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(y,v,O,U){if(y=+y,v=v>>>0,O=O>>>0,!U){const Ie=Math.pow(2,8*O)-1;we(this,y,v,O,Ie,0)}let Y=O-1,se=1;for(this[v+Y]=y&255;--Y>=0&&(se*=256);)this[v+Y]=y/se&255;return v+O},c.prototype.writeUint8=c.prototype.writeUInt8=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,1,255,0),this[v]=y&255,v+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,2,65535,0),this[v]=y&255,this[v+1]=y>>>8,v+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,2,65535,0),this[v]=y>>>8,this[v+1]=y&255,v+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,4,4294967295,0),this[v+3]=y>>>24,this[v+2]=y>>>16,this[v+1]=y>>>8,this[v]=y&255,v+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,4,4294967295,0),this[v]=y>>>24,this[v+1]=y>>>16,this[v+2]=y>>>8,this[v+3]=y&255,v+4};function $e(E,y,v,O,U){Kt(y,O,U,E,v,7);let Y=Number(y&BigInt(4294967295));E[v++]=Y,Y=Y>>8,E[v++]=Y,Y=Y>>8,E[v++]=Y,Y=Y>>8,E[v++]=Y;let se=Number(y>>BigInt(32)&BigInt(4294967295));return E[v++]=se,se=se>>8,E[v++]=se,se=se>>8,E[v++]=se,se=se>>8,E[v++]=se,v}function he(E,y,v,O,U){Kt(y,O,U,E,v,7);let Y=Number(y&BigInt(4294967295));E[v+7]=Y,Y=Y>>8,E[v+6]=Y,Y=Y>>8,E[v+5]=Y,Y=Y>>8,E[v+4]=Y;let se=Number(y>>BigInt(32)&BigInt(4294967295));return E[v+3]=se,se=se>>8,E[v+2]=se,se=se>>8,E[v+1]=se,se=se>>8,E[v]=se,v+8}c.prototype.writeBigUInt64LE=cn(function(y,v=0){return $e(this,y,v,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=cn(function(y,v=0){return he(this,y,v,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(y,v,O,U){if(y=+y,v=v>>>0,!U){const le=Math.pow(2,8*O-1);we(this,y,v,O,le-1,-le)}let Y=0,se=1,Ie=0;for(this[v]=y&255;++Y<O&&(se*=256);)y<0&&Ie===0&&this[v+Y-1]!==0&&(Ie=1),this[v+Y]=(y/se>>0)-Ie&255;return v+O},c.prototype.writeIntBE=function(y,v,O,U){if(y=+y,v=v>>>0,!U){const le=Math.pow(2,8*O-1);we(this,y,v,O,le-1,-le)}let Y=O-1,se=1,Ie=0;for(this[v+Y]=y&255;--Y>=0&&(se*=256);)y<0&&Ie===0&&this[v+Y+1]!==0&&(Ie=1),this[v+Y]=(y/se>>0)-Ie&255;return v+O},c.prototype.writeInt8=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,1,127,-128),y<0&&(y=255+y+1),this[v]=y&255,v+1},c.prototype.writeInt16LE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,2,32767,-32768),this[v]=y&255,this[v+1]=y>>>8,v+2},c.prototype.writeInt16BE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,2,32767,-32768),this[v]=y>>>8,this[v+1]=y&255,v+2},c.prototype.writeInt32LE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,4,2147483647,-2147483648),this[v]=y&255,this[v+1]=y>>>8,this[v+2]=y>>>16,this[v+3]=y>>>24,v+4},c.prototype.writeInt32BE=function(y,v,O){return y=+y,v=v>>>0,O||we(this,y,v,4,2147483647,-2147483648),y<0&&(y=4294967295+y+1),this[v]=y>>>24,this[v+1]=y>>>16,this[v+2]=y>>>8,this[v+3]=y&255,v+4},c.prototype.writeBigInt64LE=cn(function(y,v=0){return $e(this,y,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=cn(function(y,v=0){return he(this,y,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ae(E,y,v,O,U,Y){if(v+O>E.length)throw new RangeError("Index out of range");if(v<0)throw new RangeError("Index out of range")}function ue(E,y,v,O,U){return y=+y,v=v>>>0,U||ae(E,y,v,4),n.write(E,y,v,O,23,4),v+4}c.prototype.writeFloatLE=function(y,v,O){return ue(this,y,v,!0,O)},c.prototype.writeFloatBE=function(y,v,O){return ue(this,y,v,!1,O)};function be(E,y,v,O,U){return y=+y,v=v>>>0,U||ae(E,y,v,8),n.write(E,y,v,O,52,8),v+8}c.prototype.writeDoubleLE=function(y,v,O){return be(this,y,v,!0,O)},c.prototype.writeDoubleBE=function(y,v,O){return be(this,y,v,!1,O)},c.prototype.copy=function(y,v,O,U){if(!c.isBuffer(y))throw new TypeError("argument should be a Buffer");if(O||(O=0),!U&&U!==0&&(U=this.length),v>=y.length&&(v=y.length),v||(v=0),U>0&&U<O&&(U=O),U===O||y.length===0||this.length===0)return 0;if(v<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),y.length-v<U-O&&(U=y.length-v+O);const Y=U-O;return this===y&&typeof o.prototype.copyWithin=="function"?this.copyWithin(v,O,U):o.prototype.set.call(y,this.subarray(O,U),v),Y},c.prototype.fill=function(y,v,O,U){if(typeof y=="string"){if(typeof v=="string"?(U=v,v=0,O=this.length):typeof O=="string"&&(U=O,O=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!c.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(y.length===1){const se=y.charCodeAt(0);(U==="utf8"&&se<128||U==="latin1")&&(y=se)}}else typeof y=="number"?y=y&255:typeof y=="boolean"&&(y=Number(y));if(v<0||this.length<v||this.length<O)throw new RangeError("Out of range index");if(O<=v)return this;v=v>>>0,O=O===void 0?this.length:O>>>0,y||(y=0);let Y;if(typeof y=="number")for(Y=v;Y<O;++Y)this[Y]=y;else{const se=c.isBuffer(y)?y:c.from(y,U),Ie=se.length;if(Ie===0)throw new TypeError('The value "'+y+'" is invalid for argument "value"');for(Y=0;Y<O-v;++Y)this[Y+v]=se[Y%Ie]}return this};const me={};function De(E,y,v){me[E]=class extends v{constructor(){super(),Object.defineProperty(this,"message",{value:y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}De("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),De("ERR_INVALID_ARG_TYPE",function(E,y){return`The "${E}" argument must be of type number. Received type ${typeof y}`},TypeError),De("ERR_OUT_OF_RANGE",function(E,y,v){let O=`The value of "${E}" is out of range.`,U=v;return Number.isInteger(v)&&Math.abs(v)>2**32?U=_e(String(v)):typeof v=="bigint"&&(U=String(v),(v>BigInt(2)**BigInt(32)||v<-(BigInt(2)**BigInt(32)))&&(U=_e(U)),U+="n"),O+=` It must be ${y}. Received ${U}`,O},RangeError);function _e(E){let y="",v=E.length;const O=E[0]==="-"?1:0;for(;v>=O+4;v-=3)y=`_${E.slice(v-3,v)}${y}`;return`${E.slice(0,v)}${y}`}function ut(E,y,v){vt(y,"offset"),(E[y]===void 0||E[y+v]===void 0)&&Dt(y,E.length-(v+1))}function Kt(E,y,v,O,U,Y){if(E>v||E<y){const se=typeof y=="bigint"?"n":"";let Ie;throw y===0||y===BigInt(0)?Ie=`>= 0${se} and < 2${se} ** ${(Y+1)*8}${se}`:Ie=`>= -(2${se} ** ${(Y+1)*8-1}${se}) and < 2 ** ${(Y+1)*8-1}${se}`,new me.ERR_OUT_OF_RANGE("value",Ie,E)}ut(O,U,Y)}function vt(E,y){if(typeof E!="number")throw new me.ERR_INVALID_ARG_TYPE(y,"number",E)}function Dt(E,y,v){throw Math.floor(E)!==E?(vt(E,v),new me.ERR_OUT_OF_RANGE("offset","an integer",E)):y<0?new me.ERR_BUFFER_OUT_OF_BOUNDS:new me.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${y}`,E)}const Ve=/[^+/0-9A-Za-z-_]/g;function ye(E){if(E=E.split("=")[0],E=E.trim().replace(Ve,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Fe(E,y){y=y||1/0;let v;const O=E.length;let U=null;const Y=[];for(let se=0;se<O;++se){if(v=E.charCodeAt(se),v>55295&&v<57344){if(!U){if(v>56319){(y-=3)>-1&&Y.push(239,191,189);continue}else if(se+1===O){(y-=3)>-1&&Y.push(239,191,189);continue}U=v;continue}if(v<56320){(y-=3)>-1&&Y.push(239,191,189),U=v;continue}v=(U-55296<<10|v-56320)+65536}else U&&(y-=3)>-1&&Y.push(239,191,189);if(U=null,v<128){if((y-=1)<0)break;Y.push(v)}else if(v<2048){if((y-=2)<0)break;Y.push(v>>6|192,v&63|128)}else if(v<65536){if((y-=3)<0)break;Y.push(v>>12|224,v>>6&63|128,v&63|128)}else if(v<1114112){if((y-=4)<0)break;Y.push(v>>18|240,v>>12&63|128,v>>6&63|128,v&63|128)}else throw new Error("Invalid code point")}return Y}function gt(E){const y=[];for(let v=0;v<E.length;++v)y.push(E.charCodeAt(v)&255);return y}function Qr(E,y){let v,O,U;const Y=[];for(let se=0;se<E.length&&!((y-=2)<0);++se)v=E.charCodeAt(se),O=v>>8,U=v%256,Y.push(U),Y.push(O);return Y}function xr(E){return t.toByteArray(ye(E))}function kn(E,y,v,O){let U;for(U=0;U<O&&!(U+v>=y.length||U>=E.length);++U)y[U+v]=E[U];return U}function bt(E,y){return E instanceof y||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===y.name}function ln(E){return E!==E}const vo=(function(){const E="0123456789abcdef",y=new Array(256);for(let v=0;v<16;++v){const O=v*16;for(let U=0;U<16;++U)y[O+U]=E[v]+E[U]}return y})();function cn(E){return typeof BigInt>"u"?bo:E}function bo(){throw new Error("BigInt not supported")}})(af);const di=af.Buffer;class fs extends Error{name="RuntimeError";constructor(t,...n){super([t,...n].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class QS extends fs{name="ApiError"}const ul=(e,t="")=>{const n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.href=e,n.setAttribute("download",t),n.click(),document.body.removeChild(n)},dl=(e="")=>e.split("/").map(encodeURIComponent).join("/"),KS=e=>{const t=[],n=(r,s="")=>Object.keys(r).forEach(o=>{Ga(r[o])?n(r[o],`${s}${o}.`):t.push(`${s}${o}`)});return n(e),t},fl=e=>{const t=e.startsWith("v")?e.slice(1):e,[n,r]=t.split("-"),[s,o,i]=n.split(".").map(Number);return{major:s,minor:o,patch:i,pre:r}},pl=(e,t)=>{const n=fl(e),r=fl(t);return n.major!==r.major?n.major-r.major:n.minor!==r.minor?n.minor-r.minor:n.patch!==r.patch?n.patch-r.patch:n.pre&&!r.pre?-1:!n.pre&&r.pre?1:n.pre&&r.pre?n.pre.localeCompare(r.pre):0};class GS{clientService;userStore;serverUrl;capability;available;constructor(t,n,r,s=H([])){this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=T(()=>{const o=a(s).filter(i=>i.enabled).sort((i,l)=>pl(l.version,i.version));return o.length?o[0]:null}),this.available=T(()=>!!a(this.capability)?.version)}async triggerDownload(t){if(!a(this.available))throw new fs("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new fs("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new fs("download url could not be built");let r=t.publicToken?n:await this.clientService.ocs.signUrl(n,this.userStore.user?.onPremisesSamAccountName),s;if(t.publicLinkPassword)try{const o=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!1}),Authorization:"Basic "+di.from(["public",t.publicLinkPassword].join(":")).toString("base64")}});if(!o.ok)throw new z.HttpError("",o);const i=await o.blob();r=URL.createObjectURL(i),s=decodeURI(o.headers.get("content-disposition")?.split('"')[1])}catch{throw new Error("archive could not be fetched")}return ul(r,s),r}buildDownloadUrl(t){const n=[];return t.publicToken&&n.push(`public-token=${t.publicToken}`),n.push(...t.fileIds.map(r=>`id=${r}`)),this.url+"?"+n.join("&")}get url(){if(!this.available)throw new fs("no archiver available");const t=a(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:z.urlJoin(this.serverUrl,t.archiver_url)}}const JS=new Zd({ttl:10*1e3,capacity:250});class XS{get filePreview(){return JS}}const hl=new XS;class ml{accessToken;publicLinkToken;publicLinkPassword;constructor(t={}){this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+di.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class gl{instance;cancelToken;constructor(t,n){this.cancelToken=wo.CancelToken.source(),this.instance=wo.create(t),n&&this.instance.interceptors.request.use(n)}cancel(t){this.cancelToken.cancel(t)}async delete(t,n,r){return await this.internalRequestWithData("delete",t,n,r)}get(t,n){return this.internalRequest("get",t,n)}head(t,n){return this.internalRequest("head",t,n)}options(t,n){return this.internalRequest("options",t,n)}patch(t,n,r){return this.internalRequestWithData("patch",t,n,r)}post(t,n,r){return this.internalRequestWithData("post",t,n,r)}put(t,n,r){return this.internalRequestWithData("put",t,n,r)}async request(t){const n=await this.instance.request(this.obtainConfig(t));return this.processResponse(n,t)}obtainConfig(t){return Ws({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n?.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const s=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(s,r)}async internalRequestWithData(t,n,r,s){const o=await this.instance[t](n,r,this.obtainConfig(s));return this.processResponse(o,s)}}class YS extends Error{name="RetriableError"}const ZS=15e3;class e0{url;fetchOptions;abortController;eventListenerMap;readyState;withCredentials;CONNECTING;OPEN;CLOSED;onerror;onmessage;onopen;constructor(t,n){this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return gg.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{const t=new Event("open");this.onopen?.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{const n=new MessageEvent("message",{data:t.data});this.onmessage?.bind(this)(n);const r=t.event;this.eventListenerMap[r]?.forEach(o=>o(n))},onclose:()=>{throw this.readyState=this.CLOSED,new YS},onerror:t=>{console.error(t);const n=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(n),3e4+Math.floor(Math.random()*ZS)}})}fetchProvider(...t){const[n,r]=t,s={...r,...this.fetchOptions};return window.fetch(n,s)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]?.filter(r=>r!==n)}dispatchEvent(){throw new Error("Method not implemented.")}updateAccessToken(t){this.fetchOptions.headers.Authorization=`Bearer ${t}`}updateLanguage(t){this.fetchOptions.headers["Accept-Language"]=t,this.close(),this.connect()}}let yl=null;const t0=(e,t)=>(yl||(yl=new e0(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),yl),n0=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":wt.v4(),"X-Requested-With":"XMLHttpRequest"}});class r0{configStore;language;authStore;httpAuthenticatedClient;httpUnAuthenticatedClient;graphClient;ocsClient;webDavClient;initiatorId=wt.v4();staticHeaders={"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"};constructor(t){this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new gl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new gl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders({useAuth:!1})),n))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return t0(this.configStore.serverUrl,n0({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}getRequestHeaders=({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})});initGraphClient(){const t=wo.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=z.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=wo.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=z.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=z.webdav(this.configStore.serverUrl,()=>{const t={...this.staticHeaders,...this.getDynamicHeaders()};return this.authStore.publicLinkToken&&(t["public-token"]=this.authStore.publicLinkToken),this.authStore.publicLinkPassword&&(t.Authorization="Basic "+di.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":wt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class cf{topics;constructor(){this.topics=new Map}subscribe(t,n){const r={token:wt.v4(),callback:n},s=[r,...this.topics.get(t)||[]];return this.topics.set(t,s),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(s=>s.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const Xe=new cf;class uf{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}const fi=e=>({value:e,type:null}),s0=e=>fi(e),Ye=e=>fi(e),pi=e=>fi(e),o0=e=>fi(e),i0={Permissions:Ye("permissions"),IsFavorite:pi("favorite"),FileId:Ye("fileid"),FileParent:Ye("file-parent"),Name:Ye("name"),OwnerId:Ye("owner-id"),OwnerDisplayName:Ye("owner-display-name"),PrivateLink:Ye("privatelink"),ContentLength:pi("getcontentlength"),ContentSize:pi("size"),LastModifiedDate:Ye("getlastmodified"),Tags:s0("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:Ye("getetag"),MimeType:Ye("getcontenttype"),ResourceType:o0("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:Ye("owner"),LockTime:Ye("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:Ye("downloadURL"),Highlights:Ye("highlights"),MetaPathForUser:Ye("meta-path-for-user"),RemoteItemId:Ye("remote-item-id"),HasPreview:pi("has-preview"),ShareId:Ye("shareid"),ShareRoot:Ye("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:Ye("share-permissions"),TrashbinOriginalFilename:Ye("trashbin-original-filename"),TrashbinOriginalLocation:Ye("trashbin-original-location"),TrashbinDeletedDate:Ye("trashbin-delete-datetime"),PublicLinkItemType:Ye("public-link-item-type"),PublicLinkPermission:Ye("public-link-permission"),PublicLinkExpiration:Ye("public-link-expiration"),PublicLinkShareDate:Ye("public-link-share-datetime"),PublicLinkShareOwner:Ye("public-link-share-owner")},Te=Object.fromEntries(Object.entries(i0).map(([e,t])=>[e,t.value]));class Qs{static Default=[Te.Permissions,Te.IsFavorite,Te.FileId,Te.FileParent,Te.Name,Te.LockDiscovery,Te.ActiveLock,Te.OwnerId,Te.OwnerDisplayName,Te.RemoteItemId,Te.ShareRoot,Te.ShareTypes,Te.PrivateLink,Te.ContentLength,Te.ContentSize,Te.LastModifiedDate,Te.ETag,Te.MimeType,Te.ResourceType,Te.Tags,Te.Audio,Te.Location,Te.Image,Te.Photo,Te.HasPreview];static PublicLink=Qs.Default.concat([Te.PublicLinkItemType,Te.PublicLinkPermission,Te.PublicLinkExpiration,Te.PublicLinkShareDate,Te.PublicLinkShareOwner]);static Trashbin=[Te.ContentLength,Te.ResourceType,Te.TrashbinOriginalLocation,Te.TrashbinOriginalFilename,Te.TrashbinDeletedDate,Te.Permissions,Te.FileParent];static DavNamespace=[Te.ContentLength,Te.LastModifiedDate,Te.ETag,Te.MimeType,Te.ResourceType,Te.LockDiscovery,Te.ActiveLock]}var a0="[object Symbol]";function hi(e){return typeof e=="symbol"||Fn(e)&&$r(e)==a0}var l0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c0=/^\w*$/;function u0(e,t){if(mn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||hi(e)?!0:c0.test(e)||!l0.test(e)||t!=null&&e in Object(t)}var d0="Expected a function";function vl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(d0);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],o=n.cache;if(o.has(s))return o.get(s);var i=e.apply(this,r);return n.cache=o.set(s,i)||o,i};return n.cache=new(vl.Cache||Kn),n}vl.Cache=Kn;var f0=500;function p0(e){var t=vl(e,function(r){return n.size===f0&&n.clear(),r}),n=t.cache;return t}var h0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,m0=/\\(\\)?/g,g0=p0(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(h0,function(n,r,s,o){t.push(s?o.replace(m0,"$1"):r||n)}),t});function df(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var ff=en?en.prototype:void 0,pf=ff?ff.toString:void 0;function hf(e){if(typeof e=="string")return e;if(mn(e))return df(e,hf)+"";if(hi(e))return pf?pf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bl(e){return e==null?"":hf(e)}function wl(e,t){return mn(e)?e:u0(e,t)?[e]:g0(bl(e))}function mf(e){if(typeof e=="string"||hi(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function gf(e,t){t=wl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[mf(t[n++])];return n&&n==r?e:void 0}function Sl(e,t,n){var r=e==null?void 0:gf(e,t);return r===void 0?n:r}var y0={2:e=>{function t(s,o,i){s instanceof RegExp&&(s=n(s,i)),o instanceof RegExp&&(o=n(o,i));var l=r(s,o,i);return l&&{start:l[0],end:l[1],pre:i.slice(0,l[0]),body:i.slice(l[0]+s.length,l[1]),post:i.slice(l[1]+o.length)}}function n(s,o){var i=o.match(s);return i?i[0]:null}function r(s,o,i){var l,u,d,c,f,p=i.indexOf(s),h=i.indexOf(o,p+1),g=p;if(p>=0&&h>0){for(l=[],d=i.length;g>=0&&!f;)g==p?(l.push(g),p=i.indexOf(s,g+1)):l.length==1?f=[l.pop(),h]:((u=l.pop())<d&&(d=u,c=h),h=i.indexOf(o,g+1)),g=p<h&&p>=0?p:h;l.length&&(f=[d,c])}return f}e.exports=t,t.range=r},47:(e,t,n)=>{var r=n(410),s=function(d){return typeof d=="string"};function o(d,c){for(var f=[],p=0;p<d.length;p++){var h=d[p];h&&h!=="."&&(h===".."?f.length&&f[f.length-1]!==".."?f.pop():c&&f.push(".."):f.push(h))}return f}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l={};function u(d){return i.exec(d).slice(1)}l.resolve=function(){for(var d="",c=!1,f=arguments.length-1;f>=-1&&!c;f--){var p=f>=0?arguments[f]:ce.cwd();if(!s(p))throw new TypeError("Arguments to path.resolve must be strings");p&&(d=p+"/"+d,c=p.charAt(0)==="/")}return(c?"/":"")+(d=o(d.split("/"),!c).join("/"))||"."},l.normalize=function(d){var c=l.isAbsolute(d),f=d.substr(-1)==="/";return(d=o(d.split("/"),!c).join("/"))||c||(d="."),d&&f&&(d+="/"),(c?"/":"")+d},l.isAbsolute=function(d){return d.charAt(0)==="/"},l.join=function(){for(var d="",c=0;c<arguments.length;c++){var f=arguments[c];if(!s(f))throw new TypeError("Arguments to path.join must be strings");f&&(d+=d?"/"+f:f)}return l.normalize(d)},l.relative=function(d,c){function f(k){for(var w=0;w<k.length&&k[w]==="";w++);for(var C=k.length-1;C>=0&&k[C]==="";C--);return w>C?[]:k.slice(w,C+1)}d=l.resolve(d).substr(1),c=l.resolve(c).substr(1);for(var p=f(d.split("/")),h=f(c.split("/")),g=Math.min(p.length,h.length),m=g,b=0;b<g;b++)if(p[b]!==h[b]){m=b;break}var S=[];for(b=m;b<p.length;b++)S.push("..");return(S=S.concat(h.slice(m))).join("/")},l._makeLong=function(d){return d},l.dirname=function(d){var c=u(d),f=c[0],p=c[1];return f||p?(p&&(p=p.substr(0,p.length-1)),f+p):"."},l.basename=function(d,c){var f=u(d)[2];return c&&f.substr(-1*c.length)===c&&(f=f.substr(0,f.length-c.length)),f},l.extname=function(d){return u(d)[3]},l.format=function(d){if(!r.isObject(d))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof d);var c=d.root||"";if(!s(c))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof d.root);return(d.dir?d.dir+l.sep:"")+(d.base||"")},l.parse=function(d){if(!s(d))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof d);var c=u(d);if(!c||c.length!==4)throw new TypeError("Invalid path '"+d+"'");return c[1]=c[1]||"",c[2]=c[2]||"",c[3]=c[3]||"",{root:c[0],dir:c[0]+c[1].slice(0,c[1].length-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}},l.sep="/",l.delimiter=":",e.exports=l},101:function(e,t,n){var r;e=n.nmd(e),(function(){var s=(e&&e.exports,typeof mr=="object"&&mr);s.global!==s&&s.window;var o=function(c){this.message=c};(o.prototype=new Error).name="InvalidCharacterError";var i=function(c){throw new o(c)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,d={encode:function(c){c=String(c),/[^\0-\xFF]/.test(c)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var f,p,h,g,m=c.length%3,b="",S=-1,k=c.length-m;++S<k;)f=c.charCodeAt(S)<<16,p=c.charCodeAt(++S)<<8,h=c.charCodeAt(++S),b+=l.charAt((g=f+p+h)>>18&63)+l.charAt(g>>12&63)+l.charAt(g>>6&63)+l.charAt(63&g);return m==2?(f=c.charCodeAt(S)<<8,p=c.charCodeAt(++S),b+=l.charAt((g=f+p)>>10)+l.charAt(g>>4&63)+l.charAt(g<<2&63)+"="):m==1&&(g=c.charCodeAt(S),b+=l.charAt(g>>2)+l.charAt(g<<4&63)+"=="),b},decode:function(c){var f=(c=String(c).replace(u,"")).length;f%4==0&&(f=(c=c.replace(/==?$/,"")).length),(f%4==1||/[^+a-zA-Z0-9/]/.test(c))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var p,h,g=0,m="",b=-1;++b<f;)h=l.indexOf(c.charAt(b)),p=g%4?64*p+h:h,g++%4&&(m+=String.fromCharCode(255&p>>(-2*g&6)));return m},version:"1.0.0"};(r=(function(){return d}).call(t,n,t,e))===void 0||(e.exports=r)})()},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))})(n)||!!n._isBuffer)}},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,s=n.length;s--;){var o=n.charCodeAt(s);56320<=o&&o<=57343&&s--,127<o&&o<=2047?r++:2047<o&&o<=65535&&(r+=2)}return r}},285:(e,t,n)=>{var r=n(2);e.exports=function(S){return S?(S.substr(0,2)==="{}"&&(S="\\{\\}"+S.substr(2)),b((function(k){return k.split("\\\\").join(s).split("\\{").join(o).split("\\}").join(i).split("\\,").join(l).split("\\.").join(u)})(S),!0).map(c)):[]};var s="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function d(S){return parseInt(S,10)==S?parseInt(S,10):S.charCodeAt(0)}function c(S){return S.split(s).join("\\").split(o).join("{").split(i).join("}").split(l).join(",").split(u).join(".")}function f(S){if(!S)return[""];var k=[],w=r("{","}",S);if(!w)return S.split(",");var C=w.pre,A=w.body,I=w.post,N=C.split(",");N[N.length-1]+="{"+A+"}";var _=f(I);return I.length&&(N[N.length-1]+=_.shift(),N.push.apply(N,_)),k.push.apply(k,N),k}function p(S){return"{"+S+"}"}function h(S){return/^-?0\d/.test(S)}function g(S,k){return S<=k}function m(S,k){return S>=k}function b(S,k){var w=[],C=r("{","}",S);if(!C)return[S];var A=C.pre,I=C.post.length?b(C.post,!1):[""];if(/\$$/.test(C.pre))for(var N=0;N<I.length;N++){var _=A+"{"+C.body+"}"+I[N];w.push(_)}else{var F,V,Z=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(C.body),P=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(C.body),$=Z||P,L=C.body.indexOf(",")>=0;if(!$&&!L)return C.post.match(/,(?!,).*\}/)?b(S=C.pre+"{"+C.body+i+C.post):[S];if($)F=C.body.split(/\.\./);else if((F=f(C.body)).length===1&&(F=b(F[0],!1).map(p)).length===1)return I.map((function($e){return C.pre+F[0]+$e}));if($){var M=d(F[0]),j=d(F[1]),B=Math.max(F[0].length,F[1].length),q=F.length==3?Math.abs(d(F[2])):1,re=g;j<M&&(q*=-1,re=m);var J=F.some(h);V=[];for(var oe=M;re(oe,j);oe+=q){var ne;if(P)(ne=String.fromCharCode(oe))==="\\"&&(ne="");else if(ne=String(oe),J){var pe=B-ne.length;if(pe>0){var fe=new Array(pe+1).join("0");ne=oe<0?"-"+fe+ne.slice(1):fe+ne}}V.push(ne)}}else{V=[];for(var we=0;we<F.length;we++)V.push.apply(V,b(F[we],!1))}for(we=0;we<V.length;we++)for(N=0;N<I.length;N++)_=A+V[we]+I[N],(!k||$||_)&&w.push(_)}return w}},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,s){return r<<s|r>>>32-s},rotr:function(r,s){return r<<32-s|r>>>s},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var s=0;s<r.length;s++)r[s]=n.endian(r[s]);return r},randomBytes:function(r){for(var s=[];r>0;r--)s.push(Math.floor(256*Math.random()));return s},bytesToWords:function(r){for(var s=[],o=0,i=0;o<r.length;o++,i+=8)s[i>>>5]|=r[o]<<24-i%32;return s},wordsToBytes:function(r){for(var s=[],o=0;o<32*r.length;o+=8)s.push(r[o>>>5]>>>24-o%32&255);return s},bytesToHex:function(r){for(var s=[],o=0;o<r.length;o++)s.push((r[o]>>>4).toString(16)),s.push((15&r[o]).toString(16));return s.join("")},hexToBytes:function(r){for(var s=[],o=0;o<r.length;o+=2)s.push(parseInt(r.substr(o,2),16));return s},bytesToBase64:function(r){for(var s=[],o=0;o<r.length;o+=3)for(var i=r[o]<<16|r[o+1]<<8|r[o+2],l=0;l<4;l++)8*o+6*l<=8*r.length?s.push(t.charAt(i>>>6*(3-l)&63)):s.push("=");return s.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var s=[],o=0,i=0;o<r.length;i=++o%4)i!=0&&s.push((t.indexOf(r.charAt(o-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(r.charAt(o))>>>6-2*i);return s}},e.exports=n},345:()=>{},388:()=>{},410:()=>{},526:e=>{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var r=[],s=0;s<n.length;s++)r.push(255&n.charCodeAt(s));return r},bytesToString:function(n){for(var r=[],s=0;s<n.length;s++)r.push(String.fromCharCode(n[s]));return r.join("")}}};e.exports=t},542:(e,t,n)=>{(function(){var r=n(298),s=n(526).utf8,o=n(135),i=n(526).bin,l=function(u,d){u.constructor==String?u=d&&d.encoding==="binary"?i.stringToBytes(u):s.stringToBytes(u):o(u)?u=Array.prototype.slice.call(u,0):Array.isArray(u)||u.constructor===Uint8Array||(u=u.toString());for(var c=r.bytesToWords(u),f=8*u.length,p=1732584193,h=-271733879,g=-1732584194,m=271733878,b=0;b<c.length;b++)c[b]=16711935&(c[b]<<8|c[b]>>>24)|4278255360&(c[b]<<24|c[b]>>>8);c[f>>>5]|=128<<f%32,c[14+(f+64>>>9<<4)]=f;var S=l._ff,k=l._gg,w=l._hh,C=l._ii;for(b=0;b<c.length;b+=16){var A=p,I=h,N=g,_=m;p=S(p,h,g,m,c[b+0],7,-680876936),m=S(m,p,h,g,c[b+1],12,-389564586),g=S(g,m,p,h,c[b+2],17,606105819),h=S(h,g,m,p,c[b+3],22,-1044525330),p=S(p,h,g,m,c[b+4],7,-176418897),m=S(m,p,h,g,c[b+5],12,1200080426),g=S(g,m,p,h,c[b+6],17,-1473231341),h=S(h,g,m,p,c[b+7],22,-45705983),p=S(p,h,g,m,c[b+8],7,1770035416),m=S(m,p,h,g,c[b+9],12,-1958414417),g=S(g,m,p,h,c[b+10],17,-42063),h=S(h,g,m,p,c[b+11],22,-1990404162),p=S(p,h,g,m,c[b+12],7,1804603682),m=S(m,p,h,g,c[b+13],12,-40341101),g=S(g,m,p,h,c[b+14],17,-1502002290),p=k(p,h=S(h,g,m,p,c[b+15],22,1236535329),g,m,c[b+1],5,-165796510),m=k(m,p,h,g,c[b+6],9,-1069501632),g=k(g,m,p,h,c[b+11],14,643717713),h=k(h,g,m,p,c[b+0],20,-373897302),p=k(p,h,g,m,c[b+5],5,-701558691),m=k(m,p,h,g,c[b+10],9,38016083),g=k(g,m,p,h,c[b+15],14,-660478335),h=k(h,g,m,p,c[b+4],20,-405537848),p=k(p,h,g,m,c[b+9],5,568446438),m=k(m,p,h,g,c[b+14],9,-1019803690),g=k(g,m,p,h,c[b+3],14,-187363961),h=k(h,g,m,p,c[b+8],20,1163531501),p=k(p,h,g,m,c[b+13],5,-1444681467),m=k(m,p,h,g,c[b+2],9,-51403784),g=k(g,m,p,h,c[b+7],14,1735328473),p=w(p,h=k(h,g,m,p,c[b+12],20,-1926607734),g,m,c[b+5],4,-378558),m=w(m,p,h,g,c[b+8],11,-2022574463),g=w(g,m,p,h,c[b+11],16,1839030562),h=w(h,g,m,p,c[b+14],23,-35309556),p=w(p,h,g,m,c[b+1],4,-1530992060),m=w(m,p,h,g,c[b+4],11,1272893353),g=w(g,m,p,h,c[b+7],16,-155497632),h=w(h,g,m,p,c[b+10],23,-1094730640),p=w(p,h,g,m,c[b+13],4,681279174),m=w(m,p,h,g,c[b+0],11,-358537222),g=w(g,m,p,h,c[b+3],16,-722521979),h=w(h,g,m,p,c[b+6],23,76029189),p=w(p,h,g,m,c[b+9],4,-640364487),m=w(m,p,h,g,c[b+12],11,-421815835),g=w(g,m,p,h,c[b+15],16,530742520),p=C(p,h=w(h,g,m,p,c[b+2],23,-995338651),g,m,c[b+0],6,-198630844),m=C(m,p,h,g,c[b+7],10,1126891415),g=C(g,m,p,h,c[b+14],15,-1416354905),h=C(h,g,m,p,c[b+5],21,-57434055),p=C(p,h,g,m,c[b+12],6,1700485571),m=C(m,p,h,g,c[b+3],10,-1894986606),g=C(g,m,p,h,c[b+10],15,-1051523),h=C(h,g,m,p,c[b+1],21,-2054922799),p=C(p,h,g,m,c[b+8],6,1873313359),m=C(m,p,h,g,c[b+15],10,-30611744),g=C(g,m,p,h,c[b+6],15,-1560198380),h=C(h,g,m,p,c[b+13],21,1309151649),p=C(p,h,g,m,c[b+4],6,-145523070),m=C(m,p,h,g,c[b+11],10,-1120210379),g=C(g,m,p,h,c[b+2],15,718787259),h=C(h,g,m,p,c[b+9],21,-343485551),p=p+A>>>0,h=h+I>>>0,g=g+N>>>0,m=m+_>>>0}return r.endian([p,h,g,m])};l._ff=function(u,d,c,f,p,h,g){var m=u+(d&c|~d&f)+(p>>>0)+g;return(m<<h|m>>>32-h)+d},l._gg=function(u,d,c,f,p,h,g){var m=u+(d&f|c&~f)+(p>>>0)+g;return(m<<h|m>>>32-h)+d},l._hh=function(u,d,c,f,p,h,g){var m=u+(d^c^f)+(p>>>0)+g;return(m<<h|m>>>32-h)+d},l._ii=function(u,d,c,f,p,h,g){var m=u+(c^(d|~f))+(p>>>0)+g;return(m<<h|m>>>32-h)+d},l._blocksize=16,l._digestsize=16,e.exports=function(u,d){if(u==null)throw new Error("Illegal argument "+u);var c=r.wordsToBytes(l(u,d));return d&&d.asBytes?c:d&&d.asString?i.bytesToString(c):r.bytesToHex(c)}})()},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch{return null}}function s(o){try{return encodeURIComponent(o)}catch{return null}}t.stringify=function(o,i){i=i||"";var l,u,d=[];for(u in typeof i!="string"&&(i="?"),o)if(n.call(o,u)){if((l=o[u])||l!=null&&!isNaN(l)||(l=""),u=s(u),l=s(l),u===null||l===null)continue;d.push(u+"="+l)}return d.length?i+d.join("&"):""},t.parse=function(o){for(var i,l=/([^=?#&]+)=?([^&]*)/g,u={};i=l.exec(o);){var d=r(i[1]),c=r(i[2]);d===null||c===null||d in u||(u[d]=c)}return u}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},737:(e,t,n)=>{var r=n(670),s=n(647),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function f(k){return(k||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(k,w){return m(w.protocol)?k.replace(/\\/g,"/"):k},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function g(k){var w,C=(typeof window<"u"?window:typeof mr<"u"?mr:typeof self<"u"?self:{}).location||{},A={},I=typeof(k=k||C);if(k.protocol==="blob:")A=new S(unescape(k.pathname),{});else if(I==="string")for(w in A=new S(k,{}),h)delete A[w];else if(I==="object"){for(w in k)w in h||(A[w]=k[w]);A.slashes===void 0&&(A.slashes=l.test(k.href))}return A}function m(k){return k==="file:"||k==="ftp:"||k==="http:"||k==="https:"||k==="ws:"||k==="wss:"}function b(k,w){k=(k=f(k)).replace(i,""),w=w||{};var C,A=d.exec(k),I=A[1]?A[1].toLowerCase():"",N=!!A[2],_=!!A[3],F=0;return N?_?(C=A[2]+A[3]+A[4],F=A[2].length+A[3].length):(C=A[2]+A[4],F=A[2].length):_?(C=A[3]+A[4],F=A[3].length):C=A[4],I==="file:"?F>=2&&(C=C.slice(2)):m(I)?C=A[4]:I?N&&(C=C.slice(2)):F>=2&&m(w.protocol)&&(C=A[4]),{protocol:I,slashes:N||m(I),slashesCount:F,rest:C}}function S(k,w,C){if(k=(k=f(k)).replace(i,""),!(this instanceof S))return new S(k,w,C);var A,I,N,_,F,V,Z=p.slice(),P=typeof w,$=this,L=0;for(P!=="object"&&P!=="string"&&(C=w,w=null),C&&typeof C!="function"&&(C=s.parse),A=!(I=b(k||"",w=g(w))).protocol&&!I.slashes,$.slashes=I.slashes||A&&w.slashes,$.protocol=I.protocol||w.protocol||"",k=I.rest,(I.protocol==="file:"&&(I.slashesCount!==2||c.test(k))||!I.slashes&&(I.protocol||I.slashesCount<2||!m($.protocol)))&&(Z[3]=[/(.*)/,"pathname"]);L<Z.length;L++)typeof(_=Z[L])!="function"?(N=_[0],V=_[1],N!=N?$[V]=k:typeof N=="string"?~(F=N==="@"?k.lastIndexOf(N):k.indexOf(N))&&(typeof _[2]=="number"?($[V]=k.slice(0,F),k=k.slice(F+_[2])):($[V]=k.slice(F),k=k.slice(0,F))):(F=N.exec(k))&&($[V]=F[1],k=k.slice(0,F.index)),$[V]=$[V]||A&&_[3]&&w[V]||"",_[4]&&($[V]=$[V].toLowerCase())):k=_(k,$);C&&($.query=C($.query)),A&&w.slashes&&$.pathname.charAt(0)!=="/"&&($.pathname!==""||w.pathname!=="")&&($.pathname=(function(M,j){if(M==="")return j;for(var B=(j||"/").split("/").slice(0,-1).concat(M.split("/")),q=B.length,re=B[q-1],J=!1,oe=0;q--;)B[q]==="."?B.splice(q,1):B[q]===".."?(B.splice(q,1),oe++):oe&&(q===0&&(J=!0),B.splice(q,1),oe--);return J&&B.unshift(""),re!=="."&&re!==".."||B.push(""),B.join("/")})($.pathname,w.pathname)),$.pathname.charAt(0)!=="/"&&m($.protocol)&&($.pathname="/"+$.pathname),r($.port,$.protocol)||($.host=$.hostname,$.port=""),$.username=$.password="",$.auth&&(~(F=$.auth.indexOf(":"))?($.username=$.auth.slice(0,F),$.username=encodeURIComponent(decodeURIComponent($.username)),$.password=$.auth.slice(F+1),$.password=encodeURIComponent(decodeURIComponent($.password))):$.username=encodeURIComponent(decodeURIComponent($.auth)),$.auth=$.password?$.username+":"+$.password:$.username),$.origin=$.protocol!=="file:"&&m($.protocol)&&$.host?$.protocol+"//"+$.host:"null",$.href=$.toString()}S.prototype={set:function(k,w,C){var A=this;switch(k){case"query":typeof w=="string"&&w.length&&(w=(C||s.parse)(w)),A[k]=w;break;case"port":A[k]=w,r(w,A.protocol)?w&&(A.host=A.hostname+":"+w):(A.host=A.hostname,A[k]="");break;case"hostname":A[k]=w,A.port&&(w+=":"+A.port),A.host=w;break;case"host":A[k]=w,u.test(w)?(w=w.split(":"),A.port=w.pop(),A.hostname=w.join(":")):(A.hostname=w,A.port="");break;case"protocol":A.protocol=w.toLowerCase(),A.slashes=!C;break;case"pathname":case"hash":if(w){var I=k==="pathname"?"/":"#";A[k]=w.charAt(0)!==I?I+w:w}else A[k]=w;break;case"username":case"password":A[k]=encodeURIComponent(w);break;case"auth":var N=w.indexOf(":");~N?(A.username=w.slice(0,N),A.username=encodeURIComponent(decodeURIComponent(A.username)),A.password=w.slice(N+1),A.password=encodeURIComponent(decodeURIComponent(A.password))):A.username=encodeURIComponent(decodeURIComponent(w))}for(var _=0;_<p.length;_++){var F=p[_];F[4]&&(A[F[1]]=A[F[1]].toLowerCase())}return A.auth=A.password?A.username+":"+A.password:A.username,A.origin=A.protocol!=="file:"&&m(A.protocol)&&A.host?A.protocol+"//"+A.host:"null",A.href=A.toString(),A},toString:function(k){k&&typeof k=="function"||(k=s.stringify);var w,C=this,A=C.host,I=C.protocol;I&&I.charAt(I.length-1)!==":"&&(I+=":");var N=I+(C.protocol&&C.slashes||m(C.protocol)?"//":"");return C.username?(N+=C.username,C.password&&(N+=":"+C.password),N+="@"):C.password?(N+=":"+C.password,N+="@"):C.protocol!=="file:"&&m(C.protocol)&&!A&&C.pathname!=="/"&&(N+="@"),(A[A.length-1]===":"||u.test(C.hostname)&&!C.port)&&(A+=":"),N+=A+C.pathname,(w=typeof C.query=="object"?k(C.query):C.query)&&(N+=w.charAt(0)!=="?"?"?"+w:w),C.hash&&(N+=C.hash),N}},S.extractProtocol=b,S.location=g,S.trimLeft=f,S.qs=s,e.exports=S},800:()=>{},805:()=>{},829:e=>{function t(d){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t(d)}function n(d){var c=typeof Map=="function"?new Map:void 0;return n=function(f){if(f===null||(p=f,Function.toString.call(p).indexOf("[native code]")===-1))return f;var p;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(c!==void 0){if(c.has(f))return c.get(f);c.set(f,h)}function h(){return r(f,arguments,o(this).constructor)}return h.prototype=Object.create(f.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),s(h,f)},n(d)}function r(d,c,f){return r=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(p,h,g){var m=[null];m.push.apply(m,h);var b=new(Function.bind.apply(p,m));return g&&s(b,g.prototype),b},r.apply(null,arguments)}function s(d,c){return s=Object.setPrototypeOf||function(f,p){return f.__proto__=p,f},s(d,c)}function o(d){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},o(d)}var i=(function(d){function c(f){var p;return(function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")})(this,c),(p=(function(h,g){return!g||t(g)!=="object"&&typeof g!="function"?(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(h):g})(this,o(c).call(this,f))).name="ObjectPrototypeMutationError",p}return(function(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(p&&p.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),p&&s(f,p)})(c,d),c})(n(Error));function l(d,c){for(var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},p=c.split("."),h=p.length,g=function(S){var k=p[S];if(!d)return{v:void 0};if(k==="+"){if(Array.isArray(d))return{v:d.map((function(C,A){var I=p.slice(S+1);return I.length>0?l(C,I.join("."),f):f(d,A,p,S)}))};var w=p.slice(0,S).join(".");throw new Error("Object at wildcard (".concat(w,") is not an array"))}d=f(d,k,p,S)},m=0;m<h;m++){var b=g(m);if(t(b)==="object")return b.v}return d}function u(d,c){return d.length===c+1}e.exports={set:function(d,c,f){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c]=f,d[c];try{return l(d,c,(function(p,h,g,m){if(p===Reflect.getPrototypeOf({}))throw new i("Attempting to mutate Object.prototype");if(!p[h]){var b=Number.isInteger(Number(g[m+1])),S=g[m+1]==="+";p[h]=b||S?[]:{}}return u(g,m)&&(p[h]=f),p[h]}))}catch(p){if(p instanceof i)throw p;return d}},get:function(d,c){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c];try{return l(d,c,(function(f,p){return f[p]}))}catch{return d}},has:function(d,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(d)!="object"||d===null||c===void 0)return!1;if(typeof c=="number")return c in d;try{var p=!1;return l(d,c,(function(h,g,m,b){if(!u(m,b))return h&&h[g];p=f.own?h.hasOwnProperty(g):g in h})),p}catch{return!1}},hasOwn:function(d,c,f){return this.has(d,c,f||{own:!0})},isIn:function(d,c,f){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(d)!="object"||d===null||c===void 0)return!1;try{var h=!1,g=!1;return l(d,c,(function(m,b,S,k){return h=h||m===f||!!m&&m[b]===f,g=u(S,k)&&t(m)==="object"&&b in m,m&&m[b]})),p.validPath?h&&g:h}catch{return!1}},ObjectPrototypeMutationError:i}}},yf={};function st(e){var t=yf[e];if(t!==void 0)return t.exports;var n=yf[e]={id:e,loaded:!1,exports:{}};return y0[e].call(n.exports,n,n.exports,st),n.loaded=!0,n.exports}st.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return st.d(t,{a:t}),t},st.d=(e,t)=>{for(var n in t)st.o(t,n)&&!st.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},st.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),st.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var v0=st(737);st.n(v0);var b0=st(47);st.n(b0);var w0=st(542);st.n(w0);var S0=st(101);st.n(S0);const vf=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis;vf.fetch.bind(vf),(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({}),st(345),st(800),st(805);var k0=st(285);const mi=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},C0={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Ks=e=>e.replace(/[[\]\\-]/g,"\\$&"),bf=e=>e.join(""),T0=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],s=[];let o=n+1,i=!1,l=!1,u=!1,d=!1,c=n,f="";e:for(;o<e.length;){const m=e.charAt(o);if(m!=="!"&&m!=="^"||o!==n+1){if(m==="]"&&i&&!u){c=o+1;break}if(i=!0,m!=="\\"||u){if(m==="["&&!u){for(const[b,[S,k,w]]of Object.entries(C0))if(e.startsWith(b,o)){if(f)return["$.",!1,e.length-n,!0];o+=b.length,w?s.push(S):r.push(S),l=l||k;continue e}}u=!1,f?(m>f?r.push(Ks(f)+"-"+Ks(m)):m===f&&r.push(Ks(m)),f="",o++):e.startsWith("-]",o+1)?(r.push(Ks(m+"-")),o+=2):e.startsWith("-",o+1)?(f=m,o+=2):(r.push(Ks(m)),o++)}else u=!0,o++}else d=!0,o++}if(c<o)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,e.length-n,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!d)return[(p=r[0].length===2?r[0].slice(-1):r[0],p.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-n,!1];var p;const h="["+(d?"^":"")+bf(r)+"]",g="["+(d?"":"^")+bf(s)+"]";return[r.length&&s.length?"("+h+"|"+g+")":r.length?h:g,l,c-n,!0]},Gs=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},x0=new Set(["!","?","+","*","@"]),wf=e=>x0.has(e),kl="(?!\\.)",A0=new Set(["[","."]),R0=new Set(["..","."]),E0=new Set("().*{}+?[]^$\\!"),Cl="[^/]",Sf=Cl+"*?",kf=Cl+"+?";class _t{type;#n;#r;#o=!1;#e=[];#t;#i;#l;#a=!1;#s;#c;#d=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#s=this.#n===this?r:this.#n.#s,this.#l=this.#n===this?[]:this.#n.#l,t!=="!"||this.#n.#a||this.#l.push(this),this.#i=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#e.map((t=>String(t))).join("|")+")":this.#c=this.#e.map((t=>String(t))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#l.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let s=n.#i+1;!r.type&&s<r.#e.length;s++)for(const o of t.#e){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(r.#e[s])}n=r,r=n.#t}}return this}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n)if(s!==""){if(typeof s!="string"&&!(s instanceof _t&&s.#t===this))throw new Error("invalid part: "+s);this.#e.push(s)}}toJSON(){const t=this.type===null?this.#e.slice().map((n=>typeof n=="string"?n:n.toJSON())):[this.type,...this.#e.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#i===0)return!0;const t=this.#t;for(let n=0;n<this.#i;n++){const r=t.#e[n];if(!(r instanceof _t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const t=this.#t?this.#t.#e.length:0;return this.#i===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new _t(this.type,t);for(const r of this.#e)n.copyIn(r);return n}static#u(t,n,r,s){let o=!1,i=!1,l=-1,u=!1;if(n.type===null){let h=r,g="";for(;h<t.length;){const m=t.charAt(h++);if(o||m==="\\")o=!o,g+=m;else if(i)h===l+1?m!=="^"&&m!=="!"||(u=!0):m!=="]"||h===l+2&&u||(i=!1),g+=m;else if(m!=="[")if(s.noext||!wf(m)||t.charAt(h)!=="(")g+=m;else{n.push(g),g="";const b=new _t(m,n);h=_t.#u(t,b,h,s),n.push(b)}else i=!0,l=h,u=!1,g+=m}return n.push(g),h}let d=r+1,c=new _t(null,n);const f=[];let p="";for(;d<t.length;){const h=t.charAt(d++);if(o||h==="\\")o=!o,p+=h;else if(i)d===l+1?h!=="^"&&h!=="!"||(u=!0):h!=="]"||d===l+2&&u||(i=!1),p+=h;else if(h!=="[")if(wf(h)&&t.charAt(d)==="("){c.push(p),p="";const g=new _t(h,c);c.push(g),d=_t.#u(t,g,d,s)}else if(h!=="|"){if(h===")")return p===""&&n.#e.length===0&&(n.#d=!0),c.push(p),p="",n.push(...f,c),d;p+=h}else c.push(p),p="",f.push(c),c=new _t(null,n);else i=!0,l=d,u=!1,p+=h}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],d}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new _t(null,void 0,n);return _t.#u(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,s,o]=this.toRegExpSource();if(!(s||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const i=(this.#s.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${n}$`,i),{_src:n,_glob:t})}get options(){return this.#s}toRegExpSource(t){const n=t??!!this.#s.dot;if(this.#n===this&&this.#p(),!this.type){const u=this.isStart()&&this.isEnd(),d=this.#e.map((p=>{const[h,g,m,b]=typeof p=="string"?_t.#h(p,this.#r,u):p.toRegExpSource(t);return this.#r=this.#r||m,this.#o=this.#o||b,h})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!R0.has(this.#e[0]))){const p=A0,h=n&&p.has(d.charAt(0))||d.startsWith("\\.")&&p.has(d.charAt(2))||d.startsWith("\\.\\.")&&p.has(d.charAt(4)),g=!n&&!t&&p.has(d.charAt(0));c=h?"(?!(?:^|/)\\.\\.?(?:$|/))":g?kl:""}let f="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(f="(?:$|\\/)"),[c+d+f,Gs(d),this.#r=!!this.#r,this.#o]}const r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let o=this.#f(n);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){const u=this.toString();return this.#e=[u],this.type=null,this.#r=void 0,[u,Gs(this.toString()),!1,!1]}let i=!r||t||n?"":this.#f(!0);i===o&&(i=""),i&&(o=`(?:${o})(?:${i})*?`);let l="";return l=this.type==="!"&&this.#d?(this.isStart()&&!n?kl:"")+kf:s+o+(this.type==="!"?"))"+(!this.isStart()||n||t?"":kl)+Sf+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`),[l,Gs(o),this.#r=!!this.#r,this.#o]}#f(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,s,o,i]=n.toRegExpSource(t);return this.#o=this.#o||i,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#h(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=!1,o="",i=!1;for(let l=0;l<t.length;l++){const u=t.charAt(l);if(s)s=!1,o+=(E0.has(u)?"\\":"")+u;else if(u!=="\\"){if(u==="["){const[d,c,f,p]=T0(t,l);if(f){o+=d,i=i||c,l+=f-1,n=n||p;continue}}u!=="*"?u!=="?"?o+=u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(o+=Cl,n=!0):(o+=r&&t==="*"?kf:Sf,n=!0)}else l===t.length-1?o+="\\\\":s=!0}return[o,Gs(t),!!n,i]}}const Mt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return mi(t),!(!n.nocomment&&t.charAt(0)==="#")&&new gi(t,n).match(e)},D0=/^\*+([^+@!?\*\[\(]*)$/,F0=e=>t=>!t.startsWith(".")&&t.endsWith(e),I0=e=>t=>t.endsWith(e),P0=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),$0=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),O0=/^\*+\.\*+$/,L0=e=>!e.startsWith(".")&&e.includes("."),_0=e=>e!=="."&&e!==".."&&e.includes("."),M0=/^\.\*+$/,N0=e=>e!=="."&&e!==".."&&e.startsWith("."),B0=/^\*+$/,j0=e=>e.length!==0&&!e.startsWith("."),z0=e=>e.length!==0&&e!=="."&&e!=="..",V0=/^\?+([^+@!?\*\[\(]*)?$/,U0=e=>{let[t,n=""]=e;const r=Cf([t]);return n?(n=n.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(n)):r},q0=e=>{let[t,n=""]=e;const r=Tf([t]);return n?(n=n.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(n)):r},H0=e=>{let[t,n=""]=e;const r=Tf([t]);return n?s=>r(s)&&s.endsWith(n):r},W0=e=>{let[t,n=""]=e;const r=Cf([t]);return n?s=>r(s)&&s.endsWith(n):r},Cf=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},Tf=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},xf=typeof ce=="object"&&ce?typeof ce.env=="object"&&ce.env&&ce.env.__MINIMATCH_TESTING_PLATFORM__||ce.platform:"posix";Mt.sep=xf==="win32"?"\\":"/";const sn=Symbol("globstar **");Mt.GLOBSTAR=sn,Mt.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>Mt(n,e,t)};const on=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};Mt.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Mt;const t=Mt;return Object.assign((function(n,r){return t(n,r,on(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,on(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(on(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,on(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,on(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,on(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,on(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,on(e,r))},defaults:n=>t.defaults(on(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,on(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,on(e,r))},match:function(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,on(e,s))},sep:t.sep,GLOBSTAR:sn})};const Af=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return mi(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:k0(e)};Mt.braceExpand=Af,Mt.makeRe=function(e){return new gi(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},Mt.match=function(e,t){const n=new gi(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((r=>n.match(r))),n.options.nonull&&!e.length&&e.push(t),e};const Rf=/[?*]|[+@!]\(.*?\)|\[|\]/;class gi{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};mi(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||xf,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map((o=>this.slashSplit(o)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map(((o,i,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const u=!(o[0]!==""||o[1]!==""||o[2]!=="?"&&Rf.test(o[2])||Rf.test(o[3])),d=/^[a-z]:/i.test(o[0]);if(u)return[...o.slice(0,4),...o.slice(4).map((c=>this.parse(c)))];if(d)return[o[0],...o.slice(1).map((c=>this.parse(c)))]}return o.map((u=>this.parse(u)))}));if(this.debug(this.pattern,s),this.set=s.filter((o=>o.indexOf(!1)===-1)),this.isWindows)for(let o=0;o<this.set.length;o++){const i=this.set[o];i[0]===""&&i[1]===""&&this.globParts[o][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let s=0;s<t[r].length;s++)t[r][s]==="**"&&(t[r][s]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let s=r;for(;n[s+1]==="**";)s++;s!==r&&n.splice(r,s-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,s)=>{const o=r[r.length-1];return s==="**"&&o==="**"?r:s===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(r.pop(),r):(r.push(s),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const o=t[s];s===1&&o===""&&t[0]===""||o!=="."&&o!==""||(n=!0,t.splice(s,1),s--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const s=t[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let i=s;for(;r[i+1]==="**";)i++;i>s&&r.splice(s+1,i-s);let l=r[s+1];const u=r[s+2],d=r[s+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;n=!0,r.splice(s,1);const c=r.slice(0);c[s]="**",t.push(c),s--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){const l=r[i];i===1&&l===""&&r[0]===""||l!=="."&&l!==""||(n=!0,r.splice(i,1),i--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let o=0;for(;(o=r.indexOf("..",o+1))!==-1;){const i=r[o-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;const l=o===1&&r[o+1]==="**"?["."]:[];r.splice(o-1,2,...l),r.length===0&&r.push(""),o-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const s=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(s){t[n]=[],t[r]=s;break}}return t.filter((n=>n.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=0,o=0,i=[],l="";for(;s<t.length&&o<n.length;)if(t[s]===n[o])i.push(l==="b"?n[o]:t[s]),s++,o++;else if(r&&t[s]==="**"&&n[o]===t[s+1])i.push(t[s]),s++;else if(r&&n[o]==="**"&&t[s]===n[o+1])i.push(n[o]),o++;else if(t[s]!=="*"||!n[o]||!this.options.dot&&n[o].startsWith(".")||n[o]==="**"){if(n[o]!=="*"||!t[s]||!this.options.dot&&t[s].startsWith(".")||t[s]==="**"||l==="a")return!1;l="b",i.push(n[o]),s++,o++}else{if(l==="b")return!1;l="a",i.push(t[s]),s++,o++}return t.length===n.length&&i}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const s=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),b=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),S=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=b?3:m?0:void 0,w=!S&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:S?0:void 0;if(typeof k=="number"&&typeof w=="number"){const[C,A]=[t[k],n[w]];C.toLowerCase()===A.toLowerCase()&&(n[w]=C,w>k?n=n.slice(w):k>w&&(t=t.slice(k)))}}const{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var i=0,l=0,u=t.length,d=n.length;i<u&&l<d;i++,l++){this.debug("matchOne loop");var c=n[l],f=t[i];if(this.debug(n,c,f),c===!1)return!1;if(c===sn){this.debug("GLOBSTAR",[n,c,f]);var p=i,h=l+1;if(h===d){for(this.debug("** at the end");i<u;i++)if(t[i]==="."||t[i]===".."||!s.dot&&t[i].charAt(0)===".")return!1;return!0}for(;p<u;){var g=t[p];if(this.debug(`
7
- globstar while`,t,p,n,h,g),this.matchOne(t.slice(p),n.slice(h),r))return this.debug("globstar found match!",p,u,g),!0;if(g==="."||g===".."||!s.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,p,n,h);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!r||(this.debug(`
8
- >>> no match, partial?`,t,p,n,h),p!==u))}let m;if(typeof c=="string"?(m=f===c,this.debug("string match",c,f,m)):(m=c.test(f),this.debug("pattern match",c,f,m)),!m)return!1}if(i===u&&l===d)return!0;if(i===u)return r;if(l===d)return i===u-1&&t[i]==="";throw new Error("wtf?")}braceExpand(){return Af(this.pattern,this.options)}parse(t){mi(t);const n=this.options;if(t==="**")return sn;if(t==="")return"";let r,s=null;(r=t.match(B0))?s=n.dot?z0:j0:(r=t.match(D0))?s=(n.nocase?n.dot?$0:P0:n.dot?I0:F0)(r[1]):(r=t.match(V0))?s=(n.nocase?n.dot?q0:U0:n.dot?H0:W0)(r):(r=t.match(O0))?s=n.dot?_0:L0:(r=t.match(M0))&&(s=N0);const o=_t.fromGlob(t,this.options).toMMPattern();return s&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:s}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",s=new Set(n.nocase?["i"]:[]);let o=t.map((u=>{const d=u.map((c=>{if(c instanceof RegExp)for(const f of c.flags.split(""))s.add(f);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===sn?sn:c._src}));return d.forEach(((c,f)=>{const p=d[f+1],h=d[f-1];c===sn&&h!==sn&&(h===void 0?p!==void 0&&p!==sn?d[f+1]="(?:\\/|"+r+"\\/)?"+p:d[f]=r:p===void 0?d[f-1]=h+"(?:\\/|"+r+")?":p!==sn&&(d[f-1]=h+"(?:\\/|\\/"+r+"\\/)"+p,d[f+1]=sn))})),d.filter((c=>c!==sn)).join("/")})).join("|");const[i,l]=t.length>1?["(?:",")"]:["",""];o="^"+i+o+l+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const o=this.set;this.debug(this.pattern,"set",o);let i=s[s.length-1];if(!i)for(let l=s.length-2;!i&&l>=0;l--)i=s[l];for(let l=0;l<o.length;l++){const u=o[l];let d=s;if(r.matchBase&&u.length===1&&(d=[i]),this.matchOne(d,u,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return Mt.defaults(t).Minimatch}}Mt.AST=_t,Mt.Minimatch=gi,Mt.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},Mt.unescape=Gs;var Q0=st(829);st.n(Q0);var K0=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(K0||{});typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));var G0=st(388);st.n(G0),st(172);class Ef{isEnabled(){return!0}isActive(t){return rt(t,"files-spaces-projects")?!1:rt(t,"files-spaces-generic")||nn(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:s,authService:o,spacesStore:i,sharesStore:l,configStore:u}=t,{webdav:d,graphAuthenticated:c}=r,{replaceInvalidFileRoute:f}=Ci({router:n});return Ft.useTask(function*(p,h,g,m=null,b=null,S={}){try{s.clearResourceList();const k=Qs.Default;z.isPublicSpaceResource(g)&&k.push(Te.DownloadURL);let{resource:w,children:C}=yield*z.call(d.listFiles(g,{path:m,fileId:b},{signal:p,davProperties:k}));w.id&&f({space:g,resource:w,path:m,fileId:b});let A;m==="/"&&(z.isShareSpaceResource(g)?(A=yield*z.call(li({graphClient:c,spacesStore:i,space:g,signal:p})),A&&(w=z.buildIncomingShareResource({graphRoles:l.graphRoles,driveItem:A,serverUrl:u.serverUrl}))):!z.isPersonalSpaceResource(g)&&!z.isPublicSpaceResource(g)&&(w=g)),yield s.loadAncestorMetaData({folder:w,space:g,client:d,signal:p}),z.isProjectSpaceResource(g)&&(yield i.loadGraphPermissions({ids:[g.id],graphClient:c})),z.isShareSpaceResource(g)&&(C.forEach(I=>I.remoteItemId=g.id),g.graphPermissions===void 0&&(A||(A=yield*z.call(li({graphClient:c,spacesStore:i,space:g,signal:p}))),ef({sharesStore:l,spacesStore:i,space:g,sharedDriveItem:A}))),s.initResourceList({currentFolder:w,resources:C})}catch(k){if(s.setCurrentFolder(null),console.error(k),k.statusCode===401)return o.handleAuthError(a(n.currentRoute))}}).restartable()}}class Df{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-common-favorites")||n?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:s}=t;return Ft.useTask(function*(o,i){n.clearResourceList(),n.setAncestorMetaData({});let l=yield r.webdav.listFavoriteFiles({username:s.user?.onPremisesSamAccountName,signal:o});l=l.map(z.buildResource),n.initResourceList({currentFolder:null,resources:l})})}}class Ff{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return pt(t,"files-shares-via-link")||n?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:s,configStore:o,resourcesStore:i}=t;return Ft.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:s.graphAuthenticated,signal:l}));const c=(yield*z.call(s.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(f=>f.permissions.some(({link:p})=>!!p)).map(f=>z.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class If{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return pt(t,"files-shares-with-me")||n?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:s,resourcesStore:o,sharesStore:i}=t;return Ft.useTask(function*(l,u){o.clearResourceList(),o.setAncestorMetaData({}),s.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:l}));const c=(yield*z.call(r.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:l}))).map(f=>z.buildIncomingShareResource({driveItem:f,graphRoles:i.graphRoles,serverUrl:s.serverUrl}));o.initResourceList({currentFolder:null,resources:c})})}}class Pf{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return pt(t,"files-shares-with-others")||n?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:s,configStore:o,resourcesStore:i}=t;return Ft.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:s.graphAuthenticated,signal:l}));const c=(yield*z.call(s.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(f=>f.permissions.some(({link:p})=>!p)).map(f=>z.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class $f{isEnabled(){return!0}isActive(t){return jt(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:s,graphAuthenticated:o}}=t;return Ft.useTask(function*(i,l,u){n.clearResourceList(),n.setAncestorMetaData({});const{resource:d,children:c}=yield s.listFiles(u,{},{depth:1,davProperties:Qs.Trashbin,isTrash:!0,signal:i});z.isProjectSpaceResource(u)&&(yield r.loadGraphPermissions({ids:[u.id],graphClient:o})),n.initResourceList({currentFolder:d,resources:c})})}}class Of{loaders;constructor(){this.loaders=[new Ef,new Df,new Ff,new If,new Pf,new $f]}getTask(){const t=Ze(),n=Ue(),r=Ct(),s=Ae(),o=Ee(),i=Qe(),l=Re(),u=Jn(),d=_l(),c=this.loaders.find(f=>f.isEnabled()&&f.isActive(a(s)));if(!c){console.debug("No folder loader found for route");return}return Ft.useTask(function*(...f){const p={clientService:o,configStore:i,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:l,sharesStore:u,router:s,authService:d};try{yield c.getTask(p).perform(...f)}catch(h){console.error(h)}})}}const Lf=new Of;var vr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(vr||{});const J0=200;class X0{tasks=[];get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(r=>!r.state&&r.active))return null;const t=this.tasks.filter(r=>!!r.state&&r.active);if(!t.length)return null;const n=t.reduce((r,s)=>(r+=s.state.current/s.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=J0,indeterminate:r=!0}={}){const s={id:wt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(s),et.debounce(()=>{s.active=!0,Xe.publish("loading-service.add")},n)(),t({setProgress:({total:l,current:u})=>{r||this.setProgress({task:s,total:l,current:u})}}).finally(()=>{this.removeTask(s.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Xe.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,Xe.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var Y0="__lodash_hash_undefined__";function Z0(e){return this.__data__.set(e,Y0),this}function e1(e){return this.__data__.has(e)}function yi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Kn;++t<n;)this.add(e[t])}yi.prototype.add=yi.prototype.push=Z0,yi.prototype.has=e1;function t1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function n1(e,t){return e.has(t)}var r1=1,s1=2;function _f(e,t,n,r,s,o){var i=n&r1,l=e.length,u=t.length;if(l!=u&&!(i&&u>l))return!1;var d=o.get(e),c=o.get(t);if(d&&c)return d==t&&c==e;var f=-1,p=!0,h=n&s1?new yi:void 0;for(o.set(e,t),o.set(t,e);++f<l;){var g=e[f],m=t[f];if(r)var b=i?r(m,g,f,t,e,o):r(g,m,f,e,t,o);if(b!==void 0){if(b)continue;p=!1;break}if(h){if(!t1(t,function(S,k){if(!n1(h,k)&&(g===S||s(g,S,n,r,o)))return h.push(k)})){p=!1;break}}else if(!(g===m||s(g,m,n,r,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function o1(e){var t=-1,n=Array(e.size);return e.forEach(function(r,s){n[++t]=[s,r]}),n}function i1(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var a1=1,l1=2,c1="[object Boolean]",u1="[object Date]",d1="[object Error]",f1="[object Map]",p1="[object Number]",h1="[object RegExp]",m1="[object Set]",g1="[object String]",y1="[object Symbol]",v1="[object ArrayBuffer]",b1="[object DataView]",Mf=en?en.prototype:void 0,Tl=Mf?Mf.valueOf:void 0;function w1(e,t,n,r,s,o,i){switch(n){case b1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case v1:return!(e.byteLength!=t.byteLength||!o(new ri(e),new ri(t)));case c1:case u1:case p1:return js(+e,+t);case d1:return e.name==t.name&&e.message==t.message;case h1:case g1:return e==t+"";case f1:var l=o1;case m1:var u=r&a1;if(l||(l=i1),e.size!=t.size&&!u)return!1;var d=i.get(e);if(d)return d==t;r|=l1,i.set(e,t);var c=_f(l(e),l(t),r,s,o,i);return i.delete(e),c;case y1:if(Tl)return Tl.call(e)==Tl.call(t)}return!1}function xl(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}function Nf(e,t,n){var r=t(e);return mn(e)?r:xl(r,n(e))}function S1(e,t){for(var n=-1,r=e==null?0:e.length,s=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[s++]=i)}return o}function Bf(){return[]}var k1=Object.prototype,C1=k1.propertyIsEnumerable,jf=Object.getOwnPropertySymbols,zf=jf?function(e){return e==null?[]:(e=Object(e),S1(jf(e),function(t){return C1.call(e,t)}))}:Bf,T1=xd(Object.keys,Object),x1=Object.prototype,A1=x1.hasOwnProperty;function R1(e){if(!Ka(e))return T1(e);var t=[];for(var n in Object(e))A1.call(e,n)&&n!="constructor"&&t.push(n);return t}function E1(e){return oi(e)?Nd(e):R1(e)}function Vf(e){return Nf(e,E1,zf)}var D1=1,F1=Object.prototype,I1=F1.hasOwnProperty;function P1(e,t,n,r,s,o){var i=n&D1,l=Vf(e),u=l.length,d=Vf(t),c=d.length;if(u!=c&&!i)return!1;for(var f=u;f--;){var p=l[f];if(!(i?p in t:I1.call(t,p)))return!1}var h=o.get(e),g=o.get(t);if(h&&g)return h==t&&g==e;var m=!0;o.set(e,t),o.set(t,e);for(var b=i;++f<u;){p=l[f];var S=e[p],k=t[p];if(r)var w=i?r(k,S,p,t,e,o):r(S,k,p,e,t,o);if(!(w===void 0?S===k||s(S,k,n,r,o):w)){m=!1;break}b||(b=p=="constructor")}if(m&&!b){var C=e.constructor,A=t.constructor;C!=A&&"constructor"in e&&"constructor"in t&&!(typeof C=="function"&&C instanceof C&&typeof A=="function"&&A instanceof A)&&(m=!1)}return o.delete(e),o.delete(t),m}var Al=Lr(Rn,"DataView"),Rl=Lr(Rn,"Promise"),El=Lr(Rn,"Set"),Dl=Lr(Rn,"WeakMap"),Uf="[object Map]",$1="[object Object]",qf="[object Promise]",Hf="[object Set]",Wf="[object WeakMap]",Qf="[object DataView]",O1=Or(Al),L1=Or(Vs),_1=Or(Rl),M1=Or(El),N1=Or(Dl),yn=$r;(Al&&yn(new Al(new ArrayBuffer(1)))!=Qf||Vs&&yn(new Vs)!=Uf||Rl&&yn(Rl.resolve())!=qf||El&&yn(new El)!=Hf||Dl&&yn(new Dl)!=Wf)&&(yn=function(e){var t=$r(e),n=t==$1?e.constructor:void 0,r=n?Or(n):"";if(r)switch(r){case O1:return Qf;case L1:return Uf;case _1:return qf;case M1:return Hf;case N1:return Wf}return t});var B1=1,Kf="[object Arguments]",Gf="[object Array]",vi="[object Object]",j1=Object.prototype,Jf=j1.hasOwnProperty;function z1(e,t,n,r,s,o){var i=mn(e),l=mn(t),u=i?Gf:yn(e),d=l?Gf:yn(t);u=u==Kf?vi:u,d=d==Kf?vi:d;var c=u==vi,f=d==vi,p=u==d;if(p&&qs(e)){if(!qs(t))return!1;i=!0,c=!1}if(p&&!c)return o||(o=new Dn),i||Ya(e)?_f(e,t,n,r,s,o):w1(e,t,u,n,r,s,o);if(!(n&B1)){var h=c&&Jf.call(e,"__wrapped__"),g=f&&Jf.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,b=g?t.value():t;return o||(o=new Dn),s(m,b,n,r,o)}}return p?(o||(o=new Dn),P1(e,t,n,r,s,o)):!1}function Xf(e,t,n,r,s){return e===t?!0:e==null||t==null||!Fn(e)&&!Fn(t)?e!==e&&t!==t:z1(e,t,n,r,Xf,s)}function Yf(e,t){return Xf(e,t)}class V1{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:n,authStore:r,configStore:s}){this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=s}get user(){return this.userStore.user}async loadPreview(t,n=!1,r=!0,s){const{space:o,resource:i}=t;if(!i.canDownload()||!i.hasPreview?.())return;const l=z.isPublicSpaceResource(o);if(!(!l&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(l)return this.publicPreviewUrl(t,s);try{return await this.privatePreviewBlob(t,n,r,s)}catch(u){if(r)return;throw u}}}async cacheFactory(t,n,r){const{resource:s,dimensions:o}=t,i=hl.filePreview.get(s.id.toString());if(i&&i.etag===s.etag&&Yf(o,i.dimensions))return i.src;try{const l=await this.privatePreviewBlob(t,!1,!0,r);return hl.filePreview.set(s.id.toString(),{src:l,etag:s.etag,dimensions:o},0).src}catch(l){if(n)return;throw l}}buildQueryString(t){return vg.stringify({scalingup:t.scalingup||0,preview:Object.hasOwnProperty.call(t,"preview")?t.preview:1,a:Object.hasOwnProperty.call(t,"a")?t.a:1,...t.processor&&{processor:t.processor},...t.etag&&{c:t.etag.replaceAll('"',"")},...t.dimensions&&t.dimensions[0]&&{x:t.dimensions[0]},...t.dimensions&&t.dimensions[1]&&{y:t.dimensions[1]}})}async privatePreviewBlob(t,n=!1,r=!0,s){const{resource:o,dimensions:i,processor:l}=t;if(n)return this.cacheFactory(t,r,s);const u=[this.configStore.serverUrl,"remote.php/dav",dl(o.webDavPath),"?",this.buildQueryString({etag:o.etag,dimensions:i,processor:l})].join("");try{const{data:d}=await this.clientService.httpAuthenticated.get(u,{responseType:"blob",signal:s});return window.URL.createObjectURL(d)}catch(d){if([425,429].includes(d.status)){const c=d.response?.headers?.["retry-after"]||5;return await new Promise(f=>setTimeout(f,c*1e3)),this.privatePreviewBlob(t,n,r,s)}throw d}}async publicPreviewUrl(t,n){const{space:r,resource:s,dimensions:o,processor:i}=t;let{downloadURL:l}=s;if(!l){const{downloadURL:p}=await this.clientService.webdav.getFileInfo(r,s,{davProperties:[Te.DownloadURL]});l=p}const[u,d]=l.split("?"),c=[this.buildQueryString({etag:s.etag,dimensions:o,processor:i}),d].filter(Boolean).join("&"),f=[u,c].filter(Boolean).join("?");try{const{status:p}=await this.clientService.httpUnAuthenticated.head(f,{signal:n});if(p!==404)return f}catch(p){if([425,429].includes(p.status)){const h=p.response?.headers?.["retry-after"]||5;return await new Promise(g=>setTimeout(g,h*1e3)),this.publicPreviewUrl(t,n)}throw p}}}const bi=G.z.enum(["fit","resize","fill","thumbnail"]);class U1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class q1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters}),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(s=>t.characters.includes(s)).length>=t.minLength}validate(t){if(!et.isObject(t))throw new Error("options should be an object");if(!et.isNumber(t.minLength)||et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!et.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class wi{$gettext;constructor({$gettext:t}){this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!et.isObject(t))throw new Error("options should be an object");if(!et.isNumber(t.minLength)||et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class H1 extends wi{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class W1 extends wi{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class Q1 extends wi{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class K1 extends wi{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...et.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/\d/g)?.length>=t.minLength}}class G1{language;capability;policy;generatePasswordRules;constructor({language:t}){this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const n={atLeastCharacters:new H1({...this.language}),mustNotBeEmpty:new U1({...this.language}),atLeastUppercaseCharacters:new W1({...this.language}),atLeastLowercaseCharacters:new Q1({...this.language}),atLeastDigits:new K1({...this.language}),mustContain:new q1({...this.language})},r={};t&&!this.hasRules()&&(r.mustNotBeEmpty={}),this.capability.min_characters&&(r.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(r.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(r.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(r.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(r.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new bg.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){const t="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="\"!#$%&'()*+,-./:;<=>?@[]^_`{|}~",s="0123456789",o=(h,g)=>{const m=256-256%h.length;let b="",S;for(let k=0;k<g;k++){do S=window.crypto.getRandomValues(new Uint8Array(1))[0];while(S>=m);b+=h[S%h.length]}return b},{minLowercaseCharacters:i,minUppercaseCharacters:l,minDigits:u,minSpecialCharacters:d,length:c}=this.generatePasswordRules;let f="";if(f+=o(t,i),f+=o(n,l),f+=o(s,u),f+=o(r,d),f.length<c){const h=c-f.length,g=t+n+r+s;f+=o(g,h)}return(h=>{const g=h.split(""),m=new Uint32Array(g.length);window.crypto.getRandomValues(m);for(let b=g.length-1;b>0;b--){const S=m[b]%(b+1);[g[b],g[S]]=[g[S],g[b]]}return g.join("")})(f)}}const Zf=e=>({name:We.basename(e),type:"directory",relativePath:e}),ep=(e,t)=>t.map(n=>({source:e,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}})),tp=async e=>{const t=await new Promise((r,s)=>e.file(r,s));return e.fullPath===z.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},J1=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*X1(e){const t=e.createReader(),n=()=>new Promise((s,o)=>{t.readEntries(s,o)});let r;do{r=await n();for(const s of r)yield s}while(r.length>0)}async function*np(e,t){if(e.isDirectory){let n=!1;for await(const r of X1(e))if(r.isDirectory)yield*np(r,t);else if(r.isFile)try{n=!0,yield tp(r)}catch(s){console.error(s),t?.(s)}n||(yield Zf(e.fullPath||e.name))}else try{yield tp(e)}catch(n){console.error(n),t?.(n)}}const Y1=async(e,t)=>{try{const n=[],r=await Promise.all(Array.from(e.items,s=>J1(s)));for(let s=0;s<r.length;s++)for await(const o of np(r[s],t))n.push(o);return n}catch(n){console.error(n);const r=Array.from(e.files);return Promise.resolve(r)}},Z1={target:null,uppyService:null};class ek extends kc.BasePlugin{nodes;uppyService;constructor(t,n){super(t,{...Z1,...n}),this.type="acquirer",this.id=this.opts.id||"DropTarget"}handleDrop=async t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(o=>{o.type==="acquirer"&&o.handleRootDrop?.(t)});let n=!1;const r=o=>{this.uppy.log(o,"error"),n||(this.uppy.info(o.message,"error"),n=!0)},s=await Y1(t.dataTransfer,r);if(s.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const o=ep("DropTarget",s);this.uppyService.addFiles(o)}catch(o){this.uppy.log(o)}}this.opts.onDrop?.(t),this.uppyService?.publish("drop",t)};handleDragOver=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(t),this.uppyService?.publish("drag-over",t)};handleDragLeave=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(t),this.uppyService?.publish("drag-out",t)};addListeners=()=>{const{target:t,uppyService:n}=this.opts;if(this.uppyService=n,t instanceof Element?this.nodes=[t]:typeof t=="string"&&(this.nodes=Cc.toArray(document.querySelectorAll(t))),!this.nodes||this.nodes.length===0)throw new Error(`"${t}" does not match any HTML elements`);this.nodes.forEach(r=>{r.addEventListener("dragover",this.handleDragOver,!1),r.addEventListener("dragleave",this.handleDragLeave,!1),r.addEventListener("drop",this.handleDrop,!1)})};removeListeners=()=>{this.nodes&&this.nodes.forEach(t=>{t.removeEventListener("dragover",this.handleDragOver,!1),t.removeEventListener("dragleave",this.handleDragLeave,!1),t.removeEventListener("drop",this.handleDrop,!1)})};install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}}class tk{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:n}=t;this.uppy=new kc({autoProceed:!1,onBeforeFileAdded:(r,s)=>r.id in s&&!s[r.id].error?!1:(r.name=r.name.normalize("NFC"),r.meta.relativePath=this.getRelativeFilePath(r)?.normalize("NFC"),r.id=this.generateUploadId(r),r)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:n("Added %{numFiles} file(s)"),authenticate:n("Connect"),authenticateWith:n("Connect to %{pluginName}"),authenticateWithTitle:n("Please authenticate with %{pluginName} to select files"),cancel:n("Cancel"),companionError:n("Connection with Companion failed"),loadedXFiles:n("Loaded %{numFiles} files"),loading:n("Loading..."),logOut:n("Log out"),pluginWebdavInputLabel:n("Public link without password protection"),selectX:{0:n("Select %{smart_count}"),1:n("Select %{smart_count}")},signInWithGoogle:n("Sign in with Google")}}}),this.setUpEvents()}getRelativeFilePath=t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?z.urlJoin(n):void 0};addPlugin(t,...n){this.uppy.use(t,...n)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:n,uploadDataDuringCreation:r,onBeforeRequest:s,headers:o}){const i={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:o,onBeforeRequest:s,onShouldRetry:(d,c,f,p)=>d?.originalResponse?.getStatus()>=500?!1:d?.originalResponse?.getStatus()===401?!0:p(d)},l=this.uppy.getPlugin("XHRUpload");l&&this.uppy.removePlugin(l);const u=this.uppy.getPlugin("Tus");if(u){u.setOptions(i);return}this.uppy.use(wg,i)}useXhr({headers:t,timeout:n,endpoint:r}){const s={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},o=this.uppy.getPlugin("Tus");o&&this.uppy.removePlugin(o);const i=this.uppy.getPlugin("XHRUpload");if(i){i.setOptions(s);return}this.uppy.use(Sg,s)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(ek,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Xe.subscribe(t,n)}unsubscribe(t,n){Xe.unsubscribe(t,n)}publish(t,n){Xe.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{if(!(!t||!t.successful.length&&!t.failed.length)){this.publish("uploadCompleted",t);for(let n=0;n<t.successful.length;n++)this.uppy.removeFile(t.successful[n].id);this.clearInputs()}}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,n)=>{this.publish("uploadError",{file:t,error:n})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",r=>{const s=r.target,o=Array.from(s.files);this.addFiles(o)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return Cc.generateFileID(t,this.uppy.getID())}log(t,n){this.uppy.log(t,n)}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}removeFailedFiles(){const{files:t}=this.uppy.getState(),n=Object.values(t).filter(r=>r.error);n.length&&this.uppy.removeFiles(n.map(({id:r})=>r))}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,n){this.uploadFolderMap[t]=n}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function nk(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var rk=Object.getOwnPropertySymbols,sk=rk?function(e){for(var t=[];e;)xl(t,zf(e)),e=Qa(e);return t}:Bf;function rp(e){return Nf(e,el,sk)}var ok=Object.prototype,ik=ok.hasOwnProperty;function ak(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&ik.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function lk(e,t){var n=Wa(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var ck=/\w*$/;function uk(e){var t=new e.constructor(e.source,ck.exec(e));return t.lastIndex=e.lastIndex,t}var sp=en?en.prototype:void 0,op=sp?sp.valueOf:void 0;function dk(e){return op?Object(op.call(e)):{}}var fk="[object Boolean]",pk="[object Date]",hk="[object Map]",mk="[object Number]",gk="[object RegExp]",yk="[object Set]",vk="[object String]",bk="[object Symbol]",wk="[object ArrayBuffer]",Sk="[object DataView]",kk="[object Float32Array]",Ck="[object Float64Array]",Tk="[object Int8Array]",xk="[object Int16Array]",Ak="[object Int32Array]",Rk="[object Uint8Array]",Ek="[object Uint8ClampedArray]",Dk="[object Uint16Array]",Fk="[object Uint32Array]";function Ik(e,t,n){var r=e.constructor;switch(t){case wk:return Wa(e);case fk:case pk:return new r(+e);case Sk:return lk(e);case kk:case Ck:case Tk:case xk:case Ak:case Rk:case Ek:case Dk:case Fk:return Cd(e,n);case hk:return new r;case mk:case vk:return new r(e);case gk:return uk(e);case yk:return new r;case bk:return dk(e)}}var Pk="[object Map]";function $k(e){return Fn(e)&&yn(e)==Pk}var ip=is&&is.isMap,Ok=ip?Ja(ip):$k,Lk="[object Set]";function _k(e){return Fn(e)&&yn(e)==Lk}var ap=is&&is.isSet,Mk=ap?Ja(ap):_k,Nk=1,lp="[object Arguments]",Bk="[object Array]",jk="[object Boolean]",zk="[object Date]",Vk="[object Error]",cp="[object Function]",Uk="[object GeneratorFunction]",qk="[object Map]",Hk="[object Number]",up="[object Object]",Wk="[object RegExp]",Qk="[object Set]",Kk="[object String]",Gk="[object Symbol]",Jk="[object WeakMap]",Xk="[object ArrayBuffer]",Yk="[object DataView]",Zk="[object Float32Array]",eC="[object Float64Array]",tC="[object Int8Array]",nC="[object Int16Array]",rC="[object Int32Array]",sC="[object Uint8Array]",oC="[object Uint8ClampedArray]",iC="[object Uint16Array]",aC="[object Uint32Array]",tt={};tt[lp]=tt[Bk]=tt[Xk]=tt[Yk]=tt[jk]=tt[zk]=tt[Zk]=tt[eC]=tt[tC]=tt[nC]=tt[rC]=tt[qk]=tt[Hk]=tt[up]=tt[Wk]=tt[Qk]=tt[Kk]=tt[Gk]=tt[sC]=tt[oC]=tt[iC]=tt[aC]=!0,tt[Vk]=tt[cp]=tt[Jk]=!1;function Si(e,t,n,r,s,o){var i,l=t&Nk;if(n&&(i=s?n(e,r,s,o):n(e)),i!==void 0)return i;if(!En(e))return e;var u=mn(e);if(u)i=ak(e);else{var d=yn(e),c=d==cp||d==Uk;if(qs(e))return kd(e,l);if(d==up||d==lp||c&&!s)i={};else{if(!tt[d])return s?e:{};i=Ik(e,d,l)}}o||(o=new Dn);var f=o.get(e);if(f)return f;o.set(e,i),Mk(e)?e.forEach(function(g){i.add(Si(g,t,n,g,e,o))}):Ok(e)&&e.forEach(function(g,m){i.set(m,Si(g,t,n,m,e,o))});var p=rp,h=u?void 0:p(e);return nk(h||e,function(g,m){h&&(m=g,g=e[m]),Ld(i,m,Si(g,t,n,m,e,o))}),i}function lC(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(s);++r<s;)o[r]=e[r+t];return o}function cC(e,t){return t.length<2?e:gf(e,lC(t,0,-1))}var uC=Object.prototype,dC=uC.hasOwnProperty;function fC(e,t){t=wl(t,e);var n=-1,r=t.length;if(!r)return!0;for(var s=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var o=t[n];if(typeof o=="string"){if(o==="__proto__"&&!dC.call(e,"__proto__"))return!1;if(o==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(s&&n===0)continue;return!1}}}var i=cC(e,t);return i==null||delete i[mf(Rc(t))]}function pC(e){return Ga(e)?void 0:e}var dp=en?en.isConcatSpreadable:void 0;function hC(e){return mn(e)||si(e)||!!(dp&&e&&e[dp])}function mC(e,t,n,r,s){var o=-1,i=e.length;for(n||(n=hC),s||(s=[]);++o<i;){var l=e[o];n(l)?xl(s,l):s[s.length]=l}return s}function gC(e){var t=e==null?0:e.length;return t?mC(e):[]}function yC(e){return Ud(Vd(e,void 0,gC),e+"")}var vC=1,bC=2,wC=4,ps=yC(function(e,t){var n={};if(e==null)return n;var r=!1;t=df(t,function(o){return o=wl(o,e),r||(r=o.length>1),o}),_d(e,rp(e),n),r&&(n=Si(n,vC|bC|wC,pC));for(var s=t.length;s--;)fC(n,t[s]);return n});const SC=(e,t)=>{const n=(o="")=>o.split("/").filter(Boolean),r=n(e.path),s=n(t);return s.map((o,i)=>({id:wt.v4(),allowContextActions:!0,text:o,to:{path:"/"+[...r].splice(0,r.length-s.length+i+1).join("/"),query:ps(e.query,"fileId","page")},isStaticNav:!1}))},kC=(...e)=>{const t=e.pop();return[...e,{id:wt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class Js{static Cut="cut";static Copy="copy"}const ki=e=>(e||"").split("_")[0],Nr=(e,t,n=ht.DateTime.DATETIME_MED)=>e.setLocale(ki(t)).toLocaleString(n),fp=(e,t,n=ht.DateTime.DATETIME_MED)=>Nr(ht.DateTime.fromJSDate(e),t,n),CC=(e,t,n=ht.DateTime.DATETIME_MED)=>Nr(ht.DateTime.fromHTTP(e),t,n),pp=(e,t,n=ht.DateTime.DATETIME_MED)=>Nr(ht.DateTime.fromISO(e),t,n),TC=(e,t,n=ht.DateTime.DATETIME_MED)=>Nr(ht.DateTime.fromRFC2822(e),t,n),Xs=(e,t)=>e.setLocale(ki(t)).toRelative(),hp=(e,t)=>Xs(ht.DateTime.fromJSDate(e),t),xC=(e,t)=>Xs(ht.DateTime.fromHTTP(e),t),AC=(e,t)=>Xs(ht.DateTime.fromISO(e),t),RC=(e,t)=>Xs(ht.DateTime.fromRFC2822(e),t),EC=1048576,zt=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":yg.filesize(n,{round:n<EC?0:1,locale:ki(t),base:10,output:"string"})};function mp(e="",t=!1){const n=z.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],s=n.split("/");for(t&&r.push(n),s.pop();s.length>0;){if(!s.join("/")){s.pop();continue}r.push(s.join("/")),s.pop()}return r}const gp=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=s=>n(s),r.readAsArrayBuffer(e)}),yp=e=>new Promise(t=>e.toBlob(t)),Ys=()=>window.navigator.platform.match("Mac");function Br(e){return e.status==="fulfilled"}function jr(e){return e.status==="rejected"}const Fl=e=>new TextEncoder().encode(e).length,DC=()=>`OpenCloud Web UI ${ce.env.PACKAGE_VERSION}`,vp=({capabilityStore:e})=>{const t=e.status;if(!t||!t.versionstring)return;const n=t.product||"OpenCloud",r=t.productversion||t.versionstring,s=t.edition||"";return`${n} ${r} ${s}`.trim()},Me=ve.defineStore("messages",()=>{const e=H([]),t=o=>{const i={...o,id:wt.v4()};return e.value.push(i),i},n=o=>{const i=l=>l.response?.headers?.get("x-request-id");return o.map(l=>i(l)).filter(Boolean).map(l=>`X-Request-Id: ${l}`).join(`\r
9
- `)};return{messages:e,showMessage:t,showErrorMessage:o=>{const i={id:wt.v4(),status:"danger",timeout:0,...o.errors&&{errorLogContent:n(o.errors)},...o};return e.value.push(i),i},removeMessage:o=>{e.value=a(e).filter(({id:i})=>o.id!==i)}}}),Zs=ve.defineStore("clipboard",()=>{const{$gettext:e}=de.useGettext(),{showMessage:t}=Me(),n=H(),r=H([]);return{action:n,resources:r,copyResources:l=>{l[0]?.canDownload()&&(n.value=Js.Copy,r.value=l,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:l=>{l[0]?.canDownload()&&(n.value=Js.Cut,r.value=l,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),bp=ve.defineStore("extensionPreferences",()=>{const e=Cn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(s,o)=>s.multiple?o.map(i=>i.id):s.defaultExtensionId?[s.defaultExtensionId]:[],getExtensionPreference:(s,o)=>{const i=e.value[s];return i||{extensionPointId:s,selectedExtensionIds:o}},setSelectedExtensionIds:(s,o)=>{if(!Object.hasOwn(a(e),s)){e.value[s]={extensionPointId:s,selectedExtensionIds:o};return}e.value[s].selectedExtensionIds=o}}}),br=ve.defineStore("extensionRegistry",()=>{const e=Qe(),t=H([]),n=d=>{t.value.push(d)},r=d=>{t.value=a(t).map(c=>H(a(c).filter(({id:f})=>!d.includes(f)))).filter(c=>a(c).length)},s=d=>{if(!d.id||!d.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return a(t).flatMap(c=>a(c).filter(f=>f.type===d.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||f.extensionPointIds?.includes(d.id))))},o=H([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:s,extensionPoints:o,registerExtensionPoints:d=>{o.value.push(d)},unregisterExtensionPoints:d=>{o.value=a(o).map(c=>H(a(c).filter(({id:f})=>!d.includes(f)))).filter(c=>a(c).length)},getExtensionPoints:(d={})=>a(o).flatMap(c=>a(c).filter(f=>!(Object.hasOwn(d,"extensionType")&&f.extensionType!==d.extensionType)))}}),FC=ve.defineStore("groupwareConfig",()=>{const e=H(""),t=H([]),n=H(),r=H([]),s=H({});return{version:e,capabilities:t,limits:n,accounts:r,primaryAccounts:s,loadGroupwareConfig:i=>{e.value=i.version,t.value=i.capabilities||[],n.value=i.limits,r.value=i.accounts||[],s.value=i.primaryAccounts||{}}}}),wp=G.z.object({maxMailboxDepth:G.z.number(),maxSizeMailboxName:G.z.number(),maxMailboxesPerEmail:G.z.number(),maxSizeAttachmentsPerEmail:G.z.number(),mayCreateTopLevelMailbox:G.z.boolean(),maxDelayedSend:G.z.number()}),Sp=G.z.object({maxSizeScriptName:G.z.number(),maxSizeScript:G.z.number(),maxNumberScripts:G.z.number(),maxNumberRedirects:G.z.number()}),kp=G.z.object({mail:wp.optional(),sieve:Sp.optional()}),Cp=G.z.object({id:G.z.string(),name:G.z.string(),email:G.z.string().email(),mayDelete:G.z.boolean()}),Tp=G.z.object({accountId:G.z.string(),name:G.z.string(),isPersonal:G.z.boolean(),isReadOnly:G.z.boolean(),capabilities:kp,identities:G.z.array(Cp)}),xp=G.z.object({maxSizeUpload:G.z.number(),maxConcurrentUpload:G.z.number(),maxSizeRequest:G.z.number(),maxConcurrentRequests:G.z.number()}),Ap=G.z.array(Tp),Rp=G.z.record(G.z.string(),G.z.string()),IC=G.z.object({version:G.z.string(),capabilities:G.z.array(G.z.string()),limits:xp,accounts:Ap,primaryAccounts:Rp}),Ke=ve.defineStore("modals",()=>{const e=H([]),t=T(()=>a(e).at(-1)),n=u=>a(e).find(d=>d.id===u);return{modals:e,activeModal:t,dispatchModal:u=>{const d={...u,id:wt.v4()};return e.value.push(d),d},updateModal:(u,d,c)=>{const f=n(u);f[d]=c},removeModal:u=>{e.value=a(e).filter(d=>d.id!==u)},removeAllModals:()=>{e.value=[]},setModalActive:u=>{const d=a(e).findIndex(f=>f.id===u);if(d<0)return;const c=n(u);a(e).splice(d,1),e.value.push(c)}}}),Ze=ve.defineStore("user",()=>{const e=H();return{user:e,setUser:r=>{e.value=r,Cg.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}});function PC(e,t,n,r){for(var s=-1,o=e==null?0:e.length;++s<o;)n=t(n,e[s],s,e);return n}function $C(e){return function(t){return e?.[t]}}var OC={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},LC=$C(OC),_C=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,MC="\\u0300-\\u036f",NC="\\ufe20-\\ufe2f",BC="\\u20d0-\\u20ff",jC=MC+NC+BC,zC="["+jC+"]",VC=RegExp(zC,"g");function UC(e){return e=bl(e),e&&e.replace(_C,LC).replace(VC,"")}var qC=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function HC(e){return e.match(qC)||[]}var WC=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function QC(e){return WC.test(e)}var Ep="\\ud800-\\udfff",KC="\\u0300-\\u036f",GC="\\ufe20-\\ufe2f",JC="\\u20d0-\\u20ff",XC=KC+GC+JC,Dp="\\u2700-\\u27bf",Fp="a-z\\xdf-\\xf6\\xf8-\\xff",YC="\\xac\\xb1\\xd7\\xf7",ZC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",eT="\\u2000-\\u206f",tT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ip="A-Z\\xc0-\\xd6\\xd8-\\xde",nT="\\ufe0e\\ufe0f",Pp=YC+ZC+eT+tT,$p="['’]",Op="["+Pp+"]",rT="["+XC+"]",Lp="\\d+",sT="["+Dp+"]",_p="["+Fp+"]",Mp="[^"+Ep+Pp+Lp+Dp+Fp+Ip+"]",oT="\\ud83c[\\udffb-\\udfff]",iT="(?:"+rT+"|"+oT+")",aT="[^"+Ep+"]",Np="(?:\\ud83c[\\udde6-\\uddff]){2}",Bp="[\\ud800-\\udbff][\\udc00-\\udfff]",hs="["+Ip+"]",lT="\\u200d",jp="(?:"+_p+"|"+Mp+")",cT="(?:"+hs+"|"+Mp+")",zp="(?:"+$p+"(?:d|ll|m|re|s|t|ve))?",Vp="(?:"+$p+"(?:D|LL|M|RE|S|T|VE))?",Up=iT+"?",qp="["+nT+"]?",uT="(?:"+lT+"(?:"+[aT,Np,Bp].join("|")+")"+qp+Up+")*",dT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",pT=qp+Up+uT,hT="(?:"+[sT,Np,Bp].join("|")+")"+pT,mT=RegExp([hs+"?"+_p+"+"+zp+"(?="+[Op,hs,"$"].join("|")+")",cT+"+"+Vp+"(?="+[Op,hs+jp,"$"].join("|")+")",hs+"?"+jp+"+"+zp,hs+"+"+Vp,fT,dT,Lp,hT].join("|"),"g");function gT(e){return e.match(mT)||[]}function yT(e,t,n){return e=bl(e),t=t,t===void 0?QC(e)?gT(e):HC(e):e.match(t)||[]}var vT="['’]",bT=RegExp(vT,"g");function wT(e){return function(t){return PC(yT(UC(t).replace(bT,"")),e,"")}}var Hp=wT(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Wp=G.z.object({name:G.z.string().optional(),slogan:G.z.string().optional(),logo:G.z.string().optional(),logoMobile:G.z.string().optional(),urls:G.z.object({accessDeniedHelp:G.z.string().optional(),imprint:G.z.string().optional(),privacy:G.z.string().optional(),accessibility:G.z.string().optional()}).optional(),shareRoles:G.z.record(G.z.string(),G.z.object({iconName:G.z.string()})).optional()}),ST=G.z.object({roles:G.z.record(G.z.string(),G.z.string()).optional(),colorPalette:G.z.record(G.z.string(),G.z.string()).optional(),fontFamily:G.z.string().optional()}),Qp=Wp.extend({designTokens:ST.optional(),favicon:G.z.string().optional(),background:G.z.string().optional()}),kT=Qp.extend({isDark:G.z.boolean(),label:G.z.string()}),Kp=G.z.object({defaults:Qp,themes:G.z.array(kT)}),CT=G.z.object({common:Wp.optional(),clients:G.z.object({web:Kp})}),TT="oc_currentThemeName",xT=e=>{let t=document.querySelector("link[rel~='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},On=ve.defineStore("theme",()=>{const e=Cn.useLocalStorage(TT,null),t=Cn.usePreferredDark(),n=H(),r=H([]),s=c=>{const f=c.common,p=c.clients.web.defaults,h=Ac(f,p);r.value=c.clients.web.themes.map(g=>Ac(h,g)),o()},o=()=>{const c=a(r).find(p=>!p.isDark),f=a(r).find(p=>p.isDark);u(a(r).find(p=>p.label===a(e))||(a(t)?f:c)||a(r)[0],!1)},i=()=>{e.value=null,o()},l=T(()=>e.value===null),u=(c,f=!0)=>{n.value=c,f&&(e.value=a(n).label);const p=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];ci("font-family",a(n).designTokens.fontFamily),p.forEach(h=>{for(const g in a(n).designTokens[h.name])ci(`${h.prefix}-${Hp(g)}`,a(n).designTokens[h.name][g])}),a(n).designTokens?.roles?.chrome||(ci("role-chrome",a(n).designTokens?.roles?.surfaceContainer),ci("role-on-chrome",a(n).designTokens?.roles?.onSurface)),a(n).favicon&&xT(a(n).favicon)};return{availableThemes:r,currentTheme:n,initializeThemes:s,setAndApplyTheme:u,setAutoSystemTheme:i,isCurrentThemeAutoSystem:l,getRoleIcon:c=>a(n).shareRoles[c.id]?.iconName||"user"}}),Jn=ve.defineStore("shares",()=>{const e=Re(),{getRoleIcon:t}=On(),n=H(!1),r=H([]),s=H([]),o=H({}),i=_=>{o.value=_.reduce((F,V)=>(F[V.id]={...V,icon:t(V)},F),{})},l=_=>{const F=a(r).find(({id:V})=>V===_.id);if(F){Object.assign(F,_);return}a(r).push(_)},u=_=>{r.value=_},d=_=>{a(r).push(..._)},c=_=>{r.value=a(r).filter(({id:F})=>F!==_.id)},f=()=>{r.value=[],s.value=[],n.value=void 0},p=()=>{const _=Object.values(e.ancestorMetaData).map(({id:F})=>F);if(!_.length){r.value=[],s.value=[];return}a(r).forEach(F=>{_.includes(F.resourceId)||c(F)}),a(s).forEach(F=>{_.includes(F.resourceId)||m(F)})},h=_=>{s.value=_},g=_=>{const F=a(s).find(({id:V})=>V===_.id);if(F){Object.assign(F,_);return}a(s).push(_)},m=_=>{s.value=a(s).filter(({id:F})=>F!==_.id)},b=_=>{n.value=_},S=_=>{const F=$=>{const L=new Set;return $.forEach(M=>{L.add(M.shareType)}),Array.from(L)},V=[...e.resources,e.currentFolder].find($=>$?.id===_);if(!V||z.isProjectSpaceResource(V))return;const Z=[...a(r),...a(s)];e.updateResourceField({id:V.id,field:"shareTypes",value:F(Z.filter($=>!$.indirect))});const P=e.getAncestorById(_);P&&e.updateAncestorField({path:P.path,field:"shareTypes",value:F(Z.filter($=>!$.indirect))})};return{loading:n,collaboratorShares:r,linkShares:s,graphRoles:o,setGraphRoles:i,setLoading:b,setCollaboratorShares:u,setLinkShares:h,removeOrphanedShares:p,pruneShares:f,addShare:async({clientService:_,space:F,resource:V,options:Z})=>{const $=await _.graphAuthenticated.permissions.createInvite(F.id,V.id,Z,a(o));return d([$]),S(V.id),$},updateShare:async({clientService:_,space:F,resource:V,collaboratorShare:Z,options:P})=>{const $=_.graphAuthenticated.permissions,L={roles:P.roles,expirationDateTime:P.expirationDateTime},M=await $.updatePermission(F.id,V.id,Z.id,L,a(o));return l(M),M},deleteShare:async({clientService:_,space:F,resource:V,collaboratorShare:Z})=>{await _.graphAuthenticated.permissions.deletePermission(F.id,V.id,Z.id),c(Z),S(V.id)},addLink:async({clientService:_,space:F,resource:V,options:Z})=>{const $=await _.graphAuthenticated.permissions.createLink(F.id,V.id,Z),L=e.selectedResources,M=L.some(({fileId:j})=>j===V.fileId)||L.length===0&&e.currentFolder.fileId===V.fileId;if(g($),S(V.id),!M){const j=e.ancestorMetaData[V.path]??null;if(j){const{shareTypes:B}=j;B.includes(z.ShareTypes.link.value)||e.updateAncestorField({path:j.path,field:"shareTypes",value:[...B,z.ShareTypes.link.value]})}}return $},updateLink:async({clientService:_,space:F,resource:V,linkShare:Z,options:P})=>{const $=_.graphAuthenticated.permissions;let L;if(Object.hasOwn(P,"password"))L=await $.setPermissionPassword(F.id,V.id,Z.id,{password:P.password}),Z.hasPassword=!!P.password;else{const M={link:{...P.type&&{type:P.type},...P.displayName&&{"@libre.graph.displayName":P.displayName}},...Object.hasOwn(P,"expirationDateTime")&&{expirationDateTime:P.expirationDateTime}};L=await $.updatePermission(F.id,V.id,Z.id,M)}return g(L),L},deleteLink:async({clientService:_,space:F,resource:V,linkShare:Z})=>{await _.graphAuthenticated.permissions.deletePermission(F.id,V.id,Z.id),m(Z),S(V.id)}}}),Vt={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},Gp={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Jp=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),eo=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{const s=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!s.length)return[];if(t!=="mountpoint"||!n.options.routing?.fullShareOwnerPaths)return s;const o={};s.forEach(l=>{const{rootId:u,driveAlias:d}=l.root.remoteItem;o[u]=d});const i=Object.entries(o).map(([l,u])=>z.buildSpace({id:z.extractStorageId(l),name:u,driveType:u.split("/")[0],driveAlias:u,path:"/",serverUrl:n.serverUrl}));return[...s,...i]},Ue=ve.defineStore("spaces",()=>{const e=Ze(),t=Qe(),n=Jn(),r=H([]),s=H(),o=H(!1),i=H(!1),l=H(!1),u=H(null),d=H([]),c=H([]),f=T(()=>a(r).find(J=>z.isPersonalSpaceResource(J)&&J.isOwner(e.user))),p=J=>{o.value=J},h=J=>{i.value=J},g=J=>{l.value=J},m=J=>{s.value=J},b=J=>{u.value=J},S=J=>{if(!z.isProjectSpaceResource(J))return[];const oe=n.collaboratorShares.filter(ne=>ne.resourceId===J.id);return Jp(oe)},k=J=>{a(r).push(...J)},w=J=>{r.value=a(r).filter(({id:oe})=>oe!==J.id)},C=J=>a(r).find(oe=>J==oe.id),A=async({graphClient:J,space:oe,signal:ne})=>(await V({graphClient:J,signal:ne}),a(r).find(pe=>z.isMountPointSpaceResource(pe)&&pe.root?.remoteItem?.id===oe.id)),I=({driveAliasPrefix:J,id:oe,shareName:ne})=>{const pe=z.buildShareSpaceResource({driveAliasPrefix:J,id:oe,shareName:ne,serverUrl:t.serverUrl});return k([pe]),pe},N=J=>{const oe=a(r).find(({id:ne})=>ne===J.id);if(oe){Object.assign(oe,J);return}k([J])},_=({id:J,field:oe,value:ne})=>{const pe=a(r).find(fe=>J===fe.id);pe&&(pe[oe]=ne)},F=async({graphClient:J})=>{l.value=!0;try{const[oe,ne]=await Promise.all([eo({graphClient:J,driveType:"personal",configStore:t}),eo({graphClient:J,driveType:"project",configStore:t})]);k([...oe,...ne])}finally{l.value=!1}},V=async({graphClient:J,signal:oe})=>{if(!a(i))try{const ne=await eo({graphClient:J,driveType:"mountpoint",configStore:t,signal:oe});k(ne)}finally{i.value=!0}},Z=async({graphClient:J,signal:oe})=>{const ne=await eo({graphClient:J,driveType:"project",configStore:t,signal:oe});r.value=a(r).filter(pe=>!z.isProjectSpaceResource(pe)),k(ne)},P=J=>{a(d).includes(J)||a(d).push(J)},$=J=>{d.value=a(d).filter(oe=>oe!==J)},L=()=>{d.value=[]},M=J=>{a(c).includes(J)||a(c).push(J)},j=J=>{c.value=a(c).filter(oe=>oe!==J)},B=()=>{c.value=[]},q=H({});return{spaces:r,spacesInitialized:o,mountPointsInitialized:i,spacesLoading:l,currentSpace:s,personalSpace:f,defaultSpaceImageBlobURL:u,imagesLoading:d,readmesLoading:c,getSpace:C,createShareSpace:I,setSpacesInitialized:p,setMountPointsInitialized:h,setSpacesLoading:g,setCurrentSpace:m,setDefaultSpaceImageBlobURL:b,getSpaceMembers:S,getMountPointForSpace:A,addSpaces:k,removeSpace:w,upsertSpace:N,updateSpaceField:_,loadSpaces:F,loadMountPoints:V,reloadProjectSpaces:Z,addToImagesLoading:P,removeFromImagesLoading:$,purgeImagesLoading:L,addToReadmesLoading:M,removeFromReadmesLoading:j,purgeReadmesLoading:B,loadGraphPermissions:async({ids:J,graphClient:oe,useCache:ne=!0})=>{const pe=a(r).filter(fe=>J.includes(fe.id)&&(fe.graphPermissions===void 0||!ne));if(pe.length){for(const{id:fe,disabled:we}of pe){if(we){_({id:fe,field:"graphPermissions",value:[]});continue}a(q)[fe]||(q.value[fe]=oe.permissions.listPermissions(fe,fe,n.graphRoles,{select:[Gp.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:$e})=>{_({id:fe,field:"graphPermissions",value:$e}),delete q.value[fe]}))}await Promise.all(Object.values(a(q)))}}}}),Re=ve.defineStore("resources",()=>{const e=Qe(),t=Ue(),n=Ze(),r=H([]),s=H(),o=H({}),i=H([]),l=T(()=>{let ae=a(r);return a(P)||(ae=ae.filter(ue=>!ue.name.startsWith("."))),ae}),u=T(()=>{const ae=a(r).filter(({type:_e})=>_e==="file").length,ue=a(r).filter(({type:_e,name:ut})=>_e==="file"&&ut.startsWith(".")).length,be=a(r).filter(({type:_e})=>_e==="folder").length,me=a(r).filter(({type:_e,name:ut})=>_e==="folder"&&ut.startsWith(".")).length,De=a(r).filter(z.isProjectSpaceResource).length;return{files:ae,hiddenFiles:ue,folders:be,hiddenFolders:me,spaces:De}}),d=ae=>{r.value=ae},c=ae=>{r.value=a(r).filter(ue=>!ae.find(({id:be})=>be===ue.id))},f=()=>{r.value=[]},p=ae=>{const ue=a(r).find(({id:be})=>be===ae.id);if(ue){Object.assign(ue,ae);return}a(r).push(ae)},h=ae=>{const ue=a(r).filter(be=>!ae.some(me=>me.path===be.path));r.value=[...ue,...ae]},g=({id:ae,field:ue,value:be})=>{const me=a(r).find(De=>ae===De.id);me&&(me[ue]=be)},m=ae=>{s.value=ae},b=()=>{s.value=void 0},S=ae=>{r.value=ae.resources,s.value=ae.currentFolder},k=()=>{r.value=[],s.value=void 0,w.value=[]},w=H([]),C=H(null),A=T(()=>a(r).filter(ae=>a(w).includes(ae.id))),I=ae=>{const ue=ae.find(be=>!a(w).includes(be));ue&&(C.value=ue),w.value=ae},N=ae=>{C.value=ae,a(w).includes(ae)||a(w).push(ae)},_=ae=>{C.value=ae,a(w).includes(ae)&&(w.value=a(w).filter(ue=>ue!==ae))},F=ae=>{a(w).includes(ae)?_(ae):N(ae)},V=()=>{w.value=[]},Z=ae=>{C.value=ae},P=H(!0),$=H(!0),L=H(!1),M=H(!0),j=H(!0),B=ae=>{P.value=ae,window.localStorage.setItem("oc_hiddenFilesShown",ae.toString())},q=ae=>{$.value=ae,window.localStorage.setItem("oc_fileExtensionsShown",ae.toString())},re=ae=>{L.value=ae,window.localStorage.setItem("oc_webDavDetailsShown",ae.toString())},J=ae=>{M.value=ae,window.localStorage.setItem("oc_disabledSpacesShown",ae.toString())},oe=ae=>{j.value=ae,window.localStorage.setItem("oc_emptyTrashesShown",ae.toString())},ne=ae=>{o.value=ae};return{resources:r,currentFolder:s,activeResources:l,totalResourcesCount:u,setResources:d,removeResources:c,clearResources:f,upsertResource:p,upsertResources:h,updateResourceField:g,setCurrentFolder:m,clearCurrentFolder:b,initResourceList:S,clearResourceList:k,selectedIds:w,latestSelectedId:C,selectedResources:A,setSelection:I,addSelection:N,removeSelection:_,toggleSelection:F,resetSelection:V,setLastSelectedId:Z,areHiddenFilesShown:P,areFileExtensionsShown:$,areWebDavDetailsShown:L,areDisabledSpacesShown:M,areEmptyTrashesShown:j,setAreHiddenFilesShown:B,setAreFileExtensionsShown:q,setAreWebDavDetailsShown:re,setAreDisabledSpacesShown:J,setAreEmptyTrashesShown:oe,ancestorMetaData:o,setAncestorMetaData:ne,updateAncestorField:({path:ae,field:ue,value:be})=>{const me=a(o)[ae]??null;me&&(me[ue]=be)},loadAncestorMetaData:({folder:ae,space:ue,client:be,signal:me})=>{const De={[ae.path]:{id:ae.fileId,shareTypes:ae.shareTypes,parentFolderId:ae.parentFolderId,spaceId:ue.id,path:ae.path}},_e=[],ut=[Te.FileId,Te.ShareTypes,Te.FileParent],Kt=mp(ae.path),vt=t.spaces,Dt=()=>vt.filter(ye=>z.isMountPointSpaceResource(ye)&&z.extractStorageId(ye.root.remoteItem.rootId)===ue.id);let Ve=!0;if(e.options.routing.fullShareOwnerPaths){const ye=vt.some(Fe=>z.isProjectSpaceResource(Fe)&&Fe.id===ue.id);Ve=ue.isOwner(n.user)||ye}for(const ye of Kt){const Fe=a(o)[ye]??null;if(Fe?.spaceId===ue.id){De[ye]=Fe;continue}if(!Ve&&!Dt().find(gt=>ye.startsWith(gt.root.remoteItem.path)))break;_e.push(be.listFiles(ue,{path:ye},{depth:0,davProperties:ut,signal:me}).then(({resource:gt})=>{De[ye]={id:gt.fileId,shareTypes:gt.shareTypes,parentFolderId:gt.parentFolderId,spaceId:ue.id,path:ye}}))}return Promise.all(_e).then(()=>{if(!Object.keys(De).includes("/")){const ye=a(o)["/"];if(ye?.spaceId===ue.id)De["/"]=ye;else{const{parentFolderId:Fe}=Object.values(De)[0],gt=t.spaces.find(({id:Qr})=>Fe.startsWith(Qr));gt&&(De["/"]={id:gt.id,shareTypes:gt.shareTypes,parentFolderId:gt.id,spaceId:gt.id,path:"/"})}}ne(De)})},getAncestorById:ae=>Object.values(a(o)).find(ue=>ae===ue.id),deleteQueue:i,addResourcesIntoDeleteQueue:ae=>{i.value=i.value.concat(ae.filter(ue=>!a(i).includes(ue)))},removeResourcesFromDeleteQueue:ae=>{i.value=i.value.filter(ue=>!ae.includes(ue))}}}),Il=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=H(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return ze(()=>a(r),(s,o)=>{s!==o&&(s!==void 0?window.localStorage.setItem(e,typeof s=="string"?s:JSON.stringify(s)):window.localStorage.removeItem(e))},{deep:!0}),r},wr=()=>{const e=Qe(),t=T(()=>e.options.embed?.enabled),n=T(()=>e.options.embed?.target==="location"),r=T(()=>e.options.embed?.chooseFileName),s=T(()=>e.options.embed?.chooseFileNameSuggestion),o=T(()=>e.options.embed?.target==="file"),i=T(()=>e.options.embed?.fileTypes),l=T(()=>e.options.embed?.messagesOrigin),u=T(()=>a(t)&&e.options.embed?.delegateAuthentication),d=T(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:s,isFilePicker:o,messagesTargetOrigin:l,isDelegatingAuthentication:u,fileTypes:i,postMessage:(p,h)=>{const g={};a(l)&&(g.targetOrigin=a(l)),window.parent.postMessage({name:p,data:h},g)},verifyDelegatedAuthenticationOrigin:p=>a(d)?a(d)===p:!0}},Xp=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:H(!0)};const o=H(!1),i=new IntersectionObserver(l=>{const u=l.at(-1).isIntersecting;o.value=u,a(o)&&r&&r(),t!=="showHide"&&o.value&&i.unobserve(e.value)},{rootMargin:n});return ze(e,()=>{i.observe(e.value)}),Xt(()=>i.disconnect()),{isVisible:o}},to=()=>{const{width:e}=Cn.useWindowSize();return{isMobile:T(()=>e.value<640)}},AT=ve.defineStore("bottomDrawers",()=>{const e=H([]),t=T(()=>a(e).length?a(e)[a(e).length-1]:null);return{drawers:e,currentDrawer:t,showDrawer:()=>{const o={id:Mr()};return e.value.push(o),o},closeDrawer:o=>{e.value=a(e).filter(i=>i.id!==o)},closeAllDrawers:()=>{e.value=[]}}}),Pt=ve.defineStore("sideBar",()=>{const{isEnabled:e}=wr(),t=Il("oc_sideBarOpen",!1),{isMobile:n}=to(),r=H(!1),s=H(null),o=T({get(){return a(e)?a(r):a(t)},set(h){if(a(e)){r.value=h;return}t.value=h}}),i=async()=>{await St();const h=document.getElementById("app-sidebar");h&&h.focus()};return{isSideBarOpen:o,sideBarActivePanel:s,focusSidebar:i,onInitialLoad:()=>{a(n)&&(o.value=!1)},toggleSideBar:()=>{o.value=!a(o),a(o)&&i()},closeSideBar:()=>{o.value=!1,s.value=null},openSideBar:()=>{o.value=!0,s.value=null,i()},openSideBarPanel:h=>{o.value=!0,s.value=h,i()},setActiveSideBarPanel:h=>{s.value=h}}}),Yp=ve.defineStore("updates",()=>{const e=H(!0),t=H(!1),n=H();return{updates:n,isLoading:e,hasError:t,setUpdates:i=>{n.value=i},setHasError:i=>{t.value=i},setIsLoading:i=>{e.value=i}}}),no=ve.defineStore("webWorkers",()=>{const e=H([]);return{createWorker:(o,{needsTokenRenewal:i=!1}={})=>{const l=wt.v4(),u=Cn.useWebWorker(o,{type:"module",name:l}),d={id:l,needsTokenRenewal:i,...u};return a(e).push(d),d},terminateWorker:o=>{const i=a(e).find(l=>o===l.id);i&&(i.terminate(),e.value=a(e).filter(l=>o!==l.id))},terminateAllWorkers:()=>{a(e).forEach(({terminate:o})=>{o()}),e.value=[]},updateAccessTokens:o=>{a(e).filter(({needsTokenRenewal:i})=>i).forEach(({post:i})=>{i(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${o}`}}))})}}}),Ci=(e={})=>{const t=e.router||Ae(),n=e.configStore||Qe();return{replaceInvalidFileRoute:({space:s,resource:o,path:i,fileId:l})=>{if(!n.options.routing?.idBased||i===o.path&&l===o.fileId)return!1;const u=In(s,o,{configStore:n});return t.replace(u),!0}}},Pl=()=>{const e=yt();return T(()=>a(e).name)},Zp=(e,t)=>{const n=yt();return T(()=>a(n).meta[e]||t)},Ti=(e,t)=>{const n=Ae();return T({get(){return ot(a(n.currentRoute).params[e])||t},async set(r){a(n.currentRoute).params[e]!==r&&await n.replace({params:{...a(n.currentRoute).params,[e]:r}})}})};let eh=Promise.resolve();const At=(e,t)=>{const n=Ae();return T({get(){return a(n.currentRoute).query[e]||t},set(r){if(a(n.currentRoute).query[e]===r)return;eh=eh.then(async()=>{try{await n.replace({path:a(n.currentRoute).path,query:{...a(n.currentRoute).query,[e]:r}})}catch{}})}})},Xn=e=>{const t=At(e.name),n=Il(RT(e));return ze(()=>a(t)?{value:a(t),source:"route"}:a(n)?{value:a(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:ot(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},RT=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),vn=(e,...t)=>{const n=H(!1),r=Ae(),s=yt();return ze(s,()=>{n.value=e(r,...t)},{immediate:!0}),n},xi="contextRouteName",$l="contextRouteParams",Ol="contextRouteQuery",Ai=e=>{const{params:t,query:n}=e,r={},s=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const o of s)r[o]=n[o];return{[xi]:e.name,[$l]:t,[Ol]:r}},th=e=>({routeName:ot(e[xi]),routeParams:e[$l],routeQuery:e[Ol]}),ot=e=>Array.isArray(e)?e[0].toString():e?.toString();function nh({router:e,currentFileContext:t}){const n=l=>{const{fileName:u,routeName:d,routeParams:c,routeQuery:f}=a(l);return a(d)?e.push({name:a(d),params:a(c),query:{...a(f),scrollTo:a(u)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Ci({router:e}),s=(l,u)=>{const d=a(l);return r({space:a(d.space),resource:u,path:a(d.item),fileId:a(d.itemId)})},o=H(!1);return{replaceInvalidFileRoute:s,closeApp:()=>(o.value=!0,n(t)),closed:o}}const Ee=()=>Gn("$clientService");function Ll({clientService:e}){e=e||Ee();const t=Ze();return{getUrlForResource:(l,u,d)=>e.webdav.getFileUrl(l,u,{username:t.user?.onPremisesSamAccountName,...d}),revokeUrl:l=>e.webdav.revokeUrl(l),getFileContents:(l,u)=>e.webdav.getFileContents(a(a(l).space),{path:a(a(l).item)},{...u}),getFileInfo:(l,u={})=>e.webdav.getFileInfo(a(a(l).space),{path:a(a(l).item),fileId:a(a(l).itemId)},u),putFileContents:(l,u)=>e.webdav.putFileContents(a(a(l).space),{path:a(a(l).item),...u})}}const _l=()=>Gn("$authService");class zr{static allFiles="all-files";static currentFolder="current-folder"}const Ml=()=>{const e=Qe(),t=Ee(),n=Ue(),r=Re(),s=Ct(),o=T(()=>s.searchContent?.enabled),i=T(()=>r.areHiddenFilesShown),l=T(()=>n.spaces.filter(z.isProjectSpaceResource)),u=p=>a(l).find(h=>h.id===p),d=Ft.useTask(function*(p,h,g=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:p})),!h)return{totalResults:null,values:[]};const{resources:m,totalResults:b}=yield*z.call(t.webdav.search(h,{searchLimit:g,davProperties:Qs.Default,signal:p}));return{totalResults:b,values:m.map(S=>{const k=u(S.parentFolderId),w=k||S;return e.options.routing.fullShareOwnerPaths&&w.remoteItemPath&&(w.path=z.urlJoin(w.remoteItemPath,w.path)),{id:w.id,data:w}}).filter(({data:S})=>!S.name.startsWith(".")||a(i))}}).restartable();return{search:async(p,h=null)=>await d.perform(p,h),buildSearchTerm:({term:p,isTitleOnlySearch:h,tags:g,lastModified:m,mediaType:b,scope:S,useScope:k})=>{const w=[],C=p,A=a(o)&&!h;if(C){let I=`name:"*${C}*"`;A&&(I=`(name:"*${C}*" OR content:"${C}")`),w.push(I)}if(k&&S&&w.push(`scope:${S}`),g){const I=g.split("+").map(N=>`"${N}"`);w.push(`tag:(${I.join(" OR ")})`)}if(m&&w.push(`mtime:${m}`),b){const I=b.split("+").map(N=>`"${N}"`);w.push(`mediatype:(${I.join(" OR ")})`)}return w.sort((I,N)=>Number(I.startsWith("scope:"))-Number(N.startsWith("scope:"))).join(" AND ")}}};function rh({currentRoute:e,clientService:t}){const n=H(!1),{webdav:r}=t,{replaceInvalidFileRoute:s}=Ci(),{getFileInfo:o}=Ll({clientService:t}),i=_l(),l=Ue(),{buildSearchTerm:u,search:d}=Ml(),c=At("contextRouteQuery"),f=Re(),{activeResources:p}=ve.storeToRefs(f);return{isFolderLoading:n,loadFolderForFileContext:async g=>{n.value=!0;try{if(g=a(g),a(c)?.term){const I=u({term:a(c)?.term}),{values:N}=await d(I,200),_=N.filter(({data:F})=>z.isSearchResource(F)).map(F=>F.data);f.initResourceList({currentFolder:null,resources:_}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(a(g.routeName))){await Lf.getTask().perform(),n.value=!1;return}f.clearResourceList();const b=a(g.space),S=await o(g,{davProperties:[Te.FileId]});if(s({space:b,resource:S,path:a(g.item),fileId:a(g.itemId)}),l.spaces.some(I=>z.isMountPointSpaceResource(I)&&I.root.remoteItem?.id===S.id)){const I=await o(g);f.initResourceList({currentFolder:I,resources:[I]}),n.value=!1;return}const w=We.dirname(S.path),{resource:C,children:A}=await r.listFiles(b,{path:w});C.type==="file"?f.initResourceList({currentFolder:C,resources:[C]}):f.initResourceList({currentFolder:C,resources:A})}catch(m){if(m.statusCode===401)return i.handleAuthError(a(e));f.setCurrentFolder(null),console.error(m)}n.value=!1},activeFiles:p}}function Nl({appsStore:e,applicationId:t}){return{applicationMeta:T(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const Sr=()=>Xe;function sh({titleSegments:e,eventBus:t}){const n=On(),{currentTheme:r}=ve.storeToRefs(n);t=t||Sr(),ze(e,s=>{const o=a(s),i=" - ",l={shortDocumentTitle:o.join(i),fullDocumentTitle:[...o,a(r).name].join(i)};t.publish("runtime.documentTitle.changed",l)},{immediate:!0,deep:!0})}function ET({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:s}){const o=Nl({applicationId:t,appsStore:e}),{$gettext:i}=de.useGettext(),l=T(()=>{const u=We.basename(a(a(r)?.fileName))||i(a(s)?.meta?.title||""),d=a(a(o).applicationMeta);return[u,a(n)||d.name||d.id].filter(Boolean)});sh({titleSegments:l})}function oh(e={}){const t=e.clientService??Ee(),n=e.authStore??yr();return{makeRequest:(s,o,i={})=>{const l=!n.accessToken||n.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,u=new ml({accessToken:n.accessToken,publicLinkToken:n.publicLinkToken,publicLinkPassword:n.publicLinkPassword});return i.method=s,i.url=o,i.headers={...u.getHeaders(),...i?.headers||{}},l.request(i)}}}const ih=()=>{const e=Ue();return{areSpacesLoading:T(()=>!e.spacesInitialized||e.spacesLoading)}},ah=(e={})=>{const t=Ue(),{areSpacesLoading:n}=ih(),r=At("shareId"),s=At("fileId"),o=T(()=>ot(a(s))),i=Qe(),l=Ee(),u=T(()=>t.spaces),d=H(null),c=H(null),f=H(!1),p=h=>{const g=h.split("/");return a(u).find(m=>{if(!h.startsWith(m.driveAlias))return!1;const b=m.driveAlias.split("/");return g.length<b.length||g.slice(0,b.length).join("/")!==m.driveAlias?!1:m})};return zo(()=>{const h=a(e.driveAliasAndItem);!h?.startsWith("personal/")&&!h?.startsWith("project/")&&t.setCurrentSpace(null)}),ze([e.driveAliasAndItem,n],async([h,g],[m,b])=>{if(h===m&&g===b)return;if(!h||h.startsWith("virtual/")){d.value=null,c.value=null;return}if(a(d)&&h.startsWith(a(d).driveAlias)){c.value=z.urlJoin(h.slice(a(d).driveAlias.length),{leadingSlash:!0});return}let k=null,w=null;if(h.startsWith("public/")||h.startsWith("ocm/")){const[C,...A]=h.split("/").slice(1);k=a(u).find(I=>I.id===C),w=A.join("/")}else if(h.startsWith("share/")||h.startsWith("ocm-share/")){const[C,...A]=h.split("/").slice(1),I=h.startsWith("ocm-share/")?"ocm-share":"share";let N=ot(a(r));N?.includes(":")&&(N=[z.SHARE_JAIL_ID,N].join("!")),k=t.getSpace(N)||t.createShareSpace({driveAliasPrefix:I,id:N,shareName:a(C)}),w=A.join("/")}else a(o)?k=a(u).find(C=>a(o).startsWith(`${C.fileId}`)):k=p(h),k||(!t.mountPointsInitialized&&i.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:l.graphAuthenticated})),k=p(h)),k&&(w=h.slice(k.driveAlias.length));d.value=k,c.value=z.urlJoin(w,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),ze(d,h=>{t.setCurrentSpace(h)},{immediate:!0}),{space:d,item:c,itemId:o,loading:f}};function lh(e){const t=Ae(),n=Pn(),r=yt(),s=e.clientService??Ee(),o=e.applicationId,i=yr(),{publicLinkContextReady:l}=ve.storeToRefs(i),u=Ti("driveAliasAndItem"),{space:d,item:c,itemId:f,loading:p}=ah({driveAliasAndItem:u}),h=T(()=>{if(a(p))return null;let g;return a(d)?g=z.urlJoin(a(d).webDavPath,a(c)):g=z.urlJoin(ot(a(r).params.filePath)),{path:g,driveAliasAndItem:a(u),space:a(d),item:a(c),itemId:a(f),fileName:We.basename(g),routeName:ot(a(r).query[xi]),...th(a(r).query)}});return ET({appsStore:n,applicationId:o,applicationName:e.applicationName,currentFileContext:h,currentRoute:r}),{isPublicLinkContext:l,currentFileContext:h,...Gd({appsStore:n,...e}),...nh({router:t,currentFileContext:h}),...Ll({clientService:s}),...rh({clientService:s,currentRoute:r}),...oh({clientService:s,currentRoute:a(r)})}}const DT=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const n=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(n.path)||String(n.name)}" instead.`),n}}),FT=()=>[{path:"/list",redirect:e=>gn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>gn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:z.urlJoin("personal/home",ot(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>cs("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>tn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>tn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>tn("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>gr("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>us("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(DT),IT=(e,...t)=>{const[n,...r]=t.map(s=>{const o={"files-personal":gn("files-spaces-generic").name,"files-favorites":cs("files-common-favorites").name,"files-shared-with-others":tn("files-shares-with-others").name,"files-shared-with-me":tn("files-shares-with-me").name,"files-trashbin ":gr("files-trash-generic").name,"files-public-list":us("files-public-link").name}[s.name.toString()];return o&&console.warn(`route name "${name}" is deprecated, use "${o.toString()}" instead.`),{...s,...!!o&&{name:o}}});return tl(e,n,...r)},PT={name:"root",path:"/",redirect:e=>gn("files-spaces-generic",e)},$T=e=>[PT,...sS(e),...aS(e),...lS(e),...oS(e),...cS(e),...FT()],Ri=()=>{const e=Ee();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:s})=>s===".space")}}},Rt=e=>{const t=Ze(),n=Ue(),r=Qe(),s=T(()=>n.spaces),o=Ti("driveAliasAndItem"),i=f=>a(e?.space)||a(s).find(p=>p.id===f),l=f=>{let p=f.storageId;(a(o)?.startsWith("public/")||a(o)?.startsWith("ocm/"))&&(p=a(o).split("/")[1]);const h=i(p);if(h&&!z.isMountPointSpaceResource(h))return h;const g=z.isShareResource(f)&&f.shareTypes.includes(z.ShareTypes.remote.value)||f?.id?.toString().startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share";let m;return f.remoteItemPath?m=We.basename(f.remoteItemPath):a(o)?.startsWith("share/")||a(o)?.startsWith("ocm-share/")?m=a(o).split("/")[1]:m=f.name,n.getSpace(f.remoteItemId)||n.createShareSpace({driveAliasPrefix:g,id:f.remoteItemId,shareName:m})},u=f=>a(s).filter(p=>z.isMountPointSpaceResource(p)&&z.extractStorageId(p.root.remoteItem.rootId)===f.id);return{getInternalSpace:i,getMatchingSpace:l,isPersonalSpaceRoot:f=>f?.storageId&&f?.storageId===n.personalSpace?.storageId&&f?.path==="/"&&!z.isIncomingShareResource(f),isResourceAccessible:({space:f,path:p})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const h=a(s).some(m=>z.isProjectSpaceResource(m)&&m.id===f.id);return f.isOwner(t.user)||h||u(f).some(m=>p.startsWith(m.root.remoteItem.path))}}},ms=()=>{const e=Ee(),t=Re(),{$gettext:n}=de.useGettext(),r=Ue(),{upsertResource:s}=Re(),{showMessage:o,showErrorMessage:i}=Me(),l=c=>{const{graphAuthenticated:f}=e;return f.drives.createDrive({name:c},{params:{template:"default"}})};return{createSpace:l,createDefaultMetaFolder:async c=>{const f=await e.webdav.createFolder(c,{path:".space"});return z.extractStorageId(f.parentFolderId)===t.currentFolder?.id&&t.upsertResource(f),f},addNewSpace:async c=>{try{const f=await l(c);return s(f),r.upsertSpace(f),o({title:n("Space was created successfully")}),f}catch(f){console.error(f),i({title:n("Creating space failed…"),errors:[f]})}}}},Nt=()=>Gn("$loadingService"),Ei=()=>{const e=yr(),t=Ee(),n=de.useGettext();return{headers:T(()=>{const s=new ml({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":wt.v4(),...s.getHeaders()}})}};function OT(e){return new Worker("/assets/worker-DJbU-qfq.js",{name:e?.name})}const ch=({concurrentRequests:e=4}={})=>{const t=Qe(),n=Nt(),{headers:r}=Ei(),{createWorker:s,terminateWorker:o}=no(),i=({topic:u,space:d,resources:c},f)=>{const p=s(OT,{needsTokenRenewal:!0});let h;a(p.worker).onmessage=g=>{o(p.id),h?.(!0);const{successful:m,failed:b}=JSON.parse(g.data),S=b.map(({resource:k,...w})=>({resource:k,error:z.createHttpError(w)}));f({successful:m,failed:S})},n.addTask(()=>new Promise(g=>{h=g})),p.post(l({topic:u,space:d,resources:c}))},l=({topic:u,space:d,resources:c})=>JSON.stringify({topic:u,data:{space:d,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...a(r),"X-Request-ID":void 0}}});return{startWorker:i}};function LT(e){return new Worker("/assets/worker-DyU7W9CZ.js",{name:e?.name})}const uh=()=>{const e=Qe(),t=Nt(),{headers:n}=Ei(),{createWorker:r,terminateWorker:s}=no(),o=(l,u)=>{const d=r(LT,{needsTokenRenewal:!0});let c;a(d.worker).onmessage=f=>{s(d.id),c?.(!0);const{successful:p,failed:h}=JSON.parse(f.data),g=h.map(({resourceName:m,...b})=>({resourceName:m,error:z.createHttpError(b)}));u({successful:p,failed:g})},t.addTask(()=>new Promise(f=>{c=f})),d.post(i(l))},i=l=>JSON.stringify({topic:"startProcess",data:{transferData:l,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:o}};function _T(e){return new Worker("/assets/worker-CVwKToFD.js",{name:e?.name})}const dh=()=>{const e=Qe(),t=Nt(),{headers:n}=Ei(),{createWorker:r,terminateWorker:s}=no(),o=({space:l,resources:u,missingFolderPaths:d},c)=>{const f=r(_T,{needsTokenRenewal:!0});let p;a(f.worker).onmessage=h=>{s(f.id),p?.(!0);const{successful:g,failed:m}=JSON.parse(h.data),b=m.map(({resource:S,...k})=>({resource:S,error:z.createHttpError(k)}));c({successful:g,failed:b})},t.addTask(()=>new Promise(h=>{p=h})),f.post(i({space:l,resources:u,missingFolderPaths:d}))},i=({space:l,resources:u,missingFolderPaths:d})=>JSON.stringify({topic:"startProcess",data:{space:l,resources:u,missingFolderPaths:d,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:o}};function MT(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const NT=({authService:e})=>{const{createWorker:t}=no(),n=H();return{startWorker:()=>{n.value=t(MT),a(a(n).worker).onmessage=()=>{e.signinSilent().catch(async i=>{if(i instanceof kg.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),a(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",i),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:i,expiryThreshold:l})=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"set",expiry:i,expiryThreshold:l}))},resetTokenTimer:()=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"reset"}))}}};function BT(e){return e==null}const bn=()=>{const e=Pn(),t=Ae(),n=Zi(),{isEnabled:r}=wr(),{requestExtensions:s}=br(),o=rr(),{openUrl:i}=Im(),l=Qe(),{options:u}=ve.storeToRefs(l),{actions:d}=Gi(),{actions:c}=Yi(),{actions:f}=Di(),{actions:p}=mo(),{actions:h}=Qi(),{actions:g}=Ki(),{actions:m}=ws(),{actions:b}=bm(),{actions:S}=rc(),{actions:k}=Ji(),{actions:w}=im(),{actions:C}=Xi(),{actions:A}=go(),{actions:I}=tc(),N=T(()=>[...a(g),...a(m),...a(p),...a(k),...a(f),...a(C),...a(I),...a(A),...a(d),...a(c),...a(h),...a(S)]),_=T(()=>(s({id:"global.files.context-actions",extensionType:"action"})||[]).map(j=>j.action).filter(j=>BT(j.category)||j.category==="context"||j.category==="actions")),F=T(()=>a(r)?[]:e.fileExtensions.map(j=>{const B=e.apps[j.app];return{name:`editor-${j.app}`,label:()=>j.label?typeof j.label=="function"?j.label():j.label:B.name,icon:j.icon||B.icon,...B.iconFillType&&{iconFillType:B.iconFillType},img:B.img,route:({space:q,resources:re})=>V({appFileExtension:j,space:q,resource:re[0]}),handler:q=>P(j,q.space,q.resources[0]),isVisible:({resources:q})=>!a(o)||q.length!==1||!q[0].canDownload()&&!j.secureView||!a(n)&&jt(t,"files-trash-generic")?!1:q[0].extension&&j.extension?q[0].extension.toLowerCase()===j.extension.toLowerCase():q[0].mimeType&&j.mimeType?q[0].mimeType.toLowerCase()===j.mimeType.toLowerCase()||q[0].mimeType.split("/")[0].toLowerCase()===j.mimeType.toLowerCase():!1,hasPriority:j.hasPriority,class:`oc-files-actions-${Hp(B.name).toLowerCase()}-trigger`}}).sort((j,B)=>B.hasPriority!==j.hasPriority&&B.hasPriority?1:0)),V=({appFileExtension:j,space:B,resource:q})=>{const re=z.isShareSpaceResource(B)?B.id:void 0;let J=j.routeName;if(J&&!t.hasRoute(J))return console.warn(`App "${j.app}" specifies routeName "${J}" but no such route exists.`),null;if(J=J||j.app,!J||!t.hasRoute(J))return null;const oe=Z(J,B,q,re);return t.resolve(oe)},Z=(j,B,q,re,J)=>({name:j,params:{driveAliasAndItem:B?.getDriveAliasAndItem(q)},query:{...re&&{shareId:re},...q.fileId&&a(u).routing.idBased&&{fileId:q.fileId},...J&&{templateId:J},...Ai(a(t.currentRoute))}}),P=(j,B,q)=>{const re=z.isShareSpaceResource(B)?B.id:void 0,J=j.routeName||j.app,oe=Z(J,B,q,re);if(a(u).cernFeatures){const ne=t.resolve(oe).href,pe=`${j.routeName}-${q.path}`;i(ne,pe,!0);return}t.push(oe)},$=j=>{const B=L(j);B&&B.handler({...j})},L=j=>{const B=M(j);if(B.length)return B[0].name===a(m)[0].name?a(b)[0]:B[0]},M=j=>{const B=J=>J.isVisible(j),q=[...a(_),...a(F),...a(w)].filter(B).sort((J,oe)=>Number(oe.hasPriority)-Number(J.hasPriority)),re=j.omitSystemActions?[]:a(N).filter(B);return[...q,...re]};return{getDefaultAction:L,getAllOpenWithActions:M,getEditorRouteOpts:Z,openEditor:P,triggerDefaultAction:$}},Di=()=>{const e=Qe(),t=Ae(),{copyResources:n}=Zs(),r=de.useGettext(),{$gettext:s}=r,o=Re(),{currentFolder:i}=ve.storeToRefs(o),l=T(()=>Ys()?s("⌘ + C"):s("Ctrl + C")),u=({resources:c})=>{mt(t,"files-common-search")&&(c=c.filter(f=>!z.isProjectSpaceResource(f))),n(c)};return{actions:T(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:a(l),label:()=>s("Copy"),isVisible:({resources:c})=>{if(!rt(t,"files-spaces-generic")&&!nn(t,"files-public-link")&&!mt(t,"files-common-favorites")&&!mt(t,"files-common-search")||rt(t,"files-spaces-projects")||c.length===0)return!1;if(nn(t,"files-public-link"))return a(i)?.canCreate();if(mt(t,"files-common-search")&&c.every(f=>z.isProjectSpaceResource(f)))return!1;if(a(e.options.runningOnEos)){const f=c[0].path?.split("/").filter(Boolean)||[];if(rt(t,"files-spaces-generic")&&f.length<5)return!1}return!!a(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}};var Ln=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Z="z",e.Plus="+",e.Minus="-",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e.Backspace="Backspace",e.Delete="Delete",e))(Ln||{}),Fi=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Fi||{});const jT=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const n=document.activeElement;if(!n)return!1;let r;try{r=n?.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n?.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},Ii=e=>{const t=H([]),n=H(0),r=l=>{if(!e?.skipDisabledKeyBindingsCheck&&jT())return;const{key:u,ctrlKey:d,metaKey:c,shiftKey:f}=l;let p=null;const h=[];c||d?(p="Control",h.push("altKey","shiftKey")):f&&(p="Shift",h.push("altKey","ctrlKey","metaKey")),!((m,b)=>b.some(S=>m[S]))(l,h)&&a(t).filter(m=>m.primary===u&&m.modifier===p).forEach(m=>{m.preventDefault&&l.preventDefault(),m.callback(l)})},s=(l,u,{preventDefault:d=!0}={})=>{const c=wt.v4();return t.value.push({id:c,...l,modifier:l.modifier??null,preventDefault:d,callback:u}),c},o=l=>{t.value=t.value.filter(u=>u.id!==l)},i=()=>{n.value=0};return Cn.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:s,removeKeyAction:o,selectionCursor:n,resetSelectionCursor:i}};function Vr(){return{interceptModifierClick:(t,n)=>{if(!t||!n)return!1;const r=t.shiftKey,s=t.ctrlKey||t.metaKey;return!r&&!s?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),r&&Xe.publish("app.files.list.clicked.shift",{resource:n,skipTargetSelection:!1}),s&&Xe.publish("app.files.list.clicked.meta",n),!0)}}}const Bl=()=>{const e=Ii(),t=10,n=.1;return{setCropperInstance:s=>{e.bindKeyAction({primary:Ln.ArrowRight},()=>a(s)?.move(-t,0)),e.bindKeyAction({primary:Ln.ArrowLeft},()=>a(s)?.move(t,0)),e.bindKeyAction({primary:Ln.ArrowDown},()=>a(s)?.move(0,-t)),e.bindKeyAction({primary:Ln.ArrowUp},()=>a(s)?.move(0,t)),e.bindKeyAction({primary:Ln.Plus},()=>a(s)?.zoom(n)),e.bindKeyAction({primary:Ln.Minus},()=>a(s)?.zoom(-n))}}},jl=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{$gettext:n}=de.useGettext(),{copy:r}=Cn.useClipboard(),{interceptModifierClick:s}=Vr(),o=async l=>{try{await r(l),e({title:n("The link has been copied to your clipboard.")})}catch(u){t({title:n("Copy link failed"),errors:[u]})}};return{actions:T(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:l=>{const{resources:u,event:d}=l,c=u[0];if(!(d&&s(d,c)))return o(c.privateLink)},isVisible:({space:l,resources:u})=>!(u.length!==1||z.isPublicSpaceResource(l)||z.isTrashResource(u[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},ro={};function zT(e){return e.getIsPending!==void 0}function VT(e){if(zT(e))return e;let t=!0,n=e.then(r=>(t=!1,r),r=>{throw t=!1,r});return n.getIsPending=function(){return t},n}function UT(e){let t={};const n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t}function qT(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function HT(e,t){const{class:n,style:r,...s}=UT(e),{class:o,style:i,...l}=qT(t);return{class:[n,o],style:[r,i],...s,...l}}const fh=ge({inheritAttrs:!1,__name:"InlineSvg",props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:""}},emits:["loaded","unloaded","error"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=qo(),i=H(),l=H(),u=H(),d=Math.random().toString(36).substring(2);t({svgElSource:i,request:u}),ze(()=>r.src,b=>{f(b)}),f(r.src);function c(b){if(b=b.cloneNode(!0),r.uniqueIds){const S=typeof r.uniqueIds=="string"?r.uniqueIds:d;b=m(b,S,r.uniqueIdsBase)}return b=r.transformSource(b),r.title&&g(b,r.title),b.innerHTML}function f(b){ro[b]||(ro[b]=p(b)),i.value&&ro[b].getIsPending()&&!r.keepDuringLoading&&(i.value=null,s("unloaded")),ro[b].then(S=>{i.value=S,St(()=>{s("loaded",l.value)})}).catch(S=>{i.value&&(i.value=void 0,s("unloaded")),delete ro[b],s("error",S)})}function p(b){return VT(new Promise((S,k)=>{const w=new XMLHttpRequest;w.open("GET",b,!0),u.value=w,w.onload=()=>{if(w.status>=200&&w.status<400)try{let C=new DOMParser().parseFromString(w.responseText,"text/xml").getElementsByTagName("svg")[0];C?S(C):k(new Error('Loaded file is not valid SVG"'))}catch(C){k(C)}else k(new Error("Error loading SVG"))},w.onerror=k,w.send()}))}const h=()=>i.value?Xo("svg",{...HT(i.value,o),innerHTML:c(i.value),ref:l}):null;function g(b,S){const k=b.getElementsByTagName("title");if(k.length)k[0].textContent=S;else{const w=document.createElementNS("http://www.w3.org/2000/svg","title");w.textContent=S,b.insertBefore(w,b.firstChild)}}function m(b,S,k=""){const w=["id","href","xlink:href","xlink:role","xlink:arcrole"],C=["href","xlink:href"],A=(I,N)=>C.includes(I)&&(N?!N.includes("#"):!1);return[...b.children].forEach(I=>{var N;if((N=I.attributes)!=null&&N.length){const _=Object.values(I.attributes).map(F=>{const V=/url\((.*?)\)/.exec(F.value);return V!=null&&V[1]&&(F.value=F.value.replace(V[0],`url(${k}${V[1]}_${S})`)),F});w.forEach(F=>{const V=_.find(Z=>Z.name===F);V&&!A(F,V.value)&&(V.value=`${V.value}_${S}`)})}return I.children.length?m(I,S,k):I}),b}return(b,S)=>(D(),ee(h))}}),Yn=ge({__name:"OcIcon",props:{accessibleLabel:{default:""},color:{default:""},fillType:{default:"fill"},name:{default:"info"},size:{default:"medium"},type:{default:"span"}},emits:["loaded"],setup(e,{emit:t}){fh.name="inline-svg";const n=t,r=T(()=>Mr("oc-icon-title-")),s=T(()=>{const l=`${FS()}icons/`,u=e.fillType.toLowerCase();return u==="none"?`${l}${e.name}.svg`:`${l}${e.name}-${u}.svg`}),o=T(()=>({"size-3":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-12":e.size==="xlarge","size-22":e.size==="xxlarge","size-42":e.size==="xxxlarge"})),i=l=>{if(e.accessibleLabel!==""){const u=document.createElement("title");u.setAttribute("id",r.value),u.appendChild(document.createTextNode(e.accessibleLabel)),l.insertBefore(u,l.firstChild)}return l};return(l,u)=>(D(),ee(Yt(e.type),{class:R.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",o.value,{"bg-transparent min-h-0":e.type==="button"}])},{default:X(()=>[Q(a(fh),{src:s.value,"transform-source":i,"aria-hidden":e.accessibleLabel===""?"true":null,"aria-labelledby":e.accessibleLabel===""?null:r.value,focusable:e.accessibleLabel===""?"false":null,style:R.normalizeStyle(e.color!==""?{fill:e.color}:{}),class:R.normalizeClass(o.value),onLoaded:u[0]||(u[0]=d=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});var ph=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Pi=ph.join(","),hh=typeof Element>"u",Ur=hh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$i=!hh&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Oi=function(t,n){var r;n===void 0&&(n=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=s===""||s==="true",i=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Oi(t.parentNode));return i},WT=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},mh=function(t,n,r){if(Oi(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(Pi));return n&&Ur.call(t,Pi)&&s.unshift(t),s=s.filter(r),s},Li=function(t,n,r){for(var s=[],o=Array.from(t);o.length;){var i=o.shift();if(!Oi(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),u=l.length?l:i.children,d=Li(u,!0,r);r.flatten?s.push.apply(s,d):s.push({scopeParent:i,candidates:d})}else{var c=Ur.call(i,Pi);c&&r.filter(i)&&(n||!t.includes(i))&&s.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!Oi(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&p){var h=Li(f===!0?i.children:f.children,!0,r);r.flatten?s.push.apply(s,h):s.push({scopeParent:i,candidates:h})}else o.unshift.apply(o,i.children)}}return s},gh=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||WT(t))&&!gh(t)?0:t.tabIndex},QT=function(t,n){var r=qr(t);return r<0&&n&&!gh(t)?0:r},KT=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},yh=function(t){return t.tagName==="INPUT"},GT=function(t){return yh(t)&&t.type==="hidden"},JT=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},XT=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},YT=function(t){if(!t.name)return!0;var n=t.form||$i(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(t.name));else try{s=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var o=XT(s,t.form);return!o||o===t},ZT=function(t){return yh(t)&&t.type==="radio"},ex=function(t){return ZT(t)&&!YT(t)},tx=function(t){var n,r=t&&$i(t),s=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var i,l,u;for(o=!!((i=s)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(s)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!o&&s;){var d,c,f;r=$i(s),s=(d=r)===null||d===void 0?void 0:d.host,o=!!((c=s)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(s))}}return o},vh=function(t){var n=t.getBoundingClientRect(),r=n.width,s=n.height;return r===0&&s===0},nx=function(t,n){var r=n.displayCheck,s=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Ur.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Ur.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var u=t;t;){var d=t.parentElement,c=$i(t);if(d&&!d.shadowRoot&&s(d)===!0)return vh(t);t.assignedSlot?t=t.assignedSlot:!d&&c!==t.ownerDocument?t=c.host:t=d}t=u}if(tx(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return vh(t);return!1},rx=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var s=n.children.item(r);if(s.tagName==="LEGEND")return Ur.call(n,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}n=n.parentElement}return!1},_i=function(t,n){return!(n.disabled||GT(n)||nx(n,t)||JT(n)||rx(n))},zl=function(t,n){return!(ex(n)||qr(n)<0||!_i(t,n))},sx=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},bh=function(t){var n=[],r=[];return t.forEach(function(s,o){var i=!!s.scopeParent,l=i?s.scopeParent:s,u=QT(l,i),d=i?bh(s.candidates):l;u===0?i?n.push.apply(n,d):n.push(l):r.push({documentOrder:o,tabIndex:u,item:s,isScope:i,content:d})}),r.sort(KT).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(n)},ox=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Li([t],n.includeContainer,{filter:zl.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:sx}):r=mh(t,n.includeContainer,zl.bind(null,n)),bh(r)},ix=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Li([t],n.includeContainer,{filter:_i.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=mh(t,n.includeContainer,_i.bind(null,n)),r},gs=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,Pi)===!1?!1:zl(n,t)},ax=ph.concat("iframe:not([inert]):not([inert] *)").join(","),Vl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,ax)===!1?!1:_i(n,t)};function Ul(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lx(e){if(Array.isArray(e))return Ul(e)}function wh(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ch(e))||t){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return i=u.done,u},e:function(u){l=!0,o=u},f:function(){try{i||n.return==null||n.return()}finally{if(l)throw o}}}}function cx(e,t,n){return(t=hx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ux(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function kh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sh(Object(n),!0).forEach(function(r){cx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sh(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fx(e){return lx(e)||ux(e)||Ch(e)||dx()}function px(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hx(e){var t=px(e,"string");return typeof t=="symbol"?t:t+""}function Ch(e,t){if(e){if(typeof e=="string")return Ul(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ul(e,t):void 0}}var Zn={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=Zn.getActiveTrap(t);n!==r&&Zn.pauseTrap(t);var s=t.indexOf(n);s===-1||t.splice(s,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),Zn.unpauseTrap(t)},pauseTrap:function(t){var n=Zn.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=Zn.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},mx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},gx=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},so=function(t){return t?.key==="Tab"||t?.keyCode===9},yx=function(t){return so(t)&&!t.shiftKey},vx=function(t){return so(t)&&t.shiftKey},Th=function(t){return setTimeout(t,0)},oo=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return typeof t=="function"?t.apply(void 0,r):t},Mi=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},bx=[],wx=function(t,n){var r=n?.document||document,s=n?.trapStack||bx,o=kh({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:yx,isKeyBackward:vx},n),i={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,u=function(L,M,j){return L&&L[M]!==void 0?L[M]:o[j||M]},d=function(L,M){var j=typeof M?.composedPath=="function"?M.composedPath():void 0;return i.containerGroups.findIndex(function(B){var q=B.container,re=B.tabbableNodes;return q.contains(L)||j?.includes(q)||re.find(function(J){return J===L})})},c=function(L){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=M.hasFallback,B=j===void 0?!1:j,q=M.params,re=q===void 0?[]:q,J=o[L];if(typeof J=="function"&&(J=J.apply(void 0,fx(re))),J===!0&&(J=void 0),!J){if(J===void 0||J===!1)return J;throw new Error("`".concat(L,"` was specified but was not a node, or did not return a node"))}var oe=J;if(typeof J=="string"){try{oe=r.querySelector(J)}catch(ne){throw new Error("`".concat(L,'` appears to be an invalid selector; error="').concat(ne.message,'"'))}if(!oe&&!B)throw new Error("`".concat(L,"` as selector refers to no known node"))}return oe},f=function(){var L=c("initialFocus",{hasFallback:!0});if(L===!1)return!1;if(L===void 0||L&&!Vl(L,o.tabbableOptions))if(d(r.activeElement)>=0)L=r.activeElement;else{var M=i.tabbableGroups[0],j=M&&M.firstTabbableNode;L=j||c("fallbackFocus")}else L===null&&(L=c("fallbackFocus"));if(!L)throw new Error("Your focus-trap needs to have at least one focusable element");return L},p=function(){if(i.containerGroups=i.containers.map(function(L){var M=ox(L,o.tabbableOptions),j=ix(L,o.tabbableOptions),B=M.length>0?M[0]:void 0,q=M.length>0?M[M.length-1]:void 0,re=j.find(function(ne){return gs(ne)}),J=j.slice().reverse().find(function(ne){return gs(ne)}),oe=!!M.find(function(ne){return qr(ne)>0});return{container:L,tabbableNodes:M,focusableNodes:j,posTabIndexesFound:oe,firstTabbableNode:B,lastTabbableNode:q,firstDomTabbableNode:re,lastDomTabbableNode:J,nextTabbableNode:function(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,we=M.indexOf(pe);return we<0?fe?j.slice(j.indexOf(pe)+1).find(function($e){return gs($e)}):j.slice(0,j.indexOf(pe)).reverse().find(function($e){return gs($e)}):M[we+(fe?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(L){return L.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(L){return L.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(L){var M=L.activeElement;if(M)return M.shadowRoot&&M.shadowRoot.activeElement!==null?h(M.shadowRoot):M},g=function(L){if(L!==!1&&L!==h(document)){if(!L||!L.focus){g(f());return}L.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=L,mx(L)&&L.select()}},m=function(L){var M=c("setReturnFocus",{params:[L]});return M||(M===!1?!1:L)},b=function(L){var M=L.target,j=L.event,B=L.isBackward,q=B===void 0?!1:B;M=M||Mi(j),p();var re=null;if(i.tabbableGroups.length>0){var J=d(M,j),oe=J>=0?i.containerGroups[J]:void 0;if(J<0)q?re=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:re=i.tabbableGroups[0].firstTabbableNode;else if(q){var ne=i.tabbableGroups.findIndex(function(ae){var ue=ae.firstTabbableNode;return M===ue});if(ne<0&&(oe.container===M||Vl(M,o.tabbableOptions)&&!gs(M,o.tabbableOptions)&&!oe.nextTabbableNode(M,!1))&&(ne=J),ne>=0){var pe=ne===0?i.tabbableGroups.length-1:ne-1,fe=i.tabbableGroups[pe];re=qr(M)>=0?fe.lastTabbableNode:fe.lastDomTabbableNode}else so(j)||(re=oe.nextTabbableNode(M,!1))}else{var we=i.tabbableGroups.findIndex(function(ae){var ue=ae.lastTabbableNode;return M===ue});if(we<0&&(oe.container===M||Vl(M,o.tabbableOptions)&&!gs(M,o.tabbableOptions)&&!oe.nextTabbableNode(M))&&(we=J),we>=0){var $e=we===i.tabbableGroups.length-1?0:we+1,he=i.tabbableGroups[$e];re=qr(M)>=0?he.firstTabbableNode:he.firstDomTabbableNode}else so(j)||(re=oe.nextTabbableNode(M))}}else re=c("fallbackFocus");return re},S=function(L){var M=Mi(L);if(!(d(M,L)>=0)){if(oo(o.clickOutsideDeactivates,L)){l.deactivate({returnFocus:o.returnFocusOnDeactivate});return}oo(o.allowOutsideClick,L)||L.preventDefault()}},k=function(L){var M=Mi(L),j=d(M,L)>=0;if(j||M instanceof Document)j&&(i.mostRecentlyFocusedNode=M);else{L.stopImmediatePropagation();var B,q=!0;if(i.mostRecentlyFocusedNode)if(qr(i.mostRecentlyFocusedNode)>0){var re=d(i.mostRecentlyFocusedNode),J=i.containerGroups[re].tabbableNodes;if(J.length>0){var oe=J.findIndex(function(ne){return ne===i.mostRecentlyFocusedNode});oe>=0&&(o.isKeyForward(i.recentNavEvent)?oe+1<J.length&&(B=J[oe+1],q=!1):oe-1>=0&&(B=J[oe-1],q=!1))}}else i.containerGroups.some(function(ne){return ne.tabbableNodes.some(function(pe){return qr(pe)>0})})||(q=!1);else q=!1;q&&(B=b({target:i.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(i.recentNavEvent)})),g(B||i.mostRecentlyFocusedNode||f())}i.recentNavEvent=void 0},w=function(L){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=L;var j=b({event:L,isBackward:M});j&&(so(L)&&L.preventDefault(),g(j))},C=function(L){(o.isKeyForward(L)||o.isKeyBackward(L))&&w(L,o.isKeyBackward(L))},A=function(L){gx(L)&&oo(o.escapeDeactivates,L)!==!1&&(L.preventDefault(),l.deactivate())},I=function(L){var M=Mi(L);d(M,L)>=0||oo(o.clickOutsideDeactivates,L)||oo(o.allowOutsideClick,L)||(L.preventDefault(),L.stopImmediatePropagation())},N=function(){if(i.active)return Zn.activateTrap(s,l),i.delayInitialFocusTimer=o.delayInitialFocus?Th(function(){g(f())}):g(f()),r.addEventListener("focusin",k,!0),r.addEventListener("mousedown",S,{capture:!0,passive:!1}),r.addEventListener("touchstart",S,{capture:!0,passive:!1}),r.addEventListener("click",I,{capture:!0,passive:!1}),r.addEventListener("keydown",C,{capture:!0,passive:!1}),r.addEventListener("keydown",A),l},_=function(L){i.active&&!i.paused&&l._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var M=new Set,j=new Set,B=wh(L),q;try{for(B.s();!(q=B.n()).done;){var re=q.value;M.add(re);for(var J=typeof ShadowRoot<"u"&&re.getRootNode()instanceof ShadowRoot,oe=re;oe;){M.add(oe);var ne=oe.parentElement,pe=[];ne?pe=ne.children:!ne&&J&&(pe=oe.getRootNode().children,ne=oe.getRootNode().host,J=typeof ShadowRoot<"u"&&ne.getRootNode()instanceof ShadowRoot);var fe=wh(pe),we;try{for(fe.s();!(we=fe.n()).done;){var $e=we.value;j.add($e)}}catch(he){fe.e(he)}finally{fe.f()}oe=ne}}}catch(he){B.e(he)}finally{B.f()}M.forEach(function(he){j.delete(he)}),i.adjacentElements=j},F=function(){if(i.active)return r.removeEventListener("focusin",k,!0),r.removeEventListener("mousedown",S,!0),r.removeEventListener("touchstart",S,!0),r.removeEventListener("click",I,!0),r.removeEventListener("keydown",C,!0),r.removeEventListener("keydown",A),l},V=function(L){var M=L.some(function(j){var B=Array.from(j.removedNodes);return B.some(function(q){return q===i.mostRecentlyFocusedNode})});M&&g(f())},Z=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(V):void 0,P=function(){Z&&(Z.disconnect(),i.active&&!i.paused&&i.containers.map(function(L){Z.observe(L,{subtree:!0,childList:!0})}))};return l={get active(){return i.active},get paused(){return i.paused},activate:function(L){if(i.active)return this;var M=u(L,"onActivate"),j=u(L,"onPostActivate"),B=u(L,"checkCanFocusTrap"),q=Zn.getActiveTrap(s),re=!1;if(q&&!q.paused){var J;(J=q._setSubtreeIsolation)===null||J===void 0||J.call(q,!1),re=!0}try{B||p(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=h(r),M?.();var oe=function(){B&&p(),N(),P(),o.isolateSubtrees&&l._setSubtreeIsolation(!0),j?.()};if(B)return B(i.containers.concat()).then(oe,oe),this;oe()}catch(pe){if(q===Zn.getActiveTrap(s)&&re){var ne;(ne=q._setSubtreeIsolation)===null||ne===void 0||ne.call(q,!0)}throw pe}return this},deactivate:function(L){if(!i.active)return this;var M=kh({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},L);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,i.paused||l._setSubtreeIsolation(!1),i.alreadySilent.clear(),F(),i.active=!1,i.paused=!1,P(),Zn.deactivateTrap(s,l);var j=u(M,"onDeactivate"),B=u(M,"onPostDeactivate"),q=u(M,"checkCanReturnFocus"),re=u(M,"returnFocus","returnFocusOnDeactivate");j?.();var J=function(){Th(function(){re&&g(m(i.nodeFocusedBeforeActivation)),B?.()})};return re&&q?(q(m(i.nodeFocusedBeforeActivation)).then(J,J),this):(J(),this)},pause:function(L){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,L)):this},unpause:function(L){return i.active?(i.manuallyPaused=!1,s[s.length-1]!==this?this:this._setPausedState(!1,L)):this},updateContainerElements:function(L){var M=[].concat(L).filter(Boolean);return i.containers=M.map(function(j){return typeof j=="string"?r.querySelector(j):j}),o.isolateSubtrees&&_(i.containers),i.active&&(p(),o.isolateSubtrees&&!i.paused&&l._setSubtreeIsolation(!0)),P(),this}},Object.defineProperties(l,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(L,M){if(i.paused===L)return this;if(i.paused=L,L){var j=u(M,"onPause"),B=u(M,"onPostPause");j?.(),F(),P(),l._setSubtreeIsolation(!1),B?.()}else{var q=u(M,"onUnpause"),re=u(M,"onPostUnpause");q?.(),l._setSubtreeIsolation(!0),p(),N(),P(),re?.()}return this}},_setSubtreeIsolation:{value:function(L){o.isolateSubtrees&&i.adjacentElements.forEach(function(M){var j;L?o.isolateSubtrees==="aria-hidden"?((M.ariaHidden==="true"||((j=M.getAttribute("aria-hidden"))===null||j===void 0?void 0:j.toLowerCase())==="true")&&i.alreadySilent.add(M),M.setAttribute("aria-hidden","true")):((M.inert||M.hasAttribute("inert"))&&i.alreadySilent.add(M),M.setAttribute("inert",!0)):i.alreadySilent.has(M)||(o.isolateSubtrees==="aria-hidden"?M.removeAttribute("aria-hidden"):M.removeAttribute("inert"))})}}}),l.updateContainerElements(t),l};function L$(e){return e}const Sx={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object},kx=ge({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},Sx),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:n}){let r;const s=H(null),o=T(()=>{const l=s.value;return l&&(l instanceof HTMLElement?l:l.$el)});function i(){return r||(r=wx(o.value,{escapeDeactivates:e.escapeDeactivates,allowOutsideClick:e.allowOutsideClick,returnFocusOnDeactivate:e.returnFocusOnDeactivate,clickOutsideDeactivates:e.clickOutsideDeactivates,onActivate:()=>{n("update:active",!0),n("activate")},onDeactivate:()=>{n("update:active",!1),n("deactivate")},onPostActivate:()=>n("postActivate"),onPostDeactivate:()=>n("postDeactivate"),initialFocus:e.initialFocus,fallbackFocus:e.fallbackFocus,tabbableOptions:e.tabbableOptions,delayInitialFocus:e.delayInitialFocus,preventScroll:e.preventScroll}))}return ft(()=>{ze(()=>e.active,l=>{l&&o.value?i().activate():r&&(r.deactivate(),(!o.value||o.value.nodeType===Node.COMMENT_NODE)&&(r=null))},{immediate:!0,flush:"post"})}),zo(()=>{r&&r.deactivate(),r=null}),{activate(){i().activate()},deactivate(){r&&r.deactivate()},renderImpl(){if(!t.default)return null;const l=t.default().filter(d=>d.type!==Ht);return!l||!l.length||l.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),l):dr(l[0],{ref:s})}}}}),Cx=["open"],Tx=["id"],xx=Le(ge({__name:"OcBottomDrawer",props:{id:{},isDrawerActive:{type:Boolean,default:!0},isFocusTrapActive:{type:Boolean,default:!0},hasFullHeight:{type:Boolean,default:!1},maxHeight:{default:"max-h-[66vh]"}},emits:["clicked"],setup(e){return ze(()=>e.isDrawerActive,async()=>{e.isDrawerActive&&(await St(),document.getElementById(e.id)?.classList.add("active"))},{immediate:!0}),(t,n)=>(D(),K("dialog",{class:"oc-bottom-drawer fixed inset-0 bg-black/40 size-full",open:e.isDrawerActive,onClick:n[0]||(n[0]=r=>t.$emit("clicked",r))},[Q(a(kx),{active:e.isFocusTrapActive},{default:X(()=>[W("div",{id:e.id,tabindex:"-1",class:R.normalizeClass(["fixed inset-x-0 rounded-t-xl w-full overflow-y-auto transition-all duration-200 -bottom-full overflow-x-hidden",[{"[&.active]:bottom-0":e.isDrawerActive,"h-full":e.hasFullHeight},e.maxHeight]])},[Se(t.$slots,"default",{},void 0,!0)],10,Tx)]),_:3},8,["active"])],8,Cx))}}),[["__scopeId","data-v-42899e08"]]),Ut=ge({__name:"OcButton",props:{appearance:{default:"outline"},ariaLabel:{},colorRole:{default:"secondary"},disabled:{type:Boolean,default:!1},gapSize:{default:"medium"},href:{},justifyContent:{default:"center"},showSpinner:{type:Boolean,default:!1},size:{default:"medium"},submit:{default:"button"},target:{},to:{},type:{default:"button"},noHover:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t,r=T(()=>({...e.href&&{href:e.href},...e.target&&{target:e.target},...e.to&&{to:e.to},...e.type==="button"&&{type:e.submit},...e.type==="button"&&{disabled:e.disabled}})),s=T(()=>({...e.type==="button"&&{click:o}})),o=i=>{n("click",i)};return(i,l)=>{const u=te("oc-spinner");return D(),ee(Yt(e.type),at(r.value,{"aria-label":e.ariaLabel,class:[[`oc-button-${a(et.kebabCase)(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${a(et.kebabCase)(e.colorRole)}-${e.appearance}`,{...a(IS)(e.gapSize),...a(PS)(e.justifyContent),"text-sm min-h-3":e.size==="small","text-base min-h-4":e.size==="medium","text-lg min-h-7":e.size==="large","no-hover":e.noHover}],"oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default"]},Uo(s.value)),{default:X(()=>[e.showSpinner?(D(),ee(u,{key:0,size:"small",class:"spinner"})):ie("",!0),Se(i.$slots,"default")]),_:3},16,["aria-label","class"])}}}),io=Math.min,an=Math.max,Ni=Math.round,_n=e=>({x:e,y:e}),Ax={left:"right",right:"left",bottom:"top",top:"bottom"};function xh(e,t,n){return an(e,io(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function kr(e){return e.split("-")[0]}function lo(e){return e.split("-")[1]}function Ah(e){return e==="x"?"y":"x"}function Rh(e){return e==="y"?"height":"width"}function er(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Eh(e){return Ah(er(e))}function Rx(e,t,n){n===void 0&&(n=!1);const r=lo(e),s=Eh(e),o=Rh(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Bi(i)),[i,Bi(i)]}function Ex(e){const t=Bi(e);return[ql(e),t,ql(t)]}function ql(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Dh=["left","right"],Fh=["right","left"],Dx=["top","bottom"],Fx=["bottom","top"];function Ix(e,t,n){switch(e){case"top":case"bottom":return n?t?Fh:Dh:t?Dh:Fh;case"left":case"right":return t?Dx:Fx;default:return[]}}function Px(e,t,n,r){const s=lo(e);let o=Ix(kr(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(ql)))),o}function Bi(e){const t=kr(e);return Ax[t]+e.slice(t.length)}function $x(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ox(e){return typeof e!="number"?$x(e):{top:e,right:e,bottom:e,left:e}}function ji(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Ih(e,t,n){let{reference:r,floating:s}=e;const o=er(t),i=Eh(t),l=Rh(i),u=kr(t),d=o==="y",c=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[l]/2-s[l]/2;let h;switch(u){case"top":h={x:c,y:r.y-s.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-s.width,y:f};break;default:h={x:r.x,y:r.y}}switch(lo(t)){case"start":h[i]-=p*(n&&d?-1:1);break;case"end":h[i]+=p*(n&&d?-1:1);break}return h}async function Lx(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=ao(t,e),g=Ox(h),b=l[p?f==="floating"?"reference":"floating":f],S=ji(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:c,strategy:u})),k=f==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),C=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},A=ji(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:w,strategy:u}):k);return{top:(S.top-A.top+g.top)/C.y,bottom:(A.bottom-S.bottom+g.bottom)/C.y,left:(S.left-A.left+g.left)/C.x,right:(A.right-S.right+g.right)/C.x}}const _x=50,Mx=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:Lx},u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:f}=Ih(d,r,u),p=r,h=0;const g={};for(let m=0;m<o.length;m++){const b=o[m];if(!b)continue;const{name:S,fn:k}=b,{x:w,y:C,data:A,reset:I}=await k({x:c,y:f,initialPlacement:r,placement:p,strategy:s,middlewareData:g,rects:d,platform:l,elements:{reference:e,floating:t}});c=w??c,f=C??f,g[S]={...g[S],...A},I&&h<_x&&(h++,typeof I=="object"&&(I.placement&&(p=I.placement),I.rects&&(d=I.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):I.rects),{x:c,y:f}=Ih(d,p,u)),m=-1)}return{x:c,y:f,placement:p,strategy:s,middlewareData:g}},Nx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=ao(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=kr(s),k=er(l),w=kr(l)===l,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),A=p||(w||!m?[Bi(l)]:Ex(l)),I=g!=="none";!p&&I&&A.push(...Px(l,m,g,C));const N=[l,...A],_=await u.detectOverflow(t,b),F=[];let V=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&F.push(_[S]),f){const L=Rx(s,i,C);F.push(_[L[0]],_[L[1]])}if(V=[...V,{placement:s,overflows:F}],!F.every(L=>L<=0)){var Z,P;const L=(((Z=o.flip)==null?void 0:Z.index)||0)+1,M=N[L];if(M&&(!(f==="alignment"?k!==er(M):!1)||V.every(q=>er(q.placement)===k?q.overflows[0]>0:!0)))return{data:{index:L,overflows:V},reset:{placement:M}};let j=(P=V.filter(B=>B.overflows[0]<=0).sort((B,q)=>B.overflows[1]-q.overflows[1])[0])==null?void 0:P.placement;if(!j)switch(h){case"bestFit":{var $;const B=($=V.filter(q=>{if(I){const re=er(q.placement);return re===k||re==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(re=>re>0).reduce((re,J)=>re+J,0)]).sort((q,re)=>q[1]-re[1])[0])==null?void 0:$[0];B&&(j=B);break}case"initialPlacement":j=l;break}if(s!==j)return{reset:{placement:j}}}return{}}}},Bx=new Set(["left","top"]);async function jx(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=kr(n),l=lo(n),u=er(n)==="y",d=Bx.has(i)?-1:1,c=o&&u?-1:1,f=ao(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(h=l==="end"?g*-1:g),u?{x:h*c,y:p*d}:{x:p*d,y:h*c}}const zx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:l}=t,u=await jx(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:i}}}}},Vx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:k,y:w}=S;return{x:k,y:w}}},...d}=ao(e,t),c={x:n,y:r},f=await o.detectOverflow(t,d),p=er(kr(s)),h=Ah(p);let g=c[h],m=c[p];if(i){const S=h==="y"?"top":"left",k=h==="y"?"bottom":"right",w=g+f[S],C=g-f[k];g=xh(w,g,C)}if(l){const S=p==="y"?"top":"left",k=p==="y"?"bottom":"right",w=m+f[S],C=m-f[k];m=xh(w,m,C)}const b=u.fn({...t,[h]:g,[p]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[h]:i,[p]:l}}}}}},Ux=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:l}=t,{apply:u=()=>{},...d}=ao(e,t),c=await i.detectOverflow(t,d),f=kr(s),p=lo(s),h=er(s)==="y",{width:g,height:m}=o.floating;let b,S;f==="top"||f==="bottom"?(b=f,S=p===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(S=f,b=p==="end"?"top":"bottom");const k=m-c.top-c.bottom,w=g-c.left-c.right,C=io(m-c[b],k),A=io(g-c[S],w),I=!t.middlewareData.shift;let N=C,_=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=k),I&&!p){const V=an(c.left,0),Z=an(c.right,0),P=an(c.top,0),$=an(c.bottom,0);h?_=g-2*(V!==0||Z!==0?V+Z:an(c.left,c.right)):N=m-2*(P!==0||$!==0?P+$:an(c.top,c.bottom))}await u({...t,availableWidth:_,availableHeight:N});const F=await i.getDimensions(l.floating);return g!==F.width||m!==F.height?{reset:{rects:!0}}:{}}}};function zi(){return typeof window<"u"}function ys(e){return Ph(e)?(e.nodeName||"").toLowerCase():"#document"}function Qt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tr(e){var t;return(t=(Ph(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ph(e){return zi()?e instanceof Node||e instanceof Qt(e).Node:!1}function wn(e){return zi()?e instanceof Element||e instanceof Qt(e).Element:!1}function nr(e){return zi()?e instanceof HTMLElement||e instanceof Qt(e).HTMLElement:!1}function $h(e){return!zi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qt(e).ShadowRoot}function co(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Sn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function qx(e){return/^(table|td|th)$/.test(ys(e))}function Vi(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Hx=/transform|translate|scale|rotate|perspective|filter/,Wx=/paint|layout|strict|content/,Hr=e=>!!e&&e!=="none";let Hl;function Wl(e){const t=wn(e)?Sn(e):e;return Hr(t.transform)||Hr(t.translate)||Hr(t.scale)||Hr(t.rotate)||Hr(t.perspective)||!Ql()&&(Hr(t.backdropFilter)||Hr(t.filter))||Hx.test(t.willChange||"")||Wx.test(t.contain||"")}function Qx(e){let t=Cr(e);for(;nr(t)&&!vs(t);){if(Wl(t))return t;if(Vi(t))return null;t=Cr(t)}return null}function Ql(){return Hl==null&&(Hl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hl}function vs(e){return/^(html|body|#document)$/.test(ys(e))}function Sn(e){return Qt(e).getComputedStyle(e)}function Ui(e){return wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cr(e){if(ys(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$h(e)&&e.host||tr(e);return $h(t)?t.host:t}function Oh(e){const t=Cr(e);return vs(t)?e.ownerDocument?e.ownerDocument.body:e.body:nr(t)&&co(t)?t:Oh(t)}function Lh(e,t,n){var r;t===void 0&&(t=[]);const s=Oh(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=Qt(s);return o?(Kl(i),t.concat(i,i.visualViewport||[],co(s)?s:[],[])):t.concat(s,Lh(s,[]))}function Kl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _h(e){const t=Sn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=nr(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=Ni(n)!==o||Ni(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Mh(e){return wn(e)?e:e.contextElement}function bs(e){const t=Mh(e);if(!nr(t))return _n(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=_h(t);let i=(o?Ni(n.width):n.width)/r,l=(o?Ni(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Kx=_n(0);function Nh(e){const t=Qt(e);return!Ql()||!t.visualViewport?Kx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qt(e)?!1:t}function uo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Mh(e);let i=_n(1);t&&(r?wn(r)&&(i=bs(r)):i=bs(e));const l=Gx(o,n,r)?Nh(o):_n(0);let u=(s.left+l.x)/i.x,d=(s.top+l.y)/i.y,c=s.width/i.x,f=s.height/i.y;if(o){const p=Qt(o),h=r&&wn(r)?Qt(r):r;let g=p,m=Kl(g);for(;m&&r&&h!==g;){const b=bs(m),S=m.getBoundingClientRect(),k=Sn(m),w=S.left+(m.clientLeft+parseFloat(k.paddingLeft))*b.x,C=S.top+(m.clientTop+parseFloat(k.paddingTop))*b.y;u*=b.x,d*=b.y,c*=b.x,f*=b.y,u+=w,d+=C,g=Qt(m),m=Kl(g)}}return ji({width:c,height:f,x:u,y:d})}function qi(e,t){const n=Ui(e).scrollLeft;return t?t.left+n:uo(tr(e)).left+n}function Bh(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-qi(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function Jx(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=tr(r),l=t?Vi(t.floating):!1;if(r===i||l&&o)return n;let u={scrollLeft:0,scrollTop:0},d=_n(1);const c=_n(0),f=nr(r);if((f||!f&&!o)&&((ys(r)!=="body"||co(i))&&(u=Ui(r)),f)){const h=uo(r);d=bs(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=i&&!f&&!o?Bh(i,u):_n(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+c.x+p.x,y:n.y*d.y-u.scrollTop*d.y+c.y+p.y}}function Xx(e){return Array.from(e.getClientRects())}function Yx(e){const t=tr(e),n=Ui(e),r=e.ownerDocument.body,s=an(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=an(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+qi(e);const l=-n.scrollTop;return Sn(r).direction==="rtl"&&(i+=an(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:l}}const jh=25;function Zx(e,t){const n=Qt(e),r=tr(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,l=0,u=0;if(s){o=s.width,i=s.height;const c=Ql();(!c||c&&t==="fixed")&&(l=s.offsetLeft,u=s.offsetTop)}const d=qi(r);if(d<=0){const c=r.ownerDocument,f=c.body,p=getComputedStyle(f),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=jh&&(o-=g)}else d<=jh&&(o+=d);return{width:o,height:i,x:l,y:u}}function eA(e,t){const n=uo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=nr(e)?bs(e):_n(1),i=e.clientWidth*o.x,l=e.clientHeight*o.y,u=s*o.x,d=r*o.y;return{width:i,height:l,x:u,y:d}}function zh(e,t,n){let r;if(t==="viewport")r=Zx(e,n);else if(t==="document")r=Yx(tr(e));else if(wn(t))r=eA(t,n);else{const s=Nh(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ji(r)}function Vh(e,t){const n=Cr(e);return n===t||!wn(n)||vs(n)?!1:Sn(n).position==="fixed"||Vh(n,t)}function tA(e,t){const n=t.get(e);if(n)return n;let r=Lh(e,[]).filter(l=>wn(l)&&ys(l)!=="body"),s=null;const o=Sn(e).position==="fixed";let i=o?Cr(e):e;for(;wn(i)&&!vs(i);){const l=Sn(i),u=Wl(i);!u&&l.position==="fixed"&&(s=null),(o?!u&&!s:!u&&l.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||co(i)&&!u&&Vh(e,i))?r=r.filter(c=>c!==i):s=l,i=Cr(i)}return t.set(e,r),r}function nA(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?Vi(t)?[]:tA(t,this._c):[].concat(n),r],l=zh(t,i[0],s);let u=l.top,d=l.right,c=l.bottom,f=l.left;for(let p=1;p<i.length;p++){const h=zh(t,i[p],s);u=an(h.top,u),d=io(h.right,d),c=io(h.bottom,c),f=an(h.left,f)}return{width:d-f,height:c-u,x:f,y:u}}function rA(e){const{width:t,height:n}=_h(e);return{width:t,height:n}}function sA(e,t,n){const r=nr(t),s=tr(t),o=n==="fixed",i=uo(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const u=_n(0);function d(){u.x=qi(s)}if(r||!r&&!o)if((ys(t)!=="body"||co(s))&&(l=Ui(t)),r){const h=uo(t,!0,o,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else s&&d();o&&!r&&s&&d();const c=s&&!r&&!o?Bh(s,l):_n(0),f=i.left+l.scrollLeft-u.x-c.x,p=i.top+l.scrollTop-u.y-c.y;return{x:f,y:p,width:i.width,height:i.height}}function Gl(e){return Sn(e).position==="static"}function Uh(e,t){if(!nr(e)||Sn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return tr(e)===n&&(n=n.ownerDocument.body),n}function qh(e,t){const n=Qt(e);if(Vi(e))return n;if(!nr(e)){let s=Cr(e);for(;s&&!vs(s);){if(wn(s)&&!Gl(s))return s;s=Cr(s)}return n}let r=Uh(e,t);for(;r&&qx(r)&&Gl(r);)r=Uh(r,t);return r&&vs(r)&&Gl(r)&&!Wl(r)?n:r||Qx(e)||n}const oA=async function(e){const t=this.getOffsetParent||qh,n=this.getDimensions,r=await n(e.floating);return{reference:sA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iA(e){return Sn(e).direction==="rtl"}const aA={convertOffsetParentRelativeRectToViewportRelativeRect:Jx,getDocumentElement:tr,getClippingRect:nA,getOffsetParent:qh,getElementRects:oA,getClientRects:Xx,getDimensions:rA,getScale:bs,isElement:wn,isRTL:iA},lA=zx,cA=Vx,uA=Nx,dA=Ux,fA=(e,t,n)=>{const r=new Map,s={platform:aA,...n},o={...s.platform,_c:r};return Mx(e,t,{...s,platform:o})},pA=["src"],Jl=ge({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=Cu(),n=T(()=>Object.hasOwn(t,"header")||!!a(e.title)||!!a(e.logoUrl)),r=T(()=>Object.hasOwn(t,"footer"));return(s,o)=>(D(),ee(Yt(e.tag),{class:"oc-card"},{default:X(()=>[n.value?(D(),K("div",{key:0,class:R.normalizeClass(["oc-card-header",e.headerClass])},[Se(s.$slots,"header",{},()=>[e.logoUrl?(D(),K("img",{key:0,src:e.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,pA)):ie("",!0),e.title?(D(),ee(Yt(e.titleTag),{key:1,class:"mt-0"},{default:X(()=>[it(R.toDisplayString(e.title),1)]),_:1})):ie("",!0)])],2)):ie("",!0),W("div",{class:R.normalizeClass(["oc-card-body",e.bodyClass])},[Se(s.$slots,"default")],2),r.value?(D(),K("div",{key:1,class:R.normalizeClass(["oc-card-footer",e.footerClass])},[Se(s.$slots,"footer")],2)):ie("",!0)]),_:3}))}}),hA=["textContent"],mA=ge({__name:"OcMobileDrop",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""},registerClickHandler:{type:Boolean,default:!0}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const r=n,{$gettext:s}=de.useGettext(),o=AT(),{showDrawer:i,closeDrawer:l,closeAllDrawers:u}=o,{drawers:d,currentDrawer:c}=ve.storeToRefs(o),f=H(null),p=qt("bottomDrawerCardBodyRef"),h=T(()=>a(d).map(({id:w})=>w).includes(a(f)?.id)),g=T(()=>a(f)?.id&&a(c)?.id===a(f).id),m=async()=>{f.value=i(),r("show"),await St(),a(p)?.addEventListener("click",S)},b=()=>{l(a(f)?.id),a(p)?.removeEventListener("click",S),r("hide")},S=w=>{const C=w.target.closest("a[href], button");if(C){if(C.hasAttribute("aria-expanded")){C.setAttribute("aria-expanded","true");return}e.closeOnClick&&(b(),u())}},k=w=>{w.target===w.currentTarget&&u()};return Cn.onKeyStroke("Escape",w=>{w.preventDefault(),u()}),ft(()=>{!a(e.toggle)||!e.registerClickHandler||document.querySelector(e.toggle)?.addEventListener("click",m)}),Xt(()=>{e.registerClickHandler&&document.querySelector(e.toggle)?.removeEventListener("click",m),a(f)&&l(a(f).id)}),t({show:m,hide:b}),(w,C)=>{const A=te("oc-icon");return h.value?(D(),ee(Ps,{key:0,to:"#app-runtime-bottom-drawer"},[Q(xx,{id:e.drawerId,"is-drawer-active":g.value,"is-focus-trap-active":g.value,class:"oc-mobile-drop z-[calc(var(--z-index-modal)+2)]",onClicked:k},{default:X(()=>[Q(Jl,{class:"bg-role-surface-container-high overflow-x-hidden rounded-b-none","header-class":"flex flex-row justify-between items-center"},{header:X(()=>[a(d).length>1?(D(),ee(Ut,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":a(s)("Open the parent context menu"),onClick:C[0]||(C[0]=I=>b())},{default:X(()=>[Q(A,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):ie("",!0),W("span",{class:"font-semibold",textContent:R.toDisplayString(e.title)},null,8,hA),Q(Ut,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":a(s)("Close the context menu"),onClick:C[1]||(C[1]=I=>a(u)())},{default:X(()=>[Q(A,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:X(()=>[W("div",{ref_key:"bottomDrawerCardBodyRef",ref:p},[Se(w.$slots,"default")],512)]),_:3})]),_:3},8,["id","is-drawer-active","is-focus-trap-active"])])):ie("",!0)}}}),gA=()=>{const e=[];return{registerEventListener:(r,s,o,i,l)=>{r.addEventListener(s,o,l),e.push({target:r,type:s,handler:o,options:l,category:i})},unregisterEventListeners:r=>{if(!r){e.forEach(({target:o,type:i,handler:l,options:u})=>{o.removeEventListener(i,l,u)}),e.length=0;return}e.filter(o=>r.includes(o.category)).forEach(({target:o,type:i,handler:l,options:u})=>{o.removeEventListener(i,l,u)}),e.splice(0,e.length,...e.filter(o=>!r.includes(o.category)))}}},yA=["id"],Hh=ge({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>Mr("oc-drop-")},mode:{default:"click"},offset:{default:5},paddingSize:{default:"medium"},position:{default:"bottom-start"},toggle:{default:""},enforceDropOnMobile:{type:Boolean,default:!1}},emits:["hideDrop","showDrop"],setup(e,{expose:t,emit:n}){const r=n,{registerEventListener:s,unregisterEventListeners:o}=gA(),{isMobile:i}=to(),l=H(!1),u=T(()=>a(i)&&!e.enforceDropOnMobile),d=qt("bottomDrawerRef"),c=qt("drop"),f=T(()=>e.toggle?document.querySelector(e.toggle):null);t({show:({event:j,useMouseAnchor:B}={})=>{if(a(u)){a(d).show();return}a(l)||b({event:j,useMouseAnchor:B})},hide:()=>{if(a(u)){a(d).hide();return}S()}});const g=j=>{const B=j.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!B&&S()},m=()=>new Promise(j=>requestAnimationFrame(j)),b=async({event:j,useMouseAnchor:B}={})=>{if(a(l)){S();return}let q=a(f);if(B){const oe=j;q={getBoundingClientRect(){return{width:0,height:0,x:oe.clientX,y:oe.clientY,top:oe.clientY,left:oe.clientX,right:oe.clientX,bottom:oe.clientY}}}}if(l.value=!0,await St(),!q){console.warn("OcDrop cannot be opened: anchor element not found");return}await m();const{x:re,y:J}=await fA(q,a(c),{placement:e.position,middleware:[lA(e.offset),uA(),cA({padding:5}),dA({apply({availableWidth:oe,availableHeight:ne,elements:pe}){Object.assign(pe.floating.style,{maxWidth:`${Math.min(400,oe-10)}px`,maxHeight:`${Math.max(0,ne-10)}px`})}})]});Object.assign(a(c).style,{left:`${re}px`,top:`${J}px`}),a(f)?.setAttribute("aria-expanded","true"),r("showDrop"),s(document,"click",A,"document",{capture:!0}),s(document,"contextmenu",A,"document",{capture:!0}),s(document,"keydown",I,"document"),s(a(c),"focusout",C,"drop"),e.mode==="hover"&&(s(a(c),"mouseenter",F,"drop"),s(a(c),"mouseleave",V,"drop"))},S=()=>{o(["drop","document"]),l.value=!1,a(f)?.setAttribute("aria-expanded","false"),r("hideDrop")},k=j=>j instanceof FocusEvent,w=j=>j instanceof KeyboardEvent,C=j=>{if(!k(j))return;j.relatedTarget&&!a(c)?.contains(j.relatedTarget)&&S()},A=j=>{const B=j.target;if(a(c)&&!a(c).contains(B)){const re=a(f);re&&re.contains(B)||S()}},I=j=>{w(j)&&j.code==="Escape"&&(S(),a(f)?.focus())};let N=null;const _=()=>{N!==null&&(clearTimeout(N),N=null)},F=()=>{_()},V=()=>{N=setTimeout(S,100)},Z=j=>{b({event:j})},P=j=>{_(),a(l)||b({event:j})},$=()=>{N=setTimeout(S,100)},L=()=>{const j=a(f);j&&(j.setAttribute("aria-haspopup","true"),j.setAttribute("aria-expanded","false"))},M=()=>{const j=a(f);if(!(!j||a(u)))switch(e.mode){case"click":s(j,"click",Z,"anchor");break;case"hover":s(j,"mouseenter",P,"anchor"),s(j,"mouseleave",$,"anchor");break}};return ze(u,()=>{L(),a(u)?o():M()}),ft(()=>{M(),L()}),Xt(()=>{_(),o();const j=a(f);j?.removeAttribute("aria-expanded"),j?.removeAttribute("aria-haspopup")}),(j,B)=>u.value?(D(),ee(mA,{key:0,ref_key:"bottomDrawerRef",ref:d,"drawer-id":e.dropId,toggle:e.toggle,"close-on-click":e.closeOnClick,title:e.title,"register-click-handler":e.mode!=="manual",onShow:B[0]||(B[0]=q=>r("showDrop")),onHide:B[1]||(B[1]=q=>r("hideDrop"))},{default:X(()=>[Se(j.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title","register-click-handler"])):(D(),ee(fv,{key:1,name:"oc-drop"},{default:X(()=>[l.value?(D(),K("div",{key:0,id:e.dropId,ref_key:"drop",ref:c,class:"oc-drop shadow-md/20 rounded-sm bg-role-surface",onClick:g},[j.$slots.default?(D(),ee(Jl,{key:0,"body-class":[a($S)(e.paddingSize)]},{default:X(()=>[Se(j.$slots,"default")]),_:3},8,["body-class"])):Se(j.$slots,"special",{key:1})],8,yA)):ie("",!0)]),_:3}))}}),vA=["type","disabled"],bA={class:"flex flex-row flex-wrap text-sm pt-2 gap-x-2"},wA=["textContent"],Wh="file-copy",SA=ge({__name:"OcTextInputPassword",props:{disabled:{type:Boolean,default:!1},generatePasswordMethod:{type:Function},hasError:{type:Boolean,default:!1},passwordPolicy:{},teleportId:{default:""},value:{default:""}},emits:["passwordChallengeCompleted","passwordChallengeFailed","passwordGenerated"],setup(e,{expose:t,emit:n}){const r=n,s=qt("passwordInput"),{$gettext:o}=de.useGettext(),i=H(e.value),l=H(!1),u=H(Wh),d=H(!1),c=T(()=>!!Object.keys(e.passwordPolicy?.rules||{}).length),f=T(()=>e.passwordPolicy?.missing(a(i))),p=k=>{const w={};for(let C=0;C<k.format.length;C++)w[`param${C+1}`]=k.format[C]?.toString();return o(k.message,w)},h=()=>{navigator.clipboard.writeText(a(i)),u.value="check",setTimeout(()=>u.value=Wh,1500)},g=()=>{const k=e.generatePasswordMethod();i.value=k,r("passwordGenerated",i.value)};return t({focus:()=>{a(s).focus()},select:()=>{a(s).select()},setSelectionRange:(k,w)=>{a(s).setSelectionRange(k,w)}}),ze(i,k=>{if(Object.keys(e.passwordPolicy).length){if(!e.passwordPolicy.check(k))return r("passwordChallengeFailed");r("passwordChallengeCompleted")}}),(k,w)=>{const C=te("oc-contextual-helper"),A=Bt("oc-tooltip");return D(),K(ke,null,[W("div",{class:R.normalizeClass(["oc-text-input-password-wrapper flex flex-row border rounded-sm",{"oc-text-input-password-wrapper-danger text-role-error focus:text-role-error border-role-error":e.hasError,"border-role-surface outline-2 outline-role-outline":d.value,"border-role-outline":!d.value}])},[je(W("input",at(k.$attrs,{ref_key:"passwordInput",ref:s,"onUpdate:modelValue":w[0]||(w[0]=I=>i.value=I),class:"grow-2 border-0 focus:border-0 focus:outline-0",type:l.value?"text":"password",disabled:e.disabled,onFocus:w[1]||(w[1]=I=>d.value=!0),onBlur:w[2]||(w[2]=I=>d.value=!1)}),null,16,vA),[[kv,i.value]]),i.value&&!e.disabled?je((D(),ee(Ut,{key:0,"aria-label":l.value?a(o)("Hide password"):a(o)("Show password"),class:"oc-text-input-show-password-toggle px-2",appearance:"raw",size:"small",onClick:w[3]||(w[3]=I=>l.value=!l.value)},{default:X(()=>[Q(Yn,{size:"small",name:l.value?"eye-off":"eye"},null,8,["name"])]),_:1},8,["aria-label"])),[[A,l.value?a(o)("Hide password"):a(o)("Show password")]]):ie("",!0),i.value&&!e.disabled?je((D(),ee(Ut,{key:1,"aria-label":a(o)("Copy password"),class:"oc-text-input-copy-password-button px-2",appearance:"raw",size:"small",onClick:h},{default:X(()=>[Q(Yn,{size:"small",name:u.value},null,8,["name"])]),_:1},8,["aria-label"])),[[A,a(o)("Copy password")]]):ie("",!0),e.generatePasswordMethod&&!e.disabled?je((D(),ee(Ut,{key:2,"aria-label":a(o)("Generate password"),class:"oc-text-input-generate-password-button px-2",appearance:"raw",size:"small",onClick:g},{default:X(()=>[Q(Yn,{size:"small",name:"refresh","fill-type":"line"})]),_:1},8,["aria-label"])),[[A,a(o)("Generate password")]]):ie("",!0)],2),c.value?(D(),ee(Ps,{key:0,defer:"",to:`#${e.teleportId}`},[W("div",bA,[(D(!0),K(ke,null,Ge(f.value.rules,(I,N)=>(D(),K("div",{key:N,class:"flex items-center oc-text-input-password-policy-rule"},[Q(Yn,{size:"small",class:"mr-1",name:I.verified?"checkbox-circle":"close-circle",color:I.verified?"var(--oc-role-on-surface)":"var(--oc-role-error)"},null,8,["name","color"]),W("span",{class:R.normalizeClass([{"oc-text-input-danger":!I.verified}]),textContent:R.toDisplayString(p(I))},null,10,wA),I.helperMessage?(D(),ee(C,{key:0,text:I.helperMessage,title:a(o)("Password policy")},null,8,["text","title"])):ie("",!0)]))),128))])],8,["to"])):ie("",!0)],64)}}}),kA=["for"],CA={key:0,class:"text-role-error","aria-hidden":"true"},TA=["id","textContent"],xA=["id","textContent"],AA=["id"],RA=ge({inheritAttrs:!1,__name:"OcTextInput",props:{id:{default:()=>Mr("oc-textinput-")},type:{default:"text"},modelValue:{default:""},selectionRange:{},clearButtonEnabled:{type:Boolean,default:!1},clearButtonAccessibleLabel:{default:""},defaultValue:{},disabled:{type:Boolean,default:!1},label:{},inlineLabel:{type:Boolean,default:!1},errorMessage:{},errorMessageDebouncedTime:{default:500},fixMessageLine:{type:Boolean,default:!1},descriptionMessage:{},readOnly:{type:Boolean,default:!1},requiredMark:{type:Boolean,default:!1},passwordPolicy:{default:()=>({})},generatePasswordMethod:{type:Function},hasBorder:{type:Boolean,default:!0}},emits:["change","update:modelValue","focus","passwordChallengeCompleted","passwordChallengeFailed"],setup(e,{expose:t,emit:n}){const r=n,s=My(),o=H(!1),i=T(()=>!!e.descriptionMessage),l=T(()=>e.fixMessageLine||a(o)||a(i)),u=T(()=>a(o).toString()),d=T(()=>`${e.id}-message`),c=T(()=>e.type==="password"?{passwordGenerated:C}:{}),f=qo(),p=T(()=>{const _={};(a(o)||a(i))&&(_["aria-describedby"]=d.value),e.defaultValue&&(_.placeholder=e.defaultValue),e.type==="password"&&(_["password-policy"]=e.passwordPolicy,_["generate-password-method"]=e.generatePasswordMethod,_["has-error"]=a(o));const{change:F,input:V,focus:Z,class:P,...$}=f;return{...$,..._}}),h=T(()=>!e.disabled&&e.clearButtonEnabled&&!!e.modelValue),g=T(()=>e.clearButtonAccessibleLabel||"Clear input"),m=T(()=>e.type==="password"?SA:"input"),b=qt("inputRef"),S=()=>{a(b).focus()};t({focus:S});function k(){S(),C(""),w(null)}const w=_=>{r("change",_)},C=_=>{r("update:modelValue",_)},A=async _=>{await St(),a(b).select(),I(),r("focus",_.value)},I=()=>{e.selectionRange&&e.selectionRange.length>1&&a(b).setSelectionRange(e.selectionRange[0],e.selectionRange[1])};ze([()=>e.selectionRange,b],async()=>{a(b)&&(await St(),I())},{immediate:!0});const N=et.debounce(()=>{o.value=!!e.errorMessage},e.errorMessageDebouncedTime);return ze(()=>e.modelValue,()=>{N()}),ze(()=>e.errorMessage,()=>{e.errorMessage?N():(o.value=!1,N.cancel?.())}),(_,F)=>(D(),K("div",{class:R.normalizeClass([{"flex items-center":e.inlineLabel},_.$attrs.class])},[Se(_.$slots,"label",{},()=>[W("label",{class:R.normalizeClass(["inline-block",{"mr-2":e.inlineLabel,"mb-0.5":!e.inlineLabel}]),for:e.id},[it(R.toDisplayString(e.label)+" ",1),e.requiredMark?(D(),K("span",CA,"*")):ie("",!0)],10,kA)]),W("div",{class:R.normalizeClass(["relative",{"grow-1":e.inlineLabel}])},[e.readOnly?(D(),ee(Yn,{key:0,name:"lock",size:"small",class:"mt-2 ml-2 absolute"})):ie("",!0),(D(),ee(Yt(m.value),at({id:e.id},p.value,{ref_key:"inputRef",ref:b,"aria-invalid":u.value,class:["oc-text-input oc-input",{"oc-text-input-danger border-role-error":!!o.value,"pl-6":!!e.readOnly,"pr-6":h.value,"border-none outline-none bg-transparent":!e.hasBorder}],type:e.type,value:e.modelValue,disabled:e.disabled||e.readOnly,"teleport-id":a(s)},Uo(c.value),{onChange:F[0]||(F[0]=V=>w(V.target.value)),onInput:F[1]||(F[1]=V=>C(V.target.value)),onPasswordChallengeCompleted:F[2]||(F[2]=V=>_.$emit("passwordChallengeCompleted")),onPasswordChallengeFailed:F[3]||(F[3]=V=>_.$emit("passwordChallengeFailed")),onFocus:F[4]||(F[4]=V=>A(V.target))}),null,16,["id","aria-invalid","class","type","value","disabled","teleport-id"])),h.value?(D(),ee(Ut,{key:1,"aria-label":g.value,class:"pr-2 absolute top-[50%] transform-[translateY(-50%)] right-0 oc-text-input-btn-clear",appearance:"raw","no-hover":"",onClick:k},{default:X(()=>[Q(Yn,{name:"close",size:"small"})]),_:1},8,["aria-label"])):ie("",!0)],2),l.value?(D(),K("div",{key:0,class:R.normalizeClass(["oc-text-input-message flex align-center text-sm mt-1 min-h-4.5",{"oc-text-input-description text-role-on-surface-variant relative":i.value,"oc-text-input-danger text-role-error focus:text-role-error border-role-error":o.value}])},[o.value?(D(),K(ke,{key:0},[o.value?(D(),ee(Yn,{key:0,name:"error-warning",size:"small","fill-type":"line","aria-hidden":"true",class:"mr-1"})):ie("",!0),o.value?(D(),K("span",{key:1,id:d.value,class:"oc-text-input-danger text-role-error focus:text-role-error border-role-error",textContent:R.toDisplayString(e.errorMessage)},null,8,TA)):ie("",!0)],64)):i.value?(D(),K("span",{key:1,id:d.value,class:"oc-text-input-description text-role-on-surface-variant flex items-center relative",textContent:R.toDisplayString(e.descriptionMessage)},null,8,xA)):ie("",!0)],2)):ie("",!0),W("div",{id:a(s)},null,8,AA)],2))}});var EA=Object.defineProperty,Qh=Object.getOwnPropertySymbols,DA=Object.prototype.hasOwnProperty,FA=Object.prototype.propertyIsEnumerable,Kh=(e,t,n)=>t in e?EA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IA=(e,t)=>{for(var n in t||(t={}))DA.call(t,n)&&Kh(e,n,t[n]);if(Qh)for(var n of Qh(t))FA.call(t,n)&&Kh(e,n,t[n]);return e};const Gh=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},PA={},$A={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},OA=W("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),LA=[OA];function _A(e,t){return D(),K("svg",$A,LA)}const MA=Gh(PA,[["render",_A]]),NA={},BA={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},jA=W("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),zA=[jA];function VA(e,t){return D(),K("svg",BA,zA)}IA({},{Deselect:MA,OpenIndicator:Gh(NA,[["render",VA]])});const UA=["aria-label","aria-live","aria-hidden","role"],qA=ge({__name:"OcSpinner",props:{ariaLabel:{default:()=>{}},size:{default:"medium"}},setup(e){return(t,n)=>(D(),K("span",{class:R.normalizeClass(["oc-spinner inline-block after:block after:bg-transparent after:border after:border-current after:rounded-full after:size-full relative after:relative animate-spin after:content-[''] after:border-b-transparent",{"size-2":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-10":e.size==="xlarge","size-12":e.size==="xxlarge","size-16":e.size==="xxxlarge"}]),"aria-label":e.ariaLabel||void 0,"aria-live":e.ariaLabel?"polite":void 0,"aria-hidden":e.ariaLabel?void 0:"true",tabindex:"-1",role:e.ariaLabel?"img":void 0},null,10,UA))}}),HA={class:"oc-status-indicators flex"},WA=["id","textContent"],QA=ge({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=de.useGettext(),n=H({}),r=o=>Object.hasOwn(o,"handler"),s=o=>o.accessibleDescription?(a(n)[o.id]||(a(n)[o.id]=Mr("oc-indicator-description-")),a(n)[o.id]):null;return(o,i)=>{const l=Bt("oc-tooltip");return D(),K("div",HA,[(D(!0),K(ke,null,Ge(e.indicators,(u,d)=>(D(),K(ke,null,[r(u)&&!e.disableHandler?je((D(),ee(Ut,{id:u.id,key:`${u.id}-handler`,class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),"aria-label":a(t)(u.label),"aria-describedby":s(u),appearance:"raw","data-testid":u.id,"data-test-indicator-type":u.type,"data-test-indicator-resource-name":e.resource.name,"data-test-indicator-resource-path":e.resource.path,"no-hover":"",onClick:c=>u.handler?.(e.resource,c)},{default:X(()=>[Q(Yn,{name:u.icon,size:"small","fill-type":u.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","data-test-indicator-resource-name","data-test-indicator-resource-path","onClick"])),[[l,a(t)(u.label)]]):je((D(),ee(Yn,{id:u.id,key:u.id,tabindex:"-1",size:"small",class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),name:u.icon,"fill-type":u.fillType,"accessible-label":a(t)(u.label),"aria-describedby":s(u),"data-testid":u.id,"data-test-indicator-type":u.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[l,a(t)(u.label)]]),s(u)?(D(),K("p",{id:s(u),key:s(u),class:"sr-only",textContent:R.toDisplayString(a(t)(u.accessibleDescription))},null,8,WA)):ie("",!0)],64))),256))])}}}),KA={class:"oc-thead border-b"},GA=ge({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(D(),K("thead",KA,[Se(t.$slots,"default")]))}}),JA=ge({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(D(),K("tbody",null,[Se(t.$slots,"default")]))}}),Jh=Le(ge({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const n=t;return(r,s)=>(D(),ee(Yt(e.type),{class:R.normalizeClass(["oc-table-cell",{"break-all":e.wrap==="break","whitespace-nowrap":e.wrap==="nowrap","overflow-visible max-w-0":e.wrap==="truncate","text-left":e.alignH==="left","text-right":e.alignH==="right","text-center":e.alignH==="center","align-top":e.alignV==="top","align-middle":e.alignV==="middle","align-bottom":e.alignV==="bottom","w-px":e.width==="shrink","min-w-38":e.width==="expand"}]),onClick:s[0]||(s[0]=o=>n("click",o))},{default:X(()=>[Se(r.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),Xh=ge({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(D(),ee(Jh,{type:"td","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-td"},{default:X(()=>[Se(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),Yh=Le(ge({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=ny((l,u)=>{let d;return{get(){return l(),d},set(c){d=c,u()}}}),s=T(()=>e.lazy?e.lazy.colspan:1),{isVisible:o}=e.lazy?Xp({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:H(!0)},i=T(()=>!a(o));return e.lazy||n("itemVisible"),(l,u)=>(D(),K("tr",{ref_key:"observerTarget",ref:r,onClick:u[0]||(u[0]=d=>l.$emit("click",d)),onContextmenu:u[1]||(u[1]=d=>l.$emit("contextmenu",d)),onDragstart:u[2]||(u[2]=d=>l.$emit("dragstart",d)),onDrop:u[3]||(u[3]=d=>l.$emit("drop",d)),onDragenter:u[4]||(u[4]=d=>l.$emit("dragenter",d)),onDragleave:u[5]||(u[5]=d=>l.$emit("dragleave",d)),onDragover:u[6]||(u[6]=d=>l.$emit("dragover",d)),onMouseleave:u[7]||(u[7]=d=>l.$emit("mouseleave",d))},[i.value?(D(),ee(Xh,{key:0,colspan:s.value},{default:X(()=>[...u[8]||(u[8]=[W("span",{class:"shimmer inline-block bg-role-shadow overflow-hidden absolute inset-x-2 inset-y-3 after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-10 after:animate-shimmer"},null,-1)])]),_:1},8,["colspan"])):Se(l.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),XA=Le(ge({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(D(),ee(Jh,{type:"th","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-th aria-[sort]:cursor-pointer",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:X(()=>[Se(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),YA={key:0,class:"oc-table-thead-content inline-table align-middle"},ZA=["textContent"],eR={key:1},tR={key:0,class:"oc-table-thead-content inline-table align-middle"},nR=["textContent"],rR={key:1,class:"oc-table-footer border-t"},sR={class:"oc-table-footer-row h-10.5"},oR=["colspan"],iR=Le(ge({__name:"OcTable",props:{data:{},fields:{},disabled:{default:()=>[]},dragDrop:{type:Boolean,default:!1},hasHeader:{type:Boolean,default:!0},headerPosition:{default:0},highlighted:{},hover:{type:Boolean,default:!1},idKey:{default:"id"},itemDomSelector:{type:Function},lazy:{type:Boolean,default:!1},paddingX:{default:"small"},sortBy:{},sortDir:{},sticky:{type:Boolean,default:!1}},emits:["itemDropped","itemDragged","theadClicked","highlight","rowMounted","contextmenuClicked","sort","dropRowStyling","itemVisible"],setup(e,{emit:t}){const n=t,r={EVENT_THEAD_CLICKED:TS,EVENT_TROW_CLICKED:xS,EVENT_TROW_MOUNTED:AS,EVENT_TROW_CONTEXTMENU:RS},{$gettext:s}=de.useGettext(),o=P=>e.itemDomSelector?e.itemDomSelector(P):P[e.idKey],i=T(()=>{const P=["oc-table"];return e.hover&&P.push("oc-table-hover"),e.sticky&&P.push("oc-table-sticky"),P}),l=T(()=>e.fields.length),u=P=>{P.preventDefault()},d=(P,$)=>{n(ES,[P,$])},c=(P,$)=>{n(tf,[P,$])},f=(P,$,L)=>{n("dropRowStyling",P,$,L)},p=P=>P.type==="slot",h=P=>["callback","function"].indexOf(P.type)>=0,g=P=>Object.prototype.hasOwnProperty.call(P,"title")?P.title:P.name,m=()=>({class:i.value}),b=P=>{switch(e.paddingX){case"remove":return P==="right"?"pr-0":"pl-0";case"xsmall":return P==="right"?"pr-1":"pl-1";case"small":return P==="right"?"pr-2":"pl-2";case"medium":return P==="right"?"pr-4":"pl-4";case"large":return P==="right"?"pr-6":"pl-6";case"xlarge":return P==="right"?"pr-12":"pl-12";case"xxlarge":return P==="right"?"pr-24":"pl-24"}},S=(P,$)=>{const L=C(P);return L.class=`oc-table-header-cell oc-table-header-cell-${P.name}`,Object.prototype.hasOwnProperty.call(P,"thClass")&&(L.class+=` ${P.thClass}`),e.sticky&&(L.style=`top: ${e.headerPosition}px;`,L.class+=" z-10"),$===0&&(L.class+=` ${b("left")} `),$===e.fields.length-1&&(L.class+=` ${b("right")}`),F(L,P),L},k=(P,$)=>({...e.lazy&&{lazy:{colspan:l.value}},class:["oc-tbody-tr",`oc-tbody-tr-${o(P)||$}`,A(P)?"oc-table-highlighted":void 0,...I(P)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),w=(P,$,L)=>{const M=C(P);return M.class=`oc-table-data-cell oc-table-data-cell-${P.name}`,Object.prototype.hasOwnProperty.call(P,"tdClass")&&(M.class+=` ${P.tdClass}`),Object.prototype.hasOwnProperty.call(P,"wrap")&&(M.wrap=P.wrap),$===0&&(M.class+=` ${b("left")} `),$===e.fields.length-1&&(M.class+=` ${b("right")}`),Object.prototype.hasOwnProperty.call(P,"accessibleLabelCallback")&&(M["aria-label"]=P.accessibleLabelCallback(L)),M},C=P=>({...P?.alignH&&{alignH:P.alignH},...P?.alignV&&{alignV:P.alignV},...P?.width&&{width:P.width},class:void 0,wrap:void 0,style:void 0}),A=P=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(P[e.idKey])>-1:e.highlighted===P[e.idKey]:!1,I=P=>e.disabled.length?e.disabled.indexOf(P[e.idKey])>-1:!1,N=(P,$,L)=>{const M=[L[e.idKey],$+1].filter(Boolean);return p(P)?[...M,P.name].join("-"):h(P)?[...M,P.callback(L[P.name])].join("-"):[...M,L[P.name]].join("-")},_=P=>s("Sort by %{ name }",{name:P}),F=(P,$)=>{if(!V($))return;let L="none";e.sortBy===$.name&&(L=e.sortDir===Je.Asc?"ascending":"descending"),P["aria-sort"]=L},V=({sortable:P})=>!!P,Z=P=>{if(!V(P))return;let $=e.sortDir;e.sortBy===P.name&&e.sortDir!==void 0&&($=e.sortDir===Je.Desc?Je.Asc:Je.Desc),(e.sortBy!==P.name||e.sortDir===void 0)&&($=P.sortDir||Je.Desc),n("sort",{sortBy:P.name,sortDir:$})};return(P,$)=>{const L=te("oc-icon");return D(),K("table",at(m(),{class:"has-item-context-menu"}),[e.hasHeader?(D(),ee(GA,{key:0},{default:X(()=>[Q(Yh,{class:"oc-table-header-row h-10.5"},{default:X(()=>[(D(!0),K(ke,null,Ge(e.fields,(M,j)=>(D(),ee(XA,at({key:`oc-thead-${M.name}`},{ref_for:!0},S(M,j)),{default:X(()=>[M.sortable?(D(),ee(Ut,{key:0,"aria-label":_(M.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:B=>Z(M)},{default:X(()=>[M.headerType==="slot"?(D(),K("span",YA,[Se(P.$slots,M.name+"Header",{},void 0,!0)])):(D(),K("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(M))},null,8,ZA)),Q(L,{name:e.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:R.normalizeClass([{"sr-only":e.sortBy!==M.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(D(),K("div",eR,[M.headerType==="slot"?(D(),K("span",tR,[Se(P.$slots,M.name+"Header",{},void 0,!0)])):(D(),K("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(M))},null,8,nR))]))]),_:2},1040))),128))]),_:3})]),_:3})):ie("",!0),Q(JA,{class:"has-item-context-menu"},{default:X(()=>[(D(!0),K(ke,null,Ge(e.data,(M,j)=>(D(),ee(Yh,at({key:`oc-tbody-tr-${o(M)||j}`,ref_for:!0,ref:`row-${j}`},{ref_for:!0},k(M,j),{"data-item-id":M[e.idKey],draggable:e.dragDrop,class:"border-t h-10.5",onClick:B=>P.$emit(r.EVENT_TROW_CLICKED,[M,B]),onContextmenu:B=>P.$emit(r.EVENT_TROW_CONTEXTMENU,P.$refs[`row-${j}`][0],B,M),onVnodeMounted:B=>P.$emit(r.EVENT_TROW_MOUNTED,M,P.$refs[`row-${j}`][0]),onDragstart:B=>d(M,B),onDrop:B=>c(M,B),onDragenter:kt(B=>f(M,!1,B),["prevent"]),onDragleave:kt(B=>f(M,!0,B),["prevent"]),onDragover:$[0]||($[0]=B=>u(B)),onItemVisible:B=>P.$emit("itemVisible",M)}),{default:X(()=>[(D(!0),K(ke,null,Ge(e.fields,(B,q)=>(D(),ee(Xh,at({key:"oc-tbody-td-"+N(B,q,M)},{ref_for:!0},w(B,q,M)),{default:X(()=>[p(B)?Se(P.$slots,B.name,{key:0,item:M},void 0,!0):h(B)?(D(),K(ke,{key:1},[it(R.toDisplayString(B.callback(M[B.name])),1)],64)):(D(),K(ke,{key:2},[it(R.toDisplayString(M[B.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onItemVisible"]))),128))]),_:3}),P.$slots.footer?(D(),K("tfoot",rR,[W("tr",sR,[W("td",{colspan:l.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[Se(P.$slots,"footer",{},void 0,!0)],8,oR)])])):ie("",!0)],16)}}}),[["__scopeId","data-v-57029fa4"]]),Xl=()=>{const{$gettext:e,$ngettext:t}=de.useGettext(),{showMessage:n,showErrorMessage:r}=Me(),{copy:s}=Cn.useClipboard(),o=({result:l,password:u})=>{const d=l.filter(Br);let c="";if(d.length){let p=e("Link has been created successfully");if(l.length===1)try{c=u?e("%{link} Password:%{password}",{link:d[0].value.webUrl,password:u}):d[0].value.webUrl,p=e("The link has been copied to your clipboard.")}catch(h){console.warn("Unable to copy link to clipboard",h)}n({title:t(p,"Links have been created successfully.",d.length)})}const f=l.filter(jr);return f.length&&r({errors:f.map(({reason:p})=>p),title:t("Failed to create link","Failed to create links",f.length)}),c};return{copyLink:async({createLinkHandler:l,password:u})=>{if(navigator.clipboard.write)await new Promise((d,c)=>{const f=new ClipboardItem({"text/plain":l().then(p=>{const h=o({result:p,password:u}),g=new Blob([h],{type:"text/plain"});return d(),g}).catch(p=>{throw c(),p})});navigator.clipboard.write([f])});else{const d=await l(),c=o({result:d,password:u});c&&s(c)}}}},Hi=()=>{const{$gettext:e}=de.useGettext(),t=Ct(),n=Lt(),r=T(()=>n.can("create-all","PublicLink")),s=T(()=>Vt.View),o=d=>d===Vt.View?t.sharingPublicPasswordEnforcedFor.read_only:d===Vt.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:d===Vt.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:d===Vt.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,i=({isFolder:d})=>a(r)?d?[Vt.View,Vt.Edit,Vt.CreateOnly]:[Vt.View,Vt.Edit]:[],l=[{id:Vt.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:Vt.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:Vt.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:Vt.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:s,isPasswordEnforcedForLinkType:o,getAvailableLinkTypes:i,linkShareRoles:l,getLinkRoleByType:d=>l.find(({id:c})=>c===d)}},aR=ge({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=de.useGettext(),{getLinkRoleByType:r}=Hi(),s=u=>e.modelValue===u,o=u=>{t("update:modelValue",u)},i=T(()=>n(r(e.modelValue)?.displayName)),l=wt.v4();return{isSelectedType:s,updateSelectedType:o,currentLinkRoleLabel:i,dropUuid:l,getLinkRoleByType:r}}}),lR=["textContent"],cR=["textContent"],uR={class:"flex items-center"},dR={class:"text-left"},fR=["textContent"],pR={class:"text-sm leading-4"},hR={class:"flex"};function mR(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button"),u=te("oc-list"),d=te("oc-drop"),c=Bt("oc-tooltip");return D(),K(ke,null,[e.availableLinkTypeOptions.length>1?(D(),ee(l,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"text-left link-role-dropdown-toggle"},{default:X(()=>[W("span",{class:"link-current-role",textContent:R.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,lR),Q(i,{name:"arrow-down-s"})]),_:1},8,["id"])):je((D(),K("span",{key:1,class:"link-current-role mr-4",textContent:R.toDisplayString(e.currentLinkRoleLabel)},null,8,cR)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(D(),ee(d,{key:2,class:"link-role-dropdown w-md",title:e.$gettext("Role"),"drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click","close-on-click":""},{default:X(()=>[Q(u,{class:"role-dropdown-list"},{default:X(()=>[(D(!0),K(ke,null,Ge(e.availableLinkTypeOptions,(f,p)=>(D(),K("li",{key:`role-dropdown-${p}`},[Q(l,{id:`files-role-${e.getLinkRoleByType(f).id}`,class:R.normalizeClass([{selected:e.isSelectedType(f)},"p-2"]),appearance:e.isSelectedType(f)?"filled":"raw-inverse","color-role":e.isSelectedType(f)?"secondaryContainer":"surface","justify-content":"space-between",onClick:h=>e.updateSelectedType(f)},{default:X(()=>[W("span",uR,[Q(i,{name:e.getLinkRoleByType(f).icon,class:"pl-2 pr-4"},null,8,["name"]),W("span",dR,[W("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:R.toDisplayString(e.$gettext(e.getLinkRoleByType(f).displayName))},null,8,fR),W("span",pR,R.toDisplayString(e.$gettext(e.getLinkRoleByType(f).description)),1)])]),W("span",hR,[e.isSelectedType(f)?(D(),ee(i,{key:0,name:"check"})):ie("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle"])):ie("",!0)],64)}const Zh=Le(aR,[["render",mR]]),gR={class:"flex justify-between pb-2"},yR={key:0,class:"flex items-center"},vR={key:1,class:"flex items-center"},bR={class:"flex flex-col"},wR=["textContent"],SR=["textContent"],kR=["textContent"],CR={class:"mb-4 ml-[30px]"},TR={key:1,class:"text-sm text-role-on-surface-variant"},xR=["textContent"],AR=["textContent"],RR={class:"flex justify-end items-center mt-2"},ER={class:"sr-only"},em=ge({__name:"CreateLinkModal",props:{modal:{},resources:{},space:{default:()=>{}}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Ee(),r=de.useGettext(),{$gettext:s}=r,{removeModal:o}=Ke(),{copyLink:i}=Xl(),l=Om(),{isEnabled:u,postMessage:d}=wr(),{defaultLinkType:c,getAvailableLinkTypes:f,getLinkRoleByType:p,isPasswordEnforcedForLinkType:h}=Hi(),{addLink:g}=Jn(),m=On(),{currentTheme:b}=ve.storeToRefs(m),S=H(!1),k=H(!1),w=T(()=>e.resources.every(({isFolder:he})=>he)),C=T(()=>a(u)?s("Share link(s)"):s("Copy link")),A=T(()=>a(u)?s("Share link(s) and password(s)"):s("Copy link and password")),I=H(wt.v4()),N=H({}),_=H(),F=ga({value:"",error:void 0}),V=H(a(c)),Z=T(()=>s(p(a(V)).description)),P=T(()=>s(p(a(V)).displayName)),$=T(()=>p(a(V)).icon),L=T(()=>f({isFolder:a(w)})),M=T(()=>h(a(V))),j=l.getPolicy({enforcePassword:a(M)}),B=()=>{S.value=!0},q=({date:he,error:ae})=>{_.value=he,k.value=ae},re=()=>Promise.allSettled(e.resources.map(he=>g({clientService:n,space:e.space,resource:he,options:{type:a(V),"@libre.graph.quickLink":!1,password:a(F).value,expirationDateTime:a(_)?.toISO(),displayName:s("Unnamed link")}}))),J=T(()=>j.check(a(F).value)),oe=T(()=>!a(J)||a(k)),ne=async()=>{const he=await re(),ae=[],ue=he.filter(jr);return ue.length&&ue.map(({reason:be})=>be).forEach(be=>{if(console.error(be),be.response?.status===400){const me=be.response.data.error;me.message=et.upperFirst(me.message),ae.push(me)}}),ae.length?(F.error=s(ae[0].message),Promise.reject()):he};t({onConfirm:async(he={})=>{if(a(u)){const ue=(await ne()).filter(Br);ue.length&&(d("opencloud-embed:share",ue.map(({value:be})=>be.webUrl)),d("opencloud-embed:share-links",ue.map(({value:be})=>({url:be.webUrl,...he.copyPassword&&{password:a(F).value}})))),o(e.modal.id);return}await i({createLinkHandler:ne,password:he.copyPassword?a(F).value:void 0}),o(e.modal.id)}});const fe=he=>{F.value=he,F.error=void 0},we=he=>{V.value=he},$e=()=>l.generatePassword();return ft(()=>{const he=a(N)[a(V)];he&&he.$el.focus(),a(M)&&(F.value=l.generatePassword())}),(he,ae)=>{const ue=te("oc-icon"),be=te("oc-text-input"),me=te("oc-datepicker"),De=te("oc-list"),_e=te("oc-drop");return D(),K(ke,null,[W("div",gR,[S.value?(D(),K("div",yR,[Q(ue,{class:"mr-2",name:$.value,"fill-type":"line"},null,8,["name"]),Q(Zh,{"model-value":V.value,"available-link-type-options":L.value,"onUpdate:modelValue":we},null,8,["model-value","available-link-type-options"])])):(D(),K("div",vR,[Q(ue,{class:"mr-2",name:$.value,"fill-type":"line"},null,8,["name"]),W("div",bR,[W("span",{class:"font-semibold",textContent:R.toDisplayString(P.value)},null,8,wR),W("span",{class:"text-sm",textContent:R.toDisplayString(Z.value)},null,8,SR)])])),S.value?ie("",!0):(D(),ee(a(Ut),{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:ae[0]||(ae[0]=ut=>B())},{default:X(()=>[Q(ue,{name:"settings-3",size:"small","fill-type":"fill"}),W("span",{textContent:R.toDisplayString(a(s)("Options"))},null,8,kR)]),_:1}))]),W("div",CR,[S.value?(D(),ee(be,{key:I.value,"model-value":F.value,type:"password","password-policy":a(j),"generate-password-method":$e,"error-message":F.error,label:a(s)("Password"),"required-mark":M.value,class:"link-modal-password-input","onUpdate:modelValue":fe},null,8,["model-value","password-policy","error-message","label","required-mark"])):F.value?(D(),K("div",TR,[W("span",{textContent:R.toDisplayString(a(s)("Password:"))},null,8,xR),W("span",{textContent:R.toDisplayString(F.value)},null,8,AR)])):ie("",!0),S.value?(D(),ee(me,{key:2,class:"mt-2","min-date":a(ht.DateTime).now(),label:a(s)("Expiry date"),"is-dark":a(b).isDark,onDateChanged:q},null,8,["min-date","label","is-dark"])):ie("",!0)]),W("div",RR,[Q(a(Ut),{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:ae[1]||(ae[1]=ut=>he.$emit("cancel"))},{default:X(()=>[it(R.toDisplayString(a(s)("Cancel")),1)]),_:1}),W("div",{class:R.normalizeClass(["ml-2",{"oc-button-group":F.value}])},[Q(a(Ut),{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:oe.value,onClick:ae[2]||(ae[2]=ut=>he.$emit("confirm"))},{default:X(()=>[it(R.toDisplayString(C.value),1)]),_:1},8,["disabled"]),F.value?(D(),ee(a(Ut),{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:oe.value,"aria-label":a(s)("More options")},{default:X(()=>[Q(ue,{size:"small",name:"arrow-down-s"}),W("span",ER,R.toDisplayString(a(s)("More options")),1)]),_:1},8,["disabled","aria-label"])):ie("",!0),F.value?(D(),ee(_e,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small",title:a(s)("More options"),"close-on-click":""},{default:X(()=>[Q(De,null,{default:X(()=>[W("li",null,[Q(a(Ut),{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:ae[3]||(ae[3]=ut=>he.$emit("confirm",{copyPassword:!0}))},{default:X(()=>[it(R.toDisplayString(A.value),1)]),_:1})])]),_:1})]),_:1},8,["title"])):ie("",!0)],2)])],64)}}}),DR=({enforceModal:e=!1}={})=>{const t=Ee(),n=Ze(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Ct(),i=Lt(),l=Nt(),{defaultLinkType:u}=Hi(),{addLink:d}=Jn(),{dispatchModal:c}=Ke(),{copyLink:f}=Xl(),p=({space:m,resources:b})=>{const S=o.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||S){c({title:s("Copy link for »%{resourceName}«","Copy links for the selected items",b.length,{resourceName:b[0].name}),customComponent:em,customComponentAttrs:()=>({space:m,resources:b}),hideActions:!0});return}const k=b.map(C=>d({clientService:t,space:m,resource:C,options:{"@libre.graph.quickLink":!1,displayName:r("Unnamed link"),type:a(u)}}));f({createLinkHandler:()=>l.addTask(()=>Promise.allSettled(k))})},h=({resources:m})=>{if(!m.length)return!1;for(const b of m)if(!b.canShare({user:n.user,ability:i})||z.isProjectSpaceResource(b)&&b.disabled)return!1;return!0};return{actions:T(()=>[{name:"create-links",icon:"link",handler:p,label:()=>r("Create links"),isVisible:h,class:"oc-files-actions-create-links"}])}},FR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),r=Ze(),{$gettext:s}=de.useGettext(),{dispatchModal:o}=Ke(),i=Pn(),{isEnabled:l}=wr(),{openEditor:u}=bn(),d=Ee(),c=Re(),{resources:f,currentFolder:p,areFileExtensionsShown:h}=ve.storeToRefs(c),{isFileNameValid:g}=Wr(),m=T(()=>i.fileExtensions.filter(({newFileMenu:w})=>!!w)),b=(w,C)=>(c.upsertResource(w),u(C,a(e),w)),S=(w,C,A)=>{let I=s("New file")+`.${C}`;a(f).some(_=>_.name===I)&&(I=pn(I,C,a(f))),h.value||(I=z.extractNameWithoutExtension({name:I,extension:C}));const N=h.value?[0,I.length-(C.length+1)]:null;o({title:s("Create a new file"),confirmText:s("Create"),hasInput:!0,inputValue:I,inputLabel:s("File name"),inputRequiredMark:!0,inputSelectionRange:N,onConfirm:async _=>{h.value||(_=`${_}.${C}`);try{let F;if(A.createFileHandler)F=await A.createFileHandler({fileName:_,space:a(e),currentFolder:a(p)});else if(A.type==="folder"){const V=We.join(a(p).path,_);F=await d.webdav.createFolder(a(e),{path:V})}else{const V=We.join(a(p).path,_);F=await d.webdav.putFileContents(a(e),{path:V})}return c.upsertResource(F),t({title:s("»%{fileName}« was created successfully",{fileName:F.name})}),a(l)?void 0:b(F,A)}catch(F){console.error(F),n({title:s("Failed to create file"),errors:[F]})}},onInput:(_,F)=>{const V=h.value?_:`${_}.${C}`,Z={path:We.join(a(p).path,V),name:V,extension:C},{isValid:P,error:$}=g(Z,V);F(P?null:$)}})};return{actions:T(()=>{const w=[],C={};for(const A of a(m)||[])A.hasPriority?C[A.extension]=A:C[A.extension]=C[A.extension]||A;for(const[,A]of Object.entries(C))w.push({name:"create-new-file",icon:"add",handler:I=>S(I,A.extension,A),label:()=>s(A.newFileMenu.menuTitle()),isVisible:()=>a(p)?.canUpload({user:r.user}),class:"oc-files-actions-create-new-file",ext:A.extension,isExternal:A.app?.startsWith("external-")});return w}),openFile:b}},tm=()=>{const e=At("scrollTo"),t=At("details"),n=Re(),{openSideBarPanel:r}=Pt(),s=T(()=>ot(a(e))),o=T(()=>ot(a(t))),i=(u,d={forceScroll:!1,topbarElement:null})=>{const c=document.querySelectorAll(`[data-item-id='${u}']`)[0];if(!c){Xe.publish("app.files.navigate.page",{resourceId:u,forceScroll:d.forceScroll,topbarElement:d.topbarElement});return}const p=document.getElementById(d.topbarElement)?.offsetHeight||0+c.offsetHeight*2;(c.getBoundingClientRect().bottom>window.innerHeight||c.getBoundingClientRect().top<p||d.forceScroll)&&c.scrollIntoView({behavior:"smooth",block:"center"})};return Xe.subscribe("app.files.navigate.scrollTo",u=>i(u.resourceId,{forceScroll:u.forceScroll,topbarElement:u.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(u,d)=>{if(!a(s)||!u.length)return;const c=a(u).find(f=>z.isIncomingShareResource(f)?f.remoteItemId===a(s):f.id===a(s));c&&c.processing!==!0&&(n.setSelection([c.id]),i(c.id,{forceScroll:!0,topbarElement:d}),a(o)&&r(a(o)))}}},IR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),{dispatchModal:r}=Ke(),{$gettext:s}=de.useGettext(),{scrollToResource:o}=tm(),i=Re(),{resources:l,currentFolder:u}=ve.storeToRefs(i),d=Ee(),{isFileNameValid:c}=Wr(),f=async g=>{g=g.trimEnd();try{const m=We.join(a(u).path,g),b=await d.webdav.createFolder(a(e),{path:m});z.isShareSpaceResource(a(e))&&(b.remoteItemId=a(e).id),i.upsertResource(b),t({title:s("»%{folderName}« was created successfully",{folderName:g})}),await St(),o(b.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(m){console.error(m),n({title:s("Failed to create folder"),errors:[m]})}},p=()=>{let g=s("New folder");a(l).some(m=>m.name===g)&&(g=pn(g,"",a(l))),r({title:s("Create a new folder"),confirmText:s("Create"),hasInput:!0,inputValue:g,inputLabel:s("Folder name"),inputRequiredMark:!0,onConfirm:f,onInput:(m,b)=>{const S={path:We.join(a(u).path,m),name:m,isFolder:!0},{isValid:k,error:w}=c(S,m,a(l));return b(k?null:w)}})};return{actions:T(()=>[{name:"create-folder",icon:"folder",handler:p,label:()=>s("New Folder"),isVisible:()=>a(u)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:f}};class fo{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class PR{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const Yl=10,$R=63,Zl=256;class OR{state;observeEnter;observeExit;onEnterCallCount;onExitCallCount;onEnter;onExit;threshold;unobserver;constructor(t,n,r){this.unobserver=t,this.threshold=n,this.onEnter=r.onEnter,this.onExit=r.onExit,this.observeEnter=!!r.onEnter,this.observeExit=!!r.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,n){const r={element:n,unobserve:()=>this.unobserve(t,n)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...r})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...r})),this.state=t}unobserve(t,n){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(n)}}class nm{targets;intersectionObserver;options;constructor(t={}){this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,n={},r){!n.onEnter&&!n.onExit||(this.targets.set(t,new OR(this.unobserve.bind(this),r||this.options.threshold||0,{onEnter:n.onEnter,onExit:n.onExit})),this.intersectionObserver.observe(t))}unobserve(t){this.targets.delete(t),this.intersectionObserver.unobserve(t)}disconnect(){this.targets=new WeakMap,this.intersectionObserver.disconnect()}trigger(t){t.forEach(n=>{const r=this.targets.get(n.target);r&&r.request(n.isIntersecting&&n.intersectionRatio>r.threshold?0:1,n.target)})}}const po=ge({__name:"ResourceIcon",props:{resource:{},size:{default:"large"}},setup(e){const t={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},n={name:"resource-type-folder",color:"var(--oc-role-secondary)"},r={name:"layout-grid",color:"var(--oc-role-secondary)"},s={name:"layout-grid",color:"var(--oc-role-secondary)"},o={name:"resource-type-file",color:"var(--oc-role-on-surface)"},i=fd(),l=Un(dd),u=T(()=>a(m)?.name===t.name),d=T(()=>e.resource.type==="space"),c=T(()=>z.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),f=T(()=>e.resource.type==="folder"||e.resource.isFolder?t:o),p=T(()=>z.isPersonalSpaceResource(e.resource)),h=T(()=>e.resource.extension?.toLowerCase()),g=T(()=>e.resource.mimeType?.toLowerCase()),m=T(()=>{if(a(p))return n;if(a(c))return s;if(a(d))return r;const b=i[a(h)]||l?.mimeType[a(g)]||l?.extension[a(h)];return{...a(f),...b}});return(b,S)=>{const k=te("oc-icon");return D(),ee(k,{key:`resource-icon-${m.value.name}`,name:m.value.name,color:m.value.color,size:e.size,class:R.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":c.value,"[&_svg]:h-[70%]":!d.value&&!u.value}])},null,8,["name","color","size","class"])}}}),LR={name:"ResourceLink",props:{link:{type:Object,required:!1,default:null},resource:{type:Object,required:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],setup:e=>{const t=Qe(),{options:n}=ve.storeToRefs(t);return{linkTarget:T(()=>a(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return this.resource?this.link&&!this.resource.disabled:!1},isClickable(){return this.isResourceClickable&&!this.resource?.disabled}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.isNavigatable||this.$emit("click",e)}}},_R={key:1};function MR(e,t,n,r,s,o){return n.isResourceClickable?(D(),ee(Yt(o.isNavigatable?"router-link":"oc-button"),{key:0,to:o.isNavigatable?n.link:void 0,target:o.isNavigatable?e.linkTarget:void 0,rel:o.isNavigatable&&e.linkTarget==="_blank"?"noopener noreferrer":void 0,appearance:o.isNavigatable?void 0:"raw","gap-size":o.isNavigatable?void 0:"none","justify-content":o.isNavigatable?void 0:"left",type:o.isNavigatable?void 0:"button","no-hover":o.isNavigatable?void 0:!0,draggable:!1,class:"oc-resource-link max-w-full",onDragstart:t[0]||(t[0]=kt(()=>{},["prevent","stop"])),onClick:o.emitClick},{default:X(()=>[Se(e.$slots,"default",{},void 0,!0)]),_:3},40,["to","target","rel","appearance","gap-size","justify-content","type","no-hover","onClick"])):(D(),K("span",_R,[Se(e.$slots,"default",{},void 0,!0)]))}const Wi=Le(LR,[["render",MR],["__scopeId","data-v-15d92dd6"]]),NR=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],BR={key:0,class:"truncate leading-4"},jR=["textContent"],zR=["textContent"],VR=["textContent"],ec=ge({__name:"ResourceName",props:{name:{},type:{},fullPath:{},pathPrefix:{default:""},extension:{default:""},isPathDisplayed:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},truncateName:{type:Boolean,default:!0}},setup(e){const t=T(()=>e.extension?e.name.slice(0,-e.extension.length-1):e.name),n=T(()=>e.extension?"."+e.extension:""),r=T(()=>{if(!e.isPathDisplayed)return null;const l=e.fullPath.replace(/^\//,"").split("/");return l.length<2?null:l.length===2?l[0]+"/":`…/${l[l.length-2]}/`}),s=T(()=>!e.isPathDisplayed||a(r)===e.fullPath?null:e.pathPrefix?Na.join(e.pathPrefix,e.fullPath):e.fullPath),o=T(()=>{if(!a(s))return e.isExtensionDisplayed?`${a(t)}${a(n)}`:a(t)}),i=T(()=>(a(r)||"")+e.name);return(l,u)=>{const d=Bt("oc-tooltip");return je((D(),K("span",{class:R.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":i.value,"data-test-resource-type":e.type,title:o.value},[e.truncateName?(D(),K("span",BR,[W("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:R.toDisplayString(t.value)},null,8,jR)])):(D(),K("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:R.toDisplayString(t.value)},null,8,zR)),e.extension&&e.isExtensionDisplayed?(D(),K("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:R.toDisplayString(n.value)},null,8,VR)):ie("",!0)],10,NR)),[[d,s.value]])}}}),UR={class:"flex"},qR=["textContent"],ho=ge({__name:"ResourceListItem",props:{resource:{},pathPrefix:{default:""},link:{default:null},isPathDisplayed:{type:Boolean,default:!1},parentFolderLink:{default:null},parentFolderName:{default:""},parentFolderLinkIconAdditionalAttributes:{default:()=>({})},isExtensionDisplayed:{type:Boolean,default:!0},isThumbnailDisplayed:{type:Boolean,default:!0},isIconDisplayed:{type:Boolean,default:!0},isResourceClickable:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){const n=t,{$gettext:r}=de.useGettext(),s=T(()=>e.parentFolderLink?"router-link":"span"),o=T(()=>({"fill-type":"line",name:"folder-2",size:"small",...e.parentFolderLinkIconAdditionalAttributes})),i=T(()=>e.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(e.resource,"thumbnail")),l=T(()=>e.resource.thumbnail),u=T(()=>e.resource.locked?r("This item is locked"):null),d=c=>{!c||typeof c.stopPropagation!="function"||n("click",c)};return(c,f)=>{const p=te("oc-image"),h=te("oc-icon"),g=Bt("oc-tooltip");return D(),K("div",{class:R.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?je((D(),ee(Wi,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:R.normalizeClass(["relative",{"hover:underline":e.isResourceClickable}]),"aria-label":e.isResourceClickable?a(r)("Open »%{name}«",{name:e.resource?.name??""}):void 0,onClick:d},{default:X(()=>[i.value?je((D(),ee(p,{key:l.value,src:l.value,"data-test-thumbnail-resource-name":e.resource.name,class:"rounded-xs size-8 object-cover max-w-fit","aria-label":u.value,alt:""},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[g,u.value]]):je((D(),ee(po,{key:1,"aria-label":u.value,"aria-hidden":"true",resource:e.resource},null,8,["aria-label","resource"])),[[g,u.value]])]),_:1},8,["resource","link","is-resource-clickable","class","aria-label"])),[[g,e.isResourceClickable?u.value:void 0]]):ie("",!0),W("div",{class:R.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[Q(Wi,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:R.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:d},{default:X(()=>[(D(),ee(ec,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","class"]),W("div",UR,[e.isPathDisplayed?(D(),ee(Yt(s.value),{key:0,to:e.parentFolderLink,class:R.normalizeClass(["parent-folder flex items-center truncate px-0.5 mr-2 -ml-0.5 hover:bg-transparent",{"cursor-pointer":e.parentFolderLink,"cursor-default":!e.parentFolderLink}])},{default:X(()=>[Q(h,at(o.value,{class:"mr-1"}),null,16),W("span",{class:"text truncate text-sm hover:underline",textContent:R.toDisplayString(e.parentFolderName)},null,8,qR)]),_:1},8,["to","class"])):ie("",!0)])],2)],2)}}}),rm=ge({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new nm,{triggerDefaultAction:n}=bn(),{getMatchingSpace:r}=Rt(),{getDefaultAction:s}=bn(),{loadPreview:o}=cc(),i=qt("resourceListItem"),{getPathPrefix:l,getParentFolderName:u,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:f}=Tr(),p=Re(),h=H(),g=T(()=>p.areFileExtensionsShown),m=T(()=>({...e.searchResult.data,...a(h)&&{thumbnail:a(h)}})),b=T(()=>r(a(m))),S=T(()=>{const _=a(m);return z.isSpaceResource(_)&&_.disabled===!0}),k=()=>{n({space:a(b),resources:[a(m)]})},w=T(()=>e.isClickable?{parentFolderLink:d(a(m)),onClick:k}:{isResourceClickable:!1}),C=T(()=>{if(a(m).isFolder)return f(a(m));const _=s({resources:[a(m)],space:a(b)});if(!_?.route)return null;const F=_.route({space:a(b),resources:[a(m)]});return F.query={...F.query,contextRouteQuery:{...F.query?.contextRouteQuery||{},term:e.term}},F}),A=l(a(m)),I=u(a(m)),N=c(a(m));return ft(()=>{a(S)&&a(i).parentElement.classList.add("disabled");const _=async()=>{const V=await o({space:a(b),resource:a(m),dimensions:fo.Thumbnail,cancelRunning:!0,updateStore:!1});V&&(h.value=V)},F=et.debounce(({unobserve:V})=>{V(),_()},250);t.observe(a(i).$el,{onEnter:F,onExit:F.cancel})}),Xt(()=>{t.disconnect()}),(_,F)=>(D(),ee(ho,at({ref_key:"resourceListItem",ref:i,resource:m.value,"path-prefix":a(A),"is-path-displayed":!0,link:C.value,"is-extension-displayed":g.value,"parent-folder-link-icon-additional-attributes":a(N),"parent-folder-name":a(I),"is-thumbnail-displayed":!!h.value},w.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),HR=7,WR=200,QR=ge({name:"CreateShortcutModal",components:{ResourcePreview:rm},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Ee(),{$gettext:s}=de.useGettext(),{showMessage:o,showErrorMessage:i}=Me(),l=Ae(),{search:u}=Ml(),{getPathPrefix:d,getParentFolderName:c,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:p,getFolderLink:h}=Tr(),g=Re(),{resources:m,currentFolder:b}=ve.storeToRefs(g),S=qt("dropRef"),k=H(""),w=H(""),C=H(null),A=H(null),I=H(!1);let N;const _=ue=>{const be=ue.trim();return M(be)?be:`https://${be}`},F=T(()=>_(a(k))),V=T(()=>!!a(m).find(ue=>ue.name===`${a(w)}.url`)),Z=T(()=>a(V)||!a(w)||!a(k));ze(Z,()=>{t("update:confirmDisabled",a(Z))},{immediate:!0});const P=T(()=>a(V)?s("»%{name}« already exists",{name:`${a(w)}.url`}):/[/]/.test(a(w))?s('Shortcut name cannot contain "/"'):""),$=Ft.useTask(function*(ue,be){C.value=null,be=`name:"*${be}*" NOT name:"*.url"`;try{C.value=yield u(be,HR)}catch{}}),L=et.debounce(()=>{$.perform(a(k))},WR),M=ue=>["http://","https://"].some(me=>me.startsWith(ue)||ue.startsWith(me)),j=()=>{C.value=null,k.value=a(F);try{let ue=new URL(a(F)).host;a(m).some(be=>be.name===`${ue}.url`)&&(ue=pn(`${ue}.url`,"url",a(m)).slice(0,-4)),w.value=ue}catch{}},B=ue=>{C.value=null;const be=new URL(window.location.href);let me=ue.data.name;k.value=`${be.origin}/f/${ue.id}`,a(m).some(De=>De.name===`${me}.url`)&&(me=pn(`${me}.url`,"url",a(m)).slice(0,-4)),w.value=me},q=ue=>a(A)===ue,re=(ue=!1)=>{const be=Array.from(document.querySelectorAll("li.selectable-item"));let me=a(A)!==null?a(A):ue?be.length:-1;const De=ue?-1:1;do if(me+=De,me<0||me>be.length-1)return null;while(be[me].classList.contains("disabled"));return me},J=()=>{A.value=re(!0)},oe=()=>{A.value=re(!1)},ne=ue=>{a(I)&&(ue.stopPropagation(),a(S).hide())},pe=ue=>{a(I)&&(ue.stopPropagation(),a(A)!==null&&(a(A)===0?j():B(a(C)?.values?.[a(A)-1]),a(S).hide()))},fe=()=>{I.value=!1,A.value=null},we=()=>{I.value=!0,A.value=0},$e=()=>{k.value.trim().length&&a(S).show()},he=async()=>{if(await St(),w.value=k.value.trim(),!k.value.trim().length){a(S).hide();return}a(S).show(),nn(l,"files-public-link")||L()},ae=async()=>{try{const be=`[InternetShortcut]
12
- URL=${Tc.sanitize(_(a(k)),{USE_PROFILES:{html:!0}})}`,me=z.urlJoin(a(b).path,`${a(w)}.url`),De=await r.webdav.putFileContents(e.space,{path:me,content:be});g.upsertResource(De),o({title:s("Shortcut was created successfully")})}catch(ue){console.error(ue),i({title:s("Failed to create shortcut"),errors:[ue]})}};return ft(async()=>{await St(),N=new xc(a(S)?.$refs?.drop)}),ze(C,async()=>{await St(),!(!a(I)||!N)&&(N.unmark(),N.mark(a(k),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),ze(A,()=>{if(!a(I)||typeof a(S)?.$el?.scrollTo!="function")return;const ue=a(S).$el.querySelectorAll(".selectable-item");ue[a(A)]&&a(S).$el.scrollTo(0,a(A)===null?0:ue[a(A)].getBoundingClientRect().y-ue[a(A)].getBoundingClientRect().height)}),n({onConfirm:ae}),{inputUrl:k,inputFilename:w,dropRef:S,dropItemUrl:F,searchResult:C,confirmButtonDisabled:Z,inputFileNameErrorMessage:P,searchTask:$,dropItemUrlClicked:j,dropItemResourceClicked:B,getPathPrefix:d,getFolderLink:h,getParentFolderLink:f,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:p,onKeyEnterDrop:pe,onKeyDownDrop:oe,onKeyUpDrop:J,onKeyEscDrop:ne,onHideDrop:fe,onShowDrop:we,onInputUrlInput:he,onClickUrlInput:$e,isDropItemActive:q,onConfirm:ae}}}),KR={class:"flex items-center mb-1"},GR={for:"create-shortcut-modal-url-input"},JR=["textContent"],XR={key:0,class:"p-1 flex justify-center"},YR={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},ZR=["textContent"],eE={key:0,class:"flex w-full mt-4"},tE={class:"flex items-center mb-1"},nE={for:"create-shortcut-modal-filename-input"};function rE(e,t,n,r,s,o){const i=te("oc-contextual-helper"),l=te("oc-text-input"),u=te("oc-icon"),d=te("oc-button"),c=te("oc-spinner"),f=te("resource-preview"),p=te("oc-list"),h=te("oc-drop");return D(),K(ke,null,[Q(l,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=g=>e.inputUrl=g),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[Ns(e.onKeyUpDrop,["up"]),Ns(e.onKeyDownDrop,["down"]),Ns(e.onKeyEscDrop,["esc"]),Ns(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:X(()=>[W("div",KR,[W("label",GR,[it(R.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=W("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),Q(i,{text:e.$gettext("Enter the target URL of a webpage or the name of a file. Users will be directed to this webpage or file."),title:e.$gettext("Webpage or file"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),Q(h,{ref:"dropRef",toggle:"#create-shortcut-modal-url-input",class:"w-lg","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":"","enforce-drop-on-mobile":"",onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:X(()=>[Q(p,null,{default:X(()=>[W("li",{class:R.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[Q(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:X(()=>[Q(u,{name:"external-link"}),W("span",{textContent:R.toDisplayString(e.dropItemUrl)},null,8,JR)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(D(),K("li",XR,[Q(c)])):ie("",!0),e.searchResult?.values?.length?(D(),K(ke,{key:1},[W("li",YR,[W("span",{textContent:R.toDisplayString(e.$gettext("Link to a file"))},null,8,ZR)]),(D(!0),K(ke,null,Ge(e.searchResult.values,(g,m)=>(D(),K("li",{key:m,class:R.normalizeClass(["selectable-item",{active:e.isDropItemActive(m+1)}])},[Q(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:b=>e.dropItemResourceClicked(g)},{default:X(()=>[Q(f,{"search-result":g,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):ie("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(D(),K("div",eE,[Q(l,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=g=>e.inputFilename=g),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:X(()=>[W("div",tE,[W("label",nE,[it(R.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=W("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),Q(i,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):ie("",!0)],64)}const sm=Le(QR,[["render",rE]]),sE=({space:e})=>{const{dispatchModal:t}=Ke(),{$gettext:n}=de.useGettext(),r=Re(),{currentFolder:s}=ve.storeToRefs(r);return{actions:T(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:sm,customComponentAttrs:()=>({space:a(e)})})},label:()=>n("New Shortcut"),isVisible:()=>a(s)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},tc=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{can:n}=Lt(),{$gettext:r,$ngettext:s}=de.useGettext(),{createSpace:o}=ms(),i=Ee(),l=Ae(),u=T(()=>n("create-all","Drive")),{dispatchModal:d}=Ke(),c=Qe(),f=Ue(),p=Re(),{isSpaceNameValid:h}=Wr(),g=async({spaceName:S,resources:k,space:w})=>{const{webdav:C}=i,A=new sr({concurrency:c.options.concurrentRequests.resourceBatchActions}),I=[];try{const N=await o(S);f.upsertSpace(N),k.length===1&&k[0].isFolder&&(k=(await C.listFiles(w,{path:k[0].path})).children);for(const _ of k)I.push(A.add(()=>C.copyFiles(w,_,N,{path:_.name})));await Promise.all(I),p.resetSelection(),e({title:r("Space was created successfully")})}catch(N){console.error(N);const _=N.statusCode===425?r("Some files could not be copied"):r("Creating space failed…");t({title:_,errors:[N]})}},m=({resources:S,space:k})=>{d({title:s("Create Space from »%{resourceName}«","Create Space from selection",S.length,{resourceName:S[0].name}),message:s("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",S.length,{resourceName:S[0].name}),contextualHelperLabel:r("The marked elements will be copied."),contextualHelperData:{title:r("Restrictions"),text:r("Shares, versions and tags will not be copied.")},confirmText:r("Create"),hasInput:!0,inputLabel:r("Space name"),inputRequiredMark:!0,onInput:(w,C)=>{const{isValid:A,error:I}=h(w);C(A?null:I)},onConfirm:w=>g({spaceName:w,space:k,resources:S})})};return{actions:T(()=>[{name:"create-space-from-resource",icon:"function",handler:m,label:()=>r("Create Space from selection"),isVisible:({resources:S,space:k})=>!(!S.length||!a(u)||!rt(l,"files-spaces-generic")||!z.isPersonalSpaceResource(k)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},mo=()=>{const e=Ze(),t=Ct(),{displayDialog:n,filesList_delete:r}=wm(),{$gettext:s}=de.useGettext();return{actions:T(()=>[{name:"delete",icon:"delete-bin-5",label:()=>s("Delete"),handler:({resources:i})=>{r(i)},isVisible:({resources:i})=>i.length?i.every(l=>l.canBeDeleted()&&!z.isSpaceResource(l)&&!z.isIncomingShareResource(l)&&!z.isTrashResource(l)&&!l.isShareRoot()):!1,isDisabled:({resources:i})=>i.length===1&&i[0].locked,disabledTooltip:()=>s("File can't be deleted because it is currently locked."),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:i,resources:l})=>{n(i,l)},isVisible:({space:i,resources:l})=>!l.length||!t.filesPermanentDeletion||z.isProjectSpaceResource(i)&&!i.canDeleteFromTrashBin({user:e.user})?!1:l.every(z.isTrashResource),class:"oc-files-actions-delete-permanent-trigger"}])}},Qi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ae(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Ee(),i=Nt(),l=Qe(),{updateResourceField:u}=Re(),d=async({resources:f})=>{const p=[],h=[],g=new sr({concurrency:l.options.concurrentRequests.resourceBatchActions});if(f.forEach(m=>{h.push(g.add(async()=>{try{const{graphAuthenticated:b}=o;await b.driveItems.deleteDriveItem(m.driveId,m.id),u({id:m.id,field:"syncEnabled",value:!1})}catch(b){console.error(b),p.push(b)}}))}),await Promise.all(h),p.length===0){rt(n,"files-spaces-generic")&&(e({title:s("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),n.push(tn("files-shares-with-me")));return}t({title:s("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",f.length),errors:p})};return{actions:T(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>i.addTask(()=>d(f)),label:()=>r("Disable sync"),isVisible:({space:f,resources:p})=>!pt(n,"files-shares-with-me")&&!rt(n,"files-spaces-generic")||p.length===0||rt(n,"files-spaces-generic")&&(f?.driveType!=="share"||p.length>1||p[0].path!=="/")?!1:p.some(h=>h.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},om=()=>Gn("$archiverService"),Ki=()=>{const{showErrorMessage:e}=Me(),t=Ae(),n=om(),{$ngettext:r,$gettext:s,current:o}=de.useGettext(),i=yr(),l=rr(),u=({space:f,resources:p})=>(p.length>1&&(p=p.filter(h=>h.canDownload()&&!z.isProjectSpaceResource(h))),n.triggerDownload({fileIds:p.map(h=>h.fileId),...f&&z.isPublicSpaceResource(f)&&{publicToken:f.id,publicLinkPassword:i.publicLinkPassword}}).catch(h=>{console.error(h),e({title:r("Failed to download the selected folder.","Failed to download the selected files.",p.length),errors:[h]})})),d=f=>{const p=a(n.capability);return p?f.reduce((g,m)=>g+parseInt(`${m.size}`),0)>parseInt(p.max_size):void 0};return{actions:T(()=>[{name:"download-archive",icon:"inbox-archive",handler:f=>{u(f)},label:()=>s("Download"),disabledTooltip:({resources:f})=>d(f)?s("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:zt(a(n.capability).max_size,o)}):"",isDisabled:({resources:f})=>d(f),isVisible:({resources:f})=>a(l)&&!rt(t,"files-spaces-generic")&&!nn(t,"files-public-link")&&!mt(t,"files-common-favorites")&&!mt(t,"files-common-search")&&!pt(t,"files-shares-with-me")&&!pt(t,"files-shares-with-others")&&!pt(t,"files-shares-via-link")&&!mt(t,"files-common-search")||!a(n.available)||f.length===0||f.length===1&&!f[0].isFolder||f.length>1&&f.every(h=>z.isProjectSpaceResource(h))||z.isProjectSpaceResource(f[0])&&f[0].disabled?!1:!f.some(h=>!h.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},nc=e=>{const{showErrorMessage:t}=Me(),{getMatchingSpace:n}=Rt(),r=e?.clientService||Ee(),{$gettext:s}=de.useGettext(),o=Ze();return{downloadFile:async(l=null,u,d=null)=>{try{l||(l=n(u));const c=await r.webdav.getFileUrl(l,u,{version:d,username:o.user?.onPremisesSamAccountName});ul(c,u.name)}catch(c){console.error(c),t({title:s("Download failed"),desc:s("File could not be located"),errors:[c]})}}}},ws=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),n=rr(),r=Zi(),{downloadFile:s}=nc(),o=({space:l,resources:u})=>{s(l,u[0])};return{actions:T(()=>[{name:"download-file",icon:"file-download",handler:o,label:()=>t("Download"),isVisible:({resources:l})=>a(n)&&!a(r)&&!rt(e,"files-spaces-generic")&&!nn(e,"files-public-link")&&!mt(e,"files-common-favorites")&&!mt(e,"files-common-search")&&!pt(e,"files-shares-with-me")&&!pt(e,"files-shares-with-others")&&!pt(e,"files-shares-via-link")||l.length!==1||l[0].isFolder?!1:l[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},oE=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),r=Ct(),{$gettext:s}=de.useGettext(),o=Ee(),{dispatchModal:i}=Ke(),l=Re(),u=Ue(),d=Nt(),c=async({space:h})=>{try{await o.webdav.clearTrashBin(h),e({title:s("All deleted files were removed")}),l.resetSelection(),u.updateSpaceField({id:h.id,field:"hasTrashedItems",value:!1}),l.resources.some(z.isTrashResource)&&l.clearResources()}catch(g){console.error(g),t({title:s("Failed to empty trash bin"),errors:[g]})}},f=({resources:h})=>{i({title:s("Empty trash bin for »%{name}«",{name:h[0].name}),confirmText:s("Delete"),message:s("Are you sure you want to permanently delete the items in »%{name}«? You can’t undo this action.",{name:h[0].name}),hasInput:!1,onConfirm:()=>d.addTask(()=>c({space:h[0]}))})};return{actions:T(()=>[{name:"empty-trash-bin",icon:({resources:h})=>h[0]?.hasTrashedItems?"delete-bin-2":"delete-bin-7",label:()=>s("Empty trash bin"),handler:f,isVisible:({resources:h})=>h.length!==1||!r.filesPermanentDeletion||!z.isSpaceResource(h[0])?!1:h[0].canDeleteFromTrashBin({user:n.user}),isDisabled:({resources:h})=>!h[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},Gi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ae(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Ee(),i=Nt(),l=Qe(),u=Re(),{updateResourceField:d}=u,c=async({resources:p})=>{const h=[],g=[],m=new sr({concurrency:l.options.concurrentRequests.resourceBatchActions});if(p.forEach(b=>{g.push(m.add(async()=>{try{const{graphAuthenticated:S}=o;await S.driveItems.createDriveItem(b.driveId,{name:b.name,remoteItem:{id:b.fileId}}),d({id:b.id,field:"syncEnabled",value:!0})}catch(S){console.error(S),h.push(S)}}))}),await Promise.all(g),h.length===0){u.resetSelection(),rt(n,"files-spaces-generic")&&e({title:s("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",p.length)});return}t({title:s("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",p.length),errors:h})};return{actions:T(()=>[{name:"enable-sync",icon:"check",handler:p=>i.addTask(()=>c(p)),label:()=>r("Enable sync"),isVisible:({space:p,resources:h})=>!pt(n,"files-shares-with-me")&&!rt(n,"files-spaces-generic")||h.length===0||rt(n,"files-spaces-generic")&&(a(p)?.driveType!=="share"||h.length>1||h[0].path!=="/")?!1:h.some(g=>!g.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},rc=()=>{const{showErrorMessage:e}=Me(),t=Ct(),n=Ae(),{$gettext:r}=de.useGettext(),s=Ee(),o=rr(),i=Lt(),l=Re(),u=Sr(),d=async({space:f,resources:p})=>{try{const h=!p[0].starred;await s.webdav.setFavorite(f,p[0],h),l.updateResourceField({id:p[0].id,field:"starred",value:h}),h||u.publish("app.files.list.removeFromFavorites",p[0].id)}catch(h){const g=r('Failed to change favorite state of "%{file}"',{file:p[0].name});e({title:g,errors:[h]})}};return{actions:T(()=>[{name:"favorite",icon:"star",handler:d,label:({resources:f})=>f[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:f})=>a(o)&&!rt(n,"files-spaces-generic")&&!mt(n,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&i.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function iE(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const Ji=()=>{const e=Ae(),{cutResources:t}=Zs(),n=de.useGettext(),{$gettext:r}=n,s=Re(),{currentFolder:o}=ve.storeToRefs(s),i=T(()=>Ys()?r("⌘ + X"):r("Ctrl + X")),l=({resources:d})=>{t(d)};return{actions:T(()=>[{name:"cut",icon:"scissors",handler:l,shortcut:a(i),label:()=>r("Cut"),isVisible:({resources:d})=>!rt(e,"files-spaces-generic")&&!nn(e,"files-public-link")&&!mt(e,"files-common-favorites")||d.length===0||!a(o)||d.length===1&&d[0].locked?!1:!d.some(f=>iE(f,a(o).path)===!1),class:"oc-files-actions-move-trigger"}])}},im=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),n=Re(),{currentFolder:r}=ve.storeToRefs(n),s=T(()=>nn(e,"files-public-link")?us("files-public-link"):jt(e,"files-trash-overview")?gr("files-trash-generic"):gn("files-spaces-generic"));return{actions:T(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Navigate"),isVisible:({resources:i})=>i.length!==1||a(r)!==null&&Bs(i[0],a(r))||z.isTrashResource(i[0])?!1:i[0].isFolder||i[0].type==="space",route:({space:i,resources:l})=>Ws({},a(s),In(i,{path:l[0].path,fileId:l[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},am=()=>{const{$gettext:e}=de.useGettext(),{getDefaultAction:t}=bn();return{actions:T(()=>[{name:"open",icon:"eye",label:()=>e("Open"),handler:r=>{const s=t({...r,omitSystemActions:!0});!s||!Object.hasOwn(s,"handler")||s.handler(r)},route:r=>{const s=t({...r,omitSystemActions:!0});if(!(!s||!Object.hasOwn(s,"route")))return s.route(r)},isVisible:r=>{const s=t({...r,omitSystemActions:!0});return s?s.isVisible(r):!1},class:"oc-files-actions-default-editor-trigger"}])}},aE=()=>{const{showErrorMessage:e}=Me(),t=Ae(),{$gettext:n}=de.useGettext(),r=rr(),s=Zi(),o=Ee(),i=d=>{const c=/URL=(.+)/,f=d.match(c);if(f&&f[1])return f[1];throw new Error("unable to extract url")},l=async({resources:d,space:c})=>{try{const f=new URL(window.location.href),p=(await o.webdav.getFileContents(c,d[0])).body;let h=i(p);if(h=h.match(/^http[s]?:\/\//)?h:`https://${h}`,h=Tc.sanitize(h,{USE_PROFILES:{html:!0}}),h.startsWith(f.origin)){window.location.href=h;return}window.open(h)}catch(f){console.error(f),e({title:n("Failed to open shortcut"),errors:[f]})}};return{actions:T(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:l,label:()=>n("Open shortcut"),isVisible:({resources:d})=>a(r)&&!a(s)&&!rt(t,"files-spaces-generic")&&!nn(t,"files-public-link")&&!mt(t,"files-common-favorites")&&!mt(t,"files-common-search")&&!pt(t,"files-shares-with-me")&&!pt(t,"files-shares-with-others")&&!pt(t,"files-shares-via-link")||d.length!==1||d[0].extension!=="url"?!1:d[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:i}},lE=ge({name:"AppLoadingSpinner"}),cE={class:"flex items-center justify-center size-full"};function uE(e,t,n,r,s,o){const i=te("oc-spinner");return D(),K("div",cE,[Q(i,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const sc=Le(lE,[["render",uE]]),dE=ge({name:"FilePickerModal",components:{AppLoadingSpinner:sc},props:{modal:{type:Object,required:!0},allowedFileTypes:{type:Array,required:!0},parentFolderLink:{type:Object,required:!0},callbackFn:{type:Function,required:!0}},setup(e){const t=H(),n=H(!0),r=Ae(),{removeModal:s}=Ke(),o=On(),i=r.resolve(e.parentFolderLink),l=o.currentTheme.name,u=new URL(i.href,window.location.origin);u.searchParams.append("hide-logo","true"),u.searchParams.append("embed","true"),u.searchParams.append("embed-target","file"),u.searchParams.append("embed-delegate-authentication","false"),u.searchParams.append("embed-file-types",e.allowedFileTypes.join(","));const d=()=>{n.value=!1,a(t).contentWindow.focus()},c=({data:p})=>{if(p.name!=="opencloud-embed:file-pick")return;const{resource:h,locationQuery:g}=p.data;e.callbackFn({resource:h,locationQuery:g}),s(e.modal.id)},f=({data:p})=>{p.name==="opencloud-embed:cancel"&&s(e.modal.id)};return ft(()=>{window.addEventListener("message",c),window.addEventListener("message",f)}),Xt(()=>{window.removeEventListener("message",c),window.removeEventListener("message",f)}),{isLoading:n,onLoad:d,iframeTitle:l,iframeSrc:u.href,iframeRef:t,onFilePick:c}}}),fE={class:"h-full",tabindex:"0"},pE=["title","src"];function hE(e,t,n,r,s,o){const i=te("app-loading-spinner");return D(),K("div",fE,[e.isLoading?(D(),ee(i,{key:0})):ie("",!0),je(W("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,pE),[[Zu,!e.isLoading]])])}const lm=Le(dE,[["render",hE]]),cm=(e={})=>{const t=Ae(),{getMatchingSpace:n}=Rt(e);return{createFolderLink:s=>{const{path:o,fileId:i,resource:l}=s,u=a(e.space)||n(l);return u?jt(t,"files-trash-overview")?gr("files-trash-generic",In(u)):gn("files-spaces-generic",In(u,{path:o,fileId:i})):{}}}},Tr=(e={})=>{const t=Ct(),{$gettext:n}=de.useGettext(),{getInternalSpace:r,getMatchingSpace:s,isResourceAccessible:o}=Rt(),{createFolderLink:i}=cm(e);return{getPathPrefix:p=>{const h=a(e.space)||s(p);return z.isProjectSpaceResource(h)?Na.join(n("Spaces"),h.name):z.isShareSpaceResource(h)?Na.join(n("Shares"),h.name):h.name},getFolderLink:p=>i({path:p.path,fileId:p.fileId,resource:p}),getParentFolderLink:p=>{const h=a(e.space)||s(p),g=o({space:h,path:We.dirname(p.path)});return p.remoteItemId&&p.path==="/"||!g?tn("files-shares-with-me"):z.isProjectSpaceResource(p)?gn("files-spaces-projects"):i({path:We.dirname(p.path),...p.parentFolderId&&{fileId:p.parentFolderId},resource:p})},getParentFolderName:p=>{const h=a(e.space)||s(p),g=o({space:h,path:We.dirname(p.path)});if(z.isShareRoot(p)||p.id===h.id&&z.isShareSpaceResource(h)||!g)return n("Shared with me");const b=z.extractParentFolderName(p);if(b)return b;if(z.isShareSpaceResource(h))return h.name;if(t.spacesProjects){if(z.isProjectSpaceResource(p))return n("Spaces");if(h?.driveType==="project")return h.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:p=>z.isProjectSpaceResource(p)||z.isProjectSpaceResource(r(p.storageId)||{})&&p.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},um=({appId:e})=>{const{$gettext:t}=de.useGettext(),n=rr(),{dispatchModal:r}=Ke(),s=Pn(),{apps:o}=ve.storeToRefs(s),i=Ae(),{getParentFolderLink:l}=Tr(),{getMatchingSpace:u}=Rt(),{getEditorRouteOpts:d}=bn(),c=({resources:h})=>{const g=a(o)[e],m=l(h[0]),b=g.extensions.map(S=>S.extension?S.extension:S.mimeType);r({elementClass:"file-picker-modal",title:t("Open file in %{app}",{app:g.name}),customComponent:lm,hideActions:!0,customComponentAttrs:()=>({allowedFileTypes:b,parentFolderLink:m,callbackFn:p}),focusTrapInitial:!1})},f=T(()=>[{name:"open-with-app",icon:"folder-open",handler:c,label:()=>t("Open"),isVisible:()=>!a(n),class:"oc-files-actions-open-with-app-trigger"}]),p=({resource:h,locationQuery:g})=>{const m=u(h),b=z.isShareSpaceResource(m)?m.id:void 0,S=d(a(i.currentRoute).name,m,h,b);S.query={...S.query,...g};const k=i.resolve(S),w=new URL(k.href,window.location.origin);window.open(w.href,"_blank")};return{actions:f,onFilePicked:p}},dm=()=>{const e=Ae(),t=Ee(),{getMatchingSpace:n}=Rt(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Zs(),{startWorker:i}=uh(),l=Re(),{currentFolder:u}=ve.storeToRefs(l),d=T(()=>Ys()?r("⌘ + V"):r("Ctrl + V")),c=T(()=>o.action===Js.Cut?Wn.MOVE:Wn.COPY),f=async({targetSpace:g,sourceSpace:m,resources:b})=>{const S=new ud(m,b,g,a(u),u,t,r,s),k=await S.getTransferData(a(c));if(!k.length)return;const w=a(u)?.id;i(k,async({successful:C,failed:A})=>{if(S.showResultMessage(A,C,a(c)),!C.length||a(u)&&w!==a(u).id)return;const I=[],N=[];for(const _ of C)I.push((async()=>{const F=await t.webdav.getFileInfo(g,_);N.push(F)})());await Promise.allSettled(I),z.isShareSpaceResource(g)&&N.forEach(_=>{_.remoteItemId=g.id}),l.upsertResources(N)})},p=async({space:g})=>{const m=o.resources.reduce((S,k)=>{if(k.storageId in S)return S[k.storageId].resources.push(k),S;const w=n(k);return w.id in S||(S[w.id]={space:w,resources:[]}),S[w.id].resources.push(k),S},{}),b=Object.values(m).map(({space:S,resources:k})=>f({targetSpace:g,sourceSpace:S,resources:k}));await Promise.all(b),o.clearClipboard()};return{actions:T(()=>[{name:"paste",icon:"clipboard",handler:p,label:()=>r("Paste"),shortcut:a(d),isVisible:({resources:g})=>o.resources.length===0||!rt(e,"files-spaces-generic")&&!nn(e,"files-public-link")&&!mt(e,"files-common-favorites")||g.length===0?!1:nn(e,"files-public-link")&&a(u)?a(u)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},Xi=()=>{const{showErrorMessage:e}=Me(),t=Ct(),n=Ae(),{$gettext:r}=de.useGettext(),s=Ee(),o=Qe(),{dispatchModal:i}=Ke(),l=Ze(),u=Lt(),d=Re(),{setCurrentFolder:c,upsertResource:f}=d,{isFileNameValid:p}=Wr(),h=async(b,S,k)=>{let w=d.currentFolder;try{const C=We.join(We.dirname(S.path),k);await s.webdav.moveFiles(b,S,b,{path:C});const A=Bs(S,w);if(z.isShareSpaceResource(b)&&S.isReceivedShare()){if(b.rename(k),A)return w={...w},w.name=k,c(w),n.push(In(b,{path:"",fileId:S.fileId}));const N={...S};N.name=k,f(N);return}if(A)return w={...w},za(b,w,C),c(w),n.push(In(b,{path:C,fileId:S.fileId}));const I={...S};za(b,I,C),f(I)}catch(C){console.error(C);let A=r('Failed to rename "%{file}" to »%{newName}«',{file:S.name,newName:k});C.statusCode===423&&(A=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:S.name,newName:k})),e({title:A,errors:[C]})}},g=async({space:b,resources:S})=>{const k=d.currentFolder;let w;if(Bs(S[0],k)){const P=We.dirname(k.path);w=(await s.webdav.listFiles(b,{path:P})).children}const C=d.areFileExtensionsShown,A=async P=>{C||(P=`${P}.${S[0].extension}`),await h(b,S[0],P)},I=(P,$)=>{C||(P=`${P}.${S[0].extension}`);const{isValid:L,error:M}=p(S[0],P,w);$(L?null:M)},N=z.extractNameWithoutExtension(S[0]),_=!S[0].isFolder&&!C?N:S[0].name,F=S[0].isFolder?r("Rename folder »%{name}«",{name:_}):r("Rename file »%{name}«",{name:_}),V=!S[0].isFolder&&!C?N:S[0].name,Z=S[0].isFolder||!C?null:[0,N.length];i({title:F,confirmText:r("Rename"),hasInput:!0,inputValue:V,inputSelectionRange:Z,inputLabel:S[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:A,onInput:I})};return{actions:T(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:g,isVisible:({resources:b})=>jt(n,"files-trash-generic")||pt(n,"files-shares-with-me")&&!t.sharingCanRename||b.length!==1||(o.options.routing.fullShareOwnerPaths?b.some(w=>w.remoteItemPath&&w.path):b.some(w=>w.remoteItemId&&w.path==="/"))||b.length===1&&b[0].locked?!1:!b.some(w=>!w.canRename({user:l.user,ability:u})||w.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:h}},go=({showSuccessMessage:e=!0,onRestoreComplete:t}={})=>{const{showMessage:n,showErrorMessage:r}=Me(),s=Ze(),o=Ae(),{$gettext:i,$ngettext:l}=de.useGettext(),u=Ee(),d=Ue(),c=Re(),{startWorker:f}=dh(),p=async(S,k)=>{const w={},C=[],A=[],I=[];for(const N of k){const _=We.dirname(N.path);let F=[];if(_ in w)F=w[_];else{try{F=(await u.webdav.listFiles(S,{path:_})).children}catch{I.push(_)}w[_]=F}F.some(Z=>Z.name===N.name)||A.filter(Z=>Z.id!==N.id).some(Z=>Z.path===N.path)?C.push(N):A.push(N)}return{existingResourcesByPath:w,conflicts:C,resolvedResources:A,missingFolderPaths:I.filter(N=>!w[N]?.length)}},h=async S=>{let k=0;const w=[],C=S.length;let A=!1,I;for(const N of S){const _=N.type==="folder";if(A){w.push({resource:N,strategy:I});continue}const F=C-k,Z=await new Ba(i,l).resolveFileExists({name:N.name,isFolder:_},F,!1);k++,Z.doForAllConflicts&&(A=!0,I=Z.strategy),w.push({resource:N,strategy:Z.strategy})}return w},g=(S,k,w)=>{const C=a(o.currentRoute);f({space:S,resources:k,missingFolderPaths:w},async({successful:A,failed:I})=>{if(A.length){let N;A.length===1?N=i("%{resource} was restored successfully",{resource:A[0].name}):N=i("%{resourceCount} files restored successfully",{resourceCount:A.length.toString()}),e&&n({title:N}),C.name===a(o.currentRoute).name&&C.query?.fileId===a(o.currentRoute).query?.fileId&&(c.removeResources(A),c.resetSelection());const F=await u.graphAuthenticated.drives.getDrive(S.id);d.updateSpaceField({id:F.id,field:"spaceQuota",value:F.spaceQuota}),t?.({space:S,resources:A})}if(I.length){let N;I.length===1?N=i('Failed to restore "%{resource}"',{resource:I[0].resource.name}):N=i("Failed to restore %{resourceCount} files",{resourceCount:I.length.toString()}),r({title:N,errors:I.map(({error:_})=>_)})}})},m=async({space:S,resources:k})=>{const w=k.sort((Z,P)=>Z.path.length-P.path.length),{existingResourcesByPath:C,conflicts:A,resolvedResources:I,missingFolderPaths:N}=await p(S,w),_=await h(A),F=_.filter(Z=>Z.strategy===hn.REPLACE).map(Z=>Z.resource);I.push(...F);const V=_.filter(Z=>Z.strategy===hn.KEEP_BOTH).map(Z=>Z.resource);for(let Z of V){Z={...Z};const P=We.dirname(Z.path),$=C[P]||[],L=z.extractExtensionFromFile(Z),M=pn(Z.name,L,[...$,..._.map(j=>j.resource),...I]);Z.name=M,Z.path=z.urlJoin(P,M),I.push(Z)}return g(S,I,N)};return{actions:T(()=>[{name:"restore",icon:"arrow-go-back",label:()=>i("Restore"),handler:m,isVisible:({space:S,resources:k})=>!jt(o,"files-trash-generic")||!k.every(w=>z.isTrashResource(w)&&w.canBeRestored())||z.isProjectSpaceResource(S)&&!S.canRestoreFromTrashbin({user:s.user})?!1:k.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:g,collectConflicts:p}},mE=ge({name:"SaveAsModal",components:{AppLoadingSpinner:sc},props:{modal:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0},originalResource:{type:Object,required:!0},content:{type:String,required:!0}},setup(e){const t=H(),n=H(!0),r=On(),{$gettext:s}=de.useGettext(),o=Ae(),i=Ee(),{removeModal:l}=Ke(),{showMessage:u,showErrorMessage:d}=Me(),{getMatchingSpace:c}=Rt(),{getEditorRouteOpts:f}=bn(),p=o.resolve(e.parentFolderLink),h=r.currentTheme.name,g=new URL(p.href,window.location.origin);g.searchParams.append("hide-logo","true"),g.searchParams.append("embed","true"),g.searchParams.append("embed-target","location"),g.searchParams.append("embed-choose-file-name","true"),g.searchParams.append("embed-delegate-authentication","false"),g.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const m=()=>{n.value=!1,a(t).contentWindow.focus()},b=async({data:C})=>{if(C.name!=="opencloud-embed:select")return;const{resources:A,fileName:I,locationQuery:N}=C.data,_=A[0],F=c(_);try{const V=await S({destinationFolder:_,fileName:I,space:F});u({title:s("»%{fileName}« was saved successfully",{fileName:V.name})}),k({resource:V,space:F,locationQuery:N})}catch(V){console.error(V),d({title:s("Unable to save »%{fileName}«",{fileName:I}),errors:[V]}),console.error(V)}l(e.modal.id)},S=async({destinationFolder:C,fileName:A,space:I})=>{const{children:N}=await i.webdav.listFiles(I,{fileId:C.fileId},{davProperties:[Te.Name]});return N.find(F=>F.name===A)&&(A=pn(A,e.originalResource.extension,N)),i.webdav.putFileContents(I,{fileName:A,parentFolderId:C.id,content:e.content,path:z.urlJoin(C.path,A)})},k=({locationQuery:C,resource:A,space:I})=>{const N=z.isShareSpaceResource(I)?I.id:void 0,_=f(a(o.currentRoute).name,I,A,N);_.query={..._.query,...C};const F=o.resolve(_),V=new URL(F.href,window.location.origin);window.open(V.href,"_blank")},w=({data:C})=>{C.name==="opencloud-embed:cancel"&&l(e.modal.id)};return ft(()=>{window.addEventListener("message",b),window.addEventListener("message",w)}),Xt(()=>{window.removeEventListener("message",b),window.removeEventListener("message",w)}),{isLoading:n,onLoad:m,iframeTitle:h,iframeSrc:g.href,iframeRef:t,onLocationPick:b}}}),gE={class:"h-full",tabindex:"0"},yE=["title","src"];function vE(e,t,n,r,s,o){const i=te("app-loading-spinner");return D(),K("div",gE,[e.isLoading?(D(),ee(i,{key:0})):ie("",!0),je(W("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,yE),[[Zu,!e.isLoading]])])}const fm=Le(mE,[["render",vE]]),pm=({content:e})=>{const{$gettext:t}=de.useGettext(),n=rr(),{dispatchModal:r}=Ke(),{getParentFolderLink:s}=Tr(),o=({resources:l})=>{const u=s(l[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:fm,hideActions:!0,customComponentAttrs:()=>({content:a(e),parentFolderLink:u,originalResource:l[0]}),focusTrapInitial:!1})};return{actions:T(()=>[{name:"save-as",icon:"save-2",handler:o,label:()=>t("Save as"),isVisible:({resources:l})=>!a(n)||l.length!==1,class:"oc-files-actions-save-as-trigger"}])}},bE={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},wE={key:0,class:"max-h-[400px]"},SE=["src"],kE={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},CE=["textContent"],hm=ge({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=Me(),{$gettext:s}=de.useGettext(),o=Ee(),i=Ue(),{createDefaultMetaFolder:l}=ms(),{getDefaultMetaFolder:u}=Ri(),{setCropperInstance:d}=Bl(),c=H(null),f=qt("imageRef"),p=H(null);t({onConfirm:async()=>{const b=a(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),S=await g(b);await m(S)}});const g=async b=>(await new Promise(k=>b.toBlob(k,"image/png"))).arrayBuffer(),m=async b=>{const S=o.graphAuthenticated;i.addToImagesLoading(e.space.id);let k=await u(e.space);k||(k=await l(e.space));const w={"Content-Type":"application/offset+octet-stream"};try{const{fileId:C,processing:A}=await o.webdav.putFileContents(e.space,{parentFolderId:k.id,fileName:"image.png",content:b,headers:w,overwrite:!0}),I=await S.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:C}]});A||i.removeFromImagesLoading(e.space.id),i.updateSpaceField({id:e.space.id,field:"spaceImageData",value:I.spaceImageData}),n({title:s("Space image was set successfully")}),Xe.publish("app.files.spaces.uploaded-image",I)}catch(C){if(console.error(C),i.removeFromImagesLoading(e.space.id),C instanceof z.HttpError&&C.statusCode===507){r({title:s("Failed to set space image"),desc:s("Not enough quota to set the space image"),errors:[C]});return}r({title:s("Failed to set space image"),errors:[C]})}};return ft(async()=>{try{p.value=URL.createObjectURL(e.file),a(c)&&a(c)?.destroy(),await St(),c.value=new ra(a(f),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),d(c)}catch(b){r({title:s("Failed to load space image"),errors:[b]})}}),(b,S)=>{const k=te("oc-icon");return D(),K("div",bE,[p.value?(D(),K("div",wE,[W("img",{ref_key:"imageRef",ref:f,src:p.value},null,8,SE),W("div",kE,[Q(k,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),W("span",{textContent:R.toDisplayString(a(s)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(s)("+-"),panKeys:a(s)("↑↓←→")}))},null,8,CE)])])):ie("",!0)])}}}),mm=()=>{const e=Ze(),t=Ae(),{$gettext:n}=de.useGettext(),r=Ee(),s=Nt(),{dispatchModal:o}=Ke(),i=async({space:u,resources:d})=>{const{getFileContents:c}=r.webdav,f=await c(u,d[0],{responseType:"blob"}),p=new File([f.body],d[0].name);o({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:hm,customComponentAttrs:()=>({file:p,space:u})})};return{actions:T(()=>[{name:"set-space-image",icon:"image-edit",handler:u=>s.addTask(()=>i(u)),label:()=>n("Set as space image"),isVisible:({space:u,resources:d})=>d.length!==1||!d[0].hasPreview?.()||!d[0].mimeType?.includes("image/")||!rt(t,"files-spaces-generic")||!u||!z.isProjectSpaceResource(u)?!1:u.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},TE=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),n=rr(),{openSideBarPanel:r}=Pt(),s=()=>{const i=jt(e,"files-trash-generic")?null:"actions";r(i)};return{actions:T(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:s,isVisible:({resources:i})=>a(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},oc=()=>{const e=Ae(),t=Re(),{openSideBar:n}=Pt(),{$gettext:r}=de.useGettext();return{actions:T(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>r("Details"),isVisible:({resources:o})=>jt(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),n()}}])}},gm=()=>{const e=Ct(),{isPersonalSpaceRoot:t}=Rt();return{canListShares:({space:r,resource:s})=>!e.sharingApiEnabled||z.isPublicSpaceResource(r)||t(s)||z.isTrashResource(s)?!1:z.isIncomingShareResource(s)?s.sharePermissions.includes(z.GraphSharePermission.readPermissions):z.isShareSpaceResource(r)?r.graphPermissions?.includes(z.GraphSharePermission.readPermissions):!0}},ym=()=>{const e=Ct(),t=Lt(),n=Ze();return{canShare:({space:s,resource:o})=>!e.sharingApiEnabled||z.isShareSpaceResource(s)||z.isProjectSpaceResource(s)&&!s.canShare({user:n.user})?!1:o.canShare({ability:t,user:n.user})}},ic=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),{canShare:n}=ym(),{openSideBarPanel:r}=Pt(),{interceptModifierClick:s}=Vr(),o=({resources:l,event:u})=>{const d=l[0];u&&s(u,d)||r("sharing")};return{actions:T(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:l,resources:u})=>jt(e,"files-trash-generic")||u.length!==1?!1:n({space:l,resource:u[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Yi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ae(),{$gettext:r}=de.useGettext(),s=Ee(),o=Nt(),i=Qe(),{updateResourceField:l,resetSelection:u}=Re(),d=async({resources:f})=>{const p=[],h=[],g=new sr({concurrency:i.options.concurrentRequests.resourceBatchActions}),m=!f[0].hidden;if(f.forEach(b=>{h.push(g.add(async()=>{try{await s.graphAuthenticated.driveItems.updateDriveItem(b.driveId,b.id,{"@UI.Hidden":m}),l({id:b.id,field:"hidden",value:m})}catch(S){console.error(S),p.push(S)}}))}),await Promise.all(h),p.length===0){u(),e({title:r(m?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(m?"Failed to hide the share":"Failed to unhide the share"),errors:p})};return{actions:T(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>o.addTask(()=>d(f)),label:({resources:f})=>f[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:f})=>f.length===0?!1:pt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},vm=()=>{const{$gettext:e}=de.useGettext(),{showErrorMessage:t}=Me(),{webdav:n}=Ee(),r=Ct(),s=Re(),{currentFolder:o}=ve.storeToRefs(s),{actions:i}=go({showSuccessMessage:!1,onRestoreComplete:async({space:f,resources:p})=>{if(pd({resourcesStore:s,parentFolderId:p[0].parentFolderId})){const{children:h}=await n.listFiles(f,{path:a(o).path});s.upsertResources(h.filter(({id:g})=>p.some(m=>m.id===l(g))))}}}),l=f=>f.includes("!")?f.split("!")[1]:f,u=async({space:f,resources:p,callback:h})=>{const g=p.map(m=>({...m,id:l(m.id)}));try{await a(i)[0].handler({space:f,resources:g}),h()}catch(m){console.error(m),t({title:e("Failed to restore files"),errors:[m]})}},d=T(()=>Ys()?e("⌘ + Z"):e("Ctrl + Z"));return{actions:T(()=>[{name:"undoDelete",icon:"arrow-go-back",shortcut:a(d),isVisible:({space:f})=>r.davTrashbin?z.isProjectSpaceResource(f)||z.isPersonalSpaceResource(f):!1,label:()=>e("Undo"),handler:u}])}},bm=()=>{const{$gettext:e}=de.useGettext(),{actions:t}=ws(),{downloadFile:n}=nc(),{dispatchModal:r}=Ke(),s=({space:i,resources:l})=>{r({title:e("No preview available for »%{name}«",{name:l[0].name}),confirmText:e("Download"),message:e("There is no preview available for this file. Do you want to download it instead?"),onConfirm:()=>{n(i,l[0])}})};return{actions:T(()=>[{name:"fallback-to-download",icon:"file-download",handler:s,label:()=>e("Download"),isVisible:i=>a(t)[0].isVisible(i),class:"oc-files-actions-fallback-to-download-trigger"}])}},wm=()=>{const e=Qe(),{showMessage:t,showErrorMessage:n,removeMessage:r}=Me(),s=Ae(),o=de.useGettext(),{getMatchingSpace:i}=Rt(),{$gettext:l,$ngettext:u}=o,d=Ee(),{dispatchModal:c}=Ke(),f=Ue(),p=Sr(),{bindKeyAction:h,removeKeyAction:g}=Ii(),{startWorker:m}=ch({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),{actions:b}=vm(),S=Re(),{currentFolder:k}=ve.storeToRefs(S),w=H([]),C=At("page","1"),A=T(()=>parseInt(ot(a(C)))),I=At("items-per-page","1"),N=T(()=>parseInt(ot(a(I)))),_=T(()=>od(a(w))),F=({space:M,filesToDelete:j,deletedFiles:B})=>{const q=B.length===1&&j.length===1?l('"%{item}" was moved to trash bin',{item:B[0].name}):u("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",B.length,{itemCount:B.length.toString()}),re=7,J=a(b)[0],oe=J.isVisible({space:M,resources:B});let ne;const pe=t({title:q,timeout:re,actions:[J],actionOptions:{space:M,resources:B,callback:()=>{r(pe),ne&&g(ne)}}});oe&&(ne=h({primary:Ln.Z,modifier:Fi.Ctrl},()=>(g(ne),J.handler({space:M,resources:B,callback:()=>{r(pe)}}))),setTimeout(()=>g(ne),re*1e3))},V=T(()=>{const M=a(_),j=M[0].type==="folder";let B=null;return M.length===1?(j?B=l("Permanently delete folder »%{name}«",{name:M[0].name}):B=l("Permanently delete file »%{name}«",{name:M[0].name}),B):u("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",M.length,{amount:M.length.toString()})}),Z=T(()=>{const M=a(_),j=M[0].type==="folder";return M.length===1?l(j?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):l("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),P=M=>{const j=a(s.currentRoute);m({topic:"trashBinDelete",space:M,resources:a(_)},({successful:B,failed:q})=>{if(B.length){const re=B.length===1&&a(_).length===1?l('"%{item}" was deleted successfully',{item:B[0].name}):u("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",B.length,{itemCount:B.length.toString()});t({title:re})}q.forEach(({resource:re})=>{const J=l('Failed to delete "%{item}"',{item:re.name});n({title:J,errors:[new Error]})}),j.name===a(s.currentRoute).name&&j.query?.fileId===a(s.currentRoute).query?.fileId&&(S.removeResources(B),S.resetSelection())})};return{displayDialog:(M,j)=>{w.value=[...j],c({title:a(V),message:a(Z),confirmText:l("Delete"),onConfirm:()=>P(M)})},filesList_delete:M=>{w.value=[...M],S.addResourcesIntoDeleteQueue(a(w).map(({id:q})=>q)),a(w).forEach(({id:q})=>S.removeSelection(q));const j=a(M).reduce((q,re)=>{if(re.storageId in q)return q[re.storageId].resources.push(re),q;const J=i(re);return J.id in q||(q[J.id]={space:J,resources:[]}),q[J.id].resources.push(re),q},{}),B=a(k)?.id;return Object.values(j).map(({space:q,resources:re})=>{m({topic:"fileListDelete",space:q,resources:re},async({successful:J,failed:oe})=>{if(J.length&&(F({space:q,filesToDelete:re,deletedFiles:J}),p.publish("runtime.resource.deleted",J)),S.removeResourcesFromDeleteQueue(oe.map(({resource:ne})=>ne.id)),S.removeResourcesFromDeleteQueue(J.map(({id:ne})=>ne)),oe.forEach(({error:ne,resource:pe})=>{let fe=l('Failed to delete "%{resource}"',{resource:pe.name});ne.statusCode===423&&(fe=l('Failed to delete "%{resource}" - the file is locked',{resource:pe.name})),n({title:fe,errors:[ne]})}),B===a(k)?.id){S.removeResources(J);const ne=S.activeResources.length,pe=Math.ceil(a(ne)/a(N));a(A)>1&&a(A)>pe&&(C.value=pe.toString())}if(rt(s,"files-spaces-generic")&&!["public","share"].includes(q?.driveType)){const pe=await d.graphAuthenticated.drives.getDrive(a(M)[0].storageId);f.updateSpaceField({id:pe.id,field:"spaceQuota",value:pe.spaceQuota})}if(a(w).length&&Bs(a(w)[0],a(k)))return s.push(In(q,{path:We.dirname(a(w)[0].path),fileId:a(w)[0].parentFolderId}))})})}}},xE=()=>{const e=yt();return T(()=>a(e)?.query?.contextRouteName)},AE=e=>e==="files",rr=()=>{const e=yt();return T(()=>AE(al(a(e))))},Wr=()=>{const{$gettext:e}=de.useGettext(),t=Re();return{isSpaceNameValid:s=>s.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:Fl(s)>Zl?{isValid:!1,error:e("The Space name is too long")}:s.trim()!==s?{isValid:!1,error:e("The Space name cannot start or end with whitespace")}:/[/\\.:?*"><|]/.test(s)?{isValid:!1,error:e(`The Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)}:{isValid:!0,error:void 0},isFileNameValid:(s,o,i=void 0)=>{if(!o)return{isValid:!1,error:e("The name cannot be empty")};if(/[/]/.test(o))return{isValid:!1,error:e('The name cannot contain "/"')};if(/[\\]/.test(o))return{isValid:!1,error:e('The name cannot contain "\\"')};if(o===".")return{isValid:!1,error:e('The name cannot be equal to "."')};if(o==="..")return{isValid:!1,error:e('The name cannot be equal to ".."')};if(o.trim()!==o)return{isValid:!1,error:e("The name cannot start or end with whitespace")};if(Fl(o)>Zl)return{isValid:!1,error:e("The name is too long")};const l=s.path.substring(0,s.path.length-s.name.length)+o;if((i||t.resources).some(d=>d.path===l&&d.name===o)){const d=e("The name »%{name}« is already taken");return{isValid:!1,error:e(d,{name:o})}}return{isValid:!0,error:void 0}}}},Zi=()=>T(()=>!!document.getElementById("files-global-search-options")),Sm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Lt(),i=Ee(),l=yt(),{dispatchModal:u}=Ke(),d=Ue(),{removeResources:c}=Re(),f=m=>m.filter(b=>z.isProjectSpaceResource(b)&&b.canBeDeleted({user:n.user,ability:o})),p=async m=>{const b=i.graphAuthenticated,S=m.map(A=>b.drives.deleteDrive(A.id).then(()=>(c([A]),d.removeSpace(A),!0))),k=await Promise.allSettled(S),w=k.filter(Br);if(w.length){const A=w.length===1&&m.length===1?r("Space »%{space}« was deleted successfully",{space:m[0].name}):s("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",w.length,{spaceCount:w.length.toString()});e({title:A})}const C=k.filter(jr);if(C.length){C.forEach(console.error);const A=C.length===1&&m.length===1?r("Failed to delete space »%{space}«",{space:m[0].name}):s("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",C.length,{spaceCount:C.length.toString()});t({title:A,errors:C.map(I=>I.reason)})}a(l).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.list.load")},h=({resources:m})=>{const b=f(m);if(!b.length)return;const S=s("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",b.length,{count:b.length.toString()});u({title:s("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",b.length,{space:b[0].name,spaceCount:b.length.toString()}),confirmText:r("Delete"),message:S,hasInput:!1,onConfirm:()=>p(b)})};return{actions:T(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:h,isVisible:({resources:m})=>!!f(m).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:p}},km=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Lt(),i=Ee(),l=yt(),u=Ae(),{dispatchModal:d}=Ke(),c=Ue(),f=m=>m.filter(b=>z.isProjectSpaceResource(b)&&b.canDisable({user:n.user,ability:o})),p=async m=>{const b=a(l),S=i.graphAuthenticated,k=m.map(I=>S.drives.disableDrive(I.id).then(()=>(b.name==="files-spaces-generic"&&u.push({name:"files-spaces-projects"}),b.name==="admin-settings-spaces"&&(I.disabled=!0,I.spaceQuota={total:I.spaceQuota.total}),c.updateSpaceField({id:I.id,field:"disabled",value:!0}),!0))),w=await Promise.allSettled(k),C=w.filter(Br);if(C.length){const I=C.length===1&&m.length===1?r("Space »%{space}« was disabled successfully",{space:m[0].name}):s("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",C.length,{spaceCount:C.length.toString()});e({title:I})}const A=w.filter(jr);if(A.length){A.forEach(console.error);const I=A.length===1&&m.length===1?r("Failed to disable space »%{space}«",{space:m[0].name}):s("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",A.length,{spaceCount:A.length.toString()});t({title:I,errors:A.map(N=>N.reason)})}},h=({resources:m})=>{const b=f(m);if(!b.length)return;const S=s("If you disable the selected space, it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.","If you disable the %{count} selected spaces, they can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.",b.length,{count:b.length.toString()}),k=r("Disable");d({title:s("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",b.length,{space:b[0].name,spaceCount:b.length.toString()}),confirmText:k,message:S,hasInput:!1,onConfirm:()=>p(b)})};return{actions:T(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:h,isVisible:({resources:m})=>!!f(m).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:p}},Cm=()=>{const e=Qe(),t=Ue(),n=Jn(),{showMessage:r,showErrorMessage:s}=Me(),o=Ae(),{$gettext:i}=de.useGettext(),l=Lt(),u=Ee(),d=Nt(),{upsertResource:c}=Re(),f=rt(o,"files-spaces-projects"),p=async m=>{const b=t.spaces.filter(z.isProjectSpaceResource),S=pn(m.name,"",b);try{let k=await u.graphAuthenticated.drives.createDrive({name:S,description:m.description,quota:{total:m.spaceQuota.total}});const w=await u.webdav.listFiles(m);if(w.children.length){const C=new sr({concurrency:e.options.concurrentRequests.resourceBatchActions}),A=[];for(const I of w.children)A.push(C.add(()=>u.webdav.copyFiles(m,I,k,{path:I.name})));await Promise.all(A)}if(m.spaceReadmeData||m.spaceImageData){const C={special:[]};if(m.spaceReadmeData){const A=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceReadmeData.name}`});C.special.push({specialFolder:{name:"readme"},id:A.id})}if(m.spaceImageData){const A=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceImageData.name}`});C.special.push({specialFolder:{name:"image"},id:A.id})}k=await u.graphAuthenticated.drives.updateDrive(k.id,C,n.graphRoles)}t.upsertSpace(k),f&&c(k),r({title:i("Space »%{space}« was duplicated successfully",{space:m.name})})}catch(k){console.error(k),s({title:i("Failed to duplicate space »%{space}«",{space:m.name}),errors:[k]})}},h=async({resources:m})=>{for(const b of m)b.disabled||!z.isProjectSpaceResource(b)||await p(b)};return{actions:T(()=>[{name:"duplicate",icon:"folders",label:()=>i("Duplicate"),handler:m=>d.addTask(()=>h(m)),isVisible:({resources:m})=>!m?.length||m.every(b=>b.disabled)||m.every(b=>!z.isProjectSpaceResource(b))?!1:l.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:p}},RE=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r}=de.useGettext(),s=Lt(),o=Ee(),i=yt(),{dispatchModal:l}=Ke(),u=Ue(),d=(p,h)=>o.graphAuthenticated.drives.updateDrive(p.id,{name:p.name,description:h}).then(()=>{u.updateSpaceField({id:p.id,field:"description",value:h}),a(i).name==="admin-settings-spaces"&&(p.description=h),e({title:r("Space subtitle was changed successfully")})}).catch(m=>{console.error(m),t({title:r("Failed to change space subtitle"),errors:[m]})}),c=({resources:p})=>{p.length===1&&l({title:r("Change subtitle for space")+" "+p[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:p[0].description,onConfirm:h=>d(p[0],h)})};return{actions:T(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:c,isVisible:({resources:p})=>p.length!==1?!1:p[0].canEditDescription({user:n.user,ability:s}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:d}},EE={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){return{selectedOption:H(void 0),options:H([])}},computed:{quotaLimit(){return this.maxQuota||1e15},DEFAULT_OPTIONS(){return[{value:Math.pow(10,9),displayValue:this.getFormattedFileSize(Math.pow(10,9))},{value:2*Math.pow(10,9),displayValue:this.getFormattedFileSize(2*Math.pow(10,9))},{value:5*Math.pow(10,9),displayValue:this.getFormattedFileSize(5*Math.pow(10,9))},{value:10*Math.pow(10,9),displayValue:this.getFormattedFileSize(10*Math.pow(10,9))},{value:50*Math.pow(10,9),displayValue:this.getFormattedFileSize(50*Math.pow(10,9))},{value:100*Math.pow(10,9),displayValue:this.getFormattedFileSize(100*Math.pow(10,9))},{displayValue:this.$gettext("No restriction"),value:0}]}},watch:{totalQuota(){const e=this.options.find(t=>t.value===this.totalQuota);e&&(this.selectedOption=e)}},mounted(){this.setOptions(),this.selectedOption=this.options.find(e=>e.value===this.totalQuota)},methods:{onUpdate(e){this.selectedOption=e,this.$emit("selectedOptionChange",this.selectedOption)},optionSelectable(e){return e.selectable!==!1},isValueValidNumber(e){return et.isNumber(e)?e>0:/^[0-9]\d*(([.,])\d+)?$/g.test(e)},createOption(e){if(e=e.replace(",","."),!this.isValueValidNumber(e))return{displayValue:e,value:e,error:this.$gettext("Please enter only numbers"),selectable:!1};const t=parseFloat(e)*Math.pow(10,9);return t>this.quotaLimit?{value:t,displayValue:this.getFormattedFileSize(t),error:this.$gettext("Please enter a value equal to or less than %{ quotaLimit }",{quotaLimit:this.getFormattedFileSize(this.quotaLimit).toString()}),selectable:!1}:{value:t,displayValue:this.getFormattedFileSize(t)}},setOptions(){let e=[...this.DEFAULT_OPTIONS];this.maxQuota&&(e=e.filter(n=>this.totalQuota===0&&n.value===0?(n.selectable=!1,!0):n.value!==0&&n.value<=this.maxQuota)),e.find(n=>n.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(n=>n.value).sort((n,r)=>n.value-r.value),...e.filter(n=>!n.value)],this.options=e},getFormattedFileSize(e){const t=zt(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},DE={class:"quota-select-batch-action-form"},FE=["textContent"],IE={class:"flex justify-between"},PE=["textContent"],$E={key:0,class:"oc-text-input-danger"};function OE(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-select");return D(),K("div",DE,[Q(l,at({ref:"select","model-value":r.selectedOption,selectable:o.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":o.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":o.onUpdate}),{"selected-option":X(({displayValue:u})=>[e.$attrs["read-only"]?(D(),ee(i,{key:0,name:"lock",class:"mr-1",size:"small"})):ie("",!0),W("span",{textContent:R.toDisplayString(u)},null,8,FE)]),search:X(({attributes:u,events:d})=>[W("input",at({class:"vs__search"},u,Uo(d,!0)),null,16)]),option:X(({displayValue:u,error:d})=>[W("div",IE,[W("span",{textContent:R.toDisplayString(u)},null,8,PE)]),d?(D(),K("div",$E,R.toDisplayString(d),1)):ie("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Tm=Le(EE,[["render",OE]]),LE={key:0,class:"mt-2"},_E=["textContent"],xm=ge({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){const r=n,{showMessage:s,showErrorMessage:o}=Me(),{$gettext:i,$ngettext:l}=de.useGettext(),u=Ee(),d=Ae(),c=Ue(),f=Ct(),{spacesMaxQuota:p}=ve.storeToRefs(f),{updateResourceField:h}=Re(),g=H(e.spaces[0]?.spaceQuota?.total||0),m=C=>e.resourceType==="space"?l("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",C,{count:C.toString()}):e.resourceType==="user"?l("User quota was changed successfully","Quota of %{count} users was changed successfully",C,{count:C.toString()}):i("Quota was changed successfully"),b=C=>e.resourceType==="space"?l("Failed to change space quota","Failed to change quota for %{count} spaces",C,{count:C.toString()}):e.resourceType==="user"?l("Failed to change user quota","Failed to change quota for %{count} users",C,{count:C.toString()}):i("Failed to change quota"),S=T(()=>!e.spaces.some(C=>C.spaceQuota.total!==a(g)));ze(S,()=>{r("update:confirmDisabled",a(S))},{immediate:!0});const k=C=>{g.value=C.value};return t({onConfirm:async()=>{const C=u.graphAuthenticated,A=e.spaces.map(async F=>{const V=await C.drives.updateDrive(F.id,{name:F.name,quota:{total:a(g)}});a(d.currentRoute).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:F.id,quota:V.spaceQuota}),a(d.currentRoute).name==="admin-settings-users"&&Xe.publish("app.admin-settings.users.user.quota.updated",{spaceId:F.id,quota:V.spaceQuota}),c.updateSpaceField({id:F.id,field:"spaceQuota",value:V.spaceQuota}),h({id:F.id,field:"spaceQuota",value:V.spaceQuota})}),I=await Promise.allSettled(A),N=I.filter(Br);N.length&&s({title:m(N.length)});const _=I.filter(jr);_.length&&(console.error(_),_.forEach(console.error),o({title:b(_.length),errors:_.map(F=>F.reason)}))}}),(C,A)=>{const I=te("oc-contextual-helper");return D(),K(ke,null,[Q(Tm,{"total-quota":g.value,"max-quota":a(p),"position-fixed":!0,onSelectedOptionChange:k},null,8,["total-quota","max-quota"]),e.warningMessage?(D(),K("div",LE,[W("span",{class:"oc-text-input-warning",textContent:R.toDisplayString(e.warningMessage)},null,8,_E),e.warningMessageContextualHelperData?(D(),ee(I,at({key:0,class:"pl-1"},e.warningMessageContextualHelperData),null,16)):ie("",!0)])):ie("",!0)],64)}}}),Am=()=>{const{dispatchModal:e}=Ke(),{$gettext:t}=de.useGettext(),n=Lt(),r=({resources:i})=>i.length===1?t("Change quota for Space »%{name}«",{name:i[0].name}):t("Change quota for %{count} Spaces",{count:i.length.toString()}),s=({resources:i})=>{e({title:r({resources:i}),customComponent:xm,customComponentAttrs:()=>({spaces:i,resourceType:"space"})})};return{actions:T(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:s,isVisible:({resources:i})=>!i||!i.length||i.some(l=>!z.isProjectSpaceResource(l)||z.isSpaceResource(l)&&!l.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Rm(){const{triggerDefaultAction:e}=bn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;e({...{resources:[r],space:n},omitSystemActions:!0})}}}const ME=()=>{const e=Ee(),{openWithDefaultApp:t}=Rm(),{createDefaultMetaFolder:n}=ms(),r=Ze(),s=Ue(),{$gettext:o}=de.useGettext(),{getDefaultMetaFolder:i}=Ri(),l=async(c,f)=>{const p=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:f.id,fileName:"readme.md"}),h=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:p.id}]});return s.updateSpaceField({id:c.id,field:"spaceReadmeData",value:h.spaceReadmeData}),p},u=async({resources:c})=>{let f=null,p=await i(c[0]);if(p||(p=await n(c[0]),f=await l(c[0],p)),!f){const h=z.getRelativeSpecialFolderSpacePath(c[0],"readme");h?f=await e.webdav.getFileInfo(c[0],{path:h}):f=await l(c[0],p)}t({space:c[0],resource:f})};return{actions:T(()=>[{name:"editReadmeContent",icon:"article",label:()=>o("Edit description"),handler:u,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Em=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r}=de.useGettext(),s=Lt(),o=Ee(),i=yt(),{isSpaceNameValid:l}=Wr(),{dispatchModal:u}=Ke(),d=Ue(),c=(h,g)=>o.graphAuthenticated.drives.updateDrive(h.id,{name:g}).then(()=>{a(i).name==="admin-settings-spaces"&&(h.name=g),d.updateSpaceField({id:h.id,field:"name",value:g}),e({title:r("Space name was changed successfully")})}).catch(b=>{console.error(b),t({title:r("Failed to rename space"),errors:[b]})}),f=({resources:h})=>{h.length===1&&u({title:r("Rename space »%{name}«",{name:h[0].name}),confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:h[0].name,inputRequiredMark:!0,onConfirm:g=>c(h[0],g),onInput:(g,m)=>{const{isValid:b,error:S}=l(g);m(b?null:S)}})};return{actions:T(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:f,isVisible:({resources:h})=>h.length!==1?!1:h[0].canRename({user:n.user,ability:s}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},Dm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Ze(),{$gettext:r,$ngettext:s}=de.useGettext(),o=Lt(),i=Ee(),l=Nt(),u=yt(),{dispatchModal:d}=Ke(),c=Ue(),f=m=>m.filter(b=>z.isProjectSpaceResource(b)&&b.canRestore({user:n.user,ability:o})),p=async m=>{const b=i.graphAuthenticated,S=m.map(A=>b.drives.updateDrive(A.id,{name:A.name},{headers:{Restore:"true"}}).then(I=>(a(u).name==="admin-settings-spaces"&&(A.disabled=!1,A.spaceQuota=I.spaceQuota),c.updateSpaceField({id:A.id,field:"disabled",value:!1}),!0))),k=await l.addTask(()=>Promise.allSettled(S));await c.loadGraphPermissions({ids:m.map(A=>A.id),graphClient:b});const w=k.filter(Br);if(w.length){const A=w.length===1&&m.length===1?r("Space »%{space}« was enabled successfully",{space:m[0].name}):s("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",w.length,{spaceCount:w.length.toString()});e({title:A})}const C=k.filter(jr);if(C.length){C.forEach(console.error);const A=C.length===1&&m.length===1?r("Failed to enable space »%{space}«",{space:m[0].name}):s("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",C.length,{spaceCount:C.length.toString()});t({title:A,errors:C.map(I=>I.reason)})}},h=({resources:m})=>{const b=f(m);if(!b.length)return;const S=s("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",b.length,{count:b.length.toString()}),k=r("Enable");d({title:s("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",b.length,{space:b[0].name,spaceCount:b.length.toString()}),confirmText:k,message:S,hasInput:!1,onConfirm:()=>p(b)})};return{actions:T(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:h,isVisible:({resources:m})=>!!f(m).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:p}},NE=()=>{const{$gettext:e}=de.useGettext(),t=Re(),{openSideBarPanel:n}=Pt(),r=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),n("space-share")};return{actions:T(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:r,isVisible:({resources:o})=>o.length===1&&!o[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},BE=()=>{const e=Ae(),{$gettext:t}=de.useGettext(),n=s=>gr("files-trash-generic",{...In(s,{fileId:s.fileId})});return{actions:T(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:s})=>{e.push(n(s[0]))},isVisible:({resources:s})=>!(s.length!==1||!z.isProjectSpaceResource(s[0])&&!z.isPersonalSpaceResource(s[0])||s[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},jE=ge({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=On(),{currentTheme:r}=ve.storeToRefs(n),s=T(()=>a(r).isDark?"dark":"light");return{onEmojiSelect:i=>{t("confirm",i)},theme:s}}});function zE(e,t,n,r,s,o){const i=te("oc-emoji-picker");return D(),ee(i,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Fm=Le(jE,[["render",zE]]),VE=()=>{const e=Ze(),{showMessage:t,showErrorMessage:n}=Me(),{$gettext:r}=de.useGettext(),s=Ee(),o=Nt(),i=Ue(),{createDefaultMetaFolder:l}=ms(),{dispatchModal:u}=Ke(),{getDefaultMetaFolder:d}=Ri(),c=({resources:g})=>{g.length===1&&u({elementClass:"w-auto",title:r("Set icon for »%{space}«",{space:g[0].name}),hideConfirmButton:!0,customComponent:Fm,focusTrapInitial:!1,onConfirm:m=>p(g[0],m)})},f=async g=>{const m=document.createElement("canvas"),b=m.getContext("2d"),S=16/9,k=720,w=k/S;m.width=k,m.height=w;const C=.4*k;b.font=`${C}px sans-serif`,b.textBaseline="middle",b.textAlign="center",b.fillText(g,m.width/2,m.height/2+15);const I=await yp(m);return gp(I)},p=async(g,m)=>{const b=s.graphAuthenticated,S=await f(m);let k=await d(g);return k||(k=await l(g)),o.addTask(async()=>{const w={"Content-Type":"application/offset+octet-stream"};try{const{fileId:C}=await s.webdav.putFileContents(g,{parentFolderId:k.id,fileName:"image.png",content:S,headers:w,overwrite:!0}),A=await b.drives.updateDrive(g.id,{name:g.name,special:[{specialFolder:{name:"image"},id:C}]});i.updateSpaceField({id:g.id,field:"spaceImageData",value:A.spaceImageData}),t({title:r("Space icon was set successfully")}),Xe.publish("app.files.spaces.uploaded-image",A)}catch(C){if(console.error(C),C instanceof z.HttpError&&C.statusCode===507){n({title:r("Failed to set space icon"),desc:r("Not enough quota to set the space icon"),errors:[C]});return}n({title:r("Failed to set space icon"),errors:[C]})}})};return{actions:T(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>r("Set icon"),isVisible:({resources:g})=>g.length!==1?!1:g[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:p}},UE=()=>{const e=Ze(),{$gettext:t}=de.useGettext(),{dispatchModal:n}=Ke(),{graphAuthenticated:r,webdav:s}=Ee(),o=Ue(),{showMessage:i,showErrorMessage:l}=Me(),{defaultSpaceImageBlobURL:u}=ve.storeToRefs(o),d=async({space:p})=>{try{await s.deleteFile(p,{path:".space/image.png"}),await r.drives.updateDrive(p.id,{name:p.name,special:[{specialFolder:{name:"image"},id:null}]}),o.updateSpaceField({id:p.id,field:"spaceImageData",value:null}),o.updateSpaceField({id:p.id,field:"thumbnail",value:a(u)}),i({title:t("Space image deleted successfully")})}catch(h){console.error(h),l({title:t("Failed to delete space image"),errors:[h]})}},c=({resources:p})=>{n({title:t("Delete »%{space}« image",{space:p[0].name}),confirmText:t("Delete"),onConfirm:()=>d({space:p[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:p[0].name})})};return{actions:T(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:p})=>p.length!==1||!p[0].spaceImageData?!1:p[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:d}},qE=({onSpaceCreated:e}={})=>{const{dispatchModal:t}=Ke(),{$gettext:n}=de.useGettext(),{can:r}=wc.useAbility(),{isSpaceNameValid:s}=Wr(),{addNewSpace:o}=ms();return{actions:T(()=>[{name:"create",icon:"add",class:"oc-files-actions-create-space-trigger",label:()=>n("New Space"),isVisible:()=>r("create-all","Drive"),handler:()=>{t({title:n("Create a new space"),confirmText:n("Create"),hasInput:!0,inputLabel:n("Space name"),inputValue:n("New space"),inputRequiredMark:!0,onConfirm:async l=>{const u=await o(l);e?.(u)},onInput:(l,u)=>{const{isValid:d,error:c}=s(l);u(d?null:c)}})}}])}},HE=()=>{const{$gettext:e}=de.useGettext(),{openSideBar:t}=Pt();return{actions:T(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>t(),isVisible:({resources:r})=>r.length>0,class:"oc-admin-settings-show-details-trigger"}])}},WE=()=>{const{getMatchingSpace:e}=Rt(),t=Ue(),n=Pn(),r=Re(),s=Ee(),{$gettext:o}=de.useGettext(),{openEditor:i}=bn(),{resources:l,currentFolder:u}=ve.storeToRefs(r);return{openEmptyEditor:async(c,f)=>{let p=a(u)?e(a(u)):null,h=a(l),g=a(u)?.path;(!p||!a(u).canCreate())&&(p=t.personalSpace,h=(await s.webdav.listFiles(p)).children,g="");let m=o("New file")+`.${f}`;h.some(w=>w.name===m)&&(m=pn(m,f,h));const b=await s.webdav.putFileContents(p,{path:z.urlJoin(g,m)}),S=e(b),k=n.fileExtensions.find(({app:w,extension:C})=>w===c&&C===f);i(k,S,b)}}},Im=()=>{const{$gettext:e}=de.useGettext(),{showMessage:t}=Me();return{openUrl:(r,s,o)=>{const i=window.open(r,s);i?o&&i.focus():t({title:e("Pop-up and redirect block detected"),timeout:20,status:"warning",desc:e("Please turn on pop-ups and redirects in your browser settings to make sure everything works right.")})}}},QE=()=>Gn("$appProviderService"),KE=()=>{const{isResourceAccessible:e}=Rt();return{breadcrumbsFromPath:({route:r,space:s,resourcePath:o,ancestorMetaData:i=H({})})=>{const l=(c="")=>c.split("/").filter(Boolean),u=l(r.path),d=l(o);return d.map((c,f)=>{const p=z.urlJoin(...d.slice(0,f+1),{leadingSlash:!0}),h=e({space:a(s),path:p});let g;return h&&(g=a(i)[p]),{id:wt.v4(),allowContextActions:!0,text:c,...h&&{to:{path:"/"+[...u].splice(0,u.length-d.length+f+1).join("/"),query:{...ps(r.query,"page","fileId"),...g&&{fileId:g.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const s=r.pop();return[...r,{id:wt.v4(),allowContextActions:s.allowContextActions,text:s.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:s.isTruncationPlaceholder,isStaticNav:s.isStaticNav}]}}},GE=(e="")=>{const t=H(0),n=async()=>{await St();const r=document.querySelector(e||"#files-app-bar"),s=r?r.getBoundingClientRect().height:0;t.value!==s&&(t.value=s)};return window.onresize=n,ft(n),{y:t,refresh:n}},ac=()=>{const e=H(!0),t=()=>{e.value=window.innerHeight>500};return ft(()=>{t(),window.addEventListener("resize",t)}),Xt(()=>{window.removeEventListener("resize",t)}),{isSticky:e}},Pm=({extensionRegistry:e,appId:t})=>e.requestExtensions({id:`app.${t}.navItems`,extensionType:"sidebarNav"}).map(({navItem:n})=>n).filter(n=>!Object.hasOwn(n,"isVisible")||n.isVisible()),$m=()=>{const e=Kr.useRouter(),t=Kr.useRoute(),{$gettext:n}=de.useGettext(),r=yr(),s=Jd(),o=br(),i=T(()=>Pm({extensionRegistry:o,appId:a(s)}));return{navItems:T(()=>{if(!r.userContextReady)return[];const{href:u}=e.resolve(a(t));return et.orderBy(a(i).map(d=>{let c=typeof d.isActive!="function"||d.isActive();c&&(c=[d.route,...d.activeFor||[]].filter(Boolean).some(p=>{try{const h=e.resolve(p).href;return u.startsWith(h)}catch(h){return console.error(h),!1}}));const f=typeof d.name=="function"?d.name():d.name;return{...d,name:n(f),active:c}}),["priority","name"])})}};class Ss{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function JE(e){const t=Kr.useRouter(),n=Kr.useRoute(),r=XE(e),s=YE(e),o=T(()=>Math.ceil(a(e.items).length/a(s))||1),i=T(()=>{if(!a(s))return a(e.items);const l=(a(r)-1)*a(s),u=l+a(s);return a(e.items).slice(l,u)});return Xe.subscribe("app.files.navigate.page",({resourceId:l,forceScroll:u,topbarElement:d})=>{const c=et.findIndex(a(e.items),f=>f.id===l);if(c>=0){const f=Math.ceil((c+1)/Number(a(s)));t.push({...a(n),query:{...a(n).query,page:f}}).then(()=>{Xe.publish("app.files.navigate.scrollTo",{resourceId:l,forceScroll:u,topbarElement:d})})}}),{items:i,total:o,page:r,perPage:s}}function XE(e){if(e.page)return T(()=>a(e.page));const t=At("page","1");return T(()=>parseInt(ot(a(t))))}function YE(e){if(e.perPage)return T(()=>a(e.perPage));const t=Xn({name:e.perPageQueryName||Ss.perPageQueryName,defaultValue:e.perPageDefault||Ss.perPageDefault,storagePrefix:e.perPageStoragePrefix});return T(()=>parseInt(ot(a(t))))}const Om=()=>Gn("$passwordPolicyService"),Lm=()=>Gn("$previewService"),_m=()=>{const e=Pn();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:s})=>s).some(({mimeType:s})=>s===n.mimeType)}},Mm=()=>{const e=Ze();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||z.isSpaceResource(r)||z.isTrashResource(r)?!1:n?.canListVersions({user:e.user})}},Nm=()=>{const e=Ee(),t=Ue(),n=T(()=>t.spaces),r=u=>a(n).find(d=>u.toString().startsWith(d.id.toString())),s=u=>a(n).find(d=>z.isMountPointSpaceResource(d)&&d.root?.remoteItem?.id===u),o=(u,d)=>{const c=[Te.FileId,Te.FileParent,Te.Name,Te.ResourceType],f=z.buildSpace({id:u,name:""});return e.webdav.getFileInfo(f,{fileId:u},{davProperties:c,signal:d})},i=Ft.useTask(function*(u,d){let c,f,p=r(d);if(p)return c=yield e.webdav.getPathForFileId(d,{signal:u}),f=yield e.webdav.getFileInfo(p,{path:c},{signal:u}),{space:p,resource:f,path:c};yield t.loadMountPoints({graphClient:e.graphAuthenticated,signal:u});let h=s(d);f=yield o(d,u);const g=h?[]:[a(f).name];let m=a(f);for(;!h;)m=yield o(m.parentFolderId,u),h=s(m.id),h||g.unshift(m.name);return p=t.getSpace(h.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:f.storageId?.startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share",id:h.root?.remoteItem?.id,shareName:h.name}),c=z.urlJoin(...g),{space:p,resource:f,path:c}}).restartable();return{getResourceContext:u=>i.perform(u)}},Et={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},ZE=140,eD=84,Bm=()=>{const e=H(ZE),t=H(eD),n=s=>a(e)+(s-1)*a(t);return{calculateTileSizePixels:n,calculateTileSizeRem:s=>{const o=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(s)/o}}};function tD(e){if(e)return T(()=>a(e));const t=Xn({name:Et.queryName,defaultValue:Et.defaultModeName});return T(()=>ot(a(t)))}function nD(e){if(e)return T(()=>parseInt(a(e)));const t=Xn({name:Et.tilesSizeQueryName,defaultValue:Et.tilesSizeDefault.toString()});return T(()=>parseInt(ot(a(t))))}const rD=H(Et.tilesSizeMax);function lc(){return rD}const cc=e=>{const t=Lm(),{updateResourceField:n}=Re(),{httpAuthenticated:r}=Ee(),s=Ue(),{defaultSpaceImageBlobURL:o}=ve.storeToRefs(s),i=Qe(),{serverUrl:l}=ve.storeToRefs(i),u=new sr({concurrency:4}),d=T(()=>a(e)===Et.name.tiles),c=T(()=>a(d)?bi.enum.fit:bi.enum.thumbnail),f=T(()=>a(d)?fo.Tile:fo.Thumbnail),p=Ft.useTask(function*(b,{space:S,resource:k,dimensions:w,processor:C,updateStore:A=!0}){const I=z.isProjectSpaceResource(k)?z.buildSpaceImageResource(k):k,N=I.id===S.spaceImageData?.id;N&&s.addToImagesLoading(S.id);const _=yield u.add(()=>t.loadPreview({space:S,resource:I,processor:C||a(c),dimensions:w||a(f)},!0,!0,b));return _&&A&&n({id:k.id,field:"thumbnail",value:_}),N&&s.removeFromImagesLoading(S.id),_}),h=async b=>{const{resource:S,cancelRunning:k}=b;if(k&&m(),z.isProjectSpaceResource(S)&&(!S.spaceImageData||S.disabled)){a(o)&&s.updateSpaceField({id:S.id,field:"thumbnail",value:a(o)});try{const w=await r.get(`${a(l)}images/default-space-icon.png`,{responseType:"blob"});return s.setDefaultSpaceImageBlobURL(URL.createObjectURL(w.data)),s.updateSpaceField({id:S.id,field:"thumbnail",value:a(o)}),a(o)}catch{return null}}try{return await p.perform(b)}catch(w){w!=="cancel"&&console.error(w)}},g=T(()=>p.isRunning),m=()=>{p.cancelAll(),u.clear(),s.purgeImagesLoading()};return zo(m),{loadPreview:h,previewsLoading:g}},jm=({showSizeInformation:e=!0}={})=>{const t=Re(),{current:n,$gettext:r,$ngettext:s}=de.useGettext(),o=Ae(),{resources:i,totalResourcesCount:l,areHiddenFilesShown:u,currentFolder:d}=ve.storeToRefs(t),c=T(()=>{if(!a(d)?.size||a(d)?.size==="0"){const p=a(i).map(h=>h.size?parseInt(h.size.toString()):0).reduce((h,g)=>h+g,0);return zt(p,n)}return zt(a(d).size,n)});return{resourceContentsText:T(()=>{let p=s("%{ filesCount } file","%{ filesCount } files",a(l).files,{filesCount:a(l).files.toString()});!a(u)&&a(l).hiddenFiles&&(p=s("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",a(l).files,{filesCount:a(l).files.toString(),filesHiddenCount:a(l).hiddenFiles.toString()}));let h=s("%{ foldersCount } folder","%{ foldersCount } folders",a(l).folders,{foldersCount:a(l).folders.toString()});!a(u)&&a(l).hiddenFolders&&(h=s("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",a(l).folders,{foldersCount:a(l).folders.toString(),foldersHiddenCount:a(l).hiddenFolders.toString()}));const g=s("%{ spacesCount } space","%{ spacesCount } spaces",a(l).spaces,{spacesCount:a(l).spaces.toString()}),m=a(l).files+a(l).folders+a(l).spaces,b=e&&parseFloat(a(c))>0,S=pt(o,"files-shares-via-link"),k=r(b?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),w=r(b?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),C=S?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",A=`${k} ${C}`,I=`${w} ${C}`;return s(A,I,m,{itemsCount:m.toString(),itemSize:a(c),filesStr:p,foldersStr:h,spacesStr:g})})}},zm=()=>{const{$gettext:e}=de.useGettext(),{interceptModifierClick:t}=Vr(),{openSideBarPanel:n}=Pt(),r=Re(),s=Ze(),o=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.authenticated,k??[]),i=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.unauthenticated,k??[]),l=({isDirect:k})=>e(k?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),u=({isDirect:k})=>e(k?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),d=({resource:k,isDirect:w})=>({id:`files-sharing-${k.getDomSelector()}`,accessibleDescription:l({isDirect:w}),label:e("Show invited people"),icon:"group",category:"sharing",type:w?"user-direct":"user-indirect",fillType:"line",handler:(C,A)=>{A&&t(A,C)||n("sharing")}}),c=({resource:k})=>({id:`files-sharing-synced-${k.getDomSelector()}`,accessibleDescription:e("This item is synced with your devices"),label:e("Synced with your devices"),icon:"loop-right",category:"sharing",type:"resource-synced",fillType:"line"}),f=({resource:k})=>k.shareRoles?.length?{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:e(k.shareRoles[0].description),label:e(k.shareRoles[0].displayName),icon:k.shareRoles[0].icon,category:"sharing",type:"share-role",fillType:"line"}:{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:z.ShareTypes.remote.label,label:z.ShareTypes.remote.label,icon:z.ShareTypes.remote.icon,category:"sharing",type:"share-role",fillType:"line"},p=({resource:k,isDirect:w})=>({id:`file-link-${k.getDomSelector()}`,accessibleDescription:u({isDirect:w}),label:e("Show links"),icon:"link",category:"sharing",type:w?"link-direct":"link-indirect",fillType:"line",handler:()=>n("sharing")}),h=({resource:k})=>({id:`resource-locked-${k.getDomSelector()}`,accessibleDescription:e("Item locked"),label:e("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),g=({resource:k})=>({id:`resource-processing-${k.getDomSelector()}`,accessibleDescription:e("Item in processing"),label:e("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),m=({resource:k})=>({id:`resource-space-enabled-${k.getDomSelector()}`,accessibleDescription:e("Space is enabled"),label:e("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),b=({resource:k})=>({id:`resource-space-disabled-${k.getDomSelector()}`,accessibleDescription:e("Space is disabled"),label:e("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"});return{getIndicators:({space:k,resource:w})=>{const C=[];if(w.locked&&C.push(h({resource:w})),w.processing&&C.push(g({resource:w})),z.isProjectSpaceResource(w)&&!w.disabled&&C.push(m({resource:w})),z.isProjectSpaceResource(w)&&w.disabled&&C.push(b({resource:w})),z.isIncomingShareResource(w)&&(w.shareTypes.includes(z.ShareTypes.remote.value)||w.shareRoles?.length)&&C.push(f({resource:w})),z.isIncomingShareResource(w)&&w.syncEnabled&&C.push(c({resource:w})),z.isProjectSpaceResource(k)||z.isPersonalSpaceResource(k)&&k.isOwner(s.user)){const N=Object.values(r.ancestorMetaData).flatMap(({shareTypes:V})=>V),_=o(w.shareTypes);(_||o(N))&&C.push(d({resource:w,isDirect:_}));const F=i(w.shareTypes);(F||i(N))&&C.push(p({resource:w,isDirect:F}))}return C}}},Vm=({isResourceSelected:e,isResourceDisabled:t,emit:n})=>{const r=Sr(),{interceptModifierClick:s}=Vr(),o=c=>{r.publish("app.files.list.clicked"),n("update:selectedIds",c)},i=vn(jt,"files-trash-overview");return{shouldShowContextDrop:c=>a(i)&&z.isProjectSpaceResource(c)&&c.disabled?!1:!t(c),showContextMenuOnBtnClick:(c,f,p)=>{c instanceof MouseEvent&&s(c,f)||t(f)||p?.show({event:c})},showContextMenuOnRightClick:(c,f,p)=>{c instanceof MouseEvent&&s(c,f)||(c.preventDefault(),!t(f)&&(e(f)||o([f.id]),p?.show({event:c,useMouseAnchor:!0})))}}},Um=({selectedIds:e,selectedResources:t,emit:n})=>{const r=Re(),s=H(),o=qt("ghostElement"),i=async(p,h)=>{s.value=p,await St(),a(o).$el.ariaHidden="true",a(o).$el.style.left="-99999px",a(o).$el.style.top="-99999px",h.dataTransfer.setDragImage(a(o).$el,0,0),h.dataTransfer.dropEffect="move",h.dataTransfer.effectAllowed="move"},l=async(p,h)=>{a(e).includes(p.id)||(r.toggleSelection(p.id),n("update:selectedIds",[...r.selectedIds])),await i(p,h)},u=T(()=>a(t).filter(({id:p})=>p!==a(s)?.id)),d=p=>(p.dataTransfer.types||[]).some(h=>h==="Files"),c=(p,h)=>{d(h)||(s.value=null,f(p,!0,h),n("fileDropped",p.id))},f=(p,h,g)=>{if(d(g)||g.currentTarget?.contains(g.relatedTarget)||a(e).includes(p.id)||p.type!=="folder")return;const m=document.querySelectorAll(`[data-item-id='${p.id}']`)?.[0];if(!m)return;const b="!bg-role-secondary-container";h?m.classList.remove(b):m.classList.add(b)};return{ghostElement:o,dragItem:s,dragSelection:u,dragStart:l,fileDropped:c,setDropStyling:f}},qm=({resources:e,disabledResources:t,selectedIds:n,emit:r})=>{const s=Sr(),{$gettext:o}=de.useGettext(),i=f=>{s.publish("app.files.list.clicked"),r("update:selectedIds",f)},l=f=>{switch(f.type){case"folder":return o("Select folder");case"space":return o("Select space");default:return o("Select file")}},u=T(()=>{const f=a(t).length===a(e).length,p=a(n).length===a(e).length-a(t).length;return!f&&p}),d=T(()=>a(u)?o("Clear selection"):o("Select all"));return{getResourceCheckboxLabel:l,areAllResourcesSelected:u,selectAllCheckboxLabel:d,toggleSelectionAll:()=>{if(a(u))return i([]);i(a(e).filter(f=>!a(t).includes(f.id)).map(f=>f.id))}}},uc=({space:e,resources:t,selectedIds:n,emit:r})=>{const s=Re(),o=Ae(),i=Sr(),{interceptModifierClick:l}=Vr(),{getMatchingSpace:u}=Rt(),{canBeOpenedWithSecureView:d}=_m(),{getDefaultAction:c}=bn(),{isEnabled:f,fileTypes:p,isFilePicker:h,postMessage:g}=wr(),m=Zs(),{resources:b,action:S}=ve.storeToRefs(m),k=T(()=>a(t).filter($=>a(n).includes($.id))),w=$=>a(n).includes($.id),C=$=>s.deleteQueue.includes($),A=$=>a(f)&&a(p)?.length?!a(p).includes($.extension)&&!a(p).includes($.mimeType)&&!$.isFolder:C($.id)?!0:$.processing===!0,I=T(()=>a(t)?.filter(A)?.map($=>$.id)||[]);return{selectedResources:k,disabledResources:I,isResourceSelected:w,isResourceInDeleteQueue:C,isResourceDisabled:A,isResourceClickable:($,L)=>!L||z.isProjectSpaceResource($)&&$.disabled||!$.isFolder&&!$.canDownload()&&!d($)?!1:!A($),isResourceCut:$=>a(S)!==Js.Cut?!1:a(b).some(L=>L.id===$.id),fileContainerClicked:({resource:$,event:L})=>{if(A($))return;if(a(f)&&a(h)&&!$.isFolder)return g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify($)),locationQuery:JSON.parse(JSON.stringify(Ai(a(o.currentRoute))))});!L.shiftKey&&!L.metaKey&&!L.ctrlKey&&i.publish("app.files.shiftAnchor.reset");const M=L?.target;if(M?.closest("div")?.id==="oc-files-context-menu")return;if(L&&L.metaKey)return i.publish("app.files.list.clicked.meta",$);if(L&&L.shiftKey)return i.publish("app.files.list.clicked.shift",{resource:$,skipTargetSelection:!1});M.getAttribute("type")!=="checkbox"&&(w($)||(i.publish("app.files.list.clicked"),r("update:selectedIds",[$.id])))},fileNameClicked:({resource:$,event:L})=>{if(!l(L,$)){if(a(f))return a(h)||r("update:selectedIds",[$.id]),a(h)&&!$.isFolder?g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify($)),locationQuery:JSON.parse(JSON.stringify(Ai(a(o.currentRoute))))}):void 0;r("fileClick",{space:u($),resources:[$]})}},fileCheckboxClicked:({resource:$,event:L})=>{l(L,$)||(s.toggleSelection($.id),i.publish("app.files.list.clicked"),r("update:selectedIds",[...s.selectedIds]))},getResourceLink:$=>{let L=a(e);L||(L=u($));const M=c({resources:[$],space:L});if(M?.route)return M.route({space:L,resources:[$]})},...Um({selectedIds:n,selectedResources:k,emit:r}),...Vm({isResourceDisabled:A,isResourceSelected:w,emit:r}),...qm({resources:t,disabledResources:I,selectedIds:n,emit:r})}},dc=()=>{const{getMatchingSpace:e}=Rt(),t=Re(),n=T({get(){return t.selectedResources},set(i){t.setSelection(i.map(({id:l})=>l))}}),r=T({get(){return t.selectedIds},set(i){t.setSelection(i)}}),s=i=>a(r).includes(i.id),o=T(()=>{if(a(n).length!==1)return null;const i=a(n)[0];return e(i)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:s,selectedResourceSpace:o}};class yo{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}function sD(e){const t=Ae(),n=oD(e),r=iD(e),s=T(()=>Wm(a(n))||a(fc(a(i))?.name)),o=T(()=>lD(a(r))||aD(a(s),a(i))),i=e.fields;return{items:T(()=>{const d=a(e.items);return a(s)?Hm(d,a(i),a(s),a(o)):d}),sortBy:s,sortDir:o,handleSort:({sortBy:d,sortDir:c})=>t.replace({query:{...a(t.currentRoute).query,[a(e.sortByQueryName)||yo.sortByQueryName]:d,[a(e.sortDirQueryName)||yo.sortDirQueryName]:c}})}}function oD(e){return e.sortBy?ct(e.sortBy)?e.sortBy:H(e.sortBy):Xn({name:a(e.sortByQueryName)||yo.sortByQueryName,defaultValue:a(fc(a(e.fields))?.name),storagePrefix:a(e.routeName)||a(Pl())})}function iD(e){return e.sortDir?ct(e.sortDir)?e.sortDir:H(e.sortDir):Xn({name:a(e.sortDirQueryName)||yo.sortDirQueryName,defaultValue:a(fc(a(e.fields))?.sortDir),storagePrefix:a(e.routeName)||a(Pl())})}const fc=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},aD=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?a(n.sortDir):Je.Desc},Hm=(e,t,n,r)=>{const s=t.find(l=>l.name===n);if(!s)return e;const{sortable:o}=s,i=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const l=c=>c.type==="folder"&&!c.extension,u=[...e.filter(c=>l(c))].sort((c,f)=>pc(c,f,i,n,r,o)),d=[...e.filter(c=>!l(c))].sort((c,f)=>pc(c,f,i,n,r,o));return r===Je.Asc?u.concat(d):d.concat(u)}return[...e].sort((l,u)=>pc(l,u,i,s.prop||s.name,r,o))},pc=(e,t,n,r,s,o)=>{let i=Sl(e,r),l=Sl(t,r);const u=s===Je.Asc?1:-1;if(o)if(typeof o=="string"){const c=f=>f.map(p=>p[o]).join("");i=c(i),l=c(l)}else typeof o=="function"&&(i=o(i),l=o(l));return!isNaN(i)&&!isNaN(l)?(i-l)*u:n.compare((i||"").toString(),(l||"").toString())*u},Wm=e=>Array.isArray(e)?e[0]:e,lD=e=>{switch(Wm(e)){case Je.Asc:return Je.Asc;case Je.Desc:return Je.Desc}return null};function cD(e){const t=Ct(),n=yr(),r=Ee(),s=de.useGettext(),o=T(()=>t.tusMaxChunkSize>0),i=()=>{const d={};return n.publicLinkPassword?d.Authorization="Basic "+di.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(d.Authorization="Bearer "+n.accessToken),d["X-Request-ID"]=wt.v4(),d["Accept-Language"]=s.current,d["Initiator-ID"]=r.initiatorId,d},l=T(()=>{const d={onBeforeRequest:(c,f)=>new Promise(p=>{const h=i();c.setHeader("Authorization",h.Authorization),c.setHeader("X-Request-ID",h["X-Request-ID"]),c.setHeader("Accept-Language",h["Accept-Language"]),c.setHeader("Initiator-ID",h["Initiator-ID"]),f?.isRemote&&c.setHeader("x-oc-mtime",(f?.data?.lastModified/1e3).toFixed(0)),p()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return d.headers=c=>{if(c.xhrUpload||c?.isRemote)return{"x-oc-mtime":(c?.data?.lastModified/1e3).toFixed(0),...i()}},d}),u=T(()=>({timeout:6e4,endpoint:"",headers:d=>({"x-oc-mtime":(d?.data?.lastModified/1e3).toFixed(0),...i()})}));ze([l,u],()=>{if(a(o)){e.uppyService.useTus(a(l));return}e.uppyService.useXhr(a(u))},{immediate:!0})}const Qm=()=>{const e=Ee(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:s}=ai(),o=async l=>{try{const u=await e.graphAuthenticated.photos.getUserPhoto(l,{responseType:"blob"});t(l,URL.createObjectURL(u))}catch(u){u.response?.status===404&&t(l,null)}return n(l)};return{enqueueAvatar:l=>{if(n(l)!==void 0||s.has(l))return;const u=r.add(()=>o(l));s.set(l,u),u.finally(()=>s.delete(l))}}},uD=ge({name:"ActionMenuItem",props:{action:{type:Object,required:!0},actionOptions:{type:Object,required:!0},size:{type:String,required:!1,default:"medium"},appearance:{type:String,default:"raw"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1},buttonClasses:{type:Array,default:()=>[]}},setup(e){const t=Qe(),{options:n}=ve.storeToRefs(t),r=T(()=>Object.hasOwn(e.action,"route")?"router-link":Object.hasOwn(e.action,"href")?"a":(Object.hasOwn(e.action,"handler")||console.warn("ActionMenuItem: No handler, route or href callback found in action",e.action),"button")),s=T(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...a(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...a(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(a(r))&&{target:n.value.cernFeatures?"_blank":"_self"}})),o=T(()=>typeof e.action.icon=="function"?e.action.icon(e.actionOptions):e.action.icon);return{componentType:r,componentProps:s,actionIcon:o}},computed:{hasExternalImageIcon(){return this.actionIcon&&/^https?:\/\//i.test(this.actionIcon)},componentListeners(){if(typeof this.action.handler!="function")return{};const e=()=>this.action.handler({...this.actionOptions});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}}),dD={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},fD=["textContent"],pD=["textContent"];function hD(e,t,n,r,s,o){const i=te("oc-image"),l=te("oc-icon"),u=te("oc-button"),d=Bt("oc-tooltip");return je((D(),K("li",null,[je((D(),ee(u,at({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","align-middle","w-full",...e.buttonClasses],"aria-label":e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions)??e.action.label(e.actionOptions):e.action.label(e.actionOptions),"data-testid":"action-handler",size:e.size,"justify-content":"left"},Uo(e.componentListeners)),{default:X(()=>[e.action.img?(D(),ee(i,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.hasExternalImageIcon?(D(),ee(i,{key:1,"data-testid":"action-img",src:e.actionIcon,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.actionIcon?(D(),ee(l,{key:2,"data-testid":"action-icon",name:e.actionIcon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):ie("",!0),e.action.hideLabel?ie("",!0):(D(),K("span",dD,[W("span",{class:"text-left",textContent:R.toDisplayString(e.action.label(e.actionOptions))},null,8,fD)])),e.action.shortcut&&e.shortcutHint?(D(),K("span",{key:4,class:"text-sm flex-row-reverse",textContent:R.toDisplayString(e.action.shortcut)},null,8,pD)):ie("",!0)]),_:1},16,["type","class","aria-label","size"])),[[d,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[d,e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions):""]])}const ea=Le(uD,[["render",hD]]),mD=ge({name:"BatchActions",components:{ActionMenuItem:ea},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function gD(e,t,n,r,s,o){const i=te("action-menu-item"),l=te("oc-list");return D(),K("div",null,[Q(l,{id:"oc-appbar-batch-actions",class:R.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:X(()=>[(D(!0),K(ke,null,Ge(e.actions,(u,d)=>(D(),ee(i,{key:`action-${d}`,action:u,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions mr-2 float-left [&_.action-menu-item]:p-2 [&_.action-menu-item]:gap-1","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const Km=Le(mD,[["render",gD]]),yD={class:"context-menu px-2"},vD={class:"inline-flex gap-2"},bD={class:"flex oc-files-context-action-label"},wD=["textContent"],Gm=ge({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=Mr(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=Mr(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,s)=>{const o=te("oc-icon"),i=te("oc-button"),l=te("oc-list");return D(),K("li",yD,[Q(i,{id:a(n),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:X(()=>[W("span",vD,[Q(o,{name:e.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),W("span",bD,[W("span",{textContent:R.toDisplayString(e.menuSectionDrop.label)},null,8,wD)])]),Q(o,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),Q(a(Hh),{title:e.menuSectionDrop.label,"drop-id":a(t),toggle:`#${a(n)}`,mode:"hover",class:"w-3xs oc-files-context-action-drop","padding-size":"small",position:"bottom-start","close-on-click":""},{default:X(()=>[e.menuSectionDrop.items.length?(D(),ee(l,{key:0},{default:X(()=>[(D(!0),K(ke,null,Ge(e.menuSectionDrop.items,(u,d)=>(D(),ee(ea,{key:`section-${e.menuSectionDrop.label}-action-${d}`,action:u,appearance:e.appearance,"action-options":e.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):ie("",!0)]),_:1},8,["title","drop-id","toggle"])])}}}),SD=ge({name:"ContextActionMenu",components:{ActionMenuDropItem:Gm,ActionMenuItem:ea},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},actionOptions:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length&&(e<this.menuSections.length-1&&t.push("pb-2"),e>0&&t.push("pt-2"),e<this.menuSections.length-1&&t.push("border-b")),t}}}),kD={id:"oc-files-context-menu"};function CD(e,t,n,r,s,o){const i=te("action-menu-item"),l=te("action-menu-drop-item"),u=te("oc-list");return D(),K("div",kD,[(D(!0),K(ke,null,Ge(e.menuSections,(d,c)=>(D(),ee(u,{id:`oc-files-context-actions-${d.name}`,key:`section-${d.name}-list`,class:R.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:X(()=>[d.items?(D(!0),K(ke,{key:0},Ge(d.items,(f,p)=>(D(),ee(i,{key:`section-${d.name}-action-${p}`,action:f,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):ie("",!0),(D(!0),K(ke,null,Ge(d.dropItems,f=>(D(),K(ke,null,[f.items.length?(D(),ee(l,{key:f.name,"menu-section-drop":f,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):ie("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const ta=Le(SD,[["render",CD]]),TD=ge({name:"ContextActions",components:{ContextActionMenu:ta},props:{actionOptions:{type:Object,required:!0}},setup(e){const{getAllOpenWithActions:t}=bn(),{$gettext:n}=de.useGettext(),{actions:r}=am(),{actions:s}=Gi(),{actions:o}=Yi(),{actions:i}=Di(),{actions:l}=jl(),{actions:u}=Qi(),{actions:d}=mo(),{actions:c}=Ki(),{actions:f}=ws(),{actions:p}=rc(),{actions:h}=Ji(),{actions:g}=dm(),{actions:m}=Xi(),{actions:b}=go(),{actions:S}=mm(),{actions:k}=oc(),{actions:w}=tc(),{actions:C}=ic(),A=br(),I=T(()=>A.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(B=>B.action)),N=T(()=>A.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(B=>B.action)),_=oy(e,"actionOptions"),F=T(()=>[...a(s),...a(u),...a(c),...a(h),...a(i),...a(d),...a(b),...a(w),...a(N).filter(B=>B.category==="actions"||et.isNil(B.category))].filter(B=>B.isVisible(a(_)))),V=T(()=>[...a(k),...a(N).filter(B=>B.category==="sidebar")].filter(B=>B.isVisible(a(_)))),Z=T(()=>a(r).filter(B=>B.isVisible(a(_))).sort((B,q)=>Number(q.hasPriority)-Number(B.hasPriority))),P=T(()=>t({...a(_),omitSystemActions:!0}).filter(B=>B.isVisible(a(_))).sort((B,q)=>Number(q.hasPriority)-Number(B.hasPriority))),$=T(()=>[...a(C),...a(l),...a(I).filter(B=>B.category==="share")].filter(B=>B.isVisible(a(_)))),L=T(()=>[...a(c),...a(f),...a(d),...a(h),...a(i),...a(g),...a(m),...a(w),...a(b),...a(s),...a(u),...a(o),...a(S),...a(I).filter(B=>B.category==="actions"||et.isNil(B.category))].filter(B=>B.isVisible(a(_)))),M=T(()=>[...a(p).map(B=>(B.keepOpen=!0,B)),...a(k),...a(I).filter(B=>B.category==="sidebar")].filter(B=>B.isVisible(a(_))));return{menuSections:T(()=>{const B=[];return a(_).resources.length>1?(a(F).length&&B.push({name:"batch-actions",items:[...a(F)]}),B.push({name:"batch-details",items:[...a(V)]}),B):([...a(Z),...a(P)].length&&B.push({name:"context",items:[...a(Z)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...a(P)]}]}),a($).length&&B.push({name:"share",items:a($)}),a(L).length&&B.push({name:"actions",items:a(L)}),a(M).length&&B.push({name:"sidebar",items:a(M)}),B)})}}});function xD(e,t,n,r,s,o){const i=te("context-action-menu");return D(),ee(i,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const Jm=Le(TD,[["render",xD]]),AD={class:"flex items-center"},RD={class:"flex justify-between w-full"},ED={class:"flex items-center"},DD=["textContent"],FD={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},ID={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},PD={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},$D={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},OD={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},LD={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},_D=["textContent"],MD=["max"],Xm=Le(ge({__name:"ViewOptions",props:{perPageStoragePrefix:{},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{default:()=>Ss.options},perPageQueryName:{default:()=>Ss.perPageQueryName},perPageDefault:{default:()=>Ss.perPageDefault},viewModeDefault:{default:()=>Et.defaultModeName},viewModes:{default:()=>[]}},setup(e){const t=Ae(),n=yt(),{$gettext:r}=de.useGettext(),s=Pt(),{isSideBarOpen:o}=ve.storeToRefs(s),i=Re(),{setAreHiddenFilesShown:l,setAreFileExtensionsShown:u,setAreDisabledSpacesShown:d,setAreEmptyTrashesShown:c}=i,{areHiddenFilesShown:f,areFileExtensionsShown:p,areDisabledSpacesShown:h,areEmptyTrashesShown:g}=ve.storeToRefs(i),m=H(!1),b=vn(rt,"files-spaces-projects"),S=vn(jt,"files-trash-overview"),k=At("page"),w=T(()=>a(k)?parseInt(ot(a(k))):1),C=Xn({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),A=Xn({name:Et.queryName,defaultValue:e.viewModeDefault}),I=Xn({name:Et.tilesSizeQueryName,defaultValue:Et.tilesSizeDefault.toString()}),N=q=>t.replace({query:{...a(n).query,[e.perPageQueryName]:q.toString(),...a(w)>1&&{page:"1"}}}),_=q=>{A.value=q.name};ze([C,A,I],q=>{m.value=q.some(re=>!re)},{immediate:!0,deep:!0});const F=lc(),V=T({get(){return a(f)},set(q){l(q)}}),Z=T({get(){return a(p)},set(q){u(q)}}),P=T({get(){return a(h)},set(q){d(q)}}),$=T({get(){return a(g)},set(q){c(q)}}),L=q=>{V.value=q},M=q=>{Z.value=q},j=q=>{P.value=q},B=q=>{$.value=q};return(q,re)=>{const J=te("oc-icon"),oe=te("oc-button"),ne=te("oc-list"),pe=te("oc-drop"),fe=te("oc-switch"),we=te("oc-page-size"),$e=Bt("oc-tooltip");return D(),K("div",AD,[e.viewModes.length?(D(),K(ke,{key:0},[je((D(),ee(oe,{id:"mobile-viewmode-switch-toggle","aria-label":a(r)("Switch view mode"),appearance:"raw",class:R.normalizeClass(["my-2 mx-1 p-1 align-middle",{"sm:hidden":!a(o),"md:hidden":a(o)}])},{default:X(()=>[Q(J,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label","class"])),[[$e,a(r)("Switch view mode")]]),Q(pe,{title:a(r)("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:X(()=>[Q(ne,null,{default:X(()=>[(D(!0),K(ke,null,Ge(e.viewModes,he=>(D(),K("li",{key:he.name},[Q(oe,{appearance:a(A)===he.name?"filled":"raw","color-role":a(A)===he.name?"secondaryContainer":"secondary","justify-content":"left",onClick:ae=>_(he)},{default:X(()=>[W("div",RD,[W("span",ED,[Q(J,{name:he.icon.name,"fill-type":he.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),W("span",{textContent:R.toDisplayString(he.label)},null,8,DD)]),a(A)===he.name?(D(),ee(J,{key:0,name:"check",size:"medium"})):ie("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):ie("",!0),e.viewModes.length>1?(D(),K("div",{key:1,class:R.normalizeClass(["viewmode-switch-buttons oc-button-group hidden mr-2",{"sm:inline-flex":!a(o),"md:inline-flex":a(o)}])},[(D(!0),K(ke,null,Ge(e.viewModes,he=>je((D(),ee(oe,{key:he.name,"no-hover":a(A)===he.name,class:R.normalizeClass([he.name]),appearance:a(A)===he.name?"filled":"outline","color-role":a(A)===he.name?"secondaryContainer":"secondary","aria-label":a(r)("Switch to %{viewMode}",{viewMode:he.label}),onClick:ae=>_(he)},{default:X(()=>[Q(J,{name:he.icon.name,"fill-type":he.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[$e,a(r)("Switch to %{viewMode}",{viewMode:he.label})]])),128))],2)):ie("",!0),je((D(),ee(oe,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":a(r)("Display customization options of the files list"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:X(()=>[Q(J,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[$e,a(r)("Display customization options of the files list")]]),Q(pe,{title:a(r)("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:X(()=>[Q(ne,null,{default:X(()=>[e.hasHiddenFiles?(D(),K("li",FD,[Q(fe,{checked:V.value,"onUpdate:checked":[re[0]||(re[0]=he=>V.value=he),L],"data-testid":"files-switch-hidden-files",label:a(r)("Show hidden files")},null,8,["checked","label"])])):ie("",!0),e.hasFileExtensions?(D(),K("li",ID,[Q(fe,{checked:Z.value,"onUpdate:checked":[re[1]||(re[1]=he=>Z.value=he),M],"data-testid":"files-switch-files-extensions-files",label:a(r)("Show file extensions")},null,8,["checked","label"])])):ie("",!0),e.hasPagination?(D(),K("li",PD,[m.value?ie("",!0):(D(),ee(we,{key:0,selected:a(ot)(a(C)),"data-testid":"files-pagination-size",label:a(r)("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:N},null,8,["selected","label","options"]))])):ie("",!0),a(b)?(D(),K("li",$D,[Q(fe,{checked:P.value,"onUpdate:checked":[re[2]||(re[2]=he=>P.value=he),j],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show disabled Spaces")},null,8,["checked","label"])])):ie("",!0),a(S)?(D(),K("li",OD,[Q(fe,{checked:$.value,"onUpdate:checked":[re[3]||(re[3]=he=>$.value=he),B],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show empty trash bins")},null,8,["checked","label"])])):ie("",!0),a(A)===a(Et).name.tiles?(D(),K("li",LD,[W("label",{for:"tiles-size-slider",textContent:R.toDisplayString(a(r)("Tile size"))},null,8,_D),je(W("input",{id:"tiles-size-slider","onUpdate:modelValue":re[4]||(re[4]=he=>ct(I)?I.value=he:null),type:"range",min:1,max:a(F),class:"oc-range bg-role-surface-container-high rounded-sm outline-0 w-full max-w-[50%] h-1.5 hover:opacity-100 appearance-none","data-testid":"files-tiles-size-slider"},null,8,MD),[[_a,a(I)]])])):ie("",!0)]),_:1})]),_:1},8,["title"])])}}}),[["__scopeId","data-v-17fa8a66"]]),ND={key:0,id:"mobile-nav"},BD=["aria-current"],jD={class:"flex"},zD=["textContent"],VD={class:"versions flex flex-col items-center justify-center py-2 mt-4 bg-role-surface-container text-xs text-role-on-surface-variant"},UD=["textContent"],Ym=ge({__name:"MobileNav",setup(e){const t=Ct(),{isMobile:n}=to(),{navItems:r}=$m(),s=T(()=>vp({capabilityStore:t})),o=T(()=>a(r).find(i=>i.active)||a(r)[0]);return(i,l)=>{const u=te("oc-icon"),d=te("oc-button"),c=te("oc-list"),f=te("version-check"),p=te("oc-drop");return a(n)?(D(),K("nav",ND,[Q(d,{id:"mobile-nav-button",class:"p-1",appearance:"raw","aria-current":"page"},{default:X(()=>[it(R.toDisplayString(o.value.name)+" ",1),Q(u,{name:"arrow-drop-down"})]),_:1}),Q(p,{title:i.$gettext("Navigation"),"drop-id":"mobile-nav-drop",toggle:"#mobile-nav-button",mode:"click","padding-size":"small","close-on-click":""},{default:X(()=>[Q(c,null,{default:X(()=>[(D(!0),K(ke,null,Ge(a(r),(h,g)=>(D(),K("li",{key:g,class:"mobile-nav-item w-full","aria-current":h.active?"page":null},[Q(d,{type:"router-link",appearance:h.active?"filled":"raw-inverse","color-role":h.active?"secondaryContainer":"surface","justify-content":"left","no-hover":h.active,to:h.route,class:R.normalizeClass(["block p-2",{"router-link-active":h.active}])},{default:X(()=>[W("span",jD,[Q(u,{name:h.icon},null,8,["name"]),W("span",{class:"ml-4 text",textContent:R.toDisplayString(h.name)},null,8,zD)])]),_:2},1032,["appearance","color-role","no-hover","to","class"])],8,BD))),128))]),_:1}),W("div",VD,[W("div",{textContent:R.toDisplayString(s.value)},null,8,UD),Q(f)])]),_:1},8,["title"])])):ie("",!0)}}}),qD=ge({name:"AppBar",components:{BatchActions:Km,ContextActions:Jm,ViewOptions:Xm,MobileNav:Ym},props:{viewModeDefault:{type:String,required:!1,default:()=>Et.defaultModeName},breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},viewModes:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasViewOptions:{type:Boolean,default:!0},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},batchActionsLoading:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=Ue(),{$gettext:r}=de.useGettext(),{can:s}=Lt(),o=Ae(),{requestExtensions:i}=br(),{isSticky:l}=ac(),u=Pt(),{isSideBarOpen:d}=ve.storeToRefs(u),c=Re(),{selectedResources:f}=ve.storeToRefs(c),p=T(()=>e.space),{actions:h}=Gi(),{actions:g}=Yi(),{actions:m}=Di(),{actions:b}=Cm(),{actions:S}=Qi(),{actions:k}=mo(),{actions:w}=Ki(),{actions:C}=ws(),{actions:A}=Ji(),{actions:I}=go(),{actions:N}=Sm(),{actions:_}=km(),{actions:F}=Am(),{actions:V}=Dm(),Z=H(0),P=vn(mt,"files-common-search"),$=T(()=>Object.hasOwn(Cu(),"navigation")&&s("create-all","Share")),L=T(()=>{let fe=[...a(g),...a(h),...a(S),...a(w),...a(C),...a(A),...a(m),...a(k),...a(I)];P.value||(fe=[...fe,...a(b),...a(F),...a(V),...a(N),...a(_)]);const we=i({id:"global.files.batch-actions",extensionType:"action"});return we.length&&(fe=[...fe,...we.map($e=>$e.action)]),fe.filter($e=>$e.isVisible({space:a(p),resources:c.selectedResources}))}),M=T(()=>n.spaces.filter(fe=>z.isPersonalSpaceResource(fe)||z.isProjectSpaceResource(fe))),j=Un("isMobileWidth"),B=vn(jt,"files-trash-generic"),q=T(()=>!a(j)&&e.breadcrumbs.length?!0:a(B)&&a(M).length===1?!1:e.breadcrumbs.length>1),re=T(()=>a(B)&&a(M).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),J=T(()=>a(p)&&(z.isProjectSpaceResource(a(p))||z.isShareSpaceResource(a(p)))?3:2),oe=fe=>{t(tf,fe)},ne=Zp("title"),pe=T(()=>a(ne)?r(a(ne)):a(p)?.name||"");return{router:o,hasSharesNavigation:$,batchActions:L,showBreadcrumb:q,showMobileNav:re,breadcrumbMaxWidth:Z,breadcrumbTruncationOffset:J,fileDroppedBreadcrumb:oe,pageTitle:pe,selectedResources:f,isSticky:l,isSideBarOpen:d}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return Rc(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||jt(this.router,"files-trash-generic"))},selectedResourcesAnnouncement(){return this.selectedResources.length===0?this.$gettext("No items selected."):this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedResources.length,{amount:this.selectedResources.length.toString()})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar),window.addEventListener("resize",this.onResize)},beforeUnmount(){this.resizeObserver.unobserve(this.$refs.filesAppBar),window.removeEventListener("resize",this.onResize)},methods:{onResize(){const e=document.getElementById("web-content-main")?.getBoundingClientRect().width||0,t=document.getElementById("web-nav-sidebar")?.getBoundingClientRect().width||0,n=document.getElementById("app-sidebar")?.getBoundingClientRect().width||0,r=document.getElementById("files-app-bar-controls-right")?.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),HD={class:"files-topbar py-2 w-full"},WD=["textContent"],QD={key:3,id:"files-app-bar-controls-right",class:"flex"},KD={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},GD={class:"flex-1 flex justify-start items-center"},JD={key:1};function XD(e,t,n,r,s,o){const i=te("oc-hidden-announcer"),l=te("context-actions"),u=te("oc-breadcrumb"),d=te("mobile-nav"),c=te("view-options"),f=te("batch-actions"),p=te("oc-spinner");return D(),K("div",{id:"files-app-bar",ref:"filesAppBar",class:R.normalizeClass(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20",{"files-app-bar-squashed":e.isSideBarOpen,sticky:e.isSticky}])},[W("div",HD,[W("h1",{class:"sr-only",textContent:R.toDisplayString(e.pageTitle)},null,8,WD),Q(i,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),W("div",{class:R.normalizeClass(["flex items-center files-app-bar-controls min-h-12",{"justify-between":e.breadcrumbs.length||e.hasSharesNavigation,"justify-end":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(D(),ee(u,{key:0,id:"files-breadcrumb","context-menu-padding":"small","show-context-actions":e.showContextActions,items:e.breadcrumbs,"max-width":e.breadcrumbMaxWidth,"truncation-offset":e.breadcrumbTruncationOffset,"mobile-breakpoint":e.isSideBarOpen?"md":"sm",onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:X(()=>[Q(l,{"action-options":{space:e.space,resources:e.breadcrumbsContextActionsItems.filter(Boolean)}},null,8,["action-options"])]),_:1},8,["show-context-actions","items","max-width","truncation-offset","mobile-breakpoint","onItemDroppedBreadcrumb"])):ie("",!0),e.showMobileNav?(D(),ee(d,{key:1})):ie("",!0),e.hasSharesNavigation?Se(e.$slots,"navigation",{key:2}):ie("",!0),e.hasViewOptions?(D(),K("div",QD,[Q(c,{"view-modes":e.viewModes,"has-hidden-files":e.hasHiddenFiles,"has-file-extensions":e.hasFileExtensions,"has-pagination":e.hasPagination,"per-page-storage-prefix":"files","view-mode-default":e.viewModeDefault},null,8,["view-modes","has-hidden-files","has-file-extensions","has-pagination","view-mode-default"])])):ie("",!0)],2),W("div",KD,[W("div",GD,[Se(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(D(),ee(f,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):e.showBatchActions&&e.batchActionsLoading?(D(),K("div",JD,[Q(p,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):ie("",!0)])]),Se(e.$slots,"content")])],2)}const YD=Le(qD,[["render",XD]]),ZD={class:"oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1 [&_.parent-folder]:text-role-on-chrome"},eF={class:"pl-4 pr-1 my-2 mx-auto sm:m-0 inline-flex items-center justify-between bg-role-chrome border border-role-on-chrome rounded-lg h-10 gap-4 w-full sm:w-fit"},tF={class:"open-file-bar flex"},nF={class:"flex"},rF={key:1,class:"flex items-center","data-testid":"autosave-indicator"},Zm=ge({__name:"AppTopBar",props:{dropDownMenuSections:{default:()=>[]},dropDownActionOptions:{default:()=>({space:null,resources:[]})},mainActions:{default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{default:null},isReadOnly:{type:Boolean,default:!0}},emits:["close"],setup(e){const{$gettext:t,current:n}=de.useGettext(),r=Re(),s=Qe(),{getMatchingSpace:o}=Rt(),{getParentFolderName:i,getPathPrefix:l,getParentFolderLinkIconAdditionalAttributes:u}=Tr(),d=T(()=>r.areFileExtensionsShown),c=T(()=>t("Show context menu")),f=T(()=>e.isEditor&&e.hasAutoSave&&s.options.editor.autosaveEnabled),p=T(()=>{const m=ht.Duration.fromObject({seconds:s.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:m.toHuman()})}),h=T(()=>o(e.resource)),g=T(()=>!z.isPublicSpaceResource(a(h)));return(m,b)=>{const S=te("oc-icon"),k=te("oc-button"),w=te("oc-drop"),C=Bt("oc-tooltip");return D(),K("div",ZD,[W("div",eF,[W("div",tF,[e.resource?(D(),ee(ho,{key:0,id:"app-top-bar-resource",class:"[&_.oc-resource-name]:max-w-60 xs:[&_.oc-resource-name]:max-w-full sm:[&_.oc-resource-name]:max-w-20 md:[&_.oc-resource-name]:max-w-60 [&_svg]:!fill-role-on-chrome [&_span]:text-role-on-chrome","is-thumbnail-displayed":!1,"is-extension-displayed":d.value,"path-prefix":a(l)(e.resource),resource:e.resource,"parent-folder-name":a(i)(e.resource),"parent-folder-link-icon-additional-attributes":a(u)(e.resource),"is-path-displayed":g.value,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):ie("",!0)]),W("div",nF,[e.dropDownMenuSections.length?(D(),K(ke,{key:0},[je((D(),ee(k,{id:"oc-openfile-contextmenu-trigger","aria-label":c.value,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:X(()=>[Q(S,{name:"more-2"})]),_:1},8,["aria-label"])),[[C,c.value]]),Q(w,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:b[0]||(b[0]=kt(()=>{},["stop","prevent"]))},{default:X(()=>[Q(ta,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):ie("",!0),f.value&&!e.isReadOnly?(D(),K("span",rF,[je(Q(S,{"accessible-label":p.value,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[C,p.value]])])):ie("",!0),e.mainActions.length&&e.resource?(D(),ee(ta,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(A=>A.isVisible()).map(A=>({...A,class:"p-1 text-role-on-chrome [&_svg]:!fill-role-on-chrome [&:hover:not(:disabled)_svg]:!fill-role-chrome",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):ie("",!0),Q(k,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":a(t)("Close"),onClick:b[1]||(b[1]=A=>m.$emit("close"))},{default:X(()=>[Q(S,{name:"close"})]),_:1},8,["aria-label"])])])])}}}),sF=ge({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),oF={class:"text-center flex justify-center items-center h-full"},iF={key:0,class:"text-xl"};function aF(e,t,n,r,s,o){const i=te("oc-icon");return D(),K("div",oF,[Q(i,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(D(),K("p",iF,R.toDisplayString(e.message),1)):ie("",!0)])}const lF=Le(sF,[["render",aF]]),cF=ge({name:"LoadingScreen"}),uF={class:"text-center flex justify-center items-center h-full"},dF=["textContent"];function fF(e,t,n,r,s,o){const i=te("oc-spinner");return D(),K("div",uF,[Q(i,{size:"xlarge"}),W("p",{class:"sr-only",textContent:R.toDisplayString(e.$gettext("Loading app"))},null,8,dF)])}const pF=Le(cF,[["render",fF]]),hF=["id","data-testid","tabindex","inert"],mF={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},gF={class:"col-start-2 text-center my-0 text-lg"},yF={key:0,class:"mt-4"},eg=Le(ge({__name:"SideBarPanels",props:{loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close","closePanel"],setup(e,{emit:t}){const n=t,{$gettext:r}=de.useGettext(),s=T(()=>e.availablePanels.filter(w=>w.isVisible(e.panelContext)&&w.isRoot?.(e.panelContext))),o=T(()=>e.availablePanels.filter(w=>w.isVisible(e.panelContext)&&!w.isRoot?.(e.panelContext))),i=T(()=>a(s).length?[a(s)[0],...a(o)]:a(o)),l=T(()=>{const w=e.activePanel?.split("#")[0];return!w||!a(o).map(C=>C.name).includes(w)?null:w}),u=T(()=>a(l)!==null),d=T(()=>a(l)===null),c=H(null),f=w=>{c.value=w},p=T(()=>a(u)?a(l):a(s)[0].name),h=T(()=>a(s).length===1?r("Back to %{panel} panel",{panel:a(s)[0].title(e.panelContext)}):r("Back to main panels")),g=w=>{n("selectPanel",w)},m=()=>{n("selectPanel",null)},b=()=>{n("close")},S=w=>{f(a(p)),g(w)},k=()=>{f(a(p)),m(),n("closePanel")};return(w,C)=>{const A=te("oc-spinner"),I=te("oc-icon"),N=te("oc-button"),_=Bt("oc-tooltip");return e.loading?(D(),ee(A,{key:0,"aria-label":a(r)("Loading sidebar content")},null,8,["aria-label"])):(D(!0),K(ke,{key:1},Ge(i.value,F=>(D(),K("div",{id:`sidebar-panel-${F.name}`,key:`panel-${F.name}`,"data-testid":`sidebar-panel-${F.name}`,tabindex:p.value===F.name?-1:null,class:R.normalizeClass(["sidebar-panel absolute top-0 grid grid-rows-[auto_auto_1fr] bg-role-surface w-full size-full max-w-full max-h-full motion-reduce:transition-none",{"is-root-panel transition-[right] duration-[0.4s,0s]":F.isRoot?.(e.panelContext),"is-active-sub-panel":u.value&&l.value===F.name,"is-active-root-panel transition-[right] duration-[0.4s,0s]":d.value&&F.isRoot?.(e.panelContext)}]),inert:p.value!==F.name},[[p.value,c.value].includes(F.name)?(D(),K("div",mF,[F.isRoot?.(e.panelContext)?ie("",!0):je((D(),ee(N,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":h.value,onClick:k},{default:X(()=>[Q(I,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[_,h.value]]),W("h2",gF,R.toDisplayString(F.title(e.panelContext)),1),Q(N,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":a(r)("Close file sidebar"),onClick:b},{default:X(()=>[Q(I,{name:"close"})]),_:1},8,["aria-label"])])):ie("",!0),W("div",null,[F.isRoot?.(e.panelContext)?Se(w.$slots,"rootHeader",{key:0},void 0,!0):Se(w.$slots,"subHeader",{key:1},void 0,!0)]),W("div",{class:R.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${F.name}`]])},[W("div",{class:R.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!F.isRoot?.(e.panelContext)}])},[Se(w.$slots,"body",{},()=>[(D(!0),K(ke,null,Ge(F.isRoot?.(e.panelContext)?s.value:[F],(V,Z)=>(D(),K("div",{key:`sidebar-panel-${V.name}`},[(d.value?V.isRoot?.(e.panelContext):[p.value,c.value].includes(V.name))?(D(),ee(Yt(V.component),at({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":Z>0},"rounded-sm"]},{ref_for:!0},V.componentAttrs?.(e.panelContext)||{}),null,16,["class"])):ie("",!0)]))),128))],!0)],2),F.isRoot?.(e.panelContext)&&o.value.length>0?(D(),K("div",yF,[(D(!0),K(ke,null,Ge(o.value,V=>(D(),ee(N,{id:`sidebar-panel-${V.name}-select`,key:`panel-select-${V.name}`,"data-testid":`sidebar-panel-${V.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:Z=>S(V.name)},{default:X(()=>[Q(I,{name:V.icon,"fill-type":V.iconFillType},null,8,["name","fill-type"]),it(" "+R.toDisplayString(V.title(e.panelContext))+" ",1),Q(I,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):ie("",!0)],2)],10,hF))),128))}}}),[["__scopeId","data-v-839c4e7a"]]),tg=ge({inheritAttrs:!1,__name:"SideBar",props:{loading:{type:Boolean},availablePanels:{},panelContext:{}},emits:["selectPanel","close"],setup(e,{emit:t}){const n=t,r=qo(),{isMobile:s}=to(),o=Pt(),{focusSidebar:i}=o,{sideBarActivePanel:l}=ve.storeToRefs(o),u=T(()=>{if(a(s))return{...a(r),isFocusTrapActive:!e.loading,hasFullHeight:!0,maxHeight:"max-h-[80vh]",class:"z-100",onClicked:d};const p=["border-l","focus:outline-0","focus-visible:outline-0","w-[360px]","min-w-[360px]","overflow-hidden","relative","focus:shadow-none","focus-visible:shadow-none",...a(r)?.class?[a(r).class]:[]];return e.loading&&p.push("flex","justify-center","items-center"),{...a(r),class:p}}),d=p=>{if(!p.target)return;const h=p.target===p.currentTarget,g=p.target instanceof HTMLAnchorElement,m=p.target.closest("ul.sidebar-actions-panel");(h||g||m)&&c()},c=()=>{o.closeSideBar(),n("close")},f=p=>{o.openSideBarPanel(p),n("selectPanel",p)};return zo(()=>{a(s)&&c()}),(p,h)=>(D(),ee(Ps,{to:"#mobile-right-sidebar",disabled:!a(s)},[(D(),ee(Yt(a(s)?"oc-bottom-drawer":"div"),at({id:"app-sidebar",tabindex:"-1"},u.value),{default:X(()=>[Q(eg,{loading:e.loading,"available-panels":e.availablePanels,"panel-context":e.panelContext,"active-panel":a(l),onSelectPanel:f,onClose:c,onClosePanel:a(i)},{body:X(()=>[Se(p.$slots,"body")]),rootHeader:X(()=>[Se(p.$slots,"rootHeader")]),subHeader:X(()=>[Se(p.$slots,"subHeader")]),_:3},8,["loading","available-panels","panel-context","active-panel","onClosePanel"])]),_:3},16))],8,["disabled"]))}}),vF={class:"grid items-center p-2"},bF={class:"flex items-center text-sm"},wF=["textContent"],SF=["textContent"],hc=ge({__name:"SpaceInfo",setup(e){const t=Un("resource");return(n,r)=>{const s=te("oc-icon");return D(),K("div",vF,[W("div",bF,[Q(s,{name:"layout-grid",size:a(t).description?"large":"medium",class:"block mr-2"},null,8,["size"]),W("div",null,[W("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base break-all",textContent:R.toDisplayString(a(t).name)},null,8,wF),W("span",{"data-testid":"space-info-subtitle",textContent:R.toDisplayString(a(t).description)},null,8,SF)])])])}}}),kF={class:"flex justify-between p-2"},CF={class:"flex items-center"},TF={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},mc=ge({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=Re(),{isPersonalSpaceRoot:n}=Rt(),r=Un("resource"),s=Un("space"),o=T(()=>t.areFileExtensionsShown),i=T(()=>n(a(r))?a(s).name:a(r).name);return(l,u)=>(D(),K("div",kF,[W("div",CF,[e.isSubPanelActive?(D(),ee(po,{key:0,resource:a(r),size:"large",class:"mr-2 relative"},null,8,["resource"])):ie("",!0),W("div",null,[W("h3",TF,[Q(ec,{name:i.value,extension:a(r).extension,type:a(r).type,"full-path":a(r).webDavPath,"is-extension-displayed":o.value,"is-path-displayed":!1,"truncate-name":!1,class:"[&_span]:break-all"},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])]))}}),ng=ge({__name:"FileSideBar",props:{space:{default:()=>{}}},setup(e){const t=Ae(),n=Ee(),r=br(),s=Ue(),o=Jn(),i=Qe(),l=Pn(),{canListShares:u}=gm(),{canListVersions:d}=Mm(),c=Re(),{currentFolder:f}=ve.storeToRefs(c),p=Pt(),{isSideBarOpen:h,sideBarActivePanel:g}=ve.storeToRefs(p),m=H(),b=H([]),S=H([]),k=H([]),{selectedResources:w}=dc(),C=H(!1),A=T(()=>a(C)),I=T(()=>a(w).length===0?{root:e.space,parent:null,items:a(f)?.id?[a(f)]:[]}:{root:e.space,parent:a(f),items:a(w)}),N=vn(pt,"files-shares-with-me"),_=vn(pt,"files-shares-with-others"),F=vn(pt,"files-shares-via-link"),V=rt(t,"files-spaces-projects"),Z=vn(mt,"files-common-favorites"),P=vn(mt,"files-common-search"),$=T(()=>a(I).items?.length===1&&!z.isProjectSpaceResource(a(I).items[0])),L=T(()=>a(I).items?.length===1&&z.isProjectSpaceResource(a(I).items[0])),M=T(()=>a(N)||a(_)||a(F)),j=T(()=>a(M)||a(P)||a(Z)),B=T(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(ne=>ne.panel)),q=Ft.useTask(function*(ne,pe){b.value=yield n.webdav.listFileVersions(pe.id,{signal:ne})}),re=Ft.useTask(function*(ne,pe){o.setLoading(!0),o.removeOrphanedShares();const{collaboratorShares:fe,linkShares:we}=o,$e=n.graphAuthenticated.permissions;let he=e.space?.id;if(z.isShareSpaceResource(e.space)){const Ve=yield s.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:ne});Ve&&(he=Ve.root.remoteItem.rootId)}const{shares:ae,allowedRoles:ue}=yield*z.call($e.listPermissions(he,pe.fileId,o.graphRoles,{},{signal:ne})),be=ae.filter(z.isCollaboratorShare),me=ae.filter(z.isLinkShare),De=Object.values(o.graphRoles);if(S.value=ue?.map(Ve=>({...Ve,icon:De.find(ye=>ye.id===Ve.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Ve}=yield*z.call($e.listPermissions(he,pe.fileId,o.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[Gp.LibreGraphPermissionsRolesAllowedValues]},{signal:ne}));k.value=Ve?.map(ye=>({...ye,icon:De.find(Fe=>Fe.id===ye.id)?.icon}))||[]}!a(j)&&!a(V)&&(fe.forEach(Ve=>{be.some(ye=>ye.id===Ve.id)||be.push({...Ve,indirect:!0})}),we.forEach(Ve=>{me.some(ye=>ye.id===Ve.id)||me.push({...Ve,indirect:!0})})),mt(t,"files-common-search")&&(yield c.loadAncestorMetaData({folder:a(pe),space:e.space,client:n.webdav,signal:ne}));const ut=[...fe,...we].map(({resourceId:Ve})=>Ve),Kt=Object.values(c.ancestorMetaData).filter(({id:Ve,path:ye})=>Ve===pe.id||ut.includes(Ve)||z.isIncomingShareResource(pe)?!1:z.isPersonalSpaceResource(e.space)?ye!=="/":!0).map(({id:Ve})=>Ve);a(j)&&z.isProjectSpaceResource(e.space)&&!z.isProjectSpaceResource(pe)&&Kt.push(e.space.id);const vt=new sr({concurrency:i.options.concurrentRequests.shares.list}),Dt=[...new Set(Kt)].map(Ve=>vt.add(()=>n.graphAuthenticated.permissions.listPermissions(he,Ve,o.graphRoles,{},{signal:ne}).then(ye=>{const Fe=ye.shares.map(gt=>({...gt,indirect:!0}));be.push(...Fe.filter(z.isCollaboratorShare)),me.push(...Fe.filter(z.isLinkShare))})));yield Promise.allSettled(Dt),o.setCollaboratorShares(be),o.setLinkShares(me),o.setLoading(!1)}).restartable(),J=H();ze(()=>[...a(I).items,h],async(ne,pe)=>{if(a(I).items?.length!==1)return;if(!a(h)){J.value=void 0,b.value=[];return}const fe=ne?.[0],we=pe?.[0];if(fe?.id===we?.id&&fe?.mdate===a(J))return;const $e=a(I).items[0];if(J.value=$e.mdate,q.isRunning&&q.cancelAll(),!!d({space:e.space,resource:$e}))try{await q.perform($e)}catch(he){console.error(he)}},{immediate:!0,deep:!0});const oe=T(()=>a(I).items.map(ne=>ne.id));return ze(()=>[oe,h],async()=>{if(!a(h)||!a(I).items?.length){o.pruneShares(),m.value=null;return}if(a(I).items?.length!==1)return;const ne=a(I).items[0];if(C.value=!0,z.isProjectSpaceResource(ne)&&await s.loadGraphPermissions({ids:[ne.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:ne}))try{re.isRunning&&re.cancelAll(),re.perform(ne)}catch(pe){console.error(pe)}if(!z.isOutgoingShareResource(ne)&&!z.isIncomingShareResource(ne)){m.value=ne,C.value=!1;return}try{const pe=await n.webdav.getFileInfo(e.space,{path:ne.path}),fe={...pe,...ne,tags:pe.tags};m.value=fe}catch(pe){m.value=ne,console.error(pe)}C.value=!1},{deep:!0,immediate:!0}),ns("resource",ar(m)),ns("versions",ar(b)),ns("space",T(()=>e.space)),ns("availableInternalShareRoles",ar(S)),ns("availableExternalShareRoles",ar(k)),ns("versionsLoading",T(()=>q.isRunning)),(ne,pe)=>a(h)?(D(),ee(tg,at({key:0,ref:"sidebar",class:"files-side-bar z-30","available-panels":B.value,"panel-context":I.value,loading:A.value},ne.$attrs,{"data-custom-key-bindings-disabled":"true"}),{rootHeader:X(()=>[$.value?(D(),ee(mc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):L.value?(D(),ee(hc,{key:1})):ie("",!0)]),subHeader:X(()=>[$.value?(D(),ee(mc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):L.value?(D(),ee(hc,{key:1})):ie("",!0)]),_:1},16,["available-panels","panel-context","loading"])):ie("",!0)}}),xF=ge({name:"DatePickerModal",props:{modal:{type:Object,required:!0},currentDate:{type:Object,required:!1,default:null},minDate:{type:Object,required:!1,default:null},isClearable:{type:Boolean,default:!0}},emits:["confirm","cancel"],setup(){const e=On(),{currentTheme:t}=ve.storeToRefs(e),n=H(),r=H(!0);return{confirmDisabled:r,onDateChanged:({date:o,error:i})=>{r.value=i||!o,n.value=o},currentTheme:t,dateTime:n}}}),AF={class:"flex justify-end items-center mt-2"};function RF(e,t,n,r,s,o){const i=te("oc-datepicker"),l=te("oc-button");return D(),K(ke,null,[Q(i,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"is-dark":e.currentTheme.isDark,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","is-dark","onDateChanged"]),W("div",AF,[Q(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=u=>e.$emit("cancel"))},{default:X(()=>[it(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),Q(l,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=u=>e.$emit("confirm",e.dateTime))},{default:X(()=>[it(R.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const EF=Le(xF,[["render",RF]]),DF=ge({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=Ke();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),FF=["textContent"],IF={class:"flex justify-end items-center mt-4"},PF={class:"oc-modal-body-actions-grid"};function $F(e,t,n,r,s,o){const i=te("oc-button");return D(),K(ke,null,[W("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,FF),t[2]||(t[2]=W("div",{class:"my-4"},null,-1)),W("div",IF,[W("div",PF,[Q(i,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:X(()=>[it(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),Q(i,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:X(()=>[it(R.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),Q(i,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:X(()=>[it(R.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const rg=Le(DF,[["render",$F]]);var OF=/\s/;function LF(e){for(var t=e.length;t--&&OF.test(e.charAt(t)););return t}var _F=/^\s+/;function MF(e){return e&&e.slice(0,LF(e)+1).replace(_F,"")}var sg=NaN,NF=/^[-+]0x[0-9a-f]+$/i,BF=/^0b[01]+$/i,jF=/^0o[0-7]+$/i,zF=parseInt;function VF(e){if(typeof e=="number")return e;if(hi(e))return sg;if(En(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=En(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=MF(e);var n=BF.test(e);return n||jF.test(e)?zF(e.slice(2),n?2:8):NF.test(e)?sg:+e}const UF=["id"],qF=["textContent"],HF={key:2,class:"flex size-full"},gc="app.app-wrapper.app-top-bar",og=ge({__name:"AppWrapper",props:{applicationId:{},urlForResourceOptions:{default:null},fileContentOptions:{default:null},wrappedComponent:{default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=de.useGettext(),r=Pn(),{showMessage:s,showErrorMessage:o}=Me(),i=Kr.useRouter(),l=yt(),u=Ee(),d=Nt(),{getResourceContext:c}=Nm(),{selectedResources:f}=dc(),{dispatchModal:p}=Ke(),h=Ue(),g=Qe(),m=Re(),b=Jn(),S=Sr(),{isMobile:k}=to(),w=Pt(),{isSideBarOpen:C}=ve.storeToRefs(w),{actions:A}=um({appId:e.applicationId}),{actions:I}=jl(),{actions:N}=ws(),{actions:_}=oc(),{actions:F}=ic(),{actions:V}=mo(),Z=T(()=>!!e.wrappedComponent.emits?.includes("update:resource")),P=H(),$=H(),L=H(""),M=H(""),j=H(!a(Z)),B=H(),q=H(!1),re=H(),J=H();let oe="",ne=null;const{registerExtensions:pe,unregisterExtensions:fe}=br(),we=T(()=>a(j)||a(B)||!a(P)?[]:[{id:gc,type:"customComponent",extensionPointIds:["app.runtime.header.left"],content:Zm,componentProps:()=>({resource:a(P),isReadOnly:a(q),isEditor:a(he),hasAutoSave:!e.disableAutoSave,mainActions:a(F$),dropDownMenuSections:a(D$),dropDownActionOptions:a(xe),onClose:()=>{De(),fe([gc])}})}]);pe(we);const{actions:$e}=pm({content:J}),he=T(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),ae=Ce=>!!Object.keys(e.wrappedComponent.props).includes(Ce),ue=T(()=>a(J)!==a(re)),be=Ce=>{Ce.preventDefault()};ze(ue,Ce=>{Ce?window.addEventListener("beforeunload",be):window.removeEventListener("beforeunload",be)});const{applicationConfig:me,closeApp:De,currentFileContext:_e,getFileContents:ut,getFileInfo:Kt,getUrlForResource:vt,putFileContents:Dt,replaceInvalidFileRoute:Ve,revokeUrl:ye,activeFiles:Fe,loadFolderForFileContext:gt,isFolderLoading:Qr}=lh({applicationId:e.applicationId}),{applicationMeta:xr}=Nl({applicationId:e.applicationId,appsStore:r}),kn=T(()=>a(xr).meta?.fileSizeLimit),bt=T(()=>{const{name:Ce}=a(xr);return t("%{appName} for %{fileName}",{appName:t(Ce),fileName:a(a(_e).fileName)})}),ln=Ti("driveAliasAndItem"),vo=At("fileId"),cn=T(()=>ot(a(vo))),bo=async()=>{const Ce=a(cn),{space:Oe,path:lt}=await c(Ce),Mn=Oe.getDriveAliasAndItem({path:lt});return z.isPersonalSpaceResource(Oe)?i.push({params:{...a(l).params,driveAliasAndItem:Mn},query:{...a(l).query,fileId:Ce,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:We.dirname(Mn)}}}):i.push({params:{...a(l).params,driveAliasAndItem:Mn},query:{...a(l).query,fileId:Ce,contextRouteName:lt==="/"?"files-shares-with-me":"files-spaces-generic",...z.isShareSpaceResource(Oe)&&{shareId:Oe.id},contextRouteParams:{driveAliasAndItem:We.dirname(Mn)},contextRouteQuery:{...z.isShareSpaceResource(Oe)&&{shareId:Oe.id}}}})},E=Ft.useTask(function*(Ce){try{a(ln)||(yield bo()),$.value=a(a(_e).space);const Oe=yield Kt(a(_e),{signal:Ce});if(P.value=Oe,z.isShareSpaceResource(a($))&&(a(P).remoteItemId=a($).id,a(P).id===a(P).remoteItemId)){const lt=yield*z.call(li({graphClient:u.graphAuthenticated,spacesStore:h,space:a($)}));lt&&(P.value={...Oe,...z.buildIncomingShareResource({graphRoles:b.graphRoles,driveItem:lt,serverUrl:g.serverUrl}),tags:Oe.tags})}m.initResourceList({currentFolder:null,resources:[a(P)]}),f.value=[a(P)]}catch(Oe){console.error(Oe),B.value=Oe,j.value=!1}}).restartable(),y=Ft.useTask(function*(Ce){try{const Oe=e.importResourceWithExtension(a(P));if(Oe){const lt=ht.DateTime.local().toFormat("yyyyMMddHHmmss"),Mn=`${a(P).name}_${lt}.${Oe}`;if(!(yield u.webdav.copyFiles(a($),a(P),a($),{path:Mn},{signal:Ce})))throw new Error(t("Importing failed"));P.value={path:Mn}}if(Ve(_e,a(P)))return;if(q.value=![uf.Updateable,uf.FileUpdateable].some(lt=>(a(P).permissions||"").indexOf(lt)>-1),a(ae("currentContent"))){const lt=yield*z.call(ut(_e,{...e.fileContentOptions,signal:Ce}));re.value=J.value=lt.body,L.value=lt.headers["OC-ETag"]}a(ae("url"))&&(M.value=yield vt(a($),a(P),{...e.urlForResourceOptions,signal:Ce}))}catch(Oe){console.error(Oe),B.value=Oe}finally{j.value=!1}}).restartable();ze(_e,async()=>{a(Z)?$.value=a(a(_e).space):(await E.perform(),a(kn)&&VF(a(P).size)>a(kn)?p({title:t("File exceeds %{threshold}",{threshold:zt(a(kn),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:a(P).name,threshold:zt(a(kn),n)}),confirmText:t("Continue"),onCancel:()=>{De()},onConfirm:()=>{y.perform()}}):y.perform())},{immediate:!0});const v=Ce=>{console.error(Ce),o({title:t("An error occurred"),desc:Ce.message,errors:[Ce]})},O=()=>{s({title:t("File autosaved")})},U=Ft.useTask(function*(){const Ce=a(J);try{const Oe=yield Dt(_e,{content:Ce,previousEntityTag:a(L)});re.value=Ce,L.value=Oe.etag,m.upsertResource(Oe)}catch(Oe){switch(Oe.statusCode){case 401:case 403:v(new z.HttpError(t("You're not authorized to save this file"),Oe.response));break;case 409:case 412:v(new z.HttpError(t("This file was updated outside this window. Please copy your changes or save the file under a new name (»Save As...«)."),Oe.response));break;case 507:const lt=h.spaces.find(Mn=>Mn.id===a(P).storageId&&z.isProjectSpaceResource(Mn));if(lt){v(new z.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:lt.name}),Oe.response));break}v(new z.HttpError(t("Insufficient quota for saving this file"),Oe.response));break;default:v(new z.HttpError("",Oe.response))}}}).drop(),Y=async()=>{await U.perform()};let se=null;ft(()=>{if(oe=S.subscribe("runtime.resource.deleted",Be),m.ancestorMetaData?.["/"]&&a($)&&m.ancestorMetaData["/"].spaceId!==a($).id&&m.setAncestorMetaData({}),!a(he))return;const Ce=g.options.editor;Ce.autosaveEnabled&&!e.disableAutoSave&&(se=setInterval(async()=>{ue.value&&(await Y(),O())},(Ce.autosaveInterval||120)*1e3))}),Xt(()=>{S.unsubscribe("runtime.resource.deleted",oe),fe([gc]),d.isLoading||window.removeEventListener("beforeunload",be),a(ae("url"))&&ye(M.value),a(he)&&(clearInterval(se),se=null)});const{bindKeyAction:Ie}=Ii({skipDisabledKeyBindingsCheck:!0});Ie({modifier:Fi.Ctrl,primary:Ln.S},()=>{a(ue)&&Y()});const le=T(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>a(he)&&!a(q),isDisabled:()=>!a(ue),icon:"save",id:"app-save-action",label:()=>t("Save"),handler:Y}]),xe=T(()=>({space:a($),resources:[a(P)]})),qe=async(Ce,Oe)=>{a(ue)&&(await Y(),O()),Oe(Ce)},Be=Ce=>{if(Ce.find(lt=>lt.id===a(P).id)){if(ne)return ne();De()}},fg=T(()=>[...a(A),...a(le),...a($e).map(Ce=>({...Ce,isVisible:Oe=>he.value&&Ce.isVisible(Oe)}))].filter(Ce=>Ce.isVisible(a(xe)))),pg=T(()=>[...a(F),...a(I)].filter(Ce=>Ce.isVisible(a(xe)))),hg=T(()=>[...a(N).map(Ce=>({...Ce,handler:Oe=>qe(Oe,Ce.handler)})),...a(V)].filter(Ce=>Ce.isVisible(a(xe)))),mg=T(()=>[...a(_)].filter(Ce=>Ce.isVisible(a(xe)))),D$=T(()=>{const Ce=[];return a(fg).length&&Ce.push({name:"context",items:a(fg)}),a(pg).length&&Ce.push({name:"share",items:a(pg)}),a(hg).length&&Ce.push({name:"actions",items:a(hg)}),a(mg).length&&Ce.push({name:"sidebar",items:a(mg)}),Ce}),F$=T(()=>[...a(le)]);Kr.onBeforeRouteLeave((Ce,Oe,lt)=>{a(ue)?p({title:t("Unsaved changes"),customComponent:rg,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{lt()}}),async onConfirm(){await Y(),lt()}}):lt()});const I$=T(()=>({url:a(M),space:a(a(_e).space),resource:a(P),activeFiles:a(Fe),isDirty:a(ue),isReadOnly:a(q),applicationConfig:a(me),currentFileContext:a(_e),currentContent:a(J),isFolderLoading:a(Qr),"onUpdate:resource":Ce=>{$.value=a(a(_e).space),P.value={...Ce,...z.isShareSpaceResource(a($))&&{remoteItemId:a($).id}},f.value=[a(P)]},"onUpdate:currentContent":Ce=>{J.value=Ce},"onRegister:onDeleteResourceCallback":Ce=>{ne=Ce},"onDelete:resource":()=>{a(V)[0].isVisible({space:a($),resources:[a(P)]})&&a(V)[0].handler({space:a($),resources:[a(P)]})},onSave:Y,onClose:De,loadFolderForFileContext:gt,revokeUrl:ye,getUrlForResource:vt}));return(Ce,Oe)=>(D(),K("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:Oe[0]||(Oe[0]=Ns((...lt)=>a(De)&&a(De)(...lt),["esc"]))},[W("h1",{class:"sr-only",textContent:R.toDisplayString(bt.value)},null,8,qF),j.value?(D(),ee(pF,{key:0})):B.value?(D(),ee(lF,{key:1,message:B.value.message},null,8,["message"])):(D(),K("div",HF,[Se(Ce.$slots,"default",at({class:["app-wrapper-content size-full",{"w-[calc(100%-360px)]":a(C)&&!a(k)}]},I$.value)),Q(ng,{space:$.value},null,8,["space"])]))],40,UF))}});function WF(e,t){return ge({render(){return Xo(og,{wrappedComponent:e,...t},{default:n=>Xo(e,n)})}})}const yc=ge({__name:"ContextMenuQuickAction",props:{item:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},title:{default:""}},emits:["quickActionClicked"],setup(e,{expose:t}){const{$gettext:n}=de.useGettext(),r=qt("drop");t({drop:r});const s=T(()=>n("Show context menu"));return(o,i)=>{const l=te("oc-icon"),u=te("oc-button"),d=Bt("oc-tooltip");return D(),K(ke,null,[je((D(),ee(u,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"data-test-context-menu-resource-name":e.item.name,"aria-label":s.value,appearance:"raw",class:R.normalizeClass(["quick-action-button ml-1 p-1",o.$attrs.class]),onClick:i[0]||(i[0]=c=>o.$emit("quickActionClicked",c))},{default:X(()=>[Q(l,{name:"more-2"})]),_:1},8,["id","data-test-context-menu-resource-name","aria-label","class"])),[[d,s.value]]),Q(a(Hh),{ref_key:"drop",ref:r,"drop-id":`context-menu-drop-${e.resourceDomSelector(e.item)}`,toggle:`#context-menu-trigger-${e.resourceDomSelector(e.item)}`,title:e.title,position:"left-start",mode:"manual","padding-size":"small","close-on-click":""},{default:X(()=>[Se(o.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle","title"])],64)}}}),QF=ge({name:"ResourceGhostElement",components:{ResourceIcon:po},props:{previewItems:{type:Array,required:!0}},computed:{layerCount(){return Math.min(this.previewItems.length,3)},showSecondLayer(){return this.layerCount>1},showThirdLayer(){return this.layerCount>2},itemCount(){return this.previewItems.length}}}),KF={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},GF={class:"relative rounded-sm bg-role-surface-container-high"},JF={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},XF={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},YF={class:"badge absolute top-[-2px] right-[-8px] p-1 text-sm text-center leading-2 bg-red-600 text-white rounded-4xl box-content min-w-2 h-2"};function ZF(e,t,n,r,s,o){const i=te("resource-icon");return D(),K("div",KF,[W("div",GF,[Q(i,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(D(),K("div",JF)):ie("",!0),e.showThirdLayer?(D(),K("div",XF)):ie("",!0)]),W("span",YF,R.toDisplayString(e.itemCount),1)])}const vc=Le(QF,[["render",ZF]]),eI=ge({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=de.useGettext();return{formattedSize:T(()=>zt(e.size,t))}}}),tI=["textContent"];function nI(e,t,n,r,s,o){return D(),K("span",{textContent:R.toDisplayString(e.formattedSize)},null,8,tI)}const ig=Le(eI,[["render",nI]]),ag=ge({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=qo(),{getIndicators:n}=zm(),r=T(()=>{const s=n({space:e.space,resource:e.resource});return e.filter?s.filter(e.filter):s});return(s,o)=>r.value.length>0?(D(),ee(a(QA),at({key:0},a(t),{indicators:r.value,resource:e.resource}),null,16,["indicators","resource"])):ie("",!0)}}),na=ge({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=ai(),{avatarMap:n}=ve.storeToRefs(t),{enqueueAvatar:r}=Qm(),s=T(()=>a(n)[e.userId]);return ft(()=>{r(e.userId)}),(o,i)=>{const l=te("oc-avatar");return D(),ee(l,{"user-name":e.userName,src:s.value,width:36},null,8,["user-name","src"])}}}),rI={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-view-box]:!rounded-[50%]","[&_.cropper-crop-box]:!rounded-[50%]","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},sI={class:"flex flex-col items-center"},oI={class:"oc-button-group"},iI={key:0},aI=["src"],lI={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},cI=["textContent"],uI=ge({__name:"AvatarUpload",setup(e){const t=Ze(),n=ai(),{avatarMap:r}=ve.storeToRefs(n),{user:s}=ve.storeToRefs(t),{$gettext:o}=de.useGettext(),{showErrorMessage:i,showMessage:l}=Me(),{graphAuthenticated:u}=Ee(),{setCropperInstance:d}=Bl(),c=H(null),f=H(null),p=H(null),h=H(!1),g=H(!1),m=H(!1),b=H(null),S=Yl*1024*1024,k=T(()=>!!a(r)[a(s).id]),w=Z=>{const $=Z.target.files?.[0];if($){if($.size>S){i({title:o("File size exceeds the limit of %{size}MB",{size:Yl.toString()})});return}c.value=URL.createObjectURL($),g.value=!0}};ze(c,async Z=>{Z&&(await St(),p.value&&p.value.destroy(),f.value&&(p.value=new ra(f.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){h.value=!0}}),d(p)))});const C=()=>p.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),A=async Z=>await new Promise(P=>{Z.toBlob($=>P($),"image/png")}),I=()=>{b.value?.click()},N=()=>{g.value=!1,V()},_=async()=>{const Z=C(),P=await A(Z),$=URL.createObjectURL(P),L=new File([P],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await u.photos.updateOwnUserPhotoPatch(L),n.addAvatar(a(s).id,$),l({title:o("Profile picture was set successfully")})}catch(M){i({title:o("Failed to set profile picture"),errors:[M]})}g.value=!1,V()},F=async()=>{try{await u.photos.deleteOwnUserPhoto(),n.removeAvatar(a(s).id),l({title:o("Profile picture was removed successfully")})}catch(Z){i({title:o("Failed to remove profile picture"),errors:[Z]})}m.value=!1},V=()=>{p.value?.destroy(),p.value=null,b.value&&(b.value.value=""),c.value=null};return(Z,P)=>{const $=te("oc-button"),L=te("oc-icon"),M=te("oc-modal");return D(),K("div",rI,[W("input",{ref_key:"fileInputRef",ref:b,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:w},null,544),W("div",sI,[Q(na,{class:"mb-4",width:128,"user-id":a(s).id,"user-name":a(s).displayName},null,8,["user-id","user-name"]),W("div",null,[W("div",oI,[Q($,{size:"small",onClick:I},{default:X(()=>[it(R.toDisplayString(a(o)("Upload")),1)]),_:1}),k.value?(D(),ee($,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:P[0]||(P[0]=j=>m.value=!0)},{default:X(()=>[it(R.toDisplayString(a(o)("Remove")),1)]),_:1})):ie("",!0)])])]),g.value?(D(),ee(M,{key:0,title:a(o)("Crop your new profile picture"),"button-cancel-text":a(o)("Cancel"),"button-confirm-text":a(o)("Set"),"button-confirm-disabled":!h.value,"focus-trap-initial":!1,onCancel:N,onConfirm:_},{content:X(()=>[c.value?(D(),K("div",iI,[W("img",{ref_key:"imageRef",ref:f,class:"max-h-[400px]",src:c.value},null,8,aI),W("div",lI,[Q(L,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),W("span",{textContent:R.toDisplayString(a(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(o)("+-"),panKeys:a(o)("↑↓←→")}))},null,8,cI)])])):ie("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):ie("",!0),m.value?(D(),ee(M,{key:1,message:a(o)("Are you sure you want to remove your profile picture?"),title:a(o)("Remove profile picture"),"button-cancel-text":a(o)("Cancel"),"button-confirm-text":a(o)("Remove"),onCancel:P[1]||(P[1]=j=>m.value=!1),onConfirm:F},null,8,["message","title","button-cancel-text","button-confirm-text"])):ie("",!0)])}}}),dI={class:"resource-table-select-all flex justify-center items-center"},fI={class:"truncate"},pI=["textContent"],hI=["textContent"],mI=["textContent"],gI={key:0,class:"flex items-center justify-end flex-row flex-nowrap"},yI=850,vI=ge({__name:"ResourceTable",props:{resources:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,default:!1},selectedIds:{default:()=>[]},hasActions:{type:Boolean,default:!0},showRenameQuickAction:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},headerPosition:{default:0},isSelectable:{type:Boolean,default:!0},dragDrop:{type:Boolean,default:!1},viewMode:{default:()=>Et.defaultModeName},hover:{type:Boolean,default:!0},sortBy:{default:()=>{}},fieldsDisplayed:{default:()=>{}},sortDir:{default:()=>{}},space:{default:()=>{}},resourceType:{default:"file"},lazy:{type:Boolean,default:!0}},emits:["fileClick","sort","fileDropped","update:selectedIds","update:modelValue"],setup(e,{emit:t}){const n=t,r=Ae(),s=Ct(),{getMatchingSpace:o}=Rt(),{interceptModifierClick:i}=Vr(),{getParentFolderLink:l,getParentFolderLinkIconAdditionalAttributes:u,getParentFolderName:d,getPathPrefix:c}=Tr({space:H(e.space)}),{isSticky:f}=ac(),{$gettext:p,$ngettext:h,current:g}=de.useGettext(),{isLocationPicker:m,isFilePicker:b}=wr(),{selectedResources:S,disabledResources:k,isResourceSelected:w,fileContainerClicked:C,fileNameClicked:A,fileCheckboxClicked:I,isResourceDisabled:N,isResourceInDeleteQueue:_,isResourceClickable:F,isResourceCut:V,getResourceLink:Z,dragItem:P,dragSelection:$,dragStart:L,fileDropped:M,setDropStyling:j,shouldShowContextDrop:B,showContextMenuOnRightClick:q,showContextMenuOnBtnClick:re,selectAllCheckboxLabel:J,getResourceCheckboxLabel:oe,toggleSelectionAll:ne,areAllResourcesSelected:pe}=uc({space:T(()=>e.space),resources:T(()=>e.resources),selectedIds:T(()=>e.selectedIds),emit:n}),fe=Pt(),{isSideBarOpen:we}=ve.storeToRefs(fe),$e=yr(),{userContextReady:he}=ve.storeToRefs($e),ae=Re(),{areFileExtensionsShown:ue,latestSelectedId:be}=ve.storeToRefs(ae),{width:me}=Cn.useWindowSize(),De=T(()=>s.filesTags&&me.value>=yI),{actions:_e}=Xi(),{actions:ut}=Em(),Kt=T(()=>a(_e)[0].handler),vt=T(()=>a(ut)[0].handler),Dt=H({}),Ve=y=>p("Search for tag %{tag}",{tag:y}),ye=T(()=>{if(e.resources.length===0)return[];const y=e.resources[0],v=[];e.isSelectable&&v.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const O=rf(y);return v.push(...[{name:"name",title:p("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:p("Manager"),type:"slot"},{name:"members",title:p("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:p("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:p("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:p("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:p("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:p("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:p("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:p("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:p("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:p("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:p("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:U=>ln(U.mdate)+" ("+bt(U.mdate)+")"},{name:"sdate",title:p("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:U=>ln(U.sdate)+" ("+bt(U.sdate)+")"},{name:"ddate",title:p("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:U=>ln(U.ddate)+" ("+bt(U.ddate)+")"}].filter(U=>{if(U.name==="tags"&&!a(De))return!1;if(U.name==="indicators")return!0;let Y;return U.prop?Y=Sl(y,U.prop)!==void 0:Y=Object.prototype.hasOwnProperty.call(y,U.name),e.fieldsDisplayed?Y&&e.fieldsDisplayed.includes(U.name):Y}).map(U=>{const Y=O.find(se=>se.name===U.name);return Y&&Object.assign(U,{sortable:Y.sortable,sortDir:Y.sortDir}),U})),e.hasActions&&v.push({name:"actions",title:p("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),v}),Fe=y=>{const v=a(r.currentRoute).query?.term;return cs("files-common-search",{query:{provider:"files.sdk",q_tags:y,...v&&{term:v}}})},gt=y=>a(he)?{to:Fe(y)}:{},Qr=y=>y.id===a(be),xr=y=>e.showRenameQuickAction?z.isProjectSpaceResource(y)?a(ut).filter(v=>v.isVisible({resources:[y]})).length:a(_e).filter(v=>v.isVisible({space:e.space,resources:[y]})).length:!1,kn=y=>{if(z.isProjectSpaceResource(y))return a(vt)({resources:[y]});a(Kt)({space:o(y),resources:[y]})},bt=y=>fp(new Date(y),g),ln=y=>hp(new Date(y),g),vo=y=>{if(!z.isShareResource(y))return;const v=y.type==="folder"?p("folder"):p("file"),O=y.sharedWith.filter(({shareType:U})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(U))).length;return O?h("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",O,{resourceType:v,shareCount:O.toString()}):""},cn=y=>{if(!z.isShareResource(y))return"";const v=y.type==="folder"?p("folder"):p("file");return p("This %{ resourceType } is shared by %{ user }",{resourceType:v,user:y.sharedBy.map(({displayName:O})=>O).join(", ")})},bo=y=>z.isShareResource(y)?y.sharedBy.map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.user.key,username:v.id,userId:v.id})):[],E=y=>z.isShareResource(y)?y.sharedWith.filter(({shareType:v})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(v))).map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.getByValue(v.shareType).key,username:v.id,userId:v.id})):[];return(y,v)=>{const O=te("oc-checkbox"),U=te("oc-icon"),Y=te("oc-tag"),se=te("oc-avatars"),Ie=Bt("oc-tooltip");return D(),K(ke,null,[Q(a(iR),at(y.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===a(Et).name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&a(we),"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&a(we)}],data:e.resources,fields:ye.value,highlighted:e.selectedIds,disabled:a(k),sticky:a(f),"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:a(S),"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"padding-x":"medium",onHighlight:v[1]||(v[1]=le=>a(C)({resource:le[0],event:le[1]})),onContextmenuClicked:v[2]||(v[2]=(le,xe,qe)=>a(q)(xe,qe,Dt.value[qe.id])),onItemDropped:v[3]||(v[3]=le=>a(M)(le[0],le[1])),onItemDragged:v[4]||(v[4]=le=>a(L)(le[0],le[1])),onDropRowStyling:a(j),onSort:v[5]||(v[5]=le=>y.$emit("sort",le)),"onUpdate:modelValue":v[6]||(v[6]=le=>y.$emit("update:modelValue",le))}),Su({name:X(({item:le})=>[W("div",{class:R.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":xr(le)}]])},[Se(y.$slots,"image",{resource:le}),(D(),ee(ho,{key:`${le.path}-${e.resourceDomSelector(le)}-${le.thumbnail}`,resource:le,"path-prefix":a(c)(le),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":a(d)(le),"is-icon-displayed":!y.$slots.image,"is-extension-displayed":a(ue),"is-resource-clickable":a(F)(le,e.areResourcesClickable),link:a(Z)(le),"parent-folder-link":a(l)(le),"parent-folder-link-icon-additional-attributes":a(u)(le),class:R.normalizeClass({"opacity-60":a(V)(le)}),onClick:kt(xe=>a(A)({resource:le,event:xe}),["stop"])},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),xr(le)?(D(),ee(a(Ut),{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw","aria-label":a(p)("Rename file »%{name}«",{name:le.name}),title:a(p)("Rename"),onClick:kt(xe=>{a(i)(xe,le)||kn(le)},["stop"])},{default:X(()=>[Q(U,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["aria-label","title","onClick"])):ie("",!0)],2),Se(y.$slots,"additionalResourceContent",{resource:le})]),syncEnabled:X(({item:le})=>[Se(y.$slots,"syncEnabled",{resource:le})]),size:X(({item:le})=>[Q(ig,{size:le.size||Number.NaN},null,8,["size"])]),tags:X(({item:le})=>[(D(!0),K(ke,null,Ge(le.tags.slice(0,2),xe=>(D(),ee(Yt(a(he)?"router-link":"span"),at({key:xe},{ref_for:!0},gt(xe),{class:"resource-table-tag-wrapper"}),{default:X(()=>[je((D(),ee(Y,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:X(()=>[Q(U,{name:"price-tag-3",size:"small"}),W("span",fI,R.toDisplayString(xe),1)]),_:2},1024)),[[Ie,Ve(xe)]])]),_:2},1040))),128)),le.tags.length>2?(D(),ee(Y,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:v[0]||(v[0]=xe=>a(fe).openSideBar())},{default:X(()=>[it(" + "+R.toDisplayString(le.tags.length-2),1)]),_:2},1024)):ie("",!0)]),manager:X(({item:le})=>[Se(y.$slots,"manager",{resource:le})]),members:X(({item:le})=>[Se(y.$slots,"members",{resource:le})]),totalQuota:X(({item:le})=>[Se(y.$slots,"totalQuota",{resource:le})]),usedQuota:X(({item:le})=>[Se(y.$slots,"usedQuota",{resource:le})]),remainingQuota:X(({item:le})=>[Se(y.$slots,"remainingQuota",{resource:le})]),mdate:X(({item:le})=>[je(W("span",{tabindex:"0",textContent:R.toDisplayString(ln(le.mdate))},null,8,pI),[[Ie,bt(le.mdate)]])]),indicators:X(({item:le})=>[Q(ag,{space:e.space,resource:le,"disable-handler":a(N)(le)},null,8,["space","resource","disable-handler"])]),sdate:X(({item:le})=>[je(W("span",{tabindex:"0",textContent:R.toDisplayString(ln(le.sdate))},null,8,hI),[[Ie,bt(le.sdate)]])]),ddate:X(({item:le})=>[je(W("p",{tabindex:"0",class:"m-0",textContent:R.toDisplayString(ln(le.ddate))},null,8,mI),[[Ie,bt(le.ddate)]])]),sharedBy:X(({item:le})=>[Q(se,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:bo(le),"accessible-description":cn(le),"hover-effect":""},{userAvatars:X(({avatars:xe,width:qe})=>[(D(!0),K(ke,null,Ge(xe,Be=>(D(),ee(a(na),{key:Be.userId,"user-id":Be.userId,"user-name":Be.displayName,width:qe},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),sharedWith:X(({item:le})=>[Q(se,{class:"flex items-center justify-end flex-row flex-nowrap","data-testid":"resource-table-shared-with",items:E(le),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":vo(le),"hover-effect":""},{userAvatars:X(({avatars:xe,width:qe})=>[(D(!0),K(ke,null,Ge(xe,Be=>(D(),ee(a(na),{key:Be.userId,"user-id":Be.userId,"user-name":Be.displayName,width:qe},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),actions:X(({item:le})=>[a(B)(le)?(D(),K("div",gI,[Se(y.$slots,"quickActions",{resource:le}),Q(yc,{ref:xe=>Dt.value[le.id]=xe?.drop,title:le.name,item:le,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:xe=>a(re)(xe,le,Dt.value[le.id])},{contextMenu:X(()=>[Se(y.$slots,"contextMenu",{resource:le})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):ie("",!0)]),_:2},[!a(m)&&!a(b)?{name:"selectHeader",fn:X(()=>[W("div",dI,[je(Q(O,{id:"resource-table-select-all",size:"large",label:a(J),disabled:e.resources.length===a(k).length,"label-hidden":!0,"model-value":a(pe),onClick:kt(a(ne),["stop"])},null,8,["label","disabled","model-value","onClick"]),[[Ie,a(J)]])])]),key:"0"}:void 0,!a(m)&&!a(b)?{name:"select",fn:X(({item:le})=>[a(_)(le.id)?(D(),ee(a(qA),{key:0,class:"inline-flex ml-1",size:"medium","aria-label":a(p)("File is being processed")},null,8,["aria-label"])):(D(),ee(O,{key:1,id:`resource-table-select-${e.resourceDomSelector(le)}`,label:a(oe)(le),"label-hidden":!0,size:"large",disabled:a(N)(le),"model-value":a(w)(le),outline:Qr(le),"data-test-selection-resource-name":le.name,"data-test-selection-resource-path":le.path,onClick:kt(xe=>a(I)({resource:le,event:xe}),["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,y.$slots.footer?{name:"footer",fn:X(()=>[Se(y.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","onDropRowStyling"]),a(P)?(D(),ee(Ps,{key:0,to:"body"},[Q(vc,{ref:"ghostElement","preview-items":[a(P),...a($)]},null,8,["preview-items"])])):ie("",!0)],64)}}}),bI={key:0,class:"oc-tile-card-lazy-shimmer h-30 overflow-hidden relative after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-20 after:animate-shimmer"},wI={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},SI={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},kI=["textContent"],CI=["aria-label"],TI={class:"flex justify-between items-center"},xI={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},AI={class:"flex items-center"},RI={key:0,class:"text-left my-0 truncate"},EI=["textContent"],lg=ge({__name:"ResourceTile",props:{resource:{},resourceRoute:{},space:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},isPathDisplayed:{type:Boolean,default:!1},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["fileNameClicked","contextmenu","itemVisible","tileClicked"],setup(e,{emit:t}){const n=t,{$gettext:r}=de.useGettext(),{getParentFolderName:s,getParentFolderLink:o}=Tr({space:H(e.space)}),i=qt("observerTarget"),l=T(()=>a(i)?.$el),u=T(()=>e.resource.locked||e.resource.processing),d=T(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),c=T(()=>e.resource.locked?r("This item is locked"):null),f=T(()=>z.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:p}=e.lazy?Xp({target:l,onVisibleCallback:()=>n("itemVisible")}):{isVisible:H(!0)},h=T(()=>!a(p));return e.lazy||n("itemVisible"),(g,m)=>{const b=te("oc-spinner"),S=te("oc-tag"),k=te("oc-image"),w=te("oc-icon"),C=Bt("oc-tooltip");return D(),ee(a(Jl),{ref_key:"observerTarget",ref:i,"body-class":"p-0",class:R.normalizeClass(["oc-tile-card flex flex-col h-full shadow-none [&.item-accentuated]:bg-role-secondary-container",{"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline":e.isResourceSelected,"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest":!e.isResourceSelected,"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none":e.isResourceDisabled&&!a(z.isProjectSpaceResource)(e.resource),"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale":e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:m[4]||(m[4]=A=>g.$emit("contextmenu",A))},{default:X(()=>[h.value?(D(),K("div",bI)):(D(),K(ke,{key:1},[Q(Wi,{class:"oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:m[1]||(m[1]=A=>g.$emit("fileNameClicked",A))},{default:X(()=>[W("div",wI,[e.isLoading?(D(),K("div",SI,[Q(b,{"aria-label":a(r)("File is being processed")},null,8,["aria-label"])])):Se(g.$slots,"selection",{key:1,item:e.resource})]),e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)?(D(),ee(S,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:X(()=>[W("span",{textContent:R.toDisplayString(a(r)("Disabled"))},null,8,kI)]),_:1})):ie("",!0),je((D(),K("div",{class:R.normalizeClass(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute",{"p-2":e.isResourceSelected,"hover:p-2":!e.isResourceSelected}]),"aria-label":c.value},[Se(g.$slots,"imageField",{item:e.resource},()=>[e.resource.thumbnail?(D(),ee(k,{key:0,class:R.normalizeClass(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none",{"rounded-sm":e.isResourceSelected}]),src:e.resource.thumbnail,"data-test-thumbnail-resource-name":e.resource.name,onClick:m[0]||(m[0]=kt(A=>g.$emit("tileClicked",[e.resource,A]),["stop"]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(D(),ee(po,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image pt-1 relative"},Su({_:2},[u.value?{name:"status",fn:X(()=>[Q(w,at(d.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,CI)),[[C,c.value]])]),_:3},8,["resource","link","is-resource-clickable"]),W("div",{class:"p-2",onClick:m[3]||(m[3]=kt(A=>g.$emit("tileClicked",[e.resource,A]),["stop"]))},[W("div",TI,[W("div",xI,[Q(ho,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,"is-path-displayed":e.isPathDisplayed,"parent-folder-name":a(s)(e.resource),"parent-folder-link":a(o)(e.resource),link:e.resourceRoute,onClick:m[2]||(m[2]=kt(A=>g.$emit("fileNameClicked",A),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","is-path-displayed","parent-folder-name","parent-folder-link","link"])]),W("div",AI,[Se(g.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Se(g.$slots,"actions",{item:e.resource}),Se(g.$slots,"contextMenu",{item:e.resource})])]),f.value?(D(),K("p",RI,[W("span",{class:"text-sm",textContent:R.toDisplayString(f.value)},null,8,EI)])):ie("",!0),Se(g.$slots,"additionalResourceContent",{item:e.resource})])],64))]),_:3},8,["data-item-id","class"])}}}),DI={id:"tiles-view",class:"px-4 pt-2"},FI={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},II={key:1,class:"oc-tiles-sort"},PI={key:0,class:"flex"},$I={class:"p-1 text-sm"},OI=Le(ge({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},isSelectable:{type:Boolean,default:!0},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Et.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},arePathsDisplayed:{type:Boolean,default:!1}},emits:["fileClick","fileDropped","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=de.useGettext(),s=Re(),{areFileExtensionsShown:o}=ve.storeToRefs(s),{isLocationPicker:i,isFilePicker:l}=wr(),u=lc(),d=T(()=>Math.min(a(u),e.viewSize)),c=Pt(),{isSideBarOpen:f}=ve.storeToRefs(c),{disabledResources:p,isResourceSelected:h,fileContainerClicked:g,fileNameClicked:m,fileCheckboxClicked:b,isResourceDisabled:S,isResourceInDeleteQueue:k,isResourceClickable:w,isResourceCut:C,getResourceLink:A,dragItem:I,dragSelection:N,dragStart:_,fileDropped:F,setDropStyling:V,shouldShowContextDrop:Z,showContextMenuOnRightClick:P,showContextMenuOnBtnClick:$,selectAllCheckboxLabel:L,getResourceCheckboxLabel:M,toggleSelectionAll:j,areAllResourcesSelected:B}=uc({space:T(()=>e.space),resources:T(()=>e.resources),selectedIds:T(()=>e.selectedIds),emit:n}),q=H({}),re=window.__E2E__===!0?!1:e.lazy,J=T(()=>e.sortFields.find(me=>me.name===e.sortBy&&me.sortDir===e.sortDir)||e.sortFields[0]),oe=me=>{n("sort",{sortBy:me.name,sortDir:a(me.sortDir)})},ne=T(()=>{const me={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},De=a(d);return me[De]??"xxlarge"}),pe=H(0),fe=()=>{const me=document.getElementById("tiles-view"),De=getComputedStyle(me),_e=parseInt(De.getPropertyValue("padding-left"),10)|0,ut=parseInt(De.getPropertyValue("padding-right"),10)|0;pe.value=me.clientWidth-_e-ut},we=T(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:$e}=Bm(),he=T(()=>{const me=[...Array(Et.tilesSizeMax).keys()].map(De=>De+1);return[...new Set(me.map(De=>{const _e=$e(De);return _e?Math.round(a(pe)/(_e+a(we))):0}))]}),ae=T(()=>{const me=a(he);return me.length<a(d)?me[me.length-1]:me[a(d)-1]}),ue=T(()=>{const me=a(ae)?e.resources.length%a(ae):0;return me?a(ae)-me:0}),be=T(()=>a(pe)/a(ae)-a(we));return ze(be,me=>{me&&!isNaN(me)&&document.documentElement.style.setProperty("--oc-size-tiles-actual",`${me}px`)},{immediate:!0}),ze(he,me=>{u.value=Math.max(me.length,1)}),ze(f,()=>{fe()}),ft(()=>{window.addEventListener("resize",fe),fe()}),Xt(()=>{window.removeEventListener("resize",fe)}),(me,De)=>{const _e=te("oc-checkbox"),ut=te("oc-icon"),Kt=te("oc-button"),vt=te("oc-list"),Dt=te("oc-filter-chip"),Ve=Bt("oc-tooltip");return D(),K("div",DI,[W("div",FI,[e.isSelectable&&!a(l)?je((D(),ee(_e,{key:0,id:"tiles-view-select-all",class:"ml-2",size:"large",label:a(L),"label-hidden":!0,disabled:e.resources.length===a(p).length,"model-value":a(B),onClick:kt(a(j),["stop"])},null,8,["label","disabled","model-value","onClick"])),[[Ve,a(L)]]):ie("",!0),e.sortFields.length?(D(),K("div",II,[Q(Dt,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":a(r)("Sort by"),"selected-item-names":[J.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:X(()=>[Q(vt,null,{default:X(()=>[(D(!0),K(ke,null,Ge(e.sortFields,(ye,Fe)=>(D(),K("li",{key:Fe},[Q(Kt,{appearance:J.value===ye?"filled":"raw-inverse","color-role":J.value===ye?"secondaryContainer":"surface","no-hover":J.value===ye,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:gt=>oe(ye)},{default:X(()=>[W("span",null,R.toDisplayString(ye.label),1),ye===J.value?(D(),K("div",PI,[Q(ut,{name:"check"})])):ie("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):ie("",!0)]),Q(vt,{class:"oc-tiles grid justify-start gap-3"},{default:X(()=>[(D(!0),K(ke,null,Ge(e.resources,ye=>(D(),K("li",{key:ye.id,class:"oc-tiles-item has-item-context-menu"},[Q(lg,{resource:ye,space:e.space,"resource-route":a(A)(ye),"is-resource-selected":a(h)(ye),"is-resource-clickable":a(w)(ye,e.areResourcesClickable),"is-resource-disabled":a(S)(ye),"is-extension-displayed":a(o),"is-path-displayed":e.arePathsDisplayed,"resource-icon-size":ne.value,draggable:e.dragDrop,lazy:a(re),"is-loading":a(k)(ye.id),class:R.normalizeClass({"opacity-60":a(C)(ye)}),onContextmenu:Fe=>a(P)(Fe,ye,q.value[ye.id]),onFileNameClicked:kt(Fe=>a(m)({resource:ye,event:Fe}),["stop"]),onDragstart:Fe=>a(_)(ye,Fe),onDragenter:kt(Fe=>a(V)(ye,!1,Fe),["prevent"]),onDragleave:kt(Fe=>a(V)(ye,!0,Fe),["prevent"]),onDrop:Fe=>a(F)(ye,Fe),onDragover:De[0]||(De[0]=Fe=>Fe.preventDefault()),onItemVisible:Fe=>me.$emit("itemVisible",ye),onTileClicked:Fe=>a(g)({resource:ye,event:Fe[1]})},{selection:X(()=>[e.isSelectable&&!a(i)&&!a(l)?(D(),ee(_e,{key:0,label:a(M)(ye),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:a(S)(ye),"model-value":a(h)(ye),"data-test-selection-resource-name":ye.name,"data-test-selection-resource-path":ye.path,onClick:kt(Fe=>a(b)({resource:ye,event:Fe}),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):ie("",!0)]),imageField:X(()=>[Se(me.$slots,"image",{resource:ye},void 0,!0)]),indicators:X(()=>[Q(ag,{space:e.space,class:"ml-2",resource:ye,filter:Fe=>["system","sharing"].includes(Fe.category),"disable-handler":a(S)(ye)},null,8,["space","resource","filter","disable-handler"])]),actions:X(()=>[Se(me.$slots,"actions",{resource:ye},void 0,!0)]),contextMenu:X(()=>[a(Z)(ye)?(D(),ee(a(yc),{key:0,ref_for:!0,ref:Fe=>q.value[ye.id]=Fe?.drop,item:ye,title:ye.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:Fe=>a($)(Fe,ye,q.value[ye.id])},{contextMenu:X(()=>[Se(me.$slots,"contextMenu",{resource:ye},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):ie("",!0)]),additionalResourceContent:X(()=>[Se(me.$slots,"additionalResourceContent",{resource:ye},void 0,!0)]),_:2},1032,["resource","space","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","is-path-displayed","resource-icon-size","draggable","lazy","is-loading","class","onContextmenu","onFileNameClicked","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible","onTileClicked"])]))),128)),(D(!0),K(ke,null,Ge(ue.value,ye=>(D(),K("li",{key:`ghost-tile-${ye}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),a(I)?(D(),ee(Ps,{key:0,to:"body"},[Q(vc,{ref:"ghostElement","preview-items":[a(I),...a(N)]},null,8,["preview-items"])])):ie("",!0),W("div",$I,[Se(me.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-8798a647"]]),LI=ge({name:"DateFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},items:{type:Array,required:!0},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=Ae(),{current:s}=de.useGettext(),o=yt(),i=On(),{currentTheme:l}=ve.storeToRefs(i),u=H(),d=H(e.items),c=H(),f=H(),p=H(!1),h=H(),g=`q_${e.filterName}`,m=At(g),b=L=>L[e.idAttribute],S=()=>r.push({query:{...ps(a(o).query,[g]),...a(u)&&{[g]:b(a(u))}}}),k=L=>a(u)&&b(a(u))===b(L),w=()=>{c.value=void 0,f.value=void 0},C=async L=>{w(),k(L)?u.value=void 0:(u.value=L,a(h).hideDrop()),await S(),t("selectionChange",a(u))},A=()=>{u.value=void 0,p.value=!1,w(),t("selectionChange",a(u)),S()},I=()=>{d.value=e.items},N=()=>{p.value=!1},_=()=>{const L=ot(a(m));if(!L)return;const M=e.items.find(j=>b(j)===L);if(M){u.value=M;return}if(a(F)){const j=L.replace("range:",""),B=Number(j.split(" - ")[0]),q=Number(j.split(" - ")[1]);c.value=ht.DateTime.fromMillis(B),f.value=ht.DateTime.fromMillis(q),u.value=a(Z)}},F=T(()=>ot(a(m))?.startsWith("range:")),V=T(()=>!a(c)||!a(f)?!1:a(c)<=a(f)),Z=T(()=>{if(!a(c)||!a(f))return null;const L=Nr(a(c),s,ht.DateTime.DATE_SHORT),M=Nr(a(f),s,ht.DateTime.DATE_SHORT),j=a(c).toMillis(),B=a(f).toMillis();return{[e.idAttribute]:`range:${j} - ${B}`,[e.displayNameAttribute]:`${L} - ${M}`}}),P=async()=>{u.value=a(Z),await S(),a(h).hideDrop(),t("selectionChange",a(u))},$=({date:L,error:M},j)=>{if(M){console.error("date could not be set");return}const B=j==="from"?c:f;if(!L){B.value=void 0;return}const q=j==="from"?L.startOf("day"):L.endOf("day");B.value=q};return n({setSelectedItemsBasedOnQuery:_}),ft(()=>{_()}),{clearFilter:A,displayedItems:d,isItemSelected:k,selectedItem:u,onShowDrop:I,onHideDrop:N,filterChip:h,toggleItemSelection:C,setSelectedItemsBasedOnQuery:_,fromDate:c,toDate:f,dateRangeValid:V,applyDateRangeFilter:P,dateRangeApplied:F,setDateRangeDate:$,dateRangeClicked:p,currentTheme:l,queryParam:g}}}),_I={class:"flex items-center truncate"},MI={class:"truncate ml-2"},NI={class:"flex"},BI={class:"my-1"},jI={class:"flex items-center truncate"},zI={class:"truncate ml-2"},VI=["textContent"],UI={class:"flex"},qI={class:"flex items-center justify-between mb-4"},HI=["textContent"],WI={class:"mt-2"},QI={class:"date-filter-apply-btn text-end"};function KI(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button"),u=te("oc-list"),d=te("oc-datepicker"),c=te("oc-filter-chip");return D(),K("div",{class:R.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[Q(c,{ref:"filterChip","filter-label":e.filterLabel,"selected-item-names":e.selectedItem?[e.selectedItem[e.displayNameAttribute]]:void 0,onClearFilter:e.clearFilter,onShowDrop:e.onShowDrop,onHideDrop:e.onHideDrop},{default:X(()=>[Q(u,{class:R.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:X(()=>[(D(!0),K(ke,null,Ge(e.displayedItems,(f,p)=>(D(),K("li",{key:p,class:"my-1 first:mt-0 last:mb-0"},[Q(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.isItemSelected(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:h=>e.toggleItemSelection(f)},{default:X(()=>[W("div",_I,[W("div",MI,[Se(e.$slots,"item",{item:f},void 0,!0)])]),W("div",NI,[e.isItemSelected(f)?(D(),ee(i,{key:0,name:"check"})):ie("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),W("li",BI,[Q(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=f=>e.dateRangeClicked=!0)},{default:X(()=>[W("div",jI,[W("div",zI,[W("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,VI)])]),W("div",UI,[e.dateRangeApplied?(D(),ee(i,{key:0,name:"check"})):ie("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),W("div",{class:R.normalizeClass(["date-filter-range-panel absolute top-0 p-2 bg-role-surface",{"transform-[translateX(0)] visible":e.dateRangeClicked,"transform-[translateX(100%)] invisible":!e.dateRangeClicked}])},[W("div",qI,[Q(l,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:X(()=>[Q(i,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),W("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,HI),Q(l,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:X(()=>[Q(i,{name:"close"})]),_:1},8,["aria-label"])]),W("div",WI,[Q(d,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,"is-dark":e.currentTheme.isDark,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date","is-dark"]),Q(d,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,"is-dark":e.currentTheme.isDark,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date","is-dark"])]),W("div",QI,[Q(l,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:X(()=>[it(R.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const GI=Le(LI,[["render",KI],["__scopeId","data-v-80ea8301"]]),JI=ge({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Ae(),r=yt(),s=H(e.filterOptions[0].name),o=`q_${e.filterName}`,i=At(o),l=d=>n.push({query:{...ps(a(r).query,[o]),[o]:d}}),u=async d=>{s.value=d.name,await l(d.name),t("toggleFilter",d)};return ft(()=>{const d=ot(a(i));d&&e.filterOptions.some(({name:c})=>c===d)&&(s.value=d,t("toggleFilter",e.filterOptions.find(({name:c})=>c===d)))}),{queryParam:o,activeOption:s,toggleFilter:u}}}),XI=["textContent"];function YI(e,t,n,r,s,o){const i=te("oc-button");return D(),K("div",null,[W("div",{class:R.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(D(!0),K(ke,null,Ge(e.filterOptions,(l,u)=>(D(),ee(i,{id:l.name,key:u,class:R.normalizeClass(["item-inline-filter-option py-1 px-2 text-xs first:rounded-l-full last:rounded-r-full h-[26px]",{"item-inline-filter-option-selected":e.activeOption===l.name}]),appearance:e.activeOption===l.name?"filled":"raw-inverse","color-role":e.activeOption===l.name?"secondaryContainer":"surface","no-hover":e.activeOption===l.name,onClick:d=>e.toggleFilter(l)},{default:X(()=>[W("span",{class:"truncate item-inline-filter-option-label",textContent:R.toDisplayString(l.label)},null,8,XI)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const ZI=Le(JI,[["render",YI]]),eP={class:"space-quota"},tP=["textContent"],cg=ge({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=de.useGettext(),r=T(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:a(o),total:a(s),percentage:a(i).toString()}):t("%{used} used (no restriction)",{used:a(o)})),s=T(()=>zt(e.spaceQuota.total,n)),o=T(()=>zt(e.spaceQuota.used,n)),i=T(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),l=T(()=>e.spaceQuota.state==="normal"?"var(--oc-role-secondary)":"var(--oc-role-error)");return(u,d)=>{const c=te("oc-progress");return D(),K("div",eP,[W("p",{class:"mb-2 mt-0",textContent:R.toDisplayString(r.value)},null,8,tP),Q(c,{value:i.value,max:100,size:"small",color:l.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),nP=ge({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=Un("resource"),n="check",r="file-copy",s=H(r),o=H(r),i=T(()=>dl(a(t).webDavPath)),l=T(()=>e.space?.getWebDavUrl({path:a(t).path}));return{copyWebDAVPathIcon:s,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(a(i)),s.value=n,setTimeout(()=>s.value=r,1500)},copyWebDAVUrlIcon:o,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(a(l)),o.value=n,setTimeout(()=>o.value=r,1500)},webDavPath:i,webDavUrl:l}}}),rP={class:"flex"},sP=["textContent"],oP={class:"flex"},iP=["textContent"];function aP(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button"),u=Bt("oc-tooltip");return D(),K(ke,null,[W("dt",null,R.toDisplayString(e.$gettext("WebDAV path")),1),W("dd",rP,[je(W("div",{class:"truncate",textContent:R.toDisplayString(e.webDavPath)},null,8,sP),[[u,e.webDavPath]]),je((D(),ee(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:X(()=>[Q(i,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV path")]])]),W("dt",null,R.toDisplayString(e.$gettext("WebDAV URL")),1),W("dd",oP,[je(W("div",{class:"truncate",textContent:R.toDisplayString(e.webDavUrl)},null,8,iP),[[u,e.webDavUrl]]),je((D(),ee(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:X(()=>[Q(i,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV URL")]])])],64)}const ug=Le(nP,[["render",aP]]),dg=ge({__name:"CustomComponentTarget",props:{extensionPoint:{}},setup(e){const t=e,n=br(),r=bp(),s=T(()=>n.requestExtensions(t.extensionPoint)),o=r.extractDefaultExtensionIds(t.extensionPoint,a(s)),i=T(()=>{if(t.extensionPoint.multiple||a(s).length<=1)return a(s);const l=r.getExtensionPreference(t.extensionPoint.id,o);return l.selectedExtensionIds.length?[a(s).find(u=>l.selectedExtensionIds.includes(u.id))||a(s)[0]]:[a(s)[0]]});return(l,u)=>(D(!0),K(ke,null,Ge(i.value,d=>(D(),ee(Yt(d.content),at({key:`custom-component-${d.id}`},{ref_for:!0},d.componentProps?d.componentProps():void 0),null,16))),128))}}),bc={id:"app.files.sidebar.space-details.table",extensionType:"customComponent"},lP=()=>T(()=>[bc]),cP={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},uP={class:"text-center"},dP={key:1,class:"relative mb-2"},fP=["src"],pP={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},hP=["textContent"],mP=["textContent"],gP=["aria-label"],yP=ge({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=Ze(),n=Re(),{resourceContentsText:r}=jm({showSizeInformation:!1}),s=Ae(),{$gettext:o,$ngettext:i,current:l}=de.useGettext(),{loadPreview:u}=cc(),{openSideBarPanel:d}=Pt(),c=Ue(),{imagesLoading:f}=ve.storeToRefs(c),p=Jn(),h=Un("resource"),g=H(""),{user:m}=ve.storeToRefs(t),b=T(()=>c.getSpaceMembers(a(h))),S=T(()=>p.linkShares.length),k=T(()=>n.areWebDavDetailsShown),w=T(()=>!rt(s,"files-spaces-projects")),C=T(()=>`${zt(a(h).size,l)}, ${a(r)}`);ze(()=>a(h).spaceImageData,async()=>{g.value=await u({space:a(h),resource:a(h).spaceImageData?z.buildSpaceImageResource(a(h)):a(h),dimensions:fo.Tile,processor:bi.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const A=T(()=>a(b).length?a(b).filter(z.isManager).map(({sharedWith:q})=>q.id===a(m)?.id?o("%{displayName} (me)",{displayName:q.displayName}):q.displayName).join(", "):z.getSpaceManagers(a(h),p.graphRoles)?.map(({grantedToV2:re})=>re.user?.id===a(m)?.id?o("%{displayName} (me)",{displayName:re.user.displayName}):re.user?.displayName||re.group?.displayName).join(", ")),I=T(()=>pp(a(h).mdate,l)),N=T(()=>a(P)||a($)),_=T(()=>a(P)&&!a($)?a(M):!a(P)&&a($)?a(j):a(L)===1?i("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",a(S),{linkShareCount:a(S).toString()}):a(S)===1?o("This space has %{memberShareCount} members and one link.",{memberShareCount:a(L).toString()}):o("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:a(L).toString(),linkShareCount:a(S).toString()})),F=T(()=>o("Open share panel")),V=T(()=>o("Open link list in share panel")),Z=T(()=>o("Open member list in share panel")),P=T(()=>a(L)>0),$=T(()=>a(S)>0),L=T(()=>a(b).length),M=T(()=>i("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",a(L),{memberShareCount:a(L).toString()})),j=T(()=>i("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",a(S),{linkShareCount:a(S).toString()}));return(B,q)=>{const re=te("oc-spinner"),J=te("oc-icon"),oe=te("oc-button");return D(),K("div",cP,[W("div",uP,[a(f).includes(a(h).id)?(D(),ee(re,{key:0,"aria-label":a(o)("Space image is loading")},null,8,["aria-label"])):g.value?(D(),K("div",dP,[W("img",{src:g.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,fP)])):(D(),ee(J,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),e.showShareIndicators&&N.value&&!a(h).disabled?(D(),K("div",pP,[P.value?(D(),ee(oe,{key:0,appearance:"raw","aria-label":Z.value,"no-hover":"",onClick:q[0]||(q[0]=ne=>a(d)("space-share"))},{default:X(()=>[Q(J,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):ie("",!0),$.value?(D(),ee(oe,{key:1,appearance:"raw","aria-label":V.value,"no-hover":"",onClick:q[1]||(q[1]=ne=>a(d)("space-share"))},{default:X(()=>[Q(J,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):ie("",!0),W("p",{textContent:R.toDisplayString(_.value)},null,8,hP),Q(oe,{appearance:"raw","aria-label":F.value,size:"small","no-hover":"",onClick:q[2]||(q[2]=ne=>a(d)("space-share"))},{default:X(()=>[W("span",{class:"text-sm",textContent:R.toDisplayString(a(o)("Show"))},null,8,mP)]),_:1},8,["aria-label"])])):ie("",!0),W("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":a(o)("Overview of the information about the selected space")},[W("dt",null,R.toDisplayString(a(o)("Last activity")),1),W("dd",null,R.toDisplayString(I.value),1),a(h).description?(D(),K(ke,{key:0},[W("dt",null,R.toDisplayString(a(o)("Subtitle")),1),W("dd",null,R.toDisplayString(a(h).description),1)],64)):ie("",!0),W("dt",null,R.toDisplayString(a(o)("Manager")),1),W("dd",null,R.toDisplayString(A.value),1),a(h).disabled?ie("",!0):(D(),K(ke,{key:1},[W("dt",null,R.toDisplayString(a(o)("Quota")),1),W("dd",null,[Q(cg,{"space-quota":a(h).spaceQuota},null,8,["space-quota"])])],64)),w.value?(D(),K(ke,{key:2},[W("dt",null,R.toDisplayString(a(o)("Size")),1),W("dd",null,R.toDisplayString(C.value),1)],64)):ie("",!0),k.value?(D(),ee(ug,{key:3,space:a(h)},null,8,["space"])):ie("",!0),Q(dg,{"extension-point":a(bc)},null,8,["extension-point"])],8,gP)])}}}),vP={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},bP={class:"text-center mb-6 rounded-sm"},wP=["textContent"],SP=ge({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=de.useGettext(),{$gettext:n,$ngettext:r}=t,s=T(()=>{let p=0;return e.selectedSpaces.forEach(h=>{p+=h.spaceQuota.total}),zt(p,t.current)}),o=T(()=>{let p=0;return e.selectedSpaces.forEach(h=>{h.disabled||(p+=h.spaceQuota.remaining)}),zt(p,t.current)}),i=T(()=>{let p=0;return e.selectedSpaces.forEach(h=>{h.disabled||(p+=h.spaceQuota.used)}),zt(p,t.current)}),l=T(()=>e.selectedSpaces.filter(p=>!p.disabled).length),u=T(()=>e.selectedSpaces.filter(p=>p.disabled).length),d=T(()=>n("Overview of the information about the selected spaces")),c=T(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=T(()=>[{term:n("Total quota:"),definition:a(s).toString()},{term:n("Remaining quota:"),definition:a(o).toString()},{term:n("Used quota:"),definition:a(i).toString()},{term:n("Enabled:"),definition:a(l).toString()},{term:n("Disabled:"),definition:a(u).toString()}]);return(p,h)=>{const g=te("oc-icon"),m=te("oc-definition-list");return D(),K("div",vP,[W("div",bP,[W("div",null,[Q(g,{size:"xxlarge",name:"layout-grid"}),W("p",{textContent:R.toDisplayString(c.value)},null,8,wP)])]),Q(m,{"aria-label":d.value,items:f.value,class:"m-0"},null,8,["aria-label","items"])])}}}),kP=ge({name:"SpaceNoSelection"}),CP={class:"mt-12"},TP={class:"flex flex-col items-center space-info text-center"},xP=["textContent"];function AP(e,t,n,r,s,o){const i=te("oc-icon");return D(),K("div",CP,[W("div",TP,[Q(i,{name:"layout-grid",size:"xxlarge"}),W("p",{textContent:R.toDisplayString(e.$gettext("Select a space to view details"))},null,8,xP)])])}const RP=Le(kP,[["render",AP]]),EP=ge({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=H(!1);let t;return ft(()=>{t=Xe.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Xt(()=>{Xe.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!Yf(this.originalObject,this.compareObject)},unsavedChangesText(){return this.unsavedChanges?this.$gettext("Unsaved changes"):this.$gettext("No changes")}},watch:{unsavedChanges(){this.unsavedChanges&&(this.saved=!1)},"originalObject.id":function(){this.saved=!1}}}),DP={class:"w-full flex flex-row flex-wrap justify-between items-center"},FP={key:0,class:"flex items-center"},IP=["textContent"],PP={key:1},$P=["textContent"],OP=["textContent"];function LP(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button");return D(),K("div",DP,[e.saved?(D(),K("span",FP,[Q(i,{name:"checkbox-circle"}),W("span",{class:"ml-2",textContent:R.toDisplayString(e.$gettext("Changes saved"))},null,8,IP)])):(D(),K("span",PP,R.toDisplayString(e.unsavedChangesText),1)),W("div",null,[Q(l,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=u=>e.$emit("revert"))},{default:X(()=>[W("span",{textContent:R.toDisplayString(e.$gettext("Revert"))},null,8,$P)]),_:1},8,["disabled"]),Q(l,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=u=>e.$emit("confirm"))},{default:X(()=>[W("span",{textContent:R.toDisplayString(e.$gettext("Save"))},null,8,OP)]),_:1},8,["disabled"])])])}const _P=Le(EP,[["render",LP]]),MP=Uy(async()=>(await Promise.resolve().then(()=>E$)).default),NP={class:"flex items-center truncate"},BP={class:"truncate"},jP={class:"flex"},zP=ge({__name:"ItemFilter",props:{filterLabel:{},filterName:{},items:{},optionFilterLabel:{default:""},showOptionFilter:{type:Boolean,default:!1},allowMultiple:{type:Boolean,default:!1},idAttribute:{default:"id"},displayNameAttribute:{default:"name"},filterableAttributes:{default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup(e,{expose:t,emit:n}){const r=n,s=Ae(),o=yt(),i=qt("filterInputRef"),l=H([]),u=H(e.items),d=qt("itemFilterListRef"),c=`q_${e.filterName}`,f=At(c),p=N=>N[e.idAttribute],h=()=>s.push({query:{...ps(a(o).query,[c]),...!!a(l).length&&{[c]:a(l).reduce((N,_)=>(N+=`${p(_)}+`,N),"").slice(0,-1)}}}),g=N=>!!a(l).find(_=>p(_)===p(N)),m=async N=>{g(N)?l.value=a(l).filter(_=>p(_)!==p(N)):(e.allowMultiple||(l.value=[]),l.value.push(N)),await h(),r("selectionChange",a(l))},b=H(),S=(N,_)=>{if(!(_||"").trim())return N;const V=new Sc(N,{...ja,keys:e.filterableAttributes}).search(_).map(Z=>Z.item);return N.filter(Z=>V.includes(Z))},k=()=>{l.value=[],r("selectionChange",a(l)),h()},w=N=>{u.value=N},C=async()=>{w(e.items),await St(),a(i)?.focus()};let A;ze(b,()=>{w(S(e.items,a(b))),a(d)&&(A=new xc(a(d)),A.unmark(),A.mark(a(b),{element:"span",className:"mark-highlight"}))});const I=()=>{const N=ot(a(f));if(N){const _=N.split("+");l.value=e.items.filter(F=>_.includes(p(F)))}};return t({setSelectedItemsBasedOnQuery:I}),ft(()=>{I()}),(N,_)=>{const F=te("oc-checkbox"),V=te("oc-icon"),Z=te("oc-button"),P=te("oc-list"),$=te("oc-filter-chip");return D(),K("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[Q($,{"filter-label":e.filterLabel,"selected-item-names":l.value.map(L=>L[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:k,onShowDrop:C},{default:X(()=>[e.showOptionFilter&&e.filterableAttributes.length?(D(),ee(a(RA),{key:0,ref_key:"filterInputRef",ref:i,modelValue:b.value,"onUpdate:modelValue":_[0]||(_[0]=L=>b.value=L),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?N.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):ie("",!0),W("div",{ref_key:"itemFilterListRef",ref:d},[Q(P,{class:"item-filter-list"},{default:X(()=>[(D(!0),K(ke,null,Ge(u.value,(L,M)=>(D(),K("li",{key:M,class:"my-1"},[Q(Z,{class:R.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&g(L),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":L[e.displayNameAttribute],onClick:j=>m(L)},{default:X(()=>[W("div",NP,[e.allowMultiple?(D(),ee(F,{key:0,size:"large",class:"mr-2",label:N.$gettext("Toggle selection"),"model-value":g(L),"label-hidden":!0,"onUpdate:modelValue":j=>m(L),onClick:_[1]||(_[1]=kt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):ie("",!0),W("div",null,[Se(N.$slots,"image",{item:L})]),W("div",BP,[Se(N.$slots,"item",{item:L})])]),W("div",jP,[!e.allowMultiple&&g(L)?(D(),ee(V,{key:0,name:"check"})):ie("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click"])],2)}}}),VP=ge({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Ae(),r=yt(),s=H(!1),o=`q_${e.filterName}`,i=At(o),l=()=>n.push({query:{...ps(a(r).query,[o]),...a(s)&&{[o]:"true"}}}),u=async()=>{s.value=!a(s),await l(),t("toggleFilter",a(s))};return ft(()=>{ot(a(i))==="true"&&(s.value=!0)}),{queryParam:o,filterActive:s,toggleFilter:u}}});function UP(e,t,n,r,s,o){const i=te("oc-filter-chip");return D(),K("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[Q(i,{"is-toggle":!0,"filter-label":e.filterLabel,"is-toggle-active":e.filterActive,onToggleFilter:e.toggleFilter,onClearFilter:e.toggleFilter},null,8,["filter-label","is-toggle-active","onToggleFilter","onClearFilter"])],2)}const qP=Le(VP,[["render",UP]]),HP=ge({name:"LoadingIndicator",setup(){const e=Nt();let t,n,r;const s=H(e.isLoading),o=H(e.currentProgress),i=()=>{o.value=e.currentProgress,s.value=e.isLoading},l=()=>{o.value=e.currentProgress};return ft(()=>{t=Xe.subscribe(vr.add,i),n=Xe.subscribe(vr.remove,i),r=Xe.subscribe(vr.setProgress,l)}),Xt(()=>{Xe.unsubscribe(vr.add,t),Xe.unsubscribe(vr.remove,n),Xe.unsubscribe(vr.setProgress,r)}),{isLoading:s,currentProgress:o}}}),WP={key:0,id:"oc-loading-indicator",class:"w-full"};function QP(e,t,n,r,s,o){const i=te("oc-progress");return e.isLoading?(D(),K("div",WP,[Q(i,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):ie("",!0)}const KP=Le(HP,[["render",QP]]),GP={class:"no-content-message flex flex-col justify-center items-center text-center"},JP={class:"text-role-on-surface-variant text-xl"},XP={class:"text-role-on-surface-variant mt-1"},YP=Le(ge({__name:"NoContentMessage",props:{icon:{default:""},iconFillType:{default:"fill"},imgSrc:{default:""}},setup(e){return(t,n)=>{const r=te("oc-image"),s=te("oc-icon");return D(),K("div",GP,[e.imgSrc?(D(),ee(r,{key:0,width:"120",height:"120",class:"mb-4",src:e.imgSrc,alt:t.$gettext("No content image")},null,8,["src","alt"])):ie("",!0),e.icon?(D(),ee(s,{key:1,name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"mb-4"},null,8,["name","fill-type"])):ie("",!0),W("div",JP,[Se(t.$slots,"message",{},void 0,!0)]),W("div",XP,[Se(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-02a07e27"]]),ZP=ge({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){document.getElementsByClassName("files-view-wrapper")[0]?.scrollTo(0,0)}}}});function e$(e,t,n,r,s,o){const i=te("oc-pagination");return e.pages>1?(D(),ee(i,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination flex justify-center my-2"},null,8,["pages","current-page","current-route"])):ie("",!0)}const t$=Le(ZP,[["render",e$]]),n$=ge({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=de.useGettext(),r=At("useScope"),s=H(),o=H(),i=T(()=>n(s.value?.title)),l=T(()=>[{id:zr.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:zr.allFiles,title:n("All files"),enabled:!0}]);return ze(()=>e.currentFolderAvailable,()=>{if(a(r)){if(a(r).toString()==="true"){s.value=a(l).find(({id:c})=>c===zr.currentFolder);return}s.value=a(l).find(({id:c})=>c===zr.allFiles);return}if(!e.currentFolderAvailable){s.value=a(l).find(({id:d})=>d===zr.allFiles);return}if(a(o)){s.value=a(l).find(({id:d})=>d===a(o).id);return}s.value=a(l).find(({id:d})=>d===zr.allFiles)},{immediate:!0}),{currentSelection:s,currentSelectionTitle:i,onOptionSelected:d=>{o.value=d,s.value=d,t("update:modelValue",{value:d})},locationOptions:l}}}),r$={key:0},s$={key:0,class:"flex"};function o$(e,t,n,r,s,o){const i=te("oc-icon"),l=te("oc-button"),u=te("oc-list"),d=te("oc-filter-chip");return D(),K("div",{class:"z-[var(--z-index-modal)] absolute top-[50%] transform-[translateY(-50%)] right-0 ml-4 mb-4 mt-0 mr-[34px] float-right","data-testid":"search-bar-filter",onClick:t[0]||(t[0]=kt(()=>{},["stop"]))},[e.currentSelection?(D(),K("div",r$,[Q(d,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.$gettext("Location filter"),"selected-item-names":[e.currentSelectionTitle],class:"oc-search-bar-filter [&_button]:items-center [&_.oc-drop]:w-45","has-active-state":!1,raw:"","close-on-click":""},{default:X(()=>[Q(u,null,{default:X(()=>[(D(!0),K(ke,null,Ge(e.locationOptions,(c,f)=>(D(),K("li",{key:f},[Q(l,{appearance:c.id===e.currentSelection.id?"filled":"raw-inverse","color-role":c.id===e.currentSelection.id?"secondaryContainer":"surface","no-hover":c.id===e.currentSelection.id,size:"medium",class:"flex items-center w-full py-1 px-2","justify-content":"space-between",disabled:!c.enabled,"data-test-id":c.id,onClick:p=>e.onOptionSelected(c)},{default:X(()=>[W("span",null,R.toDisplayString(c.title),1),c.id===e.currentSelection.id?(D(),K("div",s$,[Q(i,{name:"check"})])):ie("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):ie("",!0)])}const i$=Le(n$,[["render",o$]]),a$={key:0},l$={key:0,class:"version-check-loading flex items-center"},c$=["textContent"],u$={key:0,class:"version-check-no-updates flex items-center"},d$=["textContent"],f$=["textContent"],p$=ge({__name:"VersionCheck",setup(e){const{$gettext:t}=de.useGettext(),n=Ct(),r=Yp(),s=n.capabilities.core["check-for-updates"],{updates:o,isLoading:i,hasError:l}=ve.storeToRefs(r),u=T(()=>s&&!a(l)),d=H(!1),c=H(),f=n.status.edition||"rolling",h=n.status.productversion.split("+")[0];return ze(()=>o,()=>{if(!a(o))return;const g=a(o).channels[f].current_version;pl(g,h)>0&&(d.value=!0,c.value=a(o).channels[f])},{immediate:!0,deep:!0}),(g,m)=>{const b=te("oc-spinner"),S=te("oc-icon"),k=te("oc-button");return u.value?(D(),K("div",a$,[a(i)?(D(),K("div",l$,[W("span",{textContent:R.toDisplayString(a(t)("Checking for updates"))},null,8,c$),Q(b,{class:"ml-1",size:"xsmall"})])):(D(),K(ke,{key:1},[d.value?(D(),ee(k,{key:1,class:"version-check-update text-role-on-surface-variant",size:"small",type:"a",href:c.value.url,target:"_blank","gap-size":"small",appearance:"raw","no-hover":""},{default:X(()=>[W("span",{class:"text-xs",textContent:R.toDisplayString(a(t)("Version %{version} available",{version:c.value.current_version}))},null,8,f$),Q(S,{name:"refresh",size:"xsmall","fill-type":"line"})]),_:1},8,["href"])):(D(),K("div",u$,[W("span",{textContent:R.toDisplayString(a(t)("Up to date"))},null,8,d$),Q(S,{class:"ml-0.5",name:"checkbox-circle",size:"xsmall","fill-type":"line"})]))],64))])):ie("",!0)}}}),h$={toolbarTips:{bold:"Gras",underline:"Souligné",italic:"Italique",strikeThrough:"Barré",title:"Titre",sub:"Indice",sup:"Exposant",quote:"Citation",unorderedList:"Liste",orderedList:"Liste numérique",task:"Liste de tâche",codeRow:"Code intégré",code:"Bloc de code",link:"Lien",image:"Image",table:"Table",mermaid:"Organigramme",katex:"Formule",revoke:"Annuler",next:"Refaire",save:"Sauvegarder",prettier:"Sublimer",pageFullscreen:"Passer en pleine page",fullscreen:"Passer en plein écran",preview:"Prévisualiser",htmlPreview:"Prévisualiser le HTML",catalog:"Table des matières",github:"Code source de l'editeur"},titleItem:{h1:"Titre niveau 1",h2:"Titre niveau 2",h3:"Titre niveau 3",h4:"Titre niveau 4",h5:"Titre niveau 5",h6:"Titre niveau 6"},imgTitleItem:{link:"Ajouter depuis une url",upload:"Télécharger une image",clip2upload:"Télécharger et recadrer"},linkModalTips:{linkTitle:"Ajouter un lien",imageTitle:"Ajouter une image depuis une url",descLabel:"Texte : ",descLabelPlaceHolder:"Entrez un texte...",urlLabel:"Url : ",urlLabelPlaceHolder:"Entrez une url...",buttonOK:"Valider"},clipModalTips:{title:"Télécharger et recadrer une image",buttonUpload:"Valider"},copyCode:{text:"Copier le code",successTips:"Copié",failTips:"La copie a échoué!"},mermaid:{flow:"Organigramme",sequence:"Chronogramme",gantt:"Diagramme de Gantt",class:"Diagramme de classes",state:"Diagramme d'état",pie:"Diagramme circulaire",relationship:"Diagramme de relation",journey:"Diagramme de tâches"},katex:{inline:"Formule en ligne",block:"Formule en bloc"},footer:{markdownTotal:"Nombre de mots",scrollAuto:"Défilement synchronisé"}},m$={toolbarTips:{bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strikeThrough:"Durchgestrichen",title:"Titel",sub:"Tiefgestellt",sup:"Hochgestellt",quote:"Zitat",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",task:"Aufgabenliste",codeRow:"Eingebetteter Code",code:"Codeblock",link:"Link",image:"Bild",table:"Tabelle",mermaid:"Flussdiagramm",katex:"Formel",revoke:"Rückgängig machen",next:"Wiederherstellen",save:"Speichern",prettier:"Verschönern",pageFullscreen:"Vollbildmodus",fullscreen:"Vollbild",preview:"Vorschau",htmlPreview:"HTML Vorschau",catalog:"Inhaltsverzeichnis",github:"Quellcode des Editors"},titleItem:{h1:"Überschrift Ebene 1",h2:"Überschrift Ebene 2",h3:"Überschrift Ebene 3",h4:"Überschrift Ebene 4",h5:"Überschrift Ebene 5",h6:"Überschrift Ebene 6"},imgTitleItem:{link:"Bildlink hinzufügen",upload:"Bild hochladen",clip2upload:"Bild zuschneiden und hochladen"},linkModalTips:{linkTitle:"Link hinzufügen",imageTitle:"Bild von URL hinzufügen",descLabel:"Text: ",descLabelPlaceHolder:"Text eingeben...",urlLabel:"URL: ",urlLabelPlaceHolder:"URL eingeben...",buttonOK:"Bestätigen"},clipModalTips:{title:"Bild zuschneiden und hochladen",buttonUpload:"Hochladen"},copyCode:{text:"Code kopieren",successTips:"Kopiert!",failTips:"Kopieren fehlgeschlagen!"},mermaid:{flow:"Flussdiagramm",sequence:"Sequenzdiagramm",gantt:"Gantt-Diagramm",class:"Klassendiagramm",state:"Zustandsdiagramm",pie:"Kreisdiagramm",relationship:"Beziehungsdiagramm",journey:"Reisediagramm"},katex:{inline:"Inline-Formel",block:"Blockformel"},footer:{markdownTotal:"Zeichenanzahl",scrollAuto:"Automatisches Scrollen"}},g$={toolbarTips:{bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strikeThrough:"Barrato",title:"Titolo",sub:"Indice",sup:"Esponente",quote:"Citazione",unorderedList:"Elenco non ordinato",orderedList:"Elenco ordinato",task:"Lista di compiti",codeRow:"Codice incorporato",code:"Blocco di codice",link:"Link",image:"Immagine",table:"Tabella",mermaid:"Diagramma",katex:"Formula",revoke:"Annulla",next:"Ripristina",save:"Salva",prettier:"Formatta",pageFullscreen:"Pagina a schermo intero",fullscreen:"Schermo intero",preview:"Anteprima",htmlPreview:"Anteprima HTML",catalog:"Indice",github:"Codice sorgente dell'editor"},titleItem:{h1:"Intestazione Livello 1",h2:"Intestazione Livello 2",h3:"Intestazione Livello 3",h4:"Intestazione Livello 4",h5:"Intestazione Livello 5",h6:"Intestazione Livello 6"},imgTitleItem:{link:"Aggiungi link immagine",upload:"Carica immagine",clip2upload:"Ritaglia e carica immagine"},linkModalTips:{linkTitle:"Aggiungi link",imageTitle:"Aggiungi immagine da URL",descLabel:"Testo: ",descLabelPlaceHolder:"Inserisci il testo...",urlLabel:"URL: ",urlLabelPlaceHolder:"Inserisci l'URL...",buttonOK:"Conferma"},clipModalTips:{title:"Ritaglia e carica immagine",buttonUpload:"Carica"},copyCode:{text:"Copia codice",successTips:"Copiato!",failTips:"Copia fallita!"},mermaid:{flow:"Diagramma di flusso",sequence:"Diagramma di sequenza",gantt:"Diagramma di Gantt",class:"Diagramma di classe",state:"Diagramma di stato",pie:"Diagramma a torta",relationship:"Diagramma di relazione",journey:"Diagramma di viaggio"},katex:{inline:"Formula in linea",block:"Formula a blocco"},footer:{markdownTotal:"Conteggio parole",scrollAuto:"Scorrimento automatico"}},y$={toolbarTips:{bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strikeThrough:"Tachado",title:"Título",sub:"Subíndice",sup:"Superíndice",quote:"Cita",unorderedList:"Lista desordenada",orderedList:"Lista ordenada",task:"Lista de tareas",codeRow:"Código en línea",code:"Bloque de código",link:"Enlace",image:"Imagen",table:"Tabla",mermaid:"Diagrama",katex:"Fórmula",revoke:"Deshacer",next:"Rehacer",save:"Guardar",prettier:"Formatear",pageFullscreen:"Página en pantalla completa",fullscreen:"Pantalla completa",preview:"Vista previa",htmlPreview:"Vista previa del HTML",catalog:"Índice",github:"Código fuente del editor"},titleItem:{h1:"Encabezado de nivel 1",h2:"Encabezado de nivel 2",h3:"Encabezado de nivel 3",h4:"Encabezado de nivel 4",h5:"Encabezado de nivel 5",h6:"Encabezado de nivel 6"},imgTitleItem:{link:"Agregar enlace de imagen",upload:"Subir imagen",clip2upload:"Recortar y subir imagen"},linkModalTips:{linkTitle:"Agregar enlace",imageTitle:"Agregar imagen desde URL",descLabel:"Texto: ",descLabelPlaceHolder:"Introduce el texto...",urlLabel:"Enlace: ",urlLabelPlaceHolder:"Introduce el enlace...",buttonOK:"Confirmar"},clipModalTips:{title:"Recortar y subir imagen",buttonUpload:"Subir"},copyCode:{text:"Copiar código",successTips:"¡Copiado!",failTips:"¡Copia fallida!"},mermaid:{flow:"Diagrama de flujo",sequence:"Diagrama de secuencia",gantt:"Diagrama de Gantt",class:"Diagrama de clase",state:"Diagrama de estado",pie:"Diagrama de pastel",relationship:"Diagrama de relación",journey:"Diagrama de viaje"},katex:{inline:"Fórmula en línea",block:"Fórmula de bloque"},footer:{markdownTotal:"Conteo de letras",scrollAuto:"Desplazamiento automático"}},v$={toolbarTips:{bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strikeThrough:"Przekreślenie",title:"Tytuł",sub:"Indeks dolny",sup:"Indeks górny",quote:"Cytat",unorderedList:"Lista nieuporządkowana",orderedList:"Lista uporządkowana",task:"Lista zadań",codeRow:"Wbudowany kod",code:"Blok kodu",link:"Link",image:"Obraz",table:"Tabela",mermaid:"Schemat przepływu",katex:"Formuła",revoke:"Cofnij",next:"Przywróć",save:"Zapisz",prettier:"Upiększ",pageFullscreen:"Pełny ekran strony",fullscreen:"Pełny ekran",preview:"Podgląd",htmlPreview:"Podgląd HTML",catalog:"Spis treści",github:"Kod źródłowy edytora"},titleItem:{h1:"Nagłówek poziom 1",h2:"Nagłówek poziom 2",h3:"Nagłówek poziom 3",h4:"Nagłówek poziom 4",h5:"Nagłówek poziom 5",h6:"Nagłówek poziom 6"},imgTitleItem:{link:"Dodaj link do obrazu",upload:"Prześlij obraz",clip2upload:"Przytnij i prześlij obraz"},linkModalTips:{linkTitle:"Dodaj link",imageTitle:"Dodaj obraz z URL",descLabel:"Tekst: ",descLabelPlaceHolder:"Wpisz tekst...",urlLabel:"URL: ",urlLabelPlaceHolder:"Wpisz URL...",buttonOK:"Potwierdź"},clipModalTips:{title:"Przytnij i prześlij obraz",buttonUpload:"Prześlij"},copyCode:{text:"Skopiuj kod",successTips:"Skopiowano!",failTips:"Nie udało się skopiować!"},mermaid:{flow:"Schemat przepływu",sequence:"Schemat sekwencji",gantt:"Wykres Gantta",class:"Diagram klas",state:"Diagram stanów",pie:"Diagram kołowy",relationship:"Diagram relacji",journey:"Diagram podróży"},katex:{inline:"Formuła inline",block:"Formuła blokowa"},footer:{markdownTotal:"Liczba znaków",scrollAuto:"Automatyczne przewijanie"}},b$={toolbarTips:{bold:"жирный",underline:"подчёркнутый",italic:"курсив",strikeThrough:"зачёркнутый",title:"заголовок",sub:"нижний индекс",sup:"верхний индекс",quote:"цитата",unorderedList:"неупорядоченный список",orderedList:"упорядоченный список",task:"список задач",codeRow:"встроенный код",code:"блочный код",link:"ссылка",image:"изображение",table:"таблица",mermaid:"диаграмма",katex:"формула",revoke:"отмена",next:"вернуть",save:"сохранить",prettier:"форматировать",pageFullscreen:"на всю страницу",fullscreen:"на весь экран",preview:"превью",previewOnly:"только превью",htmlPreview:"превью html",catalog:"каталог",github:"исходный код"},titleItem:{h1:"Заголовок 1-го ур.",h2:"Заголовок 2-го ур.",h3:"Заголовок 3-го ур.",h4:"Заголовок 4-го ур.",h5:"Заголовок 5-го ур.",h6:"Заголовок 6-го ур."},imgTitleItem:{link:"Добавить ссылку на изображение",upload:"Загрузить изображение",clip2upload:"Из буфера обмена"},linkModalTips:{linkTitle:"Добавить ссылку",imageTitle:"Добавить изображение",descLabel:"Описание:",descLabelPlaceHolder:"Введите описание...",urlLabel:"Ссылка:",urlLabelPlaceHolder:"Введите ссылку...",buttonOK:"ОК"},clipModalTips:{title:"Обрезать изображение",buttonUpload:"Загрузить"},copyCode:{text:"Скопировать",successTips:"Скопировано!",failTips:"Не удалось скопировать!"},mermaid:{flow:"цепная",sequence:"последовательная",gantt:"временная",class:"структурная",state:"статусная",pie:"круговая",relationship:"реляционная",journey:"путешествия"},katex:{inline:"встроенная",block:"блочная"},footer:{markdownTotal:"Кол-во символов",scrollAuto:"Автопрокрутка"}},w$={toolbarTips:{bold:"太字",underline:"下線",italic:"斜体",strikeThrough:"取り消し線",title:"タイトル",sub:"下付き文字",sup:"上付き文字",quote:"引用",unorderedList:"番号なし箇条書き",orderedList:"番号付の箇条書き",task:"タスクリスト",codeRow:"インラインコード",code:"ブロックコード",link:"リンク",image:"イメージ",table:"テーブル",mermaid:"mermaid図",katex:"katex数式",revoke:"後退",next:"前進",save:"保存",prettier:"フォーマット",pageFullscreen:"ブラウザのフルスクリーン",fullscreen:"フルスクリーン",preview:"プレビュー",htmlPreview:"htmlプレビュー",catalog:"目次",github:"ギットハブ"},titleItem:{h1:"見出し1",h2:"見出し2",h3:"見出し3",h4:"見出し4",h5:"見出し5",h6:"見出し6"},imgTitleItem:{link:"リンク",upload:"アップロード",clip2upload:"トリミングアップロード"},linkModalTips:{linkTitle:"追加",imageTitle:"イメージ追加",descLabel:"リンクの説明:",descLabelPlaceHolder:"説明を入力してください...",urlLabel:"リンクアドレス:",urlLabelPlaceHolder:"リンクを入力してください...",buttonOK:"確定"},clipModalTips:{title:"トリミング画像のアップロード",buttonUpload:"アップロード"},copyCode:{text:"コードをコピー",successTips:"コピー成功!",failTips:"コピー失敗!"},mermaid:{flow:"フローチャート",sequence:"タイミング図",gantt:"ガントチャート",class:"クラス図",state:"状態図",pie:"円グラフ",relationship:"関係図",journey:"旅路図"},katex:{inline:"インライン数式",block:"ブロック数式"},footer:{markdownTotal:"単語数",scrollAuto:"同期スクロール"}},S$={toolbarTips:{bold:"tebal",underline:"garis bawah",italic:"miring",strikeThrough:"coret sambung",title:"judul",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"daftar tak berurutan",orderedList:"daftar berurutan",task:"daftar tugas",codeRow:"kode inline",code:"kode blok",link:"tautan",image:"gambar",table:"tabel",mermaid:"mermaid",katex:"rumus",revoke:"membatalkan",next:"membatalkan pembatalan",save:"simpan",prettier:"penataan",pageFullscreen:"layar penuh di halaman",fullscreen:"layar penuh",preview:"pratinjau",htmlPreview:"pratinjau html",catalog:"daftar isi",github:"kode sumber"},titleItem:{h1:"Judul 1",h2:"Judul 2",h3:"Judul 3",h4:"Judul 4",h5:"Judul 5",h6:"Judul 6"},imgTitleItem:{link:"Tambahkan Tautan Gambar",upload:"Unggah Gambar",clip2upload:"Potong dan Unggah"},linkModalTips:{linkTitle:"Tambahkan Tautan",imageTitle:"Tambahkan Gambar",descLabel:"Deskripsi:",descLabelPlaceHolder:"Masukkan deskripsi...",urlLabel:"Tautan:",urlLabelPlaceHolder:"Masukkan tautan...",buttonOK:"OK"},clipModalTips:{title:"Potong dan Unggah Gambar",buttonUpload:"Unggah"},copyCode:{text:"Salin",successTips:"Tersalin!",failTips:"Gagal menyalin!"},mermaid:{flow:"diagram aliran",sequence:"diagram urutan",gantt:"diagram gantt",class:"diagram kelas",state:"diagram status",pie:"diagram pie",relationship:"diagram hubungan",journey:"diagram perjalanan"},katex:{inline:"rumus inline",block:"rumus blok"},footer:{markdownTotal:"Jumlah Kata",scrollAuto:"Gulir Otomatis"}},k$={zh:"zh-CN",fr:"fr-FR",ja:"jp-JP",id:"id-ID",ru:"ru",de:"de-DE",it:"it-IT",es:"es-ES",pl:"pl-PL",en:"en-US"},C$={"fr-FR":h$,"de-DE":m$,"it-IT":g$,"es-ES":y$,"pl-PL":v$,ru:b$,"jp-JP":w$,"id-ID":S$},T$=ge({name:"TextEditor",components:{MdEditor:ks.MdEditor,MdPreview:ks.MdPreview,NormalToolbar:ks.NormalToolbar},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e,{emit:t}){const n=de.useGettext(),{currentTheme:r}=On(),s=H(!0),o=T(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=T(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!a(o).showPreviewOnlyMd),l=T(()=>a(r).isDark?"dark":"light"),u=T(()=>a(i)?["bold","underline","italic","-","title","strikeThrough","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","-","revoke","next","=",0,"preview","previewOnly"]:["revoke","next","=",0]);return ks.config({editorConfig:{languageUserDefined:C$},editorExtensions:{screenfull:{instance:Tg},cropper:{instance:ra}},markdownItPlugins(c){return[...c,{type:"xss",plugin:ks.XSSPlugin,options:{}}]},codeMirrorExtensions(c){const f=[...c,{type:"lineNumbers",extension:xg.lineNumbers()}],p=f.find(h=>h.type==="linkShortener");return p&&(p.options.maxLength=120),a(i)?f:f.filter(h=>["lineWrapping","keymap","floatingToolbar","lineNumbers"].includes(h.type))}}),{isMarkdown:i,theme:l,toolbars:u,language:n,languages:k$,onUploadImg:async c=>{const p=(await Promise.all([...c].map(g=>new Promise((m,b)=>{const S=new FileReader;S.onload=()=>m(S.result),S.onerror=b,S.readAsDataURL(g)})))).map(g=>`![image](${g})`),h=`${a(e.currentContent)}
13
- ${p.join(`
14
-
15
- `)}
16
- `;t("update:currentContent",h)},showLineNumbers:s}}}),x$={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"},A$={key:0};function R$(e,t,n,r,s,o){const i=te("md-preview"),l=te("oc-icon"),u=te("NormalToolbar"),d=te("md-editor");return D(),K("div",x$,[e.isReadOnly?(D(),K("article",A$,[Q(i,{id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"","no-echarts":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":""},null,8,["model-value","language","theme"])])):(D(),ee(d,{key:1,id:"text-editor-component",class:R.normalizeClass([{"no-line-numbers":!e.showLineNumbers},"[&_.cm-content]:!font-(family-name:--oc-font-family)"]),"model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","no-echarts":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.toolbars,"auto-focus":"",onOnChange:t[1]||(t[1]=c=>e.$emit("update:currentContent",c))},{defToolbars:X(()=>[Q(u,{title:e.showLineNumbers?e.$gettext("hide line numbers"):e.$gettext("show line numbers"),onOnClick:t[0]||(t[0]=c=>e.showLineNumbers=!e.showLineNumbers)},{default:X(()=>[Q(l,{class:"!flex items-center justify-center size-6",size:"small",name:"hashtag","fill-type":"none"})]),_:1},8,["title"])]),_:1},8,["class","model-value","on-upload-img","language","theme","preview","toolbars"]))])}const E$=Object.freeze(Object.defineProperty({__proto__:null,default:Le(T$,[["render",R$]])},Symbol.toStringTag,{value:"Module"}));x.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=Yl,x.AccountCapabilitiesSchema=kp,x.AccountSchema=Tp,x.AccountsSchema=Ap,x.ActionMenuDropItem=Gm,x.ActionMenuItem=ea,x.ApiError=QS,x.AppBar=YD,x.AppLoadingSpinner=sc,x.AppProviderService=NS,x.AppTopBar=Zm,x.AppWrapper=og,x.AppWrapperRoute=WF,x.ArchiverService=GS,x.Auth=ml,x.AvatarUpload=uI,x.BatchActions=Km,x.Cache=Zd,x.ClientService=r0,x.ClipboardActions=Js,x.CompareSaveDialog=_P,x.ConflictDialog=Ba,x.ContextActionMenu=ta,x.ContextActions=Jm,x.ContextMenuQuickAction=yc,x.CreateLinkModal=em,x.CreateShortcutModal=sm,x.CustomComponentTarget=dg,x.DateFilter=GI,x.DatePickerModal=EF,x.EmojiPickerModal=Fm,x.EventBus=cf,x.FileInfo=mc,x.FilePickerModal=lm,x.FileSideBar=ng,x.FolderLoaderFavorites=Df,x.FolderLoaderSharedViaLink=Ff,x.FolderLoaderSharedWithMe=If,x.FolderLoaderSharedWithOthers=Pf,x.FolderLoaderSpace=Ef,x.FolderLoaderTrashbin=$f,x.FolderService=Of,x.FolderViewModeConstants=Et,x.HttpClient=gl,x.IdentitySchema=Cp,x.ImageDimension=fo,x.ImageType=PR,x.ItemFilter=zP,x.ItemFilterInline=ZI,x.ItemFilterToggle=qP,x.Key=Ln,x.LimitsSchema=xp,x.LinkRoleDropdown=Zh,x.LoadingEventTopics=vr,x.LoadingIndicator=KP,x.LoadingService=X0,x.MailCapabilitiesSchema=wp,x.MimeTypesToAppsSchema=of,x.MobileNav=Ym,x.Modifier=Fi,x.NoContentMessage=YP,x.Pagination=t$,x.PaginationConstants=Ss,x.PasswordPolicyService=G1,x.PreviewService=V1,x.PrimaryAccountsSchema=Rp,x.ProcessorType=bi,x.QuotaModal=xm,x.QuotaSelect=Tm,x.RESOURCE_MAX_CHARACTER_LENGTH=$R,x.RESOURCE_NAME_MAX_BYTES=Zl,x.RawConfigSchema=wS,x.RawGroupwareConfigSchema=IC,x.ResolveStrategy=hn,x.ResourceConflictModal=ld,x.ResourceGhostElement=vc,x.ResourceIcon=po,x.ResourceLink=Wi,x.ResourceListItem=ho,x.ResourceName=ec,x.ResourcePreview=rm,x.ResourceSize=ig,x.ResourceTable=vI,x.ResourceTile=lg,x.ResourceTiles=OI,x.ResourceTransfer=ud,x.RuntimeError=fs,x.SaveAsModal=fm,x.SearchBarFilter=i$,x.SearchLocationFilterConstants=zr,x.SideBar=tg,x.SideBarPanels=eg,x.SieveCapabilitiesSchema=Sp,x.SortConstants=yo,x.SpaceDetails=yP,x.SpaceDetailsMultiple=SP,x.SpaceImageModal=hm,x.SpaceInfo=hc,x.SpaceMoveInfoModal=ad,x.SpaceNoSelection=RP,x.SpaceQuota=cg,x.TextEditor=MP,x.ThemeConfig=CT,x.TransferType=Wn,x.UnsavedChangesModal=rg,x.UppyService=tk,x.UserAvatar=na,x.VersionCheck=p$,x.ViewOptions=Xm,x.VisibilityObserver=nm,x.WebDavDetails=ug,x.WebThemeConfig=Kp,x.activeApp=al,x.authContextValues=uS,x.blobToArrayBuffer=gp,x.breadcrumbsFromPath=SC,x.buildRoutes=$T,x.buildUrl=dS,x.cacheService=hl,x.canvasToBlob=yp,x.cloneStateObject=od,x.compareVersions=pl,x.concatBreadcrumbs=kC,x.contextQueryToFileContextProps=th,x.contextRouteNameKey=xi,x.contextRouteParamsKey=$l,x.contextRouteQueryKey=Ol,x.convertToMinimalUppyFile=ep,x.createDefaultFileIconMapping=fd,x.createFileRouteOptions=In,x.createFolderDummyFile=Zf,x.createLocation=ls,x.createLocationCommon=cs,x.createLocationPublic=us,x.createLocationShares=tn,x.createLocationSpaces=gn,x.createLocationTrash=gr,x.defaultFuseOptions=ja,x.defineWebApplication=Ag,x.determineResourceTableSortFields=rf,x.determineResourceTilesSortFields=OS,x.dirname=We.dirname,x.encodePath=dl,x.eventBus=Xe,x.extensionPoints=lP,x.fileSideBarSpaceDetailsTableExtensionPoint=bc,x.filterResources=jv,x.focusCheckbox=CS,x.folderService=Lf,x.formatDateFromDateTime=Nr,x.formatDateFromHTTP=CC,x.formatDateFromISO=pp,x.formatDateFromJSDate=fp,x.formatDateFromRFC=TC,x.formatFileSize=zt,x.formatRelativeDateFromDateTime=Xs,x.formatRelativeDateFromHTTP=xC,x.formatRelativeDateFromISO=AC,x.formatRelativeDateFromJSDate=hp,x.formatRelativeDateFromRFC=RC,x.getBackendVersion=vp,x.getExtensionNavItems=Pm,x.getLocaleFromLanguage=ki,x.getParentPaths=mp,x.getSharedAncestorRoute=kS,x.getSharedDriveItem=li,x.getSpacesByType=eo,x.getTextByteSize=Fl,x.getWebVersion=DC,x.isItemInCurrentFolder=pd,x.isLocationActive=IT,x.isLocationActiveDirector=as,x.isLocationCommonActive=mt,x.isLocationPublicActive=nn,x.isLocationSharesActive=pt,x.isLocationSpacesActive=rt,x.isLocationTrashActive=jt,x.isMacOs=Ys,x.isPromiseFulfilled=Br,x.isPromiseRejected=jr,x.isResourceBeeingMovedToSameLocation=cd,x.isSameResource=Bs,x.locationPublicLink=ol,x.locationPublicUpload=il,x.locationSharesViaLink=sl,x.locationSharesWithMe=ii,x.locationSharesWithOthers=rl,x.locationSpacesGeneric=nl,x.objectKeys=KS,x.parseVersion=fl,x.queryItemAsString=ot,x.renameResource=za,x.resolveFileNameDuplicate=pn,x.resourceIconMappingInjectionKey=dd,x.routeToContextQuery=Ai,x.setCurrentUserShareSpacePermissions=ef,x.sortFields=sf,x.sortHelper=Hm,x.sortSpaceMembers=Jp,x.translateSortFields=LS,x.triggerDownloadWithFilename=ul,x.useAbility=Lt,x.useActionsShowDetails=HE,x.useActiveApp=Jd,x.useActiveLocation=vn,x.useAppConfig=Gd,x.useAppDefaults=lh,x.useAppFileHandling=Ll,x.useAppFolderHandling=rh,x.useAppMeta=Nl,x.useAppNavigation=nh,x.useAppProviderService=QE,x.useAppsStore=Pn,x.useArchiverService=om,x.useAuthService=_l,x.useAuthStore=yr,x.useAvatarsStore=ai,x.useBreadcrumbsFromPath=KE,x.useCanBeOpenedWithSecureView=_m,x.useCanListShares=gm,x.useCanListVersions=Mm,x.useCanShare=ym,x.useCapabilityStore=Ct,x.useClientService=Ee,x.useClipboardStore=Zs,x.useConfigStore=Qe,x.useCopyLink=Xl,x.useCreateSpace=ms,x.useCropperKeyboardActions=Bl,x.useDeleteWorker=ch,x.useDocumentTitle=sh,x.useDownloadFile=nc,x.useDriveResolver=ah,x.useEmbedMode=wr,x.useEventBus=Sr,x.useExtensionPreferencesStore=bp,x.useExtensionRegistry=br,x.useFileActionFallbackToDownload=bm,x.useFileActions=bn,x.useFileActionsCopy=Di,x.useFileActionsCopyPermanentLink=jl,x.useFileActionsCreateLink=DR,x.useFileActionsCreateNewFile=FR,x.useFileActionsCreateNewFolder=IR,x.useFileActionsCreateNewShortcut=sE,x.useFileActionsCreateSpaceFromResource=tc,x.useFileActionsDelete=mo,x.useFileActionsDeleteResources=wm,x.useFileActionsDisableSync=Qi,x.useFileActionsDownloadArchive=Ki,x.useFileActionsDownloadFile=ws,x.useFileActionsEmptyTrashBin=oE,x.useFileActionsEnableSync=Gi,x.useFileActionsFavorite=rc,x.useFileActionsMove=Ji,x.useFileActionsNavigate=im,x.useFileActionsOpenShortcut=aE,x.useFileActionsOpenWithApp=um,x.useFileActionsOpenWithDefault=am,x.useFileActionsPaste=dm,x.useFileActionsRename=Xi,x.useFileActionsRestore=go,x.useFileActionsSaveAs=pm,x.useFileActionsSetImage=mm,x.useFileActionsShowActions=TE,x.useFileActionsShowDetails=oc,x.useFileActionsShowShares=ic,x.useFileActionsToggleHideShare=Yi,x.useFileActionsUndoDelete=vm,x.useFileListHeaderPosition=GE,x.useFileRouteReplace=Ci,x.useFolderLink=Tr,x.useGetMatchingSpace=Rt,x.useGetResourceContext=Nm,x.useGroupwareConfigStore=FC,x.useInterceptModifierClick=Vr,x.useIsAppActive=xE,x.useIsFilesAppActive=rr,x.useIsResourceNameValid=Wr,x.useIsSearchActive=Zi,x.useIsTopBarSticky=ac,x.useKeyboardActions=Ii,x.useLinkTypes=Hi,x.useLoadAvatars=Qm,x.useLoadPreview=cc,x.useLoadingService=Nt,x.useLocalStorage=Il,x.useMessages=Me,x.useModals=Ke,x.useNavItems=$m,x.useOpenEmptyEditor=WE,x.useOpenWithDefaultApp=Rm,x.usePagination=JE,x.usePasswordPolicyService=Om,x.usePasteWorker=uh,x.usePreviewService=Lm,x.useRequest=oh,x.useRequestHeaders=Ei,x.useResourceContents=jm,x.useResourceIndicators=zm,x.useResourceRouteResolver=cm,x.useResourceViewContextMenu=Vm,x.useResourceViewDrag=Um,x.useResourceViewHelpers=uc,x.useResourceViewSelection=qm,x.useResourcesStore=Re,x.useRestoreWorker=dh,x.useRoute=yt,x.useRouteMeta=Zp,x.useRouteName=Pl,x.useRouteParam=Ti,x.useRouteQuery=At,x.useRouteQueryPersisted=Xn,x.useRouter=Ae,x.useScrollTo=tm,x.useSearch=Ml,x.useSelectedResources=dc,x.useService=Gn,x.useSharesStore=Jn,x.useSideBar=Pt,x.useSort=sD,x.useSpaceActionsCreate=qE,x.useSpaceActionsDelete=Sm,x.useSpaceActionsDeleteImage=UE,x.useSpaceActionsDisable=km,x.useSpaceActionsDuplicate=Cm,x.useSpaceActionsEditDescription=RE,x.useSpaceActionsEditQuota=Am,x.useSpaceActionsEditReadmeContent=ME,x.useSpaceActionsNavigateToTrash=BE,x.useSpaceActionsRename=Em,x.useSpaceActionsRestore=Dm,x.useSpaceActionsSetIcon=VE,x.useSpaceActionsShowMembers=NE,x.useSpaceHelpers=Ri,x.useSpacesLoading=ih,x.useSpacesStore=Ue,x.useThemeStore=On,x.useTileSize=Bm,x.useTokenTimerWorker=NT,x.useUpdatesStore=Yp,x.useUpload=cD,x.useUserStore=Ze,x.useViewMode=tD,x.useViewSize=nD,x.useViewSizeMax=lc,x.useWebWorkersStore=no,x.useWindowOpen=Im,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));