// source --> https://yesterify.com/wp-content/plugins/woocommerce/assets/js/frontend/single-product.min.js?ver=11.1.0 
jQuery(function(t){if("undefined"==typeof wc_single_product_params)return!1;t("body").on("init",".wc-tabs-wrapper, .woocommerce-tabs",function(){t(this).find(".wc-tab, .woocommerce-tabs .panel:not(.panel .panel)").hide();var e=window.location.hash,i=window.location.href,o=t(this).find(".wc-tabs, ul.tabs").first();e.toLowerCase().indexOf("comment-")>=0||"#reviews"===e||"#tab-reviews"===e?o.find("li.reviews_tab a").trigger("click"):i.indexOf("comment-page-")>0||i.indexOf("cpage=")>0?o.find("li.reviews_tab a").trigger("click"):"#tab-additional_information"===e?o.find("li.additional_information_tab a").trigger("click"):o.find("li:first a").trigger("click")}).on("click",".wc-tabs li a, ul.tabs li a",function(e){e.preventDefault();var i=t(this),o=i.closest(".wc-tabs-wrapper, .woocommerce-tabs"),a=o.find(".wc-tabs, ul.tabs");a.find("li").removeClass("active"),a.find('a[role="tab"]').attr("aria-selected","false").attr("tabindex","-1"),o.find(".wc-tab, .panel:not(.panel .panel)").hide(),i.closest("li").addClass("active"),i.attr("aria-selected","true").attr("tabindex","0"),o.find("#"+i.attr("href").split("#")[1]).show()}).on("keydown",".wc-tabs li a, ul.tabs li a",function(e){var i="rtl"===document.documentElement.dir,o=e.key,a=i?"ArrowLeft":"ArrowRight",r=i?"ArrowRight":"ArrowLeft",n="ArrowDown",s="ArrowUp",c="Home",l="End";if([a,r,n,s,l,c].includes(o)){var d=t(this),h=d.closest(".wc-tabs-wrapper, .woocommerce-tabs").find(".wc-tabs, ul.tabs").find('a[role="tab"]'),p=h.length-1,u=h.index(d),m=o===r||o===s?u-1:u+1,g="horizontal";if(h.length>=2){var f=h[0].getBoundingClientRect(),w=h[1].getBoundingClientRect();g=Math.abs(w.top-f.top)>Math.abs(w.left-f.left)?"vertical":"horizontal"}("vertical"!==g||o!==r&&o!==a)&&("horizontal"!==g||o!==s&&o!==n)&&(e.preventDefault(),o===r&&0===u&&"horizontal"===g||o===s&&0===u&&"vertical"===g||o===l?m=p:(a===o&&u===p&&"horizontal"===g||n===o&&u===p&&"vertical"===g||o===c)&&(m=0),h.eq(m).trigger("focus"))}}).on("click","a.woocommerce-review-link",function(){return t(".reviews_tab a").trigger("click"),!0}).on("init","#rating",function(){t(this).hide().before('<p class="stars">\t\t\t\t\t\t<span role="group" aria-labelledby="comment-form-rating-label">\t\t\t\t\t\t\t<a role="radio" tabindex="0" aria-checked="false" class="star-1" href="#">'+wc_single_product_params.i18n_rating_options[0]+'</a>\t\t\t\t\t\t\t<a role="radio" tabindex="-1" aria-checked="false" class="star-2" href="#">'+wc_single_product_params.i18n_rating_options[1]+'</a>\t\t\t\t\t\t\t<a role="radio" tabindex="-1" aria-checked="false" class="star-3" href="#">'+wc_single_product_params.i18n_rating_options[2]+'</a>\t\t\t\t\t\t\t<a role="radio" tabindex="-1" aria-checked="false" class="star-4" href="#">'+wc_single_product_params.i18n_rating_options[3]+'</a>\t\t\t\t\t\t\t<a role="radio" tabindex="-1" aria-checked="false" class="star-5" href="#">'+wc_single_product_params.i18n_rating_options[4]+"</a>\t\t\t\t\t\t</span>\t\t\t\t\t</p>")}).on("click","#respond p.stars a",function(){var e=t(this),i=e.closest("p.stars").find("a").index(e)+1,o=t(this).closest("#respond").find("#rating"),a=t(this).closest(".stars");return o.val(i),e.siblings("a").removeClass("active").attr("aria-checked","false").attr("tabindex","-1"),e.addClass("active").attr("aria-checked","true").attr("tabindex","0"),a.addClass("selected"),!1}).on("click","#respond #submit",function(){var e=t(this).closest("#respond").find("#rating"),i=e.val();if(e.length>0&&!i&&"yes"===wc_single_product_params.review_rating_required)return window.alert(wc_single_product_params.i18n_required_rating_text),!1}).on("keyup",".wc-tabs li a, ul.tabs li a, #respond p.stars a",function(e){var i=e.key,o=["ArrowRight","ArrowDown"];o.concat(["ArrowLeft","ArrowUp"]).includes(i)&&(e.preventDefault(),e.stopPropagation(),o.includes(i)?t(this).next().trigger("focus").click():t(this).prev().trigger("focus").click())}),t(".wc-tabs-wrapper, .woocommerce-tabs, #rating").trigger("init");var e=function(e,i){this.$target=e,this.$images=t(".woocommerce-product-gallery__image",e),0!==this.$images.length?(e.data("product_gallery",this),this.flexslider_enabled="function"==typeof t.fn.flexslider&&wc_single_product_params.flexslider_enabled,this.zoom_enabled="function"==typeof t.fn.zoom&&wc_single_product_params.zoom_enabled,this.photoswipe_enabled="undefined"!=typeof PhotoSwipe&&wc_single_product_params.photoswipe_enabled,i&&(this.flexslider_enabled=!1!==i.flexslider_enabled&&this.flexslider_enabled,this.zoom_enabled=!1!==i.zoom_enabled&&this.zoom_enabled,this.photoswipe_enabled=!1!==i.photoswipe_enabled&&this.photoswipe_enabled),1===this.$images.length&&(this.flexslider_enabled=!1),this.initFlexslider=this.initFlexslider.bind(this),this.initZoom=this.initZoom.bind(this),this.initZoomForTarget=this.initZoomForTarget.bind(this),this.initPhotoswipe=this.initPhotoswipe.bind(this),this.initVideoThumbnailPreviews=this.initVideoThumbnailPreviews.bind(this),this.syncVideoPlayback=this.syncVideoPlayback.bind(this),this.getPhotoswipeVideoHtml=this.getPhotoswipeVideoHtml.bind(this),this.syncPhotoswipeVideoPlayback=this.syncPhotoswipeVideoPlayback.bind(this),this.onResetSlidePosition=this.onResetSlidePosition.bind(this),this.getGalleryItems=this.getGalleryItems.bind(this),this.openPhotoswipe=this.openPhotoswipe.bind(this),this.trapFocusPhotoswipe=this.trapFocusPhotoswipe.bind(this),this.handlePswpTrapFocus=this.handlePswpTrapFocus.bind(this),this.flexslider_enabled?(this.initFlexslider(i.flexslider),e.on("woocommerce_gallery_reset_slide_position",this.onResetSlidePosition)):(this.$target.css("opacity",1),this.syncVideoPlayback(0)),this.zoom_enabled&&(this.initZoom(),e.on("woocommerce_gallery_init_zoom",this.initZoom)),this.photoswipe_enabled&&this.initPhotoswipe()):this.$target.css("opacity",1)};e.prototype.initFlexslider=function(e){var i=this.$target,o=this,a=t.extend({selector:".woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image",start:function(t){i.css("opacity",1),o.syncVideoPlayback(t.currentSlide),o.syncVideoThumbnailPreviewOpacity()},after:function(t){o.initZoomForTarget(o.$images.eq(t.currentSlide)),o.syncVideoPlayback(t.currentSlide),o.syncVideoThumbnailPreviewOpacity()}},e);i.flexslider(a),o.initVideoThumbnailPreviews(),i.off("click.wcProductGalleryVideoThumbs",".flex-control-thumbs img").on("click.wcProductGalleryVideoThumbs",".flex-control-thumbs img",function(){window.setTimeout(function(){o.syncVideoPlayback(),o.syncVideoThumbnailPreviewOpacity()},0)}),t(".woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image").one("load",function(){var e=t(this);e&&setTimeout(function(){var t=e.closest(".woocommerce-product-gallery__image").height(),i=e.closest(".flex-viewport");t&&i&&i.height(t)},100)}).each(function(){this.complete&&t(this).trigger("load")})},e.prototype.syncVideoPlayback=function(t){const e="number"==typeof t?this.$images.eq(t):this.$target.find(".flex-active-slide").first();this.$images.find("video.wp-post-video").each(function(){if(e.has(this).length){const t=this.play();t&&t["catch"]&&t["catch"](function(){return undefined})}else this.pause()})},e.prototype.initVideoThumbnailPreviews=function(){const e=this.$target.find(".flex-control-thumbs img");e.length&&(this.$images.each(function(i,o){const a=t(o).attr("data-thumb-video-src"),r=e.eq(i),n=r.closest("li");if(!a||!r.length||r.siblings("video").length)return;const s=t("<video />",{"class":"woocommerce-product-gallery__video-thumbnail-preview",src:a,preload:"metadata",muted:"muted",playsinline:"playsinline","aria-hidden":"true"}).css({position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",objectFit:"cover",opacity:.5,pointerEvents:"none"});n.addClass("woocommerce-product-gallery__video-thumbnail").css("position","relative"),r.addClass("woocommerce-product-gallery__video-thumbnail-placeholder").css("opacity",0).after(s)}),this.syncVideoThumbnailPreviewOpacity())},e.prototype.syncVideoThumbnailPreviewOpacity=function(){this.$target.find(".flex-control-thumbs li.woocommerce-product-gallery__video-thumbnail").each(function(){const e=t(this),i=e.find("img.flex-active").length>0;e.find(".woocommerce-product-gallery__video-thumbnail-preview").css("opacity",i?1:.5)})},e.prototype.initZoom=function(){"complete"===document.readyState?this.initZoomForTarget(this.$images.first()):t(window).on("load",()=>{this.initZoomForTarget(this.$images.first())})},e.prototype.initZoomForTarget=function(e){if(!this.zoom_enabled)return!1;var i=this.$target.width(),o=!1;if(t(e).each(function(e,a){if(t(a).find("img").data("large_image_width")>i)return o=!0,!1}),o){var a=t.extend({touch:!1,callback:function(){var t=this;setTimeout(function(){t.removeAttribute("role"),t.setAttribute("alt",""),t.setAttribute("aria-hidden","true")},100)}},wc_single_product_params.zoom_options);"ontouchstart"in document.documentElement&&(a.on="click"),e.trigger("zoom.destroy"),e.zoom(a),setTimeout(function(){e.find(":hover").length&&e.trigger("mouseover")},100)}},e.prototype.initPhotoswipe=function(){this.zoom_enabled&&this.$images.length>0?(this.$target.prepend('<a href="#" role="button" class="woocommerce-product-gallery__trigger" aria-haspopup="dialog" aria-controls="photoswipe-fullscreen-dialog" aria-label="'+wc_single_product_params.i18n_product_gallery_trigger_text+'"><span aria-hidden="true">🔍</span></a>'),this.$target.on("click",".woocommerce-product-gallery__trigger",this.openPhotoswipe),this.$target.on("keydown",".woocommerce-product-gallery__trigger",t=>{" "===t.key&&this.openPhotoswipe(t)}),this.$target.on("click",".woocommerce-product-gallery__image a",this.openPhotoswipe)):this.$target.on("click",".woocommerce-product-gallery__image a",this.openPhotoswipe)},e.prototype.onResetSlidePosition=function(){this.$target.flexslider(0)},e.prototype.getGalleryItems=function(){const e=this.$images,i=[],o=this;return e.length>0&&e.each(function(e,a){const r=t(a).find("img[data-large_image], video[data-large_image]").first();if(r.length){const t=r.attr("data-large_image"),e=r.attr("data-large_image_width"),a=r.attr("data-large_image_height"),n=r.attr("alt")||r.attr("aria-label"),s=r.attr("data-caption")?r.attr("data-caption"):r.attr("title");let c;c=r.is("video")?{html:o.getPhotoswipeVideoHtml(r),w:e,h:a,title:s,video:!0}:{alt:n,src:t,w:e,h:a,title:s},i.push(c)}}),i},e.prototype.getPhotoswipeVideoHtml=function(e){const i=e.get(0).currentSrc||e.attr("src"),o=t("<video />",{"class":"woocommerce-product-gallery__photoswipe-video",src:i,preload:"metadata",muted:"muted",loop:"loop",playsinline:"playsinline",style:"display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;","aria-label":e.attr("aria-label")||""}),a=e.attr("poster");return a&&o.attr("poster",a),t("<div />",{"class":"woocommerce-product-gallery__photoswipe-video-wrapper",style:"display:flex;align-items:center;justify-content:center;width:100%;height:100%;"}).append(o).prop("outerHTML")},e.prototype.syncPhotoswipeVideoPlayback=function(e){const i=e.currItem&&e.currItem.container;t(e.template).find("video.woocommerce-product-gallery__photoswipe-video").each(function(){if(i&&i.contains(this)){const t=this.play();t&&t["catch"]&&t["catch"](function(){return undefined})}else this.pause()})},e.prototype.openPhotoswipe=function(e){e.preventDefault();var i,o,a=t(".pswp")[0],r=this.getGalleryItems(),n=t(e.target),s=e.currentTarget,c=!!this.flexslider_enabled&&this.$target.data("flexslider"),l=this;i=0<n.closest(".woocommerce-product-gallery__trigger").length?this.$target.find(".flex-active-slide"):n.closest(".woocommerce-product-gallery__image"),o=t(i).index(),c&&"number"==typeof c.currentSlide&&(o=c.currentSlide);var d=t.extend({index:o,addCaptionHTMLFn:function(t,e){return t.title?(e.children[0].textContent=t.title,!0):(e.children[0].textContent="",!1)},timeToIdle:0},wc_single_product_params.photoswipe_options),h=new PhotoSwipe(a,PhotoSwipeUI_Default,r,d);h.listen("afterInit",function(){l.trapFocusPhotoswipe(!0),l.syncPhotoswipeVideoPlayback(h)}),h.listen("afterChange",function(){l.syncPhotoswipeVideoPlayback(h)}),h.listen("close",function(){t(h.template).find("video.woocommerce-product-gallery__photoswipe-video").each(function(){this.pause()}),l.trapFocusPhotoswipe(!1),s.focus()}),h.init()},e.prototype.trapFocusPhotoswipe=function(t){var e=document.querySelector(".pswp");e&&(t?e.addEventListener("keydown",this.handlePswpTrapFocus):e.removeEventListener("keydown",this.handlePswpTrapFocus))},e.prototype.handlePswpTrapFocus=function(t){var e=t.currentTarget.querySelectorAll("button:not([disabled])"),i=Array.from(e).filter(function(t){return"none"!==t.style.display&&"none"!==window.getComputedStyle(t).display});if(!(1>=i.length)){var o=i[0],a=i[i.length-1];"Tab"===t.key&&(t.shiftKey?document.activeElement===o&&(t.preventDefault(),a.focus()):document.activeElement===a&&(t.preventDefault(),o.focus()))}},t.fn.wc_product_gallery=function(t){return new e(this,t||wc_single_product_params),this},t(".woocommerce-product-gallery").each(function(){t(this).trigger("wc-product-gallery-before-init",[this,wc_single_product_params]),t(this).wc_product_gallery(wc_single_product_params),t(this).trigger("wc-product-gallery-after-init",[this,wc_single_product_params])})});