!function(e){"use strict";e(document).ready((function(){var t=!0,r=wp.media.editor.send.attachment;e(document).on("click",".idt-media-upload",(function(i){var a="#"+jQuery(this).attr("id"),n=jQuery(a).attr("id").replace("-button","");return t=!0,wp.media.editor.send.attachment=function(e,i){if(!t)return r.apply(a,[e,i]);jQuery("#"+n+"-preview").html('<img src="'+i.url+'" alt="" style="max-width:200px; height:auto; margin: 0px 0px 5px; display: block;">'),jQuery("#"+n+"-remove").css("display","inline-block"),jQuery("#"+n).val(i.url).trigger("change")},wp.media.editor.open(e(this)),!1})),e(document).on("click",".idt-media-remove",(function(e){var t=jQuery(this),r=t.attr("id").replace("-remove","");jQuery("#"+r+"-preview").html(""),t.css("display","none"),jQuery("#"+r).val("").trigger("change")}))}))}(jQuery);