(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,n=window.wp.i18n,r=window.wp.element,a=window.wp.blockEditor,o=window.wp.components,c=window.React;var i,l,s,u=e.n(c);!function(e){e.INITIAL="initial",e.PENDING="pending",e.REJECTED="rejected",e.RESOLVED="resolved"}(i||(i={})),function(e){e.LOADING_STATUS="setLoadingStatus",e.RESET_OPTIONS="resetOptions",e.SET_BRAINTREE_INSTANCE="braintreeInstance"}(l||(l={})),function(e){e.NUMBER="number",e.CVV="cvv",e.EXPIRATION_DATE="expirationDate",e.EXPIRATION_MONTH="expirationMonth",e.EXPIRATION_YEAR="expirationYear",e.POSTAL_CODE="postalCode"}(s||(s={}));var p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n because window.").concat(c,".").concat(i," is undefined."),s="string"==typeof a?a:a.join(",");if(!s.includes(n)){var u=[s,n].filter(Boolean).join();l+="\nTo fix the issue, add '".concat(n,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n``.")}return l}function w(e){var t=e,n=m;t[n];var r=d(t,[n+""]);return"react-paypal-js-".concat(function(e){for(var t="",n=0;n component. Failed to initialize: ".concat(e))})}return!1===S.current.isEligible()?(x(!1),B):w.current?(S.current.render(w.current).catch(function(e){null!==w.current&&0!==w.current.children.length&&D(function(){throw new Error("Failed to render component. ".concat(e))})}),B):B},f(f([j],y,!0),[h.fundingSource],!1)),(0,c.useEffect)(function(){null!==_&&(!0===l?_.disable().catch(function(){}):_.enable().catch(function(){}))},[l,_]),u().createElement(u().Fragment,null,L?u().createElement("div",{ref:w,style:b,className:g}):s)};function R(e,t){void 0===t&&(t={});var n=document.createElement("script");return n.src=e,Object.keys(t).forEach(function(e){n.setAttribute(e,t[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",t["data-csp-nonce"])}),n}function j(e,t){if(void 0===t&&(t=Promise),I(e,t),"undefined"==typeof document)return t.resolve(null);var n=function(e){var t,n,r=e.sdkBaseUrl,a=e.environment,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a component. ".concat(e))})})}(e.Marks(p({},a)))}},[i,a.fundingSource]),u().createElement(u().Fragment,null,m?u().createElement("div",{ref:s,className:n}):r)};_.displayName="PayPalMarks";var T=function(e){var t=e.className,n=void 0===t?"":t,r=e.forceReRender,a=void 0===r?[]:r,o=d(e,["className","forceReRender"]),i=O()[0],l=i.isResolved,s=i.options,m=(0,c.useRef)(null),y=(0,c.useRef)(null),h=(0,c.useState)(null)[1];return(0,c.useEffect)(function(){if(!1!==l){var e=P(s[v]);if(void 0===e||void 0===e.Messages)return h(function(){throw new Error(E({reactComponentName:T.displayName,sdkComponentKey:"messages",sdkRequestedComponents:s.components,sdkDataNamespace:s[v]}))});y.current=e.Messages(p({},o)),y.current.render(m.current).catch(function(e){null!==m.current&&0!==m.current.children.length&&h(function(){throw new Error("Failed to render component. ".concat(e))})})}},f([l],a,!0)),u().createElement("div",{ref:m,className:n})};T.displayName="PayPalMessages";var A=function(e){var t,n=e.options,r=void 0===n?{clientId:"test"}:n,a=e.children,o=e.deferLoading,s=void 0!==o&&o,d=(0,c.useReducer)(S,{options:p(p({},r),(t={},t.dataJsSdkLibrary=y,t[h]=y,t[m]="".concat(w(r)),t)),loadingStatus:s?i.INITIAL:i.PENDING}),f=d[0],v=d[1];return(0,c.useEffect)(function(){if(!1===s&&f.loadingStatus===i.INITIAL)return v({type:l.LOADING_STATUS,value:i.PENDING});if(f.loadingStatus===i.PENDING){var e=!0;return j(f.options).then(function(){e&&v({type:l.LOADING_STATUS,value:i.RESOLVED})}).catch(function(t){console.error("".concat("Failed to load the PayPal JS SDK script."," ").concat(t)),e&&v({type:l.LOADING_STATUS,value:{state:i.REJECTED,message:String(t)}})}),function(){e=!1}}},[f.options,s,f.loadingStatus]),u().createElement(k.Provider,{value:p(p({},f),{dispatch:v})},a)};function L(){}function x(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof i?r:i,s=Object.create(l.prototype);return D(s,"_invoke",function(n,r,a){var o,i,l,s=0,u=a||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,i=0,l=e,d.n=n,c}};function f(n,r){for(i=n,l=r,t=0;!p&&s&&!a&&t3?(a=m===r)&&(l=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=f&&((a=n<2&&fr||r>m)&&(o[4]=n,o[5]=r,d.n=m,i=0))}if(a||n>1)return c;throw p=!0,r}return function(a,u,m){if(s>1)throw TypeError("Generator is already running");for(p&&1===u&&f(u,m),i=u,l=m;(t=i<2?e:l)||!p;){o||(i?i<3?(i>1&&(d.n=-1),f(i,l)):d.n=l:d.v=l);try{if(s=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(p=d.n<0)?l:n.call(r,d))!==c)break}catch(t){o=e,i=1,l=t}finally{s=1}}return{value:t,done:p}}}(n,a,o),!0),s}var c={};function i(){}function l(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(D(t={},r,function(){return this}),t),p=s.prototype=i.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,D(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return l.prototype=s,D(p,"constructor",s),D(s,"constructor",l),l.displayName="GeneratorFunction",D(s,a,"GeneratorFunction"),D(p),D(p,a,"Generator"),D(p,r,function(){return this}),D(p,"toString",function(){return"[object Generator]"}),(x=function(){return{w:o,m:d}})()}function D(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}D=function(e,t,n,r){function o(t,n){D(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},D(e,t,n,r)}function B(e,t,n,r,a,o,c){try{var i=e[o](c),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n