EasyImages2.0/public/static/zui/lib/uploader/zui.uploader.min.js

23 lines
147 KiB
JavaScript
Raw Normal View History

/*!
* ZUI: 文件上传 - v1.8.1 - 2018-04-08
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2018 cnezsoft.com; Licensed MIT
*/
/*!
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.5.2
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2016-11-23
*/
!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r<e.length;++r){if(i=a[e[r]]||o(e[r]),!i)throw"module definition dependecy not found: "+e[r];n.push(i)}t.apply(null,n)}function n(e,n,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(n===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";i(n,function(){a[e]=r.apply(null,arguments)})}function r(e){return!!a[e]}function o(t){for(var i=e,n=t.split(/[.\/]/),r=0;r<n.length;++r){if(!i[n[r]])return;i=i[n[r]]}return i}function s(i){for(var n=0;n<i.length;n++){for(var r=e,o=i[n],s=o.split(/[.\/]/),l=0;l<s.length-1;++l)r[s[l]]===t&&(r[s[l]]={}),r=r[s[l]];r[s[s.length-1]]=a[o]}}var a={};n("moxie/core/utils/Basic",[],function(){function e(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()}function t(){return s(!1,!1,arguments)}function i(){return s(!0,!1,arguments)}function n(){return s(!1,!0,arguments)}function r(){return s(!0,!0,arguments)}function o(i){switch(e(i)){case"array":return Array.prototype.slice.call(i);case"object":return t({},i)}return i}function s(t,i,n){var r,a=n[0];return l(n,function(n,u){u>0&&l(n,function(n,l){var u=-1!==p(e(n),["array","object"]);return!!(n===r||t&&a[l]===r)||(u&&i&&(n=o(n)),void(e(a[l])===e(n)&&u?s(t,i,[a[l],n]):a[l]=n))})}),a}function a(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__parent__=t.prototype,e}function l(e,t){var i,n,r,o;if(e){try{i=e.length}catch(s){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function u(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function c(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?n(r):i(e)})}var r=0,o=t.length;"function"!==e(i)&&(i=function(){}),t&&t.length||i(),n(r)}function d(e,t){var i=0,n=e.length,r=new Array(n);l(e,function(e,o){e(function(e){if(e)return t(e);var s=[].slice.call(arguments);s.shift(),r[o]=s,i++,i===n&&(r.unshift(null),t.apply(this,r))})})}function p(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i}return-1}function f(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===p(t[r],i)&&n.push(t[r]);return!!n.length&&n}function m(e,t){var i=[];return l(e,function(e){-1!==p(e,t)&&i.push(e)}),i.length?i:null}function h(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i}function g(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e}function v(e){if("string"!=typeof e)return e;var t,i={t:1099511627776,g:1073741824,m:1048576,k:1024};return e=/^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g,"")),t=e[2],e=+e[1],i.hasOwnProperty(t)&&(e*=i[t]),Math.floor(e)}function x(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e(t)?t:""})}function y(e,t){var i=this;setTimeout(function(){e.call(i)},t||1)}var E=function(){var e=0;return function(t){var i,n=(new Date).getTime().toString(32);for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:E,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,inherit:a,each:l,isEmptyObj:u,inSeries:c,inParallel:d,inArray:p,arrayDiff:f,arrayIntersect:m,toArray:h,trim:g,sprintf:x,parseSizeStr:v,delay:y}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(e
function n(e,n){if(this.trigger("loadstart"),this.readyState===s.LOADING)return this.trigger("error",new i.DOMException(i.DOMException.INVALID_STATE_ERR)),void this.trigger("loadend");if(!(n instanceof r))return this.trigger("error",new i.DOMException(i.DOMException.NOT_FOUND_ERR)),void this.trigger("loadend");if(this.result=null,this.readyState=s.LOADING,n.isDetached()){var o=n.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=o;break;case"readAsDataURL":this.result="data:"+n.type+";base64,"+t.btoa(o)}this.readyState=s.DONE,this.trigger("load"),this.trigger("loadend")}else this.connectRuntime(n.ruid),this.exec("FileReader","read",e,n)}o.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:s.EMPTY,result:null,error:null,readAsBinaryString:function(e){n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){n.call(this,"readAsDataURL",e)},readAsText:function(e){n.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[s.EMPTY,s.DONE])&&(this.readyState===s.LOADING&&(this.readyState=s.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),this.exec("FileReader","destroy"),this.disconnectRuntime(),this.unbindAll()}}),this.handleEventProps(a),this.bind("Error",function(e,t){this.readyState=s.DONE,this.error=t},999),this.bind("Load",function(){this.readyState=s.DONE},999)}var a=["loadstart","progress","load","abort","error","loadend"];return s.EMPTY=0,s.LOADING=1,s.DONE=2,s.prototype=n.instance,s}),n("moxie/core/utils/Url",[],function(){var e=function(t,i){for(var n=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r=n.length,o={http:80,https:443},s={},a=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,l=a.exec(t||"");r--;)l[r]&&(s[n[r]]=l[r]);if(!s.scheme){i&&"string"!=typeof i||(i=e(i||document.location.href)),s.scheme=i.scheme,s.host=i.host,s.port=i.port;var u="";/^[^\/]/.test(s.path)&&(u=i.path,u=/\/[^\/]*\.[^\/]*$/.test(u)?u.replace(/\/[^\/]+$/,"/"):u.replace(/\/?$/,"/")),s.path=u+(s.path||"")}return s.port||(s.port=o[s.scheme]||80),s.port=parseInt(s.port,10),s.path||(s.path="/"),delete s.source,s},t=function(t){var i={http:80,https:443},n="object"==typeof t?t:e(t);return n.scheme+"://"+n.host+(n.port!==i[n.scheme]?":"+n.port:"")+n.path+(n.query?n.query:"")},i=function(t){function i(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),i(e())===i(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:i}}),n("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i){function n(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return n.prototype=i.instance,n}),n("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(e,t,i){return function(){function n(e,t){if(!t.isDetached()){var n=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),n}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+i.btoa(r);case"readAsText":for(var o="",s=0,a=r.length;a>s;s++)o+=String.fromCharCode(r[s]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var s=this,a=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===a?(r+="[]",t.each(o,function(e){s.append(r,e)})):"object"===a?t.each(o,function(e,t){s.append(r+"["+t+"]",e)}):"null"===a||"u
if(f=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),p=u(),p.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(h=!0),r=r.getSource();else if(r instanceof s){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(a,r),h=!0;else if((c||m)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return void e.call(a,i,r);if(r instanceof s){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}p.upload?(i.withCredentials&&(p.withCredentials=!0),p.addEventListener("load",function(e){a.trigger(e)}),p.addEventListener("error",function(e){a.trigger(e)}),p.addEventListener("progress",function(e){a.trigger(e)}),p.upload.addEventListener("progress",function(e){a.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):p.onreadystatechange=function(){switch(p.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=p.getResponseHeader("Content-Length")||0),p.responseText&&(t=p.responseText.length)}catch(r){e=t=0}a.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:p.onreadystatechange=function(){},0===p.status?a.trigger("error"):a.trigger("load")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){p.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in p&&(p.responseType="json"!==i.responseType||l.can("return_response_type","json")?i.responseType:"text"),h?p.sendAsBinary?p.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);p.send(e.buffer)}():p.send(r),a.trigger("loadstart")},getStatus:function(){try{if(p)return p.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var n=new r(t.uid,p.response),o=p.getResponseHeader("Content-Disposition");if(o){var s=o.match(/filename=([\'\"'])([^\1]+)\1/);s&&(f=s[2])}return n.name=f,n.type||(n.type=i.getFileMime(f)),n;case"json":return l.can("return_response_type","json")?p.response:200===p.status&&window.JSON?JSON.parse(p.responseText):null;case"document":return c(p);default:return""!==p.responseText?p.responseText:null}}catch(a){return null}},getAllResponseHeaders:function(){try{return p.getAllResponseHeaders()}catch(e){}return""},abort:function(){p&&p.abort()},destroy:function(){m=f=null}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(e){function t(e){e instanceof ArrayBuffer?i.apply(this,arguments):n.apply(this,arguments)}function i(t){var i=new DataView(t);e.extend(this,{readByteAt:function(e){return i.getUint8(e)},writeByteAt:function(e,t){i.setUint8(e,t)},SEGMENT:function(e,n,r){switch(arguments.length){case 2:return t.slice(e,e+n);case 1:return t.slice(e);case 3:if(null===r&&(r=new ArrayBuffer),r instanceof ArrayBuffer){var o=new Uint8Array(this.length()-n+r.byteLength);e>0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<<Math.abs(n+8*r);return i},write:function(e,t,i){var n,r;if(e>this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:functi
}),n("moxie/runtime/silverlight/file/FileReaderSync",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReaderSync"],function(e,t,i){return e.FileReaderSync=t.extend({},i)}),n("moxie/runtime/silverlight/runtime/Transporter",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/runtime/Transporter"],function(e,t,i){return e.Transporter=t.extend({},i)}),n("moxie/runtime/silverlight/xhr/XMLHttpRequest",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/xhr/XMLHttpRequest","moxie/runtime/silverlight/file/FileReaderSync","moxie/runtime/silverlight/runtime/Transporter"],function(e,t,i){return e.XMLHttpRequest=t.extend({},i)}),n("moxie/runtime/silverlight/image/Image",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/runtime/flash/image/Image"],function(e,t,i,n){return e.Image=t.extend({},n,{getInfo:function(){var e=this.getRuntime(),n=["tiff","exif","gps","thumb"],r={meta:{}},o=e.shimExec.call(this,"Image","getInfo");return o.meta&&(t.each(n,function(e){var t,i,n,s,a=o.meta[e];if(a&&a.keys)for(r.meta[e]={},i=0,n=a.keys.length;n>i;i++)t=a.keys[i],s=a[t],s&&(/^(\d|[1-9]\d+)$/.test(s)?s=parseInt(s,10):/^\d*\.\d+$/.test(s)&&(s=parseFloat(s)),r.meta[e][t]=s)}),!r.meta||!r.meta.thumb||r.meta.thumb.data instanceof i||(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,l=i.capTest,u=i.capTrue;i.call(this,t,s,{access_binary:l(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:l((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:l(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return a.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return!("json"!==t||!window.JSON)||!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari"]))},upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),a)}var s="html4",a={};return i.addConstructor(s,o),a}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,s){function a(){function e(){var o,u,d,p,f,m,h=this,g=h.getRuntime();m=i.guid("uid_"),o=g.getShimContainer(),a&&(d=n.get(a+"_form"),d&&i.extend(d.style,{top:"100%"})),p=document.createElement("form"),p.setAttribute("id",m+"_form"),p.setAttribute("method","post"),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),i.extend(p.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"
2019-05-23 15:12:06 +00:00
if(!t.hasClass("file-renaming")){var n=u.plupload.getFile(t.data("id"))||t.data("file"),o=l.renameActionOnDone,a=n.status===i.DONE&&e.isFunction(o);if(a||n.status===i.QUEUED){var c=t.find(".file-name").first();t.addClass("file-renaming"),u.showFile(n),!l.renameExtension&&n.ext&&c.text(n.name.substr(0,n.name.length-n.ext.length-1)),c.attr("contenteditable","true").one("blur",function(){var i=e.trim(c.text()),d=function(){if(i!==r&&null!==i&&""!==i){var e=n.ext;e.length&&!l.renameExtension&&i.lastIndexOf("."+e)!==i.length-e.length-1&&(i+="."+e),n.name=i}u.showFile(n)};if(a){var p=o.call(u,n,i,d);p===!0?d():p===!1&&u.showFile(n)}else d();t.removeClass("file-renaming"),c.off("keydown."+s).attr("contenteditable",null)}).on("keydown."+s,function(e){13===e.keyCode&&(c.blur(),e.preventDefault())}).focus()}}})),p.toggleClass("file-show-delete-action-on-done",!!l.deleteActionOnDone),u.staticFilesSize=0,u.staticFilesCount=0,l.staticFiles&&e.each(l.staticFiles,function(t,n){n=e.extend({status:i.DONE},n),n["static"]=!0,n.id||(n.id=e.zui.uuid()),u.showFile(n),n.size&&(u.staticFilesSize+=n.size,u.staticFilesCount++)}),u.callEvent("onInit")};d.DEFAULTS=l,d.prototype.showMessage=function(e,t,i){var n=this,o=n.$message;e?clearTimeout(n.lastDismissMessage):n.hideMessage(),t=t||"danger",i===r&&(i="danger"===t?8:5),i<20&&(i*=1e3);var s=o.find(".content");s.length?s.empty().append(e):o.empty().append(e),o.attr("data-type",t).slideDown("fast"),i&&(n.lastDismissMessage=setTimeout(function(){n.hideMessage()},i))},d.prototype.hideMessage=function(){clearTimeout(this.lastDismissMessage),this.$message.slideUp("fast")},d.prototype.start=function(){return this.plupload.start()},d.prototype.stop=function(){return this.plupload.stop()},d.prototype.getState=function(){return this.plupload.state},d.prototype.isStarted=function(){return this.getState()===i.STARTED},d.prototype.isStopped=function(){return this.getState()===i.STOPPED},d.prototype.getFiles=function(){return this.plupload.files},d.prototype.getTotal=function(){return this.plupload.total},d.prototype.disableBrowse=function(e){return this.$.find(".uploader-btn-browse").attr("disable",e?"disable":null).toggle("disable",!!e),this.plupload.disableBrowse()},d.prototype.getFile=function(e){return this.plupload.getFile(e)},d.prototype.destroy=function(){var t=this,i="."+s;t.$.off(i).data(s,null),t.$list.off(i),t.$dropElement.off(i),e("body").off(i),t.plupload.destroy()},d.prototype.previewImageSrc=function(t,i){if(t&&t.getSource&&/image\//.test(t.type)){var r=e.extend({width:200,height:200},this.options.previewImageSize);if("image/gif"==t.type){var o=new n.file.FileReader;o.onload=function(){i(o.result),o.destroy(),o=null},o.readAsDataURL(t.getSource())}else{var s=new n.image.Image;s.onload=function(){s.downsize(r.width,r.height);var e="image/jpeg"==s.type?s.getAsDataURL("image/jpeg",80):s.getAsDataURL();i(e),s.destroy(),s=null},s.load(t.getSource())}}},d.prototype.createFileIcon=function(e){var t=e.type,i=e.ext,n="file-o",r=t?t.split("/"):null,o=r&&r.length?r[0]:"",s=(r&&r.length)>1?r[1]:"";return"image"==o?n="file-image":"doc"==i||"docx"==i||"pages"==i?n="file-word":"ppt"==i||"pptx"==i||"key"==i?n="file-powerpoint":"xls"==i||"xlsx"==i||"numbers"==i?n="file-excel":"html"==i||"htm"==i?n="globe":"js"==i||"php"==i||"cs"==i||"jsx"==i||"css"==i||"less"==i||"json"==i||"java"==i||"lua"==i||"py"==i||"c"==i||"cpp"==i||"swift"==i||"h"==i||"sh"==i||"rb"==i||"yml"==i||"ini"==i||"sql"==i||"xml"==i?n="file-code":"apk"==i?n="android":"exe"==i?n="windows":"pkg"==i||"msi"==i||"dmg"==i?n="cube":"epub"==i?n="book":"sketch"==i?n="diamond":"zip"==s||"x-rar"==s||"x-7z-compressed"==s?n="file-archive":"pdf"==s?n="file-pdf":"video"==o?n="file-movie":"audio"==o?n="file-audio":"text"==o&&(n="file-text-o"),'<i class="icon icon-'+n+" file-icon-"+i+'" data-type="'+t+'"'+(i?' data-ext="'+i+'"':"")+"></i>"},d.prototype.getFileItem=function(t){var i=this;if("string"==typeof t&&(t=i.plupload.getFile(t)),!t)return null;var n=t.name;if(n&&t.ext===r){var o=n.lastIndexOf(".");o=o>-1?n.substr(o+1):"",t.ext=o,t.type&&/image\//.test(t.typ