(()=>{var e={5338(e,t,o){"use strict";var r=o(5795);t.H=r.createRoot,r.hydrateRoot},1020(e,t,o){"use strict";var r=o(1609),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,o){var r,c={},l=null,u=null;for(r in void 0!==o&&(l=""+o),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!i.hasOwnProperty(r)&&(c[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===c[r]&&(c[r]=t[r]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:s.current}}t.jsx=c,t.jsxs=c},4848(e,t,o){"use strict";e.exports=o(1020)},1609(e){"use strict";e.exports=window.React},5795(e){"use strict";e.exports=window.ReactDOM}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),o.p=window.wcpayAssets.url,(()=>{"use strict";var e=o(5338);const t=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:r(e),r=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},n=window.wp.i18n;var a=o(1609);function s(e){var t,o,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=s(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}const i=function(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=s(e))&&(r&&(r+=" "),r+=t);return r};var c=o(4848);const l=e=>(0,c.jsx)("svg",{viewBox:"0 0 109 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M69.496 5.785v16.42h2.766v-6.179h4.37c1.104 0 2.059-.23 2.865-.689.807-.46 1.424-1.075 1.852-1.846.428-.788.642-1.65.642-2.585 0-.936-.214-1.79-.642-2.56a4.714 4.714 0 0 0-1.852-1.872c-.79-.46-1.745-.69-2.864-.69h-7.137Zm2.766 7.804h4c.56 0 1.054-.107 1.482-.32.445-.23.79-.55 1.037-.96.247-.41.37-.878.37-1.403 0-.526-.123-.993-.37-1.404a2.386 2.386 0 0 0-1.037-.935c-.428-.23-.922-.345-1.482-.345h-4v5.367Zm15.693 8.912c-1.02 0-1.934-.246-2.74-.739-.808-.508-1.441-1.23-1.902-2.166-.445-.936-.667-2.043-.667-3.323 0-1.264.222-2.364.667-3.3.46-.951 1.094-1.682 1.901-2.19.807-.51 1.72-.764 2.741-.764.823 0 1.597.206 2.321.616a4.761 4.761 0 0 1 1.556 1.352v-1.672h2.47v11.89h-2.47v-1.667a5.231 5.231 0 0 1-1.556 1.372 4.695 4.695 0 0 1-2.32.591Zm2.692-9.675c.53.311.924.673 1.185 1.084v4.757c-.26.423-.656.79-1.185 1.101-.642.361-1.3.542-1.976.542-1.053 0-1.893-.37-2.519-1.108-.609-.755-.913-1.731-.913-2.93 0-.787.132-1.485.395-2.092a3.327 3.327 0 0 1 1.21-1.428c.527-.345 1.136-.517 1.827-.517.675 0 1.334.197 1.976.59Zm6.422 11.817c.115.066.271.115.469.148.197.032.395.049.592.049.395 0 .725-.082.988-.246.264-.164.478-.435.642-.813l.625-1.442-4.897-12.024h2.642l3.556 9.035 3.556-9.035h2.667l-5.803 14.106c0 .017-.008.025-.024.025v.05c-.264.607-.585 1.099-.964 1.476a3.337 3.337 0 0 1-1.284.813c-.477.164-1.02.246-1.63.246a6.98 6.98 0 0 1-1.53-.172l.395-2.216ZM39.45 5.512c-4.856 0-8.575 3.614-8.575 8.502 0 4.888 3.743 8.478 8.575 8.478 4.832 0 8.527-3.614 8.551-8.478 0-4.888-3.719-8.502-8.551-8.502Zm0 11.76c-1.824 0-3.08-1.369-3.08-3.258 0-1.89 1.256-3.283 3.08-3.283s3.08 1.394 3.08 3.283-1.233 3.259-3.08 3.259Zm-30.463 5.22c1.919 0 3.458-.945 4.619-3.117l2.582-4.818v4.085c0 2.41 1.563 3.85 3.98 3.85 1.894 0 3.292-.827 4.642-3.117l5.946-10.013c1.302-2.196.378-3.85-2.488-3.85-1.54 0-2.534.496-3.434 2.173l-4.098 7.675V8.535c0-2.03-.971-3.022-2.772-3.022-1.42 0-2.558.614-3.434 2.314l-3.861 7.533V8.606c0-2.172-.9-3.093-3.08-3.093H3.136c-1.682 0-2.534.779-2.534 2.22 0 1.44.9 2.266 2.534 2.266H4.96v8.62c0 2.432 1.634 3.873 4.027 3.873Zm40.221-8.478c0-4.888 3.719-8.502 8.551-8.502 4.832 0 8.551 3.637 8.551 8.502 0 4.864-3.719 8.478-8.55 8.478-4.833 0-8.552-3.59-8.552-8.478Zm5.495 0c0 1.889 1.208 3.259 3.056 3.259 1.824 0 3.08-1.37 3.08-3.26 0-1.888-1.256-3.282-3.08-3.282s-3.056 1.394-3.056 3.283Z",fill:"#fff",...e})});(Object.getOwnPropertyDescriptor(l,"name")||{}).writable||Object.defineProperty(l,"name",{value:"default",configurable:!0});const u=e=>(0,c.jsxs)("svg",{viewBox:"0 0 100 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M63.963 4.435v15.121h2.547v-5.69h4.025c1.016 0 1.895-.212 2.638-.635a4.384 4.384 0 0 0 1.705-1.7 4.906 4.906 0 0 0 .591-2.38c0-.862-.197-1.648-.59-2.358a4.341 4.341 0 0 0-1.706-1.723c-.728-.423-1.607-.635-2.638-.635h-6.572Zm2.547 7.187h3.684c.515 0 .97-.099 1.364-.295.41-.212.728-.506.955-.884.228-.378.341-.809.341-1.292 0-.484-.113-.915-.34-1.293a2.197 2.197 0 0 0-.956-.861c-.394-.212-.849-.318-1.364-.318H66.51v4.943Zm14.451 8.206c-.94 0-1.781-.226-2.524-.68-.743-.468-1.326-1.133-1.75-1.995-.41-.861-.615-1.881-.615-3.06 0-1.164.205-2.177.614-3.038.425-.877 1.008-1.55 1.751-2.018.743-.468 1.584-.703 2.524-.703.758 0 1.47.19 2.138.567a4.384 4.384 0 0 1 1.432 1.245v-1.54h2.274v10.95h-2.274V18.02c-.393.517-.87.938-1.432 1.264a4.323 4.323 0 0 1-2.138.544Zm2.479-8.91c.487.287.851.62 1.091 1v4.38c-.24.39-.604.727-1.091 1.014-.591.332-1.198.499-1.82.499-.97 0-1.743-.34-2.319-1.02-.56-.696-.841-1.595-.841-2.698 0-.726.121-1.368.364-1.927.257-.56.629-.998 1.114-1.315.485-.318 1.046-.476 1.683-.476.621 0 1.228.181 1.819.544Zm5.913 10.883c.107.06.25.106.433.136.181.03.363.045.545.045.364 0 .667-.075.91-.227.243-.15.44-.4.591-.748l.576-1.328-4.51-11.073h2.433l3.275 8.32 3.274-8.32h2.456l-5.344 12.99c0 .016-.007.023-.022.023v.046c-.243.559-.538 1.012-.887 1.36a3.079 3.079 0 0 1-1.183.748c-.44.151-.94.227-1.5.227a6.449 6.449 0 0 1-1.41-.159l.364-2.04Z",fill:"#000",...e}),(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.242 19.82c1.767 0 3.185-.87 4.254-2.871l2.377-4.436v3.762c0 2.218 1.44 3.545 3.665 3.545 1.745 0 3.032-.762 4.275-2.871l5.475-9.22c1.2-2.023.35-3.545-2.29-3.545-1.418 0-2.334.457-3.163 2l-3.774 7.068V6.968c0-1.87-.894-2.784-2.552-2.784-1.308 0-2.355.565-3.162 2.131L9.79 13.252v-6.22c0-2-.829-2.848-2.836-2.848h-4.1c-1.55 0-2.334.718-2.334 2.044 0 1.327.828 2.088 2.334 2.088h1.68v7.937c0 2.24 1.504 3.567 3.707 3.567ZM36.295 4.184c-4.472 0-7.897 3.327-7.897 7.829 0 4.501 3.447 7.807 7.897 7.807s7.852-3.328 7.874-7.807c0-4.502-3.425-7.829-7.874-7.829Zm0 10.83c-1.68 0-2.836-1.262-2.836-3.001 0-1.74 1.156-3.023 2.836-3.023s2.835 1.283 2.835 3.023c0 1.74-1.134 3-2.835 3Zm8.985-3.001c0-4.502 3.425-7.829 7.875-7.829s7.874 3.349 7.874 7.829c0 4.48-3.424 7.807-7.874 7.807-4.45 0-7.875-3.306-7.875-7.807Zm5.061 0c0 1.74 1.112 3 2.814 3 1.68 0 2.835-1.26 2.835-3S54.834 8.99 53.155 8.99c-1.68 0-2.814 1.283-2.814 3.023Z",fill:"#873EFF"})]});function d(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&&d(n,a,o)}return o}async function p(e,t,o){const r=d(t,"",new FormData),n=await fetch(e,{method:"POST",body:r,...o});return await n.json()}(Object.getOwnPropertyDescriptor(u,"name")||{}).writable||Object.defineProperty(u,"name",{value:"default",configurable:!0});const h=(e,o)=>{"wcSettings"in window&&wcSettings.wcBlocksConfig&&"product"!==e?wp.data.dispatch("core/notices")?.createNotice("error",o,{context:`wc/${e}`}):fetch(t("ajaxUrl"),{method:"POST",body:new URLSearchParams({action:"woopay_express_checkout_button_show_error_notice",_ajax_nonce:t("woopayButtonNonce"),context:e,message:o})}).then(e=>e.json()).then(e=>{if(e.success){const t=document.querySelector(".woocommerce-notices-wrapper"),o=document.createElement("div");o.innerHTML=e.data.notice,t.insertBefore(o,null),t.scrollIntoView({behavior:"smooth",block:"center"})}})},m=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,f=(e,t,o="wcpay_")=>e.toString().replace("%%endpoint%%",o+t),g=e=>{const t=window.wcpayConfig.pay_for_order,o=window.wcpayConfig.order_id,r=window.wcpayConfig.key,n=window.wcpayConfig.billing_email;if(!t||!o||!r)return e;const a=new URL(e);return a.searchParams.append("pay_for_order",t),a.searchParams.append("order_id",o),a.searchParams.append("key",r),a.searchParams.append("billing_email",n),a.href},b=()=>{(()=>{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()})()&&(document.cookie="skip_woopay=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;")},y=()=>!!t("isShortcodeCheckout");window.wp.domReady;const w=(e,o={})=>{if(!1===(t("isShopperTrackingEnabled")??m("is_shopper_tracking_enabled")))return;const r=t("platformTrackerNonce")??m("nonce")?.platform_tracker,n=t("ajaxUrl")??m("ajax_url"),a=new FormData;a.append("tracksNonce",r),a.append("action","platform_tracks"),a.append("tracksEventName",e),a.append("tracksEventProp",JSON.stringify(o)),fetch(n,{method:"post",body:a}).then(e=>e.json())},_=async()=>{let e=(()=>{const e=document.cookie.split(";");for(let t=0;t<e.length;t++){let o=e[t];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf("tk_ai="))return o.substring(6,o.length)}})();if(e){const t={_ut:"anon",_ui:e};return JSON.stringify(t)}const o=t("platformTrackerNonce")??m("nonce")?.platform_tracker,r=t("ajaxUrl")??m("ajax_url"),n=new FormData;n.append("tracksNonce",o),n.append("action","get_identity");try{const e=await fetch(r,{method:"post",body:n});if(!e.ok)return;const t=await e.json();return t.success&&t.data&&t.data._ui&&t.data._ut?JSON.stringify(t.data):void 0}catch(e){return}};function v(e){return v="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},v(e)}var k=/^\s+/,S=/\s+$/;function x(e,t){if(t=t||{},(e=e||"")instanceof x)return e;if(!(this instanceof x))return new x(e,t);var o=function(e){var t={r:0,g:0,b:0},o=1,r=null,n=null,a=null,s=!1,i=!1;return"string"==typeof e&&(e=function(e){e=e.replace(k,"").replace(S,"").toLowerCase();var t,o=!1;if($[e])e=$[e],o=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=ee.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=ee.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ee.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=ee.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ee.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=ee.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ee.hex8.exec(e))?{r:Z(t[1]),g:Z(t[2]),b:Z(t[3]),a:G(t[4]),format:o?"name":"hex8"}:(t=ee.hex6.exec(e))?{r:Z(t[1]),g:Z(t[2]),b:Z(t[3]),format:o?"name":"hex"}:(t=ee.hex4.exec(e))?{r:Z(t[1]+""+t[1]),g:Z(t[2]+""+t[2]),b:Z(t[3]+""+t[3]),a:G(t[4]+""+t[4]),format:o?"name":"hex8"}:!!(t=ee.hex3.exec(e))&&{r:Z(t[1]+""+t[1]),g:Z(t[2]+""+t[2]),b:Z(t[3]+""+t[3]),format:o?"name":"hex"}}(e)),"object"==v(e)&&(te(e.r)&&te(e.g)&&te(e.b)?(t=function(e,t,o){return{r:255*z(e,255),g:255*z(t,255),b:255*z(o,255)}}(e.r,e.g,e.b),s=!0,i="%"===String(e.r).substr(-1)?"prgb":"rgb"):te(e.h)&&te(e.s)&&te(e.v)?(r=J(e.s),n=J(e.v),t=function(e,t,o){e=6*z(e,360),t=z(t,100),o=z(o,100);var r=Math.floor(e),n=e-r,a=o*(1-t),s=o*(1-n*t),i=o*(1-(1-n)*t),c=r%6;return{r:255*[o,s,a,a,i,o][c],g:255*[i,o,o,s,a,a][c],b:255*[a,a,i,o,o,s][c]}}(e.h,r,n),s=!0,i="hsv"):te(e.h)&&te(e.s)&&te(e.l)&&(r=J(e.s),a=J(e.l),t=function(e,t,o){var r,n,a;function s(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=z(e,360),t=z(t,100),o=z(o,100),0===t)r=n=a=o;else{var i=o<.5?o*(1+t):o+t-o*t,c=2*o-i;r=s(c,i,e+1/3),n=s(c,i,e),a=s(c,i,e-1/3)}return{r:255*r,g:255*n,b:255*a}}(e.h,r,a),s=!0,i="hsl"),e.hasOwnProperty("a")&&(o=e.a)),o=B(o),{ok:s,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:o}}(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=z(e,255),t=z(t,255),o=z(o,255);var r,n,a=Math.max(e,t,o),s=Math.min(e,t,o),i=(a+s)/2;if(a==s)r=n=0;else{var c=a-s;switch(n=i>.5?c/(2-a-s):c/(a+s),a){case e:r=(t-o)/c+(t<o?6:0);break;case t:r=(o-e)/c+2;break;case o:r=(e-t)/c+4}r/=6}return{h:r,s:n,l:i}}function F(e,t,o){e=z(e,255),t=z(t,255),o=z(o,255);var r,n,a=Math.max(e,t,o),s=Math.min(e,t,o),i=a,c=a-s;if(n=0===a?0:c/a,a==s)r=0;else{switch(a){case e:r=(t-o)/c+(t<o?6:0);break;case t:r=(o-e)/c+2;break;case o:r=(e-t)/c+4}r/=6}return{h:r,s:n,v:i}}function P(e,t,o,r){var n=[V(Math.round(e).toString(16)),V(Math.round(t).toString(16)),V(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 T(e,t,o,r){return[V(K(r)),V(Math.round(e).toString(16)),V(Math.round(t).toString(16)),V(Math.round(o).toString(16))].join("")}function M(e,t){t=0===t?0:t||10;var o=x(e).toHsl();return o.s-=t/100,o.s=U(o.s),x(o)}function E(e,t){t=0===t?0:t||10;var o=x(e).toHsl();return o.s+=t/100,o.s=U(o.s),x(o)}function A(e){return x(e).desaturate(100)}function L(e,t){t=0===t?0:t||10;var o=x(e).toHsl();return o.l+=t/100,o.l=U(o.l),x(o)}function I(e,t){t=0===t?0:t||10;var o=x(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))),x(o)}function R(e,t){t=0===t?0:t||10;var o=x(e).toHsl();return o.l-=t/100,o.l=U(o.l),x(o)}function D(e,t){var o=x(e).toHsl(),r=(o.h+t)%360;return o.h=r<0?360+r:r,x(o)}function W(e){var t=x(e).toHsl();return t.h=(t.h+180)%360,x(t)}function j(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=x(e).toHsl(),r=[x(e)],n=360/t,a=1;a<t;a++)r.push(x({h:(o.h+a*n)%360,s:o.s,l:o.l}));return r}function q(e){var t=x(e).toHsl(),o=t.h;return[x(e),x({h:(o+72)%360,s:t.s,l:t.l}),x({h:(o+216)%360,s:t.s,l:t.l})]}function H(e,t,o){t=t||6,o=o||30;var r=x(e).toHsl(),n=360/o,a=[x(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,a.push(x(r));return a}function N(e,t){t=t||6;for(var o=x(e).toHsv(),r=o.h,n=o.s,a=o.v,s=[],i=1/t;t--;)s.push(x({h:r,s:n,v:a})),a=(a+i)%1;return s}x.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=B(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=F(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=F(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 P(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=[V(Math.round(e).toString(16)),V(Math.round(t).toString(16)),V(Math.round(o).toString(16)),V(K(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*z(this._r,255))+"%",g:Math.round(100*z(this._g,255))+"%",b:Math.round(100*z(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*z(this._r,255))+"%, "+Math.round(100*z(this._g,255))+"%, "+Math.round(100*z(this._b,255))+"%)":"rgba("+Math.round(100*z(this._r,255))+"%, "+Math.round(100*z(this._g,255))+"%, "+Math.round(100*z(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(O[P(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+T(this._r,this._g,this._b,this._a),o=t,r=this._gradientType?"GradientType=1, ":"";if(e){var n=x(e);o="#"+T(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 x(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(L,arguments)},brighten:function(){return this._applyModification(I,arguments)},darken:function(){return this._applyModification(R,arguments)},desaturate:function(){return this._applyModification(M,arguments)},saturate:function(){return this._applyModification(E,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(D,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(H,arguments)},complement:function(){return this._applyCombination(W,arguments)},monochromatic:function(){return this._applyCombination(N,arguments)},splitcomplement:function(){return this._applyCombination(q,arguments)},triad:function(){return this._applyCombination(j,[3])},tetrad:function(){return this._applyCombination(j,[4])}},x.fromRatio=function(e,t){if("object"==v(e)){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]="a"===r?e[r]:J(e[r]));e=o}return x(e,t)},x.equals=function(e,t){return!(!e||!t)&&x(e).toRgbString()==x(t).toRgbString()},x.random=function(){return x.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},x.mix=function(e,t,o){o=0===o?0:o||50;var r=x(e).toRgb(),n=x(t).toRgb(),a=o/100;return x({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})},x.readability=function(e,t){var o=x(e),r=x(t);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},x.isReadable=function(e,t,o){var r,n,a,s,i,c=x.readability(e,t);switch(n=!1,(a=o,"AA"!==(s=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==s&&(s="AA"),"small"!==(i=(a.size||"small").toLowerCase())&&"large"!==i&&(i="small"),r={level:s,size:i}).level+r.size){case"AAsmall":case"AAAlarge":n=c>=4.5;break;case"AAlarge":n=c>=3;break;case"AAAsmall":n=c>=7}return n},x.mostReadable=function(e,t,o){var r,n,a,s,i=null,c=0;n=(o=o||{}).includeFallbackColors,a=o.level,s=o.size;for(var l=0;l<t.length;l++)(r=x.readability(e,t[l]))>c&&(c=r,i=x(t[l]));return x.isReadable(e,i,{level:a,size:s})||!n?i:(o.includeFallbackColors=!1,x.mostReadable(e,["#fff","#000"],o))};var $=x.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"},O=x.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}($);function B(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function z(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 U(e){return Math.min(1,Math.max(0,e))}function Z(e){return parseInt(e,16)}function V(e){return 1==e.length?"0"+e:""+e}function J(e){return e<=1&&(e=100*e+"%"),e}function K(e){return Math.round(255*parseFloat(e)).toString(16)}function G(e){return Z(e)/255}var Q,X,Y,ee=(X="[\\s|\\(]+("+(Q="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?",Y="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?",{CSS_UNIT:new RegExp(Q),rgb:new RegExp("rgb"+X),rgba:new RegExp("rgba"+Y),hsl:new RegExp("hsl"+X),hsla:new RegExp("hsla"+Y),hsv:new RegExp("hsv"+X),hsva:new RegExp("hsva"+Y),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 te(e){return!!ee.CSS_UNIT.exec(e)}const oe=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],re=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],ne=["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"],ae={".Label":[...oe,...re],".Text":[...oe,...re],".Input":[...oe,...re,...ne],".Error":[...oe,...re,...ne],".Tab":[...oe,...re,...ne],".TabIcon":[...oe],".TabLabel":[...oe,...re],".Block":[...oe.slice(1),...ne.slice(1)],".Container":[...ne],".Header":[...oe,...ne,...re],".Footer":[...oe,...ne,...re]},se={".Label":ae[".Label"],".Label--floating":[...ae[".Label"],"transform"],".Input":[...ae[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":ae[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",...ne],".TabIcon":ae[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":ae[".TabLabel"],".Block":ae[".Block"],".Container":ae[".Container"],".Header":ae[".Header"],".Footer":ae[".Footer"],".Footer--link":ae[".Text"],".Text":ae[".Text"],".Text--redirect":ae[".Text"]},ie=(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&&x(a).getAlpha()>=.5&&(o=a),r++}return o||"#ffffff"},ce=e=>{const t=x(e),o=t.getAlpha();if(o<1){const e=t.toRgb();return x({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},le={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)}}},ue={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=le.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 s=this.createRow(o.rowElement,o.validClasses,t);a.appendChild(s);const i=this.createRow(o.rowElement,o.invalidClasses,t);a.appendChild(i),this.appendClone(s,o.upeThemeInputSelector,o.hiddenInput,t),this.appendClone(s,o.upeThemeLabelSelector,o.hiddenValidActiveLabel,t),this.appendClone(i,o.upeThemeInputSelector,o.hiddenInvalidInput,t),this.appendClone(i,o.upeThemeLabelSelector,o.hiddenInvalidInput,t),t.querySelector(o.hiddenInput).style.transition="none"},cleanup:function(e){const t=e.querySelector(le.default.hiddenContainer);t&&t.remove()}},de=(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,s=se[t],i=n[0],c=a.getComputedStyle(i),l={};if(s.forEach(e=>{const t=e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),o=c.getPropertyValue(t);if(o)if("color"!==e)if("lineHeight"!==e||"0"!==o&&"0px"!==o)l[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){l[e]=o;break}}else l[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(" "):"")(l.outlineWidth,l.outlineStyle,l.outlineColor);""!==e&&(l.outline=e),delete l.outlineWidth,delete l.outlineColor,delete l.outlineStyle}const u=c.getPropertyValue("text-indent");return"0px"!==u&&"0px"===l.paddingLeft&&"0px"===l.paddingRight&&(l.paddingLeft=u,l.paddingRight=u),".Block"===t&&(l.backgroundColor=o),l},pe=(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},he={blocks_checkout:"woopay_blocks_checkout",shortcode_checkout:"woopay_shortcode_checkout"},me=(e,t=!1,o=document)=>{const r=t?he[e]??e:e,n=le.getSelectors(r,o);ue.init(r,o);const a=de(n.hiddenInput,".Input",null,o),s=de(n.hiddenInvalidInput,".Input",null,o),i=de(n.upeThemeLabelSelector,".Label",null,o),c={fontSize:i.fontSize},l=de(n.upeThemeTextSelectors,".Text",null,o),u=de(n.upeThemeInputSelector,".Tab",null,o),d=de(n.hiddenInput,".Tab--selected",null,o),p=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const o=((e,t)=>{const o={backgroundColor:e,color:t},r=x(e),n=x(t);if(!r.isValid()||!n.isValid())return{backgroundColor:"",color:""};const a=r.getBrightness()>50?x(r).darken(7):x(r).lighten(7),s=x.mostReadable(a,[n],{includeFallbackColors:!0});return o.backgroundColor=a.toRgbString(),o.color=s.toRgbString(),o})(e.backgroundColor,e.color);return t.backgroundColor=o.backgroundColor,t.color=o.color,t})(u),h={color:p.color},m={color:d.color},f=ie(n.backgroundSelectors,o),g=de(n.upeThemeLabelSelector,".Block",f,o),b={colorBackground:f,colorText:l.color,fontFamily:l.fontFamily,fontSizeBase:l.fontSize};n.pmmeRelativeTextSizeSelector&&b.fontSizeBase&&(b.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 s=window.getComputedStyle(a).getPropertyValue("font-size"),i=parseFloat(s)*o;return isNaN(i)?t:n>i?`${i}px`:`${n}px`}(n.pmmeRelativeTextSizeSelector,l.fontSize,.875,o));const y="blocks_checkout"===e||"woopay_blocks_checkout"===r;let w={variables:b,theme:ce(f)?"stripe":"night",labels:y?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":a,".Input--invalid":s,".Label":i,".Label--resting":c,".Block":g,".Tab":u,".Tab:hover":p,".Tab--selected":d,".TabIcon:hover":h,".TabIcon--selected":m,".Text":l,".Text--redirect":l}))};if(y&&(w=((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){const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const o=e.rules[".Label"].marginTop??"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=o}return e})(w,de(n.hiddenValidActiveLabel,".Label--floating",null,o))),t){const e=de(n.headerSelectors,".Header",null,o),t=de(n.footerSelectors,".Footer",null,o);(!e.backgroundColor||x(e.backgroundColor).getAlpha()<.5)&&(e.backgroundColor=ie([...n.headerSelectors??[],"body"],o)),(!t.backgroundColor||x(t.backgroundColor).getAlpha()<.5)&&(t.backgroundColor=ie([...n.footerSelectors??[],"body"],o)),w.rules={...w.rules,".Heading":de(n.headingSelectors,".Label",null,o),".Header":e,".Footer":t,".Footer-link":de(n.footerLink,".Footer--link",null,o),".Button":de(n.buttonSelectors,".Input",null,o),".Link":de(n.linkSelectors,".Label",null,o),".Container":de(n.containerSelectors,".Container",null,o)}}return ue.cleanup(o),w},fe=()=>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,ge=(e,t,o="appearance")=>{Object.entries(t).forEach(([t,r])=>{const n=`${o}[${t}]`;null!=r&&(r&&"object"==typeof r&&!Array.isArray(r)?ge(e,r,n):e.append(n,r))})};let be=!1;function ye(){const e=fe();if(!(e=>["woopay_shortcode_checkout","woopay_blocks_checkout","blocks_checkout","bnpl_product_page","bnpl_classic_cart","bnpl_cart_block"].includes(e))(e)||!t("isWooPayGlobalThemeSupportEnabled"))return null;const o=t("woopayAppearance");if(o)return o;if(y()){const o=me(e,!0);return(e=>{if(be||!e)return;be=!0;const o=t("wcAjaxUrl");if(!o)return;const r=f(o,"shopper_set_woopay_appearance"),n=pe(),a=new FormData;a.append("_ajax_nonce",t("woopaySessionNonce")),ge(a,e),a.append("font_rules",JSON.stringify(n)),fetch(r,{method:"POST",body:a,credentials:"same-origin"}).catch(()=>{})})(o),o}return null}const we=async(e,o,r)=>{const a=await _();let s="";const i=document.body,c=document.createElement("div");c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.classList.add("woopay-otp-iframe-wrapper");const l=document.createElement("iframe");l.title=(0,n.__)("WooPay SMS code verification","woocommerce-payments"),l.classList.add("woopay-otp-iframe"),l.classList.add("intrinsic-ignore");const u=768;let d=!0;const m=()=>{(u<=window.innerWidth&&d||u>window.innerWidth&&!d)&&(d=!d,l.contentWindow.postMessage({action:"setHeader",value:d},t("woopayHost"))),document.body.style.overflow="hidden"},b=()=>{if(!l)return;if(u>window.innerWidth)return l.style.left="0",l.style.right="",void(l.style.top="0");const e=l.getBoundingClientRect();l.style.top=Math.floor(window.innerHeight/2-e.height/2)+"px",l.style.left=Math.floor(window.innerWidth/2-e.width/2)+"px"};l.addEventListener("load",()=>{d=!0;const e=ye();t("isWoopayFirstPartyAuthEnabled")&&p(f(t("wcAjaxUrl"),"get_woopay_session"),{_ajax_nonce:t("woopaySessionNonce"),order_id:t("order_id"),key:t("key"),billing_email:t("billing_email"),appearance:e}).then(e=>{e?.data?.session&&l.contentWindow.postMessage({action:"setSessionData",value:e},t("woopayHost"))}),m(),window.addEventListener("resize",m),b(),window.addEventListener("resize",b),l.classList.add("open")}),c.insertBefore(l,null);const y=()=>{window.removeEventListener("resize",m),window.removeEventListener("resize",b),window.removeEventListener("pageshow",v),window.removeEventListener("message",w),document.removeEventListener("keyup",k),c.remove(),l.classList.remove("open"),document.body.style.overflow=""};function w(r){if(r.origin===new URL(t("woopayHost")).origin)switch(r.data.action){case"otp_email_submitted":s=r.data.userEmail;break;case"redirect_to_woopay_skip_session_init":r.data.redirectUrl&&(window.location=g(r.data.redirectUrl));break;case"redirect_to_platform_checkout":case"redirect_to_woopay":e.initWooPay(s||r.data.userEmail,r.data.platformCheckoutUserSession).then(e=>{if(document.querySelector(".woopay-otp-iframe"))if("success"===e.result)window.location=g(e.url);else{const e=(0,n.__)("WooPay is unavailable at this time. Sorry for the inconvenience.","woocommerce-payments");h(o,e),y()}});break;case"otp_validation_failed":break;case"close_modal":y();break;case"iframe_height":r.data.height>300&&(u<=window.innerWidth?(l.style.height=r.data.height+"px",l.style.top=Math.floor(window.innerHeight/2-r.data.height/2)+"px"):(l.style.height="",l.style.top=""))}}function v(e){e.persisted&&y()}function k(e){"Escape"===e.key&&y()&&e.stopPropagation()}c.addEventListener("click",y),((e="")=>{if(document.querySelector(".woopay-otp-iframe"))return;window.addEventListener("pageshow",v),window.addEventListener("message",w),document.addEventListener("keyup",k);const r=window.document.documentElement.clientWidth,n=window.document.documentElement.clientHeight,d=new URLSearchParams;var p;d.append("testMode",t("testMode")),d.append("needsHeader",u>window.innerWidth),d.append("wcpayVersion",t("wcpayVersionNumber")),e&&(p=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(p))&&(s=e,d.append("email",e)),d.append("is_blocks",!!window.wcSettings?.wcBlocksConfig),d.append("is_express","true"),d.append("express_context",o),d.append("source_url",window.location.href),d.append("viewport",`${r}x${n}`),a&&d.append("tracksUserIdentity",a),l.src=`${t("woopayHost")}/otp/?${d.toString()}`,i.insertBefore(c,null),b(),l.focus()})(await(async e=>{if("true"===window.wcpayConfig?.pay_for_order)return window.wcpayCustomerData?.email;const t=await(o=e,o?new Promise(e=>{if(document.querySelector(o))return e(document.querySelector(o));const t=document.querySelector('[data-block-name="woocommerce/checkout"]');if(!t)return e(null);new MutationObserver((t,r)=>{document.querySelector(o)&&(e(document.querySelector(o)),r.disconnect())}).observe(t,{childList:!0,subtree:!0})}):null);var o;return t?.value})(r)||t("woopaySessionEmail"))},_e=()=>{const e=document.querySelector(".quantity .qty");return e&&parseInt(e.value,10)||1},ve=e=>e.length<=254&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/.test(e),ke=()=>document.querySelector("form.cart")||document.querySelector("form.wp-block-add-to-cart-with-options");function Se(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function xe(e,t){let o,r,n=[];for(let a=0;a<e.length;a++){const s=e[a];if("string"!==s.type){if(void 0===t[s.value])throw new Error(`Invalid interpolation, missing component node: \`${s.value}\``);if("object"!=typeof t[s.value])throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${s.value}\``);if("componentClose"===s.type)throw new Error(`Missing opening component token: \`${s.value}\``);if("componentOpen"===s.type){o=t[s.value],r=a;break}n.push(t[s.value])}else n.push(s.value)}if(o){const s=function(e,t){const o=t[e];let r=0;for(let n=e+1;n<t.length;n++){const e=t[n];if(e.value===o.value){if("componentOpen"===e.type){r++;continue}if("componentClose"===e.type){if(0===r)return n;r--}}}throw new Error("Missing closing component token `"+o.value+"`")}(r,e),i=xe(e.slice(r+1,s),t),c=(0,a.cloneElement)(o,{},i);if(n.push(c),s<e.length-1){const o=xe(e.slice(s+1),t);n=n.concat(o)}}return n=n.filter(Boolean),0===n.length?null:1===n.length?n[0]:(0,a.createElement)(a.Fragment,null,...n)}function Ce(e){const{mixedString:t,components:o,throwErrors:r}=e;if(!o)return t;if("object"!=typeof o){if(r)throw new Error(`Interpolation Error: unable to process \`${t}\` because components is not an object`);return t}const n=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(Se)}(t);try{return xe(n,o)}catch(e){if(r)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}function Fe(e){window.WooPayConnect||(window.WooPayConnect={}),window.WooPayConnect.iframeInjectedState=e}function Pe(){return window?.WooPayConnect?.postMessageTimeout||5e3}const Te=()=>{const e=(0,a.useRef)(),[o,r]=(0,a.useState)("");return(0,a.useEffect)(()=>{(async()=>{const e=t("testMode"),o=t("woopayHost"),n=t("woopayMerchantId"),a=new URLSearchParams({testMode:e,source_url:window.location.href,blogId:n}),s=await _();s&&a.append("tracksUserIdentity",s),r(`${o}/connect/?${a.toString()}`)})()},[]),(0,a.useEffect)(()=>{if(!o||!e.current)return;const r=e.current,n=()=>{Fe(2),window.dispatchEvent(new MessageEvent("message",{source:window,origin:t("woopayHost"),data:{action:"get_iframe_post_message_success",value:e=>r.contentWindow.postMessage(e,t("woopayHost"))}}))};return r.addEventListener("load",n),()=>{r.removeEventListener("load",n)}},[o]),o?(0,c.jsx)("iframe",{ref:e,id:"woopay-connect-iframe",src:o,style:{height:0,width:0,border:"none",margin:0,padding:0,overflow:"hidden",display:"block",visibility:"hidden",position:"fixed",pointerEvents:"none",userSelect:"none"},title:(0,n.__)("WooPay Connect Direct Checkout","woocommerce-payments")}):null},Me=class{iframePostMessage=null;listeners={};constructor(){this.listeners={getIframePostMessageCallback:()=>{},getPostMessageTimeoutCallback:()=>{}},this.removeMessageListener=this.attachMessageListener(),this.injectWooPayConnectIframe()}attachMessageListener(){const e=e=>{const o=new URL(t("woopayHost")).origin;e.origin===o&&this.callbackFn(e.data)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}detachMessageListener(){"function"==typeof this.removeMessageListener&&this.removeMessageListener()}injectWooPayConnectIframe(){const o=window?.WooPayConnect?.iframeInjectedState||0;if(2===o){const e=document.querySelector("#woopay-connect-iframe");return void(e&&(this.iframePostMessage=Promise.resolve(o=>{e.contentWindow.postMessage(o,t("woopayHost"))})))}if(1===o)return void(this.iframePostMessage=new Promise(e=>{this.listeners.getIframePostMessageCallback=e}));Fe(1);const r=document.createElement("div");r.style.visibility="hidden",r.style.position="fixed",r.style.height="0",r.style.width="0",r.style.bottom="0",r.style.right="0",r.id="woopay-connect-iframe-container",document.body.appendChild(r);const n=this;this.iframePostMessage=new Promise(e=>{n.listeners.getIframePostMessageCallback=e}),(0,e.H)(r).render((0,c.jsx)(Te,{}))}injectTemporaryWooPayConnectIframe(){let e;const o=new Promise(t=>{e=t}),r=document.createElement("iframe");return r.id="temp-woopay-connect-iframe",r.src=t("woopayHost")+"/connect/",r.height=0,r.width=0,r.border="none",r.margin=0,r.padding=0,r.overflow="hidden",r.display="block",r.visibility="hidden",r.position="fixed",r.pointerEvents="none",r.userSelect="none",r.addEventListener("load",()=>{e(e=>r.contentWindow.postMessage(e,t("woopayHost")))}),document.body.appendChild(r),{resolvePostMessagePromise:o,removeTemporaryIframe:()=>{document.body.removeChild(r)}}}async sendMessageAndListenWith(e,t){const o=new Promise((e,o)=>{let r=!1;const n=setTimeout(()=>{r=!0,o(new Error("WooPayConnectIframe did not respond within the allotted time."))},Pe());this.listeners[t]=t=>{r||(n&&clearTimeout(n),e(t))}});if("function"!=typeof this.iframePostMessage?.then)throw new Error("iframePostMessage is not set");return(await this.iframePostMessage)(e),await o}async getPostMessageTimeout(){try{return await this.sendMessageAndListenWith({action:"getPostMessageTimeout"},"getPostMessageTimeoutCallback")}catch(e){return null}}callbackFn(e){switch(e.action){case"get_iframe_post_message_success":this.listeners.getIframePostMessageCallback(e.value);break;case"get_post_message_timeout_success":this.listeners.getPostMessageTimeoutCallback(e.value)}}},Ee=class extends Me{constructor(){super(),this.listeners={...this.listeners,setRedirectSessionDataCallback:()=>{},setTempThirdPartyCookieCallback:()=>{},getIsWooPayReachableCallback:()=>{},getIsThirdPartyCookiesEnabledCallback:()=>{},setPreemptiveSessionDataCallback:()=>{}}}async isWooPayThirdPartyCookiesEnabled(){const{resolvePostMessagePromise:e,removeTemporaryIframe:t}=this.injectTemporaryWooPayConnectIframe(),o=new Promise((e,t)=>{let o=!1;const r=setTimeout(()=>{o=!0,t(new Error("WooPayConnectIframe did not respond within the allotted time."))},Pe());this.listeners.setTempThirdPartyCookieCallback=t=>{o||(r&&clearTimeout(r),e(t))}});if("function"!=typeof e?.then)return!1;const r=await e;r({action:"setTempThirdPartyCookie"});try{if(!await o)return t(),!1}catch(e){return t(),!1}const n=new Promise((e,t)=>{let o=!1;const r=setTimeout(()=>{o=!0,t(new Error("WooPayConnectIframe did not respond within the allotted time."))},Pe());this.listeners.getIsThirdPartyCookiesEnabledCallback=t=>{o||(r&&clearTimeout(r),e(t))}});r({action:"getIsThirdPartyCookiesEnabled"});try{return await n}catch(e){return!1}finally{t()}}async sendRedirectSessionDataToWooPay(e){try{return await super.sendMessageAndListenWith({action:"setRedirectSessionData",value:e},"setRedirectSessionDataCallback")}catch(e){return null}}async setPreemptiveSessionData(e){try{return await super.sendMessageAndListenWith({action:"setPreemptiveSessionData",value:e},"setPreemptiveSessionDataCallback")}catch(e){return null}}async isWooPayReachable(){try{return await this.sendMessageAndListenWith({action:"isWooPayReachable"},"getIsWooPayReachableCallback")}catch(e){return!1}}callbackFn(e){switch(super.callbackFn(e),e.action){case"set_redirect_session_data_success":this.listeners.setRedirectSessionDataCallback(e.value);break;case"set_redirect_session_data_error":this.listeners.setRedirectSessionDataCallback({is_error:!0});break;case"set_temp_third_party_cookie_success":this.listeners.setTempThirdPartyCookieCallback(e.value);break;case"get_is_third_party_cookies_enabled_success":this.listeners.getIsThirdPartyCookiesEnabledCallback(e.value);break;case"get_is_woopay_reachable_success":this.listeners.getIsWooPayReachableCallback(e.value);break;case"set_preemptive_session_data_success":this.listeners.setPreemptiveSessionDataCallback(e.value);break;case"set_preemptive_session_data_error":this.listeners.setPreemptiveSessionDataCallback({is_error:!0})}}},Ae=class{static sessionConnect;static init(){this.getSessionConnect()}static getSessionConnect(){return this.sessionConnect||(this.sessionConnect=new Ee),this.sessionConnect}static async sendPreemptiveSessionDataToWooPay(e){return this.getSessionConnect().setPreemptiveSessionData(e)}static async getWooPaySessionFromMerchant(e){return p(f(t("wcAjaxUrl"),"get_woopay_session"),e)}},Le=[{name:"visa",component:o.p+"../assets/images/woopay-icons/visa.svg?ver=f5bbd888ace13f417388"},{name:"mastercard",component:o.p+"../assets/images/woopay-icons/mastercard.svg?ver=8ab106cb89511adbee3f"},{name:"amex",component:o.p+"../assets/images/woopay-icons/amex.svg?ver=b3759ac719253585e1f5"},{name:"discover",component:o.p+"../assets/images/woopay-icons/discover.svg?ver=ee7a3994c1ff74d84cd1"},{name:"jcb",component:o.p+"../assets/images/woopay-icons/jcb.svg?ver=6fe07259ab8049d5e4f6"},{name:"unionpay",component:o.p+"../assets/images/woopay-icons/unionpay.svg?ver=4ab40d7a676538ea7614"},{name:"diners",component:o.p+"../assets/images/woopay-icons/diners.svg?ver=5399061f43c9e99c93f3"}],Ie="woopay_preferred_card",Re=/^\d{4}$/,De={american_express:"amex",diners_club:"diners",union_pay:"unionpay"},We=e=>{if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.brand&&t.brand.length>0&&"string"==typeof t.last4&&Re.test(t.last4)},je={visa:(0,n.__)("Visa","woocommerce-payments"),mastercard:(0,n.__)("Mastercard","woocommerce-payments"),amex:(0,n.__)("American Express","woocommerce-payments"),discover:(0,n.__)("Discover","woocommerce-payments"),jcb:(0,n.__)("JCB","woocommerce-payments"),unionpay:(0,n.__)("UnionPay","woocommerce-payments"),diners:(0,n.__)("Diners Club","woocommerce-payments"),cartes_bancaires:(0,n.__)("Cartes Bancaires","woocommerce-payments")},qe={default:(0,n.__)("WooPay","woocommerce-payments"),buy:(0,n.__)("Buy with WooPay","woocommerce-payments"),donate:(0,n.__)("Donate with WooPay","woocommerce-payments"),book:(0,n.__)("Book with WooPay","woocommerce-payments")},He=({listenForCartChanges:e,isPreview:o=!1,buttonSettings:r,api:s,isProductPage:d=!1,emailSelector:p="#email",buttonAttributes:m,preferredCard:f=null})=>{const y=(0,a.useRef)(null),_=(0,a.useRef)(null),v=(0,a.useRef)(!1);let{height:k,type:S,theme:x,context:C,radius:F}=r;const[P,T]=(0,a.useState)(!1),[M,E]=(0,a.useState)(null),A=new Map;A.set("40","small"),A.set("48","medium"),A.set("55","large"),void 0!==m&&(k=m.height||k,F=m.borderRadius??F);const L=A.get(k?.toString())||"medium",I=qe[S||"default"]??qe.default,R="dark"===x?l:u,D=t("isWoopayFirstPartyAuthEnabled"),W=t("woopayHost")+"/woopay/",{addToCart:j,getProductData:q}=(e=>({addToCart:t=>e.expressCheckoutAddToCart(t),getProductData:()=>{const e=(()=>{const e=document.querySelector(".single_add_to_cart_button");if(e)return e.value;const t=document.querySelector('.wp-block-add-to-cart-with-options input[name="add-to-cart"]');return t?.value})();if(!e)return!1;const t=document.querySelector(".bundle_form"),o=document.querySelector(".single_variation_wrap");let r={product_id:e,quantity:_e()};if(o&&!t)r.product_id=o.querySelector('input[name="product_id"]').value,r.attributes=document.querySelector(".variations_form")?(()=>{const e=document.querySelector(".variations_form")?.querySelectorAll(".variations select"),t={};return e&&e.forEach(e=>{const o=e.name,r=e.value||"";t[o]=r}),t})():[];else{const e=ke();if(e){const t=new FormData(e);t.delete("add-to-cart");const o={};for(const e of t.entries())o[e[0]]=e[1];r={...r,...o}}}const a=ke();return!(a&&(new FormData(a).forEach((e,t)=>{if(/^(addon-|wc_)/.test(t))if(/\[\]$/.test(t)){const o=t.substring(0,t.length-2);r[o]?r[o].push(e):r[o]=[e]}else r[t]=e}),!(e=>{const t=["wc_gc_giftcard_to","wc_gc_giftcard_from","wc_gc_giftcard_to_multiple"];for(const o of t)if(e.hasOwnProperty(o)&&!e[o])return alert((0,n.__)("Please fill out all required fields","woocommerce-payments")),!1;return e.hasOwnProperty("wc_gc_giftcard_to_multiple")&&!e.wc_gc_giftcard_to_multiple.split(",").every(e=>ve(e.trim()))?(alert((0,n.__)("Please type only valid emails","woocommerce-payments")),!1):!(e.hasOwnProperty("wc_gc_giftcard_to")&&!ve(e.wc_gc_giftcard_to)&&(alert((0,n.__)("Please type only valid emails","woocommerce-payments")),1))})(r)))&&r}}))(s),H=(0,a.useRef)(q),N=(0,a.useRef)(j);(0,a.useEffect)(()=>{_.current&&E(_.current.getBoundingClientRect().width)},[]),(0,a.useEffect)(()=>{o||w("woopay_button_load",{source:C})},[o,C]);const $=(0,a.useCallback)(()=>{if(!d)return!0;const e=document.querySelector(".single_add_to_cart_button")||document.querySelector('.wp-block-add-to-cart-with-options button[type="submit"]');return!e||!e.disabled&&!e.classList.contains("disabled")||(e.classList.contains("wc-variation-is-unavailable")?window.alert(window?.wc_add_to_cart_variation_params?.i18n_unavailable_text||(0,n.__)("Sorry, this product is unavailable. Please choose a different combination.","woocommerce-payments")):window.alert((0,n.__)("Please select your product options before proceeding.","woocommerce-payments")),!1)},[d]),O=(0,a.useCallback)(e=>{if(e?.preventDefault(),!o&&(w("woopay_button_click",{source:C}),b(),$()))if(d){const e=H.current();if(!e)return;N.current(e).then(e=>{e.error?e.submit&&ke()?.submit():we(s,C,p)})}else we(s,C,p)},[s,C,p,o,d,$]),B=(0,a.useCallback)(r=>{if(r.preventDefault(),o||v.current)return;if(w("woopay_button_click",{source:C}),b(),!$())return;v.current=!0,T(!0);const a=ye();if(d){const o=H.current();if(!o)return;"function"==typeof e?.stop&&e.stop(),N.current(o).then(()=>{"function"==typeof e?.start&&e.start(),Ae.getWooPaySessionFromMerchant({_ajax_nonce:t("woopaySessionNonce"),appearance:a}).then(async e=>{if(!e?.blog_id||!e?.data?.session)throw y.current=O,new Error(e?.data);{const t=await Ae.sendPreemptiveSessionDataToWooPay(e);if(t?.is_error)return O(null),y.current=O,v.current=!1,void T(!1);window.location.href=g(t.redirect_url)}}).catch(()=>{const e=(0,n.__)("Something went wrong. Please try again.","woocommerce-payments");h(C,e),v.current=!1,T(!1)})})}else Ae.getWooPaySessionFromMerchant({_ajax_nonce:t("woopaySessionNonce"),order_id:t("order_id"),key:t("key"),billing_email:t("billing_email"),appearance:a}).then(async e=>{if(!e?.blog_id||!e?.data?.session)throw y.current=O,new Error(e?.data);{const t=await Ae.sendPreemptiveSessionDataToWooPay(e);if(t?.is_error)return O(null),y.current=O,v.current=!1,void T(!1);window.location.href=g(t.redirect_url)}})?.catch(()=>{const e=(0,n.__)("Something went wrong. Please try again.","woocommerce-payments");h(C,e),v.current=!1,T(!1)})},[$,C,o,d,e,O]);(0,a.useEffect)(()=>{t("isWoopayFirstPartyAuthEnabled")?(y.current=B,Ae.init()):y.current=O},[B,O]),(0,a.useEffect)(()=>{const e=e=>{e?.persisted&&(v.current=!1,T(!1))};return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[]);let z=null;null!==M&&(z=M>140?"wide":"narrow");const U=We(f)?(Z=f.brand,De[Z]||Z):null;var Z;const V=U&&M>=220?Le.find(e=>e.name===U):null,J=je[U]||U,K=V?(0,n.sprintf)((0,n.__)("WooPay with %1$s ending in %2$s","woocommerce-payments"),J,f.last4):I,G={ref:_,"aria-label":K,onClick:e=>y.current(e),className:i("woopay-express-button",{"is-loading":P}),"data-type":S,"data-size":L,"data-theme":x,"data-width-type":z,style:{height:`${k}px`,borderRadius:`${F}px`}},Q=P?(0,c.jsx)("span",{className:"wc-block-components-spinner"}):V&&f?(0,c.jsxs)("div",{className:"button-content",children:[(0,c.jsx)(R,{}),(0,c.jsx)("span",{className:"woopay-button-separator","aria-hidden":"true"}),(0,c.jsx)("img",{src:V.component,alt:je[U]||U,className:"woopay-button-card-brand"}),(0,c.jsx)("span",{className:"woopay-button-last4",children:f.last4})]}):(0,c.jsx)("div",{className:"button-content",children:Ce({mixedString:I.replace(qe.default,"{{wooPayLogo /}}"),components:{wooPayLogo:(0,c.jsx)(R,{})}})});return(0,c.jsx)("div",{id:"wcpay-woopay-button",children:D?(0,c.jsx)("a",{...G,href:P?void 0:W,"aria-disabled":P||void 0,tabIndex:P?-1:void 0,children:Q},`${S}-${x}-${L}`):(0,c.jsx)("button",{...G,disabled:P,type:"button",children:Q},`${S}-${x}-${L}`)})};class Ne{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=r("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(e,o=!1){const r=e.match(/#wcpay-confirm-(pi|si):([^:]+):([^:]+):([^:]+)(?::(.+))?$/);if(!r)return!0;const n="si"===r[1];let a=r[2];const s=r[3],i=r[4],c=r[5]||null,l=e.indexOf("order-pay"),u=l>-1&&e.substring(l).match(/\d+/);return u&&(a=u[0]),(async()=>{const{locale:e,publishableKey:o}=this.options,r=t("accountIdForIntentConfirmation");if(n){const e=await this.getStripe(!0);return c?e.confirmSetup({clientSecret:s,confirmParams:{confirmation_token:c},redirect:"if_required"}):e.handleNextAction({clientSecret:s})}return r?this.createStripe(o,e,r).confirmCardPayment(s):(await this.getStripe(!0)).handleNextAction({clientSecret:s})})().then(e=>{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 n=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=m("ajax_url")??t("ajaxUrl"),c=t("isChangingPayment");return[this.request(s,{action:"update_order_status",order_id:a,_ajax_nonce:i,intent_id:n,should_save_payment_method:o?"true":"false",is_changing_payment:c?"true":"false"}),r,e.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(e){const o=await this.request(t("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:t("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:s}=n;if(s)throw s;return a}initWooPay(e,o){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const r=t("wcAjaxUrl"),n=t("initWooPayNonce");let a=null,s=null;if(t("isWooPayGlobalThemeSupportEnabled"))if(y()){const e=fe();a=me(e,!0),s=pe()}else a=t("woopayAppearance"),s=t("woopayFontRules");return this.request(f(r,"init_woopay"),{_wpnonce:n,appearance:a,font_rules:s,email:e,user_session:o,order_id:t("order_id"),key:t("key"),billing_email:t("billing_email")}).finally(()=>{this.isWooPayRequesting=!1})}}expressCheckoutAddToCart(e){const o=t("wcAjaxUrl"),r=t("addToCartNonce");return this.request(f(o,"add_to_cart"),{security:r,...e})}}let $e=!1,Oe=!1;const Be=()=>{const e=t("adminAppearanceNonce");if(!e||null===new URLSearchParams(window.location.search).get("customize_messenger_channel")&&!t("isPreview"))return;const o=fe(),r=me(o,!0);if(!r)return;const n=t("ajaxUrl");if(!n)return;const a=pe(),s=new FormData;s.append("action","wcpay_admin_set_woopay_appearance"),s.append("_ajax_nonce",e),ge(s,r),s.append("font_rules",JSON.stringify(a)),fetch(n,{method:"POST",body:s,credentials:"same-origin"}).catch(()=>{})},ze=class extends Me{constructor(){super(),this.listeners={...this.listeners,getIsUserLoggedInCallback:()=>{},getEncryptedDataCallback:()=>{},getPreferredPaymentMethodCallback:()=>{}}}async isUserLoggedIn(){try{return await this.sendMessageAndListenWith({action:"getIsUserLoggedIn"},"getIsUserLoggedInCallback")}catch(e){return!1}}async getEncryptedData(){try{return await this.sendMessageAndListenWith({action:"getEncryptedData"},"getEncryptedDataCallback")}catch(e){return null}}async getPreferredPaymentMethod(){try{return await this.sendMessageAndListenWith({action:"getPreferredPaymentMethod"},"getPreferredPaymentMethodCallback")}catch(e){return null}}callbackFn(e){switch(super.callbackFn(e),e.action){case"get_is_user_logged_in_success":this.listeners.getIsUserLoggedInCallback(e.value);break;case"get_encrypted_data_success":this.listeners.getEncryptedDataCallback(e.value);break;case"get_preferred_payment_method_success":this.listeners.getPreferredPaymentMethodCallback(e.value)}}};let Ue;const Ze=[];let Ve=null,Je=(()=>{try{const e=localStorage.getItem(Ie);if(!e)return null;const t=JSON.parse(e);return We(t)?t:null}catch{return null}})();const Ke=()=>{((o={},r=null)=>{const n=new Ne({publishableKey:t("publishableKey"),accountId:t("accountId"),forceNetworkSavedCards:t("forceNetworkSavedCards"),locale:t("locale")},p),a=document.getElementById("wcpay-woopay-button");if(a){for(;Ze.length>0;)Ze.pop().unmount();const s=(0,e.H)(a);Ze.push(s),s.render((0,c.jsx)(He,{listenForCartChanges:o,buttonSettings:t("woopayButton"),api:n,isProductPage:!!a.getAttribute("data-product_page"),emailSelector:"#billing_email",preferredCard:r}))}})(Ve,Je)};jQuery(e=>{Ve={start:()=>{e(document.body).on("updated_cart_totals updated_checkout",Ke)},stop:()=>{e(document.body).off("updated_cart_totals updated_checkout",Ke)}},Ve.start()}),window.addEventListener("load",()=>{Ke(),(async()=>{try{const o=await(Ue||(Ue=(async()=>{const e=new ze;try{const t=await e.getPreferredPaymentMethod();return We(t)?t:null}finally{e.detachMessageListener()}})()),Ue);(e=>{try{We(e)?localStorage.setItem(Ie,JSON.stringify({brand:e.brand,last4:e.last4})):localStorage.removeItem(Ie)}catch{}})(o),e=o,t=Je,(e?.brand!==t?.brand||e?.last4!==t?.last4)&&(Je=o,Ke())}catch{}var e,t})(),$e||($e=!0,Be(),!Oe&&window.wp?.customize&&(Oe=!0,window.wp.customize.bind("saved",()=>{Be()})))})})()})();