jQuery(document).ready(function(e){function t(t){t.preventDefault();e(this);var i=wp.media({title:"Insert Image or Icon",library:{type:"image"},button:{text:"Use this image"},multiple:!1}).on("select",function(){var t=i.state().get("selection").first().toJSON();e("#bkinz-category-icon").attr("src",t.url),e("#staff-icon-id").attr("src",t.url),e("#bkinz-staff-img-add").attr("src",t.url),e("#bkinz-staff-img-update").attr("src",t.url),e("#bookingor-location-icon-update").attr("src",t.url),e("#bkinz-service-icon-add").attr("src",t.url),e("#service_icon_update").attr("src",t.url),e("#category-icon-id").val(t.id),e("#service-icon-id").val(t.id),e("#location-icon-id").val(t.id),e("#bookingor-business-logo").val(t.id),e("#staff-image-id").val(t.id),e("#category-icon-update-id").val(t.id),e("#bookingor-location-icon-id-update").val(t.id)}).open()}(e=jQuery.noConflict())("#tcn_category_icon").on("click",t),e("#tcn_category_icon_update").on("click",function(t){t.preventDefault(),e(this);var i=wp.media({title:"Update Icon",library:{type:"image"},button:{text:"Use this image"},multiple:!1}).on("select",function(){var t=i.state().get("selection").first().toJSON();e("#category-icon-update-id").val(t.id),e("#bookingor-location-icon-id-update").attr("src",t.url),e("#bkinz-category-icon-update").attr("src",t.url)}).open()}),e("#bp-service-icon").on("click",t),e("#bp-location-icon").on("click",t),e("#bookingor-location-icon-upload-update").on("click",t),e("#staff-image").on("click",t),e(".bp-extra-icons").on("click",function(t){var i=e(this);t.preventDefault(),custom_uploader=wp.media({title:"Insert Image or Icon",library:{type:"image"},button:{text:"Use this image"},multiple:!1}).on("select",function(){var t=custom_uploader.state().get("selection").first().toJSON();i.parent().parent().children().children().attr("src",t.url)}).open()})});