document.body.classList.contains("woocommerce-cart")||document.body.classList.contains("woocommerce-checkout")||window.innerWidth<768||!document.getElementById("site-header-cart")||window.addEventListener("load",function(){document.querySelector(".site-header-cart").addEventListener("mouseover",function(){var e=window.outerHeight,t=this.querySelector(".widget_shopping_cart_content").getBoundingClientRect().bottom+this.offsetHeight,o=this.querySelector(".cart_list");e<t&&(o.style.maxHeight="15em",o.style.overflowY="auto")})});
document.addEventListener("DOMContentLoaded",function(){if(0!==document.getElementsByClassName("storefront-handheld-footer-bar").length){[].forEach.call(document.querySelectorAll(".storefront-handheld-footer-bar .search > a"),function(t){t.addEventListener("click",function(e){t.parentElement.classList.toggle("active"),e.preventDefault()})});var t=document.getElementsByClassName("storefront-handheld-footer-bar"),n=document.forms,o=function(t){return function(e){t&&-1!==e.target.tabIndex?document.body.classList.add("sf-input-focused"):document.body.classList.remove("sf-input-focused")}};if(t.length&&n.length)for(let e=0;e<n.length;e++)t[0].contains(n[e])||(n[e].addEventListener("focus",o(!0),!0),n[e].addEventListener("blur",o(!1),!0))}});
document.addEventListener("DOMContentLoaded",function(){let i=document.getElementsByClassName("brands_index");if(i.length){let n=document.body.classList.contains("admin-bar")?32:0,t=document.getElementById("brands_a_z").scrollHeight,e=i[0].scrollHeight+40,d=function(){768<window.innerWidth&&i[0].getBoundingClientRect().top<0?i[0].style.paddingTop=Math.min(Math.abs(i[0].getBoundingClientRect().top)+20+n,t-e)+"px":i[0].style.paddingTop=0};d(),window.addEventListener("scroll",function(){d()})}});
(()=>{var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{var t;e.g.importScripts&&(t=e.g.location+"");var o=e.g.document;if(!t&&o&&(o.currentScript&&(t=o.currentScript.src),!t)){var r=o.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.p=window.wcpayAssets.url,(()=>{"use strict";const e=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:t(e),t=e=>{let t=null;if("undefined"!=typeof wcpay_upe_config)t=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;t=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return t[e]||null},o=(e,t,o="wcpay_")=>e.toString().replace("%%endpoint%%",o+t);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)}var n=/^\s+/,a=/\s+$/;function i(e,t){if(t=t||{},(e=e||"")instanceof i)return e;if(!(this instanceof i))return new i(e,t);var o=function(e){var t,o,i,c={r:0,g:0,b:0},l=1,s=null,u=null,h=null,d=!1,p=!1;return"string"==typeof e&&(e=function(e){e=e.replace(n,"").replace(a,"").toLowerCase();var t,o=!1;if(v[e])e=v[e],o=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=H.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=H.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=H.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=H.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=H.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=H.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=H.hex8.exec(e))?{r:A(t[1]),g:A(t[2]),b:A(t[3]),a:P(t[4]),format:o?"name":"hex8"}:(t=H.hex6.exec(e))?{r:A(t[1]),g:A(t[2]),b:A(t[3]),format:o?"name":"hex"}:(t=H.hex4.exec(e))?{r:A(t[1]+""+t[1]),g:A(t[2]+""+t[2]),b:A(t[3]+""+t[3]),a:P(t[4]+""+t[4]),format:o?"name":"hex8"}:!!(t=H.hex3.exec(e))&&{r:A(t[1]+""+t[1]),g:A(t[2]+""+t[2]),b:A(t[3]+""+t[3]),format:o?"name":"hex"}}(e)),"object"==r(e)&&(B(e.r)&&B(e.g)&&B(e.b)?(t=e.r,o=e.g,i=e.b,c={r:255*T(t,255),g:255*T(o,255),b:255*T(i,255)},d=!0,p="%"===String(e.r).substr(-1)?"prgb":"rgb"):B(e.h)&&B(e.s)&&B(e.v)?(s=L(e.s),u=L(e.v),c=function(e,t,o){e=6*T(e,360),t=T(t,100),o=T(o,100);var r=Math.floor(e),n=e-r,a=o*(1-t),i=o*(1-n*t),c=o*(1-(1-n)*t),l=r%6;return{r:255*[o,i,a,a,c,o][l],g:255*[c,o,o,i,a,a][l],b:255*[a,a,c,o,o,i][l]}}(e.h,s,u),d=!0,p="hsv"):B(e.h)&&B(e.s)&&B(e.l)&&(s=L(e.s),h=L(e.l),c=function(e,t,o){var r,n,a;function i(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e}if(e=T(e,360),t=T(t,100),o=T(o,100),0===t)r=n=a=o;else{var c=o<.5?o*(1+t):o+t-o*t,l=2*o-c;r=i(l,c,e+1/3),n=i(l,c,e),a=i(l,c,e-1/3)}return{r:255*r,g:255*n,b:255*a}}(e.h,s,h),d=!0,p="hsl"),e.hasOwnProperty("a")&&(l=e.a)),l=C(l),{ok:d,format:e.format||p,r:Math.min(255,Math.max(c.r,0)),g:Math.min(255,Math.max(c.g,0)),b:Math.min(255,Math.max(c.b,0)),a:l}}(e);this._originalInput=e,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||o.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function c(e,t,o){e=T(e,255),t=T(t,255),o=T(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),c=(a+i)/2;if(a==i)r=n=0;else{var l=a-i;switch(n=c>.5?l/(2-a-i):l/(a+i),a){case e:r=(t-o)/l+(t<o?6:0);break;case t:r=(o-e)/l+2;break;case o:r=(e-t)/l+4}r/=6}return{h:r,s:n,l:c}}function l(e,t,o){e=T(e,255),t=T(t,255),o=T(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),c=a,l=a-i;if(n=0===a?0:l/a,a==i)r=0;else{switch(a){case e:r=(t-o)/l+(t<o?6:0);break;case t:r=(o-e)/l+2;break;case o:r=(e-t)/l+4}r/=6}return{h:r,s:n,v:c}}function s(e,t,o,r){var n=[I(Math.round(e).toString(16)),I(Math.round(t).toString(16)),I(Math.round(o).toString(16))];return r&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function u(e,t,o,r){return[I(q(r)),I(Math.round(e).toString(16)),I(Math.round(t).toString(16)),I(Math.round(o).toString(16))].join("")}function h(e,t){t=0===t?0:t||10;var o=i(e).toHsl();return o.s-=t/100,o.s=M(o.s),i(o)}function d(e,t){t=0===t?0:t||10;var o=i(e).toHsl();return o.s+=t/100,o.s=M(o.s),i(o)}function p(e){return i(e).desaturate(100)}function f(e,t){t=0===t?0:t||10;var o=i(e).toHsl();return o.l+=t/100,o.l=M(o.l),i(o)}function m(e,t){t=0===t?0:t||10;var o=i(e).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(-t/100*255))),o.g=Math.max(0,Math.min(255,o.g-Math.round(-t/100*255))),o.b=Math.max(0,Math.min(255,o.b-Math.round(-t/100*255))),i(o)}function b(e,t){t=0===t?0:t||10;var o=i(e).toHsl();return o.l-=t/100,o.l=M(o.l),i(o)}function g(e,t){var o=i(e).toHsl(),r=(o.h+t)%360;return o.h=r<0?360+r:r,i(o)}function y(e){var t=i(e).toHsl();return t.h=(t.h+180)%360,i(t)}function w(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=i(e).toHsl(),r=[i(e)],n=360/t,a=1;a<t;a++)r.push(i({h:(o.h+a*n)%360,s:o.s,l:o.l}));return r}function _(e){var t=i(e).toHsl(),o=t.h;return[i(e),i({h:(o+72)%360,s:t.s,l:t.l}),i({h:(o+216)%360,s:t.s,l:t.l})]}function S(e,t,o){t=t||6,o=o||30;var r=i(e).toHsl(),n=360/o,a=[i(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,a.push(i(r));return a}function k(e,t){t=t||6;for(var o=i(e).toHsv(),r=o.h,n=o.s,a=o.v,c=[],l=1/t;t--;)c.push(i({h:r,s:n,v:a})),a=(a+l)%1;return c}i.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,o,r=this.toRgb();return e=r.r/255,t=r.g/255,o=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=l(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+o+"%, "+r+"%)":"hsva("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=c(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=c(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+o+"%, "+r+"%)":"hsla("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return s(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,o,r,n){var a=[I(Math.round(e).toString(16)),I(Math.round(t).toString(16)),I(Math.round(o).toString(16)),I(q(r))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*T(this._r,255))+"%",g:Math.round(100*T(this._g,255))+"%",b:Math.round(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*T(this._r,255))+"%, "+Math.round(100*T(this._g,255))+"%, "+Math.round(100*T(this._b,255))+"%)":"rgba("+Math.round(100*T(this._r,255))+"%, "+Math.round(100*T(this._g,255))+"%, "+Math.round(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(x[s(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+u(this._r,this._g,this._b,this._a),o=t,r=this._gradientType?"GradientType=1, ":"";if(e){var n=i(e);o="#"+u(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+o+")"},toString:function(e){var t=!!e;e=e||this._format;var o=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(o=this.toRgbString()),"prgb"===e&&(o=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(o=this.toHexString()),"hex3"===e&&(o=this.toHexString(!0)),"hex4"===e&&(o=this.toHex8String(!0)),"hex8"===e&&(o=this.toHex8String()),"name"===e&&(o=this.toName()),"hsl"===e&&(o=this.toHslString()),"hsv"===e&&(o=this.toHsvString()),o||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return i(this.toString())},_applyModification:function(e,t){var o=e.apply(null,[this].concat([].slice.call(t)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(p,arguments)},spin:function(){return this._applyModification(g,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(w,[3])},tetrad:function(){return this._applyCombination(w,[4])}},i.fromRatio=function(e,t){if("object"==r(e)){var o={};for(var n in e)e.hasOwnProperty(n)&&(o[n]="a"===n?e[n]:L(e[n]));e=o}return i(e,t)},i.equals=function(e,t){return!(!e||!t)&&i(e).toRgbString()==i(t).toRgbString()},i.random=function(){return i.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},i.mix=function(e,t,o){o=0===o?0:o||50;var r=i(e).toRgb(),n=i(t).toRgb(),a=o/100;return i({r:(n.r-r.r)*a+r.r,g:(n.g-r.g)*a+r.g,b:(n.b-r.b)*a+r.b,a:(n.a-r.a)*a+r.a})},i.readability=function(e,t){var o=i(e),r=i(t);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},i.isReadable=function(e,t,o){var r,n,a,c,l,s=i.readability(e,t);switch(n=!1,(a=o,"AA"!==(c=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==c&&(c="AA"),"small"!==(l=(a.size||"small").toLowerCase())&&"large"!==l&&(l="small"),r={level:c,size:l}).level+r.size){case"AAsmall":case"AAAlarge":n=s>=4.5;break;case"AAlarge":n=s>=3;break;case"AAAsmall":n=s>=7}return n},i.mostReadable=function(e,t,o){var r,n,a,c,l=null,s=0;n=(o=o||{}).includeFallbackColors,a=o.level,c=o.size;for(var u=0;u<t.length;u++)(r=i.readability(e,t[u]))>s&&(s=r,l=i(t[u]));return i.isReadable(e,l,{level:a,size:c})||!n?l:(o.includeFallbackColors=!1,i.mostReadable(e,["#fff","#000"],o))};var v=i.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},x=i.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}(v);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function T(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var o=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),o&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function M(e){return Math.min(1,Math.max(0,e))}function A(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function L(e){return e<=1&&(e=100*e+"%"),e}function q(e){return Math.round(255*parseFloat(e)).toString(16)}function P(e){return A(e)/255}var R,F,E,H=(F="[\\s|\\(]+("+(R="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+R+")[,|\\s]+("+R+")\\s*\\)?",E="[\\s|\\(]+("+R+")[,|\\s]+("+R+")[,|\\s]+("+R+")[,|\\s]+("+R+")\\s*\\)?",{CSS_UNIT:new RegExp(R),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+E),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+E),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+E),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(e){return!!H.CSS_UNIT.exec(e)}const N=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],j=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],z=["backgroundColor","border","borderTop","borderRight","borderBottom","borderLeft","borderRadius","borderWidth","borderColor","borderStyle","borderTopWidth","borderTopColor","borderTopStyle","borderRightWidth","borderRightColor","borderRightStyle","borderBottomWidth","borderBottomColor","borderBottomStyle","borderLeftWidth","borderLeftColor","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","outline","outlineOffset","boxShadow"],O={".Label":[...N,...j],".Text":[...N,...j],".Input":[...N,...j,...z],".Error":[...N,...j,...z],".Tab":[...N,...j,...z],".TabIcon":[...N],".TabLabel":[...N,...j],".Block":[...N.slice(1),...z.slice(1)],".Container":[...z],".Header":[...N,...z,...j],".Footer":[...N,...z,...j]},W={".Label":O[".Label"],".Label--floating":[...O[".Label"],"transform"],".Input":[...O[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":O[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",...z],".TabIcon":O[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":O[".TabLabel"],".Block":O[".Block"],".Container":O[".Container"],".Header":O[".Header"],".Footer":O[".Footer"],".Footer--link":O[".Text"],".Text":O[".Text"],".Text--redirect":O[".Text"]},$=(e,t=document)=>{let o=null,r=0;for(;!o&&r<e.length;){let n;try{n=t.querySelector(e[r])}catch(e){r++;continue}if(!n){r++;continue}const a=(t.defaultView||window).getComputedStyle(n).backgroundColor;a&&i(a).getAlpha()>=.5&&(o=a),r++}return o||"#ffffff"},V=e=>{const t=i(e),o=t.getAlpha();if(o<1){const e=t.toRgb();return i({r:Math.round(e.r*o+255*(1-o)),g:Math.round(e.g*o+255*(1-o)),b:Math.round(e.b*o+255*(1-o))}).getBrightness()>125}return t.getBrightness()>125},U={default:{hiddenContainer:"#wcpay-hidden-div",hiddenInput:"#wcpay-hidden-input",hiddenInvalidInput:"#wcpay-hidden-invalid-input",hiddenValidActiveLabel:"#wcpay-hidden-valid-active-label"},classicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:["#payment .payment_methods li .payment_box fieldset",".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},backgroundSelectors:["li.wc_payment_method .wc-payment-form","li.wc_payment_method .payment_box","#payment","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],pmmeRelativeTextSizeSelector:".wc_payment_method > label"},blocksCheckout:{appendTarget:".wc-block-checkout__contact-fields",upeThemeInputSelector:".wc-block-components-text-input #email",upeThemeLabelSelector:".wc-block-components-text-input label",upeThemeTextSelectors:[".wc-block-components-checkout-step__description",".wc-block-components-text-input",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],rowElement:"div",validClasses:["wc-block-components-text-input","is-active"],invalidClasses:["wc-block-components-text-input","has-error"],alternateSelectors:{appendTarget:"#billing.wc-block-components-address-form",upeThemeInputSelector:"#billing-first_name",upeThemeLabelSelector:".wc-block-components-checkout-step__description"},backgroundSelectors:["#payment-method .wc-block-components-radio-control-accordion-option","#payment-method","form.wc-block-checkout__form",".wc-block-checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-components-checkout-place-order-button"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"],pmmeRelativeTextSizeSelector:".wc-block-components-radio-control__label-group"},bnplProductPage:{appendTarget:".product .cart .quantity",upeThemeInputSelector:".product .cart .quantity .qty",upeThemeLabelSelector:".product .cart .quantity label",upeThemeTextSelectors:[".product .cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main > .product > div.summary.entry-summary","#main > .product","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".single_add_to_cart_button"]},bnplClassicCart:{appendTarget:".cart .quantity",upeThemeInputSelector:".cart .quantity .qty",upeThemeLabelSelector:".cart .quantity label",upeThemeTextSelectors:[".cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main .entry-content .cart_totals","#main .entry-content","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".checkout-button"],containerSelectors:[".shop_table"]},bnplCartBlock:{appendTarget:".wc-block-cart .wc-block-components-quantity-selector",upeThemeInputSelector:".wc-block-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input",upeThemeLabelSelector:".wc-block-components-text-input",upeThemeTextSelectors:[".wc-block-components-text-input"],rowElement:"div",validClasses:["wc-block-components-text-input"],invalidClasses:["wc-block-components-text-input","has-error"],backgroundSelectors:[".wc-block-components-bnpl-wrapper",".wc-block-components-order-meta",".wc-block-components-totals-wrapper",".wp-block-woocommerce-cart-order-summary-block",".wp-block-woocommerce-cart-totals-block",".wp-block-woocommerce-cart .wc-block-cart",".wp-block-woocommerce-cart","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-cart__submit-button"],containerSelectors:[".wp-block-woocommerce-cart-line-items-block"]},wooPayClassicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:[".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},backgroundSelectors:["#customer_details","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["form.checkout a",".woocommerce a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".woocommerce-checkout-review-order-table"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},wooPayBlocksCheckout:{appendTarget:".wc-block-checkout__contact-fields",upeThemeInputSelector:".wc-block-components-text-input #email",upeThemeLabelSelector:".wc-block-components-text-input label",upeThemeTextSelectors:[".wc-block-components-checkout-step__description",".wc-block-components-text-input",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],rowElement:"div",validClasses:["wc-block-components-text-input","is-active"],invalidClasses:["wc-block-components-text-input","has-error"],alternateSelectors:{appendTarget:"#billing.wc-block-components-address-form",upeThemeInputSelector:"#billing-first_name",upeThemeLabelSelector:".wc-block-components-checkout-step__description"},backgroundSelectors:["#payment-method .wc-block-components-radio-control-accordion-option","#payment-method","form.wc-block-checkout__form",".wc-block-checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-components-checkout-place-order-button"],linkSelectors:[".wc-block-checkout a",".wc-block-components-main a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},updateSelectors:function(e,t){return e.hasOwnProperty("alternateSelectors")&&(Object.entries(e.alternateSelectors).forEach((o=>{const[r,n]=o,a=e[r];if(Array.isArray(a))a.some((e=>{try{return t.querySelector(e)}catch(e){return!1}}))||(e[r]=n);else try{t.querySelector(e[r])||(e[r]=n)}catch(t){e[r]=n}})),delete e.alternateSelectors),e},getSelectors:function(e,t){let o=this.blocksCheckout;switch(e){case"blocks_checkout":o=this.blocksCheckout;break;case"shortcode_checkout":o=this.classicCheckout;break;case"bnpl_product_page":o=this.bnplProductPage;break;case"bnpl_classic_cart":o=this.bnplClassicCart;break;case"bnpl_cart_block":o=this.bnplCartBlock;break;case"woopay_shortcode_checkout":o=this.wooPayClassicCheckout;break;case"woopay_blocks_checkout":o=this.wooPayBlocksCheckout}return{...this.default,...this.updateSelectors(o,t)}}},D={getHiddenContainer:function(e,t){const o=t.createElement("div");return o.setAttribute("id",this.getIDFromSelector(e)),o.style.border=0,o.style.clip="rect(0 0 0 0)",o.style.height="1px",o.style.margin="-1px",o.style.overflow="hidden",o.style.padding="0",o.style.position="absolute",o.style.width="1px",o},createRow:function(e,t=[],o){const r=o.createElement(e);return t.length&&r.classList.add(...t),r},appendClone:function(e,t,o,r){const n=r.querySelector(t);if(n){const t=n.cloneNode(!0);t.id=this.getIDFromSelector(o),t.value="",e.appendChild(t)}},getIDFromSelector:function(e){return e.startsWith("#")||e.startsWith(".")?e.slice(1):e},init:function(e,t){const o=U.getSelectors(e),r=t.querySelector(o.appendTarget),n=t.querySelector(o.upeThemeInputSelector);if(!r||!n)return;t.querySelector(o.hiddenContainer)&&this.cleanup(t);const a=this.getHiddenContainer(o.hiddenContainer,t);r.appendChild(a);const i=this.createRow(o.rowElement,o.validClasses,t);a.appendChild(i);const c=this.createRow(o.rowElement,o.invalidClasses,t);a.appendChild(c),this.appendClone(i,o.upeThemeInputSelector,o.hiddenInput,t),this.appendClone(i,o.upeThemeLabelSelector,o.hiddenValidActiveLabel,t),this.appendClone(c,o.upeThemeInputSelector,o.hiddenInvalidInput,t),this.appendClone(c,o.upeThemeLabelSelector,o.hiddenInvalidInput,t),t.querySelector(o.hiddenInput).style.transition="none"},cleanup:function(e){const t=e.querySelector(U.default.hiddenContainer);t&&t.remove()}},J=(e,t,o=null,r)=>{const n=(Array.isArray(e)?e:[e]).map((e=>{try{return r.querySelector(e)}catch(e){return null}})).filter(Boolean);if(!n.length)return{};const a=r.defaultView||window,i=W[t],c=n[0],l=a.getComputedStyle(c),s={};if(i.forEach((e=>{const t=e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),o=l.getPropertyValue(t);if(o)if("color"!==e)if("lineHeight"!==e||"0"!==o&&"0px"!==o)s[e]=o;else for(let t=1;t<n.length;t++){const o=a.getComputedStyle(n[t]).getPropertyValue("line-height");if("0"!==o&&"0px"!==o){s[e]=o;break}}else s[e]=(e=>{const t=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0?(\.\d+)?|1?(\.0+)?)\s*\)$/);if(t){const o=t[4]||1;e=`rgb(${t.slice(1,4).map((e=>Math.round(e*o+255*(1-o)))).join(", ")})`}return e})(o)})),".Input"===t||".Tab--selected"===t){const e=((e,t="solid",o)=>e&&o?[e,t,o].join(" "):"")(s.outlineWidth,s.outlineStyle,s.outlineColor);""!==e&&(s.outline=e),delete s.outlineWidth,delete s.outlineColor,delete s.outlineStyle}const u=l.getPropertyValue("text-indent");return"0px"!==u&&"0px"===s.paddingLeft&&"0px"===s.paddingRight&&(s.paddingLeft=u,s.paddingRight=u),".Block"===t&&(s.backgroundColor=o),s},K=(e=document)=>{const t=[],o=e.styleSheets,r=["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","fonts.bunny.net","fonts.wp.com"];for(let e=0;e<o.length;e++){if(!o[e].href)continue;const n=new URL(o[e].href);-1!==r.indexOf(n.hostname)&&t.push({cssSrc:o[e].href})}return t},G={blocks_checkout:"woopay_blocks_checkout",shortcode_checkout:"woopay_shortcode_checkout"},Q=(e,t=!1,o=document)=>{var r;const n=t&&null!==(r=G[e])&&void 0!==r?r:e,a=U.getSelectors(n,o);D.init(n,o);const c=J(a.hiddenInput,".Input",null,o),l=J(a.hiddenInvalidInput,".Input",null,o),s=J(a.upeThemeLabelSelector,".Label",null,o),u={fontSize:s.fontSize},h=J(a.upeThemeTextSelectors,".Text",null,o),d=J(a.upeThemeInputSelector,".Tab",null,o),p=J(a.hiddenInput,".Tab--selected",null,o),f=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const o=((e,t)=>{const o={backgroundColor:e,color:t},r=i(e),n=i(t);if(!r.isValid()||!n.isValid())return{backgroundColor:"",color:""};const a=r.getBrightness()>50?i(r).darken(7):i(r).lighten(7),c=i.mostReadable(a,[n],{includeFallbackColors:!0});return o.backgroundColor=a.toRgbString(),o.color=c.toRgbString(),o})(e.backgroundColor,e.color);return t.backgroundColor=o.backgroundColor,t.color=o.color,t})(d),m={color:f.color},b={color:p.color},g=$(a.backgroundSelectors,o),y=J(a.upeThemeLabelSelector,".Block",g,o),w={colorBackground:g,colorText:h.color,fontFamily:h.fontFamily,fontSizeBase:h.fontSize};a.pmmeRelativeTextSizeSelector&&w.fontSizeBase&&(w.fontSizeBase=function(e,t,o=.875,r){const n=parseFloat(t);if(isNaN(n))return t;const a=r.querySelector(e);if(!a)return n*o+"px";const i=window.getComputedStyle(a).getPropertyValue("font-size"),c=parseFloat(i)*o;return isNaN(c)?t:n>c?`${c}px`:`${n}px`}(a.pmmeRelativeTextSizeSelector,h.fontSize,.875,o));const _="blocks_checkout"===e||"woopay_blocks_checkout"===n;let S={variables:w,theme:V(g)?"stripe":"night",labels:_?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":c,".Input--invalid":l,".Label":s,".Label--resting":u,".Block":y,".Tab":d,".Tab:hover":f,".Tab--selected":p,".TabIcon:hover":m,".TabIcon--selected":b,".Text":h,".Text--redirect":h}))};if(_&&(S=((e,t)=>{if(e.rules[".Label--floating"]=t,e.rules[".Label--floating"].transform&&"none"!==e.rules[".Label--floating"].transform){const t=e.rules[".Label--floating"].transform.match(/matrix\((.+)\)/);if(t&&t[1]){const o=t[1].split(", "),r=(parseFloat(o[0])+parseFloat(o[3]))/2,n=parseFloat(e.rules[".Label--floating"].lineHeight),a=Math.floor(n*r);e.rules[".Label--floating"].lineHeight=`${a}px`,e.rules[".Label--floating"].fontSize=`${a}px`}delete e.rules[".Label--floating"].transform}if(e.rules[".Input"].paddingTop&&(e.rules[".Input"].paddingTop=`calc(${e.rules[".Input"].paddingTop} - ${e.rules[".Label--floating"].lineHeight} - 4px - 1px)`),e.rules[".Input"].paddingBottom){var o;const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const r=null!==(o=e.rules[".Label"].marginTop)&&void 0!==o?o:"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=r}return e})(S,J(a.hiddenValidActiveLabel,".Label--floating",null,o))),t){const e=J(a.headerSelectors,".Header",null,o),t=J(a.footerSelectors,".Footer",null,o);var k,v;(!e.backgroundColor||i(e.backgroundColor).getAlpha()<.5)&&(e.backgroundColor=$([...null!==(k=a.headerSelectors)&&void 0!==k?k:[],"body"],o)),(!t.backgroundColor||i(t.backgroundColor).getAlpha()<.5)&&(t.backgroundColor=$([...null!==(v=a.footerSelectors)&&void 0!==v?v:[],"body"],o)),S.rules={...S.rules,".Heading":J(a.headingSelectors,".Label",null,o),".Header":e,".Footer":t,".Footer-link":J(a.footerLink,".Footer--link",null,o),".Button":J(a.buttonSelectors,".Input",null,o),".Link":J(a.linkSelectors,".Label",null,o),".Container":J(a.containerSelectors,".Container",null,o)}}return D.cleanup(o),S};class X{constructor(e,t){this.options=e,this.stripe=null,this.stripePlatform=null,this.request=t,this.isWooPayRequesting=!1}createStripe(e,t,o="",r=[]){const n={locale:t};return o&&(n.stripeAccount=o),r&&(n.betas=r),new Stripe(e,n)}async getStripeForUPE(e){return this.options.forceNetworkSavedCards=t("paymentMethodsConfig")[e].forceNetworkSavedCards,this.getStripe()}async getStripe(e=!1){let t=0;for(;!window.Stripe;)if(await new Promise((e=>setTimeout(e,100))),t+=100,t>6e5)throw new Error("Stripe object not found");return this.__getStripe(e)}__getStripe(e=!1){const{publishableKey:t,accountId:o,forceNetworkSavedCards:r,locale:n,isStripeLinkEnabled:a}=this.options;if(r&&!e)return this.stripePlatform||(this.stripePlatform=this.createStripe(t,n)),this.stripePlatform;if(!this.stripe){let e=["card_country_event_beta_1"];a&&(e=e.concat(["link_autofill_modal_beta_1"])),this.stripe=this.createStripe(t,n,o,e)}return this.stripe}async loadStripeForExpressCheckout(){try{return this.getStripe(!0)}catch(e){return{error:e}}}confirmIntent(t,o=!1){const r=t.match(/#wcpay-confirm-(pi|si):([^:]+):([^:]+):([^:]+)(?::(.+))?$/);if(!r)return!0;const n="si"===r[1];let a=r[2];const i=r[3],c=r[4],l=r[5]||null,s=t.indexOf("order-pay"),u=s>-1&&t.substring(s).match(/\d+/);return u&&(a=u[0]),(async()=>{const{locale:t,publishableKey:o}=this.options,r=e("accountIdForIntentConfirmation");if(n){const e=await this.getStripe(!0);return l?e.confirmSetup({clientSecret:i,confirmParams:{confirmation_token:l},redirect:"if_required"}):e.handleNextAction({clientSecret:i})}return r?this.createStripe(o,t,r).confirmCardPayment(i):(await this.getStripe(!0)).handleNextAction({clientSecret:i})})().then((t=>{var r;let n=null;t.paymentIntent?.last_payment_error&&(n={message:t.paymentIntent.last_payment_error.message}),"requires_action"===t.paymentIntent?.status&&(n={message:"Payment requires additional action."});const i=t.paymentIntent&&t.paymentIntent.id||t.setupIntent&&t.setupIntent.id||t.error&&t.error.payment_intent&&t.error.payment_intent.id||t.error.setup_intent&&t.error.setup_intent.id,l=null!==(s="ajax_url",r="object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(s)?wcpayExpressCheckoutParams[s]:null)&&void 0!==r?r:e("ajaxUrl");var s;const u=e("isChangingPayment");return[this.request(l,{action:"update_order_status",order_id:a,_ajax_nonce:c,intent_id:i,should_save_payment_method:o?"true":"false",is_changing_payment:u?"true":"false"}),n,t.error]})).then((([e,t,o])=>{if(o)throw o;return e.then((e=>{const o="string"==typeof e?JSON.parse(e):e;if(o.error)throw o.error;if(t)throw t;return o.return_url}))}))}async setupIntent(t){const o=await this.request(e("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":t,_ajax_nonce:e("createSetupIntentNonce")});if(!o.success)throw o.data.error;if("succeeded"===o.data.status)return o.data;const r=await this.getStripe(),n=await r.confirmCardSetup(o.data.client_secret),{setupIntent:a,error:i}=n;if(i)throw i;return a}initWooPay(t,r){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const n=e("wcAjaxUrl"),a=e("initWooPayNonce");let i=null,c=null;if(e("isWooPayGlobalThemeSupportEnabled"))if(e("isShortcodeCheckout")){const e=document.querySelector(".wp-block-woocommerce-checkout")?"blocks_checkout":document.querySelector(".woocommerce-billing-fields")?"woopay_shortcode_checkout":document.querySelector(".wp-block-woocommerce-cart")?"bnpl_cart_block":document.querySelector(".woocommerce-cart-form")?"bnpl_classic_cart":document.querySelector(".single-product")?"bnpl_product_page":void 0;i=Q(e,!0),c=K()}else i=e("woopayAppearance"),c=e("woopayFontRules");return this.request(o(n,"init_woopay"),{_wpnonce:a,appearance:i,font_rules:c,email:t,user_session:r,order_id:e("order_id"),key:e("key"),billing_email:e("billing_email")}).finally((()=>{this.isWooPayRequesting=!1}))}}expressCheckoutAddToCart(t){const r=e("wcAjaxUrl"),n=e("addToCartNonce");return this.request(o(r,"add_to_cart"),{security:n,...t})}}const Z="wcpay_appearance_";function Y(e){return Z+e}function ee(e,t="",o){for(const r in e){const n=e[r],a=t?t+"["+r+"]":r;"string"==typeof n||"number"==typeof n?o.append(a,n):"object"==typeof n&&ee(n,a,o)}return o}async function te(e,t,o){const r=ee(t,"",new FormData),n=await fetch(e,{method:"POST",body:r,...o});return await n.json()}const oe={bnplProductPage:"bnpl_product_page",bnplClassicCart:"bnpl_classic_cart"},re=async()=>{const{productVariations:e,country:t,locale:o,accountId:r,publishableKey:n,paymentMethods:a,currencyCode:i,isCart:c,cartTotal:l,shouldShowPMME:s}=window.wcpayStripeSiteMessaging;let u,h="bnplProductPage";const d=document.getElementById("payment-method-message");c?(u=parseInt(l,10)||0,h="bnplClassicCart"):(u=parseInt(e.base_product.amount,10)||0,s||d.style.setProperty("display","none"));const p=new X({publishableKey:n,accountId:r,locale:o},te),f={amount:u,currency:i||"USD",paymentMethodTypes:a||[],countryCode:t},m=oe[h],b=window.wcpayStripeSiteMessaging.stylesCacheVersion;let g=function(e,t){try{const o=localStorage.getItem(Y(e));if(!o)return null;const r=JSON.parse(o);if(r?.version===t)return r.appearance}catch{}return null}(m,b);g||(g=Q(m),function(e,t){document.dispatchEvent(new CustomEvent("wcpay_elements_appearance",{detail:{appearance:e,elementsLocation:t}}))}(g,m),function(e,t,o){try{localStorage.setItem(Y(e),JSON.stringify({version:t,appearance:o}))}catch{}}(m,b,g));const y={appearance:g,fonts:K()},w=(await p.getStripe()).elements(y).create("paymentMethodMessaging",f);function _(e,t){const o=e.slice(-2),r=parseFloat(e);switch(o){case"em":return r*t+"px";case"px":return e;default:return"0px"}}w.mount("#payment-method-message");const S=document.querySelector(".price")||document.querySelector(".wp-block-woocommerce-product-price"),k=document.querySelector(".cart_totals .shop_table");if(S||k){const e=S||k,t=window.getComputedStyle(e);let o=t.marginBottom;const r=parseFloat(t.fontSize),n=parseFloat(window.getComputedStyle(document.documentElement).fontSize);let a;o.endsWith("em")?o=_(o,r):o.endsWith("rem")&&(o=_(o,n)),d.style.setProperty("--wc-bnpl-margin-bottom",o),c||(a=document.createElement("div"),a.classList.add("pmme-loading"),d.prepend(a)),w.on("ready",(()=>{if(c){d.classList.add("ready");const e=document.querySelector(".cart-collaterals");if(getComputedStyle(e).getPropertyValue("--wc-bnpl-height").trim())return;const t=document.getElementById("payment-method-message"),r=document.querySelector(".cart_totals .__PrivateStripeElement");setTimeout((()=>{const n=window.getComputedStyle(t),a=parseFloat(n.height),i=parseFloat(o),c=a+i,l=window.getComputedStyle(r),s=parseFloat(l.height);e.style.setProperty("--wc-bnpl-height",c+"px"),e.style.setProperty("--wc-bnpl-container-height",s-12+"px"),e.style.setProperty("--wc-bnpl-loader-margin",i+2+"px"),t.style.setProperty("--wc-bnpl-margin-bottom","-4px")}),2e3)}else a?.remove()}))}return w};jQuery((async function(e){if(!window.wcpayStripeSiteMessaging||window.wcpayStripeSiteMessaging.isCartBlock)return;const{shouldInitializePMME:t}=window.wcpayStripeSiteMessaging;if(!t)return void document.getElementById("payment-method-message").style.setProperty("display","none");const{productVariations:r,productId:n,isCart:a}=window.wcpayStripeSiteMessaging;let i,c;if(!a){const{amount:e,currency:t}=r[n];i=e||0,c=t}const l=e(".quantity input[type=number]"),s=await re(),u=Object.keys(r).length>1,h=e=>{const t=parseInt(e,10);return isNaN(t)?0:t},d=(e,t,o=1)=>{const r=h(e)*h(o);r<=0||!t||s?.update({amount:r,currency:t})},p=()=>{d(i,c,l.val())};l.on("change",(async t=>{let n=i;const a=e('input[name="variation_id"]').val();u&&r.hasOwnProperty(a)&&(n=r[a]?.amount),d(n,c,t.target.value);try{const r=await(l=n*t.target.value,s=c,h=window.wcpayStripeSiteMessaging.country,te(o(window.wcpayStripeSiteMessaging.wcAjaxUrl,"check_bnpl_availability"),{security:window.wcpayStripeSiteMessaging.nonce.is_bnpl_available,price:l,currency:s,country:h}));r.success&&r.data.is_available?e("#payment-method-message").slideDown():e("#payment-method-message").slideUp()}catch{}var l,s,h})),e(document.body).on("updated_cart_totals",(()=>{e("#payment-method-message").before('<div class="pmme-loading"></div>'),e("#payment-method-message").hide(),te(o(window.wcpayStripeSiteMessaging.wcAjaxUrl,"get_cart_total"),{security:window.wcpayStripeSiteMessaging.nonce.get_cart_total}).then((t=>{window.wcpayStripeSiteMessaging.cartTotal=t.total,re().then((()=>{setTimeout((()=>{e(".pmme-loading").remove(),e("#payment-method-message").show(),e("#payment-method-message").addClass("pmme-updated")}),1e3)}))}))})),u&&(e(".single_variation_wrap").on("show_variation",((e,t)=>{r[t.variation_id]&&d(r[t.variation_id].amount,c,l.val())})),e(".variations").on("change",(e=>{""===e.target.value&&p()})),e(".reset_variations").on("click",p))}))})()})();
document.addEventListener("DOMContentLoaded",function(){let n=document.getElementsByClassName("storefront-sticky-add-to-cart");if(n.length&&"undefined"!=typeof storefront_sticky_add_to_cart_params){let s=document.getElementsByClassName(storefront_sticky_add_to_cart_params.trigger_class);if(0<s.length){let t=function(){s[0].getBoundingClientRect().top+s[0].scrollHeight<0?(n[0].classList.add("storefront-sticky-add-to-cart--slideInDown"),n[0].classList.remove("storefront-sticky-add-to-cart--slideOutUp")):n[0].classList.contains("storefront-sticky-add-to-cart--slideInDown")&&(n[0].classList.add("storefront-sticky-add-to-cart--slideOutUp"),n[0].classList.remove("storefront-sticky-add-to-cart--slideInDown"))},e=(t(),window.addEventListener("scroll",function(){t()}),null);var o;document.body.classList.forEach(function(t){"postid-"===t.substring(0,7)&&(e=t.replace(/[^0-9]/g,""))}),!e||!(o=document.getElementById("product-"+e))||o.classList.contains("product-type-simple")||o.classList.contains("product-type-external")||document.getElementsByClassName("storefront-sticky-add-to-cart__content-button")[0].addEventListener("click",function(t){t.preventDefault(),document.getElementById("product-"+e).scrollIntoView()})}}});
(()=>{var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{var t;e.g.importScripts&&(t=e.g.location+"");var r=e.g.document;if(!t&&r&&(r.currentScript&&(t=r.currentScript.src),!t)){var n=r.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.p=window.wcpayAssets.url,(()=>{"use strict";window.wp.domReady;const e=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:t(e),t=e=>{let t=null;if("undefined"!=typeof wcpay_upe_config)t=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;t=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return t[e]||null},r=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,n=(t,n={})=>{var o,a,c;if(!1===(null!==(o=e("isShopperTrackingEnabled"))&&void 0!==o?o:r("is_shopper_tracking_enabled")))return;const i=null!==(a=e("platformTrackerNonce"))&&void 0!==a?a:r("nonce")?.platform_tracker,p=null!==(c=e("ajaxUrl"))&&void 0!==c?c:r("ajax_url"),s=new FormData;s.append("tracksNonce",i),s.append("action","platform_tracks"),s.append("tracksEventName",t),s.append("tracksEventProp",JSON.stringify(n)),fetch(p,{method:"post",body:s}).then((e=>e.json()))};if(window.wcPayFrontendTracks&&window.wcPayFrontendTracks.length){for(const e of window.wcPayFrontendTracks)n(e.event,e.properties);window.wcPayFrontendTracks=[]}})()})();