"use strict";(globalThis["webpackChunkaurora_corporate_mobile_ui"]||=[]).push([[4132],{54132(e,t,s){s.r(t),s.d(t,{default:()=>L});var i=s(61758),l=s(58790);const a={class:"dialog__title-text q-ma-lg"};function o(e,t,s,o,n,c){const h=(0,i.g2)("ButtonDialog"),d=(0,i.g2)("AppDialog");return(0,i.uX)(),(0,i.Wv)(d,{"data-test-id":"files-delete-dialog",close:c.closeDialog},{content:(0,i.k6)(()=>[(0,i.Lk)("div",a,[(0,i.Lk)("span",null,(0,l.v_)(c.title),1)])]),actions:(0,i.k6)(()=>[(0,i.bF)(h,{"data-test-id":"files-delete-confirm",class:"q-mr-sm q-mb-sm",saving:n.saving,action:c.deleteItems,label:e.$t("COREWEBCLIENT.ACTION_DELETE")},null,8,["saving","action","label"])]),_:1},8,["close"])}var n=s(15679),c=s(65210),h=s(484),d=s(35625),r=s(9090);const g={name:"DeleteItemsDialog",components:{ButtonDialog:r.A,AppDialog:d.A},props:{file:{type:Object,default:null},dialog:{type:Boolean,default:!1}},data(){return{saving:!1}},computed:{...(0,n.L8)(c.useFilesStore,["selectedFiles"]),itemsToDelete(){return this.selectedFiles.length>1?this.selectedFiles.filter(e=>e.sharedWithMeAccess===h.fk.NOACCESS):this.file?[this.file]:[]},title(){return this.selectedFiles.length>1?this.$tc("FILESWEBCLIENT.CONFIRM_DELETE_ITEMS_PLURAL",this.selectedFiles.length):this.file?.isFolder?this.$t("FILESWEBCLIENT.CONFIRM_DELETE_FOLDERS_PLURAL"):this.$t("FILESWEBCLIENT.CONFIRM_DELETE_FILES_PLURAL")}},methods:{...(0,n.i0)(c.useFilesStore,["asyncDeleteItems","changeItemsLists","selectFile"]),closeDialog(){this.$emit("closeDialog")},async deleteItems(){this.saving=!0;const e=this.itemsToDelete.map(e=>({Path:e.path,Name:e.name,IsFolder:e.isFolder})),t=await this.asyncDeleteItems({items:e});t&&(await this.changeItemsLists({items:this.selectedFiles.length?this.selectedFiles:[this.file]}),await this.selectFile(null),this.$emit("closeDialog")),this.saving=!1}}};var E=s(12807);const m=(0,E.A)(g,[["render",o]]),L=m}}]);