vuefinder 2.2.7 → 2.3.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.
@@ -1 +1 @@
1
- "use strict";var J=Object.defineProperty;var X=(d,t,o)=>t in d?J(d,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):d[t]=o;var I=(d,t,o)=>(X(d,typeof t!="symbol"?t+"":t,o),o);const e=require("vue"),Q=require("mitt"),Z=require("dragselect"),ee=require("vanilla-lazyload");require("cropperjs/dist/cropper.css");const te=require("cropperjs"),oe=require("@uppy/core"),re=require("@uppy/xhr-upload");require("microtip/microtip.css");var P;const H=(P=document.querySelector('meta[name="csrf-token"]'))==null?void 0:P.getAttribute("content");class ae{constructor(t){I(this,"config");this.config=t}get config(){return this.config}transformRequestParams(t){const o=this.config,a={};H!=null&&H!==""&&(a[o.xsrfHeaderName]=H);const r=Object.assign({},o.headers,a,t.headers),l=Object.assign({},o.params,t.params),c=t.body,s=o.baseUrl+t.url,n=t.method;let i;n!=="get"&&(c instanceof FormData?(i=c,o.body!=null&&Object.entries(this.config.body).forEach(([f,h])=>{i.append(f,h)})):(i={...c},o.body!=null&&Object.assign(i,this.config.body)));const p={url:s,method:n,headers:r,params:l,body:i};if(o.transformRequest!=null){const f=o.transformRequest({url:s,method:n,headers:r,params:l,body:i});f.url!=null&&(p.url=f.url),f.method!=null&&(p.method=f.method),f.params!=null&&(p.params=f.params??{}),f.headers!=null&&(p.headers=f.headers??{}),f.body!=null&&(p.body=f.body)}return p}getDownloadUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"download",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}getPreviewUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"preview",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}async send(t){const o=this.transformRequestParams(t),a=t.responseType||"json",r={method:t.method,headers:o.headers,signal:t.abortSignal},l=o.url+"?"+new URLSearchParams(o.params);if(o.method!=="get"&&o.body!=null){let s;o.body instanceof FormData?s=t.body:(s=JSON.stringify(o.body),r.headers["Content-Type"]="application/json"),r.body=s}const c=await fetch(l,r);if(c.ok)return await c[a]();throw await c.json()}}function ne(d){const t={baseUrl:"",headers:{},params:{},body:{},xsrfHeaderName:"X-CSRF-Token"};return typeof d=="string"?Object.assign(t,{baseUrl:d}):Object.assign(t,d),new ae(t)}function le(d){let t=localStorage.getItem(d+"_storage");const o=e.reactive(JSON.parse(t??"{}"));e.watch(o,a);function a(){Object.keys(o).length?localStorage.setItem(d+"_storage",JSON.stringify(o)):localStorage.removeItem(d+"_storage")}function r(n,i){o[n]=i}function l(n){delete o[n]}function c(){Object.keys(o).map(n=>l(n))}return{getStore:(n,i=null)=>o.hasOwnProperty(n)?o[n]:i,setStore:r,removeStore:l,clearStore:c}}async function se(d,t){const o=t[d];return typeof o=="function"?(await o()).default:o}function ie(d,t,o,a){const{getStore:r,setStore:l}=d,c=e.ref({}),s=e.ref(r("locale",t)),n=(f,h=t)=>{se(f,a).then(g=>{c.value=g,l("locale",f),s.value=f,l("translations",g),Object.values(a).length>1&&(o.emit("vf-toast-push",{label:"The language is set to "+f}),o.emit("vf-language-saved"))}).catch(g=>{h?(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),n(h,null)):o.emit("vf-toast-push",{label:"Locale cannot be loaded!",type:"error"})})};!r("locale")&&!a.length?n(t):c.value=r("translations");const i=(f,...h)=>h.length?i(f=f.replace("%s",h.shift()),...h):f;function p(f,...h){return c.value&&c.value.hasOwnProperty(f)?i(c.value[f],...h):i(f,...h)}return{t:p,changeLocale:n,locale:s}}const $={EDIT:"edit",NEW_FILE:"newfile",NEW_FOLDER:"newfolder",PREVIEW:"preview",ARCHIVE:"archive",UNARCHIVE:"unarchive",SEARCH:"search",RENAME:"rename",UPLOAD:"upload",DELETE:"delete",FULL_SCREEN:"fullscreen",DOWNLOAD:"download",LANGUAGE:"language"},ce=Object.values($),de="2.2.7";function W(d,t,o,a,r){return(t=Math,o=t.log,a=1024,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"iB":"B")}function G(d,t,o,a,r){return(t=Math,o=t.log,a=1e3,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"B":"B")}function ue(d){const t={k:1,m:2,g:3,t:4},a=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(d);return a[1]*Math.pow(1024,t[a[2].toLowerCase()])}const j={SYSTEM:"system",LIGHT:"light",DARK:"dark"};function me(d,t){const o=e.ref(j.SYSTEM),a=e.ref(j.LIGHT);o.value=d.getStore("theme",t??j.SYSTEM);const r=window.matchMedia("(prefers-color-scheme: dark)"),l=c=>{o.value===j.DARK||o.value===j.SYSTEM&&c.matches?a.value=j.DARK:a.value=j.LIGHT};return l(r),r.addEventListener("change",l),{value:o,actualValue:a,set(c){o.value=c,c!==j.SYSTEM?d.setStore("theme",c):d.removeStore("theme"),l(r)}}}const pe=(d,t)=>{const o=le(d.id),a=Q(),r=o.getStore("metricUnits",!1),l=me(o,d.theme),c=t.i18n,s=d.locale??t.locale,n=e.computed(()=>ie(o,s,a,c)),i=f=>Array.isArray(f)?f:ce,p=d.persist?o.getStore("path",d.path):d.path;return e.reactive({version:de,root:null,debug:d.debug,emitter:a,features:i(d.features),requester:ne(d.request),theme:l,view:o.getStore("viewport","grid"),fullScreen:o.getStore("full-screen",d.fullScreen),selectButton:d.selectButton,metricUnits:r,filesize:r?G:W,maxFileSize:d.maxFileSize,loading:!1,i18n:n,modal:{active:!1,type:"delete",data:{}},adapter:o.getStore("adapter"),path:p,persist:d.persist,storage:o,data:{adapter:o.getStore("adapter"),storages:[],dirname:p,files:[]},selectedItems:[]})},fe={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},ve={key:0,class:"flex text-center"},he=["aria-label"],ge=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1),ke=[ge],ye=["aria-label"],_e=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1),xe=[_e],we=["aria-label"],be=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1),Ee=[be],Ve=["aria-label"],Ne=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),Be=[Ne],$e=["aria-label"],Ce=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1),Se=[Ce],De=["aria-label"],Me=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),je=[Me],Te=["aria-label"],Le=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),Fe=[Le],ze={key:1,class:"flex text-center"},Ae={class:"pl-2"},Oe={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Ue={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},He=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),Re=e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),qe=[He,Re],Ie={class:"flex text-center items-center justify-end"},Pe=["aria-label"],We={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ge={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"},Ye={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},Ke=["aria-label"],Je={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"},Xe={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"},Qe={name:"VFToolbar"},Ze=Object.assign(Qe,{setup(d){const t=e.inject("ServiceContainer"),{setStore:o}=t.storage,{t:a}=t.i18n,r=e.ref([]),l=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{l.value=n});const c=()=>{t.fullScreen=!t.fullScreen,o("full-screen",t.fullScreen),t.emitter.emit("vf-fullscreen-toggle")};t.emitter.on("vf-nodes-selected",n=>{r.value=n});const s=()=>{t.view=t.view==="list"?"grid":"list",o("viewport",t.view)};return(n,i)=>(e.openBlock(),e.createElementBlock("div",fe,[l.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",Ae,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Oe,e.toDisplayString(l.value),1)]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("svg",Ue,qe)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ve,[e.unref(t).features.includes(e.unref($).NEW_FOLDER)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:i[0]||(i[0]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-folder",items:r.value}))},ke,8,he)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).NEW_FILE)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[1]||(i[1]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-file",items:r.value}))},xe,8,ye)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).RENAME)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[2]||(i[2]=p=>r.value.length!=1||e.unref(t).emitter.emit("vf-modal-show",{type:"rename",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ee,2))],8,we)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).DELETE)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[3]||(i[3]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"delete",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Be,2))],8,Ve)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).UPLOAD)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[4]||(i[4]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"upload",items:r.value}))},Se,8,$e)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).UNARCHIVE)&&r.value.length==1&&r.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:5,class:"mx-1.5","aria-label":e.unref(a)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[5]||(i[5]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"unarchive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},je,2))],8,De)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).ARCHIVE)?(e.openBlock(),e.createElementBlock("div",{key:6,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[6]||(i[6]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"archive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Fe,2))],8,Te)):e.createCommentVNode("",!0)])),e.createElementVNode("div",Ie,[e.unref(t).features.includes(e.unref($).FULL_SCREEN)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:c},[(e.openBlock(),e.createElementBlock("svg",We,[e.unref(t).fullScreen?(e.openBlock(),e.createElementBlock("path",Ge)):(e.openBlock(),e.createElementBlock("path",Ye))]))],8,Pe)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:i[7]||(i[7]=p=>l.value.length||s())},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.unref(t).view==="grid"?(e.openBlock(),e.createElementBlock("path",Je)):e.createCommentVNode("",!0),e.unref(t).view==="list"?(e.openBlock(),e.createElementBlock("path",Xe)):e.createCommentVNode("",!0)],2))],8,Ke)])]))}}),et=(d,t=0,o=!1)=>{let a;return(...r)=>{o&&!a&&d(...r),clearTimeout(a),a=setTimeout(()=>{d(...r)},t)}},tt=(d,t,o)=>{const a=e.ref(d);return e.customRef((r,l)=>({get(){return r(),a.value},set:et(c=>{a.value=c,l()},t,o)}))},ot={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-sm"},rt=["aria-label"],at=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1),nt=[at],lt=["aria-label"],st=e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"},null,-1),it=[st],ct=["aria-label"],dt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),ut=[dt],mt=e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1),pt=[mt],ft={class:"flex leading-6"},vt=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),ht=["onDragover","onDragleave","onDrop","title","onClick"],gt={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},kt=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),yt=e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),_t=[kt,yt],xt={key:3,class:"relative flex bg-white dark:bg-gray-700 justify-between items-center rounded p-1 ml-2 w-full"},wt=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})])],-1),bt=["placeholder"],Et=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),Vt=[Et],Nt={name:"VFBreadcrumb"},Bt=Object.assign(Nt,{setup(d){const t=e.ref(null),o=e.ref([]),a=e.ref(!1),r=e.ref(null),l=e.inject("ServiceContainer"),{t:c}=l.i18n;l.emitter.on("vf-explorer-update",()=>{let _=[],m=[];t.value=l.data.dirname??l.adapter+"://",t.value.length==0&&(o.value=[]),t.value.replace(l.adapter+"://","").split("/").forEach(function(u){_.push(u),_.join("/")!=""&&m.push({basename:u,name:u,path:l.adapter+"://"+_.join("/"),type:"dir"})}),m.length>4&&(m=m.slice(-5),m[0].name=".."),o.value=m});const s=()=>{a.value=!1,i.value=""};l.emitter.on("vf-search-exit",()=>{s()});const n=()=>{l.features.includes($.SEARCH)&&(a.value=!0,e.nextTick(()=>r.value.focus()))},i=tt("",400);e.watch(i,_=>{l.emitter.emit("vf-toast-clear"),l.emitter.emit("vf-search-query",{newQuery:_})});const p=()=>o.value.length&&!a.value,f=(_,m=null)=>{_.preventDefault(),g(_),m??(m=o.value.length-2);let u=JSON.parse(_.dataTransfer.getData("items"));if(u.find(B=>B.storage!==l.adapter)){alert("Moving items between different storages is not supported yet.");return}l.emitter.emit("vf-modal-show",{type:"move",items:{from:u,to:o.value[m]??{path:l.adapter+"://"}}})},h=_=>{_.preventDefault(),p()?(_.dataTransfer.dropEffect="copy",_.currentTarget.classList.add("bg-blue-200","dark:bg-slate-500")):(_.dataTransfer.dropEffect="none",_.dataTransfer.effectAllowed="none")},g=_=>{_.preventDefault(),_.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500"),p()&&_.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500")},w=()=>{i.value==""&&s()};return(_,m)=>(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("span",{"aria-label":e.unref(c)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:m[0]||(m[0]=u=>h(u)),onDragleave:m[1]||(m[1]=u=>g(u)),onDrop:m[2]||(m[2]=u=>f(u)),onClick:m[3]||(m[3]=u=>{var B;return!p()||e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:((B=o.value[o.value.length-2])==null?void 0:B.path)??e.unref(l).adapter+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",p()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nt,34))],8,rt),e.unref(l).loading?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(c)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:m[5]||(m[5]=u=>e.unref(l).emitter.emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer"},ut))],8,ct)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(c)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:m[4]||(m[4]=u=>{e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:e.unref(l).data.dirname}})}),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},it))],8,lt)),a.value?(e.openBlock(),e.createElementBlock("div",xt,[wt,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:r,onKeydown:e.withKeys(s,["esc"]),onBlur:w,"onUpdate:modelValue":m[10]||(m[10]=u=>e.isRef(i)?i.value=u:null),placeholder:e.unref(c)("Search anything.."),class:"w-full pb-0 px-1 border-0 text-base ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,bt),[[e.vModelText,e.unref(i)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:s,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Vt))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(n,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onDragover:m[6]||(m[6]=u=>h(u)),onDragleave:m[7]||(m[7]=u=>g(u)),onDrop:m[8]||(m[8]=u=>f(u,-1)),onClick:m[9]||(m[9]=u=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter}})),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pt,32)),e.createElementVNode("div",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(u,B)=>(e.openBlock(),e.createElementBlock("div",{key:B},[vt,e.createElementVNode("span",{onDragover:C=>B===o.value.length-1||h(C),onDragleave:C=>B===o.value.length-1||g(C),onDrop:C=>B===o.value.length-1||f(C,B),class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",title:u.basename,onClick:C=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:u.path}})},e.toDisplayString(u.name),41,ht)]))),128))]),e.unref(l).loading?(e.openBlock(),e.createElementBlock("svg",gt,_t)):e.createCommentVNode("",!0)]))]))}}),Y=(d,t=null)=>new Date(d*1e3).toLocaleString(t??navigator.language??"en-US"),$t={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Ct=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1),St=[Ct],Dt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Mt=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1),jt=[Mt],Tt={name:"VFSortIcon"},O=Object.assign(Tt,{props:{direction:String},setup(d){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[d.direction==="down"?(e.openBlock(),e.createElementBlock("svg",$t,St)):e.createCommentVNode("",!0),d.direction==="up"?(e.openBlock(),e.createElementBlock("svg",Dt,jt)):e.createCommentVNode("",!0)]))}}),Lt=["onClick"],Ft={name:"VFToast.vue"},zt=Object.assign(Ft,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o}=t.storage,a=e.ref(o("full-screen",!1)),r=e.ref([]),l=n=>n==="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",c=n=>{r.value.splice(n,1)},s=n=>{let i=r.value.findIndex(p=>p.id===n);i!==-1&&c(i)};return t.emitter.on("vf-toast-clear",()=>{r.value=[]}),t.emitter.on("vf-toast-push",n=>{let i=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");n.id=i,r.value.push(n),setTimeout(()=>{s(i)},5e3)}),(n,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value.value?"fixed":"absolute","bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(p,f)=>(e.openBlock(),e.createElementBlock("div",{onClick:h=>c(f),key:p,class:e.normalizeClass([l(p.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(p.label),11,Lt))),128))]),_:1})],2))}});function q(d,t=14){let o=`((?=([\\w\\W]{0,${t}}))([\\w\\W]{${t+1},})([\\w\\W]{8,}))`;return d.replace(new RegExp(o),"$2..$4")}const At={class:"relative flex-auto flex flex-col overflow-hidden"},Ot={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Ut={class:"absolute"},Ht=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})],-1),Rt={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},qt=["onDblclick","onContextmenu","data-type","data-item","data-index"],It={class:"grid grid-cols-12 items-center"},Pt={class:"flex col-span-7 items-center"},Wt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Gt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Yt=[Gt],Kt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Jt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Xt=[Jt],Qt={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Zt={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},eo=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],to={class:"grid grid-cols-12 items-center"},oo={class:"flex col-span-7 items-center"},ro={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ao=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),no=[ao],lo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},so=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),io=[so],co={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},uo={class:"col-span-2 text-center"},mo={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},po=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],fo={class:"relative"},vo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ho=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),go=[ho],ko=["data-src","alt"],yo={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},_o=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),xo=[_o],wo={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},bo={class:"break-all"},Eo={name:"VFExplorer"},Vo=Object.assign(Eo,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=k=>k==null?void 0:k.substring(0,3),r=e.ref(null),l=e.ref(null),c=e.ref(0),s=e.ref(null),n=Math.floor(Math.random()*2**32),i=e.ref("");let p;t.emitter.on("vf-fullscreen-toggle",()=>{r.value.style.height=null}),t.emitter.on("vf-search-query",({newQuery:k})=>{i.value=k,k?t.emitter.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:k},onSuccess:b=>{b.files.length||t.emitter.emit("vf-toast-push",{label:o("No search result found.")})}}):t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let f=null;const h=()=>{f&&clearTimeout(f)},g=e.ref(!0),w=k=>{k.touches.length>1&&(g.value?(s.value.stop(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: off")})):(s.value.start(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: on")}),t.emitter.emit("vf-explorer-update")),g.value=!g.value)},_=k=>{f=setTimeout(()=>{const b=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:k.target.getBoundingClientRect().x,clientY:k.target.getBoundingClientRect().y});k.target.dispatchEvent(b)},500)},m=k=>{k.type==="dir"?(t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:k.path}})):t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:k})},u=e.reactive({active:!1,column:"",order:""}),B=(k=!0)=>{let b=[...t.data.files],y=u.column,E=u.order=="asc"?1:-1;if(!k)return b;const x=(v,V)=>typeof v=="string"&&typeof V=="string"?v.toLowerCase().localeCompare(V.toLowerCase()):v<V?-1:v>V?1:0;return u.active&&(b=b.slice().sort((v,V)=>x(v[y],V[y])*E)),b},C=k=>{u.active&&u.column==k?(u.active=u.order=="asc",u.column=k,u.order="desc"):(u.active=!0,u.column=k,u.order="asc")},M=()=>s.value.getSelection().map(k=>JSON.parse(k.dataset.item)),L=(k,b)=>{if(k.altKey||k.ctrlKey||k.metaKey)return k.preventDefault(),!1;k.dataTransfer.setDragImage(l.value,0,15),k.dataTransfer.effectAllowed="all",k.dataTransfer.dropEffect="copy",k.dataTransfer.setData("items",JSON.stringify(M()))},F=(k,b)=>{k.preventDefault();let y=JSON.parse(k.dataTransfer.getData("items"));if(y.find(E=>E.storage!==t.adapter)){alert("Moving items between different storages is not supported yet.");return}t.emitter.emit("vf-modal-show",{type:"move",items:{from:y,to:b}})},z=(k,b)=>{k.preventDefault(),!b||b.type!=="dir"||s.value.getSelection().find(y=>y==k.currentTarget)?(k.dataTransfer.dropEffect="none",k.dataTransfer.effectAllowed="none"):k.dataTransfer.dropEffect="copy"},A=()=>{s.value=new Z({area:r.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),t.emitter.on("vf-explorer-update",()=>e.nextTick(()=>{s.value.clearSelection(),s.value.setSettings({selectables:document.getElementsByClassName("vf-item-"+n)})})),s.value.subscribe("predragstart",({event:k,isDragging:b})=>{if(b)c.value=s.value.getSelection().length,s.value.break();else{const y=k.target.offsetWidth-k.offsetX,E=k.target.offsetHeight-k.offsetY;y<15&&E<15&&(s.value.clearSelection(),s.value.break())}}),s.value.subscribe("predragmove",({isDragging:k})=>{k&&s.value.break()}),s.value.subscribe("callback",({items:k,event:b,isDragging:y})=>{t.emitter.emit("vf-nodes-selected",M()),c.value=s.value.getSelection().length})};return e.onMounted(()=>{p=new ee(r.value),A()}),e.onUpdated(()=>{s.value.Area.reset(),s.value.SelectorArea.updatePos(),p.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>t.emitter.emit("vf-explorer-update"))}),e.onBeforeUnmount(()=>{p.destroy()}),(k,b)=>(e.openBlock(),e.createElementBlock("div",At,[e.unref(t).view=="list"||i.value.length?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",{onClick:b[0]||(b[0]=y=>C("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Name"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="basename"]])]),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b[1]||(b[1]=y=>C("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Size"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="file_size"]])])),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:b[2]||(b[2]=y=>C("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Date"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="last_modified"]])])),i.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:b[3]||(b[3]=y=>C("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Filepath"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ut,[e.createElementVNode("div",{ref_key:"dragImage",ref:l,class:"absolute -z-50 -top-96"},[Ht,e.createElementVNode("div",Rt,e.toDisplayString(c.value),1)],512)]),e.createElementVNode("div",{onTouchstart:w,onContextmenu:b[10]||(b[10]=e.withModifiers(y=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:y,area:r.value,items:M()}),["self","prevent"])),class:e.normalizeClass([e.unref(t).fullScreen?"":"resize-y","h-full w-full text-xs vf-selector-area vf-scrollbar min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:r},[i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B(),(y,E)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:x=>m(y),onTouchstart:b[4]||(b[4]=x=>_(x)),onTouchend:b[5]||(b[5]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:y}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":y.type,"data-item":JSON.stringify(y),"data-index":E},[e.createElementVNode("div",It,[e.createElementVNode("div",Pt,[y.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Wt,Yt)):(e.openBlock(),e.createElementBlock("svg",Kt,Xt)),e.createElementVNode("span",Qt,e.toDisplayString(y.basename),1)]),e.createElementVNode("div",Zt,e.toDisplayString(y.path),1)])],42,qt))),256)):e.createCommentVNode("",!0),e.unref(t).view==="list"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B(),(y,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:x=>m(y),onTouchstart:b[6]||(b[6]=x=>_(x)),onTouchend:b[7]||(b[7]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:y}),["prevent"]),onDragstart:x=>L(x),onDragover:x=>z(x,y),onDrop:x=>F(x,y),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":y.type,"data-item":JSON.stringify(y),"data-index":E},[e.createElementVNode("div",to,[e.createElementVNode("div",oo,[y.type==="dir"?(e.openBlock(),e.createElementBlock("svg",ro,no)):(e.openBlock(),e.createElementBlock("svg",lo,io)),e.createElementVNode("span",co,e.toDisplayString(y.basename),1)]),e.createElementVNode("div",uo,e.toDisplayString(y.file_size?e.unref(t).filesize(y.file_size):""),1),e.createElementVNode("div",mo,e.toDisplayString(e.unref(Y)(y.last_modified)),1)])],42,eo))),256)):e.createCommentVNode("",!0),e.unref(t).view==="grid"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(B(!1),(y,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:x=>m(y),onTouchstart:b[8]||(b[8]=x=>_(x)),onTouchend:b[9]||(b[9]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:y}),["prevent"]),onDragstart:x=>L(x),onDragover:x=>z(x,y),onDrop:x=>F(x,y),class:e.normalizeClass(["vf-item-"+e.unref(n),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":y.type,"data-item":JSON.stringify(y),"data-index":E},[e.createElementVNode("div",null,[e.createElementVNode("div",fo,[y.type==="dir"?(e.openBlock(),e.createElementBlock("svg",vo,go)):(y.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(t).requester.getPreviewUrl(e.unref(t).adapter,y),alt:y.basename,key:y.path},null,8,ko)):(e.openBlock(),e.createElementBlock("svg",yo,xo)),!(y.mime_type??"").startsWith("image")&&y.type!="dir"?(e.openBlock(),e.createElementBlock("div",wo,e.toDisplayString(a(y.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",bo,e.toDisplayString(e.unref(q)(y.basename)),1)])],42,po))),256)):e.createCommentVNode("",!0)],34),e.createVNode(zt)]))}}),No=["href","download"],Bo=["onClick"],$o={name:"VFContextMenu"},Co=Object.assign($o,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(null),r=e.ref([]),l=e.ref(""),c=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),s=e.computed(()=>c.items.filter(f=>f.key==null||t.features.includes(f.key)));t.emitter.on("vf-context-selected",f=>{r.value=f});const n={newfolder:{key:$.NEW_FOLDER,title:()=>o("New Folder"),action:()=>{t.emitter.emit("vf-modal-show",{type:"new-folder"})}},delete:{key:$.DELETE,title:()=>o("Delete"),action:()=>{t.emitter.emit("vf-modal-show",{type:"delete",items:r})}},refresh:{title:()=>o("Refresh"),action:()=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})}},preview:{key:$.PREVIEW,title:()=>o("Preview"),action:()=>{t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:r.value[0]})}},open:{title:()=>o("Open"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:r.value[0].path}})}},openDir:{title:()=>o("Open containing folder"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:r.value[0].dir}})}},download:{key:$.DOWNLOAD,link:e.computed(()=>t.requester.getDownloadUrl(t.data.adapter,r.value[0])),title:()=>o("Download"),action:()=>{}},archive:{key:$.ARCHIVE,title:()=>o("Archive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"archive",items:r})}},unarchive:{key:$.UNARCHIVE,title:()=>o("Unarchive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"unarchive",items:r})}},rename:{key:$.RENAME,title:()=>o("Rename"),action:()=>{t.emitter.emit("vf-modal-show",{type:"rename",items:r})}}},i=f=>{t.emitter.emit("vf-contextmenu-hide"),f.action()};t.emitter.on("vf-search-query",({newQuery:f})=>{l.value=f}),t.emitter.on("vf-contextmenu-show",({event:f,area:h,items:g,target:w=null})=>{if(c.items=[],l.value)if(w)c.items.push(n.openDir),t.emitter.emit("vf-context-selected",[w]);else return;else!w&&!l.value?(c.items.push(n.refresh),c.items.push(n.newfolder),t.emitter.emit("vf-context-selected",[])):g.length>1&&g.some(_=>_.path===w.path)?(c.items.push(n.refresh),c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",g)):(w.type=="dir"?c.items.push(n.open):(c.items.push(n.preview),c.items.push(n.download)),c.items.push(n.rename),w.mime_type=="application/zip"?c.items.push(n.unarchive):c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",[w]));p(f,h)}),t.emitter.on("vf-contextmenu-hide",()=>{c.active=!1});const p=(f,h)=>{c.active=!0,e.nextTick(()=>{const g=t.root.getBoundingClientRect(),w=h.getBoundingClientRect();let _=f.pageX-g.left,m=f.pageY-g.top,u=a.value.offsetHeight,B=a.value.offsetWidth;_=w.right-f.pageX+window.scrollX<B?_-B:_,m=w.bottom-f.pageY+window.scrollY<u?m-u:m,c.positions={left:_+"px",top:m+"px"}})};return(f,h)=>c.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:a,style:e.normalizeStyle(c.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,g=>(e.openBlock(),e.createElementBlock("li",{class:"cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:g.title},[g.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"block pl-2 pr-3 py-1",target:"_blank",href:g.link,download:g.link,onClick:h[0]||(h[0]=w=>e.unref(t).emitter.emit("vf-contextmenu-hide"))},[e.createElementVNode("span",null,e.toDisplayString(g.title()),1)],8,No)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pl-2 pr-3 py-1",onClick:w=>i(g)},[e.createElementVNode("span",null,e.toDisplayString(g.title()),1)],8,Bo))]))),128))],4)):e.createCommentVNode("",!0)}}),So={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Do={class:"flex leading-5 items-center"},Mo=["aria-label"],jo=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1),To=[jo],Lo=["value"],Fo={class:"ml-3"},zo={key:0},Ao={class:"ml-1"},Oo={class:"flex leading-5 items-center justify-end"},Uo=["disabled"],Ho=["aria-label"],Ro=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 stroke-slate-500 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),qo=[Ro],Io={name:"VFStatusbar"},Po=Object.assign(Io,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,{setStore:a}=t.storage,r=e.ref(0),l=()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.adapter}}),a("adapter",t.adapter)};t.emitter.on("vf-nodes-selected",n=>{r.value=n.length});const c=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{c.value=n});const s=e.computed(()=>{const n=t.selectButton.multiple?t.selectedItems.length>0:t.selectedItems.length===1;return t.selectButton.active&&n});return(n,i)=>(e.openBlock(),e.createElementBlock("div",So,[e.createElementVNode("div",Do,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(o)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},To,8,Mo),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i[0]||(i[0]=p=>e.unref(t).adapter=p),onChange:l,class:"py-0.5 text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).data.storages,p=>(e.openBlock(),e.createElementBlock("option",{value:p},e.toDisplayString(p),9,Lo))),256))],544),[[e.vModelSelect,e.unref(t).adapter]]),e.createElementVNode("div",Fo,[c.value.length?(e.openBlock(),e.createElementBlock("span",zo,e.toDisplayString(e.unref(t).data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Ao,e.toDisplayString(r.value>0?e.unref(o)("%s item(s) selected.",r.value):""),1)])]),e.createElementVNode("div",Oo,[e.unref(t).selectButton.active?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vf-btn py-0 vf-btn-primary",{disabled:!s.value}]),disabled:!s.value,onClick:i[1]||(i[1]=p=>e.unref(t).selectButton.click(e.unref(t).selectedItems,p))},e.toDisplayString(e.unref(o)("Select")),11,Uo)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(o)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:i[2]||(i[2]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"about"}))},qo,8,Ho)])]))}}),Wo={name:"VueFinder"},Go=Object.assign(Wo,{props:{id:{type:String,default:"vf"},request:{type:[String,Object],required:!0},persist:{type:Boolean,default:!1},path:{type:String,default:"."},features:{type:[Array,Boolean],default:!0},debug:{type:Boolean,default:!1},theme:{type:String,default:"system"},locale:{type:String,default:null},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},fullScreen:{type:Boolean,default:!1},selectButton:{type:Object,default(d){return{active:!1,multiple:!1,click:t=>{},...d}}}},emits:["select"],setup(d,{emit:t}){const o=t,r=pe(d,e.inject("VueFinderOptions"));e.provide("ServiceContainer",r);const{setStore:l}=r.storage,c=e.ref(null);r.root=c,r.i18n,r.emitter.on("vf-modal-close",()=>{r.modal.active=!1}),r.emitter.on("vf-modal-show",i=>{r.modal.active=!0,r.modal.type=i.type,r.modal.data=i});const s=i=>{Object.assign(r.data,i),r.emitter.emit("vf-nodes-selected",{}),r.emitter.emit("vf-explorer-update")};r.emitter.on("vf-nodes-selected",i=>{r.selectedItems=i,o("select",i)});let n;return r.emitter.on("vf-fetch-abort",()=>{n.abort(),r.loading=!1}),r.emitter.on("vf-fetch",({params:i,body:p=null,onSuccess:f=null,onError:h=null,noCloseModal:g=!1})=>{["index","search"].includes(i.q)&&(n&&n.abort(),r.loading=!0),n=new AbortController;const w=n.signal;r.requester.send({url:"",method:i.m||"get",params:i,body:p,abortSignal:w}).then(_=>{r.adapter=_.adapter,r.persist&&(r.path=_.dirname,l("path",r.path)),["index","search"].includes(i.q)&&(r.loading=!1),g||r.emitter.emit("vf-modal-close"),s(_),f&&f(_)}).catch(_=>{console.error(_),h&&h(_)})}),r.emitter.on("vf-download",i=>{const p=document.createElement("a");p.style.display="none",p.target="_blank",p.href=i,p.download=i,r.root.appendChild(p),p.click(),p.remove()}),e.onMounted(()=>{let i={};r.path.includes("://")&&(i={adapter:r.path.split("://")[0],path:r.path}),r.emitter.emit("vf-fetch",{params:{q:"index",adapter:r.adapter,...i}})}),(i,p)=>(e.openBlock(),e.createElementBlock("div",{class:"vuefinder",ref_key:"root",ref:c},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).theme.actualValue==="dark"?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).fullScreen?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(e.unref(r).fullScreen?"":"max-height: "+d.maxHeight),onMousedown:p[0]||(p[0]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide")),onTouchstart:p[1]||(p[1]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide"))},[e.createVNode(Ze),e.createVNode(Bt),e.createVNode(Vo),e.createVNode(Po)],38),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r).modal.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+e.unref(r).modal.type),{key:0})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Co)],2)],512))}}),Yo=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),Ko={class:"fixed z-10 inset-0 overflow-hidden"},Jo={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl w-full"},Xo={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qo={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},S={__name:"ModalLayout",setup(d){const t=e.inject("ServiceContainer");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:a[1]||(a[1]=e.withKeys(r=>e.unref(t).emitter.emit("vf-modal-close"),["esc"])),tabindex:"0"},[Yo,e.createElementVNode("div",Ko,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:a[0]||(a[0]=e.withModifiers(r=>e.unref(t).emitter.emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Jo,[e.createElementVNode("div",Xo,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qo,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},Zo=["aria-label"],er=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),tr=[er],or={name:"Message"},D=Object.assign(or,{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(d,{emit:t}){var i;const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(!1),c=e.ref(null),s=e.ref((i=c.value)==null?void 0:i.strMessage);e.watch(s,()=>l.value=!1);const n=()=>{o("hidden"),l.value=!0};return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:c,class:e.normalizeClass(["flex mt-2 p-1 px-2 rounded text-sm break-all dark:opacity-75",d.error?"bg-red-100 text-red-600 ":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(p.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:n,"aria-label":e.unref(r)("Close"),"data-microtip-position":"top-left",role:"tooltip"},tr,8,Zo)],2))]))}}),rr={class:"sm:flex sm:items-start"},ar=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),nr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},lr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sr={class:"mt-2"},ir={class:"text-sm text-gray-500"},cr={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},dr={class:"flex text-sm text-gray-800 dark:text-gray-400"},ur={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},mr=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),pr=[mr],fr={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},vr=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),hr=[vr],gr={class:"ml-1.5"},kr={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},yr={name:"VFModalDelete"},_r=Object.assign(yr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"delete",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s}))},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files deleted.")})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-danger"},e.toDisplayString(e.unref(o)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",kr,e.toDisplayString(e.unref(o)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",rr,[ar,e.createElementVNode("div",nr,[e.createElementVNode("h3",lr,e.toDisplayString(e.unref(o)("Delete files")),1),e.createElementVNode("div",sr,[e.createElementVNode("p",ir,e.toDisplayString(e.unref(o)("Are you sure you want to delete these files?")),1),e.createElementVNode("div",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("p",dr,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",ur,pr)):(e.openBlock(),e.createElementBlock("svg",fr,hr)),e.createElementVNode("span",gr,e.toDisplayString(n.basename),1)]))),256))]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),xr={class:"sm:flex sm:items-start"},wr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1),br={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Er={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Vr={class:"mt-2"},Nr={class:"text-sm text-gray-500"},Br={name:"VFModalMessage"},$r=Object.assign(Br,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;return(a,r)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=l=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var l,c;return[e.createElementVNode("div",xr,[wr,e.createElementVNode("div",br,[e.createElementVNode("h3",Er,e.toDisplayString(((l=e.unref(t).modal.data)==null?void 0:l.title)??"Title"),1),e.createElementVNode("div",Vr,[e.createElementVNode("p",Nr,e.toDisplayString(((c=e.unref(t).modal.data)==null?void 0:c.message)??"Message"),1)])])])]}),_:1}))}}),Cr={class:"sm:flex sm:items-start"},Sr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),Dr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Mr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},jr={class:"mt-2"},Tr={class:"text-sm text-gray-500"},Lr=["placeholder"],Fr={name:"VFModalNewFolder"},zr=Object.assign(Fr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfolder",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Cr,[Sr,e.createElementVNode("div",Dr,[e.createElementVNode("h3",Mr,e.toDisplayString(e.unref(o)("New Folder")),1),e.createElementVNode("div",jr,[e.createElementVNode("p",Tr,e.toDisplayString(e.unref(o)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Folder Name"),type:"text"},null,40,Lr),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ar={class:"sm:flex sm:items-start"},Or=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),Ur={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Hr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Rr={class:"mt-2"},qr={class:"text-sm text-gray-500"},Ir=["placeholder"],Pr={name:"VFModalNewFile"},Wr=Object.assign(Pr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfile",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ar,[Or,e.createElementVNode("div",Ur,[e.createElementVNode("h3",Hr,e.toDisplayString(e.unref(o)("New File")),1),e.createElementVNode("div",Rr,[e.createElementVNode("p",qr,e.toDisplayString(e.unref(o)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("File Name"),type:"text"},null,40,Ir),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Gr={class:"flex"},Yr=["aria-label"],Kr={class:"ml-auto mb-2"},Jr={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Xr={key:1},Qr={__name:"Text",emits:["success"],setup(d,{emit:t}){const o=t,a=e.ref(""),r=e.ref(""),l=e.ref(null),c=e.ref(!1),s=e.ref(""),n=e.ref(!1),i=e.inject("ServiceContainer"),{t:p}=i.i18n;e.onMounted(()=>{i.requester.send({url:"",method:"get",params:{q:"preview",adapter:i.modal.data.adapter,path:i.modal.data.item.path},responseType:"text"}).then(g=>{a.value=g,o("success")})});const f=()=>{c.value=!c.value,r.value=a.value,c.value==!0&&e.nextTick(()=>{l.value.focus()})},h=()=>{s.value="",n.value=!1,i.requester.send({url:"",method:"post",params:{q:"save",adapter:i.modal.data.adapter,path:i.modal.data.item.path},body:{content:r.value},responseType:"text"}).then(g=>{s.value=p("Updated."),a.value=g,o("success"),c.value=!c.value}).catch(g=>{s.value=p(g.message),n.value=!0})};return(g,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Gr,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(i).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(i).modal.data.item.basename),9,Yr),e.createElementVNode("div",Kr,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:h,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(p)("Save")),1)):e.createCommentVNode("",!0),e.unref(i).features.includes(e.unref($).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:w[0]||(w[0]=_=>f())},e.toDisplayString(c.value?e.unref(p)("Cancel"):e.unref(p)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",Xr,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:l,"onUpdate:modelValue":w[1]||(w[1]=_=>r.value=_),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,r.value]])])):(e.openBlock(),e.createElementBlock("pre",Jr,e.toDisplayString(a.value),1)),s.value.length?(e.openBlock(),e.createBlock(D,{key:2,onHidden:w[2]||(w[2]=_=>s.value=""),error:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Zr={class:"flex"},ea=["aria-label"],ta={class:"ml-auto mb-2"},oa={class:"w-full flex justify-center"},ra=["src"],aa={__name:"Image",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(null),c=e.ref(null),s=e.ref(!1),n=e.ref(""),i=e.ref(!1),p=()=>{s.value=!s.value,s.value?c.value=new te(l.value,{crop(h){}}):c.value.destroy()},f=()=>{c.value.getCroppedCanvas({width:795,height:341}).toBlob(h=>{n.value="",i.value=!1;const g=new FormData;g.set("file",h),a.requester.send({url:"",method:"post",params:{q:"upload",adapter:a.modal.data.adapter,path:a.modal.data.item.path},body:g}).then(w=>{n.value=r("Updated."),l.value.src=a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item),p(),o("success")}).catch(w=>{n.value=r(w.message),i.value=!0})})};return e.onMounted(()=>{o("success")}),(h,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Zr,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,ea),e.createElementVNode("div",ta,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(r)("Crop")),1)):e.createCommentVNode("",!0),e.unref(a).features.includes(e.unref($).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:g[0]||(g[0]=w=>p())},e.toDisplayString(s.value?e.unref(r)("Cancel"):e.unref(r)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",oa,[e.createElementVNode("img",{ref_key:"image",ref:l,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(a).requester.getPreviewUrl(e.unref(a).modal.data.adapter,e.unref(a).modal.data.item),alt:""},null,8,ra)]),n.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:g[1]||(g[1]=w=>n.value=""),error:i.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},na={class:"flex"},la=["aria-label"],sa=e.createElementVNode("div",null,null,-1),ia={__name:"Default",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t;return e.onMounted(()=>{a("success")}),(r,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",na,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,la)]),sa],64))}},ca=["aria-label"],da={class:"w-full",preload:"",controls:""},ua=["src"],ma={__name:"Video",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ca),e.createElementVNode("div",null,[e.createElementVNode("video",da,[e.createElementVNode("source",{src:r(),type:"video/mp4"},null,8,ua),e.createTextVNode(" Your browser does not support the video tag. ")])])]))}},pa=["aria-label"],fa={class:"w-full",controls:""},va=["src"],ha={__name:"Audio",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),r=()=>a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item);return e.onMounted(()=>{o("success")}),(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,pa),e.createElementVNode("div",null,[e.createElementVNode("audio",fa,[e.createElementVNode("source",{src:r(),type:"audio/mpeg"},null,8,va),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},ga=["aria-label"],ka=["data"],ya=["src"],_a=e.createElementVNode("p",null,[e.createTextVNode(" Your browser does not support PDFs. "),e.createElementVNode("a",{href:"https://example.com/test.pdf"},"Download the PDF"),e.createTextVNode(" . ")],-1),xa=[_a],wa={__name:"Pdf",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ga),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:r(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:r(),width:"100%",height:"100%"},xa,8,ya)],8,ka)])],64))}},ba={class:"sm:flex sm:items-start"},Ea={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},Va={key:0},Na={class:"text-gray-700 dark:text-gray-200 text-sm"},Ba={key:0,class:"flex leading-5"},$a=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),Ca={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Sa={class:"font-bold"},Da={class:"font-bold pl-2"},Ma={key:0,class:"text-xs text-gray-600 dark:text-gray-400"},ja=["download","href"],Ta={name:"VFModalPreview"},La=Object.assign(Ta,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(!1),r=c=>(t.modal.data.item.mime_type??"").startsWith(c),l=t.features.includes($.PREVIEW);return l||(a.value=!0),(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[6]||(s[6]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1),e.unref(t).features.includes(e.unref($).DOWNLOAD)?(e.openBlock(),e.createElementBlock("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item),href:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item)},e.toDisplayString(e.unref(o)("Download")),9,ja)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",ba,[e.createElementVNode("div",Ea,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",Va,[r("text")?(e.openBlock(),e.createBlock(Qr,{key:0,onSuccess:s[0]||(s[0]=n=>a.value=!0)})):r("image")?(e.openBlock(),e.createBlock(aa,{key:1,onSuccess:s[1]||(s[1]=n=>a.value=!0)})):r("video")?(e.openBlock(),e.createBlock(ma,{key:2,onSuccess:s[2]||(s[2]=n=>a.value=!0)})):r("audio")?(e.openBlock(),e.createBlock(ha,{key:3,onSuccess:s[3]||(s[3]=n=>a.value=!0)})):r("application/pdf")?(e.openBlock(),e.createBlock(wa,{key:4,onSuccess:s[4]||(s[4]=n=>a.value=!0)})):(e.openBlock(),e.createBlock(ia,{key:5,onSuccess:s[5]||(s[5]=n=>a.value=!0)}))])):e.createCommentVNode("",!0),e.createElementVNode("div",Na,[a.value===!1?(e.openBlock(),e.createElementBlock("div",Ba,[$a,e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Ca,[e.createElementVNode("div",null,[e.createElementVNode("span",Sa,e.toDisplayString(e.unref(o)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(t).filesize(e.unref(t).modal.data.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",Da,e.toDisplayString(e.unref(o)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(Y)(e.unref(t).modal.data.item.last_modified)),1)])]),e.unref(t).features.includes(e.unref($).DOWNLOAD)?(e.openBlock(),e.createElementBlock("div",Ma,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):e.createCommentVNode("",!0)]),_:1}))}}),Fa={class:"sm:flex sm:items-start"},za=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),Aa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Oa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ua={class:"mt-2"},Ha={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},Ra={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},qa=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Ia=[qa],Pa={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Wa=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Ga=[Wa],Ya={class:"ml-1.5"},Ka={name:"VFModalRename"},Ja=Object.assign(Ka,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items[0]),r=e.ref(t.modal.data.items[0].basename),l=e.ref(""),c=()=>{r.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"rename",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path,name:r.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is renamed.",r.value)})},onError:s=>{l.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Fa,[za,e.createElementVNode("div",Aa,[e.createElementVNode("h3",Oa,e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("div",Ua,[e.createElementVNode("p",Ha,[a.value.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Ra,Ia)):(e.openBlock(),e.createElementBlock("svg",Pa,Ga)),e.createElementVNode("span",Ya,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>r.value=i),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,544),[[e.vModelText,r.value]]),l.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Xa={class:"sm:flex sm:items-start"},Qa=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),Za={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},en={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},tn={class:"mt-2"},on={key:0,class:"pointer-events-none"},rn={key:1,class:"pointer-events-none"},an=["disabled"],nn=["disabled"],ln={class:"text-gray-500 text-sm mb-1 pr-1 max-h-[200px] overflow-y-auto vf-scrollbar"},sn={class:"rounded flex flex-shrink-0 w-6 h-6 border bg-gray-50 text-xs cursor-default dark:border-gray-700 dark:bg-gray-800 dark:text-gray-50"},cn=["textContent"],dn={class:"ml-1 w-full h-fit"},un={class:"text-left hidden md:block"},mn={class:"text-left md:hidden"},pn={key:0,class:"ml-auto"},fn=["title","disabled","onClick"],vn=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),hn=[vn],gn={key:0,class:"py-2"},kn=["disabled"],yn={name:"VFModalUpload"},_n=Object.assign(yn,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=o("uppy"),r={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10},l=e.ref({QUEUE_ENTRY_STATUS:r}),c=e.ref(null),s=e.ref(null),n=e.ref(null),i=e.ref(null),p=e.ref(null),f=e.ref(null),h=e.ref([]),g=e.ref(""),w=e.ref(!1),_=e.ref(!1);let m;function u(E){return h.value.findIndex(x=>x.id===E)}function B(E,x=null){x=x??(E.webkitRelativePath||E.name),m.addFile({name:x,type:E.type,data:E,source:"Local"})}function C(E){switch(E.status){case r.DONE:return"text-green-600";case r.ERROR:return"text-red-600";case r.CANCELED:return"text-red-600";case r.PENDING:default:return""}}const M=E=>{switch(E.status){case r.DONE:return"✓";case r.ERROR:case r.CANCELED:return"!";case r.PENDING:default:return"..."}};function L(){i.value.click()}function F(){if(!w.value){if(!h.value.filter(E=>E.status!==r.DONE).length){g.value=o("Please select file to upload first.");return}g.value="",m.retryAll(),m.upload()}}function z(){m.cancelAll({reason:"user"}),h.value.forEach(E=>{E.status!==r.DONE&&(E.status=r.CANCELED,E.statusName=o("Canceled"))}),w.value=!1}function A(E){w.value||(m.removeFile(E.id,"removed-by-user"),h.value.splice(u(E.id),1))}function k(E){if(!w.value){if(m.cancelAll({reason:"user"}),E){const x=[];h.value.forEach(v=>{v.status!==r.DONE&&x.push(v)}),h.value=[],x.forEach(v=>{B(v.originalFile,v.name)});return}h.value.splice(0)}}function b(){t.emitter.emit("vf-modal-close")}function y(){return t.requester.transformRequestParams({url:"",method:"post",params:{q:"upload",adapter:t.data.adapter,path:t.data.dirname}})}return e.onMounted(async()=>{m=new oe({debug:t.debug,restrictions:{maxFileSize:ue(t.maxFileSize)},locale:a,onBeforeFileAdded(v,V){if(V[v.id]!=null){const T=u(v.id);h.value[T].status===r.PENDING&&(g.value=m.i18n("noDuplicates",{fileName:v.name})),h.value=h.value.filter(U=>U.id!==v.id)}return h.value.push({id:v.id,name:v.name,size:t.filesize(v.size),status:r.PENDING,statusName:o("Pending upload"),percent:null,originalFile:v.data}),!0}}),m.use(re,{endpoint:"WILL_BE_REPLACED_BEFORE_UPLOAD",limit:5,timeout:0,getResponseError(v,V){let N;try{N=JSON.parse(v).message}catch{N=o("Cannot parse server response.")}return new Error(N)}}),m.on("restriction-failed",(v,V)=>{const N=h.value[u(v.id)];A(N),g.value=V.message}),m.on("upload",()=>{const v=y();m.setMeta({...v.body});const V=m.getPlugin("XHRUpload");V.opts.method=v.method,V.opts.endpoint=v.url+"?"+new URLSearchParams(v.params),V.opts.headers=v.headers,w.value=!0,h.value.forEach(N=>{N.status!==r.DONE&&(N.percent=null,N.status=r.UPLOADING,N.statusName=o("Pending upload"))})}),m.on("upload-progress",(v,V)=>{const N=Math.floor(V.bytesUploaded/V.bytesTotal*100);h.value[u(v.id)].percent=`${N}%`}),m.on("upload-success",v=>{const V=h.value[u(v.id)];V.status=r.DONE,V.statusName=o("Done")}),m.on("upload-error",(v,V)=>{const N=h.value[u(v.id)];N.percent=null,N.status=r.ERROR,V.isNetworkError?N.statusName=o("Network Error, Unable establish connection to the server or interrupted."):N.statusName=V?V.message:o("Unknown Error")}),m.on("error",v=>{g.value=v.message,w.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),m.on("complete",()=>{w.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),i.value.addEventListener("click",()=>{s.value.click()}),p.value.addEventListener("click",()=>{n.value.click()}),f.value.addEventListener("dragover",v=>{v.preventDefault(),_.value=!0}),f.value.addEventListener("dragleave",v=>{v.preventDefault(),_.value=!1});function E(v,V){V.isFile&&V.file(N=>v(V,N)),V.isDirectory&&V.createReader().readEntries(N=>{N.forEach(T=>{E(v,T)})})}f.value.addEventListener("drop",v=>{v.preventDefault(),_.value=!1;const V=/^[/\\](.+)/;[...v.dataTransfer.items].forEach(N=>{N.kind==="file"&&E((T,U)=>{const K=V.exec(T.fullPath);B(U,K[1])},N.webkitGetAsEntry())})});const x=({target:v})=>{const V=v.files;for(const N of V)B(N);v.value=""};s.value.addEventListener("change",x),n.value.addEventListener("change",x)}),e.onBeforeUnmount(()=>{m==null||m.close({reason:"unmount"})}),(E,x)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["vf-btn vf-btn-primary",w.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500"]),disabled:w.value,onClick:e.withModifiers(F,["prevent"])},e.toDisplayString(e.unref(o)("Upload")),11,kn),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(z,["prevent"])},e.toDisplayString(e.unref(o)("Cancel")),1)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(b,["prevent"])},e.toDisplayString(e.unref(o)("Close")),1))]),default:e.withCtx(()=>[e.createElementVNode("div",Xa,[Qa,e.createElementVNode("div",Za,[e.createElementVNode("h3",en,e.toDisplayString(e.unref(o)("Upload Files")),1),e.createElementVNode("div",tn,[e.createElementVNode("div",{ref_key:"dropArea",ref:f,class:"flex items-center justify-center text-lg mb-4 text-gray-500 border-2 border-gray-300 rounded border-dashed select-none cursor-pointer dark:border-gray-600 h-[120px]",onClick:L},[_.value?(e.openBlock(),e.createElementBlock("div",on,e.toDisplayString(e.unref(o)("Release to drop these files.")),1)):(e.openBlock(),e.createElementBlock("div",rn,e.toDisplayString(e.unref(o)("Drag and drop the files/folders to here or click here.")),1))],512),e.createElementVNode("div",{ref_key:"container",ref:c,class:"text-gray-500 mb-1"},[e.createElementVNode("button",{ref_key:"pickFiles",ref:i,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Files")),513),e.createElementVNode("button",{ref_key:"pickFolders",ref:p,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Folders")),513),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:w.value,onClick:x[0]||(x[0]=v=>k(!1))},e.toDisplayString(e.unref(o)("Clear all")),9,an),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:w.value,onClick:x[1]||(x[1]=v=>k(!0))},e.toDisplayString(e.unref(o)("Clear only successful")),9,nn)],512),e.createElementVNode("div",ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,v=>(e.openBlock(),e.createElementBlock("div",{class:"flex hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-gray-300",key:v.id},[e.createElementVNode("span",sn,[e.createElementVNode("span",{class:e.normalizeClass(["text-base m-auto",C(v)]),textContent:e.toDisplayString(M(v))},null,10,cn)]),e.createElementVNode("div",dn,[e.createElementVNode("div",un,e.toDisplayString(e.unref(q)(v.name,40))+" ("+e.toDisplayString(v.size)+")",1),e.createElementVNode("div",mn,e.toDisplayString(e.unref(q)(v.name,16))+" ("+e.toDisplayString(v.size)+")",1),e.createElementVNode("div",{class:e.normalizeClass(["flex break-all text-left",C(v)])},[e.createTextVNode(e.toDisplayString(v.statusName)+" ",1),v.status===l.value.QUEUE_ENTRY_STATUS.UPLOADING?(e.openBlock(),e.createElementBlock("b",pn,e.toDisplayString(v.percent),1)):e.createCommentVNode("",!0)],2)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["rounded w-5 h-5 border-1 text-base leading-none font-medium focus:outline-none dark:border-gray-200 dark:text-gray-400 dark:hover:text-gray-200 dark:bg-gray-600 ml-auto sm:text-xs hover:text-red-600",w.value?"disabled:bg-gray-100 text-white text-opacity-50":"bg-gray-100"]),title:e.unref(o)("Delete"),disabled:w.value,onClick:V=>A(v)},hn,10,fn)]))),128)),h.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gn,e.toDisplayString(e.unref(o)("No files selected!")),1))]),g.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:x[2]||(x[2]=v=>g.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),e.createElementVNode("input",{ref_key:"internalFileInput",ref:s,type:"file",multiple:"",class:"hidden"},null,512),e.createElementVNode("input",{ref_key:"internalFolderInput",ref:n,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1}))}}),xn={class:"sm:flex sm:items-start"},wn=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),bn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},En={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Vn={class:"mt-2"},Nn={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},Bn={class:"flex text-sm text-gray-800 dark:text-gray-400"},$n={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Cn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Sn=[Cn],Dn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Mn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),jn=[Mn],Tn={class:"ml-1.5"},Ln=["placeholder"],Fn={name:"VFModalArchive"},zn=Object.assign(Fn,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=e.ref(t.modal.data.items),c=()=>{l.value.length&&t.emitter.emit("vf-fetch",{params:{q:"archive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:l.value.map(({path:s,type:n})=>({path:s,type:n})),name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file(s) archived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",xn,[wn,e.createElementVNode("div",bn,[e.createElementVNode("h3",En,e.toDisplayString(e.unref(o)("Archive the files")),1),e.createElementVNode("div",Vn,[e.createElementVNode("div",Nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",Bn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",$n,Sn)):(e.openBlock(),e.createElementBlock("svg",Dn,jn)),e.createElementVNode("span",Tn,e.toDisplayString(i.basename),1)]))),256))]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>a.value=i),onKeyup:e.withKeys(c,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Archive name. (.zip file will be created)"),type:"text"},null,40,Ln),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),An={class:"sm:flex sm:items-start"},On=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Un={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Hn={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Rn={class:"mt-2"},qn={class:"flex text-sm text-gray-800 dark:text-gray-400"},In={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Pn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Wn=[Pn],Gn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Yn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Kn=[Yn],Jn={class:"ml-1.5"},Xn={class:"my-1 text-sm text-gray-500"},Qn={name:"VFModalUnarchive"},Zn=Object.assign(Qn,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n;e.ref("");const a=e.ref(t.modal.data.items[0]),r=e.ref(""),l=e.ref([]),c=()=>{t.emitter.emit("vf-fetch",{params:{q:"unarchive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file unarchived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:n[1]||(n[1]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",An,[On,e.createElementVNode("div",Un,[e.createElementVNode("h3",Hn,e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("div",Rn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",qn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",In,Wn)):(e.openBlock(),e.createElementBlock("svg",Gn,Kn)),e.createElementVNode("span",Jn,e.toDisplayString(i.basename),1)]))),256)),e.createElementVNode("p",Xn,e.toDisplayString(e.unref(o)("The archive will be unarchived at"))+" ("+e.toDisplayString(e.unref(t).data.dirname)+")",1),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[0]||(n[0]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),el={class:"sm:flex sm:items-start"},tl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),ol={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},rl={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},al={class:"text-sm text-gray-500 pb-1"},nl={class:"max-h-[200px] overflow-y-auto vf-scrollbar text-left"},ll={class:"flex text-sm text-gray-800 dark:text-gray-400"},sl={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},il=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),cl=[il],dl={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ul=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),ml=[ul],pl={class:"ml-1.5"},fl={class:"font-bold text-xs text-gray-700 dark:text-gray-500 mt-3 tracking-wider"},vl={class:"flex text-sm text-gray-800 dark:text-gray-400 border dark:border-gray-700 p-1 rounded"},hl=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),gl={class:"ml-1.5 overflow-auto"},kl={class:"m-1 mr-auto font-bold text-gray-500 text-sm dark:text-gray-200 self-center"},yl={name:"VFModalMove"},_l=Object.assign(yl,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=e.ref(t.modal.data.items.from),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"move",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s})),item:t.modal.data.items.to.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files moved.",t.modal.data.items.to.name)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",kl,e.toDisplayString(e.unref(o)("%s item(s) selected.",a.value.length)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",el,[tl,e.createElementVNode("div",ol,[e.createElementVNode("h3",rl,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("p",al,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("div",nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("div",ll,[e.createElementVNode("div",null,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",sl,cl)):(e.openBlock(),e.createElementBlock("svg",dl,ml))]),e.createElementVNode("div",pl,e.toDisplayString(n.path),1)]))),256))]),e.createElementVNode("h4",fl,e.toDisplayString(e.unref(o)("Target Directory")),1),e.createElementVNode("p",vl,[hl,e.createElementVNode("span",gl,e.toDisplayString(e.unref(t).modal.data.items.to.path),1)]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1}))}}),xl=(d,t)=>{const o=d.__vccOpts||d;for(const[a,r]of t)o[a]=r;return o},wl={props:{on:{type:String,required:!0}},setup(d,{emit:t,slots:o}){const a=e.inject("ServiceContainer"),r=e.ref(!1),{t:l}=a.i18n;let c=null;const s=()=>{clearTimeout(c),r.value=!0,c=setTimeout(()=>{r.value=!1},2e3)};return e.onMounted(()=>{a.emitter.on(d.on,s)}),e.onUnmounted(()=>{clearTimeout(c)}),{shown:r,t:l}}},bl={key:1};function El(d,t,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-sm text-green-600 dark:text-green-600 transition-opacity duration-500 ease-out",[{"opacity-0":!a.shown}]])},[d.$slots.default?e.renderSlot(d.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",bl,e.toDisplayString(a.t("Saved.")),1))],2)}const R=xl(wl,[["render",El]]),Vl={class:"sm:flex sm:items-start"},Nl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])],-1),Bl={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},$l={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Cl={class:"mt-2"},Sl={class:"text-sm text-gray-500"},Dl={class:"text-sm font-semibold mt-5 text-gray-900 dark:text-gray-400 tracking-wider"},Ml={class:"mt-3 text-left"},jl={class:"space-y-2"},Tl={class:"flex relative gap-x-3"},Ll={class:"h-6 items-center"},Fl={class:"flex-1 block text-sm"},zl={for:"metric_unit",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},Al={class:"flex relative gap-x-3"},Ol={class:"h-6 items-center"},Ul={for:"theme",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm"},Hl={class:"flex text-sm"},Rl=["label"],ql=["value"],Il={key:0,class:"flex relative gap-x-3"},Pl={class:"h-6 items-center"},Wl={for:"language",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm text-nowrap"},Gl={class:"flex text-sm"},Yl=["label"],Kl=["value"],Jl={name:"VFModalAbout"},Xl=Object.assign(Jl,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o,setStore:a,clearStore:r}=t.storage,{t:l,changeLocale:c,locale:s}=t.i18n;e.ref(""),e.ref("");const n=async()=>{r(),location.reload()},i=_=>{t.theme.set(_),t.emitter.emit("vf-theme-saved")},p=()=>{t.metricUnits=!t.metricUnits,t.filesize=t.metricUnits?G:W,a("metricUnits",t.metricUnits),t.emitter.emit("vf-metric-units-saved")},{i18n:f}=e.inject("VueFinderOptions"),g=Object.fromEntries(Object.entries({en:"English",fr:"French (Français)",de:"German (Deutsch)",fa:"Persian (فارسی)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",ru:"Russian (Pусский)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)",zhCN:"Simplified Chinese (简体中文)",zhTW:"Traditional Chinese (繁體中文)"}).filter(([_])=>Object.keys(f).includes(_))),w=e.computed(()=>({system:l("System"),light:l("Light"),dark:l("Dark")}));return(_,m)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m[5]||(m[5]=u=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Close")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Vl,[Nl,e.createElementVNode("div",Bl,[e.createElementVNode("h3",$l,e.toDisplayString(e.unref(l)("About %s","Vuefinder "+e.unref(t).version)),1),e.createElementVNode("div",Cl,[e.createElementVNode("p",Sl,e.toDisplayString(e.unref(l)("Vuefinder is a file manager component for vue 3.")),1),e.createElementVNode("div",null,[e.createElementVNode("h3",Dl,e.toDisplayString(e.unref(l)("Settings")),1)]),e.createElementVNode("div",Ml,[e.createElementVNode("fieldset",null,[e.createElementVNode("div",jl,[e.createElementVNode("div",Tl,[e.createElementVNode("div",Ll,[e.withDirectives(e.createElementVNode("input",{id:"metric_unit",name:"metric_unit",type:"checkbox","onUpdate:modelValue":m[0]||(m[0]=u=>e.unref(t).metricUnits=u),onClick:p,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).metricUnits]])]),e.createElementVNode("div",Fl,[e.createElementVNode("label",zl,[e.createTextVNode(e.toDisplayString(e.unref(l)("Use Metric Units"))+" ",1),e.createVNode(R,{class:"ms-3",on:"vf-metric-units-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",Al,[e.createElementVNode("div",Ol,[e.createElementVNode("label",Ul,e.toDisplayString(e.unref(l)("Theme")),1)]),e.createElementVNode("div",Hl,[e.withDirectives(e.createElementVNode("select",{id:"theme","onUpdate:modelValue":m[1]||(m[1]=u=>e.unref(t).theme.value=u),onChange:m[2]||(m[2]=u=>i(u.target.value)),class:"flex-shrink-0 w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(l)("Theme")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(u,B)=>(e.openBlock(),e.createElementBlock("option",{value:B},e.toDisplayString(u),9,ql))),256))],8,Rl)],544),[[e.vModelSelect,e.unref(t).theme.value]]),e.createVNode(R,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-theme-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])]),e.unref(t).features.includes(e.unref($).LANGUAGE)&&Object.keys(e.unref(g)).length>1?(e.openBlock(),e.createElementBlock("div",Il,[e.createElementVNode("div",Pl,[e.createElementVNode("label",Wl,e.toDisplayString(e.unref(l)("Language")),1)]),e.createElementVNode("div",Gl,[e.withDirectives(e.createElementVNode("select",{id:"language","onUpdate:modelValue":m[3]||(m[3]=u=>e.isRef(s)?s.value=u:null),onChange:m[4]||(m[4]=u=>e.unref(c)(u.target.value)),class:"flex-shrink-0 w-1/2 sm:w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(l)("Language")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(u,B)=>(e.openBlock(),e.createElementBlock("option",{value:B},e.toDisplayString(u),9,Kl))),256))],8,Yl)],544),[[e.vModelSelect,e.unref(s)]]),e.createVNode(R,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-language-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:n,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Reset Settings")),1)])])])])])])]),_:1}))}}),Ql=Object.freeze(Object.defineProperty({__proto__:null,ModalAbout:Xl,ModalArchive:zn,ModalDelete:_r,ModalMessage:$r,ModalMove:_l,ModalNewFile:Wr,ModalNewFolder:zr,ModalPreview:La,ModalRename:Ja,ModalUnarchive:Zn,ModalUpload:_n},Symbol.toStringTag,{value:"Module"})),Zl={install(d,t={}){d.component("VueFinder",Go);for(const a of Object.values(Ql))d.component(a.name,a);t.i18n=t.i18n??{};let[o]=Object.keys(t.i18n);t.locale=t.locale??o??"en",d.provide("VueFinderOptions",t)}};module.exports=Zl;
1
+ "use strict";var ie=Object.defineProperty;var ce=(a,t,o)=>t in a?ie(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o;var W=(a,t,o)=>(ce(a,typeof t!="symbol"?t+"":t,o),o);const e=require("vue"),de=require("mitt"),ue=require("dragselect"),me=require("@uppy/core"),fe=require("@uppy/xhr-upload"),pe=require("vanilla-lazyload");require("cropperjs/dist/cropper.css");const he=require("cropperjs");require("microtip/microtip.css");var Y;const H=(Y=document.querySelector('meta[name="csrf-token"]'))==null?void 0:Y.getAttribute("content");class ve{constructor(t){W(this,"config");this.config=t}get config(){return this.config}transformRequestParams(t){const o=this.config,n={};H!=null&&H!==""&&(n[o.xsrfHeaderName]=H);const r=Object.assign({},o.headers,n,t.headers),u=Object.assign({},o.params,t.params),s=t.body,i=o.baseUrl+t.url,l=t.method;let c;l!=="get"&&(s instanceof FormData?(c=s,o.body!=null&&Object.entries(this.config.body).forEach(([h,d])=>{c.append(h,d)})):(c={...s},o.body!=null&&Object.assign(c,this.config.body)));const f={url:i,method:l,headers:r,params:u,body:c};if(o.transformRequest!=null){const h=o.transformRequest({url:i,method:l,headers:r,params:u,body:c});h.url!=null&&(f.url=h.url),h.method!=null&&(f.method=h.method),h.params!=null&&(f.params=h.params??{}),h.headers!=null&&(f.headers=h.headers??{}),h.body!=null&&(f.body=h.body)}return f}getDownloadUrl(t,o){if(o.url!=null)return o.url;const n=this.transformRequestParams({url:"",method:"get",params:{q:"download",adapter:t,path:o.path}});return n.url+"?"+new URLSearchParams(n.params).toString()}getPreviewUrl(t,o){if(o.url!=null)return o.url;const n=this.transformRequestParams({url:"",method:"get",params:{q:"preview",adapter:t,path:o.path}});return n.url+"?"+new URLSearchParams(n.params).toString()}async send(t){const o=this.transformRequestParams(t),n=t.responseType||"json",r={method:t.method,headers:o.headers,signal:t.abortSignal},u=o.url+"?"+new URLSearchParams(o.params);if(o.method!=="get"&&o.body!=null){let i;o.body instanceof FormData?i=t.body:(i=JSON.stringify(o.body),r.headers["Content-Type"]="application/json"),r.body=i}const s=await fetch(u,r);if(s.ok)return await s[n]();throw await s.json()}}function ge(a){const t={baseUrl:"",headers:{},params:{},body:{},xsrfHeaderName:"X-CSRF-Token"};return typeof a=="string"?Object.assign(t,{baseUrl:a}):Object.assign(t,a),new ve(t)}function ke(a){let t=localStorage.getItem(a+"_storage");const o=e.reactive(JSON.parse(t??"{}"));e.watch(o,n);function n(){Object.keys(o).length?localStorage.setItem(a+"_storage",JSON.stringify(o)):localStorage.removeItem(a+"_storage")}function r(l,c){o[l]=c}function u(l){delete o[l]}function s(){Object.keys(o).map(l=>u(l))}return{getStore:(l,c=null)=>o.hasOwnProperty(l)?o[l]:c,setStore:r,removeStore:u,clearStore:s}}async function _e(a,t){const o=t[a];return typeof o=="function"?(await o()).default:o}function xe(a,t,o,n){const{getStore:r,setStore:u}=a,s=e.ref({}),i=e.ref(r("locale",t)),l=(h,d=t)=>{_e(h,n).then(m=>{s.value=m,u("locale",h),i.value=h,u("translations",m),Object.values(n).length>1&&(o.emit("vf-toast-push",{label:"The language is set to "+h}),o.emit("vf-language-saved"))}).catch(m=>{d?(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),l(d,null)):o.emit("vf-toast-push",{label:"Locale cannot be loaded!",type:"error"})})};!r("locale")&&!n.length?l(t):s.value=r("translations");const c=(h,...d)=>d.length?c(h=h.replace("%s",d.shift()),...d):h;function f(h,...d){return s.value&&s.value.hasOwnProperty(h)?c(s.value[h],...d):c(h,...d)}return{t:f,changeLocale:l,locale:i}}const C={EDIT:"edit",NEW_FILE:"newfile",NEW_FOLDER:"newfolder",PREVIEW:"preview",ARCHIVE:"archive",UNARCHIVE:"unarchive",SEARCH:"search",RENAME:"rename",UPLOAD:"upload",DELETE:"delete",FULL_SCREEN:"fullscreen",DOWNLOAD:"download",LANGUAGE:"language"},ye=Object.values(C),we="2.3.0";function J(a,t,o,n,r){return(t=Math,o=t.log,n=1024,r=o(a)/o(n)|0,a/t.pow(n,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"iB":"B")}function Q(a,t,o,n,r){return(t=Math,o=t.log,n=1e3,r=o(a)/o(n)|0,a/t.pow(n,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"B":"B")}function be(a){const t={k:1,m:2,g:3,t:4},n=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(a);return n[1]*Math.pow(1024,t[n[2].toLowerCase()])}const A={SYSTEM:"system",LIGHT:"light",DARK:"dark"};function Ee(a,t){const o=e.ref(A.SYSTEM),n=e.ref(A.LIGHT);o.value=a.getStore("theme",t??A.SYSTEM);const r=window.matchMedia("(prefers-color-scheme: dark)"),u=s=>{o.value===A.DARK||o.value===A.SYSTEM&&s.matches?n.value=A.DARK:n.value=A.LIGHT};return u(r),r.addEventListener("change",u),{value:o,actualValue:n,set(s){o.value=s,s!==A.SYSTEM?a.setStore("theme",s):a.removeStore("theme"),u(r)}}}function Ve(){const a=e.shallowRef(null),t=e.ref(!1),o=e.ref();return{visible:t,type:a,data:o,open:(u,s=null)=>{t.value=!0,a.value=u,o.value=s},close:()=>{t.value=!1,a.value=null}}}function Ne(){let a;const t=e.ref(),o=Math.floor(Math.random()*2**32),n=e.ref(!1),r=e.ref([]),u=()=>r.value,s=()=>a.getSelection(),i=()=>r.value.length,l=()=>a.clearSelection(!0),c=e.ref();function f(){a=new ue({area:t.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),a.subscribe("DS:start:pre",({items:m,event:p,isDragging:v})=>{if(v)a.Interaction._reset(p);else{const k=t.value.offsetWidth-p.offsetX,E=t.value.offsetHeight-p.offsetY;k<15&&E<15&&a.Interaction._reset(p)}}),document.addEventListener("dragleave",m=>{!m.buttons&&n.value&&(n.value=!1)})}const h=()=>e.nextTick(()=>{const m=u().map(p=>p.path);l(),a.setSettings({selectables:document.getElementsByClassName("vf-item-"+o)}),a.addSelection(a.getSelectables().filter(p=>m.includes(JSON.parse(p.dataset.item).path))),r.value=a.getSelection().map(p=>JSON.parse(p.dataset.item)),c.value(r.value)}),d=m=>{c.value=m,a.subscribe("DS:end",({items:p,event:v,isDragging:k})=>{r.value=p.map(E=>JSON.parse(E.dataset.item)),m(p.map(E=>JSON.parse(E.dataset.item)))})};return e.onMounted(()=>{f()}),e.onUnmounted(()=>{a&&a.stop()}),e.onUpdated(()=>{a&&a.Area.reset()}),{instance:a,area:t,explorerId:o,isDraggingRef:n,getSelected:u,getSelection:s,clearSelection:l,refreshSelection:h,getCount:i,onSelect:d}}function Be(a,t){const o=e.ref(a),n=e.ref(t),r=e.ref([]),u=e.ref([]),s=e.ref([]),i=e.ref(!1),l=e.ref(5);let c=!1,f=!1;const h=e.reactive({adapter:o,storages:[],dirname:n,files:[]});function d(){let _=[],x=[],M=n.value??o.value+"://";M.length===0&&(r.value=[]),M.replace(o.value+"://","").split("/").forEach(function(w){_.push(w),_.join("/")!==""&&x.push({basename:w,name:w,path:o.value+"://"+_.join("/"),type:"dir"})}),u.value=x;const[b,y]=p(x,l.value);s.value=y,r.value=b}function m(_){l.value=_,d()}function p(_,x){return _.length>x?[_.slice(-x),_.slice(0,-x)]:[_,[]]}function v(_=null){i.value=_??!i.value}function k(){return r.value&&r.value.length&&!f}const E=e.computed(()=>{var _;return((_=r.value[r.value.length-2])==null?void 0:_.path)??o.value+"://"});return e.onMounted(()=>{}),e.watch(n,d),e.onMounted(d),{adapter:o,path:n,loading:c,searchMode:f,data:h,breadcrumbs:r,breadcrumbItems:u,limitBreadcrumbItems:m,hiddenBreadcrumbs:s,showHiddenBreadcrumbs:i,toggleHiddenBreadcrumbs:v,isGoUpAvailable:k,parentFolderPath:E}}const $e=(a,t)=>{const o=ke(a.id),n=de(),r=o.getStore("metricUnits",!1),u=Ee(o,a.theme),s=t.i18n,i=a.locale??t.locale,l=o.getStore("adapter"),c=d=>Array.isArray(d)?d:ye,f=o.getStore("persist-path",a.persist),h=f?o.getStore("path",a.path):a.path;return e.reactive({version:we,root:null,debug:a.debug,emitter:n,storage:o,i18n:e.computed(()=>xe(o,i,n,s)),modal:Ve(),dragSelect:e.computed(()=>Ne()),requester:ge(a.request),features:c(a.features),view:o.getStore("viewport","grid"),fullScreen:o.getStore("full-screen",a.fullScreen),selectButton:a.selectButton,maxFileSize:a.maxFileSize,theme:u,metricUnits:r,filesize:r?Q:J,compactListView:o.getStore("compact-list-view",!0),persist:f,showThumbnails:o.getStore("show-thumbnails",a.showThumbnails),fs:Be(l,h)})},Se=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),Ce={class:"fixed z-10 inset-0 overflow-hidden"},De={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-3xl w-full"},Me={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Te={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},T={__name:"ModalLayout",setup(a){const t=e.inject("ServiceContainer");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");setTimeout(()=>o&&o.focus(),100)}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:n[1]||(n[1]=e.withKeys(r=>e.unref(t).modal.close(),["esc"])),tabindex:"0"},[Se,e.createElementVNode("div",Ce,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:n[0]||(n[0]=e.withModifiers(r=>e.unref(t).modal.close(),["self"]))},[e.createElementVNode("div",De,[e.createElementVNode("div",Me,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Te,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},Le=["aria-label"],Ae=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),je=[Ae],L={__name:"Message",props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(a,{emit:t}){var c;const o=t,n=e.inject("ServiceContainer"),{t:r}=n.i18n,u=e.ref(!1),s=e.ref(null),i=e.ref((c=s.value)==null?void 0:c.strMessage);e.watch(i,()=>u.value=!1);const l=()=>{o("hidden"),u.value=!0};return(f,h)=>(e.openBlock(),e.createElementBlock("div",null,[u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:s,class:e.normalizeClass(["flex mt-2 p-1 px-2 rounded text-sm break-all dark:opacity-75",a.error?"bg-red-100 text-red-600 ":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(f.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:l,"aria-label":e.unref(r)("Close"),"data-microtip-position":"top-left",role:"tooltip"},je,8,Le)],2))]))}},Fe={class:"sm:flex sm:items-start"},Ue=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),ze={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ie={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Re={class:"mt-2"},He={class:"text-sm text-gray-500"},qe=["placeholder"],X={__name:"ModalNewFolder",setup(a){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=()=>{n.value!==""&&t.emitter.emit("vf-fetch",{params:{q:"newfolder",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",n.value)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:i[2]||(i[2]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Fe,[Ue,e.createElementVNode("div",ze,[e.createElementVNode("h3",Ie,e.toDisplayString(e.unref(o)("New Folder")),1),e.createElementVNode("div",Re,[e.createElementVNode("p",He,e.toDisplayString(e.unref(o)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.value=l),onKeyup:e.withKeys(u,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Folder Name"),type:"text"},null,40,qe),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[1]||(i[1]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Oe={class:"sm:flex sm:items-start"},Pe=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),Ge={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},We={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ke={class:"mt-2"},Ye={class:"text-sm text-gray-500"},Je=["placeholder"],Qe={__name:"ModalNewFile",setup(a){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=()=>{n.value!==""&&t.emitter.emit("vf-fetch",{params:{q:"newfile",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",n.value)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:i[2]||(i[2]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Oe,[Pe,e.createElementVNode("div",Ge,[e.createElementVNode("h3",We,e.toDisplayString(e.unref(o)("New File")),1),e.createElementVNode("div",Ke,[e.createElementVNode("p",Ye,e.toDisplayString(e.unref(o)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.value=l),onKeyup:e.withKeys(u,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("File Name"),type:"text"},null,40,Je),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[1]||(i[1]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Xe={class:"sm:flex sm:items-start"},Ze=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),et={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},tt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ot={class:"mt-2"},rt={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},nt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},at=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),st=[at],lt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},it=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),ct=[it],dt={class:"ml-1.5"},Z={__name:"ModalRename",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items[0]),r=e.ref(t.modal.data.items[0].basename),u=e.ref(""),s=()=>{r.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"rename",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{item:n.value.path,name:r.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is renamed.",r.value)})},onError:i=>{u.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:l[2]||(l[2]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Xe,[Ze,e.createElementVNode("div",et,[e.createElementVNode("h3",tt,e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("div",ot,[e.createElementVNode("p",rt,[n.value.type==="dir"?(e.openBlock(),e.createElementBlock("svg",nt,st)):(e.openBlock(),e.createElementBlock("svg",lt,ct)),e.createElementVNode("span",dt,e.toDisplayString(n.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),onKeyup:e.withKeys(s,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,544),[[e.vModelText,r.value]]),u.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[1]||(l[1]=c=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},ut={class:"sm:flex sm:items-start"},mt=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),ft={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},pt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ht={class:"mt-2"},vt={class:"text-sm text-gray-500"},gt={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},kt={class:"flex text-sm text-gray-800 dark:text-gray-400"},_t={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},xt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),yt=[xt],wt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},bt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Et=[bt],Vt={class:"ml-1.5"},Nt={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},ee={__name:"ModalDelete",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items),r=e.ref(""),u=()=>{n.value.length&&t.emitter.emit("vf-fetch",{params:{q:"delete",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:n.value.map(({path:s,type:i})=>({path:s,type:i}))},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files deleted.")})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-danger"},e.toDisplayString(e.unref(o)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:i[1]||(i[1]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",Nt,e.toDisplayString(e.unref(o)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ut,[mt,e.createElementVNode("div",ft,[e.createElementVNode("h3",pt,e.toDisplayString(e.unref(o)("Delete files")),1),e.createElementVNode("div",ht,[e.createElementVNode("p",vt,e.toDisplayString(e.unref(o)("Are you sure you want to delete these files?")),1),e.createElementVNode("div",gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,l=>(e.openBlock(),e.createElementBlock("p",kt,[l.type==="dir"?(e.openBlock(),e.createElementBlock("svg",_t,yt)):(e.openBlock(),e.createElementBlock("svg",wt,Et)),e.createElementVNode("span",Vt,e.toDisplayString(l.basename),1)]))),256))]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[0]||(i[0]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}};function P(a,t=14){let o=`((?=([\\w\\W]{0,${t}}))([\\w\\W]{${t+1},})([\\w\\W]{8,}))`;return a.replace(new RegExp(o),"$2..$4")}const Bt={class:"sm:flex sm:items-start"},$t=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),St={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ct={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Dt={class:"mt-2"},Mt={key:0,class:"pointer-events-none"},Tt={key:1,class:"pointer-events-none"},Lt=["disabled"],At=["disabled"],jt={class:"text-gray-500 text-sm mb-1 pr-1 max-h-[200px] overflow-y-auto vf-scrollbar"},Ft={class:"rounded flex flex-shrink-0 w-6 h-6 border bg-gray-50 text-xs cursor-default dark:border-gray-700 dark:bg-gray-800 dark:text-gray-50"},Ut=["textContent"],zt={class:"ml-1 w-full h-fit"},It={class:"text-left hidden md:block"},Rt={class:"text-left md:hidden"},Ht={key:0,class:"ml-auto"},qt=["title","disabled","onClick"],Ot=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),Pt=[Ot],Gt={key:0,class:"py-2"},Wt=["disabled"],Kt={__name:"ModalUpload",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=o("uppy"),r={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10},u=e.ref({QUEUE_ENTRY_STATUS:r}),s=e.ref(null),i=e.ref(null),l=e.ref(null),c=e.ref(null),f=e.ref(null),h=e.ref(null),d=e.ref([]),m=e.ref(""),p=e.ref(!1),v=e.ref(!1);let k;function E(B){return d.value.findIndex(D=>D.id===B)}function _(B,D=null){D=D??(B.webkitRelativePath||B.name),k.addFile({name:D,type:B.type,data:B,source:"Local"})}function x(B){switch(B.status){case r.DONE:return"text-green-600";case r.ERROR:return"text-red-600";case r.CANCELED:return"text-red-600";case r.PENDING:default:return""}}const M=B=>{switch(B.status){case r.DONE:return"✓";case r.ERROR:case r.CANCELED:return"!";case r.PENDING:default:return"..."}};function b(){c.value.click()}function y(){if(!p.value){if(!d.value.filter(B=>B.status!==r.DONE).length){m.value=o("Please select file to upload first.");return}m.value="",k.retryAll(),k.upload()}}function w(){k.cancelAll({reason:"user"}),d.value.forEach(B=>{B.status!==r.DONE&&(B.status=r.CANCELED,B.statusName=o("Canceled"))}),p.value=!1}function $(B){p.value||(k.removeFile(B.id,"removed-by-user"),d.value.splice(E(B.id),1))}function S(B){if(!p.value){if(k.cancelAll({reason:"user"}),B){const D=[];d.value.forEach(g=>{g.status!==r.DONE&&D.push(g)}),d.value=[],D.forEach(g=>{_(g.originalFile,g.name)});return}d.value.splice(0)}}function z(){t.modal.close()}function F(){return t.requester.transformRequestParams({url:"",method:"post",params:{q:"upload",adapter:t.fs.adapter,path:t.fs.data.dirname}})}return e.onMounted(async()=>{k=new me({debug:t.debug,restrictions:{maxFileSize:be(t.maxFileSize)},locale:n,onBeforeFileAdded(g,V){if(V[g.id]!=null){const j=E(g.id);d.value[j].status===r.PENDING&&(m.value=k.i18n("noDuplicates",{fileName:g.name})),d.value=d.value.filter(R=>R.id!==g.id)}return d.value.push({id:g.id,name:g.name,size:t.filesize(g.size),status:r.PENDING,statusName:o("Pending upload"),percent:null,originalFile:g.data}),!0}}),k.use(fe,{endpoint:"WILL_BE_REPLACED_BEFORE_UPLOAD",limit:5,timeout:0,getResponseError(g,V){let N;try{N=JSON.parse(g).message}catch{N=o("Cannot parse server response.")}return new Error(N)}}),k.on("restriction-failed",(g,V)=>{const N=d.value[E(g.id)];$(N),m.value=V.message}),k.on("upload",()=>{const g=F();k.setMeta({...g.body});const V=k.getPlugin("XHRUpload");V.opts.method=g.method,V.opts.endpoint=g.url+"?"+new URLSearchParams(g.params),V.opts.headers=g.headers,p.value=!0,d.value.forEach(N=>{N.status!==r.DONE&&(N.percent=null,N.status=r.UPLOADING,N.statusName=o("Pending upload"))})}),k.on("upload-progress",(g,V)=>{const N=Math.floor(V.bytesUploaded/V.bytesTotal*100);d.value[E(g.id)].percent=`${N}%`}),k.on("upload-success",g=>{const V=d.value[E(g.id)];V.status=r.DONE,V.statusName=o("Done")}),k.on("upload-error",(g,V)=>{const N=d.value[E(g.id)];N.percent=null,N.status=r.ERROR,V.isNetworkError?N.statusName=o("Network Error, Unable establish connection to the server or interrupted."):N.statusName=V?V.message:o("Unknown Error")}),k.on("error",g=>{m.value=g.message,p.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname},noCloseModal:!0})}),k.on("complete",()=>{p.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname},noCloseModal:!0})}),c.value.addEventListener("click",()=>{i.value.click()}),f.value.addEventListener("click",()=>{l.value.click()}),h.value.addEventListener("dragover",g=>{g.preventDefault(),v.value=!0}),h.value.addEventListener("dragleave",g=>{g.preventDefault(),v.value=!1});function B(g,V){V.isFile&&V.file(N=>g(V,N)),V.isDirectory&&V.createReader().readEntries(N=>{N.forEach(j=>{B(g,j)})})}h.value.addEventListener("drop",g=>{g.preventDefault(),v.value=!1;const V=/^[/\\](.+)/;[...g.dataTransfer.items].forEach(N=>{N.kind==="file"&&B((j,R)=>{const le=V.exec(j.fullPath);_(R,le[1])},N.webkitGetAsEntry())})});const D=({target:g})=>{const V=g.files;for(const N of V)_(N);g.value=""};i.value.addEventListener("change",D),l.value.addEventListener("change",D)}),e.onBeforeUnmount(()=>{k==null||k.close({reason:"unmount"})}),(B,D)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["vf-btn vf-btn-primary",p.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500"]),disabled:p.value,onClick:e.withModifiers(y,["prevent"])},e.toDisplayString(e.unref(o)("Upload")),11,Wt),p.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(w,["prevent"])},e.toDisplayString(e.unref(o)("Cancel")),1)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(z,["prevent"])},e.toDisplayString(e.unref(o)("Close")),1))]),default:e.withCtx(()=>[e.createElementVNode("div",Bt,[$t,e.createElementVNode("div",St,[e.createElementVNode("h3",Ct,e.toDisplayString(e.unref(o)("Upload Files")),1),e.createElementVNode("div",Dt,[e.createElementVNode("div",{ref_key:"dropArea",ref:h,class:"flex items-center justify-center text-lg mb-4 text-gray-500 border-2 border-gray-300 rounded border-dashed select-none cursor-pointer dark:border-gray-600 h-[120px]",onClick:b},[v.value?(e.openBlock(),e.createElementBlock("div",Mt,e.toDisplayString(e.unref(o)("Release to drop these files.")),1)):(e.openBlock(),e.createElementBlock("div",Tt,e.toDisplayString(e.unref(o)("Drag and drop the files/folders to here or click here.")),1))],512),e.createElementVNode("div",{ref_key:"container",ref:s,class:"text-gray-500 mb-1"},[e.createElementVNode("button",{ref_key:"pickFiles",ref:c,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Files")),513),e.createElementVNode("button",{ref_key:"pickFolders",ref:f,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Folders")),513),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:p.value,onClick:D[0]||(D[0]=g=>S(!1))},e.toDisplayString(e.unref(o)("Clear all")),9,Lt),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:p.value,onClick:D[1]||(D[1]=g=>S(!0))},e.toDisplayString(e.unref(o)("Clear only successful")),9,At)],512),e.createElementVNode("div",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("div",{class:"flex hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-gray-300",key:g.id},[e.createElementVNode("span",Ft,[e.createElementVNode("span",{class:e.normalizeClass(["text-base m-auto",x(g)]),textContent:e.toDisplayString(M(g))},null,10,Ut)]),e.createElementVNode("div",zt,[e.createElementVNode("div",It,e.toDisplayString(e.unref(P)(g.name,40))+" ("+e.toDisplayString(g.size)+")",1),e.createElementVNode("div",Rt,e.toDisplayString(e.unref(P)(g.name,16))+" ("+e.toDisplayString(g.size)+")",1),e.createElementVNode("div",{class:e.normalizeClass(["flex break-all text-left",x(g)])},[e.createTextVNode(e.toDisplayString(g.statusName)+" ",1),g.status===u.value.QUEUE_ENTRY_STATUS.UPLOADING?(e.openBlock(),e.createElementBlock("b",Ht,e.toDisplayString(g.percent),1)):e.createCommentVNode("",!0)],2)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["rounded w-5 h-5 border-1 text-base leading-none font-medium focus:outline-none dark:border-gray-200 dark:text-gray-400 dark:hover:text-gray-200 dark:bg-gray-600 ml-auto sm:text-xs hover:text-red-600",p.value?"disabled:bg-gray-100 text-white text-opacity-50":"bg-gray-100"]),title:e.unref(o)("Delete"),disabled:p.value,onClick:V=>$(g)},Pt,10,qt)]))),128)),d.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gt,e.toDisplayString(e.unref(o)("No files selected!")),1))]),m.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:D[2]||(D[2]=g=>m.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),e.createElementVNode("input",{ref_key:"internalFileInput",ref:i,type:"file",multiple:"",class:"hidden"},null,512),e.createElementVNode("input",{ref_key:"internalFolderInput",ref:l,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1}))}},Yt={class:"sm:flex sm:items-start"},Jt=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Qt={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Xt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Zt={class:"mt-2"},eo={class:"flex text-sm text-gray-800 dark:text-gray-400"},to={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},oo=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),ro=[oo],no={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ao=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),so=[ao],lo={class:"ml-1.5"},io={class:"my-1 text-sm text-gray-500"},te={__name:"ModalUnarchive",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items[0]),r=e.ref(""),u=e.ref([]),s=()=>{t.emitter.emit("vf-fetch",{params:{q:"unarchive",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{item:n.value.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file unarchived.")})},onError:i=>{r.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:l[1]||(l[1]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Yt,[Jt,e.createElementVNode("div",Qt,[e.createElementVNode("h3",Xt,e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,c=>(e.openBlock(),e.createElementBlock("p",eo,[c.type==="dir"?(e.openBlock(),e.createElementBlock("svg",to,ro)):(e.openBlock(),e.createElementBlock("svg",no,so)),e.createElementVNode("span",lo,e.toDisplayString(c.basename),1)]))),256)),e.createElementVNode("p",io,e.toDisplayString(e.unref(o)("The archive will be unarchived at"))+" ("+e.toDisplayString(e.unref(t).fs.data.dirname)+")",1),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[0]||(l[0]=c=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},co={class:"sm:flex sm:items-start"},uo=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),mo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},fo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},po={class:"mt-2"},ho={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},vo={class:"flex text-sm text-gray-800 dark:text-gray-400"},go={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ko=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),_o=[ko],xo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},yo=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),wo=[yo],bo={class:"ml-1.5"},Eo=["placeholder"],oe={__name:"ModalArchive",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=e.ref(t.modal.data.items),s=()=>{u.value.length&&t.emitter.emit("vf-fetch",{params:{q:"archive",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:u.value.map(({path:i,type:l})=>({path:i,type:l})),name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file(s) archived.")})},onError:i=>{r.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:l[2]||(l[2]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",co,[uo,e.createElementVNode("div",mo,[e.createElementVNode("h3",fo,e.toDisplayString(e.unref(o)("Archive the files")),1),e.createElementVNode("div",po,[e.createElementVNode("div",ho,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,c=>(e.openBlock(),e.createElementBlock("p",vo,[c.type==="dir"?(e.openBlock(),e.createElementBlock("svg",go,_o)):(e.openBlock(),e.createElementBlock("svg",xo,wo)),e.createElementVNode("span",bo,e.toDisplayString(c.basename),1)]))),256))]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>n.value=c),onKeyup:e.withKeys(s,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Archive name. (.zip file will be created)"),type:"text"},null,40,Eo),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[1]||(l[1]=c=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Vo={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},No=e.createElementVNode("path",{d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44z"},null,-1),Bo=[No];function $o(a,t){return e.openBlock(),e.createElementBlock("svg",Vo,[...Bo])}const So={render:$o},Co={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},Do=e.createElementVNode("path",{d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"},null,-1),Mo=[Do];function To(a,t){return e.openBlock(),e.createElementBlock("svg",Co,[...Mo])}const Lo={render:To},Ao={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},jo=e.createElementVNode("path",{d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},null,-1),Fo=[jo];function Uo(a,t){return e.openBlock(),e.createElementBlock("svg",Ao,[...Fo])}const zo={render:Uo},Io={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Ro=e.createElementVNode("path",{d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.089 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1),Ho=[Ro];function qo(a,t){return e.openBlock(),e.createElementBlock("svg",Io,[...Ho])}const Oo={render:qo},Po={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},Go=e.createElementVNode("path",{d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},null,-1),Wo=[Go];function Ko(a,t){return e.openBlock(),e.createElementBlock("svg",Po,[...Wo])}const Yo={render:Ko},Jo={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Qo=e.createElementVNode("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1),Xo=[Qo];function Zo(a,t){return e.openBlock(),e.createElementBlock("svg",Jo,[...Xo])}const er={render:Zo},tr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},or=e.createElementVNode("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1),rr=[or];function nr(a,t){return e.openBlock(),e.createElementBlock("svg",tr,[...rr])}const ar={render:nr},sr={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",viewBox:"0 0 24 24"},lr=e.createElementVNode("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25 stroke-blue-900 dark:stroke-blue-100"},null,-1),ir=e.createElementVNode("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1),cr=[lr,ir];function dr(a,t){return e.openBlock(),e.createElementBlock("svg",sr,[...cr])}const re={render:dr},ur={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},mr=e.createElementVNode("path",{d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},null,-1),fr=[mr];function pr(a,t){return e.openBlock(),e.createElementBlock("svg",ur,[...fr])}const hr={render:pr},vr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},gr=e.createElementVNode("path",{d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"},null,-1),kr=[gr];function _r(a,t){return e.openBlock(),e.createElementBlock("svg",vr,[...kr])}const xr={render:_r},yr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},wr=e.createElementVNode("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25zm0 9.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18zM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25zm0 9.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18z"},null,-1),br=[wr];function Er(a,t){return e.openBlock(),e.createElementBlock("svg",yr,[...br])}const Vr={render:Er},Nr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Br=e.createElementVNode("path",{d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75"},null,-1),$r=[Br];function Sr(a,t){return e.openBlock(),e.createElementBlock("svg",Nr,[...$r])}const Cr={render:Sr},Dr={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mr={key:0,class:"flex text-center"},Tr=["aria-label"],Lr=["aria-label"],Ar=["aria-label"],jr=["aria-label"],Fr=["aria-label"],Ur=["aria-label"],zr=["aria-label"],Ir={key:1,class:"flex text-center"},Rr={class:"pl-2"},Hr={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},qr={class:"flex text-center items-center justify-end"},Or=["aria-label"],Pr=["aria-label"],Gr={__name:"Toolbar",setup(a){const t=e.inject("ServiceContainer"),{setStore:o}=t.storage,{t:n}=t.i18n,r=t.dragSelect,u=e.ref("");t.emitter.on("vf-search-query",({newQuery:l})=>{u.value=l});const s=()=>{t.fullScreen=!t.fullScreen,o("full-screen",t.fullScreen),t.emitter.emit("vf-fullscreen-toggle")},i=()=>{t.view=t.view==="list"?"grid":"list",r.refreshSelection(),o("viewport",t.view)};return(l,c)=>(e.openBlock(),e.createElementBlock("div",Dr,[u.value.length?(e.openBlock(),e.createElementBlock("div",Ir,[e.createElementVNode("div",Rr,[e.createTextVNode(e.toDisplayString(e.unref(n)("Search results for"))+" ",1),e.createElementVNode("span",Hr,e.toDisplayString(u.value),1)]),e.unref(t).fs.loading?(e.openBlock(),e.createBlock(e.unref(re),{key:0})):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mr,[e.unref(t).features.includes(e.unref(C).NEW_FOLDER)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(n)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:c[0]||(c[0]=f=>e.unref(t).modal.open(X,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(So))],8,Tr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).NEW_FILE)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(n)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[1]||(c[1]=f=>e.unref(t).modal.open(Qe,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Lo))],8,Lr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).RENAME)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"mx-1.5","aria-label":e.unref(n)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[2]||(c[2]=f=>e.unref(r).getCount()!==1||e.unref(t).modal.open(Z,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(zo),{class:e.normalizeClass(e.unref(r).getCount()===1?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Ar)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).DELETE)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"mx-1.5","aria-label":e.unref(n)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[3]||(c[3]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(ee,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Oo),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,jr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).UPLOAD)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"mx-1.5","aria-label":e.unref(n)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[4]||(c[4]=f=>e.unref(t).modal.open(Kt,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Yo))],8,Fr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).UNARCHIVE)&&e.unref(r).getCount()===1&&e.unref(r).getSelected()[0].mime_type==="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:5,class:"mx-1.5","aria-label":e.unref(n)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[5]||(c[5]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(te,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(ar),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Ur)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).ARCHIVE)?(e.openBlock(),e.createElementBlock("div",{key:6,class:"mx-1.5","aria-label":e.unref(n)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[6]||(c[6]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(oe,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(er),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,zr)):e.createCommentVNode("",!0)])),e.createElementVNode("div",qr,[e.unref(t).features.includes(e.unref(C).FULL_SCREEN)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:s,class:"mx-1.5","aria-label":e.unref(n)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip"},[e.unref(t).fullScreen?(e.openBlock(),e.createBlock(e.unref(xr),{key:0})):(e.openBlock(),e.createBlock(e.unref(hr),{key:1}))],8,Or)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(n)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:c[7]||(c[7]=f=>u.value.length||i())},[e.unref(t).view==="grid"?(e.openBlock(),e.createBlock(e.unref(Vr),{key:0,class:e.normalizeClass(u.value.length?"vf-toolbar-icon-disabled":"vf-toolbar-icon")},null,8,["class"])):e.createCommentVNode("",!0),e.unref(t).view==="list"?(e.openBlock(),e.createBlock(e.unref(Cr),{key:1,class:e.normalizeClass(u.value.length?"vf-toolbar-icon-disabled":"vf-toolbar-icon")},null,8,["class"])):e.createCommentVNode("",!0)],8,Pr)])]))}},Wr=(a,t=0,o=!1)=>{let n;return(...r)=>{o&&!n&&a(...r),clearTimeout(n),n=setTimeout(()=>{a(...r)},t)}},K=(a,t,o)=>{const n=e.ref(a);return e.customRef((r,u)=>({get(){return r(),n.value},set:Wr(s=>{n.value=s,u()},t,o)}))},Kr={class:"sm:flex sm:items-start"},Yr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),Jr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Qr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Xr={class:"text-sm text-gray-500 pb-1"},Zr={class:"max-h-[200px] overflow-y-auto vf-scrollbar text-left"},en={class:"flex text-sm text-gray-800 dark:text-gray-400"},tn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},on=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),rn=[on],nn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},an=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),sn=[an],ln={class:"ml-1.5"},cn={class:"font-bold text-xs text-gray-700 dark:text-gray-500 mt-3 tracking-wider"},dn={class:"flex text-sm text-gray-800 dark:text-gray-400 border dark:border-gray-700 p-1 rounded"},un=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),mn={class:"ml-1.5 overflow-auto"},fn={class:"m-1 mr-auto font-bold text-gray-500 text-sm dark:text-gray-200 self-center"},G={__name:"ModalMove",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items.from),r=e.ref(""),u=()=>{n.value.length&&t.emitter.emit("vf-fetch",{params:{q:"move",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:n.value.map(({path:s,type:i})=>({path:s,type:i})),item:t.modal.data.items.to.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files moved.",t.modal.data.items.to.name)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:i[1]||(i[1]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",fn,e.toDisplayString(e.unref(o)("%s item(s) selected.",n.value.length)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Kr,[Yr,e.createElementVNode("div",Jr,[e.createElementVNode("h3",Qr,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("p",Xr,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("div",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,l=>(e.openBlock(),e.createElementBlock("div",en,[e.createElementVNode("div",null,[l.type==="dir"?(e.openBlock(),e.createElementBlock("svg",tn,rn)):(e.openBlock(),e.createElementBlock("svg",nn,sn))]),e.createElementVNode("div",ln,e.toDisplayString(l.path),1)]))),256))]),e.createElementVNode("h4",cn,e.toDisplayString(e.unref(o)("Target Directory")),1),e.createElementVNode("p",dn,[un,e.createElementVNode("span",mn,e.toDisplayString(e.unref(t).modal.data.items.to.path),1)]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[0]||(i[0]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1}))}},pn={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",viewBox:"-40 -40 580 580"},hn=e.createElementVNode("path",{d:"M463.5 224h8.5c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2S461.9 48.1 455 55l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224z"},null,-1),vn=[hn];function gn(a,t){return e.openBlock(),e.createElementBlock("svg",pn,[...vn])}const kn={render:gn},_n={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-0.5 rounded",viewBox:"0 0 20 20"},xn=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414 0",class:"pointer-events-none","clip-rule":"evenodd"},null,-1),yn=[xn];function wn(a,t){return e.openBlock(),e.createElementBlock("svg",_n,[...yn])}const bn={render:wn},En={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",viewBox:"0 0 24 24"},Vn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1),Nn=[Vn];function Bn(a,t){return e.openBlock(),e.createElementBlock("svg",En,[...Nn])}const $n={render:Bn},Sn={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",viewBox:"0 0 20 20"},Cn=e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 0 0-1.414 0l-7 7a1 1 0 0 0 1.414 1.414L4 10.414V17a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6.586l.293.293a1 1 0 0 0 1.414-1.414z",class:"pointer-events-none"},null,-1),Dn=[Cn];function Mn(a,t){return e.openBlock(),e.createElementBlock("svg",Sn,[...Dn])}const Tn={render:Mn},Ln={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",viewBox:"0 0 20 20"},An=e.createElementVNode("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"},null,-1),jn=[An];function Fn(a,t){return e.openBlock(),e.createElementBlock("svg",Ln,[...jn])}const Un={render:Fn},zn={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"w-6 h-6 cursor-pointer",viewBox:"0 0 24 24"},In=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1),Rn=[In];function Hn(a,t){return e.openBlock(),e.createElementBlock("svg",zn,[...Rn])}const qn={render:Hn},On={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",viewBox:"0 0 24 24"},Pn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2"},null,-1),Gn=[Pn];function Wn(a,t){return e.openBlock(),e.createElementBlock("svg",On,[...Gn])}const ne={render:Wn},Kn={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 rounded text-slate-700 hover:bg-neutral-100 dark:fill-neutral-300 dark:hover:bg-gray-800 cursor-pointer",viewBox:"0 0 448 512"},Yn=e.createElementVNode("path",{d:"M8 256a56 56 0 1 1 112 0 56 56 0 1 1-112 0m160 0a56 56 0 1 1 112 0 56 56 0 1 1-112 0m216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112"},null,-1),Jn=[Yn];function Qn(a,t){return e.openBlock(),e.createElementBlock("svg",Kn,[...Jn])}const Xn={render:Qn},Zn={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-sm"},ea=["aria-label"],ta=["aria-label"],oa=["aria-label"],ra={class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full overflow-hidden"},na={class:"flex leading-6"},aa={key:0,class:"flex"},sa=e.createElementVNode("div",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),la={class:"relative"},ia=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),ca=["onDragover","onDragleave","onDrop","title","onClick"],da={class:"relative flex bg-white dark:bg-gray-700 justify-between items-center rounded p-1 ml-2 w-full"},ua=["placeholder"],ma={class:"z-30 absolute top-[65px] md:top-[75px] left-[90px] rounded -mx-1.5 mt-1 bg-neutral-50 dark:bg-gray-800 max-w-80 max-h-50 shadow overflow-y-auto text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600"},fa=["onDrop","onClick"],pa={class:"flex pointer-events-none"},ha={class:"inline-block w-full text-ellipsis overflow-hidden"},va={__name:"Breadcrumb",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=t.dragSelect,r=e.ref(null),u=K(0,100);e.watch(u,b=>{const y=r.value.children;let w=0,$=0,S=5,z=1;t.fs.limitBreadcrumbItems(S),e.nextTick(()=>{console.log("width updated");for(let F=y.length-1;F>=0&&!(w+y[F].offsetWidth>u.value-40);F--)w+=parseInt(y[F].offsetWidth,10),$++;$<z&&($=z),$>S&&($=S),t.fs.limitBreadcrumbItems($)})});const s=()=>{u.value=r.value.offsetWidth};e.onMounted(()=>{new ResizeObserver(s).observe(r.value)});const i=(b,y=null)=>{b.preventDefault(),n.isDraggingRef.value=!1,f(b),y??(y=t.fs.hiddenBreadcrumbs.length-1);let w=JSON.parse(b.dataTransfer.getData("items"));if(w.find($=>$.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:w,to:t.fs.hiddenBreadcrumbs[y]??{path:t.fs.adapter+"://"}}})},l=(b,y=null)=>{b.preventDefault(),n.isDraggingRef.value=!1,f(b),y??(y=t.fs.breadcrumbs.length-2);let w=JSON.parse(b.dataTransfer.getData("items"));if(w.find($=>$.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:w,to:t.fs.breadcrumbs[y]??{path:t.fs.adapter+"://"}}})},c=b=>{b.preventDefault(),t.fs.isGoUpAvailable()?(b.dataTransfer.dropEffect="copy",b.currentTarget.classList.add("bg-blue-200","dark:bg-slate-600")):(b.dataTransfer.dropEffect="none",b.dataTransfer.effectAllowed="none")},f=b=>{b.preventDefault(),b.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-600"),t.fs.isGoUpAvailable()&&b.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-600")},h=()=>{x(),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})},d=()=>{x(),!t.fs.isGoUpAvailable()||t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.parentFolderPath}})},m=b=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:b.path}}),t.fs.toggleHiddenBreadcrumbs(!1)},p=()=>{t.fs.showHiddenBreadcrumbs&&t.fs.toggleHiddenBreadcrumbs(!1)},v={mounted(b,y,w,$){b.clickOutsideEvent=function(S){b===S.target||b.contains(S.target)||y.value()},document.body.addEventListener("click",b.clickOutsideEvent)},beforeUnmount(b,y,w,$){document.body.removeEventListener("click",b.clickOutsideEvent)}},k=e.ref(null),E=()=>{t.features.includes(C.SEARCH)&&(t.fs.searchMode=!0,e.nextTick(()=>k.value.focus()))},_=K("",400);e.watch(_,b=>{t.emitter.emit("vf-toast-clear"),t.emitter.emit("vf-search-query",{newQuery:b})});const x=()=>{t.fs.searchMode=!1,_.value=""};t.emitter.on("vf-search-exit",()=>{x()});const M=()=>{_.value===""&&x()};return(b,y)=>(e.openBlock(),e.createElementBlock("div",Zn,[e.createElementVNode("span",{"aria-label":e.unref(o)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref(bn),{onDragover:y[0]||(y[0]=w=>c(w)),onDragleave:y[1]||(y[1]=w=>f(w)),onDrop:y[2]||(y[2]=w=>l(w)),onClick:d,class:e.normalizeClass(e.unref(t).fs.isGoUpAvailable()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500")},null,8,["class"])],8,ea),e.unref(t).fs.loading?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(o)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref($n),{onClick:y[3]||(y[3]=w=>e.unref(t).emitter.emit("vf-fetch-abort"))})],8,oa)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(o)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref(kn),{onClick:h})],8,ta)),e.withDirectives(e.createElementVNode("div",ra,[e.createElementVNode("div",null,[e.createVNode(e.unref(Tn),{onDragover:y[4]||(y[4]=w=>c(w)),onDragleave:y[5]||(y[5]=w=>f(w)),onDrop:y[6]||(y[6]=w=>l(w,-1)),onClick:y[7]||(y[7]=w=>e.unref(t).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(t).fs.adapter}}))})]),e.createElementVNode("div",na,[e.unref(t).fs.hiddenBreadcrumbs.length?e.withDirectives((e.openBlock(),e.createElementBlock("div",aa,[sa,e.createElementVNode("div",la,[e.createElementVNode("span",{onDragenter:y[8]||(y[8]=w=>e.unref(t).fs.toggleHiddenBreadcrumbs(!0)),onClick:y[9]||(y[9]=w=>e.unref(t).fs.toggleHiddenBreadcrumbs()),class:"text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer"},[e.createVNode(e.unref(Xn),{class:"px-1 pointer-events-none"})],32)])])),[[v,p]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"breadcrumbContainer",ref:r,class:"flex leading-6 w-full overflow-hidden",onClick:e.withModifiers(E,["self"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.breadcrumbs,(w,$)=>(e.openBlock(),e.createElementBlock("div",{key:$},[ia,e.createElementVNode("span",{onDragover:S=>$===e.unref(t).fs.breadcrumbs.length-1||c(S),onDragleave:S=>$===e.unref(t).fs.breadcrumbs.length-1||f(S),onDrop:S=>$===e.unref(t).fs.breadcrumbs.length-1||l(S,$),class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer whitespace-nowrap",title:w.basename,onClick:S=>e.unref(t).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(t).fs.adapter,path:w.path}})},e.toDisplayString(w.name),41,ca)]))),128))],512),e.unref(t).fs.loading?(e.openBlock(),e.createBlock(e.unref(re),{key:0})):e.createCommentVNode("",!0)],512),[[e.vShow,!e.unref(t).fs.searchMode]]),e.withDirectives(e.createElementVNode("div",da,[e.createElementVNode("div",null,[e.createVNode(e.unref(Un))]),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:k,onKeydown:e.withKeys(x,["esc"]),onBlur:M,"onUpdate:modelValue":y[10]||(y[10]=w=>e.isRef(_)?_.value=w:null),placeholder:e.unref(o)("Search anything.."),class:"w-full pb-0 px-1 border-0 text-base ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,ua),[[e.vModelText,e.unref(_)]]),e.createVNode(e.unref(qn),{onClick:x})],512),[[e.vShow,e.unref(t).fs.searchMode]]),e.withDirectives(e.createElementVNode("div",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.hiddenBreadcrumbs,(w,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,onDragover:y[11]||(y[11]=S=>c(S)),onDragleave:y[12]||(y[12]=S=>f(S)),onDrop:S=>i(S,$),onClick:S=>m(w),class:"px-2 py-0.5 hover:bg-gray-400/20 cursor-pointer items-center whitespace-nowrap"},[e.createElementVNode("div",pa,[e.createElementVNode("span",null,[e.createVNode(e.unref(ne),{class:"h-5 w-5"})]),e.createTextVNode(),e.createElementVNode("span",ha,e.toDisplayString(w.name),1)])],40,fa))),128))],512),[[e.vShow,e.unref(t).fs.showHiddenBreadcrumbs]])]))}},ae=(a,t=null)=>new Date(a*1e3).toLocaleString(t??navigator.language??"en-US"),ga=["onClick"],ka={__name:"Toast",setup(a){const t=e.inject("ServiceContainer"),{getStore:o}=t.storage,n=e.ref(o("full-screen",!1)),r=e.ref([]),u=l=>l==="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",s=l=>{r.value.splice(l,1)},i=l=>{let c=r.value.findIndex(f=>f.id===l);c!==-1&&s(c)};return t.emitter.on("vf-toast-clear",()=>{r.value=[]}),t.emitter.on("vf-toast-push",l=>{let c=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");l.id=c,r.value.push(l),setTimeout(()=>{i(c)},5e3)}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.value.value?"fixed":"absolute","max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(f,h)=>(e.openBlock(),e.createElementBlock("div",{onClick:d=>s(h),key:f,class:e.normalizeClass([u(f.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(f.label),11,ga))),128))]),_:1})],2))}},_a={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 20 20"},xa=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414","clip-rule":"evenodd"},null,-1),ya=[xa];function wa(a,t){return e.openBlock(),e.createElementBlock("svg",_a,[...ya])}const ba={render:wa},Ea={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 20 20"},Va=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 0 1-1.414 0L10 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414","clip-rule":"evenodd"},null,-1),Na=[Va];function Ba(a,t){return e.openBlock(),e.createElementBlock("svg",Ea,[...Na])}const $a={render:Ba},I={__name:"SortIcon",props:{direction:String},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[a.direction==="asc"?(e.openBlock(),e.createBlock(e.unref(ba),{key:0})):e.createCommentVNode("",!0),a.direction==="desc"?(e.openBlock(),e.createBlock(e.unref($a),{key:1})):e.createCommentVNode("",!0)]))}},Sa={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"text-neutral-500",viewBox:"0 0 24 24"},Ca=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1),Da=[Ca];function Ma(a,t){return e.openBlock(),e.createElementBlock("svg",Sa,[...Da])}const Ta={render:Ma},q={__name:"ItemIcon",props:{type:{type:String,required:!0},small:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("span",null,[a.type==="dir"?(e.openBlock(),e.createBlock(e.unref(ne),{key:0,class:e.normalizeClass({"h-5 w-5":a.small,"h-10 w-10 md:h-12 md:w-12 m-auto":!a.small})},null,8,["class"])):(e.openBlock(),e.createBlock(e.unref(Ta),{key:1,class:e.normalizeClass({"h-5 w-5":a.small,"h-10 w-10 md:h-12 md:w-12 m-auto":!a.small})},null,8,["class"]))]))}},La={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",viewBox:"0 0 24 24"},Aa=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1),ja=[Aa];function Fa(a,t){return e.openBlock(),e.createElementBlock("svg",La,[...ja])}const Ua={render:Fa},za={class:"absolute -z-50 -top-96"},Ia={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},Ra={__name:"DragItem",props:{count:{type:Number,default:0}},setup(a){const t=a;return(o,n)=>(e.openBlock(),e.createElementBlock("div",za,[e.createVNode(e.unref(Ua)),e.createElementVNode("div",Ia,e.toDisplayString(t.count),1)]))}},Ha={class:"flex"},qa=["aria-label"],Oa={class:"ml-auto mb-2"},Pa={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Ga={key:1},Wa={__name:"Text",emits:["success"],setup(a,{emit:t}){const o=t,n=e.ref(""),r=e.ref(""),u=e.ref(null),s=e.ref(!1),i=e.ref(""),l=e.ref(!1),c=e.inject("ServiceContainer"),{t:f}=c.i18n;e.onMounted(()=>{c.requester.send({url:"",method:"get",params:{q:"preview",adapter:c.modal.data.adapter,path:c.modal.data.item.path},responseType:"text"}).then(m=>{n.value=m,o("success")})});const h=()=>{s.value=!s.value,r.value=n.value,s.value==!0&&e.nextTick(()=>{u.value.focus()})},d=()=>{i.value="",l.value=!1,c.requester.send({url:"",method:"post",params:{q:"save",adapter:c.modal.data.adapter,path:c.modal.data.item.path},body:{content:r.value},responseType:"text"}).then(m=>{i.value=f("Updated."),n.value=m,o("success"),s.value=!s.value}).catch(m=>{i.value=f(m.message),l.value=!0})};return(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ha,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(c).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(c).modal.data.item.basename),9,qa),e.createElementVNode("div",Oa,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(f)("Save")),1)):e.createCommentVNode("",!0),e.unref(c).features.includes(e.unref(C).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:p[0]||(p[0]=v=>h())},e.toDisplayString(s.value?e.unref(f)("Cancel"):e.unref(f)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[s.value?(e.openBlock(),e.createElementBlock("div",Ga,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:u,"onUpdate:modelValue":p[1]||(p[1]=v=>r.value=v),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,r.value]])])):(e.openBlock(),e.createElementBlock("pre",Pa,e.toDisplayString(n.value),1)),i.value.length?(e.openBlock(),e.createBlock(L,{key:2,onHidden:p[2]||(p[2]=v=>i.value=""),error:l.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Ka={class:"flex"},Ya=["aria-label"],Ja={class:"ml-auto mb-2"},Qa={class:"w-full flex justify-center"},Xa=["src"],Za={__name:"Image",emits:["success"],setup(a,{emit:t}){const o=t,n=e.inject("ServiceContainer"),{t:r}=n.i18n,u=e.ref(null),s=e.ref(null),i=e.ref(!1),l=e.ref(""),c=e.ref(!1),f=()=>{i.value=!i.value,i.value?s.value=new he(u.value,{crop(d){}}):s.value.destroy()},h=()=>{s.value.getCroppedCanvas({width:795,height:341}).toBlob(d=>{l.value="",c.value=!1;const m=new FormData;m.set("file",d),n.requester.send({url:"",method:"post",params:{q:"upload",adapter:n.modal.data.adapter,path:n.modal.data.item.path},body:m}).then(p=>{l.value=r("Updated."),u.value.src=n.requester.getPreviewUrl(n.modal.data.adapter,n.modal.data.item),f(),o("success")}).catch(p=>{l.value=r(p.message),c.value=!0})})};return e.onMounted(()=>{o("success")}),(d,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ka,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(n).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(n).modal.data.item.basename),9,Ya),e.createElementVNode("div",Ja,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:h,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(r)("Crop")),1)):e.createCommentVNode("",!0),e.unref(n).features.includes(e.unref(C).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:m[0]||(m[0]=p=>f())},e.toDisplayString(i.value?e.unref(r)("Cancel"):e.unref(r)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Qa,[e.createElementVNode("img",{ref_key:"image",ref:u,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(n).requester.getPreviewUrl(e.unref(n).modal.data.adapter,e.unref(n).modal.data.item),alt:""},null,8,Xa)]),l.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:m[1]||(m[1]=p=>l.value=""),error:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},es={class:"flex"},ts=["aria-label"],os=e.createElementVNode("div",null,null,-1),rs={__name:"Default",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t;return e.onMounted(()=>{n("success")}),(r,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",es,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ts)]),os],64))}},ns=["aria-label"],as={class:"w-full aspect-video",preload:"",controls:""},ss=["src"],ls={__name:"Video",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{n("success")}),(u,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ns),e.createElementVNode("div",null,[e.createElementVNode("video",as,[e.createElementVNode("source",{src:r(),type:"video/mp4"},null,8,ss),e.createTextVNode(" Your browser does not support the video tag. ")])])]))}},is=["aria-label"],cs={class:"w-full",controls:""},ds=["src"],us={__name:"Audio",emits:["success"],setup(a,{emit:t}){const o=t,n=e.inject("ServiceContainer"),r=()=>n.requester.getPreviewUrl(n.modal.data.adapter,n.modal.data.item);return e.onMounted(()=>{o("success")}),(u,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(n).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(n).modal.data.item.basename),9,is),e.createElementVNode("div",null,[e.createElementVNode("audio",cs,[e.createElementVNode("source",{src:r(),type:"audio/mpeg"},null,8,ds),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},ms=["aria-label"],fs=["data"],ps=["src"],hs=e.createElementVNode("p",null,[e.createTextVNode(" Your browser does not support PDFs. "),e.createElementVNode("a",{href:"https://example.com/test.pdf"},"Download the PDF"),e.createTextVNode(" . ")],-1),vs=[hs],gs={__name:"Pdf",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{n("success")}),(u,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ms),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:r(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:r(),width:"100%",height:"100%"},vs,8,ps)],8,fs)])],64))}},ks={class:"sm:flex sm:items-start"},_s={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},xs={key:0},ys={class:"text-gray-700 dark:text-gray-200 text-sm"},ws={key:0,class:"flex leading-5"},bs=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),Es={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Vs={class:"font-bold"},Ns={class:"font-bold pl-2"},Bs={key:0,class:"text-xs text-gray-600 dark:text-gray-400"},$s=["download","href"],se={__name:"ModalPreview",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(!1),r=s=>(t.modal.data.item.mime_type??"").startsWith(s),u=t.features.includes(C.PREVIEW);return u||(n.value=!0),(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:i[6]||(i[6]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1),e.unref(t).features.includes(e.unref(C).DOWNLOAD)?(e.openBlock(),e.createElementBlock("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item),href:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item)},e.toDisplayString(e.unref(o)("Download")),9,$s)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",ks,[e.createElementVNode("div",_s,[e.unref(u)?(e.openBlock(),e.createElementBlock("div",xs,[r("text")?(e.openBlock(),e.createBlock(Wa,{key:0,onSuccess:i[0]||(i[0]=l=>n.value=!0)})):r("image")?(e.openBlock(),e.createBlock(Za,{key:1,onSuccess:i[1]||(i[1]=l=>n.value=!0)})):r("video")?(e.openBlock(),e.createBlock(ls,{key:2,onSuccess:i[2]||(i[2]=l=>n.value=!0)})):r("audio")?(e.openBlock(),e.createBlock(us,{key:3,onSuccess:i[3]||(i[3]=l=>n.value=!0)})):r("application/pdf")?(e.openBlock(),e.createBlock(gs,{key:4,onSuccess:i[4]||(i[4]=l=>n.value=!0)})):(e.openBlock(),e.createBlock(rs,{key:5,onSuccess:i[5]||(i[5]=l=>n.value=!0)}))])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[n.value===!1?(e.openBlock(),e.createElementBlock("div",ws,[bs,e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Es,[e.createElementVNode("div",null,[e.createElementVNode("span",Vs,e.toDisplayString(e.unref(o)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(t).filesize(e.unref(t).modal.data.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",Ns,e.toDisplayString(e.unref(o)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(ae)(e.unref(t).modal.data.item.last_modified)),1)])]),e.unref(t).features.includes(e.unref(C).DOWNLOAD)?(e.openBlock(),e.createElementBlock("div",Bs,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):e.createCommentVNode("",!0)]),_:1}))}},Ss=["data-type","data-item","data-index"],O={__name:"Item",props:{item:{type:Object},index:{type:Number},dragImage:{type:Object}},setup(a){const t=e.inject("ServiceContainer"),o=t.dragSelect,n=a,r=d=>{d.type==="dir"?(t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:d.path}})):t.modal.open(se,{adapter:t.fs.adapter,item:d})},u={mounted(d,m,p,v){p.props.draggable&&(d.addEventListener("dragstart",k=>s(k,m.value)),d.addEventListener("dragover",k=>l(k,m.value)),d.addEventListener("drop",k=>i(k,m.value)))},beforeUnmount(d,m,p,v){p.props.draggable&&(d.removeEventListener("dragstart",s),d.removeEventListener("dragover",l),d.removeEventListener("drop",i))}},s=(d,m)=>{if(d.altKey||d.ctrlKey||d.metaKey)return d.preventDefault(),!1;o.isDraggingRef.value=!0,d.dataTransfer.setDragImage(n.dragImage.$el,0,15),d.dataTransfer.effectAllowed="all",d.dataTransfer.dropEffect="copy",d.dataTransfer.setData("items",JSON.stringify(o.getSelected()))},i=(d,m)=>{d.preventDefault(),o.isDraggingRef.value=!1;let p=JSON.parse(d.dataTransfer.getData("items"));if(p.find(v=>v.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:p,to:m}})},l=(d,m)=>{d.preventDefault(),!m||m.type!=="dir"||o.getSelection().find(p=>p===d.currentTarget)?(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none"):d.dataTransfer.dropEffect="copy"};let c=null;const f=()=>{c&&clearTimeout(c)},h=d=>{c=setTimeout(()=>{const m=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:d.target.getBoundingClientRect().x,clientY:d.target.getBoundingClientRect().y});d.target.dispatchEvent(m)},500)};return(d,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({opacity:e.unref(o).isDraggingRef.value&&e.unref(o).getSelection().find(p=>d.$el===p)?"0.5 !important":""}),class:e.normalizeClass(["vf-item-"+e.unref(o).explorerId]),"data-type":a.item.type,key:a.item.path,"data-item":JSON.stringify(a.item),"data-index":a.index,onDblclick:m[0]||(m[0]=p=>r(a.item)),onTouchstart:m[1]||(m[1]=p=>h(p)),onTouchend:m[2]||(m[2]=p=>f()),onContextmenu:m[3]||(m[3]=e.withModifiers(p=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:p,items:e.unref(o).getSelected(),target:a.item}),["prevent"]))},[e.renderSlot(d.$slots,"default")],46,Ss)),[[u,a.item]])}},Cs={class:"relative flex-auto flex flex-col overflow-hidden"},Ds={key:0,class:"grid grid-cols-12 px-1 bg-neutral-50 dark:bg-gray-800 border-b border-neutral-300 dark:border-gray-700 text-xs select-none divide-x"},Ms={class:"relative"},Ts={class:"grid grid-cols-12 items-center"},Ls={class:"flex col-span-7 items-center"},As={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},js={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Fs={class:"grid grid-cols-12 items-center"},Us={class:"flex col-span-7 items-center"},zs={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Is={class:"col-span-2 text-center"},Rs={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap px-1 md:px-3"},Hs={class:"relative"},qs=["data-src","alt"],Os={key:2,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},Ps={class:"break-all"},Gs={__name:"Explorer",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=m=>m==null?void 0:m.substring(0,3),r=e.ref(null),u=e.ref(""),s=t.dragSelect;let i;t.emitter.on("vf-fullscreen-toggle",()=>{s.area.value.style.height=null}),t.emitter.on("vf-search-query",({newQuery:m})=>{u.value=m,m?t.emitter.emit("vf-fetch",{params:{q:"search",adapter:t.fs.adapter,path:t.fs.data.dirname,filter:m},onSuccess:p=>{p.files.length||t.emitter.emit("vf-toast-push",{label:o("No search result found.")})}}):t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})});const l=e.ref(!0),c=m=>{m.touches.length>1&&(l.value?(s.instance.stop(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: off")})):(s.instance.start(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: on")}),s.refreshSelection()),l.value=!l.value)},f=e.reactive({active:!1,column:"",order:""}),h=(m=!0)=>{let p=[...t.fs.data.files],v=f.column,k=f.order==="asc"?1:-1;if(!m)return p;const E=(_,x)=>typeof _=="string"&&typeof x=="string"?_.toLowerCase().localeCompare(x.toLowerCase()):_<x?-1:_>x?1:0;return f.active&&(p=p.slice().sort((_,x)=>E(_[v],x[v])*k)),p},d=m=>{f.active&&f.column===m?(f.active=f.order==="asc",f.column=m,f.order="desc"):(f.active=!0,f.column=m,f.order="asc")};return e.onMounted(()=>{i=new pe(s.area.value)}),e.onUpdated(()=>{i.update()}),e.onBeforeUnmount(()=>{i.destroy()}),(m,p)=>(e.openBlock(),e.createElementBlock("div",Cs,[e.unref(t).view==="list"||u.value.length?(e.openBlock(),e.createElementBlock("div",Ds,[e.createElementVNode("div",{onClick:p[0]||(p[0]=v=>d("basename")),class:"col-span-7 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Name"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="basename"]])]),u.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:p[1]||(p[1]=v=>d("file_size")),class:"justify-center col-span-2 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Size"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="file_size"]])])),u.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:p[2]||(p[2]=v=>d("last_modified")),class:"justify-center col-span-3 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Date"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="last_modified"]])])),u.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:p[3]||(p[3]=v=>d("path")),class:"justify-center col-span-5 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Filepath"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ms,[e.createVNode(Ra,{ref_key:"dragImage",ref:r,count:e.unref(s).getCount()},null,8,["count"])]),e.createElementVNode("div",{ref:e.unref(s).area,class:e.normalizeClass([e.unref(t).fullScreen?"":"resize-y","h-full w-full text-xs vf-selector-area vf-scrollbar min-h-[150px] overflow-auto p-1 z-0"]),onTouchstart:c,onContextmenu:p[4]||(p[4]=e.withModifiers(v=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:v,items:e.unref(s).getSelected()}),["self","prevent"]))},[u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h(),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-list"},{default:e.withCtx(()=>[e.createElementVNode("div",Ts,[e.createElementVNode("div",Ls,[e.createVNode(q,{type:v.type,small:e.unref(t).compactListView},null,8,["type","small"]),e.createElementVNode("span",As,e.toDisplayString(v.basename),1)]),e.createElementVNode("div",js,e.toDisplayString(v.path),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0),e.unref(t).view==="list"&&!u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(h(),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-list",draggable:"true"},{default:e.withCtx(()=>[e.createElementVNode("div",Fs,[e.createElementVNode("div",Us,[e.createVNode(q,{type:v.type,small:e.unref(t).compactListView},null,8,["type","small"]),e.createElementVNode("span",zs,e.toDisplayString(v.basename),1)]),e.createElementVNode("div",Is,e.toDisplayString(v.file_size?e.unref(t).filesize(v.file_size):""),1),e.createElementVNode("div",Rs,e.toDisplayString(e.unref(ae)(v.last_modified)),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0),e.unref(t).view==="grid"&&!u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h(!1),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-grid",draggable:"true"},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("div",Hs,[(v.mime_type??"").startsWith("image")&&e.unref(t).showThumbnails?(e.openBlock(),e.createElementBlock("img",{src:"data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(t).requester.getPreviewUrl(e.unref(t).fs.adapter,v),alt:v.basename,key:v.path},null,8,qs)):(e.openBlock(),e.createBlock(q,{key:1,type:v.type},null,8,["type"])),!((v.mime_type??"").startsWith("image")&&e.unref(t).showThumbnails)&&v.type!=="dir"?(e.openBlock(),e.createElementBlock("div",Os,e.toDisplayString(n(v.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",Ps,e.toDisplayString(e.unref(P)(v.basename)),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0)],34),e.createVNode(ka)]))}},Ws=["href","download"],Ks=["onClick"],Ys={__name:"ContextMenu",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(null),r=e.ref([]),u=e.ref(""),s=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),i=e.computed(()=>s.items.filter(h=>h.key==null||t.features.includes(h.key)));t.emitter.on("vf-context-selected",h=>{r.value=h});const l={newfolder:{key:C.NEW_FOLDER,title:()=>o("New Folder"),action:()=>t.modal.open(X)},delete:{key:C.DELETE,title:()=>o("Delete"),action:()=>{t.modal.open(ee,{items:r})}},refresh:{title:()=>o("Refresh"),action:()=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})}},preview:{key:C.PREVIEW,title:()=>o("Preview"),action:()=>t.modal.open(se,{adapter:t.fs.adapter,item:r.value[0]})},open:{title:()=>o("Open"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:r.value[0].path}})}},openDir:{title:()=>o("Open containing folder"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:r.value[0].dir}})}},download:{key:C.DOWNLOAD,link:e.computed(()=>t.requester.getDownloadUrl(t.fs.adapter,r.value[0])),title:()=>o("Download"),action:()=>{}},archive:{key:C.ARCHIVE,title:()=>o("Archive"),action:()=>t.modal.open(oe,{items:r})},unarchive:{key:C.UNARCHIVE,title:()=>o("Unarchive"),action:()=>t.modal.open(te,{items:r})},rename:{key:C.RENAME,title:()=>o("Rename"),action:()=>t.modal.open(Z,{items:r})}},c=h=>{t.emitter.emit("vf-contextmenu-hide"),h.action()};t.emitter.on("vf-search-query",({newQuery:h})=>{u.value=h}),t.emitter.on("vf-contextmenu-show",({event:h,items:d,target:m=null})=>{if(s.items=[],u.value)if(m)s.items.push(l.openDir),t.emitter.emit("vf-context-selected",[m]);else return;else!m&&!u.value?(s.items.push(l.refresh),s.items.push(l.newfolder),t.emitter.emit("vf-context-selected",[])):d.length>1&&d.some(p=>p.path===m.path)?(s.items.push(l.refresh),s.items.push(l.archive),s.items.push(l.delete),t.emitter.emit("vf-context-selected",d)):(m.type==="dir"?s.items.push(l.open):(s.items.push(l.preview),s.items.push(l.download)),s.items.push(l.rename),m.mime_type==="application/zip"?s.items.push(l.unarchive):s.items.push(l.archive),s.items.push(l.delete),t.emitter.emit("vf-context-selected",[m]));f(h)}),t.emitter.on("vf-contextmenu-hide",()=>{s.active=!1});const f=h=>{const d=t.dragSelect.area.value,m=t.root.getBoundingClientRect(),p=d.getBoundingClientRect();let v=h.clientX-m.left,k=h.clientY-m.top;s.active=!0,e.nextTick(()=>{var M;const E=(M=n.value)==null?void 0:M.getBoundingClientRect();let _=(E==null?void 0:E.height)??0,x=(E==null?void 0:E.width)??0;v=p.right-h.pageX+window.scrollX<x?v-x:v,k=p.bottom-h.pageY+window.scrollY<_?k-_:k,s.positions={left:v+"px",top:k+"px"}})};return(h,d)=>e.withDirectives((e.openBlock(),e.createElementBlock("ul",{ref_key:"contextmenu",ref:n,style:e.normalizeStyle(s.positions),class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded-sm select-none"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,m=>(e.openBlock(),e.createElementBlock("li",{class:"cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:m.title},[m.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"block pl-2 pr-3 py-2",target:"_blank",href:m.link,download:m.link,onClick:d[0]||(d[0]=p=>e.unref(t).emitter.emit("vf-contextmenu-hide"))},[e.createElementVNode("span",null,e.toDisplayString(m.title()),1)],8,Ws)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pl-2 pr-3 py-1.5",onClick:p=>c(m)},[e.createElementVNode("span",null,e.toDisplayString(m.title()),1)],8,Ks))]))),128))],4)),[[e.vShow,s.active]])}},Js=(a,t)=>{const o=a.__vccOpts||a;for(const[n,r]of t)o[n]=r;return o},Qs={props:{on:{type:String,required:!0}},setup(a,{emit:t,slots:o}){const n=e.inject("ServiceContainer"),r=e.ref(!1),{t:u}=n.i18n;let s=null;const i=()=>{clearTimeout(s),r.value=!0,s=setTimeout(()=>{r.value=!1},2e3)};return e.onMounted(()=>{n.emitter.on(a.on,i)}),e.onUnmounted(()=>{clearTimeout(s)}),{shown:r,t:u}}},Xs={key:1};function Zs(a,t,o,n,r,u){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-sm text-green-600 dark:text-green-600 transition-opacity duration-500 ease-out",[{"opacity-0":!n.shown}]])},[a.$slots.default?e.renderSlot(a.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",Xs,e.toDisplayString(n.t("Saved.")),1))],2)}const U=Js(Qs,[["render",Zs]]),el={class:"sm:flex sm:items-start"},tl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])],-1),ol={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},rl={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},nl={class:"mt-2"},al={class:"text-sm text-gray-500"},sl={class:"text-sm font-semibold mt-5 text-gray-900 dark:text-gray-400 tracking-wider"},ll={class:"mt-3 text-left"},il={class:"space-y-2"},cl={class:"flex relative gap-x-3"},dl={class:"h-6 items-center"},ul={class:"flex-1 block text-sm"},ml={for:"metric_unit",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},fl={class:"flex relative gap-x-3"},pl={class:"h-6 items-center"},hl={class:"flex-1 block text-sm"},vl={for:"large_icons",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},gl={class:"flex relative gap-x-3"},kl={class:"h-6 items-center"},_l={class:"flex-1 block text-sm"},xl={for:"persist_path",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},yl={class:"flex relative gap-x-3"},wl={class:"h-6 items-center"},bl={class:"flex-1 block text-sm"},El={for:"show_thumbnails",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},Vl={class:"flex relative gap-x-3"},Nl={class:"h-6 items-center"},Bl={for:"theme",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm"},$l={class:"flex text-sm"},Sl=["label"],Cl=["value"],Dl={key:0,class:"flex relative gap-x-3"},Ml={class:"h-6 items-center"},Tl={for:"language",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm text-nowrap"},Ll={class:"flex text-sm"},Al=["label"],jl=["value"],Fl={__name:"ModalAbout",setup(a){const t=e.inject("ServiceContainer"),{setStore:o,clearStore:n}=t.storage,{t:r,changeLocale:u,locale:s}=t.i18n,i=async()=>{n(),location.reload()},l=E=>{t.theme.set(E),t.emitter.emit("vf-theme-saved")},c=()=>{t.metricUnits=!t.metricUnits,t.filesize=t.metricUnits?Q:J,o("metricUnits",t.metricUnits),t.emitter.emit("vf-metric-units-saved")},f=()=>{t.compactListView=!t.compactListView,o("compactListView",t.compactListView),t.emitter.emit("vf-compact-view-saved")},h=()=>{t.showThumbnails=!t.showThumbnails,o("show-thumbnails",t.showThumbnails),t.emitter.emit("vf-show-thumbnails-saved")},d=()=>{t.persist=!t.persist,o("persist-path",t.persist),t.emitter.emit("vf-persist-path-saved")},{i18n:m}=e.inject("VueFinderOptions"),v=Object.fromEntries(Object.entries({en:"English",fr:"French (Français)",de:"German (Deutsch)",fa:"Persian (فارسی)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",ru:"Russian (Pусский)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)",zhCN:"Simplified Chinese (简体中文)",zhTW:"Traditional Chinese (繁體中文)"}).filter(([E])=>Object.keys(m).includes(E))),k=e.computed(()=>({system:r("System"),light:r("Light"),dark:r("Dark")}));return(E,_)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:_[8]||(_[8]=x=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(r)("Close")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",el,[tl,e.createElementVNode("div",ol,[e.createElementVNode("h3",rl,e.toDisplayString(e.unref(r)("About %s","Vuefinder "+e.unref(t).version)),1),e.createElementVNode("div",nl,[e.createElementVNode("p",al,e.toDisplayString(e.unref(r)("Vuefinder is a file manager component for vue 3.")),1),e.createElementVNode("div",null,[e.createElementVNode("h3",sl,e.toDisplayString(e.unref(r)("Settings")),1)]),e.createElementVNode("div",ll,[e.createElementVNode("fieldset",null,[e.createElementVNode("div",il,[e.createElementVNode("div",cl,[e.createElementVNode("div",dl,[e.withDirectives(e.createElementVNode("input",{id:"metric_unit",name:"metric_unit",type:"checkbox","onUpdate:modelValue":_[0]||(_[0]=x=>e.unref(t).metricUnits=x),onClick:c,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).metricUnits]])]),e.createElementVNode("div",ul,[e.createElementVNode("label",ml,[e.createTextVNode(e.toDisplayString(e.unref(r)("Use Metric Units"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-metric-units-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",fl,[e.createElementVNode("div",pl,[e.withDirectives(e.createElementVNode("input",{id:"large_icons",name:"large_icons",type:"checkbox","onUpdate:modelValue":_[1]||(_[1]=x=>e.unref(t).compactListView=x),onClick:f,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).compactListView]])]),e.createElementVNode("div",hl,[e.createElementVNode("label",vl,[e.createTextVNode(e.toDisplayString(e.unref(r)("Compact list view"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-compact-view-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",gl,[e.createElementVNode("div",kl,[e.withDirectives(e.createElementVNode("input",{id:"persist_path",name:"persist_path",type:"checkbox","onUpdate:modelValue":_[2]||(_[2]=x=>e.unref(t).persist=x),onClick:d,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).persist]])]),e.createElementVNode("div",_l,[e.createElementVNode("label",xl,[e.createTextVNode(e.toDisplayString(e.unref(r)("Persist path on reload"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-persist-path-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",yl,[e.createElementVNode("div",wl,[e.withDirectives(e.createElementVNode("input",{id:"show_thumbnails",name:"show_thumbnails",type:"checkbox","onUpdate:modelValue":_[3]||(_[3]=x=>e.unref(t).showThumbnails=x),onClick:h,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).showThumbnails]])]),e.createElementVNode("div",bl,[e.createElementVNode("label",El,[e.createTextVNode(e.toDisplayString(e.unref(r)("Show thumbnails"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-show-thumbnails-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",Vl,[e.createElementVNode("div",Nl,[e.createElementVNode("label",Bl,e.toDisplayString(e.unref(r)("Theme")),1)]),e.createElementVNode("div",$l,[e.withDirectives(e.createElementVNode("select",{id:"theme","onUpdate:modelValue":_[4]||(_[4]=x=>e.unref(t).theme.value=x),onChange:_[5]||(_[5]=x=>l(x.target.value)),class:"flex-shrink-0 w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(r)("Theme")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(x,M)=>(e.openBlock(),e.createElementBlock("option",{value:M},e.toDisplayString(x),9,Cl))),256))],8,Sl)],544),[[e.vModelSelect,e.unref(t).theme.value]]),e.createVNode(U,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-theme-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])]),e.unref(t).features.includes(e.unref(C).LANGUAGE)&&Object.keys(e.unref(v)).length>1?(e.openBlock(),e.createElementBlock("div",Dl,[e.createElementVNode("div",Ml,[e.createElementVNode("label",Tl,e.toDisplayString(e.unref(r)("Language")),1)]),e.createElementVNode("div",Ll,[e.withDirectives(e.createElementVNode("select",{id:"language","onUpdate:modelValue":_[6]||(_[6]=x=>e.isRef(s)?s.value=x:null),onChange:_[7]||(_[7]=x=>e.unref(u)(x.target.value)),class:"flex-shrink-0 w-1/2 sm:w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(r)("Language")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(x,M)=>(e.openBlock(),e.createElementBlock("option",{value:M},e.toDisplayString(x),9,jl))),256))],8,Al)],544),[[e.vModelSelect,e.unref(s)]]),e.createVNode(U,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-language-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:i,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(r)("Reset Settings")),1)])])])])])])]),_:1}))}},Ul={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"h-5 w-5",viewBox:"0 0 24 24"},zl=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1),Il=[zl];function Rl(a,t){return e.openBlock(),e.createElementBlock("svg",Ul,[...Il])}const Hl={render:Rl},ql={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"2",class:"h-5 w-5 stroke-slate-500 cursor-pointer",viewBox:"0 0 24 24"},Ol=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0"},null,-1),Pl=[Ol];function Gl(a,t){return e.openBlock(),e.createElementBlock("svg",ql,[...Pl])}const Wl={render:Gl},Kl={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Yl={class:"flex leading-5 items-center"},Jl=["aria-label"],Ql=["value"],Xl={class:"ml-3"},Zl={key:0},ei={class:"ml-1"},ti={class:"flex leading-5 items-center justify-end"},oi=["disabled"],ri=["aria-label"],ni={__name:"Statusbar",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,{setStore:n}=t.storage,r=t.dragSelect,u=()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter}}),n("adapter",t.fs.adapter)},s=e.ref("");t.emitter.on("vf-search-query",({newQuery:l})=>{s.value=l});const i=e.computed(()=>{const l=t.selectButton.multiple?r.getSelected().length>0:r.getSelected().length===1;return t.selectButton.active&&l});return(l,c)=>(e.openBlock(),e.createElementBlock("div",Kl,[e.createElementVNode("div",Yl,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(o)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},[e.createVNode(e.unref(Hl))],8,Jl),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":c[0]||(c[0]=f=>e.unref(t).fs.adapter=f),onChange:u,class:"py-0.5 text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.data.storages,f=>(e.openBlock(),e.createElementBlock("option",{value:f},e.toDisplayString(f),9,Ql))),256))],544),[[e.vModelSelect,e.unref(t).fs.adapter]]),e.createElementVNode("div",Xl,[s.value.length?(e.openBlock(),e.createElementBlock("span",Zl,e.toDisplayString(e.unref(t).fs.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",ei,e.toDisplayString(e.unref(t).dragSelect.getCount()>0?e.unref(o)("%s item(s) selected.",e.unref(t).dragSelect.getCount()):""),1)])]),e.createElementVNode("div",ti,[e.unref(t).selectButton.active?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vf-btn py-0 vf-btn-primary",{disabled:!i.value}]),disabled:!i.value,onClick:c[1]||(c[1]=f=>e.unref(t).selectButton.click(e.unref(r).getSelected(),f))},e.toDisplayString(e.unref(o)("Select")),11,oi)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(o)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:c[2]||(c[2]=f=>e.unref(t).modal.open(Fl))},[e.createVNode(e.unref(Wl))],8,ri)])]))}},ai={__name:"VueFinder",props:{id:{type:String,default:"vf"},request:{type:[String,Object],required:!0},persist:{type:Boolean,default:!1},path:{type:String,default:"."},features:{type:[Array,Boolean],default:!0},debug:{type:Boolean,default:!1},theme:{type:String,default:"system"},locale:{type:String,default:null},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},fullScreen:{type:Boolean,default:!1},showThumbnails:{type:Boolean,default:!0},selectButton:{type:Object,default(a){return{active:!1,multiple:!1,click:t=>{},...a}}}},emits:["select"],setup(a,{emit:t}){const o=t,r=$e(a,e.inject("VueFinderOptions"));e.provide("ServiceContainer",r);const{setStore:u}=r.storage,s=e.ref(null);r.root=s;const i=r.dragSelect,l=f=>{Object.assign(r.fs.data,f),i.clearSelection(),i.refreshSelection()};let c;return r.emitter.on("vf-fetch-abort",()=>{c.abort(),r.fs.loading=!1}),r.emitter.on("vf-fetch",({params:f,body:h=null,onSuccess:d=null,onError:m=null,noCloseModal:p=!1})=>{["index","search"].includes(f.q)&&(c&&c.abort(),r.fs.loading=!0),c=new AbortController;const v=c.signal;r.requester.send({url:"",method:f.m||"get",params:f,body:h,abortSignal:v}).then(k=>{r.fs.adapter=k.adapter,r.persist&&(r.fs.path=k.dirname,u("path",r.fs.path)),["index","search"].includes(f.q)&&(r.fs.loading=!1),p||r.modal.close(),l(k),d&&d(k)}).catch(k=>{console.error(k),m&&m(k)})}),e.onMounted(()=>{let f={};r.fs.path.includes("://")&&(f={adapter:r.fs.path.split("://")[0],path:r.fs.path}),r.emitter.emit("vf-fetch",{params:{q:"index",adapter:r.fs.adapter,...f}}),i.onSelect(h=>{o("select",h)})}),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:"vuefinder",ref_key:"root",ref:s},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).theme.actualValue)},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).fullScreen?"fixed w-screen inset-0 z-20":"relative rounded","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 select-none"]),style:e.normalizeStyle(e.unref(r).fullScreen?"":"max-height: "+a.maxHeight),onMousedown:h[0]||(h[0]=d=>e.unref(r).emitter.emit("vf-contextmenu-hide")),onTouchstart:h[1]||(h[1]=d=>e.unref(r).emitter.emit("vf-contextmenu-hide"))},[e.createVNode(Gr),e.createVNode(va),e.createVNode(Gs),e.createVNode(ni)],38),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r).modal.visible?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r).modal.type),{key:0})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Ys)],2)],512))}},si={install(a,t={}){t.i18n=t.i18n??{};let[o]=Object.keys(t.i18n);t.locale=t.locale??o??"en",a.provide("VueFinderOptions",t),a.component("VueFinder",ai)}};module.exports=si;