text: !function(e){var t={};function a(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,a),o.l=!0,o.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/",a(a.s=488)}({488:function(e,t,a){e.exports=a(489)},489:function(e,t){function a(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}Dropzone.autoDiscover=!1,Dropzone.prototype.defaultOptions.dictDefaultMessage=_LANG_.dictDefaultMessage,Dropzone.prototype.defaultOptions.dictFallbackMessage=_LANG_.dictFallbackMessage,Dropzone.prototype.defaultOptions.dictFallbackText=_LANG_.dictFallbackText,Dropzone.prototype.defaultOptions.dictFileTooBig=_LANG_.dictFileTooBig,Dropzone.prototype.defaultOptions.dictInvalidFileType=_LANG_.dictInvalidFileType,Dropzone.prototype.defaultOptions.dictResponseError=_LANG_.dictResponseError,Dropzone.prototype.defaultOptions.dictCancelUpload=_LANG_.dictCancelUpload,Dropzone.prototype.defaultOptions.dictCancelUploadConfirmation=_LANG_.dictCancelUploadConfirmation,Dropzone.prototype.defaultOptions.dictRemoveFile=_LANG_.dictRemoveFile,Dropzone.prototype.defaultOptions.dictMaxFilesExceeded=_LANG_.dictMaxFilesExceeded,Dropzone.options.dzone={acceptedFiles:"image/jpeg,image/png,image/gif"},$((function(){var e=new Dropzone("#kt_dropzone_media_manager",{url:current_url+"/upload?time="+$.now(),headers:{"X-CSRF-TOKEN":$('meta[name="X-CSRF-TOKEN"]').attr("content"),"X-Requested-With":"XMLHttpRequest"},params:function(e,t,a){if(a)return{dzUuid:a.file.upload.uuid,dzChunkIndex:a.index,dzTotalFileSize:a.file.size,dzCurrentChunkSize:a.dataBlock.data.size,dzTotalChunkCount:a.file.upload.totalChunkCount,dzChunkByteOffset:a.index*this.options.chunkSize,dzChunkSize:this.options.chunkSize,dzFilename:a.file.name,userID:1}},acceptedFiles:"image/jpeg,image/png,image/gif",uploadmultiple:!0,addRemoveLinks:!0,timeout:0,maxFilesize:Medias.maxFilesize,chunking:!0,forceChunking:!0,chunkSize:75387608,retryChunks:!0,retryChunksLimit:3,init:function(){this.on("addedfile",(function(e){console.log("addedfile")})),this.on("complete",(function(e){console.log("complete"),$.ajax({type:"GET",url:current_url+"/getDisplayImageManager",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:a({},crsftoken,$('meta[name="X-CSRF-TOKEN"]').attr("content")),dataType:"json",success:function(e,t,a){console.log(e),$("#imageManager").html(e.html)}})})),this.on("success",(function(e,t){if(console.log("success"),e.previewElement)return e.previewElement.classList.add("dz-success"),$((function(){setTimeout((function(){$(".dz-success").fadeOut("slow")}),2500)}))})),this.on("sending",(function(e,t,a){KTApp.block("#imageManager",{overlayColor:"#000000",state:"primary"})})),this.on("queuecomplete",(function(t,a){console.log(e),e.files[0].status==Dropzone.SUCCESS&&($.notify({title:_LANG_.updated+"!",message:_LANG_.saved_data},{type:"success"}),KTApp.unblock("#imageManager"),$(".dz-success").fadeOut("slow"),$(".dz-message").fadeIn("slow"))})),this.on("error",(function(e,t,a){console.log("errored",e,t,a),void 0!==a?this.defaultOptions.error(e,a.statusText):this.defaultOptions.error(e,t),$.notify({title:_LANG_.error+" : 500 ",message:t.error.message},{type:"warning"})})),this.on("removedfile",(function(e,t,n){console.log("removedfile",e,t,n),$.ajax({type:"GET",url:current_url+"/removedfile/"+e.upload.uuid,contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:a({},crsftoken,$('meta[name="X-CSRF-TOKEN"]').attr("content")),dataType:"json",success:function(e,a,n){console.log(t)}})}))}});$(document).on("click",".select-image",(function(e){var t;e.preventDefault(),console.log(e);var n=$(this).data("uuid-media");$.ajax({type:"POST",url:current_url+"/getManagerEdition",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:(t={},a(t,crsftoken,$('meta[name="X-CSRF-TOKEN"]').attr("content")),a(t,"value",{uuid:n}),t),dataType:"json",success:function(e,t,a){200==a.status&&($("#imageManager_edition").html(e.html),$("#imageManager_edition > #kt_modal_manager_edition").modal("show"))}})})),$(document).on("submit","#kt_apps_manager_media",(function(e){var t;e.preventDefault(),$.ajax({type:"POST",url:current_url+"/saveManagerEdition",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:(t={},a(t,crsftoken,$('meta[name="X-CSRF-TOKEN"]').attr("content")),a(t,"value",$(this).serialize()),t),dataType:"json",success:function(e,t,a){$.notify({title:e.success.message?_LANG_.updated+"!":_LANG_.warning+"!",message:e.success.message?e.success.message:e.error.message},{type:e.success.message?"success":"warning"})}})})),$(document).on("click",".deleteFileMedia",(function(e){var t;e.preventDefault();var n=$(this).data("imagemanager");$.ajax({type:"POST",url:current_url+"/removeFile",data:(t={},a(t,crsftoken,$('meta[name="X-CSRF-TOKEN"]').attr("content")),a(t,"uuid",$(this).data("uuid")),t),dataType:"json",beforeSend:function(e){KTApp.block("#imageManager",{overlayColor:"#000000",state:"primary"})},success:function(e,t,a){$.notify({title:e.success.message?_LANG_.updated+"!":_LANG_.warning+"!",message:e.success.message?e.success.message:e.error.message},{type:e.success.message?"success":"warning"}),200==a.status&&($("#imageManager_edition #kt_modal_manager_edition").modal("hide"),$(".modal-backdrop").remove(),$("#imageManager_edition").html(""),"reload"==n&&(KTApp.unblock("#imageManager"),$("#imageManager").html(e.html)))}})}))})),$(document).on("click","#kt_apps_manager_media .croppedFile",(function(e){var t;$(this).data("uuid");$.ajax({type:"POST",url:current_url+"/getCropTemplate",data:(t={},a(t,crsftoken,$('meta[name="X-CSRF-TOKEN"]').attr("content")),a(t,"uuid",$(this).data("uuid")),t),dataType:"json",beforeSend:function(e){KTApp.block(".thumbnail-image",{overlayColor:"#000000",state:"primary"})},success:function(e,t,a){200==a.status&&(KTApp.unblock(".thumbnail-image"),1==e.crop&&($(".attachment-media-view").fadeOut(),$("#cropImage").html(e.cropImage),$("#cropImage").fadeIn(),n.init(),KTApp.initTooltips()))}})})),$(document).on("click","#kt_modal_manager_edition .cancelCrop",(function(e){e.preventDefault(),$("#cropImage").fadeOut(),$("#cropImage").html(""),$(".attachment-media-view").fadeIn()}));var n={init:function(){var e,t,a;e=document.getElementById("image-upload"),t={crop:function(e){document.getElementById("dataX").value=Math.round(e.detail.x),document.getElementById("dataY").value=Math.round(e.detail.y),document.getElementById("dataWidth").value=Math.round(e.detail.width),document.getElementById("dataHeight").value=Math.round(e.detail.height),document.getElementById("dataRotate").value=e.detail.rotate,document.getElementById("dataScaleX").value=e.detail.scaleX,document.getElementById("dataScaleY").value=e.detail.scaleY;var t=document.getElementById("cropper-preview-lg");t.innerHTML="",t.appendChild(a.getCroppedCanvas({width:256,height:160}));var n=document.getElementById("cropper-preview-md");n.innerHTML="",n.appendChild(a.getCroppedCanvas({width:128,height:80}));var o=document.getElementById("cropper-preview-sm");o.innerHTML="",o.appendChild(a.getCroppedCanvas({width:64,height:40}));var i=document.getElementById("cropper-preview-xs");i.innerHTML="",i.appendChild(a.getCroppedCanvas({width:32,height:20}))},cropmove:function(e){console.log(e.type,e.detail.action)}},a=new Cropper(e,t),document.getElementById("cropper-buttons").querySelectorAll("[data-method]").forEach((function(e){e.addEventListener("click",(function(t){var n,o=e.getAttribute("data-method"),i=e.getAttribute("data-option")||void 0,r=e.getAttribute("data-second-option")||void 0;try{i=JSON.parse(i)}catch(t){}n=r?i?"":a[o]():a[o](i,r),"move"==e.getAttribute("data-method")&&a.move(e.getAttribute("data-option"),e.getAttribute("data-second-option")),"getCroppedCanvas"==e.getAttribute("data-method")&&(option="",""!=e.getAttribute("data-option")&&(console.log(e.getAttribute("data-option")),option=JSON.parse(e.getAttribute("data-option"))),a.getCroppedCanvas(option).toBlob((function(e){var t=new FormData;t.append("uuid",$("#image-upload").attr("data-uuid")),t.append("field",!1),t.append("imageCustomEdition",!0),t.append("croppedImage",e,$("#image-upload").attr("data-mine")),t.append([crsftoken],$('meta[name="X-CSRF-TOKEN"]').attr("content")),$.ajax({type:"POST",url:current_url+"/cropFile",data:t,processData:!1,contentType:!1,dataType:"json",success:function(e,t,a){$.notify({title:e.success.message?_LANG_.updated+"!":_LANG_.warning+"!",message:e.success.message?e.success.message:e.error.message},{type:e.success.message?"success":"warning"}),200==a.status&&($("#cropImage").fadeOut(),$("#cropImage").html(""),$(".attachment-media-view").fadeIn(),$("#imageCustom").html(e.imageCustomEdition))}})}),$("#image-upload").attr("data-mine")));var s=document.querySelector("#putData");try{s.value=JSON.stringify(n)}catch(t){n||(s.value=n)}}))})),document.getElementById("setAspectRatio").querySelectorAll('[name="aspectRatio"]').forEach((function(e){e.addEventListener("click",(function(e){a.setAspectRatio(e.target.value)}))}))}};$(document).on("click","#kt_apps_manager_media .deleteFileCustom",(function(e){var t;e.preventDefault();var n=$(this);$.ajax({type:"POST",url:current_url+"/deteteFileCustom",data:(t={},a(t,crsftoken,$('meta[name="X-CSRF-TOKEN"]').attr("content")),a(t,"format",$(this).data("format")),a(t,"uuid",$(this).data("uuid")),t),dataType:"json",success:function(e,t,a){$.notify({title:e.success.message?_LANG_.updated+"!":_LANG_.warning+"!",message:e.success.message?e.success.message:e.error.message},{type:e.success.message?"success":"warning"}),200==a.status&&n.parent().parent().remove()}})}))}});
  //# sourceMappingURL=imageManager.js.map