Current File : /home/kelaby89/muzza.fit/wp-content/plugins/woocommerce-payments/dist/woopay-express-button.js
/*! For license information please see woopay-express-button.js.LICENSE.txt */
(()=>{var e={5228:e=>{"use strict";var t=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},o=0;o<10;o++)t["_"+String.fromCharCode(o)]=o;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var a,i,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c<arguments.length;c++){for(var l in a=Object(arguments[c]))o.call(a,l)&&(s[l]=a[l]);if(t){i=t(a);for(var u=0;u<i.length;u++)r.call(a,i[u])&&(s[i[u]]=a[i[u]])}}return s}},1020:(e,t,o)=>{"use strict";o(5228);var r=o(1609),n=60103;if("function"==typeof Symbol&&Symbol.for){var a=Symbol.for;n=a("react.element"),a("react.fragment")}var i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,o){var r,a={},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)s.call(t,r)&&!c.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:n,type:e,key:l,ref:u,props:a,_owner:i.current}}t.jsx=l,t.jsxs=l},4848:(e,t,o)=>{"use strict";e.exports=o(1020)},6255:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var o,r;(0,n.default)(e),"object"===a(t)?(o=t.min||0,r=t.max):(o=arguments[1],r=arguments[2]);var i=encodeURI(e).split(/%..|./).length-1;return i>=o&&(void 0===r||i<=r)};var r,n=(r=o(3399))&&r.__esModule?r:{default:r};function a(e){return a="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},a(e)}e.exports=t.default,e.exports.default=t.default},9517:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),(t=(0,s.default)(t,l)).require_display_name||t.allow_display_name){var o=e.match(u);if(o){var c=o[1];if(e=e.replace(c,"").replace(/(^<|>$)/g,""),c.endsWith(" ")&&(c=c.slice(0,-1)),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(!t.trim())return!1;if(/[\.";<>]/.test(t)){if(t===e)return!1;if(t.split('"').length!==t.split('\\"').length)return!1}return!0}(c))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>g)return!1;var b=e.split("@"),y=b.pop(),_=y.toLowerCase();if(t.host_blacklist.includes(_))return!1;if(t.host_whitelist.length>0&&!t.host_whitelist.includes(_))return!1;var w=b.join("@");if(t.domain_specific_validation&&("gmail.com"===_||"googlemail.com"===_)){var v=(w=w.toLowerCase()).split("+")[0];if(!(0,n.default)(v.replace(/\./g,""),{min:6,max:30}))return!1;for(var S=v.split("."),k=0;k<S.length;k++)if(!h.test(S[k]))return!1}if(!(!1!==t.ignore_max_length||(0,n.default)(w,{max:64})&&(0,n.default)(y,{max:254})))return!1;if(!(0,a.default)(y,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length,allow_underscores:t.allow_underscores})){if(!t.allow_ip_domain)return!1;if(!(0,i.default)(y)){if(!y.startsWith("[")||!y.endsWith("]"))return!1;var x=y.slice(1,-1);if(0===x.length||!(0,i.default)(x))return!1}}if('"'===w[0])return w=w.slice(1,w.length-1),t.allow_utf8_local_part?m.test(w):p.test(w);for(var F=t.allow_utf8_local_part?f:d,C=w.split("."),P=0;P<C.length;P++)if(!F.test(C[P]))return!1;return!t.blacklisted_chars||-1===w.search(new RegExp("[".concat(t.blacklisted_chars,"]+"),"g"))};var r=c(o(3399)),n=c(o(6255)),a=c(o(7658)),i=c(o(5372)),s=c(o(3610));function c(e){return e&&e.__esModule?e:{default:e}}var l={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},u=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,d=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,h=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,f=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,m=/^([\s\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]))*$/i,g=254;e.exports=t.default,e.exports.default=t.default},7658:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(e),(t=(0,n.default)(t,i)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1)),!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var o=e.split("."),a=o[o.length-1];if(t.require_tld){if(o.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(a))return!1;if(/\s/.test(a))return!1}return!(!t.allow_numeric_tld&&/^\d+$/.test(a))&&o.every((function(e){return!(e.length>63&&!t.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)||/[\uff01-\uff5e]/.test(e)||/^-|-$/.test(e)||!t.allow_underscores&&/_/.test(e))}))};var r=a(o(3399)),n=a(o(3610));function a(e){return e&&e.__esModule?e:{default:e}}var i={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default},5372:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,n.default)(t),(o=String(o))?"4"===o?s.test(t):"6"===o&&l.test(t):e(t,4)||e(t,6)};var r,n=(r=o(3399))&&r.__esModule?r:{default:r},a="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",i="(".concat(a,"[.]){3}").concat(a),s=new RegExp("^".concat(i,"$")),c="(?:[0-9a-fA-F]{1,4})",l=new RegExp("^("+"(?:".concat(c,":){7}(?:").concat(c,"|:)|")+"(?:".concat(c,":){6}(?:").concat(i,"|:").concat(c,"|:)|")+"(?:".concat(c,":){5}(?::").concat(i,"|(:").concat(c,"){1,2}|:)|")+"(?:".concat(c,":){4}(?:(:").concat(c,"){0,1}:").concat(i,"|(:").concat(c,"){1,3}|:)|")+"(?:".concat(c,":){3}(?:(:").concat(c,"){0,2}:").concat(i,"|(:").concat(c,"){1,4}|:)|")+"(?:".concat(c,":){2}(?:(:").concat(c,"){0,3}:").concat(i,"|(:").concat(c,"){1,5}|:)|")+"(?:".concat(c,":){1}(?:(:").concat(c,"){0,4}:").concat(i,"|(:").concat(c,"){1,6}|:)|")+"(?::((?::".concat(c,"){0,5}:").concat(i,"|(?::").concat(c,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default},3399:(e,t)=>{"use strict";function o(e){return o="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},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t=o(e);throw null===e?t="null":"object"===t&&(t=e.constructor.name),new TypeError("Expected a string but received a ".concat(t))}},e.exports=t.default,e.exports.default=t.default},3610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var o in t)void 0===e[o]&&(e[o]=t[o]);return e},e.exports=t.default,e.exports.default=t.default},1609:e=>{"use strict";e.exports=window.React}},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}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(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(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),o.p=window.wcpayAssets.url,(()=>{"use strict";const e=window.ReactDOM;var t=o.n(e);const r=e=>"undefined"!=typeof wcpayConfig?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},a=window.wp.i18n;var i=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 c=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 l=o(4848);const u=e=>(0,l.jsx)("svg",{viewBox:"0 0 109 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.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})}),d=e=>(0,l.jsxs)("svg",{viewBox:"0 0 100 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.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,l.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 h(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&&h(n,a,o)}return o}async function p(e,t,o){const r=h(t,"",new FormData),n=await fetch(e,{method:"POST",body:r,...o});return await n.json()}const f=(e,t)=>{"wcSettings"in window&&wcSettings.wcBlocksConfig&&"product"!==e?wp.data.dispatch("core/notices")?.createNotice("error",t,{context:`wc/${e}`}):fetch(r("ajaxUrl"),{method:"POST",body:new URLSearchParams({action:"woopay_express_checkout_button_show_error_notice",_ajax_nonce:r("woopayButtonNonce"),context:e,message:t})}).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,g=(e,t,o="wcpay_")=>e.toString().replace("%%endpoint%%",o+t),b=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},y=()=>{(()=>{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;")},_=e=>"woopay_shortcode_checkout"===e;window.wp.domReady;const w=(e,t={})=>{var o,n,a;const i=null!==(o=r("platformTrackerNonce"))&&void 0!==o?o:null===(n=m("nonce"))||void 0===n?void 0:n.platform_tracker,s=null!==(a=r("ajaxUrl"))&&void 0!==a?a:m("ajax_url"),c=new FormData;c.append("tracksNonce",i),c.append("action","platform_tracks"),c.append("tracksEventName",e),c.append("tracksEventProp",JSON.stringify(t)),fetch(s,{method:"post",body:c}).then((e=>e.json()))},v=()=>{return e=void 0,t=void 0,n=function*(){var e,t,o;let n=(()=>{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(n){const e={_ut:"anon",_ui:n};return JSON.stringify(e)}const a=null!==(e=r("platformTrackerNonce"))&&void 0!==e?e:null===(t=m("nonce"))||void 0===t?void 0:t.platform_tracker,i=null!==(o=r("ajaxUrl"))&&void 0!==o?o:m("ajax_url"),s=new FormData;s.append("tracksNonce",a),s.append("action","get_identity");try{const e=yield fetch(i,{method:"post",body:s});if(!e.ok)return;const t=yield e.json();return t.success&&t.data&&t.data._ui&&t.data._ut?JSON.stringify(t.data):void 0}catch(e){return}},new((o=void 0)||(o=Promise))((function(r,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,s)}c((n=n.apply(e,t||[])).next())}));var e,t,o,n},S=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],k=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],x=["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"],F={".Label":[...S,...k],".Text":[...S,...k],".Input":[...S,...k,...x],".Error":[...S,...k,...x],".Tab":[...S,...k,...x],".TabIcon":[...S],".TabLabel":[...S,...k],".Block":[...S.slice(1),...x.slice(1)],".Container":[...x],".Header":[...S,...x,...k],".Footer":[...S,...x,...k]},C={".Label":F[".Label"],".Label--floating":[...F[".Label"],"transform"],".Input":[...F[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":F[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",x],".TabIcon":F[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":F[".TabLabel"],".Block":F[".Block"],".Container":F[".Container"],".Header":F[".Header"],".Footer":F[".Footer"],".Footer--link":F[".Text"],".Text":F[".Text"],".Text--redirect":F[".Text"]};function P(e){return P="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},P(e)}var M=/^\s+/,T=/\s+$/;function E(e,t){if(t=t||{},(e=e||"")instanceof E)return e;if(!(this instanceof E))return new E(e,t);var o=function(e){var t={r:0,g:0,b:0},o=1,r=null,n=null,a=null,i=!1,s=!1;return"string"==typeof e&&(e=function(e){e=e.replace(M,"").replace(T,"").toLowerCase();var t,o=!1;if(V[e])e=V[e],o=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=ie.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=ie.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ie.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=ie.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ie.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=ie.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ie.hex8.exec(e))?{r:Q(t[1]),g:Q(t[2]),b:Q(t[3]),a:oe(t[4]),format:o?"name":"hex8"}:(t=ie.hex6.exec(e))?{r:Q(t[1]),g:Q(t[2]),b:Q(t[3]),format:o?"name":"hex"}:(t=ie.hex4.exec(e))?{r:Q(t[1]+""+t[1]),g:Q(t[2]+""+t[2]),b:Q(t[3]+""+t[3]),a:oe(t[4]+""+t[4]),format:o?"name":"hex8"}:!!(t=ie.hex3.exec(e))&&{r:Q(t[1]+""+t[1]),g:Q(t[2]+""+t[2]),b:Q(t[3]+""+t[3]),format:o?"name":"hex"}}(e)),"object"==P(e)&&(se(e.r)&&se(e.g)&&se(e.b)?(t=function(e,t,o){return{r:255*K(e,255),g:255*K(t,255),b:255*K(o,255)}}(e.r,e.g,e.b),i=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):se(e.h)&&se(e.s)&&se(e.v)?(r=ee(e.s),n=ee(e.v),t=function(e,t,o){e=6*K(e,360),t=K(t,100),o=K(o,100);var r=Math.floor(e),n=e-r,a=o*(1-t),i=o*(1-n*t),s=o*(1-(1-n)*t),c=r%6;return{r:255*[o,i,a,a,s,o][c],g:255*[s,o,o,i,a,a][c],b:255*[a,a,s,o,o,i][c]}}(e.h,r,n),i=!0,s="hsv"):se(e.h)&&se(e.s)&&se(e.l)&&(r=ee(e.s),a=ee(e.l),t=function(e,t,o){var r,n,a;function i(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e}if(e=K(e,360),t=K(t,100),o=K(o,100),0===t)r=n=a=o;else{var s=o<.5?o*(1+t):o+t-o*t,c=2*o-s;r=i(c,s,e+1/3),n=i(c,s,e),a=i(c,s,e-1/3)}return{r:255*r,g:255*n,b:255*a}}(e.h,r,a),i=!0,s="hsl"),e.hasOwnProperty("a")&&(o=e.a)),o=G(o),{ok:i,format:e.format||s,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 A(e,t,o){e=K(e,255),t=K(t,255),o=K(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),s=(a+i)/2;if(a==i)r=n=0;else{var c=a-i;switch(n=s>.5?c/(2-a-i):c/(a+i),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:s}}function L(e,t,o){e=K(e,255),t=K(t,255),o=K(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),s=a,c=a-i;if(n=0===a?0:c/a,a==i)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:s}}function I(e,t,o,r){var n=[Y(Math.round(e).toString(16)),Y(Math.round(t).toString(16)),Y(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 R(e,t,o,r){return[Y(te(r)),Y(Math.round(e).toString(16)),Y(Math.round(t).toString(16)),Y(Math.round(o).toString(16))].join("")}function j(e,t){t=0===t?0:t||10;var o=E(e).toHsl();return o.s-=t/100,o.s=X(o.s),E(o)}function q(e,t){t=0===t?0:t||10;var o=E(e).toHsl();return o.s+=t/100,o.s=X(o.s),E(o)}function D(e){return E(e).desaturate(100)}function W(e,t){t=0===t?0:t||10;var o=E(e).toHsl();return o.l+=t/100,o.l=X(o.l),E(o)}function O(e,t){t=0===t?0:t||10;var o=E(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))),E(o)}function H(e,t){t=0===t?0:t||10;var o=E(e).toHsl();return o.l-=t/100,o.l=X(o.l),E(o)}function $(e,t){var o=E(e).toHsl(),r=(o.h+t)%360;return o.h=r<0?360+r:r,E(o)}function N(e){var t=E(e).toHsl();return t.h=(t.h+180)%360,E(t)}function z(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=E(e).toHsl(),r=[E(e)],n=360/t,a=1;a<t;a++)r.push(E({h:(o.h+a*n)%360,s:o.s,l:o.l}));return r}function B(e){var t=E(e).toHsl(),o=t.h;return[E(e),E({h:(o+72)%360,s:t.s,l:t.l}),E({h:(o+216)%360,s:t.s,l:t.l})]}function U(e,t,o){t=t||6,o=o||30;var r=E(e).toHsl(),n=360/o,a=[E(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,a.push(E(r));return a}function Z(e,t){t=t||6;for(var o=E(e).toHsv(),r=o.h,n=o.s,a=o.v,i=[],s=1/t;t--;)i.push(E({h:r,s:n,v:a})),a=(a+s)%1;return i}E.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=G(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=L(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=L(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+o+"%, "+r+"%)":"hsva("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=A(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=A(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 I(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=[Y(Math.round(e).toString(16)),Y(Math.round(t).toString(16)),Y(Math.round(o).toString(16)),Y(te(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*K(this._r,255))+"%",g:Math.round(100*K(this._g,255))+"%",b:Math.round(100*K(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*K(this._r,255))+"%, "+Math.round(100*K(this._g,255))+"%, "+Math.round(100*K(this._b,255))+"%)":"rgba("+Math.round(100*K(this._r,255))+"%, "+Math.round(100*K(this._g,255))+"%, "+Math.round(100*K(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(J[I(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+R(this._r,this._g,this._b,this._a),o=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var n=E(e);o="#"+R(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 E(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(W,arguments)},brighten:function(){return this._applyModification(O,arguments)},darken:function(){return this._applyModification(H,arguments)},desaturate:function(){return this._applyModification(j,arguments)},saturate:function(){return this._applyModification(q,arguments)},greyscale:function(){return this._applyModification(D,arguments)},spin:function(){return this._applyModification($,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(U,arguments)},complement:function(){return this._applyCombination(N,arguments)},monochromatic:function(){return this._applyCombination(Z,arguments)},splitcomplement:function(){return this._applyCombination(B,arguments)},triad:function(){return this._applyCombination(z,[3])},tetrad:function(){return this._applyCombination(z,[4])}},E.fromRatio=function(e,t){if("object"==P(e)){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]="a"===r?e[r]:ee(e[r]));e=o}return E(e,t)},E.equals=function(e,t){return!(!e||!t)&&E(e).toRgbString()==E(t).toRgbString()},E.random=function(){return E.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},E.mix=function(e,t,o){o=0===o?0:o||50;var r=E(e).toRgb(),n=E(t).toRgb(),a=o/100;return E({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})},E.readability=function(e,t){var o=E(e),r=E(t);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},E.isReadable=function(e,t,o){var r,n,a,i,s,c=E.readability(e,t);switch(n=!1,(a=o,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(s=(a.size||"small").toLowerCase())&&"large"!==s&&(s="small"),r={level:i,size:s}).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},E.mostReadable=function(e,t,o){var r,n,a,i,s=null,c=0;n=(o=o||{}).includeFallbackColors,a=o.level,i=o.size;for(var l=0;l<t.length;l++)(r=E.readability(e,t[l]))>c&&(c=r,s=E(t[l]));return E.isReadable(e,s,{level:a,size:i})||!n?s:(o.includeFallbackColors=!1,E.mostReadable(e,["#fff","#000"],o))};var V=E.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"},J=E.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}(V);function G(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function K(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 X(e){return Math.min(1,Math.max(0,e))}function Q(e){return parseInt(e,16)}function Y(e){return 1==e.length?"0"+e:""+e}function ee(e){return e<=1&&(e=100*e+"%"),e}function te(e){return Math.round(255*parseFloat(e)).toString(16)}function oe(e){return Q(e)/255}var re,ne,ae,ie=(ne="[\\s|\\(]+("+(re="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?",ae="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?",{CSS_UNIT:new RegExp(re),rgb:new RegExp("rgb"+ne),rgba:new RegExp("rgba"+ae),hsl:new RegExp("hsl"+ne),hsla:new RegExp("hsla"+ae),hsv:new RegExp("hsv"+ne),hsva:new RegExp("hsva"+ae),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 se(e){return!!ie.CSS_UNIT.exec(e)}const ce=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},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"],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"],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((o=>{const[r,n]=o;t.querySelector(e[r])||(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}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 i=this.createRow(o.rowElement,o.validClasses,t);a.appendChild(i);const s=this.createRow(o.rowElement,o.invalidClasses,t);a.appendChild(s),this.appendClone(i,o.upeThemeInputSelector,o.hiddenInput,t),this.appendClone(i,o.upeThemeLabelSelector,o.hiddenValidActiveLabel,t),this.appendClone(s,o.upeThemeInputSelector,o.hiddenInvalidInput,t),this.appendClone(s,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)=>{if(!r.querySelector(e))return{};const n=r.defaultView||window,a=C[t],i=r.querySelector(e),s=n.getComputedStyle(i),c={};for(let e=0;e<s.length;e++){const t=s[e].replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}));if(a.includes(t)){let o=s.getPropertyValue(s[e]);"color"===t&&(o=ce(o)),c[t]=o}}if(".Input"===t||".Tab--selected"===t){const e=((e,t="solid",o)=>e&&o?[e,t,o].join(" "):"")(c.outlineWidth,c.outlineStyle,c.outlineColor);""!==e&&(c.outline=e),delete c.outlineWidth,delete c.outlineColor,delete c.outlineStyle}const l=s.getPropertyValue("text-indent");return"0px"!==l&&"0px"===c.paddingLeft&&"0px"===c.paddingRight&&(c.paddingLeft=l,c.paddingRight=l),".Block"===t&&(c.backgroundColor=o),c},he=(e,t=!1,o=document)=>{const r=le.getSelectors(e,o);ue.init(e,o);const n=de(r.hiddenInput,".Input",null,o),a=de(r.hiddenInvalidInput,".Input",null,o),i=de(r.upeThemeLabelSelector,".Label",null,o),s={fontSize:i.fontSize},c=de(r.upeThemeTextSelectors,".Text",null,o),l=de(r.upeThemeInputSelector,".Tab",null,o),u=de(r.hiddenInput,".Tab--selected",null,o),d=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const o=((e,t)=>{const o={backgroundColor:e,color:t},r=E(e),n=E(t);if(!r.isValid()||!n.isValid())return{backgroundColor:"",color:""};const a=r.getBrightness()>50?E(r).darken(7):E(r).lighten(7),i=E.mostReadable(a,[n],{includeFallbackColors:!0});return o.backgroundColor=a.toRgbString(),o.color=i.toRgbString(),o})(e.backgroundColor,e.color);return t.backgroundColor=o.backgroundColor,t.color=o.color,t})(l),h={color:d.color},p={color:u.color},f=((e,t=document)=>{let o=null,r=0;for(;!o&&r<e.length;){const n=t.querySelector(e[r]);if(!n){r++;continue}const a=(t.defaultView||window).getComputedStyle(n).backgroundColor;a&&E(a).getAlpha()>0&&(o=a),r++}return o||"#ffffff"})(r.backgroundSelectors,o),m=de(r.headingSelectors,".Label",null,o),g=de(r.upeThemeLabelSelector,".Block",f,o),b=de(r.buttonSelectors,".Input",null,o),y=de(r.linkSelectors,".Label",null,o),_=de(r.containerSelectors,".Container",null,o),w=de(r.headerSelectors,".Header",null,o),v=de(r.footerSelectors,".Footer",null,o),S=de(r.footerLink,".Footer--link",null,o),k={colorBackground:f,colorText:c.color,fontFamily:c.fontFamily,fontSizeBase:c.fontSize};r.pmmeRelativeTextSizeSelector&&k.fontSizeBase&&(k.fontSizeBase=function(e,t,o=.875,r){const n=parseFloat(t);if(isNaN(n))return t;const a=r.querySelector(e);if(!a)return n*o+"px";const i=window.getComputedStyle(a).getPropertyValue("font-size"),s=parseFloat(i)*o;return isNaN(s)?t:n>s?`${s}px`:`${n}px`}(r.pmmeRelativeTextSizeSelector,c.fontSize,.875,o));const x="blocks_checkout"===e;let F={variables:k,theme:(C=f,E(C).getBrightness()>125?"stripe":"night"),labels:x?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":n,".Input--invalid":a,".Label":i,".Label--resting":s,".Block":g,".Tab":l,".Tab:hover":d,".Tab--selected":u,".TabIcon:hover":h,".TabIcon--selected":p,".Text":c,".Text--redirect":c}))};var C;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 o=t[1].split(", "),r=(parseFloat(o[0])+parseFloat(o[3]))/2,n=parseFloat(e.rules[".Label--floating"].lineHeight),a=Math.floor(n*r);e.rules[".Label--floating"].lineHeight=`${a}px`,e.rules[".Label--floating"].fontSize=`${a}px`}delete e.rules[".Label--floating"].transform}if(e.rules[".Input"].paddingTop&&(e.rules[".Input"].paddingTop=`calc(${e.rules[".Input"].paddingTop} - ${e.rules[".Label--floating"].lineHeight} - 4px - 1px)`),e.rules[".Input"].paddingBottom){var o;const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const r=null!==(o=e.rules[".Label"].marginTop)&&void 0!==o?o:"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=r}return e})(F,de(r.hiddenValidActiveLabel,".Label--floating",null,o))),t&&(F.rules={...F.rules,".Heading":m,".Header":w,".Footer":v,".Footer-link":S,".Button":b,".Link":y,".Container":_}),ue.cleanup(o),F},pe=()=>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,fe=async(e,t,o)=>{const n=await v();let i="";const s=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,a.__)("WooPay SMS code verification","woocommerce-payments"),l.classList.add("woopay-otp-iframe"),l.classList.add("intrinsic-ignore");const u=768;let d=!0;const h=()=>{(u<=window.innerWidth&&d||u>window.innerWidth&&!d)&&(d=!d,l.contentWindow.postMessage({action:"setHeader",value:d},r("woopayHost"))),document.body.style.overflow="hidden"},m=()=>{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=pe(),t=_(e)&&r("isWooPayGlobalThemeSupportEnabled")?he(e,!0):null;r("isWoopayFirstPartyAuthEnabled")&&p(g(r("wcAjaxUrl"),"get_woopay_session"),{_ajax_nonce:r("woopaySessionNonce"),order_id:r("order_id"),key:r("key"),billing_email:r("billing_email"),appearance:t}).then((e=>{e?.data?.session&&l.contentWindow.postMessage({action:"setSessionData",value:e},r("woopayHost"))})),h(),window.addEventListener("resize",h),m(),window.addEventListener("resize",m),l.classList.add("open")})),c.insertBefore(l,null);const y=()=>{window.removeEventListener("resize",h),window.removeEventListener("resize",m),window.removeEventListener("pageshow",S),window.removeEventListener("message",w),document.removeEventListener("keyup",k),c.remove(),l.classList.remove("open"),document.body.style.overflow=""};function w(o){if(r("woopayHost").startsWith(o.origin))switch(o.data.action){case"otp_email_submitted":i=o.data.userEmail;break;case"redirect_to_woopay_skip_session_init":o.data.redirectUrl&&(window.location=b(o.data.redirectUrl));break;case"redirect_to_platform_checkout":case"redirect_to_woopay":e.initWooPay(i||o.data.userEmail,o.data.platformCheckoutUserSession).then((e=>{if(document.querySelector(".woopay-otp-iframe"))if("success"===e.result)window.location=b(e.url);else{const e=(0,a.__)("WooPay is unavailable at this time. Sorry for the inconvenience.","woocommerce-payments");f(t,e),y()}}));break;case"otp_validation_failed":break;case"close_modal":y();break;case"iframe_height":o.data.height>300&&(u<=window.innerWidth?(l.style.height=o.data.height+"px",l.style.top=Math.floor(window.innerHeight/2-o.data.height/2)+"px"):(l.style.height="",l.style.top=""))}}function S(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",S),window.addEventListener("message",w),document.addEventListener("keyup",k);const o=window.document.documentElement.clientWidth,a=window.document.documentElement.clientHeight,d=new URLSearchParams;var h;d.append("testMode",r("testMode")),d.append("needsHeader",u>window.innerWidth),d.append("wcpayVersion",r("wcpayVersionNumber")),e&&(h=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(h))&&(i=e,d.append("email",e)),d.append("is_blocks",!!window.wcSettings?.wcBlocksConfig),d.append("is_express","true"),d.append("express_context",t),d.append("source_url",window.location.href),d.append("viewport",`${o}x${a}`),n&&d.append("tracksUserIdentity",n),l.src=`${r("woopayHost")}/otp/?${d.toString()}`,s.insertBefore(c,null),m(),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})(o)||r("woopaySessionEmail"))};var me=o(9517),ge=o.n(me);function be(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 ye(e,t){let o,r,n=[];for(let a=0;a<e.length;a++){const i=e[a];if("string"!==i.type){if(void 0===t[i.value])throw new Error(`Invalid interpolation, missing component node: \`${i.value}\``);if("object"!=typeof t[i.value])throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${i.value}\``);if("componentClose"===i.type)throw new Error(`Missing opening component token: \`${i.value}\``);if("componentOpen"===i.type){o=t[i.value],r=a;break}n.push(t[i.value])}else n.push(i.value)}if(o){const a=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),s=ye(e.slice(r+1,a),t),c=(0,i.cloneElement)(o,{},s);if(n.push(c),a<e.length-1){const o=ye(e.slice(a+1),t);n=n.concat(o)}}return n=n.filter(Boolean),0===n.length?null:1===n.length?n[0]:(0,i.createElement)(i.Fragment,null,...n)}function _e(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(be)}(t);try{return ye(n,o)}catch(e){if(r)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}function we(e){window.WooPayConnect||(window.WooPayConnect={}),window.WooPayConnect.iframeInjectedState=e}function ve(){return window?.WooPayConnect?.postMessageTimeout||5e3}const Se=()=>{const e=(0,i.useRef)(),[t,o]=(0,i.useState)("");return(0,i.useEffect)((()=>{(async()=>{const e=r("testMode"),t=r("woopayHost"),n=r("woopayMerchantId"),a=new URLSearchParams({testMode:e,source_url:window.location.href,blogId:n}),i=await v();i&&a.append("tracksUserIdentity",i),o(`${t}/connect/?${a.toString()}`)})()}),[]),(0,i.useEffect)((()=>{if(!e.current)return;const t=e.current;t.addEventListener("load",(()=>{we(2),window.dispatchEvent(new MessageEvent("message",{source:window,origin:r("woopayHost"),data:{action:"get_iframe_post_message_success",value:e=>t.contentWindow.postMessage(e,r("woopayHost"))}}))}))}),[t]),(0,l.jsx)("iframe",{ref:e,id:"woopay-connect-iframe",src:t,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,a.__)("WooPay Connect Direct Checkout","woocommerce-payments")})},ke=class{iframePostMessage=null;listeners={};constructor(){this.listeners={getIframePostMessageCallback:()=>{},getPostMessageTimeoutCallback:()=>{}},this.removeMessageListener=this.attachMessageListener(),this.injectWooPayConnectIframe()}attachMessageListener(){const e=e=>{r("woopayHost").startsWith(e.origin)&&this.callbackFn(e.data)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}detachMessageListener(){"function"==typeof this.removeMessageListener&&this.removeMessageListener()}injectWooPayConnectIframe(){const e=window?.WooPayConnect?.iframeInjectedState||0;if(2===e){const e=document.querySelector("#woopay-connect-iframe");return void(e&&(this.iframePostMessage=Promise.resolve((t=>{e.contentWindow.postMessage(t,r("woopayHost"))}))))}if(1===e)return void(this.iframePostMessage=new Promise((e=>{this.listeners.getIframePostMessageCallback=e})));we(1);const o=document.createElement("div");o.style.visibility="hidden",o.style.position="fixed",o.style.height="0",o.style.width="0",o.style.bottom="0",o.style.right="0",o.id="woopay-connect-iframe-container",document.body.appendChild(o);const n=this;this.iframePostMessage=new Promise((e=>{n.listeners.getIframePostMessageCallback=e})),t().render((0,l.jsx)(Se,{}),o)}injectTemporaryWooPayConnectIframe(){let e;const t=new Promise((t=>{e=t})),o=document.createElement("iframe");return o.id="temp-woopay-connect-iframe",o.src=r("woopayHost")+"/connect/",o.height=0,o.width=0,o.border="none",o.margin=0,o.padding=0,o.overflow="hidden",o.display="block",o.visibility="hidden",o.position="fixed",o.pointerEvents="none",o.userSelect="none",o.addEventListener("load",(()=>{e((e=>o.contentWindow.postMessage(e,r("woopayHost"))))})),document.body.appendChild(o),{resolvePostMessagePromise:t,removeTemporaryIframe:()=>{document.body.removeChild(o)}}}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."))}),ve());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)}}},xe=class extends ke{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."))}),ve());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."))}),ve());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})}}},Fe=class{static sessionConnect;static init(){this.getSessionConnect()}static getSessionConnect(){return this.sessionConnect||(this.sessionConnect=new xe),this.sessionConnect}static async sendPreemptiveSessionDataToWooPay(e){return this.getSessionConnect().setPreemptiveSessionData(e)}static async getWooPaySessionFromMerchant(e){return p(g(r("wcAjaxUrl"),"get_woopay_session"),e)}},Ce={default:(0,a.__)("WooPay","woocommerce-payments"),buy:(0,a.__)("Buy with WooPay","woocommerce-payments"),donate:(0,a.__)("Donate with WooPay","woocommerce-payments"),book:(0,a.__)("Book with WooPay","woocommerce-payments")},Pe=({listenForCartChanges:e,isPreview:t=!1,buttonSettings:o,api:n,isProductPage:s=!1,emailSelector:h="#email",buttonAttributes:p})=>{var m;const g="narrow",v="wide",S=(0,i.useRef)(null),k=(0,i.useRef)(null),x=(0,i.useRef)(!1);let{height:F,type:C,theme:P,context:M,radius:T}=o;const[E,A]=(0,i.useState)(!1),[L,I]=(0,i.useState)(v),R=new Map;var j;R.set("40","small"),R.set("48","medium"),R.set("55","large"),void 0!==p&&(F=p.height||F,T=null!==(j=p.borderRadius)&&void 0!==j?j:T);const q=R.get(F?.toString())||"medium",D=null!==(m=Ce[C||"default"])&&void 0!==m?m:Ce.default,W="dark"===P?u:d,{addToCart:O,getProductData:H}=(e=>({addToCart:t=>e.expressCheckoutAddToCart(t),getProductData:()=>{const e=document.querySelector(".single_add_to_cart_button").value,t=document.querySelector(".bundle_form"),o=document.querySelector(".single_variation_wrap");let r={product_id:e,quantity:document.querySelector(".quantity .qty").value};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=new FormData(document.querySelector("form.cart"));e.delete("add-to-cart");const t={};for(const o of e.entries())t[o[0]]=o[1];r={...r,...t}}const n=document.querySelector("form.cart");return!(n&&(new FormData(n).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,a.__)("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=>ge()(e.trim())))?(alert((0,a.__)("Please type only valid emails","woocommerce-payments")),!1):!(e.hasOwnProperty("wc_gc_giftcard_to")&&!ge()(e.wc_gc_giftcard_to)&&(alert((0,a.__)("Please type only valid emails","woocommerce-payments")),1))})(r)))&&r}}))(n),$=(0,i.useRef)(H),N=(0,i.useRef)(O);(0,i.useEffect)((()=>{if(!k.current)return;const e=k.current.getBoundingClientRect().width;I(e>140?v:g)}),[g,v]),(0,i.useEffect)((()=>{t||w("woopay_button_load",{source:M})}),[t,M]);const z=(0,i.useCallback)((()=>{if(!s)return!0;const e=document.querySelector(".single_add_to_cart_button");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,a.__)("Sorry, this product is unavailable. Please choose a different combination.","woocommerce-payments")):window.alert((0,a.__)("Please select your product options before proceeding.","woocommerce-payments")),!1)}),[s]),B=(0,i.useCallback)((e=>{if(e?.preventDefault(),!t&&(w("woopay_button_click",{source:M}),y(),z()))if(s){const e=$.current();if(!e)return;N.current(e).then((e=>{e.error?e.submit&&document.querySelector("form.cart").submit():fe(n,M,h)}))}else fe(n,M,h)}),[n,M,h,t,s,z]),U=(0,i.useCallback)((o=>{if(o.preventDefault(),t||x.current)return;if(w("woopay_button_click",{source:M}),y(),!z())return;x.current=!0,A(!0);const n=pe(),i=_(n)&&r("isWooPayGlobalThemeSupportEnabled")?he(n,!0):null;if(s){const t=$.current();if(!t)return;"function"==typeof e?.stop&&e.stop(),N.current(t).then((()=>{"function"==typeof e?.start&&e.start(),Fe.getWooPaySessionFromMerchant({_ajax_nonce:r("woopaySessionNonce"),appearance:i}).then((async e=>{if(!e?.blog_id||!e?.data?.session)throw S.current=B,new Error(e?.data);{const t=await Fe.sendPreemptiveSessionDataToWooPay(e);if(t?.is_error)return B(null),S.current=B,x.current=!1,void A(!1);window.location.href=b(t.redirect_url)}})).catch((()=>{const e=(0,a.__)("Something went wrong. Please try again.","woocommerce-payments");f(M,e),x.current=!1,A(!1)}))}))}else Fe.getWooPaySessionFromMerchant({_ajax_nonce:r("woopaySessionNonce"),order_id:r("order_id"),key:r("key"),billing_email:r("billing_email"),appearance:i}).then((async e=>{if(!e?.blog_id||!e?.data?.session)throw S.current=B,new Error(e?.data);{const t=await Fe.sendPreemptiveSessionDataToWooPay(e);if(t?.is_error)return B(null),S.current=B,x.current=!1,void A(!1);window.location.href=b(t.redirect_url)}}))?.catch((()=>{const e=(0,a.__)("Something went wrong. Please try again.","woocommerce-payments");f(M,e),x.current=!1,A(!1)}))}),[z,M,t,s,e,B]);return(0,i.useEffect)((()=>{r("isWoopayFirstPartyAuthEnabled")?(S.current=U,Fe.init()):S.current=B}),[U,B]),(0,i.useEffect)((()=>{const e=e=>{e?.persisted&&(x.current=!1,A(!1))};return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}}),[]),(0,l.jsx)("div",{id:"wcpay-woopay-button",children:(0,l.jsx)("button",{ref:k,"aria-label":D,onClick:e=>S.current(e),className:c("woopay-express-button",{"is-loading":E}),"data-type":C,"data-size":q,"data-theme":P,"data-width-type":L,style:{height:`${F}px`,borderRadius:`${T}px`},disabled:E,type:"button",children:E?(0,l.jsx)("span",{className:"wc-block-components-spinner"}):(0,l.jsx)("div",{className:"button-content",children:_e({mixedString:D.replace(Ce.default,"{{wooPayLogo /}}"),components:{wooPayLogo:(0,l.jsx)(W,{})}})})},`${C}-${P}-${q}`)})};class Me{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=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: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,t=!1){const o=e.match(/#wcpay-confirm-(pi|si):(.+):(.+):(.+)$/);if(!o)return!0;const n="si"===o[1];let a=o[2];const i=o[3],s=o[4],c=e.indexOf("order-pay"),l=c>-1&&e.substring(c).match(/\d+/);return l&&(a=l[0]),(async()=>{const{locale:e,publishableKey:t}=this.options,o=r("accountIdForIntentConfirmation"),a=await this.getStripe();return n?a.handleNextAction({clientSecret:i}):o?this.createStripe(t,e,o).confirmCardPayment(i):(await this.getStripe(!0)).handleNextAction({clientSecret:i})})().then((e=>{var o;let n=null;e.paymentIntent?.last_payment_error&&(n={message:e.paymentIntent.last_payment_error.message}),"requires_action"===e.paymentIntent?.status&&(n={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,c=null!==(o=m("ajax_url"))&&void 0!==o?o:r("ajaxUrl"),l=r("isChangingPayment");return[this.request(c,{action:"update_order_status",order_id:a,_ajax_nonce:s,intent_id:i,should_save_payment_method:t?"true":"false",is_changing_payment:l?"true":"false"}),n,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 t=await this.request(r("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:r("createSetupIntentNonce")});if(!t.success)throw t.data.error;if("succeeded"===t.data.status)return t.data;const o=await this.getStripe(),n=await o.confirmCardSetup(t.data.client_secret),{setupIntent:a,error:i}=n;if(i)throw i;return a}saveUPEAppearance(e,t){return this.request(r("ajaxUrl"),{elements_location:t,appearance:JSON.stringify(e),action:"save_upe_appearance",_ajax_nonce:r("saveUPEAppearanceNonce")}).then((e=>e.data)).catch((e=>{throw e.message?e:new Error(e.statusText)}))}initWooPay(e,t){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const o=r("wcAjaxUrl"),n=r("initWooPayNonce"),a=pe();return this.request(g(o,"init_woopay"),{_wpnonce:n,appearance:r("isWooPayGlobalThemeSupportEnabled")?he(a,!0):null,email:e,user_session:t,order_id:r("order_id"),key:r("key"),billing_email:r("billing_email")}).finally((()=>{this.isWooPayRequesting=!1}))}}expressCheckoutAddToCart(e){const t=r("wcAjaxUrl"),o=r("addToCartNonce");return this.request(g(t,"add_to_cart"),{security:o,...e})}}const Te=[];let Ee=null;const Ae=()=>{((e={})=>{const o=new Me({publishableKey:r("publishableKey"),accountId:r("accountId"),forceNetworkSavedCards:r("forceNetworkSavedCards"),locale:r("locale")},p),n=document.getElementById("wcpay-woopay-button");if(n){for(;Te.length>0;){const e=Te.pop();t().unmountComponentAtNode(e)}Te.push(n),t().render((0,l.jsx)(Pe,{listenForCartChanges:e,buttonSettings:r("woopayButton"),api:o,isProductPage:!!n.getAttribute("data-product_page"),emailSelector:"#billing_email"}),n)}})(Ee)};jQuery((e=>{Ee={start:()=>{e(document.body).on("updated_cart_totals updated_checkout",Ae)},stop:()=>{e(document.body).off("updated_cart_totals updated_checkout",Ae)}},Ee.start()})),window.addEventListener("load",Ae)})()})();
Page not found – Hello World !