!function(o,t){Croppic=function(o,t){var n=this;n.id=o,n.obj=$("#"+o),n.outputDiv=n.obj,n.options={uploadUrl:"",uploadData:{},cropUrl:"",cropData:{},outputUrlId:"",imgEyecandy:!0,imgEyecandyOpacity:.2,zoomFactor:10,doubleZoomControls:!0,modal:!1,customUploadButtonId:"",loaderHtml:"",onBeforeImgUpload:null,onAfterImgUpload:null,onImgDrag:null,onImgZoom:null,onBeforeImgCrop:null,onAfterImgCrop:null};for(i in t)n.options[i]=t[i];n.init()},Croppic.prototype={id:"",imgInitW:0,imgInitH:0,imgW:0,imgH:0,objW:0,objH:0,windowW:0,windowH:$(o).height(),obj:{},outputDiv:{},outputUrlObj:{},img:{},defaultImg:{},croppedImg:{},imgEyecandy:{},form:{},cropControlsUpload:{},cropControlsCrop:{},cropControlZoomMuchIn:{},cropControlZoomMuchOut:{},cropControlZoomIn:{},cropControlZoomOut:{},cropControlCrop:{},cropControlReset:{},cropControlRemoveCroppedImage:{},modal:{},loader:{},init:function(){var o=this;o.objW=o.obj.width(),o.objH=o.obj.height(),$.isEmptyObject(o.defaultImg)&&(o.defaultImg=o.obj.find("img")),o.createImgUploadControls(),o.bindImgUploadControl()},createImgUploadControls:function(){var o=this,t="";""===o.options.customUploadButtonId&&(t='');var i='';$.isEmptyObject(o.croppedImg)&&(i="");var n='
'+t+i+"
";o.outputDiv.append(n),o.cropControlsUpload=o.outputDiv.find(".cropControlsUpload"),""===o.options.customUploadButtonId?o.imgUploadControl=o.outputDiv.find(".cropControlUpload"):(o.imgUploadControl=$("#"+o.options.customUploadButtonId),o.imgUploadControl.show()),$.isEmptyObject(o.croppedImg)||(o.cropControlRemoveCroppedImage=o.outputDiv.find(".cropControlRemoveCroppedImage"))},bindImgUploadControl:function(){var o=this,i='';o.outputDiv.append(i),o.form=o.outputDiv.find("."+o.id+"_imgUploadForm"),o.imgUploadControl.off("click"),o.imgUploadControl.on("click",function(){o.form.find('input[type="file"]').trigger("click")}),$.isEmptyObject(o.croppedImg)||o.cropControlRemoveCroppedImage.on("click",function(){o.croppedImg.remove(),$(this).hide(),$.isEmptyObject(o.defaultImg)||o.obj.append(o.defaultImg),""!==o.options.outputUrlId&&$("#"+o.options.outputUrlId).val("")}),o.form.find('input[type="file"]').change(function(){o.options.onBeforeImgUpload&&o.options.onBeforeImgUpload.call(o),o.showLoader(),o.imgUploadControl.hide();var i=new FormData(o.form[0]);for(var n in o.options.uploadData)o.options.uploadData.hasOwnProperty(n)&&i.append(n,o.options.uploadData[n]);$.ajax({url:o.options.uploadUrl,data:i,context:t.body,cache:!1,contentType:!1,processData:!1,type:"POST"}).always(function(t){response=jQuery.parseJSON(t),"success"==response.status&&(o.imgInitW=o.imgW=response.width,o.imgInitH=o.imgH=response.height,o.options.modal&&o.createModal(),$.isEmptyObject(o.croppedImg)||o.croppedImg.remove(),o.imgUrl=response.url,o.obj.append(''),o.initCropper(),o.hideLoader(),o.options.onAfterImgUpload&&o.options.onAfterImgUpload.call(o)),"error"==response.status&&(o.obj.append('