/*!
* elFinder - file manager for web
* Version 2.1.59 (2021-06-14)
* http://elfinder.org
*
* Copyright 2009-2021, Studio 42
* Licensed under a 3-clauses BSD license
*/
!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("
").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-1&&o.splice(r,1));return n=null,this},this.trigger=function(t,n,i){var a,o,r,s,l=t.toLowerCase(),c="object"==typeof n,d=D[l]||[],p=[];if(this.debug("event-"+l,n),c&&"undefined"!=typeof i||(i=!0),o=d.length){for(s=e.Event(l),n&&(n._getEvent=function(){return s}),i&&(s.data=n),a=0;a script").each(function(){if(this.src&&this.src.match(/js\/elfinder(?:-[a-z0-9_-]+)?\.(?:min|full)\.js(?:$|\?)/i))return t=e(this),!1}),t&&(i=t.attr("src").replace(/js\/[^\/]+$/,""),i.match(/^(https?\/\/|\/)/)||(n=e("head > base[href]").attr("href"))&&(i=n.replace(/\/$/,"")+"/"+i)),""!==i?u.options.baseUrl=i:(u.options.baseUrl||(u.options.baseUrl="./"),i=u.options.baseUrl),i)}(),this.i18nBaseUrl=(this.options.i18nBaseUrl||this.baseUrl+"js/i18n").replace(/\/$/,"")+"/",this.options.maxErrorDialogs=Math.max(1,parseInt(this.options.maxErrorDialogs||5)),S.dispInlineRegex=this.options.dispInlineRegex,this.options.cssAutoLoad&&!function(){var t=u.baseUrl,n=e('head > link[href$="css/elfinder.min.css"],link[href$="css/elfinder.full.css"]:first').length,i=function(){m.data("cssautoloadHide")&&(m.data("cssautoloadHide").remove(),m.removeData("cssautoloadHide"))},a=function(){u.cssloaded||(i(),u.cssloaded=!0,u.trigger("cssloaded"))};n||(u.cssloaded=null),Array.isArray(u.options.cssAutoLoad)&&(u.options.themes["default"]?u.cssloaded===!0?u.loadCss(u.options.cssAutoLoad):u.bind("cssloaded",function(){u.loadCss(u.options.cssAutoLoad)}):(u.options.themes=Object.assign({"default":{name:"default",cssurls:u.options.cssAutoLoad}},u.options.themes),u.options.theme||(u.options.theme="default"))),null===u.cssloaded&&(m.addClass("elfinder").data("cssautoloadHide",e("")),e("head").append(m.data("cssautoloadHide")),u.options.themes["default"]||(u.options.themes=Object.assign({"default":{name:"default",cssurls:"css/theme.css",author:"elFinder Project",license:"3-clauses BSD"}},u.options.themes),u.options.theme||(u.options.theme="default")),requestAnimationFrame(function(){"hidden"===m.css("visibility")?u.loadCss([t+"css/elfinder.min.css"],{dfd:e.Deferred().done(function(){a()}).fail(function(){i(),u.cssloaded||(u.cssloaded=!1,u.bind("init",function(){u.cssloaded||u.error(["errRead","CSS (elfinder.min)"])}))})}):a()}))}(),function(){var e,t=u.options.themes,n=Object.keys(t||{});n.length&&(e=u.storage("theme")||u.options.theme,t[e]||(e=n[0]),u.cssloaded?u.changeTheme(e):u.bind("cssloaded",function(){u.changeTheme(e)}))}(),this.optionProperties={icon:void 0,csscls:void 0,tmbUrl:void 0,uiCmdMap:{},netkey:void 0,disabled:[]},re||this.options.enableAlways||2!==e("body").children().length||(this.options.enableAlways=!0),this.options.debug===!0?this.options.debug="all":Array.isArray(this.options.debug)?!function(){var t={};e.each(u.options.debug,function(){t[this]=!0}),u.options.debug=t}():this.options.debug=!1,this.noConflicts={},this.noConflict=function(){e.each(f,function(t,n){e.fn[n]&&"function"==typeof e.fn[n].noConflict&&(u.noConflicts[n]=e.fn[n].noConflict())})},this.noConflict(),this.isCORS=!1,function(){if("undefined"!=typeof u.options.cors&&null!==u.options.cors)u.isCORS=!!u.options.cors;else{var t,i=document.createElement("a"),a=window.location.protocol,o=function(e){return e=e&&":"!==e?e:a,"https:"===e?/\:443$/:/\:80$/},r=window.location.host.replace(o(a),"");i.href=n.url,n.urlUpload&&n.urlUpload!==n.url&&(t=document.createElement("a"),t.href=n.urlUpload),(r!==i.host.replace(o(i.protocol),"")||":"!==i.protocol&&""!==i.protocol&&a!==i.protocol||t&&(r!==t.host.replace(o(t.protocol),"")||":"!==t.protocol&&""!==t.protocol&&a!==t.protocol))&&(u.isCORS=!0)}u.isCORS&&(e.isPlainObject(u.options.customHeaders)||(u.options.customHeaders={}),e.isPlainObject(u.options.xhrFields)||(u.options.xhrFields={}),u.options.requestType="post",u.options.customHeaders["X-Requested-With"]="XMLHttpRequest",u.options.xhrFields.withCredentials=!0)}(),this.requestType=/^(get|post)$/i.test(this.options.requestType)?this.options.requestType.toLowerCase():"get",s=Math.max(parseInt(this.options.requestMaxConn),1),this.optsCustomData=e.isPlainObject(this.options.customData)?this.options.customData:{},this.customData=Object.assign({},this.optsCustomData),this.prevCustomData=null,this.customHeaders=e.isPlainObject(this.options.customHeaders)?this.options.customHeaders:{},this.xhrFields=e.isPlainObject(this.options.xhrFields)?this.options.xhrFields:{},this.replaceXhrSend=function(){p||(p=XMLHttpRequest.prototype.send),XMLHttpRequest.prototype.send=function(){var t=this;return u.customHeaders&&e.each(u.customHeaders,function(e){t.setRequestHeader(e,this)}),u.xhrFields&&e.each(u.xhrFields,function(e){e in t&&(t[e]=this)}),p.apply(this,arguments)}},this.restoreXhrSend=function(){p&&(XMLHttpRequest.prototype.send=p)},this.abortCmdsOnOpen=this.options.abortCmdsOnOpen||["tmb","parents"],this.navPrefix="nav"+(i.prototype.uniqueid?i.prototype.uniqueid:"")+"-",this.cwdPrefix=i.prototype.uniqueid?"cwd"+i.prototype.uniqueid+"-":"",++i.prototype.uniqueid,this.uploadURL=n.urlUpload||n.url,this.namespace=y,this.today=new Date(oe.getFullYear(),oe.getMonth(),oe.getDate()).getTime()/1e3,this.yesterday=this.today-86400,l=this.options.UTCDate?"UTC":"",this.getHours="get"+l+"Hours",this.getMinutes="get"+l+"Minutes",this.getSeconds="get"+l+"Seconds",this.getDate="get"+l+"Date",this.getDay="get"+l+"Day",this.getMonth="get"+l+"Month",this.getFullYear="get"+l+"FullYear",this.zIndex,this.searchStatus={state:0,query:"",target:"",mime:"",mixed:!1,ininc:!1},this.lang=this.storage("lang")||this.options.lang,"jp"===this.lang&&(this.lang=this.options.lang="ja"),this.viewType=this.storage("view")||this.options.defaultView||"icons",this.sortType=this.storage("sortType")||this.options.sortType||"name",this.sortOrder=this.storage("sortOrder")||this.options.sortOrder||"asc",this.sortStickFolders=this.storage("sortStickFolders"),null===this.sortStickFolders?this.sortStickFolders=!!this.options.sortStickFolders:this.sortStickFolders=!!this.sortStickFolders,this.sortAlsoTreeview=this.storage("sortAlsoTreeview"),null===this.sortAlsoTreeview||null===this.options.sortAlsoTreeview?this.sortAlsoTreeview=!!this.options.sortAlsoTreeview:this.sortAlsoTreeview=!!this.sortAlsoTreeview,this.sortRules=e.extend(!0,{},this._sortRules,this.options.sortRules),e.each(this.sortRules,function(e,t){"function"!=typeof t&&delete u.sortRules[e]}),this.compare=e.proxy(this.compare,this),this.notifyDelay=this.options.notifyDelay>0?parseInt(this.options.notifyDelay):500,this.draggingUiHelper=null,this.droppable={greedy:!0,tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-navbar-dir,.elfinder-cwd-file,.elfinder-cwd-filename",hoverClass:this.res("class","adroppable"),classes:{"ui-droppable-hover":this.res("class","adroppable")},autoDisable:!0,drop:function(t,n){var i,a,o,r=e(this),s=e.grep(n.helper.data("files")||[],function(e){return!!e}),l=[],c=[],d=[],p=n.helper.hasClass("elfinder-drag-helper-plus"),h="class";if("undefined"==typeof t.button||n.helper.data("namespace")!==y||!u.insideWorkzone(t.pageX,t.pageY))return!1;for(a=r.hasClass(u.res(h,"cwdfile"))?u.cwdId2Hash(r.attr("id")):r.hasClass(u.res(h,"navdir"))?u.navId2Hash(r.attr("id")):j,i=s.length;i--;)o=s[i],o!=a&&I[o].phash!=a?l.push(o):(p&&o!==a&&I[a].write?c:d).push(o);return!d.length&&(n.helper.data("droped",!0),c.length&&(n.helper.hide(),u.exec("duplicate",c,{_userAction:!0})),void(l.length&&(n.helper.hide(),u.clipboard(l,!p),u.exec("paste",a,{_userAction:!0},a).always(function(){u.clipboard([]),u.trigger("unlockfiles",{files:s})}),u.trigger("drop",{files:s}))))}},this.enabled=function(){return z&&this.visible()},this.visible=function(){return m[0].elfinder&&m.is(":visible")},this.isRoot=function(e){return!(!e.isroot&&e.phash)},this.root=function(t,n){t=t||j;var i,a;if(!n&&(e.each(u.roots,function(e,n){if(0===t.indexOf(e))return i=n,!1}),i))return i;for(i=I[t];i&&i.phash&&(n||!i.isroot);)i=I[i.phash];if(i)return i.hash;for(;a in I&&I.hasOwnProperty(a);)if(i=I[a],"directory"===i.mime&&!i.phash&&i.read)return i.hash;return""},this.cwd=function(){return I[j]||{}},this.option=function(t,n){var i,a;return n=n||j,u.optionsByHashes[n]&&"undefined"!=typeof u.optionsByHashes[n][t]?u.optionsByHashes[n][t]:!u.hasVolOptions||j===n||(a=u.file(n))&&a.phash===j?O[t]||"":(i="",e.each(u.volOptions,function(e,a){if(0===n.indexOf(e))return i=a[t]||"",!1}),i)},this.getDisabledCmds=function(t,n){var i={hidden:!0};return Array.isArray(t)||(t=[t]),e.each(t,function(e,t){var n=u.option("disabledFlip",t);n&&Object.assign(i,n)}),n?i:Object.keys(i)},this.file=function(e,t){return e?I[e]||(t?M[e]:void 0):void 0},this.files=function(t){var n={};return t?E[t]?(e.each(E[t],function(e){I[e]?n[e]=I[e]:delete E[t][e]}),Object.assign({},n)):{}:Object.assign({},I)},this.parents=function(e){for(var t,n=[];e&&(t=this.file(e));)n.unshift(t.hash),e=t.phash;return n},this.path2array=function(e,t){for(var n,i=[];e;){if(!(n=I[e])||!n.hash){i=[];break}i.unshift(t&&n.i18?n.i18:n.name),e=n.isroot?null:n.phash}return i},this.path=function(t,n,i){var a=I[t]&&I[t].path?I[t].path:this.path2array(t,n).join(O.separator);if(i&&I[t]){i=Object.assign({notify:{type:"parents",cnt:1,hideCnt:!0}},i);var o,r=e.Deferred(),s=i.notify,l=!1,c=function(){u.request({data:{cmd:"parents",target:I[t].phash},notify:s,preventFail:!0}).done(d).fail(function(){r.reject()})},d=function(){u.one("parentsdone",function(){a=u.path(t,n),""===a&&l?(l=!1,c()):(s&&(clearTimeout(o),s.cnt=-parseInt(s.cnt||0),u.notify(s)),r.resolve(a))})};return a?r.resolve(a):(u.ui.tree?(s&&(o=setTimeout(function(){u.notify(s)},u.notifyDelay)),l=!0,d(!0)):c(),r)}return a},this.url=function(t,n){var i,a=I[t],o=n||{},r=o.async||!1,s=o.temporary||!1,l=o.onetime&&u.option("onetimeUrl",t)||!1,c=o.absurl||!1,d=r||l?e.Deferred():null,p=function(e){return e&&c&&(e=u.convAbsUrl(e)),e},h=function(n){if(n)return p(n);if(a.url)return p(a.url);if("undefined"==typeof i&&(i=f()),i)return p(i+e.map(u.path2array(t),function(e){return encodeURIComponent(e)}).slice(1).join("/"));var o=Object.assign({},u.customData,{cmd:"file",target:a.hash});return u.oldAPI&&(o.cmd="open",o.current=a.phash),p(u.options.url+(u.options.url.indexOf("?")===-1?"?":"&")+e.param(o,!0))},f=function(){return u.option("url",!u.isRoot(a)&&a.phash||a.hash)};if(!a||!a.read)return r?d.resolve(""):"";if(!l||a.url&&"1"!=a.url||(i=f()))if("1"==a.url||s&&!a.url&&!(i=f()))this.request({data:{cmd:"url",target:t,options:{temporary:s?1:0}},preventDefault:!0,options:{async:r},notify:r?{type:s?"file":"url",cnt:1,hideCnt:!0}:{},progressBar:o.progressBar}).done(function(e){a.url=e.url||""}).fail(function(){a.url=""}).always(function(){var e;return a.url&&s&&(e=a.url,a.url="1"),r?void d.resolve(h(e)):h(e)});else{if(!r)return h();d.resolve(h())}else r=!0,this.request({data:{cmd:"url",target:t,options:{onetime:1}},preventDefault:!0,options:{async:r},notify:{type:"file",cnt:1,hideCnt:!0},progressBar:o.progressBar}).done(function(e){d.resolve(p(e.url||""))}).fail(function(){d.resolve("")});return r?d:void 0},this.forExternalUrl=function(e,t){var n=u.option("onetimeUrl",e),i={async:!0,absurl:!0};return i[n?"onetime":"temporary"]=!0,u.url(e,Object.assign({},t,i))},this.openUrl=function(t,n,i,a){var o=I[t],r="",s=(a||{}).onetimeSize||5242880;return o&&o.read?n&&"sameorigin"!==n||(o.url?1!=o.url&&(r=o.url):O.url&&0===o.hash.indexOf(u.cwd().volumeid)&&(r=O.url+e.map(this.path2array(t),function(e){return encodeURIComponent(e)}).slice(1).join("/")),n&&!this.isSameOrigin(r)||!r)?i&&this.hasParrotHeaders()?(a?delete a.onetimeSize:a={},!a.onetime&&!a.temporary&&o.size>s&&(o.mime.match(/^video|audio/)?a.temporary=!0:a.onetime=!0),a.onetime||a.temporary?this.url(o.hash,Object.assign({async:!0},a)).done(function(e){i(e)}).fail(function(){i("")}):this.getContents(t,"blob",a).done(function(e){r=(window.URL||window.webkitURL).createObjectURL(e),i(r)}).fail(function(){i("")})):(r=this.options.url,r=r+(r.indexOf("?")===-1?"?":"&")+(this.oldAPI?"cmd=open¤t="+o.phash:"cmd=file")+"&target="+o.hash+"&_t="+(o.ts||parseInt(+new Date/1e3)),n===!0&&(r+="&download=1"),e.each(this.customData,function(e,t){r+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)}),i?void i(r):r):(r+=(r.match(/\?/)?"&":"?")+"_".repeat((r.match(/[\?&](_+)t=/g)||["&t="]).sort().shift().match(/[\?&](_*)t=/)[1].length+1)+"t="+(o.ts||parseInt(+new Date/1e3)),i?void i(r):r):""},this.tmb=function(t){var n,i,a="elfinder-cwd-bgurl",o="",r={},s=0;return!(!e.isPlainObject(t)||(u.searchStatus.state&&0!==t.hash.indexOf(u.cwd().volumeid)?(n=u.option("tmbUrl",t.hash),i=u.option("tmbCrop",t.hash)):(n=O.tmbUrl,i=O.tmbCrop),i&&(a+=" elfinder-cwd-bgurl-crop"),"self"===n&&0===t.mime.indexOf("image/")?(o=u.openUrl(t.hash),a+=" elfinder-cwd-bgself"):(u.oldAPI||n)&&t&&t.tmb&&1!=t.tmb?o=n+t.tmb:u.newAPI&&t&&t.tmb&&1!=t.tmb&&(o=t.tmb),!o))&&("self"!==n&&(t.ts&&(r._t=t.ts),O.tmbReqCustomData&&Object.keys(this.customData).length&&(r=Object.assign(r,this.customData)),Object.keys(r).length&&(o+=o.match(/\?/)?"&":"?",e.each(r,function(e,t){o+=(0===s++?"":"&")+encodeURIComponent(e)+"="+encodeURIComponent(t)}))),{url:o,className:a})},this.selected=function(){return F.slice(0)},this.selectedFiles=function(){return e.map(F,function(e){return I[e]?Object.assign({},I[e]):null})},this.fileByName=function(e,t){var n;for(n in I)if(I.hasOwnProperty(n)&&I[n].phash==t&&I[n].name==e)return I[n]},this.validResponse=function(e,t){return t.error||this.rules[this.rules[e]?e:"defaults"](t)},this.returnBytes=function(e){var t;return isNaN(e)?(e||(e=""),e=e.replace(/b$/i,""),t=e.charAt(e.length-1).toLowerCase(),e=e.replace(/[tgmk]$/i,""),"t"==t?e=1024*e*1024*1024*1024:"g"==t?e=1024*e*1024*1024:"m"==t?e=1024*e*1024:"k"==t&&(e=1024*e),e=isNaN(e)?0:parseInt(e)):(e=parseInt(e),e<1&&(e=0)),e},this.request=function(t){var n,i,a,o,r=this,l=this.options,c=e.Deferred(),d=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),p=Object.assign({},r.customData,{mimes:l.onlyMimes},t.data||t),u=p.cmd,h="binary"===(t.options||{}).dataType,f=!t.asNotOpen&&"open"===u,m=!(h||t.preventDefault||t.preventFail),g=!(h||t.preventDefault||t.preventDone),v=t.progressVal||20,b=null,y=!1,w=t.progressBar?{}:t.notify?Object.assign({progress:v*t.notify.cnt},t.notify):{},x=!!t.cancel,k=h||!!t.raw,C=t.syncOnFail,z=!!t.lazy,T=t.prepare,A=t.navigate,I=(t.options||{}).cache,M=Object.assign({url:l.url,async:!0,type:this.requestType,dataType:"json",cache:r.api>=2.1029,data:p,headers:this.customHeaders,xhrFields:this.xhrFields,progress:function(e){var n=e.loaded/e.total*100;if(b&&clearTimeout(b),t.progressBar)try{t.progressBar.width(n+"%")}catch(e){}else y&&w.type&&(n*=w.cnt,v=500)n=["errResponse","errServerError","HTTP error "+e.status];else{if(414==e.status&&"get"===M.type)return M.type="post",r.abortXHR(e),void(c.xhr=e=r.transport.send(M).fail(n).done(D));n=e.quiet?"":["errConnect","HTTP error "+e.status]}}r.trigger(u+"done"),c.reject({error:n},e,t)},D=function(t){if(r.currentReqCmd=u,t.debug&&r.responseDebug(t),r.setCustomHeaderByXhr(i),k)return r.abortXHR(i),t&&t.debug&&r.debug("backend-debug",t),c.resolve(t);if(!t)return c.reject({error:["errResponse","errDataEmpty"]},i,t);if(!e.isPlainObject(t))return c.reject({error:["errResponse","errDataNotJSON"]},i,t);if(t.error)return f&&e.each(r.leafRoots,function(t,n){r.leafRoots[t]=e.grep(n,function(e){return e!==p.target})}),c.reject({error:t.error},i,t);var n=function(){var n,a=function(n){r.leafRoots[p.target]&&t[n]&&e.each(r.leafRoots[p.target],function(e,i){var a;(a=r.file(i))&&t[n].push(a)})},o=function(){r.textMimes={},e.each(r.res("mimes","text"),function(){r.textMimes[this.toLowerCase()]=!0})};return f?a("files"):"tree"===u&&a("tree"),t=r.normalize(t),r.validResponse(u,t)?(f&&(r.api||(r.api=t.api||1,"2.0"==r.api&&"undefined"!=typeof t.options.uploadMaxSize&&(r.api="2.1"),r.newAPI=r.api>=2,r.oldAPI=!r.newAPI),t.textMimes&&Array.isArray(t.textMimes)&&(r.resources.mimes.text=t.textMimes,o()),!r.textMimes&&o(),t.options&&(O=Object.assign({},S,t.options)),t.netDrivers&&(r.netDrivers=t.netDrivers),t.maxTargets&&(r.maxTargets=t.maxTargets),p.init&&(r.uplMaxSize=r.returnBytes(t.uplMaxSize),r.uplMaxFile=t.uplMaxFile?Math.min(parseInt(t.uplMaxFile),50):20)),"function"==typeof T&&T(t),A&&(n=A.target||"added",t[n]&&t[n].length&&r.one(u+"done",function(){var i=t[n],a=r.findCwdNodes(i),o=function(){var t=r.cwd().hash;return e.map(i,function(e){return e.phash&&t===e.phash?e.hash:null})},s=o(),l=function(t){var n,i,a,l=void 0,c=t.action?t.action.data:void 0;return(c||s.length)&&t.action&&(i=t.action.msg)&&(n=t.action.cmd)&&(!t.action.cwdNot||t.action.cwdNot!==r.cwd().hash)&&(a=t.action.done,c=t.action.data,l=e("").append(e('").on("mouseenter mouseleave",function(t){e(this).toggleClass("ui-state-hover","mouseenter"==t.type)}).on("click",function(){r.exec(n,c||s,{_userAction:!0,_currentType:"toast",_currentNode:e(this)}),a&&r.one(n+"done",function(){"function"==typeof a?a():"select"===a&&r.trigger("selectfiles",{files:o()})})}))),delete t.action,t.extNode=l,t};A.toast||(A.toast={}),!A.noselect&&r.trigger("selectfiles",{files:r.searchStatus.state>1?e.map(i,function(e){return e.hash}):s}),a.length?(A.noscroll||(a.first().trigger("scrolltoview",{blink:!1}),r.resources.blink(a,"lookme")),e.isPlainObject(A.toast.incwd)&&r.toast(l(A.toast.incwd))):e.isPlainObject(A.toast.inbuffer)&&r.toast(l(A.toast.inbuffer))})),c.resolve(t),void(t.debug&&r.debug("backend-debug",t))):c.reject({error:t.norError||"errResponse"},i,t)};r.abortXHR(i),z?r.lazy(n):n()},U=function(e){i&&"pending"===i.state()&&(r.abortXHR(i,{quiet:!0,abort:!0}),(!e||"unload"!==e.type&&"destroy"!==e.type)&&r.autoSync())},P=function(e){if(r.trigger(u+"done"),"autosync"==e.type){if("stop"!=e.data.action)return}else if(!("unload"==e.type||"destroy"==e.type||"openxhrabort"==e.type||e.data.added&&e.data.added.length))return;U(e)},q=function(t){var n=function(){C=!1,c.reject()};if(t&&"cmd"===t)return u;if(f){if(ie&&"pending"===ie.state()){if(ie._target===p.target)return c.reject("openabort");ie.xhr?ie.xhr.queueAbort():ie.reject("openabort")}ie=c,ie._target=p.target}if(c.always(function(){delete M.headers["X-elFinderReqid"],f&&(ie=null)}).fail(function(t,n,i){var a,s;f&&"openabort"===t&&(t="",C=!1),a={cmd:u,err:t,xhr:n,rc:i},0===t&&ne.length&&(ne=e.grep(ne,function(e){return e("cmd")!==u})),r.trigger("requestError",a),a._getEvent&&a._getEvent().isDefaultPrevented()&&(m=!1,C=!1,t&&(t.error="")),U(),f&&(o=r.file(p.target),o&&o.volumeid&&r.isRoot(o)&&delete r.volumeExpires[o.volumeid]),r.trigger(u+"fail",i),s="object"==typeof t?t.error:t,s&&(m?r.error(s):r.debug("error",r.i18n(s))),C&&r.sync()}),!u)return C=!1,c.reject({error:"errCmdReq"});if(r.maxTargets&&p.targets&&p.targets.length>r.maxTargets)return C=!1,c.reject({error:["errMaxTargets",r.maxTargets]});if(g&&c.done(E),f){for(;a=R.pop();)a.queueAbort();if(j!==p.target)for(;a=H.pop();)a.queueAbort()}return e.inArray(u,(r.cmdsToAdd+" autosync").split(" "))!==-1&&("autosync"!==u&&(r.autoSync("stop"),c.always(function(){r.autoSync()})),r.trigger("openxhrabort")),delete M.preventFail,r.api>=2.1029&&(I?M.headers["X-elFinderReqid"]=d:Object.assign(M.data,{reqid:d})),c.syncOnFail=function(e){C=!!e},te++,c.xhr=i=r.transport.send(M).always(function(){M._xhr&&"undefined"!=typeof M._xhr.responseURL&&(i.responseURL=M._xhr.responseURL||""),--te,ne.length&&ne.shift()()}).fail(F).done(D),r.api>=2.1029&&(i._requestId=d),f||p.compare&&"info"===u?(i.queueAbort=n,R.unshift(i),p.compare&&r.bind(r.cmdsToAdd+" autosync openxhrabort",P),c.always(function(){var t=e.inArray(i,R);p.compare&&r.unbind(r.cmdsToAdd+" autosync openxhrabort",P),t!==-1&&R.splice(t,1)})):e.inArray(u,r.abortCmdsOnOpen)!==-1&&(i.queueAbort=n,H.unshift(i),c.always(function(){var t=e.inArray(i,H);t!==-1&&H.splice(t,1)})),r.bind("unload destroy",P),c.always(function(){r.unbind("unload destroy",P)}),c},_=function(){return w.type&&w.cnt&&(x&&(w.cancel=c,t.eachCancel&&(w.id=+new Date)),n=setTimeout(function(){b=setTimeout(N,1e3),r.notify(w),y=!0,c.always(function(){w.cnt=-(parseInt(w.cnt)||0),r.notify(w),y=!1})},r.notifyDelay),c.always(function(){clearTimeout(n)})),te=2&&(j!==this.root()&&l.push(this.request({
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;o0?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("").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('').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",a()),W.data("fitToBaseFunc")||W.data("fitToBaseFunc",function(e){var t=W.data("resizeTm");e.preventDefault(),e.stopPropagation(),t&&cancelAnimationFrame(t),m.hasClass("elfinder-fullscreen")||u.UA.Mobile&&W.data("rotated")===u.UA.Rotated||(W.data("rotated",u.UA.Rotated),W.data("resizeTm",requestAnimationFrame(function(){u.restoreSize()})))}),"undefined"==typeof W.data("rotated")&&W.data("rotated",u.UA.Rotated),n=W.height()*(i[1]/100)-W.data("marginToMyNode"),W.off("resize."+u.namespace,W.data("fitToBaseFunc")),o&&W.on("resize."+u.namespace,W.data("fitToBaseFunc"))),m.css({width:t,height:parseInt(n)})),s.w=Math.round(m.width()),s.h=Math.round(m.height()),m.data("resizeSize",s),s.w===r.w&&s.h===r.h||(m.trigger("resize"),this.trigger("resize",{width:s.w,height:s.h}))},this.restoreSize=function(){this.resize(N,L)},this.show=function(){m.show(),this.enable().trigger("show")},this.hide=function(){this.options.enableAlways&&(T=z,z=!1),this.disable(),this.trigger("hide"),m.hide()},this.lazy=function(t,n,i){var a=function(e){var t,n=m.data("lazycnt");e?(t=!m.data("lazyrepaint")&&i.repaint,n?m.data("lazycnt",++n):m.data("lazycnt",1).addClass("elfinder-processing"),t&&m.data("lazyrepaint",!0).css("display")):n&&n>1?m.data("lazycnt",--n):(t=m.data("lazyrepaint"),m.data("lazycnt",0).removeData("lazyrepaint").removeClass("elfinder-processing"),t&&m.css("display"),u.trigger("lazydone"))},o=e.Deferred(),r=function(){o.resolve(t.call(o)),a(!1)};return n=n||0,i=i||{},a(!0),n?setTimeout(r,n):requestAnimationFrame(r),o},this.destroy=function(){m&&m[0].elfinder&&(m.hasClass("elfinder-fullscreen")&&u.toggleFullscreen(m),this.options.syncStart=!1,this.autoSync("forcestop"),this.trigger("destroy").disable(),P=[],F=[],D={},U={},e(window).off("."+y),e(document).off("."+y),u.trigger=function(){},e(K).remove(),m.off().removeData().empty().append(v.contents()).attr("class",v.attr("class")).attr("style",v.attr("style")),delete m[0].elfinder,e.each(g,function(t,n){e.each(n,function(e,t){m.on(t.type+(t.namespace?"."+t.namespace:""),t.selector,t.handler)})}))},this.autoSync=function(t){var n;if(u.options.sync>=1e3){if(r&&(clearTimeout(r),r=null,u.trigger("autosync",{action:"stop"})),"stop"===t?++X:X=Math.max(0,--X),X||"forcestop"===t||!u.options.syncStart)return;n=function(t){var i;O.syncMinMs&&(t||r)&&(t&&u.trigger("autosync",{action:"start"}),i=Math.max(u.options.sync,O.syncMinMs),r&&clearTimeout(r),r=setTimeout(function(){var t,a=!0,o=j;O.syncChkAsTs&&I[o]&&(t=I[o].ts)?u.request({data:{cmd:"info",targets:[o],compare:t,reload:1},preventDefault:!0}).done(function(e){var i;a=!0,e.compare&&(i=e.compare,i==t&&(a=!1)),a?u.sync(o).always(function(){i&&(I[o].ts=i),n()}):n()}).fail(function(t,a){var o=u.parseError(t);o&&0!=a.status?(u.error(o),Array.isArray(o)&&e.inArray("errOpen",o)!==-1&&u.request({data:{cmd:"open",target:u.lastDir("")||u.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}})):r=setTimeout(function(){n()},i)}):u.sync(j,!0).always(function(){n()})},i))},n(!0)}},this.insideWorkzone=function(e,t,n){var i=this.getUI("workzone").data("rectangle");return n=n||1,!(ei.left+i.width+n||ti.top+i.height+n)},this.toFront=function(t){var n=m.children(".ui-front").removeClass("elfinder-frontmost"),i=n.last();n.css("z-index",""),e(t).addClass("ui-front elfinder-frontmost").css("z-index",i.css("z-index")+1)},this.toHide=function(t,n){var i,a=e(t);!n&&a.hide(),a.hasClass("elfinder-frontmost")&&(a.removeClass("elfinder-frontmost"),i=m.children(".ui-front:visible:not(.elfinder-frontmost)").last(),i.length&&requestAnimationFrame(function(){m.children(".elfinder-frontmost:visible").length||(u.toFront(i),i.trigger("frontmost"))}))},this.getMaximizeCss=function(){return{width:"100%",height:"100%",margin:0,top:0,left:0,display:"block",position:"fixed",zIndex:Math.max(u.zIndex?u.zIndex+1:0,1e3),maxWidth:"",maxHeight:""}},function(){re&&u.UA.Fullscreen&&(u.UA.Fullscreen=!1,se&&"undefined"!=typeof se.attr("allowfullscreen")&&(u.UA.Fullscreen=!0));var t,n,i,a,o="elfinder-fullscreen",r="elfinder-fullscreen-native",s=function(){var t=0,n=0;e.each(m.children(".ui-dialog,.ui-draggable"),function(i,a){var o=e(a),r=o.position();r.top<0&&(o.css("top",t),t+=20),r.left<0&&(o.css("left",n),n+=20)})},l=function(){var i=u.storage("useFullscreen");a=u.UA.Fullscreen&&(i?i>0:"screen"===u.options.commandsOptions.fullscreen.mode)?{fullElm:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||null},exitFull:function(){return document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():void 0},toFull:function(e){return e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():!!e.msRequestFullscreen&&e.msRequestFullscreen()}}:{fullElm:function(){var e;return m.hasClass(o)?m.get(0):(e=m.find("."+o),e.length?e.get(0):null)},exitFull:function(){var i;e(window).off("resize."+y,d),void 0!==n&&e("body").css("overflow",n),n=void 0,t&&(i=t.elm,c(i),e(i).trigger("resize",{fullscreen:"off"})),e(window).trigger("resize")},toFull:function(t){return n=e("body").css("overflow")||"",e("body").css("overflow","hidden"),e(t).css(u.getMaximizeCss()).addClass(o).trigger("resize",{fullscreen:"on"}),s(),e(window).on("resize."+y,d).trigger("resize"),!0}}},c=function(n){t&&t.elm==n&&(e(n).removeClass(o+" "+r).attr("style",t.style),t=null)},d=function(t){var n;t.target===window&&(i&&cancelAnimationFrame(i),i=requestAnimationFrame(function(){(n=a.fullElm())&&e(n).trigger("resize",{fullscreen:"on"})}))};l(),e(document).on("fullscreenchange."+y+" webkitfullscreenchange."+y+" mozfullscreenchange."+y+" MSFullscreenChange."+y,function(n){if(u.UA.Fullscreen){var l=a.fullElm(),p=e(window);i&&cancelAnimationFrame(i),null===l?(p.off("resize."+y,d),t&&(l=t.elm,c(l),e(l).trigger("resize",{fullscreen:"off"}))):(e(l).addClass(o+" "+r).attr("style","width:100%; height:100%; margin:0; padding:0;").trigger("resize",{fullscreen:"on"}),p.on("resize."+y,d),s()),p.trigger("resize")}}),u.toggleFullscreen=function(n,i){var o=e(n).get(0),r=null;if(r=a.fullElm()){if(r==o){if(i===!0)return r}else if(i===!1)return r;return a.exitFull(),null}return i===!1?null:(l(),t={elm:o,style:e(o).attr("style")},a.toFull(o)!==!1?o:(t=null,null))}}(),function(){var t,n="elfinder-maximized",i=function(e){if(e.target===window&&e.data&&e.data.elm){var n=e.data.elm;t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){n.trigger("resize",{maximize:"on"})})}},a=function(t){e(window).off("resize."+y,i),e("body").css("overflow",t.data("bodyOvf")),t.removeClass(n).attr("style",t.data("orgStyle")).removeData("bodyOvf").removeData("orgStyle"),t.trigger("resize",{maximize:"off"})},o=function(t){t.data("bodyOvf",e("body").css("overflow")||"").data("orgStyle",t.attr("style")).addClass(n).css(u.getMaximizeCss()),e("body").css("overflow","hidden"),e(window).on("resize."+y,{elm:t},i),t.trigger("resize",{maximize:"on"})};u.toggleMaximize=function(t,i){var r=e(t),s=r.hasClass(n);if(s){if(i===!0)return;a(r)}else{if(i===!1)return;o(r)}}}(),Object.assign(e.ui.keyCode,{F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,DIG0:48,DIG1:49,DIG2:50,DIG3:51,DIG4:52,DIG5:53,DIG6:54,DIG7:55,DIG8:56,DIG9:57,NUM0:96,NUM1:97,NUM2:98,NUM3:99,NUM4:100,NUM5:101,NUM6:102,NUM7:103,NUM8:104,NUM9:105,CONTEXTMENU:93,DOT:190}),this.dragUpload=!1,this.xhrUpload=("undefined"!=typeof XMLHttpRequestUpload||"undefined"!=typeof XMLHttpRequestEventTarget)&&"undefined"!=typeof File&&"undefined"!=typeof FormData,this.transport={},"object"==typeof this.options.transport&&(this.transport=this.options.transport,"function"==typeof this.transport.init&&this.transport.init(this)),"function"!=typeof this.transport.send&&(this.transport.send=function(t){return u.UA.IE||(t._xhr=new XMLHttpRequest,t.xhr=function(){return t.progress&&t._xhr.addEventListener("progress",t.progress),t._xhr}),e.ajax(t)}),"iframe"==this.transport.upload?this.transport.upload=e.proxy(this.uploads.iframe,this):"function"==typeof this.transport.upload?this.dragUpload=!!this.options.dragUploadAllow:this.xhrUpload&&this.options.dragUploadAllow?(this.transport.upload=e.proxy(this.uploads.xhr,this),this.dragUpload=!0):this.transport.upload=e.proxy(this.uploads.iframe,this),this.decodeRawString=function(e){var t=function(e){var t,n,i;for(t=0,n=e.length,i=[];t=55296&&a<=56319?o.push((1023&a)+64<<10|1023&e[++n]):o.push(a);return o},i=function(e){var t,n,i,a,o=String.fromCharCode;for(t=0,n=e.length,a="";i=e[t],t=194?o((31&i)<<6|63&e[++t]):i<=239&&i>=224?o((15&i)<<12|(63&e[++t])<<6|63&e[++t]):i<=247&&i>=240?o(55296|((7&i)<<8|(63&e[++t])<<2|e[++t]>>>4&3)-64,56320|(15&e[t++])<<6|63&e[t]):o(65533);return a};return i(n(e))},this.getContents=function(t,n,i){var a,o,r=this,s=e.Deferred(),l=n||"arraybuffer";return s.fail(function(){o&&"pending"===o.state()&&o.reject()}),a=r.openUrl(t),r.isSameOrigin(a)||(a=r.openUrl(t,!0)),o=r.request(Object.assign({data:{cmd:"get"},options:{url:a,type:"get",cache:!0,dataType:"binary",responseType:l,processData:!1},notify:{type:"file",cnt:1,hideCnt:!0},cancel:!0},i||{})).fail(function(){s.reject()}).done(function(e){s.resolve(e)}),s},this.getBinaryByUrl=function(t,n,i){var a,o=this,r=e.Deferred();return r.fail(function(){a&&"pending"===a.state()&&a.reject()}),a=o.request(Object.assign({data:{cmd:"get"},options:Object.assign({type:"get",cache:!0,dataType:"binary",responseType:"blob",processData:!1},t)},i||{})).fail(function(){r.reject()}).done(function(e){n&&n(e),r.resolve(e)}),r},this.getMimetype=function(e,t){var n,i,a=t;return i=(e+"").match(/\.([^.]+)$/),i&&(n=i[1])&&(o||(o=u.arrayFlip(u.mimeTypes)),(a=o[n.toLowerCase()])||(a=t)),a},u.hashCheckers=[],function(t){var n={};window.Worker&&window.ArrayBuffer&&(t.options.cdns.sparkmd5&&(n.SparkMD5=!0,t.hashCheckers.push("md5")),t.options.cdns.jssha&&(n.jsSHA=!0,t.hashCheckers=t.hashCheckers.concat(["sha1","sha224","sha256","sha384","sha512","sha3-224","sha3-256","sha3-384","sha3-512","shake128","shake256"]))),t.getContentsHashes=function(i,a,o,r){var s,l=e.Deferred(),c=t.arrayFlip(a||["md5"],!0),d=[],p={},u=o?o:{shake128len:256,shake256len:512};return l.fail(function(){s&&s.reject()}),Object.keys(n).length?s=t.getContents(i,"arraybuffer",r).done(function(a){c.md5&&n.SparkMD5&&d.push(function(){var o=e.Deferred();try{var r=t.getWorker();o.fail(function(){r&&r.terminate()}),r.onmessage=function(e){if(r&&r.terminate(),e.data.hash){var n;p.md5=e.data.hash,(n=t.file(i))&&(n.md5=p.md5)}else e.data.error&&(p.md5=e.data.error);l.notify(p),o.resolve()},r.onerror=function(e){o.reject()},r.postMessage({scripts:[t.options.cdns.sparkmd5,t.getWorkerUrl("calcfilehash.js")],data:{type:"md5",bin:a}}),l.fail(function(){o.reject()})}catch(s){o.reject(),delete n.SparkMD5}return o}()),n.jsSHA&&e.each(["1","224","256","384","512","3-224","3-256","3-384","3-512","ke128","ke256"],function(o,r){c["sha"+r]&&d.push(function(){var o=e.Deferred();try{var s=t.getWorker();o.fail(function(){s&&s.terminate()}),s.onmessage=function(e){if(s&&s.terminate(),e.data.hash){var n;p["sha"+r]=e.data.hash,(n=t.file(i))&&(n["sha"+r]=p["sha"+r])}else e.data.error&&(p["sha"+r]=e.data.error);l.notify(p),o.resolve()},s.onerror=function(e){o.reject()},s.postMessage({scripts:[t.options.cdns.jssha,t.getWorkerUrl("calcfilehash.js")],data:{type:r,bin:a,hashOpts:u}}),l.fail(function(){o.reject()})}catch(c){o.reject(),delete n.jsSHA}return o}())}),d.length?e.when.apply(null,d).always(function(){l.resolve(p)}):l.reject()}).fail(function(){l.reject()}):l.reject(),l}}(this),this.parseError=function(t){var n=t;return e.isPlainObject(n)&&(n=n.error),n},this.error=function(){var e,t=arguments[0],n=arguments[1]||null;return 1==arguments.length&&"function"==typeof t?u.bind("error",t):(e=this.parseError(t),e!==!0&&e?u.trigger("error",{error:e,opts:n}):this)},e.each(A,function(t,n){u[n]=function(){var t=arguments[0];return 1==arguments.length&&"function"==typeof t?u.bind(n,t):u.trigger(n,e.isPlainObject(t)?t:{})}}),this.enable(function(){!z&&u.api&&u.visible()&&u.ui.overlay.is(":hidden")&&!m.children(".elfinder-dialog."+u.res("class","editing")+":visible").length&&(z=!0,document.activeElement&&document.activeElement.blur(),m.removeClass("elfinder-disabled"))}).disable(function(){T=z,z=!1,m.addClass("elfinder-disabled")}).open(function(){F=[]}).select(function(t){var n=0,i=[];F=e.grep(t.data.selected||t.data.value||[],function(e){return i.length||u.maxTargets&&++n>u.maxTargets?(i.push(e),!1):!!I[e]}),i.length&&(u.trigger("unselectfiles",{files:i,inselect:!0}),u.toast({mode:"warning",msg:u.i18n(["errMaxTargets",u.maxTargets])}))}).error(function(t){var n,i,a={cssClass:"elfinder-dialog-error",title:u.i18n("error"),resizable:!1,destroyOnClose:!0,buttons:{}},o=u.getUI(),r=o.children(".elfinder-dialog-error").length;r'+u.i18n(t.data.error),a)):(n=o.children(".elfinder-dialog-error:last").children(".ui-dialog-content:first"),i=n.children(".elfinder-error-counter"),i.length?i.data("cnt",parseInt(i.data("cnt"))+1).html(u.i18n(["moreErrors",i.data("cnt")])):(i=e(''+u.i18n(["moreErrors",1])+"").data("cnt",1),n.append("
",i)))}).bind("tmb",function(t){e.each(t.data.images||[],function(e,t){I[e]&&(I[e].tmb=t)})}).bind("searchstart",function(e){Object.assign(u.searchStatus,e.data),u.searchStatus.state=1}).bind("search",function(e){u.searchStatus.state=2}).bind("searchend",function(){u.searchStatus.state=0,u.searchStatus.ininc=!1,u.searchStatus.mixed=!1}).bind("canMakeEmptyFile",function(t){var n=t.data,i={};n&&Array.isArray(n.mimes)&&(n.unshift||(i=u.mimesCanMakeEmpty),e.each(n.mimes,function(){i[this]||(i[this]=u.mimeTypes[this])}),n.unshift&&(u.mimesCanMakeEmpty=Object.assign(i,u.mimesCanMakeEmpty)))}).bind("themechange",function(){requestAnimationFrame(function(){u.trigger("uiresize")})}),!0===this.options.sound&&this.bind("playsound",function(t){var n=K.canPlayType&&K.canPlayType('audio/wav; codecs="1"'),i=t.data&&t.data.soundFile;n&&i&&""!=n&&"no"!=n&&e(K).html('