From b2526e4c88fe7b14540bb4f0efd52c1e86be82a4 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Sun, 19 Sep 2021 18:27:33 +0530 Subject: [PATCH] Updates to release v5.2.5 fix #1755 --- CHANGE.md | 7 +++++++ README.md | 14 +++++++------- bower.json | 2 +- css/fileinput-rtl.css | 2 +- css/fileinput-rtl.min.css | 2 +- css/fileinput.css | 2 +- css/fileinput.min.css | 2 +- examples/index-bs3.html | 2 +- examples/index-bs4.html | 2 +- examples/index-bs5.html | 2 +- js/fileinput.js | 10 +++++----- js/fileinput.min.js | 12 ++++++------ js/locales/LANG.js | 8 ++++---- js/locales/ar.js | 8 ++++---- js/locales/az.js | 8 ++++---- js/locales/bg.js | 8 ++++---- js/locales/ca.js | 8 ++++---- js/locales/cr.js | 8 ++++---- js/locales/cs.js | 8 ++++---- js/locales/de.js | 8 ++++---- js/locales/el.js | 8 ++++---- js/locales/es.js | 8 ++++---- js/locales/et.js | 8 ++++---- js/locales/fa.js | 8 ++++---- js/locales/fi.js | 8 ++++---- js/locales/fr.js | 8 ++++---- js/locales/gl.js | 8 ++++---- js/locales/he.js | 8 ++++---- js/locales/hu.js | 8 ++++---- js/locales/id.js | 8 ++++---- js/locales/it.js | 8 ++++---- js/locales/ja.js | 8 ++++---- js/locales/ka.js | 8 ++++---- js/locales/kr.js | 8 ++++---- js/locales/kz.js | 8 ++++---- js/locales/lt.js | 8 ++++---- js/locales/lv.js | 8 ++++---- js/locales/nl.js | 8 ++++---- js/locales/no.js | 8 ++++---- js/locales/pl.js | 8 ++++---- js/locales/pt-BR.js | 8 ++++---- js/locales/pt.js | 8 ++++---- js/locales/ro.js | 8 ++++---- js/locales/ru.js | 8 ++++---- js/locales/sk.js | 8 ++++---- js/locales/sl.js | 8 ++++---- js/locales/sr-latn.js | 8 ++++---- js/locales/sv.js | 8 ++++---- js/locales/th.js | 8 ++++---- js/locales/tr.js | 8 ++++---- js/locales/uk.js | 8 ++++---- js/locales/uz-cyrl.js | 8 ++++---- js/locales/uz.js | 8 ++++---- js/locales/vi.js | 8 ++++---- js/locales/zh-TW.js | 8 ++++---- js/locales/zh.js | 8 ++++---- nuget/Package.nuspec | 2 +- package.json | 2 +- scss/fileinput-rtl.scss | 2 +- scss/fileinput.scss | 2 +- scss/themes/explorer-fa/theme.scss | 2 +- scss/themes/explorer-fas/theme.scss | 2 +- scss/themes/explorer/theme.scss | 2 +- themes/bs5/theme.js | 10 +++++----- themes/bs5/theme.min.js | 4 ++-- themes/explorer-fa/theme.css | 2 +- themes/explorer-fa/theme.js | 10 +++++----- themes/explorer-fa/theme.min.css | 2 +- themes/explorer-fa/theme.min.js | 4 ++-- themes/explorer-fas/theme.css | 2 +- themes/explorer-fas/theme.js | 10 +++++----- themes/explorer-fas/theme.min.css | 2 +- themes/explorer-fas/theme.min.js | 4 ++-- themes/explorer/theme.css | 2 +- themes/explorer/theme.js | 10 +++++----- themes/explorer/theme.min.css | 2 +- themes/explorer/theme.min.js | 4 ++-- themes/fa/theme.js | 10 +++++----- themes/fa/theme.min.js | 4 ++-- themes/fas/theme.js | 10 +++++----- themes/fas/theme.min.js | 4 ++-- themes/gly/theme.js | 10 +++++----- themes/gly/theme.min.js | 4 ++-- 83 files changed, 271 insertions(+), 264 deletions(-) diff --git a/CHANGE.md b/CHANGE.md index 6aeea112..5e43030d 100755 --- a/CHANGE.md +++ b/CHANGE.md @@ -1,6 +1,13 @@ Change Log: `bootstrap-fileinput` ================================= +## version 5.2.5 + +**Date**: 19-Sep-2021 + +- (enh #1755): Simplify NPM module handling. + + ## version 5.2.4 **Date**: 18-Sep-2021 diff --git a/README.md b/README.md index 999d2338..8b200110 100755 --- a/README.md +++ b/README.md @@ -93,34 +93,34 @@ Step 1: Load the following assets on your page in the order mentioned. - + - + - + - + - + - + - + ``` With v5.2.1, the plugin is able to automatically detect the bootstrap library version and deliver the relevant bootstrap specific functionality (if you have loaded the bootstrap.min.js before fileinput.min.js). In case of any issues - you can explicitly set the bootstrap version by setting the following variable before the plugin initialization script. diff --git a/bower.json b/bower.json index 1cddf9f7..d17fe852 100755 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "bootstrap-fileinput", - "version": "5.2.4", + "version": "5.2.5", "homepage": "https://github.com/kartik-v/bootstrap-fileinput", "authors": [ "Kartik Visweswaran " diff --git a/css/fileinput-rtl.css b/css/fileinput-rtl.css index 11240db6..1518e80f 100644 --- a/css/fileinput-rtl.css +++ b/css/fileinput-rtl.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee RTL (Right To Left) default styling for bootstrap-fileinput. diff --git a/css/fileinput-rtl.min.css b/css/fileinput-rtl.min.css index 3293a42f..6df35362 100644 --- a/css/fileinput-rtl.min.css +++ b/css/fileinput-rtl.min.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee RTL (Right To Left) default styling for bootstrap-fileinput. diff --git a/css/fileinput.css b/css/fileinput.css index b61f86db..feb845c0 100755 --- a/css/fileinput.css +++ b/css/fileinput.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee default styling for bootstrap-fileinput. diff --git a/css/fileinput.min.css b/css/fileinput.min.css index 0ae28d8e..f58e5ace 100755 --- a/css/fileinput.min.css +++ b/css/fileinput.min.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee default styling for bootstrap-fileinput. diff --git a/examples/index-bs3.html b/examples/index-bs3.html index 0de0176b..83ec60de 100644 --- a/examples/index-bs3.html +++ b/examples/index-bs3.html @@ -1,5 +1,5 @@ - + diff --git a/examples/index-bs4.html b/examples/index-bs4.html index f4ba744b..9f126aca 100644 --- a/examples/index-bs4.html +++ b/examples/index-bs4.html @@ -1,5 +1,5 @@ - + diff --git a/examples/index-bs5.html b/examples/index-bs5.html index 9aa356d1..9fb50e69 100644 --- a/examples/index-bs5.html +++ b/examples/index-bs5.html @@ -1,5 +1,5 @@ - + diff --git a/js/fileinput.js b/js/fileinput.js index 84fc20a9..97389f15 100755 --- a/js/fileinput.js +++ b/js/fileinput.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Author: Kartik Visweswaran @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'], factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { 'use strict'; $.fn.fileinputLocales = {}; diff --git a/js/fileinput.min.js b/js/fileinput.min.js index 7345e875..3150053c 100755 --- a/js/fileinput.min.js +++ b/js/fileinput.min.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Author: Kartik Visweswaran @@ -7,8 +7,8 @@ * * Licensed under the BSD-3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md - */!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","window","document"],e):"object"==typeof module&&"object"==typeof module.exports?e(require("jquery"),window,document):e(window.jQuery,window,document)}(function(e,t,i,a){"use strict";e.fn.fileinputLocales={},e.fn.fileinputThemes={},e.fn.fileinputBsVersion||(e.fn.fileinputBsVersion=t.Alert&&t.Alert.VERSION||t.bootstrap&&t.bootstrap.Alert&&bootstrap.Alert.VERSION||"3.x.x"),String.prototype.setTokens=function(e){var t,i,a=this.toString();for(t in e)e.hasOwnProperty(t)&&(i=new RegExp("{"+t+"}","g"),a=a.replace(i,e[t]));return a},Array.prototype.flatMap||(Array.prototype.flatMap=function(e){return[].concat(this.map(e))});var r,n,o=function(){var e=i.currentScript.src,t=e.substring(0,e.lastIndexOf("/"));return t.substring(0,t.lastIndexOf("/")+1)+"img/loading.gif"};r={FRAMES:".kv-preview-thumb",SORT_CSS:"file-sortable",INIT_FLAG:"init-",ZOOM_VAR:o()+"?kvTemp__2873389129__=",OBJECT_PARAMS:'\n\n\n\n\n\n',DEFAULT_PREVIEW:'
\n{previewFileIcon}\n
',MODAL_ID:"kvFileinputModal",MODAL_EVENTS:["show","shown","hide","hidden","loaded"],logMessages:{ajaxError:"{status}: {error}. Error Details: {text}.",badDroppedFiles:"Error scanning dropped files!",badExifParser:"Error loading the piexif.js library. {details}",badInputType:'The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.',exifWarning:'To avoid this warning, either set "autoOrientImage" to "false" OR ensure you have loaded the "piexif.js" library correctly on your page before the "fileinput.js" script.',invalidChunkSize:'Invalid upload chunk size: "{chunkSize}". Resumable uploads are disabled.',invalidThumb:'Invalid thumb frame with id: "{id}".',noResumableSupport:"The browser does not support resumable or chunk uploads.",noUploadUrl:'The "uploadUrl" is not set. Ajax uploads and resumable uploads have been disabled.',retryStatus:"Retrying upload for chunk # {chunk} for {filename}... retry # {retry}.",chunkQueueError:"Could not push task to ajax pool for chunk index # {index}.",resumableMaxRetriesReached:"Maximum resumable ajax retries ({n}) reached.",resumableRetryError:"Could not retry the resumable request (try # {n})... aborting.",resumableAborting:"Aborting / cancelling the resumable request.",resumableRequestError:"Error processing resumable request. {msg}"},objUrl:t.URL||t.webkitURL,isBs:function(t){var i=e.trim((e.fn.fileinputBsVersion||"")+"");return t=parseInt(t,10),i?t===parseInt(i.charAt(0),10):4===t},defaultButtonCss:function(e){return"btn-default btn-"+(e?"":"outline-")+"secondary"},now:function(){return(new Date).getTime()},round:function(e){return e=parseFloat(e),isNaN(e)?0:Math.floor(Math.round(e))},getArray:function(e){var t,i=[],a=e&&e.length||0;for(t=0;a>t;t++)i.push(e[t]);return i},getFileRelativePath:function(e){return String(e.newPath||e.relativePath||e.webkitRelativePath||r.getFileName(e)||null)},getFileId:function(e,t){var i=r.getFileRelativePath(e);return"function"==typeof t?t(e):e&&i?e.size+"_"+encodeURIComponent(i).replace(/%/g,"_"):null},getFrameSelector:function(e,t){return t=t||"",'[id="'+e+'"]'+t},getZoomSelector:function(e,t){return r.getFrameSelector("zoom-"+e,t)},getFrameElement:function(e,t,i){return e.find(r.getFrameSelector(t,i))},getZoomElement:function(e,t,i){return e.find(r.getZoomSelector(t,i))},getElapsed:function(t){var i=t,a="",n={},o={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};return r.getObjectKeys(o).forEach(function(e){n[e]=Math.floor(i/o[e]),i-=n[e]*o[e]}),e.each(n,function(e,t){t>0&&(a+=(a?" ":"")+t+e.substring(0,1))}),a},debounce:function(e,t){var i;return function(){var a=arguments,r=this;clearTimeout(i),i=setTimeout(function(){e.apply(r,a)},t)}},stopEvent:function(e){e.stopPropagation(),e.preventDefault()},getFileName:function(e){return e?e.fileName||e.name||"":""},createObjectURL:function(e){return r.objUrl&&r.objUrl.createObjectURL&&e?r.objUrl.createObjectURL(e):""},revokeObjectURL:function(e){r.objUrl&&r.objUrl.revokeObjectURL&&e&&r.objUrl.revokeObjectURL(e)},compare:function(e,t,i){return e!==a&&(i?e===t:e.match(t))},isIE:function(e){var t,a;return"Microsoft Internet Explorer"!==navigator.appName?!1:10===e?new RegExp("msie\\s"+e,"i").test(navigator.userAgent):(t=i.createElement("div"),t.innerHTML="",a=t.getElementsByTagName("i").length,i.body.appendChild(t),t.parentNode.removeChild(t),a)},canOrientImage:function(t){var a=e(i.createElement("img")).css({width:"1px",height:"1px"}).insertAfter(t),r=a.css("image-orientation");return a.remove(),!!r},canAssignFilesToInput:function(){var e=i.createElement("input");try{return e.type="file",e.files=null,!0}catch(t){return!1}},getDragDropFolders:function(e){var t,i,a=e?e.length:0,r=0;if(a>0&&e[0].webkitGetAsEntry())for(t=0;a>t;t++)i=e[t].webkitGetAsEntry(),i&&i.isDirectory&&r++;return r},initModal:function(t){var i=e("body");i.length&&t.appendTo(i)},isFunction:function(e){return"function"==typeof e},isEmpty:function(t,i){return t===a||null===t||""===t?!0:r.isString(t)&&i?""===e.trim(t):r.isArray(t)?0===t.length:!(!e.isPlainObject(t)||!e.isEmptyObject(t))},isArray:function(e){return Array.isArray(e)||"[object Array]"===Object.prototype.toString.call(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},ifSet:function(e,t,i){return i=i||"",t&&"object"==typeof t&&e in t?t[e]:i},cleanArray:function(e){return e instanceof Array||(e=[]),e.filter(function(e){return e!==a&&null!==e})},spliceArray:function(t,i,a){var r,n,o=0,s=[];if(!(t instanceof Array))return[];for(n=e.extend(!0,[],t),a&&n.reverse(),r=0;r=0?atob(e.split(",")[1]):decodeURIComponent(e.split(",")[1]),a=new ArrayBuffer(i.length),n=new Uint8Array(a),o=0;ol;)switch(a=o[l++],a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(a);break;case 12:case 13:r=o[l++],s+=String.fromCharCode((31&a)<<6|63&r);break;case 14:r=o[l++],n=o[l++],s+=String.fromCharCode((15&a)<<12|(63&r)<<6|(63&n)<<0)}return s},isHtml:function(e){var t=i.createElement("div");t.innerHTML=e;for(var a=t.childNodes,r=a.length;r--;)if(1===a[r].nodeType)return!0;return!1},isSvg:function(e){return e.match(/^\s*<\?xml/i)&&(e.match(/"+t+""))},uniqId:function(){return((new Date).getTime()+Math.floor(Math.random()*Math.pow(10,15))).toString(36)},cspBuffer:{CSP_ATTRIB:"data-csp-01928735",domElementsStyles:{},stash:function(t){var i=this,a=e.parseHTML("
"+t+"
"),n=e(a);n.find("[style]").each(function(t,a){var n=e(a),o=n[0].style,s=r.uniqId(),l={};o&&o.length&&(e(o).each(function(){l[this]=o[this]}),i.domElementsStyles[s]=l,n.removeAttr("style").attr(i.CSP_ATTRIB,s))}),n.filter("*").removeAttr("style");var o=Object.values?Object.values(a):Object.keys(a).map(function(e){return a[e]});return o.flatMap(function(e){return e.innerHTML}).join("")},apply:function(t){var i=this,a=e(t);a.find("["+i.CSP_ATTRIB+"]").each(function(t,a){var r=e(a),n=r.attr(i.CSP_ATTRIB),o=i.domElementsStyles[n];o&&r.css(o),r.removeAttr(i.CSP_ATTRIB)}),i.domElementsStyles={}}},setHtml:function(e,t){var i=r.cspBuffer;return e.html(i.stash(t)),i.apply(e),e},htmlEncode:function(e,t){return e===a?t||null:e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},replaceTags:function(t,i){var a=t;return i?(e.each(i,function(e,t){"function"==typeof t&&(t=t()),a=a.split(e).join(t)}),a):a},cleanMemory:function(e){var t=e.is("img")?e.attr("src"):e.find("source").attr("src");r.revokeObjectURL(t)},findFileName:function(e){var t=e.lastIndexOf("/");return-1===t&&(t=e.lastIndexOf("\\")),e.split(e.substring(t,t+1)).pop()},checkFullScreen:function(){return i.fullscreenElement||i.mozFullScreenElement||i.webkitFullscreenElement||i.msFullscreenElement},toggleFullScreen:function(e){var t=i,a=t.documentElement,n=r.checkFullScreen();a&&e&&!n?a.requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen&&a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):n&&(t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen&&t.webkitExitFullscreen())},moveArray:function(t,i,r,n){var o=e.extend(!0,[],t);if(n&&o.reverse(),r>=o.length)for(var s=r-o.length;s--+1;)o.push(a);return o.splice(r,0,o.splice(i,1)[0]),n&&o.reverse(),o},closeButton:function(e){return e=(r.isBs(5)?"btn-close":"close")+(e?" "+e:""),'"},getRotation:function(e){switch(e){case 2:return"rotateY(180deg)";case 3:return"rotate(180deg)";case 4:return"rotate(180deg) rotateY(180deg)";case 5:return"rotate(270deg) rotateY(180deg)";case 6:return"rotate(90deg)";case 7:return"rotate(90deg) rotateY(180deg)";case 8:return"rotate(270deg)";default:return""}},setTransform:function(e,t){e&&(e.style.transform=t,e.style.webkitTransform=t,e.style["-moz-transform"]=t,e.style["-ms-transform"]=t,e.style["-o-transform"]=t)},getObjectKeys:function(t){var i=[];return t&&e.each(t,function(e){i.push(e)}),i},getObjectSize:function(e){return r.getObjectKeys(e).length},whenAll:function(t){var i,a,n,o,s,l,d=[].slice,c=1===arguments.length&&r.isArray(t)?t:d.call(arguments),u=e.Deferred(),p=0,f=c.length,g=f;for(n=o=s=Array(f),l=function(e,t,i){return function(){i!==c&&p++,u.notifyWith(t[e]=this,i[e]=d.call(arguments)),--g||u[(p?"reject":"resolve")+"With"](t,i)}},i=0;f>i;i++)(a=c[i])&&e.isFunction(a.promise)?a.promise().done(l(i,s,c)).fail(l(i,n,o)):(u.notifyWith(this,a),--g);return g||u.resolveWith(s,c),u.promise()}},n=function(t,i){var a=this;a.$element=e(t),a.$parent=a.$element.parent(),a._validate()&&(a.isPreviewable=r.hasFileAPISupport(),a.isIE9=r.isIE(9),a.isIE10=r.isIE(10),(a.isPreviewable||a.isIE9)&&(a._init(i),a._listen()),a.$element.removeClass("file-loading"))},n.prototype={constructor:n,_cleanup:function(){var e=this;e.reader=null,e.clearFileStack(),e.fileBatchCompleted=!0,e.isError=!1,e.isDuplicateError=!1,e.isPersistentError=!1,e.cancelling=!1,e.paused=!1,e.lastProgress=0,e._initAjax()},_isAborted:function(){var e=this;return e.cancelling||e.paused},_initAjax:function(){var t=this,i=t.taskManager={pool:{},addPool:function(e){return i.pool[e]=new i.TasksPool(e)},getPool:function(e){return i.pool[e]},addTask:function(e,t){return new i.Task(e,t)},TasksPool:function(t){var a=this;a.id=t,a.cancelled=!1,a.cancelledDeferrer=e.Deferred(),a.tasks={},a.addTask=function(e,t){return a.tasks[e]=new i.Task(e,t)},a.size=function(){return r.getObjectSize(a.tasks)},a.run=function(t){var i,n,o,s=0,l=!1,d=r.getObjectKeys(a.tasks).map(function(e){return a.tasks[e]}),c=[],u=e.Deferred();if(a.cancelled)return a.cancelledDeferrer.resolve(),u.reject();if(!t){var p=r.getObjectKeys(a.tasks).map(function(e){return a.tasks[e].deferred});return r.whenAll(p).done(function(){var e=r.getArray(arguments);a.cancelled?(u.reject.apply(null,e),a.cancelledDeferrer.resolve()):(u.resolve.apply(null,e),a.cancelledDeferrer.reject())}).fail(function(){var e=r.getArray(arguments);u.reject.apply(null,e),a.cancelled?a.cancelledDeferrer.resolve():a.cancelledDeferrer.reject()}),e.each(a.tasks,function(e){i=a.tasks[e],i.run()}),u}for(n=function(t){e.when(t.deferred).fail(function(){l=!0,o.apply(null,arguments)}).always(o)},o=function(){var e=r.getArray(arguments);return u.notify(e),c.push(e),a.cancelled?(u.reject.apply(null,c),void a.cancelledDeferrer.resolve()):(c.length===a.size()&&(l?u.reject.apply(null,c):u.resolve.apply(null,c)),void(d.length&&(i=d.shift(),n(i),i.run())))};d.length&&s++0&&c.maxTotalFileCount10?t-10:Math.ceil(t/2),e=t;e>i;e--)r=parseFloat(o.bpsLog[e]),a++;o.bps=64*(a>0?r/a:0)},u),n={fileId:e,started:s,elapsed:l,loaded:i,total:a,bps:o.bps,bitrate:t._getSize(o.bps,t.bitRateUnits),pendingBytes:c},e?o.stats[e]=n:o.stats=n,n},exists:function(i){return-1!==e.inArray(i,t.fileManager.getIdList())},count:function(){return t.fileManager.getIdList().length},total:function(){var e=t.fileManager;return e.totalFiles||(e.totalFiles=e.count()),e.totalFiles},getTotalSize:function(){var i=t.fileManager;return i.totalSize?i.totalSize:(i.totalSize=0,e.each(t.getFileStack(),function(e,t){var a=parseFloat(t.size);i.totalSize+=isNaN(a)?0:a}),i.totalSize)},add:function(e,i){i||(i=t.fileManager.getId(e)),i&&(t.fileManager.stack[i]={file:e,name:r.getFileName(e),relativePath:r.getFileRelativePath(e),size:e.size,nameFmt:t._getFileName(e,""),sizeFmt:t._getSize(e.size)})},remove:function(e){var i=t._getThumbFileId(e);t.fileManager.removeFile(i)},removeFile:function(e){var i=t.fileManager;e&&(delete i.stack[e],delete i.loadedImages[e])},move:function(i,a){var r={},n=t.fileManager.stack;(i||a)&&i!==a&&(e.each(n,function(e,t){e!==i&&(r[e]=t),e===a&&(r[i]=n[i])}),t.fileManager.stack=r)},list:function(){var i=[];return e.each(t.getFileStack(),function(e,t){t&&t.file&&i.push(t.file)}),i},isPending:function(i){return-1===e.inArray(i,t.fileManager.filesProcessed)&&t.fileManager.exists(i)},isProcessed:function(){var i=!0,a=t.fileManager;return e.each(t.getFileStack(),function(e){a.isPending(e)&&(i=!1)}),i},clear:function(){var e=t.fileManager;t.isDuplicateError=!1,t.isPersistentError=!1,e.totalFiles=null,e.totalSize=null,e.uploadedSize=0,e.stack={},e.errors=[],e.filesProcessed=[],e.stats={},e.bpsLog=[],e.bps=0,e.clearImages()},clearImages:function(){t.fileManager.loadedImages={},t.fileManager.totalImages=0},addImage:function(e,i){t.fileManager.loadedImages[e]=i},removeImage:function(e){delete t.fileManager.loadedImages[e]},getImageIdList:function(){return r.getObjectKeys(t.fileManager.loadedImages)},getImageCount:function(){return t.fileManager.getImageIdList().length},getId:function(e){return t._getFileId(e)},getIndex:function(e){return t.fileManager.getIdList().indexOf(e)},getThumb:function(i){var a=null;return t._getThumbs().each(function(){var r=e(this);t._getThumbFileId(r)===i&&(a=r)}),a},getThumbIndex:function(e){var i=t._getThumbFileId(e);return t.fileManager.getIndex(i)},getIdList:function(){return r.getObjectKeys(t.fileManager.stack)},getFile:function(e){return t.fileManager.stack[e]||null},getFileName:function(e,i){var a=t.fileManager.getFile(e);return a?i?a.nameFmt||"":a.name||"":""},getFirstFile:function(){var e=t.fileManager.getIdList(),i=e&&e.length?e[0]:null;return t.fileManager.getFile(i)},setFile:function(e,i){t.fileManager.getFile(e)?t.fileManager.stack[e].file=i:t.fileManager.add(i,e)},setProcessed:function(e){t.fileManager.filesProcessed.push(e)},getProgress:function(){var e=t.fileManager.total(),i=t.fileManager.filesProcessed.length;return e?Math.ceil(i/e*100):0},setProgress:function(e,i){var a=t.fileManager.getFile(e);!isNaN(i)&&a&&(a.progress=i)}}},_setUploadData:function(t,i){var a=this;e.each(i,function(e,i){var n=a.uploadParamNames[e]||e;r.isArray(i)?t.append(n,i[0],i[1]):t.append(n,i)})},_initResumableUpload:function(){var t,i=this,a=i.resumableUploadOptions,n=r.logMessages,o=i.fileManager;if(i.enableResumableUpload){if(a.fallback!==!1&&"function"!=typeof a.fallback&&(a.fallback=function(e){e._log(n.noResumableSupport),e.enableResumableUpload=!1}),!r.hasResumableUploadSupport()&&a.fallback!==!1)return void a.fallback(i);if(!i.uploadUrl&&i.enableResumableUpload)return i._log(n.noUploadUrl),void(i.enableResumableUpload=!1);if(a.chunkSize=parseFloat(a.chunkSize),a.chunkSize<=0||isNaN(a.chunkSize))return i._log(n.invalidChunkSize,{chunkSize:a.chunkSize}),void(i.enableResumableUpload=!1);t=i.resumableManager={init:function(e,r,n){t.logs=[],t.stack=[],t.error="",t.id=e,t.file=r.file,t.fileName=r.name,t.fileIndex=n,t.completed=!1,t.lastProgress=0,i.showPreview&&(t.$thumb=o.getThumb(e)||null,t.$progress=t.$btnDelete=null,t.$thumb&&t.$thumb.length&&(t.$progress=t.$thumb.find(".file-thumb-progress"),t.$btnDelete=t.$thumb.find(".kv-file-remove"))),t.chunkSize=a.chunkSize*i.bytesToKB,t.chunkCount=t.getTotalChunks()},setAjaxError:function(e,r,o,s){e.responseJSON&&e.responseJSON.error&&(o=e.responseJSON.error.toString()),s||(t.error=o),a.showErrorLog&&i._log(n.ajaxError,{status:e.status,error:o,text:e.responseText||""})},reset:function(){t.stack=[],t.chunksProcessed={}},setProcessed:function(r){var n,s,l=t.id,d=t.$thumb,c=t.$progress,u=d&&d.length,p={id:u?d.attr("id"):"",index:o.getIndex(l),fileId:l},f=i.resumableUploadOptions.skipErrorsAndProceed;t.completed=!0,t.lastProgress=0,u&&d.removeClass("file-uploading"),"success"===r?(o.uploadedSize+=t.file.size,i.showPreview&&(i._setProgress(101,c),i._setThumbStatus(d,"Success"),i._initUploadSuccess(t.chunksProcessed[l].data,d)),o.removeFile(l),delete t.chunksProcessed[l],i._raise("fileuploaded",[p.id,p.index,p.fileId]),o.isProcessed()&&i._setProgress(101)):"cancel"!==r&&(i.showPreview&&(i._setThumbStatus(d,"Error"),i._setPreviewError(d,!0),i._setProgress(101,c,i.msgProgressError),i._setProgress(101,i.$progress,i.msgProgressError),i.cancelling=!f),i.$errorContainer.find('li[data-file-id="'+p.fileId+'"]').length||(s={file:t.fileName,max:a.maxRetries,error:t.error},n=i.msgResumableUploadRetriesExceeded.setTokens(s),e.extend(p,s),i._showFileError(n,p,"filemaxretries"),f&&(o.removeFile(l),delete t.chunksProcessed[l],o.isProcessed()&&i._setProgress(101)))),o.isProcessed()&&t.reset()},check:function(){var i=!0;e.each(t.logs,function(e,t){return t?void 0:(i=!1,!1)})},processedResumables:function(){var e,i=t.logs,a=0;if(!i||!i.length)return 0;for(e=0;et.file.size?t.file.size:e},getTotalChunks:function(){var e=parseFloat(t.chunkSize);return!isNaN(e)&&e>0?Math.ceil(t.file.size/e):0},getProgress:function(){var e=t.processedResumables(),i=t.chunkCount;return 0===i?0:Math.ceil(e/i*100)},checkAborted:function(e){i._isAborted()&&(clearInterval(e),i.unlock())},upload:function(){var e,a=o.getIdList(),n="new";e=setInterval(function(){var s;if(t.checkAborted(e),"new"===n&&(i.lock(),n="processing",s=a.shift(),o.initStats(s),o.stack[s]&&(t.init(s,o.stack[s],o.getIndex(s)),t.processUpload())),!o.isPending(s)&&t.completed&&(n="new"),o.isProcessed()){var l=i.$preview.find(".file-preview-initial");l.length&&(r.addCss(l,r.SORT_CSS),i._initSortable()),clearInterval(e),i._clearFileInput(),i.unlock(),setTimeout(function(){var e=i.previewCache.data;e&&(i.initialPreview=e.content,i.initialPreviewConfig=e.config,i.initialPreviewThumbTags=e.tags),i._raise("filebatchuploadcomplete",[i.initialPreview,i.initialPreviewConfig,i.initialPreviewThumbTags,i._getExtraData()])},i.processDelay)}},i.processDelay)},uploadResumable:function(){var e,r,n=i.taskManager,o=t.chunkCount;for(r=n.addPool(t.id),e=0;o>e;e++)t.logs[e]=!(!t.chunksProcessed[t.id]||!t.chunksProcessed[t.id][e]),t.logs[e]||t.pushAjax(e,0);r.run(a.maxThreads).done(function(){t.setProcessed("success")}).fail(function(){t.setProcessed(r.cancelled?"cancel":"error")})},processUpload:function(){var n,s,l,d,c,u,p,f=t.id;return a.testUrl?(n=new FormData,s=o.stack[f],i._setUploadData(n,{fileId:f,fileName:s.fileName,fileSize:s.size,fileRelativePath:s.relativePath,chunkSize:t.chunkSize,chunkCount:t.chunkCount}),l=function(e){p=i._getOutData(n,e),i._raise("filetestbeforesend",[f,o,t,p])},d=function(a,s,l){p=i._getOutData(n,l,a);var d=i.uploadParamNames,c=d.chunksUploaded||"chunksUploaded",u=[f,o,t,p];a[c]&&r.isArray(a[c])?(t.chunksProcessed[f]||(t.chunksProcessed[f]={}),e.each(a[c],function(e,i){t.logs[i]=!0,t.chunksProcessed[f][i]=!0}),t.chunksProcessed[f].data=a,i._raise("filetestsuccess",u)):i._raise("filetesterror",u),t.uploadResumable()},c=function(e,a,r){p=i._getOutData(n,e),i._raise("filetestajaxerror",[f,o,t,p]),t.setAjaxError(e,a,r,!0),t.uploadResumable()},u=function(){i._raise("filetestcomplete",[f,o,t,i._getOutData(n)])},void i._ajaxSubmit(l,d,u,c,n,f,t.fileIndex,a.testUrl)):void t.uploadResumable()},pushAjax:function(e,a){var r=i.taskManager,o=r.getPool(t.id);o.addTask(o.size()+1,function(e){var a,r=t.stack.shift();a=r[0],t.chunksProcessed[t.id]&&t.chunksProcessed[t.id][a]?i._log(n.chunkQueueError,{index:a}):t.sendAjax(a,r[1],e)}),t.stack.push([e,a])},sendAjax:function(e,s,l){var d,c=t.chunkSize,u=t.id,p=t.file,f=t.$thumb,g=r.logMessages,m=t.$btnDelete,h=function(e,t){t&&(e=e.setTokens(t)),e=g.resumableRequestError.setTokens({msg:e}),i._log(e),l.reject(e)};if(!t.chunksProcessed[u]||!t.chunksProcessed[u][e]){if(s>a.maxRetries)return h(g.resumableMaxRetriesReached,{n:a.maxRetries}),void t.setProcessed("error");var v,b,w,_,C,x,y=p.slice?"slice":p.mozSlice?"mozSlice":p.webkitSlice?"webkitSlice":"slice",T=p[y](c*e,c*(e+1));v=new FormData,d=o.stack[u],i._setUploadData(v,{chunkCount:t.chunkCount,chunkIndex:e,chunkSize:c,chunkSizeStart:c*e,fileBlob:[T,t.fileName],fileId:u,fileName:t.fileName,fileRelativePath:d.relativePath,fileSize:p.size,retryCount:s}),t.$progress&&t.$progress.length&&t.$progress.show(),w=function(a){b=i._getOutData(v,a),i.showPreview&&(f.hasClass("file-preview-success")||(i._setThumbStatus(f,"Loading"),r.addCss(f,"file-uploading")),m.attr("disabled",!0)),i._raise("filechunkbeforesend",[u,e,s,o,t,b])},_=function(r,d,c){if(i._isAborted())return void h(g.resumableAborting);b=i._getOutData(v,c,r);var p=i.uploadParamNames,f=p.chunkIndex||"chunkIndex",m=[u,e,s,o,t,b];r.error?(a.showErrorLog&&i._log(n.retryStatus,{retry:s+1,filename:t.fileName,chunk:e}),i._raise("filechunkerror",m),t.pushAjax(e,s+1),t.error=r.error,h(r.error)):(t.logs[r[f]]=!0,t.chunksProcessed[u]||(t.chunksProcessed[u]={}),t.chunksProcessed[u][r[f]]=!0,t.chunksProcessed[u].data=r,l.resolve.call(null,r),i._raise("filechunksuccess",m),t.check())},C=function(a,r,n){return i._isAborted()?void h(g.resumableAborting):(b=i._getOutData(v,a),t.setAjaxError(a,r,n),i._raise("filechunkajaxerror",[u,e,s,o,t,b]),t.pushAjax(e,s+1),void h(g.resumableRetryError,{n:s-1}))},x=function(){i._isAborted()||i._raise("filechunkcomplete",[u,e,s,o,t,i._getOutData(v)])},i._ajaxSubmit(w,_,x,C,v,u,t.fileIndex)}}},t.reset()}},_initTemplateDefaults:function(){var t,i,n,o,s,l,d,c,u,p,f,g,m,h,v,b,w,_,C,x,y,T,P,k,F,S,E,I,A,D,z,j,$,U,M,R,B,O,L,N,Z,H,W,V=this,q=function(e,t){return'\n"+r.DEFAULT_PREVIEW+"\n\n"},K="btn btn-sm btn-kv "+r.defaultButtonCss();t='{preview}\n
\n
\n
\n {caption}\n\n'+(r.isBs(5)?"":'
\n')+" {remove}\n {cancel}\n {pause}\n {upload}\n {browse}\n"+(r.isBs(5)?"":"
\n")+"
",i='{preview}\n
\n
\n{remove}\n{cancel}\n{upload}\n{browse}\n',n='
\n {close}
\n
\n
\n
\n
\n
\n
',s=r.closeButton("fileinput-remove"),o='',l='\n',d='',c='{icon} {label}',u='
{icon} {label}
',H=r.MODAL_ID+"Label",p='', -f='\n',W='',g='
\n
\n {status}\n
\n
{stats}',Z='
{pendingTime} {uploadSpeed}
',m=" ({sizeText})",h='',v='
\n \n
\n{drag}\n
',b='\n',w='',_='{downloadIcon}',C='',x='{dragIcon}',y='
{indicator}
',T='
\n',k=T+' title="{caption}">
\n',F="
{footer}\n{zoomCache}
\n",S="{content}\n",O=" {style}",E=q("html","text/html"),A=q("text","text/plain;charset=UTF-8"),R=q("pdf","application/pdf"),I='{alt}\n",D='",z='",j='\n",$='\n",U='\n",M='\n\n'+r.OBJECT_PARAMS+" "+r.DEFAULT_PREVIEW+"\n\n",B='
\n"+r.DEFAULT_PREVIEW+"\n
\n",L='
{zoomContent}
',N={width:"100%",height:"100%","min-height":"480px"},V._isPdfRendered()&&(R=V.pdfRendererTemplate.replace("{renderer}",V._encodeURI(V.pdfRendererUrl))),V.defaults={layoutTemplates:{main1:t,main2:i,preview:n,close:s,fileIcon:o,caption:l,modalMain:p,modal:f,descriptionClose:W,progress:g,stats:Z,size:m,footer:h,indicator:y,actions:v,actionDelete:b,actionUpload:w,actionDownload:_,actionZoom:C,actionDrag:x,btnDefault:d,btnLink:c,btnBrowse:u,zoomCache:L},previewMarkupTags:{tagBefore1:P,tagBefore2:k,tagAfter:F},previewContentTemplates:{generic:S,html:E,image:I,text:A,office:D,gdocs:z,video:j,audio:$,flash:U,object:M,pdf:R,other:B},allowedPreviewTypes:["image","html","text","video","audio","flash","pdf","object"],previewTemplates:{},previewSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"213px",height:"160px"},text:{width:"213px",height:"160px"},office:{width:"213px",height:"160px"},gdocs:{width:"213px",height:"160px"},video:{width:"213px",height:"160px"},audio:{width:"100%",height:"30px"},flash:{width:"213px",height:"160px"},object:{width:"213px",height:"160px"},pdf:{width:"100%",height:"160px",position:"relative"},other:{width:"213px",height:"160px"}},previewSettingsSmall:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"100%",height:"160px"},text:{width:"100%",height:"160px"},office:{width:"100%",height:"160px"},gdocs:{width:"100%",height:"160px"},video:{width:"100%",height:"auto"},audio:{width:"100%",height:"30px"},flash:{width:"100%",height:"auto"},object:{width:"100%",height:"auto"},pdf:{width:"100%",height:"160px"},other:{width:"100%",height:"160px"}},previewZoomSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:N,text:N,office:{width:"100%",height:"100%","max-width":"100%","min-height":"480px"},gdocs:{width:"100%",height:"100%","max-width":"100%","min-height":"480px"},video:{width:"auto",height:"100%","max-width":"100%"},audio:{width:"100%",height:"30px"},flash:{width:"auto",height:"480px"},object:{width:"auto",height:"100%","max-width":"100%","min-height":"480px"},pdf:N,other:{width:"auto",height:"100%","min-height":"480px"}},mimeTypeAliases:{"video/quicktime":"video/mp4"},fileTypeSettings:{image:function(e,t){return r.compare(e,"image.*")&&!r.compare(e,/(tiff?|wmf)$/i)||r.compare(t,/\.(gif|png|jpe?g)$/i)},html:function(e,t){return r.compare(e,"text/html")||r.compare(t,/\.(htm|html)$/i)},office:function(e,t){return r.compare(e,/(word|excel|powerpoint|office)$/i)||r.compare(t,/\.(docx?|xlsx?|pptx?|pps|potx?)$/i)},gdocs:function(e,t){return r.compare(e,/(word|excel|powerpoint|office|iwork-pages|tiff?)$/i)||r.compare(t,/\.(docx?|xlsx?|pptx?|pps|potx?|rtf|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i)},text:function(e,t){return r.compare(e,"text.*")||r.compare(t,/\.(xml|javascript)$/i)||r.compare(t,/\.(txt|md|nfo|ini|json|php|js|css)$/i)},video:function(e,t){return r.compare(e,"video.*")&&(r.compare(e,/(ogg|mp4|mp?g|mov|webm|3gp)$/i)||r.compare(t,/\.(og?|mp4|webm|mp?g|mov|3gp)$/i))},audio:function(e,t){return r.compare(e,"audio.*")&&(r.compare(t,/(ogg|mp3|mp?g|wav)$/i)||r.compare(t,/\.(og?|mp3|mp?g|wav)$/i))},flash:function(e,t){return r.compare(e,"application/x-shockwave-flash",!0)||r.compare(t,/\.(swf)$/i)},pdf:function(e,t){return r.compare(e,"application/pdf",!0)||r.compare(t,/\.(pdf)$/i)},object:function(){return!0},other:function(){return!0}},fileActionSettings:{showRemove:!0,showUpload:!0,showDownload:!0,showZoom:!0,showDrag:!0,removeIcon:'',removeClass:K,removeErrorClass:"btn btn-sm btn-kv btn-danger",removeTitle:"Remove file",uploadIcon:'',uploadClass:K,uploadTitle:"Upload file",uploadRetryIcon:'',uploadRetryTitle:"Retry upload",downloadIcon:'',downloadClass:K,downloadTitle:"Download file",zoomIcon:'',zoomClass:K,zoomTitle:"View Details",dragIcon:'',dragClass:"text-primary",dragTitle:"Move / Rearrange",dragSettings:{},indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:'',indicatorNewTitle:"Not uploaded yet",indicatorSuccessTitle:"Uploaded",indicatorErrorTitle:"Upload Error",indicatorLoadingTitle:"Uploading …",indicatorPausedTitle:"Upload Paused"}},e.each(V.defaults,function(t,i){return"allowedPreviewTypes"===t?void(V.allowedPreviewTypes===a&&(V.allowedPreviewTypes=i)):void(V[t]=e.extend(!0,{},i,V[t]))}),V._initPreviewTemplates()},_initPreviewTemplates:function(){var t,i=this,a=i.previewMarkupTags,n=a.tagAfter;e.each(i.previewContentTemplates,function(e,o){r.isEmpty(i.previewTemplates[e])&&(t=a.tagBefore2,"generic"!==e&&"image"!==e||(t=a.tagBefore1),i._isPdfRendered()&&"pdf"===e&&(t=t.replace("kv-file-content","kv-file-content kv-pdf-rendered")),i.previewTemplates[e]=t+o+n)})},_initPreviewCache:function(){var t=this;t.previewCache={data:{},init:function(){var e=t.initialPreview;e.length>0&&!r.isArray(e)&&(e=e.split(t.initialPreviewDelimiter)),t.previewCache.data={content:e,config:t.initialPreviewConfig,tags:t.initialPreviewThumbTags}},count:function(e){if(!t.previewCache.data||!t.previewCache.data.content)return 0;if(e){var i=t.previewCache.data.content.filter(function(e){return null!==e});return i.length}return t.previewCache.data.content.length},get:function(e,i){var n,o,s,l,d,c,u,p=r.INIT_FLAG+e,f=t.previewCache.data,g=f.config[e],m=f.content[e],h=r.ifSet("previewAsData",g,t.initialPreviewAsData),v=g?{title:g.title||null,alt:g.alt||null}:{title:null,alt:null},b=function(e,i,a,n,o,s,l,d){var c=" file-preview-initial "+r.SORT_CSS+(l?" "+l:""),u=t.previewInitId+"-"+s,p=g&&g.fileId||u;return t._generatePreviewTemplate(e,i,a,n,u,p,!1,null,c,o,s,d,v,g&&g.zoomData||i)};return m&&m.length?(i=i===a?!0:i,s=r.ifSet("type",g,t.initialPreviewFileType||"generic"),d=r.ifSet("filename",g,r.ifSet("caption",g)),c=r.ifSet("filetype",g,s),l=t.previewCache.footer(e,i,g&&g.size||null),u=r.ifSet("frameClass",g),n=h?b(s,m,d,c,l,p,u):b("generic",m,d,c,l,p,u,s).setTokens({content:f.content[e]}),f.tags.length&&f.tags[e]&&(n=r.replaceTags(n,f.tags[e])),r.isEmpty(g)||r.isEmpty(g.frameAttr)||(o=r.createElement(n),o.find(".file-preview-initial").attr(g.frameAttr),n=o.html(),o.remove()),n):""},clean:function(e){e.content=r.cleanArray(e.content),e.config=r.cleanArray(e.config),e.tags=r.cleanArray(e.tags),t.previewCache.data=e},add:function(e,i,a,n){var o,s=t.previewCache.data;return e&&e.length?(o=e.length-1,r.isArray(e)||(e=e.split(t.initialPreviewDelimiter)),n&&s.content?(o=s.content.push(e[0])-1,s.config[o]=i,s.tags[o]=a):(s.content=e,s.config=i,s.tags=a),t.previewCache.clean(s),o):0},set:function(e,i,n,o){var s,l,d=t.previewCache.data;if(e&&e.length&&(r.isArray(e)||(e=e.split(t.initialPreviewDelimiter)),l=e.filter(function(e){return null!==e}),l.length)){if(d.content===a&&(d.content=[]),d.config===a&&(d.config=[]),d.tags===a&&(d.tags=[]),o){for(s=0;si;i++)a=t.previewCache.get(i),r=t.reversePreviewOrder?a+r:r+a;return e=t._getMsgSelected(n),{content:r,caption:e}},footer:function(e,i,n){var o=t.previewCache.data||{};if(r.isEmpty(o.content))return"";(r.isEmpty(o.config)||r.isEmpty(o.config[e]))&&(o.config[e]={}),i=i===a?!0:i;var s,l=o.config[e],d=r.ifSet("caption",l),c=r.ifSet("width",l,"auto"),u=r.ifSet("url",l,!1),p=r.ifSet("key",l,null),f=r.ifSet("fileId",l,null),g=t.fileActionSettings,m=t.initialPreviewShowDelete||!1,h=t.initialPreviewDownloadUrl?t.initialPreviewDownloadUrl+"?key="+p+(f?"&fileId="+f:""):"",v=l.downloadUrl||h,b=l.filename||l.caption||"",w=!!v,_=r.ifSet("showRemove",l,m),C=r.ifSet("showDownload",l,r.ifSet("showDownload",g,w)),x=r.ifSet("showZoom",l,r.ifSet("showZoom",g,!0)),y=r.ifSet("showDrag",l,r.ifSet("showDrag",g,!0)),T=u===!1&&i;return C=C&&l.downloadUrl!==!1&&!!v,s=t._renderFileActions(l,!1,C,_,x,y,T,u,p,!0,v,b),t._getLayoutTemplate("footer").setTokens({progress:t._renderThumbProgress(),actions:s,caption:d,size:t._getSize(n),width:c,indicator:""})}},t.previewCache.init()},_isPdfRendered:function(){var e=this,t=e.usePdfRenderer,i="function"==typeof t?t():!!t;return i&&e.pdfRendererUrl},_handler:function(e,t,i){var a=this,r=a.namespace,n=t.split(" ").join(r+" ")+r;e&&e.length&&e.off(n).on(n,i)},_encodeURI:function(e){var t=this;return t.encodeUrl?encodeURI(e):e},_log:function(e,i){var a=this,r=a.$element.attr("id");a.showConsoleLogs&&(r&&(e='"'+r+'": '+e),e="bootstrap-fileinput: "+e,"object"==typeof i&&(e=e.setTokens(i)),t.console&&"undefined"!=typeof t.console.log?t.console.log(e):t.alert(e))},_validate:function(){var e=this,t="file"===e.$element.attr("type");return t||e._log(r.logMessages.badInputType),t},_errorsExist:function(){var t,i=this,a=i.$errorContainer.find("li");return a.length?!0:(t=r.createElement(i.$errorContainer.html()),t.find(".kv-error-close").remove(),t.find("ul").remove(),!!e.trim(t.text()).length)},_errorHandler:function(e,t){var i=this,a=e.target.error,r=function(e){i._showError(e.replace("{name}",t))};r(a.code===a.NOT_FOUND_ERR?i.msgFileNotFound:a.code===a.SECURITY_ERR?i.msgFileSecured:a.code===a.NOT_READABLE_ERR?i.msgFileNotReadable:a.code===a.ABORT_ERR?i.msgFilePreviewAborted:i.msgFilePreviewError)},_addError:function(e){var t=this,i=t.$errorContainer;e&&i.length&&(r.setHtml(i,t.errorCloseButton+e),t._handler(i.find(".kv-error-close"),"click",function(){setTimeout(function(){t.showPreview&&!t.getFrames().length&&t.clear(),i.fadeOut("slow")},t.processDelay)}))},_setValidationError:function(e){var t=this;e=(e?e+" ":"")+"has-error",t.$container.removeClass(e).addClass("has-error"),r.addCss(t.$caption,"is-invalid")},_resetErrors:function(e){var t=this,i=t.$errorContainer,a=t.resumableUploadOptions.retainErrorHistory;t.isPersistentError||t.enableResumableUpload&&a||(t.isError=!1,t.$container.removeClass("has-error"),t.$caption.removeClass("is-invalid is-valid file-processing"),i.html(""),e?i.fadeOut("slow"):i.hide())},_showFolderError:function(e){var t,i=this,a=i.$errorContainer;e&&(i.isAjaxUpload||i._clearFileInput(),t=i.msgFoldersNotAllowed.replace("{n}",e),i._addError(t),i._setValidationError(),a.fadeIn(i.fadeDelay),i._raise("filefoldererror",[e,t]))},_showFileError:function(e,t,i){var a=this,r=a.$errorContainer,n=i||"fileuploaderror",o=t&&t.fileId||"",s=t&&t.id?'
  • '+e+"
  • ":"
  • "+e+"
  • ";return 0===r.find("ul").length?a._addError("
      "+s+"
    "):r.find("ul").append(s),r.fadeIn(a.fadeDelay),a._raise(n,[t,e]),a._setValidationError("file-input-new"),!0},_showError:function(e,t,i){var a=this,r=a.$errorContainer,n=i||"fileerror";return t=t||{},t.reader=a.reader,a._addError(e),r.fadeIn(a.fadeDelay),a._raise(n,[t,e]),a.isAjaxUpload||a._clearFileInput(),a._setValidationError("file-input-new"),a.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(e){var t=this,i=t.minFileCount>1?t.filePlural:t.fileSingle,a=t.msgFilesTooLess.replace("{n}",t.minFileCount).replace("{files}",i),r=t.$errorContainer;a="
  • "+a+"
  • ",0===r.find("ul").length?t._addError("
      "+a+"
    "):r.find("ul").append(a),t.isError=!0,t._updateFileDetails(0),r.fadeIn(t.fadeDelay),t._raise("fileerror",[e,a]),t._clearFileInput(),t._setValidationError()},_parseError:function(t,i,a,r){var n,o,s,l=this,d=e.trim(a+"");return o=i.responseJSON&&i.responseJSON.error?i.responseJSON.error.toString():"",s=o?o:i.responseText,l.cancelling&&l.msgUploadAborted&&(d=l.msgUploadAborted),l.showAjaxErrorDetails&&s&&(o?d=e.trim(o+""):(s=e.trim(s.replace(/\n\s*\n/g,"\n")),n=s.length?"
    "+s+"
    ":"",d+=d?n:s)),d||(d=l.msgAjaxError.replace("{operation}",t)),l.cancelling=!1,r?""+r+": "+d:d},_parseFileType:function(e,t){var i,a,n,o,s=this,l=s.allowedPreviewTypes||[];if("application/text-plain"===e)return"text";for(o=0;o-1&&(i=t.split(".").pop(),a.previewFileIconSettings&&(r=a.previewFileIconSettings[i]||a.previewFileIconSettings[i.toLowerCase()]||null),a.previewFileExtSettings&&e.each(a.previewFileExtSettings,function(e,t){return a.previewFileIconSettings[e]&&t(i)?void(r=a.previewFileIconSettings[e]):void 0})),r||a.previewFileIcon},_parseFilePreviewIcon:function(e,t){var i=this,a=i._getPreviewIcon(t),r=e;return r.indexOf("{previewFileIcon}")>-1&&(r=r.setTokens({previewFileIconClass:i.previewFileIconClass,previewFileIcon:a})),r},_raise:function(t,i){var r=this,n=e.Event(t);i!==a?r.$element.trigger(n,i):r.$element.trigger(n);var o=n.result,s=o===!1;if(n.isDefaultPrevented()||s)return!1;if("filebatchpreupload"===n.type&&(o||s))return r.ajaxAborted=o,!1;switch(t){case"filebatchuploadcomplete":case"filebatchuploadsuccess":case"fileuploaded":case"fileclear":case"filecleared":case"filereset":case"fileerror":case"filefoldererror":case"fileuploaderror":case"filebatchuploaderror":case"filedeleteerror":case"filecustomerror":case"filesuccessremove":break;default:r.ajaxAborted||(r.ajaxAborted=o)}return!0},_listenFullScreen:function(e){var t,i,a=this,r=a.$modal;r&&r.length&&(t=r&&r.find(".btn-kv-fullscreen"),i=r&&r.find(".btn-kv-borderless"),t.length&&i.length&&(t.removeClass("active").attr("aria-pressed","false"),i.removeClass("active").attr("aria-pressed","false"),e?t.addClass("active").attr("aria-pressed","true"):i.addClass("active").attr("aria-pressed","true"),r.hasClass("file-zoom-fullscreen")?a._maximizeZoomDialog():e?a._maximizeZoomDialog():i.removeClass("active").attr("aria-pressed","false")))},_listen:function(){var a,n=this,o=n.$element,s=n.$form,l=n.$container;n._handler(o,"click",function(e){n._initFileSelected(),o.hasClass("file-no-browse")&&(o.data("zoneClicked")?o.data("zoneClicked",!1):e.preventDefault())}),n._handler(o,"change",e.proxy(n._change,n)),n._handler(n.$caption,"paste",e.proxy(n.paste,n)),n.showBrowse&&(n._handler(n.$btnFile,"click",e.proxy(n._browse,n)),n._handler(n.$btnFile,"keypress",function(e){var t=e.keyCode||e.which;13===t&&(o.trigger("click"),n._browse(e))})),n._handler(l.find(".fileinput-remove:not([disabled])"),"click",e.proxy(n.clear,n)),n._handler(l.find(".fileinput-cancel"),"click",e.proxy(n.cancel,n)),n._handler(l.find(".fileinput-pause"),"click",e.proxy(n.pause,n)),n._initDragDrop(),n._handler(s,"reset",e.proxy(n.clear,n)),n.isAjaxUpload||n._handler(s,"submit",e.proxy(n._submitForm,n)),n._handler(n.$container.find(".fileinput-upload"),"click",e.proxy(n._uploadClick,n)),n._handler(e(t),"resize",function(){n._listenFullScreen(screen.width===t.innerWidth&&screen.height===t.innerHeight)}),a="webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",n._handler(e(i),a,function(){n._listenFullScreen(r.checkFullScreen())}),n.$caption.on("focus",function(){n.$captionContainer.focus()}),n._autoFitContent(),n._initClickable(),n._refreshPreview()},_autoFitContent:function(){var a,r=t.innerWidth||i.documentElement.clientWidth||i.body.clientWidth,n=this,o=400>r?n.previewSettingsSmall||n.defaults.previewSettingsSmall:n.previewSettings||n.defaults.previewSettings;e.each(o,function(e,t){a=".file-preview-frame .file-preview-"+e,n.$preview.find(a+".kv-preview-data,"+a+" .kv-preview-data").css(t)})},_scanDroppedItems:function(e,t,i){i=i||"";var a,n,o,s=this,l=function(e){s._log(r.logMessages.badDroppedFiles),s._log(e)};e.isFile?e.file(function(e){i&&(e.newPath=i+e.name),t.push(e)},l):e.isDirectory&&(n=e.createReader(),(o=function(){n.readEntries(function(r){if(r&&r.length>0){for(a=0;a-1;return i._zoneDragDropInit(t),i.isDisabled||!n?(a.effectAllowed="none",void(a.dropEffect="none")):(a.dropEffect="copy",void(i._raise("fileDragEnter",{sourceEvent:t,files:a.types.Files})&&r.addCss(i.$dropZone,"file-highlighted")))},_zoneDragLeave:function(e){var t=this;t._zoneDragDropInit(e),t.isDisabled||t._raise("fileDragLeave",{sourceEvent:e})&&t.$dropZone.removeClass("file-highlighted")},_dropFiles:function(e,t){var i=this,a=i.$element;i.isAjaxUpload?i._change(e,t):(i.changeTriggered=!0,a.get(0).files=t,setTimeout(function(){i.changeTriggered=!1,a.trigger("change"+i.namespace)},i.processDelay)),i.$dropZone.removeClass("file-highlighted")},_zoneDrop:function(e){var t,i=this,a=(i.$element,e.originalEvent.dataTransfer),n=a.files,o=a.items,s=r.getDragDropFolders(o);if(e.preventDefault(),!i.isDisabled&&!r.isEmpty(n)&&i._raise("fileDragDrop",{sourceEvent:e,files:n}))if(s>0){if(!i.isAjaxUpload)return void i._showFolderError(s);for(n=[],t=0;t0&&n>=l,c=e(t.item);d&&(n=l-1),s.initialPreview=r.moveArray(s.initialPreview,a,n,p),s.initialPreviewConfig=r.moveArray(s.initialPreviewConfig,a,n,p),s.previewCache.init(),s.getFrames(".file-preview-initial").each(function(){e(this).attr("data-fileindex",r.INIT_FLAG+o),o++}),d&&(i=s.getFrames(":not(.file-preview-initial):first"),i.length&&c.slideUp(function(){c.insertBefore(i).slideDown()})),s._raise("filesorted",{previewId:c.attr("id"),oldIndex:a,newIndex:n,stack:s.initialPreviewConfig})}},e.extend(!0,i,s.fileActionSettings.dragSettings),s.sortable&&s.sortable.destroy(),s.sortable=f.create(l[0],i))},_setPreviewContent:function(e){var t=this;r.setHtml(t.$preview,e),t._autoFitContent()},_initPreviewImageOrientations:function(){var t=this,i=0,a=t.canOrientImage;(t.autoOrientImageInitial||a)&&t.getFrames(".file-preview-initial").each(function(){var r,n,o,s=e(this),l=t.initialPreviewConfig[i];l&&l.exif&&l.exif.Orientation&&(o=s.attr("id"),r=s.find(">.kv-file-content img"),n=t._getZoom(o," >.kv-file-content img"),a?r.css("image-orientation",t.autoOrientImageInitial?"from-image":"none"):t.setImageOrientation(r,n,l.exif.Orientation,s)),i++})},_initPreview:function(e){var t,i=this,a=i.initialCaption||"";return i.previewCache.count(!0)?(t=i.previewCache.out(),a=e&&i.initialCaption?i.initialCaption:t.caption,i._setPreviewContent(t.content),i._setInitThumbAttr(),i._setCaption(a),i._initSortable(),r.isEmpty(t.content)||i.$container.removeClass("file-input-new"),void i._initPreviewImageOrientations()):(i._clearPreview(),void(e?i._setCaption(a):i._initCaption()))},_getZoomButton:function(e){var t=this,i=t.previewZoomButtonIcons[e],a=t.previewZoomButtonClasses[e],n=' title="'+(t.previewZoomButtonTitles[e]||"")+'" ',o=r.isBs(5)?"bs-":"",s=n+("close"===e?" data-"+o+'dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==e&&"borderless"!==e&&"toggleheader"!==e||(s+=' data-toggle="button" aria-pressed="false" autocomplete="off"'),'"},_getModalContent:function(){var e=this;return e._getLayoutTemplate("modal").setTokens({rtl:e.rtl?" kv-rtl":"",zoomFrameClass:e.frameClass,prev:e._getZoomButton("prev"),next:e._getZoomButton("next"),toggleheader:e._getZoomButton("toggleheader"),fullscreen:e._getZoomButton("fullscreen"),borderless:e._getZoomButton("borderless"),close:e._getZoomButton("close")})},_listenModalEvent:function(e){var t=this,i=t.$modal,a=function(e){return{sourceEvent:e,previewId:i.data("previewId"),modal:i}};i.on(e+".bs.modal",function(n){if("bs.modal"===n.namespace){var o=i.find(".btn-fullscreen"),s=i.find(".btn-borderless");i.data("fileinputPluginId")===t.$element.attr("id")&&t._raise("filezoom"+e,a(n)),"shown"===e&&(s.removeClass("active").attr("aria-pressed","false"),o.removeClass("active").attr("aria-pressed","false"),i.hasClass("file-zoom-fullscreen")&&(t._maximizeZoomDialog(),r.checkFullScreen()?o.addClass("active").attr("aria-pressed","true"):s.addClass("active").attr("aria-pressed","true")))}})},_initZoom:function(){var t,i=this,a=i._getLayoutTemplate("modalMain"),n="#"+r.MODAL_ID;a=i._setTabIndex("modal",a),i.showPreview&&(i.$modal=e(n),i.$modal&&i.$modal.length||(t=r.createElement(r.cspBuffer.stash(a)).insertAfter(i.$container),i.$modal=e(n).insertBefore(t),r.cspBuffer.apply(i.$modal),t.remove()),r.initModal(i.$modal),i.$modal.html(r.cspBuffer.stash(i._getModalContent())),r.cspBuffer.apply(i.$modal),e.each(r.MODAL_EVENTS,function(e,t){i._listenModalEvent(t)}))},_initZoomButtons:function(){var t,i,a=this,r=a.$modal.data("previewId")||"",n=a.getFrames().toArray(),o=n.length,s=a.$modal.find(".btn-kv-prev"),l=a.$modal.find(".btn-kv-next");return n.length<2?(s.hide(),void l.hide()):(s.show(),l.show(),void(o&&(t=e(n[0]),i=e(n[o-1]),s.removeAttr("disabled"),l.removeAttr("disabled"),a.reversePreviewOrder&&([s,l]=[l,s]),t.length&&t.attr("id")===r&&s.attr("disabled",!0),i.length&&i.attr("id")===r&&l.attr("disabled",!0))))},_maximizeZoomDialog:function(){var i=this,a=i.$modal,r=a.find(".modal-header:visible"),n=a.find(".modal-footer:visible"),o=a.find(".kv-zoom-body"),s=e(t).height(),l=0;a.addClass("file-zoom-fullscreen"),r&&r.length&&(s-=r.outerHeight(!0)),n&&n.length&&(s-=n.outerHeight(!0)),o&&o.length&&(l=o.outerHeight(!0)-o.height(),s-=l),a.find(".kv-zoom-body").height(s)},_resizeZoomDialog:function(e){var t=this,i=t.$modal,a=i.find(".btn-kv-fullscreen"),n=i.find(".btn-kv-borderless");if(i.hasClass("file-zoom-fullscreen"))r.toggleFullScreen(!1),e?a.hasClass("active")||(i.removeClass("file-zoom-fullscreen"),t._resizeZoomDialog(!0),n.hasClass("active")&&n.removeClass("active").attr("aria-pressed","false")):a.hasClass("active")?a.removeClass("active").attr("aria-pressed","false"):(i.removeClass("file-zoom-fullscreen"),t.$modal.find(".kv-zoom-body").css("height",t.zoomModalHeight));else{if(!e)return void t._maximizeZoomDialog();r.toggleFullScreen(!0)}i.focus()},_setZoomContent:function(t,i){var a,n,o,s,l,d,c,u,p,f,g,m,h=this,v=t.attr("id"),b=h._getZoom(v),w=h.$modal,_=w.find(".btn-kv-fullscreen"),C=w.find(".btn-kv-borderless"),x=w.find(".btn-kv-toggleheader"),y=t.data("zoom");y&&(y=decodeURIComponent(y),m=b.html().replace(r.ZOOM_VAR,"").setTokens({zoomData:y}),b.html(m),t.data("zoom",""),b.attr("data-zoom",y)),n=b.attr("data-template")||"generic",a=b.find(".kv-file-content"),o=a.length?'\n'+a.html():"",f=t.data("caption")||h.msgZoomModalHeading,g=t.data("size")||"",u=t.data("description")||"",w.find(".kv-zoom-caption").attr("title",f).html(f),w.find(".kv-zoom-size").html(g),p=w.find(".kv-zoom-description").hide(),u&&(h.showDescriptionClose&&(u=h._getLayoutTemplate("descriptionClose").setTokens({closeIcon:h.previewZoomButtonIcons.close})+""+u),p.show().html(u),h.showDescriptionClose&&h._handler(w.find(".kv-desc-hide"),"click",function(){e(this).parent().fadeOut("fast",function(){w.focus()})})),s=w.find(".kv-zoom-body"),w.removeClass("kv-single-content"),i?(c=s.addClass("file-thumb-loading").clone().insertAfter(s),r.setHtml(s,o).hide(),c.fadeOut("fast",function(){s.fadeIn("fast",function(){s.removeClass("file-thumb-loading")}),c.remove()})):r.setHtml(s,o),d=h.previewZoomSettings[n],d&&(l=s.find(".kv-preview-data"),r.addCss(l,"file-zoom-detail"),e.each(d,function(e,t){l.css(e,t),(l.attr("width")&&"width"===e||l.attr("height")&&"height"===e)&&l.removeAttr(e)})),w.data("previewId",v),h._handler(w.find(".btn-kv-prev"),"click",function(){h._zoomSlideShow("prev",v)}),h._handler(w.find(".btn-kv-next"),"click",function(){h._zoomSlideShow("next",v)}),h._handler(_,"click",function(){h._resizeZoomDialog(!0)}),h._handler(C,"click",function(){h._resizeZoomDialog(!1)}),h._handler(x,"click",function(){var e,t=w.find(".modal-header"),i=w.find(".floating-buttons"),a=t.find(".kv-zoom-actions"),r=function(e){var i=h.$modal.find(".kv-zoom-body"),a=h.zoomModalHeight;w.hasClass("file-zoom-fullscreen")&&(a=i.outerHeight(!0),e||(a-=t.outerHeight(!0))),i.css("height",e?a+e:a)};t.is(":visible")?(e=t.outerHeight(!0),t.slideUp("slow",function(){a.find(".btn").appendTo(i),r(e)})):(i.find(".btn").appendTo(a),t.slideDown("slow",function(){r()})),w.focus()}),h._handler(w,"keydown",function(t){var i,a,r=t.which||t.keyCode,n=h.processDelay+1,o=e(this).find(".btn-kv-prev"),s=e(this).find(".btn-kv-next"),l=e(this).data("previewId");[i,a]=h.rtl?[39,37]:[37,39],e.each({prev:[o,i],next:[s,a]},function(e,t){var i=t[0],a=t[1];r===a&&i.length&&(w.focus(),i.attr("disabled")||(i.focus(),h._zoomSlideShow(e,l),setTimeout(function(){i.attr("disabled")&&w.focus()},n)))})})},_showModal:function(e){var t=this,i=t.$modal;e&&e.length&&(r.initModal(i),r.setHtml(i,t._getModalContent()),t._setZoomContent(e),i.data({backdrop:!1}),i.modal("show"),t._initZoomButtons())},_zoomPreview:function(e){var t,i=this;if(!e.length)throw"Cannot zoom to detailed preview!";t=e.closest(r.FRAMES),i._showModal(t)},_zoomSlideShow:function(t,i){var a,r,n,o,s=this,l=s.$modal.find(".kv-zoom-actions .btn-kv-"+t),d=s.getFrames().toArray(),c=[],u=d.length;if(s.reversePreviewOrder&&(t="prev"===t?"next":"prev"),!l.attr("disabled")){for(r=0;u>r;r++)n=e(d[r]),n&&n.length&&n.find(".kv-file-zoom:visible").length&&c.push(d[r]);for(u=c.length,r=0;u>r;r++)if(e(c[r]).attr("id")===i){o="prev"===t?r-1:r+1;break}0>o||o>=u||!c[o]||(a=e(c[o]),a.length&&s._setZoomContent(a,t),s._initZoomButtons(),s._raise("filezoom"+t,{previewId:i,modal:s.$modal}))}},_initZoomButton:function(){var t=this;t.$preview.find(".kv-file-zoom").each(function(){var i=e(this);t._handler(i,"click",function(){t._zoomPreview(i)})})},_inputFileCount:function(){return this.$element[0].files.length},_refreshPreview:function(){var t,i=this;(i._inputFileCount()||i.isAjaxUpload)&&i.showPreview&&i.isPreviewable&&(i.isAjaxUpload&&i.fileManager.count()>0?(t=e.extend(!0,{},i.getFileList()),i.fileManager.clear(),i._clearFileInput()):t=i.$element[0].files, -t&&t.length&&(i.readFiles(t),i._setFileDropZoneTitle()))},_clearObjects:function(t){t.find("video audio").each(function(){this.pause(),e(this).remove()}),t.find("img object div").each(function(){e(this).remove()})},_clearFileInput:function(){var t,a,r,n=this,o=n.$element;n._inputFileCount()&&(t=o.closest("form"),a=e(i.createElement("form")),r=e(i.createElement("div")),o.before(r),t.length?t.after(a):r.after(a),a.append(o).trigger("reset"),r.before(o).remove(),a.remove())},_resetUpload:function(){var e=this;e.uploadStartTime=r.now(),e.uploadCache=[],e.$btnUpload.removeAttr("disabled"),e._setProgress(0),e._hideProgress(),e._resetErrors(!1),e._initAjax(),e.fileManager.clearImages(),e._resetCanvas(),e.overwriteInitial&&(e.initialPreview=[],e.initialPreviewConfig=[],e.initialPreviewThumbTags=[],e.previewCache.data={content:[],config:[],tags:[]})},_resetCanvas:function(){var e=this;e.imageCanvas&&e.imageCanvasContext&&e.imageCanvasContext.clearRect(0,0,e.imageCanvas.width,e.imageCanvas.height)},_hasInitialPreview:function(){var e=this;return!e.overwriteInitial&&e.previewCache.count(!0)},_resetPreview:function(){var t,i,a,n=this,o=n.showUploadedThumbs,s=!n.removeFromPreviewOnError,l=(o||s)&&n.isDuplicateError;n.previewCache.count(!0)?(t=n.previewCache.out(),l&&(a=r.createElement("").insertAfter(n.$container),n.getFrames().each(function(){var t=e(this);(o&&t.hasClass("file-preview-success")||s&&t.hasClass("file-preview-error"))&&a.append(t)})),n._setPreviewContent(t.content),n._setInitThumbAttr(),i=n.initialCaption?n.initialCaption:t.caption,n._setCaption(i),l&&(a.contents().appendTo(n.$preview),a.remove())):(n._clearPreview(),n._initCaption()),n.showPreview&&(n._initZoom(),n._initSortable()),n.isDuplicateError=!1},_clearDefaultPreview:function(){var e=this;e.$preview.find(".file-default-preview").remove()},_validateDefaultPreview:function(){var e=this;e.showPreview&&!r.isEmpty(e.defaultPreviewContent)&&(e._setPreviewContent('
    '+e.defaultPreviewContent+"
    "),e.$container.removeClass("file-input-new"),e._initClickable())},_resetPreviewThumbs:function(e){var t,i=this;return e?(i._clearPreview(),void i.clearFileStack()):void(i._hasInitialPreview()?(t=i.previewCache.out(),i._setPreviewContent(t.content),i._setInitThumbAttr(),i._setCaption(t.caption),i._initPreviewActions()):i._clearPreview())},_getLayoutTemplate:function(e){var t=this,i=t.layoutTemplates[e];return r.isEmpty(t.customLayoutTags)?i:r.replaceTags(i,t.customLayoutTags)},_getPreviewTemplate:function(e){var t=this,i=t.previewTemplates,a=i[e]||i.other;return r.isEmpty(t.customPreviewTags)?a:r.replaceTags(a,t.customPreviewTags)},_getOutData:function(e,t,i,a){var r=this;return t=t||{},i=i||{},a=a||r.fileManager.list(),{formdata:e,files:a,filenames:r.filenames,filescount:r.getFilesCount(),extra:r._getExtraData(),response:i,reader:r.reader,jqXHR:t}},_getMsgSelected:function(e,t){var i=this,a=1===e?i.fileSingle:i.filePlural;return e>0?i.msgSelected.replace("{n}",e).replace("{files}",a):t?i.msgProcessing:i.msgNoFilesSelected},_getFrame:function(e,t){var i=this,a=r.getFrameElement(i.$preview,e);return!i.showPreview||t||a.length||i._log(r.logMessages.invalidThumb,{id:e}),a},_getZoom:function(e,t){var i=this,a=r.getZoomElement(i.$preview,e,t);return i.showPreview&&!a.length&&i._log(r.logMessages.invalidThumb,{id:e}),a},_getThumbs:function(e){return e=e||"",this.getFrames(":not(.file-preview-initial)"+e)},_getThumbId:function(e){var t=this;return t.previewInitId+"-"+e},_getExtraData:function(e,t){var i=this,a=i.uploadExtraData;return"function"==typeof i.uploadExtraData&&(a=i.uploadExtraData(e,t)),a},_initXhr:function(e,t){var i=this,a=i.fileManager,n=function(e){var n=0,o=e.total,s=e.loaded||e.position,l=a.getUploadStats(t,s,o);e.lengthComputable&&!i.enableResumableUpload&&(n=r.round(s/o*100)),t?i._setFileUploadStats(t,n,l):i._setProgress(n,null,null,i._getStats(l)),i._raise("fileajaxprogress",[l])};return e.upload&&(i.progressDelay&&(n=r.debounce(n,i.progressDelay)),e.upload.addEventListener("progress",n,!1)),e},_initAjaxSettings:function(){var t=this;t._ajaxSettings=e.extend(!0,{},t.ajaxSettings),t._ajaxDeleteSettings=e.extend(!0,{},t.ajaxDeleteSettings)},_mergeAjaxCallback:function(e,t,i){var a,r=this,n=r._ajaxSettings,o=r.mergeAjaxCallbacks;"delete"===i&&(n=r._ajaxDeleteSettings,o=r.mergeAjaxDeleteCallbacks),a=n[e],o&&"function"==typeof a?"before"===o?n[e]=function(){a.apply(this,arguments),t.apply(this,arguments)}:n[e]=function(){t.apply(this,arguments),a.apply(this,arguments)}:n[e]=t},_ajaxSubmit:function(t,i,a,r,n,o,s,l){var d,c,u,p,f=this;f._raise("filepreajax",[n,o,s])&&(n.append("initialPreview",JSON.stringify(f.initialPreview)),n.append("initialPreviewConfig",JSON.stringify(f.initialPreviewConfig)),n.append("initialPreviewThumbTags",JSON.stringify(f.initialPreviewThumbTags)),f._initAjaxSettings(),f._mergeAjaxCallback("beforeSend",t),f._mergeAjaxCallback("success",i),f._mergeAjaxCallback("complete",a),f._mergeAjaxCallback("error",r),l=l||f.uploadUrlThumb||f.uploadUrl,"function"==typeof l&&(l=l()),u=f._getExtraData(o,s)||{},"object"==typeof u&&e.each(u,function(e,t){n.append(e,t)}),c={xhr:function(){var t=e.ajaxSettings.xhr();return f._initXhr(t,o)},url:f._encodeURI(l),type:"POST",dataType:"json",data:n,cache:!1,processData:!1,contentType:!1},d=e.extend(!0,{},c,f._ajaxSettings),p=f.taskManager.addTask(o+"-"+s,function(){var t,i,a=this.self;t=a.ajaxQueue.shift(),i=e.ajax(t),a.ajaxRequests.push(i)}),f.ajaxQueue.push(d),p.runWithContext({self:f}))},_mergeArray:function(e,t){var i=this,a=r.cleanArray(i[e]),n=r.cleanArray(t);i[e]=a.concat(n)},_initUploadSuccess:function(t,i,n){var o,s,l,d,c,u,p,f,g,m=this;return!m.showPreview||"object"!=typeof t||e.isEmptyObject(t)?void m._resetCaption():(t.initialPreview!==a&&t.initialPreview.length>0&&(m.hasInitData=!0,c=t.initialPreview||[],u=t.initialPreviewConfig||[],p=t.initialPreviewThumbTags||[],o=t.append===a||t.append,c.length>0&&!r.isArray(c)&&(c=c.split(m.initialPreviewDelimiter)),c.length&&(m._mergeArray("initialPreview",c),m._mergeArray("initialPreviewConfig",u),m._mergeArray("initialPreviewThumbTags",p)),i!==a?n?(f=i.attr("id"),g=m._getUploadCacheIndex(f),null!==g&&(m.uploadCache[g]={id:f,content:c[0],config:u[0]||[],tags:p[0]||[],append:o})):(l=m.previewCache.add(c[0],u[0],p[0],o),s=m.previewCache.get(l,!1),d=r.createElement(s).hide().appendTo(i),i.fadeOut("slow",function(){var e=d.find("> .file-preview-frame");e&&e.length&&e.insertBefore(i).fadeIn("slow").css("display:inline-block"),m._initPreviewActions(),m._clearFileInput(),i.remove(),d.remove(),m._initSortable()})):(m.previewCache.set(c,u,p,o),m._initPreview(),m._initPreviewActions())),void m._resetCaption())},_getUploadCacheIndex:function(e){var t,i,a=this,r=a.uploadCache.length;for(t=0;r>t;t++)if(i=a.uploadCache[t],i.id===e)return t;return null},_initSuccessThumbs:function(){var t=this;t.showPreview&&setTimeout(function(){t._getThumbs(r.FRAMES+".file-preview-success").each(function(){var i=e(this),a=i.find(".kv-file-remove");a.removeAttr("disabled"),t._handler(a,"click",function(){var e=i.attr("id"),a=t._raise("filesuccessremove",[e,i.attr("data-fileindex")]);r.cleanMemory(i),a!==!1&&(t.$caption.attr("title",""),i.fadeOut("slow",function(){t.fileManager;i.remove(),t.getFrames().length||t.reset()}))})})},t.processDelay)},_updateInitialPreview:function(){var t=this,i=t.uploadCache;t.showPreview&&(e.each(i,function(e,i){t.previewCache.add(i.content,i.config,i.tags,i.append)}),t.hasInitData&&(t._initPreview(),t._initPreviewActions()))},_getThumbFileId:function(e){var t=this;return t.showPreview&&e!==a?e.attr("data-fileid"):null},_getThumbFile:function(e){var t=this,i=t._getThumbFileId(e);return i?t.fileManager.getFile(i):null},_uploadSingle:function(t,i,a){var n,o,s,l,d,c,u,p,f,g,m,h,v,b=this,w=b.fileManager,_=w.count(),C=new FormData,x=b._getThumbId(i),y=_>0||!e.isEmptyObject(b.uploadExtraData),T=b.ajaxOperations.uploadThumb,P=w.getFile(i),k={id:x,index:t,fileId:i},F=b.fileManager.getFileName(i,!0);b.enableResumableUpload||(b.showPreview&&(o=w.getThumb(i),u=o.find(".file-thumb-progress"),l=o.find(".kv-file-upload"),d=o.find(".kv-file-remove"),u.show()),0===_||!y||b.showPreview&&l&&l.hasClass("disabled")||b._abort(k)||(v=function(){c?w.errors.push(i):w.removeFile(i),w.setProcessed(i),w.isProcessed()&&(b.fileBatchCompleted=!0,s())},s=function(){var e;b.fileBatchCompleted&&setTimeout(function(){var t=0===w.count(),i=w.errors.length;b._updateInitialPreview(),b.unlock(t),t&&b._clearFileInput(),e=b.$preview.find(".file-preview-initial"),b.uploadAsync&&e.length&&(r.addCss(e,r.SORT_CSS),b._initSortable()),b._raise("filebatchuploadcomplete",[w.stack,b._getExtraData()]),b.retryErrorUploads&&0!==i||w.clear(),b._setProgress(101),b.ajaxAborted=!1},b.processDelay)},p=function(s){n=b._getOutData(C,s),w.initStats(i),b.fileBatchCompleted=!1,a||(b.ajaxAborted=!1),b.showPreview&&(o.hasClass("file-preview-success")||(b._setThumbStatus(o,"Loading"),r.addCss(o,"file-uploading")),l.attr("disabled",!0),d.attr("disabled",!0)),a||b.lock(),-1!==w.errors.indexOf(i)&&delete w.errors[i],b._raise("filepreupload",[n,x,t,b._getThumbFileId(o)]),e.extend(!0,k,n),b._abort(k)&&(s.abort(),a||(b._setThumbStatus(o,"New"),o.removeClass("file-uploading"),l.removeAttr("disabled"),d.removeAttr("disabled")),b._setProgressCancelled())},g=function(s,d,p){var g=b.showPreview&&o.attr("id")?o.attr("id"):x;n=b._getOutData(C,p,s),e.extend(!0,k,n),setTimeout(function(){r.isEmpty(s)||r.isEmpty(s.error)?(b.showPreview&&(b._setThumbStatus(o,"Success"),l.hide(),b._initUploadSuccess(s,o,a),b._setProgress(101,u)),b._raise("fileuploaded",[n,g,t,b._getThumbFileId(o)]),a?v():b.fileManager.remove(o)):(c=!0,f=b._parseError(T,p,b.msgUploadError,b.fileManager.getFileName(i)),b._showFileError(f,k),b._setPreviewError(o,!0),b.retryErrorUploads||l.hide(),a&&v(),b._setProgress(101,b._getFrame(g).find(".file-thumb-progress"),b.msgUploadError))},b.processDelay)},m=function(){b.showPreview&&(l.removeAttr("disabled"),d.removeAttr("disabled"),o.removeClass("file-uploading")),a?s():(b.unlock(!1),b._clearFileInput()),b._initSuccessThumbs()},h=function(t,r,n){f=b._parseError(T,t,n,b.fileManager.getFileName(i)),c=!0,setTimeout(function(){var r;a&&v(),b.fileManager.setProgress(i,100),b._setPreviewError(o,!0),b.retryErrorUploads||l.hide(),e.extend(!0,k,b._getOutData(C,t)),b._setProgress(101,b.$progress,b.msgAjaxProgressError.replace("{operation}",T)),r=b.showPreview&&o?o.find(".file-thumb-progress"):"",b._setProgress(101,r,b.msgUploadError),b._showFileError(f,k)},b.processDelay)},b._setFileData(C,P.file,F,i),b._setUploadData(C,{fileId:i}),b._ajaxSubmit(p,g,m,h,C,i,t)))},_setFileData:function(e,t,i,a){var r=this,n=r.preProcessUpload;n&&"function"==typeof n?e.append(r.uploadFileAttr,n(a,t)):e.append(r.uploadFileAttr,t,i)},_checkBatchPreupload:function(t,i){var a=this,r=a._raise("filebatchpreupload",[t]);return r?!0:(a._abort(t),i&&i.abort(),a._getThumbs().each(function(){var t=e(this),i=t.find(".kv-file-upload"),r=t.find(".kv-file-remove");t.hasClass("file-preview-loading")&&(a._setThumbStatus(t,"New"),t.removeClass("file-uploading")),i.removeAttr("disabled"),r.removeAttr("disabled")}),a._setProgressCancelled(),!1)},_uploadBatch:function(){var t,i,a,n,o,s,l=this,d=l.fileManager,c=d.total(),u={},p=c>0||!e.isEmptyObject(l.uploadExtraData),f=new FormData,g=l.ajaxOperations.uploadBatch;if(0!==c&&p&&!l._abort(u)){s=function(){l.fileManager.clear(),l._clearFileInput()},t=function(t){l.lock(),d.initStats();var i=l._getOutData(f,t);l.ajaxAborted=!1,l.showPreview&&l._getThumbs().each(function(){var t=e(this),i=t.find(".kv-file-upload"),a=t.find(".kv-file-remove");t.hasClass("file-preview-success")||(l._setThumbStatus(t,"Loading"),r.addCss(t,"file-uploading")),i.attr("disabled",!0),a.attr("disabled",!0)}),l._checkBatchPreupload(i,t)},i=function(t,i,a){var n=l._getOutData(f,a,t),d=0,c=l._getThumbs(":not(.file-preview-success)"),u=r.isEmpty(t)||r.isEmpty(t.errorkeys)?[]:t.errorkeys;r.isEmpty(t)||r.isEmpty(t.error)?(l._raise("filebatchuploadsuccess",[n]),s(),l.showPreview?(c.each(function(){var t=e(this);l._setThumbStatus(t,"Success"),t.removeClass("file-uploading"),t.find(".kv-file-upload").hide().removeAttr("disabled")}),l._initUploadSuccess(t)):l.reset(),l._setProgress(101)):(l.showPreview&&(c.each(function(){var t=e(this);t.removeClass("file-uploading"),t.find(".kv-file-upload").removeAttr("disabled"),t.find(".kv-file-remove").removeAttr("disabled"),0===u.length||-1!==e.inArray(d,u)?(l._setPreviewError(t,!0),l.retryErrorUploads||(t.find(".kv-file-upload").hide(),l.fileManager.remove(t))):(t.find(".kv-file-upload").hide(),l._setThumbStatus(t,"Success"),l.fileManager.remove(t)),t.hasClass("file-preview-error")&&!l.retryErrorUploads||d++}),l._initUploadSuccess(t)),o=l._parseError(g,a,l.msgUploadError),l._showFileError(o,n,"filebatchuploaderror"),l._setProgress(101,l.$progress,l.msgUploadError))},n=function(){l.unlock(),l._initSuccessThumbs(),l._clearFileInput(),l._raise("filebatchuploadcomplete",[l.fileManager.stack,l._getExtraData()])},a=function(t,i,a){var r=l._getOutData(f,t);o=l._parseError(g,t,a),l._showFileError(o,r,"filebatchuploaderror"),l.uploadFileCount=c-1,l.showPreview&&(l._getThumbs().each(function(){var t=e(this);t.removeClass("file-uploading"),l._getThumbFile(t)&&l._setPreviewError(t)}),l._getThumbs().removeClass("file-uploading"),l._getThumbs(" .kv-file-upload").removeAttr("disabled"),l._getThumbs(" .kv-file-delete").removeAttr("disabled"),l._setProgress(101,l.$progress,l.msgAjaxProgressError.replace("{operation}",g)))};var m=0;e.each(l.fileManager.stack,function(e,t){r.isEmpty(t.file)||l._setFileData(f,t.file,t.nameFmt||"untitled_"+m,e),m++}),l._ajaxSubmit(t,i,n,a,f)}},_uploadExtraOnly:function(){var e,t,i,a,n,o=this,s={},l=new FormData,d=o.ajaxOperations.uploadExtra;e=function(e){o.lock();var t=o._getOutData(l,e);o._setProgress(50),s.data=t,s.xhr=e,o._checkBatchPreupload(t,e)},t=function(e,t,i){var a=o._getOutData(l,i,e);r.isEmpty(e)||r.isEmpty(e.error)?(o._raise("filebatchuploadsuccess",[a]),o._clearFileInput(),o._initUploadSuccess(e),o._setProgress(101)):(n=o._parseError(d,i,o.msgUploadError),o._showFileError(n,a,"filebatchuploaderror"))},i=function(){o.unlock(),o._clearFileInput(),o._raise("filebatchuploadcomplete",[o.fileManager.stack,o._getExtraData()])},a=function(e,t,i){var a=o._getOutData(l,e);n=o._parseError(d,e,i),s.data=a,o._showFileError(n,a,"filebatchuploaderror"),o._setProgress(101,o.$progress,o.msgAjaxProgressError.replace("{operation}",d))},o._ajaxSubmit(e,t,i,a,l)},_deleteFileIndex:function(t){var i=this,a=t.attr("data-fileindex"),n=i.reversePreviewOrder;a.substring(0,5)===r.INIT_FLAG&&(a=parseInt(a.replace(r.INIT_FLAG,"")),i.initialPreview=r.spliceArray(i.initialPreview,a,n),i.initialPreviewConfig=r.spliceArray(i.initialPreviewConfig,a,n),i.initialPreviewThumbTags=r.spliceArray(i.initialPreviewThumbTags,a,n),i.getFrames().each(function(){var t=e(this),i=t.attr("data-fileindex");i.substring(0,5)===r.INIT_FLAG&&(i=parseInt(i.replace(r.INIT_FLAG,"")),i>a&&(i--,t.attr("data-fileindex",r.INIT_FLAG+i)))}))},_resetCaption:function(){var e=this;setTimeout(function(){var t,i,a,r="",n=e.previewCache.count(!0),o=e.fileManager.count(),s=":not(.file-preview-success):not(.file-preview-error)",l=e.showPreview&&e.getFrames(s).length;0!==o||0!==n||l?(t=n+o,t>1?r=e._getMsgSelected(t):0===o?(a=e.initialPreviewConfig[0],r="",a&&(r=a.caption||a.filename||""),r||(r=e._getMsgSelected(t))):(i=e.fileManager.getFirstFile(),r=i?i.nameFmt:"_"),e._setCaption(r)):e.reset()},e.processDelay)},_initFileActions:function(){var t=this;t.showPreview&&(t._initZoomButton(),t.getFrames(" .kv-file-remove").each(function(){var i,a,n=e(this),o=n.closest(r.FRAMES),s=o.attr("id"),l=o.attr("data-fileindex");t.fileManager;t._handler(n,"click",function(){return a=t._raise("filepreremove",[s,l]),a!==!1&&t._validateMinCount()?(i=o.hasClass("file-preview-error"),r.cleanMemory(o),void o.fadeOut("slow",function(){t.fileManager.remove(o),t._clearObjects(o),o.remove(),s&&i&&t.$errorContainer.find('li[data-thumb-id="'+s+'"]').fadeOut("fast",function(){e(this).remove(),t._errorsExist()||t._resetErrors()}),t._clearFileInput(),t._resetCaption(),t._raise("fileremoved",[s,l])})):!1})}),t.getFrames(" .kv-file-upload").each(function(){var i=e(this);t._handler(i,"click",function(){var e=i.closest(r.FRAMES),a=t._getThumbFileId(e);t._hideProgress(),e.hasClass("file-preview-error")&&!t.retryErrorUploads||t._uploadSingle(t.fileManager.getIndex(a),a,!1)})}))},_initPreviewActions:function(){var t=this,i=t.$preview,n=t.deleteExtraData||{},o=r.FRAMES+" .kv-file-remove",s=t.fileActionSettings,l=s.removeClass,d=s.removeErrorClass,c=function(){var e=t.isAjaxUpload?t.previewCache.count(!0):t._inputFileCount();t.getFrames().length||e?t._resetCaption():(t._setCaption(""),t.reset(),t.initialCaption="")};t._initZoomButton(),i.find(o).each(function(){var i,o,s,u,p=e(this),f=p.data("url")||t.deleteUrl,g=p.data("key"),m=t.ajaxOperations.deleteThumb;if(!r.isEmpty(f)&&g!==a){"function"==typeof f&&(f=f());var h,v,b,w,_,C=p.closest(r.FRAMES),x=t.previewCache.data,y=C.attr("data-fileindex");y=parseInt(y.replace(r.INIT_FLAG,"")),b=r.isEmpty(x.config)&&r.isEmpty(x.config[y])?null:x.config[y],_=r.isEmpty(b)||r.isEmpty(b.extra)?n:b.extra,w=b&&(b.filename||b.caption)||"","function"==typeof _&&(_=_()),v={id:p.attr("id"),key:g,extra:_},o=function(e){t.ajaxAborted=!1,t._raise("filepredelete",[g,e,_]),t._abort()?e.abort():(p.removeClass(d),r.addCss(C,"file-uploading"),r.addCss(p,"disabled "+l))},s=function(e,a,n){var o,s;return r.isEmpty(e)||r.isEmpty(e.error)?(C.removeClass("file-uploading").addClass("file-deleted"),void C.fadeOut("slow",function(){y=parseInt(C.attr("data-fileindex").replace(r.INIT_FLAG,"")),t.previewCache.unset(y),t._deleteFileIndex(C),o=t.previewCache.count(!0),s=o>0?t._getMsgSelected(o):"",t._setCaption(s),t._raise("filedeleted",[g,n,_]),t._clearObjects(C),C.remove(),c()})):(v.jqXHR=n,v.response=e,i=t._parseError(m,n,t.msgDeleteError,w),t._showFileError(i,v,"filedeleteerror"),C.removeClass("file-uploading"),p.removeClass("disabled "+l).addClass(d),void c())},u=function(e,i,a){var r=t._parseError(m,e,a,w);v.jqXHR=e,v.response={},t._showFileError(r,v,"filedeleteerror"),C.removeClass("file-uploading"),p.removeClass("disabled "+l).addClass(d),c()},t._initAjaxSettings(),t._mergeAjaxCallback("beforeSend",o,"delete"),t._mergeAjaxCallback("success",s,"delete"),t._mergeAjaxCallback("error",u,"delete"),h=e.extend(!0,{},{url:t._encodeURI(f),type:"POST",dataType:"json",data:e.extend(!0,{},{key:g},_)},t._ajaxDeleteSettings),t._handler(p,"click",function(){return t._validateMinCount()?(t.ajaxAborted=!1,t._raise("filebeforedelete",[g,_]),void(t.ajaxAborted instanceof Promise?t.ajaxAborted.then(function(t){t||e.ajax(h)}):t.ajaxAborted||e.ajax(h))):!1})}})},_hideFileIcon:function(){var e=this;e.overwriteInitial&&e.$captionContainer.removeClass("icon-visible")},_showFileIcon:function(){var e=this;r.addCss(e.$captionContainer,"icon-visible")},_getSize:function(t,i){var a,r,n=this,o=parseFloat(t),s=n.fileSizeGetter;return e.isNumeric(t)&&e.isNumeric(o)?("function"==typeof s?r=s(o):0===o?r="0.00 B":(i||(i=n.sizeUnits),a=Math.floor(Math.log(o)/Math.log(n.bytesToKB)),r=(o/Math.pow(n.bytesToKB,a)).toFixed(2)+" "+i[a]),n._getLayoutTemplate("size").replace("{sizeText}",r)):""},_getFileType:function(e){var t=this;return t.mimeTypeAliases[e]||e},_generatePreviewTemplate:function(n,o,s,l,d,c,u,p,f,g,m,h,v,b){var w,_,C,x=this,y=x.slug(s),T="",P="",k=t.innerWidth||i.documentElement.clientWidth||i.body.clientWidth,F=y,S=y,E="type-default",I=g||x._renderFileFooter(n,y,p,"auto",u),A=x.preferIconicPreview,D=x.preferIconicZoomPreview,z=A?"other":n;return _=400>k?x.previewSettingsSmall[z]||x.defaults.previewSettingsSmall[z]:x.previewSettings[z]||x.defaults.previewSettings[z],_&&e.each(_,function(e,t){P+=e+":"+t+";"}),C=function(t,i,o,u,p){var g,b=o?"zoom-"+d:d,w=x._getPreviewTemplate(t),_=(f||"")+" "+u;return x.frameClass&&(_=x.frameClass+" "+_),o&&(_=_.replace(" "+r.SORT_CSS,"")),w=x._parseFilePreviewIcon(w,s),"object"!==n||l||e.each(x.defaults.fileTypeSettings,function(e,t){"object"!==e&&"other"!==e&&t(s,l)&&(E="type-"+e)}),r.isEmpty(v)||(v.title!==a&&null!==v.title&&(F=v.title),v.alt!==a&&null!==v.alt&&(F=v.alt)),g={previewId:b,caption:y,title:F,alt:S,frameClass:_,type:x._getFileType(l),fileindex:m,fileid:c||"",typeCss:E,footer:I,data:o&&p?r.ZOOM_VAR+"{zoomData}":i,template:h||n,style:P?'style="'+P+'"':"",zoomData:p?encodeURIComponent(p):""},o&&(g.zoomCache="",g.zoomData="{zoomData}"),w.setTokens(g)},m=m||d.slice(d.lastIndexOf("-")+1),x.fileActionSettings.showZoom&&(T=C(D?"other":n,o,!0,"kv-zoom-thumb",b)),T="\n"+x._getLayoutTemplate("zoomCache").replace("{zoomContent}",T),"function"==typeof x.sanitizeZoomCache&&(T=x.sanitizeZoomCache(T)),w=C(A?"other":n,o,!1,"kv-preview-thumb",b),w.setTokens({zoomCache:T})},_addToPreview:function(e,t){var i,a=this;return t=r.cspBuffer.stash(t),i=a.reversePreviewOrder?e.prepend(t):e.append(t),r.cspBuffer.apply(e),i},_previewDefault:function(e,t){var i=this,a=i.$preview;if(i.showPreview){var n,o=r.getFileName(e),s=e?e.type:"",l=e.size||0,d=i._getFileName(e,""),c=t===!0&&!i.isAjaxUpload,u=r.createObjectURL(e),p=i.fileManager.getId(e),f=i._getThumbId(p);i._clearDefaultPreview(),n=i._generatePreviewTemplate("other",u,o,s,f,p,c,l),i._addToPreview(a,n),i._setThumbAttr(f,d,l),t===!0&&i.isAjaxUpload&&i._setThumbStatus(i._getFrame(f),"Error")}},_previewFile:function(e,t,i,a,n){if(this.showPreview){var o,s=this,l=r.getFileName(t),d=n.type,c=n.name,u=s._parseFileType(d,l),p=s.$preview,f=t.size||0,g="image"===u?i.target.result:a,m=s.fileManager,h=m.getId(t),v=s._getThumbId(h);o=s._generatePreviewTemplate(u,g,l,d,v,h,!1,f),s._clearDefaultPreview(),s._addToPreview(p,o);var b=s._getFrame(v);s._validateImageOrientation(b.find("img"),t,v,h,c,d,f,g),s._setThumbAttr(v,c,f),s._initSortable()}},_setThumbAttr:function(e,t,i,a){var r=this,n=r._getFrame(e);n.length&&(i=i&&i>0?r._getSize(i):"",n.data({caption:t,size:i,description:a||""}))},_setInitThumbAttr:function(){var e,t,i,a,n,o=this,s=o.previewCache.data,l=o.previewCache.count(!0);if(0!==l)for(var d=0;l>d;d++)e=s.config[d],n=o.previewInitId+"-"+r.INIT_FLAG+d,t=r.ifSet("caption",e,r.ifSet("filename",e)),i=r.ifSet("size",e),a=r.ifSet("description",e),o._setThumbAttr(n,t,i,a)},_slugDefault:function(e){return r.isEmpty(e,!0)?"":String(e).replace(/[\[\]\/\{}:;#%=\(\)\*\+\?\\\^\$\|<>&"']/g,"_")},_updateFileDetails:function(e){var t,i,a,n,o,s=this,l=s.$element,d=r.isIE(9)&&r.findFileName(l.val())||l[0].files[0]&&l[0].files[0].name;!d&&s.fileManager.count()>0?(o=s.fileManager.getFirstFile(),t=o.nameFmt):t=d?s.slug(d):"_",i=s.isAjaxUpload?s.fileManager.count():e,n=s.previewCache.count(!0)+i,a=1===i?t:s._getMsgSelected(n,!s.isAjaxUpload&&!s.isError),s.isError?(s.$previewContainer.removeClass("file-thumb-loading"),s._initCapStatus(),s.$previewStatus.html(""),s.$captionContainer.removeClass("icon-visible")):s._showFileIcon(),s._setCaption(a,s.isError),s.$container.removeClass("file-input-new file-input-ajax-new"),s._raise("fileselect",[e,t]),s.previewCache.count(!0)&&s._initPreviewActions()},_setThumbStatus:function(e,t){var i=this;if(i.showPreview){var a="indicator"+t,n=a+"Title",o="file-preview-"+t.toLowerCase(),s=e.find(".file-upload-indicator"),l=i.fileActionSettings;e.removeClass("file-preview-success file-preview-error file-preview-paused file-preview-loading"),"Success"===t&&e.find(".file-drag-handle").remove(),r.setHtml(s,l[a]),s.attr("title",l[n]),e.addClass(o),"Error"!==t||i.retryErrorUploads||e.find(".kv-file-upload").attr("disabled",!0)}},_setProgressCancelled:function(){var e=this;e._setProgress(101,e.$progress,e.msgCancelled)},_setProgress:function(e,t,i,a){var n=this;if(t=t||n.$progress,t.length){var o,s=Math.min(e,100),l=n.progressUploadThreshold,d=100>=e?n.progressTemplate:n.progressCompleteTemplate,c=100>s?n.progressTemplate:i?n.paused?n.progressPauseTemplate:n.progressErrorTemplate:d;e>=100&&(a=""),r.isEmpty(c)||(o=l&&s>l&&100>=e?c.setTokens({percent:l,status:n.msgUploadThreshold}):c.setTokens({percent:s,status:e>100?n.msgUploadEnd:s+"%"}),a=a||"",o=o.setTokens({stats:a}),r.setHtml(t,o),i&&r.setHtml(t.find('[role="progressbar"]'),i))}},_hasFiles:function(){var e=this.$element[0];return!!(e&&e.files&&e.files.length)},_setFileDropZoneTitle:function(){var e,t=this,i=t.$container.find(".file-drop-zone"),a=t.dropZoneTitle;t.isClickable&&(e=r.isEmpty(t.$element.attr("multiple"))?t.fileSingle:t.filePlural,a+=t.dropZoneClickTitle.replace("{files}",e)),i.find("."+t.dropZoneTitleClass).remove(),!t.showPreview||0===i.length||t.fileManager.count()>0||!t.dropZoneEnabled||t.previewCache.count()>0||!t.isAjaxUpload&&t._hasFiles()||(0===i.find(r.FRAMES).length&&r.isEmpty(t.defaultPreviewContent)&&i.prepend('
    '+a+"
    "),t.$container.removeClass("file-input-new"),r.addCss(t.$container,"file-input-ajax-new"))},_getStats:function(e){var t,i,a=this;return a.showUploadStats&&e&&e.bitrate?(i=a._getLayoutTemplate("stats"),t=e.elapsed&&e.bps?a.msgPendingTime.setTokens({time:r.getElapsed(Math.ceil(e.pendingBytes/e.bps))}):a.msgCalculatingTime,i.setTokens({uploadSpeed:e.bitrate,pendingTime:t})):""},_setResumableProgress:function(e,t,i){var a=this,r=a.resumableManager,n=i?r:a,o=i?i.find(".file-thumb-progress"):null;0===n.lastProgress&&(n.lastProgress=e),e0&&e._getFileCount(t-1)=g:g>=d,u||(l=p["msgImage"+o+t].setTokens({name:n,size:g}),p._showFileError(l,s),p._setPreviewError(a)))},_getExifObj:function(e){var i,a=this,n=r.logMessages.exifWarning;if("data:image/jpeg;base64,"!==e.slice(0,23)&&"data:image/jpg;base64,"!==e.slice(0,22))return void(i=null);try{i=t.piexif?t.piexif.load(e):null}catch(o){i=null,n=o&&o.message||""}return!i&&a.showExifErrorLog&&a._log(r.logMessages.badExifParser,{details:n}),i},setImageOrientation:function(t,a,n,o){var s,l,d,c=this,u=!t||!t.length,p=!a||!a.length,f=!1,g=u&&o&&"image"===o.attr("data-template");u&&p||(d="load.fileinputimageorient",g?(t=a,a=null,t.css(c.previewSettings.image),l=e(i.createElement("div")).appendTo(o.find(".kv-file-content")),s=e(i.createElement("span")).insertBefore(t),t.css("visibility","hidden").removeClass("file-zoom-detail").appendTo(l)):f=!t.is(":visible"),t.off(d).on(d,function(){f&&(c.$preview.removeClass("hide-content"),o.find(".kv-file-content").css("visibility","hidden"));var e=t[0],i=a&&a.length?a[0]:null,d=e.offsetHeight,u=e.offsetWidth,p=r.getRotation(n);if(f&&(o.find(".kv-file-content").css("visibility","visible"),c.$preview.addClass("hide-content")),t.data("orientation",n),i&&a.data("orientation",n),5>n)return r.setTransform(e,p),void r.setTransform(i,p);var m=Math.atan(u/d),h=Math.sqrt(Math.pow(d,2)+Math.pow(u,2)),v=h?d/Math.cos(Math.PI/2+m)/h:1,b=" scale("+Math.abs(v)+")";r.setTransform(e,p+b),r.setTransform(i,p+b),g&&(t.css("visibility","visible").insertAfter(s).addClass("file-zoom-detail"),s.remove(),l.remove())}))},_validateImageOrientation:function(t,i,a,n,o,s,l,d){var c,u,p=this,f=null,g=p.autoOrientImage;return f=p._getExifObj(d),p.canOrientImage?(t.css("image-orientation",g?"from-image":"none"),void p._validateImage(a,n,o,s,l,d,f)):(u=r.getZoomSelector(a," img"),(c=f?f["0th"][piexif.ImageIFD.Orientation]:null)?(p.setImageOrientation(t,e(u),c,p._getFrame(a)),p._raise("fileimageoriented",{$img:t,file:i}),void p._validateImage(a,n,o,s,l,d,f)):void p._validateImage(a,n,o,s,l,d,f))},_validateImage:function(e,t,i,a,r,n,o){var s,l,d,c=this,u=c.$preview,p=c._getFrame(e),f=p.attr("data-fileindex"),g=p.find("img");i=i||"Untitled",g.one("load",function(){l=p.width(),d=u.width(),l>d&&g.css("width","100%"),s={ind:f,id:e,fileId:t},c._checkDimensions(f,"Small",g,p,i,"Width",s),c._checkDimensions(f,"Small",g,p,i,"Height",s),c.resizeImage||(c._checkDimensions(f,"Large",g,p,i,"Width",s),c._checkDimensions(f,"Large",g,p,i,"Height",s)),c._raise("fileimageloaded",[e]),c.fileManager.addImage(t,{ind:f,img:g,thumb:p,pid:e,typ:a,siz:r,validated:!1,imgData:n,exifObj:o}),p.data("exif",o),c._validateAllImages()}).one("error",function(){c._raise("fileimageloaderror",[e])})},_validateAllImages:function(){var t,i=this,a={val:0},r=i.fileManager.getImageCount(),n=i.resizeIfSizeMoreThan;r===i.fileManager.totalImages&&(i._raise("fileimagesloaded"),i.resizeImage&&e.each(i.fileManager.loadedImages,function(e,o){o.validated||(t=o.siz,t&&t>n*i.bytesToKB&&i._getResizedImage(e,o,a,r),o.validated=!0)}))},_getResizedImage:function(i,n,o,s){var l,d,c,u,p,f,g,m,h,v,b=this,w=e(n.img)[0],_=w.naturalWidth,C=w.naturalHeight,x=1,y=b.maxImageWidth||_,T=b.maxImageHeight||C,P=!(!_||!C),k=b.imageCanvas,F=b.imageCanvasContext,S=n.typ,E=n.pid,I=n.ind,A=n.thumb,D=n.exifObj;if(p=function(e,t,i){b.isAjaxUpload?b._showFileError(e,t,i):b._showError(e,t,i),b._setPreviewError(A)},m=b.fileManager.getFile(i),h={id:E,index:I,fileId:i},v=[i,E,I],(!m||!P||y>=_&&T>=C)&&(P&&m&&b._raise("fileimageresized",v),o.val++,o.val===s&&b._raise("fileimagesresized"),!P))return void p(b.msgImageResizeError,h,"fileimageresizeerror");S=S||b.resizeDefaultImageType,d=_>y,c=C>T,x="width"===b.resizePreference?d?y/_:c?T/C:1:c?T/C:d?y/_:1,b._resetCanvas(),_*=x,C*=x,k.width=_,k.height=C;try{F.drawImage(w,0,0,_,C),u=k.toDataURL(S,b.resizeQuality),D&&(g=t.piexif.dump(D),u=t.piexif.insert(g,u)),l=r.dataURI2Blob(u),b.fileManager.setFile(i,l),b._raise("fileimageresized",v),o.val++,o.val===s&&b._raise("fileimagesresized",[a,a]),l instanceof Blob||p(b.msgImageResizeError,h,"fileimageresizeerror")}catch(z){o.val++,o.val===s&&b._raise("fileimagesresized",[a,a]),f=b.msgImageResizeException.replace("{errors}",z.message),p(f,h,"fileimageresizeexception")}},_showProgress:function(){var e=this;e.$progress&&e.$progress.length&&e.$progress.show()},_hideProgress:function(){var e=this; -e.$progress&&e.$progress.length&&e.$progress.hide()},_initBrowse:function(e){var t=this,i=t.$element;t.showBrowse?t.$btnFile=e.find(".btn-file").append(i):(i.appendTo(e).attr("tabindex",-1),r.addCss(i,"file-no-browse"))},_initClickable:function(){var t,i,a=this;a.isClickable&&(t=a.$dropZone,a.isAjaxUpload||(i=a.$preview.find(".file-default-preview"),i.length&&(t=i)),r.addCss(t,"clickable"),t.attr("tabindex",-1),a._handler(t,"click",function(i){var r=e(i.target);a.$errorContainer.is(":visible")||r.parents(".file-preview-thumbnails").length&&!r.parents(".file-default-preview").length||(a.$element.data("zoneClicked",!0).trigger("click"),t.blur())}))},_initCaption:function(){var e=this,t=e.initialCaption||"";return e.overwriteInitial||r.isEmpty(t)?(e.$caption.val(""),!1):(e._setCaption(t),!0)},_setCaption:function(t,i){var a,n,o,s,l,d,c=this;if(c.$caption.length){if(c.$captionContainer.removeClass("icon-visible"),i)a=e("
    "+c.msgValidationError+"
    ").text(),s=c.fileManager.count(),s?(d=c.fileManager.getFirstFile(),l=1===s&&d?d.nameFmt:c._getMsgSelected(s)):l=c._getMsgSelected(c.msgNo),n=r.isEmpty(t)?l:t,o=''+c.msgValidationErrorIcon+"";else{if(r.isEmpty(t))return void c.$caption.attr("title","");a=e("
    "+t+"
    ").text(),n=a,o=c._getLayoutTemplate("fileIcon")}c.$captionContainer.addClass("icon-visible"),c.$caption.attr("title",a).val(n),r.setHtml(c.$captionIcon,o)}},_createContainer:function(){var e=this,t={"class":"file-input file-input-new"+(e.rtl?" kv-rtl":"")},i=r.createElement(r.cspBuffer.stash(e._renderMain()));return r.cspBuffer.apply(i),i.insertBefore(e.$element).attr(t),e._initBrowse(i),e.theme&&i.addClass("theme-"+e.theme),i},_refreshContainer:function(){var e=this,t=e.$container,i=e.$element;i.insertAfter(t),r.setHtml(t,e._renderMain()),e._initBrowse(t),e._validateDisabled()},_validateDisabled:function(){var e=this;e.$caption.attr({readonly:e.isDisabled})},_setTabIndex:function(e,t){var i=this,r=i.tabIndexConfig[e];return t.setTokens({tabIndexConfig:r===a||null===r?"":'tabindex="'+r+'"'})},_renderMain:function(){var e=this,t=e.dropZoneEnabled?" file-drop-zone":"file-drop-disabled",i=e.showClose?e._getLayoutTemplate("close"):"",a=e.showPreview?e._getLayoutTemplate("preview").setTokens({"class":e.previewClass,dropClass:t}):"",r=e.isDisabled?e.captionClass+" file-caption-disabled":e.captionClass,n=e.captionTemplate.setTokens({"class":r+" kv-fileinput-caption"});return n=e._setTabIndex("caption",n),e.mainTemplate.setTokens({"class":e.mainClass+(!e.showBrowse&&e.showCaption?" no-browse":""),inputGroupClass:e.inputGroupClass,preview:a,close:i,caption:n,upload:e._renderButton("upload"),remove:e._renderButton("remove"),cancel:e._renderButton("cancel"),pause:e._renderButton("pause"),browse:e._renderButton("browse")})},_renderButton:function(e){var t=this,i=t._getLayoutTemplate("btnDefault"),a=t[e+"Class"],n=t[e+"Title"],o=t[e+"Icon"],s=t[e+"Label"],l=t.isDisabled?" disabled":"",d="button";switch(e){case"remove":if(!t.showRemove)return"";break;case"cancel":if(!t.showCancel)return"";a+=" kv-hidden";break;case"pause":if(!t.showPause)return"";a+=" kv-hidden";break;case"upload":if(!t.showUpload)return"";t.isAjaxUpload&&!t.isDisabled?i=t._getLayoutTemplate("btnLink").replace("{href}",t.uploadUrl):d="submit";break;case"browse":if(!t.showBrowse)return"";i=t._getLayoutTemplate("btnBrowse");break;default:return""}return i=t._setTabIndex(e,i),a+="browse"===e?" btn-file":" fileinput-"+e+" fileinput-"+e+"-button",r.isEmpty(s)||(s=' '+s+""),i.setTokens({type:d,css:a,title:n,status:l,icon:o,label:s})},_renderThumbProgress:function(){var e=this;return'
    '+e.progressInfoTemplate.setTokens({percent:101,status:e.msgUploadBegin,stats:""})+"
    "},_renderFileFooter:function(e,t,i,a,n){var o,s,l=this,d=l.fileActionSettings,c=d.showRemove,u=d.showDrag,p=d.showUpload,f=d.showZoom,g=l._getLayoutTemplate("footer"),m=l._getLayoutTemplate("indicator"),h=n?d.indicatorError:d.indicatorNew,v=n?d.indicatorErrorTitle:d.indicatorNewTitle,b=m.setTokens({indicator:h,indicatorTitle:v});return i=l._getSize(i),s={type:e,caption:t,size:i,width:a,progress:"",indicator:b},l.isAjaxUpload?(s.progress=l._renderThumbProgress(),s.actions=l._renderFileActions(s,p,!1,c,f,u,!1,!1,!1)):s.actions=l._renderFileActions(s,!1,!1,!1,f,u,!1,!1,!1),o=g.setTokens(s),o=r.replaceTags(o,l.previewThumbTags)},_renderFileActions:function(e,t,i,a,r,n,o,s,l,d,c,u){var p=this;if(!e.type&&d&&(e.type="image"),p.enableResumableUpload?t=!1:"function"==typeof t&&(t=t(e)),"function"==typeof i&&(i=i(e)),"function"==typeof a&&(a=a(e)),"function"==typeof r&&(r=r(e)),"function"==typeof n&&(n=n(e)),!(t||i||a||r||n))return"";var f,g=s===!1?"":' data-url="'+s+'"',m="",h="",v=l===!1?"":' data-key="'+l+'"',b="",w="",_="",C=p._getLayoutTemplate("actions"),x=p.fileActionSettings,y=p.otherActionButtons.setTokens({dataKey:v,key:l}),T=o?x.removeClass+" disabled":x.removeClass;return a&&(b=p._getLayoutTemplate("actionDelete").setTokens({removeClass:T,removeIcon:x.removeIcon,removeTitle:x.removeTitle,dataUrl:g,dataKey:v,key:l})),t&&(w=p._getLayoutTemplate("actionUpload").setTokens({uploadClass:x.uploadClass,uploadIcon:x.uploadIcon,uploadTitle:x.uploadTitle})),i&&(_=p._getLayoutTemplate("actionDownload").setTokens({downloadClass:x.downloadClass,downloadIcon:x.downloadIcon,downloadTitle:x.downloadTitle,downloadUrl:c||p.initialPreviewDownloadUrl}),_=_.setTokens({filename:u,key:l})),r&&(m=p._getLayoutTemplate("actionZoom").setTokens({zoomClass:x.zoomClass,zoomIcon:x.zoomIcon,zoomTitle:x.zoomTitle})),n&&d&&(f="drag-handle-init "+x.dragClass,h=p._getLayoutTemplate("actionDrag").setTokens({dragClass:f,dragTitle:x.dragTitle,dragIcon:x.dragIcon})),C.setTokens({"delete":b,upload:w,download:_,zoom:m,drag:h,other:y})},_browse:function(e){var t=this;e&&e.isDefaultPrevented()||!t._raise("filebrowse")||(t.isError&&!t.isAjaxUpload&&t.clear(),t.focusCaptionOnBrowse&&t.$captionContainer.focus())},_change:function(t){var n=this;if(e(i.body).off("focusin.fileinput focusout.fileinput"),!n.changeTriggered){n._setLoading("show");var o,s,l,d,c=n.$element,u=arguments.length>1,p=n.isAjaxUpload,f=u?arguments[1]:c[0].files,g=n.fileManager.count(),m=r.isEmpty(c.attr("multiple")),h=!p&&m?1:n.maxFileCount,v=n.maxTotalFileCount,b=v>0&&v>h,w=m&&g>0,_=function(t,i,a,r){var o=e.extend(!0,{},n._getOutData(null,{},{},f),{id:a,index:r}),s={id:a,index:r,file:i,files:f};return n.isPersistentError=!0,n._setLoading("hide"),p?n._showFileError(t,o):n._showError(t,s)},C=function(e,t,i){var a=i?n.msgTotalFilesTooMany:n.msgFilesTooMany;a=a.replace("{m}",t).replace("{n}",e),n.isError=_(a,null,null,null),n.$captionContainer.removeClass("icon-visible"),n._setCaption("",!0),n.$container.removeClass("file-input-new file-input-ajax-new")};if(n.reader=null,n._resetUpload(),n._hideFileIcon(),n.dropZoneEnabled&&n.$container.find(".file-drop-zone ."+n.dropZoneTitleClass).remove(),p||(f=t.target&&t.target.files===a?t.target.value?[{name:t.target.value.replace(/^.+\\/,"")}]:[]:t.target.files||{}),o=f,r.isEmpty(o)||0===o.length)return p||n.clear(),void n._raise("fileselectnone");if(n._resetErrors(),d=o.length,l=p?n.fileManager.count()+d:d,s=n._getFileCount(l,b?!1:a),h>0&&s>h){if(!n.autoReplace||d>h)return void C(n.autoReplace&&d>h?d:s,h);s>h&&n._resetPreviewThumbs(p)}else{if(b&&(s=n._getFileCount(l,!0),v>0&&s>v)){if(!n.autoReplace||d>h)return void C(n.autoReplace&&d>v?d:s,v,!0);s>h&&n._resetPreviewThumbs(p)}!p||w?(n._resetPreviewThumbs(!1),w&&n.clearFileStack()):!p||0!==g||n.previewCache.count(!0)&&!n.overwriteInitial||n._resetPreviewThumbs(!0)}n.readFiles(o),n._setLoading("hide")}},_abort:function(t){var i,r=this;return r.ajaxAborted&&"object"==typeof r.ajaxAborted&&r.ajaxAborted.message!==a?(i=e.extend(!0,{},r._getOutData(null),t),i.abortData=r.ajaxAborted.data||{},i.abortMessage=r.ajaxAborted.message,r._setProgress(101,r.$progress,r.msgCancelled),r._showFileError(r.ajaxAborted.message,i,"filecustomerror"),r.cancel(),r.unlock(),!0):!!r.ajaxAborted},_resetFileStack:function(){var t=this,i=0;t._getThumbs().each(function(){var a=e(this),r=a.attr("data-fileindex"),n=a.attr("id");"-1"!==r&&-1!==r&&(t._getThumbFile(a)?a.attr({"data-fileindex":"-1"}):(a.attr({"data-fileindex":i}),i++),t._getZoom(n).attr({"data-fileindex":a.attr("data-fileindex")}))})},_isFileSelectionValid:function(e){var t=this;return e=e||0,t.required&&!t.getFilesCount()?(t.$errorContainer.html(""),t._showFileError(t.msgFileRequired),!1):t.minFileCount>0&&t._getFileCount(e)v,!o&&(i||a||n)},addToStack:function(e,t){this.fileManager.add(e,t)},clearFileStack:function(){var e=this;return e.fileManager.clear(),e._initResumableUpload(),e.enableResumableUpload?(null===e.showPause&&(e.showPause=!0),null===e.showCancel&&(e.showCancel=!1)):(e.showPause=!1,null===e.showCancel&&(e.showCancel=!0)),e.$element},getFileStack:function(){return this.fileManager.stack},getFileList:function(){return this.fileManager.list()},getFilesSize:function(){return this.fileManager.getTotalSize()},getFilesCount:function(e){var t=this,i=t.isAjaxUpload?t.fileManager.count():t._inputFileCount();return e&&(i+=t.previewCache.count(!0)),t._getFileCount(i)},_initCapStatus:function(e){var t=this,i=t.$caption;i.removeClass("is-valid file-processing"),e&&("processing"===e?i.addClass("file-processing"):i.addClass("is-valid"))},_setLoading:function(e){var t=this;t.$previewStatus.html("hide"===e?"":t.msgProcessing),t.$container.removeClass("file-thumb-loading"),t._initCapStatus("hide"===e?"":"processing"),"hide"!==e&&(t.dropZoneEnabled&&t.$container.find(".file-drop-zone ."+t.dropZoneTitleClass).remove(),t.$container.addClass("file-thumb-loading"))},_initFileSelected:function(){var t=this,a=t.$element,r=e(i.body),n="focusin.fileinput focusout.fileinput";r.length?r.off(n).on("focusout.fileinput",function(){t._setLoading("show")}).on("focusin.fileinput",function(){setTimeout(function(){a.val()||(t._setLoading("hide"),t._setFileDropZoneTitle()),r.off(n)},2500)}):t._setLoading("hide")},readFiles:function(t){this.reader=new FileReader;var i,a=this,n=a.reader,o=a.$previewContainer,s=a.$previewStatus,l=a.msgLoading,d=a.msgProgress,c=a.previewInitId,u=t.length,p=a.fileTypeSettings,f=a.allowedFileTypes,g=f?f.length:0,m=a.allowedFileExtensions,h=r.isEmpty(m)?"":m.join(", "),v=function(r,n,o,s,l){var d,c=e.extend(!0,{},a._getOutData(null,{},{},t),{id:o,index:s,fileId:l}),p={id:o,index:s,fileId:l,file:n,files:t};a._previewDefault(n,!0),d=a._getFrame(o,!0),a._setLoading("hide"),a.isAjaxUpload?setTimeout(function(){i(s+1)},a.processDelay):(a.unlock(),u=0),a.removeFromPreviewOnError&&d.length?d.remove():(a._initFileActions(),d.find(".kv-file-upload").remove()),a.isPersistentError=!0,a.isError=a.isAjaxUpload?a._showFileError(r,c):a._showError(r,p),a._updateFileDetails(u)};a.fileManager.clearImages(),e.each(t,function(e,t){var i=a.fileTypeSettings.image;i&&i(t.type)&&a.fileManager.totalImages++}),i=function(b){var w,_=a.$errorContainer,C=a.fileManager;if(b>=u)return a.unlock(),a.duplicateErrors.length&&(w="
  • "+a.duplicateErrors.join("
  • ")+"
  • ",0===_.find("ul").length?r.setHtml(_,a.errorCloseButton+"
      "+w+"
    "):_.find("ul").append(w),_.fadeIn(a.fadeDelay),a._handler(_.find(".kv-error-close"),"click",function(){_.fadeOut(a.fadeDelay)}),a.duplicateErrors=[]),a.isAjaxUpload?(a._raise("filebatchselected",[C.stack]),0!==C.count()||a.isError||a.reset()):a._raise("filebatchselected",[t]),o.removeClass("file-thumb-loading"),a._initCapStatus("valid"),void s.html("");a.lock(!0);var x,y,T,P,k,F,S,E,I,A,D,z,j=t[b],$=a._getFileId(j),U=c+"-"+$,M=p.image,R=a._getFileName(j,""),B=(j&&j.size||0)/a.bytesToKB,O="",L=r.createObjectURL(j),N=0,Z="",H=!1,W=0,V=function(){var e=!!C.loadedImages[$],t=d.setTokens({index:b+1,files:u,percent:50,name:R});setTimeout(function(){s.html(t),a._updateFileDetails(u),i(b+1)},a.processDelay),a._raise("fileloaded",[j,U,$,b,n])&&a.isAjaxUpload?e||C.add(j):e&&C.removeFile($)};if(j){if(E=C.getId(j),g>0)for(y=0;g>y;y++)F=f[y],S=a.msgFileTypes[F]||F,Z+=0===y?S:", "+S;if(R===!1)return void i(b+1);if(0===R.length)return T=a.msgInvalidFileName.replace("{name}",r.htmlEncode(r.getFileName(j),"[unknown]")),void v(T,j,U,b,E);if(r.isEmpty(m)||(O=new RegExp("\\.("+m.join("|")+")$","i")),x=B.toFixed(2),a.isAjaxUpload&&C.exists(E)||a._getFrame(U,!0).length){var q={id:U,index:b,fileId:E,file:j,files:t};return T=a.msgDuplicateFile.setTokens({name:R,size:x}),void(a.isAjaxUpload?(a.duplicateErrors.push(T),a.isDuplicateError=!0,a._raise("fileduplicateerror",[j,E,R,x,U,b]),i(b+1),a._updateFileDetails(u)):(a._showError(T,q),a.unlock(),u=0,a._clearFileInput(),a.reset(),a._updateFileDetails(u)))}if(a.maxFileSize>0&&B>a.maxFileSize)return T=a.msgSizeTooLarge.setTokens({name:R,size:x,maxSize:a.maxFileSize}),void v(T,j,U,b,E);if(null!==a.minFileSize&&B<=r.getNum(a.minFileSize))return T=a.msgSizeTooSmall.setTokens({name:R,size:x,minSize:a.minFileSize}),void v(T,j,U,b,E);if(!r.isEmpty(f)&&r.isArray(f)){for(y=0;y0)for(t=0;n>t;t+=1)i.paused=!0,r[t].abort();return i.showPreview&&i._getThumbs().each(function(){var t,a=e(this),r=i._getLayoutTemplate("stats"),n=a.find(".file-upload-indicator");a.removeClass("file-uploading"),n.attr("title")===s.indicatorLoadingTitle&&(i._setThumbStatus(a,"Paused"),t=r.setTokens({pendingTime:i.msgPaused,uploadSpeed:""}),i.paused=!0,i._setProgress(o,a.find(".file-thumb-progress"),o+"%",t)),i._getThumbFile(a)||a.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")}),i._setProgress(101,i.$progress,i.msgPaused),i.$element},cancel:function(){var t,i=this,r=i.ajaxRequests,n=i.resumableManager,o=i.taskManager,s=n?o.getPool(n.id):a,l=r.length;if(i.enableResumableUpload&&s?(s.cancel().done(function(){i._setProgressCancelled()}),n.reset(),i._raise("fileuploadcancelled",[i.fileManager,n])):i._raise("fileuploadcancelled",[i.fileManager]),i._initAjax(),l>0)for(t=0;l>t;t+=1)i.cancelling=!0,r[t].abort();return i._getThumbs().each(function(){var t=e(this),a=t.find(".file-thumb-progress");t.removeClass("file-uploading"),i._setProgress(0,a),a.hide(),i._getThumbFile(t)||(t.find(".kv-file-upload").removeClass("disabled").removeAttr("disabled"),t.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")),i.unlock()}),setTimeout(function(){i._setProgressCancelled()},i.processDelay),i.$element},clear:function(){var t,i=this;if(i._raise("fileclear"))return i.$btnUpload.removeAttr("disabled"),i._getThumbs().find("video,audio,img").each(function(){r.cleanMemory(e(this))}),i._clearFileInput(),i._resetUpload(),i.clearFileStack(),i.isDuplicateError=!1,i.isPersistentError=!1,i._resetErrors(!0),i._hasInitialPreview()?(i._showFileIcon(),i._resetPreview(),i._initPreviewActions(),i.$container.removeClass("file-input-new")):(i._getThumbs().each(function(){i._clearObjects(e(this))}),i.isAjaxUpload&&(i.previewCache.data={}),i.$preview.html(""),t=!i.overwriteInitial&&i.initialCaption.length>0?i.initialCaption:"",i.$caption.attr("title","").val(t),r.addCss(i.$container,"file-input-new"),i._validateDefaultPreview()),0===i.$container.find(r.FRAMES).length&&(i._initCaption()||i.$captionContainer.removeClass("icon-visible")),i._hideFileIcon(),i.focusCaptionOnClear&&i.$captionContainer.focus(),i._setFileDropZoneTitle(),i._raise("filecleared"),i.$element},reset:function(){var e=this;if(e._raise("filereset"))return e.lastProgress=0,e._resetPreview(),e.$container.find(".fileinput-filename").text(""),r.addCss(e.$container,"file-input-new"),e.getFrames().length&&e.$container.removeClass("file-input-new"),e.clearFileStack(),e._setFileDropZoneTitle(),e.$element},disable:function(){var e=this,t=e.$container;return e.isDisabled=!0,e._raise("filedisabled"),e.$element.attr("disabled","disabled"),t.addClass("is-locked"),r.addCss(t.find(".btn-file"),"disabled"),t.find(".kv-fileinput-caption").addClass("file-caption-disabled"),t.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").attr("disabled",!0),e._initDragDrop(),e.$element},enable:function(){var e=this,t=e.$container;return e.isDisabled=!1,e._raise("fileenabled"),e.$element.removeAttr("disabled"),t.removeClass("is-locked"),t.find(".kv-fileinput-caption").removeClass("file-caption-disabled"),t.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").removeAttr("disabled"),t.find(".btn-file").removeClass("disabled"),e._initDragDrop(),e.$element},upload:function(){var t,i,a=this,n=a.fileManager,o=n.count(),s=!e.isEmptyObject(a._getExtraData());if(n.bpsLog=[],n.bps=0,a.isAjaxUpload&&!a.isDisabled&&a._isFileSelectionValid(o)){if(a.lastProgress=0,a._resetUpload(),0===o&&!s)return void a._showFileError(a.msgUploadEmpty);if(a.cancelling=!1,a._showProgress(),a.lock(),0===o&&s)return a._setProgress(2),void a._uploadExtraOnly();if(a.enableResumableUpload)return a.resume();if(a.uploadAsync||a.enableResumableUpload){if(i=a._getOutData(null),!a._checkBatchPreupload(i))return;a.fileBatchCompleted=!1,a.uploadCache=[],e.each(a.getFileStack(),function(e){var t=a._getThumbId(e);a.uploadCache.push({id:t,content:null,config:null,tags:null,append:!0})}),a.$preview.find(".file-preview-initial").removeClass(r.SORT_CSS),a._initSortable()}return a._setProgress(2),a.hasInitData=!1,a.uploadAsync?(t=0,void e.each(a.getFileStack(),function(e){a._uploadSingle(t,e,!0),t++})):(a._uploadBatch(),a.$element)}},destroy:function(){var a=this,r=a.$form,n=a.$container,o=a.$element,s=a.namespace;return e(i).off(s),e(t).off(s),r&&r.length&&r.off(s),a.isAjaxUpload&&a._clearFileInput(),a._cleanup(),a._initPreviewCache(),o.insertBefore(n).off(s).removeData(),n.off().remove(),o},refresh:function(t){var i=this,a=i.$element;return t="object"!=typeof t||r.isEmpty(t)?i.options:e.extend(!0,{},i.options,t),i._init(t,!0),i._listen(),a},zoom:function(e){var t=this,i=t._getFrame(e);t._showModal(i)},getExif:function(e){var t=this,i=t._getFrame(e);return i&&i.data("exif")||null},getFrames:function(t){var i,a=this;return t=t||"",i=a.$preview.find(r.FRAMES+t),a.reversePreviewOrder&&(i=e(i.get().reverse())),i},getPreview:function(){var e=this;return{content:e.initialPreview,config:e.initialPreviewConfig,tags:e.initialPreviewThumbTags}}},e.fn.fileinput=function(t){if(r.hasFileAPISupport()||r.isIE(9)){var i=Array.apply(null,arguments),a=[];switch(i.shift(),this.each(function(){var o,s=e(this),l=s.data("fileinput"),d="object"==typeof t&&t,c=d.theme||s.data("theme"),u={},p={},f=d.language||s.data("language")||e.fn.fileinput.defaults.language||"en";l||(c&&(p=e.fn.fileinputThemes[c]||{}),"en"===f||r.isEmpty(e.fn.fileinputLocales[f])||(u=e.fn.fileinputLocales[f]||{}),o=e.extend(!0,{},e.fn.fileinput.defaults,p,e.fn.fileinputLocales.en,u,d,s.data()),l=new n(this,o),s.data("fileinput",l)),"string"==typeof t&&a.push(l[t].apply(l,i))}),a.length){case 0:return this;case 1:return a[0];default:return a}}};var s='class="kv-preview-data file-preview-pdf" src="{renderer}?file={data}" {style}',l="btn btn-sm btn-kv "+r.defaultButtonCss(),d="btn "+r.defaultButtonCss();e.fn.fileinput.defaults={language:"en",bytesToKB:1024,showCaption:!0,showBrowse:!0,showPreview:!0,showRemove:!0,showUpload:!0,showUploadStats:!0,showCancel:null,showPause:null,showClose:!0,showUploadedThumbs:!0,showConsoleLogs:!1,browseOnZoneClick:!1,autoReplace:!1,showDescriptionClose:!0,autoOrientImage:function(){var e=t.navigator.userAgent,i=!!e.match(/WebKit/i),a=!!e.match(/iP(od|ad|hone)/i),r=a&&i&&!e.match(/CriOS/i);return!r},autoOrientImageInitial:!0,showExifErrorLog:!1,required:!1,rtl:!1,hideThumbnailContent:!1,encodeUrl:!0,focusCaptionOnBrowse:!0,focusCaptionOnClear:!0,generateFileId:null,previewClass:"",captionClass:"",frameClass:"krajee-default",mainClass:"",inputGroupClass:"",mainTemplate:null,fileSizeGetter:null,initialCaption:"",initialPreview:[],initialPreviewDelimiter:"*$$*",initialPreviewAsData:!1,initialPreviewFileType:"image",initialPreviewConfig:[],initialPreviewThumbTags:[],previewThumbTags:{},initialPreviewShowDelete:!0,initialPreviewDownloadUrl:"",removeFromPreviewOnError:!1,deleteUrl:"",deleteExtraData:{},overwriteInitial:!0,sanitizeZoomCache:function(e){var t=r.createElement(e);return t.find("input,textarea,select,datalist,form,.file-thumbnail-footer").remove(),t.html()},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewZoomButtonClasses:{prev:"btn btn-default btn-outline-secondary btn-navigate",next:"btn btn-default btn-outline-secondary btn-navigate",toggleheader:l,fullscreen:l,borderless:l,close:l},previewTemplates:{},previewContentTemplates:{},preferIconicPreview:!1,preferIconicZoomPreview:!1,allowedFileTypes:null,allowedFileExtensions:null,allowedPreviewTypes:a,allowedPreviewMimeTypes:null,allowedPreviewExtensions:null,disabledPreviewTypes:a,disabledPreviewExtensions:["msi","exe","com","zip","rar","app","vb","scr"],disabledPreviewMimeTypes:null,defaultPreviewContent:null,customLayoutTags:{},customPreviewTags:{},previewFileIcon:'',previewFileIconClass:"file-other-icon",previewFileIconSettings:{},previewFileExtSettings:{},buttonLabelClass:"hidden-xs",browseIcon:' ',browseClass:"btn btn-primary",removeIcon:'',removeClass:d,cancelIcon:'',cancelClass:d,pauseIcon:'',pauseClass:d,uploadIcon:'',uploadClass:d,uploadUrl:null,uploadUrlThumb:null,uploadAsync:!0,uploadParamNames:{chunkCount:"chunkCount",chunkIndex:"chunkIndex",chunkSize:"chunkSize",chunkSizeStart:"chunkSizeStart",chunksUploaded:"chunksUploaded",fileBlob:"fileBlob",fileId:"fileId",fileName:"fileName",fileRelativePath:"fileRelativePath",fileSize:"fileSize",retryCount:"retryCount"},maxAjaxThreads:5,fadeDelay:800,processDelay:100,bitrateUpdateDelay:500,queueDelay:10,progressDelay:0,enableResumableUpload:!1,resumableUploadOptions:{fallback:null,testUrl:null,chunkSize:2048,maxThreads:4,maxRetries:3,showErrorLog:!0,retainErrorHistory:!0,skipErrorsAndProceed:!1},uploadExtraData:{},zoomModalHeight:480,minImageWidth:null,minImageHeight:null,maxImageWidth:null,maxImageHeight:null,resizeImage:!1,resizePreference:"width",resizeQuality:.92,resizeDefaultImageType:"image/jpeg",resizeIfSizeMoreThan:0,minFileSize:-1,maxFileSize:0,maxFilePreviewSize:25600,minFileCount:0,maxFileCount:0,maxTotalFileCount:0,validateInitialCount:!1,msgValidationErrorClass:"text-danger",msgValidationErrorIcon:' ',msgErrorClass:"file-error-message",progressThumbClass:"progress-bar progress-bar-striped active progress-bar-animated",progressClass:"progress-bar bg-success progress-bar-success progress-bar-striped active progress-bar-animated",progressInfoClass:"progress-bar bg-info progress-bar-info progress-bar-striped active progress-bar-animated",progressCompleteClass:"progress-bar bg-success progress-bar-success",progressPauseClass:"progress-bar bg-primary progress-bar-primary progress-bar-striped active progress-bar-animated",progressErrorClass:"progress-bar bg-danger progress-bar-danger",progressUploadThreshold:99,previewFileType:"image",elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null,errorCloseButton:a,slugCallback:null,dropZoneEnabled:!0,dropZoneTitleClass:"file-drop-zone-title",fileActionSettings:{},otherActionButtons:"",textEncoding:"UTF-8",preProcessUpload:null,ajaxSettings:{},ajaxDeleteSettings:{},showAjaxErrorDetails:!0,mergeAjaxCallbacks:!1,mergeAjaxDeleteCallbacks:!1,retryErrorUploads:!0,reversePreviewOrder:!1,usePdfRenderer:function(){var e=!!t.MSInputMethodContext&&!!i.documentMode;return!!navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/i)||e},pdfRendererUrl:"",pdfRendererTemplate:"",tabIndexConfig:{browse:500,remove:500,upload:500,cancel:null,pause:null,modal:-1}},e.fn.fileinputLocales.en={sizeUnits:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],bitRateUnits:["B/s","KB/s","MB/s","GB/s","TB/s","PB/s","EB/s","ZB/s","YB/s"],fileSingle:"file",filePlural:"files",browseLabel:"Browse …",removeLabel:"Remove",removeTitle:"Clear all unprocessed files",cancelLabel:"Cancel",cancelTitle:"Abort ongoing upload",pauseLabel:"Pause",pauseTitle:"Pause ongoing upload",uploadLabel:"Upload",uploadTitle:"Upload selected files",msgNo:"No",msgNoFilesSelected:"No files selected",msgCancelled:"Cancelled",msgPaused:"Paused",msgPlaceholder:"Select {files} ...",msgZoomModalHeading:"Detailed Preview",msgFileRequired:"You must select a file to upload.",msgSizeTooSmall:'File "{name}" ({size} KB) is too small and must be larger than {minSize} KB.',msgSizeTooLarge:'File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB.',msgFilesTooLess:"You must select at least {n} {files} to upload.",msgFilesTooMany:"Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}.",msgTotalFilesTooMany:"You can upload a maximum of {m} files ({n} files detected).",msgFileNotFound:'File "{name}" not found!',msgFileSecured:'Security restrictions prevent reading the file "{name}".',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileName:'Invalid or unsupported characters in file name "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgFileTypes:{image:"image",html:"HTML",text:"text",video:"video",audio:"audio",flash:"flash",pdf:"PDF",object:"object"},msgUploadAborted:"The file upload was aborted",msgUploadThreshold:"Processing …",msgUploadBegin:"Initializing …",msgUploadEnd:"Done",msgUploadResume:"Resuming upload …",msgUploadEmpty:"No valid data available for upload.",msgUploadError:"Upload Error",msgDeleteError:"Delete Error",msgProgressError:"Error",msgValidationError:"Validation Error",msgLoading:"Loading file {index} of {files} …",msgProgress:"Loading file {index} of {files} - {name} - {percent}% completed.",msgSelected:"{n} {files} selected",msgProcessing:"Processing ...",msgFoldersNotAllowed:"Drag & drop files only! {n} folder(s) dropped were skipped.",msgImageWidthSmall:'Width of image file "{name}" must be at least {size} px.',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px.',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px.',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px.',msgImageResizeError:"Could not get the image dimensions to resize.",msgImageResizeException:"Error while resizing the image.
    {errors}
    ",msgAjaxError:"Something went wrong with the {operation} operation. Please try again later!",msgAjaxProgressError:"{operation} failed",msgDuplicateFile:'File "{name}" of same size "{size} KB" has already been selected earlier. Skipping duplicate selection.',msgResumableUploadRetriesExceeded:"Upload aborted beyond {max} retries for file {file}! Error Details:
    {error}
    ",msgPendingTime:"{time} remaining",msgCalculatingTime:"calculating time remaining",ajaxOperations:{deleteThumb:"file delete",uploadThumb:"file upload",uploadBatch:"batch file upload",uploadExtra:"form data upload" -},dropZoneTitle:"Drag & drop files here …",dropZoneClickTitle:"
    (or click to select {files})",previewZoomButtonTitles:{prev:"View previous file",next:"View next file",toggleheader:"Toggle header",fullscreen:"Toggle full screen",borderless:"Toggle borderless mode",close:"Close detailed preview"}},e.fn.fileinput.Constructor=n,e(i).ready(function(){var t=e("input.file[type=file]");t.length&&t.fileinput()})}); \ No newline at end of file + */!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(e){"use strict";e.fn.fileinputLocales={},e.fn.fileinputThemes={},e.fn.fileinputBsVersion||(e.fn.fileinputBsVersion=window.Alert&&window.Alert.VERSION||window.bootstrap&&window.bootstrap.Alert&&bootstrap.Alert.VERSION||"3.x.x"),String.prototype.setTokens=function(e){var t,i,a=this.toString();for(t in e)e.hasOwnProperty(t)&&(i=new RegExp("{"+t+"}","g"),a=a.replace(i,e[t]));return a},Array.prototype.flatMap||(Array.prototype.flatMap=function(e){return[].concat(this.map(e))});var t,i,a=function(){var e=document.currentScript.src,t=e.substring(0,e.lastIndexOf("/"));return t.substring(0,t.lastIndexOf("/")+1)+"img/loading.gif"};t={FRAMES:".kv-preview-thumb",SORT_CSS:"file-sortable",INIT_FLAG:"init-",ZOOM_VAR:a()+"?kvTemp__2873389129__=",OBJECT_PARAMS:'\n\n\n\n\n\n',DEFAULT_PREVIEW:'
    \n{previewFileIcon}\n
    ',MODAL_ID:"kvFileinputModal",MODAL_EVENTS:["show","shown","hide","hidden","loaded"],logMessages:{ajaxError:"{status}: {error}. Error Details: {text}.",badDroppedFiles:"Error scanning dropped files!",badExifParser:"Error loading the piexif.js library. {details}",badInputType:'The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.',exifWarning:'To avoid this warning, either set "autoOrientImage" to "false" OR ensure you have loaded the "piexif.js" library correctly on your page before the "fileinput.js" script.',invalidChunkSize:'Invalid upload chunk size: "{chunkSize}". Resumable uploads are disabled.',invalidThumb:'Invalid thumb frame with id: "{id}".',noResumableSupport:"The browser does not support resumable or chunk uploads.",noUploadUrl:'The "uploadUrl" is not set. Ajax uploads and resumable uploads have been disabled.',retryStatus:"Retrying upload for chunk # {chunk} for {filename}... retry # {retry}.",chunkQueueError:"Could not push task to ajax pool for chunk index # {index}.",resumableMaxRetriesReached:"Maximum resumable ajax retries ({n}) reached.",resumableRetryError:"Could not retry the resumable request (try # {n})... aborting.",resumableAborting:"Aborting / cancelling the resumable request.",resumableRequestError:"Error processing resumable request. {msg}"},objUrl:window.URL||window.webkitURL,isBs:function(t){var i=e.trim((e.fn.fileinputBsVersion||"")+"");return t=parseInt(t,10),i?t===parseInt(i.charAt(0),10):4===t},defaultButtonCss:function(e){return"btn-default btn-"+(e?"":"outline-")+"secondary"},now:function(){return(new Date).getTime()},round:function(e){return e=parseFloat(e),isNaN(e)?0:Math.floor(Math.round(e))},getArray:function(e){var t,i=[],a=e&&e.length||0;for(t=0;a>t;t++)i.push(e[t]);return i},getFileRelativePath:function(e){return String(e.newPath||e.relativePath||e.webkitRelativePath||t.getFileName(e)||null)},getFileId:function(e,i){var a=t.getFileRelativePath(e);return"function"==typeof i?i(e):e&&a?e.size+"_"+encodeURIComponent(a).replace(/%/g,"_"):null},getFrameSelector:function(e,t){return t=t||"",'[id="'+e+'"]'+t},getZoomSelector:function(e,i){return t.getFrameSelector("zoom-"+e,i)},getFrameElement:function(e,i,a){return e.find(t.getFrameSelector(i,a))},getZoomElement:function(e,i,a){return e.find(t.getZoomSelector(i,a))},getElapsed:function(i){var a=i,r="",n={},o={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};return t.getObjectKeys(o).forEach(function(e){n[e]=Math.floor(a/o[e]),a-=n[e]*o[e]}),e.each(n,function(e,t){t>0&&(r+=(r?" ":"")+t+e.substring(0,1))}),r},debounce:function(e,t){var i;return function(){var a=arguments,r=this;clearTimeout(i),i=setTimeout(function(){e.apply(r,a)},t)}},stopEvent:function(e){e.stopPropagation(),e.preventDefault()},getFileName:function(e){return e?e.fileName||e.name||"":""},createObjectURL:function(e){return t.objUrl&&t.objUrl.createObjectURL&&e?t.objUrl.createObjectURL(e):""},revokeObjectURL:function(e){t.objUrl&&t.objUrl.revokeObjectURL&&e&&t.objUrl.revokeObjectURL(e)},compare:function(e,t,i){return void 0!==e&&(i?e===t:e.match(t))},isIE:function(e){var t,i;return"Microsoft Internet Explorer"!==navigator.appName?!1:10===e?new RegExp("msie\\s"+e,"i").test(navigator.userAgent):(t=document.createElement("div"),t.innerHTML="",i=t.getElementsByTagName("i").length,document.body.appendChild(t),t.parentNode.removeChild(t),i)},canOrientImage:function(t){var i=e(document.createElement("img")).css({width:"1px",height:"1px"}).insertAfter(t),a=i.css("image-orientation");return i.remove(),!!a},canAssignFilesToInput:function(){var e=document.createElement("input");try{return e.type="file",e.files=null,!0}catch(t){return!1}},getDragDropFolders:function(e){var t,i,a=e?e.length:0,r=0;if(a>0&&e[0].webkitGetAsEntry())for(t=0;a>t;t++)i=e[t].webkitGetAsEntry(),i&&i.isDirectory&&r++;return r},initModal:function(t){var i=e("body");i.length&&t.appendTo(i)},isFunction:function(e){return"function"==typeof e},isEmpty:function(i,a){return void 0===i||null===i||""===i?!0:t.isString(i)&&a?""===e.trim(i):t.isArray(i)?0===i.length:!(!e.isPlainObject(i)||!e.isEmptyObject(i))},isArray:function(e){return Array.isArray(e)||"[object Array]"===Object.prototype.toString.call(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},ifSet:function(e,t,i){return i=i||"",t&&"object"==typeof t&&e in t?t[e]:i},cleanArray:function(e){return e instanceof Array||(e=[]),e.filter(function(e){return void 0!==e&&null!==e})},spliceArray:function(t,i,a){var r,n,o=0,s=[];if(!(t instanceof Array))return[];for(n=e.extend(!0,[],t),a&&n.reverse(),r=0;r=0?atob(e.split(",")[1]):decodeURIComponent(e.split(",")[1]),a=new ArrayBuffer(i.length),r=new Uint8Array(a),n=0;ns;)switch(i=n[s++],i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:a=n[s++],o+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=n[s++],r=n[s++],o+=String.fromCharCode((15&i)<<12|(63&a)<<6|(63&r)<<0)}return o},isHtml:function(e){var t=document.createElement("div");t.innerHTML=e;for(var i=t.childNodes,a=i.length;a--;)if(1===i[a].nodeType)return!0;return!1},isSvg:function(e){return e.match(/^\s*<\?xml/i)&&(e.match(/"+t+""))},uniqId:function(){return((new Date).getTime()+Math.floor(Math.random()*Math.pow(10,15))).toString(36)},cspBuffer:{CSP_ATTRIB:"data-csp-01928735",domElementsStyles:{},stash:function(i){var a=this,r=e.parseHTML("
    "+i+"
    "),n=e(r);n.find("[style]").each(function(i,r){var n=e(r),o=n[0].style,s=t.uniqId(),l={};o&&o.length&&(e(o).each(function(){l[this]=o[this]}),a.domElementsStyles[s]=l,n.removeAttr("style").attr(a.CSP_ATTRIB,s))}),n.filter("*").removeAttr("style");var o=Object.values?Object.values(r):Object.keys(r).map(function(e){return r[e]});return o.flatMap(function(e){return e.innerHTML}).join("")},apply:function(t){var i=this,a=e(t);a.find("["+i.CSP_ATTRIB+"]").each(function(t,a){var r=e(a),n=r.attr(i.CSP_ATTRIB),o=i.domElementsStyles[n];o&&r.css(o),r.removeAttr(i.CSP_ATTRIB)}),i.domElementsStyles={}}},setHtml:function(e,i){var a=t.cspBuffer;return e.html(a.stash(i)),a.apply(e),e},htmlEncode:function(e,t){return void 0===e?t||null:e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},replaceTags:function(t,i){var a=t;return i?(e.each(i,function(e,t){"function"==typeof t&&(t=t()),a=a.split(e).join(t)}),a):a},cleanMemory:function(e){var i=e.is("img")?e.attr("src"):e.find("source").attr("src");t.revokeObjectURL(i)},findFileName:function(e){var t=e.lastIndexOf("/");return-1===t&&(t=e.lastIndexOf("\\")),e.split(e.substring(t,t+1)).pop()},checkFullScreen:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},toggleFullScreen:function(e){var i=document,a=i.documentElement,r=t.checkFullScreen();a&&e&&!r?a.requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen&&a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):r&&(i.exitFullscreen?i.exitFullscreen():i.msExitFullscreen?i.msExitFullscreen():i.mozCancelFullScreen?i.mozCancelFullScreen():i.webkitExitFullscreen&&i.webkitExitFullscreen())},moveArray:function(t,i,a,r){var n=e.extend(!0,[],t);if(r&&n.reverse(),a>=n.length)for(var o=a-n.length;o--+1;)n.push(void 0);return n.splice(a,0,n.splice(i,1)[0]),r&&n.reverse(),n},closeButton:function(e){return e=(t.isBs(5)?"btn-close":"close")+(e?" "+e:""),'"},getRotation:function(e){switch(e){case 2:return"rotateY(180deg)";case 3:return"rotate(180deg)";case 4:return"rotate(180deg) rotateY(180deg)";case 5:return"rotate(270deg) rotateY(180deg)";case 6:return"rotate(90deg)";case 7:return"rotate(90deg) rotateY(180deg)";case 8:return"rotate(270deg)";default:return""}},setTransform:function(e,t){e&&(e.style.transform=t,e.style.webkitTransform=t,e.style["-moz-transform"]=t,e.style["-ms-transform"]=t,e.style["-o-transform"]=t)},getObjectKeys:function(t){var i=[];return t&&e.each(t,function(e){i.push(e)}),i},getObjectSize:function(e){return t.getObjectKeys(e).length},whenAll:function(i){var a,r,n,o,s,l,d=[].slice,c=1===arguments.length&&t.isArray(i)?i:d.call(arguments),u=e.Deferred(),p=0,f=c.length,m=f;for(n=o=s=Array(f),l=function(e,t,i){return function(){i!==c&&p++,u.notifyWith(t[e]=this,i[e]=d.call(arguments)),--m||u[(p?"reject":"resolve")+"With"](t,i)}},a=0;f>a;a++)(r=c[a])&&e.isFunction(r.promise)?r.promise().done(l(a,s,c)).fail(l(a,n,o)):(u.notifyWith(this,r),--m);return m||u.resolveWith(s,c),u.promise()}},i=function(i,a){var r=this;r.$element=e(i),r.$parent=r.$element.parent(),r._validate()&&(r.isPreviewable=t.hasFileAPISupport(),r.isIE9=t.isIE(9),r.isIE10=t.isIE(10),(r.isPreviewable||r.isIE9)&&(r._init(a),r._listen()),r.$element.removeClass("file-loading"))},i.prototype={constructor:i,_cleanup:function(){var e=this;e.reader=null,e.clearFileStack(),e.fileBatchCompleted=!0,e.isError=!1,e.isDuplicateError=!1,e.isPersistentError=!1,e.cancelling=!1,e.paused=!1,e.lastProgress=0,e._initAjax()},_isAborted:function(){var e=this;return e.cancelling||e.paused},_initAjax:function(){var i=this,a=i.taskManager={pool:{},addPool:function(e){return a.pool[e]=new a.TasksPool(e)},getPool:function(e){return a.pool[e]},addTask:function(e,t){return new a.Task(e,t)},TasksPool:function(i){var r=this;r.id=i,r.cancelled=!1,r.cancelledDeferrer=e.Deferred(),r.tasks={},r.addTask=function(e,t){return r.tasks[e]=new a.Task(e,t)},r.size=function(){return t.getObjectSize(r.tasks)},r.run=function(i){var a,n,o,s=0,l=!1,d=t.getObjectKeys(r.tasks).map(function(e){return r.tasks[e]}),c=[],u=e.Deferred();if(r.cancelled)return r.cancelledDeferrer.resolve(),u.reject();if(!i){var p=t.getObjectKeys(r.tasks).map(function(e){return r.tasks[e].deferred});return t.whenAll(p).done(function(){var e=t.getArray(arguments);r.cancelled?(u.reject.apply(null,e),r.cancelledDeferrer.resolve()):(u.resolve.apply(null,e),r.cancelledDeferrer.reject())}).fail(function(){var e=t.getArray(arguments);u.reject.apply(null,e),r.cancelled?r.cancelledDeferrer.resolve():r.cancelledDeferrer.reject()}),e.each(r.tasks,function(e){a=r.tasks[e],a.run()}),u}for(n=function(t){e.when(t.deferred).fail(function(){l=!0,o.apply(null,arguments)}).always(o)},o=function(){var e=t.getArray(arguments);return u.notify(e),c.push(e),r.cancelled?(u.reject.apply(null,c),void r.cancelledDeferrer.resolve()):(c.length===r.size()&&(l?u.reject.apply(null,c):u.resolve.apply(null,c)),void(d.length&&(a=d.shift(),n(a),a.run())))};d.length&&s++0&&l.maxTotalFileCount10?t-10:Math.ceil(t/2),e=t;e>i;e--)r=parseFloat(o.bpsLog[e]),a++;o.bps=64*(a>0?r/a:0)},u),n={fileId:e,started:s,elapsed:l,loaded:a,total:r,bps:o.bps,bitrate:i._getSize(o.bps,i.bitRateUnits),pendingBytes:c},e?o.stats[e]=n:o.stats=n,n},exists:function(t){return-1!==e.inArray(t,i.fileManager.getIdList())},count:function(){return i.fileManager.getIdList().length},total:function(){var e=i.fileManager;return e.totalFiles||(e.totalFiles=e.count()),e.totalFiles},getTotalSize:function(){var t=i.fileManager;return t.totalSize?t.totalSize:(t.totalSize=0,e.each(i.getFileStack(),function(e,i){var a=parseFloat(i.size);t.totalSize+=isNaN(a)?0:a}),t.totalSize)},add:function(e,a){a||(a=i.fileManager.getId(e)),a&&(i.fileManager.stack[a]={file:e,name:t.getFileName(e),relativePath:t.getFileRelativePath(e),size:e.size,nameFmt:i._getFileName(e,""),sizeFmt:i._getSize(e.size)})},remove:function(e){var t=i._getThumbFileId(e);i.fileManager.removeFile(t)},removeFile:function(e){var t=i.fileManager;e&&(delete t.stack[e],delete t.loadedImages[e])},move:function(t,a){var r={},n=i.fileManager.stack;(t||a)&&t!==a&&(e.each(n,function(e,i){e!==t&&(r[e]=i),e===a&&(r[t]=n[t])}),i.fileManager.stack=r)},list:function(){var t=[];return e.each(i.getFileStack(),function(e,i){i&&i.file&&t.push(i.file)}),t},isPending:function(t){return-1===e.inArray(t,i.fileManager.filesProcessed)&&i.fileManager.exists(t)},isProcessed:function(){var t=!0,a=i.fileManager;return e.each(i.getFileStack(),function(e){a.isPending(e)&&(t=!1)}),t},clear:function(){var e=i.fileManager;i.isDuplicateError=!1,i.isPersistentError=!1,e.totalFiles=null,e.totalSize=null,e.uploadedSize=0,e.stack={},e.errors=[],e.filesProcessed=[],e.stats={},e.bpsLog=[],e.bps=0,e.clearImages()},clearImages:function(){i.fileManager.loadedImages={},i.fileManager.totalImages=0},addImage:function(e,t){i.fileManager.loadedImages[e]=t},removeImage:function(e){delete i.fileManager.loadedImages[e]},getImageIdList:function(){return t.getObjectKeys(i.fileManager.loadedImages)},getImageCount:function(){return i.fileManager.getImageIdList().length},getId:function(e){return i._getFileId(e)},getIndex:function(e){return i.fileManager.getIdList().indexOf(e)},getThumb:function(t){var a=null;return i._getThumbs().each(function(){var r=e(this);i._getThumbFileId(r)===t&&(a=r)}),a},getThumbIndex:function(e){var t=i._getThumbFileId(e);return i.fileManager.getIndex(t)},getIdList:function(){return t.getObjectKeys(i.fileManager.stack)},getFile:function(e){return i.fileManager.stack[e]||null},getFileName:function(e,t){var a=i.fileManager.getFile(e);return a?t?a.nameFmt||"":a.name||"":""},getFirstFile:function(){var e=i.fileManager.getIdList(),t=e&&e.length?e[0]:null;return i.fileManager.getFile(t)},setFile:function(e,t){i.fileManager.getFile(e)?i.fileManager.stack[e].file=t:i.fileManager.add(t,e)},setProcessed:function(e){i.fileManager.filesProcessed.push(e)},getProgress:function(){var e=i.fileManager.total(),t=i.fileManager.filesProcessed.length;return e?Math.ceil(t/e*100):0},setProgress:function(e,t){var a=i.fileManager.getFile(e);!isNaN(t)&&a&&(a.progress=t)}}},_setUploadData:function(i,a){var r=this;e.each(a,function(e,a){var n=r.uploadParamNames[e]||e;t.isArray(a)?i.append(n,a[0],a[1]):i.append(n,a)})},_initResumableUpload:function(){var i,a=this,r=a.resumableUploadOptions,n=t.logMessages,o=a.fileManager;if(a.enableResumableUpload){if(r.fallback!==!1&&"function"!=typeof r.fallback&&(r.fallback=function(e){e._log(n.noResumableSupport),e.enableResumableUpload=!1}),!t.hasResumableUploadSupport()&&r.fallback!==!1)return void r.fallback(a);if(!a.uploadUrl&&a.enableResumableUpload)return a._log(n.noUploadUrl),void(a.enableResumableUpload=!1);if(r.chunkSize=parseFloat(r.chunkSize),r.chunkSize<=0||isNaN(r.chunkSize))return a._log(n.invalidChunkSize,{chunkSize:r.chunkSize}),void(a.enableResumableUpload=!1);i=a.resumableManager={init:function(e,t,n){i.logs=[],i.stack=[],i.error="",i.id=e,i.file=t.file,i.fileName=t.name,i.fileIndex=n,i.completed=!1,i.lastProgress=0,a.showPreview&&(i.$thumb=o.getThumb(e)||null,i.$progress=i.$btnDelete=null,i.$thumb&&i.$thumb.length&&(i.$progress=i.$thumb.find(".file-thumb-progress"),i.$btnDelete=i.$thumb.find(".kv-file-remove"))),i.chunkSize=r.chunkSize*a.bytesToKB,i.chunkCount=i.getTotalChunks()},setAjaxError:function(e,t,o,s){e.responseJSON&&e.responseJSON.error&&(o=e.responseJSON.error.toString()),s||(i.error=o),r.showErrorLog&&a._log(n.ajaxError,{status:e.status,error:o,text:e.responseText||""})},reset:function(){i.stack=[],i.chunksProcessed={}},setProcessed:function(t){var n,s,l=i.id,d=i.$thumb,c=i.$progress,u=d&&d.length,p={id:u?d.attr("id"):"",index:o.getIndex(l),fileId:l},f=a.resumableUploadOptions.skipErrorsAndProceed;i.completed=!0,i.lastProgress=0,u&&d.removeClass("file-uploading"),"success"===t?(o.uploadedSize+=i.file.size,a.showPreview&&(a._setProgress(101,c),a._setThumbStatus(d,"Success"),a._initUploadSuccess(i.chunksProcessed[l].data,d)),o.removeFile(l),delete i.chunksProcessed[l],a._raise("fileuploaded",[p.id,p.index,p.fileId]),o.isProcessed()&&a._setProgress(101)):"cancel"!==t&&(a.showPreview&&(a._setThumbStatus(d,"Error"),a._setPreviewError(d,!0),a._setProgress(101,c,a.msgProgressError),a._setProgress(101,a.$progress,a.msgProgressError),a.cancelling=!f),a.$errorContainer.find('li[data-file-id="'+p.fileId+'"]').length||(s={file:i.fileName,max:r.maxRetries,error:i.error},n=a.msgResumableUploadRetriesExceeded.setTokens(s),e.extend(p,s),a._showFileError(n,p,"filemaxretries"),f&&(o.removeFile(l),delete i.chunksProcessed[l],o.isProcessed()&&a._setProgress(101)))),o.isProcessed()&&i.reset()},check:function(){var t=!0;e.each(i.logs,function(e,i){return i?void 0:(t=!1,!1)})},processedResumables:function(){var e,t=i.logs,a=0;if(!t||!t.length)return 0;for(e=0;ei.file.size?i.file.size:e},getTotalChunks:function(){var e=parseFloat(i.chunkSize);return!isNaN(e)&&e>0?Math.ceil(i.file.size/e):0},getProgress:function(){var e=i.processedResumables(),t=i.chunkCount;return 0===t?0:Math.ceil(e/t*100)},checkAborted:function(e){a._isAborted()&&(clearInterval(e),a.unlock())},upload:function(){var e,r=o.getIdList(),n="new";e=setInterval(function(){var s;if(i.checkAborted(e),"new"===n&&(a.lock(),n="processing",s=r.shift(),o.initStats(s),o.stack[s]&&(i.init(s,o.stack[s],o.getIndex(s)),i.processUpload())),!o.isPending(s)&&i.completed&&(n="new"),o.isProcessed()){var l=a.$preview.find(".file-preview-initial");l.length&&(t.addCss(l,t.SORT_CSS),a._initSortable()),clearInterval(e),a._clearFileInput(),a.unlock(),setTimeout(function(){var e=a.previewCache.data;e&&(a.initialPreview=e.content,a.initialPreviewConfig=e.config,a.initialPreviewThumbTags=e.tags),a._raise("filebatchuploadcomplete",[a.initialPreview,a.initialPreviewConfig,a.initialPreviewThumbTags,a._getExtraData()])},a.processDelay)}},a.processDelay)},uploadResumable:function(){var e,t,n=a.taskManager,o=i.chunkCount;for(t=n.addPool(i.id),e=0;o>e;e++)i.logs[e]=!(!i.chunksProcessed[i.id]||!i.chunksProcessed[i.id][e]),i.logs[e]||i.pushAjax(e,0);t.run(r.maxThreads).done(function(){i.setProcessed("success")}).fail(function(){i.setProcessed(t.cancelled?"cancel":"error")})},processUpload:function(){var n,s,l,d,c,u,p,f=i.id;return r.testUrl?(n=new FormData,s=o.stack[f],a._setUploadData(n,{fileId:f,fileName:s.fileName,fileSize:s.size,fileRelativePath:s.relativePath,chunkSize:i.chunkSize,chunkCount:i.chunkCount}),l=function(e){p=a._getOutData(n,e),a._raise("filetestbeforesend",[f,o,i,p])},d=function(r,s,l){p=a._getOutData(n,l,r);var d=a.uploadParamNames,c=d.chunksUploaded||"chunksUploaded",u=[f,o,i,p];r[c]&&t.isArray(r[c])?(i.chunksProcessed[f]||(i.chunksProcessed[f]={}),e.each(r[c],function(e,t){i.logs[t]=!0,i.chunksProcessed[f][t]=!0}),i.chunksProcessed[f].data=r,a._raise("filetestsuccess",u)):a._raise("filetesterror",u),i.uploadResumable()},c=function(e,t,r){p=a._getOutData(n,e),a._raise("filetestajaxerror",[f,o,i,p]),i.setAjaxError(e,t,r,!0),i.uploadResumable()},u=function(){a._raise("filetestcomplete",[f,o,i,a._getOutData(n)])},void a._ajaxSubmit(l,d,u,c,n,f,i.fileIndex,r.testUrl)):void i.uploadResumable()},pushAjax:function(e,t){var r=a.taskManager,o=r.getPool(i.id);o.addTask(o.size()+1,function(e){var t,r=i.stack.shift();t=r[0],i.chunksProcessed[i.id]&&i.chunksProcessed[i.id][t]?a._log(n.chunkQueueError,{index:t}):i.sendAjax(t,r[1],e)}),i.stack.push([e,t])},sendAjax:function(e,s,l){var d,c=i.chunkSize,u=i.id,p=i.file,f=i.$thumb,m=t.logMessages,g=i.$btnDelete,v=function(e,t){t&&(e=e.setTokens(t)),e=m.resumableRequestError.setTokens({msg:e}),a._log(e),l.reject(e)};if(!i.chunksProcessed[u]||!i.chunksProcessed[u][e]){if(s>r.maxRetries)return v(m.resumableMaxRetriesReached,{n:r.maxRetries}),void i.setProcessed("error");var h,w,b,_,C,x,y=p.slice?"slice":p.mozSlice?"mozSlice":p.webkitSlice?"webkitSlice":"slice",T=p[y](c*e,c*(e+1));h=new FormData,d=o.stack[u],a._setUploadData(h,{chunkCount:i.chunkCount,chunkIndex:e,chunkSize:c,chunkSizeStart:c*e,fileBlob:[T,i.fileName],fileId:u,fileName:i.fileName,fileRelativePath:d.relativePath,fileSize:p.size,retryCount:s}),i.$progress&&i.$progress.length&&i.$progress.show(),b=function(r){w=a._getOutData(h,r),a.showPreview&&(f.hasClass("file-preview-success")||(a._setThumbStatus(f,"Loading"),t.addCss(f,"file-uploading")),g.attr("disabled",!0)),a._raise("filechunkbeforesend",[u,e,s,o,i,w])},_=function(t,d,c){if(a._isAborted())return void v(m.resumableAborting);w=a._getOutData(h,c,t);var p=a.uploadParamNames,f=p.chunkIndex||"chunkIndex",g=[u,e,s,o,i,w];t.error?(r.showErrorLog&&a._log(n.retryStatus,{retry:s+1,filename:i.fileName,chunk:e}),a._raise("filechunkerror",g),i.pushAjax(e,s+1),i.error=t.error,v(t.error)):(i.logs[t[f]]=!0,i.chunksProcessed[u]||(i.chunksProcessed[u]={}),i.chunksProcessed[u][t[f]]=!0,i.chunksProcessed[u].data=t,l.resolve.call(null,t),a._raise("filechunksuccess",g),i.check())},C=function(t,r,n){return a._isAborted()?void v(m.resumableAborting):(w=a._getOutData(h,t),i.setAjaxError(t,r,n),a._raise("filechunkajaxerror",[u,e,s,o,i,w]),i.pushAjax(e,s+1),void v(m.resumableRetryError,{n:s-1}))},x=function(){a._isAborted()||a._raise("filechunkcomplete",[u,e,s,o,i,a._getOutData(h)])},a._ajaxSubmit(b,_,x,C,h,u,i.fileIndex)}}},i.reset()}},_initTemplateDefaults:function(){var i,a,r,n,o,s,l,d,c,u,p,f,m,g,v,h,w,b,_,C,x,y,T,P,k,F,S,E,I,A,D,z,j,$,U,M,R,B,O,L,N,Z,H,W=this,V=function(e,i){return'\n"+t.DEFAULT_PREVIEW+"\n\n"},q="btn btn-sm btn-kv "+t.defaultButtonCss();i='{preview}\n
    \n
    \n
    \n {caption}\n\n'+(t.isBs(5)?"":'
    \n')+" {remove}\n {cancel}\n {pause}\n {upload}\n {browse}\n"+(t.isBs(5)?"":"
    \n")+"
    ",a='{preview}\n
    \n
    \n{remove}\n{cancel}\n{upload}\n{browse}\n',r='
    \n {close}
    \n
    \n
    \n
    \n
    \n
    \n
    ',o=t.closeButton("fileinput-remove"),n='',s='\n',l='',d='{icon} {label}', +c='
    {icon} {label}
    ',Z=t.MODAL_ID+"Label",u='',p='\n',H='',f='
    \n
    \n {status}\n
    \n
    {stats}',N='
    {pendingTime} {uploadSpeed}
    ',m=" ({sizeText})",g='',v='
    \n \n
    \n{drag}\n
    ',h='\n',w='',b='{downloadIcon}',_='',C='{dragIcon}',x='
    {indicator}
    ',y='
    \n',P=y+' title="{caption}">
    \n',k="
    {footer}\n{zoomCache}
    \n",F="{content}\n",B=" {style}",S=V("html","text/html"),I=V("text","text/plain;charset=UTF-8"),M=V("pdf","application/pdf"),E='{alt}\n",A='",D='",z='\n",j='\n",$='\n",U='\n\n'+t.OBJECT_PARAMS+" "+t.DEFAULT_PREVIEW+"\n\n",R='
    \n"+t.DEFAULT_PREVIEW+"\n
    \n",O='
    {zoomContent}
    ',L={width:"100%",height:"100%","min-height":"480px"},W._isPdfRendered()&&(M=W.pdfRendererTemplate.replace("{renderer}",W._encodeURI(W.pdfRendererUrl))),W.defaults={layoutTemplates:{main1:i,main2:a,preview:r,close:o,fileIcon:n,caption:s,modalMain:u,modal:p,descriptionClose:H,progress:f,stats:N,size:m,footer:g,indicator:x,actions:v,actionDelete:h,actionUpload:w,actionDownload:b,actionZoom:_,actionDrag:C,btnDefault:l,btnLink:d,btnBrowse:c,zoomCache:O},previewMarkupTags:{tagBefore1:T,tagBefore2:P,tagAfter:k},previewContentTemplates:{generic:F,html:S,image:E,text:I,office:A,gdocs:D,video:z,audio:j,flash:$,object:U,pdf:M,other:R},allowedPreviewTypes:["image","html","text","video","audio","flash","pdf","object"],previewTemplates:{},previewSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"213px",height:"160px"},text:{width:"213px",height:"160px"},office:{width:"213px",height:"160px"},gdocs:{width:"213px",height:"160px"},video:{width:"213px",height:"160px"},audio:{width:"100%",height:"30px"},flash:{width:"213px",height:"160px"},object:{width:"213px",height:"160px"},pdf:{width:"100%",height:"160px",position:"relative"},other:{width:"213px",height:"160px"}},previewSettingsSmall:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"100%",height:"160px"},text:{width:"100%",height:"160px"},office:{width:"100%",height:"160px"},gdocs:{width:"100%",height:"160px"},video:{width:"100%",height:"auto"},audio:{width:"100%",height:"30px"},flash:{width:"100%",height:"auto"},object:{width:"100%",height:"auto"},pdf:{width:"100%",height:"160px"},other:{width:"100%",height:"160px"}},previewZoomSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:L,text:L,office:{width:"100%",height:"100%","max-width":"100%","min-height":"480px"},gdocs:{width:"100%",height:"100%","max-width":"100%","min-height":"480px"},video:{width:"auto",height:"100%","max-width":"100%"},audio:{width:"100%",height:"30px"},flash:{width:"auto",height:"480px"},object:{width:"auto",height:"100%","max-width":"100%","min-height":"480px"},pdf:L,other:{width:"auto",height:"100%","min-height":"480px"}},mimeTypeAliases:{"video/quicktime":"video/mp4"},fileTypeSettings:{image:function(e,i){return t.compare(e,"image.*")&&!t.compare(e,/(tiff?|wmf)$/i)||t.compare(i,/\.(gif|png|jpe?g)$/i)},html:function(e,i){return t.compare(e,"text/html")||t.compare(i,/\.(htm|html)$/i)},office:function(e,i){return t.compare(e,/(word|excel|powerpoint|office)$/i)||t.compare(i,/\.(docx?|xlsx?|pptx?|pps|potx?)$/i)},gdocs:function(e,i){return t.compare(e,/(word|excel|powerpoint|office|iwork-pages|tiff?)$/i)||t.compare(i,/\.(docx?|xlsx?|pptx?|pps|potx?|rtf|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i)},text:function(e,i){return t.compare(e,"text.*")||t.compare(i,/\.(xml|javascript)$/i)||t.compare(i,/\.(txt|md|nfo|ini|json|php|js|css)$/i)},video:function(e,i){return t.compare(e,"video.*")&&(t.compare(e,/(ogg|mp4|mp?g|mov|webm|3gp)$/i)||t.compare(i,/\.(og?|mp4|webm|mp?g|mov|3gp)$/i))},audio:function(e,i){return t.compare(e,"audio.*")&&(t.compare(i,/(ogg|mp3|mp?g|wav)$/i)||t.compare(i,/\.(og?|mp3|mp?g|wav)$/i))},flash:function(e,i){return t.compare(e,"application/x-shockwave-flash",!0)||t.compare(i,/\.(swf)$/i)},pdf:function(e,i){return t.compare(e,"application/pdf",!0)||t.compare(i,/\.(pdf)$/i)},object:function(){return!0},other:function(){return!0}},fileActionSettings:{showRemove:!0,showUpload:!0,showDownload:!0,showZoom:!0,showDrag:!0,removeIcon:'',removeClass:q,removeErrorClass:"btn btn-sm btn-kv btn-danger",removeTitle:"Remove file",uploadIcon:'',uploadClass:q,uploadTitle:"Upload file",uploadRetryIcon:'',uploadRetryTitle:"Retry upload",downloadIcon:'',downloadClass:q,downloadTitle:"Download file",zoomIcon:'',zoomClass:q,zoomTitle:"View Details",dragIcon:'',dragClass:"text-primary",dragTitle:"Move / Rearrange",dragSettings:{},indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:'',indicatorNewTitle:"Not uploaded yet",indicatorSuccessTitle:"Uploaded",indicatorErrorTitle:"Upload Error",indicatorLoadingTitle:"Uploading …",indicatorPausedTitle:"Upload Paused"}},e.each(W.defaults,function(t,i){return"allowedPreviewTypes"===t?void(void 0===W.allowedPreviewTypes&&(W.allowedPreviewTypes=i)):void(W[t]=e.extend(!0,{},i,W[t]))}),W._initPreviewTemplates()},_initPreviewTemplates:function(){var i,a=this,r=a.previewMarkupTags,n=r.tagAfter;e.each(a.previewContentTemplates,function(e,o){t.isEmpty(a.previewTemplates[e])&&(i=r.tagBefore2,"generic"!==e&&"image"!==e||(i=r.tagBefore1),a._isPdfRendered()&&"pdf"===e&&(i=i.replace("kv-file-content","kv-file-content kv-pdf-rendered")),a.previewTemplates[e]=i+o+n)})},_initPreviewCache:function(){var i=this;i.previewCache={data:{},init:function(){var e=i.initialPreview;e.length>0&&!t.isArray(e)&&(e=e.split(i.initialPreviewDelimiter)),i.previewCache.data={content:e,config:i.initialPreviewConfig,tags:i.initialPreviewThumbTags}},count:function(e){if(!i.previewCache.data||!i.previewCache.data.content)return 0;if(e){var t=i.previewCache.data.content.filter(function(e){return null!==e});return t.length}return i.previewCache.data.content.length},get:function(e,a){var r,n,o,s,l,d,c,u=t.INIT_FLAG+e,p=i.previewCache.data,f=p.config[e],m=p.content[e],g=t.ifSet("previewAsData",f,i.initialPreviewAsData),v=f?{title:f.title||null,alt:f.alt||null}:{title:null,alt:null},h=function(e,a,r,n,o,s,l,d){var c=" file-preview-initial "+t.SORT_CSS+(l?" "+l:""),u=i.previewInitId+"-"+s,p=f&&f.fileId||u;return i._generatePreviewTemplate(e,a,r,n,u,p,!1,null,c,o,s,d,v,f&&f.zoomData||a)};return m&&m.length?(a=void 0===a?!0:a,o=t.ifSet("type",f,i.initialPreviewFileType||"generic"),l=t.ifSet("filename",f,t.ifSet("caption",f)),d=t.ifSet("filetype",f,o),s=i.previewCache.footer(e,a,f&&f.size||null),c=t.ifSet("frameClass",f),r=g?h(o,m,l,d,s,u,c):h("generic",m,l,d,s,u,c,o).setTokens({content:p.content[e]}),p.tags.length&&p.tags[e]&&(r=t.replaceTags(r,p.tags[e])),t.isEmpty(f)||t.isEmpty(f.frameAttr)||(n=t.createElement(r),n.find(".file-preview-initial").attr(f.frameAttr),r=n.html(),n.remove()),r):""},clean:function(e){e.content=t.cleanArray(e.content),e.config=t.cleanArray(e.config),e.tags=t.cleanArray(e.tags),i.previewCache.data=e},add:function(e,a,r,n){var o,s=i.previewCache.data;return e&&e.length?(o=e.length-1,t.isArray(e)||(e=e.split(i.initialPreviewDelimiter)),n&&s.content?(o=s.content.push(e[0])-1,s.config[o]=a,s.tags[o]=r):(s.content=e,s.config=a,s.tags=r),i.previewCache.clean(s),o):0},set:function(e,a,r,n){var o,s,l=i.previewCache.data;if(e&&e.length&&(t.isArray(e)||(e=e.split(i.initialPreviewDelimiter)),s=e.filter(function(e){return null!==e}),s.length)){if(void 0===l.content&&(l.content=[]),void 0===l.config&&(l.config=[]),void 0===l.tags&&(l.tags=[]),n){for(o=0;ot;t++)a=i.previewCache.get(t),r=i.reversePreviewOrder?a+r:r+a;return e=i._getMsgSelected(n),{content:r,caption:e}},footer:function(e,a,r){var n=i.previewCache.data||{};if(t.isEmpty(n.content))return"";(t.isEmpty(n.config)||t.isEmpty(n.config[e]))&&(n.config[e]={}),a=void 0===a?!0:a;var o,s=n.config[e],l=t.ifSet("caption",s),d=t.ifSet("width",s,"auto"),c=t.ifSet("url",s,!1),u=t.ifSet("key",s,null),p=t.ifSet("fileId",s,null),f=i.fileActionSettings,m=i.initialPreviewShowDelete||!1,g=i.initialPreviewDownloadUrl?i.initialPreviewDownloadUrl+"?key="+u+(p?"&fileId="+p:""):"",v=s.downloadUrl||g,h=s.filename||s.caption||"",w=!!v,b=t.ifSet("showRemove",s,m),_=t.ifSet("showDownload",s,t.ifSet("showDownload",f,w)),C=t.ifSet("showZoom",s,t.ifSet("showZoom",f,!0)),x=t.ifSet("showDrag",s,t.ifSet("showDrag",f,!0)),y=c===!1&&a;return _=_&&s.downloadUrl!==!1&&!!v,o=i._renderFileActions(s,!1,_,b,C,x,y,c,u,!0,v,h),i._getLayoutTemplate("footer").setTokens({progress:i._renderThumbProgress(),actions:o,caption:l,size:i._getSize(r),width:d,indicator:""})}},i.previewCache.init()},_isPdfRendered:function(){var e=this,t=e.usePdfRenderer,i="function"==typeof t?t():!!t;return i&&e.pdfRendererUrl},_handler:function(e,t,i){var a=this,r=a.namespace,n=t.split(" ").join(r+" ")+r;e&&e.length&&e.off(n).on(n,i)},_encodeURI:function(e){var t=this;return t.encodeUrl?encodeURI(e):e},_log:function(e,t){var i=this,a=i.$element.attr("id");i.showConsoleLogs&&(a&&(e='"'+a+'": '+e),e="bootstrap-fileinput: "+e,"object"==typeof t&&(e=e.setTokens(t)),window.console&&"undefined"!=typeof window.console.log?window.console.log(e):window.alert(e))},_validate:function(){var e=this,i="file"===e.$element.attr("type");return i||e._log(t.logMessages.badInputType),i},_errorsExist:function(){var i,a=this,r=a.$errorContainer.find("li");return r.length?!0:(i=t.createElement(a.$errorContainer.html()),i.find(".kv-error-close").remove(),i.find("ul").remove(),!!e.trim(i.text()).length)},_errorHandler:function(e,t){var i=this,a=e.target.error,r=function(e){i._showError(e.replace("{name}",t))};r(a.code===a.NOT_FOUND_ERR?i.msgFileNotFound:a.code===a.SECURITY_ERR?i.msgFileSecured:a.code===a.NOT_READABLE_ERR?i.msgFileNotReadable:a.code===a.ABORT_ERR?i.msgFilePreviewAborted:i.msgFilePreviewError)},_addError:function(e){var i=this,a=i.$errorContainer;e&&a.length&&(t.setHtml(a,i.errorCloseButton+e),i._handler(a.find(".kv-error-close"),"click",function(){setTimeout(function(){i.showPreview&&!i.getFrames().length&&i.clear(),a.fadeOut("slow")},i.processDelay)}))},_setValidationError:function(e){var i=this;e=(e?e+" ":"")+"has-error",i.$container.removeClass(e).addClass("has-error"),t.addCss(i.$caption,"is-invalid")},_resetErrors:function(e){var t=this,i=t.$errorContainer,a=t.resumableUploadOptions.retainErrorHistory;t.isPersistentError||t.enableResumableUpload&&a||(t.isError=!1,t.$container.removeClass("has-error"),t.$caption.removeClass("is-invalid is-valid file-processing"),i.html(""),e?i.fadeOut("slow"):i.hide())},_showFolderError:function(e){var t,i=this,a=i.$errorContainer;e&&(i.isAjaxUpload||i._clearFileInput(),t=i.msgFoldersNotAllowed.replace("{n}",e),i._addError(t),i._setValidationError(),a.fadeIn(i.fadeDelay),i._raise("filefoldererror",[e,t]))},_showFileError:function(e,t,i){var a=this,r=a.$errorContainer,n=i||"fileuploaderror",o=t&&t.fileId||"",s=t&&t.id?'
  • '+e+"
  • ":"
  • "+e+"
  • ";return 0===r.find("ul").length?a._addError("
      "+s+"
    "):r.find("ul").append(s),r.fadeIn(a.fadeDelay),a._raise(n,[t,e]),a._setValidationError("file-input-new"),!0},_showError:function(e,t,i){var a=this,r=a.$errorContainer,n=i||"fileerror";return t=t||{},t.reader=a.reader,a._addError(e),r.fadeIn(a.fadeDelay),a._raise(n,[t,e]),a.isAjaxUpload||a._clearFileInput(),a._setValidationError("file-input-new"),a.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(e){var t=this,i=t.minFileCount>1?t.filePlural:t.fileSingle,a=t.msgFilesTooLess.replace("{n}",t.minFileCount).replace("{files}",i),r=t.$errorContainer;a="
  • "+a+"
  • ",0===r.find("ul").length?t._addError("
      "+a+"
    "):r.find("ul").append(a),t.isError=!0,t._updateFileDetails(0),r.fadeIn(t.fadeDelay),t._raise("fileerror",[e,a]),t._clearFileInput(),t._setValidationError()},_parseError:function(t,i,a,r){var n,o,s,l=this,d=e.trim(a+"");return o=i.responseJSON&&i.responseJSON.error?i.responseJSON.error.toString():"",s=o?o:i.responseText,l.cancelling&&l.msgUploadAborted&&(d=l.msgUploadAborted),l.showAjaxErrorDetails&&s&&(o?d=e.trim(o+""):(s=e.trim(s.replace(/\n\s*\n/g,"\n")),n=s.length?"
    "+s+"
    ":"",d+=d?n:s)),d||(d=l.msgAjaxError.replace("{operation}",t)),l.cancelling=!1,r?""+r+": "+d:d},_parseFileType:function(e,i){var a,r,n,o,s=this,l=s.allowedPreviewTypes||[];if("application/text-plain"===e)return"text";for(o=0;o-1&&(i=t.split(".").pop(),a.previewFileIconSettings&&(r=a.previewFileIconSettings[i]||a.previewFileIconSettings[i.toLowerCase()]||null),a.previewFileExtSettings&&e.each(a.previewFileExtSettings,function(e,t){return a.previewFileIconSettings[e]&&t(i)?void(r=a.previewFileIconSettings[e]):void 0})),r||a.previewFileIcon},_parseFilePreviewIcon:function(e,t){var i=this,a=i._getPreviewIcon(t),r=e;return r.indexOf("{previewFileIcon}")>-1&&(r=r.setTokens({previewFileIconClass:i.previewFileIconClass,previewFileIcon:a})),r},_raise:function(t,i){var a=this,r=e.Event(t);void 0!==i?a.$element.trigger(r,i):a.$element.trigger(r);var n=r.result,o=n===!1;if(r.isDefaultPrevented()||o)return!1;if("filebatchpreupload"===r.type&&(n||o))return a.ajaxAborted=n,!1;switch(t){case"filebatchuploadcomplete":case"filebatchuploadsuccess":case"fileuploaded":case"fileclear":case"filecleared":case"filereset":case"fileerror":case"filefoldererror":case"fileuploaderror":case"filebatchuploaderror":case"filedeleteerror":case"filecustomerror":case"filesuccessremove":break;default:a.ajaxAborted||(a.ajaxAborted=n)}return!0},_listenFullScreen:function(e){var t,i,a=this,r=a.$modal;r&&r.length&&(t=r&&r.find(".btn-kv-fullscreen"),i=r&&r.find(".btn-kv-borderless"),t.length&&i.length&&(t.removeClass("active").attr("aria-pressed","false"),i.removeClass("active").attr("aria-pressed","false"),e?t.addClass("active").attr("aria-pressed","true"):i.addClass("active").attr("aria-pressed","true"),r.hasClass("file-zoom-fullscreen")?a._maximizeZoomDialog():e?a._maximizeZoomDialog():i.removeClass("active").attr("aria-pressed","false")))},_listen:function(){var i,a=this,r=a.$element,n=a.$form,o=a.$container;a._handler(r,"click",function(e){a._initFileSelected(),r.hasClass("file-no-browse")&&(r.data("zoneClicked")?r.data("zoneClicked",!1):e.preventDefault())}),a._handler(r,"change",e.proxy(a._change,a)),a._handler(a.$caption,"paste",e.proxy(a.paste,a)),a.showBrowse&&(a._handler(a.$btnFile,"click",e.proxy(a._browse,a)),a._handler(a.$btnFile,"keypress",function(e){var t=e.keyCode||e.which;13===t&&(r.trigger("click"),a._browse(e))})),a._handler(o.find(".fileinput-remove:not([disabled])"),"click",e.proxy(a.clear,a)),a._handler(o.find(".fileinput-cancel"),"click",e.proxy(a.cancel,a)),a._handler(o.find(".fileinput-pause"),"click",e.proxy(a.pause,a)),a._initDragDrop(),a._handler(n,"reset",e.proxy(a.clear,a)),a.isAjaxUpload||a._handler(n,"submit",e.proxy(a._submitForm,a)),a._handler(a.$container.find(".fileinput-upload"),"click",e.proxy(a._uploadClick,a)),a._handler(e(window),"resize",function(){a._listenFullScreen(screen.width===window.innerWidth&&screen.height===window.innerHeight)}),i="webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",a._handler(e(document),i,function(){a._listenFullScreen(t.checkFullScreen())}),a.$caption.on("focus",function(){a.$captionContainer.focus()}),a._autoFitContent(),a._initClickable(),a._refreshPreview()},_autoFitContent:function(){var t,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=this,r=400>i?a.previewSettingsSmall||a.defaults.previewSettingsSmall:a.previewSettings||a.defaults.previewSettings;e.each(r,function(e,i){t=".file-preview-frame .file-preview-"+e,a.$preview.find(t+".kv-preview-data,"+t+" .kv-preview-data").css(i)})},_scanDroppedItems:function(e,i,a){a=a||"";var r,n,o,s=this,l=function(e){s._log(t.logMessages.badDroppedFiles),s._log(e)};e.isFile?e.file(function(e){a&&(e.newPath=a+e.name),i.push(e)},l):e.isDirectory&&(n=e.createReader(),(o=function(){n.readEntries(function(t){if(t&&t.length>0){for(r=0;r-1;return a._zoneDragDropInit(i),a.isDisabled||!n?(r.effectAllowed="none",void(r.dropEffect="none")):(r.dropEffect="copy",void(a._raise("fileDragEnter",{sourceEvent:i,files:r.types.Files})&&t.addCss(a.$dropZone,"file-highlighted")))},_zoneDragLeave:function(e){var t=this;t._zoneDragDropInit(e),t.isDisabled||t._raise("fileDragLeave",{sourceEvent:e})&&t.$dropZone.removeClass("file-highlighted")},_dropFiles:function(e,t){var i=this,a=i.$element;i.isAjaxUpload?i._change(e,t):(i.changeTriggered=!0,a.get(0).files=t,setTimeout(function(){i.changeTriggered=!1,a.trigger("change"+i.namespace)},i.processDelay)),i.$dropZone.removeClass("file-highlighted")},_zoneDrop:function(e){var i,a=this,r=(a.$element,e.originalEvent.dataTransfer),n=r.files,o=r.items,s=t.getDragDropFolders(o);if(e.preventDefault(),!a.isDisabled&&!t.isEmpty(n)&&a._raise("fileDragDrop",{sourceEvent:e,files:n}))if(s>0){if(!a.isAjaxUpload)return void a._showFolderError(s);for(n=[],i=0;i0&&n>=l,c=e(i.item);d&&(n=l-1),o.initialPreview=t.moveArray(o.initialPreview,r,n,u),o.initialPreviewConfig=t.moveArray(o.initialPreviewConfig,r,n,u),o.previewCache.init(),o.getFrames(".file-preview-initial").each(function(){e(this).attr("data-fileindex",t.INIT_FLAG+s),s++}),d&&(a=o.getFrames(":not(.file-preview-initial):first"),a.length&&c.slideUp(function(){c.insertBefore(a).slideDown()})),o._raise("filesorted",{previewId:c.attr("id"),oldIndex:r,newIndex:n,stack:o.initialPreviewConfig})}},e.extend(!0,i,o.fileActionSettings.dragSettings),o.sortable&&o.sortable.destroy(),o.sortable=p.create(s[0],i))},_setPreviewContent:function(e){var i=this;t.setHtml(i.$preview,e),i._autoFitContent()},_initPreviewImageOrientations:function(){var t=this,i=0,a=t.canOrientImage;(t.autoOrientImageInitial||a)&&t.getFrames(".file-preview-initial").each(function(){var r,n,o,s=e(this),l=t.initialPreviewConfig[i];l&&l.exif&&l.exif.Orientation&&(o=s.attr("id"),r=s.find(">.kv-file-content img"),n=t._getZoom(o," >.kv-file-content img"),a?r.css("image-orientation",t.autoOrientImageInitial?"from-image":"none"):t.setImageOrientation(r,n,l.exif.Orientation,s)),i++})},_initPreview:function(e){var i,a=this,r=a.initialCaption||"";return a.previewCache.count(!0)?(i=a.previewCache.out(),r=e&&a.initialCaption?a.initialCaption:i.caption,a._setPreviewContent(i.content),a._setInitThumbAttr(),a._setCaption(r),a._initSortable(),t.isEmpty(i.content)||a.$container.removeClass("file-input-new"),void a._initPreviewImageOrientations()):(a._clearPreview(),void(e?a._setCaption(r):a._initCaption()))},_getZoomButton:function(e){var i=this,a=i.previewZoomButtonIcons[e],r=i.previewZoomButtonClasses[e],n=' title="'+(i.previewZoomButtonTitles[e]||"")+'" ',o=t.isBs(5)?"bs-":"",s=n+("close"===e?" data-"+o+'dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==e&&"borderless"!==e&&"toggleheader"!==e||(s+=' data-toggle="button" aria-pressed="false" autocomplete="off"'),'"},_getModalContent:function(){var e=this;return e._getLayoutTemplate("modal").setTokens({rtl:e.rtl?" kv-rtl":"",zoomFrameClass:e.frameClass,prev:e._getZoomButton("prev"),next:e._getZoomButton("next"),toggleheader:e._getZoomButton("toggleheader"),fullscreen:e._getZoomButton("fullscreen"),borderless:e._getZoomButton("borderless"),close:e._getZoomButton("close")})},_listenModalEvent:function(e){var i=this,a=i.$modal,r=function(e){return{sourceEvent:e,previewId:a.data("previewId"),modal:a}};a.on(e+".bs.modal",function(n){if("bs.modal"===n.namespace){var o=a.find(".btn-fullscreen"),s=a.find(".btn-borderless");a.data("fileinputPluginId")===i.$element.attr("id")&&i._raise("filezoom"+e,r(n)),"shown"===e&&(s.removeClass("active").attr("aria-pressed","false"),o.removeClass("active").attr("aria-pressed","false"),a.hasClass("file-zoom-fullscreen")&&(i._maximizeZoomDialog(),t.checkFullScreen()?o.addClass("active").attr("aria-pressed","true"):s.addClass("active").attr("aria-pressed","true")))}})},_initZoom:function(){var i,a=this,r=a._getLayoutTemplate("modalMain"),n="#"+t.MODAL_ID;r=a._setTabIndex("modal",r),a.showPreview&&(a.$modal=e(n),a.$modal&&a.$modal.length||(i=t.createElement(t.cspBuffer.stash(r)).insertAfter(a.$container),a.$modal=e(n).insertBefore(i),t.cspBuffer.apply(a.$modal),i.remove()),t.initModal(a.$modal),a.$modal.html(t.cspBuffer.stash(a._getModalContent())),t.cspBuffer.apply(a.$modal),e.each(t.MODAL_EVENTS,function(e,t){a._listenModalEvent(t)}))},_initZoomButtons:function(){var t,i,a=this,r=a.$modal.data("previewId")||"",n=a.getFrames().toArray(),o=n.length,s=a.$modal.find(".btn-kv-prev"),l=a.$modal.find(".btn-kv-next");return n.length<2?(s.hide(),void l.hide()):(s.show(),l.show(),void(o&&(t=e(n[0]),i=e(n[o-1]),s.removeAttr("disabled"),l.removeAttr("disabled"),a.reversePreviewOrder&&([s,l]=[l,s]),t.length&&t.attr("id")===r&&s.attr("disabled",!0),i.length&&i.attr("id")===r&&l.attr("disabled",!0))))},_maximizeZoomDialog:function(){var t=this,i=t.$modal,a=i.find(".modal-header:visible"),r=i.find(".modal-footer:visible"),n=i.find(".kv-zoom-body"),o=e(window).height(),s=0;i.addClass("file-zoom-fullscreen"),a&&a.length&&(o-=a.outerHeight(!0)),r&&r.length&&(o-=r.outerHeight(!0)),n&&n.length&&(s=n.outerHeight(!0)-n.height(),o-=s),i.find(".kv-zoom-body").height(o)},_resizeZoomDialog:function(e){var i=this,a=i.$modal,r=a.find(".btn-kv-fullscreen"),n=a.find(".btn-kv-borderless");if(a.hasClass("file-zoom-fullscreen"))t.toggleFullScreen(!1),e?r.hasClass("active")||(a.removeClass("file-zoom-fullscreen"),i._resizeZoomDialog(!0),n.hasClass("active")&&n.removeClass("active").attr("aria-pressed","false")):r.hasClass("active")?r.removeClass("active").attr("aria-pressed","false"):(a.removeClass("file-zoom-fullscreen"),i.$modal.find(".kv-zoom-body").css("height",i.zoomModalHeight));else{if(!e)return void i._maximizeZoomDialog();t.toggleFullScreen(!0)}a.focus()},_setZoomContent:function(i,a){var r,n,o,s,l,d,c,u,p,f,m,g,v=this,h=i.attr("id"),w=v._getZoom(h),b=v.$modal,_=b.find(".btn-kv-fullscreen"),C=b.find(".btn-kv-borderless"),x=b.find(".btn-kv-toggleheader"),y=i.data("zoom");y&&(y=decodeURIComponent(y),g=w.html().replace(t.ZOOM_VAR,"").setTokens({zoomData:y}),w.html(g),i.data("zoom",""),w.attr("data-zoom",y)),n=w.attr("data-template")||"generic",r=w.find(".kv-file-content"),o=r.length?'\n'+r.html():"",f=i.data("caption")||v.msgZoomModalHeading,m=i.data("size")||"",u=i.data("description")||"",b.find(".kv-zoom-caption").attr("title",f).html(f),b.find(".kv-zoom-size").html(m),p=b.find(".kv-zoom-description").hide(),u&&(v.showDescriptionClose&&(u=v._getLayoutTemplate("descriptionClose").setTokens({closeIcon:v.previewZoomButtonIcons.close})+""+u),p.show().html(u),v.showDescriptionClose&&v._handler(b.find(".kv-desc-hide"),"click",function(){e(this).parent().fadeOut("fast",function(){b.focus()})})),s=b.find(".kv-zoom-body"),b.removeClass("kv-single-content"),a?(c=s.addClass("file-thumb-loading").clone().insertAfter(s),t.setHtml(s,o).hide(),c.fadeOut("fast",function(){s.fadeIn("fast",function(){s.removeClass("file-thumb-loading")}),c.remove()})):t.setHtml(s,o),d=v.previewZoomSettings[n],d&&(l=s.find(".kv-preview-data"),t.addCss(l,"file-zoom-detail"),e.each(d,function(e,t){l.css(e,t),(l.attr("width")&&"width"===e||l.attr("height")&&"height"===e)&&l.removeAttr(e)})),b.data("previewId",h),v._handler(b.find(".btn-kv-prev"),"click",function(){v._zoomSlideShow("prev",h)}),v._handler(b.find(".btn-kv-next"),"click",function(){v._zoomSlideShow("next",h)}),v._handler(_,"click",function(){v._resizeZoomDialog(!0)}),v._handler(C,"click",function(){v._resizeZoomDialog(!1)}),v._handler(x,"click",function(){var e,t=b.find(".modal-header"),i=b.find(".floating-buttons"),a=t.find(".kv-zoom-actions"),r=function(e){var i=v.$modal.find(".kv-zoom-body"),a=v.zoomModalHeight;b.hasClass("file-zoom-fullscreen")&&(a=i.outerHeight(!0),e||(a-=t.outerHeight(!0))),i.css("height",e?a+e:a)};t.is(":visible")?(e=t.outerHeight(!0),t.slideUp("slow",function(){a.find(".btn").appendTo(i),r(e)})):(i.find(".btn").appendTo(a),t.slideDown("slow",function(){r()})),b.focus()}),v._handler(b,"keydown",function(t){var i,a,r=t.which||t.keyCode,n=v.processDelay+1,o=e(this).find(".btn-kv-prev"),s=e(this).find(".btn-kv-next"),l=e(this).data("previewId");[i,a]=v.rtl?[39,37]:[37,39],e.each({prev:[o,i],next:[s,a]},function(e,t){var i=t[0],a=t[1];r===a&&i.length&&(b.focus(),i.attr("disabled")||(i.focus(),v._zoomSlideShow(e,l),setTimeout(function(){i.attr("disabled")&&b.focus()},n)))})})},_showModal:function(e){var i=this,a=i.$modal;e&&e.length&&(t.initModal(a),t.setHtml(a,i._getModalContent()),i._setZoomContent(e),a.data({backdrop:!1}),a.modal("show"),i._initZoomButtons())},_zoomPreview:function(e){var i,a=this;if(!e.length)throw"Cannot zoom to detailed preview!";i=e.closest(t.FRAMES),a._showModal(i)},_zoomSlideShow:function(t,i){var a,r,n,o,s=this,l=s.$modal.find(".kv-zoom-actions .btn-kv-"+t),d=s.getFrames().toArray(),c=[],u=d.length;if(s.reversePreviewOrder&&(t="prev"===t?"next":"prev"),!l.attr("disabled")){for(r=0;u>r;r++)n=e(d[r]),n&&n.length&&n.find(".kv-file-zoom:visible").length&&c.push(d[r]);for(u=c.length,r=0;u>r;r++)if(e(c[r]).attr("id")===i){o="prev"===t?r-1:r+1;break}0>o||o>=u||!c[o]||(a=e(c[o]),a.length&&s._setZoomContent(a,t),s._initZoomButtons(),s._raise("filezoom"+t,{previewId:i,modal:s.$modal}))}},_initZoomButton:function(){var t=this;t.$preview.find(".kv-file-zoom").each(function(){var i=e(this);t._handler(i,"click",function(){ +t._zoomPreview(i)})})},_inputFileCount:function(){return this.$element[0].files.length},_refreshPreview:function(){var t,i=this;(i._inputFileCount()||i.isAjaxUpload)&&i.showPreview&&i.isPreviewable&&(i.isAjaxUpload&&i.fileManager.count()>0?(t=e.extend(!0,{},i.getFileList()),i.fileManager.clear(),i._clearFileInput()):t=i.$element[0].files,t&&t.length&&(i.readFiles(t),i._setFileDropZoneTitle()))},_clearObjects:function(t){t.find("video audio").each(function(){this.pause(),e(this).remove()}),t.find("img object div").each(function(){e(this).remove()})},_clearFileInput:function(){var t,i,a,r=this,n=r.$element;r._inputFileCount()&&(t=n.closest("form"),i=e(document.createElement("form")),a=e(document.createElement("div")),n.before(a),t.length?t.after(i):a.after(i),i.append(n).trigger("reset"),a.before(n).remove(),i.remove())},_resetUpload:function(){var e=this;e.uploadStartTime=t.now(),e.uploadCache=[],e.$btnUpload.removeAttr("disabled"),e._setProgress(0),e._hideProgress(),e._resetErrors(!1),e._initAjax(),e.fileManager.clearImages(),e._resetCanvas(),e.overwriteInitial&&(e.initialPreview=[],e.initialPreviewConfig=[],e.initialPreviewThumbTags=[],e.previewCache.data={content:[],config:[],tags:[]})},_resetCanvas:function(){var e=this;e.imageCanvas&&e.imageCanvasContext&&e.imageCanvasContext.clearRect(0,0,e.imageCanvas.width,e.imageCanvas.height)},_hasInitialPreview:function(){var e=this;return!e.overwriteInitial&&e.previewCache.count(!0)},_resetPreview:function(){var i,a,r,n=this,o=n.showUploadedThumbs,s=!n.removeFromPreviewOnError,l=(o||s)&&n.isDuplicateError;n.previewCache.count(!0)?(i=n.previewCache.out(),l&&(r=t.createElement("").insertAfter(n.$container),n.getFrames().each(function(){var t=e(this);(o&&t.hasClass("file-preview-success")||s&&t.hasClass("file-preview-error"))&&r.append(t)})),n._setPreviewContent(i.content),n._setInitThumbAttr(),a=n.initialCaption?n.initialCaption:i.caption,n._setCaption(a),l&&(r.contents().appendTo(n.$preview),r.remove())):(n._clearPreview(),n._initCaption()),n.showPreview&&(n._initZoom(),n._initSortable()),n.isDuplicateError=!1},_clearDefaultPreview:function(){var e=this;e.$preview.find(".file-default-preview").remove()},_validateDefaultPreview:function(){var e=this;e.showPreview&&!t.isEmpty(e.defaultPreviewContent)&&(e._setPreviewContent('
    '+e.defaultPreviewContent+"
    "),e.$container.removeClass("file-input-new"),e._initClickable())},_resetPreviewThumbs:function(e){var t,i=this;return e?(i._clearPreview(),void i.clearFileStack()):void(i._hasInitialPreview()?(t=i.previewCache.out(),i._setPreviewContent(t.content),i._setInitThumbAttr(),i._setCaption(t.caption),i._initPreviewActions()):i._clearPreview())},_getLayoutTemplate:function(e){var i=this,a=i.layoutTemplates[e];return t.isEmpty(i.customLayoutTags)?a:t.replaceTags(a,i.customLayoutTags)},_getPreviewTemplate:function(e){var i=this,a=i.previewTemplates,r=a[e]||a.other;return t.isEmpty(i.customPreviewTags)?r:t.replaceTags(r,i.customPreviewTags)},_getOutData:function(e,t,i,a){var r=this;return t=t||{},i=i||{},a=a||r.fileManager.list(),{formdata:e,files:a,filenames:r.filenames,filescount:r.getFilesCount(),extra:r._getExtraData(),response:i,reader:r.reader,jqXHR:t}},_getMsgSelected:function(e,t){var i=this,a=1===e?i.fileSingle:i.filePlural;return e>0?i.msgSelected.replace("{n}",e).replace("{files}",a):t?i.msgProcessing:i.msgNoFilesSelected},_getFrame:function(e,i){var a=this,r=t.getFrameElement(a.$preview,e);return!a.showPreview||i||r.length||a._log(t.logMessages.invalidThumb,{id:e}),r},_getZoom:function(e,i){var a=this,r=t.getZoomElement(a.$preview,e,i);return a.showPreview&&!r.length&&a._log(t.logMessages.invalidThumb,{id:e}),r},_getThumbs:function(e){return e=e||"",this.getFrames(":not(.file-preview-initial)"+e)},_getThumbId:function(e){var t=this;return t.previewInitId+"-"+e},_getExtraData:function(e,t){var i=this,a=i.uploadExtraData;return"function"==typeof i.uploadExtraData&&(a=i.uploadExtraData(e,t)),a},_initXhr:function(e,i){var a=this,r=a.fileManager,n=function(e){var n=0,o=e.total,s=e.loaded||e.position,l=r.getUploadStats(i,s,o);e.lengthComputable&&!a.enableResumableUpload&&(n=t.round(s/o*100)),i?a._setFileUploadStats(i,n,l):a._setProgress(n,null,null,a._getStats(l)),a._raise("fileajaxprogress",[l])};return e.upload&&(a.progressDelay&&(n=t.debounce(n,a.progressDelay)),e.upload.addEventListener("progress",n,!1)),e},_initAjaxSettings:function(){var t=this;t._ajaxSettings=e.extend(!0,{},t.ajaxSettings),t._ajaxDeleteSettings=e.extend(!0,{},t.ajaxDeleteSettings)},_mergeAjaxCallback:function(e,t,i){var a,r=this,n=r._ajaxSettings,o=r.mergeAjaxCallbacks;"delete"===i&&(n=r._ajaxDeleteSettings,o=r.mergeAjaxDeleteCallbacks),a=n[e],o&&"function"==typeof a?"before"===o?n[e]=function(){a.apply(this,arguments),t.apply(this,arguments)}:n[e]=function(){t.apply(this,arguments),a.apply(this,arguments)}:n[e]=t},_ajaxSubmit:function(t,i,a,r,n,o,s,l){var d,c,u,p,f=this;f._raise("filepreajax",[n,o,s])&&(n.append("initialPreview",JSON.stringify(f.initialPreview)),n.append("initialPreviewConfig",JSON.stringify(f.initialPreviewConfig)),n.append("initialPreviewThumbTags",JSON.stringify(f.initialPreviewThumbTags)),f._initAjaxSettings(),f._mergeAjaxCallback("beforeSend",t),f._mergeAjaxCallback("success",i),f._mergeAjaxCallback("complete",a),f._mergeAjaxCallback("error",r),l=l||f.uploadUrlThumb||f.uploadUrl,"function"==typeof l&&(l=l()),u=f._getExtraData(o,s)||{},"object"==typeof u&&e.each(u,function(e,t){n.append(e,t)}),c={xhr:function(){var t=e.ajaxSettings.xhr();return f._initXhr(t,o)},url:f._encodeURI(l),type:"POST",dataType:"json",data:n,cache:!1,processData:!1,contentType:!1},d=e.extend(!0,{},c,f._ajaxSettings),p=f.taskManager.addTask(o+"-"+s,function(){var t,i,a=this.self;t=a.ajaxQueue.shift(),i=e.ajax(t),a.ajaxRequests.push(i)}),f.ajaxQueue.push(d),p.runWithContext({self:f}))},_mergeArray:function(e,i){var a=this,r=t.cleanArray(a[e]),n=t.cleanArray(i);a[e]=r.concat(n)},_initUploadSuccess:function(i,a,r){var n,o,s,l,d,c,u,p,f,m=this;return!m.showPreview||"object"!=typeof i||e.isEmptyObject(i)?void m._resetCaption():(void 0!==i.initialPreview&&i.initialPreview.length>0&&(m.hasInitData=!0,d=i.initialPreview||[],c=i.initialPreviewConfig||[],u=i.initialPreviewThumbTags||[],n=void 0===i.append||i.append,d.length>0&&!t.isArray(d)&&(d=d.split(m.initialPreviewDelimiter)),d.length&&(m._mergeArray("initialPreview",d),m._mergeArray("initialPreviewConfig",c),m._mergeArray("initialPreviewThumbTags",u)),void 0!==a?r?(p=a.attr("id"),f=m._getUploadCacheIndex(p),null!==f&&(m.uploadCache[f]={id:p,content:d[0],config:c[0]||[],tags:u[0]||[],append:n})):(s=m.previewCache.add(d[0],c[0],u[0],n),o=m.previewCache.get(s,!1),l=t.createElement(o).hide().appendTo(a),a.fadeOut("slow",function(){var e=l.find("> .file-preview-frame");e&&e.length&&e.insertBefore(a).fadeIn("slow").css("display:inline-block"),m._initPreviewActions(),m._clearFileInput(),a.remove(),l.remove(),m._initSortable()})):(m.previewCache.set(d,c,u,n),m._initPreview(),m._initPreviewActions())),void m._resetCaption())},_getUploadCacheIndex:function(e){var t,i,a=this,r=a.uploadCache.length;for(t=0;r>t;t++)if(i=a.uploadCache[t],i.id===e)return t;return null},_initSuccessThumbs:function(){var i=this;i.showPreview&&setTimeout(function(){i._getThumbs(t.FRAMES+".file-preview-success").each(function(){var a=e(this),r=a.find(".kv-file-remove");r.removeAttr("disabled"),i._handler(r,"click",function(){var e=a.attr("id"),r=i._raise("filesuccessremove",[e,a.attr("data-fileindex")]);t.cleanMemory(a),r!==!1&&(i.$caption.attr("title",""),a.fadeOut("slow",function(){i.fileManager;a.remove(),i.getFrames().length||i.reset()}))})})},i.processDelay)},_updateInitialPreview:function(){var t=this,i=t.uploadCache;t.showPreview&&(e.each(i,function(e,i){t.previewCache.add(i.content,i.config,i.tags,i.append)}),t.hasInitData&&(t._initPreview(),t._initPreviewActions()))},_getThumbFileId:function(e){var t=this;return t.showPreview&&void 0!==e?e.attr("data-fileid"):null},_getThumbFile:function(e){var t=this,i=t._getThumbFileId(e);return i?t.fileManager.getFile(i):null},_uploadSingle:function(i,a,r){var n,o,s,l,d,c,u,p,f,m,g,v,h,w=this,b=w.fileManager,_=b.count(),C=new FormData,x=w._getThumbId(a),y=_>0||!e.isEmptyObject(w.uploadExtraData),T=w.ajaxOperations.uploadThumb,P=b.getFile(a),k={id:x,index:i,fileId:a},F=w.fileManager.getFileName(a,!0);w.enableResumableUpload||(w.showPreview&&(o=b.getThumb(a),u=o.find(".file-thumb-progress"),l=o.find(".kv-file-upload"),d=o.find(".kv-file-remove"),u.show()),0===_||!y||w.showPreview&&l&&l.hasClass("disabled")||w._abort(k)||(h=function(){c?b.errors.push(a):b.removeFile(a),b.setProcessed(a),b.isProcessed()&&(w.fileBatchCompleted=!0,s())},s=function(){var e;w.fileBatchCompleted&&setTimeout(function(){var i=0===b.count(),a=b.errors.length;w._updateInitialPreview(),w.unlock(i),i&&w._clearFileInput(),e=w.$preview.find(".file-preview-initial"),w.uploadAsync&&e.length&&(t.addCss(e,t.SORT_CSS),w._initSortable()),w._raise("filebatchuploadcomplete",[b.stack,w._getExtraData()]),w.retryErrorUploads&&0!==a||b.clear(),w._setProgress(101),w.ajaxAborted=!1},w.processDelay)},p=function(s){n=w._getOutData(C,s),b.initStats(a),w.fileBatchCompleted=!1,r||(w.ajaxAborted=!1),w.showPreview&&(o.hasClass("file-preview-success")||(w._setThumbStatus(o,"Loading"),t.addCss(o,"file-uploading")),l.attr("disabled",!0),d.attr("disabled",!0)),r||w.lock(),-1!==b.errors.indexOf(a)&&delete b.errors[a],w._raise("filepreupload",[n,x,i,w._getThumbFileId(o)]),e.extend(!0,k,n),w._abort(k)&&(s.abort(),r||(w._setThumbStatus(o,"New"),o.removeClass("file-uploading"),l.removeAttr("disabled"),d.removeAttr("disabled")),w._setProgressCancelled())},m=function(s,d,p){var m=w.showPreview&&o.attr("id")?o.attr("id"):x;n=w._getOutData(C,p,s),e.extend(!0,k,n),setTimeout(function(){t.isEmpty(s)||t.isEmpty(s.error)?(w.showPreview&&(w._setThumbStatus(o,"Success"),l.hide(),w._initUploadSuccess(s,o,r),w._setProgress(101,u)),w._raise("fileuploaded",[n,m,i,w._getThumbFileId(o)]),r?h():w.fileManager.remove(o)):(c=!0,f=w._parseError(T,p,w.msgUploadError,w.fileManager.getFileName(a)),w._showFileError(f,k),w._setPreviewError(o,!0),w.retryErrorUploads||l.hide(),r&&h(),w._setProgress(101,w._getFrame(m).find(".file-thumb-progress"),w.msgUploadError))},w.processDelay)},g=function(){w.showPreview&&(l.removeAttr("disabled"),d.removeAttr("disabled"),o.removeClass("file-uploading")),r?s():(w.unlock(!1),w._clearFileInput()),w._initSuccessThumbs()},v=function(t,i,n){f=w._parseError(T,t,n,w.fileManager.getFileName(a)),c=!0,setTimeout(function(){var i;r&&h(),w.fileManager.setProgress(a,100),w._setPreviewError(o,!0),w.retryErrorUploads||l.hide(),e.extend(!0,k,w._getOutData(C,t)),w._setProgress(101,w.$progress,w.msgAjaxProgressError.replace("{operation}",T)),i=w.showPreview&&o?o.find(".file-thumb-progress"):"",w._setProgress(101,i,w.msgUploadError),w._showFileError(f,k)},w.processDelay)},w._setFileData(C,P.file,F,a),w._setUploadData(C,{fileId:a}),w._ajaxSubmit(p,m,g,v,C,a,i)))},_setFileData:function(e,t,i,a){var r=this,n=r.preProcessUpload;n&&"function"==typeof n?e.append(r.uploadFileAttr,n(a,t)):e.append(r.uploadFileAttr,t,i)},_checkBatchPreupload:function(t,i){var a=this,r=a._raise("filebatchpreupload",[t]);return r?!0:(a._abort(t),i&&i.abort(),a._getThumbs().each(function(){var t=e(this),i=t.find(".kv-file-upload"),r=t.find(".kv-file-remove");t.hasClass("file-preview-loading")&&(a._setThumbStatus(t,"New"),t.removeClass("file-uploading")),i.removeAttr("disabled"),r.removeAttr("disabled")}),a._setProgressCancelled(),!1)},_uploadBatch:function(){var i,a,r,n,o,s,l=this,d=l.fileManager,c=d.total(),u={},p=c>0||!e.isEmptyObject(l.uploadExtraData),f=new FormData,m=l.ajaxOperations.uploadBatch;if(0!==c&&p&&!l._abort(u)){s=function(){l.fileManager.clear(),l._clearFileInput()},i=function(i){l.lock(),d.initStats();var a=l._getOutData(f,i);l.ajaxAborted=!1,l.showPreview&&l._getThumbs().each(function(){var i=e(this),a=i.find(".kv-file-upload"),r=i.find(".kv-file-remove");i.hasClass("file-preview-success")||(l._setThumbStatus(i,"Loading"),t.addCss(i,"file-uploading")),a.attr("disabled",!0),r.attr("disabled",!0)}),l._checkBatchPreupload(a,i)},a=function(i,a,r){var n=l._getOutData(f,r,i),d=0,c=l._getThumbs(":not(.file-preview-success)"),u=t.isEmpty(i)||t.isEmpty(i.errorkeys)?[]:i.errorkeys;t.isEmpty(i)||t.isEmpty(i.error)?(l._raise("filebatchuploadsuccess",[n]),s(),l.showPreview?(c.each(function(){var t=e(this);l._setThumbStatus(t,"Success"),t.removeClass("file-uploading"),t.find(".kv-file-upload").hide().removeAttr("disabled")}),l._initUploadSuccess(i)):l.reset(),l._setProgress(101)):(l.showPreview&&(c.each(function(){var t=e(this);t.removeClass("file-uploading"),t.find(".kv-file-upload").removeAttr("disabled"),t.find(".kv-file-remove").removeAttr("disabled"),0===u.length||-1!==e.inArray(d,u)?(l._setPreviewError(t,!0),l.retryErrorUploads||(t.find(".kv-file-upload").hide(),l.fileManager.remove(t))):(t.find(".kv-file-upload").hide(),l._setThumbStatus(t,"Success"),l.fileManager.remove(t)),t.hasClass("file-preview-error")&&!l.retryErrorUploads||d++}),l._initUploadSuccess(i)),o=l._parseError(m,r,l.msgUploadError),l._showFileError(o,n,"filebatchuploaderror"),l._setProgress(101,l.$progress,l.msgUploadError))},n=function(){l.unlock(),l._initSuccessThumbs(),l._clearFileInput(),l._raise("filebatchuploadcomplete",[l.fileManager.stack,l._getExtraData()])},r=function(t,i,a){var r=l._getOutData(f,t);o=l._parseError(m,t,a),l._showFileError(o,r,"filebatchuploaderror"),l.uploadFileCount=c-1,l.showPreview&&(l._getThumbs().each(function(){var t=e(this);t.removeClass("file-uploading"),l._getThumbFile(t)&&l._setPreviewError(t)}),l._getThumbs().removeClass("file-uploading"),l._getThumbs(" .kv-file-upload").removeAttr("disabled"),l._getThumbs(" .kv-file-delete").removeAttr("disabled"),l._setProgress(101,l.$progress,l.msgAjaxProgressError.replace("{operation}",m)))};var g=0;e.each(l.fileManager.stack,function(e,i){t.isEmpty(i.file)||l._setFileData(f,i.file,i.nameFmt||"untitled_"+g,e),g++}),l._ajaxSubmit(i,a,n,r,f)}},_uploadExtraOnly:function(){var e,i,a,r,n,o=this,s={},l=new FormData,d=o.ajaxOperations.uploadExtra;e=function(e){o.lock();var t=o._getOutData(l,e);o._setProgress(50),s.data=t,s.xhr=e,o._checkBatchPreupload(t,e)},i=function(e,i,a){var r=o._getOutData(l,a,e);t.isEmpty(e)||t.isEmpty(e.error)?(o._raise("filebatchuploadsuccess",[r]),o._clearFileInput(),o._initUploadSuccess(e),o._setProgress(101)):(n=o._parseError(d,a,o.msgUploadError),o._showFileError(n,r,"filebatchuploaderror"))},a=function(){o.unlock(),o._clearFileInput(),o._raise("filebatchuploadcomplete",[o.fileManager.stack,o._getExtraData()])},r=function(e,t,i){var a=o._getOutData(l,e);n=o._parseError(d,e,i),s.data=a,o._showFileError(n,a,"filebatchuploaderror"),o._setProgress(101,o.$progress,o.msgAjaxProgressError.replace("{operation}",d))},o._ajaxSubmit(e,i,a,r,l)},_deleteFileIndex:function(i){var a=this,r=i.attr("data-fileindex"),n=a.reversePreviewOrder;r.substring(0,5)===t.INIT_FLAG&&(r=parseInt(r.replace(t.INIT_FLAG,"")),a.initialPreview=t.spliceArray(a.initialPreview,r,n),a.initialPreviewConfig=t.spliceArray(a.initialPreviewConfig,r,n),a.initialPreviewThumbTags=t.spliceArray(a.initialPreviewThumbTags,r,n),a.getFrames().each(function(){var i=e(this),a=i.attr("data-fileindex");a.substring(0,5)===t.INIT_FLAG&&(a=parseInt(a.replace(t.INIT_FLAG,"")),a>r&&(a--,i.attr("data-fileindex",t.INIT_FLAG+a)))}))},_resetCaption:function(){var e=this;setTimeout(function(){var t,i,a,r="",n=e.previewCache.count(!0),o=e.fileManager.count(),s=":not(.file-preview-success):not(.file-preview-error)",l=e.showPreview&&e.getFrames(s).length;0!==o||0!==n||l?(t=n+o,t>1?r=e._getMsgSelected(t):0===o?(a=e.initialPreviewConfig[0],r="",a&&(r=a.caption||a.filename||""),r||(r=e._getMsgSelected(t))):(i=e.fileManager.getFirstFile(),r=i?i.nameFmt:"_"),e._setCaption(r)):e.reset()},e.processDelay)},_initFileActions:function(){var i=this;i.showPreview&&(i._initZoomButton(),i.getFrames(" .kv-file-remove").each(function(){var a,r,n=e(this),o=n.closest(t.FRAMES),s=o.attr("id"),l=o.attr("data-fileindex");i.fileManager;i._handler(n,"click",function(){return r=i._raise("filepreremove",[s,l]),r!==!1&&i._validateMinCount()?(a=o.hasClass("file-preview-error"),t.cleanMemory(o),void o.fadeOut("slow",function(){i.fileManager.remove(o),i._clearObjects(o),o.remove(),s&&a&&i.$errorContainer.find('li[data-thumb-id="'+s+'"]').fadeOut("fast",function(){e(this).remove(),i._errorsExist()||i._resetErrors()}),i._clearFileInput(),i._resetCaption(),i._raise("fileremoved",[s,l])})):!1})}),i.getFrames(" .kv-file-upload").each(function(){var a=e(this);i._handler(a,"click",function(){var e=a.closest(t.FRAMES),r=i._getThumbFileId(e);i._hideProgress(),e.hasClass("file-preview-error")&&!i.retryErrorUploads||i._uploadSingle(i.fileManager.getIndex(r),r,!1)})}))},_initPreviewActions:function(){var i=this,a=i.$preview,r=i.deleteExtraData||{},n=t.FRAMES+" .kv-file-remove",o=i.fileActionSettings,s=o.removeClass,l=o.removeErrorClass,d=function(){var e=i.isAjaxUpload?i.previewCache.count(!0):i._inputFileCount();i.getFrames().length||e?i._resetCaption():(i._setCaption(""),i.reset(),i.initialCaption="")};i._initZoomButton(),a.find(n).each(function(){var a,n,o,c,u=e(this),p=u.data("url")||i.deleteUrl,f=u.data("key"),m=i.ajaxOperations.deleteThumb;if(!t.isEmpty(p)&&void 0!==f){"function"==typeof p&&(p=p());var g,v,h,w,b,_=u.closest(t.FRAMES),C=i.previewCache.data,x=_.attr("data-fileindex");x=parseInt(x.replace(t.INIT_FLAG,"")),h=t.isEmpty(C.config)&&t.isEmpty(C.config[x])?null:C.config[x],b=t.isEmpty(h)||t.isEmpty(h.extra)?r:h.extra,w=h&&(h.filename||h.caption)||"","function"==typeof b&&(b=b()),v={id:u.attr("id"),key:f,extra:b},n=function(e){i.ajaxAborted=!1,i._raise("filepredelete",[f,e,b]),i._abort()?e.abort():(u.removeClass(l),t.addCss(_,"file-uploading"),t.addCss(u,"disabled "+s))},o=function(e,r,n){var o,c;return t.isEmpty(e)||t.isEmpty(e.error)?(_.removeClass("file-uploading").addClass("file-deleted"),void _.fadeOut("slow",function(){x=parseInt(_.attr("data-fileindex").replace(t.INIT_FLAG,"")),i.previewCache.unset(x),i._deleteFileIndex(_),o=i.previewCache.count(!0),c=o>0?i._getMsgSelected(o):"",i._setCaption(c),i._raise("filedeleted",[f,n,b]),i._clearObjects(_),_.remove(),d()})):(v.jqXHR=n,v.response=e,a=i._parseError(m,n,i.msgDeleteError,w),i._showFileError(a,v,"filedeleteerror"),_.removeClass("file-uploading"),u.removeClass("disabled "+s).addClass(l),void d())},c=function(e,t,a){var r=i._parseError(m,e,a,w);v.jqXHR=e,v.response={},i._showFileError(r,v,"filedeleteerror"),_.removeClass("file-uploading"),u.removeClass("disabled "+s).addClass(l),d()},i._initAjaxSettings(),i._mergeAjaxCallback("beforeSend",n,"delete"),i._mergeAjaxCallback("success",o,"delete"),i._mergeAjaxCallback("error",c,"delete"),g=e.extend(!0,{},{url:i._encodeURI(p),type:"POST",dataType:"json",data:e.extend(!0,{},{key:f},b)},i._ajaxDeleteSettings),i._handler(u,"click",function(){return i._validateMinCount()?(i.ajaxAborted=!1,i._raise("filebeforedelete",[f,b]),void(i.ajaxAborted instanceof Promise?i.ajaxAborted.then(function(t){t||e.ajax(g)}):i.ajaxAborted||e.ajax(g))):!1})}})},_hideFileIcon:function(){var e=this;e.overwriteInitial&&e.$captionContainer.removeClass("icon-visible")},_showFileIcon:function(){var e=this;t.addCss(e.$captionContainer,"icon-visible")},_getSize:function(t,i){var a,r,n=this,o=parseFloat(t),s=n.fileSizeGetter;return e.isNumeric(t)&&e.isNumeric(o)?("function"==typeof s?r=s(o):0===o?r="0.00 B":(i||(i=n.sizeUnits),a=Math.floor(Math.log(o)/Math.log(n.bytesToKB)),r=(o/Math.pow(n.bytesToKB,a)).toFixed(2)+" "+i[a]),n._getLayoutTemplate("size").replace("{sizeText}",r)):""},_getFileType:function(e){var t=this;return t.mimeTypeAliases[e]||e},_generatePreviewTemplate:function(i,a,r,n,o,s,l,d,c,u,p,f,m,g){var v,h,w,b=this,_=b.slug(r),C="",x="",y=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T=_,P=_,k="type-default",F=u||b._renderFileFooter(i,_,d,"auto",l),S=b.preferIconicPreview,E=b.preferIconicZoomPreview,I=S?"other":i;return h=400>y?b.previewSettingsSmall[I]||b.defaults.previewSettingsSmall[I]:b.previewSettings[I]||b.defaults.previewSettings[I],h&&e.each(h,function(e,t){x+=e+":"+t+";"}),w=function(a,l,d,u,g){var v,h=d?"zoom-"+o:o,w=b._getPreviewTemplate(a),C=(c||"")+" "+u;return b.frameClass&&(C=b.frameClass+" "+C),d&&(C=C.replace(" "+t.SORT_CSS,"")),w=b._parseFilePreviewIcon(w,r),"object"!==i||n||e.each(b.defaults.fileTypeSettings,function(e,t){"object"!==e&&"other"!==e&&t(r,n)&&(k="type-"+e)}),t.isEmpty(m)||(void 0!==m.title&&null!==m.title&&(T=m.title),void 0!==m.alt&&null!==m.alt&&(T=m.alt)),v={previewId:h,caption:_,title:T,alt:P,frameClass:C,type:b._getFileType(n),fileindex:p,fileid:s||"",typeCss:k,footer:F,data:d&&g?t.ZOOM_VAR+"{zoomData}":l,template:f||i,style:x?'style="'+x+'"':"",zoomData:g?encodeURIComponent(g):""},d&&(v.zoomCache="",v.zoomData="{zoomData}"),w.setTokens(v)},p=p||o.slice(o.lastIndexOf("-")+1),b.fileActionSettings.showZoom&&(C=w(E?"other":i,a,!0,"kv-zoom-thumb",g)),C="\n"+b._getLayoutTemplate("zoomCache").replace("{zoomContent}",C),"function"==typeof b.sanitizeZoomCache&&(C=b.sanitizeZoomCache(C)),v=w(S?"other":i,a,!1,"kv-preview-thumb",g),v.setTokens({zoomCache:C})},_addToPreview:function(e,i){var a,r=this;return i=t.cspBuffer.stash(i),a=r.reversePreviewOrder?e.prepend(i):e.append(i),t.cspBuffer.apply(e),a},_previewDefault:function(e,i){var a=this,r=a.$preview;if(a.showPreview){var n,o=t.getFileName(e),s=e?e.type:"",l=e.size||0,d=a._getFileName(e,""),c=i===!0&&!a.isAjaxUpload,u=t.createObjectURL(e),p=a.fileManager.getId(e),f=a._getThumbId(p);a._clearDefaultPreview(),n=a._generatePreviewTemplate("other",u,o,s,f,p,c,l),a._addToPreview(r,n),a._setThumbAttr(f,d,l),i===!0&&a.isAjaxUpload&&a._setThumbStatus(a._getFrame(f),"Error")}},_previewFile:function(e,i,a,r,n){if(this.showPreview){var o,s=this,l=t.getFileName(i),d=n.type,c=n.name,u=s._parseFileType(d,l),p=s.$preview,f=i.size||0,m="image"===u?a.target.result:r,g=s.fileManager,v=g.getId(i),h=s._getThumbId(v);o=s._generatePreviewTemplate(u,m,l,d,h,v,!1,f),s._clearDefaultPreview(),s._addToPreview(p,o);var w=s._getFrame(h);s._validateImageOrientation(w.find("img"),i,h,v,c,d,f,m),s._setThumbAttr(h,c,f),s._initSortable()}},_setThumbAttr:function(e,t,i,a){var r=this,n=r._getFrame(e);n.length&&(i=i&&i>0?r._getSize(i):"",n.data({caption:t,size:i,description:a||""}))},_setInitThumbAttr:function(){var e,i,a,r,n,o=this,s=o.previewCache.data,l=o.previewCache.count(!0);if(0!==l)for(var d=0;l>d;d++)e=s.config[d],n=o.previewInitId+"-"+t.INIT_FLAG+d,i=t.ifSet("caption",e,t.ifSet("filename",e)),a=t.ifSet("size",e),r=t.ifSet("description",e),o._setThumbAttr(n,i,a,r)},_slugDefault:function(e){return t.isEmpty(e,!0)?"":String(e).replace(/[\[\]\/\{}:;#%=\(\)\*\+\?\\\^\$\|<>&"']/g,"_")},_updateFileDetails:function(e){var i,a,r,n,o,s=this,l=s.$element,d=t.isIE(9)&&t.findFileName(l.val())||l[0].files[0]&&l[0].files[0].name;!d&&s.fileManager.count()>0?(o=s.fileManager.getFirstFile(),i=o.nameFmt):i=d?s.slug(d):"_",a=s.isAjaxUpload?s.fileManager.count():e,n=s.previewCache.count(!0)+a,r=1===a?i:s._getMsgSelected(n,!s.isAjaxUpload&&!s.isError),s.isError?(s.$previewContainer.removeClass("file-thumb-loading"),s._initCapStatus(),s.$previewStatus.html(""),s.$captionContainer.removeClass("icon-visible")):s._showFileIcon(),s._setCaption(r,s.isError),s.$container.removeClass("file-input-new file-input-ajax-new"),s._raise("fileselect",[e,i]),s.previewCache.count(!0)&&s._initPreviewActions()},_setThumbStatus:function(e,i){var a=this;if(a.showPreview){var r="indicator"+i,n=r+"Title",o="file-preview-"+i.toLowerCase(),s=e.find(".file-upload-indicator"),l=a.fileActionSettings;e.removeClass("file-preview-success file-preview-error file-preview-paused file-preview-loading"),"Success"===i&&e.find(".file-drag-handle").remove(),t.setHtml(s,l[r]),s.attr("title",l[n]),e.addClass(o),"Error"!==i||a.retryErrorUploads||e.find(".kv-file-upload").attr("disabled",!0)}},_setProgressCancelled:function(){var e=this;e._setProgress(101,e.$progress,e.msgCancelled)},_setProgress:function(e,i,a,r){var n=this;if(i=i||n.$progress,i.length){var o,s=Math.min(e,100),l=n.progressUploadThreshold,d=100>=e?n.progressTemplate:n.progressCompleteTemplate,c=100>s?n.progressTemplate:a?n.paused?n.progressPauseTemplate:n.progressErrorTemplate:d;e>=100&&(r=""),t.isEmpty(c)||(o=l&&s>l&&100>=e?c.setTokens({percent:l,status:n.msgUploadThreshold}):c.setTokens({percent:s,status:e>100?n.msgUploadEnd:s+"%"}),r=r||"",o=o.setTokens({stats:r}),t.setHtml(i,o),a&&t.setHtml(i.find('[role="progressbar"]'),a))}},_hasFiles:function(){var e=this.$element[0];return!!(e&&e.files&&e.files.length)},_setFileDropZoneTitle:function(){var e,i=this,a=i.$container.find(".file-drop-zone"),r=i.dropZoneTitle;i.isClickable&&(e=t.isEmpty(i.$element.attr("multiple"))?i.fileSingle:i.filePlural,r+=i.dropZoneClickTitle.replace("{files}",e)),a.find("."+i.dropZoneTitleClass).remove(),!i.showPreview||0===a.length||i.fileManager.count()>0||!i.dropZoneEnabled||i.previewCache.count()>0||!i.isAjaxUpload&&i._hasFiles()||(0===a.find(t.FRAMES).length&&t.isEmpty(i.defaultPreviewContent)&&a.prepend('
    '+r+"
    "),i.$container.removeClass("file-input-new"),t.addCss(i.$container,"file-input-ajax-new"))},_getStats:function(e){var i,a,r=this;return r.showUploadStats&&e&&e.bitrate?(a=r._getLayoutTemplate("stats"),i=e.elapsed&&e.bps?r.msgPendingTime.setTokens({time:t.getElapsed(Math.ceil(e.pendingBytes/e.bps))}):r.msgCalculatingTime,a.setTokens({uploadSpeed:e.bitrate,pendingTime:i})):""},_setResumableProgress:function(e,t,i){var a=this,r=a.resumableManager,n=i?r:a,o=i?i.find(".file-thumb-progress"):null;0===n.lastProgress&&(n.lastProgress=e),e0&&e._getFileCount(t-1)=m:m>=d,u||(l=p["msgImage"+o+i].setTokens({name:n,size:m}),p._showFileError(l,s),p._setPreviewError(r)))},_getExifObj:function(e){var i,a=this,r=t.logMessages.exifWarning;if("data:image/jpeg;base64,"!==e.slice(0,23)&&"data:image/jpg;base64,"!==e.slice(0,22))return void(i=null);try{i=window.piexif?window.piexif.load(e):null}catch(n){i=null,r=n&&n.message||""}return!i&&a.showExifErrorLog&&a._log(t.logMessages.badExifParser,{details:r}),i},setImageOrientation:function(i,a,r,n){var o,s,l,d=this,c=!i||!i.length,u=!a||!a.length,p=!1,f=c&&n&&"image"===n.attr("data-template");c&&u||(l="load.fileinputimageorient",f?(i=a,a=null,i.css(d.previewSettings.image),s=e(document.createElement("div")).appendTo(n.find(".kv-file-content")),o=e(document.createElement("span")).insertBefore(i),i.css("visibility","hidden").removeClass("file-zoom-detail").appendTo(s)):p=!i.is(":visible"),i.off(l).on(l,function(){p&&(d.$preview.removeClass("hide-content"),n.find(".kv-file-content").css("visibility","hidden"));var e=i[0],l=a&&a.length?a[0]:null,c=e.offsetHeight,u=e.offsetWidth,m=t.getRotation(r);if(p&&(n.find(".kv-file-content").css("visibility","visible"),d.$preview.addClass("hide-content")),i.data("orientation",r),l&&a.data("orientation",r),5>r)return t.setTransform(e,m),void t.setTransform(l,m);var g=Math.atan(u/c),v=Math.sqrt(Math.pow(c,2)+Math.pow(u,2)),h=v?c/Math.cos(Math.PI/2+g)/v:1,w=" scale("+Math.abs(h)+")";t.setTransform(e,m+w),t.setTransform(l,m+w),f&&(i.css("visibility","visible").insertAfter(o).addClass("file-zoom-detail"),o.remove(),s.remove())}))},_validateImageOrientation:function(i,a,r,n,o,s,l,d){var c,u,p=this,f=null,m=p.autoOrientImage;return f=p._getExifObj(d),p.canOrientImage?(i.css("image-orientation",m?"from-image":"none"),void p._validateImage(r,n,o,s,l,d,f)):(u=t.getZoomSelector(r," img"),(c=f?f["0th"][piexif.ImageIFD.Orientation]:null)?(p.setImageOrientation(i,e(u),c,p._getFrame(r)),p._raise("fileimageoriented",{$img:i,file:a}),void p._validateImage(r,n,o,s,l,d,f)):void p._validateImage(r,n,o,s,l,d,f))},_validateImage:function(e,t,i,a,r,n,o){var s,l,d,c=this,u=c.$preview,p=c._getFrame(e),f=p.attr("data-fileindex"),m=p.find("img");i=i||"Untitled",m.one("load",function(){l=p.width(),d=u.width(),l>d&&m.css("width","100%"),s={ind:f,id:e,fileId:t},c._checkDimensions(f,"Small",m,p,i,"Width",s),c._checkDimensions(f,"Small",m,p,i,"Height",s),c.resizeImage||(c._checkDimensions(f,"Large",m,p,i,"Width",s),c._checkDimensions(f,"Large",m,p,i,"Height",s)),c._raise("fileimageloaded",[e]),c.fileManager.addImage(t,{ind:f,img:m,thumb:p,pid:e,typ:a,siz:r,validated:!1,imgData:n,exifObj:o}),p.data("exif",o),c._validateAllImages()}).one("error",function(){c._raise("fileimageloaderror",[e])})},_validateAllImages:function(){var t,i=this,a={val:0},r=i.fileManager.getImageCount(),n=i.resizeIfSizeMoreThan;r===i.fileManager.totalImages&&(i._raise("fileimagesloaded"),i.resizeImage&&e.each(i.fileManager.loadedImages,function(e,o){o.validated||(t=o.siz,t&&t>n*i.bytesToKB&&i._getResizedImage(e,o,a,r),o.validated=!0)}))},_getResizedImage:function(i,a,r,n){var o,s,l,d,c,u,p,f,m,g,v=this,h=e(a.img)[0],w=h.naturalWidth,b=h.naturalHeight,_=1,C=v.maxImageWidth||w,x=v.maxImageHeight||b,y=!(!w||!b),T=v.imageCanvas,P=v.imageCanvasContext,k=a.typ,F=a.pid,S=a.ind,E=a.thumb,I=a.exifObj;if(c=function(e,t,i){v.isAjaxUpload?v._showFileError(e,t,i):v._showError(e,t,i),v._setPreviewError(E)},f=v.fileManager.getFile(i),m={id:F,index:S,fileId:i},g=[i,F,S],(!f||!y||C>=w&&x>=b)&&(y&&f&&v._raise("fileimageresized",g),r.val++,r.val===n&&v._raise("fileimagesresized"),!y))return void c(v.msgImageResizeError,m,"fileimageresizeerror");k=k||v.resizeDefaultImageType,s=w>C,l=b>x,_="width"===v.resizePreference?s?C/w:l?x/b:1:l?x/b:s?C/w:1,v._resetCanvas(),w*=_,b*=_,T.width=w,T.height=b;try{P.drawImage(h,0,0,w,b),d=T.toDataURL(k,v.resizeQuality),I&&(p=window.piexif.dump(I),d=window.piexif.insert(p,d)),o=t.dataURI2Blob(d),v.fileManager.setFile(i,o), +v._raise("fileimageresized",g),r.val++,r.val===n&&v._raise("fileimagesresized",[void 0,void 0]),o instanceof Blob||c(v.msgImageResizeError,m,"fileimageresizeerror")}catch(A){r.val++,r.val===n&&v._raise("fileimagesresized",[void 0,void 0]),u=v.msgImageResizeException.replace("{errors}",A.message),c(u,m,"fileimageresizeexception")}},_showProgress:function(){var e=this;e.$progress&&e.$progress.length&&e.$progress.show()},_hideProgress:function(){var e=this;e.$progress&&e.$progress.length&&e.$progress.hide()},_initBrowse:function(e){var i=this,a=i.$element;i.showBrowse?i.$btnFile=e.find(".btn-file").append(a):(a.appendTo(e).attr("tabindex",-1),t.addCss(a,"file-no-browse"))},_initClickable:function(){var i,a,r=this;r.isClickable&&(i=r.$dropZone,r.isAjaxUpload||(a=r.$preview.find(".file-default-preview"),a.length&&(i=a)),t.addCss(i,"clickable"),i.attr("tabindex",-1),r._handler(i,"click",function(t){var a=e(t.target);r.$errorContainer.is(":visible")||a.parents(".file-preview-thumbnails").length&&!a.parents(".file-default-preview").length||(r.$element.data("zoneClicked",!0).trigger("click"),i.blur())}))},_initCaption:function(){var e=this,i=e.initialCaption||"";return e.overwriteInitial||t.isEmpty(i)?(e.$caption.val(""),!1):(e._setCaption(i),!0)},_setCaption:function(i,a){var r,n,o,s,l,d,c=this;if(c.$caption.length){if(c.$captionContainer.removeClass("icon-visible"),a)r=e("
    "+c.msgValidationError+"
    ").text(),s=c.fileManager.count(),s?(d=c.fileManager.getFirstFile(),l=1===s&&d?d.nameFmt:c._getMsgSelected(s)):l=c._getMsgSelected(c.msgNo),n=t.isEmpty(i)?l:i,o=''+c.msgValidationErrorIcon+"";else{if(t.isEmpty(i))return void c.$caption.attr("title","");r=e("
    "+i+"
    ").text(),n=r,o=c._getLayoutTemplate("fileIcon")}c.$captionContainer.addClass("icon-visible"),c.$caption.attr("title",r).val(n),t.setHtml(c.$captionIcon,o)}},_createContainer:function(){var e=this,i={"class":"file-input file-input-new"+(e.rtl?" kv-rtl":"")},a=t.createElement(t.cspBuffer.stash(e._renderMain()));return t.cspBuffer.apply(a),a.insertBefore(e.$element).attr(i),e._initBrowse(a),e.theme&&a.addClass("theme-"+e.theme),a},_refreshContainer:function(){var e=this,i=e.$container,a=e.$element;a.insertAfter(i),t.setHtml(i,e._renderMain()),e._initBrowse(i),e._validateDisabled()},_validateDisabled:function(){var e=this;e.$caption.attr({readonly:e.isDisabled})},_setTabIndex:function(e,t){var i=this,a=i.tabIndexConfig[e];return t.setTokens({tabIndexConfig:void 0===a||null===a?"":'tabindex="'+a+'"'})},_renderMain:function(){var e=this,t=e.dropZoneEnabled?" file-drop-zone":"file-drop-disabled",i=e.showClose?e._getLayoutTemplate("close"):"",a=e.showPreview?e._getLayoutTemplate("preview").setTokens({"class":e.previewClass,dropClass:t}):"",r=e.isDisabled?e.captionClass+" file-caption-disabled":e.captionClass,n=e.captionTemplate.setTokens({"class":r+" kv-fileinput-caption"});return n=e._setTabIndex("caption",n),e.mainTemplate.setTokens({"class":e.mainClass+(!e.showBrowse&&e.showCaption?" no-browse":""),inputGroupClass:e.inputGroupClass,preview:a,close:i,caption:n,upload:e._renderButton("upload"),remove:e._renderButton("remove"),cancel:e._renderButton("cancel"),pause:e._renderButton("pause"),browse:e._renderButton("browse")})},_renderButton:function(e){var i=this,a=i._getLayoutTemplate("btnDefault"),r=i[e+"Class"],n=i[e+"Title"],o=i[e+"Icon"],s=i[e+"Label"],l=i.isDisabled?" disabled":"",d="button";switch(e){case"remove":if(!i.showRemove)return"";break;case"cancel":if(!i.showCancel)return"";r+=" kv-hidden";break;case"pause":if(!i.showPause)return"";r+=" kv-hidden";break;case"upload":if(!i.showUpload)return"";i.isAjaxUpload&&!i.isDisabled?a=i._getLayoutTemplate("btnLink").replace("{href}",i.uploadUrl):d="submit";break;case"browse":if(!i.showBrowse)return"";a=i._getLayoutTemplate("btnBrowse");break;default:return""}return a=i._setTabIndex(e,a),r+="browse"===e?" btn-file":" fileinput-"+e+" fileinput-"+e+"-button",t.isEmpty(s)||(s=' '+s+""),a.setTokens({type:d,css:r,title:n,status:l,icon:o,label:s})},_renderThumbProgress:function(){var e=this;return'
    '+e.progressInfoTemplate.setTokens({percent:101,status:e.msgUploadBegin,stats:""})+"
    "},_renderFileFooter:function(e,i,a,r,n){var o,s,l=this,d=l.fileActionSettings,c=d.showRemove,u=d.showDrag,p=d.showUpload,f=d.showZoom,m=l._getLayoutTemplate("footer"),g=l._getLayoutTemplate("indicator"),v=n?d.indicatorError:d.indicatorNew,h=n?d.indicatorErrorTitle:d.indicatorNewTitle,w=g.setTokens({indicator:v,indicatorTitle:h});return a=l._getSize(a),s={type:e,caption:i,size:a,width:r,progress:"",indicator:w},l.isAjaxUpload?(s.progress=l._renderThumbProgress(),s.actions=l._renderFileActions(s,p,!1,c,f,u,!1,!1,!1)):s.actions=l._renderFileActions(s,!1,!1,!1,f,u,!1,!1,!1),o=m.setTokens(s),o=t.replaceTags(o,l.previewThumbTags)},_renderFileActions:function(e,t,i,a,r,n,o,s,l,d,c,u){var p=this;if(!e.type&&d&&(e.type="image"),p.enableResumableUpload?t=!1:"function"==typeof t&&(t=t(e)),"function"==typeof i&&(i=i(e)),"function"==typeof a&&(a=a(e)),"function"==typeof r&&(r=r(e)),"function"==typeof n&&(n=n(e)),!(t||i||a||r||n))return"";var f,m=s===!1?"":' data-url="'+s+'"',g="",v="",h=l===!1?"":' data-key="'+l+'"',w="",b="",_="",C=p._getLayoutTemplate("actions"),x=p.fileActionSettings,y=p.otherActionButtons.setTokens({dataKey:h,key:l}),T=o?x.removeClass+" disabled":x.removeClass;return a&&(w=p._getLayoutTemplate("actionDelete").setTokens({removeClass:T,removeIcon:x.removeIcon,removeTitle:x.removeTitle,dataUrl:m,dataKey:h,key:l})),t&&(b=p._getLayoutTemplate("actionUpload").setTokens({uploadClass:x.uploadClass,uploadIcon:x.uploadIcon,uploadTitle:x.uploadTitle})),i&&(_=p._getLayoutTemplate("actionDownload").setTokens({downloadClass:x.downloadClass,downloadIcon:x.downloadIcon,downloadTitle:x.downloadTitle,downloadUrl:c||p.initialPreviewDownloadUrl}),_=_.setTokens({filename:u,key:l})),r&&(g=p._getLayoutTemplate("actionZoom").setTokens({zoomClass:x.zoomClass,zoomIcon:x.zoomIcon,zoomTitle:x.zoomTitle})),n&&d&&(f="drag-handle-init "+x.dragClass,v=p._getLayoutTemplate("actionDrag").setTokens({dragClass:f,dragTitle:x.dragTitle,dragIcon:x.dragIcon})),C.setTokens({"delete":w,upload:b,download:_,zoom:g,drag:v,other:y})},_browse:function(e){var t=this;e&&e.isDefaultPrevented()||!t._raise("filebrowse")||(t.isError&&!t.isAjaxUpload&&t.clear(),t.focusCaptionOnBrowse&&t.$captionContainer.focus())},_change:function(i){var a=this;if(e(document.body).off("focusin.fileinput focusout.fileinput"),!a.changeTriggered){a._setLoading("show");var r,n,o,s,l=a.$element,d=arguments.length>1,c=a.isAjaxUpload,u=d?arguments[1]:l[0].files,p=a.fileManager.count(),f=t.isEmpty(l.attr("multiple")),m=!c&&f?1:a.maxFileCount,g=a.maxTotalFileCount,v=g>0&&g>m,h=f&&p>0,w=function(t,i,r,n){var o=e.extend(!0,{},a._getOutData(null,{},{},u),{id:r,index:n}),s={id:r,index:n,file:i,files:u};return a.isPersistentError=!0,a._setLoading("hide"),c?a._showFileError(t,o):a._showError(t,s)},b=function(e,t,i){var r=i?a.msgTotalFilesTooMany:a.msgFilesTooMany;r=r.replace("{m}",t).replace("{n}",e),a.isError=w(r,null,null,null),a.$captionContainer.removeClass("icon-visible"),a._setCaption("",!0),a.$container.removeClass("file-input-new file-input-ajax-new")};if(a.reader=null,a._resetUpload(),a._hideFileIcon(),a.dropZoneEnabled&&a.$container.find(".file-drop-zone ."+a.dropZoneTitleClass).remove(),c||(u=i.target&&void 0===i.target.files?i.target.value?[{name:i.target.value.replace(/^.+\\/,"")}]:[]:i.target.files||{}),r=u,t.isEmpty(r)||0===r.length)return c||a.clear(),void a._raise("fileselectnone");if(a._resetErrors(),s=r.length,o=c?a.fileManager.count()+s:s,n=a._getFileCount(o,v?!1:void 0),m>0&&n>m){if(!a.autoReplace||s>m)return void b(a.autoReplace&&s>m?s:n,m);n>m&&a._resetPreviewThumbs(c)}else{if(v&&(n=a._getFileCount(o,!0),g>0&&n>g)){if(!a.autoReplace||s>m)return void b(a.autoReplace&&s>g?s:n,g,!0);n>m&&a._resetPreviewThumbs(c)}!c||h?(a._resetPreviewThumbs(!1),h&&a.clearFileStack()):!c||0!==p||a.previewCache.count(!0)&&!a.overwriteInitial||a._resetPreviewThumbs(!0)}a.readFiles(r),a._setLoading("hide")}},_abort:function(t){var i,a=this;return a.ajaxAborted&&"object"==typeof a.ajaxAborted&&void 0!==a.ajaxAborted.message?(i=e.extend(!0,{},a._getOutData(null),t),i.abortData=a.ajaxAborted.data||{},i.abortMessage=a.ajaxAborted.message,a._setProgress(101,a.$progress,a.msgCancelled),a._showFileError(a.ajaxAborted.message,i,"filecustomerror"),a.cancel(),a.unlock(),!0):!!a.ajaxAborted},_resetFileStack:function(){var t=this,i=0;t._getThumbs().each(function(){var a=e(this),r=a.attr("data-fileindex"),n=a.attr("id");"-1"!==r&&-1!==r&&(t._getThumbFile(a)?a.attr({"data-fileindex":"-1"}):(a.attr({"data-fileindex":i}),i++),t._getZoom(n).attr({"data-fileindex":a.attr("data-fileindex")}))})},_isFileSelectionValid:function(e){var t=this;return e=e||0,t.required&&!t.getFilesCount()?(t.$errorContainer.html(""),t._showFileError(t.msgFileRequired),!1):t.minFileCount>0&&t._getFileCount(e)h,!o&&(a||r||n)},addToStack:function(e,t){this.fileManager.add(e,t)},clearFileStack:function(){var e=this;return e.fileManager.clear(),e._initResumableUpload(),e.enableResumableUpload?(null===e.showPause&&(e.showPause=!0),null===e.showCancel&&(e.showCancel=!1)):(e.showPause=!1,null===e.showCancel&&(e.showCancel=!0)),e.$element},getFileStack:function(){return this.fileManager.stack},getFileList:function(){return this.fileManager.list()},getFilesSize:function(){return this.fileManager.getTotalSize()},getFilesCount:function(e){var t=this,i=t.isAjaxUpload?t.fileManager.count():t._inputFileCount();return e&&(i+=t.previewCache.count(!0)),t._getFileCount(i)},_initCapStatus:function(e){var t=this,i=t.$caption;i.removeClass("is-valid file-processing"),e&&("processing"===e?i.addClass("file-processing"):i.addClass("is-valid"))},_setLoading:function(e){var t=this;t.$previewStatus.html("hide"===e?"":t.msgProcessing),t.$container.removeClass("file-thumb-loading"),t._initCapStatus("hide"===e?"":"processing"),"hide"!==e&&(t.dropZoneEnabled&&t.$container.find(".file-drop-zone ."+t.dropZoneTitleClass).remove(),t.$container.addClass("file-thumb-loading"))},_initFileSelected:function(){var t=this,i=t.$element,a=e(document.body),r="focusin.fileinput focusout.fileinput";a.length?a.off(r).on("focusout.fileinput",function(){t._setLoading("show")}).on("focusin.fileinput",function(){setTimeout(function(){i.val()||(t._setLoading("hide"),t._setFileDropZoneTitle()),a.off(r)},2500)}):t._setLoading("hide")},readFiles:function(i){this.reader=new FileReader;var a,r=this,n=r.reader,o=r.$previewContainer,s=r.$previewStatus,l=r.msgLoading,d=r.msgProgress,c=r.previewInitId,u=i.length,p=r.fileTypeSettings,f=r.allowedFileTypes,m=f?f.length:0,g=r.allowedFileExtensions,v=t.isEmpty(g)?"":g.join(", "),h=function(t,n,o,s,l){var d,c=e.extend(!0,{},r._getOutData(null,{},{},i),{id:o,index:s,fileId:l}),p={id:o,index:s,fileId:l,file:n,files:i};r._previewDefault(n,!0),d=r._getFrame(o,!0),r._setLoading("hide"),r.isAjaxUpload?setTimeout(function(){a(s+1)},r.processDelay):(r.unlock(),u=0),r.removeFromPreviewOnError&&d.length?d.remove():(r._initFileActions(),d.find(".kv-file-upload").remove()),r.isPersistentError=!0,r.isError=r.isAjaxUpload?r._showFileError(t,c):r._showError(t,p),r._updateFileDetails(u)};r.fileManager.clearImages(),e.each(i,function(e,t){var i=r.fileTypeSettings.image;i&&i(t.type)&&r.fileManager.totalImages++}),a=function(w){var b,_=r.$errorContainer,C=r.fileManager;if(w>=u)return r.unlock(),r.duplicateErrors.length&&(b="
  • "+r.duplicateErrors.join("
  • ")+"
  • ",0===_.find("ul").length?t.setHtml(_,r.errorCloseButton+"
      "+b+"
    "):_.find("ul").append(b),_.fadeIn(r.fadeDelay),r._handler(_.find(".kv-error-close"),"click",function(){_.fadeOut(r.fadeDelay)}),r.duplicateErrors=[]),r.isAjaxUpload?(r._raise("filebatchselected",[C.stack]),0!==C.count()||r.isError||r.reset()):r._raise("filebatchselected",[i]),o.removeClass("file-thumb-loading"),r._initCapStatus("valid"),void s.html("");r.lock(!0);var x,y,T,P,k,F,S,E,I,A,D,z,j=i[w],$=r._getFileId(j),U=c+"-"+$,M=p.image,R=r._getFileName(j,""),B=(j&&j.size||0)/r.bytesToKB,O="",L=t.createObjectURL(j),N=0,Z="",H=!1,W=0,V=function(){var e=!!C.loadedImages[$],t=d.setTokens({index:w+1,files:u,percent:50,name:R});setTimeout(function(){s.html(t),r._updateFileDetails(u),a(w+1)},r.processDelay),r._raise("fileloaded",[j,U,$,w,n])&&r.isAjaxUpload?e||C.add(j):e&&C.removeFile($)};if(j){if(E=C.getId(j),m>0)for(y=0;m>y;y++)F=f[y],S=r.msgFileTypes[F]||F,Z+=0===y?S:", "+S;if(R===!1)return void a(w+1);if(0===R.length)return T=r.msgInvalidFileName.replace("{name}",t.htmlEncode(t.getFileName(j),"[unknown]")),void h(T,j,U,w,E);if(t.isEmpty(g)||(O=new RegExp("\\.("+g.join("|")+")$","i")),x=B.toFixed(2),r.isAjaxUpload&&C.exists(E)||r._getFrame(U,!0).length){var q={id:U,index:w,fileId:E,file:j,files:i};return T=r.msgDuplicateFile.setTokens({name:R,size:x}),void(r.isAjaxUpload?(r.duplicateErrors.push(T),r.isDuplicateError=!0,r._raise("fileduplicateerror",[j,E,R,x,U,w]),a(w+1),r._updateFileDetails(u)):(r._showError(T,q),r.unlock(),u=0,r._clearFileInput(),r.reset(),r._updateFileDetails(u)))}if(r.maxFileSize>0&&B>r.maxFileSize)return T=r.msgSizeTooLarge.setTokens({name:R,size:x,maxSize:r.maxFileSize}),void h(T,j,U,w,E);if(null!==r.minFileSize&&B<=t.getNum(r.minFileSize))return T=r.msgSizeTooSmall.setTokens({name:R,size:x,minSize:r.minFileSize}),void h(T,j,U,w,E);if(!t.isEmpty(f)&&t.isArray(f)){for(y=0;y0)for(t=0;n>t;t+=1)i.paused=!0,r[t].abort();return i.showPreview&&i._getThumbs().each(function(){var t,a=e(this),r=i._getLayoutTemplate("stats"),n=a.find(".file-upload-indicator");a.removeClass("file-uploading"),n.attr("title")===s.indicatorLoadingTitle&&(i._setThumbStatus(a,"Paused"),t=r.setTokens({pendingTime:i.msgPaused,uploadSpeed:""}),i.paused=!0,i._setProgress(o,a.find(".file-thumb-progress"),o+"%",t)),i._getThumbFile(a)||a.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")}),i._setProgress(101,i.$progress,i.msgPaused),i.$element},cancel:function(){var t,i=this,a=i.ajaxRequests,r=i.resumableManager,n=i.taskManager,o=r?n.getPool(r.id):void 0,s=a.length;if(i.enableResumableUpload&&o?(o.cancel().done(function(){i._setProgressCancelled()}),r.reset(),i._raise("fileuploadcancelled",[i.fileManager,r])):i._raise("fileuploadcancelled",[i.fileManager]),i._initAjax(),s>0)for(t=0;s>t;t+=1)i.cancelling=!0,a[t].abort();return i._getThumbs().each(function(){var t=e(this),a=t.find(".file-thumb-progress");t.removeClass("file-uploading"),i._setProgress(0,a),a.hide(),i._getThumbFile(t)||(t.find(".kv-file-upload").removeClass("disabled").removeAttr("disabled"),t.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")),i.unlock()}),setTimeout(function(){i._setProgressCancelled()},i.processDelay),i.$element},clear:function(){var i,a=this;if(a._raise("fileclear"))return a.$btnUpload.removeAttr("disabled"),a._getThumbs().find("video,audio,img").each(function(){t.cleanMemory(e(this))}),a._clearFileInput(),a._resetUpload(),a.clearFileStack(),a.isDuplicateError=!1,a.isPersistentError=!1,a._resetErrors(!0),a._hasInitialPreview()?(a._showFileIcon(),a._resetPreview(),a._initPreviewActions(),a.$container.removeClass("file-input-new")):(a._getThumbs().each(function(){a._clearObjects(e(this))}),a.isAjaxUpload&&(a.previewCache.data={}),a.$preview.html(""),i=!a.overwriteInitial&&a.initialCaption.length>0?a.initialCaption:"",a.$caption.attr("title","").val(i),t.addCss(a.$container,"file-input-new"),a._validateDefaultPreview()),0===a.$container.find(t.FRAMES).length&&(a._initCaption()||a.$captionContainer.removeClass("icon-visible")),a._hideFileIcon(),a.focusCaptionOnClear&&a.$captionContainer.focus(),a._setFileDropZoneTitle(),a._raise("filecleared"),a.$element},reset:function(){var e=this;if(e._raise("filereset"))return e.lastProgress=0,e._resetPreview(),e.$container.find(".fileinput-filename").text(""),t.addCss(e.$container,"file-input-new"),e.getFrames().length&&e.$container.removeClass("file-input-new"),e.clearFileStack(),e._setFileDropZoneTitle(),e.$element},disable:function(){var e=this,i=e.$container;return e.isDisabled=!0,e._raise("filedisabled"),e.$element.attr("disabled","disabled"),i.addClass("is-locked"),t.addCss(i.find(".btn-file"),"disabled"),i.find(".kv-fileinput-caption").addClass("file-caption-disabled"),i.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").attr("disabled",!0),e._initDragDrop(),e.$element},enable:function(){var e=this,t=e.$container;return e.isDisabled=!1,e._raise("fileenabled"),e.$element.removeAttr("disabled"),t.removeClass("is-locked"),t.find(".kv-fileinput-caption").removeClass("file-caption-disabled"),t.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").removeAttr("disabled"),t.find(".btn-file").removeClass("disabled"),e._initDragDrop(),e.$element},upload:function(){var i,a,r=this,n=r.fileManager,o=n.count(),s=!e.isEmptyObject(r._getExtraData());if(n.bpsLog=[],n.bps=0,r.isAjaxUpload&&!r.isDisabled&&r._isFileSelectionValid(o)){if(r.lastProgress=0,r._resetUpload(),0===o&&!s)return void r._showFileError(r.msgUploadEmpty);if(r.cancelling=!1,r._showProgress(),r.lock(),0===o&&s)return r._setProgress(2),void r._uploadExtraOnly();if(r.enableResumableUpload)return r.resume();if(r.uploadAsync||r.enableResumableUpload){if(a=r._getOutData(null),!r._checkBatchPreupload(a))return;r.fileBatchCompleted=!1,r.uploadCache=[],e.each(r.getFileStack(),function(e){var t=r._getThumbId(e);r.uploadCache.push({id:t,content:null,config:null,tags:null,append:!0})}),r.$preview.find(".file-preview-initial").removeClass(t.SORT_CSS),r._initSortable()}return r._setProgress(2),r.hasInitData=!1,r.uploadAsync?(i=0,void e.each(r.getFileStack(),function(e){r._uploadSingle(i,e,!0),i++})):(r._uploadBatch(),r.$element)}},destroy:function(){var t=this,i=t.$form,a=t.$container,r=t.$element,n=t.namespace;return e(document).off(n),e(window).off(n),i&&i.length&&i.off(n),t.isAjaxUpload&&t._clearFileInput(),t._cleanup(),t._initPreviewCache(),r.insertBefore(a).off(n).removeData(),a.off().remove(),r},refresh:function(i){var a=this,r=a.$element;return i="object"!=typeof i||t.isEmpty(i)?a.options:e.extend(!0,{},a.options,i),a._init(i,!0),a._listen(),r},zoom:function(e){var t=this,i=t._getFrame(e);t._showModal(i)},getExif:function(e){var t=this,i=t._getFrame(e);return i&&i.data("exif")||null},getFrames:function(i){var a,r=this;return i=i||"",a=r.$preview.find(t.FRAMES+i),r.reversePreviewOrder&&(a=e(a.get().reverse())),a},getPreview:function(){var e=this;return{content:e.initialPreview,config:e.initialPreviewConfig,tags:e.initialPreviewThumbTags}}},e.fn.fileinput=function(a){if(t.hasFileAPISupport()||t.isIE(9)){var r=Array.apply(null,arguments),n=[];switch(r.shift(),this.each(function(){var o,s=e(this),l=s.data("fileinput"),d="object"==typeof a&&a,c=d.theme||s.data("theme"),u={},p={},f=d.language||s.data("language")||e.fn.fileinput.defaults.language||"en";l||(c&&(p=e.fn.fileinputThemes[c]||{}),"en"===f||t.isEmpty(e.fn.fileinputLocales[f])||(u=e.fn.fileinputLocales[f]||{}),o=e.extend(!0,{},e.fn.fileinput.defaults,p,e.fn.fileinputLocales.en,u,d,s.data()),l=new i(this,o),s.data("fileinput",l)),"string"==typeof a&&n.push(l[a].apply(l,r))}),n.length){case 0:return this;case 1:return n[0];default:return n}}};var r='class="kv-preview-data file-preview-pdf" src="{renderer}?file={data}" {style}',n="btn btn-sm btn-kv "+t.defaultButtonCss(),o="btn "+t.defaultButtonCss();e.fn.fileinput.defaults={language:"en",bytesToKB:1024,showCaption:!0,showBrowse:!0,showPreview:!0,showRemove:!0,showUpload:!0,showUploadStats:!0,showCancel:null,showPause:null,showClose:!0,showUploadedThumbs:!0,showConsoleLogs:!1,browseOnZoneClick:!1,autoReplace:!1,showDescriptionClose:!0,autoOrientImage:function(){var e=window.navigator.userAgent,t=!!e.match(/WebKit/i),i=!!e.match(/iP(od|ad|hone)/i),a=i&&t&&!e.match(/CriOS/i);return!a},autoOrientImageInitial:!0,showExifErrorLog:!1,required:!1,rtl:!1,hideThumbnailContent:!1,encodeUrl:!0,focusCaptionOnBrowse:!0,focusCaptionOnClear:!0,generateFileId:null,previewClass:"",captionClass:"",frameClass:"krajee-default",mainClass:"",inputGroupClass:"",mainTemplate:null,fileSizeGetter:null,initialCaption:"",initialPreview:[],initialPreviewDelimiter:"*$$*",initialPreviewAsData:!1,initialPreviewFileType:"image",initialPreviewConfig:[],initialPreviewThumbTags:[],previewThumbTags:{},initialPreviewShowDelete:!0,initialPreviewDownloadUrl:"",removeFromPreviewOnError:!1,deleteUrl:"",deleteExtraData:{},overwriteInitial:!0,sanitizeZoomCache:function(e){var i=t.createElement(e);return i.find("input,textarea,select,datalist,form,.file-thumbnail-footer").remove(),i.html()},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewZoomButtonClasses:{prev:"btn btn-default btn-outline-secondary btn-navigate",next:"btn btn-default btn-outline-secondary btn-navigate",toggleheader:n,fullscreen:n,borderless:n,close:n},previewTemplates:{},previewContentTemplates:{},preferIconicPreview:!1,preferIconicZoomPreview:!1,allowedFileTypes:null,allowedFileExtensions:null,allowedPreviewTypes:void 0,allowedPreviewMimeTypes:null,allowedPreviewExtensions:null,disabledPreviewTypes:void 0,disabledPreviewExtensions:["msi","exe","com","zip","rar","app","vb","scr"],disabledPreviewMimeTypes:null,defaultPreviewContent:null,customLayoutTags:{},customPreviewTags:{},previewFileIcon:'',previewFileIconClass:"file-other-icon",previewFileIconSettings:{},previewFileExtSettings:{},buttonLabelClass:"hidden-xs",browseIcon:' ',browseClass:"btn btn-primary",removeIcon:'',removeClass:o,cancelIcon:'',cancelClass:o,pauseIcon:'',pauseClass:o,uploadIcon:'',uploadClass:o,uploadUrl:null,uploadUrlThumb:null,uploadAsync:!0,uploadParamNames:{chunkCount:"chunkCount",chunkIndex:"chunkIndex",chunkSize:"chunkSize",chunkSizeStart:"chunkSizeStart",chunksUploaded:"chunksUploaded",fileBlob:"fileBlob",fileId:"fileId",fileName:"fileName",fileRelativePath:"fileRelativePath",fileSize:"fileSize",retryCount:"retryCount"},maxAjaxThreads:5,fadeDelay:800,processDelay:100,bitrateUpdateDelay:500,queueDelay:10,progressDelay:0,enableResumableUpload:!1,resumableUploadOptions:{fallback:null,testUrl:null,chunkSize:2048,maxThreads:4,maxRetries:3,showErrorLog:!0,retainErrorHistory:!0,skipErrorsAndProceed:!1},uploadExtraData:{},zoomModalHeight:480,minImageWidth:null,minImageHeight:null,maxImageWidth:null,maxImageHeight:null,resizeImage:!1,resizePreference:"width",resizeQuality:.92,resizeDefaultImageType:"image/jpeg",resizeIfSizeMoreThan:0,minFileSize:-1,maxFileSize:0,maxFilePreviewSize:25600,minFileCount:0,maxFileCount:0,maxTotalFileCount:0,validateInitialCount:!1,msgValidationErrorClass:"text-danger",msgValidationErrorIcon:' ',msgErrorClass:"file-error-message",progressThumbClass:"progress-bar progress-bar-striped active progress-bar-animated",progressClass:"progress-bar bg-success progress-bar-success progress-bar-striped active progress-bar-animated",progressInfoClass:"progress-bar bg-info progress-bar-info progress-bar-striped active progress-bar-animated",progressCompleteClass:"progress-bar bg-success progress-bar-success",progressPauseClass:"progress-bar bg-primary progress-bar-primary progress-bar-striped active progress-bar-animated",progressErrorClass:"progress-bar bg-danger progress-bar-danger",progressUploadThreshold:99,previewFileType:"image",elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null,errorCloseButton:void 0,slugCallback:null,dropZoneEnabled:!0,dropZoneTitleClass:"file-drop-zone-title",fileActionSettings:{},otherActionButtons:"",textEncoding:"UTF-8",preProcessUpload:null,ajaxSettings:{},ajaxDeleteSettings:{},showAjaxErrorDetails:!0,mergeAjaxCallbacks:!1,mergeAjaxDeleteCallbacks:!1,retryErrorUploads:!0,reversePreviewOrder:!1,usePdfRenderer:function(){var e=!!window.MSInputMethodContext&&!!document.documentMode;return!!navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/i)||e},pdfRendererUrl:"",pdfRendererTemplate:"",tabIndexConfig:{browse:500,remove:500,upload:500,cancel:null,pause:null,modal:-1}},e.fn.fileinputLocales.en={sizeUnits:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],bitRateUnits:["B/s","KB/s","MB/s","GB/s","TB/s","PB/s","EB/s","ZB/s","YB/s"],fileSingle:"file",filePlural:"files",browseLabel:"Browse …",removeLabel:"Remove",removeTitle:"Clear all unprocessed files",cancelLabel:"Cancel",cancelTitle:"Abort ongoing upload",pauseLabel:"Pause",pauseTitle:"Pause ongoing upload",uploadLabel:"Upload",uploadTitle:"Upload selected files",msgNo:"No",msgNoFilesSelected:"No files selected",msgCancelled:"Cancelled",msgPaused:"Paused",msgPlaceholder:"Select {files} ...",msgZoomModalHeading:"Detailed Preview",msgFileRequired:"You must select a file to upload.",msgSizeTooSmall:'File "{name}" ({size} KB) is too small and must be larger than {minSize} KB.',msgSizeTooLarge:'File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB.',msgFilesTooLess:"You must select at least {n} {files} to upload.",msgFilesTooMany:"Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}.",msgTotalFilesTooMany:"You can upload a maximum of {m} files ({n} files detected).",msgFileNotFound:'File "{name}" not found!',msgFileSecured:'Security restrictions prevent reading the file "{name}".',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileName:'Invalid or unsupported characters in file name "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgFileTypes:{image:"image",html:"HTML",text:"text",video:"video",audio:"audio",flash:"flash",pdf:"PDF",object:"object"},msgUploadAborted:"The file upload was aborted",msgUploadThreshold:"Processing …",msgUploadBegin:"Initializing …",msgUploadEnd:"Done",msgUploadResume:"Resuming upload …",msgUploadEmpty:"No valid data available for upload.",msgUploadError:"Upload Error",msgDeleteError:"Delete Error",msgProgressError:"Error",msgValidationError:"Validation Error",msgLoading:"Loading file {index} of {files} …",msgProgress:"Loading file {index} of {files} - {name} - {percent}% completed.",msgSelected:"{n} {files} selected",msgProcessing:"Processing ...",msgFoldersNotAllowed:"Drag & drop files only! {n} folder(s) dropped were skipped.",msgImageWidthSmall:'Width of image file "{name}" must be at least {size} px.',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px.',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px.',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px.',msgImageResizeError:"Could not get the image dimensions to resize.",msgImageResizeException:"Error while resizing the image.
    {errors}
    ",msgAjaxError:"Something went wrong with the {operation} operation. Please try again later!", +msgAjaxProgressError:"{operation} failed",msgDuplicateFile:'File "{name}" of same size "{size} KB" has already been selected earlier. Skipping duplicate selection.',msgResumableUploadRetriesExceeded:"Upload aborted beyond {max} retries for file {file}! Error Details:
    {error}
    ",msgPendingTime:"{time} remaining",msgCalculatingTime:"calculating time remaining",ajaxOperations:{deleteThumb:"file delete",uploadThumb:"file upload",uploadBatch:"batch file upload",uploadExtra:"form data upload"},dropZoneTitle:"Drag & drop files here …",dropZoneClickTitle:"
    (or click to select {files})",previewZoomButtonTitles:{prev:"View previous file",next:"View next file",toggleheader:"Toggle header",fullscreen:"Toggle full screen",borderless:"Toggle borderless mode",close:"Close detailed preview"}},e.fn.fileinput.Constructor=i,e(document).ready(function(){var t=e("input.file[type=file]");t.length&&t.fileinput()})}); \ No newline at end of file diff --git a/js/locales/LANG.js b/js/locales/LANG.js index 29bb8a11..b9e815b2 100755 --- a/js/locales/LANG.js +++ b/js/locales/LANG.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['_LANG_'] = { diff --git a/js/locales/ar.js b/js/locales/ar.js index 57d33bb5..e92ad214 100755 --- a/js/locales/ar.js +++ b/js/locales/ar.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['ar'] = { diff --git a/js/locales/az.js b/js/locales/az.js index c1475808..2d8b0168 100644 --- a/js/locales/az.js +++ b/js/locales/az.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['az'] = { diff --git a/js/locales/bg.js b/js/locales/bg.js index 46d641aa..0d837f05 100755 --- a/js/locales/bg.js +++ b/js/locales/bg.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['bg'] = { diff --git a/js/locales/ca.js b/js/locales/ca.js index 76cd6ef2..35ab7f2c 100755 --- a/js/locales/ca.js +++ b/js/locales/ca.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['ca'] = { diff --git a/js/locales/cr.js b/js/locales/cr.js index 63107857..f55b4973 100755 --- a/js/locales/cr.js +++ b/js/locales/cr.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['cr'] = { diff --git a/js/locales/cs.js b/js/locales/cs.js index 20db7192..fcef8025 100644 --- a/js/locales/cs.js +++ b/js/locales/cs.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['cs'] = { diff --git a/js/locales/de.js b/js/locales/de.js index 8b6af5fc..aba2be16 100755 --- a/js/locales/de.js +++ b/js/locales/de.js @@ -9,13 +9,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['de'] = { diff --git a/js/locales/el.js b/js/locales/el.js index 83e29aed..0bc2f3a5 100755 --- a/js/locales/el.js +++ b/js/locales/el.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['el'] = { diff --git a/js/locales/es.js b/js/locales/es.js index f212a34d..b52088b8 100755 --- a/js/locales/es.js +++ b/js/locales/es.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['es'] = { diff --git a/js/locales/et.js b/js/locales/et.js index 289b4ec0..a85c4f7b 100644 --- a/js/locales/et.js +++ b/js/locales/et.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['et'] = { diff --git a/js/locales/fa.js b/js/locales/fa.js index ada101c0..5fdc85c7 100755 --- a/js/locales/fa.js +++ b/js/locales/fa.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['fa'] = { diff --git a/js/locales/fi.js b/js/locales/fi.js index ed8fbe46..7af01e05 100755 --- a/js/locales/fi.js +++ b/js/locales/fi.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales.fi = { diff --git a/js/locales/fr.js b/js/locales/fr.js index 13708806..e8e27109 100755 --- a/js/locales/fr.js +++ b/js/locales/fr.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['fr'] = { diff --git a/js/locales/gl.js b/js/locales/gl.js index 3cf7270c..26d16e55 100644 --- a/js/locales/gl.js +++ b/js/locales/gl.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['gl'] = { diff --git a/js/locales/he.js b/js/locales/he.js index 50d5b24b..6b0a4c64 100644 --- a/js/locales/he.js +++ b/js/locales/he.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['he'] = { diff --git a/js/locales/hu.js b/js/locales/hu.js index d775fc0a..dfcced34 100755 --- a/js/locales/hu.js +++ b/js/locales/hu.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['hu'] = { diff --git a/js/locales/id.js b/js/locales/id.js index 6b57cc9b..78722a75 100755 --- a/js/locales/id.js +++ b/js/locales/id.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['id'] = { diff --git a/js/locales/it.js b/js/locales/it.js index 40747831..5c1fa5ac 100755 --- a/js/locales/it.js +++ b/js/locales/it.js @@ -13,13 +13,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['it'] = { diff --git a/js/locales/ja.js b/js/locales/ja.js index cbdc3af1..45b8a46d 100755 --- a/js/locales/ja.js +++ b/js/locales/ja.js @@ -18,13 +18,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['ja'] = { diff --git a/js/locales/ka.js b/js/locales/ka.js index f797ef06..00579191 100755 --- a/js/locales/ka.js +++ b/js/locales/ka.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['ka'] = { diff --git a/js/locales/kr.js b/js/locales/kr.js index 1e1e176d..ac07bc43 100755 --- a/js/locales/kr.js +++ b/js/locales/kr.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['kr'] = { diff --git a/js/locales/kz.js b/js/locales/kz.js index a57fe48c..5c40c9a6 100755 --- a/js/locales/kz.js +++ b/js/locales/kz.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['kz'] = { diff --git a/js/locales/lt.js b/js/locales/lt.js index f63f9fc5..773c7726 100644 --- a/js/locales/lt.js +++ b/js/locales/lt.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['lt'] = { diff --git a/js/locales/lv.js b/js/locales/lv.js index 666fef7b..70c8a578 100644 --- a/js/locales/lv.js +++ b/js/locales/lv.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['lv'] = { diff --git a/js/locales/nl.js b/js/locales/nl.js index 80100d3f..56b0add3 100755 --- a/js/locales/nl.js +++ b/js/locales/nl.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['nl'] = { diff --git a/js/locales/no.js b/js/locales/no.js index 8f1980c7..5fe00010 100644 --- a/js/locales/no.js +++ b/js/locales/no.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['no'] = { diff --git a/js/locales/pl.js b/js/locales/pl.js index 263cef08..602349df 100755 --- a/js/locales/pl.js +++ b/js/locales/pl.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['pl'] = { diff --git a/js/locales/pt-BR.js b/js/locales/pt-BR.js index ea3a1056..996a8920 100755 --- a/js/locales/pt-BR.js +++ b/js/locales/pt-BR.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['pt-BR'] = { diff --git a/js/locales/pt.js b/js/locales/pt.js index 55af47ac..294aea7a 100755 --- a/js/locales/pt.js +++ b/js/locales/pt.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['pt'] = { diff --git a/js/locales/ro.js b/js/locales/ro.js index 878aa84c..bfa2cc11 100755 --- a/js/locales/ro.js +++ b/js/locales/ro.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['ro'] = { diff --git a/js/locales/ru.js b/js/locales/ru.js index 0900e7fd..326230c5 100755 --- a/js/locales/ru.js +++ b/js/locales/ru.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['ru'] = { diff --git a/js/locales/sk.js b/js/locales/sk.js index ebe328d2..5394b7da 100755 --- a/js/locales/sk.js +++ b/js/locales/sk.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['sk'] = { diff --git a/js/locales/sl.js b/js/locales/sl.js index 085a6c41..d708585b 100755 --- a/js/locales/sl.js +++ b/js/locales/sl.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['sl'] = { diff --git a/js/locales/sr-latn.js b/js/locales/sr-latn.js index 00036376..f3fdc886 100644 --- a/js/locales/sr-latn.js +++ b/js/locales/sr-latn.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['sr-latn'] = { diff --git a/js/locales/sv.js b/js/locales/sv.js index 6c189dd3..b4253fa4 100644 --- a/js/locales/sv.js +++ b/js/locales/sv.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['sv'] = { diff --git a/js/locales/th.js b/js/locales/th.js index f35991ba..1c9426c7 100755 --- a/js/locales/th.js +++ b/js/locales/th.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['th'] = { diff --git a/js/locales/tr.js b/js/locales/tr.js index b44acb48..88800ecc 100755 --- a/js/locales/tr.js +++ b/js/locales/tr.js @@ -11,13 +11,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['tr'] = { diff --git a/js/locales/uk.js b/js/locales/uk.js index d8736fe9..2835e3ab 100755 --- a/js/locales/uk.js +++ b/js/locales/uk.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['uk'] = { diff --git a/js/locales/uz-cyrl.js b/js/locales/uz-cyrl.js index de7be1fd..ab700134 100644 --- a/js/locales/uz-cyrl.js +++ b/js/locales/uz-cyrl.js @@ -10,13 +10,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['uz-cyrl'] = { diff --git a/js/locales/uz.js b/js/locales/uz.js index cf283abb..821a3041 100644 --- a/js/locales/uz.js +++ b/js/locales/uz.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales.uz = { diff --git a/js/locales/vi.js b/js/locales/vi.js index f50b7ff6..564f0099 100755 --- a/js/locales/vi.js +++ b/js/locales/vi.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['vi'] = { diff --git a/js/locales/zh-TW.js b/js/locales/zh-TW.js index baae7e07..8c7c079d 100755 --- a/js/locales/zh-TW.js +++ b/js/locales/zh-TW.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['zh-TW'] = { diff --git a/js/locales/zh.js b/js/locales/zh.js index 3a59352a..ad22beb0 100755 --- a/js/locales/zh.js +++ b/js/locales/zh.js @@ -12,13 +12,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputLocales['zh'] = { diff --git a/nuget/Package.nuspec b/nuget/Package.nuspec index a3abe56a..e2ca0b88 100755 --- a/nuget/Package.nuspec +++ b/nuget/Package.nuspec @@ -3,7 +3,7 @@ bootstrap-fileinput bootstrap-fileinput - 5.2.4 + 5.2.5 Kartik Visweswaran Kartik Visweswaran https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md diff --git a/package.json b/package.json index 8af3b72f..16805a2b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-fileinput", - "version": "5.2.4", + "version": "5.2.5", "homepage": "https://github.com/kartik-v/bootstrap-fileinput", "authors": [ "Kartik Visweswaran " diff --git a/scss/fileinput-rtl.scss b/scss/fileinput-rtl.scss index b008e4ff..4a9cfc72 100644 --- a/scss/fileinput-rtl.scss +++ b/scss/fileinput-rtl.scss @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee RTL (Right To Left) default styling for bootstrap-fileinput. diff --git a/scss/fileinput.scss b/scss/fileinput.scss index e76e1c32..dd674f5f 100644 --- a/scss/fileinput.scss +++ b/scss/fileinput.scss @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee default styling for bootstrap-fileinput. diff --git a/scss/themes/explorer-fa/theme.scss b/scss/themes/explorer-fa/theme.scss index d412ddc8..ac373937 100644 --- a/scss/themes/explorer-fa/theme.scss +++ b/scss/themes/explorer-fa/theme.scss @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome 4.x theme style for bootstrap-fileinput. Load this theme file after loading diff --git a/scss/themes/explorer-fas/theme.scss b/scss/themes/explorer-fas/theme.scss index 5a265772..d855f57e 100644 --- a/scss/themes/explorer-fas/theme.scss +++ b/scss/themes/explorer-fas/theme.scss @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading diff --git a/scss/themes/explorer/theme.scss b/scss/themes/explorer/theme.scss index 83a9ed0b..580ecf51 100644 --- a/scss/themes/explorer/theme.scss +++ b/scss/themes/explorer/theme.scss @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer theme style for bootstrap-fileinput. Load this theme file after loading `fileinput.css`. diff --git a/themes/bs5/theme.js b/themes/bs5/theme.js index 82f1974f..db7cd398 100644 --- a/themes/bs5/theme.js +++ b/themes/bs5/theme.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Bootstrap 5.x icon theme configuration for bootstrap-fileinput. Requires bootstrap 5.x icons CSS to be loaded. @@ -14,13 +14,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'],factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { 'use strict'; $.fn.fileinputBsVersion = '5.x.x'; $.fn.fileinputThemes.bs5 = { diff --git a/themes/bs5/theme.min.js b/themes/bs5/theme.min.js index 7563996d..dd6b6099 100644 --- a/themes/bs5/theme.min.js +++ b/themes/bs5/theme.min.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Bootstrap 5.x icon theme configuration for bootstrap-fileinput. Requires bootstrap 5.x icons CSS to be loaded. @@ -10,4 +10,4 @@ * * Licensed under the BSD-3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md - */!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery","window","document"],i):"object"==typeof module&&"object"==typeof module.exports?i(require("jquery"),window,document):i(window.jQuery,window,document)}(function(i){"use strict";i.fn.fileinputBsVersion="5.x.x",i.fn.fileinputThemes.bs5={fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},layoutTemplates:{fileIcon:''},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:' ',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file + */!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):i("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(i){"use strict";i.fn.fileinputBsVersion="5.x.x",i.fn.fileinputThemes.bs5={fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},layoutTemplates:{fileIcon:''},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:' ',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file diff --git a/themes/explorer-fa/theme.css b/themes/explorer-fa/theme.css index 384aca4b..51f54368 100644 --- a/themes/explorer-fa/theme.css +++ b/themes/explorer-fa/theme.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading diff --git a/themes/explorer-fa/theme.js b/themes/explorer-fa/theme.js index 300c4c99..fc45b82b 100644 --- a/themes/explorer-fa/theme.js +++ b/themes/explorer-fa/theme.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome theme configuration for bootstrap-fileinput. @@ -15,13 +15,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'],factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { 'use strict'; $.fn.fileinputThemes['explorer-fa'] = { layoutTemplates: { diff --git a/themes/explorer-fa/theme.min.css b/themes/explorer-fa/theme.min.css index ef10511d..bed309b1 100644 --- a/themes/explorer-fa/theme.min.css +++ b/themes/explorer-fa/theme.min.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading diff --git a/themes/explorer-fa/theme.min.js b/themes/explorer-fa/theme.min.js index 3acffb7b..7632b51f 100644 --- a/themes/explorer-fa/theme.min.js +++ b/themes/explorer-fa/theme.min.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome theme configuration for bootstrap-fileinput. @@ -11,4 +11,4 @@ * * Licensed under the BSD-3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md - */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery","window","document"],a):"object"==typeof module&&"object"==typeof module.exports?a(require("jquery"),window,document):a(window.jQuery,window,document)}(function(a){"use strict";a.fn.fileinputThemes["explorer-fa"]={layoutTemplates:{footer:'
    {caption}
    {size}{progress}
    {indicator} {actions}
    ',actions:'{drag}\n
    \n \n
    ',fileIcon:' '},previewSettings:{html:{width:"100px",height:"60px"},text:{width:"100px",height:"60px"},video:{width:"auto",height:"60px"},audio:{width:"auto",height:"60px"},flash:{width:"100%",height:"60px"},object:{width:"100%",height:"60px"},pdf:{width:"100px",height:"60px"},other:{width:"100%",height:"60px"}},frameClass:"explorer-frame",fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:'',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file + */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(a){"use strict";a.fn.fileinputThemes["explorer-fa"]={layoutTemplates:{footer:'
    {caption}
    {size}{progress}
    {indicator} {actions}
    ',actions:'{drag}\n
    \n \n
    ',fileIcon:' '},previewSettings:{html:{width:"100px",height:"60px"},text:{width:"100px",height:"60px"},video:{width:"auto",height:"60px"},audio:{width:"auto",height:"60px"},flash:{width:"100%",height:"60px"},object:{width:"100%",height:"60px"},pdf:{width:"100px",height:"60px"},other:{width:"100%",height:"60px"}},frameClass:"explorer-frame",fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:'',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file diff --git a/themes/explorer-fas/theme.css b/themes/explorer-fas/theme.css index 8730b2d1..246d4907 100644 --- a/themes/explorer-fas/theme.css +++ b/themes/explorer-fas/theme.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading diff --git a/themes/explorer-fas/theme.js b/themes/explorer-fas/theme.js index 9cf0edbc..1af6624c 100644 --- a/themes/explorer-fas/theme.js +++ b/themes/explorer-fas/theme.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome theme configuration for bootstrap-fileinput. @@ -15,13 +15,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'],factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { 'use strict'; $.fn.fileinputThemes['explorer-fas'] = { layoutTemplates: { diff --git a/themes/explorer-fas/theme.min.css b/themes/explorer-fas/theme.min.css index 05eddb59..e9a59216 100644 --- a/themes/explorer-fas/theme.min.css +++ b/themes/explorer-fas/theme.min.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading diff --git a/themes/explorer-fas/theme.min.js b/themes/explorer-fas/theme.min.js index 96616dc9..e389dbeb 100644 --- a/themes/explorer-fas/theme.min.js +++ b/themes/explorer-fas/theme.min.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer Font Awesome theme configuration for bootstrap-fileinput. @@ -11,4 +11,4 @@ * * Licensed under the BSD-3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md - */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery","window","document"],a):"object"==typeof module&&"object"==typeof module.exports?a(require("jquery"),window,document):a(window.jQuery,window,document)}(function(a){"use strict";a.fn.fileinputThemes["explorer-fas"]={layoutTemplates:{footer:'
    {caption}
    {size}{progress}
    {indicator} {actions}
    ',actions:'{drag}\n
    \n \n
    ',fileIcon:' '},previewSettings:{html:{width:"100px",height:"60px"},text:{width:"100px",height:"60px"},video:{width:"auto",height:"60px"},audio:{width:"auto",height:"60px"},flash:{width:"100%",height:"60px"},object:{width:"100%",height:"60px"},pdf:{width:"100px",height:"60px"},other:{width:"100%",height:"60px"}},frameClass:"explorer-frame",fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:'',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file + */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(a){"use strict";a.fn.fileinputThemes["explorer-fas"]={layoutTemplates:{footer:'
    {caption}
    {size}{progress}
    {indicator} {actions}
    ',actions:'{drag}\n
    \n \n
    ',fileIcon:' '},previewSettings:{html:{width:"100px",height:"60px"},text:{width:"100px",height:"60px"},video:{width:"auto",height:"60px"},audio:{width:"auto",height:"60px"},flash:{width:"100%",height:"60px"},object:{width:"100%",height:"60px"},pdf:{width:"100px",height:"60px"},other:{width:"100%",height:"60px"}},frameClass:"explorer-frame",fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:'',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file diff --git a/themes/explorer/theme.css b/themes/explorer/theme.css index 31619c83..ee47aa97 100755 --- a/themes/explorer/theme.css +++ b/themes/explorer/theme.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer theme style for bootstrap-fileinput. Load this theme file after loading `fileinput.css`. diff --git a/themes/explorer/theme.js b/themes/explorer/theme.js index 71252785..dd02325e 100755 --- a/themes/explorer/theme.js +++ b/themes/explorer/theme.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer theme configuration for bootstrap-fileinput. Load this theme file after loading `fileinput.js`. @@ -13,13 +13,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'],factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputThemes.explorer = { layoutTemplates: { diff --git a/themes/explorer/theme.min.css b/themes/explorer/theme.min.css index a29a5c9c..883211e2 100644 --- a/themes/explorer/theme.min.css +++ b/themes/explorer/theme.min.css @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer theme style for bootstrap-fileinput. Load this theme file after loading `fileinput.css`. diff --git a/themes/explorer/theme.min.js b/themes/explorer/theme.min.js index 4008e379..a73c7ffb 100644 --- a/themes/explorer/theme.min.js +++ b/themes/explorer/theme.min.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Krajee Explorer theme configuration for bootstrap-fileinput. Load this theme file after loading `fileinput.js`. @@ -9,4 +9,4 @@ * * Licensed under the BSD-3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md - */!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","window","document"],e):"object"==typeof module&&"object"==typeof module.exports?e(require("jquery"),window,document):e(window.jQuery,window,document)}(function(e){"use strict";e.fn.fileinputThemes.explorer={layoutTemplates:{footer:'
    {caption}
    {size}{progress}
    {indicator} {actions}
    ',actions:'{drag}\n
    \n \n
    '},previewSettings:{html:{width:"100px",height:"60px"},text:{width:"100px",height:"60px"},video:{width:"auto",height:"60px"},audio:{width:"auto",height:"60px"},flash:{width:"100%",height:"60px"},object:{width:"100%",height:"60px"},pdf:{width:"100px",height:"60px"},other:{width:"100%",height:"60px"}},frameClass:"explorer-frame"}}); \ No newline at end of file + */!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(e){"use strict";e.fn.fileinputThemes.explorer={layoutTemplates:{footer:'
    {caption}
    {size}{progress}
    {indicator} {actions}
    ',actions:'{drag}\n
    \n \n
    '},previewSettings:{html:{width:"100px",height:"60px"},text:{width:"100px",height:"60px"},video:{width:"auto",height:"60px"},audio:{width:"auto",height:"60px"},flash:{width:"100%",height:"60px"},object:{width:"100%",height:"60px"},pdf:{width:"100px",height:"60px"},other:{width:"100%",height:"60px"}},frameClass:"explorer-frame"}}); \ No newline at end of file diff --git a/themes/fa/theme.js b/themes/fa/theme.js index ffdfacc3..100a5fbc 100755 --- a/themes/fa/theme.js +++ b/themes/fa/theme.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Font Awesome icon theme configuration for bootstrap-fileinput. Requires font awesome assets to be loaded. @@ -13,13 +13,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'],factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputThemes.fa = { diff --git a/themes/fa/theme.min.js b/themes/fa/theme.min.js index 1356f7e5..495b675b 100644 --- a/themes/fa/theme.min.js +++ b/themes/fa/theme.min.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Font Awesome icon theme configuration for bootstrap-fileinput. Requires font awesome assets to be loaded. @@ -9,4 +9,4 @@ * * Licensed under the BSD-3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md - */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery","window","document"],a):"object"==typeof module&&"object"==typeof module.exports?a(require("jquery"),window,document):a(window.jQuery,window,document)}(function(a){"use strict";a.fn.fileinputThemes.fa={fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},layoutTemplates:{fileIcon:' '},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:'',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file + */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(a){"use strict";a.fn.fileinputThemes.fa={fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},layoutTemplates:{fileIcon:' '},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:'',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file diff --git a/themes/fas/theme.js b/themes/fas/theme.js index dc94dbca..816aa184 100644 --- a/themes/fas/theme.js +++ b/themes/fas/theme.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Font Awesome 5 icon theme configuration for bootstrap-fileinput. Requires font awesome 5 assets to be loaded. @@ -13,13 +13,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'],factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputThemes.fas = { diff --git a/themes/fas/theme.min.js b/themes/fas/theme.min.js index 498cd0c4..e27e2343 100644 --- a/themes/fas/theme.min.js +++ b/themes/fas/theme.min.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Font Awesome 5 icon theme configuration for bootstrap-fileinput. Requires font awesome 5 assets to be loaded. @@ -9,4 +9,4 @@ * * Licensed under the BSD-3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md - */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery","window","document"],a):"object"==typeof module&&"object"==typeof module.exports?a(require("jquery"),window,document):a(window.jQuery,window,document)}(function(a){"use strict";a.fn.fileinputThemes.fas={fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},layoutTemplates:{fileIcon:' '},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:'',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file + */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(a){"use strict";a.fn.fileinputThemes.fas={fileActionSettings:{removeIcon:'',uploadIcon:'',uploadRetryIcon:'',downloadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:''},layoutTemplates:{fileIcon:' '},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:'',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file diff --git a/themes/gly/theme.js b/themes/gly/theme.js index 7ac40b12..80459704 100755 --- a/themes/gly/theme.js +++ b/themes/gly/theme.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Glyphicon (default) theme configuration for bootstrap-fileinput. @@ -13,13 +13,13 @@ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { - define(['jquery', 'window', 'document'],factory); + define(['jquery'],factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { - factory(require('jquery'), window, document); + factory(require('jquery')); } else { - factory(window.jQuery, window, document); + factory(window.jQuery); } -}(function ($, window, document, undefined) { +}(function ($) { "use strict"; $.fn.fileinputThemes.gly = { diff --git a/themes/gly/theme.min.js b/themes/gly/theme.min.js index 6dd22fb9..c371433d 100644 --- a/themes/gly/theme.min.js +++ b/themes/gly/theme.min.js @@ -1,5 +1,5 @@ /*! - * bootstrap-fileinput v5.2.4 + * bootstrap-fileinput v5.2.5 * http://plugins.krajee.com/file-input * * Glyphicon (default) theme configuration for bootstrap-fileinput. @@ -9,4 +9,4 @@ * * Licensed under the BSD-3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md - */!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery","window","document"],i):"object"==typeof module&&"object"==typeof module.exports?i(require("jquery"),window,document):i(window.jQuery,window,document)}(function(i){"use strict";i.fn.fileinputThemes.gly={fileActionSettings:{removeIcon:'',uploadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:''},layoutTemplates:{fileIcon:''},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:' ',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file + */!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):i("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(i){"use strict";i.fn.fileinputThemes.gly={fileActionSettings:{removeIcon:'',uploadIcon:'',zoomIcon:'',dragIcon:'',indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:''},layoutTemplates:{fileIcon:''},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewFileIcon:'',browseIcon:' ',removeIcon:'',cancelIcon:'',pauseIcon:'',uploadIcon:'',msgValidationErrorIcon:' '}}); \ No newline at end of file