text: (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vuetify-file-manager"]=t():e["vuetify-file-manager"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({1687:function(e,t,n){"use strict";var i=n("dae6"),o=n.n(i);o.a},2083:function(e,t,n){"use strict";var i=n("f04c"),o=n.n(i);o.a},"5ed8":function(e,t,n){"use strict";var i=n("f2b8"),o=n.n(i);o.a},"9da9":function(e,t,n){"use strict";var i=n("fac0"),o=n.n(i);o.a},a132:function(e,t,n){},dae6:function(e,t,n){},f04c:function(e,t,n){},f2b8:function(e,t,n){},f6b2:function(e,t,n){"use strict";var i=n("a132"),o=n.n(i);o.a},f6fd:function(e,t){(function(e){var t="currentScript",n=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(i){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(e in n)if(n[e].src==t||"interactive"==n[e].readyState)return n[e];return null}}})})(document)},fac0:function(e,t,n){},fb15:function(e,t,n){"use strict";var i;(n.r(t),"undefined"!==typeof window)&&(n("f6fd"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=i[1]));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-layout",{attrs:{"pa-0":"","ma-0":"","fill-height":""}},[n("v-flex",{attrs:{xs12:"",sm4:"",md3:"",xl2:""}},[n("v-layout",{staticClass:"grey lighten-4",staticStyle:{position:"relative"},attrs:{column:"","fill-height":"","pa-3":""}},[n("folders",{attrs:{"root-name":e.rootName,folders:e.folders,deleteFolder:e.deleteFolder,hasDeleteOption:e.hasDeleteFolderOption},on:{folderSelected:e.folderSelected}}),n("folder-create",e._g({attrs:{createFolder:e.createFolder,folders:e.folders},on:{folderCreated:e.callGetFolders}},e.$listeners))],1)],1),n("v-divider",{attrs:{vertical:""}}),n("v-flex",{attrs:{xs12:"",sm8:"",md9:"",xl10:""}},[n("v-layout",{attrs:{column:"","fill-height":"","pa-3":""}},[n("folder-view",e._g({attrs:{files:e.files,deleteImage:e.deleteImage,hasDeleteOption:e.hasDeleteImageOption}},e.$listeners))],1)],1)],1)},l=[],a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"folder-create-wrapper"},[n("v-tooltip",{attrs:{left:""},scopedSlots:e._u([{key:"activator",fn:function(t){var i=t.on;return[n("v-btn",e._g({staticClass:"createFolderBtn",attrs:{absolute:"",dark:"",fab:"",bottom:"",right:"",small:"",color:"accent"},on:{click:function(t){e.dialog=!0}}},i),[n("v-icon",[e._v("fa-plus")])],1)]}}])},[e._v(" "+e._s(e.$vuetify.lang.t("$vuetify.fileManager.folder.create"))+" ")]),n("v-dialog",{attrs:{width:"300px"},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[n("v-card",[n("v-card-title",[e._v(e._s(e.$vuetify.lang.t("$vuetify.fileManager.folder.create")))]),n("v-card-text",[n("v-text-field",{attrs:{label:e.$vuetify.lang.t("$vuetify.fileManager.name"),hint:e.$vuetify.lang.t("$vuetify.fileManager.folder.create")},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}}),n("v-select",{attrs:{items:e.foldersWithWebsiteParent,label:e.$vuetify.lang.t("$vuetify.fileManager.folder.upperFolder"),"item-text":"name","item-value":"id"},model:{value:e.parent,callback:function(t){e.parent=t},expression:"parent"}})],1),n("v-card-actions",[n("v-spacer"),n("v-btn",{attrs:{flat:"",color:"accent"},on:{click:e.callCreateFolder}},[e._v(e._s(e.$vuetify.lang.t("$vuetify.fileManager.folder.upperFolder")))])],1)],1)],1)],1)},r=[],s={name:"FolderCreate",props:{folders:{required:!0,type:Array},createFolder:{required:!0,type:Function}},data(){return{dialog:!1,name:"",parent:null}},computed:{foldersWithWebsiteParent(){return[...this.folders,{name:"Website",id:null}]}},methods:{callCreateFolder(){this.createFolder(this.name,this.parent).then(()=>{this.dialog=!1,this.$emit("folderCreated"),this.name=null,this.parent=null})}}},f=s;n("f6b2");function c(e,t,n,i,o,l,a,r){var s,f="function"===typeof e?e.options:e;if(t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),i&&(f.functional=!0),l&&(f._scopeId="data-v-"+l),a?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=s):o&&(s=r?function(){o.call(this,this.$root.$options.shadowRoot)}:o),s)if(f.functional){f._injectStyles=s;var c=f.render;f.render=function(e,t){return s.call(t),c(e,t)}}else{var d=f.beforeCreate;f.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:f}}var d=c(f,a,r,!1,null,"5b553739",null),u=d.exports,p=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("v-treeview",{attrs:{active:e.active,open:e.open,items:e.folderItems,activatable:""},on:{"update:active":function(t){e.active=t},"update:open":function(t){e.open=t}},scopedSlots:e._u([{key:"prepend",fn:function(t){var i=t.item,o=t.open;return[n("v-icon",{on:{contextmenu:function(t){return e.showContextMenu(t,i)}}},[e._v(" "+e._s(o?"fa-folder-open":"fa-folder")+" ")])]}},{key:"label",fn:function(t){var i=t.item;return[n("div",{on:{contextmenu:function(t){return e.showContextMenu(t,i)}}},[e._v(" "+e._s(i.name)+" ")])]}}])}),n("context-menu",{ref:"contextMenu",on:{showDeleteDialog:e.showDeleteDialog}}),n("delete-dialog",{ref:"deleteDialog",on:{deleted:e.deleteFolder}})],1)},v=[],m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-dialog",{attrs:{"max-width":"290"},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[n("v-card",[n("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$vuetify.lang.t("$vuetify.fileManager.confirmation_delete"))+" ")]),n("v-card-text",[e._v(" "+e._s(e.$vuetify.lang.t("$vuetify.fileManager.image.delete.warning"))+" ")]),n("v-card-actions",[n("v-btn",{attrs:{color:"grey darken-1",text:"",flat:""},on:{click:function(t){e.dialog=!1}}},[e._v(" "+e._s(e.$vuetify.lang.t("$vuetify.cancel"))+" ")]),n("v-spacer"),n("v-btn",{attrs:{color:"priamry darken-1",text:"",flat:""},on:{click:e.deleteItem}},[e._v(" "+e._s(e.$vuetify.lang.t("$vuetify.delete"))+" ")])],1)],1)],1)},h=[],g={name:"DeleteDialog",data:()=>({dialog:!1,item:null}),methods:{deleteItem(){this.dialog=!1,this.$emit("deleted",this.item)},show(e){this.item=e,this.dialog=!0}}},y=g,_=c(y,m,h,!1,null,"f3a16b4a",null),x=_.exports,b=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("v-menu",{attrs:{"position-x":e.x,"position-y":e.y,absolute:"","offset-y":""},model:{value:e.showMenu,callback:function(t){e.showMenu=t},expression:"showMenu"}},[n("v-list",{staticClass:"clickable"},[n("v-list-tile",[n("v-list-tile-title",{on:{click:function(t){return e.$emit("showDeleteDialog",e.item)}}},[n("v-icon",{staticClass:"red--text"},[e._v("far fa-trash-alt")]),e._v(" "+e._s(e.item?e.item.name:"")+" "+e._s(e.$vuetify.lang.t("$vuetify.delete"))+" ")],1)],1)],1)],1)],1)},w=[],$={name:"ContextMenu",data:()=>({showMenu:!1,x:0,y:0,item:null}),methods:{show(e,t){e.preventDefault(),this.showMenu=!1,this.item=t,this.x=e.clientX,this.y=e.clientY,this.$nextTick(()=>{this.showMenu=!0})}}},F=$,D=(n("5ed8"),c(F,b,w,!1,null,null,null)),C=D.exports,k={name:"folders",components:{DeleteDialog:x,ContextMenu:C},data(){return{active:[],open:[],folderItems:[]}},watch:{folders:{immediate:!0,deep:!0,handler(){this.folderItems=[{name:this.rootName,id:"root",children:this.folders}],this.open=["root"]}},active:{deep:!0,handler(e,t){let n=e[0];"undefined"===typeof n&&(n=t[0]),this.$emit("folderSelected",n)}}},props:{folders:{required:!0,type:Array},rootName:{required:!1,type:String,default:"Website"},deleteFolder:{required:!1,type:Function,default:()=>{}},hasDeleteOption:{required:!1,type:Boolean,default:!1}},methods:{showContextMenu(e,t){e.preventDefault(),this.hasDeleteOption&&this.$refs.contextMenu.show(e,t)},showDeleteDialog(e){this.$refs.deleteDialog.show(e)}}},S=k,M=(n("1687"),c(S,p,v,!1,null,null,null)),O=M.exports,j=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-container",{attrs:{"grid-list-md":"",fluid:"",id:"drop-area"},on:{drop:function(t){return t.preventDefault(),e.handleDrop(t)},dragover:function(e){e.preventDefault()}}},[e.files.length>0?n("v-layout",{attrs:{row:"",wrap:""}},e._l(e.files,(function(t){return n("file-view",e._g({attrs:{isRemovable:e.hasDeleteOption,file:t},on:{showDeleteDialog:e.showDeleteDialog}},e.$listeners))})),1):n("div",{staticClass:"text-xs-center"},[n("v-icon",{attrs:{size:"150"}},[e._v("fa-search")]),n("div",{staticClass:"mt-3 title"},[e._v(e._s(e.$vuetify.lang.t("$vuetify.fileManager.folder.empty")))])],1),n("delete-dialog",{ref:"deleteDialog",on:{deleted:e.deleteImage}})],1)},q=[],I=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-hover",{scopedSlots:e._u([{key:"default",fn:function(t){var i=t.hover;return n("v-flex",{staticClass:"text-xs-center file",staticStyle:{position:"relative"},attrs:{xs4:"",md3:"",lg2:"","pa-3":""}},[n("v-badge",{staticClass:"right px-2",staticStyle:{width:"100%"},attrs:{color:"transparant",transition:"scale-transition"},scopedSlots:e._u([{key:"badge",fn:function(){return[n("v-speed-dial",{staticClass:"mr-4",attrs:{openOnHover:"",direction:"bottom"},scopedSlots:e._u([{key:"activator",fn:function(){return[n("v-btn",{attrs:{color:"primary darken-2",dark:"",fab:"",small:""},model:{value:e.fab,callback:function(t){e.fab=t},expression:"fab"}},[n("v-icon",[e._v("fa-ellipsis-v")]),n("v-icon",[e._v("fa-times")])],1)]},proxy:!0}],null,!0),model:{value:e.fab,callback:function(t){e.fab=t},expression:"fab"}},[n("v-btn",{attrs:{fab:"",dark:"",small:"",color:"grey","x-small":""},on:{click:function(t){return e.$emit("download",e.file)}}},[n("v-icon",[e._v("fa-download")])],1),e.isRemovable?n("v-btn",{attrs:{fab:"",dark:"",small:"",color:"red","x-small":""},on:{click:function(t){return e.$emit("showDeleteDialog",e.file)}}},[n("v-icon",{on:{click:function(e){}}},[e._v("fa-trash")])],1):e._e()],1)]},proxy:!0}],null,!0),model:{value:i,callback:function(e){i=e},expression:"hover"}},[e.isImage?n("v-img",{staticClass:"mt-4",attrs:{height:72,src:e.file.preview_path+"?height=80"},on:{click:function(t){return e.$emit("select",e.file)}}}):n("v-icon",{staticClass:"mt-4",attrs:{size:72,color:"gray"},on:{click:function(t){return e.$emit("select",e.file)}}},[e._v(" fal "+e._s(e.icon)+" ")]),n("v-tooltip",{attrs:{right:""},scopedSlots:e._u([{key:"activator",fn:function(t){var i=t.on;return[n("div",e._g({staticClass:"subheading text-truncate"},i),[e._v(e._s(e.file.name))])]}}],null,!0)},[e._v(" "+e._s(e.file.name)+" ")])],1)],1)}}])})},E=[],P={name:"FileView",components:{ContextMenu:C},props:{file:{required:!0,type:Object},isRemovable:{required:!1,type:Boolean,default:!1}},data:()=>({fab:!1}),computed:{isImage(){return this.file.mime_type&&["image/png","image/jpeg","image/jpg"].includes(this.file.mime_type)},icon(){let e=this.file.mime_type,t={image:"fa-file-image",audio:"fa-file-audio",video:"fa-file-video","application/pdf":"fa-file-pdf","application/msword":"fa-file-word","application/vnd.ms-word":"fa-file-word","application/vnd.oasis.opendocument.text":"fa-file-word","application/vnd.openxmlformatsfficedocument.wordprocessingml":"fa-file-word","application/vnd.ms-excel":"fa-file-excel","application/vnd.openxmlformatsfficedocument.spreadsheetml":"fa-file-excel","application/vnd.oasis.opendocument.spreadsheet":"fa-file-excel","application/vnd.ms-powerpoint":"fa-file-powerpoint","application/vnd.openxmlformatsfficedocument.presentationml":"fa-file-powerpoint","application/vnd.oasis.opendocument.presentation":"fa-file-powerpoint","text/plain":"fa-file-alt","text/html":"fa-file-code","application/json":"fa-file-code","application/gzip":"fa-file-archive","application/zip":"fa-file-archive"};for(let n in t){if(!t.hasOwnProperty(n))return"fa-file";if(0===e.search(n))return t[n]}return"fa-file"}}},T=P,R=(n("9da9"),n("2083"),c(T,I,E,!1,null,"335f5621",null)),N=R.exports,W={name:"FolderView",components:{DeleteDialog:x,FileView:N,ContextMenu:C},props:{files:{required:!0,type:Array},deleteImage:{required:!1,type:Function,default:()=>{}},hasDeleteOption:{required:!1,type:Boolean,default:!1}},methods:{handleDrop(e){this.$emit("filesDropped",e.dataTransfer.files)},showDeleteDialog(e){this.$refs.deleteDialog.show(e)}}},V=W,B=c(V,j,q,!1,null,"1b2183e8",null),z=B.exports,G={name:"vuetify-file-manager",components:{FolderCreate:u,FolderView:z,Folders:O},data(){return{files:[],folders:[]}},props:{getFolders:{required:!0,type:Function},getFolderContent:{required:!0,type:Function},rootName:{required:!1,type:String,default:"Website"},createFolder:{required:!0,type:Function},deleteFolder:{required:!1,type:Function},deleteImage:{required:!1,type:Function}},computed:{selectedFolder(){return this.folders?this.folders[0].id:null},hasDeleteFolderOption(){return"function"===typeof this.deleteFolder},hasDeleteImageOption(){return"function"===typeof this.deleteImage}},methods:{folderSelected(e){this.getFolderContent(e).then(e=>{this.files=e})},callGetFolders(){this.getFolders().then(e=>{this.folders=e,this.folderSelected(e[0].id)})},reloadFiles(){this.folderSelected(this.selectedFolder)},reloadDirectory(){this.callGetFolders()}},created(){this.callGetFolders()}},A=G,X=c(A,o,l,!1,null,"9868c6d0",null),U=X.exports;const H={install(e,t){e.component("vuetify-file-manager",U)}};var Y=H;t["default"]=Y}})}));
  //# sourceMappingURL=vuetify-file-manager.umd.min.js.map