function renderMediaUploader(t){"use strict";var e;return void 0!==e?void e.open():(e=wp.media.frames.file_frame=wp.media({title:t.title,library:{type:"image"},button:{text:t.button},multiple:!1}),e.on("select",function(){var i=e.state().get("selection").first().toJSON(),r=jQuery(t.inputField),a=jQuery(t.imgTag);r.val(i.url),a.attr("src",i.url)}),void e.open())}!function(t){"use strict";t(function(){t("#rwp-rating-image-btn").on("click",function(e){e.preventDefault();var i={title:t(this).data("tb-title"),button:t(this).data("tb-button"),inputField:"#rwp-rating-image-url",imgTag:"#rwp-rating-image"};renderMediaUploader(i)}),t("#rwp-reviews-meta-box").on("click",".rwp-review-add-image-btn",function(e){e.preventDefault();var i=t(this).data("review-id"),r={title:t(this).data("tb-title"),button:t(this).data("tb-button"),inputField:"#rwp-review-add-image-input-"+i,imgTag:"#rwp-review-image-img-"+i};renderMediaUploader(r)})})}(jQuery);
