"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[634],{5021:function(e,t,n){n.d(t,{Vv:function(){return C},ch:function(){return P}});var r,a,o,i,c,s,u=n(7294);(i=r||(r={})).INITIAL="initial",i.PENDING="pending",i.REJECTED="rejected",i.RESOLVED="resolved",(c=a||(a={})).LOADING_STATUS="setLoadingStatus",c.RESET_OPTIONS="resetOptions",c.SET_BRAINTREE_INSTANCE="braintreeInstance",(s=o||(o={})).NUMBER="number",s.CVV="cvv",s.EXPIRATION_DATE="expirationDate",s.EXPIRATION_MONTH="expirationMonth",s.EXPIRATION_YEAR="expirationYear",s.POSTAL_CODE="postalCode";var l=function(){return(l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function d(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>t.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function p(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var f="data-react-paypal-script-id",A={DATA_CLIENT_TOKEN:"dataClientToken",DATA_JS_SDK_LIBRARY:"dataJsSdkLibrary",DATA_LIBRARY_VALUE:"react-paypal-js",DATA_NAMESPACE:"dataNamespace",DATA_SDK_INTEGRATION_SOURCE:"dataSdkIntegrationSource",DATA_USER_ID_TOKEN:"dataUserIdToken"},E="3.84.0";"https://js.braintreegateway.com/web/".concat(E,"/js/client.min.js"),"https://js.braintreegateway.com/web/".concat(E,"/js/paypal-checkout.min.js");var m="paypal";function v(e){return void 0===e&&(e=m),window[e]}function y(e){var t=e.reactComponentName,n=e.sdkComponentKey,r=e.sdkRequestedComponents,a=void 0===r?"":r,o=e.sdkDataNamespace,i=n.charAt(0).toUpperCase().concat(n.substring(1)),c="Unable to render <".concat(t," /> because window.").concat(void 0===o?m:o,".").concat(i," is undefined."),s="string"==typeof a?a:a.join(",");if(!s.includes(n)){var u=[s,n].filter(Boolean).join();c+="\nTo fix the issue, add '".concat(n,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n`<PayPalScriptProvider options={{ components: '".concat(u,"'}}>`.")}return c}function h(e){e[f];var t=d(e,[f+""]);return"react-paypal-js-".concat(function(e){for(var t="",n=0;n<e.length;n++){var r=e[n].charCodeAt(0)*n;e[n+1]&&(r+=e[n+1].charCodeAt(0)*(n-1)),t+=String.fromCharCode(97+Math.abs(r)%26)}return t}(JSON.stringify(t)))}function S(e,t){var n,o,i,c;switch(t.type){case a.LOADING_STATUS:if("object"==typeof t.value)return l(l({},e),{loadingStatus:t.value.state,loadingStatusErrorMessage:t.value.message});return l(l({},e),{loadingStatus:t.value});case a.RESET_OPTIONS:return i=e.options[f],(null==(c=self.document.querySelector("script[".concat(f,'="').concat(i,'"]')))?void 0:c.parentNode)&&c.parentNode.removeChild(c),l(l({},e),{loadingStatus:r.PENDING,options:l(l(((n={})[A.DATA_SDK_INTEGRATION_SOURCE]=A.DATA_LIBRARY_VALUE,n),t.value),((o={})[f]="".concat(h(t.value)),o))});case a.SET_BRAINTREE_INSTANCE:return l(l({},e),{braintreePayPalCheckoutInstance:t.value});default:return e}}var T=(0,u.createContext)(null);function N(){var e=function(e){if("function"==typeof(null==e?void 0:e.dispatch)&&0!==e.dispatch.length)return e;throw Error("usePayPalScriptReducer must be used within a PayPalScriptProvider")}((0,u.useContext)(T));return[l(l({},e),{isInitial:e.loadingStatus===r.INITIAL,isPending:e.loadingStatus===r.PENDING,isResolved:e.loadingStatus===r.RESOLVED,isRejected:e.loadingStatus===r.REJECTED}),e.dispatch]}(0,u.createContext)({});var P=function(e){var t,n=e.className,r=e.disabled,a=void 0!==r&&r,o=e.children,i=e.forceReRender,c=d(e,["className","disabled","children","forceReRender"]),s="".concat(void 0===n?"":n," ").concat(a?"paypal-buttons-disabled":"").trim(),f=(0,u.useRef)(null),E=(0,u.useRef)(null),m=N()[0],h=m.isResolved,S=m.options,T=(0,u.useState)(null),b=T[0],I=T[1],O=(0,u.useState)(!0),R=O[0],g=O[1],C=(0,u.useState)(null)[1];function D(){null!==E.current&&E.current.close().catch(function(){})}return(null===(t=E.current)||void 0===t?void 0:t.updateProps)&&E.current.updateProps({message:c.message}),(0,u.useEffect)(function(){if(!1===h)return D;var e=v(S.dataNamespace);if(void 0===e||void 0===e.Buttons)return C(function(){throw Error(y({reactComponentName:P.displayName,sdkComponentKey:"buttons",sdkRequestedComponents:S.components,sdkDataNamespace:S[A.DATA_NAMESPACE]}))}),D;var t=function(e,t){I(t),"function"==typeof c.onInit&&c.onInit(e,t)};try{E.current=e.Buttons(l(l({},c),{onInit:t}))}catch(n){return C(function(){throw Error("Failed to render <PayPalButtons /> component. Failed to initialize:  ".concat(n))})}return!1===E.current.isEligible()?(g(!1),D):(f.current&&E.current.render(f.current).catch(function(e){null!==f.current&&0!==f.current.children.length&&C(function(){throw Error("Failed to render <PayPalButtons /> component. ".concat(e))})}),D)},p(p([h],void 0===i?[]:i,!0),[c.fundingSource],!1)),(0,u.useEffect)(function(){null!==b&&(!0===a?b.disable().catch(function(){}):b.enable().catch(function(){}))},[a,b]),u.createElement(u.Fragment,null,R?u.createElement("div",{ref:f,style:a?{opacity:.38}:{},className:s}):o)};function b(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 I(e){return window[e]}function O(e,t){if("object"!=typeof e||null===e)throw Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==t&&"function"!=typeof t)throw Error("Expected PromisePonyfill to be a function.")}P.displayName="PayPalButtons";var R=function(e){var t=e.className,n=e.children,r=d(e,["className","children"]),a=N()[0],o=a.isResolved,i=a.options,c=(0,u.useRef)(null),s=(0,u.useState)(!0),p=s[0],f=s[1],E=(0,u.useState)(null)[1],m=function(e){var t=c.current;if(!t||!e.isEligible())return f(!1);t.firstChild&&t.removeChild(t.firstChild),e.render(t).catch(function(e){null!==t&&0!==t.children.length&&E(function(){throw Error("Failed to render <PayPalMarks /> component. ".concat(e))})})};return(0,u.useEffect)(function(){if(!1!==o){var e=v(i[A.DATA_NAMESPACE]);if(void 0===e||void 0===e.Marks)return E(function(){throw Error(y({reactComponentName:R.displayName,sdkComponentKey:"marks",sdkRequestedComponents:i.components,sdkDataNamespace:i[A.DATA_NAMESPACE]}))});m(e.Marks(l({},r)))}},[o,r.fundingSource]),u.createElement(u.Fragment,null,p?u.createElement("div",{ref:c,className:void 0===t?"":t}):n)};R.displayName="PayPalMarks";var g=function(e){var t=e.className,n=e.forceReRender,r=d(e,["className","forceReRender"]),a=N()[0],o=a.isResolved,i=a.options,c=(0,u.useRef)(null),s=(0,u.useRef)(null),f=(0,u.useState)(null)[1];return(0,u.useEffect)(function(){if(!1!==o){var e=v(i[A.DATA_NAMESPACE]);if(void 0===e||void 0===e.Messages)return f(function(){throw Error(y({reactComponentName:g.displayName,sdkComponentKey:"messages",sdkRequestedComponents:i.components,sdkDataNamespace:i[A.DATA_NAMESPACE]}))});s.current=e.Messages(l({},r)),s.current.render(c.current).catch(function(e){null!==c.current&&0!==c.current.children.length&&f(function(){throw Error("Failed to render <PayPalMessages /> component. ".concat(e))})})}},p([o],void 0===n?[]:n,!0)),u.createElement("div",{ref:c,className:void 0===t?"":t})};g.displayName="PayPalMessages";var C=function(e){var t,n=e.options,o=void 0===n?{clientId:"test"}:n,i=e.children,c=e.deferLoading,s=void 0!==c&&c,d=(0,u.useReducer)(S,{options:l(l({},o),((t={})[A.DATA_JS_SDK_LIBRARY]=A.DATA_LIBRARY_VALUE,t[A.DATA_SDK_INTEGRATION_SOURCE]=A.DATA_LIBRARY_VALUE,t[f]="".concat(h(o)),t)),loadingStatus:s?r.INITIAL:r.PENDING}),p=d[0],E=d[1];return(0,u.useEffect)(function(){if(!1===s&&p.loadingStatus===r.INITIAL)return E({type:a.LOADING_STATUS,value:r.PENDING});if(p.loadingStatus===r.PENDING){var e=!0;return(function(e,t){if(void 0===t&&(t=Promise),O(e,t),"undefined"==typeof document)return t.resolve(null);var n,r,a,o,i,c,s,u=(o="sandbox"===e.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js",delete e.environment,e.sdkBaseUrl&&(o=e.sdkBaseUrl,delete e.sdkBaseUrl),c=(i=Object.keys(e).filter(function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]}).reduce(function(t,n){var r,a,o=e[n].toString();return"data"===(r=n,a=function(e,t){return(t?"-":"")+e.toLowerCase()},n=r.replace(/[A-Z]+(?![a-z])|[A-Z]/g,a)).substring(0,4)||"crossorigin"===n?t.attributes[n]=o:t.queryParams[n]=o,t},{queryParams:{},attributes:{}})).queryParams,s=i.attributes,c["merchant-id"]&&-1!==c["merchant-id"].indexOf(",")&&(s["data-merchant-id"]=c["merchant-id"],c["merchant-id"]="*"),{url:"".concat(o,"?").concat((n=c,r="",Object.keys(n).forEach(function(e){0!==r.length&&(r+="&"),r+=e+"="+n[e]}),r)),attributes:s}),l=u.url,d=u.attributes,p=d["data-namespace"]||"paypal",f=I(p);return(d["data-js-sdk-library"]||(d["data-js-sdk-library"]="paypal-js"),function(e,t){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var r=b(e,t),a=n.cloneNode();if(delete a.dataset.uidAuto,Object.keys(a.dataset).length!==Object.keys(r.dataset).length)return null;var o=!0;return Object.keys(a.dataset).forEach(function(e){a.dataset[e]!==r.dataset[e]&&(o=!1)}),o?n:null}(l,d)&&f)?t.resolve(f):(function(e,t){void 0===t&&(t=Promise),O(e,t);var n=e.url,r=e.attributes;if("string"!=typeof n||0===n.length)throw Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)throw Error("Expected attributes to be an object.");return new t(function(e,t){var a,o,i,c,s,u;if("undefined"==typeof document)return e();o=(a={url:n,attributes:r,onSuccess:function(){return e()},onError:function(){return t(Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.')))}}).url,i=a.attributes,c=a.onSuccess,s=a.onError,(u=b(o,i)).onerror=s,u.onload=c,document.head.insertBefore(u,document.head.firstElementChild)})})({url:l,attributes:d},t).then(function(){var e=I(p);if(e)return e;throw Error("The window.".concat(p," global variable is not available."))})})(p.options).then(function(){e&&E({type:a.LOADING_STATUS,value:r.RESOLVED})}).catch(function(t){console.error("".concat("Failed to load the PayPal JS SDK script."," ").concat(t)),e&&E({type:a.LOADING_STATUS,value:{state:r.REJECTED,message:String(t)}})}),function(){e=!1}}},[p.options,s,p.loadingStatus]),u.createElement(T.Provider,{value:l(l({},p),{dispatch:E})},i)};function D(){}(0,u.createContext)({cardFieldsForm:null,fields:{},registerField:D,unregisterField:D});var _={PAYPAL:"paypal",VENMO:"venmo",APPLEPAY:"applepay",ITAU:"itau",CREDIT:"credit",PAYLATER:"paylater",CARD:"card",IDEAL:"ideal",SEPA:"sepa",BANCONTACT:"bancontact",GIROPAY:"giropay",SOFORT:"sofort",EPS:"eps",MYBANK:"mybank",P24:"p24",PAYU:"payu",BLIK:"blik",TRUSTLY:"trustly",OXXO:"oxxo",BOLETO:"boleto",BOLETOBANCARIO:"boletobancario",WECHATPAY:"wechatpay",MERCADOPAGO:"mercadopago",MULTIBANCO:"multibanco",SATISPAY:"satispay",PAIDY:"paidy",ZIMPLER:"zimpler",MAXIMA:"maxima"};_.IDEAL,_.BANCONTACT,_.GIROPAY,_.SOFORT,_.EPS,_.MYBANK,_.P24,_.PAYU,_.BLIK,_.TRUSTLY,_.OXXO,_.BOLETO,_.BOLETOBANCARIO,_.WECHATPAY,_.MERCADOPAGO,_.MULTIBANCO,_.SATISPAY,_.PAIDY,_.MAXIMA,_.ZIMPLER},9815:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(943),a=n(3375),o=n(1566);function i(e){return function(e){if(Array.isArray(e))return(0,r.Z)(e)}(e)||(0,a.Z)(e)||(0,o.Z)(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}}]);