\n',tagBefore2:'
\n',tagAfter:"
{footer}\n{zoomCache}
\n"},previewContentTemplates:{generic:"{content}\n",html:o,image:l,text:d,office:c,gdocs:u,video:p,audio:f,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:!1,removeIcon:'
',removeClass:x,removeErrorClass:"btn btn-sm btn-kv btn-danger",removeTitle:"Remove file",uploadIcon:'
',uploadClass:x,uploadTitle:"Upload file",uploadRetryIcon:'
',uploadRetryTitle:"Retry upload",downloadIcon:'
',downloadClass:x,downloadTitle:"Download file",rotateIcon:'
',rotateClass:x,rotateTitle:"Rotate 90 deg. clockwise",zoomIcon:'
',zoomClass:x,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,s=r.tagAfter;e.each(a.previewContentTemplates,function(e,n){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+n+s)})},_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,s,n,o,l,d,c,u=t.INIT_FLAG+e,p=i.previewCache.data,f=p.config[e],h=p.content[e],m=t.ifSet("previewAsData",f,i.initialPreviewAsData),g=f?{title:f.title||null,alt:f.alt||null}:{title:null,alt:null},v=function(e,a,r,s,n,o,l,d){var c=" file-preview-initial "+t.SORT_CSS+(l?" "+l:""),u=i.previewInitId+"-"+o,p=f&&f.fileId||u;return i._generatePreviewTemplate(e,a,r,s,u,p,!1,null,null,c,n,o,d,g,f&&f.zoomData||a)};return h&&h.length?(a=void 0===a||a,n=t.ifSet("type",f,i.initialPreviewFileType||"generic"),l=t.ifSet("filename",f,t.ifSet("caption",f)),d=t.ifSet("filetype",f,n),o=i.previewCache.footer(e,a,f&&f.size||null),c=t.ifSet("frameClass",f),r=m?v(n,h,l,d,o,u,c):v("generic",h,l,d,o,u,c,n).setTokens({content:p.content[e]}),p.tags.length&&p.tags[e]&&(r=t.replaceTags(r,p.tags[e])),t.isEmpty(f)||t.isEmpty(f.frameAttr)||(s=t.createDiv(),t.setHtml(s,r),s.find(".file-preview-initial").attr(f.frameAttr),r=s.html(),s.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,s){var n,o=i.previewCache.data;return e&&e.length?(n=e.length-1,t.isArray(e)||(e=e.split(i.initialPreviewDelimiter)),s&&o.content?(n=o.content.push(e[0])-1,o.config[n]=a,o.tags[n]=r):(o.content=e,o.config=a,o.tags=r),i.previewCache.clean(o),n):0},set:function(e,a,r,s){var n,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=[]),s){for(n=0;n
"+a+": "+e)):i||this.$errorContainer.html(""),this._showFileError(e,t,"fileusererror"))},_showFileError:function(e,i,a){var r=this.$errorContainer,s=a||"fileuploaderror",n=i&&i.fileId||"",o=i&&i.id?''+e+"":""+e+"";return 0===r.find("ul").length?this._addError(""):(r.find("ul").append(t.cspBuffer.stash(o)),t.cspBuffer.apply(r)),r.fadeIn(this.fadeDelay),this._raise(s,[i,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(""):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(e,i,a,r){var s,n,o,l=t.trim(a+"");return o=(n=i.responseJSON&&i.responseJSON.error?i.responseJSON.error.toString():"")||i.responseText,this.cancelling&&this.msgUploadAborted&&(l=this.msgUploadAborted),this.showAjaxErrorDetails&&o&&(n?l=t.trim(n+""):(s=(o=t.trim(o.replace(/\n\s*\n/g,"\n"))).length?""+o+"
":"",l+=l?s:o)),l||(l=this.msgAjaxError.replace("{operation}",e)),this.cancelling=!1,r?""+r+": "+l:l},_parseFileType:function(e,i){var a,r,s,n=this.allowedPreviewTypes||[];if("application/text-plain"===e)return"text";for(s=0;s-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,s=!1===r;if(a.isDefaultPrevented()||s)return!1;if("filebatchpreupload"===a.type&&(r||s))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,s=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(s.find(".fileinput-remove:not([disabled])"),"click",e.proxy(i.clear,i)),i._handler(s.find(".fileinput-cancel"),"click",e.proxy(i.cancel,i)),i._handler(s.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,s,n,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&&(s=e.createReader(),(n=function(){s.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")},_addFilesFromSystem:function(e,a,r){var s=this,n=a.files,o=a.items,l=t.getDragDropFolders(o);if(e.preventDefault(),s.isDisabled||t.isEmpty(n)||!n.length)console.log("No valid copied files found in clipboard for pasting.");else if(s._raise(r,{sourceEvent:e,files:n}))if(l>0){if(!s.isAjaxUpload)return void s._showFolderError(l);for(n=[],i=0;i0&&s>=l,c=e(i.item);d&&(s=l-1),n.initialPreview=t.moveArray(n.initialPreview,r,s,u),n.initialPreviewConfig=t.moveArray(n.initialPreviewConfig,r,s,u),n.previewCache.init(),n.getFrames(".file-preview-initial").each(function(){e(this).attr("data-fileindex",t.INIT_FLAG+o),o++}),d&&(a=n.getFrames(":not(.file-preview-initial):first")).length&&c.slideUp(function(){c.insertBefore(a).slideDown()}),n._raise("filesorted",{previewId:c.attr("id"),oldIndex:r,newIndex:s,stack:n.initialPreviewConfig})}},e.extend(!0,i,n.fileActionSettings.dragSettings),n.sortable&&n.sortable.destroy(),n.sortable=p.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,s,n,o=e(this),l=t.initialPreviewConfig[i];l&&l.exif&&l.exif.Orientation&&(n=o.attr("id"),r=o.find(">.kv-file-content img"),s=t._getZoom(n," >.kv-file-content img"),a?r.css("image-orientation",t.autoOrientImageInitial?"from-image":"none"):t.setImageOrientation(r,s,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]||"")+'" ',s=t.isBs(5)?"bs-":"",n=r+("close"===e?" data-"+s+'dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==e&&"borderless"!==e&&"toggleheader"!==e||(n+=' data-toggle="button" aria-pressed="false"'),'"},_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 s=a.find(".btn-fullscreen"),n=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")),n.removeClass("active").attr("aria-pressed","false"),s.removeClass("active").attr("aria-pressed","false"),a.hasClass("file-zoom-fullscreen")&&(i._maximizeZoomDialog(),t.checkFullScreen()?s.addClass("active").attr("aria-pressed","true"):n.addClass("active").attr("aria-pressed","true")))}})},_initZoom:function(){var i,a=this,r=a._getLayoutTemplate("modalMain"),s="#"+t.MODAL_ID;r=a._setTabIndex("modal",r),a.showPreview&&(a.$modal=e(s),a.$modal&&a.$modal.length||(i=t.createElement(t.cspBuffer.stash(r)).insertAfter(a.$container),a.$modal=e(s).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")||"",s=this.getFrames().toArray(),n=s.length,o=a.find(".btn-kv-prev"),l=a.find(".btn-kv-next");a.find(".btn-kv-rotate");if(s.length<2)return o.hide(),void l.hide();o.show(),l.show(),n&&(t=e(s[0]),i=e(s[n-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"),s=e(window).height();t.addClass("file-zoom-fullscreen"),i&&i.length&&(s-=i.outerHeight(!0)),a&&a.length&&(s-=a.outerHeight(!0)),r&&r.length&&(s-=r.outerHeight(!0)-r.height()),t.find(".kv-zoom-body").height(s)},_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,s,n,o,l,d,c,u,p,f,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"),y=b.find(".btn-kv-toggleheader"),x=i.data("zoom");x&&(x=decodeURIComponent(x),m=w.html().replace(g.zoomPlaceholder,"").setTokens({zoomData:x}),t.setHtml(w,m),i.data("zoom",""),w.attr("data-zoom",x)),s=w.attr("data-template")||"generic",n=(r=w.find(".kv-file-content")).length?r.html():"",f=i.data("caption")||g.msgZoomModalHeading,h=i.data("size")||"",u=i.data("description")||"",t.setHtml(b.find(".kv-zoom-caption").attr("title",f),f),t.setHtml(b.find(".kv-zoom-size"),h),p=b.find(".kv-zoom-description").hide(),u&&(g.showDescriptionClose&&(u=g._getLayoutTemplate("descriptionClose").setTokens({closeIcon:g.previewZoomButtonIcons.close})+""+u),t.setHtml(p,u).show(),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,n).hide(),c.fadeOut("fast",function(){o.fadeIn("fast",function(){o.removeClass("file-thumb-loading")}),c.remove()})):t.setHtml(o,n),(d=g.previewZoomSettings[s])&&(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(y,"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,s=g.processDelay+1,n=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:[n,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()},s)},s)))})})},_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,s,n,o,l,d=this.$modal,c=d.find(".kv-zoom-actions .btn-kv-"+t),u=this.getFrames().toArray(),p=[],f=u.length;if(this.reversePreviewOrder&&(t="prev"===t?"next":"prev"),!c.attr("disabled")){for(r=0;r=f||!p[n]||((a=e(p[n])).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,s=this.showUploadedThumbs,n=!this.removeFromPreviewOnError,o=(s||n)&&this.isDuplicateError;this.previewCache.count(!0)?(i=this.previewCache.out(),o&&(r=t.createDiv().insertAfter(this.$container),this.getFrames().each(function(){var t=e(this);(s&&t.hasClass("file-preview-success")||n&&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,s=function(e){var s=0,n=e.total,o=e.loaded||e.position,l=r.getUploadStats(i,o,n);e.lengthComputable&&!a.enableResumableUpload&&(s=t.round(o/n*100)),i?a._setFileUploadStats(i,s,l):a._setProgress(s,null,null,a._getStats(l)),a._raise("fileajaxprogress",[l])};return e.upload&&(a.progressDelay&&(s=t.debounce(s,a.progressDelay)),e.upload.addEventListener("progress",s,!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,s=this.mergeAjaxCallbacks;"delete"===i&&(r=this._ajaxDeleteSettings,s=this.mergeAjaxDeleteCallbacks),a=r[e],r[e]=s&&"function"==typeof a?"before"===s?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,s,n,o,l){var d,c,u,p=this,f=p.taskManager;p._raise("filepreajax",[s,n,o])&&(s.append("initialPreview",JSON.stringify(p.initialPreview)),s.append("initialPreviewConfig",JSON.stringify(p.initialPreviewConfig)),s.append("initialPreviewThumbTags",JSON.stringify(p.initialPreviewThumbTags)),p._initAjaxSettings(),p._mergeAjaxCallback("beforeSend",t),p._mergeAjaxCallback("success",i),p._mergeAjaxCallback("complete",a),p._mergeAjaxCallback("error",r),"function"==typeof(l=l||p.uploadUrlThumb||p.uploadUrl)&&(l=l()),"object"==typeof(u=p._getExtraData(n,o)||{})&&e.each(u,function(e,t){s.append(e,t)}),c={xhr:function(){var t=e.ajaxSettings.xhr();return p._initXhr(t,n)},url:p._encodeURI(l),type:"POST",dataType:"json",data:s,cache:!1,processData:!1,contentType:!1},d=e.extend(!0,{},c,p._ajaxSettings),p.ajaxQueue.push(d),f.addTask(n+"-"+o,function(){var t,i,a=this.self;t=a.ajaxQueue.shift(),i=e.ajax(t),a.ajaxRequests.push(i)}).runWithContext({self:p}))},_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 s,n,o,l,d,c,u,p,f,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||[],s=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?(p=a.attr("id"),null!==(f=h._getUploadCacheIndex(p))&&(h.uploadCache[f]={id:p,content:d[0],config:c[0]||[],tags:u[0]||[],append:s})):(o=h.previewCache.add(d[0],c[0],u[0],s),n=h.previewCache.get(o,!1),l=t.createElement(t.cspBuffer.stash(n)).hide().appendTo(a),t.cspBuffer.apply(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,s),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),F=b.ajaxOperations.uploadThumb,P=_.getFile(a),S={id:x,index:i,fileId:a},k=b.fileManager.getFileName(a,!0),I=function(){s&&s.resolve&&s.resolve()};b.enableResumableUpload||(b.uploadInitiated=!0,b.showPreview&&(o=_.getThumb(a),p=o.find(".file-thumb-progress"),d=o.find(".kv-file-upload"),c=o.find(".kv-file-remove"),p.show()),0===C||!T||b.showPreview&&d&&d.hasClass("disabled")||b._abort(S)||(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)},f=function(s){n=b._getOutData(y,s),_.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",[n,x,i,b._getThumbFileId(o)]),e.extend(!0,S,n),b._abort(S)&&(s.abort(),r||(b._setThumbStatus(o,"New"),o.removeClass("file-uploading"),d.removeAttr("disabled"),c.removeAttr("disabled")),b._setProgressCancelled())},m=function(s,l,c){var f=b.showPreview&&o.attr("id")?o.attr("id"):x;n=b._getOutData(y,c,s),e.extend(!0,S,n),setTimeout(function(){t.isEmpty(s)||t.isEmpty(s.error)?(b.showPreview&&(b._setThumbStatus(o,"Success"),d.hide(),b._initUploadSuccess(s,o,r),b._setProgress(101,p)),b._raise("fileuploaded",[n,f,i,b._getThumbFileId(o)]),r?(w(),I()):b.fileManager.remove(o)):(u=!0,h=b._parseError(F,c,b.msgUploadError,b.fileManager.getFileName(a)),b._showFileError(h,S),b._setPreviewError(o,!0),b.retryErrorUploads||d.hide(),r&&(w(),I()),b._setProgress(101,b._getFrame(f).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,n){h=b._parseError(F,t,n,b.fileManager.getFileName(a)),u=!0,setTimeout(function(){var i;r&&(w(),s&&s.reject&&s.reject()),b.fileManager.setProgress(a,100),b._setPreviewError(o,!0),b.retryErrorUploads||d.hide(),e.extend(!0,S,b._getOutData(y,t)),b._setProgress(101,b.$progress,b.msgAjaxProgressError.replace("{operation}",F)),i=b.showPreview&&o?o.find(".file-thumb-progress"):"",b._setProgress(101,i,b.msgUploadError),b._showFileError(h,S)},b.processDelay)},b._setFileData(y,P.file,k,a),b._setUploadData(y,{fileId:a}),b._ajaxSubmit(f,m,g,v,y,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,s,n,o,l=this,d=l.fileManager,c=d.total(),u=c>0||!e.isEmptyObject(l.uploadExtraData),p=new FormData,f=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(p,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 s=l._getOutData(p,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",[s]),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)),n=l._parseError(f,r,l.msgUploadError),l._showFileError(n,s,"filebatchuploaderror"),l._setProgress(101,l.$progress,l.msgUploadError))},s=function(){l.unlock(),l._initSuccessThumbs(),l._clearFileInput(),l._raise("filebatchuploadcomplete",[l.fileManager.stack,l._getExtraData()])},r=function(t,i,a){var r=l._getOutData(p,t);n=l._parseError(f,t,a),l._showFileError(n,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}",f)))};var h=0;e.each(l.fileManager.stack,function(e,i){t.isEmpty(i.file)||l._setFileData(p,i.file,i.nameFmt||"untitled_"+h,e),h++}),l._ajaxSubmit(i,a,s,r,p)}},_uploadExtraOnly:function(){var e,i,a,r,s,n=this,o={},l=new FormData,d=n.ajaxOperations.uploadExtra;e=function(e){n.lock();var t=n._getOutData(l,e);n._setProgress(50),o.data=t,o.xhr=e,n._checkBatchPreupload(t,e)},i=function(e,i,a){var r=n._getOutData(l,a,e);t.isEmpty(e)||t.isEmpty(e.error)?(n._raise("filebatchuploadsuccess",[r]),n._clearFileInput(),n._initUploadSuccess(e),n._setProgress(101)):(s=n._parseError(d,a,n.msgUploadError),n._showFileError(s,r,"filebatchuploaderror"))},a=function(){n.unlock(),n._clearFileInput(),n._raise("filebatchuploadcomplete",[n.fileManager.stack,n._getExtraData()])},r=function(e,t,i){var a=n._getOutData(l,e);s=n._parseError(d,e,i),o.data=a,n._showFileError(s,a,"filebatchuploaderror"),n._setProgress(101,n.$progress,n.msgAjaxProgressError.replace("{operation}",d))},n._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="",s=e.previewCache.count(!0),n=e.fileManager.count(),o=e.showPreview&&e.getFrames(":not(.file-preview-success):not(.file-preview-error)").length;0!==n||0!==s||o?((t=s+n)>1?r=e._getMsgSelected(t):0===n?(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,s,n,o,l,d,c,u,p,f="",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)",s="rotate("+(n=a%360)+"deg)",f="",90!==n&&270!==n||(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(),p=g.width(),u>h*(c=Math.min(d,p))&&(h=c>u&&0!=c?(u/c).toFixed(2):1)),1!==h&&(f=" scale("+h+")")),i.addClass("rotate-animate").css("transform",r+f),setTimeout(function(){i.removeClass("rotate-animate").css("transform",s+f),w&&v.removeClass("kv-overflow-hidden"),t.data("angle",n)},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),s=r.find(".kv-file-content > :first-child");i._handler(a,"click",function(){var e=(r.data("angle")||0)+90;i._handleRotation(r,s,e)})})},_initRotateZoom:function(e,t){var i=this,a=i.$modal,r=a.find(".btn-kv-rotate"),s=e.data("angle");a.data("angle",s),r.length&&(r.off("click"),a.hasClass("rotatable")&&r.on("click",function(){s=(a.data("angle")||0)+90,a.data("angle",s),i._handleRotation(a,a.find(".file-zoom-detail"),s),i._handleRotation(e,t,s),e.hasClass("hide-rotate")&&e.data("angle",s)}))},_initFileActions:function(){var i=this;i.showPreview&&(i._initZoomButton(),i._initRotateButton(),i.getFrames(" .kv-file-remove").each(function(){var a,r=e(this),s=r.closest(t.FRAMES),n=s.attr("id"),o=s.attr("data-fileindex");i.fileManager;i._handler(r,"click",function(){if(!1===i._raise("filepreremove",[n,o])||!i._validateMinCount())return!1;a=s.hasClass("file-preview-error"),t.cleanMemory(s),s.fadeOut("slow",function(){i.fileManager.remove(s),i._clearObjects(s),s.remove(),n&&a&&i.$errorContainer.find('li[data-thumb-id="'+n+'"]').fadeOut("fast",function(){e(this).remove(),i._errorsExist()||i._resetErrors()}),i._clearFileInput(),i._resetCaption(),i._raise("fileremoved",[n,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||{},s=t.FRAMES+" .kv-file-remove",n=i.fileActionSettings,o=n.removeClass,l=n.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(s).each(function(){var a,s,n,c,u=e(this),p=u.data("url")||i.deleteUrl,f=u.data("key"),h=i.ajaxOperations.deleteThumb;if(!t.isEmpty(p)&&void 0!==f){"function"==typeof p&&(p=p());var m,g,v,w,b,_=u.closest(t.FRAMES),C=i.previewCache.data,y=_.attr("data-fileindex");y=parseInt(y.replace(t.INIT_FLAG,"")),v=t.isEmpty(C.config)&&t.isEmpty(C.config[y])?null:C.config[y],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:f,extra:b},s=function(e){i.ajaxAborted=!1,i._raise("filepredelete",[f,e,b]),i._abort()?e.abort():(u.removeClass(l),t.addCss(_,"file-uploading"),t.addCss(u,"disabled "+o))},n=function(e,r,s){var n,c;if(!t.isEmpty(e)&&!t.isEmpty(e.error))return g.jqXHR=s,g.response=e,a=i._parseError(h,s,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(){y=parseInt(_.attr("data-fileindex").replace(t.INIT_FLAG,"")),i.previewCache.unset(y),i._deleteFileIndex(_),n=i.previewCache.count(!0),c=n>0?i._getMsgSelected(n):"",i._setCaption(c),i._raise("filedeleted",[f,s,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",s,"delete"),i._mergeAjaxCallback("success",n,"delete"),i._mergeAjaxCallback("error",c,"delete"),m=e.extend(!0,{},{url:i._encodeURI(p),type:"POST",dataType:"json",data:e.extend(!0,{},{key:f},b)},i._ajaxDeleteSettings),i._handler(u,"click",function(){if(!i._validateMinCount())return!1;i.ajaxAborted=!1,i._raise("filebeforedelete",[f,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(e,i,a){var r,s,n=parseFloat(e),o=0,l=this.bytesToKB,d=this.fileSizeGetter,c=n;if(!t.isNumeric(e)||!t.isNumeric(n))return"";if("function"==typeof d)r=d(n);else{if(a||(a=this.sizeUnits),n>0){for(;c>=l;)c/=l,++o;a[o]||(c=n,o=0)}(s=c.toFixed(2))==c&&(s=c),r=s+" "+a[o]}return i?r:this._getLayoutTemplate("size").replace("{sizeText}",r)},_getFileType:function(e){return this.mimeTypeAliases[e]||e},_generatePreviewTemplate:function(i,a,r,s,n,o,l,d,c,u,p,f,h,m,g){var v,w,b,_,C=this,y=C.slug(r),x="",T="",F=c||r,P=F.split(".").pop().toLowerCase(),S=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,k=y,I=y,E="type-default",A=p||C._renderFileFooter(i,y,d,"auto",l),z=-1!==e.inArray(P,C.alwaysPreviewFileExtensions),D=C.preferIconicPreview&&!z,j=C.preferIconicZoomPreview&&!z,U=D?"other":i;return(v=S<400?C.previewSettingsSmall[U]||C.defaults.previewSettingsSmall[U]:C.previewSettings[U]||C.defaults.previewSettings[U])&&e.each(v,function(e,t){T+=e+":"+t+";"}),w=function(a,l,d,c,p){var g,v=d?"zoom-"+n:n,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||s||e.each(C.defaults.fileTypeSettings,function(e,t){"object"!==e&&"other"!==e&&t(r,s)&&(E="type-"+e)}),t.isEmpty(m)||(void 0!==m.title&&null!==m.title&&(k=m.title),void 0!==m.alt&&null!==m.alt&&(I=k=m.alt)),g={previewId:v,caption:y,title:k,alt:I,frameClass:b,type:C._getFileType(s),fileindex:f,fileid:o||"",filename:F,typeCss:E,footer:A,data:l,template:h||i,style:T?'style="'+T+'"':"",zoomData:p?encodeURIComponent(p):""},d&&(g.zoomCache="",g.zoomData="{zoomData}"),w.setTokens(g)},f=f||n.slice(n.lastIndexOf("-")+1),_=C.fileActionSettings.showRotate&&-1!==e.inArray(P,C.rotatableFileExtensions),C.fileActionSettings.showZoom&&(b="kv-zoom-thumb",_&&(b+=" rotatable"+(j?" hide-rotate":"")),x=w(j?"other":i,a,!0,b,g)),x="\n"+C._getLayoutTemplate("zoomCache").replace("{zoomContent}",x),"function"==typeof C.sanitizeZoomCache&&(x=C.sanitizeZoomCache(x)),b="kv-preview-thumb",_&&(b+=" rotatable"+(D||C.hideThumbnailContent||!!C.previewFileIconSettings[P]?" hide-rotate":"")),w(D?"other":i,a,!1,b,g).setTokens({zoomCache:x})},_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,s=t.getFileName(e),n=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),p=this._getThumbId(u);this._clearDefaultPreview(),r=this._generatePreviewTemplate("other",c,s,n,p,u,d,o),this._addToPreview(a,r),this._setThumbAttr(p,l,o),!0===i&&this.isAjaxUpload&&this._setThumbStatus(this._getFrame(p),"Error")}},_previewFile:function(e,i,a,r,s){if(this.showPreview){var n,o=t.getFileName(i),l=s.type,d=s.name,c=this._parseFileType(l,o),u=this.$preview,p=i.size||0,f="image"===c?a.target.result:r,h=this.fileManager.getId(i),m=this._getThumbId(h);n=this._generatePreviewTemplate(c,f,o,l,m,h,!1,p,s.filename),this._clearDefaultPreview(),this._addToPreview(u,n);var g=this._getFrame(m);this._validateImageOrientation(g.find("img"),i,m,h,d,l,p,f),this._setThumbAttr(m,d,p),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,s,n=this.previewCache.data,o=this.previewCache.count(!0);if(0!==o)for(var l=0;l&"']/g,"_")},_updateFileDetails:function(e){var i,a,r,s,n=this.$element,o=t.isIE(9)&&t.findFileName(n.val())||n[0].files[0]&&n[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,s=this.previewCache.count(!0)+a,r=1===a?i:this._getMsgSelected(s,!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",s="file-preview-"+i.toLowerCase(),n=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(n,o[a]),n.attr("title",o[r]),e.addClass(s),"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 s,n=Math.min(e,100),o=this.progressUploadThreshold,l=e<=100?this.progressTemplate:this.progressCompleteTemplate,d=n<100?this.progressTemplate:a?this.paused?this.progressPauseTemplate:this.progressErrorTemplate:l;e>=100&&(r=""),t.isEmpty(d)||(r=r||"",s=(s=o&&n>o&&e<=100?d.setTokens({percent:o,status:this.msgUploadThreshold}):d.setTokens({percent:n,status:e>100?this.msgUploadEnd:n+"%"})).setTokens({stats:r}),t.setHtml(i,s),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(t.cspBuffer.stash(''+a+"
")),t.cspBuffer.apply(i)),this.$container.removeClass("file-input-new"),this.isAjaxUpload&&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,s=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:s,size:c,dimension:l}),n),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,s){var n,o,l,d=this,c=!i||!i.length,u=!a||!a.length,p=!1,f=c&&s&&"image"===s.attr("data-template");c&&u||(l="load.fileinputimageorient",f?(i=a,a=null,i.css(d.previewSettings.image),o=t.createDiv().appendTo(s.find(".kv-file-content")),n=e(document.createElement("span")).insertBefore(i),i.css("visibility","hidden").removeClass("file-zoom-detail").appendTo(o)):p=!i.is(":visible"),i.off(l).on(l,function(){p&&(d.$preview.removeClass("hide-content"),s.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(p&&(s.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),f&&(i.css("visibility","visible").insertAfter(n).addClass("file-zoom-detail"),n.remove(),o.remove())}))},_validateImageOrientation:function(i,a,r,s,n,o,l,d){var c,u,p,f=this.autoOrientImage;if(c=this._getExifObj(d),this.canOrientImage)return i.css("image-orientation",f?"from-image":"none"),void this._validateImage(r,s,n,o,l,d,c);p=t.getZoomSelector(r," img"),(u=c?c["0th"][piexif.ImageIFD.Orientation]:null)?(this.setImageOrientation(i,e(p),u,this._getFrame(r)),this._raise("fileimageoriented",{$img:i,file:a}),this._validateImage(r,s,n,o,l,d,c)):this._validateImage(r,s,n,o,l,d,c)},_validateImage:function(e,t,i,a,r,s,n){var o,l,d,c=this,u=c.$preview,p=c._getFrame(e),f=p.attr("data-fileindex"),h=p.find("img");i=i||"Untitled",h.one("load",function(){h.data("validated")||(h.data("validated",!0),l=p.width(),d=u.width(),l>d&&h.css("width","100%"),o={ind:f,id:e,fileId:t},setTimeout(function(){var l,d;l=c._isValidSize("Small","Width",h,p,i,o),d=c._isValidSize("Small","Height",h,p,i,o),c.resizeImage||(l=l&&c._isValidSize("Large","Width",h,p,i,o),d=d&&c._isValidSize("Large","Height",h,p,i,o)),c._raise("fileimageloaded",[e]),p.data("exif",n),l&&d&&(c.fileManager.addImage(t,{ind:f,img:h,thumb:p,pid:e,typ:a,siz:r,validated:!1,imgData:s,exifObj:n}),c._validateAllImages())},c.processDelay))}).one("error",function(){c._raise("fileimageloaderror",[e])})},_validateAllImages:function(){var t,i=this,a={val:0},r=i.fileManager.getImageCount(),s=i.resizeIfSizeMoreThan;r===i.fileManager.totalImages&&(i._raise("fileimagesloaded"),i.resizeImage&&e.each(i.fileManager.loadedImages,function(e,n){n.validated||((t=n.siz)&&t>s*i.bytesToKB&&i._getResizedImage(e,n,a,r),n.validated=!0)}))},_getResizedImage:function(i,a,r,s){var n,o,l,d,c,u,p,f,h,m=this,g=e(a.img)[0],v=g.naturalWidth,w=g.naturalHeight,b=1,_=m.maxImageWidth||v,C=m.maxImageHeight||w,y=!(!v||!w),x=m.imageCanvas,T=m.imageCanvasContext,F=a.typ,P=a.pid,S=a.ind,k=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(k)},f={id:P,index:S,fileId:i},h=[i,P,S],(p=m.fileManager.getFile(i))&&y&&!(v<=_&&w<=C)||(y&&p&&m._raise("fileimageresized",h),r.val++,r.val===s&&m._raise("fileimagesresized"),y)){F=F||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,x.width=v,x.height=w;try{T.drawImage(g,0,0,v,w),d=x.toDataURL(F,m.resizeQuality),I&&(u=window.piexif.dump(I),d=window.piexif.insert(u,d)),n=t.dataURI2Blob(d),m.fileManager.setFile(i,n),m._raise("fileimageresized",h),r.val++,r.val===s&&m._raise("fileimagesresized",[void 0,void 0]),n instanceof Blob||c(m.msgImageResizeError,f,"fileimageresizeerror")}catch(e){r.val++,r.val===s&&m._raise("fileimagesresized",[void 0,void 0]),c(m.msgImageResizeException.replace("{errors}",e.message),f,"fileimageresizeexception")}}else c(m.msgImageResizeError,f,"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,s,n,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),s=t.isEmpty(i)?l:i,n=''+this.msgValidationErrorIcon+"";else{if(t.isEmpty(i))return void this.$caption.attr("title","");s=r=e(""+i+"
").text(),n=this._getLayoutTemplate("fileIcon")}this.$captionContainer.addClass("icon-visible"),this.$caption.attr("title",r).val(s),t.setHtml(this.$captionIcon,n)}},_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"],s=this[e+"Icon"],n=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(n)||(n=' '+n+""),i.setTokens({type:l,css:a,title:r,status:o,icon:s,label:n})},_renderThumbProgress:function(){return''+this.progressInfoTemplate.setTokens({percent:101,status:this.msgUploadBegin,stats:""})+"
"},_renderFileFooter:function(e,i,a,r,s){var n,o,l=this.fileActionSettings,d=l.showRemove,c=l.showDrag,u=l.showUpload,p=l.showRotate,f=l.showZoom,h=this._getLayoutTemplate("footer"),m=this._getLayoutTemplate("indicator"),g=s?l.indicatorError:l.indicatorNew,v=s?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,p,f,c,!1,!1,!1)):o.actions=this._renderFileActions(o,!1,!1,!1,!1,f,c,!1,!1,!1),n=h.setTokens(o),n=t.replaceTags(n,this.previewThumbTags)},_renderFileActions:function(e,t,i,a,r,s,n,o,l,d,c,u,p){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 s&&(s=s(e)),"function"==typeof n&&(n=n(e)),"function"==typeof r&&(r=r(e)),!(t||i||a||r||s||n))return"";var f,h=!1===l?"":' data-url="'+l+'"',m="",g="",v="",w=!1===d?"":' data-key="'+d+'"',b="",_="",C="",y=this._getLayoutTemplate("actions"),x=this.fileActionSettings,T=this.otherActionButtons.setTokens({dataKey:w,key:d}),F=o?x.removeClass+" disabled":x.removeClass;return a&&(b=this._getLayoutTemplate("actionDelete").setTokens({removeClass:F,removeIcon:x.removeIcon,removeTitle:x.removeTitle,dataUrl:h,dataKey:w,key:d})),r&&(v=this._getLayoutTemplate("actionRotate").setTokens({rotateClass:x.rotateClass,rotateIcon:x.rotateIcon,rotateTitle:x.rotateTitle})),t&&(_=this._getLayoutTemplate("actionUpload").setTokens({uploadClass:x.uploadClass,uploadIcon:x.uploadIcon,uploadTitle:x.uploadTitle})),i&&(C=(C=this._getLayoutTemplate("actionDownload").setTokens({downloadClass:x.downloadClass,downloadIcon:x.downloadIcon,downloadTitle:x.downloadTitle,downloadUrl:u||this.initialPreviewDownloadUrl})).setTokens({filename:p,key:d})),s&&(m=this._getLayoutTemplate("actionZoom").setTokens({zoomClass:x.zoomClass,zoomIcon:x.zoomIcon,zoomTitle:x.zoomTitle})),n&&c&&(f="drag-handle-init "+x.dragClass,g=this._getLayoutTemplate("actionDrag").setTokens({dragClass:f,dragTitle:x.dragTitle,dragIcon:x.dragIcon})),y.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,s,n,o,l=a.$element,d=arguments.length>1,c=a.isAjaxUpload,u=d?arguments[1]:l[0].files,p=a.fileManager.count(),f=t.isEmpty(l.attr("multiple")),h=!c&&f?1:a.maxFileCount,m=a.maxTotalFileCount,g=m>0&&m>h,v=f&&p>0,w=function(t,i,r){var s,n,o,l,d,p,f=r?a.msgTotalFilesTooMany:a.msgFilesTooMany;f=f.replace("{m}",i).replace("{n}",t),a.isError=(s=f,n=null,o=null,l=null,d=e.extend(!0,{},a._getOutData(null,{},{},u),{id:o,index:l}),p={id:o,index:l,file:n,files:u},a.isPersistentError=!0,a._toggleLoading("hide"),c?a._showFileError(s,d):a._showError(s,p)),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,n=c?a.fileManager.count()+o:o,s=a._getFileCount(n,!g&&void 0),h>0&&s>h){if(!a.autoReplace||o>h)return void w(a.autoReplace&&o>h?o:s,h);s>h&&a._resetPreviewThumbs(c)}else{if(g&&(s=a._getFileCount(n,!0),m>0&&s>m)){if(!a.autoReplace||o>h)return void w(a.autoReplace&&o>m?o:s,m,!0);s>h&&a._resetPreviewThumbs(c)}!c||v?(a._resetPreviewThumbs(!1),v&&a.clearFileStack()):!c||0!==p||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"),s=a.attr("id");"-1"!==r&&-1!==r&&(t._getThumbFile(a)?a.attr({"data-fileindex":"-1"}):(a.attr({"data-fileindex":i}),i++),t._getZoom(s).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){t.setHtml(this.$previewStatus,"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._setFileDropZoneTitle(),a.off(r),t._toggleLoading("hide")},2500)}):t._toggleLoading("hide")},readFiles:function(i){this.reader=new FileReader;var a,r=this,s=r.reader,n=r.$previewContainer,o=r.$previewStatus,l=r.msgLoading,d=r.msgProgress,c=r.previewInitId,u=i.length,p=r.fileTypeSettings,f=r.allowedFileTypes,h=f?f.length:0,m=r.allowedFileExtensions,g=t.isEmpty(m)?"":m.join(", "),v=function(t,s,n,o,l){var d,c=e.extend(!0,{},r._getOutData(null,{},{},i),{id:n,index:o,fileId:l}),p={id:n,index:o,fileId:l,file:s,files:i};Object.values(i).forEach(e=>{r._previewDefault(e,!0)}),d=r._getFrame(n,!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,p),r._updateFileDetails(u)};r.fileManager.clearImages(),e.each(i,function(e,t){var i=r.fileTypeSettings.image;i&&i(t.type)&&r.fileManager.totalImages++}),(a=function(w){var b,_=r.$errorContainer,C=r.fileManager;if(w>=u)return r.unlock(),r.duplicateErrors.length&&(b=""+r.duplicateErrors.join("")+"",0===_.find("ul").length?t.setHtml(_,r.errorCloseButton+""):(_.find("ul").append(t.cspBuffer.stash(b)),t.cspBuffer.apply(_)),_.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]),n.removeClass("file-thumb-loading"),r._initCapStatus("valid"),void o.html("");r.lock(!0);var y,x,T,F,P,S,k,I,E,A,z,D,j,U,M,$,R=i[w],B=R&&R.size||0,O=r._getSize(B,!0),L=p.image,N=B/r.bytesToKB,Z="",H=0,W="",V=!1,q=0;if($=function(e){e=e||R,y=D=r._getFileId(R),x=c+"-"+y,z=t.createObjectURL(e),A=r._getFileName(R,"")},M=function(){var e=!!C.loadedImages[y],i=d.setTokens({index:w+1,files:u,percent:50,name:A});setTimeout(function(){t.setHtml(o,i),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,x,y,w,s])&&r.isAjaxUpload?e||C.add(R):e&&C.removeFile(y)},R){if($(),h>0)for(F=0;F0&&i.length>1){var G=[],Y=0;if(Object.values(i).forEach(e=>{Y+=e.size/r.bytesToKB,G.push(e.name)}),Y>r.maxMultipleFileSize)return P=r.msgMultipleSizeTooLarge.setTokens({name:G,size:r._getSize(Y,!0),maxSize:r._getSize(r.maxMultipleFileSize*r.bytesToKB,!0)}),void v(P,R,x,w,D)}else if(r.maxFileSize>0&&N>r.maxFileSize)return P=r.msgSizeTooLarge.setTokens({name:A,size:O,maxSize:r._getSize(r.maxFileSize*r.bytesToKB,!0)}),void v(P,R,x,w,D);if(null!==r.minFileSize&&N<=t.getNum(r.minFileSize))return P=r.msgSizeTooSmall.setTokens({name:A,size:O,minSize:r._getSize(r.minFileSize*r.bytesToKB,!0)}),void v(P,R,x,w,D);if(!t.isEmpty(f)&&t.isArray(f)){for(F=0;F0)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,s=r.fileManager,n=s.count(),o=r.taskManager,l=!e.isEmptyObject(r._getExtraData());if(s.bpsLog=[],s.bps=0,r.isAjaxUpload&&!r.isDisabled&&r._isFileSelectionValid(n)){if(r.lastProgress=0,r._resetUpload(),0!==n||l){if(r.cancelling=!1,r.uploadInitiated=!0,r._showProgress(),r.lock(),0===n&&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",[s.stack,r._getExtraData()])}).fail(function(){r._log("Async upload batch completed with errors."),r._raise("filebatchuploaderror",[s.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(i){if(t.hasFileAPISupport()||t.isIE(9)){var r=Array.apply(null,arguments),s=[];switch(r.shift(),this.each(function(){var n={},o={};"object"==typeof i&&(n=e.extend(!0,{},e.fn.fileinput.defaults,i),o=i);var l,d=e(this),c=d.data("fileinput"),u=n.theme||d.data("theme")||e.fn.fileinput.defaults.theme,p={},f={},h=n.language||d.data("language")||e.fn.fileinput.defaults.language||"en";c||(u&&(f=e.fn.fileinputThemes[u]||{}),"en"===h||t.isEmpty(e.fn.fileinputLocales[h])||(p=e.fn.fileinputLocales[h]||{}),l=e.extend(!0,{},e.fn.fileinput.defaults,f,e.fn.fileinputLocales.en,p,o,d.data()),c=new a(this,l),d.data("fileinput",c)),"string"==typeof i&&s.push(c[i].apply(c,r))}),s.length){case 0:return this;case 1:return s[0];default:return s}}};var r="btn btn-sm btn-kv "+t.defaultButtonCss(),s="btn "+t.defaultButtonCss();e.fn.fileinput.defaults={language:"zh",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.createDiv();return t.setHtml(i,e),i.find("input,textarea,select,datalist,form,.file-thumbnail-footer").remove(),i.html()},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewZoomButtonClasses:{prev:"btn btn-default btn-outline-secondary btn-navigate",next:"btn btn-default btn-outline-secondary btn-navigate",rotate:r,toggleheader:r,fullscreen:r,borderless:r,close:r},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:s,cancelIcon:'',cancelClass:s,pauseIcon:'',pauseClass:s,uploadIcon:'',uploadClass:s,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,maxMultipleFileSize: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:{headers:{"X-CSRF-Token":document.querySelector('meta[name="csrf-token"]').content}},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}.',msgMultipleSizeTooLarge:'Files "{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.fileinputLocales.zh={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:"文件",filePlural:"个文件",browseLabel:"选择 …",removeLabel:"移除",removeTitle:"清除选中文件",cancelLabel:"取消",cancelTitle:"取消进行中的上传",pauseLabel:"暂停",pauseTitle:"暂停上传",uploadLabel:"上传",uploadTitle:"上传选中文件",msgNo:"没有",msgNoFilesSelected:"未选择文件",msgPaused:"已暂停",msgCancelled:"取消",msgPlaceholder:"选择 {files} ...",msgZoomModalHeading:"详细预览",msgFileRequired:"必须选择一个文件上传.",msgSizeTooSmall:'文件 "{name}" ({size}) 必须大于限定大小 {minSize}.',msgSizeTooLarge:'文件 "{name}" ({size}) 超过了允许大小 {maxSize}.',msgMultipleSizeTooLarge:'文件 "{name}" ({size}) 超过了允许大小 {maxSize}.',msgFilesTooLess:"你必须选择最少 {n} {files} 来上传. ",msgFilesTooMany:"选择的上传文件个数 ({n}) 超出最大文件的限制个数 {m}.",msgTotalFilesTooMany:"你最多可以上传 {m} 个文件 (当前有{n} 个文件).",msgFileNotFound:'文件 "{name}" 未找到!',msgFileSecured:'安全限制,为了防止读取文件 "{name}".',msgFileNotReadable:'文件 "{name}" 不可读.',msgFilePreviewAborted:'取消 "{name}" 的预览.',msgFilePreviewError:'读取 "{name}" 时出现了一个错误.',msgInvalidFileName:'文件名 "{name}" 包含非法字符.',msgInvalidFileType:'不正确的类型 "{name}". 只支持 "{types}" 类型的文件.',msgInvalidFileExtension:'不正确的文件扩展名 "{name}". 只支持 "{extensions}" 的文件扩展名.',msgFileTypes:{image:"image",html:"HTML",text:"text",video:"video",audio:"audio",flash:"flash",pdf:"PDF",object:"object"},msgUploadAborted:"该文件上传被中止",msgUploadThreshold:"处理中 …",msgUploadBegin:"正在初始化 …",msgUploadEnd:"完成",msgUploadResume:"继续上传 …",msgUploadEmpty:"无效的文件上传.",msgUploadError:"上传出错",msgDeleteError:"删除出错",msgProgressError:"上传出错",msgValidationError:"验证错误",msgLoading:"加载第 {index} 文件 共 {files} …",msgProgress:"加载第 {index} 文件 共 {files} - {name} - {percent}% 完成.",msgSelected:"{n} {files} 选中",msgProcessing:"处理中 ...",msgFoldersNotAllowed:"只支持拖拽文件! 跳过 {n} 拖拽的文件夹.",msgImageWidthSmall:'图像文件的"{name}"的宽度必须是至少{size}像素.',msgImageHeightSmall:'图像文件的"{name}"的高度必须至少为{size}像素.',msgImageWidthLarge:'图像文件"{name}"的宽度不能超过{size}像素.',msgImageHeightLarge:'图像文件"{name}"的高度不能超过{size}像素.',msgImageResizeError:"无法获取的图像尺寸调整。",msgImageResizeException:"调整图像大小时发生错误。{errors}
",msgAjaxError:"{operation} 发生错误. 请重试!",msgAjaxProgressError:"{operation} 失败",msgDuplicateFile:'文件 "{name}",大小 "{size}" 已经被选中.忽略相同的文件.',msgResumableUploadRetriesExceeded:"文件 {file} 上传失败超过 {max} 次重试 ! 错误详情: {error}
",msgPendingTime:"{time} 剩余",msgCalculatingTime:"计算剩余时间",ajaxOperations:{deleteThumb:"删除文件",uploadThumb:"上传文件",uploadBatch:"批量上传",uploadExtra:"表单数据上传"},dropZoneTitle:"拖拽文件到这里 …
支持多文件同时上传",dropZoneClickTitle:"
(或点击{files}按钮选择文件)",fileActionSettings:{removeTitle:"删除文件",uploadTitle:"上传文件",downloadTitle:"下载文件",uploadRetryTitle:"重试",rotateTitle:"顺时针旋转90度",zoomTitle:"查看详情",dragTitle:"移动 / 重置",indicatorNewTitle:"没有上传",indicatorSuccessTitle:"上传",indicatorErrorTitle:"上传错误",indicatorPausedTitle:"上传已暂停",indicatorLoadingTitle:"上传 …"},previewZoomButtonTitles:{prev:"预览上一个文件",next:"预览下一个文件",rotate:"顺时针旋转90度",toggleheader:"缩放",fullscreen:"全屏",borderless:"无边界模式",close:"关闭当前预览"}},e.fn.fileinput.Constructor=a,e(document).ready(function(){var t=e("input.file[type=file]");t.length&&t.fileinput()})});
\ No newline at end of file
diff --git a/ruoyi-admin/src/main/resources/templates/include.html b/ruoyi-admin/src/main/resources/templates/include.html
index 2159afcc..fc7ef4de 100644
--- a/ruoyi-admin/src/main/resources/templates/include.html
+++ b/ruoyi-admin/src/main/resources/templates/include.html
@@ -109,10 +109,10 @@
-
+
-
+