function shoptimizerWooQuantityButtons(){var t=document.querySelectorAll(".woocommerce-cart-form div.quantity:not(.buttons_added) .qty, .summary div.quantity:not(.buttons_added) .qty");if(0<t.length){var e=document.createElement("div");e.setAttribute("class","quantity-nav"),e.innerHTML='<span tabindex="0" role="button" aria-label="Increase quantity" class="quantity-button quantity-up plus"></span><span tabindex="0" role="button" aria-label="Reduce quantity" class="quantity-button quantity-down minus"></span>',t.forEach(function(t){if("date"!==t.type&&"hidden"!==t.type){t.parentNode.classList.add("buttons_added");var n=e.cloneNode(!0);t.parentNode.insertBefore(n,t.nextSibling)}});var n=document.querySelectorAll("input.qty");0<n.length&&n.forEach(function(t){if(!t.closest(".product-quantity")){var e=parseInt(t.getAttribute("min"));e&&0<e&&parseInt(t.value)<e&&(t.value=e)}})}}jQuery(document).ready(function(t){t(document).ajaxComplete(function(){shoptimizerWooQuantityButtons()}),t(document.body).on("wc_fragments_refreshed",function(){shoptimizerWooQuantityButtons()})}),document.addEventListener("DOMContentLoaded",function(){window.addEventListener("load",function(t){shoptimizerWooQuantityButtons()})}),document.addEventListener("DOMContentLoaded",function(){document.addEventListener("click",function(t){var e=t.target;if(e.classList.contains("plus")||e.classList.contains("minus")){var n=e.closest(".quantity");if(n){var a=n.querySelector("input.qty");if(a){var i=parseInt(a.value),o=parseInt(a.getAttribute("max")),u=parseInt(a.getAttribute("min")),r=a.getAttribute("step");i&&""!==i&&"NaN"!==i||(i=0),(""===o||"NaN"===o)&&(o=""),(""===u||"NaN"===u)&&(u=0),("any"===r||""===r||void 0===r||"NaN"===parseInt(r))&&(r=1),e.classList.contains("plus")?o&&(o===i||i>o)?a.value=o:a.value=i+parseInt(r):u&&(u===i||i<u)?a.value=u:0<i&&(a.value=i-parseInt(r));var s=document.querySelector('.woocommerce-cart-form [name="update_cart"]');s&&(s.removeAttribute("disabled"),s.setAttribute("aria-disabled","false")),a.dispatchEvent(new Event("change",{bubbles:!0}))}}t.stopPropagation(),t.preventDefault();return}})});
const details=document.querySelectorAll('.summary details');
details.forEach(( targetDetail)=> {
targetDetail.addEventListener('click', ()=> {
details.forEach(( detail)=> {
if(detail!==targetDetail){
detail.removeAttribute('open');
}});
});
});
class Accordion {
constructor(el){
this.el=el;
this.summary=el.querySelector('summary');
this.content=el.querySelector('.cg-accordion-item');
this.animation=null;
this.isClosing=false;
this.isExpanding=false;
this.summary.addEventListener('click',(e)=> this.onClick(e) );
}
onClick(e){
e.preventDefault();
this.el.style.overflow='hidden';
if(this.isClosing||! this.el.open){
this.open();
}else if(this.isExpanding||this.el.open){
this.shrink();
}}
shrink(){
this.isClosing=true;
const startHeight=`${this.el.offsetHeight}px`;
const endHeight=`${this.summary.offsetHeight}px`;
if(this.animation){
this.animation.cancel();
}
this.animation=this.el.animate({
height: [ startHeight, endHeight ]
}, {
duration: 200,
easing: 'ease-out'
});
this.animation.onfinish=()=> this.onAnimationFinish(false);
this.animation.oncancel=()=> this.isClosing=false;
}
open(){
this.el.style.height=`${this.el.offsetHeight}px`;
this.el.open=true;
window.requestAnimationFrame(()=> this.expand ());
}
expand (){
this.isExpanding=true;
const startHeight=`${this.el.offsetHeight}px`;
const endHeight=`${this.summary.offsetHeight + this.content.offsetHeight}px`;
if(this.animation){
this.animation.cancel();
}
this.animation=this.el.animate({
height: [ startHeight, endHeight ]
}, {
duration: 200,
easing: 'ease-out'
});
this.animation.onfinish=()=> this.onAnimationFinish(true);
this.animation.oncancel=()=> this.isExpanding=false;
}
onAnimationFinish(open){
this.el.open=open;
this.animation=null;
this.isClosing=false;
this.isExpanding=false;
this.el.style.height=this.el.style.overflow='';
}}
document.querySelectorAll('.summary details').forEach(( el)=> {
new Accordion(el);
});
(()=>{var e,t,n={941(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(212)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},212(e,t,n){e.exports=function(e){function t(e){let n,s,o,i=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";i++;const o=t.formatters[s];if("function"==typeof o){const t=e[i];n=o.call(r,t),e.splice(i,1),i--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e,t){let n=0,r=0,s=-1,o=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(s=r,o=n,r++):(n++,r++);else{if(-1===s)return!1;r=s+1,o++,n=o}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(s(e,n))return!1;for(const n of t.names)if(s(e,n))return!0;return!1},t.humanize=n(997),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},997(e){var t=1e3,n=60*t,r=60*n,s=24*r,o=7*s,i=365.25*s;function a(e,t,n,r){var s=t>=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var o=Math.abs(e);if(o>=s)return a(e,o,s,"day");if(o>=r)return a(e,o,r,"hour");if(o>=n)return a(e,o,n,"minute");if(o>=t)return a(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=s)return Math.round(e/s)+"d";if(o>=r)return Math.round(e/r)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},269(e,t,n){"use strict";n.d(t,{K:()=>i});var r=n(941);const s=n.n(r)()("wc-analytics:consent"),o="statistics";const i=new class{consentListeners=[];isListenerInitialized=!1;isWpConsentApiAvailable(){return"function"==typeof window.wp_has_consent}hasAnalyticsConsent(){if(!this.isWpConsentApiAvailable())return s("WP Consent API not available, defaulting to true for backward compatibility"),!0;const e=window.wp_has_consent(o);return s("Analytics consent status:",e),e}addConsentChangeListener(e){this.consentListeners.push(e),this.initializeConsentListener()}initializeConsentListener(){!this.isListenerInitialized&&this.isWpConsentApiAvailable()&&(s("Initializing consent change listener"),document.addEventListener("wp_listen_for_consent_change",e=>{const t=e.detail;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e===o&&this.notifyListeners("allow"===t[e])}),this.isListenerInitialized=!0)}notifyListeners(e){this.consentListeners.forEach(t=>{try{t(e)}catch(e){s("Error in consent change listener:",e)}})}}},600(e,t,n){"object"==typeof window&&window.wcAnalytics?.assets_url&&(n.p=window.wcAnalytics.assets_url)}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,s),o.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,n)=>(s.f[n](e,t),t),[])),s.u=e=>e+".js?minify=false&ver="+{193:"5b5cf55edcce081b4ad1",686:"5723073a00bf7c2955d7"}[e],s.miniCssF=e=>{},(()=>{if(!s.miniCssF)throw new Error("MiniCSSWithRTLPlugin was loaded before MiniCSSExtractPlugin");var e;s.miniCssF=(e=s.miniCssF,t=>{var n="rtl"===document.dir,r=e(t);return n?r.replace(/\.css(?:$|\?)/,".rtl$&"):r})})(),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@automattic/woocommerce-analytics:",s.l=(n,r,o,i)=>{if(e[n])e[n].push(r);else{var a,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==t+o){a=d;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",t+o),a.src=n),e[n]=[r];var f=(t,r)=>{a.onerror=a.onload=null,clearTimeout(C);var s=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach(e=>e(r)),t)return t(r)},C=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),c&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={310:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,s)=>r=e[t]=[n,s]);n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,a,c]=n,u=0;if(i.some(t=>0!==e[t])){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(c)c(s)}for(t&&t(n);u<i.length;u++)o=i[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk_automattic_woocommerce_analytics=self.webpackChunk_automattic_woocommerce_analytics||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";s(600);var e=s(269);jQuery(()=>{window.wcAnalytics&&(e.K.hasAnalyticsConsent()?s.e(193).then(s.bind(s,633)):e.K.addConsentChangeListener(e=>{e&&s.e(193).then(s.bind(s,633))}))})})()})();
(()=>{"use strict";var e={n:o=>{var i=o&&o.__esModule?()=>o.default:()=>o;return e.d(i,{a:i}),i},d:(o,i)=>{for(var r in i)e.o(i,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:i[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.jQuery;e.n(o)()(function(e){e(".pwb-dropdown-widget").on("change",function(){var o=e(this).find(":selected").val();location.href=o}),"function"==typeof e.fn.slick&&(e(".pwb-carousel").slick({slide:".pwb-slick-slide",infinite:!0,draggable:!1,prevArrow:'<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+"</span></div>",nextArrow:'<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+"</span></div>",speed:300,lazyLoad:"progressive",responsive:[{breakpoint:1024,settings:{slidesToShow:4,draggable:!0,arrows:!1}},{breakpoint:600,settings:{slidesToShow:3,draggable:!0,arrows:!1}},{breakpoint:480,settings:{slidesToShow:2,draggable:!0,arrows:!1}}]}),e(".pwb-product-carousel").slick({slide:".pwb-slick-slide",infinite:!0,draggable:!1,prevArrow:'<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+"</span></div>",nextArrow:'<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+"</span></div>",speed:300,lazyLoad:"progressive",responsive:[{breakpoint:1024,settings:{slidesToShow:3,draggable:!0,arrows:!1}},{breakpoint:600,settings:{slidesToShow:2,draggable:!0,arrows:!1}},{breakpoint:480,settings:{slidesToShow:1,draggable:!0,arrows:!1}}]}));var o=function(){var o=[location.protocol,"//",location.host,location.pathname].join(""),i=window.location.href,r=[];e('.pwb-filter-products input[type="checkbox"]').each(function(o){e(this).prop("checked")&&r.push(e(this).val())}),i=(r=r.join())?-1===(i=(i=i.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i,"")).replace(/\/page\/\d*\//i,"")).indexOf("?")?i+"?pwb-brand-filter="+r:i+"&pwb-brand-filter="+r:o,location.href=i};e(".pwb-apply-filter").on("click",function(){o()}),e(".pwb-remove-filter").on("click",function(){!function(){[location.protocol,"//",location.host,location.pathname].join("");var e=window.location.href;e=(e=e.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i,"")).replace(/\/page\/\d*\//i,""),location.href=e}()}),e(".pwb-filter-products.pwb-hide-submit-btn input").on("change",function(){o()});var r=i("pwb-brand-filter");if(null!=r){var t=r.split(",");e('.pwb-filter-products input[type="checkbox"]').prop("checked",!1);for(var a=0,n=t.length;a<n;a++)e('.pwb-filter-products input[type="checkbox"]').each(function(o){e(this).val()&&t[a]==e(this).val()&&e(this).prop("checked",!0)})}else e('.pwb-filter-products input[type="checkbox"]').prop("checked",!1)});var i=function(e){var o,i,r=decodeURIComponent(window.location.search.substring(1)).split("&");for(i=0;i<r.length;i++)if((o=r[i].split("="))[0]===e)return void 0===o[1]||o[1]}})();
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});
!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);
function _callSuper(t,e,s){return e=_getPrototypeOf(e),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(e,s||[],_getPrototypeOf(t).constructor):e.apply(t,s))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}function _superPropGet(t,e,s,a){var n=_get(_getPrototypeOf(1&a?t.prototype:t),e,s);return 2&a&&"function"==typeof n?function(t){return n.apply(s,t)}:n}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,s){var a=_superPropBase(t,e);if(a)return(a=Object.getOwnPropertyDescriptor(a,e)).get?a.get.call(arguments.length<3?t:s):a.value}).apply(null,arguments)}function _superPropBase(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var s=0;s<e.length;s++){var a=e[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,_toPropertyKey(a.key),a)}}function _createClass(t,e,s){return e&&_defineProperties(t.prototype,e),s&&_defineProperties(t,s),Object.defineProperty(t,"prototype",{writable:!1}),t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var s=t[Symbol.toPrimitive];if(void 0===s)return("string"===e?String:Number)(t);s=s.call(t,e||"default");if("object"!=_typeof(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}(c=>{var t=(()=>_createClass(function t(){if(_classCallCheck(this,t),this.css_selector={},this.button_id="fkwcs_stripe_smart_button",this.payment_request=null,this.express_request_type=null,this.express_button_wrapper=null,this.is_product_page=!1,this.style_value=fkwcs_data.style,this.request_data={},this.cart_request_data={},this.add_to_cart_end_point="fkwcs_add_to_cart",this.is_google_ready_to_pay=!1,this.dataCommon={currency:fkwcs_data.currency,country:fkwcs_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0},""!==fkwcs_data.pub_key){try{this.stripe=Stripe(fkwcs_data.pub_key,{locale:fkwcs_data.locale}),this.init()}catch(t){"yes"===fkwcs_data.debug_log&&console.log("Stripe Error",t)}this.wcEvents()}},[{key:"init",value:function(){"yes"===fkwcs_data.is_product?this.request_data=Object.assign(this.dataCommon,{total:fkwcs_data.single_product.total,requestShipping:"yes"===fkwcs_data.single_product.requestShipping,displayItems:fkwcs_data.single_product.displayItems}):"yes"===fkwcs_data.is_cart&&(this.request_data=Object.assign(this.dataCommon,{total:fkwcs_data.cart_data.order_data.total,requestShipping:"yes"===fkwcs_data.shipping_required,displayItems:fkwcs_data.cart_data.displayItems})),this.setupPaymentRequest()}},{key:"ajaxEndpoint",value:function(t){var e="";return e=fkwcs_data.hasOwnProperty("wc_endpoints")&&fkwcs_data.wc_endpoints.hasOwnProperty(t)?fkwcs_data.wc_endpoints[t]:e}},{key:"setRequestData",value:function(t){var e,s;t.hasOwnProperty("order_data")&&(e=c('input[name="payment_method"]:checked'),s="yes"===t.shipping_required,0<e.length&&"fkwcs_stripe_apple_pay"===e.val()&&(s=!1),this.request_data=Object.assign(this.dataCommon,{total:t.order_data.total,currency:t.order_data.currency,country:t.order_data.country_code,requestShipping:s,displayItems:t.order_data.displayItems}))}},{key:"getRequestData",value:function(){return this.request_data}},{key:"setupPaymentRequest",value:function(){var t=this.getRequestData();if(0!==Object.keys(t).length)try{var e=this.stripe.paymentRequest(t);this.productEvents(e),e.canMakePayment().then(this.makePayment.bind(this)).catch(this.makePaymentCatch.bind(this)),e.on("paymentmethod",this.onPaymentMethod.bind(this)),e.on("shippingaddresschange",this.shippingAddressChange.bind(this)),e.on("shippingoptionchange",this.shippingOptionChange.bind(this)),e.on("cancel",this.cancelPayment.bind(this))}catch(t){console.log(t)}}},{key:"productEvents",value:function(s){var a=this,n=(c(".fkwcs_smart_cart_button").off("click").on("click",function(t){s.show(),t.preventDefault()}),c("body").off("click",".fkwcs_smart_checkout_button").on("click",".fkwcs_smart_checkout_button",function(t){s.show(),t.preventDefault()}),c("button.fkwcs_smart_product_button"));n.off("click").on("click",function(t){var e=c("form.cart button.single_add_to_cart_button");if(!c(this).hasClass("fkwcs_disabled_btn"))return s.show(),t.preventDefault(),c.when(a.addToCartProduct());e.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):e.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text)}),c(document.body).off("show_variation").on("show_variation",function(t,e,s){s?n.removeClass("fkwcs_disabled_btn"):n.addClass("fkwcs_disabled_btn")}),c(document.body).off("hide_variation").on("hide_variation",function(){n.addClass("fkwcs_disabled_btn")}),c(document.body).off("woocommerce_variation_has_changed").on("woocommerce_variation_has_changed",function(){a.updateSelectedProductsData(s)}),c("form.cart .quantity").off("input").on("input",".qty",function(){a.updateSelectedProductsData(s)})}},{key:"updateSelectedProductsData",value:function(e){c.when(this.prepareSelectedProductData()).then(function(t){t.error?self.showErrorMessage(t.error):c.when(e.update({total:t.total,displayItems:t.displayItems})).then(function(){})})}},{key:"createButton",value:function(t){}},{key:"makePayment",value:function(t){var e=c(".fkwcs_smart_buttons");if(t){var s=c(".fkwcs_express_checkout_button_icon"),a=c(".fkwcs_stripe_smart_button_wrapper"),n=c("#fkwcs-payment-request-separator"),r="";if(!0!==this.is_google_ready_to_pay||"yes"!==fkwcs_data.google_pay_as_express||!1!==t.applePay&&null!==t.applePay){if(t.applePay)this.express_request_type="apple_pay",this.express_button_wrapper="fkwcs_ec_applepay_button",r="dark"===fkwcs_data.style.theme?fkwcs_data.icons.applepay_light:fkwcs_data.icons.applepay_gray;else if(t.googlePay)this.express_request_type="google_pay",this.express_button_wrapper="fkwcs_ec_googlepay_button",r="dark"===fkwcs_data.style.theme?fkwcs_data.icons.gpay_light:fkwcs_data.icons.gpay_gray;else{if(!this.linkEnabled())return void e.hide();this.express_request_type="payment_request_api",this.express_button_wrapper="fkwcs_ec_link_button",r=fkwcs_data.icons.link}a.hasClass("fkwcs_hide_button")||e.show(),this.makeButtonVisibleInline(),this.buttonOnProductPage(),this.buttonOnCartPage(),this.buttonOnCheckoutPage(),s.hide(),e.addClass("fkwcs_express_"+this.express_request_type),e.removeClass("fkwcs_ec_payment_button-"+fkwcs_data.style.theme),e.addClass(this.express_button_wrapper+"-"+fkwcs_data.style.theme),""!==r&&(s.attr("src",r),s.show()),n.hasClass("cart")&&n.show(),n.hasClass("checkout")&&n.show(),!n.hasClass("fkwcs-product")||a.hasClass("inline")||n.show(),a.length&&(a.css("display","block"),c(document.body).trigger("fkwcs_smart_buttons_showed",["stripe",t])),"inline"===fkwcs_data.style.button_position&&a.hasClass("fkwcs-product")&&(document.getElementById("fkwcs_stripe_smart_button_wrapper").style.display="inline-block")}else t.googlePay=!1,t.link=!1}else"yes"===fkwcs_data.debug_log&&(console.log(fkwcs_data.debug_msg),e.hide()),c(document.body).trigger("fkwcs_smart_buttons_not_available")}},{key:"onPaymentMethod",value:function(e){var s=this,t=this.paymentMethodData(e);c.ajax({type:"POST",data:t,dataType:"text",url:this.ajaxEndpoint("wc_stripe_create_order"),success:function(t){t=(t=>{if(!(t=t.match(/\{(?:[^{}]|(\{[^{}]*\}))*\}/)))return console.warn("No JSON object found in response."),null;try{return JSON.parse(t[0])}catch(t){return console.error("Failed to parse JSON:",t),null}})(t);t&&"success"===t.result?!1===s.confirmPaymentIntent(e,t.redirect)&&(window.location=t.redirect):s.abortPayment(e,t?t.messages:"Error processing payment")}})}},{key:"addToCartProduct",value:function(){var t=c(".single_add_to_cart_button").val(),e=c(".single_variation_wrap"),e=(e.length&&(t=e.find('input[name="product_id"]').val()),c(".quantity .qty").val()),a={fkwcs_nonce:fkwcs_data.fkwcs_nonce,action:"add_to_cart",product_id:t,qty:e,attributes:c(".variations_form").length?this.getVariationAttributes().attributes:[]},t=c("form.cart").serializeArray();return c.each(t,function(t,e){var s;/^addon-/.test(e.name)&&(/\[\]$/.test(e.name)?(s=e.name.substring(0,e.name.length-2),a[s]?a[s].push(e.value):a[s]=[e.value]):a[e.name]=e.value),"sublium-option-plan"===e.name&&(a[e.name]=e.value)}),c.ajax({type:"POST",data:a,url:this.ajaxEndpoint(this.add_to_cart_end_point),success:function(t){c(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash,c(".single_add_to_cart_button")])}})}},{key:"prepareSelectedProductData",value:function(){var t=c(".single_variation_wrap"),e=c(".single_add_to_cart_button").val(),t=(0<t.length&&(e=c(".single_variation_wrap").find('input[name="product_id"]').val()),c("#product-addons-total")),s=0,t=(0<t.length&&(s=(t.data("price_data")||[]).reduce(function(t,e){return t+e.cost},0)),{fkwcs_nonce:fkwcs_data.fkwcs_nonce,product_id:e,qty:c(".quantity .qty").val(),addon_value:s,attributes:c(".variations_form").length?this.getVariationAttributes().attributes:[]});return c.ajax({type:"POST",data:t,url:this.ajaxEndpoint("fkwcs_selected_product_data")})}},{key:"logError",value:function(t){c.ajax({type:"POST",url:fkwcs_data.admin_ajax,data:{action:"fkwcs_js_errors",_security:fkwcs_data.js_nonce,failed:2<arguments.length&&void 0!==arguments[2]&&arguments[2],error:t}})}},{key:"getVariationAttributes",value:function(){var t=c(".variations_form").first().find(".variations select"),e={},s=0;return t.each(function(){var t=c(this).data("attribute_name")||c(this).attr("name");e[t]=c(this).val()||"",s++}),{count:s,chosenCount:0,attributes:e}}},{key:"paymentMethodData",value:function(t){var e=t.paymentMethod,s=e.billing_details,a=s.email,n=s.phone,r=s.address,s=s.name,o=t.shippingAddress,i={fkwcs_nonce:fkwcs_data.fkwcs_nonce,billing_first_name:null!==s?s.split(" ").slice(0,1).join(" "):"test",billing_last_name:null!==s?s.split(" ").slice(1).join(" "):"test",billing_company:"",billing_email:null!==a?a:t.payerEmail,billing_phone:null!==n?n:t.payerPhone&&t.payerPhone.replace("/[() -]/g",""),order_comments:"",payment_method:"fkwcs_stripe",terms:1,fkwcs_source:e.id,payment_request_type:this.express_request_type};return 0<c('input[name="billing_email"]').length&&""!==c('input[name="billing_email"]').val()&&(i.billing_email=c('input[name="billing_email"]').val()),"apple_pay"===this.express_request_type&&0<c("li.payment_method_fkwcs_stripe_apple_pay").length&&(i.payment_method="fkwcs_stripe_apple_pay"),i=this.prepareBillingAddress(i,r),i=this.prepareShippingAddress(i,o),"yes"===fkwcs_data.is_checkout?(null!==t.shippingOption&&c('input[name="shipping_method[0]"][value="'+t.shippingOption.id+'"]').prop("checked",!0),s=c("form[name=checkout]").serializeArray(),c.each(s,function(t,e){!1!==Object.prototype.hasOwnProperty.call(i,e.name)&&""!==i[e.name]||(i[e.name]=e.value)}),i.page_from="checkout"):"yes"===fkwcs_data.is_product?i.page_from="product":i.page_from="cart",!0===Object.prototype.hasOwnProperty.call(i,"wc-fkwcs_stripe-payment-token")&&delete i["wc-fkwcs_stripe-payment-token"],i=JSON.parse(JSON.stringify(i))}},{key:"prepareBillingAddress",value:function(t,e){return null!==e&&(t.billing_address_1=null!==e?e.line1:"",t.billing_address_2=null!==e?e.line2:"",t.billing_city=null!==e?e.city:"",t.billing_state=null!==e?e.state:"",t.billing_postcode=null!==e?e.postal_code:"",t.billing_country=null!==e?e.country:""),t}},{key:"prepareShippingAddress",value:function(t,e){return e&&(t.shipping_first_name=e.recipient.split(" ").slice(0,1).join(" "),t.shipping_last_name=e.recipient.split(" ").slice(1).join(" "),t.shipping_company=e.organization,t.shipping_country=e.country,t.shipping_address_1=void 0===e.addressLine[0]?"":e.addressLine[0],t.shipping_address_2=void 0===e.addressLine[1]?"":e.addressLine[1],t.shipping_city=e.city,t.shipping_state=e.region,t.hasOwnProperty("billing_phone")&&(t.shipping_phone=t.billing_phone),t.shipping_postcode=e.postalCode,t.ship_to_different_address=1),t}},{key:"confirmPaymentIntent",value:function(t,e){var s=e.match(/^#?fkwcs-confirm-(pi|si)-([^:]+):(.+):(.+):(.+):(.+)$/);if(!s||s.length<5)return window.location.redirect=e,!1;var e=s[1],a=s[2],s=decodeURIComponent(s[3]);this.confirmPayment(t,a,s,e)}},{key:"confirmPayment",value:function(s,a,n,r){var o=this,t=null,t="si"===r?this.stripe.handleCardSetup(a,{payment_method:s.paymentMethod.id},{handleActions:!1}):this.stripe.confirmCardPayment(a,{payment_method:s.paymentMethod.id},{handleActions:!1}),i=c("form.woocommerce-checkout");t.then(function(t){var e;t.error?(o.logError(t.error),c(".woocommerce-error").remove(),i.unblock(),c(".woocommerce-notices-wrapper:first-child").html('<div class="woocommerce-error fkwcs-errors">'+t.error.message+"</div>").show(),s.complete("fail")):(s.complete("success"),"requires_action"===(t=t["si"===r?"setupIntent":"paymentIntent"]).status||"requires_source_action"===t.status?(e=o,("si"===r?o.stripe.handleCardSetup(a):o.stripe.confirmCardPayment(a)).then(function(t){t.error?(e.logError(t.error),c(".woocommerce-error").remove(),i.unblock(),c(".woocommerce-notices-wrapper:first-child").html('<div class="woocommerce-error fkwcs-errors">'+t.error.message+"</div>").show()):(i.addClass("processing"),i.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),window.location=n)})):(i.addClass("processing"),i.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),window.location=n))})}},{key:"abortPayment",value:function(t,e){t.complete("success"),this.showErrorMessage(e)}},{key:"shippingAddressChange",value:function(e){var t=e.shippingAddress,t={fkwcs_nonce:fkwcs_data.fkwcs_nonce,country:t.country,state:t.region,postcode:t.postalCode,city:t.city,address:void 0===t.addressLine[0]?"":t.addressLine[0],address_2:void 0===t.addressLine[1]?"":t.addressLine[1],payment_request_type:this.express_request_type,is_product_page:this.is_product_page};return c.ajax({type:"POST",data:t,url:this.ajaxEndpoint("fkwcs_update_shipping_address"),success:function(t){"success"===t.result?e.updateWith({status:t.result,total:t.total,shippingOptions:t.shipping_methods,displayItems:t.displayItems}):"fail"===t.result&&e.updateWith({status:"fail"})}})}},{key:"shippingOptionChange",value:function(e){var t=e.shippingOption,t={fkwcs_nonce:fkwcs_data.fkwcs_nonce,shipping_method:[t.id],payment_request_type:this.express_request_type,is_product_page:this.is_product_page};return c.ajax({type:"POST",data:t,url:this.ajaxEndpoint("fkwcs_update_shipping_option"),success:function(t){"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})}})}},{key:"makePaymentCatch",value:function(t){console.log("error",t)}},{key:"cancelPayment",value:function(){c(document.body).trigger("fkwcs_express_cancel_payment",this)}},{key:"showErrorMessage",value:function(t){c(".woocommerce-error").remove(),("no"!==fkwcs_data.is_product?c(".product").first():c("form.checkout").closest("form")).before(t),window.scrollTo({top:100,behavior:"smooth"})}},{key:"getCartDetails",value:function(){var t={fkwcs_nonce:fkwcs_data.fkwcs_nonce},e=this;c.ajax({type:"POST",data:t,url:this.ajaxEndpoint("fkwcs_get_cart_details"),success:function(t){t.success&&(e.setRequestData(t.data),e.setupPaymentRequest())}})}},{key:"wcEvents",value:function(){var a=this,s=this;c(document.body).on("updated_checkout",function(t,e){try{e&&e.fragments&&(s.setRequestData(e.fragments.fkwcs_cart_details),s.setupPaymentRequest(),!1===e.fragments.fkwcs_cart_details.is_fkwcs_need_payment?document.getElementById("fkwcs_stripe_smart_button_wrapper").classList.add("fkwcs_hide_button"):document.getElementById("fkwcs_stripe_smart_button_wrapper").classList.remove("fkwcs_hide_button"))}catch(t){}}),c(document.body).on("updated_cart_totals",function(){s.getCartDetails()}),c(document.body).on("wc_fragments_refreshed added_to_cart removed_from_cart wc_fragments_loaded",function(t,e){setTimeout(function(){if("undefined"==typeof wc_cart_fragments_params)return!1;var t;"undefined"!=typeof Storage&&(t=sessionStorage.getItem(wc_cart_fragments_params.fragment_name),"object"===_typeof(t=JSON.parse(t)))&&t.hasOwnProperty("fkwcs_cart_details")&&(a.cart_request_data=t.fkwcs_cart_details,"yes"!==fkwcs_data.is_product)&&(s.setRequestData(t.fkwcs_cart_details),s.setupPaymentRequest())},300)}),c(document.body).on("fkwcs_express_button_init",function(){var t=c("#fkcart-modal");"yes"===fkwcs_data.is_product&&!t.hasClass("fkcart-show")||(0<Object.keys(a.cart_request_data).length&&a.setRequestData(a.cart_request_data),a.setupPaymentRequest())}),c(document.body).on("fkwcs_express_button_update_cart_details",function(t,e){e.hasOwnProperty("fkwcs_cart_details")&&(a.setRequestData(e.fkwcs_cart_details),a.setupPaymentRequest())}),c(document.body).on("fkcart_fragments_refreshed",function(t,e){var s=c("#fkcart-modal");void 0!==e&&e.hasOwnProperty("fkwcs_cart_details")&&(a.cart_request_data=e.fkwcs_cart_details,s.hasClass("fkcart-show"))&&(a.setRequestData(a.cart_request_data),a.setupPaymentRequest())}),c(document.body).on("fkwcs_google_ready_pay",function(){s.is_google_ready_to_pay=!0}),c(document.body).on("fkcart_cart_closed",function(){var t;"yes"===fkwcs_data.is_product&&((t=c("form.cart").find(".qty")).length&&t.val(1),a.request_data=Object.assign(a.dataCommon,{total:fkwcs_data.single_product.total,requestShipping:"yes"===fkwcs_data.single_product.requestShipping,displayItems:fkwcs_data.single_product.displayItems}),a.setupPaymentRequest())})}},{key:"setCss",value:function(t,e,s){this.css_selector.hasOwnProperty(t)||(this.css_selector[t]={}),this.css_selector[t][e]=s}},{key:"applyCss",value:function(){for(var t in this.css_selector)if(0!==Object.keys(this.css_selector[t]).length)for(var e in this.css_selector[t])c(t).css(e,this.css_selector[t][e])}},{key:"buttonOnProductPage",value:function(){var t,e,s,a,n;1==fkwcs_data.is_product_page&&0!==c("form.cart button.single_add_to_cart_button").length&&(t=c("form.cart button.single_add_to_cart_button:visible"),e=c(".fkwcs_smart_buttons"),s=10<this.style_value.button_length?"min-width":"width",!(a="px")!==e.hasClass("fkwcs_smart_product_button"))&&("above"===this.style_value.button_position?(this.setCss("#fkwcs_stripe_smart_button_wrapper","width","100%"),this.setCss("#fkwcs-payment-request-separator","width","200px"),this.setCss("form.cart button.single_add_to_cart_button",s,"200px"),this.setCss("form.cart button.single_add_to_cart_button","float","left"),this.setCss("form.cart","display","inline-block"),this.setCss(".fkwcs_smart_buttons",s,"200px")):(n=t.outerWidth(),0<c("form.cart .quantity").length&&(n=n+c("form.cart .quantity").width()+parseInt(c("form.cart .quantity").css("marginRight").replace("px",""))),"inline"===this.style_value.button_position?(n=(n=t.outerWidth())<120?150:n,c("form.cart").width()<500&&this.makeButtonVisibleInline(),this.setCss("form.cart button.single_add_to_cart_button",s,n+"px")):(this.setCss("form.grouped_form button.single_add_to_cart_button",s,n+"px"),0<c(".theme-kadence button.single_add_to_cart_button").length&&(this.setCss(".theme-kadence button.single_add_to_cart_button",s,(n=100)+(a="%")),this.setCss(".theme-kadence button.single_add_to_cart_button","margin-top","20px"))),this.setCss("#fkwcs_stripe_smart_button_wrapper",s,n+a),this.setCss("form.cart .fkwcs_smart_buttons",s,n+a),"below"===this.style_value.button_position&&(this.setCss(".theme-twentytwentytwo .fkwcs_smart_buttons",s,t.outerWidth()+"px"),this.setCss(".theme-twentytwentytwo #fkwcs-payment-request-separator",s,t.outerWidth()+"px"))),this.applyCss(),this.expressBtnStyle(e,t))}},{key:"buttonOnCartPage",value:function(){var t,e;"yes"===fkwcs_data.is_cart&&0!==c(".wc-proceed-to-checkout .checkout-button").length&&(t=c(".wc-proceed-to-checkout .checkout-button"),e=c(".fkwcs_smart_buttons"),30<c(".place-order #place_order").outerHeight()&&this.setCss(".fkwcs_smart_buttons","height",t.outerHeight()+"px"),this.setCss(".fkwcs_smart_buttons","font-size",t.css("font-size")),this.applyCss(),this.expressBtnStyle(e,t))}},{key:"buttonOnCheckoutPage",value:function(){var t=c(".woocommerce-billing-fields");"yes"===fkwcs_data.is_checkout&&0!==t.length&&(this.setCss("#fkwcs_stripe_smart_button_wrapper","max-width",t.outerWidth(!0)),this.applyCss())}},{key:"expressBtnStyle",value:function(s,a){c.each(["padding","border-radius","box-shadow","font-weight","text-shadow","font-size","line-height","padding"],function(t,e){s.css(e,a.css(e))}),s.css("max-height",a.outerHeight()+"px")}},{key:"makeButtonVisibleInline",value:function(){var t,e,s="",a=c("#fkwcs_stripe_smart_button_wrapper");0!==a.length&&(a.hasClass("inline")&&(t=(a=a.parent()).children(".single_add_to_cart_button"),e=a.children(".quantity"),s=a.outerWidth()-((a=t.outerWidth())+e.outerWidth()+10),this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","marginRight",e.css("marginRight")),a<s?(this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","margin",0),this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","marginRight",e.css("marginRight")),this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","clear","unset"),this.setCss("#fkwcs_stripe_smart_button_wrapper","margin","0px"),this.setCss("#fkwcs_stripe_smart_button_wrapper","display","inline-block")):(this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","margin","10px 0"),this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","flex","initial"),this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","clear","both"),this.setCss("#fkwcs_stripe_smart_button_wrapper .theme-flatsome .cart .quantity","width","100%"),this.setCss("#fkwcs_stripe_smart_button_wrapper .theme-flatsome .cart .quantity","clear","both"),this.setCss("#fkwcs_stripe_smart_button_wrapper","maringTop","10px"),this.setCss("#fkwcs_stripe_smart_button_wrapper","display","block")),60<(s=t.outerHeight())&&this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","height","60"),s<35&&this.setCss("#fkwcs_stripe_smart_button_wrapper .single_add_to_cart_button","height","35"),c("#fkwcs_stripe_smart_button_wrapper").width(a)),this.applyCss())}},{key:"linkEnabled",value:function(){return"yes"===fkwcs_data.link_button_enabled&&"yes"===fkwcs_data.express_pay_enabled}}]))(),e=(()=>{function s(){return _classCallCheck(this,s),_callSuper(this,s)}return _inherits(s,t),_createClass(s,[{key:"init",value:function(){fkwcs_data.hasOwnProperty("google_pay_as_express")&&"yes"===fkwcs_data.google_pay_as_express&&(this.google_pay_client=null,this.shipping_options=[],this.request_data={},this.google_is_ready=null,this.add_to_cart_end_point="fkwcs_gpay_add_to_cart",this.gateway_id="fkwcs_stripe_google_pay",this.createPaymentClient())}},{key:"googlePayVersion",value:function(){return{apiVersion:2,apiVersionMinor:0}}},{key:"getBaseCardBrand",value:function(){return{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":fkwcs_data.pub_key}}}}},{key:"getMerchantData",value:function(){var t={environment:"test"===fkwcs_data.mode?"TEST":"PRODUCTION",merchantId:fkwcs_data.google_pay.merchant_id,merchantName:fkwcs_data.google_pay.merchant_name,paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return"test"===fkwcs_data.mode&&delete t.merchantId,this.shippingAddressRequired()&&(t.paymentDataCallbacks.onPaymentDataChanged=this.paymentDataChanged.bind(this)),t}},{key:"createGooglePayButton",value:function(t){return c("<div class='fkwcs_google_pay_wrapper fkwcs_smart_product_button ".concat(1<arguments.length&&void 0!==arguments[1]?arguments[1]:"","'></div>")).html(this.google_pay_client.createButton(t))}},{key:"createPaymentClient",value:function(){var t=this;try{this.google_pay_client=new google.payments.api.PaymentsClient(this.getMerchantData());var e=this.googlePayVersion();e.allowedPaymentMethods=[this.getBaseCardBrand ()],this.google_pay_client.isReadyToPay(e).then(function(){t.google_is_ready=!0,c(document.body).trigger("fkwcs_google_ready_pay",[t.google_pay_client]),t.createCheckoutExpressBtn()}).catch(function(t){console.log("error",t)})}catch(t){console.log(t)}}},{key:"buttonOnProductPage",value:function(){var t,e,s,a,n,r=this;1==fkwcs_data.is_product_page&&0!==c("form.cart button.single_add_to_cart_button").length&&(t=c("form.cart button.single_add_to_cart_button:visible"),e=c(".fkwcs_smart_buttons"),s=10<this.style_value.button_length?"min-width":"width",!(a="px")!==e.hasClass("fkwcs_smart_product_button"))&&("above"===this.style_value.button_position?(this.setCss("#fkwcs_stripe_smart_button_wrapper","width","100%"),this.setCss("#fkwcs-payment-request-separator","width","200px"),this.setCss("form.cart button.single_add_to_cart_button",s,"200px"),this.setCss("form.cart button.single_add_to_cart_button","float","left"),this.setCss("form.cart","display","inline-block"),this.setCss(".fkwcs_smart_buttons",s,"200px")):(n=t.outerWidth(),0<c("form.cart .quantity").length&&(n=n+c("form.cart .quantity").width()+parseInt(c("form.cart .quantity").css("marginRight").replace("px",""))),"inline"===this.style_value.button_position?(n=(n=t.outerWidth())<120?150:n,c("form.cart").width()<500&&this.makeButtonVisibleInline(),this.setCss("form.cart button.single_add_to_cart_button",s,n+"px"),this.setCss("#fkwcs_stripe_smart_button_wrapper.fkwcs-product","display","inline-block")):(this.setCss("form.grouped_form button.single_add_to_cart_button",s,n+"px"),0<c(".theme-kadence button.single_add_to_cart_button").length&&(this.setCss(".theme-kadence button.single_add_to_cart_button",s,(n=100)+(a="%")),this.setCss(".theme-kadence button.single_add_to_cart_button","margin-top","20px"))),this.setCss("#fkwcs_stripe_smart_button_wrapper",s,n+a),this.setCss("form.cart .fkwcs_smart_buttons",s,n+a),setTimeout(function(t){r.setCss("#fkwcs_stripe_smart_button_wrapper .gpay-card-info-container",s,t+"px"),r.setCss("#fkwcs_stripe_smart_button_wrapper .gpay-card-info-container","min-width",t+"px"),r.setCss("#fkwcs_stripe_smart_button_wrapper .gpay-card-info-iframe","width",t+"px"),r.applyCss()},300,n),"below"===this.style_value.button_position&&(this.setCss(".theme-twentytwentytwo .fkwcs_smart_buttons",s,t.outerWidth()+"px"),this.setCss(".theme-twentytwentytwo #fkwcs-payment-request-separator",s,t.outerWidth()+"px"))),this.applyCss(),this.expressBtnStyle(e,t))}},{key:"createCheckoutExpressBtn",value:function(){var t,a=this,e=(c("#fkwcs_stripe_smart_button_wrapper").css("display","block"),c("#fkwcs_custom_express_button"));0<e.length&&("1"===fkwcs_data.is_product_page||"yes"===fkwcs_data.is_product_page?(e.after(this.createGooglePayButton(this.getSingleProductExpressOptions(),"fkwcs-single-product")),this.buttonOnProductPage(),t=c("form.cart .fkwcs_google_pay_wrapper"),c(document.body).off("show_variation").on("show_variation",function(){t.removeClass("fkwcs_disabled_btn")}),c(document.body).off("hide_variation").on("hide_variation",function(){t.addClass("fkwcs_disabled_btn")})):"1"!==fkwcs_data.is_cart&&"yes"!==fkwcs_data.is_cart||(e.after(this.createGooglePayButton(this.getCartExpressOptions(),"fkwcs-woocommerce-cart")),c(document.body).on("wc_fragments_refreshed",function(t,e){setTimeout(function(){var t;"sessionStorage"in window&&null!==window.sessionStorage&&null!=(t=sessionStorage.getItem(wc_cart_fragments_params.fragment_name))&&"object"===_typeof(t=JSON.parse(t))&&t.hasOwnProperty("fkwcs_google_pay_data")&&(fkwcs_data.gpay_cart_data=t.fkwcs_google_pay_data,c("#fkwcs_stripe_smart_button_wrapper").css("display","block"),c(".fkwcs-woocommerce-cart").remove(),c("#fkwcs_custom_express_button").after(a.createGooglePayButton(a.getCartExpressOptions(),"fkwcs-woocommerce-cart")))},1e3)}))),c(document.body).on("added_to_cart fkcart_fragments_refreshed",function(t,e){void 0!==e&&e.hasOwnProperty("fkwcs_google_pay_data")&&(fkwcs_data.gpay_cart_data=e.fkwcs_google_pay_data)}),c(document.body).on("fkwcs_generate_fkcart_mini_button",function(){c(".fkwcs_fkcart_gpay_wrapper").html(a.createGooglePayButton(a.getCartExpressOptions(),"mini-cart"));for(var t=c("#fkcart-modal .fkcart-checkout-wrap #fkcart-checkout-button"),e=["font-size","font-weight","border-radius","line-height"],s=0;s<e.length;s++)c(".fkcart-checkout-wrap.fkcart-panel.fkwcs_fkcart_gpay_wrapper button").css(e[s],t.css(e[s]))})}},{key:"getSingleProductExpressOptions",value:function(){return{buttonColor:fkwcs_data.google_pay_btn_color,buttonType:fkwcs_data.google_pay_btn_theme,buttonSizeMode:"fill",onClick:this.startSingleProductCheckout.bind(this)}}},{key:"getCartExpressOptions",value:function(){return{buttonColor:fkwcs_data.google_pay_btn_color,buttonType:fkwcs_data.google_pay_btn_theme,buttonSizeMode:"fill",onClick:this.startExpressCartGpayPayment.bind(this)}}},{key:"startExpressCartGpayPayment",value:function(){var t=fkwcs_data.gpay_cart_data||fkwcs_data.gpay_single_product;t&&this.update_transaction_data(t),this.startSingleProductGpayPayment()}},{key:"startSingleProductCheckout",value:function(){var e=this;try{c.when(this.addToCartProduct()).then(function(t){e.update_transaction_data(null==t||null==(t=t.fragments)?void 0:t.fkwcs_google_pay_data),e.startSingleProductGpayPayment()})}catch(t){}}},{key:"startSingleProductGpayPayment",value:function(){var e=this;this.google_pay_client.loadPaymentData(this.buildGpayPaymentData()).then(this.productSingleProductGpayData.bind(this)).catch(function(t){console.log("error",t),"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?e.showError({message:"DEVELOPER_ERROR_WHITELIST"}):e.showError({message:t.statusMessage}))})}},{key:"buildGpayPaymentData",value:function(){var t=c.extend({},this.googlePayVersion(),{emailRequired:!0,environment:"test"===fkwcs_data.mode?"TEST":"PRODUCTION",merchantInfo:{merchantName:fkwcs_data.google_pay.merchant_name,merchantId:fkwcs_data.google_pay.merchant_id},allowedPaymentMethods:[this.getBaseCardBrand ()]});return t.shippingAddressRequired=this.shippingAddressRequired(),t.callbackIntents=["PAYMENT_AUTHORIZATION"],t.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,t.allowedPaymentMethods[0].parameters.billingAddressRequired&&(t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:!0}),(t=c.extend(t,this.request_data)).shippingAddressRequired&&(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.shipping_options},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]),t}},{key:"paymentDataChanged",value:function(t){var s=this;return new Promise(function(e){s.update_payment_data(t).then(function(t){"fail"===t.result?e({error:{reason:"SHIPPING_ADDRESS_UNSUPPORTED",message:fkwcs_data.shipping_error,intent:"SHIPPING_ADDRESS"}}):e(t.paymentRequestUpdate)}).catch(function(t){e({error:{reason:"SHIPPING_ADDRESS_UNSUPPORTED",message:fkwcs_data.shipping_error,intent:"SHIPPING_ADDRESS"}})})})}},{key:"update_transaction_data",value:function(t){var e=t.order_data.displayItems;this.request_data={transactionInfo:{countryCode:t.order_data.country_code.toUpperCase(),currencyCode:t.order_data.currency.toUpperCase(),totalPriceStatus:"ESTIMATED",totalPrice:t.order_data.total.amount.toString(),displayItems:e,totalPriceLabel:t.order_data.total.label}},null!=t&&t.shipping_options&&(this.shipping_options=null==t?void 0:t.shipping_options)}},{key:"mapAddress",value:function(t,e){var s={};return e.hasOwnProperty("address1")&&(s.line_1=null==e?void 0:e.address1),e.hasOwnProperty("address2")&&(s.line_2=(null==e?void 0:e.address2)+(null==e?void 0:e.address3)),e.hasOwnProperty("locality")&&(s.city=null==e?void 0:e.locality),e.hasOwnProperty("postalCode")&&(s.postal_code=null==e?void 0:e.postalCode),e.hasOwnProperty("administrativeArea")&&(s.state=null==e?void 0:e.administrativeArea),e.hasOwnProperty("countryCode")&&(s.country=null==e?void 0:e.countryCode),e.hasOwnProperty("name")&&(s.name=e.name),s}},{key:"updateAddress",value:function(t){var e={},s=t.hasOwnProperty("shippingAddress")?t.shippingAddress:null,a=(null!==s&&(e.shipping=this.mapAddress("shipping",s),e.shipping.shipping_method=null==t?void 0:t.shippingOptionData),t.hasOwnProperty("paymentMethodData")&&t.paymentMethodData.hasOwnProperty("info")&&t.paymentMethodData.info.hasOwnProperty("billingAddress")?t.paymentMethodData.info.billingAddress:null);return null!==a&&(e.billing=this.mapAddress("billing",a)),null==a&&null!==s&&(e.billing=this.mapAddress("billing",s)),null!==a&&a.hasOwnProperty("phoneNumber")&&(e.phone=null==a?void 0:a.phoneNumber),null!=t&&t.email&&(e.email=null==t?void 0:t.email),null!=t&&t.phone&&(e.phone=null==t?void 0:t.phone),e}},{key:"map_google_pay_address",value:function(t){return{country:t.countryCode,postcode:t.postalCode,city:t.locality,state:t.administrativeArea}}},{key:"update_payment_data",value:function(s,a){var n=this;return new Promise(function(e){var t="default"===s.shippingOptionData.id?null:s.shippingOptionData.id;c.ajax({url:fkwcs_data.wc_endpoints.fkwcs_gpay_update_shipping_address,dataType:"json",method:"POST",data:c.extend({fkwcs_nonce:fkwcs_data.fkwcs_nonce},{shipping_address:n.map_google_pay_address(s.shippingAddress),shipping_method:[t]},a),success:function(t){e(t)}})})}},{key:"productSingleProductGpayData",value:function(t){var s=this,e=JSON.parse(t.paymentMethodData.tokenizationData.token),a=this.updateAddress(t),t={name:a.billing.name,email:a.email,phone:null==a?void 0:a.phone,address:{country:null==(t=a.billing)?void 0:t.country,city:null==(t=a.billing)?void 0:t.city,postal_code:null==(t=a.billing)?void 0:t.postal_code,state:null==(t=a.billing)?void 0:t.state,line1:null==(t=a.billing)?void 0:t.line1,line2:null==(t=a.billing)?void 0:t.line2}};c("body").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),this.stripe.createPaymentMethod({type:"card",card:{token:e.id},billing_details:t}).then(function(e){if(e.error)return s.showError(e.error);a.paymentMethod=e.paymentMethod.id,c.ajax({type:"POST",data:s.prepareCheckoutData(a),dataType:"text",url:s.ajaxEndpoint("fkwcs_gpay_button_payment_request"),success:function(t){t=(t=>{if(!(t=t.match(/\{(?:[^{}]|(\{[^{}]*\}))*\}/)))return console.warn("No JSON object found in response."),null;try{return JSON.parse(t[0])}catch(t){return console.error("Failed to parse JSON:",t),null}})(t);t&&"success"===t.result?!1===s.confirmPaymentIntent(e,t.redirect)&&(window.location=t.redirect):(c("body").unblock(),window.location.reload())}})}).catch(function(){c("body").unblock()})}},{key:"prepareCheckoutData",value:function(t){var e=t.paymentMethod,s=t.email,a=null==t?void 0:t.phone,n=t.billing,r=t.billing.name,t=t.shipping,r={fkwcs_nonce:fkwcs_data.fkwcs_nonce,billing_first_name:null!==r?r.split(" ").slice(0,1).join(" "):"test",billing_last_name:null!==r?r.split(" ").slice(1).join(" "):"test",billing_company:"",billing_email:0<c('input[name="billing_email"]').length&&""!==c('input[name="billing_email"]').val()?c('input[name="billing_email"]').val():s,billing_phone:a?a.replace("/[() -]/g",""):"",order_comments:"",payment_method:this.gateway_id,terms:1,fkwcs_source:e,payment_request_type:this.gateway_id},r=this.prepareBillingAddress(r,n);return r=this.prepareShippingAddress(r,t),"yes"===fkwcs_data.is_product?r.page_from="product":r.page_from="cart",r=JSON.parse(JSON.stringify(r))}},{key:"shippingAddressRequired",value:function(){return"yes"===fkwcs_data.shipping_required}},{key:"prepareBillingAddress",value:function(t,e){return console.trace(),(t=_superPropGet(s,"prepareBillingAddress",this,3)([t,e])).billing_address_1=null!==e?e.line_1:"",t.billing_address_2=null!==e?e.line_2:"",t}},{key:"prepareShippingAddress",value:function(t,e){return e&&(t.shipping_first_name=e.name.split(" ").slice(0,1).join(" "),t.shipping_last_name=e.name.split(" ").slice(1).join(" "),t.shipping_country=e.country,t.shipping_address_1=e.line_1,t.shipping_address_2=e.line_2,t.shipping_city=e.city,t.shipping_state=e.state,e.hasOwnProperty("shipping_method")&&(t.shipping_method=Object.values(e.shipping_method)),t.hasOwnProperty("billing_phone")&&(t.shipping_phone=t.billing_phone),t.shipping_postcode=e.postal_code,t.ship_to_different_address=1),t}},{key:"confirmPaymentIntent",value:function(t,e){var s=e.match(/^#?fkwcs-confirm-(pi|si)-([^:]+):(.+):(.+):(.+):(.+)$/);if(!s||s.length<5)return window.location.redirect=e,c("body").unblock(),!1;var e=s[1],a=s[2],s=decodeURIComponent(s[3]);this.confirmPayment(t,a,s,e)}},{key:"confirmPayment",value:function(t,e,s,a){var n=this;("si"==a?this.stripe.handleCardSetup(e,{payment_method:t.paymentMethod.id},{handleActions:!1}):this.stripe.confirmCardPayment(e,{payment_method:t.paymentMethod.id},{handleActions:!1})).then(function(t){t.error?(n.logError(t.error),c("body").unblock()):"requires_action"===(t=t["si"===a?"setupIntent":"paymentIntent"]).status||"requires_source_action"===t.status?("si"==a?n.stripe.handleCardSetup(e):n.stripe.confirmCardPayment(e)).then(function(t){t.error?(n.logError(t.error),c("body").unblock()):window.location=s}):(c("body").unblock(),window.location=s)})}},{key:"setupPaymentRequest",value:function(){}},{key:"setRequestData",value:function(){}}])})();new t;try{void 0===fkwcs_data.google_pay||"live"===fkwcs_data.mode&&""===fkwcs_data.google_pay.merchant_id||new e}catch(t){console.log("Error Captured During Gpay initialization",t)}})(jQuery);
!function(){var e={5637:function(e,t,i){"use strict";i.r(t),i.d(t,{AutoResizing:function(){return y},LAZY_BEFORE_SIZES:function(){return l},SMUSH_BEFORE_SIZES:function(){return c}});var n=i(7857);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,a,o,s=[],u=!0,l=!1;try{if(a=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;u=!1}else for(;!(u=(n=a.call(i)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,r=e}finally{try{if(!u&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw r}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}var l="lazybeforesizes",c="smush:beforeSizes",d="data-original-sizes",f="data-srcset",v=["gif","jpg","jpeg","png","webp"],h="w",y=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.precision,n=void 0===i?0:i,r=t.skipAutoWidth,a=void 0!==r&&r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.precision=parseInt(n,10),this.precision=isNaN(this.precision)?0:this.precision,this.skipAutoWidth=a,this.initEventListeners()},t=[{key:"initEventListeners",value:function(){var e=this;document.addEventListener(l,function(t){var i;(0,n.G)(null===(i=t.detail)||void 0===i?void 0:i.instance)&&e.maybeAutoResize(t)})}},{key:"maybeAutoResize",value:function(e){var t,i,n,r=e.target,a=null===(t=e.detail)||void 0===t?void 0:t.width;if("IMG"===(null==r?void 0:r.nodeName)&&a)if(null===(i=e.detail)||void 0===i?void 0:i.dataAttr){if(this.isElementEligibleForResizing(r))if(this.shouldRevertToOriginalSizes(r,a))this.revertToOriginalSizesIfNeeded(r)&&e.preventDefault();else{var o=this.triggerEvent(r,c,{resizeWidth:a});if(o.defaultPrevented)this.revertToOriginalSizesIfNeeded(r)&&e.preventDefault();else{a=(null===(n=o.detail)||void 0===n?void 0:n.resizeWidth)||a;var s=this.getDataSrc(r);this.isFromSmushCDN(s)&&(this.resizeImageWithCDN(r,a),this.isChildOfPicture(r)&&this.resizeSourceElements(r.parentNode.querySelectorAll("source"),a))}}}else this.getOriginalSizesAttr(r)||e.preventDefault()}},{key:"shouldAutoResize",value:function(e,t){var i=e.parentNode;if(i&&this.isInlineElement(i)){if("PICTURE"===i.nodeName)return!1;var n=i.clientWidth,r=e.offsetWidth;if(t===n&&n===r)return!1}return!0}},{key:"isInlineElement",value:function(e){if(!e||1!==e.nodeType)return!1;var t=window.getComputedStyle(e).display;return"inline"===t||"inline-block"===t}},{key:"isChildOfPicture",value:function(e){var t;return e&&"PICTURE"===(null==e||null===(t=e.parentNode)||void 0===t?void 0:t.nodeName)}},{key:"resizeSourceElements",value:function(e,t){var i=this;e&&null!=e&&e.length&&e.forEach(function(e){return i.resizeSourceElement(e,t)})}},{key:"resizeSourceElement",value:function(e,t){var i=e.getAttribute(f);if(i){var n=this.parseSrcSet(i);if(n&&n.length)if(1===n.length&&""===n[0].unit)this.resizeNonResponsiveSource(e,n[0].src,t);else{var r=this.getBaseSourceSrcForResize(n,t);this.isFromSmushCDN(r)&&this.updateSrcsetForResize(e,i,r,t,n)}}}},{key:"resizeNonResponsiveSource",value:function(e,t,i){if(this.isFromSmushCDN(t)&&this.isSourceActive(e)){var n=this.getResizedCDNURL(t,i),r=this.getPixelRatio();if(r>1){var a=Math.ceil(i*r),o=this.getResizedCDNURL(t,a)+" "+a+h;n+=" ".concat(i).concat(h,", ").concat(o)}this.updateElementSrcset(e,null,n)}}},{key:"isSourceActive",value:function(e){var t,i=e.getAttribute("media");return!(i&&(null===(t=window)||void 0===t||null===(t=t.matchMedia(i))||void 0===t||!t.matches))}},{key:"getBaseSourceSrcForResize",value:function(e,t){var i=e[0];return h!==i.unit?null:!this.isThumbnail(i.src)||i.value>=t?i.src:null}},{key:"isElementEligibleForResizing",value:function(e){var t=this.getOriginalSizesAttr(e),i=this.getDataSrc(e),n=this.getDataSrcSet(e);return Boolean(t&&i&&n)}},{key:"shouldRevertToOriginalSizes",value:function(e,t){if("auto"===this.getElementWidth(e))return this.shouldSkipAutoWidth();var i=this.getOriginalSizesAttr(e),n=this.getMaxWidthFromSizes(i);return!(!(n&&t>n)||this.isChildOfPicture(e))||!this.shouldAutoResize(e,t)}},{key:"triggerEvent",value:function(e,t){var i=new CustomEvent(t,{detail:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},bubbles:!(arguments.length>3&&void 0!==arguments[3])||arguments[3],cancelable:!(arguments.length>4&&void 0!==arguments[4])||arguments[4]});return e.dispatchEvent(i),i}},{key:"shouldSkipAutoWidth",value:function(){return this.skipAutoWidth}},{key:"resizeImageWithCDN",value:function(e,t){var i=this.getDataSrcSet(e),n=this.getDataSrc(e);if(i&&n){var r=this.parseSrcSet(i),a=this.getBaseImageSrcForResize(n,r,t);this.updateSrcsetForResize(e,i,a,t,r)}}},{key:"updateSrcsetForResize",value:function(e,t,i,n,r){var a=this.updateSrcsetWithTargetWidth(t,i,n,r);a=this.updateSrcsetWithRetinaWidth(a,i,n,r),this.updateElementSrcset(e,t,a)}},{key:"getBaseImageSrcForResize",value:function(e,t,i){if(!this.isThumbnail(e))return e;var n=t.find(function(e){return e.value>=i});return n?n.src:e}},{key:"isThumbnail",value:function(e){return new RegExp("(-\\d+x\\d+)\\.(".concat(v.join("|"),")(?:\\?.+)?$"),"i").test(e)}},{key:"updateSrcsetWithTargetWidth",value:function(e,t,i,n){return this.findSimilarSource(n,i)?e:e+", "+this.getResizedCDNURL(t,i)+" "+i+h}},{key:"updateSrcsetWithRetinaWidth",value:function(e,t,i,n){var r=this.getPixelRatio();if(r<=1)return e;var a=Math.ceil(i*r);return this.findSimilarSource(n,r,"x")||this.findSimilarSource(n,a,h)?e:e+", "+this.getResizedCDNURL(t,a)+" "+a+h}},{key:"updateElementSrcset",value:function(e,t,i){i!==t&&e.setAttribute("data-srcset",i)}},{key:"getPixelRatio",value:function(){return window.devicePixelRatio||1}},{key:"findSimilarSource",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.precision;return e.find(function(e){return n===e.unit&&e.value>=t&&i.isFuzzyMatch(e.value,t,r)})}},{key:"getResizedCDNURL",value:function(e,t){var i=this.parseURL(e);if(i){var n=new URLSearchParams(i.search);n.set("size","".concat(t,"x0"));var r=i.origin+i.pathname;return"".concat(r,"?").concat(n.toString())}}},{key:"parseURL",value:function(e){try{return new URL(e)}catch(e){return null}}},{key:"parseSrcSet",value:function(e){var t=this.extractSourcesFromSrcSet(e);return this.sortSources(t)}},{key:"extractSourcesFromSrcSet",value:function(e){return e.split(",").map(function(e){var t=a(e.trim().split(/\s+/),2),i=t[0],n=t[1],r=0,o="";return n&&(n.endsWith(h)?(r=parseInt(n,10),o=h):n.endsWith("x")&&(r=parseFloat(n),o="x")),{markup:e,src:i,value:r,unit:o}})}},{key:"sortSources",value:function(e){return e.sort(function(e,t){return e.value===t.value?0:e.value>t.value?-1:1}),e}},{key:"revertToOriginalSizesIfNeeded",value:function(e){var t=this.getOriginalSizesAttr(e);return!!t&&(e.setAttribute("sizes",t),e.removeAttribute(d),!0)}},{key:"getElementWidth",value:function(e){var t,i=null===(t=e.style)||void 0===t?void 0:t.width;if(i&&"auto"===i.trim())return"auto";var n=window.getComputedStyle(e).width,r=parseInt(n,10);return isNaN(r)?n:r}},{key:"getMaxWidthFromSizes",value:function(e){var t=e.match(/\(max-width:\s*(\d+)px\)\s*100vw,\s*\1px/);return t?parseInt(t[1],10):0}},{key:"getOriginalSizesAttr",value:function(e){return e.getAttribute(d)}},{key:"getDataSrcSet",value:function(e){return e.getAttribute(f)}},{key:"getDataSrc",value:function(e){return e.getAttribute("data-src")}},{key:"isFromSmushCDN",value:function(e){return e&&e.includes("smushcdn.com")}},{key:"isFuzzyMatch",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.abs(e-t)<=i}}],t&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}();!function(e,t){if(null===(e=window.smushLazyLoadOptions)||void 0===e?void 0:e.autoResizingEnabled){var i=(null===(t=window.smushLazyLoadOptions)||void 0===t?void 0:t.autoResizeOptions)||{};i=Object.assign({precision:5,skipAutoWidth:!0},i),new y(i)}}()},7857:function(e,t,i){"use strict";i.d(t,{G:function(){return a}});var n=i(6879),r=i.n(n),a=function(e){return e===r()||JSON.stringify((null==e?void 0:e.cfg)||{})===JSON.stringify((null===r()||void 0===r()?void 0:r().cfg)||{})};t.A=r()},4885:function(e,t,i){"use strict";i.r(t);var n=i(7857);document.addEventListener("lazybeforeunveil",function(e){var t;(0,n.G)(null==e||null===(t=e.detail)||void 0===t?void 0:t.instance)&&function(e){var t=e.getAttribute("data-bg-image")||e.getAttribute("data-bg"),i=e.hasAttribute("data-bg-image")?"background-image":"background";if(t){var n,r=e.getAttribute("style")||"",a="".concat(i,": ").concat(t,";"),o=new RegExp("".concat(i,"\\s*:\\s*[^;]+;?"));n=o.test(r)?r.replace(o,a):r.length>0?r.replace(/;$/g,"")+";"+a:a,e.setAttribute("style",n.trim())}}(e.target)})},5651:function(e,t,i){"use strict";i.r(t);var n,r,a,o,s,u,l,c=i(7857);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function v(e){var t=function(e,t){if("object"!=d(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==d(t)?t:t+""}r="smush-lazyload-video",a="smush-lazyloaded-video",o="smush-lazyload-autoplay",s="ontouchstart"in window?"touchstart":"pointerdown",u=Number(null===(n=window)||void 0===n?void 0:n.smush_video_render_delay)||0,l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldDelayVideoRenderingForMobile=this.supportsIntersectionObserver(),this.queuedVideoElements=[],this.isMobileOrSafari=null,this.init()},t=[{key:"init",value:function(){var e=this;document.addEventListener("lazybeforeunveil",function(t){return e.handleVideoLazyLoad(t)}),document.addEventListener(s,function(){return e.enableVideoRenderingForMobile()},{once:!0,passive:!0}),document.addEventListener("DOMContentLoaded",function(){u<=0?document.querySelector(".".concat(r,".").concat(o))&&e.enableVideoRenderingForMobile():setTimeout(function(){return e.enableVideoRenderingForMobile()},u)})}},{key:"handleVideoLazyLoad",value:function(e){var t,i=e.target;(0,c.G)(null==e||null===(t=e.detail)||void 0===t?void 0:t.instance)&&i.classList.contains(r)&&(this.handleButtonPlay(i),this.maybePrepareVideoForPlay(i))}},{key:"handleButtonPlay",value:function(e){var t=this,i=e.querySelector(".".concat("smush-play-btn"));if(i){var n=function(){return t.loadIframeVideoWithAutoPlay(e)};i.addEventListener("click",n),i.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n())})}else{var r;this.loadIframeVideo(e),null===(r=window.console)||void 0===r||r.warning("Missing play button [.smush-play-btn] for video element:",e)}}},{key:"maybePrepareVideoForPlay",value:function(e){var t=e.classList.contains(o);this.shouldPrepareIframeForPlay()?this.maybePrepareVideoForMobileAndSafari(e,t):t&&this.loadIframeVideoWithAutoPlay(e)}},{key:"enableVideoRenderingForMobile",value:function(){this.shouldDelayVideoRenderingForMobile&&(this.shouldDelayVideoRenderingForMobile=!1,this.maybeObserveQueuedVideoElements())}},{key:"supportsIntersectionObserver",value:function(){return"IntersectionObserver"in window}},{key:"maybeObserveQueuedVideoElements",value:function(){this.queuedVideoElements.length&&this.observeQueuedVideoElements()}},{key:"observeQueuedVideoElements",value:function(){var e=this,t=new IntersectionObserver(function(i){i.forEach(function(i){if(i.isIntersecting){var n=i.target;e.loadIframeVideo(n),t.unobserve(n)}})},{rootMargin:"0px 0px 200px 0px",threshold:.1});this.queuedVideoElements.forEach(function(e){t.observe(e)})}},{key:"maybePrepareVideoForMobileAndSafari",value:function(e,t){this.shouldDelayVideoRenderingForMobile?this.queuedVideoElements.push(e):this.loadIframeVideo(e,t)}},{key:"shouldPrepareIframeForPlay",value:function(){return null===this.isMobileOrSafari&&(this.isMobileOrSafari=this.checkIfMobileOrSafari()),this.isMobileOrSafari}},{key:"checkIfMobileOrSafari",value:function(){var e=navigator.userAgent;return e.includes("Mobi")||e.includes("Safari")&&!e.includes("Chrome")}},{key:"loadIframeVideo",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.classList.contains(a)){e.classList.add(a,"loading");var n=e.querySelector("iframe");if(n){var r=null===(t=n.dataset)||void 0===t?void 0:t.src;if(r){if(i){var o=new URL(r);o.searchParams.set("autoplay","1"),o.searchParams.set("playsinline","1"),r=o.toString()}var s=n.getAttribute("allow")||"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture";s.includes("autoplay")||(s+="; autoplay"),n.setAttribute("allow",s),n.setAttribute("allowFullscreen","true"),n.setAttribute("src",r),e.classList.remove("loading")}else{var u;null===(u=window.console)||void 0===u||u.error("Missing data-src attribute for iframe:",n)}}else{var l;null===(l=window.console)||void 0===l||l.error("Missing iframe element in video wrapper:",e)}}}},{key:"loadIframeVideoWithAutoPlay",value:function(e){this.loadIframeVideo(e,!0)}}],t&&f(e.prototype,t),i&&f(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}(),new l},6879:function(e){!function(t){var i=function(e,t,i){"use strict";var n,r;if(function(){var t,i={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(t in r=e.lazySizesConfig||e.lazysizesConfig||{},i)t in r||(r[t]=i[t])}(),!t||!t.getElementsByClassName)return{init:function(){},cfg:r,noSupport:!0};var a=t.documentElement,o=e.HTMLPictureElement,s="addEventListener",u="getAttribute",l=e[s].bind(e),c=e.setTimeout,d=e.requestAnimationFrame||c,f=e.requestIdleCallback,v=/^picture$/i,h=["load","error","lazyincluded","_lazyloaded"],y={},m=Array.prototype.forEach,g=function(e,t){return y[t]||(y[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),y[t].test(e[u]("class")||"")&&y[t]},p=function(e,t){g(e,t)||e.setAttribute("class",(e[u]("class")||"").trim()+" "+t)},b=function(e,t){var i;(i=g(e,t))&&e.setAttribute("class",(e[u]("class")||"").replace(i," "))},S=function(e,t,i){var n=i?s:"removeEventListener";i&&S(e,t),h.forEach(function(i){e[n](i,t)})},z=function(e,i,r,a,o){var s=t.createEvent("Event");return r||(r={}),r.instance=n,s.initEvent(i,!a,!o),s.detail=r,e.dispatchEvent(s),s},w=function(t,i){var n;!o&&(n=e.picturefill||r.pf)?(i&&i.src&&!t[u]("srcset")&&t.setAttribute("srcset",i.src),n({reevaluate:!0,elements:[t]})):i&&i.src&&(t.src=i.src)},E=function(e,t){return(getComputedStyle(e,null)||{})[t]},A=function(e,t,i){for(i=i||e.offsetWidth;i<r.minSize&&t&&!e._lazysizesWidth;)i=t.offsetWidth,t=t.parentNode;return i},k=(pe=[],be=[],Se=pe,ze=function(){var e=Se;for(Se=pe.length?be:pe,me=!0,ge=!1;e.length;)e.shift()();me=!1},we=function(e,i){me&&!i?e.apply(this,arguments):(Se.push(e),ge||(ge=!0,(t.hidden?c:d)(ze)))},we._lsFlush=ze,we),C=function(e,t){return t?function(){k(e)}:function(){var t=this,i=arguments;k(function(){e.apply(t,i)})}},R=function(e){var t,n=0,a=r.throttleDelay,o=r.ricTimeout,s=function(){t=!1,n=i.now(),e()},u=f&&o>49?function(){f(s,{timeout:o}),o!==r.ricTimeout&&(o=r.ricTimeout)}:C(function(){c(s)},!0);return function(e){var r;(e=!0===e)&&(o=33),t||(t=!0,(r=a-(i.now()-n))<0&&(r=0),e||r<9?u():c(u,r))}},M=function(e){var t,n,r=99,a=function(){t=null,e()},o=function(){var e=i.now()-n;e<r?c(o,r-e):(f||a)(a)};return function(){n=i.now(),t||(t=c(o,r))}},O=(Q=/^img$/i,Z=/^iframe$/i,J="onscroll"in e&&!/(gle|ing)bot/.test(navigator.userAgent),Y=0,K=0,X=0,ee=-1,te=function(e){X--,(!e||X<0||!e.target)&&(X=0)},ie=function(e){return null==G&&(G="hidden"==E(t.body,"visibility")),G||!("hidden"==E(e.parentNode,"visibility")&&"hidden"==E(e,"visibility"))},ne=function(e,i){var n,r=e,o=ie(e);for(U-=i,H+=i,q-=i,$+=i;o&&(r=r.offsetParent)&&r!=t.body&&r!=a;)(o=(E(r,"opacity")||1)>0)&&"visible"!=E(r,"overflow")&&(n=r.getBoundingClientRect(),o=$>n.left&&q<n.right&&H>n.top-1&&U<n.bottom+1);return o},re=function(){var e,i,o,s,l,c,d,f,v,h,y,m,g=n.elements;if((T=r.loadMode)&&X<8&&(e=g.length)){for(i=0,ee++;i<e;i++)if(g[i]&&!g[i]._lazyRace)if(!J||n.prematureUnveil&&n.prematureUnveil(g[i]))fe(g[i]);else if((f=g[i][u]("data-expand"))&&(c=1*f)||(c=K),h||(h=!r.expand||r.expand<1?a.clientHeight>500&&a.clientWidth>500?500:370:r.expand,n._defEx=h,y=h*r.expFactor,m=r.hFac,G=null,K<y&&X<1&&ee>2&&T>2&&!t.hidden?(K=y,ee=0):K=T>1&&ee>1&&X<6?h:Y),v!==c&&(j=innerWidth+c*m,B=innerHeight+c,d=-1*c,v=c),o=g[i].getBoundingClientRect(),(H=o.bottom)>=d&&(U=o.top)<=B&&($=o.right)>=d*m&&(q=o.left)<=j&&(H||$||q||U)&&(r.loadHidden||ie(g[i]))&&(D&&X<3&&!f&&(T<3||ee<4)||ne(g[i],c))){if(fe(g[i]),l=!0,X>9)break}else!l&&D&&!s&&X<4&&ee<4&&T>2&&(x[0]||r.preloadAfterLoad)&&(x[0]||!f&&(H||$||q||U||"auto"!=g[i][u](r.sizesAttr)))&&(s=x[0]||g[i]);s&&!l&&fe(s)}},ae=R(re),oe=function(e){var t=e.target;t._lazyCache?delete t._lazyCache:(te(e),p(t,r.loadedClass),b(t,r.loadingClass),S(t,ue),z(t,"lazyloaded"))},se=C(oe),ue=function(e){se({target:e.target})},le=function(e,t){var i=e.getAttribute("data-load-mode")||r.iframeLoadMode;0==i?e.contentWindow.location.replace(t):1==i&&(e.src=t)},ce=function(e){var t,i=e[u](r.srcsetAttr);(t=r.customMedia[e[u]("data-media")||e[u]("media")])&&e.setAttribute("media",t),i&&e.setAttribute("srcset",i)},de=C(function(e,t,i,n,a){var o,s,l,d,f,h;(f=z(e,"lazybeforeunveil",t)).defaultPrevented||(n&&(i?p(e,r.autosizesClass):e.setAttribute("sizes",n)),s=e[u](r.srcsetAttr),o=e[u](r.srcAttr),a&&(d=(l=e.parentNode)&&v.test(l.nodeName||"")),h=t.firesLoad||"src"in e&&(s||o||d),f={target:e},p(e,r.loadingClass),h&&(clearTimeout(_),_=c(te,2500),S(e,ue,!0)),d&&m.call(l.getElementsByTagName("source"),ce),s?e.setAttribute("srcset",s):o&&!d&&(Z.test(e.nodeName)?le(e,o):e.src=o),a&&(s||d)&&w(e,{src:o})),e._lazyRace&&delete e._lazyRace,b(e,r.lazyClass),k(function(){var t=e.complete&&e.naturalWidth>1;h&&!t||(t&&p(e,r.fastLoadedClass),oe(f),e._lazyCache=!0,c(function(){"_lazyCache"in e&&delete e._lazyCache},9)),"lazy"==e.loading&&X--},!0)}),fe=function(e){if(!e._lazyRace){var t,i=Q.test(e.nodeName),n=i&&(e[u](r.sizesAttr)||e[u]("sizes")),a="auto"==n;(!a&&D||!i||!e[u]("src")&&!e.srcset||e.complete||g(e,r.errorClass)||!g(e,r.lazyClass))&&(t=z(e,"lazyunveilread").detail,a&&L.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,X++,de(e,t,a,n,i))}},ve=M(function(){r.loadMode=3,ae()}),he=function(){3==r.loadMode&&(r.loadMode=2),ve()},ye=function(){D||(i.now()-V<999?c(ye,999):(D=!0,r.loadMode=3,ae(),l("scroll",he,!0)))},{_:function(){V=i.now(),n.elements=t.getElementsByClassName(r.lazyClass),x=t.getElementsByClassName(r.lazyClass+" "+r.preloadClass),l("scroll",ae,!0),l("resize",ae,!0),l("pageshow",function(e){if(e.persisted){var i=t.querySelectorAll("."+r.loadingClass);i.length&&i.forEach&&d(function(){i.forEach(function(e){e.complete&&fe(e)})})}}),e.MutationObserver?new MutationObserver(ae).observe(a,{childList:!0,subtree:!0,attributes:!0}):(a[s]("DOMNodeInserted",ae,!0),a[s]("DOMAttrModified",ae,!0),setInterval(ae,999)),l("hashchange",ae,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){t[s](e,ae,!0)}),/d$|^c/.test(t.readyState)?ye():(l("load",ye),t[s]("DOMContentLoaded",ae),c(ye,2e4)),n.elements.length?(re(),k._lsFlush()):ae()},checkElems:ae,unveil:fe,_aLSL:he}),L=(P=C(function(e,t,i,n){var r,a,o;if(e._lazysizesWidth=n,n+="px",e.setAttribute("sizes",n),v.test(t.nodeName||""))for(a=0,o=(r=t.getElementsByTagName("source")).length;a<o;a++)r[a].setAttribute("sizes",n);i.detail.dataAttr||w(e,i.detail)}),I=function(e,t,i){var n,r=e.parentNode;r&&(i=A(e,r,i),(n=z(e,"lazybeforesizes",{width:i,dataAttr:!!t})).defaultPrevented||(i=n.detail.width)&&i!==e._lazysizesWidth&&P(e,r,n,i))},W=M(function(){var e,t=F.length;if(t)for(e=0;e<t;e++)I(F[e])}),{_:function(){F=t.getElementsByClassName(r.autosizesClass),l("resize",W)},checkElems:W,updateElem:I}),N=function(){!N.i&&t.getElementsByClassName&&(N.i=!0,L._(),O._())};var F,P,I,W;var x,D,_,T,V,j,B,U,q,$,H,G,Q,Z,J,Y,K,X,ee,te,ie,ne,re,ae,oe,se,ue,le,ce,de,fe,ve,he,ye;var me,ge,pe,be,Se,ze,we;return c(function(){r.init&&N()}),n={cfg:r,autoSizer:L,loader:O,init:N,uP:w,aC:p,rC:b,hC:g,fire:z,gW:A,rAF:k}}(t,t.document,Date);t.lazySizes=i,e.exports&&(e.exports=i)}("undefined"!=typeof window?window:{})}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,i),a.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e=window.lazySizesConfig||null;e&&delete window.lazySizesConfig;var t=i(7857);i(4885),i(5651),i(5637),t.A.init(),e?window.lazySizesConfig=e:"lazySizesConfig"in window&&delete window.lazySizesConfig}()}();
(function ($){
$(document).ready(function (){
$(document).on("click", ".awdr_change_product", function(){
var product_id=$(this).attr('data-pid');
var rule_unique_id=$(this).attr('data-rule_id');
var parent_id=$(this).attr('data-parent_id');
var data={
action: 'awdr_change_discount_product_in_cart',
product_id: product_id,
rule_unique_id: rule_unique_id,
parent_id: parent_id,
awdr_nonce: awdr_params.nonce,
};
$.ajax({
url: awdr_params.ajaxurl,
data: data,
type: 'POST',
success: function (response){
if(response.success==true){
if(response.data==1){
jQuery("[name='update_cart']").removeAttr('disabled');
jQuery("[name='update_cart']").trigger("click");
}}
},
error: function (response){
}});
});
var acc=document.getElementsByClassName("awdr-select-free-variant-product-toggle");
var i;
$(document).on("click",'.awdr-select-free-variant-product-toggle' , function (e){
e.preventDefault();
this.classList.toggle("awdr-select-free-variant-product-toggle-active");
var panel=this.nextElementSibling;
if(panel.style.display==="block"){
$(panel).slideUp(1000);
}else{
$(panel).slideDown(1000);
}});
});
})(jQuery);