You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
skycaiji/vendor/studio-42/elfinder/js/elfinder.min.js

25 lines
532 KiB

6 years ago
/*!
* elFinder - file manager for web
3 years ago
* Version 2.1.59 (2021-06-14)
6 years ago
* http://elfinder.org
*
3 years ago
* Copyright 2009-2021, Studio 42
6 years ago
* Licensed under a 3-clauses BSD license
*/
3 years ago
!function(e,t){if("function"==typeof define&&define.amd)define(["jquery","jquery-ui"],t);else if("undefined"!=typeof exports){var n,i;try{n=require("jquery"),i=require("jquery-ui")}catch(a){}module.exports=t(n,i)}else t(e.jQuery,e.jQuery.ui,!0)}(this,function(e,t,n){n=n||!1;var i=function(t,n,a){var o,r,s,l,c,d,p,u=this,h=[],f=["button","tooltip"],m=e(t),g=e.extend(!0,{},e._data(m.get(0),"events")),v=e("<div></div>").append(m.contents()).attr("class",m.attr("class")||"").attr("style",m.attr("style")||""),b=m.attr("id")||m.attr("id","elfauto"+e(".elfinder").length).attr("id"),y="elfinder-"+b,w="mousedown."+y,x="keydown."+y,k="keypress."+y,C="keyup."+y,z=!1,T=!1,A=["enable","disable","load","open","reload","select","add","remove","change","dblclick","getfile","lockfiles","unlockfiles","selectfiles","unselectfiles","dragstart","dragstop","search","searchend","viewchange"],j="",S={path:"",url:"",tmbUrl:"",disabled:[],separator:"/",archives:[],extract:[],copyOverwrite:!0,uploadOverwrite:!0,uploadMaxSize:0,jpgQuality:100,tmbCrop:!1,tmbReqCustomData:!1,tmb:!1},O={},I={},M={},E={},F=[],D={},U={},P=[],q={},R=[],H=[],_=new u.command(u),N="auto",L=400,W=null,B="sounds/",$="",V=!1,K=e(document.createElement("audio")).hide().appendTo("body")[0],X=0,J="",G=null,Y=function(t){var n,i,a,o,r,s,l,c,d={},p={};u.api>=2.1?(u.commandMap=t.options.uiCmdMap&&Object.keys(t.options.uiCmdMap).length?t.options.uiCmdMap:{},J!==JSON.stringify(u.commandMap)&&(J=JSON.stringify(u.commandMap))):u.options.sync=0,t.init?(I={},E={}):(s=j,n="elfinder-subtree-loaded "+u.res("class","navexpand"),r=u.res("class","navcollapse"),i=Object.keys(I),a=function(e){if(!I[e])return!0;var t="directory"===I[e].mime,i=I[e].phash;!(!t||d[i]||!p[i]&&u.navHash2Elm(I[e].hash).is(":hidden")&&u.navHash2Elm(i).next(".elfinder-navbar-subtree").children().length>100)||!t&&i===j||q[e]?t&&(p[i]=!0):(t&&!d[i]&&(d[i]=!0,u.navHash2Elm(i).removeClass(n).next(".elfinder-navbar-subtree").empty()),ee(I[e]))},o=function(){i.length&&(G&&G._abort(),G=u.asyncJob(a,i,{interval:20,numPerOnce:100}).done(function(){var t=u.storage("hide")||{items:{}};Object.keys(M).length&&e.each(M,function(e){t.items[e]||delete M[e]})}))},u.trigger("filesgc").one("filesgc",function(){i=[]}),u.one("opendone",function(){s!==j&&(m.data("lazycnt")?u.one("lazydone",o):o())})),u.sorters={},j=t.cwd.hash,Q(t.files),I[j]?(c=u.diff([t.cwd],!0),c.changed.length&&(Q(c.changed,"change"),u.change({changed:c.changed}))):Q([t.cwd]),t.changed&&t.changed.length&&Q(t.changed,"change"),l=JSON.stringify(u.sorters),$!==l&&(u.trigger("sorterupdate"),$=l),u.lastDir(j),u.autoSync()},Q=function(t,n){var i,a,o,r,s,n=n||"files",l=["sizeInfo","encoding"],c={name:!0,perm:!0,date:!0,size:!0,kind:!0},d=!u.sorters._checked&&"files"===n,p=t.length,h=function(t){var n=t||{},i=[];e.each(u.sortRules,function(e){(c[e]||"undefined"!=typeof n[e]||"mode"===e&&"undefined"!=typeof n.perm)&&i.push(e)}),u.sorters=u.arrayFlip(i,!0),u.sorters._checked=!0},f={},m=u.storage("hide")||{},g=m.items||{};for(a=0;a<p;a++)if(i=Object.assign({},t[a]),s=!(m.show||!g[i.hash]),i.name&&i.hash&&i.mime){if(s||(d&&i.phash===j&&(h(i),d=!1),!i.phash||"add"!==n&&("change"!==n||I[i.hash]&&i.size===I[i.hash])||(r=u.parents(i.phash))&&e.each(r,function(){f[this]=!0})),I[i.hash]){for(o=0;o<l.length;o++)I[i.hash][l[o]]&&!i[l[o]]&&(i[l[o]]=I[i.hash][l[o]]);i.sizeInfo&&!i.size&&(i.size=i.sizeInfo.size),ee(I[i.hash],!0)}g[i.hash]&&(M[i.hash]=i),s?(p--,t.splice(a--,1)):(I[i.hash]=i,"directory"!==i.mime||E[i.hash]||(E[i.hash]={}),i.phash&&(E[i.phash]||(E[i.phash]={}),E[i.phash][i.hash]=!0))}e.each(Object.keys(f),function(){var e=I[this];e&&e.sizeInfo&&delete e.sizeInfo}),d&&h()},Z=function(t){var n,i=t.length,a={},o=function(t){var i=I[t];i&&("directory"===i.mime&&(a[t]&&delete u.roots[a[t]],e.each(u.leafRoots,function(n,i){var a,o;(a=e.inArray(t,i))!==-1&&(1===i.length?((o=Object.assign({},I[n]))&&o._realStats&&(e.each(o._realStats,function(e,t){o[e]=t}),Z(I[n]._realStats),u.change({changed:[o]})),delete u.leafRoots[n]):u.leafRoots[n].splice(a,1))}),u.searchStatus.state<2&&e.each(I,funct
data:{cmd:"parents",target:j},preventDefault:!0})),e.each(c(),function(e,t){l.push(a.request({data:{cmd:t.cmd,target:t.target},preventDefault:!0}))})),e.when.apply(e,l).fail(function(t,o){i=o&&200!=o.status,n&&e.inArray("errOpen",t)===-1?s.reject(t&&0!=o.status?t:void 0):(s.reject(t),a.parseError(t)&&a.request({data:{cmd:"open",target:a.lastDir("")||a.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}}))}).done(function(e){var n,i,o;if(e.cwd.compare&&r===e.cwd.compare)return s.reject();if(n={tree:[]},i=arguments.length,i>1)for(o=1;o<i;o++)arguments[o].tree&&arguments[o].tree.length&&n.tree.push.apply(n.tree,arguments[o].tree);if(a.api<2.1&&(n.tree||(n.tree=[]),n.tree.push(e.cwd)),e=a.normalize(e),!a.validResponse("open",e))return s.reject(e.norError||"errResponse");if(n=a.normalize(n),!a.validResponse("tree",n))return s.reject(n.norError||"errResponse");var l=a.diff(e.files.concat(n&&n.tree?n.tree:[]),t);return l.added.push(e.cwd),a.updateCache(l),l.removed.length&&a.remove(l),l.added.length&&a.add(l),l.changed.length&&a.change(l),s.resolve(l)}).always(function(){a.autoSync()}),s},this.upload=function(e){return this.transport.upload(e,this)},this.shortcut=function(t){var n,i,a,o,r;if(this.options.allowShortcuts&&t.pattern&&e.isFunction(t.callback))for(n=t.pattern.toUpperCase().split(/\s+/),o=0;o<n.length;o++)i=n[o],r=i.split("+"),a=1==(a=r.pop()).length?a>0?a:a.charCodeAt(0):a>0?a:e.ui.keyCode[a],a&&!U[i]&&(U[i]={keyCode:a,altKey:e.inArray("ALT",r)!=-1,ctrlKey:e.inArray("CTRL",r)!=-1,shiftKey:e.inArray("SHIFT",r)!=-1,type:t.type||"keydown",callback:t.callback,description:t.description,pattern:i});return this},this.shortcuts=function(){var t=[];return e.each(U,function(e,n){t.push([n.pattern,u.i18n(n.description)])}),t},this.clipboard=function(t,n){var i=function(){return e.map(P,function(e){return e.hash})};return void 0!==t&&(P.length&&this.trigger("unlockfiles",{files:i()}),q={},P=e.map(t||[],function(e){var t=I[e];return t?(q[e]=!0,{hash:e,phash:t.phash,name:t.name,mime:t.mime,read:t.read,locked:t.locked,cut:!!n}):null}),this.trigger("changeclipboard",{clipboard:P.slice(0,P.length)}),n&&this.trigger("lockfiles",{files:i()})),P.slice(0,P.length)},this.isCommandEnabled=function(e,t){var n,i,a=u.cwd().volumeid||"";return!t&&u.searchStatus.state>1&&u.selected().length&&(t=u.selected()[0]),n=!t||a&&0===t.indexOf(a)?O.disabledFlip:u.option("disabledFlip",t),i=this._commands[e],!!i&&(i.alwaysEnabled||!n[e])},this.exec=function(t,n,i,a){var o,r;return!a&&this.commandMap[t]&&"hidden"!==this.commandMap[t]&&(t=this.commandMap[t]),"open"===t&&((this.searchStatus.state||this.searchStatus.ininc)&&this.trigger("searchend",{noupdate:!0}),this.autoSync("stop")),!a&&n&&(e.isArray(n)?n.length&&(a=n[0]):a=n),o=this._commands[t]&&this.isCommandEnabled(t,a)?this._commands[t].exec(n,i):e.Deferred().reject("errUnknownCmd"),r=typeof o,"object"===r&&o.promise||(u.debug("warning",'"cmd.exec()" should be returned "$.Deferred" but cmd "'+t+'" returned "'+r+'"'),o=e.Deferred().resolve()),this.trigger("exec",{dfrd:o,cmd:t,files:n,opts:i,dstHash:a}),o},this.dialog=function(t,n){var i=e("<div></div>").append(t).appendTo(m).elfinderdialog(n,u),a=i.closest(".ui-dialog"),o=function(){!i.data("draged")&&i.is(":visible")&&i.elfinderdialog("posInit")};return a.length&&(u.bind("resize",o),a.on("remove",function(){u.unbind("resize",o)})),i},this.toast=function(t){return e('<div class="ui-front"></div>').appendTo(this.ui.toast).elfindertoast(t||{},this)},this.getUI=function(t){return t?this.ui[t]||e():m},this.getCommand=function(e){return void 0===e?this._commands:this._commands[e]},this.resize=function(t,n){var i,a=function(){for(var e=m.outerHeight(!0)-m.innerHeight(),t=m;t.get(0)!==W.get(0)&&(t=t.parent(),e+=t.outerHeight(!0)-t.innerHeight(),t.parent().length););return e},o=!m.hasClass("ui-resizable"),r=m.data("resizeSize")||{w:0,h:0},s={};W&&W.data("resizeTm")&&clearTimeout(W.data("resizeTm")),u.options.noResizeBySelf||("string"==typeof n&&(i=n.match(/^([0-9.]+)%$/))&&(W&&W.length||(W=e(window)),W.data("marginToMyNode")||W.data("marginToMyNode",
null===z||null===T||"touchstart"===s.type&&C.length>1||("touchstart"===s.type?(n=m.offset(),i=m.width(),c&&(e=!1,c.is(":hidden")?(l||(l=Math.max(50,i/10)),(A?z-n.left:i+n.left-z)<l&&(e=z)):s.originalEvent._preventSwipeX||(o=c.width(),y=A?z<n.left+o:z>n.left+i-o,y?(l=Math.max(50,i/10),e=z):e=!1)),d&&(t=!1,s.originalEvent._preventSwipeY||(r=d.height(),a=n.top,T-a<(d.is(":hidden")?v:r+30)&&(t=T,m.on(p,d.is(":hidden")?f:h))))):(c&&e!==!1&&(b=(A?e>z:e<z)?"navhide":"navshow",w=Math.abs(e-z),("navhide"===b&&w>.6*o||w>("navhide"===b?o/3:45)&&("navshow"===b||(A?z<n.left+20:z>n.left+i-20)))&&(u.getUI("navbar").trigger(b,{handleW:l}),e=!1)),d&&t!==!1&&(x=d.offset().top,Math.abs(t-T)>Math.min(45,r/3)&&(k=t>T?"slideUp":"slideDown",("slideDown"===k||x+20>T)&&(d.is("slideDown"===k?":hidden":":visible")&&d.stop(!0,!0).trigger("toggle",{duration:100,handleH:v}),t=!1)))))})}(),u.dragUpload&&!function(){var t,n,i=function(t){return"TEXTAREA"!==t.target.nodeName&&"INPUT"!==t.target.nodeName&&0===e(t.target).closest("div.ui-dialog-content").length},a="native-drag-enter",o="native-drag-disable",r="class",s=u.res(r,"navdir"),l=(u.res(r,"droppable"),u.res(r,"adroppable"),u.res(r,"navarrow"),u.res(r,"adroppable")),c=u.getUI("workzone"),d="ltr"===u.direction,p=function(){n&&cancelAnimationFrame(n),n=null};m.on("dragenter",function(e){p(),i(e)&&(e.preventDefault(),e.stopPropagation(),t=c.data("rectangle"))}).on("dragleave",function(e){p(),i(e)&&(e.preventDefault(),e.stopPropagation())}).on("dragover",function(e){var a;i(e)?(e.preventDefault(),e.stopPropagation(),e.originalEvent.dataTransfer.dropEffect="none",n||(n=requestAnimationFrame(function(){var i,o=t.top+t.height,r=o-u.getUI("navdock").outerHeight(!0);((a=e.pageY<t.top)||e.pageY>r)&&(i=t.cwdEdge>e.pageX?(d?"navbar":"cwd")+(a?"Up":"Down"):(d?"cwd":"navbar")+(a?"Up":"Down"),a||"cwd"===i.substr(0,3)&&(o<e.pageY?r=o:i=""),i&&u.autoScroll[i](Math.pow(a?t.top-e.pageY:e.pageY-r,1.3))),n=null}))):p()}).on("drop",function(e){p(),i(e)&&(e.stopPropagation(),e.preventDefault())}),m.on("dragenter",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var n,i=e(t.currentTarget),r=t.currentTarget.id||null,s=null;if(!r){s=u.cwd(),i.data(o,!1);try{e.each(t.originalEvent.dataTransfer.types,function(e,t){"elfinderfrom:"===t.substr(0,13)&&(n=t.substr(13).toLowerCase())})}catch(t){}}s&&(!s.write||n&&n===(window.location.href+s.hash).toLowerCase())?i.data(o,!0):(t.preventDefault(),t.stopPropagation(),i.data(a,!0),i.addClass(l))}}).on("dragleave",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var n=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),n.data(a)?n.data(a,!1):n.removeClass(l)}}).on("dragover",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var n=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),t.originalEvent.dataTransfer.dropEffect=n.data(o)?"none":"copy",n.data(a,!1)}}).on("drop",".native-droppable",function(t){if(t.originalEvent&&t.originalEvent.dataTransfer){var n,i=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),i.removeClass(l),n=t.currentTarget.id?i.hasClass(s)?u.navId2Hash(t.currentTarget.id):u.cwdId2Hash(t.currentTarget.id):u.cwd().hash,t.originalEvent._target=n,u.exec("upload",{dropEvt:t.originalEvent,target:n},void 0,n)}})}(),u.cssloaded===!1&&(u.cssloaded=!0,u.trigger("cssloaded")),u.zIndexCalc(),void u.trigger("init").request({data:{cmd:"open",target:u.startDir(),init:1,tree:1},preventDone:!0,notify:{type:"open",cnt:1,hideCnt:!0},freeze:!0}).fail(function(){u.trigger("fail").disable().lastDir(""),D={},U={},e(document).add(m).off("."+y),u.trigger=function(){}}).done(function(t){var n=function(e){var t=u.file(u.trashes[e]);u.options.debug;t&&t.volumeid&&delete u.volOptions[t.volumeid].trashHash,u.trashes[e]=!1,u.debug("backend-error",'Trash hash "'+e+'" was not found or not writable.')},i={};u.options.rawStringDecoder&&u.registRawStringDecoder(u.options.rawStringDecoder),u.zIndexCalc(),u.load().debug("api",u.api),m.trigger("resize"),Y(t),u.trigger("open",t,!1),u.trigger("opendone"),re&&u.options.enableAlways&&e(window).
return i<1?d.reject():(u.append('<input type="hidden" name="'+(s.newAPI?"target":"current")+'" value="'+g+'"/>').append('<input type="hidden" name="html" value="1"/>').append('<input type="hidden" name="node" value="'+s.id+'"/>').append(e(l).attr("name","upload[]")),y.length>0&&(e.each(y,function(e,t){u.append('<input type="hidden" name="renames[]" value="'+s.escape(t)+'"/>')}),u.append('<input type="hidden" name="suffix" value="'+n.options.backupSuffix+'"/>')),w&&e.each(y,function(e,t){u.append('<input type="hidden" name="['+e+']" value="'+s.escape(t)+'"/>')}),0===t.overwrite&&u.append('<input type="hidden" name="overwrite" value="0"/>'),e.each(s.options.onlyMimes||[],function(e,t){u.append('<input type="hidden" name="mimes[]" value="'+s.escape(t)+'"/>')}),e.each(s.customData,function(e,t){u.append('<input type="hidden" name="'+e+'" value="'+s.escape(t)+'"/>')}),u.appendTo("body"),void m.appendTo("body"))}),d}},one:function(e,t,n){var i=this,a=e.toLowerCase(),o=function(e,n){return i.toUnbindEvents[a]||(i.toUnbindEvents[a]=[]),i.toUnbindEvents[a].push({type:a,callback:o}),(t.done?t.done:t).apply(this,arguments)};return t.done&&(o={done:o}),this.bind(a,o,n)},localStorage:function(t,n){var i,a,o,r,s,l=this,c=window.localStorage,d="elfinder-"+(t||"")+this.id,p=window.location.pathname+"-elfinder-",u=this.id,h=[];if("undefined"==typeof t)return r=p.length,s=u.length*-1,e.each(c,function(e){e.substr(0,r)===p&&e.substr(s)===u&&h.push(e)}),e.each(h,function(e,t){c.removeItem(t)}),!0;if(t=p+t+u,null===n)return c.removeItem(t);if(void 0===n&&!(i=c.getItem(t))&&(a=c.getItem(d))&&(n=a,c.removeItem(d)),void 0!==n){o=typeof n,"string"!==o&&"number"!==o&&(n=JSON.stringify(n));try{c.setItem(t,n)}catch(f){try{c.clear(),c.setItem(t,n)}catch(f){l.debug("error",f.toString())}}i=c.getItem(t)}if(i&&("{"===i.substr(0,1)||"["===i.substr(0,1)))try{return JSON.parse(i)}catch(f){}return i},sessionStorage:function(e,t){var n,i,a,o=this;try{n=window.sessionStorage}catch(r){}if(n){if(null===t)return n.removeItem(e);if(void 0!==t){a=typeof t,"string"!==a&&"number"!==a&&(t=JSON.stringify(t));try{n.setItem(e,t)}catch(r){try{n.clear(),n.setItem(e,t)}catch(r){o.debug("error",r.toString())}}}if(i=n.getItem(e),i&&("{"===i.substr(0,1)||"["===i.substr(0,1)))try{return JSON.parse(i)}catch(r){}return i}},cookie:function(t,n){var i,a,o,r,s,l;if(t="elfinder-"+t+this.id,void 0===n){if(this.cookieEnabled&&document.cookie&&""!=document.cookie)for(o=document.cookie.split(";"),t+="=",r=0;r<o.length;r++)if(o[r]=e.trim(o[r]),o[r].substring(0,t.length)==t){if(s=decodeURIComponent(o[r].substring(t.length)),"{"===s.substr(0,1)||"["===s.substr(0,1))try{return JSON.parse(s)}catch(c){}return s}return null}if(!this.cookieEnabled)return"";if(a=Object.assign({},this.options.cookie),null===n?(n="",a.expires=-1):(l=typeof n,"string"!==l&&"number"!==l&&(n=JSON.stringify(n))),"number"==typeof a.expires&&(i=new Date,i.setTime(i.getTime()+864e5*a.expires),a.expires=i),document.cookie=t+"="+encodeURIComponent(n)+"; expires="+a.expires.toUTCString()+(a.path?"; path="+a.path:"")+(a.domain?"; domain="+a.domain:"")+(a.secure?"; secure":"")+(a.samesite?"; samesite="+a.samesite:""),n&&("{"===n.substr(0,1)||"["===n.substr(0,1)))try{return JSON.parse(n)}catch(c){}return n},startDir:function(){var e=window.location.hash;return e&&e.match(/^#elf_/)?e.replace(/^#elf_/,""):this.options.startPathHash?this.options.startPathHash:this.lastDir()},lastDir:function(e){return this.options.rememberLastDir?this.storage("lastdir",e):""},_node:e("<span></c.length;>"),escape:function(e){return this._node.text(e).html().replace(/"/g,"&quot;").replace(/'/g,"&#039;")},normalize:function(t){var n,i,a,o,r,s=this,l=function(){var e,t;return(t=s.options.fileFilter)&&("function"==typeof t?e=function(e){return t.call(s,e)}:t instanceof RegExp&&(e=function(e){return t.test(e.name)})),e?e:null}(),c=function(t){var n;t.uiCmdMap&&(e.isPlainObject(t.uiCmdMap)&&Object.keys(t.uiCmdMap).length?(t.disabledFlip||(t.disabledFlip={}),n=t.disabledFlip,e.each(t.uiCmdMap,function(e,i){"hidden"!==i||n[e]||(t.disabled.push(e),t.disa
targets:this},preventDefault:!0}))}),i.push.apply(i,c),c.push.apply(c,d),e.when.apply(e,c).fail(function(){o.reject()}).done(function(){var t,i,r,s=function(t,i){var a;(a=n.file(t))&&(a.sizeInfo={isCache:!0},e.each(["size","dirCnt","fileCnt"],function(){a.sizeInfo[this]=i[this]||0}),a.size=parseInt(a.sizeInfo.size),m.push(a))},l=0,c=0,d=0,u=arguments.length,h=[],f="",m=[];for(t=0;t<u;t++)r=arguments[t],i=null,r.isCache||(p[t]&&(i=n.file(p[t]))?s(p[t],r):r.sizes&&e.isPlainObject(r.sizes)&&e.each(r.sizes,function(e,t){s(e,t)})),l+=parseInt(r.size),c!==!1&&("undefined"==typeof r.fileCnt?c=!1:c+=parseInt(r.fileCnt||0)),d!==!1&&("undefined"==typeof r.dirCnt?d=!1:d+=parseInt(r.dirCnt||0));m.length&&n.change({changed:m}),d!==!1&&h.push(n.i18n("folders")+": "+(d-(a>1?0:1))),c!==!1&&h.push(n.i18n("files")+": "+c),h.length&&(f="<br>"+h.join(", ")),o.resolve({size:l,fileCnt:c,dirCnt:d,formated:(l>=0?n.formatSize(l):n.i18n("unknown"))+f})}),n.autoSync()}),o},wkObjUrl:null,getWorker:function(e){function t(){self.onmessage=function(e){var t=e.data;try{if(self.data=t.data,t.scripts)for(var n=0;n<t.scripts.length;n++)importScripts(t.scripts[n]);self.postMessage(self.res)}catch(e){self.postMessage({error:e.toString()})}}}var n;try{this.wkObjUrl||(this.wkObjUrl=(window.URL||window.webkitURL).createObjectURL(new Blob([t.toString().replace(/\s+/g," ").replace(/ *([^\w]) */g,"$1").replace(/^function\b.+?\{|\}$/g,"")],{type:"text/javascript"}))),n=new Worker(this.wkObjUrl,e)}catch(i){this.debug("error",i.toString())}return n},getWorkerUrl:function(e){return this.convAbsUrl(this.baseUrl+"js/worker/"+e)},getTheme:function(t){var n,i,a=this,o=e.Deferred(),r=function(t,n){return n||(n=a.convAbsUrl(a.baseUrl)),Array.isArray(t)?e.map(t,function(e){return r(e,n)}):t.match(/^(?:http|\/\/)/i)?t:n+t.replace(/^(?:\.\/|\/)/,"")};return t&&(n=a.options.themes[t])?"string"==typeof n?(url=r(n),(i=url.match(/^(.+\/)[^\/]+\.json$/i))?e.getJSON(url).done(function(e){n=e,n.id=t,n.cssurls&&(n.cssurls=r(n.cssurls,i[1])),o.resolve(n)}).fail(function(){o.reject()}):o.resolve({id:t,name:t,cssurls:[url]})):e.isPlainObject(n)&&n.cssurls?(n.id=t,n.cssurls=r(n.cssurls),Array.isArray(n.cssurls)||(n.cssurls=[n.cssurls]),n.name||(n.name=t),o.resolve(n)):o.reject():o.reject(),o},changeTheme:function(t){var n=this;return t&&(!n.options.themes[t]||n.theme&&n.theme.id===t?"default"===t&&n.theme&&"default"!==n.theme.id&&(e("head>link.elfinder-theme-ext").remove(),n.theme=null,n.trigger&&n.trigger("themechange")):n.getTheme(t).done(function(t){t.cssurls&&(e("head>link.elfinder-theme-ext").remove(),n.loadCss(t.cssurls,{className:"elfinder-theme-ext",dfd:e.Deferred().done(function(){n.theme=t,n.trigger&&n.trigger("themechange")})}))})),this},applyLeafRootStats:function(t,n){var i=this,a=n?t:i.file(t.hash)||t,o=a.ts,r=!1;return!n&&t._realStats||(t._realStats={locked:t.locked||0,dirs:t.dirs||0,ts:t.ts}),t.locked=1,a.locked||(r=!0),t.dirs=1,a.dirs||(r=!0),e.each(i.leafRoots[t.hash],function(){var e=i.file(this);e&&e.ts&&(t.ts||0)<e.ts&&(t.ts=e.ts)}),o!==t.ts&&(r=!0),r},abortXHR:function(e,t){var n=t||{};e&&(n.quiet&&(e.quiet=!0),n.abort&&e._requestId&&this.request({data:{cmd:"abort",id:e._requestId},preventDefault:!0}),e.abort(),e=void 0)},setCustomHeaderByXhr:function(t){var n=this;t.getResponseHeader&&n.parrotHeaders&&n.parrotHeaders.length&&e.each(n.parrotHeaders,function(e,i){var a=t.getResponseHeader(i);a?(n.customHeaders[i]=a,n.sessionStorage("core-ph:"+i,a)):"string"==typeof a&&(delete n.customHeaders[i],n.sessionStorage("core-ph:"+i,null))})},hasParrotHeaders:function(){var e=!1,t=this.parrotHeaders;if(Object.keys(this.customHeaders).length)for(var n=0;n<t.length;n++)if(this.customHeaders[t[n]]){e=!0;break}return e},getRequestId:function(){return(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16)},arrayFlip:function(t,n){var i,a={},o=e.isArray(t);for(i in t)(o||t.hasOwnProperty(i))&&(a[t[i]]=n||i);return a},splitFileExtention:function(e){var t;return(t=e.match(/^(.+?)?\.((?:tar\.(?:gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(?:gz|bz2)|[a-z0-9]{1,10})$/i))?("undef
"application/x-font-linux-psf":"psf","application/x-font-pcf":"pcf","application/x-font-snf":"snf","application/x-font-type1":"pfa","application/x-freearc":"arc","application/x-futuresplash":"spl","application/x-gca-compressed":"gca","application/x-glulx":"ulx","application/x-gnumeric":"gnumeric","application/x-gramps-xml":"gramps","application/x-gtar":"gtar","application/x-hdf":"hdf","application/x-install-instructions":"install","application/x-iso9660-image":"iso","application/x-java-jnlp-file":"jnlp","application/x-latex":"latex","application/x-lzh-compressed":"lzh","application/x-mie":"mie","application/x-mobipocket-ebook":"prc","application/x-ms-application":"application","application/x-ms-shortcut":"lnk","application/x-ms-wmd":"wmd","application/x-ms-wmz":"wmz","application/x-ms-xbap":"xbap","application/x-msaccess":"mdb","application/x-msbinder":"obd","application/x-mscardfile":"crd","application/x-msclip":"clp","application/x-msdownload":"dll","application/x-msmediaview":"mvb","application/x-msmetafile":"wmf","application/x-msmoney":"mny","application/x-mspublisher":"pub","application/x-msschedule":"scd","application/x-msterminal":"trm","application/x-mswrite":"wri","application/x-netcdf":"nc","application/x-nzb":"nzb","application/x-pkcs12":"p12","application/x-pkcs7-certificates":"p7b","application/x-pkcs7-certreqresp":"p7r","application/x-research-info-systems":"ris","application/x-shar":"shar","application/x-shockwave-flash":"swf","application/x-silverlight-app":"xap","application/x-sql":"sql","application/x-stuffit":"sit","application/x-stuffitx":"sitx","application/x-subrip":"srt","application/x-sv4cpio":"sv4cpio","application/x-sv4crc":"sv4crc","application/x-t3vm-image":"t3","application/x-tads":"gam","application/x-tar":"tar","application/x-tcl":"tcl","application/x-tex":"tex","application/x-tex-tfm":"tfm","application/x-texinfo":"texinfo","application/x-tgif":"obj","application/x-ustar":"ustar","application/x-wais-source":"src","application/x-x509-ca-cert":"der","application/x-xfig":"fig","application/x-xliff+xml":"xlf","application/x-xpinstall":"xpi","application/x-xz":"xz","application/x-zmachine":"z1","application/xaml+xml":"xaml","application/xcap-diff+xml":"xdf","application/xenc+xml":"xenc","application/xhtml+xml":"xhtml","application/xml":"xsl","application/xml-dtd":"dtd","application/xop+xml":"xop","application/xproc+xml":"xpl","application/xslt+xml":"xslt","application/xspf+xml":"xspf","application/xv+xml":"mxml","application/yang":"yang","application/yin+xml":"yin","application/zip":"zip","audio/adpcm":"adp","audio/basic":"au","audio/midi":"mid","audio/mp4":"m4a","audio/mpeg":"mpga","audio/ogg":"oga","audio/s3m":"s3m","audio/silk":"sil","audio/vnd.dece.audio":"uva","audio/vnd.digital-winds":"eol","audio/vnd.dra":"dra","audio/vnd.dts":"dts","audio/vnd.dts.hd":"dtshd","audio/vnd.lucent.voice":"lvp","audio/vnd.ms-playready.media.pya":"pya","audio/vnd.nuera.ecelp4800":"ecelp4800","audio/vnd.nuera.ecelp7470":"ecelp7470","audio/vnd.nuera.ecelp9600":"ecelp9600","audio/vnd.rip":"rip","audio/webm":"weba","audio/x-aac":"aac","audio/x-aiff":"aif","audio/x-caf":"caf","audio/x-flac":"flac","audio/x-matroska":"mka","audio/x-mpegurl":"m3u","audio/x-ms-wax":"wax","audio/x-ms-wma":"wma","audio/x-pn-realaudio":"ram","audio/x-pn-realaudio-plugin":"rmp","audio/xm":"xm","chemical/x-cdx":"cdx","chemical/x-cif":"cif","chemical/x-cmdf":"cmdf","chemical/x-cml":"cml","chemical/x-csml":"csml","chemical/x-xyz":"xyz","font/collection":"ttc","font/otf":"otf","font/ttf":"ttf","font/woff":"woff","font/woff2":"woff2","image/cgm":"cgm","image/g3fax":"g3","image/gif":"gif","image/ief":"ief","image/jpeg":"jpeg","image/ktx":"ktx","image/png":"png","image/prs.btif":"btif","image/sgi":"sgi","image/svg+xml":"svg","image/tiff":"tiff","image/vnd.adobe.photoshop":"psd","image/vnd.dece.graphic":"uvi","image/vnd.djvu":"djvu","image/vnd.dvb.subtitle":"sub","image/vnd.dwg":"dwg","image/vnd.dxf":"dxf","image/vnd.fastbidsheet":"fbs","image/vnd.fpx":"fpx","image/vnd.fst":"fst","image/vnd.fujixerox.edmics-mmr":"mmr","image/vnd.fujixerox.edmic
errUploadTransfer:'"$1" transfer error.',errUploadTemp:"Unable to make temporary file for upload.",errNotReplace:'Object "$1" already exists at this location and can not be replaced by object with another type.',errReplace:'Unable to replace "$1".',errSave:'Unable to save "$1".',errCopy:'Unable to copy "$1".',errMove:'Unable to move "$1".',errCopyInItself:'Unable to copy "$1" into itself.',errRm:'Unable to remove "$1".',errTrash:"Unable into trash.",errRmSrc:"Unable remove source file(s).",errExtract:'Unable to extract files from "$1".',errArchive:"Unable to create archive.",errArcType:"Unsupported archive type.",errNoArchive:"File is not archive or has unsupported archive type.",errCmdNoSupport:"Backend does not support this command.",errReplByChild:'The folder "$1" can\'t be replaced by an item it contains.',errArcSymlinks:"For security reason denied to unpack archives contains symlinks or files with not allowed names.",errArcMaxSize:"Archive files exceeds maximum allowed size.",errResize:'Unable to resize "$1".',errResizeDegree:"Invalid rotate degree.",errResizeRotate:"Unable to rotate image.",errResizeSize:"Invalid image size.",errResizeNoChange:"Image size not changed.",errUsupportType:"Unsupported file type.",errNotUTF8Content:'File "$1" is not in UTF-8 and cannot be edited.',errNetMount:'Unable to mount "$1".',errNetMountNoDriver:"Unsupported protocol.",errNetMountFailed:"Mount failed.",errNetMountHostReq:"Host required.",errSessionExpires:"Your session has expired due to inactivity.",errCreatingTempDir:'Unable to create temporary directory: "$1"',errFtpDownloadFile:'Unable to download file from FTP: "$1"',errFtpUploadFile:'Unable to upload file to FTP: "$1"',errFtpMkdir:'Unable to create remote directory on FTP: "$1"',errArchiveExec:'Error while archiving files: "$1"',errExtractExec:'Error while extracting files: "$1"',errNetUnMount:"Unable to unmount.",errConvUTF8:"Not convertible to UTF-8",errFolderUpload:"Try the modern browser, If you'd like to upload the folder.",errSearchTimeout:'Timed out while searching "$1". Search result is partial.',errReauthRequire:"Re-authorization is required.",errMaxTargets:"Max number of selectable items is $1.",errRestore:"Unable to restore from the trash. Can't identify the restore destination.",errEditorNotFound:"Editor not found to this file type.",errServerError:"Error occurred on the server side.",errEmpty:'Unable to empty folder "$1".',moreErrors:"There are $1 more errors.",errMaxMkdirs:"You can create up to $1 folders at one time.",cmdarchive:"Create archive",cmdback:"Back",cmdcopy:"Copy",cmdcut:"Cut",cmddownload:"Download",cmdduplicate:"Duplicate",cmdedit:"Edit file",cmdextract:"Extract files from archive",cmdforward:"Forward",cmdgetfile:"Select files",cmdhelp:"About this software",cmdhome:"Root",cmdinfo:"Get info",cmdmkdir:"New folder",cmdmkdirin:"Into New Folder",cmdmkfile:"New file",cmdopen:"Open",cmdpaste:"Paste",cmdquicklook:"Preview",cmdreload:"Reload",cmdrename:"Rename",cmdrm:"Delete",cmdtrash:"Into trash",cmdrestore:"Restore",cmdsearch:"Find files",cmdup:"Go to parent folder",cmdupload:"Upload files",cmdview:"View",cmdresize:"Resize & Rotate",cmdsort:"Sort",cmdnetmount:"Mount network volume",cmdnetunmount:"Unmount",cmdplaces:"To Places",cmdchmod:"Change mode",cmdopendir:"Open a folder",cmdcolwidth:"Reset column width",cmdfullscreen:"Full Screen",cmdmove:"Move",cmdempty:"Empty the folder",cmdundo:"Undo",cmdredo:"Redo",cmdpreference:"Preferences",cmdselectall:"Select all",cmdselectnone:"Select none",cmdselectinvert:"Invert selection",cmdopennew:"Open in new window",cmdhide:"Hide (Preference)",btnClose:"Close",btnSave:"Save",btnRm:"Remove",btnApply:"Apply",btnCancel:"Cancel",btnNo:"No",btnYes:"Yes",btnMount:"Mount",btnApprove:"Goto $1 & approve",btnUnmount:"Unmount",btnConv:"Convert",btnCwd:"Here",btnVolume:"Volume",btnAll:"All",btnMime:"MIME Type",btnFileName:"Filename",btnSaveClose:"Save & Close",btnBackup:"Backup",btnRename:"Rename",btnRenameAll:"Rename(All)",btnPrevious:"Prev ($1/$2)",btnNext:"Next ($1/$2)",btnSaveAs:"Save As",ntfopen:"Open folder",ntffile:"Open
try{a.insertRule(o+':before{content:"'+r.toLowerCase()+'"}',0)}catch(l){}}V[n]=!0}},X=function(e){return e.mime&&"directory"!==e.mime&&!V[e.mime]&&K(e.mime,e.name),N[p?"row":"icon"].replace(/\{([a-z0-9_]+)\}/g,function(n,i){return $[i]?$[i](e,t):e[i]?e[i]:""})},J=e(),G=!1,Y=function(t,n){function i(e,t){return e[t+"All"]("[id]:not(."+w+"):not(.elfinder-cwd-parent):first")}var a,o,r,s,l,c=e.ui.keyCode,d=t==c.LEFT||t==c.UP,f=Ue.find("[id]."+y);if(f.length)if(a=f.filter(d?":first":":last"),r=i(a,d?"prev":"next"),r.length)if(p||t==c.LEFT||t==c.RIGHT)o=r;else if(s=a.position().top,l=a.position().left,o=a,d){do o=o.prev("[id]");while(o.length&&!(o.position().top<s&&o.position().left<=l));o.hasClass(w)&&(o=i(o,"next"))}else{do o=o.next("[id]");while(o.length&&!(o.position().top>s&&o.position().left>=l));o.hasClass(w)&&(o=i(o,"prev")),o.length||(r=Ue.find("[id]:not(."+w+"):last"),r.position().top>s&&(o=r))}else o=a;else o=J.length?d?J.prev():J:Ue.find("[id]:not(."+w+"):not(.elfinder-cwd-parent):"+(d?"last":"first"));o&&o.length&&!o.hasClass("elfinder-cwd-parent")&&(a&&n?o=a.add(a[d?"prevUntil":"nextUntil"]("#"+o.attr("id"))).add(o):f.trigger(h),o.trigger(u),re(o.filter(d?":first":":last")),oe())},Q={},Z=function(e){t.cwdHash2Elm(e).trigger(u)},ee=!1,te=function(){t.cwd().hash;R&&Re.find("input").prop("checked",!0),t.lazy(function(){var n;t.maxTargets&&(F||E).length>t.maxTargets?(ne({notrigger:!0}),n=e.map(F||E,function(e){return t.file(e)||null}),n=n.slice(0,t.maxTargets),Q={},e.each(n,function(e,n){Q[n.hash]=!0,t.cwdHash2Elm(n.hash).trigger(u)}),t.toast({mode:"warning",msg:t.i18n(["errMaxTargets",t.maxTargets])})):(Ue.find("[id]:not(."+y+"):not(.elfinder-cwd-parent)").trigger(u),Q=t.arrayFlip(F||E,!0)),oe(),R&&Re.data("pending",!1)},0,{repaint:!0})},ne=function(e){var t=e||{};R&&Re.find("input").prop("checked",!1),Object.keys(Q).length&&(G=!1,Q={},Ue.find("[id]."+y).trigger(h),R&&Ue.find("input:checkbox."+j).prop("checked",!1)),!t.notrigger&&oe(),R&&Re.data("pending",!1),Ue.removeClass("elfinder-cwd-allselected")},ie=function(){var n={};ee?ne():Object.keys(Q).length?(e.each(F||E,function(e,i){var a=t.cwdHash2Elm(i);Q[i]?a.length&&a.trigger(h):(n[i]=!0,a.length&&a.trigger(u))}),Q=n,oe()):te()},ae=void 0,oe=function(){var e=Object.keys(Q),n={selected:e,origin:"cwd"};ge&&(e.length>1||e[0]!==t.cwdId2Hash(ge.attr("id")))&&ge.hasClass(y)&&ge.trigger(h),ee=e.length&&e.length===(F||E).length&&(!t.maxTargets||e.length<=t.maxTargets),R&&(Re.find("input").prop("checked",ee),Ue[ee?"addClass":"removeClass"]("elfinder-cwd-allselected")),ee?n.selectall=!0:e.length||(n.unselectall=!0),t.trigger("select",n)},re=function(e,n){if(e.length){var i=e.position().top,a=e.outerHeight(!0),o=Pe.scrollTop(),r=Pe.get(0).clientHeight,s=we?we.outerHeight(!0):0;i+s+a>o+r?Pe.scrollTop(parseInt(i+s+a-r)):i<o&&Pe.scrollTop(i),p&&Pe.scrollLeft(0),!!n&&t.resources.blink(e,"lookme")}},se=[],le={},ce=function(e){for(var t=se.length;t--;)if(se[t].hash==e)return t;return-1},de="elfscrstart",pe="elfscrstop",ue=!1,he={disabled:!0,filter:"[id]:first",stop:oe,delay:250,appendTo:"body",autoRefresh:!1,selected:function(t,n){e(n.selected).trigger(u)},unselected:function(t,n){e(n.unselected).trigger(h)}},fe={},me=function(a,o){if(le.renderd){var r=(p?Ue.find("tbody:first"):Ue).children("[id]"+(n.oldSchool?":not(.elfinder-cwd-parent)":"")+":first");if(r.length){var s,l,c=Ue.data("selectable"),d=function(){var n=Pe.offset(),a=Pe.width(),o=e(window),s=r.width()/2,l=Math.min(n.left-o.scrollLeft()+("ltr"===t.direction?s:a-s),n.left+a-10),c=n.top-o.scrollTop()+10+(p?i:0);return{left:Math.max(0,Math.round(l)),top:Math.max(0,Math.round(c))}}(),u=a?r:e(document.elementFromPoint(d.left,d.top)),h={},f={},m=5,g=Math.ceil((le.hpi?Math.ceil(Le.data("rectangle").height/le.hpi*1.5):be)/m),y=function(){var e,n,i;for(i=0;i<m&&(e=u.attr("id"),e&&(le.getTmbs=[],n=t.cwdId2Hash(e),fe[n]=e,le.attachTmbs[n]&&(f[n]=le.attachTmbs[n]),c&&(h[e]=!0)),u=u.next(),u.length);i++);},w=function(){var e;Ue.data("selectable")&&(Object.assign(h,Q),e=Object.keys(h),e.length&&(he.filter="#"+e.join(", #"),Ue.select
document.head&&(document.head.appendChild(l),i=l.sheet,i.insertRule('.elfinder-cwd-wrapper-empty .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder")+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty .native-droppable .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder"+(d?"LTap":"Drop"))+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty .ui-droppable-disabled .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder")+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptySearch")+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-incsearch-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyIncSearch")+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-letsearch-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyLetSearch")+'" }',c++)),(s=t.storage("iconsize")||n.iconsView.size||0)&&(s=Math.min(s,n.iconsView.sizeMax),Ue.trigger("iconpref",{size:s})),d||(t.one("open",function(){i&&t.zIndex&&i.insertRule(".ui-selectable-helper{z-index:"+t.zIndex+";}",c++)}),o=e('<div style="position:absolute"></div>'),a=t.getUI(),a.on("resize",function(e,t){var n;e.preventDefault(),e.stopPropagation(),t&&t.fullscreen&&(n=a.offset(),"on"===t.fullscreen?(o.css({top:n.top*-1,left:n.left*-1}).appendTo(a),he.appendTo=o):(o.detach(),he.appendTo="body"),Ue.data("selectable")&&Ue.selectable("option",{appendTo:he.appendTo}))})),r=t.getUI("tree").length}).bind("enable",function(){_e()}).bind("request.open",function(){le.getTmbs=[]}).one("open",function(){t.maxTargets&&(S=Math.min(t.maxTargets,S))}).bind("open add remove searchend",function(){var n=t.cwd().hash,i=this.type;if(("open"===i||"searchend"===i||t.searchStatus.state<2)&&(E=e.map(t.files(n),function(e){return e.hash}),t.trigger("cwdhasheschange",E)),"open"===i){var a=function(){var n=!1;return e.each(M,function(e,i){if(t.trashes[i])return n=!0,!1}),n},o=n&&(!t.file(n)||r)?r?function(){var n=e.Deferred();return t.one("treesync",function(e){e.data.always(function(){n.resolve()})}),n}():t.request({data:{cmd:"parents",target:t.cwd().hash},preventFail:!0}):null,s=t.cwd();s.volumeid!==l&&(Be.empty().hide(),l&&Pe.removeClass("elfinder-cwd-wrapper-"+l),l=s.volumeid,$e(),Pe.addClass("elfinder-cwd-wrapper-"+l)),e.when(o).done(function(){M=t.parents(s.hash),Pe[a()?"addClass":"removeClass"]("elfinder-cwd-wrapper-trash")}),F=void 0,ne({notrigger:!0}),De()}}).bind("search",function(n){E=e.map(n.data.files,function(e){return e.hash}),t.trigger("cwdhasheschange",E),F=void 0,t.searchStatus.ininc=!1,De(),t.autoSync("stop")}).bind("searchend",function(e){(O||F)&&(O="",F?t.trigger("incsearchend",e.data):e.data&&e.data.noupdate||De()),t.autoSync()}).bind("searchstart",function(e){ne(),O=e.data.query}).bind("incsearchstart",function(n){var i=n.data.query||"",a=n.data.type||"SearchName",o=t.options.commandsOptions.search.searchTypes||{};(o[a]&&o[a].incsearch||"SearchName"===a)&&(Q={},t.lazy(function(){var n,r,s="";if(O=i,i){if("/"===i.substr(0,1)&&(i=i.substr(1),s="^"),n=new RegExp(s+i.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"),"SearchName"===a)F=e.grep(E,function(e){var i=t.file(e);return!(!i||!(i.name.match(n)||i.i18&&i.i18.match(n)))});else if(r=o[a].incsearch,"string"==typeof r)F=e.grep(E,function(e){var i=t.file(e);return!!(i&&i[r]&&(i[r]+"").match(n))});else if("function"==typeof r)try{F=e.grep(r({val:i,regex:n},E,t),function(e){return!!t.file(e)})}catch(l){F=[]}t.trigger("incsearch",{hashes:F,query:i}).searchStatus.ininc=!0,De(),t.autoSync("stop")}else t.trigger("incsearchend")}))}).bind("incsearchend",function(e){O="",t.searchStatus.ininc=!1,F=void 0,e.data&&e.data.noupdate||De(),t.autoSync()}).bind("sortchange",function(){var e=Pe.scrollLeft(),n=Ue.hasClass("elfinder-cwd-allselected");De(),t.one("cwdrender",function(){Pe.scrollLeft(e),n&&(Q=t.array
})})})},e.fn.elfinderpath=function(t,n){return this.each(function(){var a,o,r="",s="",l=[],c="statusbar",d=t.res("class","hover"),p="path"+(i.prototype.uniqueid?i.prototype.uniqueid:"")+"-",u=e('<div class="ui-widget-header ui-helper-clearfix elfinder-workzone-path"></div>'),h=e(this).addClass("elfinder-path").html("&nbsp;").on("mousedown","span.elfinder-path-dir",function(n){var i=e(this).attr("id").substr(p.length);n.preventDefault(),i!=t.cwd().hash&&(e(this).addClass(d),r?t.exec("search",r,{target:i,mime:l.join(" ")}):t.trigger("select",{selected:[i]}).exec("open",i))}).prependTo(t.getUI("statusbar").show()),f=e('<div class="elfinder-path-roots"></div>').on("click",function(n){n.stopPropagation(),n.preventDefault();var i=e.map(t.roots,function(e){return t.file(e)}),a=[];e.each(i,function(e,n){n.phash||t.root(t.cwd().hash,!0)===n.hash||a.push({label:t.escape(n.i18||n.name),icon:"home",callback:function(){t.exec("open",n.hash)},options:{iconClass:n.csscls||"",iconImg:n.icon||""}})}),t.trigger("contextmenu",{raw:a,x:n.pageX,y:n.pageY})}).append('<span class="elfinder-button-icon elfinder-button-icon-menu" ></span>').appendTo(u),m=function(n){var i=[],a=[];return e.each(t.parents(n),function(e,o){var r=n===o?"elfinder-path-dir elfinder-path-cwd":"elfinder-path-dir",s=t.file(o),l=t.escape(s.i18||s.name);a.push(l),i.push('<span id="'+p+o+'" class="'+r+'" title="'+a.join(t.option("separator"))+'">'+l+"</span>")}),i.join('<span class="elfinder-path-other">'+t.option("separator")+"</span>")},g=function(){var n;h.children("span.elfinder-path-dir").attr("style",""),n="ltr"===t.direction?e("#"+p+t.cwd().hash).prevAll("span.elfinder-path-dir:first"):e(),h.scrollLeft(n.length?n.position().left:0)},v=function(){if(!t.UA.CSS.flex){var n,i,a=h.children("span.elfinder-path-dir"),o=a.length;if("workzone"===c||o<2)return void a.attr("style","");h.width(h.css("max-width")),a.css({maxWidth:100/o+"%",display:"inline-block"}),n=h.width()-9,h.children("span.elfinder-path-other").each(function(){n-=e(this).width()}),i=[],a.each(function(t){var a=e(this),o=a.width();n-=o,o<this.scrollWidth&&i.push(t)}),h.width(""),i.length?(n>0&&(n/=i.length,e.each(i,function(t,i){var o=e(a[i]);o.css("max-width",o.width()+n)})),a.last().attr("style","")):a.attr("style","")}};t.one("init",function(){a=t.getUI("tree").length,o=t.getUI("stat").length,!a&&n.toWorkzoneWithoutNavbar&&(u.append(h).insertBefore(t.getUI("workzone")),c="workzone",t.bind("open",g).one("opendone",function(){t.getUI().trigger("resize")}))}).bind("open searchend parents",function(){r="",s="",l=[],h.html(m(t.cwd().hash)),Object.keys(t.roots).length>1?(h.css("margin",""),f.show()):(h.css("margin",0),f.hide()),!o&&v()}).bind("searchstart",function(e){e.data&&(r=e.data.query||"",s=e.data.target||"",l=e.data.mimes||[])}).bind("search",function(e){var n="";n=s?m(s):t.i18n("btnAll"),h.html('<span class="elfinder-path-other">'+t.i18n("searcresult")+": </span>"+n),v()}).bind("navbarshow navbarhide",function(){var e=t.getUI("workzone");"navbarshow"===this.type?(t.unbind("open",g),h.prependTo(t.getUI("statusbar")),u.detach(),c="statusbar"):(u.append(h).insertBefore(e),c="workzone",g(),t.bind("open",g)),t.trigger("uiresize")}).bind("resize uistatchange",v)})},e.fn.elfinderplaces=function(t,n){return this.each(function(){var i={},a="class",o=t.res(a,"navdir"),r=t.res(a,"navcollapse"),s=t.res(a,"navexpand"),l=t.res(a,"hover"),c=t.res(a,"treeroot"),d=t.res(a,"adroppable"),p=t.res("tpl","placedir"),u=t.res("tpl","perms"),h=e(t.res("tpl","navspinner")),f=n.suffix?n.suffix:"",m="places"+f,g=null,v=function(e){return e.substr(6)},b=function(e){return"place-"+e},y=function(t){return e(document.getElementById(b(t)))},w=function(){var n=[],a={};n=e.map(E.children().find("[id]"),function(e){return v(e.id)}),n.length?e.each(n.reverse(),function(e,t){a[t]=i[t]}):a=null,t.storage(m,a)},x=function(){var a,o;m="places"+(n.suffix?n.suffix:""),i={},a=t.storage(m),"string"==typeof a?(a=e.grep(a.split(","),function(e){return!!e}),e.each(a,function(e,t){var n=t.split("#");i[n[0]]=n[1]?n[1]:n[0]})):e.isPlainObject(a)&&(i=a)
t.stopPropagation(),M(t.clientX)&&a.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"),a.data("dropover",Math.max(a.data("dropover")-1,0)),i.data("expandTimer")&&clearTimeout(i.data("expandTimer")),i.removeData("dropover").removeClass(z+" "+C)},deactivate:function(){e(this).removeData("dropover").removeClass(z+" "+C)},drop:function(e,t){M(e.clientX)&&H.call(this,e,t)}}),N=e(t.res("tpl","navspinner")),L=t.res("tpl","navdir"),W=t.res("tpl","perms"),B=(t.res("tpl","lock"),t.res("tpl","symlink")),$={},V={id:function(e){return t.navHash2Id(e.hash)},name:function(e){return t.escape(e.i18||e.name)},cssclass:function(e){var i=(e.phash&&!e.isroot?"":d)+" "+m+" "+t.perms2class(e);return e.dirs&&!e.link&&(i+=" "+v)&&e.dirs==-1&&(i+=" "+w),n.getClass&&(i+=" "+n.getClass(e)),e.csscls&&(i+=" "+t.escape(e.csscls)),i},title:function(e){return n.attrTitle?' title="'+t.escape(t.path(e.hash,!0)||e.i18||e.name)+'"':""},root:function(t){var n="";return!t.phash||t.isroot?(n+=" "+S,!t.disabled||t.disabled.length<1?n+=" "+O+" "+I:(e.inArray("paste",t.disabled)===-1&&(n+=" "+O),e.inArray("upload",t.disabled)===-1&&(n+=" "+I)),n):""},permissions:function(e){return e.read&&e.write?"":W},symlink:function(e){return e.alias?B:""},style:function(e){return e.icon?t.getIconStyle(e):""}},K=function(e){return L.replace(/(?:\{([a-z]+)\})/gi,function(t,n){var i=V[n]?V[n](e):e[n]||"";return"id"===n&&e.dirs==-1&&(E[i]=i),i})},X=function(n,i){return e.map(n||[],function(e){return"directory"!==e.mime||i&&!t.navHash2Elm(e.hash).length?null:e})},J=function(e){return e?t.navHash2Elm(e).next("."+f):oe},G=function(e,n){for(var i,a=e.children(":first");a.length;){if(i=t.file(t.navId2Hash(a.children("[id]").attr("id"))),(i=t.file(t.navId2Hash(a.children("[id]").attr("id"))))&&Q(n,i)<0)return a;a=a.next()}return e.children("button.elfinder-navbar-pager-next")},Y=function(i){for(var a,o,r,s,l,d,p,u=i.length,h=[],f=u,m=e(),g={},v=t.cwd(),b=function(i,a,o,r){var s={},l=0,d=t.newAPI?Math.min(1e4,Math.max(10,n.subTreeMax)):1e4,p=function(){s={},e.each(a,function(e,t){s[t.hash]=e})},u=function(t){"prepare"===t?e.each(a,function(e,t){t.node&&i.append(t.node.hide())}):"done"===t&&e.each(a,function(e,t){t.node&&t.node.detach().show()})},h=function(t,n){var i;return t.stopPropagation(),n.select?void g(f(n.select)):n.change?void u(n.change):(n.removed&&n.removed.length&&(a=e.grep(a,function(e){return n.removed.indexOf(e.hash)===-1||(!i&&(i=!0),!1)})),n.added&&n.added.length&&(a=a.concat(e.grep(n.added,function(e){return void 0===s[e.hash]&&(!i&&(i=!0),!0)}))),void(i&&(a.sort(Q),p(),g(l))))},f=function(e){if(void 0!==s[e])return Math.floor(s[e]/d)*d},m=t.navId2Hash(i.prev("[id]").attr("id")),g=function(n,o){var r,s,u,y,w,x,k,C,z=[],T={};delete $[m],l=n,i.off("update."+t.namespace,h),a.length>d&&(i.on("update."+t.namespace,h),void 0===n&&(u=0,p(),n=f(v.hash),void 0===n&&(n=0)),y=a.slice(n,n+d),$[m]=i,w=n?Math.max(-1,n-d):-1,x=n+d>=a.length?0:n+d,r=Math.ceil(a.length/d),s=Math.ceil(n/d)),e.each(y||a,function(e,t){z.push(K(t)),t.node&&(T[t.hash]=t.node)}),k=w>-1?e('<button class="elfinder-navbar-pager elfinder-navbar-pager-prev"></button>').text(t.i18n("btnPrevious",s,r)).button({icons:{primary:"ui-icon-caret-1-n"}}).on("click",function(e){e.preventDefault(),e.stopPropagation(),g(w,"up")}):e(),C=x?e('<button class="elfinder-navbar-pager elfinder-navbar-pager-next"></button>').text(t.i18n("btnNext",s+2,r)).button({icons:{primary:"ui-icon-caret-1-s"}}).on("click",function(e){e.preventDefault(),e.stopPropagation(),g(x,"down")}):e(),b(),i.empty()[y?"addClass":"removeClass"]("elfinder-navbar-hasmore").append(k,z.join(""),C),e.each(T,function(e,n){t.navHash2Elm(e).parent().replaceWith(n)}),o&&Z(t.navHash2Id(y["up"===o?y.length-1:0].hash)),!c&&t.lazy(function(){ie(null,i)})},b=function(){e.each(i.children(".elfinder-navbar-wrapper"),function(n,i){var o,r,l=e(i),c=l.children("[id]:first");c.hasClass(y)&&(o=t.navId2Hash(c.attr("id")),o&&void 0!==(r=s[o])&&(a[r].node=l.detach()))})};g()},w={},x=[],k={};f--;)a=i[f],g[a.hash]||t.navHash2Elm(a.hash).length||(g[a.hash]=!0,(o=J(a.p
r&&c.substr(0,b.options.url.length)===b.options.url&&(f=b.getRequestId(),S.push(f),c+="&cpath="+s+"&reqid="+f,h=setTimeout(function(){b.notify({type:"download",cnt:1,cancel:b.UA.IE||b.UA.Edge?void 0:function(){S.length&&e.each(S,function(){b.request({data:{cmd:"abort",id:this},preventDefault:!0})}),S=[]}})},b.notifyDelay),A(f)),p?T(d.attr("href",c).attr("download",b.escape(y[i].name)).get(0)):b.UA.Mobile?setTimeout(function(){window.open(c)||(b.error("errPopup"),h&&cleaerTimeout(h),j())},100):x+='<iframe class="downloader" id="downloader-'+y[i].hash+'" style="display:none" src="'+c+'"></iframe>';d.remove(),e(x).appendTo("body").ready(function(){setTimeout(function(){e(x).each(function(){e("#"+e(this).attr("id")).remove()})},2e4+1e4*i)}),b.trigger("download",{files:y}),w.resolve()}),u=y.length,g=[],i=0;i<y.length;i++)b.openUrl(y[i].hash,!0,function(e){e&&g.push(e),--u<1&&m.resolve(g)});return w}},i.prototype.commands.duplicate=function(){var t=this.fm;this.getstate=function(n){var i=this.files(n),a=i.length,o=function(n){var i=!0;return e.grep(n,function(e){return i=!(!i||!e.read||e.phash!==t.cwd().hash||t.isRoot(e))})};return a&&t.cwd().write&&o(i).length==a?0:-1},this.exec=function(t){var n=this.fm,i=this.files(t),a=i.length,o=e.Deferred().fail(function(e){e&&n.error(e)});return a?(e.each(i,function(e,t){if(!t.read||!n.file(t.phash).write)return!o.reject(["errCopy",t.name,"errPerm"])}),"rejected"==o.state()?o:n.request({data:{cmd:"duplicate",targets:this.hashes(t)},notify:{type:"copy",cnt:a},navigate:{toast:{inbuffer:{msg:n.i18n(["complete",n.i18n("cmdduplicate")])}}}})):o.reject()}},i.prototype.commands.edit=function(){var t,n=this,i=this.fm,a=i.res("class","editing"),o=[],r=[],s=!1,l=function(e){return e.replace(/\s+$/,"")},c=function(t){var a,o=e('<select class="ui-corner-all"></select>');return t&&e.each(t,function(e,t){a=i.escape(t.value),o.append('<option value="'+a+'">'+(t.caption?i.escape(t.caption):a)+"</option>")}),e.each(n.options.encodings,function(e,t){o.append('<option value="'+t+'">'+t+"</option>")}),o},d=function(){var t,a,o=i.options.dialogContained?i.getUI():e(window);return a="string"==typeof n.options.dialogWidth&&(t=n.options.dialogWidth.match(/(\d+)%/))?parseInt(o.width()*(t[1]/100)):parseInt(n.options.dialogWidth||650),Math.min(a,o.width())},p=function(){if(n.options.dialogHeight){var t,a,o=i.options.dialogContained?i.getUI():e(window);return a="string"==typeof n.options.dialogHeight&&(t=n.options.dialogHeight.match(/(\d+)%/))?parseInt(o.height()*(t[1]/100)):parseInt(n.options.dialogHeight||o.height()),Math.min(a,o.height())}},u=function(t){var a,l,c,d=t.length;return d>1&&(a=t[0].mime,l=t[0].name.replace(/^.*(\.[^.]+)$/,"$1")),e.grep(t,function(t){var p;return!c&&"directory"!==t.mime&&(p=t.read&&(s||i.mimeIsText(t.mime)||e.inArray(t.mime,1===d?o:r)!==-1)&&(!n.onlyMimes.length||e.inArray(t.mime,n.onlyMimes)!==-1)&&(1===d||t.mime===a&&t.name.substr(l.length*-1)===l)&&!!i.uploadMimeCheck(t.mime,t.phash)&&b(t,d)&&Object.keys(g).length,p||(c=!0),p)})},h=function(e){var t,n=i.file(e);i.request({cmd:"info",targets:[e],preventDefault:!0}).done(function(e){var a;e&&e.files&&e.files.length&&(t=e.files[0],n.ts==t.ts&&n.size==t.size||(a={changed:[t]},i.updateCache(a),i.change(a)))})},f=function(t,o,r,s,u,f){var g,v,b,y,w,k,C=e.Deferred(),z=!1,T=function(){return!!z||(i.toast({mode:"warning",msg:i.i18n("nowLoading")}),!1)},A=function(){f&&Array.isArray(f)&&e.each(f,function(){this.msg&&i.toast(this)})},j=function(){var t,n,a,o=y?y.val():void 0,r=e.Deferred().fail(function(e){b.show().find("button.elfinder-btncnt-0,button.elfinder-btncnt-1").hide()});return T()?(g.editor&&(g.editor.save(g[0],g.editor.instance),t=g.editor.confObj,t.info&&(t.info.schemeContent||t.info.arrayBufferContent)&&(o="scheme")),n=D(),U(n),n.promise?(a=setTimeout(function(){i.notify({type:"chkcontent",cnt:1,hideCnt:!0,cancel:function(){n.reject()}})},100),n.always(function(){a&&clearTimeout(a),i.notify({type:"chkcontent",cnt:-1})}).done(function(e){C.notifyWith(g,[o,g.data("hash"),v,r])}).fail(function(e){r.reject(e)})):C.notifyWith(g,[o
t&&(i.hide(),t.debug&&(c=e("<fieldset>").append(e("<legend></legend>").text("debug"),u(e("<dl></dl>"),t.debug)),i.append(c)),t.options&&(c=e("<fieldset>").append(e("<legend></legend>").text("options"),u(e("<dl></dl>"),t.options)),i.append(c)),i.show()),n.off("click.debugrender")}),r.after(i),t&&o.tabs("refresh"))},D="";this.alwaysEnabled=!0,this.updateOnSelect=!1,this.state=-1,this.shortcuts=[{pattern:"f1",description:this.title}],s.bind("load",function(){var c,d,p,u,h,f,g=l.options.view||["about","shortcuts","help","integrations","debug"];(c=e.inArray("preference",g))!==-1&&g.splice(c,1),e.fn.tabs||(c=e.inArray(g,"debug"))!==-1&&g.splice(c,1),e.each(g,function(e,t){w.push(y[m](/\{id\}/g,t)[m](/\{title\}/,s.i18n(t)))}),w.push("</ul>"),e.inArray("about",g)!==-1&&A(),e.inArray("shortcuts",g)!==-1&&j(),e.inArray("help",g)!==-1&&(d=s.i18nBaseUrl+"help/%s.html.js",S()),e.inArray("integrations",g)!==-1&&I(),e.inArray("debug",g)!==-1&&E(),w.push("</div>"),D=e(w.join("")),D.find(".ui-tabs-nav li").on("mouseenter mouseleave",function(t){e(this).toggleClass("ui-state-hover","mouseenter"===t.type)}).on("focus blur","a",function(t){e(t.delegateTarget).toggleClass("ui-state-focus","focusin"===t.type)}).children().on("click",function(t){var n=e(this);t.preventDefault(),t.stopPropagation(),n.parent().addClass(z).siblings().removeClass(z),D.children(".ui-tabs-panel").hide().filter(n.attr("href")).show()}).filter(":first").trigger("click"),O&&(n=D.find(".elfinder-help-tab-integrations").hide(),i=D.find("#"+s.namespace+"-help-integrations").hide().append(e('<div class="elfinder-help-integrations-desc"></div>').html(s.i18n("integrationWith"))),s.bind("helpIntegration",function(t){var a,o,r,l,c=i.children("ul:first");t.data&&(e.isPlainObject(t.data)?(a=Object.assign({link:"",title:"",banner:""},t.data),(a.title||a.link)&&(a.title||(a.title=a.link),o=a.link?e("<a></a>").attr("href",a.link).attr("target","_blank").text(a.title):e("<span></span>").text(a.title),a.banner&&(o=e("<span></span>").append(e("<img/>").attr(a.banner),o)))):(o=e(t.data),o.filter("a").each(function(){var t=e(this);t.attr("target")||t.attr("target","_blank")})),o&&(n.show(),c.length||(c=e('<ul class="elfinder-help-integrations"></ul>').appendTo(i)),a&&a.cmd?(l="elfinder-help-integration-"+a.cmd,r=c.find("ul."+l),r.length||(r=e('<ul class="'+l+'"></ul>'),c.append(e("<li></li>").append(e("<span></span>").html(s.i18n("cmd"+a.cmd))).append(r))),o=r.append(e("<li></li>").append(o))):c.append(e("<li></li>").append(o))))}).bind("themechange",function(){D.find("div.elfinder-help-term-theme").replaceWith(T())})),M&&(a=D.find(".elfinder-help-tab-debug").hide(),o=D.find("#"+s.namespace+"-help-debug").children("div:first"),r=o.children("ul:first").on("click",function(e){e.preventDefault(),e.stopPropagation()}),l.debug={},s.bind("backenddebug",function(e){M&&e.data&&e.data.debug&&(l.debug={options:e.data.options,debug:Object.assign({cmd:s.currentReqCmd},e.data.debug)},l.dialog&&F())})),D.find("#"+s.namespace+"-help-about").find(".apiver").text(s.api),l.dialog=l.fmDialog(D,{title:l.title,width:530,maxWidth:"window",maxHeight:"window",autoOpen:!1,destroyOnClose:!1,close:function(){M&&(a.hide(),o.tabs("destroy")),t=!1}}).on("click",function(e){e.stopPropagation()}).css({overflow:"hidden"}),p=l.dialog.children(".ui-tabs"),u=p.children(".ui-tabs-nav:first"),h=p.children(".ui-tabs-panel"),f=l.dialog.outerHeight(!0)-l.dialog.height(),l.dialog.closest(".ui-dialog").on("resize",function(){h.height(l.dialog.height()-f-u.outerHeight(!0)-20)}),d&&l.dialog.one("initContents",function(){e.ajax({url:l.options.helpSource?l.options.helpSource:d.replace("%s",s.lang),dataType:"html"}).done(function(t){e("#"+s.namespace+"-help-help").html(t)}).fail(function(){e.ajax({url:d.replace("%s","en"),dataType:"html"}).done(function(t){e("#"+s.namespace+"-help-help").html(t)})})}),l.state=0,s.trigger("helpBuilded",l.dialog)}).one("open",function(){var e=!1;s.one("backenddebug",function(){e=!0}).one("opendone",function(){requestAnimationFrame(function(){!e&&M&&(M=!1,a.hide(),o.hide(),r.hide())})})}),this.getstate
hash:n.hash,phash:n.phash,name:n.name}))):!v.reject([f,n.name,"errPerm"])}),"rejected"===v.state()?v:(o=e.Deferred(),u&&r.options.moveConfirm?s.confirm({title:"moveFiles",text:s.i18n("confirmMove",c.i18||c.name),accept:{label:"btnYes",callback:function(){o.resolve()}},cancel:{label:"btnCancel",callback:function(){o.reject()}}}):o.resolve(),o.done(function(){e.when(b(g),y(m)).done(function(e,t){v.resolve(t&&t.undo?t:void 0)}).fail(function(){v.reject()}).always(function(){u&&s.clipboard([])})}).fail(function(){v.reject()}),v)):v.reject([f,d[0].name,"errPerm"]):v.reject()}},i.prototype.commands.places=function(){var t=this,n=this.fm,i=function(n){var i=!0;return e.grep(t.files(n),function(e){return i=!(!i||"directory"!=e.mime)})},a=null;this.getstate=function(e){var t=this.hashes(e),n=t.length;return a&&n&&n==i(t).length?0:-1},this.exec=function(t){var n=this.files(t);return a.trigger("regist",[n]),e.Deferred().resolve()},n.one("load",function(){a=n.ui.places})},i.prototype.commands.preference=function(){var t,n,i=this,a=this.fm,o="replace",r='<li class="'+a.res("class","tabstab")+' elfinder-preference-tab-{id}"><a href="#'+a.namespace+'-preference-{id}" id="'+a.namespace+'-preference-tab-{id}" class="ui-tabs-anchor {class}">{title}</a></li>',s=e('<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-preference">'),l=e('<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-top">'),c=e('<div class="elfinder-preference-tabs ui-tabs-panel ui-widget-content ui-corner-bottom"></div>'),d=(e("base").length?document.location.href.replace(/#.*$/,""):"",function(t){e("#"+a.namespace+"-preference-tab-"+t).trigger("mouseover").trigger("click"),n=t}),p=a.res("class","tabsactive"),u=function(){var u=i.options.categories||{language:["language"],theme:["theme"],toolbar:["toolbarPref"],workspace:["iconSize","columnPref","selectAction","makefileTypes","useStoredEditor","editorMaximized","useFullscreen","showHidden"],dialog:["autoFocusDialog"],selectionInfo:["infoItems","hashChecker"],reset:["clearBrowserData"],all:!0},h=i.options.prefs||["language","theme","toolbarPref","iconSize","columnPref","selectAction","makefileTypes","useStoredEditor","editorMaximized","useFullscreen","showHidden","infoItems","hashChecker","autoFocusDialog","clearBrowserData"];a.cookieEnabled||delete u.language,h=a.arrayFlip(h,!0),a.options.getFileCallback&&delete h.selectAction,a.UA.Fullscreen||delete h.useFullscreen,h.language&&(h.language=function(){var t=e("<select></select>").on("change",function(){var t=e(this).val();a.storage("lang",t),e("#"+a.id).elfinder("reload")}),n=[],o=i.options.langs||{ar:"العربية",bg:"Български",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",el:"Ελληνικά",en:"English",es:"Español",fa:"فارسی",fo:"Føroyskt",fr:"Français",fr_CA:"Français (Canada)",he:"עברית",hr:"Hrvatski",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"日本語",ko:"한국어",nl:"Nederlands",no:"Norsk",pl:"Polski",pt_BR:"Português",ro:"Română",ru:"Pусский",si:"සිංහල",sk:"Slovenčina",sl:"Slovenščina",sr:"Srpski",sv:"Svenska",tr:"Türkçe",ug_CN:"ئۇيغۇرچە",uk:"Український",vi:"Tiếng Việt",zh_CN:"简体中文",zh_TW:"正體中文"};return a.cookieEnabled?(e.each(o,function(e,t){n.push('<option value="'+e+'">'+t+"</option>")}),t.append(n.join("")).val(a.lang)):e()}()),h.theme&&(h.theme=function(){var t=a.options.themes?Object.keys(a.options.themes).length:0;if(0===t||1===t&&a.options.themes["default"])return null;var n=e("<select></select>").on("change",function(){var t=e(this).val();a.changeTheme(t).storage("theme",t)}),i={image:'<img class="elfinder-preference-theme elfinder-preference-theme-image" src="$2" />',link:'<a href="$1" target="_blank" title="$3">$2</a>',data:'<dt>$1</dt><dd><span class="elfinder-preference-theme elfinder-preference-theme-$0">$2</span></dd>'},o=["image","description","author","email","license"],r=e('<button class="ui-button ui-corner-all ui-widget elfinder-preference-theme-default"></button>').text(a.i18n("
}).trigger("changesize"),p.width&&p.height||h([u.width,u.height]),t.hideinfo()},c.onerror=u,c.postMessage({scripts:[n.options.cdns.tiff,n.getWorkerUrl("quicklook.tiff.js")],data:{data:i}})}catch(o){u(o)}}else u()}),a.one("change",function(){d&&d.state&&"pending"===d.state()&&d.reject()}))})},function(t){var n,i=t.fm,a=i.arrayFlip(["image/vnd.adobe.photoshop","image/x-photoshop"]),o=t.preview,r=function(e,a,r){try{i.replaceXhrSend(),n.fromURL(e).then(function(e){var n;a.attr("src",e.image.toBase64()),requestAnimationFrame(function(){n=(a.width()/a.height()).toFixed(2),o.on("changesize",function(){var e,t,i=parseInt(o.width()),r=parseInt(o.height());n<(i/r).toFixed(2)?(t=r,e=Math.floor(t*n)):(e=i,t=Math.floor(e/n)),a.width(e).height(t).css("margin-top",t<r?Math.floor((r-t)/2):0)}).trigger("changesize"),r.remove(),t.hideinfo(),a.fadeIn(100)})},function(){r.remove(),a.remove()}),i.restoreXhrSend()}catch(s){i.restoreXhrSend(),r.remove(),a.remove()}};o.on(t.evUpdate,function(s){var l,c,d,p,u,h,f=s.file;a[f.mime]&&i.options.cdns.psd&&!i.UA.ltIE10&&t.dispInlineRegex.test(f.mime)&&(s.stopImmediatePropagation(),c=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+i.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),d=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(c),h=i.openUrl(f.hash,"sameorigin",function(t){t&&(l=e("<img/>").hide().appendTo(o),n?r(t,l,c):(p=window.define,u=window.require,window.require=null,window.define=null,i.loadScript([i.options.cdns.psd],function(){n=require("psd"),p?window.define=p:delete window.define,u?window.require=u:delete window.require,r(t,l,c)})))},{progressBar:d}),o.one("change",function(){h&&h.state&&"pending"===h.state()&&h.reject()}))})},function(t){var n=t.fm,i=n.arrayFlip(["text/html","application/xhtml+xml"]),a=t.preview;a.on(t.evUpdate,function(o){var r,s,l,c=o.file;i[c.mime]&&t.dispInlineRegex.test(c.mime)&&(!t.options.getSizeMax||c.size<=t.options.getSizeMax)&&(o.stopImmediatePropagation(),s=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),l=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(s),a.one("change",function(){"pending"==r.state()&&r.reject()}).addClass("elfinder-overflow-auto"),r=n.request({data:{cmd:"get",target:c.hash,conv:1,_t:c.ts},options:{type:"get",cache:!0},preventDefault:!0,progressBar:l}).done(function(n){t.hideinfo();var i=e('<iframe class="elfinder-quicklook-preview-html"></iframe>').appendTo(a)[0].contentWindow.document;i.open(),i.write(n.content),i.close()}).always(function(){s.remove()}))})},function(t){var n=t.fm,i=n.arrayFlip(["text/x-markdown"]),a=t.preview,o=null,r=function(n,i){t.hideinfo();var r=e('<iframe class="elfinder-quicklook-preview-html"></iframe>').appendTo(a)[0].contentWindow.document;r.open(),r.write(o(n.content)),r.close(),i.remove()},s=function(e){o=!1,e.remove()};a.on(t.evUpdate,function(l){var c,d,p,u=l.file;i[u.mime]&&n.options.cdns.marked&&o!==!1&&t.dispInlineRegex.test(u.mime)&&(!t.options.getSizeMax||u.size<=t.options.getSizeMax)&&(l.stopImmediatePropagation(),d=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),p=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(d),a.one("change",function(){"pending"==c.state()&&c.reject()}).addClass("elfinder-overflow-auto"),c=n.request({data:{cmd:"get",target:u.hash,conv:1,_t:u.ts},options:{type:"get",cache:!0},preventDefault:!0,progressBar:p}).done(function(e){o||window.marked?(o||(o=window.marked),r(e,d)):n.loadScript([n.options.cdns.marked],function(t){o=t||window.marked||!1,delete window.marked,o?r(e,d):s(d)},{tryRequire:!0,error:function(){s(d)}})}).fail(function(){s(d)}))})},function(t){if(t.options.viewerjs){var n=t.fm,i=t.prev
return i=s[1]?"."+s[1]:"",s[1]&&"*"===s[0]?(a='"'+n.splitFileExtention(l.name)[0]+i+'", ',a+='"'+n.splitFileExtention(c.name)[0]+i+'"'):s[0].length>1&&("*"===s[0].substr(-1)?(o=s[0].substr(0,s[0].length-1),a='"'+o+l.name+'", ',a+='"'+o+c.name+'"'):"*"===s[0].substr(0,1)&&(o=s[0].substr(1),a='"'+n.splitFileExtention(l.name)[0]+o+i+'", ',a+='"'+n.splitFileExtention(c.name)[0]+o+i+'"')),a||(a='"'+s[0]+"1"+i+'", "'+s[0]+"2"+i+'"'),r.length>2&&(a+=" ..."),a},o=function(){var o,r=n.selected(),s='<input name="type" type="radio" class="elfinder-tabstop">',l=function(t,i){return e('<label class="elfinder-rename-batch-checks">'+n.i18n(i)+"</label>").prepend(t)},c=e('<input type="text" class="ui-corner-all elfinder-tabstop">'),d=e(s),p=e(s),u=e(s),h=e(s),f=e("<div></div>").append(l(d,"plusNumber"),l(p,"asPrefix"),l(u,"asSuffix"),l(h,"changeExtention")),m=e('<div class="elfinder-rename-batch-preview"></div>'),g=e('<div class="elfinder-rename-batch"></div>').append(e('<div class="elfinder-rename-batch-name"></div>').append(c),e('<div class="elfinder-rename-batch-type"></div>').append(f),m),v={title:n.i18n("batchRename"),modal:!0,destroyOnClose:!0,width:Math.min(380,n.getUI().width()-20),buttons:{},open:function(){c.on("input",y).trigger("focus")}},b=function(){var e=c.val(),t=n.splitFileExtention(n.file(r[0]).name)[1];return(""!==e||d.is(":checked"))&&(p.is(":checked")?e+="*":u.is(":checked")?e="*"+e+"."+t:h.is(":checked")?e="*."+e:t&&(e+="."+t)),e},y=function(){var e=b();""!==e?m.html(n.i18n(["renameMultiple",r.length,a(e)])):m.empty()},w=f.find("input:radio").on("change",y);v.buttons[n.i18n("btnApply")]=function(){var e,t,a=b();""!==a&&(o.elfinderdialog("close"),t=r,e=n.file(t.shift()),i(void 0,t,e,a))},v.buttons[n.i18n("btnCancel")]=function(){o.elfinderdialog("close")},e.fn.checkboxradio?w.checkboxradio({create:function(e,t){this===d.get(0)&&d.prop("checked",!0).change()}}):f.buttonset({create:function(e,t){d.prop("checked",!0).change()}}),o=t.fmDialog(g,v)};this.noChangeDirOnRemovedCwd=!0,this.shortcuts=[{pattern:"f2"+("mac"==n.OS?" enter":"")},{pattern:"shift+f2",description:"batchRename",callback:function(){n.selected().length>1&&o()}}],this.getstate=function(i){var a,r,s,l,c,d,p=this.files(i),u=p.length;return u?(u>1&&p[0].phash&&(a=p[0].phash,r=n.splitFileExtention(p[0].name)[1].toLowerCase(),s=p[0].mime),1===u&&(d=n.isRoot(p[0])),c=1===u&&(n.cookieEnabled&&d||!p[0].locked)||n.api>2.103&&u===e.grep(p,function(e){return!(l||e.locked||e.phash!==a||n.isRoot(e)||s!==e.mime&&r!==n.splitFileExtention(e.name)[1].toLowerCase())||(l&&(l=!0),!1)}).length?0:-1,!d&&0===c&&n.option("disabledFlip",p[0].hash).rename&&(c=-1),c!==-1&&u>1?t.extra={icon:"preference",node:e("<span></span>").attr({title:n.i18n("batchRename")}).on("click touchstart",function(e){"touchstart"===e.type&&e.originalEvent.touches.length>1||(e.stopPropagation(),e.preventDefault(),n.getUI().trigger("click"),o())})}:delete t.extra,c):-1},this.exec=function(t,o){var r,s=(n.getUI("cwd"),t||!!n.selected().length&&n.selected()||[n.cwd().hash]),l=s.length,c=n.file(s.shift()),d=".elfinder-cwd-filename",p=o||{},u=n.cwd().hash==c.hash,h="navbar"===p._currentType||"files"===p._currentType?p._currentType:u?"navbar":"files",f="files"!==h,m=n[f?"navHash2Elm":"cwdHash2Elm"](c.hash),g=!f&&"list"!=n.storage("view"),v=function(){requestAnimationFrame(function(){x&&x.trigger("blur")})},b=function(){T.is(":hidden")||T.elfinderoverlay("hide").off("click close",A),z.removeClass("ui-front").css("position","").off("unselect."+n.namespace,v),g?C&&C.css("max-height",""):f||z.css("width","").parent("td").css("overflow","")},y=e.Deferred().fail(function(e){var t=x.parent(),i=n.escape(c.i18||c.name);x.off(),g&&(i=i.replace(/([_.])/g,"&#8203;$1")),requestAnimationFrame(function(){f?x.replaceWith(i):t.length?(x.remove(),t.html(i)):m.find(d).html(i)}),e&&n.error(e)}).always(function(){b(),n.unbind("resize",j),n.enable()}),w=function(t){var o=e.trim(x.val()),r=(n.splitFileExtention(o),!0),d=function(){x.off(),b(),f?x.replaceWith(n.escape(o)):C.html(n.escape(o)),i(y,s,c,o)};if(T.is(":hidden")||z.css("z
z.on("mouseup",Ve.stop)),o&&!i)return Pe();if(a.size>(h.getDimThreshold||0))qe.off("error.dimreq"),e();else if(o)return Pe()},close:function(){u&&(Ne.off("mousedown touchstart",Ve.start).off("touchend",Ve.stop),e(document).off("mouseup",Ve.stop)),t.unbind("resize",rt),e(this).elfinderdialog("destroy")},resize:function(e,t){t&&"off"===t.minimize&&rt()}}).attr("id",o).closest(".ui-dialog").addClass(w),t.UA.ltIE8&&e(".elfinder-dialog").css("filter",""),_e.css({opacity:.2,"background-color":"#fff",position:"absolute"}),R.css("cursor","move"),R.find(".elfinder-resize-handle-point").css({"background-color":"#fff",opacity:.5,"border-color":"#000"}),u||V.find(".api2").remove(),D.find("input,select").prop("disabled",!0),D.find("input.elfinder-resize-quality").next("span").addClass("elfinder-resize-jpgsize").attr("title",t.i18n("roughFileSize"))};return d.length&&d[0].mime.indexOf("image/")!==-1?(o="resize-"+t.namespace+"-"+d[0].hash,r=m.find("#"+o),r.length?(r.elfinderdialog("toTop"),p.resolve()):(t.openUrl(d[0].hash,"sameorigin",function(e){x(d[0],o,e)}),p)):p.reject()}},function(e){var t=function(e,t){var n=0;for(n in t)if("undefined"!=typeof e[t[n]])return t[n];return e[t[n]]="",t[n]};if(e.cssHooks.rotate={get:function(t,n,i){return e(t).rotate()},set:function(t,n){return e(t).rotate(n),n}},e.cssHooks.transform={get:function(e,n,i){var a=t(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[a]},set:function(e,n){var i=t(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[i]=n,n}},e.fn.rotate=function(e){var t;return"undefined"==typeof e?window.opera?(t=this.css("transform").match(/rotate\((.*?)\)/),t&&t[1]?Math.round(180*parseFloat(t[1])/Math.PI):0):(t=this.css("transform").match(/rotate\((.*?)\)/),t&&t[1]?parseInt(t[1]):0):(this.css("transform",this.css("transform").replace(/none|rotate\(.*?\)/,"")+"rotate("+parseInt(e)+"deg)"),this)},e.fx.step.rotate=function(t){0==t.state&&(t.start=e(t.elem).rotate(),t.now=t.start),e(t.elem).rotate(t.now)},"undefined"==typeof window.addEventListener&&"undefined"==typeof document.getElementsByClassName){var n=function(e){for(var t=e,n=t.offsetLeft,i=t.offsetTop;t.offsetParent&&(t=t.offsetParent,t==document.body||"static"==t.currentStyle.position);)t!=document.body&&t!=document.documentElement&&(n-=t.scrollLeft,i-=t.scrollTop),n+=t.offsetLeft,i+=t.offsetTop;return{x:n,y:i}},i=function(e){if("static"==e.currentStyle.position){var t=n(e);e.style.position="absolute",e.style.left=t.x+"px",e.style.top=t.y+"px"}},a=function(e,t){var n,a=1,o=1,r=1,s=1;if("undefined"!=typeof e.style.msTransform)return!0;i(e),n=t.match(/rotate\((.*?)\)/);var l=n&&n[1]?parseInt(n[1]):0;l%=360,l<0&&(l=360+l);var c=l*Math.PI/180,d=Math.cos(c),p=Math.sin(c);a*=d,o*=-p,r*=p,s*=d,e.style.filter=(e.style.filter||"").replace(/progid:DXImageTransform\.Microsoft\.Matrix\([^)]*\)/,"")+("progid:DXImageTransform.Microsoft.Matrix(M11="+a+",M12="+o+",M21="+r+",M22="+s+",FilterType='bilinear',sizingMethod='auto expand')");var u=parseInt(e.style.width||e.width||0),h=parseInt(e.style.height||e.height||0);c=l*Math.PI/180;var f=Math.abs(Math.cos(c)),m=Math.abs(Math.sin(c)),g=(u-(u*f+h*m))/2,v=(h-(u*m+h*f))/2;return e.style.marginLeft=Math.floor(g)+"px",e.style.marginTop=Math.floor(v)+"px",!0},o=e.cssHooks.transform.set;e.cssHooks.transform.set=function(e,t){return o.apply(this,[e,t]),a(e,t),t}}}(jQuery),(i.prototype.commands.restore=function(){"use strict";var t=this,n=this.fm,i=0,a=function(t){var o,r=e.Deferred(),s=[],l=[],c=[],d=[];return r._xhrReject=function(){e.each(c,function(){this&&this.reject&&this.reject()}),o&&o._xhrReject()},e.each(t,function(e,t){"directory"===t.mime?s.push(t):l.push(t)}),s.length?(e.each(s,function(e,t){c.push(n.request({data:{cmd:"open",target:t.hash},preventDefault:!0,asNotOpen:!0})),d[e]=t.hash}),e.when.apply(e,c).fail(function(){r.reject()}).done(function(){var t=[];e.each(arguments,function(e,n){n.files&&(n.files.length?t=t.concat(n.files):t.push({hash:"fakefile_"+i++,phash:d[e],mime:"fakefile",name:"fakefile"