(window.webpackJsonp=window.webpackJsonp||[]).push([[132],{712:function(t,e,n){"use strict";n.r(e);n(17);var o={props:{libraryItemId:String,showFullPath:Boolean,file:{type:Object,default:function(){}},inModal:Boolean},data:function(){return{}},computed:{userToken:function(){return this.$store.getters["user/getToken"]},userCanDownload:function(){return this.$store.getters["user/getUserCanDownload"]},userCanDelete:function(){return this.$store.getters["user/getUserCanDelete"]},userIsAdmin:function(){return this.$store.getters["user/getIsAdminOrUp"]},downloadUrl:function(){return"".concat("/audiobookshelf","/api/items/").concat(this.libraryItemId,"/file/").concat(this.file.ino,"/download?token=").concat(this.userToken)},contextMenuItems:function(){var t=[];return this.userCanDownload&&t.push({text:this.$strings.LabelDownload,action:"download"}),this.userCanDelete&&t.push({text:this.$strings.ButtonDelete,action:"delete"}),this.userIsAdmin&&this.file.audioFile&&!this.inModal&&t.push({text:this.$strings.LabelMoreInfo,action:"more"}),t}},methods:{contextMenuAction:function(t){var e=t.action;"delete"===e?this.deleteLibraryFile():"download"===e?this.downloadLibraryFile():"more"===e&&this.$emit("showMore",this.file.audioFile)},deleteLibraryFile:function(){var t=this,e={message:this.$strings.MessageConfirmDeleteFile,callback:function(e){e&&t.$axios.$delete("/api/items/".concat(t.libraryItemId,"/file/").concat(t.file.ino)).then((function(){t.$toast.success(t.$strings.ToastDeleteFileSuccess)})).catch((function(e){console.error("Failed to delete file",e),t.$toast.error(t.$strings.ToastDeleteFileFailed)}))},type:"yesNo"};this.$store.commit("globals/setConfirmPrompt",e)},downloadLibraryFile:function(){this.$downloadFile(this.downloadUrl,this.file.metadata.filename)}},mounted:function(){}},r=n(4),component=Object(r.a)(o,(function(){var t=this,e=t._self._c;return e("tr",[e("td",{staticClass:"px-4"},[t._v("\n    "+t._s(t.showFullPath?t.file.metadata.path:t.file.metadata.relPath)+"\n  ")]),t._v(" "),e("td",[t._v("\n    "+t._s(t.$bytesPretty(t.file.metadata.size))+"\n  ")]),t._v(" "),e("td",{staticClass:"text-xs"},[e("div",{staticClass:"flex items-center"},[e("p",[t._v(t._s(t.file.fileType))])])]),t._v(" "),t.contextMenuItems.length?e("td",{staticClass:"text-center"},[e("ui-context-menu-dropdown",{attrs:{items:t.contextMenuItems,"menu-width":110},on:{action:t.contextMenuAction}})],1):t._e()])}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{UiContextMenuDropdown:n(349).default})}}]);