1(function(){"use strict";var a,b,c=function(a,b){return function(){return a.apply(b,arguments)}};a=jQuery,b=function(){function b(a){this.refreshNonce=c(this.refreshNonce,this),this.hideModal=c(this.hideModal,this),this.showModal=c(this.showModal,this),this.handleModalAjaxResponse=c(this.handleModalAjaxResponse,this),this.initializeFlagging=c(this.initializeFlagging,this),this.initializeModal=c(this.initializeModal,this),this.initializeNotifications=c(this.initializeNotifications,this),this.initializeVoting=c(this.initializeVoting,this),this.initializeValidation=c(this.initializeValidation,this),this.initializeFieldToggler=c(this.initializeFieldToggler,this),this.initializeAttachmentFields=c(this.initializeAttachmentFields,this),this.activateTab=c(this.activateTab,this),this.initializeTabs=c(this.initializeTabs,this),this.filterContributions=c(this.filterContributions,this),this.initializeRatingFilter=c(this.initializeRatingFilter,this),this.initializeFilter=c(this.initializeFilter,this);var b;this.options=a,b=window.location.hash&&0===window.location.hash.indexOf("share")?window.location.hash.split("-")[1]:null,this.options.comment_type=this.options.comment_type||b,this.initializeModal(),this.initializeTabs(),this.initializeRadioButtons(),this.initializeAttachmentFields(),this.initializeRatingFields(),this.initializeFieldToggler(),this.initializeValidation(),this.initializeVoting(),this.initializeNotifications(),this.initializeFlagging(),this.initializeTips(),this.initializeFilter(),this.initializeRatingFilter()}return b.prototype.initializeFilter=function(){return a(".contributions-filter select").on("change",function(b){return function(c){var d;return d=a(c.currentTarget),b.filterContributions(d.val())}}(this)),a(".js-clear-filters").on("click",function(b){return b.preventDefault(),a(".contributions-filter select").val("").trigger("change")})},b.prototype.initializeRatingFilter=function(){return a("#reviews .product-rating-details a").on("click",function(b){return function(c){var d;return c.preventDefault(),d=a(c.currentTarget),a(".contributions-filter select").val("comment_type=review"),b.filterContributions(decodeURIComponent(d.attr("href")).split("comments_filter=")[1].split("#")[0])}}(this))},b.prototype.filterContributions=function(b){return a("#contributions-list-title").text(this.options.i18n.loading),a("#contributions-list .contributions-container").empty().addClass("loading"),a.get(this.options.ajax_url,{action:"wc_product_reviews_pro_contributions_list",product_id:this.options.product_id,comments_filter:b},function(b){return function(c){return a("#contributions-list").html(c),b.hideFlagForms(),b.initializeFieldToggler(),b.initializeTips()}}(this)),b?a(".js-clear-filters").show():a(".js-clear-filters").hide()},b.prototype.initializeRadioButtons=function(){return a("#reviews").on("click",".form-contribution input[type='radio']",function(b){var c,d,e,f;return f=b.currentTarget,d=a(f),c=d.closest(".form-row"),(e=c.hasClass("val
1idate-required"))?void 0:f.value===c.attr("data-prev-value")?(d.prop("checked",!1).trigger("change"),c.attr("data-prev-value","")):c.attr("data-prev-value",f.value)})},b.prototype.initializeTabs=function(){return this.$contributionTabs=a(".contribution-form-wrapper"),this.options.comment_type&&"contribution_comment"!==this.options.comment_type&&this.activateTab(this.options.comment_type),a(".js-switch-contribution-type").on("click",function(b){return function(c){var d;return c.preventDefault(),d=a(c.currentTarget),b.activateTab(d.attr("href").split("-")[1])}}(this))},b.prototype.activateTab=function(b){return this.$contributionTabs.removeClass("active"),this.$contributionTabs.filter("#"+b+"_form_wrapper").addClass("active"),a('.js-switch-contribution-type[href="#share-'+b+'"]').addClass("active").siblings(".active").removeClass("active")},b.prototype.initializeRatingFields=function(){return a("#review_rating_field").each(function(b,c){var d,e;return d=a(c),e=a('<span class="star-label" data-selected-text="" />'),d.append(e),d.find("label.checkbox").each(function(b,c){var d;return d=a(c),d.hover(function(){return e.text(d.text())},function(){return e.text(e.data("selected-text"))})}),d.find("input").on("change",function(){var a;return a=d.siblings('label.checkbox[for="review_rating_'+d.val()+'"]').text(),e.text(a).data("selected-text",a)})})},b.prototype.initializeAttachmentFields=function(){return a(".form-contribution .attachment-url").each(function(b,c){var d,e,f;return d=a(c),f=d.closest("form"),e=f.find(".attachment-file"),e.length?d.add(e).prepend('<a href="#" class="toggle-attachment-source"></a>'):void 0}),a(".form-contribution .attachment-type").each(function(b){return function(c,d){var e,f,g,h,i,j,k;return f=a(d),h=f.closest("form"),j=h.find('input[name="comment_type"]').val(),e=f.find("input"),i=h.find(".attachment-url"),g=h.find(".attachment-file"),-1===a.inArray(j,["video","photo"])&&i.hide(),g.hide(),k=function(a){return i.find(".toggle-attachment-source").text(b.options.i18n["attach_"+a+"_file"]),g.find(".toggle-attachment-source").text(b.options.i18n["attach_"+a+"_url"])},e.val()&&k(e.val()),e.on("change",function(b){var c,d,e,f;return e=b.currentTarget,c=a(e),f=e.value,d=c.is(":checked"),d&&f?(k(f),"video"===f?(g.hide(),i.find(".toggle-attachment-source").hide()):i.find(".toggle-attachment-source").show(),i.is(":visible")||g.is(":visible")?void 0:i.slideDown("fast")):(i.slideUp("fast"),g.slideUp("fast"))}).each(function(c,d){var e;return f=a(d),e=d.value,f.next("label.checkbox").attr("title",b.options.i18n["attach_a_"+e]).addClass("js-tip")}),f.find("label:first-child").hide(),h.find(".toggle-attachment-source").on("click",function(a){return a.preventDefault(),g.slideToggle("fast"),i.slideToggle("fast")}),g.on("change","input",function(c){var d,e,f;return f=c.currentTarget,d=a(f),d.siblings(".wc-product-reviews-pro-validation-error").remove(),e=f.files[0].type.match("image.*"),e?void 0:d.after('<span class="wc-product-reviews-pro-validation-error">'+b.options.i18n.file_not_allowed+"</span>")})}}(this))},b.prototype.initializeFieldToggler=function(){return a(".form-contribution:not(.field-toggler-initialized)").each(function(b){return function(c,d){var e,f;return e=a(d),f=e.find('input[name="comment_type"]').val(),a(".star-rating-selector:not(.validate-required )").insertAfter("#review_comment_field"),b.options.comment_type!==f?(e.find(".form-row:not(:first)").hide(),e.find(".form-row:first").find("input, textarea, select").one("focus change",function(b){var c,d,e;return d=a(b.currentTarget),c=d.closest("form"),e=c.find('input[name="comment_type"]').val(),"photo"!==e&&"video"!==e?c.find(".form-row:hidden:not(:contains(.input-hidden)):not(.attachment-source)").slideDown("fast"):"photo"===e?c.find(".form-row:hidden:not(:contains(.input-hidden)):not(.attachment-file)").slideDown("fast"):c.find(".form-row:hidden:not(:contains(.input-hidden))").slideDown("fast")}),e.addClass("field-toggler-initialized")):void 0}}(this))},b.prototype.initializeValidation=function(){return a("#reviews").on("submit",".form-contribution",function(b){return function(c){var d,e,f,g,h,i,j;return c.preventDefault(),d=a(c.currentTarget),i=d.find('input[name="comment_type"]').val(),d.find(".wc-product-reviews-pro-validation-error").remove(),g=b.options.file_size_max,e=0,d.find("input,select,textarea").each(function(c,d){var f,h,j,k,l,m,n,o,p,q;switch(f=a(d),m=f.attr("name"),q=f.val(),p=f.closest(".form-row").hasClass("val
1idate-required"),p&&"review_rating"!==m&&!q&&(f.after('<span class="wc-product-reviews-pro-validation-error">'+b.options.i18n.error_required+"</span>"),e++),m){case i+"_comment":if(j=f,o=j.data("min-word-count"),n=j.data("max-word-count"),o||n){if(k=a.trim(j.val()).split(" ").length,o&&o>k)return j.after('<span class="wc-product-reviews-pro-validation-error">'+b.options.i18n.error_too_short.replace(/%d/g,o)+"</span>"),e++;if(n&&k>n)return j.after('<span class="wc-product-reviews-pro-validation-error">'+b.options.i18n.error_too_long.replace(/%d/g,n)+"</span>"),e++}break;case i+"_attachment_file":if(h=f,l=null,"undefined"!=typeof FileReader&&null!==FileReader&&d.files.length>0&&(l=d.files[0].size),null!=l&&l>g)return h.after('<span class="wc-product-reviews-pro-validation-error">'+b.options.i18n.error_file_size_max+"</span>"),e++}}),"photo"===i&&(j=d.find(".attachment-url input").val(),f=d.find(".attachment-file input").val(),j||f||(d.find(".attachment-url input").after('<span class="wc-product-reviews-pro-validation-error">'+b.options.i18n.error_attach_file+"</span>"),d.find(".attachment-file input").after('<span class="wc-product-reviews-pro-validation-error">'+b.options.i18n.error_attach_file+"</span>"))),e?void 0:(h=function(){return d.get(0).submit()},!b.options.is_user_logged_in&&b.options.comment_registration?b.showModal().one("login",function(){return h()}):h())}}(this))},b.prototype.initializeVoting=function(){return a("#comments").on("click",".contribution-actions .vote",function(b){return function(c){var d,e,f,g,h,i,j,k;return c.preventDefault(),g=a(c.currentTarget),j=g.hasClass("vote-down")?"negative":"positive",i=g.data("comment-id"),d=g.siblings(".feedback").html(""),f=g.siblings(".vote-count-positive"),e=g.siblings(".vote-count-negative"),k=g.hasClass("done"),h=function(){return a.ajax({type:"POST",url:b.options.ajax_url,data:{action:"wc_product_reviews_pro_vote",security:b.options.nonce,vote:j,comment_id:i},success:function(a){var c;return d.css("display","inline-block"),setTimeout(function(){return d.fadeOut()},2e3),a.data&&a.data.message?(d.text(a.data.message),a.success?(d.removeClass("error"),f.text("("+a.data.positive_votes+")"),e.text("("+a.data.negative_votes+")"),g.removeClass("done").siblings(".vote").removeClass("done"),k||g.addClass("done"),c=a.data.positive_votes||a.data.negative_votes?b.options.i18n.comment_karma.replace("%1$d",a.data.positive_votes).replace("%2$d",a.data.total_votes):"",g.closest(".comment_container").find(".contribution-karma").text(c)):d.addClass("error")):d.text(b.options.i18n.vote_failed).addClass("error")}})},b.options.is_user_logged_in?h():b.showModal().one("login",function(){return h()})}}(this))},b.prototype.initializeNotifications=function(){return a("#comments").on("click",".contribution-actions .notifications",function(b){return function(c){var d,e,f,g,h;return c.preventDefault(),e=a(c.currentTarget),h=e.hasClass("subscribe")?"subscribe":"unsubscribe",f=e.data("comment-id"),d=e.siblings(".feedback").html(""),g=function(){return a.ajax({type:"POST",url:b.options.ajax_url,data:{action:"wc_product_reviews_pro_notify_replies",security:b.options.nonce,manage:h,user_id:b.options.user_id,comment_id:f},success:function(a){return d.css("display","inline-block"),setTimeout(function(){return d.fadeOut()},2e3),a.data&&a.data.message?(d.text(a.data.message),a.success?(e.hide(),"subscribe"===h?e.parent().find(".unsubscribe").show():e.parent().find(".subscribe").show(),d.removeClass("error")):d.addClass("error")):d.text(b.options.i18n.subscribe_failed).addClass("error")}})},b.options.is_user_logged_in?g():b.showModal().one("login",function(){return g()})}}(this))},b.prototype.initializeModal=function(){var b,c;return this.$modal=b=a("#wc-product-reviews-pro-modal"),this.$overlay=c=a("#wc-product-reviews-pro-modal-overlay"),b.find("a.close").on("click",function(a){return function(b){return b.preventDefault(),a.hideModal()}}(this)),b.find(".switcher a").on("click",function(c){var d;return c.preventDefault(),d=a(c.currentTarget),d.closest(".switcher").find("p").toggle(),b.find(".col-1, .col-2").toggle()}),b.find("form.login").on("submit",function(b){return function(c){var d;return c.preventDefault(),d=a(c.currentTarget),a.post(b.options.ajax_url,{username:d.find("#username").val(),password:d.find("#password").val(),_wpnonce:d.find("#_wpnonce").val(),login:1,_wc_product_reviews_pro_ajax_login:1},function(a){return b.handleModalAjaxResponse(a,d)})}}(this)),b.find("form.register").on("submit",function(b){return function(c){var d;return c.preventDefault(),d=a(c.currentTarget),a.post(b.options.ajax_url,{email:d.find("#reg_email").val(),username:d.find("#reg_username").val(),password:d.find("#reg_password").val(),register:d.find('input[name="register"]').val(),_wpnonce:d.find("#_wpnonce").val(),_wc_product_reviews_pro_ajax_register:!0},function(a){return b.handleModalAjaxResponse(a,d)})}}(this)),a("#reviews").on("click",".js-wc-product-reviews-pro-show-login-modal",function(a){return function(b){return b.preventDefault(),a.options.is_user_logged_in?void 0:a.showModal().one("login",function(){return window.location.assign(window.location.toString()+"#reviews"),window.location.reload()})}}(this))},b.prototype.hideFlagForms=function(){return a(".contribution-flag-form").hide()},b.prototype.initializeFlagging=function(){return this.hideFlagForms(),a("#comments").on("click",".contribution-actions .js-toggle-flag-form",function(b){var c,d;return b.preventDefault(),c=a(b.currentTarget),a(".flag-response").remove(),d=c.data("c
1omment-id"),a("form#flag-contribution-"+d).slideDown("fast").find("button").removeProp("disabled")}),a("#reviews").on("submit",".contribution-flag-form",function(b){return function(c){var d,e,f,g;return c.preventDefault(),e=a(c.currentTarget),e.find("button").attr("disabled",!0),d=e.siblings(".contribution-actions").find(".feedback").html(""),f=e.find('input[name="comment_id"]').val(),g=e.find('input[name="flag_reason"]').val(),a.ajax({type:"POST",url:b.options.ajax_url,data:{action:"wc_product_reviews_pro_flag",security:b.options.nonce,comment_id:f,reason:g},success:function(a){return e.slideUp("fast").find("button").removeAttr("disabled"),d.show(),setTimeout(function(){return d.fadeOut()},2e3),a.data&&a.data.message?(d.text(a.data.message),a.success?(d.removeClass("error"),e.prev(".comment_container").find(".js-toggle-flag-form").addClass("done")):d.addClass("error")):d.text(this.options.i18n.flag_failed).addClass("error")}})}}(this))},b.prototype.initializeTips=function(){return a(".js-tip").tipTip({attribute:"title",fadeIn:50,fadeOut:50,delay:200})},b.prototype.handleModalAjaxResponse=function(a,b){var c,d;return a.success?this.refreshNonce(function(a){return function(c){return a.options.is_user_logged_in=!0,b.prevAll(".woocommerce-error").remove(),a.hideModal().trigger("login")}}(this)):(b.prevAll(".woocommerce-error").remove(),b.before(null!=(c=null!=a&&null!=(d=a.data)?d.message:void 0)?c:this.options.i18n.error_login_signup))},b.prototype.showModal=function(){var b,c;return b=this.$modal,c=this.$overlay,a(document).on("keydown.modal",function(a){return function(b){return 27===b.keyCode?a.hideModal():void 0}}(this)),c.fadeIn(100).on("click.modal",function(a){return function(){return a.hideModal()}}(this)),b.fadeIn(200),b.find(".col-1").show(),b.find(".col-2").hide(),b.trigger("showmodal")},b.prototype.hideModal=function(){return a(document).off("keydown.modal"),this.$overlay.hide().off("click.modal"),this.$modal.fadeOut(100),this.$modal.trigger("hidemodal")},b.prototype.refreshNonce=function(b){return a.get(this.options.ajax_url,{action:"wc_product_reviews_pro_refresh_nonce"}).done(function(a){return function(c){var d,e,f;return a.options.nonce=null!=c&&null!=(d=c.data)?d.nonce:void 0,a.options.user_id=null!=c&&null!=(e=c.data)?e.user_id:void 0,b(null!=c&&null!=(f=c.data)?f.nonce:void 0)}}(this))},b}(),a(window).load(function(){return new b(window.wc_product_reviews_pro)})}).call(this);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.