(()=>{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 n=e.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var o=n.getElementsByTagName("script");if(o.length)for(var r=o.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=o[r--].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 t=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:n(e),n=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="always")=>Object.keys(e).filter((t=>"link"!==t&&e[t].isReusable)).reduce(((e,n)=>(e[n]=t,e)),{}),r=e=>void 0!==e.link&&void 0!==e.card,a=e=>{const t=[e];return"card"===e&&r(n("paymentMethodsConfig"))&&t.push("link"),t},i={address_1:"billing_address_1",address_2:"billing_address_2",city:"billing_city",state:"billing_state",postcode:"billing_postcode",country:"billing_country",first_name:"billing_first_name",last_name:"billing_last_name"},c=e=>{const t="woocommerce_payments";return"card"===e?t:`${t}_${e}`},s=()=>{const e=document.querySelector('input[name="payment_method"][value*="woocommerce_payments"]:checked');return e?e.value.replace("woocommerce_payments_","").replace("woocommerce_payments","")||"card":null},l=e=>{const t={},r=function(e){if(n("cartContainsSubscription"))return!0;const t=document.querySelector(`.wcpay-upe-form[data-payment-method-type="${e}"]`);if(!t)return!1;const o=t.querySelector(`#wc-${c(e)}-new-payment-method`);return o?.checked||!1}(e)?"always":"never";var a;return t.terms=o(n("paymentMethodsConfig"),r),!n("isCheckout")||n("isOrderPay")||n("isChangingPayment")||(t.fields={billingDetails:(a=n("enabledBillingFields"),{name:a.billing_first_name||a.billing_last_name?"never":"auto",email:a.billing_email?"never":"auto",phone:a.billing_phone?"never":"auto",address:{country:a.billing_country?"never":"auto",line1:a.billing_address_1?"never":"auto",line2:a.billing_address_2?"never":"auto",city:a.billing_city?"never":"auto",state:a.billing_state?"never":"auto",postalCode:a.billing_postcode?"never":"auto"}})}),window.wcpayCustomerData&&(t.defaultValues={billingDetails:{name:window.wcpayCustomerData.name,email:window.wcpayCustomerData.email,address:{country:window.wcpayCustomerData.billing_country}}}),t},u=(e,t)=>{e.append(``)},d=e=>{const t=n("paymentMethodsConfig"),o=e.dataset.paymentMethodType,r=t[o].countries,a=s();let i=e?.closest("form.checkout, form#add_payment_method")?.querySelector('[name="billing_country"]');i||(i=document.querySelector("#billing_country"));const c=i?.value||window?.wcpayCustomerData?.billing_country||"",l=e?.closest(".wc_payment_method");if(r.includes(c))l.style.removeProperty("display");else if(l.style.display="none",o===a){const e=document.querySelector('input[name="payment_method"][value="woocommerce_payments"]');e?.click()}},m=window.wp.i18n,p=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],h=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],f=["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"],y={".Label":[...p,...h],".Text":[...p,...h],".Input":[...p,...h,...f],".Error":[...p,...h,...f],".Tab":[...p,...h,...f],".TabIcon":[...p],".TabLabel":[...p,...h],".Block":[...p.slice(1),...f.slice(1)],".Container":[...f],".Header":[...p,...f,...h],".Footer":[...p,...f,...h]},b={".Label":y[".Label"],".Label--floating":[...y[".Label"],"transform"],".Input":[...y[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":y[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",...f],".TabIcon":y[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":y[".TabLabel"],".Block":y[".Block"],".Container":y[".Container"],".Header":y[".Header"],".Footer":y[".Footer"],".Footer--link":y[".Text"],".Text":y[".Text"],".Text--redirect":y[".Text"]};function g(e){return g="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},g(e)}var v=/^\s+/,w=/\s+$/;function _(e,t){if(t=t||{},(e=e||"")instanceof _)return e;if(!(this instanceof _))return new _(e,t);var n=function(e){var t,n,o,r={r:0,g:0,b:0},a=1,i=null,c=null,s=null,l=!1,u=!1;return"string"==typeof e&&(e=function(e){e=e.replace(v,"").replace(w,"").toLowerCase();var t,n=!1;if(N[e])e=N[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=U.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=U.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=U.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=U.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=U.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=U.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=U.hex8.exec(e))?{r:X(t[1]),g:X(t[2]),b:X(t[3]),a:z(t[4]),format:n?"name":"hex8"}:(t=U.hex6.exec(e))?{r:X(t[1]),g:X(t[2]),b:X(t[3]),format:n?"name":"hex"}:(t=U.hex4.exec(e))?{r:X(t[1]+""+t[1]),g:X(t[2]+""+t[2]),b:X(t[3]+""+t[3]),a:z(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=U.hex3.exec(e))&&{r:X(t[1]+""+t[1]),g:X(t[2]+""+t[2]),b:X(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==g(e)&&(Q(e.r)&&Q(e.g)&&Q(e.b)?(t=e.r,n=e.g,o=e.b,r={r:255*H(t,255),g:255*H(n,255),b:255*H(o,255)},l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):Q(e.h)&&Q(e.s)&&Q(e.v)?(i=G(e.s),c=G(e.v),r=function(e,t,n){e=6*H(e,360),t=H(t,100),n=H(n,100);var o=Math.floor(e),r=e-o,a=n*(1-t),i=n*(1-r*t),c=n*(1-(1-r)*t),s=o%6;return{r:255*[n,i,a,a,c,n][s],g:255*[c,n,n,i,a,a][s],b:255*[a,a,c,n,n,i][s]}}(e.h,i,c),l=!0,u="hsv"):Q(e.h)&&Q(e.s)&&Q(e.l)&&(i=G(e.s),s=G(e.l),r=function(e,t,n){var o,r,a;function i(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=H(e,360),t=H(t,100),n=H(n,100),0===t)o=r=a=n;else{var c=n<.5?n*(1+t):n+t-n*t,s=2*n-c;o=i(s,c,e+1/3),r=i(s,c,e),a=i(s,c,e-1/3)}return{r:255*o,g:255*r,b:255*a}}(e.h,i,s),l=!0,u="hsl"),e.hasOwnProperty("a")&&(a=e.a)),a=Z(a),{ok:l,format:e.format||u,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.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=n.ok}function k(e,t,n){e=H(e,255),t=H(t,255),n=H(n,255);var o,r,a=Math.max(e,t,n),i=Math.min(e,t,n),c=(a+i)/2;if(a==i)o=r=0;else{var s=a-i;switch(r=c>.5?s/(2-a-i):s/(a+i),a){case e:o=(t-n)/s+(t>1)+720)%360;--t;)o.h=(o.h+r)%360,a.push(_(o));return a}function j(e,t){t=t||6;for(var n=_(e).toHsv(),o=n.h,r=n.s,a=n.v,i=[],c=1/t;t--;)i.push(_({h:o,s:r,v:a})),a=(a+c)%1;return 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,n,o=this.toRgb();return e=o.r/255,t=o.g/255,n=o.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*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Z(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=S(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=S(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),o=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+o+"%)":"hsva("+t+", "+n+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var e=k(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=k(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),o=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+o+"%)":"hsla("+t+", "+n+"%, "+o+"%, "+this._roundA+")"},toHex:function(e){return C(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,o,r){var a=[B(Math.round(e).toString(16)),B(Math.round(t).toString(16)),B(Math.round(n).toString(16)),B(q(o))];return r&&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*H(this._r,255))+"%",g:Math.round(100*H(this._g,255))+"%",b:Math.round(100*H(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*H(this._r,255))+"%, "+Math.round(100*H(this._g,255))+"%, "+Math.round(100*H(this._b,255))+"%)":"rgba("+Math.round(100*H(this._r,255))+"%, "+Math.round(100*H(this._g,255))+"%, "+Math.round(100*H(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(D[C(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+x(this._r,this._g,this._b,this._a),n=t,o=this._gradientType?"GradientType = 1, ":"";if(e){var r=_(e);n="#"+x(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,o=this._a<1&&this._a>=0;return t||!o||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return _(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(E,arguments)},darken:function(){return this._applyModification(R,arguments)},desaturate:function(){return this._applyModification(F,arguments)},saturate:function(){return this._applyModification(L,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(T,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(V,arguments)},complement:function(){return this._applyCombination(I,arguments)},monochromatic:function(){return this._applyCombination(j,arguments)},splitcomplement:function(){return this._applyCombination(W,arguments)},triad:function(){return this._applyCombination(P,[3])},tetrad:function(){return this._applyCombination(P,[4])}},_.fromRatio=function(e,t){if("object"==g(e)){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]="a"===o?e[o]:G(e[o]));e=n}return _(e,t)},_.equals=function(e,t){return!(!e||!t)&&_(e).toRgbString()==_(t).toRgbString()},_.random=function(){return _.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},_.mix=function(e,t,n){n=0===n?0:n||50;var o=_(e).toRgb(),r=_(t).toRgb(),a=n/100;return _({r:(r.r-o.r)*a+o.r,g:(r.g-o.g)*a+o.g,b:(r.b-o.b)*a+o.b,a:(r.a-o.a)*a+o.a})},_.readability=function(e,t){var n=_(e),o=_(t);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)},_.isReadable=function(e,t,n){var o,r,a,i,c,s=_.readability(e,t);switch(r=!1,(a=n,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(c=(a.size||"small").toLowerCase())&&"large"!==c&&(c="small"),o={level:i,size:c}).level+o.size){case"AAsmall":case"AAAlarge":r=s>=4.5;break;case"AAlarge":r=s>=3;break;case"AAAsmall":r=s>=7}return r},_.mostReadable=function(e,t,n){var o,r,a,i,c=null,s=0;r=(n=n||{}).includeFallbackColors,a=n.level,i=n.size;for(var l=0;ls&&(s=o,c=_(t[l]));return _.isReadable(e,c,{level:a,size:i})||!r?c:(n.includeFallbackColors=!1,_.mostReadable(e,["#fff","#000"],n))};var N=_.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"},D=_.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(N);function Z(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function H(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Y(e){return Math.min(1,Math.max(0,e))}function X(e){return parseInt(e,16)}function B(e){return 1==e.length?"0"+e:""+e}function G(e){return e<=1&&(e=100*e+"%"),e}function q(e){return Math.round(255*parseFloat(e)).toString(16)}function z(e){return X(e)/255}var J,O,$,U=(O="[\\s|\\(]+("+(J="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+J+")[,|\\s]+("+J+")\\s*\\)?",$="[\\s|\\(]+("+J+")[,|\\s]+("+J+")[,|\\s]+("+J+")[,|\\s]+("+J+")\\s*\\)?",{CSS_UNIT:new RegExp(J),rgb:new RegExp("rgb"+O),rgba:new RegExp("rgba"+$),hsl:new RegExp("hsl"+O),hsla:new RegExp("hsla"+$),hsv:new RegExp("hsv"+O),hsva:new RegExp("hsva"+$),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 Q(e){return!!U.CSS_UNIT.exec(e)}const K={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"],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"],linkSelectors:["a"],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"],linkSelectors:["a"],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"],linkSelectors:["a"]},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"],linkSelectors:["a"],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"],linkSelectors:["a"],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"],backgroundSelectors:["#customer_details","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["a"],containerSelectors:[".woocommerce-checkout-review-order-table"],headerSelectors:[".site-header","header > div"],footerSelectors:[".site-footer","footer > div"],footerLink:[".site-footer a","footer a"]},updateSelectors:function(e,t){return e.hasOwnProperty("alternateSelectors")&&(Object.entries(e.alternateSelectors).forEach((n=>{const[o,r]=n;t.querySelector(e[o])||(e[o]=r)})),delete e.alternateSelectors),e},getSelectors:function(e,t){let n=this.blocksCheckout;switch(e){case"blocks_checkout":n=this.blocksCheckout;break;case"shortcode_checkout":n=this.classicCheckout;break;case"bnpl_product_page":n=this.bnplProductPage;break;case"bnpl_classic_cart":n=this.bnplClassicCart;break;case"bnpl_cart_block":n=this.bnplCartBlock;break;case"woopay_shortcode_checkout":n=this.wooPayClassicCheckout}return{...this.default,...this.updateSelectors(n,t)}}},ee={getHiddenContainer:function(e,t){const n=t.createElement("div");return n.setAttribute("id",this.getIDFromSelector(e)),n.style.border=0,n.style.clip="rect(0 0 0 0)",n.style.height="1px",n.style.margin="-1px",n.style.overflow="hidden",n.style.padding="0",n.style.position="absolute",n.style.width="1px",n},createRow:function(e,t=[],n){const o=n.createElement(e);return t.length&&o.classList.add(...t),o},appendClone:function(e,t,n,o){const r=o.querySelector(t);if(r){const t=r.cloneNode(!0);t.id=this.getIDFromSelector(n),t.value="",e.appendChild(t)}},getIDFromSelector:function(e){return e.startsWith("#")||e.startsWith(".")?e.slice(1):e},init:function(e,t){const n=K.getSelectors(e),o=t.querySelector(n.appendTarget),r=t.querySelector(n.upeThemeInputSelector);if(!o||!r)return;t.querySelector(n.hiddenContainer)&&this.cleanup(t);const a=this.getHiddenContainer(n.hiddenContainer,t);o.appendChild(a);const i=this.createRow(n.rowElement,n.validClasses,t);a.appendChild(i);const c=this.createRow(n.rowElement,n.invalidClasses,t);a.appendChild(c),this.appendClone(i,n.upeThemeInputSelector,n.hiddenInput,t),this.appendClone(i,n.upeThemeLabelSelector,n.hiddenValidActiveLabel,t),this.appendClone(c,n.upeThemeInputSelector,n.hiddenInvalidInput,t),this.appendClone(c,n.upeThemeLabelSelector,n.hiddenInvalidInput,t),t.querySelector(n.hiddenInput).style.transition="none"},cleanup:function(e){const t=e.querySelector(K.default.hiddenContainer);t&&t.remove()}},te=(e,t,n=null,o)=>{const r=(Array.isArray(e)?e:[e]).map((e=>o.querySelector(e))).filter(Boolean);if(!r.length)return{};const a=o.defaultView||window,i=b[t],c=r[0],s=a.getComputedStyle(c),l={};if(i.forEach((e=>{const t=e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),n=s.getPropertyValue(t);if(n)if("color"!==e)if("lineHeight"!==e||"0"!==n&&"0px"!==n)l[e]=n;else for(let t=1;t{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 n=t[4]||1;e=`rgb(${t.slice(1,4).map((e=>Math.round(e*n+255*(1-n)))).join(", ")})`}return e})(n)})),".Input"===t||".Tab--selected"===t){const e=((e,t="solid",n)=>e&&n?[e,t,n].join(" "):"")(l.outlineWidth,l.outlineStyle,l.outlineColor);""!==e&&(l.outline=e),delete l.outlineWidth,delete l.outlineColor,delete l.outlineStyle}const u=s.getPropertyValue("text-indent");return"0px"!==u&&"0px"===l.paddingLeft&&"0px"===l.paddingRight&&(l.paddingLeft=u,l.paddingRight=u),".Block"===t&&(l.backgroundColor=n),l},ne=(e=document)=>{const t=[],n=e.styleSheets,o=["fonts.googleapis.com","fonts.gstatic.com","fast.fonts.com","use.typekit.net"];for(let e=0;e{const o=K.getSelectors(e,n);ee.init(e,n);const r=te(o.hiddenInput,".Input",null,n),a=te(o.hiddenInvalidInput,".Input",null,n),i=te(o.upeThemeLabelSelector,".Label",null,n),c={fontSize:i.fontSize},s=te(o.upeThemeTextSelectors,".Text",null,n),l=te(o.upeThemeInputSelector,".Tab",null,n),u=te(o.hiddenInput,".Tab--selected",null,n),d=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const n=((e,t)=>{const n={backgroundColor:e,color:t},o=_(e),r=_(t);if(!o.isValid()||!r.isValid())return{backgroundColor:"",color:""};const a=o.getBrightness()>50?_(o).darken(7):_(o).lighten(7),i=_.mostReadable(a,[r],{includeFallbackColors:!0});return n.backgroundColor=a.toRgbString(),n.color=i.toRgbString(),n})(e.backgroundColor,e.color);return t.backgroundColor=n.backgroundColor,t.color=n.color,t})(l),m={color:d.color},p={color:u.color},h=((e,t=document)=>{let n=null,o=0;for(;!n&&o0&&(n=a),o++}return n||"#ffffff"})(o.backgroundSelectors,n),f=te(o.headingSelectors,".Label",null,n),y=te(o.upeThemeLabelSelector,".Block",h,n),b=te(o.buttonSelectors,".Input",null,n),g=te(o.linkSelectors,".Label",null,n),v=te(o.containerSelectors,".Container",null,n),w=te(o.headerSelectors,".Header",null,n),k=te(o.footerSelectors,".Footer",null,n),S=te(o.footerLink,".Footer--link",null,n),C={colorBackground:h,colorText:s.color,fontFamily:s.fontFamily,fontSizeBase:s.fontSize};o.pmmeRelativeTextSizeSelector&&C.fontSizeBase&&(C.fontSizeBase=function(e,t,n=.875,o){const r=parseFloat(t);if(isNaN(r))return t;const a=o.querySelector(e);if(!a)return r*n+"px";const i=window.getComputedStyle(a).getPropertyValue("font-size"),c=parseFloat(i)*n;return isNaN(c)?t:r>c?`${c}px`:`${r}px`}(o.pmmeRelativeTextSizeSelector,s.fontSize,.875,n));const x="blocks_checkout"===e;let F={variables:C,theme:(L=h,_(L).getBrightness()>125?"stripe":"night"),labels:x?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":r,".Input--invalid":a,".Label":i,".Label--resting":c,".Block":y,".Tab":l,".Tab:hover":d,".Tab--selected":u,".TabIcon:hover":m,".TabIcon--selected":p,".Text":s,".Text--redirect":s}))};var L;return x&&(F=((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 n=t[1].split(", "),o=(parseFloat(n[0])+parseFloat(n[3]))/2,r=parseFloat(e.rules[".Label--floating"].lineHeight),a=Math.floor(r*o);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 n;const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const o=null!==(n=e.rules[".Label"].marginTop)&&void 0!==n?n:"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=o}return e})(F,te(o.hiddenValidActiveLabel,".Label--floating",null,n))),t&&(F.rules={...F.rules,".Heading":f,".Header":w,".Footer":k,".Footer-link":S,".Button":b,".Link":g,".Container":v}),ee.cleanup(n),F},re=(e,t=!1,n=!0,o=null)=>{let r="";r=e.includes("woocommerce-error")?e:'";let a=jQuery(".woocommerce-notices-wrapper, form.checkout");if(a=t?a.first():a.last(),!a.length)return;jQuery(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),a.prepend(''+r+"
"),n&&a.find(".input-text, select, input:checkbox").trigger("validate").blur();let i=jQuery(".woocommerce-NoticeGroup-checkout");i.length||(i=a),jQuery.scroll_to_notices(i),jQuery(document.body).trigger("checkout_error")};var ae=function(){return ae=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&r[r.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]=o+n?(o=a,[4,ue(0)]):[3,3]):[3,4];case 2:i.sent(),i.label=3;case 3:return++r,[3,1];case 4:return[2]}}))}))}function he(e){e.then(void 0,(function(){}))}function fe(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function ye(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function be(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function ge(e,t){return 0==(t%=64)?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=ve(e=ye(e,[4283543511,3981806797]),[0,e[0]>>>1]),ve(e=ye(e,[3301882366,444984403]),[0,e[0]>>>1])}function _e(e){return parseInt(e)}function ke(e){return parseFloat(e)}function Se(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ce(e){return e.reduce((function(e,t){return e+(t?1:0)}),0)}function xe(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function Fe(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function Le(e,t,n){var o=Object.keys(e).filter((function(e){return!function(e,t){for(var n=0,o=e.length;n=4}function Me(){var e=window,t=navigator;return Ce(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Ee(){var e=window,t=navigator;return Ce(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Re(){var e=window;return Ce(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function Te(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ie(){var e=Me(),t=function(){var e,t,n=window;return Ce(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}();if(!e&&!t)return!1;var n=window;return Ce(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function Pe(e){var t=new Error(e);return t.name=e,t}function We(e,t,n){var o,r,a;return void 0===n&&(n=50),ie(this,void 0,void 0,(function(){var i,c;return ce(this,(function(s){switch(s.label){case 0:i=document,s.label=1;case 1:return i.body?[3,3]:[4,ue(n)];case 2:return s.sent(),[3,1];case 3:c=i.createElement("iframe"),s.label=4;case 4:return s.trys.push([4,,10,11]),[4,new Promise((function(e,n){var o=!1,r=function(){o=!0,e()};c.onload=r,c.onerror=function(e){o=!0,n(e)};var a=c.style;a.setProperty("display","block","important"),a.position="absolute",a.top="0",a.left="0",a.visibility="hidden",t&&"srcdoc"in c?c.srcdoc=t:c.src="about:blank",i.body.appendChild(c);var s=function(){var e,t;o||("complete"===(null===(t=null===(e=c.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?r():setTimeout(s,10))};s()}))];case 5:s.sent(),s.label=6;case 6:return(null===(r=null===(o=c.contentWindow)||void 0===o?void 0:o.document)||void 0===r?void 0:r.body)?[3,8]:[4,ue(n)];case 7:return s.sent(),[3,6];case 8:return[4,e(c,c.contentWindow)];case 9:return[2,s.sent()];case 10:return null===(a=c.parentNode)||void 0===a||a.removeChild(c),[7];case 11:return[2]}}))}))}function Ve(e){for(var t=function(e){for(var t,n,o="Unexpected syntax '".concat(e,"'"),r=/^\s*([a-z-]*)(.*)$/i.exec(e),a=r[1]||void 0,i={},c=/([.:#][\w-]+|\[.+?\])/gi,s=function(e,t){i[e]=i[e]||[],i[e].push(t)};;){var l=c.exec(r[2]);if(!l)break;var u=l[0];switch(u[0]){case".":s("class",u.slice(1));break;case"#":s("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(o);s(d[1],null!==(n=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==n?n:"");break;default:throw new Error(o)}}return[a,i]}(e),n=t[0],o=t[1],r=document.createElement(null!=n?n:"div"),a=0,i=Object.keys(o);a.6*n.length}))).sort(),[2,r]}var c}))}))},fontPreferences:function(){return void 0===e&&(e=4e3),We((function(t,n){var o=n.document,r=o.body,a=r.style;a.width="".concat(e,"px"),a.webkitTextSizeAdjust=a.textSizeAdjust="none",Me()?r.style.zoom="".concat(1/n.devicePixelRatio):Ee()&&(r.style.zoom="reset");var i=o.createElement("div");return i.textContent=se([],Array(e/20|0),!0).map((function(){return"word"})).join(" "),r.appendChild(i),function(e,t){for(var n={},o={},r=0,a=Object.keys(et);r');var e},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Ee()&&!Re()&&!function(){var e=window;return Ce(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var n=new t(1,5e3,44100),o=n.createOscillator();o.type="triangle",o.frequency.value=1e4;var r=n.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,o.connect(r),r.connect(n.destination),o.start(0);var a=function(e){var t=function(){};return[new Promise((function(n,o){var r=!1,a=0,i=0;e.oncomplete=function(e){return n(e.renderedBuffer)};var c=function(){setTimeout((function(){return o(Pe("timeout"))}),Math.min(500,i+5e3-Date.now()))},s=function(){try{var t=e.startRendering();switch(de(t)&&he(t),e.state){case"running":i=Date.now(),r&&c();break;case"suspended":document.hidden||a++,r&&a>=3?o(Pe("suspended")):setTimeout(s,500)}}catch(e){o(e)}};s(),t=function(){r||(r=!0,i>0&&c())}})),t]}(n),i=a[0],c=a[1],s=i.then((function(e){return function(e){for(var t=0,n=0;n=3||n.push(t.languages);else if("string"==typeof t.languages){var r=t.languages;r&&n.push(r.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Se(ke(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return Se(_e(e),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n},hardwareConcurrency:function(){return Se(_e(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var n=(new t).resolvedOptions().timeZone;if(n)return n}var o,r=(o=(new Date).getFullYear(),-Math.max(ke(new Date(o,0,1).getTimezoneOffset()),ke(new Date(o,6,1).getTimezoneOffset())));return"UTC".concat(r>=0?"+":"").concat(Math.abs(r))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){var e,t;if(!(Ae()||(e=window,t=navigator,Ce(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Ae())))try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&Ee()&&!Re()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Ce(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],n=0;n>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)}(function(e){for(var t="",n=0,o=Object.keys(e).sort();n=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(le,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,at(n)];case 1:return e.sent(),[2,it(Le(tt,{debug:o},[]),o)]}}))}))},hashComponents:rt,componentsToDebugString:ot};const st=(0,m.__)("An error was encountered when preparing the payment form. Please try again later.","woocommerce-payments");var lt,ut;!function(e){e.AFFIRM="affirm",e.AFTERPAY_CLEARPAY="afterpay_clearpay",e.ALIPAY="alipay",e.AMAZON_PAY="amazon_pay",e.APPLE_PAY="apple_pay",e.AU_BECS_DEBIT="au_becs_debit",e.BANCONTACT="bancontact",e.CARD="card",e.CARD_PRESENT="card_present",e.EPS="eps",e.GIROPAY="giropay",e.GOOGLE_PAY="google_pay",e.GRABPAY="grabpay",e.IDEAL="ideal",e.KLARNA="klarna",e.LINK="link",e.MULTIBANCO="multibanco",e.P24="p24",e.SEPA_DEBIT="sepa_debit",e.SOFORT="sofort",e.WECHAT_PAY="wechat_pay"}(lt||(lt={})),function(e){e.AMEX="amex",e.CARTES_BANCAIRES="cartes_bancaires",e.DINERS="diners",e.DISCOVER="discover",e.JCB="jcb",e.MASTERCARD="mastercard",e.UNIONPAY="unionpay",e.VISA="visa"}(ut||(ut={})),(0,m.__)("ACH Credit Transfer","woocommerce-payments"),(0,m.__)("ACH Debit","woocommerce-payments"),(0,m.__)("ACSS Debit","woocommerce-payments"),(0,m.__)("Amazon Pay","woocommerce-payments"),(0,m.__)("American Express","woocommerce-payments"),(0,m.__)("Card Payment","woocommerce-payments"),(0,m.__)("In-Person Card Payment","woocommerce-payments"),(0,m.__)("Cartes Bancaires","woocommerce-payments"),(0,m.__)("Diners Club","woocommerce-payments"),(0,m.__)("Discover","woocommerce-payments"),(0,m.__)("JCB","woocommerce-payments"),(0,m.__)("Mastercard","woocommerce-payments"),(0,m.__)("Stripe Account","woocommerce-payments"),(0,m.__)("Union Pay","woocommerce-payments"),(0,m.__)("Visa","woocommerce-payments");const dt=lt,mt={};let pt=null;for(const e in n("paymentMethodsConfig"))mt[e]={elements:null,upeElement:null,hasLoadError:!1};async function ht(e){await e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function ft(e){e.removeClass("processing").unblock()}async function yt(e,t,o){try{if(!pt){const{visitorId:e}=await(async()=>{const e=await ct.load({monitoring:!1});if(!e)throw new Error(st);return await e.get()})();pt=e}}catch(e){return void re(e.message)}const i=new Event("wc-credit-card-form-init");document.body.dispatchEvent(i);const c=t.dataset.paymentMethodType;if(!mt[c])return;const s=mt[c].upeElement||await async function(e,t,o){const i=Number(n("cartTotal")),c=a(t),s=await async function(e,t){var o;const r=null!==(o={shortcode_checkout:"upeAppearance",add_payment_method:"upeAddPaymentMethodAppearance"}[t])&&void 0!==o?o:"upeAppearance",a=n(r);return a?Promise.resolve(a):await e.saveUPEAppearance(oe(t),t)}(e,o);document.querySelector(`.wcpay-upe-element[data-payment-method-type="${t}"]`)?.closest(".wc_payment_method")?.classList.add(`theme--${s.theme||"stripe"}`);const u={mode:i<1?"setup":"payment",currency:n("currency").toLowerCase(),amount:i,paymentMethodCreation:"manual",paymentMethodTypes:c,appearance:s,fonts:ne()},d=(await e.getStripeForUPE(t)).elements(u),m=d.create("payment",{...l(t),wallets:{applePay:"never",googlePay:"never",link:r(n("paymentMethodsConfig"))?"auto":"never"}});return mt[t].elements=d,mt[t].upeElement=m,m}(e,c,o);s.mount(t),s.on("loaderror",(e=>{mt[c].hasLoadError=!0,t.style.padding="0";const n=document.createElement("div");n.classList.add("woocommerce-error"),n.innerHTML=e.error.message,n.style.margin="0",t.appendChild(n);const o=t.closest(".payment_box")?.querySelector(".woocommerce-SavedPaymentMethods-saveNew");o&&(o.style.display="none")}))}const bt=({id:e},t,n)=>n.setupIntent(e).then((function(e){!function(e,t){const n=document.createElement("input");n.type="hidden",n.id="wcpay-setup-intent",n.name="wcpay-setup-intent",n.value=t.id,e.append(n)}(t,e)}));let gt;const vt=(e,t,o,r=()=>Promise.resolve())=>{if(!gt)return(async()=>{try{await ht(t);const{elements:a,hasLoadError:c}=mt[o];if(c)throw new Error((0,m.__)("Invalid or missing payment details. Please ensure the provided payment method is correctly entered.","woocommerce-payments"));await function(e){return e.submit().then((e=>{if(e.error)throw new Error(e.error.message)}))}(a);const s=await async function(e,t,o,r){let a={};return window.wcpayCustomerData&&(a={billing_details:{name:wcpayCustomerData.name||void 0,email:wcpayCustomerData.email,address:wcpayCustomerData.address||{country:wcpayCustomerData.billing_country}}}),"checkout"===o.attr("name")&&(a={billing_details:{...a.billing_details,name:`${document.querySelector(`#${i.first_name}`)?.value||""} ${document.querySelector(`#${i.last_name}`)?.value||""}`.trim()||void 0,email:document.querySelector("#billing_email")?.value,phone:document.querySelector("#billing_phone")?.value,address:{...a.billing_details?.address,city:document.querySelector(`#${i.city}`)?.value,country:document.querySelector(`#${i.country}`)?.value,line1:document.querySelector(`#${i.address_1}`)?.value,line2:document.querySelector(`#${i.address_2}`)?.value,postal_code:document.querySelector(`#${i.postcode}`)?.value,state:document.querySelector(`#${i.state}`)?.value}}}),n("isOrderPay")&&function(e,t){if(![dt.AFTERPAY_CLEARPAY,dt.AFFIRM].includes(t))return!1;const n=e?.billing_details?.address;if(!n)return!1;const o=t===dt.AFFIRM?["line1","state","city","postal_code","country"]:["line1","postal_code","country"];for(const e of o)if(""===n[e]||null===n[e]||void 0===n[e])return!0;return t===dt.AFFIRM&&!e.name}(a,r)&&delete a.billing_details.address,(await e.getStripeForUPE(r)).createPaymentMethod({elements:t,params:a})}(e,a,t,o);s.error?(u(t,"woocommerce_payments_payment_method_error"),((e,t)=>{[["wcpay-payment-method-error-code",t.code],["wcpay-payment-method-error-decline-code",t.decline_code],["wcpay-payment-method-error-message",t.message],["wcpay-payment-method-error-type",t.type]].forEach((([t,n])=>{e.append(``)}))})(t,s.error)):u(t,s.paymentMethod.id),((e,t="")=>{e.find('input[name="wcpay-fingerprint"]').remove();const n=``;e.append(n)})(t,pt),(e=>{var t;const n=null!==(t=window.wcpayFraudPreventionToken)&&void 0!==t?t:"";e.append(``)})(t),await r(s.paymentMethod,t,e),gt=!0,t.removeClass("processing").submit()}catch(e){gt=!1,ft(t),re(e.message)}})(),!1;gt=!1},wt="https://cdn.sift.com/s.js",_t="https://js.stripe.com/v3",kt={sift:({beacon_key:e,session_id:t,user_id:n})=>{const o=window._sift=window._sift||[];if(o.push(["_setAccount",e]),o.push(["_setUserId",n]),o.push(["_setSessionId",t]),o.push(["_trackPageview"]),!document.querySelector(`[src="${wt}"]`)){const e=document.createElement("script");e.src=wt,e.async=!0,document.body.appendChild(e)}},stripe:()=>{if(!document.querySelector(`[src^="${_t}"]`)){const e=document.createElement("script");e.src=_t,e.async=!0,document.body.appendChild(e)}}},St=e=>{const n=e.confirmIntent(window.location.href,null!==(o=document.querySelector("#wc-woocommerce_payments-new-payment-method")?.checked)&&void 0!==o&&o);var o;return!0===n?Promise.resolve():(history.replaceState("",document.title,window.location.pathname+window.location.search),n.then((e=>{window.location=e})).catch((e=>{let n=e.message;e instanceof Error&&(n=t("genericErrorMessage")),re(n)})))},Ct=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,xt=(e,t,n="wcpay_")=>e.toString().replace("%%endpoint%%",n+t),Ft=()=>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;class Lt{constructor(e,t){this.options=e,this.stripe=null,this.stripePlatform=null,this.request=t,this.isWooPayRequesting=!1}createStripe(e,t,n="",o=[]){const r={locale:t};return n&&(r.stripeAccount=n),o&&(r.betas=o),new Stripe(e,r)}async getStripeForUPE(e){return this.options.forceNetworkSavedCards=n("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:n,forceNetworkSavedCards:o,locale:r,isStripeLinkEnabled:a}=this.options;if(o&&!e)return this.stripePlatform||(this.stripePlatform=this.createStripe(t,r)),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,r,n,e)}return this.stripe}async loadStripeForExpressCheckout(){try{return this.getStripe(!0)}catch(e){return{error:e}}}confirmIntent(e,n=!1){const o=e.match(/#wcpay-confirm-(pi|si):(.+):(.+):(.+)$/);if(!o)return!0;const r="si"===o[1];let a=o[2];const i=o[3],c=o[4],s=e.indexOf("order-pay"),l=s>-1&&e.substring(s).match(/\d+/);return l&&(a=l[0]),(async()=>{const{locale:e,publishableKey:n}=this.options,o=t("accountIdForIntentConfirmation"),a=await this.getStripe();return r?a.handleNextAction({clientSecret:i}):o?this.createStripe(n,e,o).confirmCardPayment(i):(await this.getStripe(!0)).handleNextAction({clientSecret:i})})().then((e=>{var o;let r=null;e.paymentIntent?.last_payment_error&&(r={message:e.paymentIntent.last_payment_error.message}),"requires_action"===e.paymentIntent?.status&&(r={message:"Payment requires additional action."});const i=e.paymentIntent&&e.paymentIntent.id||e.setupIntent&&e.setupIntent.id||e.error&&e.error.payment_intent&&e.error.payment_intent.id||e.error.setup_intent&&e.error.setup_intent.id,s=null!==(o=Ct("ajax_url"))&&void 0!==o?o:t("ajaxUrl"),l=t("isChangingPayment");return[this.request(s,{action:"update_order_status",order_id:a,_ajax_nonce:c,intent_id:i,should_save_payment_method:n?"true":"false",is_changing_payment:l?"true":"false"}),r,e.error]})).then((([e,t,n])=>{if(n)throw n;return e.then((e=>{const n="string"==typeof e?JSON.parse(e):e;if(n.error)throw n.error;if(t)throw t;return n.return_url}))}))}async setupIntent(e){const n=await this.request(t("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:t("createSetupIntentNonce")});if(!n.success)throw n.data.error;if("succeeded"===n.data.status)return n.data;const o=await this.getStripe(),r=await o.confirmCardSetup(n.data.client_secret),{setupIntent:a,error:i}=r;if(i)throw i;return a}saveUPEAppearance(e,n){return this.request(t("ajaxUrl"),{elements_location:n,appearance:JSON.stringify(e),action:"save_upe_appearance",_ajax_nonce:t("saveUPEAppearanceNonce")}).then((e=>e.data)).catch((e=>{throw e.message?e:new Error(e.statusText)}))}initWooPay(e,n){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const o=t("wcAjaxUrl"),r=t("initWooPayNonce"),a=Ft();return this.request(xt(o,"init_woopay"),{_wpnonce:r,appearance:t("isWooPayGlobalThemeSupportEnabled")?oe(a,!0):null,email:e,user_session:n,order_id:t("order_id"),key:t("key"),billing_email:t("billing_email")}).finally((()=>{this.isWooPayRequesting=!1}))}}expressCheckoutAddToCart(e){const n=t("wcAjaxUrl"),o=t("addToCartNonce");return this.request(xt(n,"add_to_cart"),{security:o,...e})}}function At(e,t="",n){for(const o in e){const r=e[o],a=t?t+"["+o+"]":o;"string"==typeof r||"number"==typeof r?n.append(a,r):"object"==typeof r&&At(r,a,n)}return n}async function Mt(e,t,n){const o=At(t,"",new FormData),r=await fetch(e,{method:"POST",body:o,...n});return await r.json()}window.wp.domReady;const Et=(e,n={})=>{var o,r,a,i;if(!1===(null!==(o=t("isShopperTrackingEnabled"))&&void 0!==o?o:Ct("is_shopper_tracking_enabled")))return;const c=null!==(r=t("platformTrackerNonce"))&&void 0!==r?r:null===(a=Ct("nonce"))||void 0===a?void 0:a.platform_tracker,s=null!==(i=t("ajaxUrl"))&&void 0!==i?i:Ct("ajax_url"),l=new FormData;l.append("tracksNonce",c),l.append("action","platform_tracks"),l.append("tracksEventName",e),l.append("tracksEventProp",JSON.stringify(n)),fetch(s,{method:"post",body:l}).then((e=>e.json()))},Rt=()=>{return e=void 0,n=void 0,r=function*(){var e,n,o;let r=(()=>{const e=document.cookie.split(";");for(let t=0;te?new Promise((t=>{if(document.querySelector(e))return t(document.querySelector(e));const n=document.querySelector('[data-block-name="woocommerce/checkout"]');if(!n)return t(null);new MutationObserver(((n,o)=>{document.querySelector(e)&&(t(document.querySelector(e)),o.disconnect())})).observe(n,{childList:!0,subtree:!0})})):null,It=e=>new RegExp(/^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,}\.?$/i).test(e),Pt=()=>{const e=document.cookie.split(";").find((e=>e.includes("skip_woopay")));if(!e)return!1;const t=e?.split("=");return"skip_woopay"===t[0].trim()&&"1"===t[1].trim()},Wt=()=>{Pt()&&(document.cookie="skip_woopay=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;")};let Vt=null;document.addEventListener("click",(function(e){const t=e.target?.closest(".js-woopayments-copy-test-number");if(!t)return;e.preventDefault();const n=t.querySelector("span").innerText;navigator.clipboard?(navigator.clipboard.writeText(n),window.wp?.data?.dispatch("core/notices")?.createInfoNotice((0,m.__)("Test number copied to your clipboard!","woocommerce-payments"),{id:"woopayments/test-number-copied",type:"snackbar",context:"wc/checkout/payments"}),t.classList.add("state--success"),clearTimeout(Vt),Vt=setTimeout((()=>{t.classList.remove("state--success")}),2e3)):prompt((0,m.__)("Copy the test number:","woocommerce-payments"),n)}),!1);const jt=e.p+"../assets/images/payment-method-icons/visa.svg?ver=fc7cc4d4e752bdf85f3d",Nt=e.p+"../assets/images/payment-method-icons/mastercard.svg?ver=4d62eb12903d72705eba",Dt=e.p+"../assets/images/payment-method-icons/amex.svg?ver=f55d5deea3391ea7797b",Zt=e.p+"../assets/images/payment-method-icons/discover.svg?ver=9c04fa2a8eed50cc729c",Ht=e.p+"../assets/images/cards/jcb.svg?ver=3fc73f04b9db34caa6d9",Yt=e.p+"../assets/images/cards/unionpay.svg?ver=e60ed9d9db08315ff5c9",Xt=e.p+"../assets/images/cards/cartes_bancaires.svg?ver=d30151baf3e66bac2776";jQuery((function(e){(e=>{for(const t in e){const n=kt[t];n&&e[t]&&n(e[t])}})(n("fraudServices"));const a=n("publishableKey");if(!a)return;const l=e("form.checkout"),u=e("form#add_payment_method"),p=e("form#order_review"),h=jQuery(l).add(u).add(p),f=new Lt({publishableKey:a,accountId:n("accountId"),forceNetworkSavedCards:n("forceNetworkSavedCards"),locale:n("locale"),isStripeLinkEnabled:r(n("paymentMethodsConfig"))},Mt);function y(e){const t=s();if(!function(e){const t=document.querySelector(`.wcpay-upe-form[data-payment-method-type="${e}"]`);if(!t)return!1;const n=`wc-${c(e)}-payment-token-new`,o=t.querySelector(`input#${n}`);return!!o&&!o.checked}(t))return vt(f,e,t)}async function b(t){const n=e(".wcpay-upe-form").find(".wcpay-upe-element");if(n.length&&!n.children().length)for(const e of n.toArray())await yt(f,e,t),g(e)}function g(t){if((e=>!!n("paymentMethodsConfig")[e.dataset.paymentMethodType].countries.length)(t)){d(t);const n=t?.closest("form.checkout")?.querySelector(`[name="${i.country}"]`);n&&e(n).on("change",(function(){d(t)}))}}ht(h),St(f).finally((()=>{ft(h)})),e(document.body).on("updated_checkout",(()=>{b("shortcode_checkout"),async function(){const e=document.querySelector('label[for="payment_method_woocommerce_payments"]');if(!e)return;if(e.querySelector(".payment-methods--logos"))return;const t=e.querySelector("img");if(!t)return;const o=document.createElement("div");o.className="payment-methods--logos";const r=document.createElement("div");r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.setAttribute("data-testid","payment-methods-logos");const a=(()=>{const e=[{name:"visa",component:jt},{name:"mastercard",component:Nt},{name:"amex",component:Dt},{name:"discover",component:Zt}],t=[{name:"jcb",component:Ht},{name:"unionpay",component:Yt}];return"FR"===n("storeCountry")&&t.push({name:"cartes_bancaires",component:Xt}),[...e,...t]})();function i(){const e=window.innerWidth;return e>=768&&e<=900?1:3}function c(){return a.length>i()}function s(e,t){const n=t.closest("label");if(!n)return;const o=n.getBoundingClientRect(),r=window.getComputedStyle(n),a=parseInt(r.paddingRight,10);e.style.position="fixed",e.style.right=window.innerWidth-(o.right-a)+"px",e.style.top=o.top-25+"px",e.style.zIndex="1000",e.style.left="auto"}function l(){r.innerHTML="";const t=i(),n=a.slice(0,t),o=a.length-t;if(n.forEach((e=>{const t=document.createElement("img");t.src=e.component,t.alt=e.name,t.width=38,t.height=24,r.appendChild(t)})),c()){const e=document.createElement("div");e.className="payment-methods--logos-count",e.textContent=`+ ${o}`,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),d()})),r.appendChild(e)}const s=e.querySelector(".logo-popover");s&&!c()&&s.remove()}function u(){const t=function(e){const t=document.createElement("div");t.className="logo-popover",t.setAttribute("role","dialog"),t.setAttribute("aria-label","Supported Credit Card Brands"),e.forEach((e=>{const n=document.createElement("img");n.src=e.component,n.alt=e.name,n.width=38,n.height=24,t.appendChild(n)}));const n=Math.min(e.length,5);t.style.gridTemplateColumns=`repeat(${n}, 38px)`;const o=38*n+8*(n-1)+16;return t.style.width=`${o}px`,t}(a.slice(i()));e.appendChild(t),s(t,r);const n=()=>s(t,r);window.addEventListener("resize",n),window.addEventListener("scroll",n);const o={},c=()=>{t.remove(),window.removeEventListener("resize",n),window.removeEventListener("scroll",n),document.removeEventListener("mousedown",o.handleOutsideClick),document.removeEventListener("keydown",o.handleEscapeKey)};o.handleOutsideClick=e=>{t.contains(e.target)||r.contains(e.target)||c()},o.handleEscapeKey=e=>{"Escape"===e.key&&c()},document.addEventListener("mousedown",o.handleOutsideClick),document.addEventListener("keydown",o.handleEscapeKey)}function d(){if(!c())return;const t=e.querySelector(".logo-popover");t?t.remove():u()}r.addEventListener("keydown",(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),d())})),o.appendChild(r),t.replaceWith(o),l(),window.addEventListener("resize",l)}()})),l.on(Object.values(n("paymentMethodsConfig")).map((e=>`checkout_place_order_${e.gatewayId}`)).join(" "),(function(){if(!(()=>{const e=n("enabledBillingFields");if(!`${document.querySelector(`#${i.first_name}`)?.value||""} ${document.querySelector(`#${i.last_name}`)?.value||""}`.trim()&&(e[i.first_name]||e[i.last_name]))return!0;const t=["billing_email",i.country,i.address_1,i.city,i.postcode].filter((t=>e[t])),o=t.includes(i.country)?document.querySelector(`#${i.country}`)?.value:null;return Boolean(t.find((t=>{const n=document.querySelector(`#${t}`);let r=e[t]?.required;const a=function(){try{return JSON.parse(wc_address_i18n_params.locale.replace(/"/g,'"'))}catch(e){return null}}();if(o&&a&&"billing_email"!==t){var i;const e=t.replace("billing_","");r=null!==(i=a[o]?.[e]?.required)&&void 0!==i?i:a.default?.[e]?.required}const c=n?.value;return r&&!c})))})())return y(e(this))})),l.on("click","#place_order",(function(){s()&&Et("checkout_place_order_button_click")})),window.addEventListener("hashchange",(()=>{window.location.hash.startsWith("#wcpay-confirm-")&&(ht(h),St(f).finally((()=>{ft(h)})))})),document.addEventListener("change",(function(e){e.target&&"wc-woocommerce_payments-new-payment-method"===e.target.id&&function(e){const t=e.target.checked?"always":"never",r=s();if(!r)return;const a=mt[r].upeElement;a&&a.update({terms:o(n("paymentMethodsConfig"),t)})}(e)})),u.length&&b("add_payment_method"),p.length&&b("shortcode_checkout"),u.on("submit",(function(){if("woocommerce_payments"===u.find("input:checked[name='payment_method']").val())return e.blockUI.defaults.ignoreIfBlocked=!0,vt(f,u,s(),bt)})),p.on("submit",(function(){if(null!==s())return y(p)})),n("isWooPayEnabled")&&n("isWooPayEmailInputEnabled")&&null===new URLSearchParams(window.location.search).get("customize_messenger_channel")&&!t("isPreview")&&(async(e,n,o=!1)=>{if("true"===window.wcpayConfig?.pay_for_order)return;let r;const a=await Tt(e),i=await Rt();if(!a)return;const c=document.createElement("div"),s=a.parentNode;c.classList.add("wc-block-components-spinner");const l=document.createElement("div");l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true"),l.classList.add("woopay-otp-iframe-wrapper");const u=document.createElement("iframe");u.title=(0,m.__)("WooPay SMS code verification","woocommerce-payments"),u.classList.add("woopay-otp-iframe"),u.classList.add("intrinsic-ignore");const d=document.createElement("span");d.setAttribute("aria-hidden","true"),d.classList.add("arrow");const p=768,h=new URLSearchParams(window.location.search),f=Pt(),y="undefined"!=typeof performance&&"back_forward"===performance.getEntriesByType("navigation")[0].type||"true"===h.get("skip_woopay")||f;if(y&&!f){const e=new Date,t=new Date(e.getTime()+864e5);document.cookie=`skip_woopay=1; path=/; expires=${t.toUTCString()}`}let b=!0;const g=()=>{(p<=window.innerWidth&&b||p>window.innerWidth&&!b)&&(b=!b,u.contentWindow.postMessage({action:"setHeader",value:b},t("woopayHost"))),document.body.style.overflow="hidden"},v=()=>{if(!u)return;if(p>window.innerWidth)return u.style.left="0",void(u.style.right="");if(u.getBoundingClientRect().top<=0||window.innerHeight-(u.getBoundingClientRect().height+u.getBoundingClientRect().top)<=0){const e=50,t=document.documentElement.scrollTop+a.getBoundingClientRect().top-u.getBoundingClientRect().height/2-e;window.scrollTo({top:t})}const e=a.getBoundingClientRect(),t=u.getBoundingClientRect();u.style.top=Math.floor(e.top-t.height/2)+"px",d.style.top=Math.floor(e.top+e.height/2-parseFloat(window.getComputedStyle(d)["border-right-width"]))+"px",window.innerWidth-(e.right+t.width)<=50?(u.style.left="auto",d.style.left="auto",u.style.right="50px",d.style.right=`${t.width+50}px`):(u.style.left=`${e.right+5}px`,u.style.right="",d.style.left=e.right-10+"px",d.style.right="")};u.addEventListener("load",(()=>{b=!0;const e=Ft(),n=(e=>"woopay_shortcode_checkout"===e)(e)&&t("isWooPayGlobalThemeSupportEnabled")?oe(e,!0):null;t("isWoopayFirstPartyAuthEnabled")&&Mt(xt(t("wcAjaxUrl"),"get_woopay_session"),{_ajax_nonce:t("woopaySessionNonce"),order_id:t("order_id"),key:t("key"),billing_email:t("billing_email"),appearance:n}).then((e=>{e?.data?.session&&u.contentWindow.postMessage({action:"setSessionData",value:e},t("woopayHost"))})),g(),window.addEventListener("resize",g),v(),window.addEventListener("resize",v),u.classList.add("open")})),l.insertBefore(d,null),l.insertBefore(u,null);const w=document.createElement("div");w.textContent=(0,m.__)("WooPay is unavailable at this time. Please complete your checkout below. Sorry for the inconvenience.","woocommerce-payments"),w.classList.add("wc-block-checkout__guest-checkout-notice");const _=(e=!0)=>{window.removeEventListener("resize",g),window.removeEventListener("resize",v),l.remove(),u.classList.remove("open"),e&&a.focus(),document.body.style.overflow=""};l.addEventListener("click",_);const k=()=>{(o?s.parentNode:s).insertBefore(w,null)};document.addEventListener("keyup",(e=>{"Escape"===e.key&&_()&&e.stopPropagation()}));const S=new AbortController,{signal:C}=S;C.addEventListener("abort",(()=>{c.remove(),_(!1)})),o?(await Tt("button.wc-block-components-checkout-place-order-button")).addEventListener("click",(()=>{S.abort()})):document.querySelector('form[name="checkout"]').addEventListener("submit",(()=>{S.abort()}));const x=e=>{const t=new CustomEvent("woopayUserCheck",{detail:{isRegisteredUser:e}});window.dispatchEvent(t)},F=async(e,n=!0)=>{s.insertBefore(c,a);const r=o?s.parentNode:s;r.contains(w)&&r.removeChild(w),Et("checkout_email_address_woopay_check"),Mt(xt(t("wcAjaxUrl"),"get_woopay_signature"),{_ajax_nonce:t("woopaySignatureNonce")}).then((e=>{if(e.success)return e.data;throw new Error((0,m.__)("Request for signature failed.","woocommerce-payments"))})).then((e=>{if(e.signature)return e.signature;throw new Error((0,m.__)("Signature not found.","woocommerce-payments"))})).then((n=>{const o=new URLSearchParams;return o.append("email",e),o.append("test_mode",!!t("testMode")),o.append("wcpay_version",t("wcpayVersionNumber")),o.append("blog_id",t("woopayMerchantId")),o.append("request_signature",n),fetch(`${t("woopayHost")}/wp-json/platform-checkout/v1/user/exists?${o.toString()}`,{signal:C})})).then((e=>(200!==e.status&&k(),e.json()))).then((r=>{x(r["user-exists"]),r["user-exists"]?n&&(e=>{if(document.querySelector(".woopay-otp-iframe"))return;const n=window.document.documentElement.clientWidth,r=window.document.documentElement.clientHeight,a=new URLSearchParams;a.append("email",e),a.append("testMode",t("testMode")),a.append("needsHeader",p>window.innerWidth),a.append("wcpayVersion",t("wcpayVersionNumber")),a.append("is_blocks",o?"true":"false"),a.append("source_url",window.wcSettings?.storePages?.checkout?.permalink),a.append("viewport",`${n}x${r}`),i&&a.append("tracksUserIdentity",i),u.src=`${t("woopayHost")}/otp/?${a.toString()}`,s.insertBefore(l,null),v(),u.focus()})(e):"rest_invalid_param"!==r.code&&(Et("checkout_woopay_save_my_info_offered"),window.woopayCheckout?.PRE_CHECK_SAVE_MY_INFO&&Et("checkout_save_my_info_click",{status:"checked"}))})).catch((e=>{window.wcpayConfig.woopayIsCountryAvailable&&"TypeError"===e.name&&k()})).finally((()=>{c.remove()}))};if(a.addEventListener("input",(e=>{const t=e.currentTarget.value;clearTimeout(r),c.remove(),r=setTimeout((()=>{x(!1),It(t)&&F(t)}),500)})),window.addEventListener("message",(e=>{if(t("woopayHost").startsWith(e.origin))switch(e.data.action){case"redirect_to_woopay_skip_session_init":e.data.redirectUrl&&(Wt(),window.location=(e=>{const t=window.wcpayConfig.pay_for_order,n=window.wcpayConfig.order_id,o=window.wcpayConfig.key,r=window.wcpayConfig.billing_email;if(!t||!n||!o)return e;const a=new URL(e);return a.searchParams.append("pay_for_order",t),a.searchParams.append("order_id",n),a.searchParams.append("key",o),a.searchParams.append("billing_email",r),a.href})(e.data.redirectUrl));break;case"redirect_to_platform_checkout":case"redirect_to_woopay":const t=n.initWooPay(a.value,e.data.platformCheckoutUserSession);if(!t)break;t.then((e=>{document.querySelector(".woopay-otp-iframe")&&("success"===e.result?(Wt(),window.location=e.url):(k(),_(!1)))})).catch((()=>{k(),_(!1)}));break;case"otp_validation_failed":break;case"close_modal":_();break;case"iframe_height":if(e.data.height>300)if(p<=window.innerWidth){u.style.height=e.data.height+"px";const t=a.getBoundingClientRect();u.style.top=Math.floor(t.top-e.data.height/2)+"px",d.style.top=Math.floor(t.top+t.height/2-parseFloat(window.getComputedStyle(d)["border-right-width"]))+"px"}else u.style.height="",u.style.top=""}})),window.addEventListener("pageshow",(function(e){e.persisted&&_(!1)})),a.value){const e=a.value;It(e)&&F(e,!1)}if(y){setTimeout((()=>{x(!0)}),2e3),Et("woopay_skipped",{}),h.delete("skip_woopay");let{pathname:e}=window.location;""!==h.toString()&&(e+="?"+h.toString()),history.replaceState(null,null,e),_(!1)}})("#billing_email",f)}))})()})();