{"version":3,"sources":["webpack:///./node_modules/@stripe/stripe-js/dist/stripe.esm.js","webpack:///./src/components/StripeForm.js","webpack:///./src/pages/payment/index.js","webpack:///./node_modules/uuid/dist/esm-browser/rng.js","webpack:///./node_modules/uuid/dist/esm-browser/regex.js","webpack:///./node_modules/uuid/dist/esm-browser/stringify.js","webpack:///./node_modules/uuid/dist/esm-browser/validate.js","webpack:///./node_modules/uuid/dist/esm-browser/v4.js","webpack:///./node_modules/@stripe/react-stripe-js/dist/react-stripe.umd.js"],"names":["V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","stripePromise","loadScript","params","Promise","resolve","reject","window","document","Stripe","console","warn","script","scripts","querySelectorAll","concat","i","length","test","src","findScript","queryString","advancedFraudSignals","createElement","headOrBody","head","body","Error","appendChild","injectScript","addEventListener","error","initStripe","maybeStripe","args","startTime","stripe","apply","undefined","_registerWrapper","name","version","registerWrapper","stripePromise$1","then","loadCalled","err","CARD_ELEMENT_OPTIONS","style","base","fontSize","color","fontFamily","letterSpacing","lineHeight","invalid","AdminFeeInfo","___EmotionJSX","className","data-toggle","data-tooltip","data-placement","role","aria-label","StripeForm","_ref","setField","paymentInfo","useStripe","elements","useElements","isCreditReady","setIsCreditReady","useState","formStatus","setFormStatus","message","loading","onSubmit","async","event","preventDefault","_await$axios$post","floatSafePaymentAmt","Math","floor","totalAmount","paymentIntent","axios","post","qs","stringify","amount","currency","payment_method_types","headers","Authorization","data","result","confirmCardPayment","client_secret","payment_method","card","getElement","CardElement","billing_details","email","_paymentInfo$totalAmo","API","createPayment","id","uuid","clientName","clientEmail","businessName","stripeID","Lambda","sendEmail","IS_NOTIFICATION","TO","FROM","subject","toLocaleString","Date","toDateString","clear","Util","LogError","errors","Text","center","fontStyle","paddingBottom","Input","type","prepend","placeholder","value","onChange","required","disabled","step","label","append","adminFee","inputStyles","height","width","border","borderRadius","paddingLeft","customComponent","options","complete","ClipLoader","size","Button","Object","keys","_len","arguments","Array","_key","now","loadStripe","process","Payment","props","setPaymentInfo","Layout","bodyClass","SEO","title","Elements","e","target","payAmt","Number","toFixed","getRandomValues","rnds8","Uint8Array","rng","crypto","bind","msCrypto","byteToHex","push","toString","substr","arr","offset","toLowerCase","TypeError","buf","rnds","random","exports","React","ownKeys","object","enumerableOnly","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","_objectSpread2","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","constructor","prototype","configurable","writable","_slicedToArray","isArray","_arrayWithHoles","_i","_s","_e","_arr","_n","_d","call","next","done","_iterableToArrayLimit","o","minLen","_arrayLikeToArray","n","slice","from","_unsupportedIterableToArray","_nonIterableRest","len","arr2","emptyFunction","emptyFunctionWithReset","hasOwnProperty","resetWarningCache","propTypes","fn","module","createCommonjsModule","shim","propName","componentName","location","propFullName","secret","getShim","isRequired","ReactPropTypes","array","bool","func","number","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","factoryWithThrowingShims","usePrevious","ref","useRef","useEffect","current","isUnknownObject","raw","extractAllowedOptionsUpdates","prevOptions","immutableKeys","reduce","newOptions","isUpdated","isEqual","left","right","leftArray","leftPlainObject","leftKeys","rightKeys","keySet","allKeys","l","r","every","includes","validateStripe","createToken","createPaymentMethod","parseStripeProp","isPromise","tag","ElementsContext","createContext","displayName","CartElementContext","useElementsContextWithUseCase","useCaseMessage","ctx","useCase","parseElementsContext","useContext","useCartElementContextWithUseCase","parseCartElementContext","ElementsConsumer","_ref2","children","useAttachEvent","cb","cbDefined","cbRef","decoratedCb","on","off","createElementComponent","isServer","str","charAt","toUpperCase","Element","readyCallback","_ref$options","onBlur","onFocus","onReady","onEscape","onClick","onLoadError","onLoaderStart","onNetworksChange","onCheckout","onLineItemClick","onConfirm","onCancel","onShippingAddressChange","onShippingRateChange","_React$useState2","setElement","elementRef","domNode","_useCartElementContex","setCart","setCartState","useLayoutEffect","newElement","create","mount","updates","update","destroy","__elementType","AuBankAccountElement","CardNumberElement","CardExpiryElement","CardCvcElement","FpxBankElement","IbanElement","IdealBankElement","P24BankElement","EpsBankElement","PaymentElement","PayButtonElement","PaymentRequestButtonElement","LinkAuthenticationElement","AddressElement","ShippingAddressElement","CartElement","PaymentMethodMessagingElement","AffirmMessageElement","AfterpayClearpayMessageElement","rawStripeProp","parsed","useMemo","cart","_React$useState4","cartState","_React$useState6","setContext","isMounted","safeSetContext","prevStripe","anyStripe","registerAppInfo","url","Provider","useCartElement","useCartElementState","factory"],"mappings":"qHAAIA,EAAS,2BACTC,EAAe,4CACfC,EAA0B,mJAiC1BC,EAAgB,KAChBC,EAAa,SAAoBC,GAEnC,OAAsB,OAAlBF,EACKA,EAETA,EAAgB,IAAIG,SAAQ,SAAUC,EAASC,GAC7C,GAAsB,oBAAXC,QAA8C,oBAAbC,SAS5C,GAHID,OAAOE,QAAUN,GACnBO,QAAQC,KAAKX,GAEXO,OAAOE,OACTJ,EAAQE,OAAOE,aAGjB,IACE,IAAIG,EArDO,WAEf,IADA,IAAIC,EAAUL,SAASM,iBAAiB,gBAAiBC,OAAOjB,EAAQ,OAC/DkB,EAAI,EAAGA,EAAIH,EAAQI,OAAQD,IAAK,CACvC,IAAIJ,EAASC,EAAQG,GACrB,GAAKjB,EAAamB,KAAKN,EAAOO,KAG9B,OAAOP,EAET,OAAO,KA4CUQ,GACTR,GAAUT,EACZO,QAAQC,KAAKX,GACHY,IACVA,EA9CW,SAAsBT,GACvC,IAAIkB,EAAclB,IAAWA,EAAOmB,qBAAuB,8BAAgC,GACvFV,EAASJ,SAASe,cAAc,UACpCX,EAAOO,IAAM,GAAGJ,OAAOjB,GAAQiB,OAAOM,GACtC,IAAIG,EAAahB,SAASiB,MAAQjB,SAASkB,KAC3C,IAAKF,EACH,MAAM,IAAIG,MAAM,+EAGlB,OADAH,EAAWI,YAAYhB,GAChBA,EAqCQiB,CAAa1B,IAExBS,EAAOkB,iBAA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AAU9W,iBAAiB,CACzBC,KAAM,kBACNC,QAAS,WAEX4W,EAAUC,gBAAgB,CACxB9W,KAAM,kBACNC,QAAS,SACT8W,IAAK,+CAEN,CAACrF,EAAI9R,SACYkK,EAAM/K,cAAcqS,EAAgB4F,SAAU,CAChE/Q,MAAOyL,GACO5H,EAAM/K,cAAcwS,EAAmByF,SAAU,CAC/D/Q,MAAO,CACLoQ,KAAMA,EACNhC,QAASA,EACTkC,UAAWA,EACXjC,aAAcA,IAEfpC,KAuWLrI,EAAQmI,iBAAmBA,EAC3BnI,EAAQ0L,eAAiBA,EACzB1L,EAAQsL,eAAiBA,EACzBtL,EAAQuL,YAAcA,EACtBvL,EAAQwL,iBAAmBA,EAC3BxL,EAAQ8L,0BAA4BA,EACpC9L,EAAQyL,eAAiBA,EACzBzL,EAAQ4L,iBAAmBA,EAC3B5L,EAAQ2L,eAAiBA,EACzB3L,EAAQkM,8BAAgCA,EACxClM,EAAQ6L,4BAA8BA,EACtC7L,EAAQgM,uBAAyBA,EACjChM,EAAQoN,eAnVa,WAGnB,OAF4BnF,EAAiC,0BAC9BuE,MAkVjCxM,EAAQqN,oBA3UkB,WAGxB,OAF6BpF,EAAiC,+BACzByE,WA0UvC1M,EAAQ/H,YAvWU,WAGhB,OAF4B0P,EAA8B,uBACvB3P,UAsWrCgI,EAAQjI,UA/VQ,WAGd,OAF6B4P,EAA8B,qBACzB5R,QA8VpCyH,OAAO0D,eAAelB,EAAS,aAAc,CAC3C5D,OAAO,IA7wBsDkR,CAAQtN,EAAS,EAAQ","file":"component---src-pages-payment-index-js-645f2562f3b90bec64ca.js","sourcesContent":["var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n return script;\n }\n return null;\n};\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a element.');\n }\n headOrBody.appendChild(script);\n return script;\n};\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.54.2\",\n startTime: startTime\n });\n};\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n try {\n var script = findScript();\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\nexport { loadStripe };","import React, { useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { useStripe, useElements, CardElement } from '@stripe/react-stripe-js'\nimport axios from 'axios'\nimport qs from 'qs'\nimport { ClipLoader } from 'react-spinners'\nimport { v4 as uuid } from 'uuid'\n\nimport { API, Lambda, Util } from '../amplify'\n\nimport Input from './Input'\nimport Button from './Button'\nimport Text from './Text'\n\nconst CARD_ELEMENT_OPTIONS = {\n style: {\n base: {\n fontSize: '17px',\n color: '#495057',\n fontFamily:\n '\"Open Sans\", \"Helvetica Neue\", Arial, sans-serif, -apple-system',\n letterSpacing: '0.025em',\n lineHeight: '40px',\n '::placeholder': {\n color: '#aab7c4',\n },\n },\n invalid: {\n color: '#c23d4b',\n },\n },\n}\n\nconst AdminFeeInfo = () => (\n \n    ❓\n \n)\n\nconst StripeForm = ({ setField, paymentInfo }) => {\n const stripe = useStripe()\n const elements = useElements()\n\n const [isCreditReady, setIsCreditReady] = useState(false)\n const [formStatus, setFormStatus] = useState({\n message: null,\n error: false,\n loading: false,\n })\n\n const onCardChange = event => {\n setIsCreditReady(event.complete)\n }\n\n const handleSubmit = async event => {\n event.preventDefault()\n\n if (!stripe || !elements) {\n return\n }\n setFormStatus({\n message: null,\n error: false,\n loading: true,\n })\n\n try {\n const floatSafePaymentAmt = Math.floor(paymentInfo.totalAmount * 100)\n\n // TODO: Move this to lambda if we really want this to be proper\n const paymentIntent = (\n await axios.post(\n 'https://api.stripe.com/v1/payment_intents',\n qs.stringify({\n amount: floatSafePaymentAmt, // stripe deals in cents\n currency: 'cad', // will we only have to deal with CAD?\n payment_method_types: ['card'],\n }),\n {\n headers: {\n Authorization: `Bearer ${process.env.GATSBY_STRIPE_SECRET_API_KEY}`,\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n },\n )\n )?.data\n\n const result = await stripe.confirmCardPayment(\n paymentIntent.client_secret,\n {\n payment_method: {\n card: elements.getElement(CardElement),\n billing_details: {\n name: paymentInfo.name,\n email: paymentInfo.email,\n },\n },\n },\n )\n\n if (result.error) {\n setFormStatus({\n message: result.error.message,\n error: true,\n loading: false,\n })\n } else {\n // create payment record\n await API.createPayment({\n id: uuid(),\n clientName: paymentInfo.name,\n clientEmail: paymentInfo.email,\n businessName: paymentInfo.businessName,\n totalAmount: floatSafePaymentAmt,\n stripeID: result.paymentIntent.id,\n })\n\n // send emails after payment succeeds\n await Lambda.sendEmail({\n IS_NOTIFICATION: false,\n TO: paymentInfo.email,\n FROM: 'CREDIT',\n subject: 'ADD Capital Payment Receipt',\n body: `Thank you for your payment to ADD Capital. This is a confirmation email for you to keep.

\n Paid by: ${paymentInfo.name}
\n Business: ${paymentInfo.businessName}
\n Total Amount Paid: $${paymentInfo.totalAmount?.toLocaleString(\n 'en-US',\n )}
\n Paid on: ${new Date().toDateString()}`,\n })\n\n // send email to ADD too?\n\n setFormStatus({\n message:\n 'Payment successfully submitted. You will receive an email receipt.',\n error: false,\n loading: false,\n })\n setField('SUCCESS')\n elements.getElement(CardElement).clear()\n }\n } catch (error) {\n Util.LogError('ERROR_STRIPE_PAYMENT', error, paymentInfo)\n\n // if payment succeeds but GQL fails\n if (error?.errors) {\n setFormStatus({\n message:\n 'Payment successfully submitted. You will receive an email receipt.',\n error: false,\n loading: false,\n })\n } else {\n setFormStatus({\n message:\n error.message || 'An unknown error has occured. Please try again!',\n error: true,\n loading: false,\n })\n }\n }\n }\n\n return (\n
\n \n {formStatus.message}\n \n \n \n \n \n }\n step='.001'\n label='Administrative Fee'\n value={paymentInfo.adminFee}\n required\n disabled\n />\n \n }\n />\n {formStatus.loading ? (\n
\n \n
\n ) : (\n \n Confirm Payment\n \n )}\n \n )\n}\n\nStripeForm.propTypes = {\n setField: PropTypes.func,\n paymentInfo: PropTypes.object,\n}\n\nexport default StripeForm\n","import React, { useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { graphql } from 'gatsby'\nimport { loadStripe } from '@stripe/stripe-js'\nimport { Elements } from '@stripe/react-stripe-js'\n\nimport Layout from '../../layouts/index'\nimport SEO from '../../components/SEO'\nimport StripeForm from '../../components/StripeForm'\n\nconst stripePromise = loadStripe(process.env.GATSBY_STRIPE_API_KEY)\n\nconst Payment = props => {\n const [paymentInfo, setPaymentInfo] = useState({\n name: '',\n email: '',\n businessName: '',\n amount: 0.0,\n adminFee: 0.0,\n totalAmount: 0.0,\n })\n\n const setField = e => {\n if (e === 'SUCCESS') {\n setPaymentInfo({\n name: '',\n email: '',\n businessName: '',\n amount: 0.0,\n adminFee: 0.0,\n totalAmount: 0.0,\n })\n } else if (e.target.name === 'amount') {\n const payAmt = Number(e.target.value)\n const adminFee = payAmt * 0.0325\n setPaymentInfo({\n ...paymentInfo,\n amount: payAmt,\n adminFee: Number(adminFee.toFixed(2)),\n totalAmount: Number(Number(payAmt + adminFee).toFixed(2)),\n })\n } else {\n setPaymentInfo({\n ...paymentInfo,\n [e.target.name]: e.target.value,\n })\n }\n }\n\n return (\n \n \n
\n
Payment Centre
\n
\n\n
\n
\n
\n
\n
\n
Total Due
\n
\n {`$${paymentInfo.totalAmount?.toLocaleString('en-US')}`}\n
\n
\n
\n
\n \n \n \n
\n
\n
\n \n )\n}\n\nexport const query = graphql`\n query PaymentQuery {\n allMarkdownRemark(\n filter: { fileAbsolutePath: { regex: \"/payment/\" } }\n sort: { fields: [frontmatter___date], order: DESC }\n ) {\n edges {\n node {\n html\n frontmatter {\n title\n path\n }\n }\n }\n }\n }\n`\n\nPayment.propTypes = {\n data: PropTypes.object,\n}\n\nexport default Payment\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;","import REGEX from './regex.js';\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return stringify(rnds);\n}\nexport default v4;","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : (global = global || self, factory(global.ReactStripe = {}, global.React));\n})(this, function (exports, React) {\n 'use strict';\n\n React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n }\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n }\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n }\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n }\n function _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n }\n function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n function _iterableToArrayLimit(arr, i) {\n var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]);\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n }\n function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n }\n function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n function createCommonjsModule(fn, module) {\n return module = {\n exports: {}\n }, fn(module, module.exports), module.exports;\n }\n\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n var ReactPropTypesSecret_1 = ReactPropTypesSecret;\n function emptyFunction() {}\n function emptyFunctionWithReset() {}\n emptyFunctionWithReset.resetWarningCache = emptyFunction;\n var factoryWithThrowingShims = function () {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret_1) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n err.name = 'Invariant Violation';\n throw err;\n }\n shim.isRequired = shim;\n function getShim() {\n return shim;\n }\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n ReactPropTypes.PropTypes = ReactPropTypes;\n return ReactPropTypes;\n };\n var propTypes = createCommonjsModule(function (module) {\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = factoryWithThrowingShims();\n }\n });\n var usePrevious = function usePrevious(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n };\n var isUnknownObject = function isUnknownObject(raw) {\n return raw !== null && _typeof(raw) === 'object';\n };\n var isPromise = function isPromise(raw) {\n return isUnknownObject(raw) && typeof raw.then === 'function';\n }; // We are using types to enforce the `stripe` prop in this lib,\n // but in an untyped integration `stripe` could be anything, so we need\n // to do some sanity validation to prevent type errors.\n\n var isStripe = function isStripe(raw) {\n return isUnknownObject(raw) && typeof raw.elements === 'function' && typeof raw.createToken === 'function' && typeof raw.createPaymentMethod === 'function' && typeof raw.confirmCardPayment === 'function';\n };\n var PLAIN_OBJECT_STR = '[object Object]';\n var isEqual = function isEqual(left, right) {\n if (!isUnknownObject(left) || !isUnknownObject(right)) {\n return left === right;\n }\n var leftArray = Array.isArray(left);\n var rightArray = Array.isArray(right);\n if (leftArray !== rightArray) return false;\n var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;\n var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;\n if (leftPlainObject !== rightPlainObject) return false; // not sure what sort of special object this is (regexp is one option), so\n // fallback to reference check.\n\n if (!leftPlainObject && !leftArray) return left === right;\n var leftKeys = Object.keys(left);\n var rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) return false;\n var keySet = {};\n for (var i = 0; i < leftKeys.length; i += 1) {\n keySet[leftKeys[i]] = true;\n }\n for (var _i = 0; _i < rightKeys.length; _i += 1) {\n keySet[rightKeys[_i]] = true;\n }\n var allKeys = Object.keys(keySet);\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n var l = left;\n var r = right;\n var pred = function pred(key) {\n return isEqual(l[key], r[key]);\n };\n return allKeys.every(pred);\n };\n var extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates(options, prevOptions, immutableKeys) {\n if (!isUnknownObject(options)) {\n return null;\n }\n return Object.keys(options).reduce(function (newOptions, key) {\n var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);\n if (immutableKeys.includes(key)) {\n if (isUpdated) {\n console.warn(\"Unsupported prop change: options.\".concat(key, \" is not a mutable property.\"));\n }\n return newOptions;\n }\n if (!isUpdated) {\n return newOptions;\n }\n return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));\n }, null);\n };\n var INVALID_STRIPE_ERROR = 'Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.'; // We are using types to enforce the `stripe` prop in this lib, but in a real\n // integration `stripe` could be anything, so we need to do some sanity\n // validation to prevent type errors.\n\n var validateStripe = function validateStripe(maybeStripe) {\n if (maybeStripe === null || isStripe(maybeStripe)) {\n return maybeStripe;\n }\n throw new Error(INVALID_STRIPE_ERROR);\n };\n var parseStripeProp = function parseStripeProp(raw) {\n if (isPromise(raw)) {\n return {\n tag: 'async',\n stripePromise: Promise.resolve(raw).then(validateStripe)\n };\n }\n var stripe = validateStripe(raw);\n if (stripe === null) {\n return {\n tag: 'empty'\n };\n }\n return {\n tag: 'sync',\n stripe: stripe\n };\n };\n var ElementsContext = /*#__PURE__*/React.createContext(null);\n ElementsContext.displayName = 'ElementsContext';\n var parseElementsContext = function parseElementsContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an provider.\"));\n }\n return ctx;\n };\n var CartElementContext = /*#__PURE__*/React.createContext(null);\n CartElementContext.displayName = 'CartElementContext';\n var parseCartElementContext = function parseCartElementContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an provider.\"));\n }\n return ctx;\n };\n /**\n * The `Elements` provider allows you to use [Element components](https://stripe.com/docs/stripe-js/react#element-components) and access the [Stripe object](https://stripe.com/docs/js/initializing) in any nested component.\n * Render an `Elements` provider at the root of your React app so that it is available everywhere you need it.\n *\n * To use the `Elements` provider, call `loadStripe` from `@stripe/stripe-js` with your publishable key.\n * The `loadStripe` function will asynchronously load the Stripe.js script and initialize a `Stripe` object.\n * Pass the returned `Promise` to `Elements`.\n *\n * @docs https://stripe.com/docs/stripe-js/react#elements-provider\n */\n\n var Elements = function Elements(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]);\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n cart = _React$useState2[0],\n setCart = _React$useState2[1];\n var _React$useState3 = React.useState(null),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n cartState = _React$useState4[0],\n setCartState = _React$useState4[1]; // For a sync stripe instance, initialize into context\n\n var _React$useState5 = React.useState(function () {\n return {\n stripe: parsed.tag === 'sync' ? parsed.stripe : null,\n elements: parsed.tag === 'sync' ? parsed.stripe.elements(options) : null\n };\n }),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n ctx = _React$useState6[0],\n setContext = _React$useState6[1];\n React.useEffect(function () {\n var isMounted = true;\n var safeSetContext = function safeSetContext(stripe) {\n setContext(function (ctx) {\n // no-op if we already have a stripe instance (https://github.com/stripe/react-stripe-js/issues/296)\n if (ctx.stripe) return ctx;\n return {\n stripe: stripe,\n elements: stripe.elements(options)\n };\n });\n }; // For an async stripePromise, store it in context once resolved\n\n if (parsed.tag === 'async' && !ctx.stripe) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe && isMounted) {\n // Only update Elements context if the component is still mounted\n // and stripe is not null. We allow stripe to be null to make\n // handling SSR easier.\n safeSetContext(stripe);\n }\n });\n } else if (parsed.tag === 'sync' && !ctx.stripe) {\n // Or, handle a sync stripe instance going from null -> populated\n safeSetContext(parsed.stripe);\n }\n return function () {\n isMounted = false;\n };\n }, [parsed, ctx, options]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!ctx.elements) {\n return;\n }\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['clientSecret', 'fonts']);\n if (updates) {\n ctx.elements.update(updates);\n }\n }, [options, prevOptions, ctx.elements]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n var anyStripe = ctx.stripe;\n if (!anyStripe || !anyStripe._registerWrapper || !anyStripe.registerAppInfo) {\n return;\n }\n anyStripe._registerWrapper({\n name: 'react-stripe-js',\n version: \"1.16.5\"\n });\n anyStripe.registerAppInfo({\n name: 'react-stripe-js',\n version: \"1.16.5\",\n url: 'https://stripe.com/docs/stripe-js/react'\n });\n }, [ctx.stripe]);\n return /*#__PURE__*/React.createElement(ElementsContext.Provider, {\n value: ctx\n }, /*#__PURE__*/React.createElement(CartElementContext.Provider, {\n value: {\n cart: cart,\n setCart: setCart,\n cartState: cartState,\n setCartState: setCartState\n }\n }, children));\n };\n var useElementsContextWithUseCase = function useElementsContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(ElementsContext);\n return parseElementsContext(ctx, useCaseMessage);\n };\n var useCartElementContextWithUseCase = function useCartElementContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(CartElementContext);\n return parseCartElementContext(ctx, useCaseMessage);\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#useelements-hook\n */\n\n var useElements = function useElements() {\n var _useElementsContextWi = useElementsContextWithUseCase('calls useElements()'),\n elements = _useElementsContextWi.elements;\n return elements;\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#usestripe-hook\n */\n\n var useStripe = function useStripe() {\n var _useElementsContextWi2 = useElementsContextWithUseCase('calls useStripe()'),\n stripe = _useElementsContextWi2.stripe;\n return stripe;\n };\n /**\n * @docs https://stripe.com/docs/payments/checkout/cart-element\n */\n\n var useCartElement = function useCartElement() {\n var _useCartElementContex = useCartElementContextWithUseCase('calls useCartElement()'),\n cart = _useCartElementContex.cart;\n return cart;\n };\n /**\n * @docs https://stripe.com/docs/payments/checkout/cart-element\n */\n\n var useCartElementState = function useCartElementState() {\n var _useCartElementContex2 = useCartElementContextWithUseCase('calls useCartElementState()'),\n cartState = _useCartElementContex2.cartState;\n return cartState;\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#elements-consumer\n */\n\n var ElementsConsumer = function ElementsConsumer(_ref2) {\n var children = _ref2.children;\n var ctx = useElementsContextWithUseCase('mounts '); // Assert to satisfy the busted React.FC return type (it should be ReactNode)\n\n return children(ctx);\n };\n ElementsConsumer.propTypes = {\n children: propTypes.func.isRequired\n };\n var useAttachEvent = function useAttachEvent(element, event, cb) {\n var cbDefined = !!cb;\n var cbRef = React.useRef(cb); // In many integrations the callback prop changes on each render.\n // Using a ref saves us from calling element.on/.off every render.\n\n React.useEffect(function () {\n cbRef.current = cb;\n }, [cb]);\n React.useEffect(function () {\n if (!cbDefined || !element) {\n return function () {};\n }\n var decoratedCb = function decoratedCb() {\n if (cbRef.current) {\n cbRef.current.apply(cbRef, arguments);\n }\n };\n element.on(event, decoratedCb);\n return function () {\n element.off(event, decoratedCb);\n };\n }, [cbDefined, event, element, cbRef]);\n };\n var capitalized = function capitalized(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n };\n var createElementComponent = function createElementComponent(type, isServer) {\n var displayName = \"\".concat(capitalized(type), \"Element\");\n var ClientElement = function ClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n onBlur = _ref.onBlur,\n onFocus = _ref.onFocus,\n onReady = _ref.onReady,\n onChange = _ref.onChange,\n onEscape = _ref.onEscape,\n onClick = _ref.onClick,\n onLoadError = _ref.onLoadError,\n onLoaderStart = _ref.onLoaderStart,\n onNetworksChange = _ref.onNetworksChange,\n onCheckout = _ref.onCheckout,\n onLineItemClick = _ref.onLineItemClick,\n onConfirm = _ref.onConfirm,\n onCancel = _ref.onCancel,\n onShippingAddressChange = _ref.onShippingAddressChange,\n onShippingRateChange = _ref.onShippingRateChange;\n var _useElementsContextWi = useElementsContextWithUseCase(\"mounts <\".concat(displayName, \">\")),\n elements = _useElementsContextWi.elements;\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n element = _React$useState2[0],\n setElement = _React$useState2[1];\n var elementRef = React.useRef(null);\n var domNode = React.useRef(null);\n var _useCartElementContex = useCartElementContextWithUseCase(\"mounts <\".concat(displayName, \">\")),\n setCart = _useCartElementContex.setCart,\n setCartState = _useCartElementContex.setCartState; // For every event where the merchant provides a callback, call element.on\n // with that callback. If the merchant ever changes the callback, removes\n // the old callback with element.off and then call element.on with the new one.\n\n useAttachEvent(element, 'blur', onBlur);\n useAttachEvent(element, 'focus', onFocus);\n useAttachEvent(element, 'escape', onEscape);\n useAttachEvent(element, 'click', onClick);\n useAttachEvent(element, 'loaderror', onLoadError);\n useAttachEvent(element, 'loaderstart', onLoaderStart);\n useAttachEvent(element, 'networkschange', onNetworksChange);\n useAttachEvent(element, 'lineitemclick', onLineItemClick);\n useAttachEvent(element, 'confirm', onConfirm);\n useAttachEvent(element, 'cancel', onCancel);\n useAttachEvent(element, 'shippingaddresschange', onShippingAddressChange);\n useAttachEvent(element, 'shippingratechange', onShippingRateChange);\n var readyCallback;\n if (type === 'cart') {\n readyCallback = function readyCallback(event) {\n setCartState(event);\n onReady && onReady(event);\n };\n } else if (onReady) {\n if (type === 'payButton') {\n // Passes through the event, which includes visible PM types\n readyCallback = onReady;\n } else {\n // For other Elements, pass through the Element itself.\n readyCallback = function readyCallback() {\n onReady(element);\n };\n }\n }\n useAttachEvent(element, 'ready', readyCallback);\n var changeCallback = type === 'cart' ? function (event) {\n setCartState(event);\n onChange && onChange(event);\n } : onChange;\n useAttachEvent(element, 'change', changeCallback);\n var checkoutCallback = type === 'cart' ? function (event) {\n setCartState(event);\n onCheckout && onCheckout(event);\n } : onCheckout;\n useAttachEvent(element, 'checkout', checkoutCallback);\n React.useLayoutEffect(function () {\n if (elementRef.current === null && elements && domNode.current !== null) {\n var newElement = elements.create(type, options);\n if (type === 'cart' && setCart) {\n // we know that elements.create return value must be of type StripeCartElement if type is 'cart',\n // we need to cast because typescript is not able to infer which overloaded method is used based off param type\n setCart(newElement);\n } // Store element in a ref to ensure it's _immediately_ available in cleanup hooks in StrictMode\n\n elementRef.current = newElement; // Store element in state to facilitate event listener attachment\n\n setElement(newElement);\n newElement.mount(domNode.current);\n }\n }, [elements, options, setCart]);\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!elementRef.current) {\n return;\n }\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['paymentRequest']);\n if (updates) {\n elementRef.current.update(updates);\n }\n }, [options, prevOptions]);\n React.useLayoutEffect(function () {\n return function () {\n if (elementRef.current) {\n elementRef.current.destroy();\n elementRef.current = null;\n }\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className,\n ref: domNode\n });\n }; // Only render the Element wrapper in a server environment.\n\n var ServerElement = function ServerElement(props) {\n // Validate that we are in the right context by calling useElementsContextWithUseCase.\n useElementsContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n useCartElementContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var id = props.id,\n className = props.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n };\n var Element = isServer ? ServerElement : ClientElement;\n Element.propTypes = {\n id: propTypes.string,\n className: propTypes.string,\n onChange: propTypes.func,\n onBlur: propTypes.func,\n onFocus: propTypes.func,\n onReady: propTypes.func,\n onEscape: propTypes.func,\n onClick: propTypes.func,\n onLoadError: propTypes.func,\n onLoaderStart: propTypes.func,\n onNetworksChange: propTypes.func,\n onCheckout: propTypes.func,\n onLineItemClick: propTypes.func,\n onConfirm: propTypes.func,\n onCancel: propTypes.func,\n onShippingAddressChange: propTypes.func,\n onShippingRateChange: propTypes.func,\n options: propTypes.object\n };\n Element.displayName = displayName;\n Element.__elementType = type;\n return Element;\n };\n var isServer = typeof window === 'undefined';\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AuBankAccountElement = createElementComponent('auBankAccount', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardElement = createElementComponent('card', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardNumberElement = createElementComponent('cardNumber', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardExpiryElement = createElementComponent('cardExpiry', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardCvcElement = createElementComponent('cardCvc', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var FpxBankElement = createElementComponent('fpxBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var IbanElement = createElementComponent('iban', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var IdealBankElement = createElementComponent('idealBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var P24BankElement = createElementComponent('p24Bank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var EpsBankElement = createElementComponent('epsBank', isServer);\n var PaymentElement = createElementComponent('payment', isServer);\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var PayButtonElement = createElementComponent('payButton', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var LinkAuthenticationElement = createElementComponent('linkAuthentication', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AddressElement = createElementComponent('address', isServer);\n /**\n * @deprecated\n * Use `AddressElement` instead.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var ShippingAddressElement = createElementComponent('shippingAddress', isServer);\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/elements/cart-element\n */\n\n var CartElement = createElementComponent('cart', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var PaymentMethodMessagingElement = createElementComponent('paymentMethodMessaging', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AffirmMessageElement = createElementComponent('affirmMessage', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AfterpayClearpayMessageElement = createElementComponent('afterpayClearpayMessage', isServer);\n exports.AddressElement = AddressElement;\n exports.AffirmMessageElement = AffirmMessageElement;\n exports.AfterpayClearpayMessageElement = AfterpayClearpayMessageElement;\n exports.AuBankAccountElement = AuBankAccountElement;\n exports.CardCvcElement = CardCvcElement;\n exports.CardElement = CardElement;\n exports.CardExpiryElement = CardExpiryElement;\n exports.CardNumberElement = CardNumberElement;\n exports.CartElement = CartElement;\n exports.Elements = Elements;\n exports.ElementsConsumer = ElementsConsumer;\n exports.EpsBankElement = EpsBankElement;\n exports.FpxBankElement = FpxBankElement;\n exports.IbanElement = IbanElement;\n exports.IdealBankElement = IdealBankElement;\n exports.LinkAuthenticationElement = LinkAuthenticationElement;\n exports.P24BankElement = P24BankElement;\n exports.PayButtonElement = PayButtonElement;\n exports.PaymentElement = PaymentElement;\n exports.PaymentMethodMessagingElement = PaymentMethodMessagingElement;\n exports.PaymentRequestButtonElement = PaymentRequestButtonElement;\n exports.ShippingAddressElement = ShippingAddressElement;\n exports.useCartElement = useCartElement;\n exports.useCartElementState = useCartElementState;\n exports.useElements = useElements;\n exports.useStripe = useStripe;\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n});"],"sourceRoot":""}