From c233160befa815aab3f00c3a88f1d9984567b886 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Wed, 29 Jun 2022 12:37:53 +0530 Subject: [PATCH] Update to release v5.5.0 fixes #1694 --- CHANGE.md | 4 +++- js/fileinput.js | 13 ++++++++----- js/fileinput.min.js | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGE.md b/CHANGE.md index cfce21f9..a47ad816 100755 --- a/CHANGE.md +++ b/CHANGE.md @@ -5,7 +5,7 @@ Change Log: `bootstrap-fileinput` **Major Release: BC Breaking** -**Date**: 28-Jun-2022 +**Date**: 29-Jun-2022 - (enh #1800): Styling enhancements for thumbnail content and rotatable images. - (enh #1799): Correct translations containing `{maxSize}, {minSize}, {size}`. @@ -47,6 +47,8 @@ $input.on('fileuploaderror', function(event, data) { // $input.fileinput('showUserError', userMessage); }); ``` +- (enh #1694): Thumbnail of images only but detailed preview/iconic view of all other files. + - New property `alwaysPreviewFileExtensions` - setup as an array list of extensions whose content will always be shown in preview (irrespective of `preferIconPreview` or `previewFileIconSettings` which will be used to control icon preview for configured types). ## version 5.2.8 diff --git a/js/fileinput.js b/js/fileinput.js index 8fde8094..7466a45a 100755 --- a/js/fileinput.js +++ b/js/fileinput.js @@ -4369,12 +4369,13 @@ zoomData ) { var self = this, caption = self.slug(fname), prevContent, zoomContent = '', styleAttribs = '', - filename = fnameUpdated || fname, + filename = fnameUpdated || fname, isIconic, ext = filename.split('.').pop().toLowerCase(), screenW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, config, title = caption, alt = caption, typeCss = 'type-default', getContent, addFrameCss, footer = foot || self._renderFileFooter(cat, caption, size, 'auto', isError), isRotatable, - forcePrevIcon = self.preferIconicPreview, forceZoomIcon = self.preferIconicZoomPreview, - newCat = forcePrevIcon ? 'other' : cat, ext = filename.split('.').pop().toLowerCase(); + alwaysPreview = $.inArray(ext, self.alwaysPreviewFileExtensions) !== -1, + forcePrevIcon = self.preferIconicPreview && !alwaysPreview, + forceZoomIcon = self.preferIconicZoomPreview && !alwaysPreview, newCat = forcePrevIcon ? 'other' : cat; config = screenW < 400 ? (self.previewSettingsSmall[newCat] || self.defaults.previewSettingsSmall[newCat]) : (self.previewSettings[newCat] || self.defaults.previewSettings[newCat]); if (config) { @@ -4448,7 +4449,8 @@ } addFrameCss = 'kv-preview-thumb'; if (isRotatable) { - addFrameCss += ' rotatable' + (forcePrevIcon || self.hideThumbnailContent ? ' hide-rotate' : ''); + isIconic = forcePrevIcon || self.hideThumbnailContent || !!self.previewFileIconSettings[ext]; + addFrameCss += ' rotatable' + (isIconic ? ' hide-rotate' : ''); } prevContent = getContent((forcePrevIcon ? 'other' : cat), data, false, addFrameCss, zoomData); return prevContent.setTokens({zoomCache: zoomContent}); @@ -6340,6 +6342,7 @@ previewContentTemplates: {}, preferIconicPreview: false, preferIconicZoomPreview: false, + alwaysPreviewFileExtensions: [], rotatableFileExtensions: ['jpg', 'jpeg', 'png', 'gif'], allowedFileTypes: null, allowedFileExtensions: null, @@ -6397,7 +6400,7 @@ maxThreads: 4, maxRetries: 3, showErrorLog: true, - retainErrorHistory: true, // display complete error history always unless user explicitly resets upload + retainErrorHistory: false, // when set to true, display complete error history always unless user explicitly resets upload skipErrorsAndProceed: false // when set to true, files with errors will be skipped and upload will continue with other files }, uploadExtraData: {}, diff --git a/js/fileinput.min.js b/js/fileinput.min.js index 5e849cf3..71f5485d 100755 --- a/js/fileinput.min.js +++ b/js/fileinput.min.js @@ -8,4 +8,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"],e):"object"==typeof module&&"object"==typeof module.exports?e(require("jquery")):e(window.jQuery)}(function(e){"use strict";var t,i;e.fn.fileinputLocales={},e.fn.fileinputThemes={},e.fn.fileinputBsVersion||(e.fn.fileinputBsVersion=window.bootstrap&&window.bootstrap.Alert&&window.bootstrap.Alert.VERSION||window.Alert&&window.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))}),t={FRAMES:".kv-preview-thumb",SORT_CSS:"file-sortable",INIT_FLAG:"init-",SCRIPT_SRC:document&&document.currentScript&&document.currentScript.src||null,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,getZoomPlaceholder:function(){var e,i=t.SCRIPT_SRC,a="?kvTemp__2873389129__=";return i?(e=i.substring(0,i.lastIndexOf("/"))).substring(0,e.lastIndexOf("/")+1)+"img/loading.gif"+a:a},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;t0&&(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&&(10===e?new RegExp("msie\\s"+e,"i").test(navigator.userAgent):((t=document.createElement("div")).innerHTML="\x3c!--[if IE "+e+"]> 0&&e[0].webkitGetAsEntry())for(t=0;t=0?atob(e.split(",")[1]):decodeURIComponent(e.split(",")[1]),a=new ArrayBuffer(i.length),r=new Uint8Array(a),n=0;n>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(i);break;case 12:case 13:a=n[o++],s+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=n[o++],r=n[o++],s+=String.fromCharCode((15&i)<<12|(63&a)<<6|(63&r)<<0)}return s},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},isPdf:function(e){return!t.isEmpty(e)&&(0!==(e=e.toString().trim().replace(/\n/g," ")).length&&void 0)},isSvg:function(e){return!t.isEmpty(e)&&(0!==(e=e.toString().trim().replace(/\n/g," ")).length&&(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);return n.find("[style]").each(function(i,r){var n=e(r),s=n[0].style,o=t.uniqId(),l={};s&&s.length&&(e(s).each(function(){l[this]=s[this]}),a.domElementsStyles[o]=l,n.removeAttr("style").attr(a.CSP_ATTRIB,o))}),n.filter("*").removeAttr("style"),(Object.values?Object.values(r):Object.keys(r).map(function(e){return r[e]})).flatMap(function(e){return e.innerHTML}).join("")},apply:function(t){var i=this;e(t).find("["+i.CSP_ATTRIB+"]").each(function(t,a){var r=e(a),n=r.attr(i.CSP_ATTRIB),s=i.domElementsStyles[n];s&&r.css(s),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 s=a-n.length;1+s--;)n.push(void 0);return n.splice(a,0,n.splice(i,1)[0]),r&&n.reverse(),n},closeButton:function(e){return'"},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,s,o,l,d=[].slice,c=1===arguments.length&&t.isArray(i)?i:d.call(arguments),u=e.Deferred(),f=0,p=c.length,h=p;for(n=s=o=Array(p),l=function(e,t,i){return function(){i!==c&&f++,u.notifyWith(t[e]=this,i[e]=d.call(arguments)),--h||u[(f?"reject":"resolve")+"With"](t,i)}},a=0;a0&&l.maxTotalFileCount10?t-10:Math.ceil(t/2),e=t;e>i;e--)r=parseFloat(s.bpsLog[e]),a++;s.bps=64*(a>0?r/a:0)},u),n={fileId:e,started:o,elapsed:l,loaded:a,total:r,bps:s.bps,bitrate:i._getSize(s.bps,!1,i.bitRateUnits),pendingBytes:c},e?s.stats[e]=n:s.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,s=a.fileManager;if(a.enableResumableUpload)if(!1!==r.fallback&&"function"!=typeof r.fallback&&(r.fallback=function(e){e._log(n.noResumableSupport),e.enableResumableUpload=!1}),t.hasResumableUploadSupport()||!1===r.fallback){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=s.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,s,o){e.responseJSON&&e.responseJSON.error&&(s=e.responseJSON.error.toString()),o||(i.error=s),r.showErrorLog&&a._log(n.ajaxError,{status:e.status,error:s,text:e.responseText||""})},reset:function(){i.stack=[],i.chunksProcessed={}},setProcessed:function(t){var n,o,l=i.id,d=i.$thumb,c=i.$progress,u=d&&d.length,f={id:u?d.attr("id"):"",index:s.getIndex(l),fileId:l},p=a.resumableUploadOptions.skipErrorsAndProceed;i.completed=!0,i.lastProgress=0,u&&d.removeClass("file-uploading"),"success"===t?(s.uploadedSize+=i.file.size,a.showPreview&&(a._setProgress(101,c),a._setThumbStatus(d,"Success"),a._initUploadSuccess(i.chunksProcessed[l].data,d)),s.removeFile(l),delete i.chunksProcessed[l],a._raise("fileuploaded",[f.id,f.index,f.fileId]),s.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=!p),a.$errorContainer.find('li[data-file-id="'+f.fileId+'"]').length||(o={file:i.fileName,max:r.maxRetries,error:i.error},n=a.msgResumableUploadRetriesExceeded.setTokens(o),e.extend(f,o),a._showFileError(n,f,"filemaxretries"),p&&(s.removeFile(l),delete i.chunksProcessed[l],s.isProcessed()&&a._setProgress(101)))),s.isProcessed()&&i.reset()},check:function(){e.each(i.logs,function(e,t){if(!t)return!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=s.getIdList(),n="new";e=setInterval(function(){var o;if(i.checkAborted(e),"new"===n&&(a.lock(),n="processing",o=r.shift(),s.initStats(o),s.stack[o]&&(i.init(o,s.stack[o],s.getIndex(o)),i.processUpload())),!s.isPending(o)&&i.completed&&(n="new"),s.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,s=i.chunkCount;for(t=n.addPool(i.id),e=0;er.maxRetries)return g(h.resumableMaxRetriesReached,{n:r.maxRetries}),void i.setProcessed("error");var v,w,b,_,C,x,y=f[f.slice?"slice":f.mozSlice?"mozSlice":f.webkitSlice?"webkitSlice":"slice"](c*e,c*(e+1));v=new FormData,d=s.stack[u],a._setUploadData(v,{chunkCount:i.chunkCount,chunkIndex:e,chunkSize:c,chunkSizeStart:c*e,fileBlob:[y,i.fileName],fileId:u,fileName:i.fileName,fileRelativePath:d.relativePath,fileSize:f.size,retryCount:o}),i.$progress&&i.$progress.length&&i.$progress.show(),b=function(r){w=a._getOutData(v,r),a.showPreview&&(p.hasClass("file-preview-success")||(a._setThumbStatus(p,"Loading"),t.addCss(p,"file-uploading")),m.attr("disabled",!0)),a._raise("filechunkbeforesend",[u,e,o,s,i,w])},_=function(t,d,c){if(a._isAborted())g(h.resumableAborting);else{w=a._getOutData(v,c,t);var f=a.uploadParamNames.chunkIndex||"chunkIndex",p=[u,e,o,s,i,w];t.error?(r.showErrorLog&&a._log(n.retryStatus,{retry:o+1,filename:i.fileName,chunk:e}),a._raise("filechunkerror",p),i.pushAjax(e,o+1),i.error=t.error,g(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",p),i.check())}},C=function(t,r,n){a._isAborted()?g(h.resumableAborting):(w=a._getOutData(v,t),i.setAjaxError(t,r,n),a._raise("filechunkajaxerror",[u,e,o,s,i,w]),i.pushAjax(e,o+1),g(h.resumableRetryError,{n:o-1}))},x=function(){a._isAborted()||a._raise("filechunkcomplete",[u,e,o,s,i,a._getOutData(v)])},a._ajaxSubmit(b,_,x,C,v,u,i.fileIndex)}}}).reset()}else r.fallback(a)},_initTemplateDefaults:function(){var i,a,r,n,s,o,l,d,c,u,f,p,h,m,g,v,w,b,_,C=this,x=function(e,i){return'\n"+t.DEFAULT_PREVIEW+"\n\n"},y="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=t.closeButton("fileinput-remove"),_=t.MODAL_ID+"Label",r='',n='\n',s='
\n",c='",u='",f='\n",p='\x3c!--suppress ALL --\x3e\n",h='\n",m='\n\n'+t.OBJECT_PARAMS+" "+t.DEFAULT_PREVIEW+"\n\n",v='
\n"+t.DEFAULT_PREVIEW+"\n
\n",b={width:"100%",height:"100%","min-height":"480px"},C._isPdfRendered()&&(g=C.pdfRendererTemplate.replace("{renderer}",C._encodeURI(C.pdfRendererUrl))),C.defaults={layoutTemplates:{main1:i,main2:'{preview}\n
\n
\n{remove}\n{cancel}\n{upload}\n{browse}\n',preview:'
\n {close}
\n
\n
\n
\n
\n
\n
',close:a,fileIcon:'',caption:'\n',modalMain:r,modal:n,descriptionClose:'',progress:'
\n
\n {status}\n
\n
{stats}',stats:'
{pendingTime} {uploadSpeed}
',size:" ({sizeText})",footer:'',indicator:'
{indicator}
',actions:'
\n \n
\n{drag}\n
',actionDelete:'\n',actionRotate:'',actionUpload:'',actionDownload:'{downloadIcon}',actionZoom:'',actionDrag:'{dragIcon}',btnDefault:'',btnLink:'{icon} {label}',btnBrowse:'
{icon} {label}
',zoomCache:'
{zoomContent}
'},previewMarkupTags:{tagBefore1:'
\n',tagBefore2:'
\n',tagAfter:"
{footer}\n{zoomCache}
\n"},previewContentTemplates:{generic:"{content}\n",html:o,image:l,text:d,office:c,gdocs:u,video:f,audio:p,flash:h,object:m,pdf:g,other:v},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:b,text:b,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:b,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,showRotate:!0,removeIcon:'',removeClass:y,removeErrorClass:"btn btn-sm btn-kv btn-danger",removeTitle:"Remove file",uploadIcon:'',uploadClass:y,uploadTitle:"Upload file",uploadRetryIcon:'',uploadRetryTitle:"Retry upload",downloadIcon:'',downloadClass:y,downloadTitle:"Download file",rotateIcon:'',rotateClass:y,rotateTitle:"Rotate 90 deg. clockwise",zoomIcon:'',zoomClass:y,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(C.defaults,function(t,i){"allowedPreviewTypes"!==t?C[t]=e.extend(!0,{},i,C[t]):void 0===C.allowedPreviewTypes&&(C.allowedPreviewTypes=i)}),C._initPreviewTemplates()},_initPreviewTemplates:function(){var i,a=this,r=a.previewMarkupTags,n=r.tagAfter;e.each(a.previewContentTemplates,function(e,s){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+s+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){return i.previewCache.data&&i.previewCache.data.content?e?i.previewCache.data.content.filter(function(e){return null!==e}).length:i.previewCache.data.content.length:0},get:function(e,a){var r,n,s,o,l,d,c,u=t.INIT_FLAG+e,f=i.previewCache.data,p=f.config[e],h=f.content[e],m=t.ifSet("previewAsData",p,i.initialPreviewAsData),g=p?{title:p.title||null,alt:p.alt||null}:{title:null,alt:null},v=function(e,a,r,n,s,o,l,d){var c=" file-preview-initial "+t.SORT_CSS+(l?" "+l:""),u=i.previewInitId+"-"+o,f=p&&p.fileId||u;return i._generatePreviewTemplate(e,a,r,n,u,f,!1,null,null,c,s,o,d,g,p&&p.zoomData||a)};return h&&h.length?(a=void 0===a||a,s=t.ifSet("type",p,i.initialPreviewFileType||"generic"),l=t.ifSet("filename",p,t.ifSet("caption",p)),d=t.ifSet("filetype",p,s),o=i.previewCache.footer(e,a,p&&p.size||null),c=t.ifSet("frameClass",p),r=m?v(s,h,l,d,o,u,c):v("generic",h,l,d,o,u,c,s).setTokens({content:f.content[e]}),f.tags.length&&f.tags[e]&&(r=t.replaceTags(r,f.tags[e])),t.isEmpty(p)||t.isEmpty(p.frameAttr)||((n=t.createElement(r)).find(".file-preview-initial").attr(p.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 s,o=i.previewCache.data;return e&&e.length?(s=e.length-1,t.isArray(e)||(e=e.split(i.initialPreviewDelimiter)),n&&o.content?(s=o.content.push(e[0])-1,o.config[s]=a,o.tags[s]=r):(o.content=e,o.config=a,o.tags=r),i.previewCache.clean(o),s):0},set:function(e,a,r,n){var s,o=i.previewCache.data;if(e&&e.length&&(t.isArray(e)||(e=e.split(i.initialPreviewDelimiter)),e.filter(function(e){return null!==e}).length)){if(void 0===o.content&&(o.content=[]),void 0===o.config&&(o.config=[]),void 0===o.tags&&(o.tags=[]),n){for(s=0;s"+a+": "+e)):i||this.$errorContainer.html(""),this._showFileError(e,t,"fileusererror"))},_showFileError:function(e,t,i){var a=this.$errorContainer,r=i||"fileuploaderror",n=t&&t.fileId||"",s=t&&t.id?'
  • '+e+"
  • ":"
  • "+e+"
  • ";return 0===a.find("ul").length?this._addError("
      "+s+"
    "):a.find("ul").append(s),a.fadeIn(this.fadeDelay),this._raise(r,[t,e]),this._setValidationError("file-input-new"),!0},_showError:function(e,t,i){var a=this.$errorContainer,r=i||"fileerror";return(t=t||{}).reader=this.reader,this._addError(e),a.fadeIn(this.fadeDelay),this._raise(r,[t,e]),this.isAjaxUpload||this._clearFileInput(),this._setValidationError("file-input-new"),this.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(e){var t=this.minFileCount>1?this.filePlural:this.fileSingle,i=this.msgFilesTooLess.replace("{n}",this.minFileCount).replace("{files}",t),a=this.$errorContainer;i="
  • "+i+"
  • ",0===a.find("ul").length?this._addError("
      "+i+"
    "):a.find("ul").append(i),this.isError=!0,this._updateFileDetails(0),a.fadeIn(this.fadeDelay),this._raise("fileerror",[e,i]),this._clearFileInput(),this._setValidationError()},_parseError:function(t,i,a,r){var n,s,o,l=e.trim(a+"");return o=(s=i.responseJSON&&i.responseJSON.error?i.responseJSON.error.toString():"")||i.responseText,this.cancelling&&this.msgUploadAborted&&(l=this.msgUploadAborted),this.showAjaxErrorDetails&&o&&(s?l=e.trim(s+""):(n=(o=e.trim(o.replace(/\n\s*\n/g,"\n"))).length?"
    "+o+"
    ":"",l+=l?n:o)),l||(l=this.msgAjaxError.replace("{operation}",t)),this.cancelling=!1,r?""+r+": "+l:l},_parseFileType:function(e,i){var a,r,n,s=this.allowedPreviewTypes||[];if("application/text-plain"===e)return"text";for(n=0;n-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){a.previewFileIconSettings[e]&&t(i)&&(r=a.previewFileIconSettings[e])})),r||a.previewFileIcon},_parseFilePreviewIcon:function(e,t){var i=this._getPreviewIcon(t),a=e;return a.indexOf("{previewFileIcon}")>-1&&(a=a.setTokens({previewFileIconClass:this.previewFileIconClass,previewFileIcon:i})),a},_raise:function(t,i){var a=e.Event(t);void 0!==i?this.$element.trigger(a,i):this.$element.trigger(a);var r=a.result,n=!1===r;if(a.isDefaultPrevented()||n)return!1;if("filebatchpreupload"===a.type&&(r||n))return this.ajaxAborted=r,!1;switch(t){case"filebatchuploadcomplete":case"filebatchuploadsuccess":case"fileuploaded":case"fileclear":case"filecleared":case"filereset":case"fileerror":case"filefoldererror":case"filecustomerror":case"filesuccessremove":break;default:this.ajaxAborted||(this.ajaxAborted=r)}return!0},_listenFullScreen:function(e){var t,i,a=this.$modal;a&&a.length&&(t=a&&a.find(".btn-kv-fullscreen"),i=a&&a.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"),a.hasClass("file-zoom-fullscreen")?this._maximizeZoomDialog():e?this._maximizeZoomDialog():i.removeClass("active").attr("aria-pressed","false")))},_listen:function(){var i=this,a=i.$element,r=i.$form,n=i.$container;i._handler(a,"click",function(e){i._initFileSelected(),a.hasClass("file-no-browse")&&(a.data("zoneClicked")?a.data("zoneClicked",!1):e.preventDefault())}),i._handler(a,"change",e.proxy(i._change,i)),i._handler(i.$caption,"paste",e.proxy(i.paste,i)),i.showBrowse&&(i._handler(i.$btnFile,"click",e.proxy(i._browse,i)),i._handler(i.$btnFile,"keypress",function(e){13===(e.keyCode||e.which)&&(a.trigger("click"),i._browse(e))})),i._handler(n.find(".fileinput-remove:not([disabled])"),"click",e.proxy(i.clear,i)),i._handler(n.find(".fileinput-cancel"),"click",e.proxy(i.cancel,i)),i._handler(n.find(".fileinput-pause"),"click",e.proxy(i.pause,i)),i._initDragDrop(),i._handler(r,"reset",e.proxy(i.clear,i)),i.isAjaxUpload||i._handler(r,"submit",e.proxy(i._submitForm,i)),i._handler(i.$container.find(".fileinput-upload"),"click",e.proxy(i._uploadClick,i)),i._handler(e(window),"resize",function(){i._listenFullScreen(screen.width===window.innerWidth&&screen.height===window.innerHeight)}),i._handler(e(document),"webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",function(){i._listenFullScreen(t.checkFullScreen())}),i.$caption.on("focus",function(){i.$captionContainer.focus()}),i._autoFitContent(),i._initClickable(),i._refreshPreview()},_autoFitContent:function(){var t,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=this,r=i<400?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,s,o=this,l=function(e){o._log(t.logMessages.badDroppedFiles),o._log(e)};e.isFile?e.file(function(e){a&&(e.newPath=a+e.name),i.push(e)},l):e.isDirectory&&(n=e.createReader(),(s=function(){n.readEntries(function(t){if(t&&t.length>0){for(r=0;r-1;if(this._zoneDragDropInit(i),this.isDisabled||!r)return a.effectAllowed="none",void(a.dropEffect="none");a.dropEffect="copy",this._raise("fileDragEnter",{sourceEvent:i,files:a.types.Files})&&t.addCss(this.$dropZone,"file-highlighted")},_zoneDragLeave:function(e){this._zoneDragDropInit(e),this.isDisabled||this._raise("fileDragLeave",{sourceEvent:e})&&this.$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,s=r.items,o=t.getDragDropFolders(s);if(e.preventDefault(),!a.isDisabled&&!t.isEmpty(n)&&a._raise("fileDragDrop",{sourceEvent:e,files:n}))if(o>0){if(!a.isAjaxUpload)return void a._showFolderError(o);for(n=[],i=0;i0&&n>=l,c=e(i.item);d&&(n=l-1),s.initialPreview=t.moveArray(s.initialPreview,r,n,u),s.initialPreviewConfig=t.moveArray(s.initialPreviewConfig,r,n,u),s.previewCache.init(),s.getFrames(".file-preview-initial").each(function(){e(this).attr("data-fileindex",t.INIT_FLAG+o),o++}),d&&(a=s.getFrames(":not(.file-preview-initial):first")).length&&c.slideUp(function(){c.insertBefore(a).slideDown()}),s._raise("filesorted",{previewId:c.attr("id"),oldIndex:r,newIndex:n,stack:s.initialPreviewConfig})}},e.extend(!0,i,s.fileActionSettings.dragSettings),s.sortable&&s.sortable.destroy(),s.sortable=f.create(o[0],i))},_setPreviewContent:function(e){t.setHtml(this.$preview,e),this._autoFitContent()},_initPreviewImageOrientations:function(){var t=this,i=0,a=t.canOrientImage;(t.autoOrientImageInitial||a)&&t.getFrames(".file-preview-initial").each(function(){var r,n,s,o=e(this),l=t.initialPreviewConfig[i];l&&l.exif&&l.exif.Orientation&&(s=o.attr("id"),r=o.find(">.kv-file-content img"),n=t._getZoom(s," >.kv-file-content img"),a?r.css("image-orientation",t.autoOrientImageInitial?"from-image":"none"):t.setImageOrientation(r,n,l.exif.Orientation,o)),i++})},_initPreview:function(e){var i,a=this.initialCaption||"";if(!this.previewCache.count(!0))return this._clearPreview(),void(e?this._setCaption(a):this._initCaption());i=this.previewCache.out(),a=e&&this.initialCaption?this.initialCaption:i.caption,this._setPreviewContent(i.content),this._setInitThumbAttr(),this._setCaption(a),this._initSortable(),t.isEmpty(i.content)||this.$container.removeClass("file-input-new"),this._initPreviewImageOrientations()},_getZoomButton:function(e){var i=this.previewZoomButtonIcons[e],a=this.previewZoomButtonClasses[e],r=' title="'+(this.previewZoomButtonTitles[e]||"")+'" ',n=t.isBs(5)?"bs-":"",s=r+("close"===e?" data-"+n+'dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==e&&"borderless"!==e&&"toggleheader"!==e||(s+=' data-toggle="button" aria-pressed="false" autocomplete="off"'),'"},_getModalContent:function(){return this._getLayoutTemplate("modal").setTokens({rtl:this.rtl?" kv-rtl":"",zoomFrameClass:this.frameClass,prev:this._getZoomButton("prev"),next:this._getZoomButton("next"),rotate:this._getZoomButton("rotate"),toggleheader:this._getZoomButton("toggleheader"),fullscreen:this._getZoomButton("fullscreen"),borderless:this._getZoomButton("borderless"),close:this._getZoomButton("close")})},_listenModalEvent:function(e){var i=this,a=i.$modal;a.on(e+".bs.modal",function(r){if("bs.modal"===r.namespace){var n=a.find(".btn-fullscreen"),s=a.find(".btn-borderless");a.data("fileinputPluginId")===i.$element.attr("id")&&i._raise("filezoom"+e,function(e){return{sourceEvent:e,previewId:a.data("previewId"),modal:a}}(r)),"shown"===e&&(i._handleRotation(a,a.find(".file-zoom-detail"),a.data("angle")),s.removeClass("active").attr("aria-pressed","false"),n.removeClass("active").attr("aria-pressed","false"),a.hasClass("file-zoom-fullscreen")&&(i._maximizeZoomDialog(),t.checkFullScreen()?n.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.$modal,r=a.data("previewId")||"",n=this.getFrames().toArray(),s=n.length,o=a.find(".btn-kv-prev"),l=a.find(".btn-kv-next");a.find(".btn-kv-rotate");if(n.length<2)return o.hide(),void l.hide();o.show(),l.show(),s&&(t=e(n[0]),i=e(n[s-1]),o.removeAttr("disabled"),l.removeAttr("disabled"),this.reversePreviewOrder&&([o,l]=[l,o]),t.length&&t.attr("id")===r&&o.attr("disabled",!0),i.length&&i.attr("id")===r&&l.attr("disabled",!0))},_maximizeZoomDialog:function(){var t=this.$modal,i=t.find(".modal-header:visible"),a=t.find(".modal-footer:visible"),r=t.find(".kv-zoom-body"),n=e(window).height();t.addClass("file-zoom-fullscreen"),i&&i.length&&(n-=i.outerHeight(!0)),a&&a.length&&(n-=a.outerHeight(!0)),r&&r.length&&(n-=r.outerHeight(!0)-r.height()),t.find(".kv-zoom-body").height(n)},_resizeZoomDialog:function(e){var i=this.$modal,a=i.find(".btn-kv-fullscreen"),r=i.find(".btn-kv-borderless");if(i.hasClass("file-zoom-fullscreen"))t.toggleFullScreen(!1),e?a.hasClass("active")||(i.removeClass("file-zoom-fullscreen"),this._resizeZoomDialog(!0),r.hasClass("active")&&r.removeClass("active").attr("aria-pressed","false")):a.hasClass("active")?a.removeClass("active").attr("aria-pressed","false"):(i.removeClass("file-zoom-fullscreen"),this.$modal.find(".kv-zoom-body").css("height",this.zoomModalHeight));else{if(!e)return void this._maximizeZoomDialog();t.toggleFullScreen(!0)}i.focus()},_setZoomContent:function(i,a){var r,n,s,o,l,d,c,u,f,p,h,m,g=this,v=i.attr("id"),w=g._getZoom(v),b=g.$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),m=w.html().replace(g.zoomPlaceholder,"").setTokens({zoomData:y}),w.html(m),i.data("zoom",""),w.attr("data-zoom",y)),n=w.attr("data-template")||"generic",s=(r=w.find(".kv-file-content")).length?r.html():"",p=i.data("caption")||g.msgZoomModalHeading,h=i.data("size")||"",u=i.data("description")||"",b.find(".kv-zoom-caption").attr("title",p).html(p),b.find(".kv-zoom-size").html(h),f=b.find(".kv-zoom-description").hide(),u&&(g.showDescriptionClose&&(u=g._getLayoutTemplate("descriptionClose").setTokens({closeIcon:g.previewZoomButtonIcons.close})+""+u),f.show().html(u),g.showDescriptionClose&&g._handler(b.find(".kv-desc-hide"),"click",function(){e(this).parent().fadeOut("fast",function(){b.focus()})})),o=b.find(".kv-zoom-body"),b.removeClass("kv-single-content"),a?(c=o.addClass("file-thumb-loading").clone().insertAfter(o),t.setHtml(o,s).hide(),c.fadeOut("fast",function(){o.fadeIn("fast",function(){o.removeClass("file-thumb-loading")}),c.remove()})):t.setHtml(o,s),(d=g.previewZoomSettings[n])&&(l=o.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",v),g._handler(b.find(".btn-kv-prev"),"click",function(){g._zoomSlideShow("prev",v)}),g._handler(b.find(".btn-kv-next"),"click",function(){g._zoomSlideShow("next",v)}),g._handler(_,"click",function(){g._resizeZoomDialog(!0)}),g._handler(C,"click",function(){g._resizeZoomDialog(!1)}),g._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=g.$modal.find(".kv-zoom-body"),a=g.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()}),g._handler(b,"keydown",function(t){var i,a,r=t.which||t.keyCode,n=g.processDelay+1,s=e(this).find(".btn-kv-prev"),o=e(this).find(".btn-kv-next"),l=e(this).data("previewId");[i,a]=g.rtl?[39,37]:[37,39],e.each({prev:[s,i],next:[o,a]},function(e,t){var i=t[0],a=t[1];r===a&&i.length&&(b.focus(),i.attr("disabled")||(i.blur(),setTimeout(function(){i.focus(),g._zoomSlideShow(e,l),setTimeout(function(){i.attr("disabled")&&b.focus()},n)},n)))})})},_showModal:function(e){var i,a,r=this.$modal;e&&e.length&&(t.initModal(r),t.setHtml(r,this._getModalContent()),this._setZoomContent(e),r.removeClass("rotatable"),r.data({backdrop:!1,fileinputPluginId:this.$element.attr("id")}),r.find(".kv-zoom-body").css("height",this.zoomModalHeight),(i=e.find(".kv-file-content > :first-child")).length&&(a=i.css("transform"))&&r.find(".file-zoom-detail").css("transform",a),e.hasClass("rotatable")&&r.addClass("rotatable"),e.data("angle")&&r.data("angle",e.data("angle")),e.data("angle")||0,r.modal("show"),this._initZoomButtons(),this._initRotateZoom(e,i))},_zoomPreview:function(e){var i;if(!e.length)throw"Cannot zoom to detailed preview!";i=e.closest(t.FRAMES),this._showModal(i)},_zoomSlideShow:function(t,i){var a,r,n,s,o,l,d=this.$modal,c=d.find(".kv-zoom-actions .btn-kv-"+t),u=this.getFrames().toArray(),f=[],p=u.length;if(this.reversePreviewOrder&&(t="prev"===t?"next":"prev"),!c.attr("disabled")){for(r=0;r=p||!f[s]||((a=e(f[s])).length&&this._setZoomContent(a,t),this._initZoomButtons(),a.length&&a.hasClass("rotatable")?(o=a.data("angle")||0,d.addClass("rotatable").data("angle",o),l=a.find(".kv-file-content > :first-child"),this._initRotateZoom(a,l)):d.removeClass("rotatable").removeData("angle"),this._raise("filezoom"+t,{previewId:i,modal:this.$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;(this._inputFileCount()||this.isAjaxUpload)&&this.showPreview&&this.isPreviewable&&(this.isAjaxUpload&&this.fileManager.count()>0?(t=e.extend(!0,[],this.getFileList()),this.fileManager.clear(),this._clearFileInput()):t=this.$element[0].files,t&&t.length&&this.readFiles(t))},_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.$element;this._inputFileCount()&&(t=r.closest("form"),i=e(document.createElement("form")),a=e(document.createElement("div")),r.before(a),t.length?t.after(i):a.after(i),i.append(r).trigger("reset"),a.before(r).remove(),i.remove())},_resetUpload:function(){this.uploadInitiated=!1,this.uploadStartTime=t.now(),this.uploadCache=[],this.$btnUpload.removeAttr("disabled"),this._setProgress(0),this._hideProgress(),this._resetErrors(!1),this._initAjax(),this.fileManager.clearImages(),this._resetCanvas(),this.overwriteInitial&&(this.initialPreview=[],this.initialPreviewConfig=[],this.initialPreviewThumbTags=[],this.previewCache.data={content:[],config:[],tags:[]})},_resetCanvas:function(){this.imageCanvas&&this.imageCanvasContext&&this.imageCanvasContext.clearRect(0,0,this.imageCanvas.width,this.imageCanvas.height)},_hasInitialPreview:function(){return!this.overwriteInitial&&this.previewCache.count(!0)},_resetPreview:function(){var i,a,r,n=this.showUploadedThumbs,s=!this.removeFromPreviewOnError,o=(n||s)&&this.isDuplicateError;this.previewCache.count(!0)?(i=this.previewCache.out(),o&&(r=t.createElement("").insertAfter(this.$container),this.getFrames().each(function(){var t=e(this);(n&&t.hasClass("file-preview-success")||s&&t.hasClass("file-preview-error"))&&r.append(t)})),this._setPreviewContent(i.content),this._setInitThumbAttr(),a=this.initialCaption?this.initialCaption:i.caption,this._setCaption(a),o&&(r.contents().appendTo(this.$preview),r.remove())):(this._clearPreview(),this._initCaption()),this.showPreview&&(this._initZoom(),this._initSortable()),this.isDuplicateError=!1},_clearDefaultPreview:function(){this.$preview.find(".file-default-preview").remove()},_validateDefaultPreview:function(){this.showPreview&&!t.isEmpty(this.defaultPreviewContent)&&(this._setPreviewContent('
    '+this.defaultPreviewContent+"
    "),this.$container.removeClass("file-input-new"),this._initClickable())},_resetPreviewThumbs:function(e){var t;if(e)return this._clearPreview(),void this.clearFileStack();this._hasInitialPreview()?(t=this.previewCache.out(),this._setPreviewContent(t.content),this._setInitThumbAttr(),this._setCaption(t.caption),this._initPreviewActions()):this._clearPreview()},_getLayoutTemplate:function(e){var i=this.layoutTemplates[e];return t.isEmpty(this.customLayoutTags)?i:t.replaceTags(i,this.customLayoutTags)},_getPreviewTemplate:function(e){var i=this.previewTemplates,a=i[e]||i.other;return t.isEmpty(this.customPreviewTags)?a:t.replaceTags(a,this.customPreviewTags)},_getOutData:function(e,t,i,a){return t=t||{},i=i||{},{formdata:e,files:a=a||this.fileManager.list(),filenames:this.filenames,filescount:this.getFilesCount(),extra:this._getExtraData(),response:i,reader:this.reader,jqXHR:t}},_getMsgSelected:function(e,t){var i=1===e?this.fileSingle:this.filePlural;return e>0?this.msgSelected.replace("{n}",e).replace("{files}",i):t?this.msgProcessing:this.msgNoFilesSelected},_getFrame:function(e,i){var a=t.getFrameElement(this.$preview,e);return!this.showPreview||i||a.length||this._log(t.logMessages.invalidThumb,{id:e}),a},_getZoom:function(e,i){var a=t.getZoomElement(this.$preview,e,i);return this.showPreview&&!a.length&&this._log(t.logMessages.invalidThumb,{id:e}),a},_getThumbs:function(e){return e=e||"",this.getFrames(":not(.file-preview-initial)"+e)},_getThumbId:function(e){return this.previewInitId+"-"+e},_getExtraData:function(e,t){var i=this.uploadExtraData;return"function"==typeof this.uploadExtraData&&(i=this.uploadExtraData(e,t)),i},_initXhr:function(e,i){var a=this,r=a.fileManager,n=function(e){var n=0,s=e.total,o=e.loaded||e.position,l=r.getUploadStats(i,o,s);e.lengthComputable&&!a.enableResumableUpload&&(n=t.round(o/s*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(){this._ajaxSettings=e.extend(!0,{},this.ajaxSettings),this._ajaxDeleteSettings=e.extend(!0,{},this.ajaxDeleteSettings)},_mergeAjaxCallback:function(e,t,i){var a,r=this._ajaxSettings,n=this.mergeAjaxCallbacks;"delete"===i&&(r=this._ajaxDeleteSettings,n=this.mergeAjaxDeleteCallbacks),a=r[e],r[e]=n&&"function"==typeof a?"before"===n?function(){a.apply(this,arguments),t.apply(this,arguments)}:function(){t.apply(this,arguments),a.apply(this,arguments)}:t},_ajaxSubmit:function(t,i,a,r,n,s,o,l){var d,c,u,f=this,p=f.taskManager;f._raise("filepreajax",[n,s,o])&&(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),"function"==typeof(l=l||f.uploadUrlThumb||f.uploadUrl)&&(l=l()),"object"==typeof(u=f._getExtraData(s,o)||{})&&e.each(u,function(e,t){n.append(e,t)}),c={xhr:function(){var t=e.ajaxSettings.xhr();return f._initXhr(t,s)},url:f._encodeURI(l),type:"POST",dataType:"json",data:n,cache:!1,processData:!1,contentType:!1},d=e.extend(!0,{},c,f._ajaxSettings),f.ajaxQueue.push(d),p.addTask(s+"-"+o,function(){var t,i,a=this.self;t=a.ajaxQueue.shift(),i=e.ajax(t),a.ajaxRequests.push(i)}).runWithContext({self:f}))},_mergeArray:function(e,i){var a=t.cleanArray(this[e]),r=t.cleanArray(i);this[e]=a.concat(r)},_initUploadSuccess:function(i,a,r){var n,s,o,l,d,c,u,f,p,h=this;h.showPreview&&"object"==typeof i&&!e.isEmptyObject(i)?(void 0!==i.initialPreview&&i.initialPreview.length>0&&(h.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(h.initialPreviewDelimiter)),d.length&&(h._mergeArray("initialPreview",d),h._mergeArray("initialPreviewConfig",c),h._mergeArray("initialPreviewThumbTags",u)),void 0!==a?r?(f=a.attr("id"),null!==(p=h._getUploadCacheIndex(f))&&(h.uploadCache[p]={id:f,content:d[0],config:c[0]||[],tags:u[0]||[],append:n})):(o=h.previewCache.add(d[0],c[0],u[0],n),s=h.previewCache.get(o,!1),l=t.createElement(s).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"),h._initPreviewActions(),h._clearFileInput(),a.remove(),l.remove(),h._initSortable()})):(h.previewCache.set(d,c,u,n),h._initPreview(),h._initPreviewActions())),h._resetCaption()):h._resetCaption()},_getUploadCacheIndex:function(e){var t,i=this.uploadCache.length;for(t=0;t0||!e.isEmptyObject(b.uploadExtraData),P=b.ajaxOperations.uploadThumb,k=_.getFile(a),F={id:y,index:i,fileId:a},S=b.fileManager.getFileName(a,!0),I=function(){n&&n.resolve&&n.resolve()};b.enableResumableUpload||(b.uploadInitiated=!0,b.showPreview&&(o=_.getThumb(a),f=o.find(".file-thumb-progress"),d=o.find(".kv-file-upload"),c=o.find(".kv-file-remove"),f.show()),0===C||!T||b.showPreview&&d&&d.hasClass("disabled")||b._abort(F)||(w=function(){u?_.errors.push(a):_.removeFile(a),_.setProcessed(a),_.isProcessed()&&(b.fileBatchCompleted=!0,l())},l=function(){var e;b.fileBatchCompleted&&setTimeout(function(){var i=0===_.count(),a=_.errors.length;b._updateInitialPreview(),b.unlock(i),i&&b._clearFileInput(),e=b.$preview.find(".file-preview-initial"),b.uploadAsync&&e.length&&(t.addCss(e,t.SORT_CSS),b._initSortable()),b._raise("filebatchuploadcomplete",[_.stack,b._getExtraData()]),b.retryErrorUploads&&0!==a||_.clear(),b._setProgress(101),b.ajaxAborted=!1,b.uploadInitiated=!1},b.processDelay)},p=function(n){s=b._getOutData(x,n),_.initStats(a),b.fileBatchCompleted=!1,r||(b.ajaxAborted=!1),b.showPreview&&(o.hasClass("file-preview-success")||(b._setThumbStatus(o,"Loading"),t.addCss(o,"file-uploading")),d.attr("disabled",!0),c.attr("disabled",!0)),r||b.lock(),-1!==_.errors.indexOf(a)&&delete _.errors[a],b._raise("filepreupload",[s,y,i,b._getThumbFileId(o)]),e.extend(!0,F,s),b._abort(F)&&(n.abort(),r||(b._setThumbStatus(o,"New"),o.removeClass("file-uploading"),d.removeAttr("disabled"),c.removeAttr("disabled")),b._setProgressCancelled())},m=function(n,l,c){var p=b.showPreview&&o.attr("id")?o.attr("id"):y;s=b._getOutData(x,c,n),e.extend(!0,F,s),setTimeout(function(){t.isEmpty(n)||t.isEmpty(n.error)?(b.showPreview&&(b._setThumbStatus(o,"Success"),d.hide(),b._initUploadSuccess(n,o,r),b._setProgress(101,f)),b._raise("fileuploaded",[s,p,i,b._getThumbFileId(o)]),r?(w(),I()):b.fileManager.remove(o)):(u=!0,h=b._parseError(P,c,b.msgUploadError,b.fileManager.getFileName(a)),b._showFileError(h,F),b._setPreviewError(o,!0),b.retryErrorUploads||d.hide(),r&&(w(),I()),b._setProgress(101,b._getFrame(p).find(".file-thumb-progress"),b.msgUploadError))},b.processDelay)},g=function(){b.showPreview&&(d.removeAttr("disabled"),c.removeAttr("disabled"),o.removeClass("file-uploading")),r?l():(b.unlock(!1),b._clearFileInput()),b._initSuccessThumbs()},v=function(t,i,s){h=b._parseError(P,t,s,b.fileManager.getFileName(a)),u=!0,setTimeout(function(){var i;r&&(w(),n&&n.reject&&n.reject()),b.fileManager.setProgress(a,100),b._setPreviewError(o,!0),b.retryErrorUploads||d.hide(),e.extend(!0,F,b._getOutData(x,t)),b._setProgress(101,b.$progress,b.msgAjaxProgressError.replace("{operation}",P)),i=b.showPreview&&o?o.find(".file-thumb-progress"):"",b._setProgress(101,i,b.msgUploadError),b._showFileError(h,F)},b.processDelay)},b._setFileData(x,k.file,S,a),b._setUploadData(x,{fileId:a}),b._ajaxSubmit(p,m,g,v,x,a,i)))},_setFileData:function(e,t,i,a){var r=this.preProcessUpload;r&&"function"==typeof r?e.append(this.uploadFileAttr,r(a,t)):e.append(this.uploadFileAttr,t,i)},_checkBatchPreupload:function(t,i){var a=this;return!!a._raise("filebatchpreupload",[t])||(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,s,o,l=this,d=l.fileManager,c=d.total(),u=c>0||!e.isEmptyObject(l.uploadExtraData),f=new FormData,p=l.ajaxOperations.uploadBatch;if(0!==c&&u&&!l._abort({})){o=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]),o(),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)),s=l._parseError(p,r,l.msgUploadError),l._showFileError(s,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);s=l._parseError(p,t,a),l._showFileError(s,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}",p)))};var h=0;e.each(l.fileManager.stack,function(e,i){t.isEmpty(i.file)||l._setFileData(f,i.file,i.nameFmt||"untitled_"+h,e),h++}),l._ajaxSubmit(i,a,n,r,f)}},_uploadExtraOnly:function(){var e,i,a,r,n,s=this,o={},l=new FormData,d=s.ajaxOperations.uploadExtra;e=function(e){s.lock();var t=s._getOutData(l,e);s._setProgress(50),o.data=t,o.xhr=e,s._checkBatchPreupload(t,e)},i=function(e,i,a){var r=s._getOutData(l,a,e);t.isEmpty(e)||t.isEmpty(e.error)?(s._raise("filebatchuploadsuccess",[r]),s._clearFileInput(),s._initUploadSuccess(e),s._setProgress(101)):(n=s._parseError(d,a,s.msgUploadError),s._showFileError(n,r,"filebatchuploaderror"))},a=function(){s.unlock(),s._clearFileInput(),s._raise("filebatchuploadcomplete",[s.fileManager.stack,s._getExtraData()])},r=function(e,t,i){var a=s._getOutData(l,e);n=s._parseError(d,e,i),o.data=a,s._showFileError(n,a,"filebatchuploaderror"),s._setProgress(101,s.$progress,s.msgAjaxProgressError.replace("{operation}",d))},s._ajaxSubmit(e,i,a,r,l)},_deleteFileIndex:function(i){var a=i.attr("data-fileindex"),r=this.reversePreviewOrder;a.substring(0,5)===t.INIT_FLAG&&(a=parseInt(a.replace(t.INIT_FLAG,"")),this.initialPreview=t.spliceArray(this.initialPreview,a,r),this.initialPreviewConfig=t.spliceArray(this.initialPreviewConfig,a,r),this.initialPreviewThumbTags=t.spliceArray(this.initialPreviewThumbTags,a,r),this.getFrames().each(function(){var i=e(this),r=i.attr("data-fileindex");r.substring(0,5)===t.INIT_FLAG&&(r=parseInt(r.replace(t.INIT_FLAG,"")))>a&&(r--,i.attr("data-fileindex",t.INIT_FLAG+r))}))},_resetCaption:function(){var e=this;setTimeout(function(){var t,i,a,r="",n=e.previewCache.count(!0),s=e.fileManager.count(),o=e.showPreview&&e.getFrames(":not(.file-preview-success):not(.file-preview-error)").length;0!==s||0!==n||o?((t=n+s)>1?r=e._getMsgSelected(t):0===s?(r="",(a=e.initialPreviewConfig[0])&&(r=a.caption||a.filename||""),r||(r=e._getMsgSelected(t))):r=(i=e.fileManager.getFirstFile())?i.nameFmt:"_",e._setCaption(r)):e.reset()},e.processDelay)},_handleRotation:function(t,i,a){var r,n,s,o,l,d,c,u,f,p="",h=1,m=i[0],g=i.parent(),v=e("body"),w=!!v.length;w&&v.addClass("kv-overflow-hidden"),i.length&&!t.hasClass("hide-rotate")?((o=i.css("transform"))&&i.css("transform","none"),o&&i.css("transform",o),r="rotate("+(a=a||0)+"deg)",n="rotate("+(s=a%360)+"deg)",p="",90!==s&&270!==s||(h=(d=m.naturalWidth||i.outerWidth()||0)>(l=m.naturalHeight||i.outerHeight()||0)&&0!=d?(l/d).toFixed(2):1,g.length&&(u=g.height(),f=g.width(),u>h*(c=Math.min(d,f))&&(h=c>u&&0!=c?(u/c).toFixed(2):1)),1!==h&&(p=" scale("+h+")")),i.addClass("rotate-animate").css("transform",r+p),setTimeout(function(){i.removeClass("rotate-animate").css("transform",n+p),w&&v.removeClass("kv-overflow-hidden"),t.data("angle",s)},this.fadeDelay)):w&&v.removeClass("kv-overflow-hidden")},_initRotateButton:function(){var i=this;i.getFrames(".rotatable .kv-file-rotate").each(function(){var a=e(this),r=a.closest(t.FRAMES),n=r.find(".kv-file-content > :first-child");i._handler(a,"click",function(){var e=(r.data("angle")||0)+90;i._handleRotation(r,n,e)})})},_initRotateZoom:function(e,t){var i=this,a=i.$modal,r=a.find(".btn-kv-rotate"),n=e.data("angle");a.data("angle",n),r.length&&(r.off("click"),a.hasClass("rotatable")&&r.on("click",function(){n=(a.data("angle")||0)+90,a.data("angle",n),i._handleRotation(a,a.find(".file-zoom-detail"),n),i._handleRotation(e,t,n),e.hasClass("hide-rotate")&&e.data("angle",n)}))},_initFileActions:function(){var i=this;i.showPreview&&(i._initZoomButton(),i._initRotateButton(),i.getFrames(" .kv-file-remove").each(function(){var a,r=e(this),n=r.closest(t.FRAMES),s=n.attr("id"),o=n.attr("data-fileindex");i.fileManager;i._handler(r,"click",function(){if(!1===i._raise("filepreremove",[s,o])||!i._validateMinCount())return!1;a=n.hasClass("file-preview-error"),t.cleanMemory(n),n.fadeOut("slow",function(){i.fileManager.remove(n),i._clearObjects(n),n.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,o])})})}),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",s=i.fileActionSettings,o=s.removeClass,l=s.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(),i._initRotateButton(),a.find(n).each(function(){var a,n,s,c,u=e(this),f=u.data("url")||i.deleteUrl,p=u.data("key"),h=i.ajaxOperations.deleteThumb;if(!t.isEmpty(f)&&void 0!==p){"function"==typeof f&&(f=f());var m,g,v,w,b,_=u.closest(t.FRAMES),C=i.previewCache.data,x=_.attr("data-fileindex");x=parseInt(x.replace(t.INIT_FLAG,"")),v=t.isEmpty(C.config)&&t.isEmpty(C.config[x])?null:C.config[x],b=t.isEmpty(v)||t.isEmpty(v.extra)?r:v.extra,w=v&&(v.filename||v.caption)||"","function"==typeof b&&(b=b()),g={id:u.attr("id"),key:p,extra:b},n=function(e){i.ajaxAborted=!1,i._raise("filepredelete",[p,e,b]),i._abort()?e.abort():(u.removeClass(l),t.addCss(_,"file-uploading"),t.addCss(u,"disabled "+o))},s=function(e,r,n){var s,c;if(!t.isEmpty(e)&&!t.isEmpty(e.error))return g.jqXHR=n,g.response=e,a=i._parseError(h,n,i.msgDeleteError,w),i._showFileError(a,g,"filedeleteerror"),_.removeClass("file-uploading"),u.removeClass("disabled "+o).addClass(l),void d();_.removeClass("file-uploading").addClass("file-deleted"),_.fadeOut("slow",function(){x=parseInt(_.attr("data-fileindex").replace(t.INIT_FLAG,"")),i.previewCache.unset(x),i._deleteFileIndex(_),s=i.previewCache.count(!0),c=s>0?i._getMsgSelected(s):"",i._setCaption(c),i._raise("filedeleted",[p,n,b]),i._clearObjects(_),_.remove(),d()})},c=function(e,t,a){var r=i._parseError(h,e,a,w);g.jqXHR=e,g.response={},i._showFileError(r,g,"filedeleteerror"),_.removeClass("file-uploading"),u.removeClass("disabled "+o).addClass(l),d()},i._initAjaxSettings(),i._mergeAjaxCallback("beforeSend",n,"delete"),i._mergeAjaxCallback("success",s,"delete"),i._mergeAjaxCallback("error",c,"delete"),m=e.extend(!0,{},{url:i._encodeURI(f),type:"POST",dataType:"json",data:e.extend(!0,{},{key:p},b)},i._ajaxDeleteSettings),i._handler(u,"click",function(){if(!i._validateMinCount())return!1;i.ajaxAborted=!1,i._raise("filebeforedelete",[p,b]),i.ajaxAborted instanceof Promise?i.ajaxAborted.then(function(t){t||e.ajax(m)}):i.ajaxAborted||e.ajax(m)})}})},_hideFileIcon:function(){this.overwriteInitial&&this.$captionContainer.removeClass("icon-visible")},_showFileIcon:function(){t.addCss(this.$captionContainer,"icon-visible")},_getSize:function(t,i,a){var r,n,s=parseFloat(t),o=0,l=this.bytesToKB,d=this.fileSizeGetter,c=s;if(!e.isNumeric(t)||!e.isNumeric(s))return"";if("function"==typeof d)r=d(s);else{if(a||(a=this.sizeUnits),s>0){for(;c>=l;)c/=l,++o;a[o]||(c=s,o=0)}(n=c.toFixed(2))==c&&(n=c),r=n+" "+a[o]}return i?r:this._getLayoutTemplate("size").replace("{sizeText}",r)},_getFileType:function(e){return this.mimeTypeAliases[e]||e},_generatePreviewTemplate:function(i,a,r,n,s,o,l,d,c,u,f,p,h,m,g){var v,w,b,_,C=this,x=C.slug(r),y="",T="",P=c||r,k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,F=x,S=x,I="type-default",E=f||C._renderFileFooter(i,x,d,"auto",l),A=C.preferIconicPreview,z=C.preferIconicZoomPreview,D=A?"other":i,j=P.split(".").pop().toLowerCase();return(v=k<400?C.previewSettingsSmall[D]||C.defaults.previewSettingsSmall[D]:C.previewSettings[D]||C.defaults.previewSettings[D])&&e.each(v,function(e,t){T+=e+":"+t+";"}),w=function(a,l,d,c,f){var g,v=d?"zoom-"+s:s,w=C._getPreviewTemplate(a),b=(u||"")+" "+c;return C.frameClass&&(b=C.frameClass+" "+b),d&&(b=b.replace(" "+t.SORT_CSS,"")),w=C._parseFilePreviewIcon(w,r),"object"!==i||n||e.each(C.defaults.fileTypeSettings,function(e,t){"object"!==e&&"other"!==e&&t(r,n)&&(I="type-"+e)}),t.isEmpty(m)||(void 0!==m.title&&null!==m.title&&(F=m.title),void 0!==m.alt&&null!==m.alt&&(S=F=m.alt)),g={previewId:v,caption:x,title:F,alt:S,frameClass:b,type:C._getFileType(n),fileindex:p,fileid:o||"",filename:P,typeCss:I,footer:E,data:d&&f?C.zoomPlaceholder+"{zoomData}":l,template:h||i,style:T?'style="'+T+'"':"",zoomData:f?encodeURIComponent(f):""},d&&(g.zoomCache="",g.zoomData="{zoomData}"),w.setTokens(g)},p=p||s.slice(s.lastIndexOf("-")+1),_=C.fileActionSettings.showRotate&&-1!==e.inArray(j,C.rotatableFileExtensions),C.fileActionSettings.showZoom&&(b="kv-zoom-thumb",_&&(b+=" rotatable"+(z?" hide-rotate":"")),y=w(z?"other":i,a,!0,b,g)),y="\n"+C._getLayoutTemplate("zoomCache").replace("{zoomContent}",y),"function"==typeof C.sanitizeZoomCache&&(y=C.sanitizeZoomCache(y)),b="kv-preview-thumb",_&&(b+=" rotatable"+(A||C.hideThumbnailContent?" hide-rotate":"")),w(A?"other":i,a,!1,b,g).setTokens({zoomCache:y})},_addToPreview:function(e,i){var a;return i=t.cspBuffer.stash(i),a=this.reversePreviewOrder?e.prepend(i):e.append(i),t.cspBuffer.apply(e),a},_previewDefault:function(e,i){var a=this.$preview;if(this.showPreview){var r,n=t.getFileName(e),s=e?e.type:"",o=e.size||0,l=this._getFileName(e,""),d=!0===i&&!this.isAjaxUpload,c=t.createObjectURL(e),u=this.fileManager.getId(e),f=this._getThumbId(u);this._clearDefaultPreview(),r=this._generatePreviewTemplate("other",c,n,s,f,u,d,o),this._addToPreview(a,r),this._setThumbAttr(f,l,o),!0===i&&this.isAjaxUpload&&this._setThumbStatus(this._getFrame(f),"Error")}},_previewFile:function(e,i,a,r,n){if(this.showPreview){var s,o=t.getFileName(i),l=n.type,d=n.name,c=this._parseFileType(l,o),u=this.$preview,f=i.size||0,p="image"===c?a.target.result:r,h=this.fileManager.getId(i),m=this._getThumbId(h);s=this._generatePreviewTemplate(c,p,o,l,m,h,!1,f,n.filename),this._clearDefaultPreview(),this._addToPreview(u,s);var g=this._getFrame(m);this._validateImageOrientation(g.find("img"),i,m,h,d,l,f,p),this._setThumbAttr(m,d,f),this._initSortable()}},_setThumbAttr:function(e,t,i,a){var r=this._getFrame(e);r.length&&(i=i&&i>0?this._getSize(i):"",r.data({caption:t,size:i,description:a||""}))},_setInitThumbAttr:function(){var e,i,a,r,n,s=this.previewCache.data,o=this.previewCache.count(!0);if(0!==o)for(var l=0;l&"']/g,"_")},_updateFileDetails:function(e){var i,a,r,n,s=this.$element,o=t.isIE(9)&&t.findFileName(s.val())||s[0].files[0]&&s[0].files[0].name;i=!o&&this.fileManager.count()>0?this.fileManager.getFirstFile().nameFmt:o?this.slug(o):"_",a=this.isAjaxUpload?this.fileManager.count():e,n=this.previewCache.count(!0)+a,r=1===a?i:this._getMsgSelected(n,!this.isAjaxUpload&&!this.isError),this.isError?(this.$previewContainer.removeClass("file-thumb-loading"),this._initCapStatus(),this.$previewStatus.html(""),this.$captionContainer.removeClass("icon-visible")):this._showFileIcon(),this._setCaption(r,this.isError),this.$container.removeClass("file-input-new file-input-ajax-new"),this._raise("fileselect",[e,i]),this.previewCache.count(!0)&&this._initPreviewActions()},_setThumbStatus:function(e,i){if(this.showPreview){var a="indicator"+i,r=a+"Title",n="file-preview-"+i.toLowerCase(),s=e.find(".file-upload-indicator"),o=this.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,o[a]),s.attr("title",o[r]),e.addClass(n),"Error"!==i||this.retryErrorUploads||e.find(".kv-file-upload").attr("disabled",!0)}},_setProgressCancelled:function(){this._setProgress(101,this.$progress,this.msgCancelled)},_setProgress:function(e,i,a,r){if((i=i||this.$progress).length){var n,s=Math.min(e,100),o=this.progressUploadThreshold,l=e<=100?this.progressTemplate:this.progressCompleteTemplate,d=s<100?this.progressTemplate:a?this.paused?this.progressPauseTemplate:this.progressErrorTemplate:l;e>=100&&(r=""),t.isEmpty(d)||(r=r||"",n=(n=o&&s>o&&e<=100?d.setTokens({percent:o,status:this.msgUploadThreshold}):d.setTokens({percent:s,status:e>100?this.msgUploadEnd:s+"%"})).setTokens({stats:r}),t.setHtml(i,n),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.$container.find(".file-drop-zone"),a=this.dropZoneTitle;this.isClickable&&(e=t.isEmpty(this.$element.attr("multiple"))?this.fileSingle:this.filePlural,a+=this.dropZoneClickTitle.replace("{files}",e)),i.find("."+this.dropZoneTitleClass).remove(),!this.showPreview||0===i.length||this.fileManager.count()>0||!this.dropZoneEnabled||this.previewCache.count()>0||!this.isAjaxUpload&&this._hasFiles()||(0===i.find(t.FRAMES).length&&t.isEmpty(this.defaultPreviewContent)&&i.prepend('
    '+a+"
    "),this.$container.removeClass("file-input-new"),t.addCss(this.$container,"file-input-ajax-new"))},_getStats:function(e){var i,a;return this.showUploadStats&&e&&e.bitrate?(a=this._getLayoutTemplate("stats"),i=e.elapsed&&e.bps?this.msgPendingTime.setTokens({time:t.getElapsed(Math.ceil(e.pendingBytes/e.bps))}):this.msgCalculatingTime,a.setTokens({uploadSpeed:e.bitrate,pendingTime:i})):""},_setResumableProgress:function(e,t,i){var a=this.resumableManager,r=i?a:this,n=i?i.find(".file-thumb-progress"):null;0===r.lastProgress&&(r.lastProgress=e),e0&&this._getFileCount(e-1)=c:l<=c)||(o=this["msgImage"+i+e]||'Image "{name}" has a size validation error (limit "{size}").',this._showFileError(o.setTokens({name:n,size:c,dimension:l}),s),this._setPreviewError(r),this.fileManager.remove(r),this._clearFileInput(),!1))},_getExifObj:function(e){var i,a=t.logMessages.exifWarning;if("data:image/jpeg;base64,"===e.slice(0,23)||"data:image/jpg;base64,"===e.slice(0,22)){try{i=window.piexif?window.piexif.load(e):null}catch(e){i=null,a=e&&e.message||""}return!i&&this.showExifErrorLog&&this._log(t.logMessages.badExifParser,{details:a}),i}i=null},setImageOrientation:function(i,a,r,n){var s,o,l,d=this,c=!i||!i.length,u=!a||!a.length,f=!1,p=c&&n&&"image"===n.attr("data-template");c&&u||(l="load.fileinputimageorient",p?(i=a,a=null,i.css(d.previewSettings.image),o=e(document.createElement("div")).appendTo(n.find(".kv-file-content")),s=e(document.createElement("span")).insertBefore(i),i.css("visibility","hidden").removeClass("file-zoom-detail").appendTo(o)):f=!i.is(":visible"),i.off(l).on(l,function(){f&&(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,h=t.getRotation(r);if(f&&(n.find(".kv-file-content").css("visibility","visible"),d.$preview.addClass("hide-content")),i.data("orientation",r),l&&a.data("orientation",r),r<5)return t.setTransform(e,h),void t.setTransform(l,h);var m=Math.atan(u/c),g=Math.sqrt(Math.pow(c,2)+Math.pow(u,2)),v=g?c/Math.cos(Math.PI/2+m)/g:1,w=" scale("+Math.abs(v)+")";t.setTransform(e,h+w),t.setTransform(l,h+w),p&&(i.css("visibility","visible").insertAfter(s).addClass("file-zoom-detail"),s.remove(),o.remove())}))},_validateImageOrientation:function(i,a,r,n,s,o,l,d){var c,u,f,p=this.autoOrientImage;if(c=this._getExifObj(d),this.canOrientImage)return i.css("image-orientation",p?"from-image":"none"),void this._validateImage(r,n,s,o,l,d,c);f=t.getZoomSelector(r," img"),(u=c?c["0th"][piexif.ImageIFD.Orientation]:null)?(this.setImageOrientation(i,e(f),u,this._getFrame(r)),this._raise("fileimageoriented",{$img:i,file:a}),this._validateImage(r,n,s,o,l,d,c)):this._validateImage(r,n,s,o,l,d,c)},_validateImage:function(e,t,i,a,r,n,s){var o,l,d,c=this,u=c.$preview,f=c._getFrame(e),p=f.attr("data-fileindex"),h=f.find("img");i=i||"Untitled",h.one("load",function(){h.data("validated")||(h.data("validated",!0),l=f.width(),d=u.width(),l>d&&h.css("width","100%"),o={ind:p,id:e,fileId:t},setTimeout(function(){var l,d;l=c._isValidSize("Small","Width",h,f,i,o),d=c._isValidSize("Small","Height",h,f,i,o),c.resizeImage||(l=l&&c._isValidSize("Large","Width",h,f,i,o),d=d&&c._isValidSize("Large","Height",h,f,i,o)),c._raise("fileimageloaded",[e]),f.data("exif",s),l&&d&&(c.fileManager.addImage(t,{ind:p,img:h,thumb:f,pid:e,typ:a,siz:r,validated:!1,imgData:n,exifObj:s}),c._validateAllImages())},c.processDelay))}).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,s){s.validated||((t=s.siz)&&t>n*i.bytesToKB&&i._getResizedImage(e,s,a,r),s.validated=!0)}))},_getResizedImage:function(i,a,r,n){var s,o,l,d,c,u,f,p,h,m=this,g=e(a.img)[0],v=g.naturalWidth,w=g.naturalHeight,b=1,_=m.maxImageWidth||v,C=m.maxImageHeight||w,x=!(!v||!w),y=m.imageCanvas,T=m.imageCanvasContext,P=a.typ,k=a.pid,F=a.ind,S=a.thumb,I=a.exifObj;if(c=function(e,t,i){m.isAjaxUpload?m._showFileError(e,t,i):m._showError(e,t,i),m._setPreviewError(S)},p={id:k,index:F,fileId:i},h=[i,k,F],(f=m.fileManager.getFile(i))&&x&&!(v<=_&&w<=C)||(x&&f&&m._raise("fileimageresized",h),r.val++,r.val===n&&m._raise("fileimagesresized"),x)){P=P||m.resizeDefaultImageType,o=v>_,l=w>C,b="width"===m.resizePreference?o?_/v:l?C/w:1:l?C/w:o?_/v:1,m._resetCanvas(),v*=b,w*=b,y.width=v,y.height=w;try{T.drawImage(g,0,0,v,w),d=y.toDataURL(P,m.resizeQuality),I&&(u=window.piexif.dump(I),d=window.piexif.insert(u,d)),s=t.dataURI2Blob(d),m.fileManager.setFile(i,s),m._raise("fileimageresized",h),r.val++,r.val===n&&m._raise("fileimagesresized",[void 0,void 0]),s instanceof Blob||c(m.msgImageResizeError,p,"fileimageresizeerror")}catch(e){r.val++,r.val===n&&m._raise("fileimagesresized",[void 0,void 0]),c(m.msgImageResizeException.replace("{errors}",e.message),p,"fileimageresizeexception")}}else c(m.msgImageResizeError,p,"fileimageresizeerror")},_showProgress:function(){this.$progress&&this.$progress.length&&this.$progress.show()},_hideProgress:function(){this.$progress&&this.$progress.length&&this.$progress.hide()},_initBrowse:function(e){var i=this.$element;this.showBrowse?this.$btnFile=e.find(".btn-file").append(i):(i.appendTo(e).attr("tabindex",-1),t.addCss(i,"file-no-browse"))},_initClickable:function(){var i,a,r=this;r.isClickable&&(i=r.$dropZone,r.isAjaxUpload||(a=r.$preview.find(".file-default-preview")).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.initialCaption||"";return this.overwriteInitial||t.isEmpty(e)?(this.$caption.val(""),!1):(this._setCaption(e),!0)},_setCaption:function(i,a){var r,n,s,o,l,d;if(this.$caption.length){if(this.$captionContainer.removeClass("icon-visible"),a)r=e("
    "+this.msgValidationError+"
    ").text(),(o=this.fileManager.count())?(d=this.fileManager.getFirstFile(),l=1===o&&d?d.nameFmt:this._getMsgSelected(o)):l=this._getMsgSelected(this.msgNo),n=t.isEmpty(i)?l:i,s=''+this.msgValidationErrorIcon+"";else{if(t.isEmpty(i))return void this.$caption.attr("title","");n=r=e("
    "+i+"
    ").text(),s=this._getLayoutTemplate("fileIcon")}this.$captionContainer.addClass("icon-visible"),this.$caption.attr("title",r).val(n),t.setHtml(this.$captionIcon,s)}},_createContainer:function(){var e={class:"file-input file-input-new"+(this.rtl?" kv-rtl":"")},i=t.createElement(t.cspBuffer.stash(this._renderMain()));return t.cspBuffer.apply(i),i.insertBefore(this.$element).attr(e),this._initBrowse(i),this.theme&&i.addClass("theme-"+this.theme),i},_refreshContainer:function(){var e=this.$container;this.$element.insertAfter(e),t.setHtml(e,this._renderMain()),this._initBrowse(e),this._validateDisabled()},_validateDisabled:function(){this.$caption.attr({readonly:this.isDisabled})},_setTabIndex:function(e,t){var i=this.tabIndexConfig[e];return t.setTokens({tabIndexConfig:null==i?"":'tabindex="'+i+'"'})},_renderMain:function(){var e=this.dropZoneEnabled?" file-drop-zone":"file-drop-disabled",t=this.showClose?this._getLayoutTemplate("close"):"",i=this.showPreview?this._getLayoutTemplate("preview").setTokens({class:this.previewClass,dropClass:e}):"",a=this.isDisabled?this.captionClass+" file-caption-disabled":this.captionClass,r=this.captionTemplate.setTokens({class:a+" kv-fileinput-caption"});return r=this._setTabIndex("caption",r),this.mainTemplate.setTokens({class:this.mainClass+(!this.showBrowse&&this.showCaption?" no-browse":""),inputGroupClass:this.inputGroupClass,preview:i,close:t,caption:r,upload:this._renderButton("upload"),remove:this._renderButton("remove"),cancel:this._renderButton("cancel"),pause:this._renderButton("pause"),browse:this._renderButton("browse")})},_renderButton:function(e){var i=this._getLayoutTemplate("btnDefault"),a=this[e+"Class"],r=this[e+"Title"],n=this[e+"Icon"],s=this[e+"Label"],o=this.isDisabled?" disabled":"",l="button";switch(e){case"remove":if(!this.showRemove)return"";break;case"cancel":if(!this.showCancel)return"";a+=" kv-hidden";break;case"pause":if(!this.showPause)return"";a+=" kv-hidden";break;case"upload":if(!this.showUpload)return"";this.isAjaxUpload&&!this.isDisabled?i=this._getLayoutTemplate("btnLink").replace("{href}",this.uploadUrl):l="submit";break;case"browse":if(!this.showBrowse)return"";i=this._getLayoutTemplate("btnBrowse");break;default:return""}return i=this._setTabIndex(e,i),a+="browse"===e?" btn-file":" fileinput-"+e+" fileinput-"+e+"-button",t.isEmpty(s)||(s=' '+s+""),i.setTokens({type:l,css:a,title:r,status:o,icon:n,label:s})},_renderThumbProgress:function(){return'
    '+this.progressInfoTemplate.setTokens({percent:101,status:this.msgUploadBegin,stats:""})+"
    "},_renderFileFooter:function(e,i,a,r,n){var s,o,l=this.fileActionSettings,d=l.showRemove,c=l.showDrag,u=l.showUpload,f=l.showRotate,p=l.showZoom,h=this._getLayoutTemplate("footer"),m=this._getLayoutTemplate("indicator"),g=n?l.indicatorError:l.indicatorNew,v=n?l.indicatorErrorTitle:l.indicatorNewTitle,w=m.setTokens({indicator:g,indicatorTitle:v});return o={type:e,caption:i,size:a=this._getSize(a),width:r,progress:"",indicator:w},this.isAjaxUpload?(o.progress=this._renderThumbProgress(),o.actions=this._renderFileActions(o,u,!1,d,f,p,c,!1,!1,!1)):o.actions=this._renderFileActions(o,!1,!1,!1,!1,p,c,!1,!1,!1),s=h.setTokens(o),s=t.replaceTags(s,this.previewThumbTags)},_renderFileActions:function(e,t,i,a,r,n,s,o,l,d,c,u,f){if(!e.type&&c&&(e.type="image"),this.enableResumableUpload?t=!1:"function"==typeof t&&(t=t(e)),"function"==typeof i&&(i=i(e)),"function"==typeof a&&(a=a(e)),"function"==typeof n&&(n=n(e)),"function"==typeof s&&(s=s(e)),"function"==typeof r&&(r=r(e)),!(t||i||a||r||n||s))return"";var p,h=!1===l?"":' data-url="'+l+'"',m="",g="",v="",w=!1===d?"":' data-key="'+d+'"',b="",_="",C="",x=this._getLayoutTemplate("actions"),y=this.fileActionSettings,T=this.otherActionButtons.setTokens({dataKey:w,key:d}),P=o?y.removeClass+" disabled":y.removeClass;return a&&(b=this._getLayoutTemplate("actionDelete").setTokens({removeClass:P,removeIcon:y.removeIcon,removeTitle:y.removeTitle,dataUrl:h,dataKey:w,key:d})),r&&(v=this._getLayoutTemplate("actionRotate").setTokens({rotateClass:y.rotateClass,rotateIcon:y.rotateIcon,rotateTitle:y.rotateTitle})),t&&(_=this._getLayoutTemplate("actionUpload").setTokens({uploadClass:y.uploadClass,uploadIcon:y.uploadIcon,uploadTitle:y.uploadTitle})),i&&(C=(C=this._getLayoutTemplate("actionDownload").setTokens({downloadClass:y.downloadClass,downloadIcon:y.downloadIcon,downloadTitle:y.downloadTitle,downloadUrl:u||this.initialPreviewDownloadUrl})).setTokens({filename:f,key:d})),n&&(m=this._getLayoutTemplate("actionZoom").setTokens({zoomClass:y.zoomClass,zoomIcon:y.zoomIcon,zoomTitle:y.zoomTitle})),s&&c&&(p="drag-handle-init "+y.dragClass,g=this._getLayoutTemplate("actionDrag").setTokens({dragClass:p,dragTitle:y.dragTitle,dragIcon:y.dragIcon})),x.setTokens({delete:b,upload:_,download:C,rotate:v,zoom:m,drag:g,other:T})},_browse:function(e){e&&e.isDefaultPrevented()||!this._raise("filebrowse")||(this.isError&&!this.isAjaxUpload&&this.clear(),this.focusCaptionOnBrowse&&this.$captionContainer.focus())},_change:function(i){var a=this;if(e(document.body).off("focusin.fileinput focusout.fileinput"),a.changeTriggered)a._toggleLoading("hide");else{a._toggleLoading("show");var r,n,s,o,l=a.$element,d=arguments.length>1,c=a.isAjaxUpload,u=d?arguments[1]:l[0].files,f=a.fileManager.count(),p=t.isEmpty(l.attr("multiple")),h=!c&&p?1:a.maxFileCount,m=a.maxTotalFileCount,g=m>0&&m>h,v=p&&f>0,w=function(t,i,r){var n,s,o,l,d,f,p=r?a.msgTotalFilesTooMany:a.msgFilesTooMany;p=p.replace("{m}",i).replace("{n}",t),a.isError=(n=p,s=null,o=null,l=null,d=e.extend(!0,{},a._getOutData(null,{},{},u),{id:o,index:l}),f={id:o,index:l,file:s,files:u},a.isPersistentError=!0,a._toggleLoading("hide"),c?a._showFileError(n,d):a._showError(n,f)),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(),o=r.length,s=c?a.fileManager.count()+o:o,n=a._getFileCount(s,!g&&void 0),h>0&&n>h){if(!a.autoReplace||o>h)return void w(a.autoReplace&&o>h?o:n,h);n>h&&a._resetPreviewThumbs(c)}else{if(g&&(n=a._getFileCount(s,!0),m>0&&n>m)){if(!a.autoReplace||o>h)return void w(a.autoReplace&&o>m?o:n,m,!0);n>h&&a._resetPreviewThumbs(c)}!c||v?(a._resetPreviewThumbs(!1),v&&a.clearFileStack()):!c||0!==f||a.previewCache.count(!0)&&!a.overwriteInitial||a._resetPreviewThumbs(!0)}a.autoReplace&&a._getThumbs().each(function(){var t=e(this);(t.hasClass("file-preview-success")||t.hasClass("file-preview-error"))&&t.remove()}),a.readFiles(r),a._toggleLoading("hide")}},_abort:function(t){var i;return this.ajaxAborted&&"object"==typeof this.ajaxAborted&&void 0!==this.ajaxAborted.message?((i=e.extend(!0,{},this._getOutData(null),t)).abortData=this.ajaxAborted.data||{},i.abortMessage=this.ajaxAborted.message,this._setProgress(101,this.$progress,this.msgCancelled),this._showFileError(this.ajaxAborted.message,i,"filecustomerror"),this.cancel(),this.unlock(),!0):!!this.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){return e=e||0,this.required&&!this.getFilesCount()?(this.$errorContainer.html(""),this._showFileError(this.msgFileRequired),!1):!(this.minFileCount>0&&this._getFileCount(e)m)&&(i||a||r)},addToStack:function(e,t){this.stackIsUpdating=!0,this.fileManager.add(e,t),this._refreshPreview(),this.stackIsUpdating=!1},clearFileStack:function(){return this.fileManager.clear(),this._initResumableUpload(),this.enableResumableUpload?(null===this.showPause&&(this.showPause=!0),null===this.showCancel&&(this.showCancel=!1)):(this.showPause=!1,null===this.showCancel&&(this.showCancel=!0)),this.$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.isAjaxUpload?this.fileManager.count():this._inputFileCount();return e&&(t+=this.previewCache.count(!0)),this._getFileCount(t)},_initCapStatus:function(e){var t=this.$caption;t.removeClass("is-valid file-processing"),e&&("processing"===e?t.addClass("file-processing"):t.addClass("is-valid"))},_toggleLoading:function(e){this.$previewStatus.html("hide"===e?"":this.msgProcessing),this.$container.removeClass("file-thumb-loading"),this._initCapStatus("hide"===e?"":"processing"),"hide"!==e&&(this.dropZoneEnabled&&this.$container.find(".file-drop-zone ."+this.dropZoneTitleClass).remove(),this.$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._toggleLoading("show")}).on("focusin.fileinput",function(){setTimeout(function(){i.val()||(t._toggleLoading("hide"),t._setFileDropZoneTitle()),a.off(r)},2500)}):t._toggleLoading("hide")},readFiles:function(i){this.reader=new FileReader;var a,r=this,n=r.reader,s=r.$previewContainer,o=r.$previewStatus,l=r.msgLoading,d=r.msgProgress,c=r.previewInitId,u=i.length,f=r.fileTypeSettings,p=r.allowedFileTypes,h=p?p.length:0,m=r.allowedFileExtensions,g=t.isEmpty(m)?"":m.join(", "),v=function(t,n,s,o,l){var d,c=e.extend(!0,{},r._getOutData(null,{},{},i),{id:s,index:o,fileId:l}),f={id:s,index:o,fileId:l,file:n,files:i};r._previewDefault(n,!0),d=r._getFrame(s,!0),r._toggleLoading("hide"),r.isAjaxUpload?setTimeout(function(){a(o+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,f),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]),s.removeClass("file-thumb-loading"),r._initCapStatus("valid"),void o.html("");r.lock(!0);var x,y,T,P,k,F,S,I,E,A,z,D,j,$,U,M,R=i[w],B=R&&R.size||0,O=r._getSize(B,!0),L=f.image,N=B/r.bytesToKB,Z="",H=0,W="",V=!1,q=0;if(M=function(e){e=e||R,x=D=r._getFileId(R),y=c+"-"+x,z=t.createObjectURL(e),A=r._getFileName(R,"")},U=function(){var e=!!C.loadedImages[x],t=d.setTokens({index:w+1,files:u,percent:50,name:A});setTimeout(function(){o.html(t),r._updateFileDetails(u),r.getFilesCount(!0)>0&&r.getFrames(":visible")&&r.$dropZone.find("."+r.dropZoneTitleClass).remove(),a(w+1)},r.processDelay),r._raise("fileloaded",[R,y,x,w,n])&&r.isAjaxUpload?e||C.add(R):e&&C.removeFile(x)},R){if(M(),h>0)for(P=0;P0&&N>r.maxFileSize)return k=r.msgSizeTooLarge.setTokens({name:A,size:O,maxSize:r._getSize(r.maxFileSize*r.bytesToKB,!0)}),void v(k,R,y,w,D);if(null!==r.minFileSize&&N<=t.getNum(r.minFileSize))return k=r.msgSizeTooSmall.setTokens({name:A,size:O,minSize:r._getSize(r.minFileSize*r.bytesToKB,!0)}),void v(k,R,y,w,D);if(!t.isEmpty(p)&&t.isArray(p)){for(P=0;P0)for(t=0;t0)for(t=0;t0?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(){if(this._raise("filereset"))return this.lastProgress=0,this._resetPreview(),this.$container.find(".fileinput-filename").text(""),t.addCss(this.$container,"file-input-new"),this.getFrames().length&&this.$container.removeClass("file-input-new"),this.clearFileStack(),this._setFileDropZoneTitle(),this.$element},disable:function(){var e=this.$container;return this.isDisabled=!0,this._raise("filedisabled"),this.$element.attr("disabled","disabled"),e.addClass("is-locked"),t.addCss(e.find(".btn-file"),"disabled"),e.find(".kv-fileinput-caption").addClass("file-caption-disabled"),e.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").attr("disabled",!0),this._initDragDrop(),this.$element},enable:function(){var e=this.$container;return this.isDisabled=!1,this._raise("fileenabled"),this.$element.removeAttr("disabled"),e.removeClass("is-locked"),e.find(".kv-fileinput-caption").removeClass("file-caption-disabled"),e.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").removeAttr("disabled"),e.find(".btn-file").removeClass("disabled"),this._initDragDrop(),this.$element},upload:function(){var i,a,r=this,n=r.fileManager,s=n.count(),o=r.taskManager,l=!e.isEmptyObject(r._getExtraData());if(n.bpsLog=[],n.bps=0,r.isAjaxUpload&&!r.isDisabled&&r._isFileSelectionValid(s)){if(r.lastProgress=0,r._resetUpload(),0!==s||l){if(r.cancelling=!1,r.uploadInitiated=!0,r._showProgress(),r.lock(),0===s&&l)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()}if(r._setProgress(2),r.hasInitData=!1,r.uploadAsync){i=0;var d=r.ajaxPool=o.addPool(t.uniqId());return e.each(r.getFileStack(),function(e){d.addTask(e+i,function(t){r._uploadSingle(i,e,!0,t)}),i++}),void d.run(r.maxAjaxThreads).done(function(){r._log("Async upload batch completed successfully."),r._raise("filebatchuploadsuccess",[n.stack,r._getExtraData()])}).fail(function(){r._log("Async upload batch completed with errors."),r._raise("filebatchuploaderror",[n.stack,r._getExtraData()])})}return r._uploadBatch(),r.$element}r._showFileError(r.msgUploadEmpty)}},destroy:function(){var t=this.$form,i=this.$container,a=this.$element,r=this.namespace;return e(document).off(r),e(window).off(r),t&&t.length&&t.off(r),this.isAjaxUpload&&this._clearFileInput(),this._cleanup(),this._initPreviewCache(),a.insertBefore(i).off(r).removeData(),i.off().remove(),a},refresh:function(i){var a=this.$element;return i="object"!=typeof i||t.isEmpty(i)?this.options:e.extend(!0,{},this.options,i),this._init(i,!0),this._listen(),a},zoom:function(e){var t=this._getFrame(e);this._showModal(t)},getExif:function(e){var t=this._getFrame(e);return t&&t.data("exif")||null},getFrames:function(i){var a;return i=i||"",a=this.$preview.find(t.FRAMES+i),this.reversePreviewOrder&&(a=e(a.get().reverse())),a},getPreview:function(){return{content:this.initialPreview,config:this.initialPreviewConfig,tags:this.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 s,o=e(this),l=o.data("fileinput"),d="object"==typeof a&&a,c=d.theme||o.data("theme"),u={},f={},p=d.language||o.data("language")||e.fn.fileinput.defaults.language||"en";l||(c&&(f=e.fn.fileinputThemes[c]||{}),"en"===p||t.isEmpty(e.fn.fileinputLocales[p])||(u=e.fn.fileinputLocales[p]||{}),s=e.extend(!0,{},e.fn.fileinput.defaults,f,e.fn.fileinputLocales.en,u,d,o.data()),l=new i(this,s),o.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 a="btn btn-sm btn-kv "+t.defaultButtonCss(),r="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);return!(!!e.match(/iP(od|ad|hone)/i)&&t&&!e.match(/CriOS/i))},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:'',rotate:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewZoomButtonClasses:{prev:"btn btn-default btn-outline-secondary btn-navigate",next:"btn btn-default btn-outline-secondary btn-navigate",rotate:a,toggleheader:a,fullscreen:a,borderless:a,close:a},previewTemplates:{},previewContentTemplates:{},preferIconicPreview:!1,preferIconicZoomPreview:!1,rotatableFileExtensions:["jpg","jpeg","png","gif"],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:r,cancelIcon:'',cancelClass:r,pauseIcon:'',pauseClass:r,uploadIcon:'',uploadClass:r,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:485,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}) is too small and must be larger than {minSize}.',msgSizeTooLarge:'File "{name}" ({size}) exceeds maximum allowed upload size of {maxSize}.',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 (detected {dimension} px).',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px (detected {dimension} px).',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px (detected {dimension} px).',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px (detected {dimension} 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}" 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",rotate:"Rotate 90 deg. clockwise",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 +!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?e(require("jquery")):e(window.jQuery)}(function(e){"use strict";var t,i;e.fn.fileinputLocales={},e.fn.fileinputThemes={},e.fn.fileinputBsVersion||(e.fn.fileinputBsVersion=window.bootstrap&&window.bootstrap.Alert&&window.bootstrap.Alert.VERSION||window.Alert&&window.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))}),t={FRAMES:".kv-preview-thumb",SORT_CSS:"file-sortable",INIT_FLAG:"init-",SCRIPT_SRC:document&&document.currentScript&&document.currentScript.src||null,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,getZoomPlaceholder:function(){var e,i=t.SCRIPT_SRC,a="?kvTemp__2873389129__=";return i?(e=i.substring(0,i.lastIndexOf("/"))).substring(0,e.lastIndexOf("/")+1)+"img/loading.gif"+a:a},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;t0&&(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&&(10===e?new RegExp("msie\\s"+e,"i").test(navigator.userAgent):((t=document.createElement("div")).innerHTML="\x3c!--[if IE "+e+"]> 0&&e[0].webkitGetAsEntry())for(t=0;t=0?atob(e.split(",")[1]):decodeURIComponent(e.split(",")[1]),a=new ArrayBuffer(i.length),r=new Uint8Array(a),n=0;n>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(i);break;case 12:case 13:a=n[o++],s+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=n[o++],r=n[o++],s+=String.fromCharCode((15&i)<<12|(63&a)<<6|(63&r)<<0)}return s},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},isPdf:function(e){return!t.isEmpty(e)&&(0!==(e=e.toString().trim().replace(/\n/g," ")).length&&void 0)},isSvg:function(e){return!t.isEmpty(e)&&(0!==(e=e.toString().trim().replace(/\n/g," ")).length&&(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);return n.find("[style]").each(function(i,r){var n=e(r),s=n[0].style,o=t.uniqId(),l={};s&&s.length&&(e(s).each(function(){l[this]=s[this]}),a.domElementsStyles[o]=l,n.removeAttr("style").attr(a.CSP_ATTRIB,o))}),n.filter("*").removeAttr("style"),(Object.values?Object.values(r):Object.keys(r).map(function(e){return r[e]})).flatMap(function(e){return e.innerHTML}).join("")},apply:function(t){var i=this;e(t).find("["+i.CSP_ATTRIB+"]").each(function(t,a){var r=e(a),n=r.attr(i.CSP_ATTRIB),s=i.domElementsStyles[n];s&&r.css(s),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 s=a-n.length;1+s--;)n.push(void 0);return n.splice(a,0,n.splice(i,1)[0]),r&&n.reverse(),n},closeButton:function(e){return'"},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,s,o,l,d=[].slice,c=1===arguments.length&&t.isArray(i)?i:d.call(arguments),u=e.Deferred(),f=0,p=c.length,h=p;for(n=s=o=Array(p),l=function(e,t,i){return function(){i!==c&&f++,u.notifyWith(t[e]=this,i[e]=d.call(arguments)),--h||u[(f?"reject":"resolve")+"With"](t,i)}},a=0;a0&&l.maxTotalFileCount10?t-10:Math.ceil(t/2),e=t;e>i;e--)r=parseFloat(s.bpsLog[e]),a++;s.bps=64*(a>0?r/a:0)},u),n={fileId:e,started:o,elapsed:l,loaded:a,total:r,bps:s.bps,bitrate:i._getSize(s.bps,!1,i.bitRateUnits),pendingBytes:c},e?s.stats[e]=n:s.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,s=a.fileManager;if(a.enableResumableUpload)if(!1!==r.fallback&&"function"!=typeof r.fallback&&(r.fallback=function(e){e._log(n.noResumableSupport),e.enableResumableUpload=!1}),t.hasResumableUploadSupport()||!1===r.fallback){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=s.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,s,o){e.responseJSON&&e.responseJSON.error&&(s=e.responseJSON.error.toString()),o||(i.error=s),r.showErrorLog&&a._log(n.ajaxError,{status:e.status,error:s,text:e.responseText||""})},reset:function(){i.stack=[],i.chunksProcessed={}},setProcessed:function(t){var n,o,l=i.id,d=i.$thumb,c=i.$progress,u=d&&d.length,f={id:u?d.attr("id"):"",index:s.getIndex(l),fileId:l},p=a.resumableUploadOptions.skipErrorsAndProceed;i.completed=!0,i.lastProgress=0,u&&d.removeClass("file-uploading"),"success"===t?(s.uploadedSize+=i.file.size,a.showPreview&&(a._setProgress(101,c),a._setThumbStatus(d,"Success"),a._initUploadSuccess(i.chunksProcessed[l].data,d)),s.removeFile(l),delete i.chunksProcessed[l],a._raise("fileuploaded",[f.id,f.index,f.fileId]),s.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=!p),a.$errorContainer.find('li[data-file-id="'+f.fileId+'"]').length||(o={file:i.fileName,max:r.maxRetries,error:i.error},n=a.msgResumableUploadRetriesExceeded.setTokens(o),e.extend(f,o),a._showFileError(n,f,"filemaxretries"),p&&(s.removeFile(l),delete i.chunksProcessed[l],s.isProcessed()&&a._setProgress(101)))),s.isProcessed()&&i.reset()},check:function(){e.each(i.logs,function(e,t){if(!t)return!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=s.getIdList(),n="new";e=setInterval(function(){var o;if(i.checkAborted(e),"new"===n&&(a.lock(),n="processing",o=r.shift(),s.initStats(o),s.stack[o]&&(i.init(o,s.stack[o],s.getIndex(o)),i.processUpload())),!s.isPending(o)&&i.completed&&(n="new"),s.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,s=i.chunkCount;for(t=n.addPool(i.id),e=0;er.maxRetries)return g(h.resumableMaxRetriesReached,{n:r.maxRetries}),void i.setProcessed("error");var v,w,b,_,C,x,y=f[f.slice?"slice":f.mozSlice?"mozSlice":f.webkitSlice?"webkitSlice":"slice"](c*e,c*(e+1));v=new FormData,d=s.stack[u],a._setUploadData(v,{chunkCount:i.chunkCount,chunkIndex:e,chunkSize:c,chunkSizeStart:c*e,fileBlob:[y,i.fileName],fileId:u,fileName:i.fileName,fileRelativePath:d.relativePath,fileSize:f.size,retryCount:o}),i.$progress&&i.$progress.length&&i.$progress.show(),b=function(r){w=a._getOutData(v,r),a.showPreview&&(p.hasClass("file-preview-success")||(a._setThumbStatus(p,"Loading"),t.addCss(p,"file-uploading")),m.attr("disabled",!0)),a._raise("filechunkbeforesend",[u,e,o,s,i,w])},_=function(t,d,c){if(a._isAborted())g(h.resumableAborting);else{w=a._getOutData(v,c,t);var f=a.uploadParamNames.chunkIndex||"chunkIndex",p=[u,e,o,s,i,w];t.error?(r.showErrorLog&&a._log(n.retryStatus,{retry:o+1,filename:i.fileName,chunk:e}),a._raise("filechunkerror",p),i.pushAjax(e,o+1),i.error=t.error,g(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",p),i.check())}},C=function(t,r,n){a._isAborted()?g(h.resumableAborting):(w=a._getOutData(v,t),i.setAjaxError(t,r,n),a._raise("filechunkajaxerror",[u,e,o,s,i,w]),i.pushAjax(e,o+1),g(h.resumableRetryError,{n:o-1}))},x=function(){a._isAborted()||a._raise("filechunkcomplete",[u,e,o,s,i,a._getOutData(v)])},a._ajaxSubmit(b,_,x,C,v,u,i.fileIndex)}}}).reset()}else r.fallback(a)},_initTemplateDefaults:function(){var i,a,r,n,s,o,l,d,c,u,f,p,h,m,g,v,w,b,_,C=this,x=function(e,i){return'\n"+t.DEFAULT_PREVIEW+"\n\n"},y="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=t.closeButton("fileinput-remove"),_=t.MODAL_ID+"Label",r='',n='\n',s='
    \n",c='",u='",f='\n",p='\x3c!--suppress ALL --\x3e\n",h='\n",m='\n\n'+t.OBJECT_PARAMS+" "+t.DEFAULT_PREVIEW+"\n\n",v='
    \n"+t.DEFAULT_PREVIEW+"\n
    \n",b={width:"100%",height:"100%","min-height":"480px"},C._isPdfRendered()&&(g=C.pdfRendererTemplate.replace("{renderer}",C._encodeURI(C.pdfRendererUrl))),C.defaults={layoutTemplates:{main1:i,main2:'{preview}\n
    \n
    \n{remove}\n{cancel}\n{upload}\n{browse}\n',preview:'
    \n {close}
    \n
    \n
    \n
    \n
    \n
    \n
    ',close:a,fileIcon:'',caption:'\n',modalMain:r,modal:n,descriptionClose:'',progress:'
    \n
    \n {status}\n
    \n
    {stats}',stats:'
    {pendingTime} {uploadSpeed}
    ',size:" ({sizeText})",footer:'',indicator:'
    {indicator}
    ',actions:'
    \n \n
    \n{drag}\n
    ',actionDelete:'\n',actionRotate:'',actionUpload:'',actionDownload:'{downloadIcon}',actionZoom:'',actionDrag:'{dragIcon}',btnDefault:'',btnLink:'{icon} {label}',btnBrowse:'
    {icon} {label}
    ',zoomCache:'
    {zoomContent}
    '},previewMarkupTags:{tagBefore1:'
    \n',tagBefore2:'
    \n',tagAfter:"
    {footer}\n{zoomCache}
    \n"},previewContentTemplates:{generic:"{content}\n",html:o,image:l,text:d,office:c,gdocs:u,video:f,audio:p,flash:h,object:m,pdf:g,other:v},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:b,text:b,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:b,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,showRotate:!0,removeIcon:'',removeClass:y,removeErrorClass:"btn btn-sm btn-kv btn-danger",removeTitle:"Remove file",uploadIcon:'',uploadClass:y,uploadTitle:"Upload file",uploadRetryIcon:'',uploadRetryTitle:"Retry upload",downloadIcon:'',downloadClass:y,downloadTitle:"Download file",rotateIcon:'',rotateClass:y,rotateTitle:"Rotate 90 deg. clockwise",zoomIcon:'',zoomClass:y,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(C.defaults,function(t,i){"allowedPreviewTypes"!==t?C[t]=e.extend(!0,{},i,C[t]):void 0===C.allowedPreviewTypes&&(C.allowedPreviewTypes=i)}),C._initPreviewTemplates()},_initPreviewTemplates:function(){var i,a=this,r=a.previewMarkupTags,n=r.tagAfter;e.each(a.previewContentTemplates,function(e,s){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+s+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){return i.previewCache.data&&i.previewCache.data.content?e?i.previewCache.data.content.filter(function(e){return null!==e}).length:i.previewCache.data.content.length:0},get:function(e,a){var r,n,s,o,l,d,c,u=t.INIT_FLAG+e,f=i.previewCache.data,p=f.config[e],h=f.content[e],m=t.ifSet("previewAsData",p,i.initialPreviewAsData),g=p?{title:p.title||null,alt:p.alt||null}:{title:null,alt:null},v=function(e,a,r,n,s,o,l,d){var c=" file-preview-initial "+t.SORT_CSS+(l?" "+l:""),u=i.previewInitId+"-"+o,f=p&&p.fileId||u;return i._generatePreviewTemplate(e,a,r,n,u,f,!1,null,null,c,s,o,d,g,p&&p.zoomData||a)};return h&&h.length?(a=void 0===a||a,s=t.ifSet("type",p,i.initialPreviewFileType||"generic"),l=t.ifSet("filename",p,t.ifSet("caption",p)),d=t.ifSet("filetype",p,s),o=i.previewCache.footer(e,a,p&&p.size||null),c=t.ifSet("frameClass",p),r=m?v(s,h,l,d,o,u,c):v("generic",h,l,d,o,u,c,s).setTokens({content:f.content[e]}),f.tags.length&&f.tags[e]&&(r=t.replaceTags(r,f.tags[e])),t.isEmpty(p)||t.isEmpty(p.frameAttr)||((n=t.createElement(r)).find(".file-preview-initial").attr(p.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 s,o=i.previewCache.data;return e&&e.length?(s=e.length-1,t.isArray(e)||(e=e.split(i.initialPreviewDelimiter)),n&&o.content?(s=o.content.push(e[0])-1,o.config[s]=a,o.tags[s]=r):(o.content=e,o.config=a,o.tags=r),i.previewCache.clean(o),s):0},set:function(e,a,r,n){var s,o=i.previewCache.data;if(e&&e.length&&(t.isArray(e)||(e=e.split(i.initialPreviewDelimiter)),e.filter(function(e){return null!==e}).length)){if(void 0===o.content&&(o.content=[]),void 0===o.config&&(o.config=[]),void 0===o.tags&&(o.tags=[]),n){for(s=0;s"+a+": "+e)):i||this.$errorContainer.html(""),this._showFileError(e,t,"fileusererror"))},_showFileError:function(e,t,i){var a=this.$errorContainer,r=i||"fileuploaderror",n=t&&t.fileId||"",s=t&&t.id?'
  • '+e+"
  • ":"
  • "+e+"
  • ";return 0===a.find("ul").length?this._addError("
      "+s+"
    "):a.find("ul").append(s),a.fadeIn(this.fadeDelay),this._raise(r,[t,e]),this._setValidationError("file-input-new"),!0},_showError:function(e,t,i){var a=this.$errorContainer,r=i||"fileerror";return(t=t||{}).reader=this.reader,this._addError(e),a.fadeIn(this.fadeDelay),this._raise(r,[t,e]),this.isAjaxUpload||this._clearFileInput(),this._setValidationError("file-input-new"),this.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(e){var t=this.minFileCount>1?this.filePlural:this.fileSingle,i=this.msgFilesTooLess.replace("{n}",this.minFileCount).replace("{files}",t),a=this.$errorContainer;i="
  • "+i+"
  • ",0===a.find("ul").length?this._addError("
      "+i+"
    "):a.find("ul").append(i),this.isError=!0,this._updateFileDetails(0),a.fadeIn(this.fadeDelay),this._raise("fileerror",[e,i]),this._clearFileInput(),this._setValidationError()},_parseError:function(t,i,a,r){var n,s,o,l=e.trim(a+"");return o=(s=i.responseJSON&&i.responseJSON.error?i.responseJSON.error.toString():"")||i.responseText,this.cancelling&&this.msgUploadAborted&&(l=this.msgUploadAborted),this.showAjaxErrorDetails&&o&&(s?l=e.trim(s+""):(n=(o=e.trim(o.replace(/\n\s*\n/g,"\n"))).length?"
    "+o+"
    ":"",l+=l?n:o)),l||(l=this.msgAjaxError.replace("{operation}",t)),this.cancelling=!1,r?""+r+": "+l:l},_parseFileType:function(e,i){var a,r,n,s=this.allowedPreviewTypes||[];if("application/text-plain"===e)return"text";for(n=0;n-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){a.previewFileIconSettings[e]&&t(i)&&(r=a.previewFileIconSettings[e])})),r||a.previewFileIcon},_parseFilePreviewIcon:function(e,t){var i=this._getPreviewIcon(t),a=e;return a.indexOf("{previewFileIcon}")>-1&&(a=a.setTokens({previewFileIconClass:this.previewFileIconClass,previewFileIcon:i})),a},_raise:function(t,i){var a=e.Event(t);void 0!==i?this.$element.trigger(a,i):this.$element.trigger(a);var r=a.result,n=!1===r;if(a.isDefaultPrevented()||n)return!1;if("filebatchpreupload"===a.type&&(r||n))return this.ajaxAborted=r,!1;switch(t){case"filebatchuploadcomplete":case"filebatchuploadsuccess":case"fileuploaded":case"fileclear":case"filecleared":case"filereset":case"fileerror":case"filefoldererror":case"filecustomerror":case"filesuccessremove":break;default:this.ajaxAborted||(this.ajaxAborted=r)}return!0},_listenFullScreen:function(e){var t,i,a=this.$modal;a&&a.length&&(t=a&&a.find(".btn-kv-fullscreen"),i=a&&a.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"),a.hasClass("file-zoom-fullscreen")?this._maximizeZoomDialog():e?this._maximizeZoomDialog():i.removeClass("active").attr("aria-pressed","false")))},_listen:function(){var i=this,a=i.$element,r=i.$form,n=i.$container;i._handler(a,"click",function(e){i._initFileSelected(),a.hasClass("file-no-browse")&&(a.data("zoneClicked")?a.data("zoneClicked",!1):e.preventDefault())}),i._handler(a,"change",e.proxy(i._change,i)),i._handler(i.$caption,"paste",e.proxy(i.paste,i)),i.showBrowse&&(i._handler(i.$btnFile,"click",e.proxy(i._browse,i)),i._handler(i.$btnFile,"keypress",function(e){13===(e.keyCode||e.which)&&(a.trigger("click"),i._browse(e))})),i._handler(n.find(".fileinput-remove:not([disabled])"),"click",e.proxy(i.clear,i)),i._handler(n.find(".fileinput-cancel"),"click",e.proxy(i.cancel,i)),i._handler(n.find(".fileinput-pause"),"click",e.proxy(i.pause,i)),i._initDragDrop(),i._handler(r,"reset",e.proxy(i.clear,i)),i.isAjaxUpload||i._handler(r,"submit",e.proxy(i._submitForm,i)),i._handler(i.$container.find(".fileinput-upload"),"click",e.proxy(i._uploadClick,i)),i._handler(e(window),"resize",function(){i._listenFullScreen(screen.width===window.innerWidth&&screen.height===window.innerHeight)}),i._handler(e(document),"webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",function(){i._listenFullScreen(t.checkFullScreen())}),i.$caption.on("focus",function(){i.$captionContainer.focus()}),i._autoFitContent(),i._initClickable(),i._refreshPreview()},_autoFitContent:function(){var t,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=this,r=i<400?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,s,o=this,l=function(e){o._log(t.logMessages.badDroppedFiles),o._log(e)};e.isFile?e.file(function(e){a&&(e.newPath=a+e.name),i.push(e)},l):e.isDirectory&&(n=e.createReader(),(s=function(){n.readEntries(function(t){if(t&&t.length>0){for(r=0;r-1;if(this._zoneDragDropInit(i),this.isDisabled||!r)return a.effectAllowed="none",void(a.dropEffect="none");a.dropEffect="copy",this._raise("fileDragEnter",{sourceEvent:i,files:a.types.Files})&&t.addCss(this.$dropZone,"file-highlighted")},_zoneDragLeave:function(e){this._zoneDragDropInit(e),this.isDisabled||this._raise("fileDragLeave",{sourceEvent:e})&&this.$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,s=r.items,o=t.getDragDropFolders(s);if(e.preventDefault(),!a.isDisabled&&!t.isEmpty(n)&&a._raise("fileDragDrop",{sourceEvent:e,files:n}))if(o>0){if(!a.isAjaxUpload)return void a._showFolderError(o);for(n=[],i=0;i0&&n>=l,c=e(i.item);d&&(n=l-1),s.initialPreview=t.moveArray(s.initialPreview,r,n,u),s.initialPreviewConfig=t.moveArray(s.initialPreviewConfig,r,n,u),s.previewCache.init(),s.getFrames(".file-preview-initial").each(function(){e(this).attr("data-fileindex",t.INIT_FLAG+o),o++}),d&&(a=s.getFrames(":not(.file-preview-initial):first")).length&&c.slideUp(function(){c.insertBefore(a).slideDown()}),s._raise("filesorted",{previewId:c.attr("id"),oldIndex:r,newIndex:n,stack:s.initialPreviewConfig})}},e.extend(!0,i,s.fileActionSettings.dragSettings),s.sortable&&s.sortable.destroy(),s.sortable=f.create(o[0],i))},_setPreviewContent:function(e){t.setHtml(this.$preview,e),this._autoFitContent()},_initPreviewImageOrientations:function(){var t=this,i=0,a=t.canOrientImage;(t.autoOrientImageInitial||a)&&t.getFrames(".file-preview-initial").each(function(){var r,n,s,o=e(this),l=t.initialPreviewConfig[i];l&&l.exif&&l.exif.Orientation&&(s=o.attr("id"),r=o.find(">.kv-file-content img"),n=t._getZoom(s," >.kv-file-content img"),a?r.css("image-orientation",t.autoOrientImageInitial?"from-image":"none"):t.setImageOrientation(r,n,l.exif.Orientation,o)),i++})},_initPreview:function(e){var i,a=this.initialCaption||"";if(!this.previewCache.count(!0))return this._clearPreview(),void(e?this._setCaption(a):this._initCaption());i=this.previewCache.out(),a=e&&this.initialCaption?this.initialCaption:i.caption,this._setPreviewContent(i.content),this._setInitThumbAttr(),this._setCaption(a),this._initSortable(),t.isEmpty(i.content)||this.$container.removeClass("file-input-new"),this._initPreviewImageOrientations()},_getZoomButton:function(e){var i=this.previewZoomButtonIcons[e],a=this.previewZoomButtonClasses[e],r=' title="'+(this.previewZoomButtonTitles[e]||"")+'" ',n=t.isBs(5)?"bs-":"",s=r+("close"===e?" data-"+n+'dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==e&&"borderless"!==e&&"toggleheader"!==e||(s+=' data-toggle="button" aria-pressed="false" autocomplete="off"'),'"},_getModalContent:function(){return this._getLayoutTemplate("modal").setTokens({rtl:this.rtl?" kv-rtl":"",zoomFrameClass:this.frameClass,prev:this._getZoomButton("prev"),next:this._getZoomButton("next"),rotate:this._getZoomButton("rotate"),toggleheader:this._getZoomButton("toggleheader"),fullscreen:this._getZoomButton("fullscreen"),borderless:this._getZoomButton("borderless"),close:this._getZoomButton("close")})},_listenModalEvent:function(e){var i=this,a=i.$modal;a.on(e+".bs.modal",function(r){if("bs.modal"===r.namespace){var n=a.find(".btn-fullscreen"),s=a.find(".btn-borderless");a.data("fileinputPluginId")===i.$element.attr("id")&&i._raise("filezoom"+e,function(e){return{sourceEvent:e,previewId:a.data("previewId"),modal:a}}(r)),"shown"===e&&(i._handleRotation(a,a.find(".file-zoom-detail"),a.data("angle")),s.removeClass("active").attr("aria-pressed","false"),n.removeClass("active").attr("aria-pressed","false"),a.hasClass("file-zoom-fullscreen")&&(i._maximizeZoomDialog(),t.checkFullScreen()?n.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.$modal,r=a.data("previewId")||"",n=this.getFrames().toArray(),s=n.length,o=a.find(".btn-kv-prev"),l=a.find(".btn-kv-next");a.find(".btn-kv-rotate");if(n.length<2)return o.hide(),void l.hide();o.show(),l.show(),s&&(t=e(n[0]),i=e(n[s-1]),o.removeAttr("disabled"),l.removeAttr("disabled"),this.reversePreviewOrder&&([o,l]=[l,o]),t.length&&t.attr("id")===r&&o.attr("disabled",!0),i.length&&i.attr("id")===r&&l.attr("disabled",!0))},_maximizeZoomDialog:function(){var t=this.$modal,i=t.find(".modal-header:visible"),a=t.find(".modal-footer:visible"),r=t.find(".kv-zoom-body"),n=e(window).height();t.addClass("file-zoom-fullscreen"),i&&i.length&&(n-=i.outerHeight(!0)),a&&a.length&&(n-=a.outerHeight(!0)),r&&r.length&&(n-=r.outerHeight(!0)-r.height()),t.find(".kv-zoom-body").height(n)},_resizeZoomDialog:function(e){var i=this.$modal,a=i.find(".btn-kv-fullscreen"),r=i.find(".btn-kv-borderless");if(i.hasClass("file-zoom-fullscreen"))t.toggleFullScreen(!1),e?a.hasClass("active")||(i.removeClass("file-zoom-fullscreen"),this._resizeZoomDialog(!0),r.hasClass("active")&&r.removeClass("active").attr("aria-pressed","false")):a.hasClass("active")?a.removeClass("active").attr("aria-pressed","false"):(i.removeClass("file-zoom-fullscreen"),this.$modal.find(".kv-zoom-body").css("height",this.zoomModalHeight));else{if(!e)return void this._maximizeZoomDialog();t.toggleFullScreen(!0)}i.focus()},_setZoomContent:function(i,a){var r,n,s,o,l,d,c,u,f,p,h,m,g=this,v=i.attr("id"),w=g._getZoom(v),b=g.$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),m=w.html().replace(g.zoomPlaceholder,"").setTokens({zoomData:y}),w.html(m),i.data("zoom",""),w.attr("data-zoom",y)),n=w.attr("data-template")||"generic",s=(r=w.find(".kv-file-content")).length?r.html():"",p=i.data("caption")||g.msgZoomModalHeading,h=i.data("size")||"",u=i.data("description")||"",b.find(".kv-zoom-caption").attr("title",p).html(p),b.find(".kv-zoom-size").html(h),f=b.find(".kv-zoom-description").hide(),u&&(g.showDescriptionClose&&(u=g._getLayoutTemplate("descriptionClose").setTokens({closeIcon:g.previewZoomButtonIcons.close})+""+u),f.show().html(u),g.showDescriptionClose&&g._handler(b.find(".kv-desc-hide"),"click",function(){e(this).parent().fadeOut("fast",function(){b.focus()})})),o=b.find(".kv-zoom-body"),b.removeClass("kv-single-content"),a?(c=o.addClass("file-thumb-loading").clone().insertAfter(o),t.setHtml(o,s).hide(),c.fadeOut("fast",function(){o.fadeIn("fast",function(){o.removeClass("file-thumb-loading")}),c.remove()})):t.setHtml(o,s),(d=g.previewZoomSettings[n])&&(l=o.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",v),g._handler(b.find(".btn-kv-prev"),"click",function(){g._zoomSlideShow("prev",v)}),g._handler(b.find(".btn-kv-next"),"click",function(){g._zoomSlideShow("next",v)}),g._handler(_,"click",function(){g._resizeZoomDialog(!0)}),g._handler(C,"click",function(){g._resizeZoomDialog(!1)}),g._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=g.$modal.find(".kv-zoom-body"),a=g.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()}),g._handler(b,"keydown",function(t){var i,a,r=t.which||t.keyCode,n=g.processDelay+1,s=e(this).find(".btn-kv-prev"),o=e(this).find(".btn-kv-next"),l=e(this).data("previewId");[i,a]=g.rtl?[39,37]:[37,39],e.each({prev:[s,i],next:[o,a]},function(e,t){var i=t[0],a=t[1];r===a&&i.length&&(b.focus(),i.attr("disabled")||(i.blur(),setTimeout(function(){i.focus(),g._zoomSlideShow(e,l),setTimeout(function(){i.attr("disabled")&&b.focus()},n)},n)))})})},_showModal:function(e){var i,a,r=this.$modal;e&&e.length&&(t.initModal(r),t.setHtml(r,this._getModalContent()),this._setZoomContent(e),r.removeClass("rotatable"),r.data({backdrop:!1,fileinputPluginId:this.$element.attr("id")}),r.find(".kv-zoom-body").css("height",this.zoomModalHeight),(i=e.find(".kv-file-content > :first-child")).length&&(a=i.css("transform"))&&r.find(".file-zoom-detail").css("transform",a),e.hasClass("rotatable")&&r.addClass("rotatable"),e.data("angle")&&r.data("angle",e.data("angle")),e.data("angle")||0,r.modal("show"),this._initZoomButtons(),this._initRotateZoom(e,i))},_zoomPreview:function(e){var i;if(!e.length)throw"Cannot zoom to detailed preview!";i=e.closest(t.FRAMES),this._showModal(i)},_zoomSlideShow:function(t,i){var a,r,n,s,o,l,d=this.$modal,c=d.find(".kv-zoom-actions .btn-kv-"+t),u=this.getFrames().toArray(),f=[],p=u.length;if(this.reversePreviewOrder&&(t="prev"===t?"next":"prev"),!c.attr("disabled")){for(r=0;r=p||!f[s]||((a=e(f[s])).length&&this._setZoomContent(a,t),this._initZoomButtons(),a.length&&a.hasClass("rotatable")?(o=a.data("angle")||0,d.addClass("rotatable").data("angle",o),l=a.find(".kv-file-content > :first-child"),this._initRotateZoom(a,l)):d.removeClass("rotatable").removeData("angle"),this._raise("filezoom"+t,{previewId:i,modal:this.$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;(this._inputFileCount()||this.isAjaxUpload)&&this.showPreview&&this.isPreviewable&&(this.isAjaxUpload&&this.fileManager.count()>0?(t=e.extend(!0,[],this.getFileList()),this.fileManager.clear(),this._clearFileInput()):t=this.$element[0].files,t&&t.length&&this.readFiles(t))},_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.$element;this._inputFileCount()&&(t=r.closest("form"),i=e(document.createElement("form")),a=e(document.createElement("div")),r.before(a),t.length?t.after(i):a.after(i),i.append(r).trigger("reset"),a.before(r).remove(),i.remove())},_resetUpload:function(){this.uploadInitiated=!1,this.uploadStartTime=t.now(),this.uploadCache=[],this.$btnUpload.removeAttr("disabled"),this._setProgress(0),this._hideProgress(),this._resetErrors(!1),this._initAjax(),this.fileManager.clearImages(),this._resetCanvas(),this.overwriteInitial&&(this.initialPreview=[],this.initialPreviewConfig=[],this.initialPreviewThumbTags=[],this.previewCache.data={content:[],config:[],tags:[]})},_resetCanvas:function(){this.imageCanvas&&this.imageCanvasContext&&this.imageCanvasContext.clearRect(0,0,this.imageCanvas.width,this.imageCanvas.height)},_hasInitialPreview:function(){return!this.overwriteInitial&&this.previewCache.count(!0)},_resetPreview:function(){var i,a,r,n=this.showUploadedThumbs,s=!this.removeFromPreviewOnError,o=(n||s)&&this.isDuplicateError;this.previewCache.count(!0)?(i=this.previewCache.out(),o&&(r=t.createElement("").insertAfter(this.$container),this.getFrames().each(function(){var t=e(this);(n&&t.hasClass("file-preview-success")||s&&t.hasClass("file-preview-error"))&&r.append(t)})),this._setPreviewContent(i.content),this._setInitThumbAttr(),a=this.initialCaption?this.initialCaption:i.caption,this._setCaption(a),o&&(r.contents().appendTo(this.$preview),r.remove())):(this._clearPreview(),this._initCaption()),this.showPreview&&(this._initZoom(),this._initSortable()),this.isDuplicateError=!1},_clearDefaultPreview:function(){this.$preview.find(".file-default-preview").remove()},_validateDefaultPreview:function(){this.showPreview&&!t.isEmpty(this.defaultPreviewContent)&&(this._setPreviewContent('
    '+this.defaultPreviewContent+"
    "),this.$container.removeClass("file-input-new"),this._initClickable())},_resetPreviewThumbs:function(e){var t;if(e)return this._clearPreview(),void this.clearFileStack();this._hasInitialPreview()?(t=this.previewCache.out(),this._setPreviewContent(t.content),this._setInitThumbAttr(),this._setCaption(t.caption),this._initPreviewActions()):this._clearPreview()},_getLayoutTemplate:function(e){var i=this.layoutTemplates[e];return t.isEmpty(this.customLayoutTags)?i:t.replaceTags(i,this.customLayoutTags)},_getPreviewTemplate:function(e){var i=this.previewTemplates,a=i[e]||i.other;return t.isEmpty(this.customPreviewTags)?a:t.replaceTags(a,this.customPreviewTags)},_getOutData:function(e,t,i,a){return t=t||{},i=i||{},{formdata:e,files:a=a||this.fileManager.list(),filenames:this.filenames,filescount:this.getFilesCount(),extra:this._getExtraData(),response:i,reader:this.reader,jqXHR:t}},_getMsgSelected:function(e,t){var i=1===e?this.fileSingle:this.filePlural;return e>0?this.msgSelected.replace("{n}",e).replace("{files}",i):t?this.msgProcessing:this.msgNoFilesSelected},_getFrame:function(e,i){var a=t.getFrameElement(this.$preview,e);return!this.showPreview||i||a.length||this._log(t.logMessages.invalidThumb,{id:e}),a},_getZoom:function(e,i){var a=t.getZoomElement(this.$preview,e,i);return this.showPreview&&!a.length&&this._log(t.logMessages.invalidThumb,{id:e}),a},_getThumbs:function(e){return e=e||"",this.getFrames(":not(.file-preview-initial)"+e)},_getThumbId:function(e){return this.previewInitId+"-"+e},_getExtraData:function(e,t){var i=this.uploadExtraData;return"function"==typeof this.uploadExtraData&&(i=this.uploadExtraData(e,t)),i},_initXhr:function(e,i){var a=this,r=a.fileManager,n=function(e){var n=0,s=e.total,o=e.loaded||e.position,l=r.getUploadStats(i,o,s);e.lengthComputable&&!a.enableResumableUpload&&(n=t.round(o/s*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(){this._ajaxSettings=e.extend(!0,{},this.ajaxSettings),this._ajaxDeleteSettings=e.extend(!0,{},this.ajaxDeleteSettings)},_mergeAjaxCallback:function(e,t,i){var a,r=this._ajaxSettings,n=this.mergeAjaxCallbacks;"delete"===i&&(r=this._ajaxDeleteSettings,n=this.mergeAjaxDeleteCallbacks),a=r[e],r[e]=n&&"function"==typeof a?"before"===n?function(){a.apply(this,arguments),t.apply(this,arguments)}:function(){t.apply(this,arguments),a.apply(this,arguments)}:t},_ajaxSubmit:function(t,i,a,r,n,s,o,l){var d,c,u,f=this,p=f.taskManager;f._raise("filepreajax",[n,s,o])&&(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),"function"==typeof(l=l||f.uploadUrlThumb||f.uploadUrl)&&(l=l()),"object"==typeof(u=f._getExtraData(s,o)||{})&&e.each(u,function(e,t){n.append(e,t)}),c={xhr:function(){var t=e.ajaxSettings.xhr();return f._initXhr(t,s)},url:f._encodeURI(l),type:"POST",dataType:"json",data:n,cache:!1,processData:!1,contentType:!1},d=e.extend(!0,{},c,f._ajaxSettings),f.ajaxQueue.push(d),p.addTask(s+"-"+o,function(){var t,i,a=this.self;t=a.ajaxQueue.shift(),i=e.ajax(t),a.ajaxRequests.push(i)}).runWithContext({self:f}))},_mergeArray:function(e,i){var a=t.cleanArray(this[e]),r=t.cleanArray(i);this[e]=a.concat(r)},_initUploadSuccess:function(i,a,r){var n,s,o,l,d,c,u,f,p,h=this;h.showPreview&&"object"==typeof i&&!e.isEmptyObject(i)?(void 0!==i.initialPreview&&i.initialPreview.length>0&&(h.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(h.initialPreviewDelimiter)),d.length&&(h._mergeArray("initialPreview",d),h._mergeArray("initialPreviewConfig",c),h._mergeArray("initialPreviewThumbTags",u)),void 0!==a?r?(f=a.attr("id"),null!==(p=h._getUploadCacheIndex(f))&&(h.uploadCache[p]={id:f,content:d[0],config:c[0]||[],tags:u[0]||[],append:n})):(o=h.previewCache.add(d[0],c[0],u[0],n),s=h.previewCache.get(o,!1),l=t.createElement(s).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"),h._initPreviewActions(),h._clearFileInput(),a.remove(),l.remove(),h._initSortable()})):(h.previewCache.set(d,c,u,n),h._initPreview(),h._initPreviewActions())),h._resetCaption()):h._resetCaption()},_getUploadCacheIndex:function(e){var t,i=this.uploadCache.length;for(t=0;t0||!e.isEmptyObject(b.uploadExtraData),P=b.ajaxOperations.uploadThumb,k=_.getFile(a),F={id:y,index:i,fileId:a},S=b.fileManager.getFileName(a,!0),I=function(){n&&n.resolve&&n.resolve()};b.enableResumableUpload||(b.uploadInitiated=!0,b.showPreview&&(o=_.getThumb(a),f=o.find(".file-thumb-progress"),d=o.find(".kv-file-upload"),c=o.find(".kv-file-remove"),f.show()),0===C||!T||b.showPreview&&d&&d.hasClass("disabled")||b._abort(F)||(w=function(){u?_.errors.push(a):_.removeFile(a),_.setProcessed(a),_.isProcessed()&&(b.fileBatchCompleted=!0,l())},l=function(){var e;b.fileBatchCompleted&&setTimeout(function(){var i=0===_.count(),a=_.errors.length;b._updateInitialPreview(),b.unlock(i),i&&b._clearFileInput(),e=b.$preview.find(".file-preview-initial"),b.uploadAsync&&e.length&&(t.addCss(e,t.SORT_CSS),b._initSortable()),b._raise("filebatchuploadcomplete",[_.stack,b._getExtraData()]),b.retryErrorUploads&&0!==a||_.clear(),b._setProgress(101),b.ajaxAborted=!1,b.uploadInitiated=!1},b.processDelay)},p=function(n){s=b._getOutData(x,n),_.initStats(a),b.fileBatchCompleted=!1,r||(b.ajaxAborted=!1),b.showPreview&&(o.hasClass("file-preview-success")||(b._setThumbStatus(o,"Loading"),t.addCss(o,"file-uploading")),d.attr("disabled",!0),c.attr("disabled",!0)),r||b.lock(),-1!==_.errors.indexOf(a)&&delete _.errors[a],b._raise("filepreupload",[s,y,i,b._getThumbFileId(o)]),e.extend(!0,F,s),b._abort(F)&&(n.abort(),r||(b._setThumbStatus(o,"New"),o.removeClass("file-uploading"),d.removeAttr("disabled"),c.removeAttr("disabled")),b._setProgressCancelled())},m=function(n,l,c){var p=b.showPreview&&o.attr("id")?o.attr("id"):y;s=b._getOutData(x,c,n),e.extend(!0,F,s),setTimeout(function(){t.isEmpty(n)||t.isEmpty(n.error)?(b.showPreview&&(b._setThumbStatus(o,"Success"),d.hide(),b._initUploadSuccess(n,o,r),b._setProgress(101,f)),b._raise("fileuploaded",[s,p,i,b._getThumbFileId(o)]),r?(w(),I()):b.fileManager.remove(o)):(u=!0,h=b._parseError(P,c,b.msgUploadError,b.fileManager.getFileName(a)),b._showFileError(h,F),b._setPreviewError(o,!0),b.retryErrorUploads||d.hide(),r&&(w(),I()),b._setProgress(101,b._getFrame(p).find(".file-thumb-progress"),b.msgUploadError))},b.processDelay)},g=function(){b.showPreview&&(d.removeAttr("disabled"),c.removeAttr("disabled"),o.removeClass("file-uploading")),r?l():(b.unlock(!1),b._clearFileInput()),b._initSuccessThumbs()},v=function(t,i,s){h=b._parseError(P,t,s,b.fileManager.getFileName(a)),u=!0,setTimeout(function(){var i;r&&(w(),n&&n.reject&&n.reject()),b.fileManager.setProgress(a,100),b._setPreviewError(o,!0),b.retryErrorUploads||d.hide(),e.extend(!0,F,b._getOutData(x,t)),b._setProgress(101,b.$progress,b.msgAjaxProgressError.replace("{operation}",P)),i=b.showPreview&&o?o.find(".file-thumb-progress"):"",b._setProgress(101,i,b.msgUploadError),b._showFileError(h,F)},b.processDelay)},b._setFileData(x,k.file,S,a),b._setUploadData(x,{fileId:a}),b._ajaxSubmit(p,m,g,v,x,a,i)))},_setFileData:function(e,t,i,a){var r=this.preProcessUpload;r&&"function"==typeof r?e.append(this.uploadFileAttr,r(a,t)):e.append(this.uploadFileAttr,t,i)},_checkBatchPreupload:function(t,i){var a=this;return!!a._raise("filebatchpreupload",[t])||(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,s,o,l=this,d=l.fileManager,c=d.total(),u=c>0||!e.isEmptyObject(l.uploadExtraData),f=new FormData,p=l.ajaxOperations.uploadBatch;if(0!==c&&u&&!l._abort({})){o=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]),o(),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)),s=l._parseError(p,r,l.msgUploadError),l._showFileError(s,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);s=l._parseError(p,t,a),l._showFileError(s,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}",p)))};var h=0;e.each(l.fileManager.stack,function(e,i){t.isEmpty(i.file)||l._setFileData(f,i.file,i.nameFmt||"untitled_"+h,e),h++}),l._ajaxSubmit(i,a,n,r,f)}},_uploadExtraOnly:function(){var e,i,a,r,n,s=this,o={},l=new FormData,d=s.ajaxOperations.uploadExtra;e=function(e){s.lock();var t=s._getOutData(l,e);s._setProgress(50),o.data=t,o.xhr=e,s._checkBatchPreupload(t,e)},i=function(e,i,a){var r=s._getOutData(l,a,e);t.isEmpty(e)||t.isEmpty(e.error)?(s._raise("filebatchuploadsuccess",[r]),s._clearFileInput(),s._initUploadSuccess(e),s._setProgress(101)):(n=s._parseError(d,a,s.msgUploadError),s._showFileError(n,r,"filebatchuploaderror"))},a=function(){s.unlock(),s._clearFileInput(),s._raise("filebatchuploadcomplete",[s.fileManager.stack,s._getExtraData()])},r=function(e,t,i){var a=s._getOutData(l,e);n=s._parseError(d,e,i),o.data=a,s._showFileError(n,a,"filebatchuploaderror"),s._setProgress(101,s.$progress,s.msgAjaxProgressError.replace("{operation}",d))},s._ajaxSubmit(e,i,a,r,l)},_deleteFileIndex:function(i){var a=i.attr("data-fileindex"),r=this.reversePreviewOrder;a.substring(0,5)===t.INIT_FLAG&&(a=parseInt(a.replace(t.INIT_FLAG,"")),this.initialPreview=t.spliceArray(this.initialPreview,a,r),this.initialPreviewConfig=t.spliceArray(this.initialPreviewConfig,a,r),this.initialPreviewThumbTags=t.spliceArray(this.initialPreviewThumbTags,a,r),this.getFrames().each(function(){var i=e(this),r=i.attr("data-fileindex");r.substring(0,5)===t.INIT_FLAG&&(r=parseInt(r.replace(t.INIT_FLAG,"")))>a&&(r--,i.attr("data-fileindex",t.INIT_FLAG+r))}))},_resetCaption:function(){var e=this;setTimeout(function(){var t,i,a,r="",n=e.previewCache.count(!0),s=e.fileManager.count(),o=e.showPreview&&e.getFrames(":not(.file-preview-success):not(.file-preview-error)").length;0!==s||0!==n||o?((t=n+s)>1?r=e._getMsgSelected(t):0===s?(r="",(a=e.initialPreviewConfig[0])&&(r=a.caption||a.filename||""),r||(r=e._getMsgSelected(t))):r=(i=e.fileManager.getFirstFile())?i.nameFmt:"_",e._setCaption(r)):e.reset()},e.processDelay)},_handleRotation:function(t,i,a){var r,n,s,o,l,d,c,u,f,p="",h=1,m=i[0],g=i.parent(),v=e("body"),w=!!v.length;w&&v.addClass("kv-overflow-hidden"),i.length&&!t.hasClass("hide-rotate")?((o=i.css("transform"))&&i.css("transform","none"),o&&i.css("transform",o),r="rotate("+(a=a||0)+"deg)",n="rotate("+(s=a%360)+"deg)",p="",90!==s&&270!==s||(h=(d=m.naturalWidth||i.outerWidth()||0)>(l=m.naturalHeight||i.outerHeight()||0)&&0!=d?(l/d).toFixed(2):1,g.length&&(u=g.height(),f=g.width(),u>h*(c=Math.min(d,f))&&(h=c>u&&0!=c?(u/c).toFixed(2):1)),1!==h&&(p=" scale("+h+")")),i.addClass("rotate-animate").css("transform",r+p),setTimeout(function(){i.removeClass("rotate-animate").css("transform",n+p),w&&v.removeClass("kv-overflow-hidden"),t.data("angle",s)},this.fadeDelay)):w&&v.removeClass("kv-overflow-hidden")},_initRotateButton:function(){var i=this;i.getFrames(".rotatable .kv-file-rotate").each(function(){var a=e(this),r=a.closest(t.FRAMES),n=r.find(".kv-file-content > :first-child");i._handler(a,"click",function(){var e=(r.data("angle")||0)+90;i._handleRotation(r,n,e)})})},_initRotateZoom:function(e,t){var i=this,a=i.$modal,r=a.find(".btn-kv-rotate"),n=e.data("angle");a.data("angle",n),r.length&&(r.off("click"),a.hasClass("rotatable")&&r.on("click",function(){n=(a.data("angle")||0)+90,a.data("angle",n),i._handleRotation(a,a.find(".file-zoom-detail"),n),i._handleRotation(e,t,n),e.hasClass("hide-rotate")&&e.data("angle",n)}))},_initFileActions:function(){var i=this;i.showPreview&&(i._initZoomButton(),i._initRotateButton(),i.getFrames(" .kv-file-remove").each(function(){var a,r=e(this),n=r.closest(t.FRAMES),s=n.attr("id"),o=n.attr("data-fileindex");i.fileManager;i._handler(r,"click",function(){if(!1===i._raise("filepreremove",[s,o])||!i._validateMinCount())return!1;a=n.hasClass("file-preview-error"),t.cleanMemory(n),n.fadeOut("slow",function(){i.fileManager.remove(n),i._clearObjects(n),n.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,o])})})}),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",s=i.fileActionSettings,o=s.removeClass,l=s.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(),i._initRotateButton(),a.find(n).each(function(){var a,n,s,c,u=e(this),f=u.data("url")||i.deleteUrl,p=u.data("key"),h=i.ajaxOperations.deleteThumb;if(!t.isEmpty(f)&&void 0!==p){"function"==typeof f&&(f=f());var m,g,v,w,b,_=u.closest(t.FRAMES),C=i.previewCache.data,x=_.attr("data-fileindex");x=parseInt(x.replace(t.INIT_FLAG,"")),v=t.isEmpty(C.config)&&t.isEmpty(C.config[x])?null:C.config[x],b=t.isEmpty(v)||t.isEmpty(v.extra)?r:v.extra,w=v&&(v.filename||v.caption)||"","function"==typeof b&&(b=b()),g={id:u.attr("id"),key:p,extra:b},n=function(e){i.ajaxAborted=!1,i._raise("filepredelete",[p,e,b]),i._abort()?e.abort():(u.removeClass(l),t.addCss(_,"file-uploading"),t.addCss(u,"disabled "+o))},s=function(e,r,n){var s,c;if(!t.isEmpty(e)&&!t.isEmpty(e.error))return g.jqXHR=n,g.response=e,a=i._parseError(h,n,i.msgDeleteError,w),i._showFileError(a,g,"filedeleteerror"),_.removeClass("file-uploading"),u.removeClass("disabled "+o).addClass(l),void d();_.removeClass("file-uploading").addClass("file-deleted"),_.fadeOut("slow",function(){x=parseInt(_.attr("data-fileindex").replace(t.INIT_FLAG,"")),i.previewCache.unset(x),i._deleteFileIndex(_),s=i.previewCache.count(!0),c=s>0?i._getMsgSelected(s):"",i._setCaption(c),i._raise("filedeleted",[p,n,b]),i._clearObjects(_),_.remove(),d()})},c=function(e,t,a){var r=i._parseError(h,e,a,w);g.jqXHR=e,g.response={},i._showFileError(r,g,"filedeleteerror"),_.removeClass("file-uploading"),u.removeClass("disabled "+o).addClass(l),d()},i._initAjaxSettings(),i._mergeAjaxCallback("beforeSend",n,"delete"),i._mergeAjaxCallback("success",s,"delete"),i._mergeAjaxCallback("error",c,"delete"),m=e.extend(!0,{},{url:i._encodeURI(f),type:"POST",dataType:"json",data:e.extend(!0,{},{key:p},b)},i._ajaxDeleteSettings),i._handler(u,"click",function(){if(!i._validateMinCount())return!1;i.ajaxAborted=!1,i._raise("filebeforedelete",[p,b]),i.ajaxAborted instanceof Promise?i.ajaxAborted.then(function(t){t||e.ajax(m)}):i.ajaxAborted||e.ajax(m)})}})},_hideFileIcon:function(){this.overwriteInitial&&this.$captionContainer.removeClass("icon-visible")},_showFileIcon:function(){t.addCss(this.$captionContainer,"icon-visible")},_getSize:function(t,i,a){var r,n,s=parseFloat(t),o=0,l=this.bytesToKB,d=this.fileSizeGetter,c=s;if(!e.isNumeric(t)||!e.isNumeric(s))return"";if("function"==typeof d)r=d(s);else{if(a||(a=this.sizeUnits),s>0){for(;c>=l;)c/=l,++o;a[o]||(c=s,o=0)}(n=c.toFixed(2))==c&&(n=c),r=n+" "+a[o]}return i?r:this._getLayoutTemplate("size").replace("{sizeText}",r)},_getFileType:function(e){return this.mimeTypeAliases[e]||e},_generatePreviewTemplate:function(i,a,r,n,s,o,l,d,c,u,f,p,h,m,g){var v,w,b,_,C=this,x=C.slug(r),y="",T="",P=c||r,k=P.split(".").pop().toLowerCase(),F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,S=x,I=x,E="type-default",A=f||C._renderFileFooter(i,x,d,"auto",l),z=-1!==e.inArray(k,C.alwaysPreviewFileExtensions),D=C.preferIconicPreview&&!z,j=C.preferIconicZoomPreview&&!z,$=D?"other":i;return(v=F<400?C.previewSettingsSmall[$]||C.defaults.previewSettingsSmall[$]:C.previewSettings[$]||C.defaults.previewSettings[$])&&e.each(v,function(e,t){T+=e+":"+t+";"}),w=function(a,l,d,c,f){var g,v=d?"zoom-"+s:s,w=C._getPreviewTemplate(a),b=(u||"")+" "+c;return C.frameClass&&(b=C.frameClass+" "+b),d&&(b=b.replace(" "+t.SORT_CSS,"")),w=C._parseFilePreviewIcon(w,r),"object"!==i||n||e.each(C.defaults.fileTypeSettings,function(e,t){"object"!==e&&"other"!==e&&t(r,n)&&(E="type-"+e)}),t.isEmpty(m)||(void 0!==m.title&&null!==m.title&&(S=m.title),void 0!==m.alt&&null!==m.alt&&(I=S=m.alt)),g={previewId:v,caption:x,title:S,alt:I,frameClass:b,type:C._getFileType(n),fileindex:p,fileid:o||"",filename:P,typeCss:E,footer:A,data:d&&f?C.zoomPlaceholder+"{zoomData}":l,template:h||i,style:T?'style="'+T+'"':"",zoomData:f?encodeURIComponent(f):""},d&&(g.zoomCache="",g.zoomData="{zoomData}"),w.setTokens(g)},p=p||s.slice(s.lastIndexOf("-")+1),_=C.fileActionSettings.showRotate&&-1!==e.inArray(k,C.rotatableFileExtensions),C.fileActionSettings.showZoom&&(b="kv-zoom-thumb",_&&(b+=" rotatable"+(j?" hide-rotate":"")),y=w(j?"other":i,a,!0,b,g)),y="\n"+C._getLayoutTemplate("zoomCache").replace("{zoomContent}",y),"function"==typeof C.sanitizeZoomCache&&(y=C.sanitizeZoomCache(y)),b="kv-preview-thumb",_&&(b+=" rotatable"+(D||C.hideThumbnailContent||!!C.previewFileIconSettings[k]?" hide-rotate":"")),w(D?"other":i,a,!1,b,g).setTokens({zoomCache:y})},_addToPreview:function(e,i){var a;return i=t.cspBuffer.stash(i),a=this.reversePreviewOrder?e.prepend(i):e.append(i),t.cspBuffer.apply(e),a},_previewDefault:function(e,i){var a=this.$preview;if(this.showPreview){var r,n=t.getFileName(e),s=e?e.type:"",o=e.size||0,l=this._getFileName(e,""),d=!0===i&&!this.isAjaxUpload,c=t.createObjectURL(e),u=this.fileManager.getId(e),f=this._getThumbId(u);this._clearDefaultPreview(),r=this._generatePreviewTemplate("other",c,n,s,f,u,d,o),this._addToPreview(a,r),this._setThumbAttr(f,l,o),!0===i&&this.isAjaxUpload&&this._setThumbStatus(this._getFrame(f),"Error")}},_previewFile:function(e,i,a,r,n){if(this.showPreview){var s,o=t.getFileName(i),l=n.type,d=n.name,c=this._parseFileType(l,o),u=this.$preview,f=i.size||0,p="image"===c?a.target.result:r,h=this.fileManager.getId(i),m=this._getThumbId(h);s=this._generatePreviewTemplate(c,p,o,l,m,h,!1,f,n.filename),this._clearDefaultPreview(),this._addToPreview(u,s);var g=this._getFrame(m);this._validateImageOrientation(g.find("img"),i,m,h,d,l,f,p),this._setThumbAttr(m,d,f),this._initSortable()}},_setThumbAttr:function(e,t,i,a){var r=this._getFrame(e);r.length&&(i=i&&i>0?this._getSize(i):"",r.data({caption:t,size:i,description:a||""}))},_setInitThumbAttr:function(){var e,i,a,r,n,s=this.previewCache.data,o=this.previewCache.count(!0);if(0!==o)for(var l=0;l&"']/g,"_")},_updateFileDetails:function(e){var i,a,r,n,s=this.$element,o=t.isIE(9)&&t.findFileName(s.val())||s[0].files[0]&&s[0].files[0].name;i=!o&&this.fileManager.count()>0?this.fileManager.getFirstFile().nameFmt:o?this.slug(o):"_",a=this.isAjaxUpload?this.fileManager.count():e,n=this.previewCache.count(!0)+a,r=1===a?i:this._getMsgSelected(n,!this.isAjaxUpload&&!this.isError),this.isError?(this.$previewContainer.removeClass("file-thumb-loading"),this._initCapStatus(),this.$previewStatus.html(""),this.$captionContainer.removeClass("icon-visible")):this._showFileIcon(),this._setCaption(r,this.isError),this.$container.removeClass("file-input-new file-input-ajax-new"),this._raise("fileselect",[e,i]),this.previewCache.count(!0)&&this._initPreviewActions()},_setThumbStatus:function(e,i){if(this.showPreview){var a="indicator"+i,r=a+"Title",n="file-preview-"+i.toLowerCase(),s=e.find(".file-upload-indicator"),o=this.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,o[a]),s.attr("title",o[r]),e.addClass(n),"Error"!==i||this.retryErrorUploads||e.find(".kv-file-upload").attr("disabled",!0)}},_setProgressCancelled:function(){this._setProgress(101,this.$progress,this.msgCancelled)},_setProgress:function(e,i,a,r){if((i=i||this.$progress).length){var n,s=Math.min(e,100),o=this.progressUploadThreshold,l=e<=100?this.progressTemplate:this.progressCompleteTemplate,d=s<100?this.progressTemplate:a?this.paused?this.progressPauseTemplate:this.progressErrorTemplate:l;e>=100&&(r=""),t.isEmpty(d)||(r=r||"",n=(n=o&&s>o&&e<=100?d.setTokens({percent:o,status:this.msgUploadThreshold}):d.setTokens({percent:s,status:e>100?this.msgUploadEnd:s+"%"})).setTokens({stats:r}),t.setHtml(i,n),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.$container.find(".file-drop-zone"),a=this.dropZoneTitle;this.isClickable&&(e=t.isEmpty(this.$element.attr("multiple"))?this.fileSingle:this.filePlural,a+=this.dropZoneClickTitle.replace("{files}",e)),i.find("."+this.dropZoneTitleClass).remove(),!this.showPreview||0===i.length||this.fileManager.count()>0||!this.dropZoneEnabled||this.previewCache.count()>0||!this.isAjaxUpload&&this._hasFiles()||(0===i.find(t.FRAMES).length&&t.isEmpty(this.defaultPreviewContent)&&i.prepend('
    '+a+"
    "),this.$container.removeClass("file-input-new"),t.addCss(this.$container,"file-input-ajax-new"))},_getStats:function(e){var i,a;return this.showUploadStats&&e&&e.bitrate?(a=this._getLayoutTemplate("stats"),i=e.elapsed&&e.bps?this.msgPendingTime.setTokens({time:t.getElapsed(Math.ceil(e.pendingBytes/e.bps))}):this.msgCalculatingTime,a.setTokens({uploadSpeed:e.bitrate,pendingTime:i})):""},_setResumableProgress:function(e,t,i){var a=this.resumableManager,r=i?a:this,n=i?i.find(".file-thumb-progress"):null;0===r.lastProgress&&(r.lastProgress=e),e0&&this._getFileCount(e-1)=c:l<=c)||(o=this["msgImage"+i+e]||'Image "{name}" has a size validation error (limit "{size}").',this._showFileError(o.setTokens({name:n,size:c,dimension:l}),s),this._setPreviewError(r),this.fileManager.remove(r),this._clearFileInput(),!1))},_getExifObj:function(e){var i,a=t.logMessages.exifWarning;if("data:image/jpeg;base64,"===e.slice(0,23)||"data:image/jpg;base64,"===e.slice(0,22)){try{i=window.piexif?window.piexif.load(e):null}catch(e){i=null,a=e&&e.message||""}return!i&&this.showExifErrorLog&&this._log(t.logMessages.badExifParser,{details:a}),i}i=null},setImageOrientation:function(i,a,r,n){var s,o,l,d=this,c=!i||!i.length,u=!a||!a.length,f=!1,p=c&&n&&"image"===n.attr("data-template");c&&u||(l="load.fileinputimageorient",p?(i=a,a=null,i.css(d.previewSettings.image),o=e(document.createElement("div")).appendTo(n.find(".kv-file-content")),s=e(document.createElement("span")).insertBefore(i),i.css("visibility","hidden").removeClass("file-zoom-detail").appendTo(o)):f=!i.is(":visible"),i.off(l).on(l,function(){f&&(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,h=t.getRotation(r);if(f&&(n.find(".kv-file-content").css("visibility","visible"),d.$preview.addClass("hide-content")),i.data("orientation",r),l&&a.data("orientation",r),r<5)return t.setTransform(e,h),void t.setTransform(l,h);var m=Math.atan(u/c),g=Math.sqrt(Math.pow(c,2)+Math.pow(u,2)),v=g?c/Math.cos(Math.PI/2+m)/g:1,w=" scale("+Math.abs(v)+")";t.setTransform(e,h+w),t.setTransform(l,h+w),p&&(i.css("visibility","visible").insertAfter(s).addClass("file-zoom-detail"),s.remove(),o.remove())}))},_validateImageOrientation:function(i,a,r,n,s,o,l,d){var c,u,f,p=this.autoOrientImage;if(c=this._getExifObj(d),this.canOrientImage)return i.css("image-orientation",p?"from-image":"none"),void this._validateImage(r,n,s,o,l,d,c);f=t.getZoomSelector(r," img"),(u=c?c["0th"][piexif.ImageIFD.Orientation]:null)?(this.setImageOrientation(i,e(f),u,this._getFrame(r)),this._raise("fileimageoriented",{$img:i,file:a}),this._validateImage(r,n,s,o,l,d,c)):this._validateImage(r,n,s,o,l,d,c)},_validateImage:function(e,t,i,a,r,n,s){var o,l,d,c=this,u=c.$preview,f=c._getFrame(e),p=f.attr("data-fileindex"),h=f.find("img");i=i||"Untitled",h.one("load",function(){h.data("validated")||(h.data("validated",!0),l=f.width(),d=u.width(),l>d&&h.css("width","100%"),o={ind:p,id:e,fileId:t},setTimeout(function(){var l,d;l=c._isValidSize("Small","Width",h,f,i,o),d=c._isValidSize("Small","Height",h,f,i,o),c.resizeImage||(l=l&&c._isValidSize("Large","Width",h,f,i,o),d=d&&c._isValidSize("Large","Height",h,f,i,o)),c._raise("fileimageloaded",[e]),f.data("exif",s),l&&d&&(c.fileManager.addImage(t,{ind:p,img:h,thumb:f,pid:e,typ:a,siz:r,validated:!1,imgData:n,exifObj:s}),c._validateAllImages())},c.processDelay))}).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,s){s.validated||((t=s.siz)&&t>n*i.bytesToKB&&i._getResizedImage(e,s,a,r),s.validated=!0)}))},_getResizedImage:function(i,a,r,n){var s,o,l,d,c,u,f,p,h,m=this,g=e(a.img)[0],v=g.naturalWidth,w=g.naturalHeight,b=1,_=m.maxImageWidth||v,C=m.maxImageHeight||w,x=!(!v||!w),y=m.imageCanvas,T=m.imageCanvasContext,P=a.typ,k=a.pid,F=a.ind,S=a.thumb,I=a.exifObj;if(c=function(e,t,i){m.isAjaxUpload?m._showFileError(e,t,i):m._showError(e,t,i),m._setPreviewError(S)},p={id:k,index:F,fileId:i},h=[i,k,F],(f=m.fileManager.getFile(i))&&x&&!(v<=_&&w<=C)||(x&&f&&m._raise("fileimageresized",h),r.val++,r.val===n&&m._raise("fileimagesresized"),x)){P=P||m.resizeDefaultImageType,o=v>_,l=w>C,b="width"===m.resizePreference?o?_/v:l?C/w:1:l?C/w:o?_/v:1,m._resetCanvas(),v*=b,w*=b,y.width=v,y.height=w;try{T.drawImage(g,0,0,v,w),d=y.toDataURL(P,m.resizeQuality),I&&(u=window.piexif.dump(I),d=window.piexif.insert(u,d)),s=t.dataURI2Blob(d),m.fileManager.setFile(i,s),m._raise("fileimageresized",h),r.val++,r.val===n&&m._raise("fileimagesresized",[void 0,void 0]),s instanceof Blob||c(m.msgImageResizeError,p,"fileimageresizeerror")}catch(e){r.val++,r.val===n&&m._raise("fileimagesresized",[void 0,void 0]),c(m.msgImageResizeException.replace("{errors}",e.message),p,"fileimageresizeexception")}}else c(m.msgImageResizeError,p,"fileimageresizeerror")},_showProgress:function(){this.$progress&&this.$progress.length&&this.$progress.show()},_hideProgress:function(){this.$progress&&this.$progress.length&&this.$progress.hide()},_initBrowse:function(e){var i=this.$element;this.showBrowse?this.$btnFile=e.find(".btn-file").append(i):(i.appendTo(e).attr("tabindex",-1),t.addCss(i,"file-no-browse"))},_initClickable:function(){var i,a,r=this;r.isClickable&&(i=r.$dropZone,r.isAjaxUpload||(a=r.$preview.find(".file-default-preview")).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.initialCaption||"";return this.overwriteInitial||t.isEmpty(e)?(this.$caption.val(""),!1):(this._setCaption(e),!0)},_setCaption:function(i,a){var r,n,s,o,l,d;if(this.$caption.length){if(this.$captionContainer.removeClass("icon-visible"),a)r=e("
    "+this.msgValidationError+"
    ").text(),(o=this.fileManager.count())?(d=this.fileManager.getFirstFile(),l=1===o&&d?d.nameFmt:this._getMsgSelected(o)):l=this._getMsgSelected(this.msgNo),n=t.isEmpty(i)?l:i,s=''+this.msgValidationErrorIcon+"";else{if(t.isEmpty(i))return void this.$caption.attr("title","");n=r=e("
    "+i+"
    ").text(),s=this._getLayoutTemplate("fileIcon")}this.$captionContainer.addClass("icon-visible"),this.$caption.attr("title",r).val(n),t.setHtml(this.$captionIcon,s)}},_createContainer:function(){var e={class:"file-input file-input-new"+(this.rtl?" kv-rtl":"")},i=t.createElement(t.cspBuffer.stash(this._renderMain()));return t.cspBuffer.apply(i),i.insertBefore(this.$element).attr(e),this._initBrowse(i),this.theme&&i.addClass("theme-"+this.theme),i},_refreshContainer:function(){var e=this.$container;this.$element.insertAfter(e),t.setHtml(e,this._renderMain()),this._initBrowse(e),this._validateDisabled()},_validateDisabled:function(){this.$caption.attr({readonly:this.isDisabled})},_setTabIndex:function(e,t){var i=this.tabIndexConfig[e];return t.setTokens({tabIndexConfig:null==i?"":'tabindex="'+i+'"'})},_renderMain:function(){var e=this.dropZoneEnabled?" file-drop-zone":"file-drop-disabled",t=this.showClose?this._getLayoutTemplate("close"):"",i=this.showPreview?this._getLayoutTemplate("preview").setTokens({class:this.previewClass,dropClass:e}):"",a=this.isDisabled?this.captionClass+" file-caption-disabled":this.captionClass,r=this.captionTemplate.setTokens({class:a+" kv-fileinput-caption"});return r=this._setTabIndex("caption",r),this.mainTemplate.setTokens({class:this.mainClass+(!this.showBrowse&&this.showCaption?" no-browse":""),inputGroupClass:this.inputGroupClass,preview:i,close:t,caption:r,upload:this._renderButton("upload"),remove:this._renderButton("remove"),cancel:this._renderButton("cancel"),pause:this._renderButton("pause"),browse:this._renderButton("browse")})},_renderButton:function(e){var i=this._getLayoutTemplate("btnDefault"),a=this[e+"Class"],r=this[e+"Title"],n=this[e+"Icon"],s=this[e+"Label"],o=this.isDisabled?" disabled":"",l="button";switch(e){case"remove":if(!this.showRemove)return"";break;case"cancel":if(!this.showCancel)return"";a+=" kv-hidden";break;case"pause":if(!this.showPause)return"";a+=" kv-hidden";break;case"upload":if(!this.showUpload)return"";this.isAjaxUpload&&!this.isDisabled?i=this._getLayoutTemplate("btnLink").replace("{href}",this.uploadUrl):l="submit";break;case"browse":if(!this.showBrowse)return"";i=this._getLayoutTemplate("btnBrowse");break;default:return""}return i=this._setTabIndex(e,i),a+="browse"===e?" btn-file":" fileinput-"+e+" fileinput-"+e+"-button",t.isEmpty(s)||(s=' '+s+""),i.setTokens({type:l,css:a,title:r,status:o,icon:n,label:s})},_renderThumbProgress:function(){return'
    '+this.progressInfoTemplate.setTokens({percent:101,status:this.msgUploadBegin,stats:""})+"
    "},_renderFileFooter:function(e,i,a,r,n){var s,o,l=this.fileActionSettings,d=l.showRemove,c=l.showDrag,u=l.showUpload,f=l.showRotate,p=l.showZoom,h=this._getLayoutTemplate("footer"),m=this._getLayoutTemplate("indicator"),g=n?l.indicatorError:l.indicatorNew,v=n?l.indicatorErrorTitle:l.indicatorNewTitle,w=m.setTokens({indicator:g,indicatorTitle:v});return o={type:e,caption:i,size:a=this._getSize(a),width:r,progress:"",indicator:w},this.isAjaxUpload?(o.progress=this._renderThumbProgress(),o.actions=this._renderFileActions(o,u,!1,d,f,p,c,!1,!1,!1)):o.actions=this._renderFileActions(o,!1,!1,!1,!1,p,c,!1,!1,!1),s=h.setTokens(o),s=t.replaceTags(s,this.previewThumbTags)},_renderFileActions:function(e,t,i,a,r,n,s,o,l,d,c,u,f){if(!e.type&&c&&(e.type="image"),this.enableResumableUpload?t=!1:"function"==typeof t&&(t=t(e)),"function"==typeof i&&(i=i(e)),"function"==typeof a&&(a=a(e)),"function"==typeof n&&(n=n(e)),"function"==typeof s&&(s=s(e)),"function"==typeof r&&(r=r(e)),!(t||i||a||r||n||s))return"";var p,h=!1===l?"":' data-url="'+l+'"',m="",g="",v="",w=!1===d?"":' data-key="'+d+'"',b="",_="",C="",x=this._getLayoutTemplate("actions"),y=this.fileActionSettings,T=this.otherActionButtons.setTokens({dataKey:w,key:d}),P=o?y.removeClass+" disabled":y.removeClass;return a&&(b=this._getLayoutTemplate("actionDelete").setTokens({removeClass:P,removeIcon:y.removeIcon,removeTitle:y.removeTitle,dataUrl:h,dataKey:w,key:d})),r&&(v=this._getLayoutTemplate("actionRotate").setTokens({rotateClass:y.rotateClass,rotateIcon:y.rotateIcon,rotateTitle:y.rotateTitle})),t&&(_=this._getLayoutTemplate("actionUpload").setTokens({uploadClass:y.uploadClass,uploadIcon:y.uploadIcon,uploadTitle:y.uploadTitle})),i&&(C=(C=this._getLayoutTemplate("actionDownload").setTokens({downloadClass:y.downloadClass,downloadIcon:y.downloadIcon,downloadTitle:y.downloadTitle,downloadUrl:u||this.initialPreviewDownloadUrl})).setTokens({filename:f,key:d})),n&&(m=this._getLayoutTemplate("actionZoom").setTokens({zoomClass:y.zoomClass,zoomIcon:y.zoomIcon,zoomTitle:y.zoomTitle})),s&&c&&(p="drag-handle-init "+y.dragClass,g=this._getLayoutTemplate("actionDrag").setTokens({dragClass:p,dragTitle:y.dragTitle,dragIcon:y.dragIcon})),x.setTokens({delete:b,upload:_,download:C,rotate:v,zoom:m,drag:g,other:T})},_browse:function(e){e&&e.isDefaultPrevented()||!this._raise("filebrowse")||(this.isError&&!this.isAjaxUpload&&this.clear(),this.focusCaptionOnBrowse&&this.$captionContainer.focus())},_change:function(i){var a=this;if(e(document.body).off("focusin.fileinput focusout.fileinput"),a.changeTriggered)a._toggleLoading("hide");else{a._toggleLoading("show");var r,n,s,o,l=a.$element,d=arguments.length>1,c=a.isAjaxUpload,u=d?arguments[1]:l[0].files,f=a.fileManager.count(),p=t.isEmpty(l.attr("multiple")),h=!c&&p?1:a.maxFileCount,m=a.maxTotalFileCount,g=m>0&&m>h,v=p&&f>0,w=function(t,i,r){var n,s,o,l,d,f,p=r?a.msgTotalFilesTooMany:a.msgFilesTooMany;p=p.replace("{m}",i).replace("{n}",t),a.isError=(n=p,s=null,o=null,l=null,d=e.extend(!0,{},a._getOutData(null,{},{},u),{id:o,index:l}),f={id:o,index:l,file:s,files:u},a.isPersistentError=!0,a._toggleLoading("hide"),c?a._showFileError(n,d):a._showError(n,f)),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(),o=r.length,s=c?a.fileManager.count()+o:o,n=a._getFileCount(s,!g&&void 0),h>0&&n>h){if(!a.autoReplace||o>h)return void w(a.autoReplace&&o>h?o:n,h);n>h&&a._resetPreviewThumbs(c)}else{if(g&&(n=a._getFileCount(s,!0),m>0&&n>m)){if(!a.autoReplace||o>h)return void w(a.autoReplace&&o>m?o:n,m,!0);n>h&&a._resetPreviewThumbs(c)}!c||v?(a._resetPreviewThumbs(!1),v&&a.clearFileStack()):!c||0!==f||a.previewCache.count(!0)&&!a.overwriteInitial||a._resetPreviewThumbs(!0)}a.autoReplace&&a._getThumbs().each(function(){var t=e(this);(t.hasClass("file-preview-success")||t.hasClass("file-preview-error"))&&t.remove()}),a.readFiles(r),a._toggleLoading("hide")}},_abort:function(t){var i;return this.ajaxAborted&&"object"==typeof this.ajaxAborted&&void 0!==this.ajaxAborted.message?((i=e.extend(!0,{},this._getOutData(null),t)).abortData=this.ajaxAborted.data||{},i.abortMessage=this.ajaxAborted.message,this._setProgress(101,this.$progress,this.msgCancelled),this._showFileError(this.ajaxAborted.message,i,"filecustomerror"),this.cancel(),this.unlock(),!0):!!this.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){return e=e||0,this.required&&!this.getFilesCount()?(this.$errorContainer.html(""),this._showFileError(this.msgFileRequired),!1):!(this.minFileCount>0&&this._getFileCount(e)m)&&(i||a||r)},addToStack:function(e,t){this.stackIsUpdating=!0,this.fileManager.add(e,t),this._refreshPreview(),this.stackIsUpdating=!1},clearFileStack:function(){return this.fileManager.clear(),this._initResumableUpload(),this.enableResumableUpload?(null===this.showPause&&(this.showPause=!0),null===this.showCancel&&(this.showCancel=!1)):(this.showPause=!1,null===this.showCancel&&(this.showCancel=!0)),this.$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.isAjaxUpload?this.fileManager.count():this._inputFileCount();return e&&(t+=this.previewCache.count(!0)),this._getFileCount(t)},_initCapStatus:function(e){var t=this.$caption;t.removeClass("is-valid file-processing"),e&&("processing"===e?t.addClass("file-processing"):t.addClass("is-valid"))},_toggleLoading:function(e){this.$previewStatus.html("hide"===e?"":this.msgProcessing),this.$container.removeClass("file-thumb-loading"),this._initCapStatus("hide"===e?"":"processing"),"hide"!==e&&(this.dropZoneEnabled&&this.$container.find(".file-drop-zone ."+this.dropZoneTitleClass).remove(),this.$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._toggleLoading("show")}).on("focusin.fileinput",function(){setTimeout(function(){i.val()||(t._toggleLoading("hide"),t._setFileDropZoneTitle()),a.off(r)},2500)}):t._toggleLoading("hide")},readFiles:function(i){this.reader=new FileReader;var a,r=this,n=r.reader,s=r.$previewContainer,o=r.$previewStatus,l=r.msgLoading,d=r.msgProgress,c=r.previewInitId,u=i.length,f=r.fileTypeSettings,p=r.allowedFileTypes,h=p?p.length:0,m=r.allowedFileExtensions,g=t.isEmpty(m)?"":m.join(", "),v=function(t,n,s,o,l){var d,c=e.extend(!0,{},r._getOutData(null,{},{},i),{id:s,index:o,fileId:l}),f={id:s,index:o,fileId:l,file:n,files:i};r._previewDefault(n,!0),d=r._getFrame(s,!0),r._toggleLoading("hide"),r.isAjaxUpload?setTimeout(function(){a(o+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,f),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]),s.removeClass("file-thumb-loading"),r._initCapStatus("valid"),void o.html("");r.lock(!0);var x,y,T,P,k,F,S,I,E,A,z,D,j,$,U,M,R=i[w],B=R&&R.size||0,O=r._getSize(B,!0),L=f.image,N=B/r.bytesToKB,Z="",H=0,W="",V=!1,q=0;if(M=function(e){e=e||R,x=D=r._getFileId(R),y=c+"-"+x,z=t.createObjectURL(e),A=r._getFileName(R,"")},U=function(){var e=!!C.loadedImages[x],t=d.setTokens({index:w+1,files:u,percent:50,name:A});setTimeout(function(){o.html(t),r._updateFileDetails(u),r.getFilesCount(!0)>0&&r.getFrames(":visible")&&r.$dropZone.find("."+r.dropZoneTitleClass).remove(),a(w+1)},r.processDelay),r._raise("fileloaded",[R,y,x,w,n])&&r.isAjaxUpload?e||C.add(R):e&&C.removeFile(x)},R){if(M(),h>0)for(P=0;P0&&N>r.maxFileSize)return k=r.msgSizeTooLarge.setTokens({name:A,size:O,maxSize:r._getSize(r.maxFileSize*r.bytesToKB,!0)}),void v(k,R,y,w,D);if(null!==r.minFileSize&&N<=t.getNum(r.minFileSize))return k=r.msgSizeTooSmall.setTokens({name:A,size:O,minSize:r._getSize(r.minFileSize*r.bytesToKB,!0)}),void v(k,R,y,w,D);if(!t.isEmpty(p)&&t.isArray(p)){for(P=0;P0)for(t=0;t0)for(t=0;t0?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(){if(this._raise("filereset"))return this.lastProgress=0,this._resetPreview(),this.$container.find(".fileinput-filename").text(""),t.addCss(this.$container,"file-input-new"),this.getFrames().length&&this.$container.removeClass("file-input-new"),this.clearFileStack(),this._setFileDropZoneTitle(),this.$element},disable:function(){var e=this.$container;return this.isDisabled=!0,this._raise("filedisabled"),this.$element.attr("disabled","disabled"),e.addClass("is-locked"),t.addCss(e.find(".btn-file"),"disabled"),e.find(".kv-fileinput-caption").addClass("file-caption-disabled"),e.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").attr("disabled",!0),this._initDragDrop(),this.$element},enable:function(){var e=this.$container;return this.isDisabled=!1,this._raise("fileenabled"),this.$element.removeAttr("disabled"),e.removeClass("is-locked"),e.find(".kv-fileinput-caption").removeClass("file-caption-disabled"),e.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").removeAttr("disabled"),e.find(".btn-file").removeClass("disabled"),this._initDragDrop(),this.$element},upload:function(){var i,a,r=this,n=r.fileManager,s=n.count(),o=r.taskManager,l=!e.isEmptyObject(r._getExtraData());if(n.bpsLog=[],n.bps=0,r.isAjaxUpload&&!r.isDisabled&&r._isFileSelectionValid(s)){if(r.lastProgress=0,r._resetUpload(),0!==s||l){if(r.cancelling=!1,r.uploadInitiated=!0,r._showProgress(),r.lock(),0===s&&l)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()}if(r._setProgress(2),r.hasInitData=!1,r.uploadAsync){i=0;var d=r.ajaxPool=o.addPool(t.uniqId());return e.each(r.getFileStack(),function(e){d.addTask(e+i,function(t){r._uploadSingle(i,e,!0,t)}),i++}),void d.run(r.maxAjaxThreads).done(function(){r._log("Async upload batch completed successfully."),r._raise("filebatchuploadsuccess",[n.stack,r._getExtraData()])}).fail(function(){r._log("Async upload batch completed with errors."),r._raise("filebatchuploaderror",[n.stack,r._getExtraData()])})}return r._uploadBatch(),r.$element}r._showFileError(r.msgUploadEmpty)}},destroy:function(){var t=this.$form,i=this.$container,a=this.$element,r=this.namespace;return e(document).off(r),e(window).off(r),t&&t.length&&t.off(r),this.isAjaxUpload&&this._clearFileInput(),this._cleanup(),this._initPreviewCache(),a.insertBefore(i).off(r).removeData(),i.off().remove(),a},refresh:function(i){var a=this.$element;return i="object"!=typeof i||t.isEmpty(i)?this.options:e.extend(!0,{},this.options,i),this._init(i,!0),this._listen(),a},zoom:function(e){var t=this._getFrame(e);this._showModal(t)},getExif:function(e){var t=this._getFrame(e);return t&&t.data("exif")||null},getFrames:function(i){var a;return i=i||"",a=this.$preview.find(t.FRAMES+i),this.reversePreviewOrder&&(a=e(a.get().reverse())),a},getPreview:function(){return{content:this.initialPreview,config:this.initialPreviewConfig,tags:this.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 s,o=e(this),l=o.data("fileinput"),d="object"==typeof a&&a,c=d.theme||o.data("theme"),u={},f={},p=d.language||o.data("language")||e.fn.fileinput.defaults.language||"en";l||(c&&(f=e.fn.fileinputThemes[c]||{}),"en"===p||t.isEmpty(e.fn.fileinputLocales[p])||(u=e.fn.fileinputLocales[p]||{}),s=e.extend(!0,{},e.fn.fileinput.defaults,f,e.fn.fileinputLocales.en,u,d,o.data()),l=new i(this,s),o.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 a="btn btn-sm btn-kv "+t.defaultButtonCss(),r="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);return!(!!e.match(/iP(od|ad|hone)/i)&&t&&!e.match(/CriOS/i))},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:'',rotate:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewZoomButtonClasses:{prev:"btn btn-default btn-outline-secondary btn-navigate",next:"btn btn-default btn-outline-secondary btn-navigate",rotate:a,toggleheader:a,fullscreen:a,borderless:a,close:a},previewTemplates:{},previewContentTemplates:{},preferIconicPreview:!1,preferIconicZoomPreview:!1,alwaysPreviewFileExtensions:[],rotatableFileExtensions:["jpg","jpeg","png","gif"],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:r,cancelIcon:'',cancelClass:r,pauseIcon:'',pauseClass:r,uploadIcon:'',uploadClass:r,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:!1,skipErrorsAndProceed:!1},uploadExtraData:{},zoomModalHeight:485,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}) is too small and must be larger than {minSize}.',msgSizeTooLarge:'File "{name}" ({size}) exceeds maximum allowed upload size of {maxSize}.',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 (detected {dimension} px).',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px (detected {dimension} px).',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px (detected {dimension} px).',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px (detected {dimension} 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}" 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",rotate:"Rotate 90 deg. clockwise",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