Ubuntu
(()=>{"use strict";var t={4744:t=>{var e=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===r}(t)}(t)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?c((r=t,Array.isArray(r)?[]:{}),t,e):t;var r}function o(t,e,r){return t.concat(e).map(function(t){return n(t,r)})}function i(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}(t))}function a(t,e){try{return e in t}catch(t){return!1}}function c(t,r,u){(u=u||{}).arrayMerge=u.arrayMerge||o,u.isMergeableObject=u.isMergeableObject||e,u.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(r);return s===Array.isArray(t)?s?u.arrayMerge(t,r,u):function(t,e,r){var o={};return r.isMergeableObject(t)&&i(t).forEach(function(e){o[e]=n(t[e],r)}),i(e).forEach(function(i){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(a(t,i)&&r.isMergeableObject(e[i])?o[i]=function(t,e){if(!e.customMerge)return c;var r=e.customMerge(t);return"function"==typeof r?r:c}(i,r)(t[i],e[i],r):o[i]=n(e[i],r))}),o}(t,r,u):n(r,u)}c.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,r){return c(t,r,e)},{})};var u=c;t.exports=u}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=window.wc.wcBlocksRegistry,o=window.wp.i18n;var i=function(t){return t.data_client_id.has_subscriptions&&t.data_client_id.paypal_subscriptions_enabled},a=function(t){var e;return!(null==t||null===(e=t.locations_with_subscription_product)||void 0===e||!e.cart)};function c(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach(function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])}),r}function u(t,e){if(void 0===e&&(e=Promise),l(t,e),"undefined"==typeof document)return e.resolve(null);var r=function(t){var e,r,n=t.sdkBaseUrl,o=t.environment,i=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o3&&void 0!==arguments[3]?arguments[3]:null;fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:e.nonce})}).then(function(t){return t.json()}).then(function(o){var i;(function(t,e){return!(!t||t.user!==e||(new Date).getTime()>=1e3*t.expiration)})(o,e.user)&&(i=o,sessionStorage.setItem("ppcp-data-client-id",JSON.stringify(i)),t["data-client-token"]=o.token,u(t).then(function(t){"function"==typeof r&&r(t)}).catch(function(t){"function"==typeof n&&n(t)}))})};function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||v(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=v(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var _n=0,n=function(){};return{s:n,n:function(){return _n>=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}function v(t,e){if(t){if("string"==typeof t)return b(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r')),r.append(o)),e=o.get(0)}return jQuery(e).length?e:null}},{key:"toKey",value:function(t){return Array.isArray(t)?JSON.stringify(t):t}}],e&&m(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();window.widgetBuilder=window.widgetBuilder||new g;const w=window.widgetBuilder;var S=r(4744),O=r.n(S),j=function(t){return t.replace(/([-_]\w)/g,function(t){return t[1].toUpperCase()})},_=function(t){var e=function(t){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[j(r)]=t[r]);return e}(t.url_params);t.script_attributes&&(e=O()(e,t.script_attributes));var r=function(t){var e,r,n=null==t||null===(e=t.save_payment_methods)||void 0===e?void 0:e.id_token;return n&&!0===(null==t||null===(r=t.user)||void 0===r?void 0:r.is_logged)?{"data-user-id-token":n}:{}}(t);return O().all([e,r])};function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function k(t){for(var e=1;e3?(o=y===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&dn||n>y)&&(i[4]=r,i[5]=n,p.n=y,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(D(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,D(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,D(f,"constructor",s),D(s,"constructor",u),u.displayName="GeneratorFunction",D(s,o,"GeneratorFunction"),D(f),D(f,o,"Generator"),D(f,n,function(){return this}),D(f,"toString",function(){return"[object Generator]"}),(T=function(){return{w:i,m:p}})()}function D(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}D=function(t,e,r,n){function i(e,r){D(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},D(t,e,r,n)}function R(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function x(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){R(i,n,o,a,c,"next",t)}function c(t){R(i,n,o,a,c,"throw",t)}a(void 0)})}}var I=new Map,C=new Map,N=function(){var t=x(T().m(function t(e,r){var n;return T().w(function(t){for(;;)switch(t.n){case 0:if(null===(n=r.data_client_id)||void 0===n||!n.set_attribute||!0===r.vault_v3_enabled){t.n=1;break}return t.a(2,new Promise(function(t,n){f(e,r.data_client_id,function(e){w.setPaypal(e),t(e)},n)}));case 1:return t.a(2,null)}},t)}));return function(_x,e){return t.apply(this,arguments)}}(),M=function(){var t=x(T().m(function t(e,r){var n,o,i;return T().w(function(t){for(;;)switch(t.n){case 0:if(e){t.n=1;break}throw new Error("Namespace is required");case 1:if(!I.has(e)){t.n=2;break}return console.log("Script already loaded for namespace: ".concat(e)),t.a(2,I.get(e));case 2:if(!C.has(e)){t.n=3;break}return console.log("Script loading in progress for namespace: ".concat(e)),t.a(2,C.get(e));case 3:return n=k(k({},_(r)),{},{"data-namespace":e}),t.n=4,N(n,r);case 4:if(!(o=t.v)){t.n=5;break}return t.a(2,o);case 5:return i=new Promise(function(t,r){u(n).then(function(r){w.setPaypal(r),I.set(e,r),console.log("Script loaded for namespace: ".concat(e)),t(r)}).catch(function(t){console.error("Failed to load script for namespace: ".concat(e),t),r(t)}).finally(function(){C.delete(e)})}),C.set(e,i),t.a(2,i)}},t)}));return function(e,r){return t.apply(this,arguments)}}(),B=function(t,e,r){jQuery(document).trigger("ppcp-shown",{handler:t,action:"show",selector:e,element:r})},F=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(t){return"string"==typeof t?document.querySelector(t):t}(t);if(n){var o=n.style.getPropertyValue("display");if(e)"none"===o&&(n.style.removeProperty("display"),B("Hiding.setVisible",t,n)),function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}(n)||(n.style.setProperty("display","block"),B("Hiding.setVisible",t,n));else{if("none"===o)return;n.style.setProperty("display","none",r?"important":""),function(t,e,r){jQuery(document).trigger("ppcp-hidden",{handler:t,action:"hide",selector:e,element:r})}("Hiding.setVisible",t,n)}}};function G(t){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(t)}function L(t,e){for(var r=0;r3?(o=y===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&dn||n>y)&&(i[4]=r,i[5]=n,p.n=y,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Q(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Q(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Q(f,"constructor",s),Q(s,"constructor",u),u.displayName="GeneratorFunction",Q(s,o,"GeneratorFunction"),Q(f),Q(f,o,"Generator"),Q(f,n,function(){return this}),Q(f,"toString",function(){return"[object Generator]"}),(H=function(){return{w:i,m:p}})()}function Q(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Q=function(t,e,r,n){function i(e,r){Q(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},Q(t,e,r,n)}function V(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function K(t,e){for(var r=0;r0?setTimeout(function(){e.attemptDiscoverBlocks(t-1).then(r)},2e3):r()})})}},{key:"discoverBlocks",value:function(){var t=this;return new Promise(function(e){var r=document.querySelectorAll(".ppcp-messages");0!==r.length?(Array.from(r).forEach(function(e){e.id||(e.id="ppcp-message-".concat(Math.random().toString(36).substr(2,9)));var r={wrapper:"#"+e.id};e.getAttribute("data-pp-placement")||(r.placement=t.gateway.messages.placement),t.renderers.push(new J(r))}),e(!0)):e(!1)})}},{key:"shouldShow",value:function(t){if(!0===this.gateway.messages.is_hidden)return!1;var e={result:!0};return jQuery(document.body).trigger("ppcp_should_show_messages",[e,t.config.wrapper]),e.result}},{key:"render",value:function(){var t=this;this.renderers.forEach(function(e){var r=t.shouldShow(e);r&&function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return new Promise(function(n,o){var i=setTimeout(function(){clearInterval(c),o('Element "'.concat(t,'" not found within ').concat(e,"ms"))},e),a=document.querySelector(t);if(a)return clearTimeout(i),void n(a);var c=setInterval(function(){var e=document.querySelector(t);e&&(clearTimeout(i),clearInterval(c),n(e))},r)})}(e.config.wrapper).then(function(){F(e.config.wrapper,r),e.renderWithAmount(t.lastAmount)}).catch(function(){})})}}],e&&K(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n}();const Z=z;function X(t){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(t)}function Y(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(this.contextBootstrapWatchers);try{for(n.s();!(r=n.n()).done;)(0,r.value)(this.contextBootstrapRegistry[t])}catch(t){n.e(t)}finally{n.f()}}}],e&&ht(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();window.ppcpResources=window.ppcpResources||{};const St=window.ppcpResources.ButtonModuleWatcher=window.ppcpResources.ButtonModuleWatcher||new wt;function Ot(t){return Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ot(t)}function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _t(t,e,r){return(e=function(t){var e=function(t){if("object"!=Ot(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ot(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ot(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Pt=function(t,e){var r={};switch(["shape","height"].forEach(function(e){t[e]&&(r[e]=t[e])}),e){case"paypal":return t;case"paylater":return function(t){for(var e=1;e3?(o=y===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&dn||n>y)&&(i[4]=r,i[5]=n,p.n=y,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(At(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,At(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,At(f,"constructor",s),At(s,"constructor",u),u.displayName="GeneratorFunction",At(s,o,"GeneratorFunction"),At(f),At(f,o,"Generator"),At(f,n,function(){return this}),At(f,"toString",function(){return"[object Generator]"}),(kt=function(){return{w:i,m:p}})()}function At(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}At=function(t,e,r,n){function i(e,r){At(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},At(t,e,r,n)}function Tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e0)){t.n=3;break}throw new Error(u.data.details.map(function(t){return"".concat(t.issue," ").concat(t.description)}).join("
"));case 3:if(null===(l=u.data)||void 0===l||!l.message){t.n=4;break}throw new Error(u.data.message);case 4:throw new Error(r.scriptData.labels.error.generic);case 5:return t.a(2,u.data.id);case 6:throw t.p=6,f=t.v,console.error(f),n(f.message),o(),f;case 7:return t.a(2)}},t,null,[[0,6]])}));return function(_x,e,r,n){return t.apply(this,arguments)}}(),Nt=function(){var t=It(kt().m(function t(e,r,n,o,i,a,c,u,s,l,f,p,d){var y,v,b,m,h,g,w,S,O,j,_,P;return kt().w(function(t){for(;;)switch(t.p=t.n){case 0:if(d(!0),t.p=1,ue(n)){t.n=3;break}return t.n=2,r.order.get();case 2:b=t.v,t.n=7;break;case 3:return t.n=4,fetch(n.scriptData.ajax.get_order.endpoint,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:n.scriptData.ajax.get_order.nonce,order_id:e.orderID})});case 4:return m=t.v,t.n=5,m.json();case 5:if((h=t.v).success){t.n=6;break}throw new Error((null===(g=h.data)||void 0===g?void 0:g.message)||n.scriptData.labels.error.generic);case 6:b=h.data;case 7:if(!(null===(y=b)||void 0===y||null===(y=y.purchase_units)||void 0===y||null===(y=y[0])||void 0===y||null===(y=y.shipping)||void 0===y?void 0:y.address)){t.n=8;break}return w=pt(b),S=[wp.data.dispatch("wc/store/cart").updateCustomerData({billing_address:w.billingAddress,shipping_address:w.shippingAddress})],o()&&(S.push(wp.data.dispatch("wc/store/cart").setBillingAddress(w.billingAddress)),i.needsShipping&&S.push(wp.data.dispatch("wc/store/cart").setShippingAddress(w.shippingAddress))),t.n=8,Promise.all(S);case 8:return a(b),t.n=9,fetch(n.scriptData.ajax.approve_order.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:n.scriptData.ajax.approve_order.nonce,order_id:e.orderID,funding_source:null!==(v=window.ppcpFundingSource)&&void 0!==v?v:"paypal"})});case 9:return O=t.v,t.n=10,O.json();case 10:if((j=t.v).success){t.n=13;break}if(void 0===r||void 0===r.restart){t.n=11;break}return t.a(2,r.restart());case 11:if(null===(_=j.data)||void 0===_||!_.message){t.n=12;break}throw new Error(j.data.message);case 12:throw new Error(n.scriptData.labels.error.generic);case 13:c()?(s(!0),l()):location.href=u(),t.n=15;break;case 14:throw t.p=14,P=t.v,console.error(P),d(!1),f(P.message),p(),P;case 15:return t.a(2)}},t,null,[[1,14]])}));return function(e,r,n,o,i,a,c,u,s,l,f,p,d){return t.apply(this,arguments)}}(),Mt=function(){var t=It(kt().m(function t(e,r,n){var o;return kt().w(function(t){for(;;)if(0===t.n)return o=n.scriptData.subscription_plan_id,""!==n.scriptData.variable_paypal_subscription_variation_from_cart&&(o=n.scriptData.variable_paypal_subscription_variation_from_cart),t.a(2,r.subscription.create({plan_id:o}))},t)}));return function(e,r,n){return t.apply(this,arguments)}}(),Bt=function(){var t=It(kt().m(function t(e,r,n,o,i,a,c,u,s,l,f,p){var d,y,v,b,m,h,g;return kt().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,r.subscription.get();case 1:if(!(d=t.v)){t.n=2;break}return y=dt(d),v=[wp.data.dispatch("wc/store/cart").updateCustomerData({billing_address:y.billingAddress,shipping_address:y.shippingAddress})],o()&&(v.push(wp.data.dispatch("wc/store/cart").setBillingAddress(y.billingAddress)),i.needsShipping&&v.push(wp.data.dispatch("wc/store/cart").setShippingAddress(y.shippingAddress))),t.n=2,Promise.all(v);case 2:return a(d),t.n=3,fetch(n.scriptData.ajax.approve_subscription.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:n.scriptData.ajax.approve_subscription.nonce,order_id:e.orderID,subscription_id:e.subscriptionID})});case 3:return b=t.v,t.n=4,b.json();case 4:if((m=t.v).success){t.n=7;break}if(void 0===r||void 0===r.restart){t.n=5;break}return t.a(2,r.restart());case 5:if(null===(h=m.data)||void 0===h||!h.message){t.n=6;break}throw new Error(m.data.message);case 6:throw new Error(n.scriptData.labels.error.generic);case 7:c()?(s(!0),l()):location.href=u(),t.n=9;break;case 8:throw t.p=8,g=t.v,console.error(g),f(g.message),p(),g;case 9:return t.a(2)}},t,null,[[0,8]])}));return function(e,r,n,o,i,a,c,u,s,l,f,p){return t.apply(this,arguments)}}(),Ft=function(){var t=It(kt().m(function t(e){return kt().w(function(t){for(;;)if(0===t.n)return t.a(2,fetch(e.scriptData.ajax.create_setup_token.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:e.scriptData.ajax.create_setup_token.nonce,payment_method:"ppcp-gateway"})}).then(function(t){return t.json()}).then(function(t){return t.data.id}).catch(function(t){console.error(t)}))},t)}));return function(e){return t.apply(this,arguments)}}(),Gt=function(){var t=It(kt().m(function t(e,r,n){var o,i,a,c;return kt().w(function(t){for(;;)switch(t.n){case 0:return o=r.scriptData.ajax.create_payment_token_for_guest.endpoint,i={nonce:r.scriptData.ajax.create_payment_token_for_guest.nonce,vault_setup_token:e},r.scriptData.user.is_logged_in&&(o=r.scriptData.ajax.create_payment_token.endpoint,i={nonce:r.scriptData.ajax.create_payment_token.nonce,vault_setup_token:e,is_free_trial_cart:r.scriptData.is_free_trial_cart}),t.n=1,fetch(o,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});case 1:return a=t.v,t.n=2,a.json();case 2:!0===(c=t.v).success&&n(),console.error(c);case 3:return t.a(2)}},t)}));return function(e,r,n){return t.apply(this,arguments)}}();const Lt=window.React;var qt=r.n(Lt);function Ut(t){return Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(t)}function Jt(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"form.woocommerce-checkout";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.target=e}return e=t,n=[{key:"fullPage",value:function(){return new t(window)}}],(r=[{key:"setTarget",value:function(t){this.target=t}},{key:"block",value:function(){jQuery(this.target).block({message:null,overlayCSS:{background:"#fff",opacity:.6},baseZ:1e4})}},{key:"unblock",value:function(){jQuery(this.target).unblock()}}])&&Jt(e.prototype,r),n&&Jt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();const Qt=Ht;function Vt(t){return Vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vt(t)}function Kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function $t(t){for(var e=1;e3?(o=y===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&dn||n>y)&&(i[4]=r,i[5]=n,p.n=y,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Xt(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Xt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Xt(f,"constructor",s),Xt(s,"constructor",u),u.displayName="GeneratorFunction",Xt(s,o,"GeneratorFunction"),Xt(f),Xt(f,o,"Generator"),Xt(f,n,function(){return this}),Xt(f,"toString",function(){return"[object Generator]"}),(Zt=function(){return{w:i,m:p}})()}function Xt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Xt=function(t,e,r,n){function i(e,r){Xt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},Xt(t,e,r,n)}function Yt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function te(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Yt(i,n,o,a,c,"next",t)}function c(t){Yt(i,n,o,a,c,"throw",t)}a(void 0)})}}function ee(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return re(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r because window.").concat(a,".").concat(c," is undefined."),s="string"==typeof o?o:o.join(",");if(!s.includes(r)){var l=[s,r].filter(Boolean).join();u+="\nTo fix the issue, add '".concat(r,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n``.")}return u}function Se(t){var e=t,r=de;e[r];var n=fe(e,[r+""]);return"react-paypal-js-".concat(function(t){for(var e="",r=0;r component. Failed to initialize: ".concat(t))})}return!1===v.current.isEligible()?(P(!1),k):y.current?(v.current.render(y.current).catch(function(t){null!==y.current&&0!==y.current.children.length&&E(function(){throw new Error("Failed to render component. ".concat(t))})}),k):k},pe(pe([h],l,!0),[f.fundingSource],!1)),(0,Lt.useEffect)(function(){null!==S&&(!0===c?S.disable().catch(function(){}):S.enable().catch(function(){}))},[c,S]),qt().createElement(qt().Fragment,null,_?qt().createElement("div",{ref:y,style:p,className:d}):u)};function Ee(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach(function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])}),r}function ke(t,e){if(void 0===e&&(e=Promise),Te(t,e),"undefined"==typeof document)return e.resolve(null);var r=function(t){var e,r,n=t.sdkBaseUrl,o=t.environment,i=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o component. ".concat(t))})})}(t.Marks(le({},o)))}},[a,o.fundingSource]),qt().createElement(qt().Fragment,null,l?qt().createElement("div",{ref:u,className:r}):n)};De.displayName="PayPalMarks";var Re=function(t){var e=t.className,r=void 0===e?"":e,n=t.forceReRender,o=void 0===n?[]:n,i=fe(t,["className","forceReRender"]),a=_e()[0],c=a.isResolved,u=a.options,s=(0,Lt.useRef)(null),l=(0,Lt.useRef)(null),f=(0,Lt.useState)(null)[1];return(0,Lt.useEffect)(function(){if(!1!==c){var t=ge(u[ve]);if(void 0===t||void 0===t.Messages)return f(function(){throw new Error(we({reactComponentName:Re.displayName,sdkComponentKey:"messages",sdkRequestedComponents:u.components,sdkDataNamespace:u[ve]}))});l.current=t.Messages(le({},i)),l.current.render(s.current).catch(function(t){null!==s.current&&0!==s.current.children.length&&f(function(){throw new Error("Failed to render component. ".concat(t))})})}},pe([c],o,!0)),qt().createElement("div",{ref:s,className:r})};Re.displayName="PayPalMessages";var xe=function(t){var e,r=t.options,n=void 0===r?{clientId:"test"}:r,o=t.children,i=t.deferLoading,a=void 0!==i&&i,c=(0,Lt.useReducer)(Oe,{options:le(le({},n),(e={},e.dataJsSdkLibrary=ye,e[be]=ye,e[de]="".concat(Se(n)),e)),loadingStatus:a?ne.INITIAL:ne.PENDING}),u=c[0],s=c[1];return(0,Lt.useEffect)(function(){if(!1===a&&u.loadingStatus===ne.INITIAL)return s({type:oe.LOADING_STATUS,value:ne.PENDING});if(u.loadingStatus===ne.PENDING){var t=!0;return ke(u.options).then(function(){t&&s({type:oe.LOADING_STATUS,value:ne.RESOLVED})}).catch(function(e){console.error("".concat("Failed to load the PayPal JS SDK script."," ").concat(e)),t&&s({type:oe.LOADING_STATUS,value:{state:ne.REJECTED,message:String(e)}})}),function(){t=!1}}},[u.options,a,u.loadingStatus]),qt().createElement(je.Provider,{value:le(le({},u),{dispatch:s})},o)};function Ie(){}function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Ne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Me(t){for(var e=1;e3?(o=y===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&dn||n>y)&&(i[4]=r,i[5]=n,p.n=y,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(qe(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,qe(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,qe(f,"constructor",s),qe(s,"constructor",u),u.displayName="GeneratorFunction",qe(s,o,"GeneratorFunction"),qe(f),qe(f,o,"Generator"),qe(f,n,function(){return this}),qe(f,"toString",function(){return"[object Generator]"}),(Le=function(){return{w:i,m:p}})()}function qe(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}qe=function(t,e,r,n){function i(e,r){qe(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},qe(t,e,r,n)}function Ue(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Je(t,e){if(t){if("string"==typeof t)return We(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?We(t,e):void 0}}function We(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0},supports:{features:$e}})}if(He.scriptData.continuation)(0,n.registerPaymentMethod)({name:He.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:He.title}}),content:React.createElement(se,{config:He,isEditing:!1}),edit:React.createElement(Fe,{config:He,fundingSource:"paypal"}),ariaLabel:He.title,canMakePayment:function(){return!0},supports:{features:[].concat($e,["ppcp_continuation"])}});else if(He.smartButtonsEnabled){var Xe,Ye=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Je(t))){e&&(t=e);var _n=0,r=function(){};return{s:r,n:function(){return _n>=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,i=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return o=t.done,t},e:function(t){i=!0,n=t},f:function(){try{o||null==e.return||e.return()}finally{if(i)throw n}}}}(He.scriptData.is_free_trial_cart?["paypal"]:["paypal"].concat(function(t){if(Array.isArray(t))return We(t)}(Ve=He.enabledFundingSources)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(Ve)||Je(Ve)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));try{var tr=function(){var t,e,r=Xe.value;(0,n.registerExpressPaymentMethod)({name:"".concat(He.id,"-").concat(r),title:"PayPal",description:(0,o.__)("Eligible users will see the PayPal button.","woocommerce-paypal-payments"),gatewayId:"ppcp-gateway",paymentMethodId:He.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:He.title}}),content:React.createElement(se,{config:He,isEditing:!1,fundingSource:r}),edit:React.createElement(Fe,{config:He,fundingSource:r}),ariaLabel:He.title,canMakePayment:(t=Le().m(function t(){return Le().w(function(t){for(;;)switch(t.n){case 0:return Ke||(Ke=M("ppcpBlocksPaypalExpressButtons",He.scriptData)).then(function(){new rt(He.scriptData).init()}),t.n=1,Ke;case 1:return t.a(2,ppcpBlocksPaypalExpressButtons.Buttons({fundingSource:r}).isEligible())}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Ue(i,n,o,a,c,"next",t)}function c(t){Ue(i,n,o,a,c,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)}),supports:{features:$e,style:["height","borderRadius"]}})};for(Ye.s();!(Xe=Ye.n()).done;)tr()}catch(t){Ye.e(t)}finally{Ye.f()}}}})();