jQuery(function(){jQuery(document).on("click",".wcml_currency_switcher a",wcml_switch_currency_handler)});var wcml_switch_currency_handler=function(event){event.preventDefault();if(jQuery(this).is(":disabled")||jQuery(this).parent().hasClass("wcml-cs-active-currency")||jQuery(this).hasClass("wcml-cs-active-currency")){return false}else{jQuery(this).off(event)}wcml_load_currency(jQuery(this).attr("rel"))};function wcml_load_currency(currency,force_switch){var ajax_loader=jQuery('');jQuery(".wcml_currency_switcher").append(ajax_loader);if(typeof force_switch==="undefined")force_switch=0;jQuery.ajax({type:"post",url:woocommerce_params.ajax_url,dataType:"json",data:{action:"wcml_switch_currency",currency:currency,force_switch:force_switch,params:window.location.search.substr(1)},success:function(response){if(typeof response.error!=="undefined"){alert(response.error)}else if(typeof response.data.prevent_switching!=="undefined"){jQuery("body").append(response.data.prevent_switching)}else{var target_location=window.location.href;if(-1!==target_location.indexOf("#")||wcml_mc_settings.cache_enabled){var url_dehash=target_location.split("#");var hash=url_dehash.length>1?"#"+url_dehash[1]:"";target_location=url_dehash[0].replace(/&wcmlc(\=[^&]*)?(?=&|$)|wcmlc(\=[^&]*)?(&|$)/,"").replace(/\?$/,"");var url_glue=target_location.indexOf("?")!=-1?"&":"?";target_location+=url_glue+"wcmlc="+currency+hash}wcml_reset_cart_fragments();target_location=wcml_maybe_adjust_widget_price(target_location,response.data);window.location=target_location}}})}function wcml_maybe_adjust_widget_price(target_location,response){if(typeof response.min_price!=="undefined"){target_location=target_location.replace(/(min_price=)(\d+)/,"$1"+response.min_price)}if(typeof response.max_price!=="undefined"){target_location=target_location.replace(/(max_price=)(\d+)/,"$1"+response.max_price)}return target_location}; jQuery(document).ready(function($){ resizeAllGridItems(); jQuery(window).on("resize", function (){ resizeAllGridItems(); }); jQuery("form#commentform").attr("enctype", "multipart/form-data").attr("encoding", "multipart/form-data"); jQuery("#commentform").on("submit", function(event){ if(ajax_object.ivole_recaptcha==='1'){ var recaptcha=jQuery("#g-recaptcha-response").val(); if(recaptcha===""){ event.preventDefault(); alert("Please confirm that you are not a robot"); }} var cr_ajax_comment=jQuery("#cr-ajax-reviews-review-form form#commentform textarea#comment"); if(cr_ajax_comment.length > 0){ if(ajax_object.ivole_allow_empty_comment==='0'&&cr_ajax_comment.val().trim().length===0){ event.preventDefault(); alert(ajax_object.ivole_allow_empty_comment_alert); }} }); jQuery("ol.commentlist").on("click", ".ivole-comment-a", function(t){ if(ajax_object.ivole_disable_lightbox==='0'){ t.preventDefault(); var o=jQuery(".pswp")[0]; var pics=jQuery(this).parent().parent().find("img"); var this_pic=jQuery(this).find("img"); var inx=0; if(pics.length > 0&&this_pic.length > 0){ var a=[]; for (i=0; i < pics.length; i++){ a.push({ src: pics[i].src, w: pics[i].naturalWidth, h: pics[i].naturalHeight, title: pics[i].alt }); if(this_pic[0].src==pics[i].src){ inx=i; }} var r={ index: inx }; new PhotoSwipe(o, PhotoSwipeUI_Default, a, r).init(); }} }); initVoteClick("ol.commentlist", ".ivole-a-button"); initVoteClick(".cr-ajax-reviews-cus-images-modal", ".ivole-a-button"); jQuery(".ivole-video-a, .iv-comment-video-icon").on("click", function(t){ if(! jQuery("#iv-comment-videos-id").hasClass("iv-comment-videos-modal")){ var tt=t.target.closest("[id^='iv-comment-video-id-']"); var iid="#" + tt.id; jQuery("#iv-comment-videos-id").addClass("iv-comment-videos-modal"); jQuery(iid).addClass("iv-comment-video-modal"); jQuery(iid).find("video").prop("controls", true); jQuery(iid).find(".iv-comment-video-icon").hide(); jQuery(iid).find("video").get(0).play(); jQuery(iid).css({ "top": "50%", "margin-top": function(){ return -$(this).outerHeight() / 2 }}); return false; }}); jQuery("#iv-comment-videos-id").on("click", function(t){ if(jQuery("#iv-comment-videos-id").hasClass("iv-comment-videos-modal")){ jQuery("#iv-comment-videos-id").removeClass("iv-comment-videos-modal"); var vids=jQuery("#iv-comment-videos-id").find("[id^='iv-comment-video-id-']"); var i=0; var iid=""; for(i=0; i < vids.length; i++){ iid="#" + vids[i].id; if(jQuery(iid).hasClass("iv-comment-video-modal")){ jQuery(iid).removeClass("iv-comment-video-modal"); jQuery(iid).find("video").get(0).pause(); jQuery(iid).find("video").prop("controls", false); jQuery(iid).find(".iv-comment-video-icon").show(); jQuery(iid).removeAttr("style"); }} return false; }}); jQuery("#cr-show-more-reviews-id").on("click", function(t){ t.preventDefault(); var cr_product_id=jQuery(".commentlist.cr-ajax-reviews-list").attr("data-product"); var cr_nonce=jQuery(this).attr("data-nonce"); var cr_page=jQuery(this).attr("data-page"); var cr_sort=jQuery("#cr-ajax-reviews-sort").children("option:selected").val(); var cr_rating=jQuery("div.ivole-summaryBox.cr-summaryBox-ajax tr.ivole-histogramRow.ivole-histogramRow-s a.ivole-histogram-a").attr("data-rating"); var cr_search=jQuery(".cr-ajax-search input").val(); var cr_tags=[]; jQuery(".cr-review-tags-filter .cr-tags-filter.cr-tag-selected").each(function(){ cr_tags.push(jQuery(this).attr("data-crtagid")); }); if(!cr_rating){ cr_rating=0; } var cr_data={ "action": "cr_show_more_reviews", "productID": cr_product_id, "page": cr_page, "sort": cr_sort, "rating": cr_rating, "search": cr_search, "tags": cr_tags, "security": cr_nonce }; jQuery(".cr-search-no-reviews").hide(); jQuery("#cr-show-more-reviews-id").hide(); jQuery("#cr-show-more-review-spinner").show(); jQuery("div.ivole-summaryBox.cr-summaryBox-ajax").addClass("cr-summaryBar-updating"); jQuery("#cr-ajax-reviews-sort").addClass("cr-sort-updating"); jQuery("div.cr-review-tags-filter").addClass("cr-review-tags-filter-disabled"); jQuery.post(ajax_object.ajax_url, cr_data, function(response){ jQuery("#cr-show-more-review-spinner").hide(); jQuery("div.ivole-summaryBox.cr-summaryBox-ajax").removeClass("cr-summaryBar-updating"); jQuery("#cr-ajax-reviews-sort").removeClass("cr-sort-updating"); jQuery("div.cr-review-tags-filter").removeClass("cr-review-tags-filter-disabled"); if(response.page > 0){ jQuery(".commentlist.cr-ajax-reviews-list").append(response.html); jQuery("#cr-show-more-reviews-id").attr("data-page",response.page); if(!response.last_page){ jQuery("#cr-show-more-reviews-id").show(); }} if(response.html==null&&response.page===1){ jQuery(".cr-search-no-reviews").show(); }}, "json"); }); jQuery("#cr-ajax-reviews-sort").on("change", function(t){ t.preventDefault(); var cr_product_id=jQuery(".commentlist.cr-ajax-reviews-list").attr("data-product"); var cr_nonce=jQuery(this).attr("data-nonce"); var cr_sort=jQuery(this).children("option:selected").val(); var cr_rating=jQuery("div.ivole-summaryBox.cr-summaryBox-ajax tr.ivole-histogramRow.ivole-histogramRow-s a.ivole-histogram-a").attr("data-rating"); if(!cr_rating){ cr_rating=0; } var cr_data={ "action": "cr_sort_reviews", "productID": cr_product_id, "sort": cr_sort, "rating": cr_rating, "security": cr_nonce }; jQuery(".cr-search-no-reviews").hide(); jQuery('.cr-ajax-search input').val("").trigger("change"); jQuery("#cr-show-more-reviews-id").hide(); jQuery(".commentlist.cr-ajax-reviews-list").hide(); jQuery("#cr-show-more-review-spinner").show(); jQuery("div.ivole-summaryBox.cr-summaryBox-ajax").addClass("cr-summaryBar-updating"); jQuery("#cr-ajax-reviews-sort").addClass("cr-sort-updating"); jQuery.post(ajax_object.ajax_url, cr_data, function(response){ jQuery("#cr-show-more-review-spinner").hide(); jQuery("div.ivole-summaryBox.cr-summaryBox-ajax").removeClass("cr-summaryBar-updating"); jQuery("#cr-ajax-reviews-sort").removeClass("cr-sort-updating"); if(response.page>0){ jQuery(".commentlist.cr-ajax-reviews-list").empty(); jQuery(".commentlist.cr-ajax-reviews-list").append(response.html); jQuery(".commentlist.cr-ajax-reviews-list").show(); jQuery("#cr-show-more-reviews-id").attr("data-page",response.page); if(!response.last_page){ jQuery("#cr-show-more-reviews-id").show(); }} }, "json"); }); jQuery(".cr-reviews-ajax-comments .cr-summaryBox-wrap").on("click", "a.ivole-histogram-a, .ivole-seeAllReviews", function(t){ t.preventDefault(); var cr_product_id=jQuery(".commentlist.cr-ajax-reviews-list").attr("data-product"); var cr_nonce=jQuery("div.ivole-summaryBox.cr-summaryBox-ajax").attr("data-nonce"); var cr_rating=jQuery(this).attr("data-rating"); var cr_sort=jQuery("#cr-ajax-reviews-sort").children("option:selected").val(); var cr_data={ "action": "cr_filter_reviews", "productID": cr_product_id, "rating": cr_rating, "sort": cr_sort, "security": cr_nonce }; jQuery("div.ivole-summaryBox.cr-summaryBox-ajax tr.ivole-histogramRow.ivole-histogramRow-s").removeClass("ivole-histogramRow-s"); if(cr_rating > 0){ jQuery(this).closest("tr.ivole-histogramRow").addClass("ivole-histogramRow-s"); } jQuery(".cr-search-no-reviews").hide(); jQuery('.cr-ajax-search input').val("").trigger("change"); jQuery("#cr-show-more-reviews-id").hide(); jQuery(".commentlist.cr-ajax-reviews-list").hide(); jQuery("#cr-show-more-review-spinner").show(); jQuery("div.ivole-summaryBox.cr-summaryBox-ajax").addClass("cr-summaryBar-updating"); jQuery("#cr-ajax-reviews-sort").addClass("cr-sort-updating"); jQuery.post(ajax_object.ajax_url, cr_data, function(response){ jQuery("#cr-show-more-review-spinner").hide(); jQuery("div.ivole-summaryBox.cr-summaryBox-ajax").removeClass("cr-summaryBar-updating"); jQuery("#cr-ajax-reviews-sort").removeClass("cr-sort-updating"); if(response.page>0){ jQuery("div#cr-ajax-reviews-fil-sta").remove(); jQuery(".cr-reviews-ajax-comments div.cr-summaryBox-wrap").append(response.filter_note); jQuery(".commentlist.cr-ajax-reviews-list").empty(); jQuery(".commentlist.cr-ajax-reviews-list").append(response.html); jQuery(".commentlist.cr-ajax-reviews-list").show(); jQuery("#cr-show-more-reviews-id").attr("data-page",response.page); if(!response.last_page){ jQuery("#cr-show-more-reviews-id").show(); }} }, "json"); }); jQuery('.cr-ajax-search input').on("keyup", function(e){ if(e.keyCode==13){ jQuery(".cr-ajax-search button").trigger("click"); } if(jQuery(this).val()!="") jQuery(".cr-ajax-search .cr-clear-input").css("display", "inline-block"); }).on("change", function(){ if(jQuery(this).val()==="") jQuery(".cr-ajax-search .cr-clear-input").hide(); }); jQuery(".cr-ajax-search .cr-clear-input").on("click", function (){ jQuery(this).prev("input").val(""); jQuery(".cr-ajax-search .cr-clear-input").hide(); jQuery(".cr-ajax-search button").trigger("click"); }); jQuery(".cr-ajax-search button").on("click", function (e){ e.preventDefault(); jQuery("#cr-show-more-reviews-id").attr("data-page", 0); jQuery(".cr-reviews-ajax-comments .cr-ajax-reviews-list").empty(); jQuery("#cr-show-more-reviews-id").trigger("click"); }); jQuery("button.cr-ajax-reviews-add-review").on("click", function(t){ t.preventDefault(); jQuery("#comments.cr-reviews-ajax-comments").hide(); jQuery("#cr-ajax-reviews-review-form").show(); }); jQuery("a#cr-ajax-reviews-cancel").on("click", function(t){ t.preventDefault(); jQuery("#cr-ajax-reviews-review-form").hide(); jQuery("#comments.cr-reviews-ajax-comments").show(); }); jQuery(".cr-review-tags-filter span.cr-tags-filter").on("click", function (e){ e.preventDefault(); jQuery("#cr-show-more-reviews-id").attr("data-page", 0); jQuery(".cr-reviews-ajax-comments .cr-ajax-reviews-list").empty(); if(jQuery(this).hasClass("cr-tag-selected")){ jQuery(this).removeClass("cr-tag-selected"); }else{ jQuery(this).addClass("cr-tag-selected"); } jQuery("#cr-show-more-reviews-id").trigger("click"); }); jQuery("div.iv-comment-image-top img").on("click", function(t){ t.preventDefault(); var slide_no=jQuery(this).data("slide"); jQuery("#reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal-cont").addClass("cr-mask-active"); jQuery("body").addClass("cr-noscroll"); jQuery("#reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal div.cr-ajax-reviews-cus-images-slider-main").slick('setPosition'); jQuery("#reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal div.cr-ajax-reviews-cus-images-slider-nav").slick('setPosition'); if(typeof slide_no!=='undefined'){ jQuery("#reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal div.cr-ajax-reviews-cus-images-slider-main").slick('slickGoTo',slide_no,true); jQuery("#reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal div.cr-ajax-reviews-cus-images-slider-nav").slick('slickGoTo',slide_no,true); }}); jQuery("#reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal-cont, #reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal button.cr-ajax-reviews-cus-images-close").on("click", function(t){ t.preventDefault(); jQuery("#reviews.cr-reviews-ajax-reviews .cr-mask-active div.cr-ajax-reviews-cus-images-modal div.cr-ajax-reviews-cus-images-slider-main").slick('slickGoTo',0,true); jQuery("#reviews.cr-reviews-ajax-reviews .cr-mask-active div.cr-ajax-reviews-cus-images-modal div.cr-ajax-reviews-cus-images-slider-nav").slick('slickGoTo',0,true); jQuery("#reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal-cont").removeClass("cr-mask-active"); jQuery("body").removeClass("cr-noscroll"); }); jQuery("#reviews.cr-reviews-ajax-reviews div.cr-ajax-reviews-cus-images-modal").on("click", function(t){ t.stopPropagation(); }); $(".single_variation_wrap").on("show_variation", function(event, variation){ if(jQuery(".cr_gtin").length){ jQuery(".cr_gtin_val").text(variation._cr_gtin); } if(jQuery(".cr_mpn").length){ jQuery(".cr_mpn_val").text(variation._cr_mpn); } if(jQuery(".cr_brand").length){ jQuery(".cr_brand_val").text(variation._cr_brand); }}); jQuery(document).on('reset_data', function (){ var $cr_gtin=jQuery(".cr_gtin"), $cr_mpn=jQuery(".cr_mpn"), $cr_brand=jQuery(".cr_brand"); if($cr_gtin.length){ jQuery(".cr_gtin_val").text($cr_gtin.data("o_content")); } if($cr_mpn.length){ jQuery(".cr_mpn_val").text($cr_mpn.data("o_content")); } if($cr_brand.length){ jQuery(".cr_brand_val").text($cr_brand.data("o_content")); }}); jQuery('#cr-show-more-all-reviews').on("click", function (e){ e.preventDefault(); var $this=jQuery(this), $spinner=$this.next("#cr-show-more-review-spinner"), attributes=jQuery(this).parents(".cr-all-reviews-shortcode").data("attributes"), cr_rating=jQuery("div.ivole-summaryBox.cr-all-reviews-ajax tr.ivole-histogramRow.ivole-histogramRow-s a.cr-histogram-a").attr("data-rating"); var cr_data={ "action": "cr_show_more_all_reviews", "attributes": attributes, "rating": cr_rating, "page": $this.data("page") }; $this.hide(); $spinner.show(); jQuery.post(ajax_object.ajax_url, cr_data, function(response){ $spinner.hide(); if(response.html!==""){ $this.parents(".cr-all-reviews-shortcode").find(".commentlist").append(response.html); if(!response.last_page){ jQuery("#cr-show-more-all-reviews").show(); } jQuery("#cr-show-more-all-reviews").data("page",response.page); }else{ $this.hide(); }}).fail(function(response){ $spinner.hide(); $this.show(); $this.parent().append('
'+response.responseText+'
'); }); }); jQuery("#cr_all_reviews_shortcode .cr-summaryBox-wrap").on("click", "a.cr-histogram-a, .ivole-seeAllReviews", function(t){ t.preventDefault(); var cr_rating=jQuery(this).data("rating"); var attributes=jQuery(this).parents(".cr-all-reviews-shortcode").data("attributes"); var cr_data={ "action": "cr_show_more_all_reviews", "attributes": attributes, "page": 0, "rating": cr_rating }; jQuery("div.ivole-summaryBox.cr-all-reviews-ajax tr.ivole-histogramRow.ivole-histogramRow-s").removeClass("ivole-histogramRow-s"); if(cr_rating > 0){ jQuery(this).closest("tr.ivole-histogramRow").addClass("ivole-histogramRow-s"); } jQuery("#cr-show-more-all-reviews").hide(); jQuery("#cr_all_reviews_shortcode .commentlist").hide(); jQuery("#cr-show-more-review-spinner").show(); jQuery("div.ivole-summaryBox.cr-all-reviews-ajax").addClass("cr-summaryBar-updating"); jQuery("#cr-ajax-reviews-fil-sta a.ivole-seeAllReviews").addClass("cr-seeAll-updating"); jQuery.post(ajax_object.ajax_url, cr_data, function(response){ jQuery("#cr-show-more-review-spinner").hide(); jQuery("div.ivole-summaryBox.cr-all-reviews-ajax").removeClass("cr-summaryBar-updating"); jQuery("#cr-ajax-reviews-fil-sta a.ivole-seeAllReviews").removeClass("cr-seeAll-updating"); if(response.html!==""){ jQuery("div#cr-ajax-reviews-fil-sta").remove(); jQuery("#cr_all_reviews_shortcode .cr-summaryBox-wrap").append(response.filter_note); jQuery("#cr_all_reviews_shortcode .commentlist").empty(); jQuery("#cr_all_reviews_shortcode .commentlist").append(response.html); jQuery("#cr_all_reviews_shortcode .commentlist").show(); jQuery("#cr-show-more-all-reviews").data("page",response.page); if(!response.last_page){ jQuery("#cr-show-more-all-reviews").show(); }} }, "json"); }); jQuery("#cr-show-more-reviews-grid").on("click", function (e){ e.preventDefault(); var $this=jQuery(this), $spinner=$this.next(".ivole-show-more-spinner"), attributes=$this.parents(".ivole-reviews-grid").data("attributes"); attributes.offset=$this.parents(".ivole-reviews-grid").find(".ivole-review-card.cr-card-product").length; attributes.shop_offset=$this.parents(".ivole-reviews-grid").find(".ivole-review-card.cr-card-shop").length; var grid_data={ 'action': "ivole_show_more_grid_reviews", 'attributes': attributes }; $this.hide(); $spinner.show(); jQuery.post(ajax_object.ajax_url, grid_data, function(response){ $spinner.hide(); $reviews=jQuery(response.html).find(".ivole-reviews-grid-inner"); if($reviews.length){ $this.parents(".ivole-reviews-grid").find(".ivole-reviews-grid-inner").append($reviews.html()); $this.show(); resizeAllGridItems(); }else{ $this.hide(); }}).fail(function(response){ $spinner.hide(); $this.show(); $this.parent().append('
'+response.responseText+'
'); }); }); jQuery('#cr_floatingtrustbadge_front').on("click", function(){ if(!jQuery(this).hasClass('cr-floatingbadge-big')){ jQuery(this).find('img.cr_floatingtrustbadge_small').hide(); jQuery(this).find('a.cr_floatingtrustbadge_big').css('display', 'block'); jQuery(this).find('div.cr-floatingbadge-close').css('display', 'block'); jQuery(this).addClass('cr-floatingbadge-big'); var crcolors=jQuery(this).data('crcolors'); if(typeof crcolors!=='undefined'){ jQuery(this).css('border-color', crcolors['big']['border']); jQuery(this).find('div.cr-floatingbadge-background-top').css('background-color', crcolors['big']['top']); jQuery(this).find('div.cr-floatingbadge-background-middle').css('background-color', crcolors['big']['middle']); jQuery(this).find('div.cr-floatingbadge-background-bottom').css('background-color', crcolors['big']['bottom']); jQuery(this).find('div.cr-floatingbadge-background-bottom').css('border-color', crcolors['big']['border']); }} }); jQuery('#cr_floatingtrustbadge_front .cr-floatingbadge-close').on("click", function(event){ if(jQuery('#cr_floatingtrustbadge_front').hasClass('cr-floatingbadge-big')){ jQuery(this).closest('#cr_floatingtrustbadge_front').find('a.cr_floatingtrustbadge_big').hide(); jQuery(this).closest('#cr_floatingtrustbadge_front').find('img.cr_floatingtrustbadge_small').css('display', 'block'); jQuery(this).closest('#cr_floatingtrustbadge_front').removeClass('cr-floatingbadge-big'); var crcolors=jQuery(this).closest('#cr_floatingtrustbadge_front').data('crcolors'); if(typeof crcolors!=='undefined'){ jQuery(this).closest('#cr_floatingtrustbadge_front').css('border-color', crcolors['small']['border']); jQuery(this).closest('#cr_floatingtrustbadge_front').find('div.cr-floatingbadge-background-top').css('background-color', crcolors['small']['top']); jQuery(this).closest('#cr_floatingtrustbadge_front').find('div.cr-floatingbadge-background-middle').css('background-color', crcolors['small']['middle']); jQuery(this).closest('#cr_floatingtrustbadge_front').find('div.cr-floatingbadge-background-bottom').css('background-color', crcolors['small']['bottom']); jQuery(this).closest('#cr_floatingtrustbadge_front').find('div.cr-floatingbadge-background-bottom').css('border-color', crcolors['small']['border']); }}else{ jQuery('#cr_floatingtrustbadge_front').hide(); document.cookie='cr_hide_trustbadge=true; path=/; max-age='+60*60*24+';'; } event.stopPropagation(); }); jQuery('.cr-slider-read-more a').on("click", function (e){ e.preventDefault(); let parent=jQuery(this).parents(".review-text"); parent.find(".cr-slider-read-more").hide(); parent.find(".cr-slider-details").css("display", "inline"); }); jQuery('.cr-slider-read-less a').on("click", function (e){ e.preventDefault(); let parent=jQuery(this).parents(".review-text"); parent.find(".cr-slider-details").hide(); parent.find(".cr-slider-read-more").css("display", "inline"); }); jQuery('#cr_qna.cr-qna-block .cr-qna-search-block button.cr-qna-ask-button').on("click", function (e){ e.preventDefault(); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form').addClass("cr-q-modal"); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-qna-new-a-form').removeClass("cr-q-modal"); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay').addClass("cr-q-modal"); jQuery("body").addClass("cr-noscroll"); }); jQuery("#cr_qna.cr-qna-block .cr-qna-list-block .cr-qna-list-block-inner").on("click", ".cr-qna-ans-button", function (e){ e.preventDefault(); let parent=jQuery(this).parents(".cr-qna-list-q-cont"); let question=parent.find("span.cr-qna-list-question").text(); if(question.length){ jQuery("#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-qna-new-a-form .cr-qna-new-q-form-input .cr-qna-new-q-form-text").text(question); } let question_id=jQuery(this).attr("data-question"); if(question_id.length){ jQuery("#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-input .cr-qna-new-q-form-s-b").attr("data-question", question_id); } jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form').removeClass("cr-q-modal"); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-qna-new-a-form').addClass("cr-q-modal"); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay').addClass("cr-q-modal"); jQuery("body").addClass("cr-noscroll"); }); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay').on("click", function (e){ e.preventDefault(); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-ok').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-error').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-input').css('display', 'block'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form').removeClass('cr-q-modal'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay').removeClass('cr-q-modal'); jQuery("body").removeClass("cr-noscroll"); }); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-close').on("click", function (e){ e.preventDefault(); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-ok').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-error').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-input').css('display', 'block'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form').removeClass('cr-q-modal'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay').removeClass('cr-q-modal'); jQuery("body").removeClass("cr-noscroll"); }); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form').on("click", function (e){ e.stopPropagation(); }); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-q, #cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-name, #cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-email').on("input", function (e){ jQuery(this).addClass('cr-qna-new-q-form-notinit'); crValidateQna(); }); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-input .cr-qna-new-q-form-s-b').on("click", function (e){ if(crValidateQnaHelper()){ var cr_cptcha=jQuery(this).attr("data-crcptcha"); if(cr_cptcha&&cr_cptcha.length > 0){ grecaptcha.ready(function(){ grecaptcha.execute(cr_cptcha, {action: 'submit'}).then(function(token){ crNewQna(token) }); }); }else{ crNewQna(''); }} }); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-ok .cr-qna-new-q-form-s-b').on("click", function (e){ e.preventDefault(); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-ok').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-error').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-input').css('display', 'block'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form').removeClass('cr-q-modal'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay').removeClass('cr-q-modal'); jQuery("body").removeClass("cr-noscroll"); }); jQuery("#cr_qna.cr-qna-block .cr-qna-list-block").on("click", ".cr-qna-list-q-cont .cr-qna-list-q-b .cr-qna-list-q-b-r .cr-qna-q-voting img", function (e){ e.preventDefault(); var cr_upvote=0; var cr_question_id=0; cr_question_id=jQuery(this).parents(".cr-qna-q-voting").attr("data-vquestion");; cr_upvote=jQuery(this).attr("data-upvote"); var cr_data={ "action": "cr_vote_question", "questionID": cr_question_id, "upvote": cr_upvote }; jQuery(this).parents(".cr-qna-q-voting").addClass("cr-q-vote-loading"); jQuery(this).parents(".cr-qna-list-q-b-r").find(".cr-qna-q-voting-spinner").addClass("cr-q-vote-loading"); jQuery.post(ajax_object.ajax_url, cr_data, function(response){ jQuery("#cr_qna.cr-qna-block .cr-qna-list-block .cr-qna-list-q-cont .cr-qna-list-q-b .cr-qna-list-q-b-r .cr-qna-q-voting-spinner-" + response.qid).removeClass("cr-q-vote-loading"); jQuery("#cr_qna.cr-qna-block .cr-qna-list-block .cr-qna-list-q-cont .cr-qna-list-q-b .cr-qna-list-q-b-r .cr-qna-q-voting-" + response.qid).removeClass("cr-q-vote-loading"); if(0===response.code){ jQuery("#cr_qna.cr-qna-block .cr-qna-list-block .cr-qna-list-q-cont .cr-qna-list-q-b .cr-qna-list-q-b-r .cr-qna-q-voting-" + response.qid + " .cr-qna-q-voting-upvote").text("(" + response.upvotes + ")"); jQuery("#cr_qna.cr-qna-block .cr-qna-list-block .cr-qna-list-q-cont .cr-qna-list-q-b .cr-qna-list-q-b-r .cr-qna-q-voting-" + response.qid + " .cr-qna-q-voting-downvote").text("(" + response.downvotes + ")"); }}, "json"); }); jQuery("#cr_qna.cr-qna-block #cr-show-more-q-id").on("click", function(t){ t.preventDefault(); var cr_product_id=jQuery(this).attr("data-product"); var cr_nonce=jQuery(this).attr("data-nonce"); var cr_page=jQuery(this).attr("data-page"); var cr_search=jQuery("#cr_qna.cr-qna-block .cr-ajax-qna-search input").val(); var cr_data={ "action": "cr_show_more_qna", "productID": cr_product_id, "page": cr_page, "search": cr_search, "security": cr_nonce }; jQuery("#cr_qna.cr-qna-block .cr-search-no-qna").hide(); jQuery("#cr_qna.cr-qna-block #cr-show-more-q-id").hide(); jQuery("#cr_qna.cr-qna-block #cr-show-more-q-spinner").show(); jQuery.post(ajax_object.ajax_url, cr_data, function(response){ jQuery("#cr_qna.cr-qna-block #cr-show-more-q-spinner").hide(); if(response.page >=0){ jQuery("#cr_qna.cr-qna-block .cr-qna-list-block .cr-qna-list-block-inner").append(response.html); jQuery("#cr_qna.cr-qna-block #cr-show-more-q-id").attr("data-page",response.page); if(!response.last_page){ jQuery("#cr_qna.cr-qna-block #cr-show-more-q-id").show(); }} if(response.html===""&&response.page===0){ jQuery("#cr_qna.cr-qna-block .cr-search-no-qna").show(); }}, "json"); }); jQuery("#cr_qna.cr-qna-block .cr-ajax-qna-search input").on("keyup", cr_keyup_delay(function(e){ var code=(e.keyCode||e.which); if(code==37||code==38||code==39||code==40){ return; } jQuery("#cr_qna.cr-qna-block #cr-show-more-q-id").attr("data-page", -1); jQuery("#cr_qna.cr-qna-block .cr-qna-list-block .cr-qna-list-block-inner").empty(); jQuery("#cr_qna.cr-qna-block #cr-show-more-q-id").trigger("click"); }, 500)); jQuery("#cr_qna.cr-qna-block .cr-ajax-qna-search input").on("keyup", function(e){ if(jQuery(this).val()!==""){ jQuery("#cr_qna.cr-qna-block .cr-ajax-qna-search .cr-clear-input").css("display", "inline-block"); }else{ if(jQuery(this).val()==="") jQuery("#cr_qna.cr-qna-block .cr-ajax-qna-search .cr-clear-input").hide(); }}).on("change", function(){ if(jQuery(this).val()==="") jQuery("#cr_qna.cr-qna-block .cr-ajax-qna-search .cr-clear-input").hide(); }); jQuery("#cr_qna.cr-qna-block .cr-ajax-qna-search .cr-clear-input").on("click", function (){ jQuery(this).prev("input").val(""); jQuery("#cr_qna.cr-qna-block .cr-ajax-qna-search .cr-clear-input").hide(); jQuery("#cr_qna.cr-qna-block #cr-show-more-q-id").attr("data-page", -1); jQuery("#cr_qna.cr-qna-block .cr-qna-list-block .cr-qna-list-block-inner").empty(); jQuery("#cr_qna.cr-qna-block #cr-show-more-q-id").trigger("click"); }); jQuery("body").on("click", "a.cr-qna-link", function (){ jQuery('.cr_qna_tab a').click(); return true; }); }); function resizeAllGridItems(){ jQuery('.ivole-reviews-grid-inner > .ivole-review-card').each(function(){ let $parent=jQuery(this).parent(); let parent_width=$parent.width(); let classes=["ivole-reviews-grid-inner"]; if(parent_width < 680){ classes.push("cr-grid-columns-2"); }else classes=classes.filter(val=> val!=="cr-grid-columns-2"); if(parent_width < 480){ classes.push("cr-single-column"); }else classes=classes.filter(val=> val!=="cr-single-column"); $parent.removeClass(); $parent[0].className=classes.join(" "); let rowHeight=parseInt($parent.css('grid-auto-rows')); if(isNaN(rowHeight)) rowHeight=0; let rowGap=parseInt($parent.css('grid-row-gap')); let rowSpan=Math.ceil(( jQuery(this).find('.ivole-review-card-content').height() + parseInt(jQuery(this).css("borderTopWidth")) + parseInt(jQuery(this).css("borderBottomWidth")) + parseInt(jQuery(this).css("paddingTop")) + parseInt(jQuery(this).css("paddingBottom")) + rowGap ) /(rowHeight + rowGap) ); jQuery(this).css('gridRowEnd', 'span ' + rowSpan); }); } function initVoteClick(sel1, sel2){ jQuery(sel1).on("click", sel2, function(e){ e.preventDefault(); let reviewIDhtml=jQuery(this).data("vote"); let $parent=jQuery(this).parents(".ivole-voting-cont"); if(reviewIDhtml!=null){ let reviewID=reviewIDhtml; let data={ "action": "ivole_vote_review", "reviewID": reviewID, "upvote": jQuery(this).data("upvote"), "security": ajax_object.ajax_nonce }; $parent.find(".ivole-declarative").hide(); $parent.find(".ivole-reviewvoting-" + reviewID).text(ajax_object.text_processing); jQuery.post(ajax_object.ajax_url, data, function(response){ if(response.code===0){ $parent.find(".ivole-reviewvoting-" + reviewID).text(ajax_object.text_thankyou); }else if(response.code===1){ $parent.find(".ivole-reviewvoting-" + reviewID).text(ajax_object.text_thankyou); }else if(response.code===2){ $parent.find(".ivole-reviewvoting-" + reviewID).text(ajax_object.text_thankyou); }else if(response.code===3){ $parent.find(".ivole-reviewvoting-" + reviewID).text(ajax_object.text_error1); }else{ $parent.find(".ivole-reviewvoting-" + reviewID).text(ajax_object.text_error2); }}, "json"); }}); } function crValidateQnaHelper(){ var ret=true; if(jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-q').val().trim().length <=0){ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-q').addClass('cr-qna-new-q-form-invalid'); ret=false; }else{ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-q').removeClass('cr-qna-new-q-form-invalid'); } if(jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-name').val().trim().length <=0){ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-name').addClass('cr-qna-new-q-form-invalid'); ret=false; }else{ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-name').removeClass('cr-qna-new-q-form-invalid'); } if(!crValidateEmail(jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-email').val().trim())){ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-email').addClass('cr-qna-new-q-form-invalid'); ret=false; }else{ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-email').removeClass('cr-qna-new-q-form-invalid'); } return ret; } function crValidateQna(){ if(crValidateQnaHelper()){ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-s button.cr-qna-new-q-form-s-b').addClass('cr-q-active'); }else{ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-s button.cr-qna-new-q-form-s-b').removeClass('cr-q-active'); }} function crValidateEmail(email){ var re=/\S+@\S+\.\S+/; return re.test(email); } function crNewQna(token){ var cr_nonce=jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input .cr-qna-new-q-form-s-b').attr("data-nonce"); var cr_product_id=jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input .cr-qna-new-q-form-s-b').attr("data-product"); var cr_text=jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-q').val().trim(); var cr_name=jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-name').val().trim(); var cr_email=jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-email').val().trim(); var cr_question_id=jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input .cr-qna-new-q-form-s-b').attr("data-question"); var cr_data={ "action": "cr_new_qna", "productID": cr_product_id, "questionID": cr_question_id, "text": cr_text, "name": cr_name, "email": cr_email, "security": cr_nonce, "cptcha": token }; jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input .cr-qna-new-q-form-s-b').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input .cr-qna-new-q-form-s-p').css('display', 'inline-block'); jQuery.post(ajax_object.ajax_url, cr_data, function(response){ if(0===response.code){ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-error').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-ok').css('display', 'block'); }else{ if(response.description&&response.description.length > 0){ jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-error p.cr-qna-new-q-form-text').append(' ' + response.description); } jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-ok').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input').css('display', 'none'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-error').css('display', 'block'); } jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-q').val(''); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-name').val(''); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-email').val(''); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-q, #cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-name, #cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form .cr-qna-new-q-form-email').removeClass('cr-qna-new-q-form-notinit'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input .cr-qna-new-q-form-s-b').css('display', 'inline-block'); jQuery('#cr_qna.cr-qna-block .cr-qna-new-q-overlay .cr-qna-new-q-form.cr-q-modal .cr-qna-new-q-form-input .cr-qna-new-q-form-s-p').css('display', 'none'); }, "json"); } function cr_keyup_delay(fn, ms){ let timer=0; return function(...args){ clearTimeout(timer); timer=setTimeout(fn.bind(this, ...args), ms||0); };}; !function(){"use strict";function e(b){b.fn._fadeIn=b.fn.fadeIn;var p=b.noop||function(){},h=/MSIE/.test(navigator.userAgent),k=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),y=(document.documentMode,b.isFunction(document.createElement("div").style.setExpression));b.blockUI=function(e){o(window,e)},b.unblockUI=function(e){v(window,e)},b.growlUI=function(e,t,o,n){var i=b('
');e&&i.append("

"+e+"

"),t&&i.append("

"+t+"

"),o===undefined&&(o=3e3);var s=function(e){e=e||{},b.blockUI({message:i,fadeIn:"undefined"!=typeof e.fadeIn?e.fadeIn:700,fadeOut:"undefined"!=typeof e.fadeOut?e.fadeOut:1e3,timeout:"undefined"!=typeof e.timeout?e.timeout:o,centerY:!1,showOverlay:!1,onUnblock:n,css:b.blockUI.defaults.growlCSS})};s();i.css("opacity");i.mouseover(function(){s({fadeIn:0,timeout:3e4});var e=b(".blockMsg");e.stop(),e.fadeTo(300,1)}).mouseout(function(){b(".blockMsg").fadeOut(1e3)})},b.fn.block=function(e){if(this[0]===window)return b.blockUI(e),this;var t=b.extend({},b.blockUI.defaults,e||{});return this.each(function(){var e=b(this);t.ignoreIfBlocked&&e.data("blockUI.isBlocked")||e.unblock({fadeOut:0})}),this.each(function(){"static"==b.css(this,"position")&&(this.style.position="relative",b(this).data("blockUI.static",!0)),this.style.zoom=1,o(this,e)})},b.fn.unblock=function(e){return this[0]===window?(b.unblockUI(e),this):this.each(function(){v(this,e)})},b.blockUI.version=2.7,b.blockUI.defaults={message:"

Please wait...

",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var m=null,g=[];function o(e,o){var t,n,i,s,l,d,a,c,r,u=e==window,f=o&&o.message!==undefined?o.message:undefined;(o=b.extend({},b.blockUI.defaults,o||{})).ignoreIfBlocked&&b(e).data("blockUI.isBlocked")||(o.overlayCSS=b.extend({},b.blockUI.defaults.overlayCSS,o.overlayCSS||{}),i=b.extend({},b.blockUI.defaults.css,o.css||{}),o.onOverlayClick&&(o.overlayCSS.cursor="pointer"),s=b.extend({},b.blockUI.defaults.themedCSS,o.themedCSS||{}),f=f===undefined?o.message:f,u&&m&&v(window,{fadeOut:0}),f&&"string"!=typeof f&&(f.parentNode||f.jquery)&&(t=f.jquery?f[0]:f,a={},b(e).data("blockUI.history",a),a.el=t,a.parent=t.parentNode,a.display=t.style.display,a.position=t.style.position,a.parent&&a.parent.removeChild(t)),b(e).data("blockUI.onUnblock",o.onUnblock),r=o.baseZ,a=h||o.forceIframe?b(''):b(''),t=o.theme?b(''):b(''),o.theme&&u?(c='"):o.theme?(c='"):c=u?'':'',r=b(c),f&&(o.theme?(r.css(s),r.addClass("ui-widget-content")):r.css(i)),o.theme||t.css(o.overlayCSS),t.css("position",u?"fixed":"absolute"),(h||o.forceIframe)&&a.css("opacity",0),c=[a,t,r],n=b(u?"body":e),b.each(c,function(){this.appendTo(n)}),o.theme&&o.draggable&&b.fn.draggable&&r.draggable({handle:".ui-dialog-titlebar",cancel:"li"}),s=y&&(!b.support.boxModel||0 .blockUI"):s.find(">.blockUI"),t.cursorReset&&(1'+wc_add_to_cart_params.i18n_view_cart+""),d(document.body).trigger("wc_cart_button_updated",[r]))},t.prototype.updateFragments=function(t,a){a&&(d.each(a,function(t){d(t).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),d.each(a,function(t,a){d(t).replaceWith(a),d(t).stop(!0).css("opacity","1").unblock()}),d(document.body).trigger("wc_fragments_loaded"))},new t}); !function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(m,n,e,t){var f={features:null,bind:function(e,t,n,i){var o=(i?"remove":"add")+"EventListener";t=t.split(" ");for(var a=0;ah.currItem.fitRatio?be||(jt(h.currItem,!1,!0),be=!0):be&&(jt(h.currItem),be=!1)),Ee(te,pe.x,pe.y,g))},ke=function(e){e.container&&Ee(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},Re=function(e,t){t[A]=p+e+"px, 0px"+v},Pe=function(e,t){var n;!y.loop&&t&&(n=x+(ye.x*fe-e)/ye.x,t=Math.round(e-ct.x),(n<0&&0=Ht()-1&&t<0)&&(e=ct.x+t*y.mainScrollEndFriction)),ct.x=e,Re(e,a)},Ze=function(e,t){var n=dt[e]-he[e];return de[e]+ce[e]+n-t/d*n},Fe=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Le=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},ze=null,_e=function(){ze&&(f.unbind(document,"mousemove",_e),f.addClass(m,"pswp--has_mouse"),y.mouseUsed=!0,Me("mouseUsed")),ze=setTimeout(function(){ze=null},100)},Ne=function(e,t){e=Vt(h.currItem,me,e);return t&&(ee=e),e},Ue=function(e){return(e=e||h.currItem).initialZoomLevel},He=function(e){return 0<(e=e||h.currItem).w?y.maxSpreadZoom:1},Ye=function(e,t,n,i){return i===h.currItem.initialZoomLevel?(n[e]=h.currItem.initialPosition[e],!0):(n[e]=Ze(e,i),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]=Ht())&&(x=0),h.currItem=Ut(x),(z.isOldIOSPhone||z.isOldAndroid)&&(ge=!1),m.setAttribute("aria-hidden","false"),y.modal&&(ge?m.style.position="fixed":(m.style.position="absolute",m.style.top=f.getScrollY()+"px")),L===undefined&&(Me("initialLayout"),L=Z=f.getScrollY());t="pswp--open ";for(y.mainClass&&(t+=y.mainClass+" "),y.showHideOpacity&&(t+="pswp--animate_opacity "),t+=O?"pswp--touch":"pswp--notouch",t+=z.animationName?" pswp--css_animation":"",t+=z.svg?" pswp--svg":"",f.addClass(m,t),h.updateSize(),l=-1,xe=null,e=0;e<3;e++)Re((e+l)*ye.x,I[e].el.style);F||f.bind(h.scrollWrap,u,h),Te("initialZoomInEnd",function(){h.setContent(I[0],x-1),h.setContent(I[2],x+1),I[0].el.style.display=I[2].el.style.display="block",y.focus&&m.focus(),f.bind(document,"keydown",h),z.transform&&f.bind(h.scrollWrap,"click",h),y.mouseUsed||f.bind(document,"mousemove",_e),f.bind(window,"resize scroll orientationchange",h),Me("bindEvents")}),h.setContent(I[1],x),h.updateCurrItem(),Me("afterInit"),ge||(w=setInterval(function(){Ve||G||J||g!==h.currItem.initialZoomLevel||h.updateSize()},1e3)),f.addClass(m,"pswp--visible")}},close:function(){r&&(i=!(r=!1),Me("close"),f.unbind(window,"resize scroll orientationchange",h),f.unbind(window,"scroll",c.scroll),f.unbind(document,"keydown",h),f.unbind(document,"mousemove",_e),z.transform&&f.unbind(h.scrollWrap,"click",h),G&&f.unbind(window,s,h),clearTimeout(_),Me("unbindEvents"),Yt(h.currItem,null,!0,h.destroy))},destroy:function(){Me("destroy"),Lt&&clearTimeout(Lt),m.setAttribute("aria-hidden","true"),m.className=P,w&&clearInterval(w),f.unbind(h.scrollWrap,u,h),f.unbind(window,"scroll",h),ft(),$e(),De=null},panTo:function(e,t,n){n||(e>ee.min.x?e=ee.min.x:eee.min.y?t=ee.min.y:tee.min[e]||aee.min[e]&&(u=y.panEndFriction,ee.min[e],n=ee.min[e]-de[e]),(n<=0||s<0)&&1ot.x&&(o=ot.x)):ee.min.x!==ee.max.x&&(i=a)):(ah.currItem.fitRatio&&(pe[e]+=t[e]*u)},St=function(e){var t;"mousedown"===e.type&&0h.currItem.initialZoomLevel+h.currItem.initialZoomLevel/15&&(le=!0),e=1,a=Ue(),i=He(),nh.currItem.fitRatio&&Rt(H):Ft())}},kt=function(){var t,n,i={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){n=1ee.min[t]?i.backAnimDestination[t]=ee.min[t]:pe[t]=Ht()&&(x=y.loop?0:Ht()-1,o=!0),o&&!y.loop||(xe+=a,fe-=a,n=!0));var o=ye.x*fe,a=Math.abs(o-ct.x),r=n||o>ct.x==0The image could not be loaded.',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return zt.length}},Xt=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},Vt=function(e,t,n){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=Xt(),e.initialPosition=e.bounds.center,e.bounds;var i,o,a,r=!n;return r&&(e.vGap||(e.vGap={top:0,bottom:0}),Me("parseVerticalMargin",e)),Wt.x=t.x,Wt.y=t.y-e.vGap.top-e.vGap.bottom,r&&(i=Wt.x/e.w,o=Wt.y/e.h,e.fitRatio=iWt.x?Math.round(Wt.x-i):a.center.x,a.max.y=o>Wt.y?Math.round(Wt.y-o)+t.vGap.top:a.center.y,a.min.x=i>Wt.x?0:a.center.x,a.min.y=o>Wt.y?t.vGap.top:a.center.y,r&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},Kt=function(e,t,n,i,o,a){t.loadError||i&&(t.imageAppended=!0,jt(t,i,t===h.currItem&&be),n.appendChild(i),a&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))},qt=function(e){e.loading=!0,e.loaded=!1;var t=e.img=f.createEl("pswp__img","img"),n=function(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,t.onload=t.onerror=null,t=null};return t.onload=n,t.onerror=function(){e.loadError=!0,n()},t.src=e.src,t.alt=e.alt||"",t},$t=function(e,t){if(e.src&&e.loadError&&e.container)return t&&(e.container.innerHTML=""),e.container.innerHTML=y.errorMsg.replace("%url%",e.src),!0},jt=function(e,t,n){var i;e.src&&(t=t||e.container.lastChild,i=n?e.w:Math.round(e.w*e.fitRatio),n=n?e.h:Math.round(e.h*e.fitRatio),e.placeholder&&!e.loaded&&(e.placeholder.style.width=i+"px",e.placeholder.style.height=n+"px"),t.style.width=i+"px",t.style.height=n+"px")},Jt=function(){if(Bt.length){for(var e,t=0;t=ee.max.x&&n<=ee.min.y&&n>=ee.max.y)&&e.preventDefault(),h.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:me.x/2+he.x,y:me.y/2+he.y};var t=y.getDoubleTapZoom(!0,h.currItem),n=g===t;h.mouseZoomedIn=!n,h.zoomTo(n?h.currItem.initialZoomLevel:t,e,333),f[(n?"remove":"add")+"Class"](m,"pswp--zoomed-in")}}});var on,an,rn,ln,sn,un,cn,dn,pn,mn,fn,hn,yn={history:!0,galleryUID:1},xn=function(){return fn.hash.substring(1)},gn=function(){on&&clearTimeout(on),rn&&clearTimeout(rn)},vn=function(){var e=xn(),t={};if(e.length<5)return t;var n,i=e.split("&");for(a=0;a