`, where Drop-in will be included on your page or the selector for the empty element. e.g. `#dropin-container`.\n * @param {string} options.selector Deprecated: Now an alias for `options.container`.\n * @param {string} [options.locale=`en_US`] Use this option to change the language, links, and terminology used throughout Drop-in. Supported locales include:\n * `ar_EG`,\n * `cs_CZ`,\n * `da_DK`,\n * `de_DE`,\n * `el_GR`,\n * `en_AU`,\n * `en_GB`,\n * `en_IN`,\n * `en_US`,\n * `es_ES`,\n * `es_XC`,\n * `fi_FI`,\n * `fr_CA`,\n * `fr_FR`,\n * `fr_XC`,\n * `he_IL`,\n * `hu_HU`,\n * `id_ID`,\n * `it_IT`,\n * `ja_JP`,\n * `ko_KR`,\n * `nl_NL`,\n * `no_NO`,\n * `pl_PL`,\n * `pt_BR`,\n * `pt_PT`,\n * `ru_RU`,\n * `sk_SK`,\n * `sv_SE`,\n * `th_TH`,\n * `zh_CN`,\n * `zh_HK`,\n * `zh_TW`,\n * `zh_XC`.\n *\n * @param {object} [options.translations] To use your own translations, pass an object with the strings you wish to replace. This object must use the same structure as the object used internally for supported translations, which can be found [here](https://github.com/braintree/braintree-web-drop-in/blob/master/src/translations/en_US.js). Any strings that are not included will be those from the provided `locale` or `en_US` if no `locale` is provided. See below for an example of creating Drop-in with custom translations.\n * @param {array} [options.paymentOptionPriority] Use this option to indicate the order in which enabled payment options should appear when multiple payment options are enabled. By default, payment options will appear in this order: `['card', 'paypal', 'paypalCredit', 'venmo', 'applePay', 'googlePay']`. Payment options omitted from this array will not be offered to the customer.\n *\n * @param {(boolean|object)} [options.card] The configuration options for cards. See [`cardCreateOptions`](#~cardCreateOptions) for all `card` options. If this option is omitted, cards will still appear as a payment option. To remove cards, pass `false` for the value.\n * @param {object} [options.paypal] The configuration options for PayPal. To include a PayPal option in your Drop-in integration, include the `paypal` parameter and [enable PayPal in the Braintree Control Panel](https://developers.braintreepayments.com/guides/paypal/testing-go-live/#go-live). To test in Sandbox, you will need to [link a PayPal sandbox test account to your Braintree sandbox account](https://developers.braintreepayments.com/guides/paypal/testing-go-live/#linked-paypal-testing).\n *\n * Some of the PayPal configuration options are listed [here](#~paypalCreateOptions), but for a full list see the [PayPal Checkout client reference options](http://braintree.github.io/braintree-web/3.74.0/PayPalCheckout.html#createPayment).\n *\n * PayPal is not [supported in Internet Explorer versions lower than 11](https://developer.paypal.com/docs/checkout/reference/faq/#which-browsers-does-paypal-checkout-support).\n *\n * @param {object} [options.paypalCredit] The configuration options for PayPal Credit. To include a PayPal Credit option in your Drop-in integration, include the `paypalCredit` parameter and [enable PayPal in the Braintree Control Panel](https://developers.braintreepayments.com/guides/paypal/testing-go-live/#go-live).\n *\n * Some of the PayPal Credit configuration options are listed [here](#~paypalCreateOptions), but for a full list see the [PayPal Checkout client reference options](http://braintree.github.io/braintree-web/3.74.0/PayPalCheckout.html#createPayment). For more information on PayPal Credit, see the [Braintree Developer Docs](https://developers.braintreepayments.com/guides/paypal/paypal-credit/javascript/v3).\n *\n * PayPal Credit is not [supported in Internet Explorer versions lower than 11](https://developer.paypal.com/docs/checkout/reference/faq/#which-browsers-does-paypal-checkout-support).\n *\n * @param {(object|boolean)} [options.venmo] The configuration options for Pay with Venmo. To include a Venmo option in your Drop-in integration, include the `venmo` parameter and [follow the documentation for setting up Venmo in the Braintree control panel](https://articles.braintreepayments.com/guides/payment-methods/venmo#setup). If a user's browser does not support Venmo, the Venmo option will not be rendered.\n *\n * See [`venmoCreateOptions`](#~venmoCreateOptions) for `venmo` options.\n *\n * @param {object} [options.applePay] The configuration options for Apple Pay. To include an Apple Pay option in your Drop-in integration, include the `applePay` parameter and [enable Apple Pay in the Braintree Control Panel](https://developers.braintreepayments.com/guides/apple-pay/configuration/javascript/v3). If a user's browser does not support Apple Pay, the Apple Pay option will not be rendered. See [Apple's documentation](https://support.apple.com/en-us/HT201469) for browser and device support.\n *\n * See [`applePayCreateOptions`](#~applePayCreateOptions) for `applePay` options.\n *\n * @param {object} [options.googlePay] The configuration options for Google Pay. To include a Google Pay option in your Drop-in integration, include the `googlePay` parameter and [enable Google Pay in the Braintree Control Panel](https://developers.braintreepayments.com/guides/google-pay/configuration/javascript/v3). If a user's browser does not support Google Pay, the Google Pay option will not be rendered. See [Google's documentation](https://developers.google.com/pay/api/web/test-and-deploy) for browser and device support.\n *\n * See [`googlePayCreateOptions`](#~googlePayCreateOptions) for `googlePay` options.\n *\n * @param {object|boolean} [options.dataCollector] If `true` is passed, Drop-in will be configured to collect data for use with Advanced Fraud Protection. If collecting data via Kount, pass a [`dataCollectorOptions` object](#~dataCollectorOptions) with `kount: true` instead. If Data Collector is configured and fails to load, Drop-in creation will fail.\n *\n * @param {(boolean|object)} [options.threeDSecure] It's recomended that you pass `true` here to enable 3D Secure and pass the configuration options for 3D Secure into {@link Dropin#requestPaymentMethod|requestPaymentMethod options}.See [`threeDSecureOptions`](#~threeDSecureOptions) for the deprecated create options. If 3D Secure is configured and fails to load, Drop-in creation will fail.\n *\n * @param {boolean} [options.vaultManager=false] Whether or not to allow a customer to delete saved payment methods when used with a [client token with a customer id](https://developers.braintreepayments.com/reference/request/client-token/generate/#customer_id). *Note:* Deleting a payment method from Drop-in will permanently delete the payment method, so this option is not recommended for merchants using Braintree's recurring billing system. This feature is not supported in Internet Explorer 9.\n *\n * @param {boolean} [options.preselectVaultedPaymentMethod=true] Whether or not to initialize Drop-in with a vaulted payment method pre-selected. Only applicable when using a [client token with a customer id](https://developers.braintreepayments.com/reference/request/client-token/generate/#customer_id) and a customer with saved payment methods.\n *\n * @param {boolean} [options.showDefaultPaymentMethodFirst=true] When `true` or left out, the customer's default payment method will be displayed first in the list of vaulted payment methods. When `false`, the Braintree API will determine which payment method to display first, typically the latest payment method added to the customer. Only applicable when using a [client token with a customer id](https://developers.braintreepayments.com/reference/request/client-token/generate/#customer_id) and a customer with saved payment methods.\n *\n * @param {function} [callback] The second argument, `data`, is the {@link Dropin} instance. Returns a promise if no callback is provided.\n * @returns {(void|Promise)} Returns a promise if no callback is provided.\n * @example\n *
A full example of accepting credit cards with callback API\n * \n * \n * \n *
\n *
Checkout\n * \n * \n *
\n *
\n *\n * \n *\n * \n * \n * \n * @example\n *
A full example of accepting credit cards with promise API\n * \n * \n * \n *
\n *
Checkout\n * \n * \n *
\n *
\n *\n * \n *\n * \n * \n * \n * @example\n *
Setting up a Drop-in instance to accept credit cards, PayPal, PayPal Credit, Venmo, and Apple Pay\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * applePay: {\n * displayName: 'Merchant Name',\n * paymentRequest: {\n * label: 'Localized Name',\n * total: '10.00'\n * }\n * },\n * paypal: {\n * flow: 'checkout',\n * amount: '10.00',\n * currency: 'USD'\n * },\n * paypalCredit: {\n * flow: 'checkout',\n * amount: '10.00',\n * currency: 'USD'\n * },\n * venmo: true\n * }, function (err, dropinInstance) {\n * // Set up a handler to request a payment method and\n * // submit the payment method nonce to your server\n * });\n * @example\n *
Setting up a Drop-in instance to accept Venmo with restricted browser support\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * venmo: {\n * allowNewBrowserTab: false\n * }\n * }, function (err, dropinInstance) {\n * // Set up a handler to request a payment method and\n * // submit the payment method nonce to your server\n * });\n *\n * @example\n *
Submitting the payment method nonce to the server using a form\n * \n * \n * \n *
\n *
Checkout\n * \n * \n *
\n *\n * \n *\n * \n * \n * \n *\n * @example\n *
Use your own translations\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * translations: {\n * payingWith: 'You are paying with {{paymentSource}}',\n * chooseAnotherWayToPay: 'My custom chooseAnotherWayToPay string',\n * // Any other custom translation strings\n * }\n * }, callback);\n *\n * @example\n *
Customizing Drop-in with card form overrides\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * card: {\n * overrides: {\n * fields: {\n * number: {\n * placeholder: '1111 1111 1111 1111' // Update the number field placeholder\n * },\n * postalCode: {\n * minlength: 5 // Set the minimum length of the postal code field\n * },\n * cvv: null // Remove the CVV field from your form\n * },\n * styles: {\n * input: {\n * 'font-size': '18px' // Change the font size for all inputs\n * },\n * ':focus': {\n * color: 'red' // Change the focus color to red for all inputs\n * }\n * }\n * }\n * }\n * }, callback);\n *\n * @example\n *
Mask Card Inputs\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * card: {\n * overrides: {\n * fields: {\n * number: {\n * maskInput: {\n * showLastFour: true\n * }\n * },\n * cvv: {\n * maskInput: true\n * }\n * }\n * }\n * }\n * }, callback);\n *\n * @example\n *
Including a cardholder name field\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * card: {\n * cardholderName: true\n * }\n * }, callback);\n *\n * @example\n *
Including a required cardholder name field\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * card: {\n * cardholderName: {\n * required: true\n * }\n * }\n * }, callback);\n *\n * @example\n *
Enabling 3D Secure\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * threeDSecure: true\n * }, function (err, dropinInstance) {\n * // setup payment button\n * btn.addEventListener('click', function (e) {\n * e.preventDefault();\n *\n * dropinInstance.requestPaymentMethod(|\n * threeDSecure: {\n * amount: '100.00',\n * billingAddress: {\n * givenName: 'Jill', // ASCII-printable characters required, else will throw a validation error\n * surname: 'Doe', // ASCII-printable characters required, else will throw a validation error\n * phoneNumber: '8101234567',\n * streetAddress: '555 Smith St.',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * },\n * // additional 3ds params\n * }\n * }, function (err, payload) {\n * // inspect payload.liablityShifted\n * // send payload.nonce to server\n * });\n * });\n * });\n *\n * @example\n *
Enabled Vault Manager\n * braintree.dropin.create({\n * authorization: 'CLIENT_AUTHORIZATION',\n * container: '#dropin-container',\n * vaultManager: true\n * }, callback);\n */\n\n function create(options) {\n if (!options.authorization) {\n return Promise.reject(new DropinError('options.authorization is required.'));\n }\n\n return client.create({\n authorization: options.authorization\n }).catch(function (err) {\n return Promise.reject(new DropinError({\n message: 'There was an error creating Drop-in.',\n braintreeWebError: err\n }));\n }).then(function (clientInstance) {\n clientInstance = setAnalyticsIntegration(clientInstance);\n\n if (clientInstance.getConfiguration().authorizationType === 'TOKENIZATION_KEY') {\n analytics.sendEvent(clientInstance, 'started.tokenization-key');\n } else {\n analytics.sendEvent(clientInstance, 'started.client-token');\n }\n\n return new Promise(function (resolve, reject) {\n new Dropin({\n merchantConfiguration: options,\n client: clientInstance\n })._initialize(function (err, instance) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(instance);\n });\n });\n });\n }\n\n function setAnalyticsIntegration(clientInstance) {\n var configuration = clientInstance.getConfiguration();\n configuration.analyticsMetadata.integration = constants.INTEGRATION;\n configuration.analyticsMetadata.integrationType = constants.INTEGRATION;\n configuration.analyticsMetadata.dropinVersion = VERSION;\n\n clientInstance.getConfiguration = function () {\n return configuration;\n };\n\n return clientInstance;\n } // we check for document's existence to support server side rendering\n\n\n createFromScriptTag(create, typeof document !== 'undefined' && document.querySelector('script[data-braintree-dropin-authorization]'));\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of Drop-in, i.e. `1.27.0`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"./constants\": 187,\n \"./dropin\": 189,\n \"./lib/analytics\": 192,\n \"./lib/create-from-script-tag\": 195,\n \"./lib/dropin-error\": 197,\n \"./lib/promise\": 204,\n \"@braintree/wrap-promise\": 46,\n \"braintree-web/client\": 55\n }],\n 191: [function (require, module, exports) {\n 'use strict';\n\n function addSelectionEventHandler(element, func) {\n element.addEventListener('click', func);\n element.addEventListener('keyup', function (event) {\n if (event.keyCode === 13) {\n func();\n }\n });\n }\n\n module.exports = addSelectionEventHandler;\n }, {}],\n 192: [function (require, module, exports) {\n 'use strict';\n\n var atob = require('./polyfill').atob;\n\n var constants = require('../constants');\n\n var braintreeClientVersion = require('braintree-web/client').VERSION;\n\n function _millisToSeconds(millis) {\n return Math.floor(millis / 1000);\n }\n\n function sendAnalyticsEvent(client, kind, callback) {\n var configuration = client.getConfiguration();\n var analyticsRequest = client._request;\n\n var timestamp = _millisToSeconds(Date.now());\n\n var url = configuration.gatewayConfiguration.analytics.url;\n var data = {\n analytics: [{\n kind: constants.ANALYTICS_PREFIX + kind,\n timestamp: timestamp\n }],\n _meta: configuration.analyticsMetadata,\n braintreeLibraryVersion: braintreeClientVersion\n };\n\n if (configuration.authorizationType === 'TOKENIZATION_KEY') {\n data.tokenizationKey = configuration.authorization;\n } else {\n data.authorizationFingerprint = JSON.parse(atob(configuration.authorization)).authorizationFingerprint;\n }\n\n analyticsRequest({\n url: url,\n method: 'post',\n data: data,\n timeout: constants.ANALYTICS_REQUEST_TIMEOUT_MS\n }, callback);\n }\n\n module.exports = {\n sendEvent: sendAnalyticsEvent\n };\n }, {\n \"../constants\": 187,\n \"./polyfill\": 203,\n \"braintree-web/client\": 55\n }],\n 193: [function (require, module, exports) {\n arguments[4][91][0].apply(exports, arguments);\n }, {\n \"dup\": 91\n }],\n 194: [function (require, module, exports) {\n 'use strict';\n\n var isIe9 = require('@braintree/browser-detection/is-ie9');\n\n var isIe10 = require('@braintree/browser-detection/is-ie10');\n\n module.exports = {\n isIe9: isIe9,\n isIe10: isIe10\n };\n }, {\n \"@braintree/browser-detection/is-ie10\": 28,\n \"@braintree/browser-detection/is-ie9\": 29\n }],\n 195: [function (require, module, exports) {\n 'use strict';\n\n var analytics = require('./analytics');\n\n var find = require('./find-parent-form');\n\n var uuid = require('@braintree/uuid');\n\n var DropinError = require('./dropin-error');\n\n var kebabCaseToCamelCase = require('./kebab-case-to-camel-case');\n\n var WHITELISTED_DATA_ATTRIBUTES = ['locale', 'payment-option-priority', 'data-collector.kount', 'data-collector.paypal', // camelcase version was accidentally used initially.\n // we add the kebab case version to match the docs, but\n // we retain the camelcase version for backwards compatibility\n 'card.cardholderName', 'card.cardholderName.required', 'card.cardholder-name', 'card.cardholder-name.required', 'paypal.amount', 'paypal.currency', 'paypal.flow', 'paypal.landing-page-type', 'paypal-credit.amount', 'paypal-credit.currency', 'paypal-credit.flow', 'paypal-credit.landing-page-type'];\n\n function injectHiddenInput(name, value, form) {\n var input = form.querySelector('[name=\"' + name + '\"]');\n\n if (!input) {\n input = document.createElement('input');\n input.type = 'hidden';\n input.name = name;\n form.appendChild(input);\n }\n\n input.value = value;\n }\n\n function addCompositeKeyValuePairToObject(obj, key, value) {\n var decomposedKeys = key.split('.');\n var topLevelKey = kebabCaseToCamelCase(decomposedKeys[0]);\n\n if (decomposedKeys.length === 1) {\n obj[topLevelKey] = deserialize(value);\n } else {\n obj[topLevelKey] = obj[topLevelKey] || {};\n addCompositeKeyValuePairToObject(obj[topLevelKey], decomposedKeys.slice(1).join('.'), value);\n }\n }\n\n function deserialize(value) {\n try {\n return JSON.parse(value);\n } catch (e) {\n return value;\n }\n }\n\n function createFromScriptTag(createFunction, scriptTag) {\n var authorization, container, createOptions, form;\n\n if (!scriptTag) {\n return;\n }\n\n authorization = scriptTag.getAttribute('data-braintree-dropin-authorization');\n\n if (!authorization) {\n throw new DropinError('Authorization not found in data-braintree-dropin-authorization attribute');\n }\n\n container = document.createElement('div');\n container.id = 'braintree-dropin-' + uuid();\n form = find.findParentForm(scriptTag);\n\n if (!form) {\n throw new DropinError('No form found for script tag integration.');\n }\n\n form.addEventListener('submit', function (event) {\n event.preventDefault();\n });\n scriptTag.parentNode.insertBefore(container, scriptTag);\n createOptions = {\n authorization: authorization,\n container: container\n };\n WHITELISTED_DATA_ATTRIBUTES.forEach(function (compositeKey) {\n var value = scriptTag.getAttribute('data-' + compositeKey);\n\n if (value == null) {\n return;\n }\n\n addCompositeKeyValuePairToObject(createOptions, compositeKey, value);\n });\n createFunction(createOptions).then(function (instance) {\n analytics.sendEvent(instance._client, 'integration-type.script-tag');\n form.addEventListener('submit', function () {\n instance.requestPaymentMethod(function (requestPaymentError, payload) {\n if (requestPaymentError) {\n return;\n }\n\n injectHiddenInput('payment_method_nonce', payload.nonce, form);\n\n if (payload.deviceData) {\n injectHiddenInput('device_data', payload.deviceData, form);\n }\n\n form.submit();\n });\n });\n });\n }\n\n module.exports = createFromScriptTag;\n }, {\n \"./analytics\": 192,\n \"./dropin-error\": 197,\n \"./find-parent-form\": 198,\n \"./kebab-case-to-camel-case\": 202,\n \"@braintree/uuid\": 42\n }],\n 196: [function (require, module, exports) {\n (function (global) {\n (function () {\n 'use strict';\n\n var constants = require('../constants');\n\n var analytics = require('./analytics');\n\n var assets = require('@braintree/asset-loader');\n\n var Promise = require('./promise');\n\n function DataCollector(config) {\n this._config = config;\n }\n\n DataCollector.prototype.initialize = function () {\n var self = this;\n return Promise.resolve().then(function () {\n var braintreeWebVersion;\n\n if (global.braintree && global.braintree.dataCollector) {\n return Promise.resolve();\n }\n\n braintreeWebVersion = self._config.client.getVersion();\n return assets.loadScript({\n src: 'https://js.braintreegateway.com/web/' + braintreeWebVersion + '/js/data-collector.min.js',\n id: constants.DATA_COLLECTOR_SCRIPT_ID\n });\n }).then(function () {\n return global.braintree.dataCollector.create(self._config);\n }).then(function (instance) {\n self._instance = instance;\n }).catch(function (err) {\n analytics.sendEvent(self._config.client, 'data-collector.setup-failed'); // log the Data Collector setup error\n // but do not prevent Drop-in from loading\n\n self.log(err);\n });\n };\n\n DataCollector.prototype.log = function (message) {\n console.log(message); // eslint-disable-line no-console\n };\n\n DataCollector.prototype.getDeviceData = function () {\n if (!this._instance) {\n return '';\n }\n\n return this._instance.deviceData;\n };\n\n DataCollector.prototype.teardown = function () {\n if (!this._instance) {\n return Promise.resolve();\n }\n\n return this._instance.teardown();\n };\n\n module.exports = DataCollector;\n }).call(this);\n }).call(this, typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n }, {\n \"../constants\": 187,\n \"./analytics\": 192,\n \"./promise\": 204,\n \"@braintree/asset-loader\": 1\n }],\n 197: [function (require, module, exports) {\n 'use strict';\n\n function isBraintreeWebError(err) {\n return err.name === 'BraintreeError';\n }\n\n function DropinError(err) {\n this.name = 'DropinError';\n\n if (typeof err === 'string') {\n this.message = err;\n } else {\n this.message = err.message;\n }\n\n if (isBraintreeWebError(err)) {\n this._braintreeWebError = err;\n } else {\n this._braintreeWebError = err.braintreeWebError;\n }\n }\n\n DropinError.prototype = Object.create(Error.prototype);\n DropinError.prototype.constructor = DropinError;\n module.exports = DropinError;\n }, {}],\n 198: [function (require, module, exports) {\n 'use strict';\n\n function findParentForm(element) {\n var parentNode = element.parentNode;\n\n if (!parentNode || parentNode.nodeName === 'FORM') {\n return parentNode;\n }\n\n return findParentForm(parentNode);\n }\n\n module.exports = {\n findParentForm: findParentForm\n };\n }, {}],\n 199: [function (require, module, exports) {\n 'use strict';\n\n var atob = require('./polyfill').atob;\n\n module.exports = function (client) {\n var authorizationFingerprint;\n var configuration = client.getConfiguration();\n\n if (configuration.authorizationType !== 'TOKENIZATION_KEY') {\n authorizationFingerprint = JSON.parse(atob(configuration.authorization)).authorizationFingerprint;\n return !authorizationFingerprint || authorizationFingerprint.indexOf('customer_id=') === -1;\n }\n\n return true;\n };\n }, {\n \"./polyfill\": 203\n }],\n 200: [function (require, module, exports) {\n (function (global) {\n (function () {\n 'use strict';\n\n function isHTTPS() {\n return global.location.protocol === 'https:';\n }\n\n module.exports = {\n isHTTPS: isHTTPS\n };\n }).call(this);\n }).call(this, typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n }, {}],\n 201: [function (require, module, exports) {\n (function (global) {\n (function () {\n 'use strict';\n\n module.exports = function (win) {\n win = win || global;\n return Boolean(win.document.characterSet && win.document.characterSet.toLowerCase() === 'utf-8');\n };\n }).call(this);\n }).call(this, typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n }, {}],\n 202: [function (require, module, exports) {\n 'use strict';\n\n function kebabCaseToCamelCase(kebab) {\n var parts = kebab.split('-');\n var first = parts.shift();\n var capitalizedParts = parts.map(function (part) {\n return part.charAt(0).toUpperCase() + part.substring(1);\n });\n return [first].concat(capitalizedParts).join('');\n }\n\n module.exports = kebabCaseToCamelCase;\n }, {}],\n 203: [function (require, module, exports) {\n (function (global) {\n (function () {\n 'use strict';\n /* eslint-disable no-mixed-operators */\n\n var atobNormalized = typeof global.atob === 'function' ? global.atob : atob;\n\n function atob(base64String) {\n var a, b, c, b1, b2, b3, b4, i;\n var base64Matcher = new RegExp('^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$');\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var result = '';\n\n if (!base64Matcher.test(base64String)) {\n throw new Error('Non base64 encoded input passed to window.atob polyfill');\n }\n\n i = 0;\n\n do {\n b1 = characters.indexOf(base64String.charAt(i++));\n b2 = characters.indexOf(base64String.charAt(i++));\n b3 = characters.indexOf(base64String.charAt(i++));\n b4 = characters.indexOf(base64String.charAt(i++));\n a = (b1 & 0x3F) << 2 | b2 >> 4 & 0x3;\n b = (b2 & 0xF) << 4 | b3 >> 2 & 0xF;\n c = (b3 & 0x3) << 6 | b4 & 0x3F;\n result += String.fromCharCode(a) + (b ? String.fromCharCode(b) : '') + (c ? String.fromCharCode(c) : '');\n } while (i < base64String.length);\n\n return result;\n }\n\n module.exports = {\n atob: function atob(base64String) {\n return atobNormalized.call(global, base64String);\n },\n _atob: atob\n };\n }).call(this);\n }).call(this, typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n }, {}],\n 204: [function (require, module, exports) {\n (function (global) {\n (function () {\n 'use strict';\n\n var Promise = global.Promise || require('promise-polyfill');\n\n module.exports = Promise;\n }).call(this);\n }).call(this, typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n }, {\n \"promise-polyfill\": 182\n }],\n 205: [function (require, module, exports) {\n 'use strict';\n\n module.exports = function (string) {\n if (typeof string !== 'string') {\n return '';\n }\n\n return string.replace(//g, '>');\n };\n }, {}],\n 206: [function (require, module, exports) {\n 'use strict';\n\n module.exports = function () {\n var el = document.createElement('div');\n var prop = 'flex-basis: 1px';\n var prefixes = ['-webkit-', '-moz-', '-ms-', '-o-', ''];\n prefixes.forEach(function (prefix) {\n el.style.cssText += prefix + prop;\n });\n return Boolean(el.style.length);\n };\n }, {}],\n 207: [function (require, module, exports) {\n 'use strict';\n\n var assign = require('./assign').assign;\n\n var threeDSecure = require('braintree-web/three-d-secure');\n\n var DEFAULT_ACS_WINDOW_SIZE = '03';\n var PASSTHROUGH_EVENTS = ['customer-canceled', 'authentication-modal-render', 'authentication-modal-close'];\n\n function ThreeDSecure(client, model) {\n this._client = client;\n this._model = model;\n this._config = assign({}, model.merchantConfiguration.threeDSecure);\n }\n\n ThreeDSecure.prototype.initialize = function () {\n var self = this;\n return threeDSecure.create({\n client: this._client,\n version: 2\n }).then(function (instance) {\n self._instance = instance;\n PASSTHROUGH_EVENTS.forEach(function (eventName) {\n self._instance.on(eventName, function (event) {\n self._model._emit('3ds:' + eventName, event);\n });\n });\n });\n };\n\n ThreeDSecure.prototype.verify = function (payload, merchantProvidedData) {\n var verifyOptions = assign({\n amount: this._config.amount\n }, merchantProvidedData, {\n nonce: payload.nonce,\n bin: payload.details.bin,\n // TODO in the future, we will allow\n // merchants to pass in a custom\n // onLookupComplete hook\n onLookupComplete: function onLookupComplete(data, next) {\n next();\n }\n });\n verifyOptions.additionalInformation = verifyOptions.additionalInformation || {};\n verifyOptions.additionalInformation.acsWindowSize = verifyOptions.additionalInformation.acsWindowSize || DEFAULT_ACS_WINDOW_SIZE;\n return this._instance.verifyCard(verifyOptions);\n };\n\n ThreeDSecure.prototype.updateConfiguration = function (key, value) {\n this._config[key] = value;\n };\n\n ThreeDSecure.prototype.teardown = function () {\n return this._instance.teardown();\n };\n\n module.exports = ThreeDSecure;\n }, {\n \"./assign\": 193,\n \"braintree-web/three-d-secure\": 143\n }],\n 208: [function (require, module, exports) {\n 'use strict';\n\n var browserDetection = require('./browser-detection');\n\n function isHidden(element) {\n if (!element) {\n // no parentNode, so nothing containing the element is hidden\n return false;\n }\n\n if (element.style.display === 'none') {\n return true;\n }\n\n return isHidden(element.parentNode);\n }\n\n function onTransitionEnd(element, propertyName, callback) {\n if (browserDetection.isIe9() || isHidden(element)) {\n callback();\n return;\n }\n\n function transitionEventListener(event) {\n if (event.propertyName === propertyName) {\n element.removeEventListener('transitionend', transitionEventListener);\n callback();\n }\n }\n\n element.addEventListener('transitionend', transitionEventListener);\n }\n\n module.exports = {\n onTransitionEnd: onTransitionEnd\n };\n }, {\n \"./browser-detection\": 194\n }],\n 209: [function (require, module, exports) {\n 'use strict';\n\n var Promise = require('./promise');\n\n function delay(time) {\n time = time || 0;\n return new Promise(function (resolve) {\n window.setTimeout(resolve, time);\n });\n }\n\n module.exports = {\n delay: delay\n };\n }, {\n \"./promise\": 204\n }],\n 210: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"الدفع باستخدام {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"اختر طريقة دفع أخرى\",\n \"chooseAWayToPay\": \"اختر طريقة الدفع\",\n \"otherWaysToPay\": \"طرق أخرى للدفع\",\n \"edit\": \"تحرير\",\n \"doneEditing\": \"تم\",\n \"editPaymentMethods\": \"تحرير طرق الدفع\",\n \"CreditCardDeleteConfirmationMessage\": \"هل تريد حذف البطاقة ({{secondaryIdentifier}}) التي تنتهي بالرقم {{identifier}}؟\",\n \"PayPalAccountDeleteConfirmationMessage\": \"هل تريد حذف حساب {{identifier}} على PayPal؟\",\n \"VenmoAccountDeleteConfirmationMessage\": \"هل تريد فعلاً حذف حساب Venmo الذي يحمل اسم المستخدم {{identifier}}؟\",\n \"genericDeleteConfirmationMessage\": \"هل تريد فعلاً حذف طريقة الدفع هذه؟\",\n \"deleteCancelButton\": \"إلغاء\",\n \"deleteConfirmationButton\": \"حذف\",\n \"fieldEmptyForCvv\": \"يرجى إدخال رمز حماية البطاقة.\",\n \"fieldEmptyForExpirationDate\": \"يرجى إدخال تاريخ انتهاء الصلاحية.\",\n \"fieldEmptyForCardholderName\": \"يرجى إدخال اسم صاحب البطاقة.\",\n \"fieldTooLongForCardholderName\": \"يجب أن يقل اسم صاحب البطاقة عن 256 حرفاً.\",\n \"fieldEmptyForNumber\": \"يرجى إدخال رقم.\",\n \"fieldEmptyForPostalCode\": \"يرجى إدخال الرمز البريدي.\",\n \"fieldInvalidForCardholderName\": \"اسم حامل البطاقة غير صحيح.\",\n \"fieldInvalidForCvv\": \"رمز الحماية هذا غير صحيح.\",\n \"fieldInvalidForExpirationDate\": \"تاريخ انتهاء الصلاحية هذا غير صحيح.\",\n \"fieldInvalidForNumber\": \"رقم هذه البطاقة غير صحيح.\",\n \"fieldInvalidForPostalCode\": \"الرمز البريدي هذا غير صحيح.\",\n \"genericError\": \"وقع خطأ ما من جانبنا.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"هذه البطاقة الائتمانية موجودة حالياً كطريقة دفع محفوظة.\",\n \"hostedFieldsFailedTokenizationError\": \"يرجى مراجعة بياناتك وإعادة المحاولة.\",\n \"hostedFieldsFieldsInvalidError\": \"يرجى مراجعة بياناتك وإعادة المحاولة.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"خطأ في الشبكة. يرجى إعادة المحاولة.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"فشلت مصادقة بطاقة الائتمان. يرجى مراجعة بياناتك وإعادة المحاولة.\",\n \"paypalButtonMustBeUsed\": \"استخدم زر PayPal لاستئناف الدفع.\",\n \"paypalAccountTokenizationFailedError\": \"وقع خطأ أثناء إضافة حساب PayPal. يرجى إعادة المحاولة.\",\n \"paypalFlowFailedError\": \"وقع خطأ أثناء الاتصال بـ PayPal. يرجى إعادة المحاولة.\",\n \"paypalTokenizationRequestActiveError\": \"تفويض الدفع عبر PayPal قيد التنفيذ.\",\n \"venmoCanceledError\": \"وقع خطأ ما. تأكد أن أحدث إصدار من تطبيق Venmo مثبت في جهازك وأن متصفحك يدعم التبديل إلى Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"فشل حذف طريقة الدفع. أعد المحاولة.\",\n \"venmoAppFailedError\": \"تطبيق Venmo غير موجود في جهازك.\",\n \"unsupportedCardTypeError\": \"نوع هذه البطاقة غير مدعوم. يرجى استخدام بطاقة أخرى.\",\n \"applePayTokenizationError\": \"وقع خطأ في الشبكة أثناء معالجة الدفع عبر Apple Pay. يرجى إعادة المحاولة.\",\n \"applePayActiveCardError\": \"إضافة بطاقة مدعومة إلى محفظة Apple Pay.\",\n \"cardholderNameLabel\": \"اسم صاحب البطاقة\",\n \"cardNumberLabel\": \"رقم البطاقة\",\n \"cvvLabel\": \"رمز حماية البطاقة\",\n \"cvvThreeDigitLabelSubheading\": \"(3 أرقام)\",\n \"cvvFourDigitLabelSubheading\": \"(4 أرقام)\",\n \"cardholderNamePlaceholder\": \"اسم صاحب البطاقة\",\n \"expirationDateLabel\": \"تاريخ انتهاء الصلاحية\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"MM/YY\",\n \"postalCodeLabel\": \"الرمز البريدي\",\n \"saveCardLabel\": \"حفظ البطاقة\",\n \"payWithCard\": \"الدفع باستخدام بطاقة\",\n \"endingIn\": \"التي تنتهي بالرقم {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"بطاقة\",\n \"PayPal\": \"Paypal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 211: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Způsob platby: {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Vybrat jiný způsob platby\",\n \"chooseAWayToPay\": \"Vybrat způsob platby\",\n \"otherWaysToPay\": \"Jiné způsoby platby\",\n \"edit\": \"Upravit\",\n \"doneEditing\": \"Hotovo\",\n \"editPaymentMethods\": \"Upravit způsoby platby\",\n \"CreditCardDeleteConfirmationMessage\": \"Chcete kartu {{secondaryIdentifier}} s koncovým číslem {{identifier}} odstranit?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Chcete účet {{identifier}} ve službě PayPal odstranit?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Opravdu chcete účet Venmo s uživatelským jménem {{identifier}} odstranit?\",\n \"genericDeleteConfirmationMessage\": \"Opravdu chcete tento způsob platby odstranit?\",\n \"deleteCancelButton\": \"Zrušit\",\n \"deleteConfirmationButton\": \"Odstranit\",\n \"fieldEmptyForCvv\": \"Vyplňte kód CVV.\",\n \"fieldEmptyForExpirationDate\": \"Vyplňte datum vypršení platnosti.\",\n \"fieldEmptyForCardholderName\": \"Vyplňte jméno držitele karty.\",\n \"fieldTooLongForCardholderName\": \"Jméno držitele karty musí obsahovat méně než 256 znaků.\",\n \"fieldEmptyForNumber\": \"Vyplňte číslo.\",\n \"fieldEmptyForPostalCode\": \"Vyplňte PSČ.\",\n \"fieldInvalidForCardholderName\": \"Toto jméno držitele karty není platné.\",\n \"fieldInvalidForCvv\": \"Tento bezpečnostní kód není platný.\",\n \"fieldInvalidForExpirationDate\": \"Toto datum vypršení platnosti není platné.\",\n \"fieldInvalidForNumber\": \"Toto číslo karty není platné.\",\n \"fieldInvalidForPostalCode\": \"Toto PSČ není platné.\",\n \"genericError\": \"Došlo k chybě na naší straně.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Tato kreditní karta je již jako způsob platby uložena.\",\n \"hostedFieldsFailedTokenizationError\": \"Zkontrolujte zadané údaje a zkuste to znovu.\",\n \"hostedFieldsFieldsInvalidError\": \"Zkontrolujte zadané údaje a zkuste to znovu.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Došlo k chybě sítě. Zkuste to znovu.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Ověření kreditní karty se nezdařilo. Zkontrolujte zadané údaje a zkuste to znovu.\",\n \"paypalButtonMustBeUsed\": \"Chcete-li přejít k platbě, použijte tlačítko PayPal.\",\n \"paypalAccountTokenizationFailedError\": \"Při přidávání účtu PayPal došlo k chybě. Zkuste to znovu.\",\n \"paypalFlowFailedError\": \"Při připojování ke službě PayPal došlo k chybě. Zkuste to znovu.\",\n \"paypalTokenizationRequestActiveError\": \"Autorizace platby přes PayPal již probíhá.\",\n \"venmoCanceledError\": \"Došlo k chybě. Zkontrolujte, zda máte v zařízení nainstalovanou nejnovější verzi aplikace Venmo a zda prohlížeč přechod na aplikaci Venmo podporuje.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Způsob platby se nepodařilo odstranit. Zkuste to znovu.\",\n \"venmoAppFailedError\": \"Aplikaci Venmo se ve vašem zařízení nepodařilo najít.\",\n \"unsupportedCardTypeError\": \"Tento typ karty není podporován. Vyzkoušejte jinou kartu.\",\n \"applePayTokenizationError\": \"Při zpracování platby přes Apple Pay došlo k chybě sítě. Zkuste to znovu.\",\n \"applePayActiveCardError\": \"Přidejte si podporovanou kartu do peněženky Apple Pay.\",\n \"cardholderNameLabel\": \"Jméno držitele karty\",\n \"cardNumberLabel\": \"Číslo karty\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 číslice)\",\n \"cvvFourDigitLabelSubheading\": \"(4 číslice)\",\n \"cardholderNamePlaceholder\": \"Jméno držitele karty\",\n \"expirationDateLabel\": \"Datum vypršení platnosti\",\n \"expirationDateLabelSubheading\": \"(MM/RR)\",\n \"expirationDatePlaceholder\": \"MM/RR\",\n \"postalCodeLabel\": \"PSČ\",\n \"saveCardLabel\": \"Uložit kartu\",\n \"payWithCard\": \"Zaplatit kartou\",\n \"endingIn\": \"Koncové číslo: {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Karta\",\n \"PayPal\": \"Společnost PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 212: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Betaler med {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Vælg en anden betalingsmetode\",\n \"chooseAWayToPay\": \"Vælg, hvordan du vil betale\",\n \"otherWaysToPay\": \"Andre betalingsmetoder\",\n \"edit\": \"Rediger\",\n \"doneEditing\": \"Udført\",\n \"editPaymentMethods\": \"Rediger betalingsmetoder\",\n \"CreditCardDeleteConfirmationMessage\": \"Vil du slette {{secondaryIdentifier}}-kortet, der slutter på {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Vil du slette PayPal-kontoen {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Er du sikker på, at du vil slette Venmo-kontoen med brugernavnet {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Er du sikker på, at du vil slette denne betalingsmetode?\",\n \"deleteCancelButton\": \"Annuller\",\n \"deleteConfirmationButton\": \"Slet\",\n \"fieldEmptyForCvv\": \"Du skal angive kontrolcifrene.\",\n \"fieldEmptyForExpirationDate\": \"Du skal angive udløbsdatoen.\",\n \"fieldEmptyForCardholderName\": \"Du skal angive kortindehaverens navn.\",\n \"fieldTooLongForCardholderName\": \"Kortejerens navn skal være mindre end 256 tegn.\",\n \"fieldEmptyForNumber\": \"Du skal angive et nummer.\",\n \"fieldEmptyForPostalCode\": \"Du skal angive et postnummer.\",\n \"fieldInvalidForCardholderName\": \"Kortindehaverens navn er ugyldigt.\",\n \"fieldInvalidForCvv\": \"Sikkerhedskoden er ugyldig.\",\n \"fieldInvalidForExpirationDate\": \"Udløbsdatoen er ugyldig.\",\n \"fieldInvalidForNumber\": \"Kortnummeret er ugyldigt.\",\n \"fieldInvalidForPostalCode\": \"Postnummeret er ugyldigt.\",\n \"genericError\": \"Der opstod en fejl.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Dette betalingskort er allerede en gemt betalingsmetode.\",\n \"hostedFieldsFailedTokenizationError\": \"Tjek oplysningerne, og prøv igen.\",\n \"hostedFieldsFieldsInvalidError\": \"Tjek oplysningerne, og prøv igen.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Netværksfejl. Prøv igen.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Betalingskortet blev ikke bekræftet. Tjek oplysningerne, og prøv igen.\",\n \"paypalButtonMustBeUsed\": \"Brug PayPal-knappen for at fortsætte med din betaling.\",\n \"paypalAccountTokenizationFailedError\": \"PayPal-kontoen blev ikke tilføjet. Prøv igen.\",\n \"paypalFlowFailedError\": \"Der kunne ikke oprettes forbindelse til PayPal. Prøv igen.\",\n \"paypalTokenizationRequestActiveError\": \"PayPal-betalingen er i gang med at blive autoriseret.\",\n \"venmoCanceledError\": \"Der opstod en fejl. Sørg for, at du har den seneste version af Venmo-appen installeret på din enhed, og at din browser understøtter skift til Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Vi kunne ikke slette betalingsmetoden. Prøv igen.\",\n \"venmoAppFailedError\": \"Venmo-appen blev ikke fundet på din enhed.\",\n \"unsupportedCardTypeError\": \"Korttypen understøttes ikke. Prøv et andet kort.\",\n \"applePayTokenizationError\": \"Der opstod en netværksfejl under behandlingen af betalingen med Apple Pay. Prøv igen.\",\n \"applePayActiveCardError\": \"Knyt et understøttet kort til din Apple Pay-e-pung.\",\n \"cardholderNameLabel\": \"Kortindehaverens navn\",\n \"cardNumberLabel\": \"Kortnummer\",\n \"cvvLabel\": \"Kontrolcifre\",\n \"cvvThreeDigitLabelSubheading\": \"(3 cifre)\",\n \"cvvFourDigitLabelSubheading\": \"(4 cifre)\",\n \"cardholderNamePlaceholder\": \"Kortindehaverens navn\",\n \"expirationDateLabel\": \"Udløbsdato\",\n \"expirationDateLabelSubheading\": \"(MM/ÅÅ)\",\n \"expirationDatePlaceholder\": \"MM/ÅÅ\",\n \"postalCodeLabel\": \"Postnummer\",\n \"saveCardLabel\": \"Gem kort\",\n \"payWithCard\": \"Betal med kort\",\n \"endingIn\": \"Der slutter på {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Kort\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 213: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Zahlen mit {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Andere Zahlungsmethode wählen\",\n \"chooseAWayToPay\": \"Wie möchten Sie bezahlen?\",\n \"otherWaysToPay\": \"Andere Zahlungsmethoden\",\n \"edit\": \"Bearbeiten\",\n \"doneEditing\": \"Fertig\",\n \"editPaymentMethods\": \"Zahlungsquellen bearbeiten\",\n \"CreditCardDeleteConfirmationMessage\": \"{{secondaryIdentifier}} Karte mit den Endziffern {{identifier}} löschen?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"PayPal-Konto {{identifier}} löschen?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Wollen Sie das Venmo-Konto mit dem Benutzernamen {{identifier}} wirklich löschen?\",\n \"genericDeleteConfirmationMessage\": \"Wollen Sie diese Zahlungsquelle wirklich löschen?\",\n \"deleteCancelButton\": \"Abbrechen\",\n \"deleteConfirmationButton\": \"Löschen\",\n \"fieldEmptyForCvv\": \"Geben Sie die Kartenprüfnummer ein.\",\n \"fieldEmptyForExpirationDate\": \"Geben Sie das Ablaufdatum ein.\",\n \"fieldEmptyForCardholderName\": \"Geben Sie den Namen des Karteninhabers ein.\",\n \"fieldTooLongForCardholderName\": \"Der Name des Karteninhabers darf 255 Zeichen nicht übersteigen.\",\n \"fieldEmptyForNumber\": \"Geben Sie die Nummer ein.\",\n \"fieldEmptyForPostalCode\": \"Geben Sie die PLZ ein.\",\n \"fieldInvalidForCardholderName\": \"Der Name des Karteninhabers ist nicht gültig.\",\n \"fieldInvalidForCvv\": \"Die Kartenprüfnummer ist ungültig.\",\n \"fieldInvalidForExpirationDate\": \"Das Ablaufdatum ist ungültig.\",\n \"fieldInvalidForNumber\": \"Die Kreditkartennummer ist ungültig.\",\n \"fieldInvalidForPostalCode\": \"Die PLZ ist ungültig.\",\n \"genericError\": \"Bei uns ist ein Problem aufgetreten.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Diese Kreditkarte ist bereits als gespeicherte Zahlungsmethode vorhanden.\",\n \"hostedFieldsFailedTokenizationError\": \"Überprüfen Sie Ihre Eingabe und versuchen Sie es erneut.\",\n \"hostedFieldsFieldsInvalidError\": \"Überprüfen Sie Ihre Eingabe und versuchen Sie es erneut.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Netzwerkfehler. Versuchen Sie es erneut.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Überprüfung der Karte fehlgeschlagen. Überprüfen Sie Ihre Eingabe und versuchen Sie es erneut.\",\n \"paypalButtonMustBeUsed\": \"Verwenden Sie den PayPal-Button, um mit der Zahlung fortfahren.\",\n \"paypalAccountTokenizationFailedError\": \"Beim Hinzufügen des PayPal-Kontos ist ein Problem aufgetreten. Versuchen Sie es erneut.\",\n \"paypalFlowFailedError\": \"Beim Verbinden mit PayPal ist ein Problem aufgetreten. Versuchen Sie es erneut.\",\n \"paypalTokenizationRequestActiveError\": \"Die PayPal-Zahlung wird bereits autorisiert.\",\n \"venmoCanceledError\": \"Etwas ist schief gelaufen. Vergewissern Sie sich, dass Sie die neueste Version der Venmo-App auf Ihrem Gerät installiert haben und Ihr Browser den Wechsel zu Venmo unterstützt.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Die Zahlungsquelle konnte nicht gelöscht werden. Versuchen Sie es erneut.\",\n \"venmoAppFailedError\": \"Die Venmo-App wurde auf Ihrem Gerät nicht gefunden.\",\n \"unsupportedCardTypeError\": \"Dieser Kreditkartentyp wird nicht unterstützt. Versuchen Sie es mit einer anderen Karte.\",\n \"applePayTokenizationError\": \"Netzwerkfehler bei der Zahlungsabwicklung mit Apple Pay. Versuchen Sie es erneut.\",\n \"applePayActiveCardError\": \"Fügen Sie der Apple-Pay-Börse eine unterstützte Kreditkarte hinzu.\",\n \"cardholderNameLabel\": \"Name des Karteninhabers\",\n \"cardNumberLabel\": \"Kartennummer\",\n \"cvvLabel\": \"Prüfnr.\",\n \"cvvThreeDigitLabelSubheading\": \"(3-stellig)\",\n \"cvvFourDigitLabelSubheading\": \"(4-stellig)\",\n \"cardholderNamePlaceholder\": \"Name des Karteninhabers\",\n \"expirationDateLabel\": \"Gültig bis\",\n \"expirationDateLabelSubheading\": \"(MM/JJ)\",\n \"expirationDatePlaceholder\": \"MM/JJ\",\n \"postalCodeLabel\": \"PLZ\",\n \"saveCardLabel\": \"Karte speichern\",\n \"payWithCard\": \"Mit Kreditkarte zahlen\",\n \"endingIn\": \"Mit den Endziffern {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Kreditkarte\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 214: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Πληρωμή μέσω {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Επιλέξτε έναν άλλον τρόπο πληρωμής\",\n \"chooseAWayToPay\": \"Επιλογή τρόπου πληρωμής\",\n \"otherWaysToPay\": \"Άλλοι τρόποι πληρωμής\",\n \"edit\": \"Επεξεργασία\",\n \"doneEditing\": \"Τέλος\",\n \"editPaymentMethods\": \"Επεξεργασία μεθόδων πληρωμής\",\n \"CreditCardDeleteConfirmationMessage\": \"Διαγραφή κάρτας {{secondaryIdentifier}} που λήγει σε {{identifier}};\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Διαγραφή λογαριασμού PayPal {{identifier}};\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Θέλετε σίγουρα να διαγράψετε τον λογαριασμό Venmo με το όνομα χρήστη {{identifier}};\",\n \"genericDeleteConfirmationMessage\": \"Θέλετε σίγουρα να διαγράψετε αυτήν τη μέθοδο πληρωμής;\",\n \"deleteCancelButton\": \"Ακύρωση\",\n \"deleteConfirmationButton\": \"Διαγραφή\",\n \"fieldEmptyForCvv\": \"Συμπληρώστε έναν CVV.\",\n \"fieldEmptyForExpirationDate\": \"Συμπληρώστε ημερομηνία λήξης.\",\n \"fieldEmptyForCardholderName\": \"Συμπληρώστε το όνομα ενός κατόχου κάρτας.\",\n \"fieldTooLongForCardholderName\": \"Το όνομα του κατόχου της κάρτας πρέπει να περιέχει λιγότερους από 256 χαρακτήρες.\",\n \"fieldEmptyForNumber\": \"Συμπληρώστε έναν αριθμό.\",\n \"fieldEmptyForPostalCode\": \"Συμπληρώστε έναν ταχυδρομικό κώδικα.\",\n \"fieldInvalidForCardholderName\": \"Αυτό το όνομα κατόχου κάρτας δεν είναι έγκυρο.\",\n \"fieldInvalidForCvv\": \"Αυτός ο κωδικός ασφαλείας δεν είναι έγκυρος.\",\n \"fieldInvalidForExpirationDate\": \"Αυτή η ημερομηνία λήξης δεν είναι έγκυρη.\",\n \"fieldInvalidForNumber\": \"Αυτός ο αριθμός κάρτας δεν είναι έγκυρος.\",\n \"fieldInvalidForPostalCode\": \"Αυτός ο ταχυδρομικός κώδικας δεν είναι έγκυρος.\",\n \"genericError\": \"Προέκυψε ένα πρόβλημα στο σύστημά μας.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Αυτή η πιστωτική κάρτα υπάρχει ήδη ως αποθηκευμένη μέθοδος πληρωμής.\",\n \"hostedFieldsFailedTokenizationError\": \"Ελέγξτε τα στοιχεία σας και δοκιμάστε ξανά.\",\n \"hostedFieldsFieldsInvalidError\": \"Ελέγξτε τα στοιχεία σας και δοκιμάστε ξανά.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Σφάλμα δικτύου. Δοκιμάστε ξανά.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Η επαλήθευση της πιστωτικής κάρτας απέτυχε. Ελέγξτε τα στοιχεία σας και δοκιμάστε ξανά.\",\n \"paypalButtonMustBeUsed\": \"Χρησιμοποιήστε το κουμπί PayPal για να συνεχίσετε με την πληρωμή.\",\n \"paypalAccountTokenizationFailedError\": \"Προέκυψε κάποιο πρόβλημα με την προσθήκη του λογαριασμού PayPal. Δοκιμάστε ξανά.\",\n \"paypalFlowFailedError\": \"Προέκυψε κάποιο πρόβλημα με τη σύνδεση στην PayPal. Δοκιμάστε ξανά.\",\n \"paypalTokenizationRequestActiveError\": \"Η εξουσιοδότηση πληρωμής PayPal βρίσκεται ήδη σε εξέλιξη.\",\n \"venmoCanceledError\": \"Προέκυψε πρόβλημα. Βεβαιωθείτε ότι έχετε την πιο πρόσφατη έκδοση της εφαρμογής Venmo εγκατεστημένη στη συσκευή σας και ότι το πρόγραμμα περιήγησής σας υποστηρίζει τη μετάβαση στη Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Η διαγραφή της μεθόδου πληρωμής είναι αδύνατη, δοκιμάστε ξανά.\",\n \"venmoAppFailedError\": \"Η εφαρμογή Venmo δεν βρέθηκε στη συσκευή σας.\",\n \"unsupportedCardTypeError\": \"Αυτός ο τύπος κάρτας δεν υποστηρίζεται. Δοκιμάστε άλλη κάρτα.\",\n \"applePayTokenizationError\": \"Προέκυψε σφάλμα δικτύου κατά την επεξεργασία της πληρωμής μέσω Apple Pay. Δοκιμάστε ξανά.\",\n \"applePayActiveCardError\": \"Προσθέστε μια υποστηριζόμενη κάρτα στο πορτοφόλι Apple Pay.\",\n \"cardholderNameLabel\": \"Όνομα κατόχου κάρτας\",\n \"cardNumberLabel\": \"Αριθμός κάρτας\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 ψηφία)\",\n \"cvvFourDigitLabelSubheading\": \"(4 ψηφία)\",\n \"cardholderNamePlaceholder\": \"Όνομα κατόχου κάρτας\",\n \"expirationDateLabel\": \"Ημερομηνία λήξης\",\n \"expirationDateLabelSubheading\": \"(ΜΜ/ΕΕ)\",\n \"expirationDatePlaceholder\": \"MM/ΕΕ\",\n \"postalCodeLabel\": \"Ταχυδρομικός κώδικας\",\n \"saveCardLabel\": \"Αποθήκευση κάρτας\",\n \"payWithCard\": \"Πληρωμή με κάρτα\",\n \"endingIn\": \"που λήγει σε {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Κάρτα\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 215: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Paying with {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Choose another way to pay\",\n \"chooseAWayToPay\": \"Choose a way to pay\",\n \"otherWaysToPay\": \"Other ways to pay\",\n \"edit\": \"Edit\",\n \"doneEditing\": \"Done\",\n \"editPaymentMethods\": \"Edit payment methods\",\n \"CreditCardDeleteConfirmationMessage\": \"Delete {{secondaryIdentifier}} card ending in {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Delete PayPal account {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Are you sure you want to delete the Venmo account with username {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Are you sure you want to delete this payment method?\",\n \"deleteCancelButton\": \"Cancel\",\n \"deleteConfirmationButton\": \"Delete\",\n \"fieldEmptyForCvv\": \"Please fill out a CVV.\",\n \"fieldEmptyForExpirationDate\": \"Please fill out an expiry date.\",\n \"fieldEmptyForCardholderName\": \"Please fill out a cardholder name.\",\n \"fieldTooLongForCardholderName\": \"Cardholder name must be less than 256 characters.\",\n \"fieldEmptyForNumber\": \"Please fill out a number.\",\n \"fieldEmptyForPostalCode\": \"Please fill out a postcode.\",\n \"fieldInvalidForCardholderName\": \"This cardholder name isn't valid.\",\n \"fieldInvalidForCvv\": \"This security code is not valid.\",\n \"fieldInvalidForExpirationDate\": \"This expiry date is not valid.\",\n \"fieldInvalidForNumber\": \"This card number is not valid.\",\n \"fieldInvalidForPostalCode\": \"This postcode is not valid.\",\n \"genericError\": \"Something went wrong on our end.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"This credit card already exists as a saved payment method.\",\n \"hostedFieldsFailedTokenizationError\": \"Check your entries and try again.\",\n \"hostedFieldsFieldsInvalidError\": \"Check your entries and try again.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Network error. Please try again.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Credit card verification failed. Check your entries and try again.\",\n \"paypalButtonMustBeUsed\": \"Use the PayPal button to continue with your payment.\",\n \"paypalAccountTokenizationFailedError\": \"Something went wrong while adding the PayPal account. Please try again.\",\n \"paypalFlowFailedError\": \"Something went wrong while connecting to PayPal. Please try again.\",\n \"paypalTokenizationRequestActiveError\": \"PayPal payment authorisation is already in progress.\",\n \"venmoCanceledError\": \"We're sorry, something seems to have gone wrong. Please ensure you have the most recent version of the Venmo app installed on your device and your browser supports switching to Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"We're sorry. We couldn't delete that payment method. Please try again.\",\n \"venmoAppFailedError\": \"The Venmo app wasn't found on your device.\",\n \"unsupportedCardTypeError\": \"This card type is not supported. Please try another card.\",\n \"applePayTokenizationError\": \"A network error occurred while processing the Apple Pay payment. Please try again.\",\n \"applePayActiveCardError\": \"Link a supported card to your Apple Pay Wallet.\",\n \"cardholderNameLabel\": \"Cardholder Name\",\n \"cardNumberLabel\": \"Card Number\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 digits)\",\n \"cvvFourDigitLabelSubheading\": \"(4 digits)\",\n \"cardholderNamePlaceholder\": \"Cardholder Name\",\n \"expirationDateLabel\": \"Expiry date\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"MM/YY\",\n \"postalCodeLabel\": \"Postcode\",\n \"saveCardLabel\": \"Save card\",\n \"payWithCard\": \"Pay with credit or debit card\",\n \"endingIn\": \"Ending in {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Card\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 216: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Paying with {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Choose another way to pay\",\n \"chooseAWayToPay\": \"Choose a way to pay\",\n \"otherWaysToPay\": \"Other ways to pay\",\n \"edit\": \"Edit\",\n \"doneEditing\": \"Done\",\n \"editPaymentMethods\": \"Edit funding sources\",\n \"CreditCardDeleteConfirmationMessage\": \"Delete {{secondaryIdentifier}} card ending in {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Delete PayPal account {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Are you sure you want to delete the Venmo account with username {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Are you sure you want to delete this funding source?\",\n \"deleteCancelButton\": \"Cancel\",\n \"deleteConfirmationButton\": \"Delete\",\n \"fieldEmptyForCvv\": \"Please fill in a CSC.\",\n \"fieldEmptyForExpirationDate\": \"Please fill in an expiry date.\",\n \"fieldEmptyForCardholderName\": \"Please fill in a cardholder name.\",\n \"fieldTooLongForCardholderName\": \"Cardholder name must be less than 256 characters.\",\n \"fieldEmptyForNumber\": \"Please fill in a number.\",\n \"fieldEmptyForPostalCode\": \"Please fill in a postcode.\",\n \"fieldInvalidForCardholderName\": \"This cardholder name isn't valid.\",\n \"fieldInvalidForCvv\": \"This security code is not valid.\",\n \"fieldInvalidForExpirationDate\": \"This expiry date is not valid.\",\n \"fieldInvalidForNumber\": \"This card number is not valid.\",\n \"fieldInvalidForPostalCode\": \"This postcode is not valid.\",\n \"genericError\": \"Something went wrong on our end.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"This credit card has already been added to your account as a funding source.\",\n \"hostedFieldsFailedTokenizationError\": \"Please check your information and try again.\",\n \"hostedFieldsFieldsInvalidError\": \"Please check your information and try again.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Network error. Please try again.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Credit card verification failed. Please check your information and try again.\",\n \"paypalButtonMustBeUsed\": \"Use the PayPal button to continue with your payment.\",\n \"paypalAccountTokenizationFailedError\": \"Something went wrong while adding the PayPal account. Please try again.\",\n \"paypalFlowFailedError\": \"Something went wrong while connecting to PayPal. Please try again.\",\n \"paypalTokenizationRequestActiveError\": \"PayPal payment authorisation is already in progress.\",\n \"venmoCanceledError\": \"We're sorry, something seems to have gone wrong. Make sure you have the most recent version of the Venmo app installed on your device and your browser supports the switch to Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Unable to delete funding source, try again.\",\n \"venmoAppFailedError\": \"The Venmo app isn't on your device.\",\n \"unsupportedCardTypeError\": \"This card type is not supported. Please try another card.\",\n \"applePayTokenizationError\": \"A network error occurred while processing the Apple Pay payment. Please try again.\",\n \"applePayActiveCardError\": \"Add a supported card to your Apple Pay wallet.\",\n \"cardholderNameLabel\": \"Cardholder name\",\n \"cardNumberLabel\": \"Card number\",\n \"cvvLabel\": \"CSC\",\n \"cvvThreeDigitLabelSubheading\": \"(3 digits)\",\n \"cvvFourDigitLabelSubheading\": \"(4 digits)\",\n \"cardholderNamePlaceholder\": \"Cardholder name\",\n \"expirationDateLabel\": \"Expiry date\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"MM/YY\",\n \"postalCodeLabel\": \"Postcode\",\n \"saveCardLabel\": \"Save card\",\n \"payWithCard\": \"Pay with card\",\n \"endingIn\": \"Ending in {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Card\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 217: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Paying with {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Choose another way to pay\",\n \"chooseAWayToPay\": \"Choose a way to pay\",\n \"otherWaysToPay\": \"Other ways to pay\",\n \"edit\": \"Edit\",\n \"doneEditing\": \"Done\",\n \"editPaymentMethods\": \"Edit payment methods\",\n \"CreditCardDeleteConfirmationMessage\": \"Delete {{secondaryIdentifier}} card ending in {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Delete PayPal account {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Are you sure you want to delete the Venmo account with username {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Are you sure you want to delete this payment method?\",\n \"deleteCancelButton\": \"Cancel\",\n \"deleteConfirmationButton\": \"Delete\",\n \"fieldEmptyForCvv\": \"Please enter a CVV.\",\n \"fieldEmptyForExpirationDate\": \"Please enter an expiry date.\",\n \"fieldEmptyForCardholderName\": \"Please enter a cardholder name.\",\n \"fieldTooLongForCardholderName\": \"Cardholder name must have less than 256 characters.\",\n \"fieldEmptyForNumber\": \"Please enter a number.\",\n \"fieldEmptyForPostalCode\": \"Please enter a PIN code.\",\n \"fieldInvalidForCardholderName\": \"This cardholder name isn't valid.\",\n \"fieldInvalidForCvv\": \"This security code isn't valid.\",\n \"fieldInvalidForExpirationDate\": \"This expiration date isn't valid.\",\n \"fieldInvalidForNumber\": \"This card number isn't valid.\",\n \"fieldInvalidForPostalCode\": \"This PIN code isn't valid.\",\n \"genericError\": \"We're sorry, something seems to have gone wrong.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"This credit card already exists as a saved payment method.\",\n \"hostedFieldsFailedTokenizationError\": \"Please check your information and try again.\",\n \"hostedFieldsFieldsInvalidError\": \"Please check your information and try again.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Network error. Please try again.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Credit card verification failed. Please check your information and try again.\",\n \"paypalButtonMustBeUsed\": \"Use the PayPal button to continue with your payment.\",\n \"paypalAccountTokenizationFailedError\": \"Something went wrong adding the PayPal account. Please try again.\",\n \"paypalFlowFailedError\": \"Something went wrong connecting to PayPal. Please try again.\",\n \"paypalTokenizationRequestActiveError\": \"PayPal payment authorisation is already in progress.\",\n \"venmoCanceledError\": \"We're sorry, something seems to have gone wrong. Please ensure you have the most recent version of the Venmo app installed on your device and your browser supports switching to Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Unable to delete payment method. Please try again.\",\n \"venmoAppFailedError\": \"The Venmo app couldn't be found on your device.\",\n \"unsupportedCardTypeError\": \"This card type isn't supported. Please try another card.\",\n \"applePayTokenizationError\": \"A network error occurred while processing the Apple Pay payment. Please try again.\",\n \"applePayActiveCardError\": \"Add a supported card to your Apple Pay wallet.\",\n \"cardholderNameLabel\": \"Cardholder name\",\n \"cardNumberLabel\": \"Card number\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 digits)\",\n \"cvvFourDigitLabelSubheading\": \"(4 digits)\",\n \"cardholderNamePlaceholder\": \"Cardholder name\",\n \"expirationDateLabel\": \"Expiry date\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"MM/YY\",\n \"postalCodeLabel\": \"PIN code\",\n \"saveCardLabel\": \"Save card\",\n \"payWithCard\": \"Pay with card\",\n \"endingIn\": \"Ending in {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Card\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 218: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n payingWith: 'Paying with {{paymentSource}}',\n chooseAnotherWayToPay: 'Choose another way to pay',\n chooseAWayToPay: 'Choose a way to pay',\n otherWaysToPay: 'Other ways to pay',\n edit: 'Edit',\n doneEditing: 'Done',\n editPaymentMethods: 'Edit payment methods',\n CreditCardDeleteConfirmationMessage: 'Delete {{secondaryIdentifier}} card ending in {{identifier}}?',\n PayPalAccountDeleteConfirmationMessage: 'Delete PayPal account {{identifier}}?',\n VenmoAccountDeleteConfirmationMessage: 'Are you sure you want to delete Venmo account with username {{identifier}}?',\n genericDeleteConfirmationMessage: 'Are you sure you want to delete this payment method?',\n deleteCancelButton: 'Cancel',\n deleteConfirmationButton: 'Delete',\n // Errors\n fieldEmptyForCvv: 'Please fill out a CVV.',\n fieldEmptyForExpirationDate: 'Please fill out an expiration date.',\n fieldEmptyForCardholderName: 'Please fill out a cardholder name.',\n fieldEmptyForNumber: 'Please fill out a card number.',\n fieldEmptyForPostalCode: 'Please fill out a postal code.',\n fieldInvalidForCardholderName: 'This cardholder name is not valid.',\n fieldInvalidForCvv: 'This security code is not valid.',\n fieldInvalidForExpirationDate: 'This expiration date is not valid.',\n fieldInvalidForNumber: 'This card number is not valid.',\n fieldInvalidForPostalCode: 'This postal code is not valid.',\n fieldTooLongForCardholderName: 'Cardholder name must be less than 256 characters.',\n genericError: 'Something went wrong on our end.',\n hostedFieldsTokenizationFailOnDuplicateError: 'This credit card already exists as a saved payment method.',\n hostedFieldsFailedTokenizationError: 'Please check your information and try again.',\n hostedFieldsTokenizationCvvVerificationFailedError: 'Credit card verification failed. Please check your information and try again.',\n hostedFieldsTokenizationNetworkErrorError: 'Network error. Please try again.',\n hostedFieldsFieldsInvalidError: 'Please check your information and try again.',\n paypalButtonMustBeUsed: 'Use the PayPal button to continue with your payment.',\n paypalAccountTokenizationFailedError: 'Something went wrong adding the PayPal account. Please try again.',\n paypalFlowFailedError: 'Something went wrong connecting to PayPal. Please try again.',\n paypalTokenizationRequestActiveError: 'PayPal payment authorization is already in progress.',\n applePayTokenizationError: 'A network error occurred while processing the Apple Pay payment. Please try again.',\n applePayActiveCardError: 'Add a supported card to your Apple Pay wallet.',\n vaultManagerPaymentMethodDeletionError: 'Unable to delete payment method, try again.',\n venmoCanceledError: 'Something went wrong. Ensure you have the most recent version of the Venmo app installed on your device and your browser supports switching to Venmo.',\n venmoAppFailedError: 'The Venmo app could not be found on your device.',\n unsupportedCardTypeError: 'This card type is not supported. Please try another card.',\n // Card form\n cardholderNameLabel: 'Cardholder Name',\n cardNumberLabel: 'Card Number',\n cvvLabel: 'CVV',\n cvvThreeDigitLabelSubheading: '(3 digits)',\n cvvFourDigitLabelSubheading: '(4 digits)',\n expirationDateLabel: 'Expiration Date',\n expirationDateLabelSubheading: '(MM/YY)',\n cardholderNamePlaceholder: 'Cardholder Name',\n expirationDatePlaceholder: 'MM/YY',\n postalCodeLabel: 'Postal Code',\n saveCardLabel: 'Save card',\n payWithCard: 'Pay with card',\n // Payment Method descriptions\n endingIn: 'Ending in {{lastFourCardDigits}}',\n Card: 'Card',\n PayPal: 'PayPal',\n 'PayPal Credit': 'PayPal Credit',\n 'Apple Pay': 'Apple Pay',\n 'Google Pay': 'Google Pay',\n 'Venmo': 'Venmo',\n 'American Express': 'American Express',\n Discover: 'Discover',\n 'Diners Club': 'Diners Club',\n MasterCard: 'Mastercard',\n Visa: 'Visa',\n JCB: 'JCB',\n Maestro: 'Maestro',\n UnionPay: 'UnionPay'\n };\n }, {}],\n 219: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Pago con {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Selecciona otra forma de pago.\",\n \"chooseAWayToPay\": \"Selecciona una forma de pago.\",\n \"otherWaysToPay\": \"Otras formas de pago\",\n \"edit\": \"Modificar\",\n \"doneEditing\": \"Hecho\",\n \"editPaymentMethods\": \"Editar formas de pago\",\n \"CreditCardDeleteConfirmationMessage\": \"¿Quieres eliminar la tarjeta {{secondaryIdentifier}} que termina en {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"¿Quieres eliminar la cuenta PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"¿Seguro de que deseas eliminar la cuenta de Venmo con nombre de usuario {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"¿Seguro que deseas eliminar esta forma de pago?\",\n \"deleteCancelButton\": \"Cancelar\",\n \"deleteConfirmationButton\": \"Eliminar\",\n \"fieldEmptyForCvv\": \"Escribe el código CVV.\",\n \"fieldEmptyForExpirationDate\": \"Escribe la fecha de vencimiento.\",\n \"fieldEmptyForCardholderName\": \"Escribe el nombre de un titular de la tarjeta.\",\n \"fieldTooLongForCardholderName\": \"El nombre del titular de la tarjeta debe tener menos de 256 caracteres.\",\n \"fieldEmptyForNumber\": \"Escribe un número.\",\n \"fieldEmptyForPostalCode\": \"Escribe el código postal.\",\n \"fieldInvalidForCardholderName\": \"El nombre del titular de la tarjeta no es válido.\",\n \"fieldInvalidForCvv\": \"Este código de seguridad no es válido.\",\n \"fieldInvalidForExpirationDate\": \"Esta fecha de vencimiento no es válida.\",\n \"fieldInvalidForNumber\": \"Este número de tarjeta no es válido.\",\n \"fieldInvalidForPostalCode\": \"Este código postal no es válido.\",\n \"genericError\": \"Hemos tenido algún problema.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Esta tarjeta de crédito ya existe como forma de pago guardada.\",\n \"hostedFieldsFailedTokenizationError\": \"Comprueba la información e inténtalo de nuevo.\",\n \"hostedFieldsFieldsInvalidError\": \"Comprueba la información e inténtalo de nuevo.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Error de red. Inténtalo de nuevo.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Error de verificación de la tarjeta de crédito. Comprueba la información e inténtalo de nuevo.\",\n \"paypalButtonMustBeUsed\": \"Utiliza el botón de PayPal para continuar con el pago.\",\n \"paypalAccountTokenizationFailedError\": \"Se ha producido un error al vincular la cuenta PayPal. Inténtalo de nuevo.\",\n \"paypalFlowFailedError\": \"Se ha producido un error al conectarse a PayPal. Inténtalo de nuevo.\",\n \"paypalTokenizationRequestActiveError\": \"Ya hay una autorización de pago de PayPal en curso.\",\n \"venmoCanceledError\": \"Ha habido un problema. Asegúrate de que tienes la versión más reciente de la aplicación de Venmo instalada en tu dispositivo y de que tu navegador es compatible con cambiar a Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"No se ha podido eliminar la forma de pago. Inténtalo de nuevo.\",\n \"venmoAppFailedError\": \"No se ha encontrado la aplicación de Venmo en tu dispositivo.\",\n \"unsupportedCardTypeError\": \"No se admite este tipo de tarjeta. Prueba con otra tarjeta.\",\n \"applePayTokenizationError\": \"Se ha producido un error de red al procesar el pago con Apple Pay. Inténtalo de nuevo.\",\n \"applePayActiveCardError\": \"Añade una tarjeta admitida a tu Wallet de Apple Pay.\",\n \"cardholderNameLabel\": \"Nombre del titular de la tarjeta\",\n \"cardNumberLabel\": \"Número de tarjeta\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 dígitos)\",\n \"cvvFourDigitLabelSubheading\": \"(4 dígitos)\",\n \"cardholderNamePlaceholder\": \"Nombre del titular de la tarjeta\",\n \"expirationDateLabel\": \"Fecha de vencimiento\",\n \"expirationDateLabelSubheading\": \"(MM/AA)\",\n \"expirationDatePlaceholder\": \"MM/AA\",\n \"postalCodeLabel\": \"Código postal\",\n \"saveCardLabel\": \"Guardar tarjeta\",\n \"payWithCard\": \"Pagar con tarjeta\",\n \"endingIn\": \"Terminada en {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Tarjeta\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 220: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Pagando con {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Elija otra forma de pago\",\n \"chooseAWayToPay\": \"Elija una forma de pago\",\n \"otherWaysToPay\": \"Otras formas de pago\",\n \"edit\": \"Editar\",\n \"doneEditing\": \"Listo\",\n \"editPaymentMethods\": \"Editar formas de pago\",\n \"CreditCardDeleteConfirmationMessage\": \"¿Desea eliminar la tarjeta {{secondaryIdentifier}} con terminación en {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"¿Desea eliminar la cuenta de PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"¿Seguro que desea eliminar la cuenta de Venmo con el nombre de usuario {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"¿Seguro que desea eliminar esta forma de pago?\",\n \"deleteCancelButton\": \"Cancelar\",\n \"deleteConfirmationButton\": \"Eliminar\",\n \"fieldEmptyForCvv\": \"Ingrese un CVV.\",\n \"fieldEmptyForExpirationDate\": \"Complete una fecha de vencimiento.\",\n \"fieldEmptyForCardholderName\": \"Ingrese el nombre del titular de la tarjeta.\",\n \"fieldTooLongForCardholderName\": \"El nombre del titular de la tarjeta debe tener menos de 256 caracteres.\",\n \"fieldEmptyForNumber\": \"Ingrese un número.\",\n \"fieldEmptyForPostalCode\": \"Ingrese un código postal.\",\n \"fieldInvalidForCardholderName\": \"El nombre del titular de la tarjeta no es válido.\",\n \"fieldInvalidForCvv\": \"Este código de seguridad no es válido.\",\n \"fieldInvalidForExpirationDate\": \"Esta fecha de vencimiento no es válida.\",\n \"fieldInvalidForNumber\": \"Este número de tarjeta no es válido.\",\n \"fieldInvalidForPostalCode\": \"Este código postal no es válido.\",\n \"genericError\": \"Se ha producido un error.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Esta tarjeta de crédito ya existe como forma de pago guardada.\",\n \"hostedFieldsFailedTokenizationError\": \"Verifique su información e inténtelo de nuevo.\",\n \"hostedFieldsFieldsInvalidError\": \"Verifique su información e inténtelo de nuevo.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Error de red. Inténtelo de nuevo.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"La verificación de la tarjeta de crédito falló. Revise su información e inténtelo de nuevo.\",\n \"paypalButtonMustBeUsed\": \"Utilice el botón de PayPal para continuar con su pago.\",\n \"paypalAccountTokenizationFailedError\": \"Se ha producido un error al agregar la cuenta de PayPal. Inténtelo de nuevo.\",\n \"paypalFlowFailedError\": \"Se ha producido un error al conectar con PayPal. Inténtelo de nuevo.\",\n \"paypalTokenizationRequestActiveError\": \"La autorización de pago de PayPal ya está en curso.\",\n \"venmoCanceledError\": \"Se ha producido un error. Asegúrese de que tiene la versión más reciente de la aplicación de Venmo instalada en su dispositivo y que su navegador admita el sitio web Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"No se pudo eliminar la forma de pago, inténtelo de nuevo.\",\n \"venmoAppFailedError\": \"No se pudo encontrar la aplicación de Venmo en su dispositivo.\",\n \"unsupportedCardTypeError\": \"Este tipo de tarjeta no es compatible. Inténtelo con otra tarjeta.\",\n \"applePayTokenizationError\": \"Se ha producido un error de red al procesar el pago de Apple Pay. Inténtelo de nuevo.\",\n \"applePayActiveCardError\": \"Agregue una tarjeta compatible a su cartera de Apple Pay.\",\n \"cardholderNameLabel\": \"Nombre del titular de la tarjeta\",\n \"cardNumberLabel\": \"Número de tarjeta\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 dígitos)\",\n \"cvvFourDigitLabelSubheading\": \"(4 dígitos)\",\n \"cardholderNamePlaceholder\": \"Nombre del titular de la tarjeta\",\n \"expirationDateLabel\": \"Fecha de vencimiento\",\n \"expirationDateLabelSubheading\": \"(MM/AA)\",\n \"expirationDatePlaceholder\": \"MM/AA\",\n \"postalCodeLabel\": \"Código postal\",\n \"saveCardLabel\": \"Guardar tarjeta\",\n \"payWithCard\": \"Pagar con tarjeta\",\n \"endingIn\": \"Con terminación en {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Tarjeta\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 221: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Maksutapa: {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Valitse toinen maksutapa\",\n \"chooseAWayToPay\": \"Valitse maksutapa\",\n \"otherWaysToPay\": \"Muut maksutavat\",\n \"edit\": \"Muokkaa\",\n \"doneEditing\": \"Valmis\",\n \"editPaymentMethods\": \"Muokkaa maksutapoja\",\n \"CreditCardDeleteConfirmationMessage\": \"Haluatko poistaa {{secondaryIdentifier}}-kortin, jonka numero päättyy {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Haluatko poistaa PayPal-tilin {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Haluatko varmasti poistaa Venmo-tilin, jonka käyttäjätunnus on {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Haluatko varmasti poistaa tämän maksutavan?\",\n \"deleteCancelButton\": \"Peruuta\",\n \"deleteConfirmationButton\": \"Poista\",\n \"fieldEmptyForCvv\": \"Täytä CVV.\",\n \"fieldEmptyForExpirationDate\": \"Täytä voimassaolon päättymispäivämäärä.\",\n \"fieldEmptyForCardholderName\": \"Täytä kortinhaltijan nimi.\",\n \"fieldTooLongForCardholderName\": \"Kortin haltijan nimen on oltava alle 256 merkkiä.\",\n \"fieldEmptyForNumber\": \"Täytä numero.\",\n \"fieldEmptyForPostalCode\": \"Täytä postinumero.\",\n \"fieldInvalidForCardholderName\": \"Kortinhaltijan nimi ei ole kelvollinen.\",\n \"fieldInvalidForCvv\": \"Tämä turvakoodi ei ole kelvollinen.\",\n \"fieldInvalidForExpirationDate\": \"Tämä päättymispäivämäärä ei ole kelvollinen.\",\n \"fieldInvalidForNumber\": \"Tämä kortin numero ei ole kelvollinen.\",\n \"fieldInvalidForPostalCode\": \"Tämä postinumero ei ole kelvollinen.\",\n \"genericError\": \"Jokin meni pieleen meidän päässämme.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Tämä luottokortti on jo tallennettu maksutavaksi.\",\n \"hostedFieldsFailedTokenizationError\": \"Tarkista tiedot ja yritä uudelleen.\",\n \"hostedFieldsFieldsInvalidError\": \"Tarkista tiedot ja yritä uudelleen.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Verkkovirhe. Yritä uudelleen.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Luottokortin varmennus epäonnistui. Tarkista tiedot ja yritä uudelleen.\",\n \"paypalButtonMustBeUsed\": \"Jatka maksua PayPal-painikkeen avulla.\",\n \"paypalAccountTokenizationFailedError\": \"Jotain meni pieleen PayPal-tiliä lisätessä. Yritä uudelleen.\",\n \"paypalFlowFailedError\": \"Jotain meni pieleen muodostettaessa yhteyttä PayPaliin. Yritä uudelleen.\",\n \"paypalTokenizationRequestActiveError\": \"PayPal-maksun valtuutus on jo meneillään.\",\n \"venmoCanceledError\": \"Jokin meni pieleen. Varmista, että laitteeseesi on asennettu Venmo-sovelluksen viimeisin versio, ja että selain tukee vaihtamista Venmoon.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Maksutavan poistaminen ei onnistu, yritä uudelleen.\",\n \"venmoAppFailedError\": \"Venmo-sovellusta ei löytynyt laitteesta.\",\n \"unsupportedCardTypeError\": \"Tätä korttityyppiä ei tueta. Kokeile toista korttia.\",\n \"applePayTokenizationError\": \"Tapahtui verkkovirhe Apple Pay -maksun käsittelyssä. Yritä uudelleen.\",\n \"applePayActiveCardError\": \"Lisää tuettu kortti Apple Pay -lompakkoon.\",\n \"cardholderNameLabel\": \"Kortinhaltijan nimi\",\n \"cardNumberLabel\": \"Kortin numero\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(kolme numeroa)\",\n \"cvvFourDigitLabelSubheading\": \"(neljä numeroa)\",\n \"cardholderNamePlaceholder\": \"Kortinhaltijan nimi\",\n \"expirationDateLabel\": \"Päättymispäivämäärä\",\n \"expirationDateLabelSubheading\": \"(KK/VV)\",\n \"expirationDatePlaceholder\": \"KK/VV\",\n \"postalCodeLabel\": \"Postinumero\",\n \"saveCardLabel\": \"Tallenna kortti\",\n \"payWithCard\": \"Maksa kortilla\",\n \"endingIn\": \"Päättyy {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Kortti\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 222: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Payer avec {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Choisir un autre mode de paiement\",\n \"chooseAWayToPay\": \"Choisir le mode de paiement\",\n \"otherWaysToPay\": \"Autres modes de paiement\",\n \"edit\": \"Modifier\",\n \"doneEditing\": \"Terminé\",\n \"editPaymentMethods\": \"Modifier les modes de paiement\",\n \"CreditCardDeleteConfirmationMessage\": \"Supprimer la carte {{secondaryIdentifier}} se terminant par {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Supprimer le compte PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Souhaitez-vous vraiment supprimer le compte Venmo avec le nom d’utilisateur {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Voulez-vous vraiment supprimer ce mode de paiement?\",\n \"deleteCancelButton\": \"Annuler\",\n \"deleteConfirmationButton\": \"Supprimer\",\n \"fieldEmptyForCvv\": \"Veuillez saisir un cryptogramme visuel.\",\n \"fieldEmptyForExpirationDate\": \"Veuillez saisir une date d'expiration.\",\n \"fieldEmptyForCardholderName\": \"Veuillez saisir un nom de titulaire de la carte.\",\n \"fieldTooLongForCardholderName\": \"Le nom du titulaire de la carte doit contenir moins de 256 caractères.\",\n \"fieldEmptyForNumber\": \"Veuillez saisir un numéro.\",\n \"fieldEmptyForPostalCode\": \"Veuillez saisir un code postal.\",\n \"fieldInvalidForCardholderName\": \"Le nom de ce titulaire de la carte n'est pas valide.\",\n \"fieldInvalidForCvv\": \"Ce cryptogramme visuel n'est pas valide.\",\n \"fieldInvalidForExpirationDate\": \"Cette date d'expiration n'est pas valide.\",\n \"fieldInvalidForNumber\": \"Ce numéro de carte n'est pas valide.\",\n \"fieldInvalidForPostalCode\": \"Ce code postal n'est pas valide.\",\n \"genericError\": \"Une erreur s'est produite de notre côté.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Cette carte de crédit existe déjà comme mode de paiement enregistré.\",\n \"hostedFieldsFailedTokenizationError\": \"Vérifiez vos informations, puis réessayez.\",\n \"hostedFieldsFieldsInvalidError\": \"Vérifiez vos informations, puis réessayez.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Erreur réseau. Veuillez réessayer.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"La vérification de la carte de crédit a échoué. Vérifiez vos informations, puis réessayez.\",\n \"paypalButtonMustBeUsed\": \"Utilisez le bouton PayPal pour poursuivre votre paiement.\",\n \"paypalAccountTokenizationFailedError\": \"Une erreur s'est produite lors de l'enregistrement du compte PayPal. Veuillez réessayer.\",\n \"paypalFlowFailedError\": \"Une erreur s'est produite au cours de la connexion à PayPal. Veuillez réessayer.\",\n \"paypalTokenizationRequestActiveError\": \"L'autorisation de paiement PayPal est déjà en cours.\",\n \"venmoCanceledError\": \"Une erreur s'est produite. Assurez-vous que la version la plus récente de l'application Venmo est installée sur votre appareil et que votre navigateur prend Venmo en charge.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Impossible de supprimer le mode de paiement, essayez de nouveau.\",\n \"venmoAppFailedError\": \"L'application Venmo est introuvable sur votre appareil.\",\n \"unsupportedCardTypeError\": \"Ce type de carte n'est pas pris en charge. Veuillez essayer une autre carte.\",\n \"applePayTokenizationError\": \"Une erreur de réseau s'est produite lors du traitement du paiement avec Apple Pay. Veuillez réessayer.\",\n \"applePayActiveCardError\": \"Ajoutez une carte prise en charge à Apple Pay.\",\n \"cardholderNameLabel\": \"Nom du titulaire de la carte\",\n \"cardNumberLabel\": \"Numéro de carte\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 chiffres)\",\n \"cvvFourDigitLabelSubheading\": \"(4 chiffres)\",\n \"cardholderNamePlaceholder\": \"Nom du titulaire de la carte\",\n \"expirationDateLabel\": \"Date d'expiration\",\n \"expirationDateLabelSubheading\": \"(MM/AA)\",\n \"expirationDatePlaceholder\": \"MM/AA\",\n \"postalCodeLabel\": \"Code postal\",\n \"saveCardLabel\": \"Enregistrer la carte\",\n \"payWithCard\": \"Payer par carte\",\n \"endingIn\": \"Se terminant par {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Carte\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 223: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Payer avec {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Choisissez une autre façon de payer.\",\n \"chooseAWayToPay\": \"Choisissez comment payer.\",\n \"otherWaysToPay\": \"Autres façons de payer\",\n \"edit\": \"Modifier\",\n \"doneEditing\": \"Terminé\",\n \"editPaymentMethods\": \"Modifier les sources d'approvisionnement\",\n \"CreditCardDeleteConfirmationMessage\": \"Supprimer la carte {{secondaryIdentifier}} se terminant par {{identifier}} ?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Supprimer le compte PayPal {{identifier}} ?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Êtes-vous sûr de vouloir supprimer le compte Venmo avec le nom d'utilisateur {{identifier}} ?\",\n \"genericDeleteConfirmationMessage\": \"Êtes-vous sûr de vouloir supprimer cette source d'approvisionnement ?\",\n \"deleteCancelButton\": \"Annuler\",\n \"deleteConfirmationButton\": \"Supprimer\",\n \"fieldEmptyForCvv\": \"Entrez un cryptogramme visuel.\",\n \"fieldEmptyForExpirationDate\": \"Entrez une date d'expiration.\",\n \"fieldEmptyForCardholderName\": \"Entrez un nom du titulaire de la carte.\",\n \"fieldTooLongForCardholderName\": \"Le nom du titulaire de la carte doit contenir moins de 256 caractères.\",\n \"fieldEmptyForNumber\": \"Entrez un numéro.\",\n \"fieldEmptyForPostalCode\": \"Entrez un code postal.\",\n \"fieldInvalidForCardholderName\": \"Le nom de ce titulaire de la carte est incorrect.\",\n \"fieldInvalidForCvv\": \"Ce cryptogramme visuel n'est pas valide.\",\n \"fieldInvalidForExpirationDate\": \"Cette date d'expiration n'est pas valide.\",\n \"fieldInvalidForNumber\": \"Ce numéro de carte n'est pas valide.\",\n \"fieldInvalidForPostalCode\": \"Ce code postal n'est pas valide.\",\n \"genericError\": \"Une erreur est survenue.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Cette carte bancaire existe déjà comme mode de paiement enregistré.\",\n \"hostedFieldsFailedTokenizationError\": \"Vérifiez vos informations et réessayez.\",\n \"hostedFieldsFieldsInvalidError\": \"Vérifiez vos informations et réessayez.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Erreur réseau. Réessayez.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Échec de vérification de la carte bancaire. Vérifiez vos informations et réessayez.\",\n \"paypalButtonMustBeUsed\": \"Utilisez le bouton PayPal pour poursuivre votre paiement.\",\n \"paypalAccountTokenizationFailedError\": \"Une erreur est survenue lors de l'ajout du compte PayPal. Réessayez.\",\n \"paypalFlowFailedError\": \"Une erreur est survenue lors de la connexion à PayPal. Réessayez.\",\n \"paypalTokenizationRequestActiveError\": \"L'autorisation de paiement PayPal est déjà en cours.\",\n \"venmoCanceledError\": \"Une erreur est survenue. Vérifiez que vous disposez de la dernière version de l'application Venmo sur votre appareil et que votre navigateur prend en charge la redirection vers Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Impossible de supprimer la source d'approvisionnement. Réessayez.\",\n \"venmoAppFailedError\": \"L'application Venmo est introuvable sur votre appareil.\",\n \"unsupportedCardTypeError\": \"Ce type de carte n'est pas pris en charge. Essayez une autre carte.\",\n \"applePayTokenizationError\": \"Une erreur réseau s'est produite lors du traitement du paiement Apple Pay. Réessayez.\",\n \"applePayActiveCardError\": \"Enregistrez une carte prise en charge sur Apple Pay.\",\n \"cardholderNameLabel\": \"Nom du titulaire de la carte\",\n \"cardNumberLabel\": \"Nº de carte\",\n \"cvvLabel\": \"Cryptogramme visuel\",\n \"cvvThreeDigitLabelSubheading\": \"(3 chiffres)\",\n \"cvvFourDigitLabelSubheading\": \"(4 chiffres)\",\n \"cardholderNamePlaceholder\": \"Nom du titulaire de la carte\",\n \"expirationDateLabel\": \"Date d'expiration\",\n \"expirationDateLabelSubheading\": \"(MM/AA)\",\n \"expirationDatePlaceholder\": \"MM/AA\",\n \"postalCodeLabel\": \"Code postal\",\n \"saveCardLabel\": \"Enregistrer une carte\",\n \"payWithCard\": \"Payer par carte\",\n \"endingIn\": \"Se terminant par {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Carte\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 224: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Payer avec {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Choisir un autre mode de paiement\",\n \"chooseAWayToPay\": \"Choisir un mode de paiement\",\n \"otherWaysToPay\": \"Autres modes de paiement\",\n \"edit\": \"Modifier\",\n \"doneEditing\": \"Terminé\",\n \"editPaymentMethods\": \"Modifier les modes de paiement\",\n \"CreditCardDeleteConfirmationMessage\": \"Supprimer la carte {{secondaryIdentifier}} se terminant par {{identifier}} ?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Supprimer le compte PayPal {{identifier}} ?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Souhaitez-vous vraiment supprimer le compte Venmo associé au nom d'utilisateur {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Souhaitez-vous vraiment supprimer ce mode de paiement ?\",\n \"deleteCancelButton\": \"Annuler\",\n \"deleteConfirmationButton\": \"Supprimer\",\n \"fieldEmptyForCvv\": \"Saisissez un cryptogramme visuel.\",\n \"fieldEmptyForExpirationDate\": \"Indiquez une date d'expiration.\",\n \"fieldEmptyForCardholderName\": \"Saisissez le nom du titulaire de la carte.\",\n \"fieldTooLongForCardholderName\": \"Le nom du titulaire de la carte doit comporter moins de 256 caractères.\",\n \"fieldEmptyForNumber\": \"Indiquez un numéro.\",\n \"fieldEmptyForPostalCode\": \"Indiquez un code postal.\",\n \"fieldInvalidForCardholderName\": \"Le nom de ce titulaire de la carte est incorrect.\",\n \"fieldInvalidForCvv\": \"Ce cryptogramme visuel n'est pas valide.\",\n \"fieldInvalidForExpirationDate\": \"Cette date d'expiration n'est pas valide.\",\n \"fieldInvalidForNumber\": \"Ce numéro de carte n'est pas valide.\",\n \"fieldInvalidForPostalCode\": \"Ce code postal n'est pas valide.\",\n \"genericError\": \"Une erreur est survenue.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Cette carte bancaire existe déjà en tant que mode de paiement enregistré.\",\n \"hostedFieldsFailedTokenizationError\": \"Vérifiez les informations et réessayez.\",\n \"hostedFieldsFieldsInvalidError\": \"Vérifiez les informations et réessayez.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Erreur réseau. Réessayez.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Échec de la vérification de carte bancaire. Vérifiez les informations et réessayez.\",\n \"paypalButtonMustBeUsed\": \"Utilisez le bouton PayPal pour poursuivre le paiement.\",\n \"paypalAccountTokenizationFailedError\": \"Un problème est survenu lors de l'ajout du compte PayPal. Réessayez.\",\n \"paypalFlowFailedError\": \"Une erreur est survenue lors de la connexion à PayPal. Réessayez.\",\n \"paypalTokenizationRequestActiveError\": \"L'autorisation de paiement PayPal est déjà en cours.\",\n \"venmoCanceledError\": \"Une erreur est survenue. Vérifiez que la dernière version de l'application Venmo est installée sur votre appareil et que votre navigateur prend en charge la redirection vers Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Impossible de supprimer le mode de paiement, réessayez.\",\n \"venmoAppFailedError\": \"Nous n'avons pas trouvé l'application Venmo sur votre appareil.\",\n \"unsupportedCardTypeError\": \"Ce type de carte n'est pas pris en charge. Essayez une autre carte.\",\n \"applePayTokenizationError\": \"Une erreur réseau s'est produite lors du traitement du paiement Apple Pay. Réessayez.\",\n \"applePayActiveCardError\": \"Ajoutez une carte prise en charge à votre portefeuille Apple Pay.\",\n \"cardholderNameLabel\": \"Nom du titulaire de la carte\",\n \"cardNumberLabel\": \"Numéro de carte\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 chiffres)\",\n \"cvvFourDigitLabelSubheading\": \"(4 chiffres)\",\n \"cardholderNamePlaceholder\": \"Nom du titulaire de la carte\",\n \"expirationDateLabel\": \"Date d'expiration\",\n \"expirationDateLabelSubheading\": \"(MM/AA)\",\n \"expirationDatePlaceholder\": \"MM/AA\",\n \"postalCodeLabel\": \"Code postal\",\n \"saveCardLabel\": \"Enregistrer la carte\",\n \"payWithCard\": \"Payer avec la carte\",\n \"endingIn\": \"Se terminant par {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Carte\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 225: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"שליחת תשלום באמצעות {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"עליך לבחור שיטת תשלום אחרת\",\n \"chooseAWayToPay\": \"עליך לבחור שיטת תשלום\",\n \"otherWaysToPay\": \"שיטות תשלום אחרות\",\n \"edit\": \"עריכה\",\n \"doneEditing\": \"סיום\",\n \"editPaymentMethods\": \"עריכת שיטות תשלום\",\n \"CreditCardDeleteConfirmationMessage\": \"ברצונך למחוק את כרטיס ה-{{secondaryIdentifier}} שמסתיים בספרות {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"ברצונך למחוק את חשבון ה-PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"האם אתה בטוח שברצונך למחוק את חשבון Venmo הרשום תחת שם המשתמש {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"האם אתה בטוח שברצונך למחוק שיטת תשלום זו?\",\n \"deleteCancelButton\": \"ביטול\",\n \"deleteConfirmationButton\": \"מחיקה\",\n \"fieldEmptyForCvv\": \"עליך למלא את מספר האבטחה של כרטיס האשראי.\",\n \"fieldEmptyForExpirationDate\": \"עליך למלא את תאריך פקיעת התוקף.\",\n \"fieldEmptyForCardholderName\": \"עליך למלא את שם בעל הכרטיס.\",\n \"fieldTooLongForCardholderName\": \"שם בעל הכרטיס יכול להכיל 256 תווים לכל היותר.\",\n \"fieldEmptyForNumber\": \"עליך למלא את המספר.\",\n \"fieldEmptyForPostalCode\": \"עליך למלא את המיקוד.\",\n \"fieldInvalidForCardholderName\": \"שם בעל הכרטיס אינו חוקי.\",\n \"fieldInvalidForCvv\": \"קוד אבטחה זה אינו חוקי.\",\n \"fieldInvalidForExpirationDate\": \"תאריך פקיעת התוקף הזה אינו חוקי.\",\n \"fieldInvalidForNumber\": \"מספר כרטיס האשראי הזה אינו חוקי.\",\n \"fieldInvalidForPostalCode\": \"מיקוד זה אינו חוקי.\",\n \"genericError\": \"נראה שמשהו השתבש בצד שלנו.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"כרטיס אשראי זה כבר שמור כשיטת תשלום.\",\n \"hostedFieldsFailedTokenizationError\": \"עליך לבדוק את הפרטים שלך ולנסות שוב.\",\n \"hostedFieldsFieldsInvalidError\": \"עליך לבדוק את הפרטים שלך ולנסות שוב.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"שגיאת רשת. יש לנסות שוב.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"אימות כרטיס האשראי נכשל. עליך לבדוק את הפרטים שלך ולנסות שוב.\",\n \"paypalButtonMustBeUsed\": \"להשתמש בלחצן PayPal כדי להמשיך בביצוע התשלום שלך.\",\n \"paypalAccountTokenizationFailedError\": \"משהו השתבש בו בעת הוספת חשבון PayPal. יש לנסות שוב.\",\n \"paypalFlowFailedError\": \"משהו השתבש בהתחברות ל-PayPal. יש לנסות שוב.\",\n \"paypalTokenizationRequestActiveError\": \"אישור התשלום של PayPal כבר מתבצע.\",\n \"venmoCanceledError\": \"נראה שמשהו השתבש. עליך לוודא שהגרסה העדכנית ביותר של אפליקציית Venmo מותקנת במכשיר שלך, ושהדפדפן שלך תומך במעבר ל-Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"לא הצלחנו למחוק את שיטת התשלום, עליך לנסות שוב.\",\n \"venmoAppFailedError\": \"לא מצאנו למצוא את אפליקציית Venmo במכשיר שלך.\",\n \"unsupportedCardTypeError\": \"סוג כרטיס זה אינו נתמך. עליך לנסות כרטיס אחר.\",\n \"applePayTokenizationError\": \"אירעה שגיאת רשת בעת עיבוד תשלום התשלומים של Apple Pay. יש לנסות שוב.\",\n \"applePayActiveCardError\": \"הוספת כרטיס נתמך לארנק Apple Pay שלך.\",\n \"cardholderNameLabel\": \"שם בעל הכרטיס\",\n \"cardNumberLabel\": \"מספר הכרטיס\",\n \"cvvLabel\": \"קוד האבטחה (CVV)\",\n \"cvvThreeDigitLabelSubheading\": \"(3 ספרות)\",\n \"cvvFourDigitLabelSubheading\": \"(ארבע ספרות)\",\n \"cardholderNamePlaceholder\": \"שם בעל הכרטיס\",\n \"expirationDateLabel\": \"תאריך פקיעת תוקף\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"MM/YY\",\n \"postalCodeLabel\": \"מיקוד\",\n \"saveCardLabel\": \"שמירת הכרטיס\",\n \"payWithCard\": \"תשלום באמצעות כרטיס אשראי\",\n \"endingIn\": \"המסתיים בספרות {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"כרטיס\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 226: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Fizetve ezzel {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Válasszon másik fizetési módot\",\n \"chooseAWayToPay\": \"Válasszon fizetési módot\",\n \"otherWaysToPay\": \"Egyéb fizetési módok\",\n \"edit\": \"Szerkesztés\",\n \"doneEditing\": \"Kész\",\n \"editPaymentMethods\": \"Fizetési módok szerkesztése\",\n \"CreditCardDeleteConfirmationMessage\": \"Törli a(z) {{identifier}}-re végződő {{secondaryIdentifier}} kártyát?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Törli a(z) {{identifier}} PayPal-számlát?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Biztosan törli a(z) {{identifier}} felhasználónévhez tartozó Venmo-számlát?\",\n \"genericDeleteConfirmationMessage\": \"Biztosan törli ezt a fizetési módot?\",\n \"deleteCancelButton\": \"Mégse\",\n \"deleteConfirmationButton\": \"Törés\",\n \"fieldEmptyForCvv\": \"Adja meg a CVV-t.\",\n \"fieldEmptyForExpirationDate\": \"Töltse ki a lejárati dátumot.\",\n \"fieldEmptyForCardholderName\": \"Töltse ki a kártyatulajdonos nevét.\",\n \"fieldTooLongForCardholderName\": \"A kártyatulajdonos neve nem lehet hosszabb mint 256 karakter.\",\n \"fieldEmptyForNumber\": \"Töltse ki a számot.\",\n \"fieldEmptyForPostalCode\": \"Töltse ki az irányítószámot.\",\n \"fieldInvalidForCardholderName\": \"Ez a kártyabirtokos neve nem érvényes.\",\n \"fieldInvalidForCvv\": \"Ez a biztonsági kód nem érvényes.\",\n \"fieldInvalidForExpirationDate\": \"Ez a lejárati dátum nem érvényes.\",\n \"fieldInvalidForNumber\": \"Ez a kártyaszám nem érvényes.\",\n \"fieldInvalidForPostalCode\": \"Ez az irányítószám nem érvényes.\",\n \"genericError\": \"Hiba történt a mi oldalunkon.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Ez a hitelkártya már szerepel mentett fizetési módként.\",\n \"hostedFieldsFailedTokenizationError\": \"Ellenőrizze adatait, majd próbálja újra.\",\n \"hostedFieldsFieldsInvalidError\": \"Ellenőrizze adatait, majd próbálja újra.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Hálózati hiba. Próbálja újra.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"A hitelkártya hitelesítése sikertelen. Ellenőrizze adatait, majd próbálja újra.\",\n \"paypalButtonMustBeUsed\": \"A fizetés folytatásához használja a PayPal-gombot.\",\n \"paypalAccountTokenizationFailedError\": \"Hiba történt a PayPal-számla hozzáadása közben. Próbálja újra.\",\n \"paypalFlowFailedError\": \"Hiba történt a PayPalhoz való kapcsolódás közben. Próbálja újra.\",\n \"paypalTokenizationRequestActiveError\": \"A PayPal-fizetés engedélyezése már folyamatban van.\",\n \"venmoCanceledError\": \"Hiba történt. Ellenőrizze, hogy eszközére a Venmo-alkalmazás legfrissebb verziója van-e telepítve, és hogy a böngészője támogatja-e a Venmo-ra történő átváltást.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Nem sikerült törölni a fizetési módot, próbálja újra.\",\n \"venmoAppFailedError\": \"A Venmo-alkalmazást nem találja a rendszer az eszközön.\",\n \"unsupportedCardTypeError\": \"Ez a kártyatípus nem támogatott. Próbáljon meg másik kártyát.\",\n \"applePayTokenizationError\": \"Hálózati hiba történt az Apple Pay-kifizetés közben. Próbálja újra.\",\n \"applePayActiveCardError\": \"Adjon egy támogatott kártyáját az Apple Pay pénztárcához.\",\n \"cardholderNameLabel\": \"Kártyatulajdonos neve\",\n \"cardNumberLabel\": \"Kártyaszám\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 számjegy)\",\n \"cvvFourDigitLabelSubheading\": \"(4 számjegy)\",\n \"cardholderNamePlaceholder\": \"Kártyatulajdonos neve\",\n \"expirationDateLabel\": \"Lejárati dátum\",\n \"expirationDateLabelSubheading\": \"(HH/ÉÉ)\",\n \"expirationDatePlaceholder\": \"HH/ÉÉ\",\n \"postalCodeLabel\": \"Irányítószám\",\n \"saveCardLabel\": \"Kártya mentése\",\n \"payWithCard\": \"Fizetés kártyával\",\n \"endingIn\": \"{{lastFourCardDigits}} végű\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"-kártya\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 227: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Membayar dengan {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Pilih metode pembayaran lain\",\n \"chooseAWayToPay\": \"Pilih metode pembayaran\",\n \"otherWaysToPay\": \"Metode pembayaran lain\",\n \"edit\": \"Edit\",\n \"doneEditing\": \"Selesai\",\n \"editPaymentMethods\": \"Edit metode pembayaran\",\n \"CreditCardDeleteConfirmationMessage\": \"Hapus kartu {{secondaryIdentifier}} yang berakhiran {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Hapus {{identifier}} rekening PayPal?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Yakin akan menghapus rekening Venmo dengan nama pengguna {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Yakin akan menghapus metode pembayaran ini?\",\n \"deleteCancelButton\": \"Batalkan\",\n \"deleteConfirmationButton\": \"Hapus\",\n \"fieldEmptyForCvv\": \"Masukkan CVV.\",\n \"fieldEmptyForExpirationDate\": \"Masukkan tanggal akhir berlaku.\",\n \"fieldEmptyForCardholderName\": \"Masukkan nama pemegang kartu.\",\n \"fieldTooLongForCardholderName\": \"Nama pemegang kartu harus kurang dari 256 karakter.\",\n \"fieldEmptyForNumber\": \"Masukkan nomor.\",\n \"fieldEmptyForPostalCode\": \"Masukkan kode pos.\",\n \"fieldInvalidForCardholderName\": \"Nama pemilik kartu ini tidak valid.\",\n \"fieldInvalidForCvv\": \"Kode keamanan ini tidak valid.\",\n \"fieldInvalidForExpirationDate\": \"Tanggal akhir berlaku ini tidak valid.\",\n \"fieldInvalidForNumber\": \"Nomor kartu ini tidak valid.\",\n \"fieldInvalidForPostalCode\": \"Kode pos ini tidak valid.\",\n \"genericError\": \"Ada yang salah pada sistem kami.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Kartu kredit ini sudah dimasukkan sebagai metode pembayaran tersimpan.\",\n \"hostedFieldsFailedTokenizationError\": \"Periksa informasi Anda dan coba lagi.\",\n \"hostedFieldsFieldsInvalidError\": \"Periksa informasi Anda dan coba lagi.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Masalah jaringan. Coba lagi.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Verifikasi kartu kredit gagal. Periksa informasi Anda dan coba lagi.\",\n \"paypalButtonMustBeUsed\": \"Gunakan tombol PayPal untuk melanjutkan pembayaran Anda.\",\n \"paypalAccountTokenizationFailedError\": \"Terjadi kesalahan saat menambahkan rekening PayPal. Coba lagi.\",\n \"paypalFlowFailedError\": \"Terjadi kesalahan saat menyambung ke PayPal. Coba lagi.\",\n \"paypalTokenizationRequestActiveError\": \"Otorisasi pembayaran PayPal sedang diproses.\",\n \"venmoCanceledError\": \"Terdapat kesalahan. Pastikan Anda telah menginstal aplikasi Venmo versi terbaru pada perangkat dan peramban Anda mendukung untuk beralih ke Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Tidak dapat menghapus metode pembayaran, coba lagi.\",\n \"venmoAppFailedError\": \"Aplikasi Venmo tidak dapat ditemukan pada perangkat Anda.\",\n \"unsupportedCardTypeError\": \"Jenis kartu ini tidak didukung. Coba kartu lainnya.\",\n \"applePayTokenizationError\": \"Terjadi kesalahan jaringan sewaktu memproses pembayaran melalui Apple Pay. Coba lagi.\",\n \"applePayActiveCardError\": \"Tambahkan kartu yang didukung ke wallet Apple Pay.\",\n \"cardholderNameLabel\": \"Nama Pemegang Kartu\",\n \"cardNumberLabel\": \"Nomor Kartu\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 angka)\",\n \"cvvFourDigitLabelSubheading\": \"(4 angka)\",\n \"cardholderNamePlaceholder\": \"Nama Pemegang Kartu\",\n \"expirationDateLabel\": \"Tanggal Kedaluwarsa\",\n \"expirationDateLabelSubheading\": \"(BB/TT)\",\n \"expirationDatePlaceholder\": \"BB/TT\",\n \"postalCodeLabel\": \"Kode Pos\",\n \"saveCardLabel\": \"Simpan kartu\",\n \"payWithCard\": \"Bayar dengan kartu\",\n \"endingIn\": \"Berakhiran {{lastTwoCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Kartu\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 228: [function (require, module, exports) {\n /* eslint-disable camelcase */\n 'use strict';\n\n var assign = require('../lib/assign').assign;\n\n var fiveCharacterLocales = {\n ar_EG: require('./ar_EG'),\n cs_CZ: require('./cs_CZ'),\n da_DK: require('./da_DK'),\n de_DE: require('./de_DE'),\n el_GR: require('./el_GR'),\n en_AU: require('./en_AU'),\n en_GB: require('./en_GB'),\n en_IN: require('./en_IN'),\n en_US: require('./en_US'),\n es_ES: require('./es_ES'),\n es_XC: require('./es_XC'),\n fi_FI: require('./fi_FI'),\n fr_CA: require('./fr_CA'),\n fr_FR: require('./fr_FR'),\n fr_XC: require('./fr_XC'),\n he_IL: require('./he_IL'),\n hu_HU: require('./hu_HU'),\n id_ID: require('./id_ID'),\n it_IT: require('./it_IT'),\n ja_JP: require('./ja_JP'),\n ko_KR: require('./ko_KR'),\n nl_NL: require('./nl_NL'),\n no_NO: require('./no_NO'),\n pl_PL: require('./pl_PL'),\n pt_BR: require('./pt_BR'),\n pt_PT: require('./pt_PT'),\n ru_RU: require('./ru_RU'),\n sk_SK: require('./sk_SK'),\n sv_SE: require('./sv_SE'),\n th_TH: require('./th_TH'),\n zh_CN: require('./zh_CN'),\n zh_HK: require('./zh_HK'),\n zh_TW: require('./zh_TW'),\n zh_XC: require('./zh_XC')\n };\n var twoCharacterLocaleAliases = {\n ar: fiveCharacterLocales.ar_EG,\n cs: fiveCharacterLocales.cs_CZ,\n da: fiveCharacterLocales.da_DK,\n de: fiveCharacterLocales.de_DE,\n el: fiveCharacterLocales.el_GR,\n en: fiveCharacterLocales.en_US,\n es: fiveCharacterLocales.es_ES,\n fi: fiveCharacterLocales.fi_FI,\n fr: fiveCharacterLocales.fr_FR,\n id: fiveCharacterLocales.id_ID,\n it: fiveCharacterLocales.it_IT,\n hu: fiveCharacterLocales.hu_HU,\n ja: fiveCharacterLocales.ja_JP,\n ko: fiveCharacterLocales.ko_KR,\n nl: fiveCharacterLocales.nl_NL,\n no: fiveCharacterLocales.no_NO,\n pl: fiveCharacterLocales.pl_PL,\n pt: fiveCharacterLocales.pt_PT,\n ru: fiveCharacterLocales.ru_RU,\n sk: fiveCharacterLocales.sk_SK,\n sv: fiveCharacterLocales.sv_SE,\n th: fiveCharacterLocales.th_TH,\n zh: fiveCharacterLocales.zh_CN\n };\n module.exports = {\n twoCharacterLocaleAliases: twoCharacterLocaleAliases,\n fiveCharacterLocales: fiveCharacterLocales,\n translations: assign({}, twoCharacterLocaleAliases, fiveCharacterLocales)\n };\n /* eslint-enable camelcase */\n }, {\n \"../lib/assign\": 193,\n \"./ar_EG\": 210,\n \"./cs_CZ\": 211,\n \"./da_DK\": 212,\n \"./de_DE\": 213,\n \"./el_GR\": 214,\n \"./en_AU\": 215,\n \"./en_GB\": 216,\n \"./en_IN\": 217,\n \"./en_US\": 218,\n \"./es_ES\": 219,\n \"./es_XC\": 220,\n \"./fi_FI\": 221,\n \"./fr_CA\": 222,\n \"./fr_FR\": 223,\n \"./fr_XC\": 224,\n \"./he_IL\": 225,\n \"./hu_HU\": 226,\n \"./id_ID\": 227,\n \"./it_IT\": 229,\n \"./ja_JP\": 230,\n \"./ko_KR\": 231,\n \"./nl_NL\": 232,\n \"./no_NO\": 233,\n \"./pl_PL\": 234,\n \"./pt_BR\": 235,\n \"./pt_PT\": 236,\n \"./ru_RU\": 237,\n \"./sk_SK\": 238,\n \"./sv_SE\": 239,\n \"./th_TH\": 240,\n \"./zh_CN\": 241,\n \"./zh_HK\": 242,\n \"./zh_TW\": 243,\n \"./zh_XC\": 244\n }],\n 229: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Pagamento con {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Scegli di pagare in un altro modo\",\n \"chooseAWayToPay\": \"Scegli come pagare\",\n \"otherWaysToPay\": \"Altri modi di pagare\",\n \"edit\": \"Modifica\",\n \"doneEditing\": \"Fine\",\n \"editPaymentMethods\": \"Modifica i metodi di pagamento\",\n \"CreditCardDeleteConfirmationMessage\": \"Eliminare la carta {{secondaryIdentifier}} le cui ultime cifre sono {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Eliminare il conto PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Vuoi eliminare il conto Venmo con nome utente {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Vuoi eliminare questo metodo di pagamento?\",\n \"deleteCancelButton\": \"Annulla\",\n \"deleteConfirmationButton\": \"Rimuovi\",\n \"fieldEmptyForCvv\": \"Immetti il codice di sicurezza (CVV).\",\n \"fieldEmptyForExpirationDate\": \"Immetti la data di scadenza.\",\n \"fieldEmptyForCardholderName\": \"Immetti il nome del titolare della carta.\",\n \"fieldTooLongForCardholderName\": \"Il nome del titolare della carta deve avere meno di 256 caratteri.\",\n \"fieldEmptyForNumber\": \"Immetti il numero di carta.\",\n \"fieldEmptyForPostalCode\": \"Immetti il CAP.\",\n \"fieldInvalidForCardholderName\": \"Il nome del titolare non è valido.\",\n \"fieldInvalidForCvv\": \"Il codice di sicurezza non è valido.\",\n \"fieldInvalidForExpirationDate\": \"La data di scadenza non è valida.\",\n \"fieldInvalidForNumber\": \"Il numero di carta non è valido.\",\n \"fieldInvalidForPostalCode\": \"Il CAP non è valido.\",\n \"genericError\": \"Si è verificato un errore nei nostri sistemi.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Questa carta di credito è già registrata come metodo di pagamento salvato.\",\n \"hostedFieldsFailedTokenizationError\": \"Controlla e riprova.\",\n \"hostedFieldsFieldsInvalidError\": \"Controlla e riprova.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Errore di rete. Riprova.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"La verifica della carta di credito non è andata a buon fine. Controlla i dati e riprova.\",\n \"paypalButtonMustBeUsed\": \"Usa il pulsante PayPal per procedere al pagamento.\",\n \"paypalAccountTokenizationFailedError\": \"Si è verificato un errore nel collegamento del conto PayPal. Riprova.\",\n \"paypalFlowFailedError\": \"Si è verificato un errore di connessione a PayPal. Riprova.\",\n \"paypalTokenizationRequestActiveError\": \"L'autorizzazione di pagamento PayPal è già in corso.\",\n \"venmoCanceledError\": \"Si è verificato un errore. Assicurati di avere la versione più recente dell'app Venmo installata sul tuo dispositivo e che il browser supporti l'uso di Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Impossibile eliminare il metodo di pagamento; riprova.\",\n \"venmoAppFailedError\": \"Impossibile trovare l'app Venmo sul dispositivo in uso.\",\n \"unsupportedCardTypeError\": \"Questo tipo di carta non è supportato. Prova con un'altra carta.\",\n \"applePayTokenizationError\": \"Si è verificato un errore di rete durante l'elaborazione del pagamento con Apple Pay. Riprova.\",\n \"applePayActiveCardError\": \"Collega una carta supportata al tuo Apple Pay Wallet.\",\n \"cardholderNameLabel\": \"Titolare della carta\",\n \"cardNumberLabel\": \"Numero di carta\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 cifre)\",\n \"cvvFourDigitLabelSubheading\": \"(4 cifre)\",\n \"cardholderNamePlaceholder\": \"Titolare della carta\",\n \"expirationDateLabel\": \"Data di scadenza\",\n \"expirationDateLabelSubheading\": \"(MM/AA)\",\n \"expirationDatePlaceholder\": \"MM/AA\",\n \"postalCodeLabel\": \"CAP\",\n \"saveCardLabel\": \"Salva carta\",\n \"payWithCard\": \"Paga con una carta\",\n \"endingIn\": \"Le cui ultime cifre sono {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Carta\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 230: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"{{paymentSource}}で支払う\",\n \"chooseAnotherWayToPay\": \"別の支払方法を選択する\",\n \"chooseAWayToPay\": \"支払方法を選択する\",\n \"otherWaysToPay\": \"その他の支払方法\",\n \"edit\": \"編集\",\n \"doneEditing\": \"完了\",\n \"editPaymentMethods\": \"支払方法の編集\",\n \"CreditCardDeleteConfirmationMessage\": \"末尾が{{identifier}}の{{secondaryIdentifier}}カードを削除しますか?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"PayPalアカウント{{identifier}}を削除しますか?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"ユーザー名{{identifier}}のVenmoアカウントを削除してよろしいですか?\",\n \"genericDeleteConfirmationMessage\": \"この支払い方法を削除してよろしいですか?\",\n \"deleteCancelButton\": \"キャンセル\",\n \"deleteConfirmationButton\": \"削除\",\n \"fieldEmptyForCvv\": \"セキュリティコードを入力してください。\",\n \"fieldEmptyForExpirationDate\": \"有効期限を入力してください。\",\n \"fieldEmptyForCardholderName\": \"カード保有者の名前を入力してください。\",\n \"fieldTooLongForCardholderName\": \"カード保有者の名前は256文字未満にしてください。\",\n \"fieldEmptyForNumber\": \"番号を入力してください。\",\n \"fieldEmptyForPostalCode\": \"郵便番号を入力してください。\",\n \"fieldInvalidForCardholderName\": \"このカード保有者の名前は無効です。\",\n \"fieldInvalidForCvv\": \"このセキュリティコードは無効です。\",\n \"fieldInvalidForExpirationDate\": \"この有効期限は無効です。\",\n \"fieldInvalidForNumber\": \"このカード番号は無効です。\",\n \"fieldInvalidForPostalCode\": \"この郵便番号は無効です。\",\n \"genericError\": \"弊社側で問題が発生しました。\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"このクレジットカードは、保存済みの支払方法としてすでに登録されています。\",\n \"hostedFieldsFailedTokenizationError\": \"情報を確認してもう一度お試しください。\",\n \"hostedFieldsFieldsInvalidError\": \"情報を確認してもう一度お試しください。\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"ネットワークエラーです。もう一度お試しください。\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"クレジットカードの認証に失敗しました。情報を確認してもう一度お試しください。\",\n \"paypalButtonMustBeUsed\": \"お客さまの支払いを続行するには、PayPalボタンを使用します。\",\n \"paypalAccountTokenizationFailedError\": \"PayPalアカウントの追加で問題が発生しました。もう一度お試しください。\",\n \"paypalFlowFailedError\": \"PayPalへの接続に問題が発生しました。もう一度お試しください。\",\n \"paypalTokenizationRequestActiveError\": \"PayPal支払いの承認はすでに処理中です。\",\n \"venmoCanceledError\": \"問題が発生しました。お客さまの端末にインストールされているVenmoアプリが最新のバージョンであること、お使いのブラウザがVenmoへの切り替えをサポートしていることを確認してください。\",\n \"vaultManagerPaymentMethodDeletionError\": \"支払方法を削除できません。もう一度お試しください。\",\n \"venmoAppFailedError\": \"お客さまの端末でVenmoアプリが見つかりませんでした。\",\n \"unsupportedCardTypeError\": \"このカードタイプはサポートされていません。別のカードをご使用ください。\",\n \"applePayTokenizationError\": \"Apple Payの支払いを処理する際にネットワークエラーが発生しました。もう一度お試しください。\",\n \"applePayActiveCardError\": \"Apple Payウォレットに対応しているカードを追加してください。\",\n \"cardholderNameLabel\": \"カード保有者の名前\",\n \"cardNumberLabel\": \"カード番号\",\n \"cvvLabel\": \"セキュリティコード\",\n \"cvvThreeDigitLabelSubheading\": \"(3桁)\",\n \"cvvFourDigitLabelSubheading\": \"(4桁)\",\n \"cardholderNamePlaceholder\": \"カード保有者の名前\",\n \"expirationDateLabel\": \"有効期限\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"MM/YY\",\n \"postalCodeLabel\": \"郵便番号\",\n \"saveCardLabel\": \"カードを保存\",\n \"payWithCard\": \"カードで支払う\",\n \"endingIn\": \"末尾が{{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"カード\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"銀聯(UnionPay)\"\n };\n }, {}],\n 231: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"{{paymentSource}}(으)로 결제\",\n \"chooseAnotherWayToPay\": \"다른 결제수단 선택\",\n \"chooseAWayToPay\": \"결제수단 선택\",\n \"otherWaysToPay\": \"다른 방법으로 결제\",\n \"edit\": \"편집\",\n \"doneEditing\": \"완료\",\n \"editPaymentMethods\": \"결제수단 편집\",\n \"CreditCardDeleteConfirmationMessage\": \"끝번호가 {{identifier}}인 {{secondaryIdentifier}} 카드를 삭제하시겠어요?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"PayPal 계정 {{identifier}}을(를) 삭제하시겠어요?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"사용자 이름이 {{identifier}}인 Venmo 계정을 삭제하시겠어요?\",\n \"genericDeleteConfirmationMessage\": \"이 결제수단을 삭제하시겠어요?\",\n \"deleteCancelButton\": \"취소\",\n \"deleteConfirmationButton\": \"삭제\",\n \"fieldEmptyForCvv\": \"CVV를 입력하세요.\",\n \"fieldEmptyForExpirationDate\": \"만료일을 입력하세요.\",\n \"fieldEmptyForCardholderName\": \"카드 소유자 이름을 입력하세요.\",\n \"fieldTooLongForCardholderName\": \"카드 소유자 이름은 256자 미만이어야 합니다.\",\n \"fieldEmptyForNumber\": \"번호를 입력하세요.\",\n \"fieldEmptyForPostalCode\": \"우편번호를 입력하세요.\",\n \"fieldInvalidForCardholderName\": \"이 카드 소유자 이름은 유효하지 않습니다.\",\n \"fieldInvalidForCvv\": \"이 보안 코드가 올바르지 않습니다.\",\n \"fieldInvalidForExpirationDate\": \"이 만료일이 올바르지 않습니다.\",\n \"fieldInvalidForNumber\": \"이 카드 번호가 올바르지 않습니다.\",\n \"fieldInvalidForPostalCode\": \"이 우편번호가 올바르지 않습니다.\",\n \"genericError\": \"저희 쪽에 문제가 발생했습니다.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"저장된 결제수단에 이미 이 신용카드가 존재합니다.\",\n \"hostedFieldsFailedTokenizationError\": \"정보를 확인하고 다시 시도해 주세요.\",\n \"hostedFieldsFieldsInvalidError\": \"정보를 확인하고 다시 시도해 주세요.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"네트워크 오류가 발생했습니다. 다시 시도해 주세요.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"신용카드 인증에 실패했습니다. 정보를 확인하고 다시 시도해 주세요.\",\n \"paypalButtonMustBeUsed\": \"결제를 계속하려면 PayPal 버튼을 사용하세요.\",\n \"paypalAccountTokenizationFailedError\": \"PayPal 계정을 추가하는 동안 문제가 발생했습니다. 다시 시도해 주세요.\",\n \"paypalFlowFailedError\": \"PayPal 계정을 연결하는 동안 문제가 발생했습니다. 다시 시도해 주세요.\",\n \"paypalTokenizationRequestActiveError\": \"PayPal 결제 승인이 이미 진행 중입니다.\",\n \"venmoCanceledError\": \"오류가 발생했습니다. 기기에 최신 버전의 Venmo 앱이 설치되어 있으며 브라우저가 Venmo로 전환 기능을 지원하는지 확인하세요.\",\n \"vaultManagerPaymentMethodDeletionError\": \"결제수단을 삭제할 수 없습니다. 다시 시도해 주세요.\",\n \"venmoAppFailedError\": \"기기에서 Venmo 앱을 찾을 수 없습니다.\",\n \"unsupportedCardTypeError\": \"이 카드 형식은 지원되지 않습니다. 다른 카드로 시도해 주세요.\",\n \"applePayTokenizationError\": \"Apple Pay 결제를 처리하는 동안 네트워크 오류가 발생했습니다. 다시 시도해 주세요.\",\n \"applePayActiveCardError\": \"Apple Pay 전자지갑에 지원되는 카드를 추가하세요.\",\n \"cardholderNameLabel\": \"카드 소유자 이름\",\n \"cardNumberLabel\": \"카드 번호\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3자리)\",\n \"cvvFourDigitLabelSubheading\": \"(4자리)\",\n \"cardholderNamePlaceholder\": \"카드 소유자 이름\",\n \"expirationDateLabel\": \"만료일\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"MM/YY\",\n \"postalCodeLabel\": \"우편번호\",\n \"saveCardLabel\": \"카드 저장\",\n \"payWithCard\": \"카드로 결제\",\n \"endingIn\": \"끝번호: {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"카드\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 232: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Betalen met {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Kies een andere betaalmethode\",\n \"chooseAWayToPay\": \"Kies een betaalwijze\",\n \"otherWaysToPay\": \"Andere manieren om te betalen\",\n \"edit\": \"Bewerk\",\n \"doneEditing\": \"Klaar\",\n \"editPaymentMethods\": \"Betaalmethoden aanpassen\",\n \"CreditCardDeleteConfirmationMessage\": \"{{secondaryIdentifier}}-kaart eindigend op {{identifier}} verwijderen?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"PayPal-rekening {{identifier}} verwijderen?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Weet u zeker dat u Venmo-rekening met gebruikersnaam {{identifier}} wilt verwijderen?\",\n \"genericDeleteConfirmationMessage\": \"Weet u zeker dat u deze betaalmethode wilt verwijderen?\",\n \"deleteCancelButton\": \"Annuleren\",\n \"deleteConfirmationButton\": \"Verwijderen\",\n \"fieldEmptyForCvv\": \"Vul een CSC in.\",\n \"fieldEmptyForExpirationDate\": \"Vul een vervaldatum in.\",\n \"fieldEmptyForCardholderName\": \"Vul een naam voor de kaarthouder in.\",\n \"fieldTooLongForCardholderName\": \"De naam van de kaarthouder moet korter zijn dan 256 tekens.\",\n \"fieldEmptyForNumber\": \"Vul een nummer in.\",\n \"fieldEmptyForPostalCode\": \"Vul een postcode in.\",\n \"fieldInvalidForCardholderName\": \"Naam kaarthouder is ongeldig.\",\n \"fieldInvalidForCvv\": \"Deze CSC is ongeldig.\",\n \"fieldInvalidForExpirationDate\": \"Deze vervaldatum is ongeldig.\",\n \"fieldInvalidForNumber\": \"Dit creditcardnummer is ongeldig.\",\n \"fieldInvalidForPostalCode\": \"Deze postcode is ongeldig.\",\n \"genericError\": \"Er is iets fout gegaan.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Deze creditcard staat al geregistreerd als een opgeslagen betaalmethode.\",\n \"hostedFieldsFailedTokenizationError\": \"Controleer uw gegevens en probeer het opnieuw.\",\n \"hostedFieldsFieldsInvalidError\": \"Controleer uw gegevens en probeer het opnieuw.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Netwerkfout. Probeer het opnieuw.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"De controle van de creditcard is mislukt. Controleer uw gegevens en probeer het opnieuw.\",\n \"paypalButtonMustBeUsed\": \"Gebruik de PayPal-knop om door te gaan met uw betaling.\",\n \"paypalAccountTokenizationFailedError\": \"Er is iets misgegaan bij het toevoegen van de PayPal-rekening. Probeer het opnieuw.\",\n \"paypalFlowFailedError\": \"Er is iets misgegaan bij de verbinding met PayPal. Probeer het opnieuw.\",\n \"paypalTokenizationRequestActiveError\": \"De autorisatie van de PayPal-betaling is al in behandeling.\",\n \"venmoCanceledError\": \"Er ging iets fout. Controleer of de meest recente versie van de Venmo-app op je apparaat is geïnstalleerd en dat je browser overschakelen naar Venmo ondersteunt.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Kan de betaalmethode niet verwijderen, probeer het opnieuw.\",\n \"venmoAppFailedError\": \"De Venmo-app is niet aangetroffen op je apparaat.\",\n \"unsupportedCardTypeError\": \"Dit type creditcard wordt niet ondersteund. Gebruik een andere creditcard.\",\n \"applePayTokenizationError\": \"Er is een netwerkfout opgetreden bij het verwerken van de Apple Pay-betaling. Probeer het opnieuw.\",\n \"applePayActiveCardError\": \"Voeg een ondersteunde creditcard toe aan je Apple Pay-wallet.\",\n \"cardholderNameLabel\": \"Naam kaarthouder\",\n \"cardNumberLabel\": \"Creditcardnummer\",\n \"cvvLabel\": \"CSC\",\n \"cvvThreeDigitLabelSubheading\": \"(3 cijfers)\",\n \"cvvFourDigitLabelSubheading\": \"(4 cijfers)\",\n \"cardholderNamePlaceholder\": \"Naam kaarthouder\",\n \"expirationDateLabel\": \"Vervaldatum\",\n \"expirationDateLabelSubheading\": \"(MM/JJ)\",\n \"expirationDatePlaceholder\": \"MM/JJ\",\n \"postalCodeLabel\": \"Postcode\",\n \"saveCardLabel\": \"Creditcard opslaan\",\n \"payWithCard\": \"Betalen met creditcard\",\n \"endingIn\": \"Eindigend op {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Creditcard\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 233: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Betaling med {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Velg en annen måte å betale på\",\n \"chooseAWayToPay\": \"Velg betalingsmåte\",\n \"otherWaysToPay\": \"Andre måter å betale på\",\n \"edit\": \"Rediger\",\n \"doneEditing\": \"Fullført\",\n \"editPaymentMethods\": \"Endre betalingsmetodene dine\",\n \"CreditCardDeleteConfirmationMessage\": \"Vil du slette {{secondaryIdentifier}}-kortet som slutter på {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Vil du slette PayPal-kontoen {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Er du sikker på at du vil slette Venmo-kontoen med brukernavnet {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Er du sikker på at du vil slette denne betalingsmetoden?\",\n \"deleteCancelButton\": \"Avbryt\",\n \"deleteConfirmationButton\": \"Slett\",\n \"fieldEmptyForCvv\": \"Oppgi en kortsikkerhetskode (CVV).\",\n \"fieldEmptyForExpirationDate\": \"Oppgi en utløpsdato.\",\n \"fieldEmptyForCardholderName\": \"Oppgi et navn for kortinnehaveren.\",\n \"fieldTooLongForCardholderName\": \"Makslengden for kortinnehaverens navn er 256 tegn.\",\n \"fieldEmptyForNumber\": \"Oppgi et nummer.\",\n \"fieldEmptyForPostalCode\": \"Oppgi et postnummer.\",\n \"fieldInvalidForCardholderName\": \"Denne kortinnehaverens navn er ikke gyldig.\",\n \"fieldInvalidForCvv\": \"Denne sikkerhetskoden er ikke gyldig.\",\n \"fieldInvalidForExpirationDate\": \"Denne utløpsdatoen er ikke gyldig.\",\n \"fieldInvalidForNumber\": \"Dette kortnummeret er ikke gyldig.\",\n \"fieldInvalidForPostalCode\": \"Dette postnummeret er ikke gyldig.\",\n \"genericError\": \"Noe gikk galt hos oss.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Dette betalingskortet eksisterer allerede som en lagret betalingsmetode.\",\n \"hostedFieldsFailedTokenizationError\": \"Kontroller informasjonen og prøv på nytt.\",\n \"hostedFieldsFieldsInvalidError\": \"Kontroller informasjonen og prøv på nytt.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Nettverksfeil. Prøv på nytt.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Bekreftelsen av betalingskortet mislyktes. Kontroller informasjonen og prøv på nytt.\",\n \"paypalButtonMustBeUsed\": \"Bruk PayPal-knappen for å fortsette med betalingen.\",\n \"paypalAccountTokenizationFailedError\": \"Noe gikk galt da PayPal-kontoen ble lagt til. Prøv på nytt.\",\n \"paypalFlowFailedError\": \"Det oppsto et problem med tilkoblingen til PayPal. Prøv på nytt.\",\n \"paypalTokenizationRequestActiveError\": \"Godkjenning av PayPal-betalingen pågår allerede\",\n \"venmoCanceledError\": \"Noe gikk galt. Kontroller at du har installert den nyeste versjonen av Venmo-appen på enheten og at nettleseren din støtter bytte til Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Kunne ikke slette betalingsmetoden. Prøv på nytt.\",\n \"venmoAppFailedError\": \"Finner ikke Venmo-appen på enheten.\",\n \"unsupportedCardTypeError\": \"Denne korttypen støttes ikke. Prøv med et annet kort.\",\n \"applePayTokenizationError\": \"Det oppsto en nettverksfeil under behandlingen av Apple Pay-betalingen. Prøv på nytt.\",\n \"applePayActiveCardError\": \"Legg til et kort som støttes i Apple Pay-lommeboken din.\",\n \"cardholderNameLabel\": \"Kortinnehaverens navn\",\n \"cardNumberLabel\": \"Kortnummer\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 siffer)\",\n \"cvvFourDigitLabelSubheading\": \"(4 siffer)\",\n \"cardholderNamePlaceholder\": \"Kortinnehaverens navn\",\n \"expirationDateLabel\": \"Utløpsdato\",\n \"expirationDateLabelSubheading\": \"(MM/ÅÅ)\",\n \"expirationDatePlaceholder\": \"MM/ÅÅ\",\n \"postalCodeLabel\": \"Postnummer\",\n \"saveCardLabel\": \"Lagre kort\",\n \"payWithCard\": \"Betal med kort\",\n \"endingIn\": \"Slutter på {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Kort\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 234: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Źródło finansowania płatności: {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Wybierz inne źródło finansowania płatności\",\n \"chooseAWayToPay\": \"Wybierz źródło finansowania płatności\",\n \"otherWaysToPay\": \"Inne źródła finansowania płatności\",\n \"edit\": \"Edytuj\",\n \"doneEditing\": \"Gotowe\",\n \"editPaymentMethods\": \"Edytuj źródła finansowania płatności\",\n \"CreditCardDeleteConfirmationMessage\": \"Usunąć kartę {{secondaryIdentifier}} o numerze zakończonym cyframi {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Usunąć konto PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Czy na pewno chcesz usunąć konto Venmo z nazwą użytkownika {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Czy na pewno chcesz usunąć to źródło finansowania płatności?\",\n \"deleteCancelButton\": \"Anuluj\",\n \"deleteConfirmationButton\": \"Usuń\",\n \"fieldEmptyForCvv\": \"Podaj kod bezpieczeństwa.\",\n \"fieldEmptyForExpirationDate\": \"Podaj datę ważności.\",\n \"fieldEmptyForCardholderName\": \"Podaj imię i nazwisko posiadacza karty.\",\n \"fieldTooLongForCardholderName\": \"Imię i nazwisko posiadacza karty musi mieć mniej niż 256 znaków.\",\n \"fieldEmptyForNumber\": \"Podaj numer.\",\n \"fieldEmptyForPostalCode\": \"Podaj kod pocztowy.\",\n \"fieldInvalidForCardholderName\": \"To imię i nazwisko posiadacza karty jest nieprawidłowe.\",\n \"fieldInvalidForCvv\": \"Podany kod bezpieczeństwa jest nieprawidłowy.\",\n \"fieldInvalidForExpirationDate\": \"Podana data ważności jest nieprawidłowa.\",\n \"fieldInvalidForNumber\": \"Podany numer karty jest nieprawidłowy.\",\n \"fieldInvalidForPostalCode\": \"Podany kod pocztowy jest nieprawidłowy.\",\n \"genericError\": \"Wystąpił błąd po naszej stronie.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Ta karta kredytowa jest już zapisana jako źródło finansowania płatności.\",\n \"hostedFieldsFailedTokenizationError\": \"Sprawdź swoje informacje i spróbuj ponownie.\",\n \"hostedFieldsFieldsInvalidError\": \"Sprawdź swoje informacje i spróbuj ponownie.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Błąd sieci. Spróbuj ponownie.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Weryfikacja karty kredytowej nie powiodła się. Sprawdź swoje informacje i spróbuj ponownie.\",\n \"paypalButtonMustBeUsed\": \"Użyj przycisku PayPal, aby kontynuować płatność.\",\n \"paypalAccountTokenizationFailedError\": \"Coś poszło nie tak podczas dodawania konta PayPal. Spróbuj ponownie.\",\n \"paypalFlowFailedError\": \"Coś poszło nie tak podczas łączenia z systemem PayPal. Spróbuj ponownie.\",\n \"paypalTokenizationRequestActiveError\": \"Autoryzacja płatności PayPal jest już w trakcie realizacji.\",\n \"venmoCanceledError\": \"Wystąpił problem. Upewnij się, czy na swoim urządzeniu masz zainstalowaną najnowszą wersję aplikacji Venmo i Twoja przeglądarka ją obsługuje.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Nie można usunąć źródła finansowania płatności. Spróbuj ponownie.\",\n \"venmoAppFailedError\": \"Nie można odnaleźć aplikacji Venmo na urządzeniu.\",\n \"unsupportedCardTypeError\": \"Ten typ karty nie jest obsługiwany. Spróbuj użyć innej karty.\",\n \"applePayTokenizationError\": \"Wystąpił błąd sieci podczas przetwarzania płatności Apple Pay. Spróbuj ponownie.\",\n \"applePayActiveCardError\": \"Dodaj obsługiwaną kartę do portfela Apple Pay.\",\n \"cardholderNameLabel\": \"Imię i nazwisko posiadacza karty\",\n \"cardNumberLabel\": \"Numer karty\",\n \"cvvLabel\": \"Kod CVC\",\n \"cvvThreeDigitLabelSubheading\": \"(3 cyfry)\",\n \"cvvFourDigitLabelSubheading\": \"(4 cyfry)\",\n \"cardholderNamePlaceholder\": \"Imię i nazwisko posiadacza karty\",\n \"expirationDateLabel\": \"Data ważności\",\n \"expirationDateLabelSubheading\": \"(MM/RR)\",\n \"expirationDatePlaceholder\": \"MM/RR\",\n \"postalCodeLabel\": \"Kod pocztowy\",\n \"saveCardLabel\": \"Zapisz kartę\",\n \"payWithCard\": \"Zapłać kartą\",\n \"endingIn\": \"O numerze zakończonym cyframi {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Karta\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 235: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Pagando com {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Escolher outro meio de pagamento\",\n \"chooseAWayToPay\": \"Escolher um meio de pagamento\",\n \"otherWaysToPay\": \"Outro meio de pagamento\",\n \"edit\": \"Editar\",\n \"doneEditing\": \"Concluído\",\n \"editPaymentMethods\": \"Editar meios de pagamento\",\n \"CreditCardDeleteConfirmationMessage\": \"Excluir cartão com {{secondaryIdentifier}} com final {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Excluir conta do PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Tem certeza de que deseja excluir a conta do Venmo com o nome de usuário {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Tem certeza de que deseja excluir este meio de pagamento?\",\n \"deleteCancelButton\": \"Cancelar\",\n \"deleteConfirmationButton\": \"Excluir\",\n \"fieldEmptyForCvv\": \"Informe o Código de Segurança.\",\n \"fieldEmptyForExpirationDate\": \"Informe a data de vencimento.\",\n \"fieldEmptyForCardholderName\": \"Informe o nome do titular do cartão.\",\n \"fieldTooLongForCardholderName\": \"O nome do titular do cartão deve ter menos de 256 caracteres.\",\n \"fieldEmptyForNumber\": \"Informe um número.\",\n \"fieldEmptyForPostalCode\": \"Informe um CEP.\",\n \"fieldInvalidForCardholderName\": \"O nome do titular do cartão é inválido.\",\n \"fieldInvalidForCvv\": \"Este código de segurança não é válido.\",\n \"fieldInvalidForExpirationDate\": \"Esta data de vencimento não é válida.\",\n \"fieldInvalidForNumber\": \"O número do cartão não é válido.\",\n \"fieldInvalidForPostalCode\": \"Este CEP não é válido.\",\n \"genericError\": \"Ocorreu um erro.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Este cartão de crédito já está salvo em seus meios de pagamento.\",\n \"hostedFieldsFailedTokenizationError\": \"Verifique as informações e tente novamente.\",\n \"hostedFieldsFieldsInvalidError\": \"Verifique as informações e tente novamente.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Erro de rede. Tente novamente.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Falha ao verificar o cartão de crédito. Verifique as informações e tente novamente.\",\n \"paypalButtonMustBeUsed\": \"Use o botão do PayPal para prosseguir com o seu pagamento.\",\n \"paypalAccountTokenizationFailedError\": \"Ocorreu um erro ao adicionar a conta do PayPal. Tente novamente.\",\n \"paypalFlowFailedError\": \"Ocorreu um erro de conexão com o PayPal. Tente novamente.\",\n \"paypalTokenizationRequestActiveError\": \"A autorização de pagamento do PayPal já está em andamento.\",\n \"venmoCanceledError\": \"Ocorreu um erro. Certifique-se de ter a versão mais recente do aplicativo Venmo instalado no seu dispositivo e que o seu navegador suporte a mudança para o Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Não é possível excluir o meio de pagamento, tente novamente.\",\n \"venmoAppFailedError\": \"Não foi possível encontrar o aplicativo Venmo no seu dispositivo.\",\n \"unsupportedCardTypeError\": \"Este tipo de cartão não é aceito. Experimente outro cartão.\",\n \"applePayTokenizationError\": \"Ocorreu um erro de rede ao processar o pagamento com Apple Pay. Tente novamente.\",\n \"applePayActiveCardError\": \"Adicione cartão suportado à sua carteira do Apple Pay.\",\n \"cardholderNameLabel\": \"Nome do titular do cartão\",\n \"cardNumberLabel\": \"Número do cartão\",\n \"cvvLabel\": \"CSC\",\n \"cvvThreeDigitLabelSubheading\": \"(3 dígitos)\",\n \"cvvFourDigitLabelSubheading\": \"(4 dígitos)\",\n \"cardholderNamePlaceholder\": \"Nome do titular do cartão\",\n \"expirationDateLabel\": \"Data de vencimento\",\n \"expirationDateLabelSubheading\": \"(MM/AA)\",\n \"expirationDatePlaceholder\": \"MM/AA\",\n \"postalCodeLabel\": \"CEP\",\n \"saveCardLabel\": \"Salvar cartão\",\n \"payWithCard\": \"Pague com seu cartão\",\n \"endingIn\": \"Com final {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Cartão\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 236: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Pagar com {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Escolher outra forma de pagamento\",\n \"chooseAWayToPay\": \"Escolha um meio de pagamento\",\n \"otherWaysToPay\": \"Outras formas de pagamento\",\n \"edit\": \"Editar\",\n \"doneEditing\": \"Concluído\",\n \"editPaymentMethods\": \"Editar meios de pagamento\",\n \"CreditCardDeleteConfirmationMessage\": \"Eliminar o cartão {{secondaryIdentifier}} terminado em {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Eliminar {{identifier}} da conta PayPal?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Tem a certeza de que pretende eliminar a conta Venmo com o nome de utilizador {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Tem certeza de que pretende eliminar este meio de pagamento?\",\n \"deleteCancelButton\": \"Cancelar\",\n \"deleteConfirmationButton\": \"Eliminar\",\n \"fieldEmptyForCvv\": \"Introduza o código CVV.\",\n \"fieldEmptyForExpirationDate\": \"Introduza a data de validade.\",\n \"fieldEmptyForCardholderName\": \"Introduza um nome do titular do cartão.\",\n \"fieldTooLongForCardholderName\": \"O nome do titular do cartão tem de ter menos de 256 carateres.\",\n \"fieldEmptyForNumber\": \"Introduza um número.\",\n \"fieldEmptyForPostalCode\": \"Introduza o código postal.\",\n \"fieldInvalidForCardholderName\": \"Este nome do titular do cartão não é válido.\",\n \"fieldInvalidForCvv\": \"Este código de segurança não é válido.\",\n \"fieldInvalidForExpirationDate\": \"Esta data de validade não é correta.\",\n \"fieldInvalidForNumber\": \"Este número de cartão não é válido.\",\n \"fieldInvalidForPostalCode\": \"Este código postal não é válido.\",\n \"genericError\": \"Tudo indica que houve um problema.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Este cartão de crédito já está registado como um meio de pagamento guardado.\",\n \"hostedFieldsFailedTokenizationError\": \"Verifique os dados e tente novamente.\",\n \"hostedFieldsFieldsInvalidError\": \"Verifique os dados e tente novamente.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Erro de rede. Tente novamente.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"A verificação do cartão de crédito falhou. Verifique os dados e tente novamente.\",\n \"paypalButtonMustBeUsed\": \"Use o botão PayPal para continuar com o seu pagamento.\",\n \"paypalAccountTokenizationFailedError\": \"Ocorreu um erro ao associar a conta PayPal. Tente novamente.\",\n \"paypalFlowFailedError\": \"Ocorreu um erro na ligação com PayPal. Tente novamente.\",\n \"paypalTokenizationRequestActiveError\": \"Já há uma autorização de pagamento PayPal em curso.\",\n \"venmoCanceledError\": \"Ocorreu um erro. Certifique-se de que tem a versão mais recente da aplicação Venmo instalada no seu dispositivo e que o navegador suporta a mudança para o Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Não é possível eliminar o meio de pagamento, tente novamente.\",\n \"venmoAppFailedError\": \"Não foi possível encontrar a aplicação Venmo no dispositivo.\",\n \"unsupportedCardTypeError\": \"Este tipo de cartão não é suportado. Tente usar outro cartão.\",\n \"applePayTokenizationError\": \"Ocorreu um erro de rede ao processar o pagamento com Apple Pay. Tente novamente.\",\n \"applePayActiveCardError\": \"Adicione um cartão suportado à sua carteira Apple Pay.\",\n \"cardholderNameLabel\": \"Nome do titular do cartão\",\n \"cardNumberLabel\": \"Número do cartão\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 dígitos)\",\n \"cvvFourDigitLabelSubheading\": \"(4 dígitos)\",\n \"cardholderNamePlaceholder\": \"Nome do titular do cartão\",\n \"expirationDateLabel\": \"Data de validade\",\n \"expirationDateLabelSubheading\": \"(MM/AA)\",\n \"expirationDatePlaceholder\": \"MM/AA\",\n \"postalCodeLabel\": \"Código postal\",\n \"saveCardLabel\": \"Guardar cartão\",\n \"payWithCard\": \"Pagar com cartão\",\n \"endingIn\": \"Terminado em {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Cartão\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 237: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Способы оплаты: {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Выберите другой способ оплаты\",\n \"chooseAWayToPay\": \"Выберите способ оплаты\",\n \"otherWaysToPay\": \"Другие способы оплаты\",\n \"edit\": \"Редактировать\",\n \"doneEditing\": \"Готово\",\n \"editPaymentMethods\": \"Редактировать способы оплаты\",\n \"CreditCardDeleteConfirmationMessage\": \"Удалить карту {{secondaryIdentifier}}, оканчивающуюся на {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Удалить счет PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Вы действительно хотите удалить счет Venmo с именем пользователя {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Вы действительно хотите удалить этот способ оплаты?\",\n \"deleteCancelButton\": \"Отмена\",\n \"deleteConfirmationButton\": \"Удалить\",\n \"fieldEmptyForCvv\": \"Укажите код безопасности.\",\n \"fieldEmptyForExpirationDate\": \"Укажите дату окончания срока действия.\",\n \"fieldEmptyForCardholderName\": \"Введите имя и фамилию владельца карты.\",\n \"fieldTooLongForCardholderName\": \"Имя владельца карты должно содержать не более 256 символов.\",\n \"fieldEmptyForNumber\": \"Введите номер.\",\n \"fieldEmptyForPostalCode\": \"Укажите почтовый индекс.\",\n \"fieldInvalidForCardholderName\": \"Недопустимое имя владельца карты.\",\n \"fieldInvalidForCvv\": \"Этот код безопасности недействителен.\",\n \"fieldInvalidForExpirationDate\": \"Эта дата окончания срока действия недействительна.\",\n \"fieldInvalidForNumber\": \"Этот номер карты недействителен.\",\n \"fieldInvalidForPostalCode\": \"Этот почтовый индекс недействителен.\",\n \"genericError\": \"Возникла проблема с нашей стороны.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Эта кредитная карта уже указана как сохраненный источник средств.\",\n \"hostedFieldsFailedTokenizationError\": \"Проверьте правильность ввода данных и повторите попытку.\",\n \"hostedFieldsFieldsInvalidError\": \"Проверьте правильность ввода данных и повторите попытку.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Ошибка сети. Повторите попытку.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Проверка банковской карты не выполнена. Проверьте правильность ввода данных и повторите попытку.\",\n \"paypalButtonMustBeUsed\": \"Используйте кнопку PayPal, чтобы продолжить совершение оплаты.\",\n \"paypalAccountTokenizationFailedError\": \"Что-то пошло не так — не удалось добавить учетную запись PayPal. Повторите попытку.\",\n \"paypalFlowFailedError\": \"Что-то пошло не так — не удалось подключиться к системе PayPal. Повторите попытку.\",\n \"paypalTokenizationRequestActiveError\": \"Выполняется авторизация платежа PayPal.\",\n \"venmoCanceledError\": \"Возникла ошибка. Просим вас убедиться, что у вас установлена новейшая версия приложения Venmo и ваш браузер поддерживает переключение к Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Не удалось удалить способ оплаты. Повторите попытку.\",\n \"venmoAppFailedError\": \"Приложение Venmo не обнаружено на вашем устройстве.\",\n \"unsupportedCardTypeError\": \"Этот тип карты не поддерживается. Попробуйте воспользоваться другой картой.\",\n \"applePayTokenizationError\": \"При обработке платежа через Apple Pay возникла сетевая ошибка. Повторите попытку.\",\n \"applePayActiveCardError\": \"Добавьте поддерживаемую карту к своему счету Apple Pay.\",\n \"cardholderNameLabel\": \"Имя и фамилия владельца\",\n \"cardNumberLabel\": \"Номер карты\",\n \"cvvLabel\": \"Код безопасности\",\n \"cvvThreeDigitLabelSubheading\": \"(3 цифры)\",\n \"cvvFourDigitLabelSubheading\": \"(4 цифры)\",\n \"cardholderNamePlaceholder\": \"Имя и фамилия владельца\",\n \"expirationDateLabel\": \"Срок действия\",\n \"expirationDateLabelSubheading\": \"(ММ/ГГ)\",\n \"expirationDatePlaceholder\": \"ММ/ГГ\",\n \"postalCodeLabel\": \"Индекс\",\n \"saveCardLabel\": \"Сохранить карту\",\n \"payWithCard\": \"Оплатить картой\",\n \"endingIn\": \"Последние четыре цифры номера карты: {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Карта\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 238: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Spôsob úhrady: {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Vyberte iný spôsob platby\",\n \"chooseAWayToPay\": \"Vyberte spôsob platby\",\n \"otherWaysToPay\": \"Iné spôsoby platby\",\n \"edit\": \"Upraviť\",\n \"doneEditing\": \"Hotovo\",\n \"editPaymentMethods\": \"Upraviť spôsoby platby\",\n \"CreditCardDeleteConfirmationMessage\": \"Odstrániť kartu {{secondaryIdentifier}} končiacu na {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Odstrániť účet PayPal {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Naozaj chcete odstrániť účet Venmo s menom používateľa {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Ste si istí, že chcete tento spôsob platby odstrániť?\",\n \"deleteCancelButton\": \"Zrušiť\",\n \"deleteConfirmationButton\": \"Odstrániť\",\n \"fieldEmptyForCvv\": \"Zadajte číslo CVV.\",\n \"fieldEmptyForExpirationDate\": \"Zadajte dátum skončenia platnosti.\",\n \"fieldEmptyForCardholderName\": \"Zadajte meno majiteľa karty.\",\n \"fieldTooLongForCardholderName\": \"Meno majiteľa karty musí obsahovať menej ako 256 znakov.\",\n \"fieldEmptyForNumber\": \"Zadajte číslo.\",\n \"fieldEmptyForPostalCode\": \"Zadajte PSČ.\",\n \"fieldInvalidForCardholderName\": \"Toto meno majiteľa karty je neplatné.\",\n \"fieldInvalidForCvv\": \"Tento bezpečnostný kód je neplatný.\",\n \"fieldInvalidForExpirationDate\": \"Tento dátum skončenia platnosti je neplatný.\",\n \"fieldInvalidForNumber\": \"Toto číslo karty je neplatné.\",\n \"fieldInvalidForPostalCode\": \"Toto PSČ je neplatné.\",\n \"genericError\": \"Vyskytla sa chyba na našej strane.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Táto kreditná karta už existuje ako uložená metóda platby.\",\n \"hostedFieldsFailedTokenizationError\": \"Skontrolujte údaje a skúste to znova.\",\n \"hostedFieldsFieldsInvalidError\": \"Skontrolujte údaje a skúste to znova.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Chyba v sieti. Skúste to znova.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Overenie kreditnej karty nebolo úspešné. Skontrolujte údaje a skúste to znova.\",\n \"paypalButtonMustBeUsed\": \"Ak chcete pokračovať v platbe, použite tlačidlo PayPal.\",\n \"paypalAccountTokenizationFailedError\": \"Vyskytla sa chyba pri pridávaní účtu PayPal. Skúste to znova.\",\n \"paypalFlowFailedError\": \"Vyskytla sa chyba pri pripájaní do účtu PayPal. Skúste to znova.\",\n \"paypalTokenizationRequestActiveError\": \"Autorizácia platby PayPal už prebieha.\",\n \"venmoCanceledError\": \"Vyskytla sa chyba. Skontrolujte, či máte v zariadení nainštalovanú najnovšiu verziu aplikácie Venmo a či prehliadač podporuje prechod na aplikáciu Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Nebolo možné odstrániť spôsob platby, skúste to znova.\",\n \"venmoAppFailedError\": \"Aplikáciu Venmo sa vo vašom zariadení nepodarilo nájsť.\",\n \"unsupportedCardTypeError\": \"Tento typ karty nie je podporovaný. Skúste inú kartu.\",\n \"applePayTokenizationError\": \"Počas spracúvania platby cez Apple Pay došlo k chybe siete. Skúste to znova.\",\n \"applePayActiveCardError\": \"Pridajte si podporovanú kartu do peňaženky Apple Pay.\",\n \"cardholderNameLabel\": \"Meno majiteľa karty\",\n \"cardNumberLabel\": \"Číslo karty\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 číslice)\",\n \"cvvFourDigitLabelSubheading\": \"(4 číslice)\",\n \"cardholderNamePlaceholder\": \"Meno majiteľa karty\",\n \"expirationDateLabel\": \"Dátum skončenia platnosti\",\n \"expirationDateLabelSubheading\": \"(MM/RR)\",\n \"expirationDatePlaceholder\": \"MM/RR\",\n \"postalCodeLabel\": \"PSČ\",\n \"saveCardLabel\": \"Uložiť kartu\",\n \"payWithCard\": \"Zaplatiť kartou\",\n \"endingIn\": \"S posledným štvorčíslím {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Karta\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 239: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"Betalas med {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"Välj ett annat sätt att betala\",\n \"chooseAWayToPay\": \"Välj hur du vill betala\",\n \"otherWaysToPay\": \"Andra sätt att betala\",\n \"edit\": \"Ändra\",\n \"doneEditing\": \"Klart\",\n \"editPaymentMethods\": \"Redigera betalningsmetoder\",\n \"CreditCardDeleteConfirmationMessage\": \"Ta bort {{secondaryIdentifier}}-kort som slutar på {{identifier}}?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"Ta bort PayPal-konto {{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"Är du säker på att du vill ta bort Venmo-konto med användarnamn {{identifier}}?\",\n \"genericDeleteConfirmationMessage\": \"Är du säker på att du vill ta bort den här betalningsmetoden?\",\n \"deleteCancelButton\": \"Avbryt\",\n \"deleteConfirmationButton\": \"Ta bort\",\n \"fieldEmptyForCvv\": \"Fyll i en CVV-kod.\",\n \"fieldEmptyForExpirationDate\": \"Fyll i ett utgångsdatum.\",\n \"fieldEmptyForCardholderName\": \"Fyll i kortinnehavarens namn.\",\n \"fieldTooLongForCardholderName\": \"Kortinnehavarens namn måste vara kortare än 256 tecken.\",\n \"fieldEmptyForNumber\": \"Fyll i ett nummer.\",\n \"fieldEmptyForPostalCode\": \"Fyll i ett postnummer.\",\n \"fieldInvalidForCardholderName\": \"Namnet på kortinnehavaren är ogiltigt.\",\n \"fieldInvalidForCvv\": \"Den här säkerhetskoden är inte giltig.\",\n \"fieldInvalidForExpirationDate\": \"Det här utgångsdatumet är inte giltigt.\",\n \"fieldInvalidForNumber\": \"Det här kortnumret är inte giltigt.\",\n \"fieldInvalidForPostalCode\": \"Det här postnumret är inte giltigt.\",\n \"genericError\": \"Ett fel uppstod.\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"Det här betalkortet finns redan som en sparad betalningsmetod.\",\n \"hostedFieldsFailedTokenizationError\": \"Kontrollera uppgifterna och försök igen.\",\n \"hostedFieldsFieldsInvalidError\": \"Kontrollera uppgifterna och försök igen.\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"Nätverksfel. Försök igen.\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"Verifieringen av betalkort misslyckades. Kontrollera uppgifterna och försök igen.\",\n \"paypalButtonMustBeUsed\": \"Använd PayPal-knappen för att fortsätta med din betalning.\",\n \"paypalAccountTokenizationFailedError\": \"Ett fel uppstod när PayPal-kontot skulle läggas till. Försök igen.\",\n \"paypalFlowFailedError\": \"Ett fel uppstod när anslutningen till PayPal skulle upprättas. Försök igen.\",\n \"paypalTokenizationRequestActiveError\": \"Betalningsgodkännandet för PayPal behandlas redan.\",\n \"venmoCanceledError\": \"Något gick fel. Se till att du har den senaste versionen av Venmo-appen installerad på din enhet och att webbläsaren stöder att gå över till Venmo.\",\n \"vaultManagerPaymentMethodDeletionError\": \"Det gick inte att ta bort betalningsmetoden. Försök igen.\",\n \"venmoAppFailedError\": \"Venmo-appen kunde inte hittas på din enhet.\",\n \"unsupportedCardTypeError\": \"Den här korttypen stöds inte. Pröva med ett annat kort.\",\n \"applePayTokenizationError\": \"Ett nätverksfel inträffade när Apple Pay-betalningen skulle behandlas. Försök igen.\",\n \"applePayActiveCardError\": \"Lägg till ett kort som stöds i Apple Pay-e-plånboken.\",\n \"cardholderNameLabel\": \"Kortinnehavarens namn\",\n \"cardNumberLabel\": \"Kortnummer\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 siffror)\",\n \"cvvFourDigitLabelSubheading\": \"(4 siffror)\",\n \"cardholderNamePlaceholder\": \"Kortinnehavarens namn\",\n \"expirationDateLabel\": \"Utgångsdatum\",\n \"expirationDateLabelSubheading\": \"(MM/ÅÅ)\",\n \"expirationDatePlaceholder\": \"MM/ÅÅ\",\n \"postalCodeLabel\": \"Postnummer\",\n \"saveCardLabel\": \"Spara kort\",\n \"payWithCard\": \"Betala med kort\",\n \"endingIn\": \"Slutar på {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"Kort\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 240: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"การชำระเงินด้วย {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"เลือกวิธีอื่นเพื่อชำระเงิน\",\n \"chooseAWayToPay\": \"เลือกวิธีชำระเงิน\",\n \"otherWaysToPay\": \"วิธีอื่นๆ ในการชำระเงิน\",\n \"edit\": \"แก้ไข\",\n \"doneEditing\": \"เสร็จแล้ว\",\n \"editPaymentMethods\": \"แก้ไขวิธีการชำระเงิน\",\n \"CreditCardDeleteConfirmationMessage\": \"ลบบัตร {{secondaryIdentifier }} ที่ลงท้ายด้วย {{identifier}} หรือไม่\",\n \"PayPalAccountDeleteConfirmationMessage\": \"ลบ {{identifier}} บัญชี PayPal หรือไม่\",\n \"VenmoAccountDeleteConfirmationMessage\": \"คุณมั่นใจว่าต้องการลบบัญชี Venmo ที่มีชื่อผู้ใช้ {{identifier}} หรือไม่\",\n \"genericDeleteConfirmationMessage\": \"คุณมั่นใจว่าต้องการลบวิธีการชำระเงินนี้หรือไม่\",\n \"deleteCancelButton\": \"ยกเลิก\",\n \"deleteConfirmationButton\": \"ลบ\",\n \"fieldEmptyForCvv\": \"โปรดกรอก CVV (รหัสการตรวจสอบยืนยันบัตร)\",\n \"fieldEmptyForExpirationDate\": \"โปรดกรอกวันที่หมดอายุ\",\n \"fieldEmptyForCardholderName\": \"โปรดกรอกชื่อเจ้าของบัตร\",\n \"fieldTooLongForCardholderName\": \"ชื่อผู้ถือบัตรจะต้องไม่เกิน 256 อักขระ\",\n \"fieldEmptyForNumber\": \"โปรดกรอกหมายเลข\",\n \"fieldEmptyForPostalCode\": \"โปรดกรอกรหัสไปรษณีย์\",\n \"fieldInvalidForCardholderName\": \"ชื่อผู้ถือบัตรนี้ไม่ถูกต้องชื่อผู้ถือบัตรนี้ไม่ถูกต้อง\",\n \"fieldInvalidForCvv\": \"รหัสความปลอดภัยนี้ไม่ถูกต้อง\",\n \"fieldInvalidForExpirationDate\": \"วันที่หมดอายุนี้ไม่ถูกต้อง\",\n \"fieldInvalidForNumber\": \"หมายเลขบัตรนี้ไม่ถูกต้อง\",\n \"fieldInvalidForPostalCode\": \"รหัสไปรษณีย์นี้ไม่ถูกต้อง\",\n \"genericError\": \"เกิดข้อผิดพลาดขึ้นในระบบของเรา\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"บัตรเครดิตนี้ถูกบันทึกไว้เป็นวิธีการชำระเงิน\",\n \"hostedFieldsFailedTokenizationError\": \"โปรดตรวจสอบข้อมูลของคุณ แล้วลองใหม่อีกครั้ง\",\n \"hostedFieldsFieldsInvalidError\": \"โปรดตรวจสอบข้อมูลของคุณ แล้วลองใหม่อีกครั้ง\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"ข้อผิดพลาดด้านเครือข่าย โปรดลองอีกครั้ง\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"การตรวจสอบยืนยันบัตรเครดิตล้มเหลว โปรดตรวจสอบข้อมูลของคุณ แล้วลองใหม่อีกครั้ง\",\n \"paypalButtonMustBeUsed\": \"ใช้ปุ่ม PayPal เพื่อดำเนินการชำระเงินต่อ\",\n \"paypalAccountTokenizationFailedError\": \"เกิดข้อผิดพลาดในการเพิ่มบัญชี PayPal โปรดลองอีกครั้ง\",\n \"paypalFlowFailedError\": \"เกิดข้อผิดพลาดในการเชื่อมต่อกับ PayPal โปรดลองอีกครั้ง\",\n \"paypalTokenizationRequestActiveError\": \"การอนุญาตการชำระเงินของ PayPal อยู่ในระหว่างดำเนินการ\",\n \"venmoCanceledError\": \"เกิดข้อผิดพลาดบางประการ ตรวจสอบว่าคุณมีแอป Venmo เวอร์ชันล่าสุดติดตั้งในอุปกรณ์ของคุณ และมีเบราเซอร์ที่รองรับ Venmo\",\n \"vaultManagerPaymentMethodDeletionError\": \"ไม่สามารถลบวิธีการชำระเงินได้ ลองอีกครั้ง\",\n \"venmoAppFailedError\": \"ไม่พบแอป Venmo บนอุปกรณ์ของคุณ\",\n \"unsupportedCardTypeError\": \"ไม่รองรับบัตรประเภทนี้ โปรดลองใช้บัตรใบอื่น\",\n \"applePayTokenizationError\": \"เกิดข้อผิดพลาดด้านเครือข่ายขึ้นขณะดำเนินการชำระเงินด้วย Apple Pay โปรดลองอีกครั้ง\",\n \"applePayActiveCardError\": \"เพิ่มบัตรที่รองรับในกระเป๋าสตางค์ Apple Pay ของคุณ\",\n \"cardholderNameLabel\": \"ชื่อเจ้าของบัตร\",\n \"cardNumberLabel\": \"หมายเลขบัตร\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 หลัก)\",\n \"cvvFourDigitLabelSubheading\": \"(4 หลัก)\",\n \"cardholderNamePlaceholder\": \"ชื่อเจ้าของบัตร\",\n \"expirationDateLabel\": \"วันหมดอายุ\",\n \"expirationDateLabelSubheading\": \"(ดด/ปป)\",\n \"expirationDatePlaceholder\": \"ดด/ปป\",\n \"postalCodeLabel\": \"รหัสไปรษณีย์\",\n \"saveCardLabel\": \"บันทึกบัตร\",\n \"payWithCard\": \"ชำระเงินด้วยบัตร\",\n \"endingIn\": \"ลงท้ายด้วย {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"บัตร\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 241: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"正在使用{{paymentSource}}付款\",\n \"chooseAnotherWayToPay\": \"选择其他付款方式\",\n \"chooseAWayToPay\": \"选择付款方式\",\n \"otherWaysToPay\": \"其他付款方式\",\n \"edit\": \"编辑\",\n \"doneEditing\": \"完成\",\n \"editPaymentMethods\": \"编辑付款方式\",\n \"CreditCardDeleteConfirmationMessage\": \"删除尾号为{{identifier}}的{{secondaryIdentifier}}卡?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"删除PayPal账户{{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"确定要删除用户名为{{identifier}}的Venmo账户吗?\",\n \"genericDeleteConfirmationMessage\": \"确定要删除该付款方式吗?\",\n \"deleteCancelButton\": \"取消\",\n \"deleteConfirmationButton\": \"删除\",\n \"fieldEmptyForCvv\": \"请填写CVV。\",\n \"fieldEmptyForExpirationDate\": \"请填写有效期限。\",\n \"fieldEmptyForCardholderName\": \"请填写持卡人的姓名。\",\n \"fieldTooLongForCardholderName\": \"持卡人姓名必须少于256个字符。\",\n \"fieldEmptyForNumber\": \"请填写一个号码。\",\n \"fieldEmptyForPostalCode\": \"请填写邮政编码。\",\n \"fieldInvalidForCardholderName\": \"此持卡人姓名无效。\",\n \"fieldInvalidForCvv\": \"此安全代码无效。\",\n \"fieldInvalidForExpirationDate\": \"此有效期限无效。\",\n \"fieldInvalidForNumber\": \"此卡号无效。\",\n \"fieldInvalidForPostalCode\": \"此邮政编码无效。\",\n \"genericError\": \"我们遇到了一些问题\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"此信用卡已作为保存后的付款方式存在。\",\n \"hostedFieldsFailedTokenizationError\": \"请检查您的信息,然后重试。\",\n \"hostedFieldsFieldsInvalidError\": \"请检查您的信息,然后重试。\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"网络错误。请重试。\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"信用卡验证失败。请检查您的信息,然后重试。\",\n \"paypalButtonMustBeUsed\": \"使用PayPal按钮继续进行付款。\",\n \"paypalAccountTokenizationFailedError\": \"添加PayPal账户时出错。请重试。\",\n \"paypalFlowFailedError\": \"连接到PayPal时出错。请重试。\",\n \"paypalTokenizationRequestActiveError\": \"PayPal付款授权已在进行中。\",\n \"venmoCanceledError\": \"我们遇到了问题。请确保您的设备上已安装最新版本的Venmo应用,并且您的浏览器支持切换到Venmo。\",\n \"vaultManagerPaymentMethodDeletionError\": \"无法删除付款方式,请重试。\",\n \"venmoAppFailedError\": \"在您的设备上找不到Venmo应用。\",\n \"unsupportedCardTypeError\": \"不支持该卡类型。请尝试其他卡。\",\n \"applePayTokenizationError\": \"处理Apple Pay付款时出现网络错误。请重试。\",\n \"applePayActiveCardError\": \"请添加受支持的卡到您的Apple Pay钱包。\",\n \"cardholderNameLabel\": \"持卡人姓名\",\n \"cardNumberLabel\": \"卡号\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3位数)\",\n \"cvvFourDigitLabelSubheading\": \"(4位数)\",\n \"cardholderNamePlaceholder\": \"持卡人姓名\",\n \"expirationDateLabel\": \"有效期限\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"MM/YY\",\n \"postalCodeLabel\": \"邮政编码\",\n \"saveCardLabel\": \"保存卡\",\n \"payWithCard\": \"用卡付款\",\n \"endingIn\": \"尾号为{{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"卡\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"银联\"\n };\n }, {}],\n 242: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"付款方式為 {{paymentSource}}\",\n \"chooseAnotherWayToPay\": \"選擇其他付款方式\",\n \"chooseAWayToPay\": \"選擇付款方式\",\n \"otherWaysToPay\": \"其他付款方式\",\n \"edit\": \"編輯\",\n \"doneEditing\": \"完成\",\n \"editPaymentMethods\": \"編輯付款方式\",\n \"CreditCardDeleteConfirmationMessage\": \"要刪除末碼為 {{identifier}} 的 {{secondaryIdentifier}} 卡嗎?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"要刪除 PayPal 帳戶 {{identifier}} 嗎?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"確定要刪除使用者名稱為 {{identifier}} 的 Venmo 帳戶嗎?\",\n \"genericDeleteConfirmationMessage\": \"確定要刪除此付款方式嗎?\",\n \"deleteCancelButton\": \"取消\",\n \"deleteConfirmationButton\": \"刪除\",\n \"fieldEmptyForCvv\": \"請填寫信用卡認證碼。\",\n \"fieldEmptyForExpirationDate\": \"請填寫到期日。\",\n \"fieldEmptyForCardholderName\": \"請填寫持卡人的名字。\",\n \"fieldTooLongForCardholderName\": \"持卡人姓名必須少於 256 個字元。\",\n \"fieldEmptyForNumber\": \"請填寫號碼。\",\n \"fieldEmptyForPostalCode\": \"請填寫郵遞區號。\",\n \"fieldInvalidForCardholderName\": \"持卡人姓名無效。\",\n \"fieldInvalidForCvv\": \"此安全代碼無效。\",\n \"fieldInvalidForExpirationDate\": \"此到期日無效。\",\n \"fieldInvalidForNumber\": \"此卡號無效。\",\n \"fieldInvalidForPostalCode\": \"此郵遞區號無效。\",\n \"genericError\": \"系統發生錯誤。\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"此信用卡已存在,為已儲存的付款方式。\",\n \"hostedFieldsFailedTokenizationError\": \"請檢查你的資料並再試一次。\",\n \"hostedFieldsFieldsInvalidError\": \"請檢查你的資料並再試一次。\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"網絡錯誤。再試一次。\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"信用卡認證失敗。請檢查你的資料並再試一次。\",\n \"paypalButtonMustBeUsed\": \"使用 PayPal 按鈕以繼續付款。\",\n \"paypalAccountTokenizationFailedError\": \"加入 PayPal 帳戶時發生錯誤。再試一次。\",\n \"paypalFlowFailedError\": \"連接 PayPal 時發生錯誤。再試一次。\",\n \"paypalTokenizationRequestActiveError\": \"PayPal 付款授權已在處理中。\",\n \"venmoCanceledError\": \"系統發生錯誤,請確保你已在裝置上安裝最新版本的 Venmo 應用程式,而且你的瀏覽器支援切換至 Venmo。\",\n \"vaultManagerPaymentMethodDeletionError\": \"無法刪除付款方式,請再試一次。\",\n \"venmoAppFailedError\": \"在你的裝置上找不到 Venmo 應用程式。\",\n \"unsupportedCardTypeError\": \"不可使用此信用卡類型。請改用其他信用卡。\",\n \"applePayTokenizationError\": \"處理 Apple Pay 付款時發生網絡錯誤。再試一次。\",\n \"applePayActiveCardError\": \"在 Apple Pay 錢包中加入支援的信用卡。\",\n \"cardholderNameLabel\": \"持卡人名字\",\n \"cardNumberLabel\": \"卡號\",\n \"cvvLabel\": \"信用卡認證碼\",\n \"cvvThreeDigitLabelSubheading\": \"(3 位數)\",\n \"cvvFourDigitLabelSubheading\": \"(4 位數)\",\n \"cardholderNamePlaceholder\": \"持卡人名字\",\n \"expirationDateLabel\": \"到期日\",\n \"expirationDateLabelSubheading\": \"(MM/YY)\",\n \"expirationDatePlaceholder\": \"月 / 年\",\n \"postalCodeLabel\": \"郵遞區號\",\n \"saveCardLabel\": \"儲存信用卡\",\n \"payWithCard\": \"使用信用卡付款\",\n \"endingIn\": \"末碼為 {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"信用卡\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 243: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"以 {{paymentSource}} 付款\",\n \"chooseAnotherWayToPay\": \"選擇付款的以其他方式付款\",\n \"chooseAWayToPay\": \"選擇付款方式\",\n \"otherWaysToPay\": \"其他付款方式\",\n \"edit\": \"編輯\",\n \"doneEditing\": \"完成\",\n \"editPaymentMethods\": \"編輯付款方式\",\n \"CreditCardDeleteConfirmationMessage\": \"確定要刪除末碼為 {{identifier}} 的 {{secondaryIdentifier}} 卡片嗎?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"確定要刪除 {{identifier}} PayPal 帳戶嗎?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"確定要刪除用戶名稱為 {{identifier}} 的 Venmo 帳戶嗎?\",\n \"genericDeleteConfirmationMessage\": \"確定要刪除此付款方式?\",\n \"deleteCancelButton\": \"取消\",\n \"deleteConfirmationButton\": \"刪除\",\n \"fieldEmptyForCvv\": \"請填妥信用卡驗證碼。\",\n \"fieldEmptyForExpirationDate\": \"請填妥到期日。\",\n \"fieldEmptyForCardholderName\": \"請填妥持卡人姓名。\",\n \"fieldTooLongForCardholderName\": \"持卡人姓名不能超過 256 個字元。\",\n \"fieldEmptyForNumber\": \"請填妥號碼。\",\n \"fieldEmptyForPostalCode\": \"請填寫郵遞區號。\",\n \"fieldInvalidForCardholderName\": \"此持卡人姓名無效。\",\n \"fieldInvalidForCvv\": \"這組安全代碼無效。\",\n \"fieldInvalidForExpirationDate\": \"此到期日無效。\",\n \"fieldInvalidForNumber\": \"此卡號無效。\",\n \"fieldInvalidForPostalCode\": \"此郵遞區號無效。\",\n \"genericError\": \"我們的系統發生問題。\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"此信用卡已存在,為已儲存的付款方式。\",\n \"hostedFieldsFailedTokenizationError\": \"請檢查你的資料並重試。\",\n \"hostedFieldsFieldsInvalidError\": \"請檢查你的資料並重試。\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"網路錯誤。請重試。\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"信用卡認證失敗。請檢查你的資料並重試。\",\n \"paypalButtonMustBeUsed\": \"使用 PayPal 按鈕以繼續付款。\",\n \"paypalAccountTokenizationFailedError\": \"新增 PayPal 帳戶時,系統發生錯誤。請重試。\",\n \"paypalFlowFailedError\": \"連結至 PayPal 時,系統發生錯誤。請重試。\",\n \"paypalTokenizationRequestActiveError\": \"PayPal 支付款項的授權已在處理中。\",\n \"venmoCanceledError\": \"系統發生錯誤。確認你的裝置上裝有最新版本的 Venmo 應用程式,而且瀏覽器支援切換至 Venmo。\",\n \"vaultManagerPaymentMethodDeletionError\": \"無法刪除付款方式,請再試一次。\",\n \"venmoAppFailedError\": \"你的裝置上找不到 Venmo 應用程式。\",\n \"unsupportedCardTypeError\": \"不支援此卡片類型。請改用其他卡片。\",\n \"applePayTokenizationError\": \"在處理 Apple Pay 付款時發生網路錯誤。請重試。\",\n \"applePayActiveCardError\": \"新增支援的卡片至你的 Apple Pay 錢包。\",\n \"cardholderNameLabel\": \"持卡人姓名\",\n \"cardNumberLabel\": \"卡號\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3 位數)\",\n \"cvvFourDigitLabelSubheading\": \"(4 位數)\",\n \"cardholderNamePlaceholder\": \"持卡人姓名\",\n \"expirationDateLabel\": \"到期日\",\n \"expirationDateLabelSubheading\": \"(月 / 年)\",\n \"expirationDatePlaceholder\": \"月 / 年\",\n \"postalCodeLabel\": \"郵遞區號\",\n \"saveCardLabel\": \"儲存卡片\",\n \"payWithCard\": \"使用信用卡 / 扣帳卡付款\",\n \"endingIn\": \"末碼為 {{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"信用卡或扣帳卡\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal 信貸\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"美國運通 (American Express)\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"大來國際 (Diners Club)\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"UnionPay\"\n };\n }, {}],\n 244: [function (require, module, exports) {\n 'use strict';\n\n module.exports = {\n \"payingWith\": \"使用{{paymentSource}}付款\",\n \"chooseAnotherWayToPay\": \"选择其它付款方式\",\n \"chooseAWayToPay\": \"选择付款方式\",\n \"otherWaysToPay\": \"其它付款方式\",\n \"edit\": \"编辑\",\n \"doneEditing\": \"完成\",\n \"editPaymentMethods\": \"编辑付款方式\",\n \"CreditCardDeleteConfirmationMessage\": \"删除尾号为{{identifier}}的{{secondaryIdentifier}}卡?\",\n \"PayPalAccountDeleteConfirmationMessage\": \"删除PayPal账户{{identifier}}?\",\n \"VenmoAccountDeleteConfirmationMessage\": \"确定要删除用户名为{{identifier}}的Venmo账户吗?\",\n \"genericDeleteConfirmationMessage\": \"确定要删除此付款方式吗?\",\n \"deleteCancelButton\": \"取消\",\n \"deleteConfirmationButton\": \"删除\",\n \"fieldEmptyForCvv\": \"请填写 CVV。\",\n \"fieldEmptyForExpirationDate\": \"请填写有效期限。\",\n \"fieldEmptyForCardholderName\": \"请填写持卡人姓名。\",\n \"fieldTooLongForCardholderName\": \"持卡人姓名必须少于256个字符。\",\n \"fieldEmptyForNumber\": \"请填写号码。\",\n \"fieldEmptyForPostalCode\": \"请填写邮政编码。\",\n \"fieldInvalidForCardholderName\": \"此持卡人姓名无效。\",\n \"fieldInvalidForCvv\": \"此验证码无效。\",\n \"fieldInvalidForExpirationDate\": \"此有效期限无效。\",\n \"fieldInvalidForNumber\": \"此卡号无效。\",\n \"fieldInvalidForPostalCode\": \"此邮政编码无效。\",\n \"genericError\": \"我们遇到了一些问题。\",\n \"hostedFieldsTokenizationFailOnDuplicateError\": \"此信用卡已存在于已保存的付款方式中。\",\n \"hostedFieldsFailedTokenizationError\": \"请检查您的信息,然后重试。\",\n \"hostedFieldsFieldsInvalidError\": \"请检查您的信息,然后重试。\",\n \"hostedFieldsTokenizationNetworkErrorError\": \"网络错误。请重试。\",\n \"hostedFieldsTokenizationCvvVerificationFailedError\": \"信用卡认证失败。请检查您的信息,然后重试。\",\n \"paypalButtonMustBeUsed\": \"使用PayPal按钮以便继续进行您的付款。\",\n \"paypalAccountTokenizationFailedError\": \"添加PayPal账户时遇到了问题。请重试。\",\n \"paypalFlowFailedError\": \"连接到PayPal时遇到了问题。请重试。\",\n \"paypalTokenizationRequestActiveError\": \"PayPal付款授权正在处理中。\",\n \"venmoCanceledError\": \"我们遇到了一些问题。请确保您的设备上安装了最新版本的Venmo应用,并且您的浏览器支持切换到Venmo。\",\n \"vaultManagerPaymentMethodDeletionError\": \"无法删除付款方式,请重试。\",\n \"venmoAppFailedError\": \"未能在您的设备上找到Venmo应用。\",\n \"unsupportedCardTypeError\": \"不支持此类型的卡。请尝试其它卡。\",\n \"applePayTokenizationError\": \"处理Apple Pay付款时出现了网络错误。请重试。\",\n \"applePayActiveCardError\": \"在您的Apple Pay钱包中添加一张受支持的卡。\",\n \"cardholderNameLabel\": \"持卡人姓名\",\n \"cardNumberLabel\": \"卡号\",\n \"cvvLabel\": \"CVV\",\n \"cvvThreeDigitLabelSubheading\": \"(3位数)\",\n \"cvvFourDigitLabelSubheading\": \"(4位数)\",\n \"cardholderNamePlaceholder\": \"持卡人姓名\",\n \"expirationDateLabel\": \"有效期限\",\n \"expirationDateLabelSubheading\": \"(月/年)\",\n \"expirationDatePlaceholder\": \"月/年\",\n \"postalCodeLabel\": \"邮政编码\",\n \"saveCardLabel\": \"保存卡\",\n \"payWithCard\": \"使用卡付款\",\n \"endingIn\": \"尾号为{{lastFourCardDigits}}\",\n \"Apple Pay\": \"Apple Pay\",\n \"Venmo\": \"Venmo\",\n \"Card\": \"卡\",\n \"PayPal\": \"PayPal\",\n \"PayPal Credit\": \"PayPal Credit\",\n \"Google Pay\": \"Google Pay\",\n \"American Express\": \"American Express\",\n \"Discover\": \"Discover\",\n \"Diners Club\": \"Diners Club\",\n \"MasterCard\": \"Mastercard\",\n \"Visa\": \"Visa\",\n \"JCB\": \"JCB\",\n \"Maestro\": \"Maestro\",\n \"UnionPay\": \"银联\"\n };\n }, {}],\n 245: [function (require, module, exports) {\n 'use strict';\n\n var assign = require('../lib/assign').assign;\n\n var classList = require('@braintree/class-list');\n\n var DropinError = require('../lib/dropin-error');\n\n var errors = require('../constants').errors;\n\n var Promise = require('../lib/promise');\n\n function BaseView(options) {\n options = options || {};\n assign(this, options);\n }\n\n BaseView.prototype.getElementById = function (id) {\n if (!this.element) {\n return null;\n }\n\n return this.element.querySelector('[data-braintree-id=\"' + id + '\"]');\n };\n\n BaseView.prototype.requestPaymentMethod = function () {\n return Promise.reject(new DropinError(errors.NO_PAYMENT_METHOD_ERROR));\n };\n\n BaseView.prototype.getPaymentMethod = function () {\n return this.activeMethodView && this.activeMethodView.paymentMethod;\n };\n\n BaseView.prototype.onSelection = function () {};\n\n BaseView.prototype.teardown = function () {\n return Promise.resolve();\n };\n\n BaseView.prototype.preventUserAction = function () {\n if (this.element) {\n classList.add(this.element, 'braintree-sheet--loading');\n }\n\n this.model.preventUserAction();\n };\n\n BaseView.prototype.allowUserAction = function () {\n if (this.element) {\n classList.remove(this.element, 'braintree-sheet--loading');\n }\n\n this.model.allowUserAction();\n };\n\n module.exports = BaseView;\n }, {\n \"../constants\": 187,\n \"../lib/assign\": 193,\n \"../lib/dropin-error\": 197,\n \"../lib/promise\": 204,\n \"@braintree/class-list\": 35\n }],\n 246: [function (require, module, exports) {\n 'use strict';\n\n var BaseView = require('./base-view');\n\n var addSelectionEventHandler = require('../lib/add-selection-event-handler');\n\n var paymentMethodTypes = require('../constants').paymentMethodTypes;\n\n function DeleteConfirmationView() {\n BaseView.apply(this, arguments);\n\n this._initialize();\n }\n\n DeleteConfirmationView.prototype = Object.create(BaseView.prototype);\n DeleteConfirmationView.prototype.constructor = DeleteConfirmationView;\n DeleteConfirmationView.ID = DeleteConfirmationView.prototype.ID = 'delete-confirmation';\n\n DeleteConfirmationView.prototype._initialize = function () {\n this._yesButton = this.getElementById('delete-confirmation__yes');\n this._noButton = this.getElementById('delete-confirmation__no');\n this._messageBox = this.getElementById('delete-confirmation__message');\n addSelectionEventHandler(this._yesButton, function () {\n this.model.deleteVaultedPaymentMethod();\n }.bind(this));\n addSelectionEventHandler(this._noButton, function () {\n this.model.cancelDeleteVaultedPaymentMethod();\n }.bind(this));\n };\n\n DeleteConfirmationView.prototype.applyPaymentMethod = function (paymentMethod) {\n var identifier, secondaryIdentifier;\n var messageText = this.strings[paymentMethod.type + 'DeleteConfirmationMessage'];\n\n if (messageText) {\n switch (paymentMethod.type) {\n case paymentMethodTypes.card:\n identifier = paymentMethod.details.lastFour;\n secondaryIdentifier = paymentMethod.details.cardType;\n secondaryIdentifier = this.strings[secondaryIdentifier] || secondaryIdentifier;\n break;\n\n case paymentMethodTypes.paypal:\n identifier = paymentMethod.details.email;\n break;\n\n case paymentMethodTypes.venmo:\n identifier = paymentMethod.details.username;\n break;\n\n default:\n break;\n }\n\n messageText = messageText.replace('{{identifier}}', identifier);\n\n if (secondaryIdentifier) {\n messageText = messageText.replace('{{secondaryIdentifier}}', secondaryIdentifier);\n }\n } else {\n messageText = this.strings.genericDeleteConfirmationMessage;\n }\n\n this._messageBox.innerText = messageText;\n };\n\n module.exports = DeleteConfirmationView;\n }, {\n \"../constants\": 187,\n \"../lib/add-selection-event-handler\": 191,\n \"./base-view\": 245\n }],\n 247: [function (require, module, exports) {\n 'use strict';\n\n var analytics = require('../lib/analytics');\n\n var analyticsKinds = require('../constants').analyticsKinds;\n\n var BaseView = require('./base-view');\n\n var classList = require('@braintree/class-list');\n\n var sheetViews = require('./payment-sheet-views');\n\n var PaymentMethodsView = require('./payment-methods-view');\n\n var PaymentOptionsView = require('./payment-options-view');\n\n var DeleteConfirmationView = require('./delete-confirmation-view');\n\n var addSelectionEventHandler = require('../lib/add-selection-event-handler');\n\n var Promise = require('../lib/promise');\n\n var wait = require('../lib/wait');\n\n var supportsFlexbox = require('../lib/supports-flexbox');\n\n var CHANGE_ACTIVE_PAYMENT_METHOD_TIMEOUT = require('../constants').CHANGE_ACTIVE_PAYMENT_METHOD_TIMEOUT;\n\n var DEVELOPER_MISCONFIGURATION_MESSAGE = require('../constants').errors.DEVELOPER_MISCONFIGURATION_MESSAGE;\n\n function MainView() {\n BaseView.apply(this, arguments);\n this.dependenciesInitializing = 0;\n\n this._initialize();\n }\n\n MainView.prototype = Object.create(BaseView.prototype);\n MainView.prototype.constructor = MainView;\n\n MainView.prototype._initialize = function () {\n var paymentOptionsView;\n this._hasMultiplePaymentOptions = this.model.supportedPaymentOptions.length > 1;\n this._views = {};\n this.sheetContainer = this.getElementById('sheet-container');\n this.sheetErrorText = this.getElementById('sheet-error-text');\n this.toggle = this.getElementById('toggle');\n this.disableWrapper = this.getElementById('disable-wrapper');\n this.lowerContainer = this.getElementById('lower-container');\n this.loadingContainer = this.getElementById('loading-container');\n this.dropinContainer = this.element.querySelector('.braintree-dropin');\n this.supportsFlexbox = supportsFlexbox();\n this.model.on('asyncDependenciesReady', this.hideLoadingIndicator.bind(this));\n this.model.on('errorOccurred', this.showSheetError.bind(this));\n this.model.on('errorCleared', this.hideSheetError.bind(this));\n this.model.on('preventUserAction', this.preventUserAction.bind(this));\n this.model.on('allowUserAction', this.allowUserAction.bind(this));\n this.paymentSheetViewIDs = Object.keys(sheetViews).reduce(function (ids, sheetViewKey) {\n var PaymentSheetView, paymentSheetView;\n\n if (this.model.supportedPaymentOptions.indexOf(sheetViewKey) !== -1) {\n PaymentSheetView = sheetViews[sheetViewKey];\n paymentSheetView = new PaymentSheetView({\n element: this.getElementById(PaymentSheetView.ID),\n mainView: this,\n model: this.model,\n client: this.client,\n strings: this.strings\n });\n paymentSheetView.initialize();\n this.addView(paymentSheetView);\n ids.push(paymentSheetView.ID);\n }\n\n return ids;\n }.bind(this), []);\n this.paymentMethodsViews = new PaymentMethodsView({\n element: this.element,\n model: this.model,\n client: this.client,\n strings: this.strings\n });\n this.addView(this.paymentMethodsViews);\n this.deleteConfirmationView = new DeleteConfirmationView({\n element: this.getElementById('delete-confirmation'),\n model: this.model,\n strings: this.strings\n });\n this.addView(this.deleteConfirmationView);\n addSelectionEventHandler(this.toggle, this.toggleAdditionalOptions.bind(this));\n this.model.on('changeActivePaymentMethod', function () {\n wait.delay(CHANGE_ACTIVE_PAYMENT_METHOD_TIMEOUT).then(function () {\n this.setPrimaryView(PaymentMethodsView.ID);\n }.bind(this));\n }.bind(this));\n this.model.on('changeActivePaymentView', this._onChangeActivePaymentMethodView.bind(this));\n this.model.on('removeActivePaymentMethod', function () {\n var activePaymentView = this.getView(this.model.getActivePaymentView());\n\n if (activePaymentView && typeof activePaymentView.removeActivePaymentMethod === 'function') {\n activePaymentView.removeActivePaymentMethod();\n }\n }.bind(this));\n this.model.on('enableEditMode', this.enableEditMode.bind(this));\n this.model.on('disableEditMode', this.disableEditMode.bind(this));\n this.model.on('confirmPaymentMethodDeletion', this.openConfirmPaymentMethodDeletionDialog.bind(this));\n this.model.on('cancelVaultedPaymentMethodDeletion', this.cancelVaultedPaymentMethodDeletion.bind(this));\n this.model.on('startVaultedPaymentMethodDeletion', this.startVaultedPaymentMethodDeletion.bind(this));\n this.model.on('finishVaultedPaymentMethodDeletion', this.finishVaultedPaymentMethodDeletion.bind(this));\n\n if (this._hasMultiplePaymentOptions) {\n paymentOptionsView = new PaymentOptionsView({\n client: this.client,\n element: this.getElementById(PaymentOptionsView.ID),\n mainView: this,\n model: this.model,\n strings: this.strings\n });\n this.addView(paymentOptionsView);\n }\n\n this._sendToDefaultView();\n };\n\n MainView.prototype._onChangeActivePaymentMethodView = function (id) {\n var activePaymentView = this.getView(id);\n\n if (id === PaymentMethodsView.ID) {\n classList.add(this.paymentMethodsViews.container, 'braintree-methods--active');\n classList.remove(this.sheetContainer, 'braintree-sheet--active');\n } else {\n wait.delay(0).then(function () {\n classList.add(this.sheetContainer, 'braintree-sheet--active');\n }.bind(this));\n classList.remove(this.paymentMethodsViews.container, 'braintree-methods--active');\n\n if (!this.getView(id).getPaymentMethod()) {\n this.model.setPaymentMethodRequestable({\n isRequestable: false\n });\n }\n }\n\n activePaymentView.onSelection();\n };\n\n MainView.prototype.addView = function (view) {\n this._views[view.ID] = view;\n };\n\n MainView.prototype.getView = function (id) {\n return this._views[id];\n };\n\n MainView.prototype.setPrimaryView = function (id, secondaryViewId) {\n var paymentMethod;\n wait.delay(0).then(function () {\n this.element.className = prefixShowClass(id);\n\n if (secondaryViewId) {\n classList.add(this.element, prefixShowClass(secondaryViewId));\n }\n }.bind(this));\n this.primaryView = this.getView(id);\n this.model.changeActivePaymentView(id);\n\n if (this.paymentSheetViewIDs.indexOf(id) !== -1) {\n if (this.model.getPaymentMethods().length > 0 || this.getView(PaymentOptionsView.ID)) {\n this.showToggle();\n } else {\n this.hideToggle();\n }\n } else if (id === PaymentMethodsView.ID) {\n this.showToggle(); // Move options below the upper-container\n\n this.getElementById('lower-container').appendChild(this.getElementById('options'));\n } else if (id === PaymentOptionsView.ID) {\n this.hideToggle();\n }\n\n if (!this.supportsFlexbox) {\n this.element.setAttribute('data-braintree-no-flexbox', true);\n }\n\n paymentMethod = this.primaryView.getPaymentMethod();\n this.model.setPaymentMethodRequestable({\n isRequestable: Boolean(paymentMethod && !this.model.isInEditMode()),\n type: paymentMethod && paymentMethod.type,\n selectedPaymentMethod: paymentMethod\n });\n this.model.clearError();\n };\n\n MainView.prototype.requestPaymentMethod = function () {\n var activePaymentView = this.getView(this.model.getActivePaymentView());\n return activePaymentView.requestPaymentMethod().then(function (payload) {\n analytics.sendEvent(this.client, 'request-payment-method.' + analyticsKinds[payload.type]);\n return payload;\n }.bind(this)).catch(function (err) {\n analytics.sendEvent(this.client, 'request-payment-method.error');\n return Promise.reject(err);\n }.bind(this));\n };\n\n MainView.prototype.hideLoadingIndicator = function () {\n classList.remove(this.dropinContainer, 'braintree-loading');\n classList.add(this.dropinContainer, 'braintree-loaded');\n classList.add(this.loadingContainer, 'braintree-hidden');\n };\n\n MainView.prototype.showLoadingIndicator = function () {\n classList.add(this.dropinContainer, 'braintree-loading');\n classList.remove(this.dropinContainer, 'braintree-loaded');\n classList.remove(this.loadingContainer, 'braintree-hidden');\n };\n\n MainView.prototype.toggleAdditionalOptions = function () {\n var sheetViewID;\n var isPaymentSheetView = this.paymentSheetViewIDs.indexOf(this.primaryView.ID) !== -1;\n this.hideToggle();\n\n if (!this._hasMultiplePaymentOptions) {\n sheetViewID = this.paymentSheetViewIDs[0];\n classList.add(this.element, prefixShowClass(sheetViewID));\n this.model.changeActivePaymentView(sheetViewID);\n } else if (isPaymentSheetView) {\n if (this.model.getPaymentMethods().length === 0) {\n this.setPrimaryView(PaymentOptionsView.ID);\n } else {\n this.setPrimaryView(PaymentMethodsView.ID, PaymentOptionsView.ID);\n this.hideToggle();\n }\n } else {\n classList.add(this.element, prefixShowClass(PaymentOptionsView.ID));\n }\n };\n\n MainView.prototype.showToggle = function () {\n if (this.model.isInEditMode()) {\n return;\n }\n\n classList.remove(this.toggle, 'braintree-hidden');\n classList.add(this.lowerContainer, 'braintree-hidden');\n };\n\n MainView.prototype.hideToggle = function () {\n classList.add(this.toggle, 'braintree-hidden');\n classList.remove(this.lowerContainer, 'braintree-hidden');\n };\n\n MainView.prototype.showSheetError = function (error) {\n var errorMessage;\n var genericErrorMessage = this.strings.genericError;\n\n if (this.strings.hasOwnProperty(error)) {\n errorMessage = this.strings[error];\n } else if (error && typeof error.code === 'string') {\n errorMessage = this.strings[snakeCaseToCamelCase(error.code) + 'Error'] || genericErrorMessage;\n } else if (error === 'developerError') {\n errorMessage = DEVELOPER_MISCONFIGURATION_MESSAGE;\n } else {\n errorMessage = genericErrorMessage;\n }\n\n classList.add(this.dropinContainer, 'braintree-sheet--has-error');\n this.sheetErrorText.innerHTML = errorMessage;\n };\n\n MainView.prototype.hideSheetError = function () {\n classList.remove(this.dropinContainer, 'braintree-sheet--has-error');\n };\n\n MainView.prototype.getOptionsElements = function () {\n return this._views.options.elements;\n };\n\n MainView.prototype.preventUserAction = function () {\n classList.remove(this.disableWrapper, 'braintree-hidden');\n };\n\n MainView.prototype.allowUserAction = function () {\n classList.add(this.disableWrapper, 'braintree-hidden');\n };\n\n MainView.prototype.teardown = function () {\n var error;\n var viewNames = Object.keys(this._views);\n var teardownPromises = viewNames.map(function (view) {\n return this._views[view].teardown().catch(function (err) {\n error = err;\n });\n }.bind(this));\n return Promise.all(teardownPromises).then(function () {\n if (error) {\n return Promise.reject(error);\n }\n\n return Promise.resolve();\n });\n };\n\n MainView.prototype.enableEditMode = function () {\n this.setPrimaryView(this.paymentMethodsViews.ID);\n this.paymentMethodsViews.enableEditMode();\n this.hideToggle();\n this.model.setPaymentMethodRequestable({\n isRequestable: false\n });\n };\n\n MainView.prototype.disableEditMode = function () {\n var paymentMethod;\n this.hideSheetError();\n this.paymentMethodsViews.disableEditMode();\n this.showToggle();\n paymentMethod = this.primaryView.getPaymentMethod();\n this.model.setPaymentMethodRequestable({\n isRequestable: Boolean(paymentMethod),\n type: paymentMethod && paymentMethod.type,\n selectedPaymentMethod: paymentMethod\n });\n };\n\n MainView.prototype.openConfirmPaymentMethodDeletionDialog = function (paymentMethod) {\n this.deleteConfirmationView.applyPaymentMethod(paymentMethod);\n this.setPrimaryView(this.deleteConfirmationView.ID);\n };\n\n MainView.prototype.cancelVaultedPaymentMethodDeletion = function () {\n this.setPrimaryView(this.paymentMethodsViews.ID);\n };\n\n MainView.prototype.startVaultedPaymentMethodDeletion = function () {\n this.element.className = '';\n this.showLoadingIndicator();\n };\n\n MainView.prototype.finishVaultedPaymentMethodDeletion = function (error) {\n var self = this;\n this.paymentMethodsViews.refreshPaymentMethods();\n\n if (error && this.model.getPaymentMethods().length > 0) {\n this.model.enableEditMode();\n this.showSheetError('vaultManagerPaymentMethodDeletionError');\n } else {\n this._sendToDefaultView();\n }\n\n return new Promise(function (resolve) {\n wait.delay(500).then(function () {\n // allow all the views to reset before hiding the loading indicator\n self.hideLoadingIndicator();\n resolve();\n });\n });\n };\n\n MainView.prototype._sendToDefaultView = function () {\n var paymentMethods = this.model.getPaymentMethods();\n var preselectVaultedPaymentMethod = this.model.merchantConfiguration.preselectVaultedPaymentMethod !== false;\n\n if (paymentMethods.length > 0) {\n if (preselectVaultedPaymentMethod) {\n analytics.sendEvent(this.client, 'vaulted-card.preselect');\n this.model.changeActivePaymentMethod(paymentMethods[0]);\n } else {\n this.setPrimaryView(this.paymentMethodsViews.ID);\n }\n } else if (this._hasMultiplePaymentOptions) {\n this.setPrimaryView(PaymentOptionsView.ID);\n } else {\n this.setPrimaryView(this.paymentSheetViewIDs[0]);\n }\n };\n\n function snakeCaseToCamelCase(s) {\n return s.toLowerCase().replace(/(\\_\\w)/g, function (m) {\n return m[1].toUpperCase();\n });\n }\n\n function prefixShowClass(classname) {\n return 'braintree-show-' + classname;\n }\n\n module.exports = MainView;\n }, {\n \"../constants\": 187,\n \"../lib/add-selection-event-handler\": 191,\n \"../lib/analytics\": 192,\n \"../lib/promise\": 204,\n \"../lib/supports-flexbox\": 206,\n \"../lib/wait\": 209,\n \"./base-view\": 245,\n \"./delete-confirmation-view\": 246,\n \"./payment-methods-view\": 249,\n \"./payment-options-view\": 250,\n \"./payment-sheet-views\": 255,\n \"@braintree/class-list\": 35\n }],\n 248: [function (require, module, exports) {\n 'use strict';\n\n var analytics = require('../lib/analytics');\n\n var BaseView = require('./base-view');\n\n var classList = require('@braintree/class-list');\n\n var constants = require('../constants');\n\n var addSelectionEventHandler = require('../lib/add-selection-event-handler');\n\n var paymentMethodHTML = \"
\\n\\n
\\n \\n
\\n\\n
\\n\\n
\\n\";\n\n function PaymentMethodView() {\n BaseView.apply(this, arguments);\n\n this._initialize();\n }\n\n PaymentMethodView.prototype = Object.create(BaseView.prototype);\n PaymentMethodView.prototype.constructor = PaymentMethodView;\n\n PaymentMethodView.prototype._initialize = function () {\n var endingInText;\n var html = paymentMethodHTML;\n var paymentMethodCardTypes = constants.paymentMethodCardTypes;\n var paymentMethodTypes = constants.paymentMethodTypes;\n this.element = document.createElement('div');\n this.element.className = 'braintree-method';\n this.element.setAttribute('tabindex', '0');\n addSelectionEventHandler(this.element, this._choosePaymentMethod.bind(this));\n\n switch (this.paymentMethod.type) {\n case paymentMethodTypes.applePay:\n html = html.replace(/@ICON/g, 'logoApplePay').replace(/@CLASSNAME/g, '').replace(/@TITLE/g, this.strings['Apple Pay']).replace(/@SUBTITLE/g, '');\n break;\n\n case paymentMethodTypes.card:\n endingInText = this.strings.endingIn.replace('{{lastFourCardDigits}}', this.paymentMethod.details.lastFour);\n html = html.replace(/@ICON/g, 'icon-' + paymentMethodCardTypes[this.paymentMethod.details.cardType]).replace(/@CLASSNAME/g, ' braintree-icon--bordered').replace(/@TITLE/g, endingInText).replace(/@SUBTITLE/g, this.strings[this.paymentMethod.details.cardType]);\n break;\n\n case paymentMethodTypes.googlePay:\n html = html.replace(/@ICON/g, 'logoGooglePay').replace(/@CLASSNAME/g, '').replace(/@TITLE/g, this.strings['Google Pay']).replace(/@SUBTITLE/g, '');\n break;\n\n case paymentMethodTypes.paypal:\n html = html.replace(/@ICON/g, 'logoPayPal').replace(/@CLASSNAME/g, '').replace(/@TITLE/g, this.paymentMethod.details.email).replace(/@SUBTITLE/g, this.strings.PayPal);\n break;\n\n case paymentMethodTypes.venmo:\n html = html.replace(/@ICON/g, 'logoVenmo').replace(/@CLASSNAME/g, '').replace(/@TITLE/g, this.paymentMethod.details.username).replace(/@SUBTITLE/g, this.strings.Venmo);\n break;\n\n default:\n break;\n }\n\n this.element.innerHTML = html;\n this.checkMark = this.element.querySelector('.braintree-method__check-container');\n addSelectionEventHandler(this.element.querySelector('.braintree-method__delete-container'), this._selectDelete.bind(this));\n };\n\n PaymentMethodView.prototype.setActive = function (isActive) {\n // setTimeout required to animate addition of new payment methods\n setTimeout(function () {\n classList.toggle(this.element, 'braintree-method--active', isActive);\n }.bind(this), 0);\n };\n\n PaymentMethodView.prototype.enableEditMode = function () {\n classList.add(this.checkMark, 'braintree-hidden');\n\n if (this.paymentMethod.hasSubscription) {\n classList.add(this.element, 'braintree-method--disabled');\n }\n };\n\n PaymentMethodView.prototype.disableEditMode = function () {\n classList.remove(this.checkMark, 'braintree-hidden');\n classList.remove(this.element, 'braintree-method--disabled');\n };\n\n PaymentMethodView.prototype._choosePaymentMethod = function () {\n if (this.model.isInEditMode()) {\n return;\n }\n\n if (this.paymentMethod.vaulted) {\n analytics.sendEvent(this.client, 'vaulted-' + constants.analyticsKinds[this.paymentMethod.type] + '.select');\n }\n\n this.model.changeActivePaymentMethod(this.paymentMethod);\n };\n\n PaymentMethodView.prototype._selectDelete = function () {\n this.model.confirmPaymentMethodDeletion(this.paymentMethod);\n };\n\n module.exports = PaymentMethodView;\n }, {\n \"../constants\": 187,\n \"../lib/add-selection-event-handler\": 191,\n \"../lib/analytics\": 192,\n \"./base-view\": 245,\n \"@braintree/class-list\": 35\n }],\n 249: [function (require, module, exports) {\n 'use strict';\n\n var BaseView = require('./base-view');\n\n var PaymentMethodView = require('./payment-method-view');\n\n var DropinError = require('../lib/dropin-error');\n\n var classList = require('@braintree/class-list');\n\n var errors = require('../constants').errors;\n\n var Promise = require('../lib/promise');\n\n var addSelectionEventHandler = require('../lib/add-selection-event-handler');\n\n var PAYMENT_METHOD_TYPE_TO_TRANSLATION_STRING = {\n CreditCard: 'Card',\n PayPalAccount: 'PayPal',\n ApplePayCard: 'Apple Pay',\n AndroidPayCard: 'Google Pay',\n VenmoAccount: 'Venmo'\n };\n\n function PaymentMethodsView() {\n BaseView.apply(this, arguments);\n\n this._initialize();\n }\n\n PaymentMethodsView.prototype = Object.create(BaseView.prototype);\n PaymentMethodsView.prototype.constructor = PaymentMethodsView;\n PaymentMethodsView.ID = PaymentMethodsView.prototype.ID = 'methods';\n\n PaymentMethodsView.prototype._initialize = function () {\n this.views = [];\n this.container = this.getElementById('methods-container');\n this._headingLabel = this.getElementById('methods-label');\n this._editButton = this.getElementById('methods-edit');\n this.model.on('addPaymentMethod', this._addPaymentMethod.bind(this));\n this.model.on('changeActivePaymentMethod', this._changeActivePaymentMethodView.bind(this));\n this.model.on('refreshPaymentMethods', this.refreshPaymentMethods.bind(this));\n this.refreshPaymentMethods();\n\n if (this.model.merchantConfiguration.vaultManager) {\n this.model.on('removePaymentMethod', this._removePaymentMethod.bind(this));\n addSelectionEventHandler(this._editButton, function () {\n if (this.model.isInEditMode()) {\n this.model.disableEditMode();\n } else {\n this.model.enableEditMode();\n }\n }.bind(this));\n classList.remove(this._editButton, 'braintree-hidden');\n }\n };\n\n PaymentMethodsView.prototype.removeActivePaymentMethod = function () {\n if (!this.activeMethodView) {\n return;\n }\n\n this.activeMethodView.setActive(false);\n this.activeMethodView = null;\n classList.add(this._headingLabel, 'braintree-no-payment-method-selected');\n };\n\n PaymentMethodsView.prototype._getPaymentMethodString = function () {\n var stringKey, paymentMethodTypeString;\n\n if (!this.activeMethodView) {\n return '';\n }\n\n stringKey = PAYMENT_METHOD_TYPE_TO_TRANSLATION_STRING[this.activeMethodView.paymentMethod.type];\n paymentMethodTypeString = this.strings[stringKey];\n return this.strings.payingWith.replace('{{paymentSource}}', paymentMethodTypeString);\n };\n\n PaymentMethodsView.prototype.enableEditMode = function () {\n classList.add(this.container, 'braintree-methods--edit');\n this._editButton.innerHTML = this.strings.deleteCancelButton;\n this._headingLabel.innerHTML = this.strings.editPaymentMethods;\n this.views.forEach(function (view) {\n view.enableEditMode();\n });\n };\n\n PaymentMethodsView.prototype.disableEditMode = function () {\n classList.remove(this.container, 'braintree-methods--edit');\n this._editButton.innerHTML = this.strings.edit;\n this._headingLabel.innerHTML = this._getPaymentMethodString();\n this.views.forEach(function (view) {\n view.disableEditMode();\n });\n };\n\n PaymentMethodsView.prototype._addPaymentMethod = function (paymentMethod) {\n var paymentMethodView = new PaymentMethodView({\n model: this.model,\n paymentMethod: paymentMethod,\n client: this.client,\n strings: this.strings\n });\n\n if (this.model.isGuestCheckout && this.container.firstChild) {\n this.container.removeChild(this.container.firstChild);\n this.views.pop();\n }\n\n if (this.container.firstChild) {\n this.container.insertBefore(paymentMethodView.element, this.container.firstChild);\n } else {\n this.container.appendChild(paymentMethodView.element);\n }\n\n this.views.push(paymentMethodView);\n };\n\n PaymentMethodsView.prototype._removePaymentMethod = function (paymentMethod) {\n var i;\n\n for (i = 0; i < this.views.length; i++) {\n if (this.views[i].paymentMethod === paymentMethod) {\n this.container.removeChild(this.views[i].element);\n this._headingLabel.innerHTML = ' ';\n this.views.splice(i, 1);\n break;\n }\n }\n };\n\n PaymentMethodsView.prototype._changeActivePaymentMethodView = function (paymentMethod) {\n var i;\n var previousActiveMethodView = this.activeMethodView;\n\n for (i = 0; i < this.views.length; i++) {\n if (this.views[i].paymentMethod === paymentMethod) {\n this.activeMethodView = this.views[i];\n this._headingLabel.innerHTML = this._getPaymentMethodString();\n break;\n }\n }\n\n if (previousActiveMethodView) {\n previousActiveMethodView.setActive(false);\n }\n\n this.activeMethodView.setActive(true);\n classList.remove(this._headingLabel, 'braintree-no-payment-method-selected');\n };\n\n PaymentMethodsView.prototype.requestPaymentMethod = function () {\n if (!this.activeMethodView || this.model.isInEditMode()) {\n return Promise.reject(new DropinError(errors.NO_PAYMENT_METHOD_ERROR));\n }\n\n return Promise.resolve(this.activeMethodView.paymentMethod);\n };\n\n PaymentMethodsView.prototype.refreshPaymentMethods = function () {\n var i;\n var paymentMethods = this.model.getPaymentMethods();\n this.views.forEach(function (view) {\n this.container.removeChild(view.element);\n }.bind(this));\n this.views = [];\n\n for (i = paymentMethods.length - 1; i >= 0; i--) {\n this._addPaymentMethod(paymentMethods[i]);\n }\n };\n\n module.exports = PaymentMethodsView;\n }, {\n \"../constants\": 187,\n \"../lib/add-selection-event-handler\": 191,\n \"../lib/dropin-error\": 197,\n \"../lib/promise\": 204,\n \"./base-view\": 245,\n \"./payment-method-view\": 248,\n \"@braintree/class-list\": 35\n }],\n 250: [function (require, module, exports) {\n 'use strict';\n\n var analytics = require('../lib/analytics');\n\n var addSelectionEventHandler = require('../lib/add-selection-event-handler');\n\n var BaseView = require('./base-view');\n\n var paymentOptionIDs = require('../constants').paymentOptionIDs;\n\n var paymentMethodOptionHTML = \"
\\n \\n
\\n\\n
\\n\";\n\n function PaymentOptionsView() {\n BaseView.apply(this, arguments);\n\n this._initialize();\n }\n\n PaymentOptionsView.prototype = Object.create(BaseView.prototype);\n PaymentOptionsView.prototype.constructor = PaymentOptionsView;\n PaymentOptionsView.ID = PaymentOptionsView.prototype.ID = 'options';\n\n PaymentOptionsView.prototype._initialize = function () {\n this.container = this.getElementById('payment-options-container');\n this.elements = {};\n this.model.supportedPaymentOptions.forEach(function (paymentOptionID) {\n this._addPaymentOption(paymentOptionID);\n }.bind(this));\n };\n\n PaymentOptionsView.prototype._addPaymentOption = function (paymentOptionID) {\n var paymentSource;\n var div = document.createElement('div');\n var html = paymentMethodOptionHTML;\n\n var clickHandler = function clickHandler() {\n this.mainView.setPrimaryView(paymentOptionID);\n this.model.selectPaymentOption(paymentOptionID);\n analytics.sendEvent(this.client, 'selected.' + paymentOptionIDs[paymentOptionID]);\n }.bind(this);\n\n div.className = 'braintree-option braintree-option__' + paymentOptionID;\n div.setAttribute('tabindex', '0');\n\n switch (paymentOptionID) {\n case paymentOptionIDs.applePay:\n paymentSource = this.strings['Apple Pay'];\n html = html.replace(/@ICON/g, 'logoApplePay');\n break;\n\n case paymentOptionIDs.card:\n paymentSource = this.strings.Card;\n html = html.replace(/@ICON/g, 'iconCardFront');\n html = html.replace(/@CLASSNAME/g, 'braintree-icon--bordered');\n break;\n\n case paymentOptionIDs.googlePay:\n paymentSource = this.strings['Google Pay'];\n html = html.replace(/@ICON/g, 'logoGooglePay');\n break;\n\n case paymentOptionIDs.paypal:\n paymentSource = this.strings.PayPal;\n html = html.replace(/@ICON/g, 'logoPayPal');\n break;\n\n case paymentOptionIDs.paypalCredit:\n paymentSource = this.strings['PayPal Credit'];\n html = html.replace(/@ICON/g, 'logoPayPalCredit');\n break;\n\n case paymentOptionIDs.venmo:\n paymentSource = this.strings.Venmo;\n html = html.replace(/@ICON/g, 'logoVenmo');\n break;\n\n default:\n break;\n }\n\n html = html.replace(/@OPTION_LABEL/g, this._generateOptionLabel(paymentSource));\n html = html.replace(/@OPTION_TITLE/g, paymentSource);\n html = html.replace(/@CLASSNAME/g, '');\n div.innerHTML = html;\n addSelectionEventHandler(div, clickHandler);\n this.container.appendChild(div);\n this.elements[paymentOptionID] = {\n div: div,\n clickHandler: clickHandler\n };\n };\n\n PaymentOptionsView.prototype._generateOptionLabel = function (paymentSourceString) {\n return this.strings.payingWith.replace('{{paymentSource}}', paymentSourceString);\n };\n\n module.exports = PaymentOptionsView;\n }, {\n \"../constants\": 187,\n \"../lib/add-selection-event-handler\": 191,\n \"../lib/analytics\": 192,\n \"./base-view\": 245\n }],\n 251: [function (require, module, exports) {\n (function (global) {\n (function () {\n 'use strict';\n\n var assign = require('../../lib/assign').assign;\n\n var BaseView = require('../base-view');\n\n var btApplePay = require('braintree-web/apple-pay');\n\n var DropinError = require('../../lib/dropin-error');\n\n var isHTTPS = require('../../lib/is-https');\n\n var Promise = require('../../lib/promise');\n\n var paymentOptionIDs = require('../../constants').paymentOptionIDs;\n\n var DEFAULT_APPLE_PAY_SESSION_VERSION = 2;\n\n function ApplePayView() {\n BaseView.apply(this, arguments);\n }\n\n ApplePayView.prototype = Object.create(BaseView.prototype);\n ApplePayView.prototype.constructor = ApplePayView;\n ApplePayView.ID = ApplePayView.prototype.ID = paymentOptionIDs.applePay;\n\n ApplePayView.prototype.initialize = function () {\n var self = this;\n self.applePayConfiguration = assign({}, self.model.merchantConfiguration.applePay);\n self.applePaySessionVersion = self.applePayConfiguration.applePaySessionVersion || DEFAULT_APPLE_PAY_SESSION_VERSION;\n delete self.applePayConfiguration.applePaySessionVersion;\n return btApplePay.create({\n client: this.client\n }).then(function (applePayInstance) {\n var buttonDiv = self.getElementById('apple-pay-button');\n self.applePayInstance = applePayInstance;\n buttonDiv.onclick = self._showPaymentSheet.bind(self);\n buttonDiv.style['-apple-pay-button-style'] = self.model.merchantConfiguration.applePay.buttonStyle || 'black';\n self.model.asyncDependencyReady(ApplePayView.ID);\n }).catch(function (err) {\n self.model.asyncDependencyFailed({\n view: self.ID,\n error: new DropinError(err)\n });\n });\n };\n\n ApplePayView.prototype._showPaymentSheet = function () {\n var self = this;\n var request = self.applePayInstance.createPaymentRequest(this.applePayConfiguration.paymentRequest);\n var session = new global.ApplePaySession(self.applePaySessionVersion, request);\n\n session.onvalidatemerchant = function (event) {\n self.applePayInstance.performValidation({\n validationURL: event.validationURL,\n displayName: self.applePayConfiguration.displayName\n }).then(function (validationData) {\n session.completeMerchantValidation(validationData);\n }).catch(function (validationErr) {\n self.model.reportError(validationErr);\n session.abort();\n });\n };\n\n session.onpaymentauthorized = function (event) {\n self.applePayInstance.tokenize({\n token: event.payment.token\n }).then(function (payload) {\n session.completePayment(global.ApplePaySession.STATUS_SUCCESS);\n payload.rawPaymentData = event.payment;\n self.model.addPaymentMethod(payload);\n }).catch(function (tokenizeErr) {\n self.model.reportError(tokenizeErr);\n session.completePayment(global.ApplePaySession.STATUS_FAILURE);\n });\n };\n\n session.begin();\n return false;\n };\n\n ApplePayView.prototype.updateConfiguration = function (key, value) {\n this.applePayConfiguration[key] = value;\n };\n\n ApplePayView.isEnabled = function (options) {\n var gatewayConfiguration = options.client.getConfiguration().gatewayConfiguration;\n var applePayEnabled = gatewayConfiguration.applePayWeb && Boolean(options.merchantConfiguration.applePay);\n var applePaySessionVersion = options.merchantConfiguration.applePay && options.merchantConfiguration.applePay.applePaySessionVersion;\n var applePayBrowserSupported;\n applePaySessionVersion = applePaySessionVersion || DEFAULT_APPLE_PAY_SESSION_VERSION;\n\n if (!applePayEnabled) {\n return Promise.resolve(false);\n }\n\n applePayBrowserSupported = global.ApplePaySession && isHTTPS.isHTTPS();\n\n if (!applePayBrowserSupported) {\n return Promise.resolve(false);\n }\n\n if (!global.ApplePaySession.supportsVersion(applePaySessionVersion)) {\n return Promise.resolve(false);\n }\n\n return Promise.resolve(Boolean(global.ApplePaySession.canMakePayments()));\n };\n\n module.exports = ApplePayView;\n }).call(this);\n }).call(this, typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n }, {\n \"../../constants\": 187,\n \"../../lib/assign\": 193,\n \"../../lib/dropin-error\": 197,\n \"../../lib/is-https\": 200,\n \"../../lib/promise\": 204,\n \"../base-view\": 245,\n \"braintree-web/apple-pay\": 49\n }],\n 252: [function (require, module, exports) {\n (function (global) {\n (function () {\n 'use strict';\n\n var analytics = require('../../lib/analytics');\n\n var assign = require('../../lib/assign').assign;\n\n var browserDetection = require('../../lib/browser-detection');\n\n var BaseView = require('../base-view');\n\n var btPaypal = require('braintree-web/paypal-checkout');\n\n var DropinError = require('../../lib/dropin-error');\n\n var constants = require('../../constants');\n\n var assets = require('@braintree/asset-loader');\n\n var translations = require('../../translations').fiveCharacterLocales;\n\n var Promise = require('../../lib/promise');\n\n var ASYNC_DEPENDENCY_TIMEOUT = 30000;\n var READ_ONLY_CONFIGURATION_OPTIONS = ['offerCredit', 'locale'];\n var DEFAULT_CHECKOUTJS_LOG_LEVEL = 'warn';\n var paypalScriptLoadInProgressPromise;\n\n function BasePayPalView() {\n BaseView.apply(this, arguments);\n }\n\n BasePayPalView.prototype = Object.create(BaseView.prototype);\n\n BasePayPalView.prototype.initialize = function () {\n var asyncDependencyTimeoutHandler;\n var isCredit = Boolean(this._isPayPalCredit);\n var setupComplete = false;\n var self = this;\n var paypalType = isCredit ? 'paypalCredit' : 'paypal';\n var paypalConfiguration = this.model.merchantConfiguration[paypalType];\n var dropinWrapperId = '#braintree--dropin__' + this.model.componentID;\n this.paypalConfiguration = assign({}, paypalConfiguration);\n asyncDependencyTimeoutHandler = setTimeout(function () {\n self.model.asyncDependencyFailed({\n view: self.ID,\n error: new DropinError('There was an error connecting to PayPal.')\n });\n }, ASYNC_DEPENDENCY_TIMEOUT);\n return btPaypal.create({\n client: this.client\n }).then(function (paypalInstance) {\n var checkoutJSConfiguration;\n var buttonSelector = '[data-braintree-id=\"paypal-button\"]';\n var environment = self.client.getConfiguration().gatewayConfiguration.environment === 'production' ? 'production' : 'sandbox';\n var locale = self.model.merchantConfiguration.locale;\n self.paypalInstance = paypalInstance;\n self.paypalConfiguration.offerCredit = Boolean(isCredit);\n checkoutJSConfiguration = {\n env: environment,\n style: self.paypalConfiguration.buttonStyle || {},\n commit: self.paypalConfiguration.commit,\n payment: function payment() {\n return paypalInstance.createPayment(self.paypalConfiguration).catch(reportError);\n },\n onAuthorize: function onAuthorize(data) {\n return paypalInstance.tokenizePayment(data).then(function (tokenizePayload) {\n if (self.paypalConfiguration.flow === 'vault' && !self.model.isGuestCheckout) {\n tokenizePayload.vaulted = true;\n }\n\n self.model.addPaymentMethod(tokenizePayload);\n }).catch(reportError);\n },\n onError: reportError\n };\n\n if (locale && locale in translations) {\n self.paypalConfiguration.locale = locale;\n checkoutJSConfiguration.locale = locale;\n }\n\n checkoutJSConfiguration.funding = {\n disallowed: []\n };\n Object.keys(global.paypal.FUNDING).forEach(function (key) {\n if (key === 'PAYPAL' || key === 'CREDIT') {\n return;\n }\n\n checkoutJSConfiguration.funding.disallowed.push(global.paypal.FUNDING[key]);\n });\n\n if (isCredit) {\n buttonSelector = '[data-braintree-id=\"paypal-credit-button\"]';\n checkoutJSConfiguration.style.label = 'credit';\n } else {\n checkoutJSConfiguration.funding.disallowed.push(global.paypal.FUNDING.CREDIT);\n }\n\n buttonSelector = dropinWrapperId + ' ' + buttonSelector;\n return global.paypal.Button.render(checkoutJSConfiguration, buttonSelector).then(function () {\n self.model.asyncDependencyReady(paypalType);\n setupComplete = true;\n clearTimeout(asyncDependencyTimeoutHandler);\n });\n }).catch(reportError);\n\n function reportError(err) {\n if (setupComplete) {\n self.model.reportError(err);\n } else {\n self.model.asyncDependencyFailed({\n view: self.ID,\n error: err\n });\n clearTimeout(asyncDependencyTimeoutHandler);\n }\n }\n };\n\n BasePayPalView.prototype.requestPaymentMethod = function () {\n this.model.reportError('paypalButtonMustBeUsed');\n return BaseView.prototype.requestPaymentMethod.call(this);\n };\n\n BasePayPalView.prototype.updateConfiguration = function (key, value) {\n if (READ_ONLY_CONFIGURATION_OPTIONS.indexOf(key) === -1) {\n this.paypalConfiguration[key] = value;\n }\n };\n\n BasePayPalView.isEnabled = function (options) {\n var gatewayConfiguration = options.client.getConfiguration().gatewayConfiguration;\n var merchantPayPalConfig = options.merchantConfiguration.paypal || options.merchantConfiguration.paypalCredit;\n\n if (!gatewayConfiguration.paypalEnabled) {\n return Promise.resolve(false);\n }\n\n if (browserDetection.isIe9() || browserDetection.isIe10()) {\n analytics.sendEvent(options.client, options.viewID + '.checkout.js-browser-not-supported');\n return Promise.resolve(false);\n }\n\n if (global.paypal && global.paypal.Button) {\n return Promise.resolve(true);\n }\n\n if (paypalScriptLoadInProgressPromise) {\n return paypalScriptLoadInProgressPromise;\n }\n\n paypalScriptLoadInProgressPromise = assets.loadScript({\n src: constants.CHECKOUT_JS_SOURCE,\n id: constants.PAYPAL_CHECKOUT_SCRIPT_ID,\n dataAttributes: {\n 'log-level': merchantPayPalConfig.logLevel || DEFAULT_CHECKOUTJS_LOG_LEVEL\n }\n }).then(function () {\n return Promise.resolve(true);\n }).catch(function () {\n return Promise.resolve(false);\n }).then(function (result) {\n paypalScriptLoadInProgressPromise = null;\n return Promise.resolve(result);\n });\n return paypalScriptLoadInProgressPromise;\n };\n\n module.exports = BasePayPalView;\n }).call(this);\n }).call(this, typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n }, {\n \"../../constants\": 187,\n \"../../lib/analytics\": 192,\n \"../../lib/assign\": 193,\n \"../../lib/browser-detection\": 194,\n \"../../lib/dropin-error\": 197,\n \"../../lib/promise\": 204,\n \"../../translations\": 228,\n \"../base-view\": 245,\n \"@braintree/asset-loader\": 1,\n \"braintree-web/paypal-checkout\": 132\n }],\n 253: [function (require, module, exports) {\n 'use strict';\n\n var assign = require('../../lib/assign').assign;\n\n var BaseView = require('../base-view');\n\n var classList = require('@braintree/class-list');\n\n var constants = require('../../constants');\n\n var DropinError = require('../../lib/dropin-error');\n\n var hostedFields = require('braintree-web/hosted-fields');\n\n var isUtf8 = require('../../lib/is-utf-8');\n\n var transitionHelper = require('../../lib/transition-helper');\n\n var Promise = require('../../lib/promise');\n\n var cardIconHTML = \"
\\n \\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n \\n
\\n\\n
\\n \\n
\\n
\\n \\n
\\n
\\n \\n
\\n\";\n var PASSTHROUGH_EVENTS = ['empty', // TODO should intercept this event and call tokenize\n 'inputSubmitRequest', 'binAvailable'];\n\n function CardView() {\n BaseView.apply(this, arguments);\n }\n\n CardView.prototype = Object.create(BaseView.prototype);\n CardView.prototype.constructor = CardView;\n CardView.ID = CardView.prototype.ID = constants.paymentOptionIDs.card;\n\n CardView.prototype.initialize = function () {\n var cvvFieldGroup, postalCodeFieldGroup, hfOptions;\n var cardholderNameGroup = this.getElementById('cardholder-name-field-group');\n var cardIcons = this.getElementById('card-view-icons');\n this.merchantConfiguration = this.model.merchantConfiguration.card || {};\n this.merchantConfiguration.vault = this.merchantConfiguration.vault || {};\n this.hasCardholderName = Boolean(this.merchantConfiguration.cardholderName);\n this.cardholderNameRequired = this.hasCardholderName && this.merchantConfiguration.cardholderName.required === true;\n hfOptions = this._generateHostedFieldsOptions();\n cardIcons.innerHTML = cardIconHTML;\n\n this._hideUnsupportedCardIcons();\n\n this.hasCVV = hfOptions.fields.cvv;\n this.saveCardInput = this.getElementById('save-card-input');\n this.cardNumberIcon = this.getElementById('card-number-icon');\n this.cardNumberIconSvg = this.getElementById('card-number-icon-svg');\n this.cvvIcon = this.getElementById('cvv-icon');\n this.cvvIconSvg = this.getElementById('cvv-icon-svg');\n this.cvvLabelDescriptor = this.getElementById('cvv-label-descriptor');\n this.fieldErrors = {};\n\n if (!this.hasCardholderName) {\n cardholderNameGroup.parentNode.removeChild(cardholderNameGroup);\n }\n\n if (!this.hasCVV) {\n cvvFieldGroup = this.getElementById('cvv-field-group');\n cvvFieldGroup.parentNode.removeChild(cvvFieldGroup);\n }\n\n if (!hfOptions.fields.postalCode) {\n postalCodeFieldGroup = this.getElementById('postal-code-field-group');\n postalCodeFieldGroup.parentNode.removeChild(postalCodeFieldGroup);\n }\n\n if (!this.model.isGuestCheckout && this.merchantConfiguration.vault.allowVaultCardOverride === true) {\n classList.remove(this.getElementById('save-card-field-group'), 'braintree-hidden');\n }\n\n if (this.merchantConfiguration.vault.vaultCard === false) {\n this.saveCardInput.checked = false;\n }\n\n return hostedFields.create(hfOptions).then(function (hostedFieldsInstance) {\n this.hostedFieldsInstance = hostedFieldsInstance;\n this.hostedFieldsInstance.on('blur', this._onBlurEvent.bind(this));\n this.hostedFieldsInstance.on('cardTypeChange', this._onCardTypeChangeEvent.bind(this));\n this.hostedFieldsInstance.on('focus', this._onFocusEvent.bind(this));\n this.hostedFieldsInstance.on('notEmpty', this._onNotEmptyEvent.bind(this));\n this.hostedFieldsInstance.on('validityChange', this._onValidityChangeEvent.bind(this));\n PASSTHROUGH_EVENTS.forEach(function (eventName) {\n this.hostedFieldsInstance.on(eventName, function (event) {\n this.model._emit('card:' + eventName, event);\n }.bind(this));\n }.bind(this));\n this.model.asyncDependencyReady(CardView.ID);\n }.bind(this)).catch(function (err) {\n this.model.asyncDependencyFailed({\n view: this.ID,\n error: err\n });\n }.bind(this));\n };\n\n CardView.prototype._sendRequestableEvent = function () {\n if (!this._isTokenizing) {\n this.model.setPaymentMethodRequestable({\n isRequestable: this._validateForm(),\n type: constants.paymentMethodTypes.card\n });\n }\n };\n\n CardView.prototype._generateHostedFieldsOptions = function () {\n var challenges = this.client.getConfiguration().gatewayConfiguration.challenges;\n var hasCVVChallenge = challenges.indexOf('cvv') !== -1;\n var hasPostalCodeChallenge = challenges.indexOf('postal_code') !== -1;\n var overrides = this.merchantConfiguration.overrides;\n var options = {\n client: this.client,\n fields: {\n cardholderName: {\n container: this._getFieldContainer('cardholder-name'),\n placeholder: this.strings.cardholderNamePlaceholder\n },\n number: {\n container: this._getFieldContainer('number'),\n placeholder: generateCardNumberPlaceholder()\n },\n expirationDate: {\n container: this._getFieldContainer('expiration'),\n placeholder: this.strings.expirationDatePlaceholder\n },\n cvv: {\n container: this._getFieldContainer('cvv'),\n placeholder: addBullets(3)\n },\n postalCode: {\n container: this._getFieldContainer('postal-code')\n }\n },\n styles: {\n input: {\n 'font-size': '16px',\n 'font-family': '-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif',\n color: '#000'\n },\n ':focus': {\n color: 'black'\n },\n '::-webkit-input-placeholder': {\n color: '#6a6a6a'\n },\n ':-moz-placeholder': {\n color: '#6a6a6a'\n },\n '::-moz-placeholder': {\n color: '#6a6a6a'\n },\n ':-ms-input-placeholder ': {\n color: '#6a6a6a'\n },\n 'input::-ms-clear': {\n color: 'transparent'\n }\n }\n };\n\n if (!this.hasCardholderName) {\n delete options.fields.cardholderName;\n }\n\n if (!hasCVVChallenge) {\n delete options.fields.cvv;\n }\n\n if (!hasPostalCodeChallenge) {\n delete options.fields.postalCode;\n }\n\n if (!overrides) {\n return options;\n }\n\n if (overrides.fields) {\n if (overrides.fields.cvv && typeof overrides.fields.cvv.placeholder !== 'undefined') {\n this._hasCustomCVVPlaceholder = true;\n }\n\n Object.keys(overrides.fields).forEach(function (field) {\n if ((field === 'cvv' || field === 'postalCode') && overrides.fields[field] === null) {\n delete options.fields[field];\n return;\n }\n\n if (!options.fields[field]) {\n return;\n }\n\n assign(options.fields[field], overrides.fields[field], {\n selector: options.fields[field].selector\n });\n });\n }\n\n if (overrides.styles) {\n Object.keys(overrides.styles).forEach(function (style) {\n if (overrides.styles[style] === null) {\n delete options.styles[style];\n return;\n } else if (typeof overrides.styles[style] === 'string') {\n // it's a class name, and should override the configured styles entirely\n options.styles[style] = overrides.styles[style];\n return;\n }\n\n normalizeStyles(overrides.styles[style]);\n options.styles[style] = options.styles[style] || {};\n assign(options.styles[style], overrides.styles[style]);\n });\n }\n\n return options;\n };\n\n CardView.prototype._validateForm = function (showFieldErrors) {\n var card, cardType, cardTypeSupported, state;\n var isValid = true;\n var supportedCardTypes = this.client.getConfiguration().gatewayConfiguration.creditCards.supportedCardTypes;\n\n if (!this.hostedFieldsInstance) {\n return false;\n }\n\n state = this.hostedFieldsInstance.getState();\n Object.keys(state.fields).forEach(function (key) {\n var field = state.fields[key];\n\n if (!showFieldErrors && !isValid) {\n // return early if form is already invalid\n // and we don't need to display all field errors\n return;\n }\n\n if (field.isEmpty) {\n if (!this.cardholderNameRequired && key === 'cardholderName') {\n isValid = true;\n } else {\n isValid = false;\n\n if (showFieldErrors) {\n this.showFieldError(key, this.strings['fieldEmptyFor' + capitalize(key)]);\n }\n }\n } else if (!field.isValid) {\n isValid = false;\n\n if (showFieldErrors) {\n this.showFieldError(key, this.strings['fieldInvalidFor' + capitalize(key)]);\n }\n }\n }.bind(this));\n\n if (state.fields.number.isValid) {\n card = state.cards[0];\n cardType = card && constants.configurationCardTypes[card.type];\n cardTypeSupported = cardType && supportedCardTypes.indexOf(cardType) !== -1;\n\n if (!cardTypeSupported) {\n isValid = false;\n\n if (showFieldErrors) {\n this.showFieldError('number', this.strings.unsupportedCardTypeError);\n }\n }\n }\n\n return isValid;\n };\n\n CardView.prototype.getPaymentMethod = function () {\n // eslint-disable-line consistent-return\n var formIsValid = this._validateForm();\n\n if (formIsValid) {\n return {\n type: constants.paymentMethodTypes.card\n };\n }\n };\n\n CardView.prototype.tokenize = function () {\n var transitionCallback;\n var self = this;\n var state = self.hostedFieldsInstance.getState();\n var tokenizeOptions = {\n vault: this._shouldVault()\n };\n this.model.clearError();\n\n if (!this._validateForm(true)) {\n self.model.reportError('hostedFieldsFieldsInvalidError');\n self.allowUserAction();\n return Promise.reject(new DropinError(constants.errors.NO_PAYMENT_METHOD_ERROR));\n }\n\n if (!this.cardholderNameRequired && state.fields.cardholderName && state.fields.cardholderName.isEmpty) {\n tokenizeOptions.fieldsToTokenize = Object.keys(state.fields).filter(function (field) {\n return field !== 'cardholderName';\n });\n }\n\n self._isTokenizing = true;\n return self.hostedFieldsInstance.tokenize(tokenizeOptions).then(function (payload) {\n var retainCardFields = self.merchantConfiguration.clearFieldsAfterTokenization === false;\n\n if (!retainCardFields) {\n Object.keys(state.fields).forEach(function (field) {\n self.hostedFieldsInstance.clear(field);\n });\n }\n\n if (self._shouldVault()) {\n payload.vaulted = true;\n }\n\n return new Promise(function (resolve) {\n transitionCallback = function transitionCallback() {\n // Wait for braintree-sheet--tokenized class to be added in IE 9\n // before attempting to remove it\n setTimeout(function () {\n self.model.addPaymentMethod(payload);\n resolve(payload);\n classList.remove(self.element, 'braintree-sheet--tokenized');\n }, 0);\n };\n\n transitionHelper.onTransitionEnd(self.element, 'max-height', transitionCallback);\n setTimeout(function () {\n self.allowUserAction();\n self._isTokenizing = false;\n }, constants.CHANGE_ACTIVE_PAYMENT_METHOD_TIMEOUT);\n classList.add(self.element, 'braintree-sheet--tokenized');\n });\n }).catch(function (err) {\n self._isTokenizing = false; // this is a little magical, but if the code property exists\n // in the translations with the word Error appended to the end,\n // then reportError will automatically print that translation.\n // See https://github.com/braintree/braintree-web-drop-in/blob/6ecba73f2f16e8b7ae2119702ac162a1a985908e/src/views/main-view.js#L255-L256\n\n self.model.reportError(err);\n self.allowUserAction();\n return Promise.reject(new DropinError({\n message: constants.errors.NO_PAYMENT_METHOD_ERROR,\n braintreeWebError: err\n }));\n });\n };\n\n CardView.prototype.showFieldError = function (field, errorMessage) {\n var fieldError;\n var fieldGroup = this.getElementById(camelCaseToKebabCase(field) + '-field-group');\n var input = fieldGroup.querySelector('input');\n\n if (!this.fieldErrors.hasOwnProperty(field)) {\n this.fieldErrors[field] = this.getElementById(camelCaseToKebabCase(field) + '-field-error');\n }\n\n classList.add(fieldGroup, 'braintree-form__field-group--has-error');\n fieldError = this.fieldErrors[field];\n fieldError.innerHTML = errorMessage;\n\n if (input) {\n input.setAttribute('aria-invalid', true);\n } else {\n this.hostedFieldsInstance.setAttribute({\n field: field,\n attribute: 'aria-invalid',\n value: true\n });\n this.hostedFieldsInstance.setMessage({\n field: field,\n message: errorMessage\n });\n }\n };\n\n CardView.prototype.hideFieldError = function (field) {\n var fieldGroup = this.getElementById(camelCaseToKebabCase(field) + '-field-group');\n var input = fieldGroup.querySelector('input');\n\n if (!this.fieldErrors.hasOwnProperty(field)) {\n this.fieldErrors[field] = this.getElementById(camelCaseToKebabCase(field) + '-field-error');\n }\n\n classList.remove(fieldGroup, 'braintree-form__field-group--has-error');\n\n if (input) {\n input.removeAttribute('aria-invalid');\n } else {\n this.hostedFieldsInstance.removeAttribute({\n field: field,\n attribute: 'aria-invalid'\n });\n this.hostedFieldsInstance.setMessage({\n field: field,\n message: ''\n });\n }\n };\n\n CardView.prototype.teardown = function () {\n return this.hostedFieldsInstance.teardown();\n };\n\n CardView.prototype._shouldVault = function () {\n return !this.model.isGuestCheckout && this.saveCardInput.checked;\n };\n\n CardView.prototype._getFieldContainer = function (field) {\n // we committed to not changing the data-braintree-id fields\n // so we need to convert this field to the id used in the HTML\n if (field === 'expiration') {\n field = 'expiration-date';\n }\n\n return this.getElementById(field + '-field-group').querySelector('.braintree-form__hosted-field');\n };\n\n CardView.prototype._onBlurEvent = function (event) {\n var field = event.fields[event.emittedBy];\n var fieldGroup = this.getElementById(camelCaseToKebabCase(event.emittedBy) + '-field-group');\n classList.remove(fieldGroup, 'braintree-form__field-group--is-focused');\n\n if (this._shouldApplyFieldEmptyError(event.emittedBy, field)) {\n this.showFieldError(event.emittedBy, this.strings['fieldEmptyFor' + capitalize(event.emittedBy)]);\n } else if (!field.isEmpty && !field.isValid) {\n this.showFieldError(event.emittedBy, this.strings['fieldInvalidFor' + capitalize(event.emittedBy)]);\n } else if (event.emittedBy === 'number' && !this._isCardTypeSupported(event.cards[0].type)) {\n this.showFieldError('number', this.strings.unsupportedCardTypeError);\n }\n\n this.model._emit('card:blur', event);\n\n setTimeout(function () {\n // when focusing on a field by clicking the label,\n // we need to wait a bit for the iframe to be\n // focused properly before applying validations\n if (this._shouldApplyFieldEmptyError(event.emittedBy, field)) {\n this.showFieldError(event.emittedBy, this.strings['fieldEmptyFor' + capitalize(event.emittedBy)]);\n }\n }.bind(this), 150);\n };\n\n CardView.prototype._onCardTypeChangeEvent = function (event) {\n var cardType;\n var cardNumberHrefLink = '#iconCardFront';\n var cvvHrefLink = '#iconCVVBack';\n var cvvDescriptor = this.strings.cvvThreeDigitLabelSubheading;\n var cvvPlaceholder = addBullets(3);\n var numberFieldGroup = this.getElementById('number-field-group');\n\n if (event.cards.length === 1) {\n cardType = event.cards[0].type;\n cardNumberHrefLink = '#icon-' + cardType;\n\n if (cardType === 'american-express') {\n cvvHrefLink = '#iconCVVFront';\n cvvDescriptor = this.strings.cvvFourDigitLabelSubheading;\n cvvPlaceholder = addBullets(4);\n } // Keep icon visible when field is not focused\n\n\n classList.add(numberFieldGroup, 'braintree-form__field-group--card-type-known');\n } else {\n classList.remove(numberFieldGroup, 'braintree-form__field-group--card-type-known');\n }\n\n this.cardNumberIconSvg.setAttribute('xlink:href', cardNumberHrefLink);\n\n if (this.hasCVV) {\n this.cvvIconSvg.setAttribute('xlink:href', cvvHrefLink);\n this.cvvLabelDescriptor.innerHTML = cvvDescriptor;\n\n if (!this._hasCustomCVVPlaceholder) {\n this.hostedFieldsInstance.setAttribute({\n field: 'cvv',\n attribute: 'placeholder',\n value: cvvPlaceholder\n });\n }\n }\n\n this.model._emit('card:cardTypeChange', event);\n };\n\n CardView.prototype._onFocusEvent = function (event) {\n var fieldGroup = this.getElementById(camelCaseToKebabCase(event.emittedBy) + '-field-group');\n classList.add(fieldGroup, 'braintree-form__field-group--is-focused');\n\n this.model._emit('card:focus', event);\n };\n\n CardView.prototype._onNotEmptyEvent = function (event) {\n this.hideFieldError(event.emittedBy);\n\n this.model._emit('card:notEmpty', event);\n };\n\n CardView.prototype._onValidityChangeEvent = function (event) {\n var isValid;\n var field = event.fields[event.emittedBy];\n\n if (event.emittedBy === 'number' && event.cards[0]) {\n isValid = field.isValid && this._isCardTypeSupported(event.cards[0].type);\n } else {\n isValid = field.isValid;\n }\n\n classList.toggle(field.container, 'braintree-form__field--valid', isValid);\n\n if (field.isPotentiallyValid) {\n this.hideFieldError(event.emittedBy);\n }\n\n this._sendRequestableEvent();\n\n this.model._emit('card:validityChange', event);\n };\n\n CardView.prototype.requestPaymentMethod = function () {\n this.preventUserAction();\n return this.tokenize();\n };\n\n CardView.prototype.onSelection = function () {\n if (!this.hostedFieldsInstance) {\n return;\n }\n\n setTimeout(function () {\n if (this.hasCardholderName) {\n this.hostedFieldsInstance.focus('cardholderName');\n } else {\n this.hostedFieldsInstance.focus('number');\n }\n }.bind(this), 50);\n };\n\n CardView.prototype._hideUnsupportedCardIcons = function () {\n var supportedCardTypes = this.client.getConfiguration().gatewayConfiguration.creditCards.supportedCardTypes;\n Object.keys(constants.configurationCardTypes).forEach(function (paymentMethodCardType) {\n var cardIcon;\n var configurationCardType = constants.configurationCardTypes[paymentMethodCardType];\n\n if (supportedCardTypes.indexOf(configurationCardType) === -1) {\n cardIcon = this.getElementById(paymentMethodCardType + '-card-icon');\n classList.add(cardIcon, 'braintree-hidden');\n }\n }.bind(this));\n };\n\n CardView.prototype._isCardTypeSupported = function (cardType) {\n var configurationCardType = constants.configurationCardTypes[cardType];\n var supportedCardTypes = this.client.getConfiguration().gatewayConfiguration.creditCards.supportedCardTypes;\n return supportedCardTypes.indexOf(configurationCardType) !== -1;\n };\n\n CardView.isEnabled = function (options) {\n var gatewayConfiguration = options.client.getConfiguration().gatewayConfiguration;\n var disabledByMerchant = options.merchantConfiguration.card === false;\n return Promise.resolve(!disabledByMerchant && gatewayConfiguration.creditCards.supportedCardTypes.length > 0);\n };\n\n CardView.prototype._shouldApplyFieldEmptyError = function (fieldId, field) {\n if (!field.isEmpty) {\n return false;\n }\n\n if (fieldId === 'cardholderName' && !this.cardholderNameRequired) {\n return false;\n }\n\n return isCardViewElement();\n };\n\n function isCardViewElement() {\n var activeId = document.activeElement && document.activeElement.id;\n var isHostedFieldsElement = document.activeElement instanceof HTMLIFrameElement && activeId.indexOf('braintree-hosted-field') !== -1;\n return isHostedFieldsElement;\n }\n\n function camelCaseToKebabCase(string) {\n return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }\n\n function capitalize(string) {\n return string[0].toUpperCase() + string.substr(1);\n }\n\n function normalizeStyles(styles) {\n Object.keys(styles).forEach(function (style) {\n var transformedKeyName = camelCaseToKebabCase(style);\n styles[transformedKeyName] = styles[style];\n });\n }\n\n function addBullets(number) {\n var bulletCharacter = isUtf8() ? '•' : '*';\n return Array(number + 1).join(bulletCharacter);\n }\n\n function generateCardNumberPlaceholder() {\n var four = addBullets(4);\n return [four, four, four, four].join(' ');\n }\n\n module.exports = CardView;\n }, {\n \"../../constants\": 187,\n \"../../lib/assign\": 193,\n \"../../lib/dropin-error\": 197,\n \"../../lib/is-utf-8\": 201,\n \"../../lib/promise\": 204,\n \"../../lib/transition-helper\": 208,\n \"../base-view\": 245,\n \"@braintree/class-list\": 35,\n \"braintree-web/hosted-fields\": 81\n }],\n 254: [function (require, module, exports) {\n (function (global) {\n (function () {\n 'use strict';\n\n var assign = require('../../lib/assign').assign;\n\n var BaseView = require('../base-view');\n\n var btGooglePay = require('braintree-web/google-payment');\n\n var DropinError = require('../../lib/dropin-error');\n\n var constants = require('../../constants');\n\n var assets = require('@braintree/asset-loader');\n\n var Promise = require('../../lib/promise');\n\n var analytics = require('../../lib/analytics');\n\n function GooglePayView() {\n BaseView.apply(this, arguments);\n }\n\n GooglePayView.prototype = Object.create(BaseView.prototype);\n GooglePayView.prototype.constructor = GooglePayView;\n GooglePayView.ID = GooglePayView.prototype.ID = constants.paymentOptionIDs.googlePay;\n\n GooglePayView.prototype.initialize = function () {\n var self = this;\n var buttonOptions, googlePayVersion, merchantId;\n self.googlePayConfiguration = assign({}, self.model.merchantConfiguration.googlePay);\n googlePayVersion = self.googlePayConfiguration.googlePayVersion;\n merchantId = self.googlePayConfiguration.merchantId;\n buttonOptions = assign({\n buttonType: 'short'\n }, self.googlePayConfiguration.button, {\n onClick: function onClick(event) {\n event.preventDefault();\n self.preventUserAction();\n self.tokenize().then(function () {\n self.allowUserAction();\n });\n }\n });\n delete self.googlePayConfiguration.googlePayVersion;\n delete self.googlePayConfiguration.merchantId;\n delete self.googlePayConfiguration.button;\n return btGooglePay.create({\n client: self.client,\n googlePayVersion: googlePayVersion,\n googleMerchantId: merchantId\n }).then(function (googlePayInstance) {\n self.googlePayInstance = googlePayInstance;\n self.paymentsClient = createPaymentsClient(self.client);\n }).then(function () {\n var buttonContainer = self.getElementById('google-pay-button');\n buttonContainer.appendChild(self.paymentsClient.createButton(buttonOptions));\n self.model.asyncDependencyReady(GooglePayView.ID);\n }).catch(function (err) {\n self.model.asyncDependencyFailed({\n view: self.ID,\n error: new DropinError(err)\n });\n });\n };\n\n GooglePayView.prototype.tokenize = function () {\n var self = this;\n var paymentDataRequest = self.googlePayInstance.createPaymentDataRequest(self.googlePayConfiguration);\n var rawPaymentData;\n return self.paymentsClient.loadPaymentData(paymentDataRequest).then(function (paymentData) {\n rawPaymentData = paymentData;\n return self.googlePayInstance.parseResponse(paymentData);\n }).then(function (tokenizePayload) {\n tokenizePayload.rawPaymentData = rawPaymentData;\n self.model.addPaymentMethod(tokenizePayload);\n }).catch(function (err) {\n var reportedError = err;\n\n if (err.statusCode === 'DEVELOPER_ERROR') {\n console.error(err); // eslint-disable-line no-console\n\n reportedError = 'developerError';\n } else if (err.statusCode === 'CANCELED') {\n analytics.sendEvent(self.client, 'googlepay.loadPaymentData.canceled');\n return;\n } else if (err.statusCode) {\n analytics.sendEvent(self.client, 'googlepay.loadPaymentData.failed');\n }\n\n self.model.reportError(reportedError);\n });\n };\n\n GooglePayView.prototype.updateConfiguration = function (key, value) {\n this.googlePayConfiguration[key] = value;\n };\n\n GooglePayView.isEnabled = function (options) {\n var gatewayConfiguration = options.client.getConfiguration().gatewayConfiguration;\n\n if (!(gatewayConfiguration.androidPay && Boolean(options.merchantConfiguration.googlePay))) {\n return Promise.resolve(false);\n }\n\n return Promise.resolve().then(function () {\n if (!(global.google && global.google.payments && global.google.payments.api && global.google.payments.api.PaymentsClient)) {\n return assets.loadScript({\n id: constants.GOOGLE_PAYMENT_SCRIPT_ID,\n src: constants.GOOGLE_PAYMENT_SOURCE\n });\n }\n\n return Promise.resolve();\n }).then(function () {\n var paymentsClient = createPaymentsClient(options.client);\n return paymentsClient.isReadyToPay({\n allowedPaymentMethods: ['CARD', 'TOKENIZED_CARD']\n });\n }).then(function (response) {\n return Boolean(response.result);\n });\n };\n\n function createPaymentsClient(client) {\n return new global.google.payments.api.PaymentsClient({\n environment: client.getConfiguration().gatewayConfiguration.environment === 'production' ? 'PRODUCTION' : 'TEST'\n });\n }\n\n module.exports = GooglePayView;\n }).call(this);\n }).call(this, typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {});\n }, {\n \"../../constants\": 187,\n \"../../lib/analytics\": 192,\n \"../../lib/assign\": 193,\n \"../../lib/dropin-error\": 197,\n \"../../lib/promise\": 204,\n \"../base-view\": 245,\n \"@braintree/asset-loader\": 1,\n \"braintree-web/google-payment\": 74\n }],\n 255: [function (require, module, exports) {\n 'use strict';\n\n var paymentOptionIDs = require('../../constants').paymentOptionIDs;\n\n var result = {};\n result[paymentOptionIDs.applePay] = require('./apple-pay-view');\n result[paymentOptionIDs.card] = require('./card-view');\n result[paymentOptionIDs.googlePay] = require('./google-pay-view');\n result[paymentOptionIDs.paypal] = require('./paypal-view');\n result[paymentOptionIDs.paypalCredit] = require('./paypal-credit-view');\n result[paymentOptionIDs.venmo] = require('./venmo-view');\n module.exports = result;\n }, {\n \"../../constants\": 187,\n \"./apple-pay-view\": 251,\n \"./card-view\": 253,\n \"./google-pay-view\": 254,\n \"./paypal-credit-view\": 256,\n \"./paypal-view\": 257,\n \"./venmo-view\": 258\n }],\n 256: [function (require, module, exports) {\n 'use strict';\n\n var assign = require('../../lib/assign').assign;\n\n var Promise = require('../../lib/promise');\n\n var paymentOptionIDs = require('../../constants').paymentOptionIDs;\n\n var BasePayPalView = require('./base-paypal-view');\n\n function PayPalCreditView() {\n BasePayPalView.apply(this, arguments);\n this._isPayPalCredit = true;\n }\n\n PayPalCreditView.prototype = Object.create(BasePayPalView.prototype);\n PayPalCreditView.prototype.constructor = PayPalCreditView;\n PayPalCreditView.ID = PayPalCreditView.prototype.ID = paymentOptionIDs.paypalCredit;\n\n PayPalCreditView.isEnabled = function (options) {\n if (!options.merchantConfiguration.paypalCredit) {\n return Promise.resolve(false);\n }\n\n return BasePayPalView.isEnabled(assign({\n viewID: PayPalCreditView.ID\n }, options));\n };\n\n module.exports = PayPalCreditView;\n }, {\n \"../../constants\": 187,\n \"../../lib/assign\": 193,\n \"../../lib/promise\": 204,\n \"./base-paypal-view\": 252\n }],\n 257: [function (require, module, exports) {\n 'use strict';\n\n var assign = require('../../lib/assign').assign;\n\n var Promise = require('../../lib/promise');\n\n var paymentOptionIDs = require('../../constants').paymentOptionIDs;\n\n var BasePayPalView = require('./base-paypal-view');\n\n function PayPalView() {\n BasePayPalView.apply(this, arguments);\n }\n\n PayPalView.prototype = Object.create(BasePayPalView.prototype);\n PayPalView.prototype.constructor = PayPalView;\n PayPalView.ID = PayPalView.prototype.ID = paymentOptionIDs.paypal;\n\n PayPalView.isEnabled = function (options) {\n if (!options.merchantConfiguration.paypal) {\n return Promise.resolve(false);\n }\n\n return BasePayPalView.isEnabled(assign({\n viewID: PayPalView.ID\n }, options));\n };\n\n module.exports = PayPalView;\n }, {\n \"../../constants\": 187,\n \"../../lib/assign\": 193,\n \"../../lib/promise\": 204,\n \"./base-paypal-view\": 252\n }],\n 258: [function (require, module, exports) {\n 'use strict';\n\n var assign = require('../../lib/assign').assign;\n\n var BaseView = require('../base-view');\n\n var btVenmo = require('braintree-web/venmo');\n\n var DropinError = require('../../lib/dropin-error');\n\n var Promise = require('../../lib/promise');\n\n var paymentOptionIDs = require('../../constants').paymentOptionIDs;\n\n function VenmoView() {\n BaseView.apply(this, arguments);\n }\n\n VenmoView.prototype = Object.create(BaseView.prototype);\n VenmoView.prototype.constructor = VenmoView;\n VenmoView.ID = VenmoView.prototype.ID = paymentOptionIDs.venmo;\n\n VenmoView.prototype.initialize = function () {\n var self = this;\n var venmoConfiguration = assign({}, self.model.merchantConfiguration.venmo, {\n client: this.client\n });\n return btVenmo.create(venmoConfiguration).then(function (venmoInstance) {\n self.venmoInstance = venmoInstance;\n\n if (!self.venmoInstance.hasTokenizationResult()) {\n return Promise.resolve();\n }\n\n return self.venmoInstance.tokenize().then(function (payload) {\n self.model.reportAppSwitchPayload(payload);\n }).catch(function (err) {\n if (self._isIgnorableError(err)) {\n return;\n }\n\n self.model.reportAppSwitchError(paymentOptionIDs.venmo, err);\n });\n }).then(function () {\n var button = self.getElementById('venmo-button');\n button.addEventListener('click', function (event) {\n event.preventDefault();\n self.preventUserAction();\n return self.venmoInstance.tokenize().then(function (payload) {\n self.model.addPaymentMethod(payload);\n }).catch(function (tokenizeErr) {\n if (self._isIgnorableError(tokenizeErr)) {\n return;\n }\n\n self.model.reportError(tokenizeErr);\n }).then(function () {\n self.allowUserAction();\n });\n });\n self.model.asyncDependencyReady(VenmoView.ID);\n }).catch(function (err) {\n self.model.asyncDependencyFailed({\n view: self.ID,\n error: new DropinError(err)\n });\n });\n };\n\n VenmoView.prototype._isIgnorableError = function (error) {\n // customer cancels the flow in the app\n // we don't emit an error because the customer\n // initiated that action\n return error.code === 'VENMO_APP_CANCELED' || error.code === 'VENMO_DESKTOP_CANCELED';\n };\n\n VenmoView.isEnabled = function (options) {\n var gatewayConfiguration = options.client.getConfiguration().gatewayConfiguration;\n var venmoEnabled = gatewayConfiguration.payWithVenmo && Boolean(options.merchantConfiguration.venmo);\n\n if (!venmoEnabled) {\n return Promise.resolve(false);\n }\n\n return Promise.resolve(btVenmo.isBrowserSupported(options.merchantConfiguration.venmo));\n };\n\n module.exports = VenmoView;\n }, {\n \"../../constants\": 187,\n \"../../lib/assign\": 193,\n \"../../lib/dropin-error\": 197,\n \"../../lib/promise\": 204,\n \"../base-view\": 245,\n \"braintree-web/venmo\": 153\n }]\n }, {}, [190])(190);\n});","var Handlebars = require(\"../../../node_modules/handlebars/runtime.js\");\nfunction __default(obj) { return obj && (obj.__esModule ? obj[\"default\"] : obj); }\nmodule.exports = (Handlebars[\"default\"] || Handlebars).template({\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"
\\n \"\n + alias4(((helper = (helper = lookupProperty(helpers,\"tag\") || (depth0 != null ? lookupProperty(depth0,\"tag\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"tag\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":2},\"end\":{\"line\":3,\"column\":9}}}) : helper)))\n + \"\\n\\n\";\n},\"useData\":true});","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/master/actionview/app/assets/javascripts\nReleased under the MIT license\n */\n;\n(function () {\n var context = this;\n (function () {\n (function () {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form',\n formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n }).call(this);\n }).call(context);\n var Rails = context.Rails;\n (function () {\n (function () {\n var nonce;\n nonce = null;\n\n Rails.loadCSPNonce = function () {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n\n Rails.cspNonce = function () {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n }).call(this);\n (function () {\n var expando, m;\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\n Rails.matches = function (element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n\n expando = '_ujsData';\n\n Rails.getData = function (element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n\n Rails.setData = function (element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n\n return element[expando][key] = value;\n };\n\n Rails.$ = function (selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n }).call(this);\n (function () {\n var $, csrfParam, csrfToken;\n $ = Rails.$;\n\n csrfToken = Rails.csrfToken = function () {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n\n csrfParam = Rails.csrfParam = function () {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n\n Rails.CSRFProtection = function (xhr) {\n var token;\n token = csrfToken();\n\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n\n Rails.refreshCSRFTokens = function () {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n\n if (token != null && param != null) {\n return $('form input[name=\"' + param + '\"]').forEach(function (input) {\n return input.value = token;\n });\n }\n };\n }).call(this);\n (function () {\n var CustomEvent, fire, matches, preventDefault;\n matches = Rails.matches;\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function CustomEvent(event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n\n CustomEvent.prototype.preventDefault = function () {\n var result;\n result = preventDefault.call(this);\n\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function get() {\n return true;\n }\n });\n }\n\n return result;\n };\n }\n\n fire = Rails.fire = function (obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n\n Rails.stopEverything = function (e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n\n Rails.delegate = function (element, selector, eventType, handler) {\n return element.addEventListener(eventType, function (e) {\n var target;\n target = e.target;\n\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n }).call(this);\n (function () {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n\n Rails.ajax = function (options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function () {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n\n if (options.beforeSend != null && !options.beforeSend(xhr, options)) {\n return false;\n }\n\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function prepareOptions(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n\n options.accept = AcceptHeaders[options.dataType];\n\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n\n return options;\n };\n\n createXHR = function createXHR(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n CSRFProtection(xhr);\n }\n\n xhr.withCredentials = !!options.withCredentials;\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n\n return xhr;\n };\n\n processResponse = function processResponse(response, type) {\n var parser, script;\n\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n\n return response;\n };\n\n Rails.href = function (element) {\n return element.href;\n };\n\n Rails.isCrossDomain = function (url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n\n try {\n urlAnchor.href = url;\n return !((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host || originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host);\n } catch (error) {\n e = error;\n return true;\n }\n };\n }).call(this);\n (function () {\n var matches, toArray;\n matches = Rails.matches;\n\n toArray = function toArray(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function (element, additionalParam) {\n var inputs, params;\n inputs = [element];\n\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n\n params = [];\n inputs.forEach(function (input) {\n if (!input.name || input.disabled) {\n return;\n }\n\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function (option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n\n if (additionalParam) {\n params.push(additionalParam);\n }\n\n return params.map(function (param) {\n if (param.name != null) {\n return encodeURIComponent(param.name) + \"=\" + encodeURIComponent(param.value);\n } else {\n return param;\n }\n }).join('&');\n };\n\n Rails.formElements = function (form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function (el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n }).call(this);\n (function () {\n var allowAction, fire, stopEverything;\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n\n Rails.handleConfirm = function (e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n\n allowAction = function allowAction(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n\n if (!message) {\n return true;\n }\n\n answer = false;\n\n if (fire(element, 'confirm')) {\n try {\n answer = confirm(message);\n } catch (error) {}\n\n callback = fire(element, 'confirm:complete', [answer]);\n }\n\n return answer && callback;\n };\n }).call(this);\n (function () {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, matches, setData, stopEverything;\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n\n Rails.handleDisabledElement = function (e) {\n var element;\n element = this;\n\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function (e) {\n var element;\n element = e instanceof Event ? e.target : e;\n\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n\n Rails.disableElement = function (e) {\n var element;\n element = e instanceof Event ? e.target : e;\n\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n\n disableLinkElement = function disableLinkElement(element) {\n var replacement;\n replacement = element.getAttribute('data-disable-with');\n\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function enableLinkElement(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function disableFormElements(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function disableFormElement(element) {\n var replacement;\n replacement = element.getAttribute('data-disable-with');\n\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function enableFormElements(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function enableFormElement(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n\n setData(element, 'ujs:enable-with', null);\n }\n\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n }).call(this);\n (function () {\n var stopEverything;\n stopEverything = Rails.stopEverything;\n\n Rails.handleMethod = function (e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n\n if (!method) {\n return;\n }\n\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"
\";\n\n if (csrfParam != null && csrfToken != null && !Rails.isCrossDomain(href)) {\n formContent += \"
\";\n }\n\n formContent += '
';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n }).call(this);\n (function () {\n var ajax,\n fire,\n getData,\n isCrossDomain,\n isRemote,\n matches,\n serializeElement,\n setData,\n stopEverything,\n slice = [].slice;\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n\n isRemote = function isRemote(element) {\n var value;\n value = element.getAttribute('data-remote');\n return value != null && value !== 'false';\n };\n\n Rails.handleRemote = function (e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n\n if (!isRemote(element)) {\n return true;\n }\n\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function beforeSend(xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function success() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function error() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function complete() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: withCredentials != null && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n\n Rails.formSubmitButtonClick = function (e) {\n var button, form;\n button = this;\n form = button.form;\n\n if (!form) {\n return;\n }\n\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n\n Rails.preventInsignificantClick = function (e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = e.button != null && e.button !== 0;\n\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n }).call(this);\n (function () {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n\n if (typeof jQuery !== \"undefined\" && jQuery !== null && jQuery.ajax != null) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n\n Rails.start = function () {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n\n window.addEventListener('pageshow', function () {\n $(Rails.formEnableSelector).forEach(function (el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function (el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function (e) {\n return setTimeout(function () {\n return disableElement(e);\n }, 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n }).call(this);\n }).call(this);\n\n if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === \"object\" && module.exports) {\n module.exports = Rails;\n } else if (typeof define === \"function\" && define.amd) {\n define(Rails);\n }\n}).call(this);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*\nTurbolinks 5.2.0\nCopyright © 2018 Basecamp, LLC\n */\n(function () {\n var t = this;\n (function () {\n (function () {\n this.Turbolinks = {\n supported: function () {\n return null != window.history.pushState && null != window.requestAnimationFrame && null != window.addEventListener;\n }(),\n visit: function visit(t, r) {\n return e.controller.visit(t, r);\n },\n clearCache: function clearCache() {\n return e.controller.clearCache();\n },\n setProgressBarDelay: function setProgressBarDelay(t) {\n return e.controller.setProgressBarDelay(t);\n }\n };\n }).call(this);\n }).call(t);\n var e = t.Turbolinks;\n (function () {\n (function () {\n var t,\n r,\n n,\n o = [].slice;\n e.copyObject = function (t) {\n var e, r, n;\n r = {};\n\n for (e in t) {\n n = t[e], r[e] = n;\n }\n\n return r;\n }, e.closest = function (e, r) {\n return t.call(e, r);\n }, t = function () {\n var t, e;\n return t = document.documentElement, null != (e = t.closest) ? e : function (t) {\n var e;\n\n for (e = this; e;) {\n if (e.nodeType === Node.ELEMENT_NODE && r.call(e, t)) return e;\n e = e.parentNode;\n }\n };\n }(), e.defer = function (t) {\n return setTimeout(t, 1);\n }, e.throttle = function (t) {\n var e;\n return e = null, function () {\n var r;\n return r = 1 <= arguments.length ? o.call(arguments, 0) : [], null != e ? e : e = requestAnimationFrame(function (n) {\n return function () {\n return e = null, t.apply(n, r);\n };\n }(this));\n };\n }, e.dispatch = function (t, e) {\n var r, o, i, s, a, u;\n return a = null != e ? e : {}, u = a.target, r = a.cancelable, o = a.data, i = document.createEvent(\"Events\"), i.initEvent(t, !0, r === !0), i.data = null != o ? o : {}, i.cancelable && !n && (s = i.preventDefault, i.preventDefault = function () {\n return this.defaultPrevented || Object.defineProperty(this, \"defaultPrevented\", {\n get: function get() {\n return !0;\n }\n }), s.call(this);\n }), (null != u ? u : document).dispatchEvent(i), i;\n }, n = function () {\n var t;\n return t = document.createEvent(\"Events\"), t.initEvent(\"test\", !0, !0), t.preventDefault(), t.defaultPrevented;\n }(), e.match = function (t, e) {\n return r.call(t, e);\n }, r = function () {\n var t, e, r, n;\n return t = document.documentElement, null != (e = null != (r = null != (n = t.matchesSelector) ? n : t.webkitMatchesSelector) ? r : t.msMatchesSelector) ? e : t.mozMatchesSelector;\n }(), e.uuid = function () {\n var t, e, r;\n\n for (r = \"\", t = e = 1; 36 >= e; t = ++e) {\n r += 9 === t || 14 === t || 19 === t || 24 === t ? \"-\" : 15 === t ? \"4\" : 20 === t ? (Math.floor(4 * Math.random()) + 8).toString(16) : Math.floor(15 * Math.random()).toString(16);\n }\n\n return r;\n };\n }).call(this), function () {\n e.Location = function () {\n function t(t) {\n var e, r;\n null == t && (t = \"\"), r = document.createElement(\"a\"), r.href = t.toString(), this.absoluteURL = r.href, e = r.hash.length, 2 > e ? this.requestURL = this.absoluteURL : (this.requestURL = this.absoluteURL.slice(0, -e), this.anchor = r.hash.slice(1));\n }\n\n var e, r, n, o;\n return t.wrap = function (t) {\n return t instanceof this ? t : new this(t);\n }, t.prototype.getOrigin = function () {\n return this.absoluteURL.split(\"/\", 3).join(\"/\");\n }, t.prototype.getPath = function () {\n var t, e;\n return null != (t = null != (e = this.requestURL.match(/\\/\\/[^\\/]*(\\/[^?;]*)/)) ? e[1] : void 0) ? t : \"/\";\n }, t.prototype.getPathComponents = function () {\n return this.getPath().split(\"/\").slice(1);\n }, t.prototype.getLastPathComponent = function () {\n return this.getPathComponents().slice(-1)[0];\n }, t.prototype.getExtension = function () {\n var t, e;\n return null != (t = null != (e = this.getLastPathComponent().match(/\\.[^.]*$/)) ? e[0] : void 0) ? t : \"\";\n }, t.prototype.isHTML = function () {\n return this.getExtension().match(/^(?:|\\.(?:htm|html|xhtml))$/);\n }, t.prototype.isPrefixedBy = function (t) {\n var e;\n return e = r(t), this.isEqualTo(t) || o(this.absoluteURL, e);\n }, t.prototype.isEqualTo = function (t) {\n return this.absoluteURL === (null != t ? t.absoluteURL : void 0);\n }, t.prototype.toCacheKey = function () {\n return this.requestURL;\n }, t.prototype.toJSON = function () {\n return this.absoluteURL;\n }, t.prototype.toString = function () {\n return this.absoluteURL;\n }, t.prototype.valueOf = function () {\n return this.absoluteURL;\n }, r = function r(t) {\n return e(t.getOrigin() + t.getPath());\n }, e = function e(t) {\n return n(t, \"/\") ? t : t + \"/\";\n }, o = function o(t, e) {\n return t.slice(0, e.length) === e;\n }, n = function n(t, e) {\n return t.slice(-e.length) === e;\n }, t;\n }();\n }.call(this), function () {\n var t = function t(_t, e) {\n return function () {\n return _t.apply(e, arguments);\n };\n };\n\n e.HttpRequest = function () {\n function r(r, n, o) {\n this.delegate = r, this.requestCanceled = t(this.requestCanceled, this), this.requestTimedOut = t(this.requestTimedOut, this), this.requestFailed = t(this.requestFailed, this), this.requestLoaded = t(this.requestLoaded, this), this.requestProgressed = t(this.requestProgressed, this), this.url = e.Location.wrap(n).requestURL, this.referrer = e.Location.wrap(o).absoluteURL, this.createXHR();\n }\n\n return r.NETWORK_FAILURE = 0, r.TIMEOUT_FAILURE = -1, r.timeout = 60, r.prototype.send = function () {\n var t;\n return this.xhr && !this.sent ? (this.notifyApplicationBeforeRequestStart(), this.setProgress(0), this.xhr.send(), this.sent = !0, \"function\" == typeof (t = this.delegate).requestStarted ? t.requestStarted() : void 0) : void 0;\n }, r.prototype.cancel = function () {\n return this.xhr && this.sent ? this.xhr.abort() : void 0;\n }, r.prototype.requestProgressed = function (t) {\n return t.lengthComputable ? this.setProgress(t.loaded / t.total) : void 0;\n }, r.prototype.requestLoaded = function () {\n return this.endRequest(function (t) {\n return function () {\n var e;\n return 200 <= (e = t.xhr.status) && 300 > e ? t.delegate.requestCompletedWithResponse(t.xhr.responseText, t.xhr.getResponseHeader(\"Turbolinks-Location\")) : (t.failed = !0, t.delegate.requestFailedWithStatusCode(t.xhr.status, t.xhr.responseText));\n };\n }(this));\n }, r.prototype.requestFailed = function () {\n return this.endRequest(function (t) {\n return function () {\n return t.failed = !0, t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE);\n };\n }(this));\n }, r.prototype.requestTimedOut = function () {\n return this.endRequest(function (t) {\n return function () {\n return t.failed = !0, t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE);\n };\n }(this));\n }, r.prototype.requestCanceled = function () {\n return this.endRequest();\n }, r.prototype.notifyApplicationBeforeRequestStart = function () {\n return e.dispatch(\"turbolinks:request-start\", {\n data: {\n url: this.url,\n xhr: this.xhr\n }\n });\n }, r.prototype.notifyApplicationAfterRequestEnd = function () {\n return e.dispatch(\"turbolinks:request-end\", {\n data: {\n url: this.url,\n xhr: this.xhr\n }\n });\n }, r.prototype.createXHR = function () {\n return this.xhr = new XMLHttpRequest(), this.xhr.open(\"GET\", this.url, !0), this.xhr.timeout = 1e3 * this.constructor.timeout, this.xhr.setRequestHeader(\"Accept\", \"text/html, application/xhtml+xml\"), this.xhr.setRequestHeader(\"Turbolinks-Referrer\", this.referrer), this.xhr.onprogress = this.requestProgressed, this.xhr.onload = this.requestLoaded, this.xhr.onerror = this.requestFailed, this.xhr.ontimeout = this.requestTimedOut, this.xhr.onabort = this.requestCanceled;\n }, r.prototype.endRequest = function (t) {\n return this.xhr ? (this.notifyApplicationAfterRequestEnd(), null != t && t.call(this), this.destroy()) : void 0;\n }, r.prototype.setProgress = function (t) {\n var e;\n return this.progress = t, \"function\" == typeof (e = this.delegate).requestProgressed ? e.requestProgressed(this.progress) : void 0;\n }, r.prototype.destroy = function () {\n var t;\n return this.setProgress(1), \"function\" == typeof (t = this.delegate).requestFinished && t.requestFinished(), this.delegate = null, this.xhr = null;\n }, r;\n }();\n }.call(this), function () {\n var t = function t(_t2, e) {\n return function () {\n return _t2.apply(e, arguments);\n };\n };\n\n e.ProgressBar = function () {\n function e() {\n this.trickle = t(this.trickle, this), this.stylesheetElement = this.createStylesheetElement(), this.progressElement = this.createProgressElement();\n }\n\n var r;\n return r = 300, e.defaultCSS = \".turbolinks-progress-bar {\\n position: fixed;\\n display: block;\\n top: 0;\\n left: 0;\\n height: 3px;\\n background: #0076ff;\\n z-index: 9999;\\n transition: width \" + r + \"ms ease-out, opacity \" + r / 2 + \"ms \" + r / 2 + \"ms ease-in;\\n transform: translate3d(0, 0, 0);\\n}\", e.prototype.show = function () {\n return this.visible ? void 0 : (this.visible = !0, this.installStylesheetElement(), this.installProgressElement(), this.startTrickling());\n }, e.prototype.hide = function () {\n return this.visible && !this.hiding ? (this.hiding = !0, this.fadeProgressElement(function (t) {\n return function () {\n return t.uninstallProgressElement(), t.stopTrickling(), t.visible = !1, t.hiding = !1;\n };\n }(this))) : void 0;\n }, e.prototype.setValue = function (t) {\n return this.value = t, this.refresh();\n }, e.prototype.installStylesheetElement = function () {\n return document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n }, e.prototype.installProgressElement = function () {\n return this.progressElement.style.width = 0, this.progressElement.style.opacity = 1, document.documentElement.insertBefore(this.progressElement, document.body), this.refresh();\n }, e.prototype.fadeProgressElement = function (t) {\n return this.progressElement.style.opacity = 0, setTimeout(t, 1.5 * r);\n }, e.prototype.uninstallProgressElement = function () {\n return this.progressElement.parentNode ? document.documentElement.removeChild(this.progressElement) : void 0;\n }, e.prototype.startTrickling = function () {\n return null != this.trickleInterval ? this.trickleInterval : this.trickleInterval = setInterval(this.trickle, r);\n }, e.prototype.stopTrickling = function () {\n return clearInterval(this.trickleInterval), this.trickleInterval = null;\n }, e.prototype.trickle = function () {\n return this.setValue(this.value + Math.random() / 100);\n }, e.prototype.refresh = function () {\n return requestAnimationFrame(function (t) {\n return function () {\n return t.progressElement.style.width = 10 + 90 * t.value + \"%\";\n };\n }(this));\n }, e.prototype.createStylesheetElement = function () {\n var t;\n return t = document.createElement(\"style\"), t.type = \"text/css\", t.textContent = this.constructor.defaultCSS, t;\n }, e.prototype.createProgressElement = function () {\n var t;\n return t = document.createElement(\"div\"), t.className = \"turbolinks-progress-bar\", t;\n }, e;\n }();\n }.call(this), function () {\n var t = function t(_t3, e) {\n return function () {\n return _t3.apply(e, arguments);\n };\n };\n\n e.BrowserAdapter = function () {\n function r(r) {\n this.controller = r, this.showProgressBar = t(this.showProgressBar, this), this.progressBar = new e.ProgressBar();\n }\n\n var n, o, i;\n return i = e.HttpRequest, n = i.NETWORK_FAILURE, o = i.TIMEOUT_FAILURE, r.prototype.visitProposedToLocationWithAction = function (t, e) {\n return this.controller.startVisitToLocationWithAction(t, e);\n }, r.prototype.visitStarted = function (t) {\n return t.issueRequest(), t.changeHistory(), t.loadCachedSnapshot();\n }, r.prototype.visitRequestStarted = function (t) {\n return this.progressBar.setValue(0), t.hasCachedSnapshot() || \"restore\" !== t.action ? this.showProgressBarAfterDelay() : this.showProgressBar();\n }, r.prototype.visitRequestProgressed = function (t) {\n return this.progressBar.setValue(t.progress);\n }, r.prototype.visitRequestCompleted = function (t) {\n return t.loadResponse();\n }, r.prototype.visitRequestFailedWithStatusCode = function (t, e) {\n switch (e) {\n case n:\n case o:\n return this.reload();\n\n default:\n return t.loadResponse();\n }\n }, r.prototype.visitRequestFinished = function (t) {\n return this.hideProgressBar();\n }, r.prototype.visitCompleted = function (t) {\n return t.followRedirect();\n }, r.prototype.pageInvalidated = function () {\n return this.reload();\n }, r.prototype.showProgressBarAfterDelay = function () {\n return this.progressBarTimeout = setTimeout(this.showProgressBar, this.controller.progressBarDelay);\n }, r.prototype.showProgressBar = function () {\n return this.progressBar.show();\n }, r.prototype.hideProgressBar = function () {\n return this.progressBar.hide(), clearTimeout(this.progressBarTimeout);\n }, r.prototype.reload = function () {\n return window.location.reload();\n }, r;\n }();\n }.call(this), function () {\n var t = function t(_t4, e) {\n return function () {\n return _t4.apply(e, arguments);\n };\n };\n\n e.History = function () {\n function r(e) {\n this.delegate = e, this.onPageLoad = t(this.onPageLoad, this), this.onPopState = t(this.onPopState, this);\n }\n\n return r.prototype.start = function () {\n return this.started ? void 0 : (addEventListener(\"popstate\", this.onPopState, !1), addEventListener(\"load\", this.onPageLoad, !1), this.started = !0);\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"popstate\", this.onPopState, !1), removeEventListener(\"load\", this.onPageLoad, !1), this.started = !1) : void 0;\n }, r.prototype.push = function (t, r) {\n return t = e.Location.wrap(t), this.update(\"push\", t, r);\n }, r.prototype.replace = function (t, r) {\n return t = e.Location.wrap(t), this.update(\"replace\", t, r);\n }, r.prototype.onPopState = function (t) {\n var r, n, o, i;\n return this.shouldHandlePopState() && (i = null != (n = t.state) ? n.turbolinks : void 0) ? (r = e.Location.wrap(window.location), o = i.restorationIdentifier, this.delegate.historyPoppedToLocationWithRestorationIdentifier(r, o)) : void 0;\n }, r.prototype.onPageLoad = function (t) {\n return e.defer(function (t) {\n return function () {\n return t.pageLoaded = !0;\n };\n }(this));\n }, r.prototype.shouldHandlePopState = function () {\n return this.pageIsLoaded();\n }, r.prototype.pageIsLoaded = function () {\n return this.pageLoaded || \"complete\" === document.readyState;\n }, r.prototype.update = function (t, e, r) {\n var n;\n return n = {\n turbolinks: {\n restorationIdentifier: r\n }\n }, history[t + \"State\"](n, null, e);\n }, r;\n }();\n }.call(this), function () {\n e.HeadDetails = function () {\n function t(t) {\n var e, r, n, s, a, u;\n\n for (this.elements = {}, n = 0, a = t.length; a > n; n++) {\n u = t[n], u.nodeType === Node.ELEMENT_NODE && (s = u.outerHTML, r = null != (e = this.elements)[s] ? e[s] : e[s] = {\n type: i(u),\n tracked: o(u),\n elements: []\n }, r.elements.push(u));\n }\n }\n\n var e, r, n, o, i;\n return t.fromHeadElement = function (t) {\n var e;\n return new this(null != (e = null != t ? t.childNodes : void 0) ? e : []);\n }, t.prototype.hasElementWithKey = function (t) {\n return t in this.elements;\n }, t.prototype.getTrackedElementSignature = function () {\n var t, e;\n return function () {\n var r, n;\n r = this.elements, n = [];\n\n for (t in r) {\n e = r[t].tracked, e && n.push(t);\n }\n\n return n;\n }.call(this).join(\"\");\n }, t.prototype.getScriptElementsNotInDetails = function (t) {\n return this.getElementsMatchingTypeNotInDetails(\"script\", t);\n }, t.prototype.getStylesheetElementsNotInDetails = function (t) {\n return this.getElementsMatchingTypeNotInDetails(\"stylesheet\", t);\n }, t.prototype.getElementsMatchingTypeNotInDetails = function (t, e) {\n var r, n, o, i, s, a;\n o = this.elements, s = [];\n\n for (n in o) {\n i = o[n], a = i.type, r = i.elements, a !== t || e.hasElementWithKey(n) || s.push(r[0]);\n }\n\n return s;\n }, t.prototype.getProvisionalElements = function () {\n var t, e, r, n, o, i, s;\n r = [], n = this.elements;\n\n for (e in n) {\n o = n[e], s = o.type, i = o.tracked, t = o.elements, null != s || i ? t.length > 1 && r.push.apply(r, t.slice(1)) : r.push.apply(r, t);\n }\n\n return r;\n }, t.prototype.getMetaValue = function (t) {\n var e;\n return null != (e = this.findMetaElementByName(t)) ? e.getAttribute(\"content\") : void 0;\n }, t.prototype.findMetaElementByName = function (t) {\n var r, n, o, i;\n r = void 0, i = this.elements;\n\n for (o in i) {\n n = i[o].elements, e(n[0], t) && (r = n[0]);\n }\n\n return r;\n }, i = function i(t) {\n return r(t) ? \"script\" : n(t) ? \"stylesheet\" : void 0;\n }, o = function o(t) {\n return \"reload\" === t.getAttribute(\"data-turbolinks-track\");\n }, r = function r(t) {\n var e;\n return e = t.tagName.toLowerCase(), \"script\" === e;\n }, n = function n(t) {\n var e;\n return e = t.tagName.toLowerCase(), \"style\" === e || \"link\" === e && \"stylesheet\" === t.getAttribute(\"rel\");\n }, e = function e(t, _e) {\n var r;\n return r = t.tagName.toLowerCase(), \"meta\" === r && t.getAttribute(\"name\") === _e;\n }, t;\n }();\n }.call(this), function () {\n e.Snapshot = function () {\n function t(t, e) {\n this.headDetails = t, this.bodyElement = e;\n }\n\n return t.wrap = function (t) {\n return t instanceof this ? t : \"string\" == typeof t ? this.fromHTMLString(t) : this.fromHTMLElement(t);\n }, t.fromHTMLString = function (t) {\n var e;\n return e = document.createElement(\"html\"), e.innerHTML = t, this.fromHTMLElement(e);\n }, t.fromHTMLElement = function (t) {\n var r, n, o, i;\n return o = t.querySelector(\"head\"), r = null != (i = t.querySelector(\"body\")) ? i : document.createElement(\"body\"), n = e.HeadDetails.fromHeadElement(o), new this(n, r);\n }, t.prototype.clone = function () {\n return new this.constructor(this.headDetails, this.bodyElement.cloneNode(!0));\n }, t.prototype.getRootLocation = function () {\n var t, r;\n return r = null != (t = this.getSetting(\"root\")) ? t : \"/\", new e.Location(r);\n }, t.prototype.getCacheControlValue = function () {\n return this.getSetting(\"cache-control\");\n }, t.prototype.getElementForAnchor = function (t) {\n try {\n return this.bodyElement.querySelector(\"[id='\" + t + \"'], a[name='\" + t + \"']\");\n } catch (e) {}\n }, t.prototype.getPermanentElements = function () {\n return this.bodyElement.querySelectorAll(\"[id][data-turbolinks-permanent]\");\n }, t.prototype.getPermanentElementById = function (t) {\n return this.bodyElement.querySelector(\"#\" + t + \"[data-turbolinks-permanent]\");\n }, t.prototype.getPermanentElementsPresentInSnapshot = function (t) {\n var e, r, n, o, i;\n\n for (o = this.getPermanentElements(), i = [], r = 0, n = o.length; n > r; r++) {\n e = o[r], t.getPermanentElementById(e.id) && i.push(e);\n }\n\n return i;\n }, t.prototype.findFirstAutofocusableElement = function () {\n return this.bodyElement.querySelector(\"[autofocus]\");\n }, t.prototype.hasAnchor = function (t) {\n return null != this.getElementForAnchor(t);\n }, t.prototype.isPreviewable = function () {\n return \"no-preview\" !== this.getCacheControlValue();\n }, t.prototype.isCacheable = function () {\n return \"no-cache\" !== this.getCacheControlValue();\n }, t.prototype.isVisitable = function () {\n return \"reload\" !== this.getSetting(\"visit-control\");\n }, t.prototype.getSetting = function (t) {\n return this.headDetails.getMetaValue(\"turbolinks-\" + t);\n }, t;\n }();\n }.call(this), function () {\n var t = [].slice;\n\n e.Renderer = function () {\n function e() {}\n\n var r;\n return e.render = function () {\n var e, r, n, o;\n return n = arguments[0], r = arguments[1], e = 3 <= arguments.length ? t.call(arguments, 2) : [], o = function (t, e, r) {\n r.prototype = t.prototype;\n var n = new r(),\n o = t.apply(n, e);\n return Object(o) === o ? o : n;\n }(this, e, function () {}), o.delegate = n, o.render(r), o;\n }, e.prototype.renderView = function (t) {\n return this.delegate.viewWillRender(this.newBody), t(), this.delegate.viewRendered(this.newBody);\n }, e.prototype.invalidateView = function () {\n return this.delegate.viewInvalidated();\n }, e.prototype.createScriptElement = function (t) {\n var e;\n return \"false\" === t.getAttribute(\"data-turbolinks-eval\") ? t : (e = document.createElement(\"script\"), e.textContent = t.textContent, e.async = !1, r(e, t), e);\n }, r = function r(t, e) {\n var r, n, o, i, s, a, u;\n\n for (i = e.attributes, a = [], r = 0, n = i.length; n > r; r++) {\n s = i[r], o = s.name, u = s.value, a.push(t.setAttribute(o, u));\n }\n\n return a;\n }, e;\n }();\n }.call(this), function () {\n var t,\n r,\n n = function n(t, e) {\n function r() {\n this.constructor = t;\n }\n\n for (var n in e) {\n o.call(e, n) && (t[n] = e[n]);\n }\n\n return r.prototype = e.prototype, t.prototype = new r(), t.__super__ = e.prototype, t;\n },\n o = {}.hasOwnProperty;\n\n e.SnapshotRenderer = function (e) {\n function o(t, e, r) {\n this.currentSnapshot = t, this.newSnapshot = e, this.isPreview = r, this.currentHeadDetails = this.currentSnapshot.headDetails, this.newHeadDetails = this.newSnapshot.headDetails, this.currentBody = this.currentSnapshot.bodyElement, this.newBody = this.newSnapshot.bodyElement;\n }\n\n return n(o, e), o.prototype.render = function (t) {\n return this.shouldRender() ? (this.mergeHead(), this.renderView(function (e) {\n return function () {\n return e.replaceBody(), e.isPreview || e.focusFirstAutofocusableElement(), t();\n };\n }(this))) : this.invalidateView();\n }, o.prototype.mergeHead = function () {\n return this.copyNewHeadStylesheetElements(), this.copyNewHeadScriptElements(), this.removeCurrentHeadProvisionalElements(), this.copyNewHeadProvisionalElements();\n }, o.prototype.replaceBody = function () {\n var t;\n return t = this.relocateCurrentBodyPermanentElements(), this.activateNewBodyScriptElements(), this.assignNewBody(), this.replacePlaceholderElementsWithClonedPermanentElements(t);\n }, o.prototype.shouldRender = function () {\n return this.newSnapshot.isVisitable() && this.trackedElementsAreIdentical();\n }, o.prototype.trackedElementsAreIdentical = function () {\n return this.currentHeadDetails.getTrackedElementSignature() === this.newHeadDetails.getTrackedElementSignature();\n }, o.prototype.copyNewHeadStylesheetElements = function () {\n var t, e, r, n, o;\n\n for (n = this.getNewHeadStylesheetElements(), o = [], e = 0, r = n.length; r > e; e++) {\n t = n[e], o.push(document.head.appendChild(t));\n }\n\n return o;\n }, o.prototype.copyNewHeadScriptElements = function () {\n var t, e, r, n, o;\n\n for (n = this.getNewHeadScriptElements(), o = [], e = 0, r = n.length; r > e; e++) {\n t = n[e], o.push(document.head.appendChild(this.createScriptElement(t)));\n }\n\n return o;\n }, o.prototype.removeCurrentHeadProvisionalElements = function () {\n var t, e, r, n, o;\n\n for (n = this.getCurrentHeadProvisionalElements(), o = [], e = 0, r = n.length; r > e; e++) {\n t = n[e], o.push(document.head.removeChild(t));\n }\n\n return o;\n }, o.prototype.copyNewHeadProvisionalElements = function () {\n var t, e, r, n, o;\n\n for (n = this.getNewHeadProvisionalElements(), o = [], e = 0, r = n.length; r > e; e++) {\n t = n[e], o.push(document.head.appendChild(t));\n }\n\n return o;\n }, o.prototype.relocateCurrentBodyPermanentElements = function () {\n var e, n, o, i, s, a, u;\n\n for (a = this.getCurrentBodyPermanentElements(), u = [], e = 0, n = a.length; n > e; e++) {\n i = a[e], s = t(i), o = this.newSnapshot.getPermanentElementById(i.id), r(i, s.element), r(o, i), u.push(s);\n }\n\n return u;\n }, o.prototype.replacePlaceholderElementsWithClonedPermanentElements = function (t) {\n var e, n, o, i, s, a, u;\n\n for (u = [], o = 0, i = t.length; i > o; o++) {\n a = t[o], n = a.element, s = a.permanentElement, e = s.cloneNode(!0), u.push(r(n, e));\n }\n\n return u;\n }, o.prototype.activateNewBodyScriptElements = function () {\n var t, e, n, o, i, s;\n\n for (i = this.getNewBodyScriptElements(), s = [], e = 0, o = i.length; o > e; e++) {\n n = i[e], t = this.createScriptElement(n), s.push(r(n, t));\n }\n\n return s;\n }, o.prototype.assignNewBody = function () {\n return document.body = this.newBody;\n }, o.prototype.focusFirstAutofocusableElement = function () {\n var t;\n return null != (t = this.newSnapshot.findFirstAutofocusableElement()) ? t.focus() : void 0;\n }, o.prototype.getNewHeadStylesheetElements = function () {\n return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails);\n }, o.prototype.getNewHeadScriptElements = function () {\n return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails);\n }, o.prototype.getCurrentHeadProvisionalElements = function () {\n return this.currentHeadDetails.getProvisionalElements();\n }, o.prototype.getNewHeadProvisionalElements = function () {\n return this.newHeadDetails.getProvisionalElements();\n }, o.prototype.getCurrentBodyPermanentElements = function () {\n return this.currentSnapshot.getPermanentElementsPresentInSnapshot(this.newSnapshot);\n }, o.prototype.getNewBodyScriptElements = function () {\n return this.newBody.querySelectorAll(\"script\");\n }, o;\n }(e.Renderer), t = function t(_t5) {\n var e;\n return e = document.createElement(\"meta\"), e.setAttribute(\"name\", \"turbolinks-permanent-placeholder\"), e.setAttribute(\"content\", _t5.id), {\n element: e,\n permanentElement: _t5\n };\n }, r = function r(t, e) {\n var r;\n return (r = t.parentNode) ? r.replaceChild(e, t) : void 0;\n };\n }.call(this), function () {\n var t = function t(_t6, e) {\n function n() {\n this.constructor = _t6;\n }\n\n for (var o in e) {\n r.call(e, o) && (_t6[o] = e[o]);\n }\n\n return n.prototype = e.prototype, _t6.prototype = new n(), _t6.__super__ = e.prototype, _t6;\n },\n r = {}.hasOwnProperty;\n\n e.ErrorRenderer = function (e) {\n function r(t) {\n var e;\n e = document.createElement(\"html\"), e.innerHTML = t, this.newHead = e.querySelector(\"head\"), this.newBody = e.querySelector(\"body\");\n }\n\n return t(r, e), r.prototype.render = function (t) {\n return this.renderView(function (e) {\n return function () {\n return e.replaceHeadAndBody(), e.activateBodyScriptElements(), t();\n };\n }(this));\n }, r.prototype.replaceHeadAndBody = function () {\n var t, e;\n return e = document.head, t = document.body, e.parentNode.replaceChild(this.newHead, e), t.parentNode.replaceChild(this.newBody, t);\n }, r.prototype.activateBodyScriptElements = function () {\n var t, e, r, n, o, i;\n\n for (n = this.getScriptElements(), i = [], e = 0, r = n.length; r > e; e++) {\n o = n[e], t = this.createScriptElement(o), i.push(o.parentNode.replaceChild(t, o));\n }\n\n return i;\n }, r.prototype.getScriptElements = function () {\n return document.documentElement.querySelectorAll(\"script\");\n }, r;\n }(e.Renderer);\n }.call(this), function () {\n e.View = function () {\n function t(t) {\n this.delegate = t, this.htmlElement = document.documentElement;\n }\n\n return t.prototype.getRootLocation = function () {\n return this.getSnapshot().getRootLocation();\n }, t.prototype.getElementForAnchor = function (t) {\n return this.getSnapshot().getElementForAnchor(t);\n }, t.prototype.getSnapshot = function () {\n return e.Snapshot.fromHTMLElement(this.htmlElement);\n }, t.prototype.render = function (t, e) {\n var r, n, o;\n return o = t.snapshot, r = t.error, n = t.isPreview, this.markAsPreview(n), null != o ? this.renderSnapshot(o, n, e) : this.renderError(r, e);\n }, t.prototype.markAsPreview = function (t) {\n return t ? this.htmlElement.setAttribute(\"data-turbolinks-preview\", \"\") : this.htmlElement.removeAttribute(\"data-turbolinks-preview\");\n }, t.prototype.renderSnapshot = function (t, r, n) {\n return e.SnapshotRenderer.render(this.delegate, n, this.getSnapshot(), e.Snapshot.wrap(t), r);\n }, t.prototype.renderError = function (t, r) {\n return e.ErrorRenderer.render(this.delegate, r, t);\n }, t;\n }();\n }.call(this), function () {\n var t = function t(_t7, e) {\n return function () {\n return _t7.apply(e, arguments);\n };\n };\n\n e.ScrollManager = function () {\n function r(r) {\n this.delegate = r, this.onScroll = t(this.onScroll, this), this.onScroll = e.throttle(this.onScroll);\n }\n\n return r.prototype.start = function () {\n return this.started ? void 0 : (addEventListener(\"scroll\", this.onScroll, !1), this.onScroll(), this.started = !0);\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"scroll\", this.onScroll, !1), this.started = !1) : void 0;\n }, r.prototype.scrollToElement = function (t) {\n return t.scrollIntoView();\n }, r.prototype.scrollToPosition = function (t) {\n var e, r;\n return e = t.x, r = t.y, window.scrollTo(e, r);\n }, r.prototype.onScroll = function (t) {\n return this.updatePosition({\n x: window.pageXOffset,\n y: window.pageYOffset\n });\n }, r.prototype.updatePosition = function (t) {\n var e;\n return this.position = t, null != (e = this.delegate) ? e.scrollPositionChanged(this.position) : void 0;\n }, r;\n }();\n }.call(this), function () {\n e.SnapshotCache = function () {\n function t(t) {\n this.size = t, this.keys = [], this.snapshots = {};\n }\n\n var r;\n return t.prototype.has = function (t) {\n var e;\n return e = r(t), e in this.snapshots;\n }, t.prototype.get = function (t) {\n var e;\n if (this.has(t)) return e = this.read(t), this.touch(t), e;\n }, t.prototype.put = function (t, e) {\n return this.write(t, e), this.touch(t), e;\n }, t.prototype.read = function (t) {\n var e;\n return e = r(t), this.snapshots[e];\n }, t.prototype.write = function (t, e) {\n var n;\n return n = r(t), this.snapshots[n] = e;\n }, t.prototype.touch = function (t) {\n var e, n;\n return n = r(t), e = this.keys.indexOf(n), e > -1 && this.keys.splice(e, 1), this.keys.unshift(n), this.trim();\n }, t.prototype.trim = function () {\n var t, e, r, n, o;\n\n for (n = this.keys.splice(this.size), o = [], t = 0, r = n.length; r > t; t++) {\n e = n[t], o.push(delete this.snapshots[e]);\n }\n\n return o;\n }, r = function r(t) {\n return e.Location.wrap(t).toCacheKey();\n }, t;\n }();\n }.call(this), function () {\n var t = function t(_t8, e) {\n return function () {\n return _t8.apply(e, arguments);\n };\n };\n\n e.Visit = function () {\n function r(r, n, o) {\n this.controller = r, this.action = o, this.performScroll = t(this.performScroll, this), this.identifier = e.uuid(), this.location = e.Location.wrap(n), this.adapter = this.controller.adapter, this.state = \"initialized\", this.timingMetrics = {};\n }\n\n var n;\n return r.prototype.start = function () {\n return \"initialized\" === this.state ? (this.recordTimingMetric(\"visitStart\"), this.state = \"started\", this.adapter.visitStarted(this)) : void 0;\n }, r.prototype.cancel = function () {\n var t;\n return \"started\" === this.state ? (null != (t = this.request) && t.cancel(), this.cancelRender(), this.state = \"canceled\") : void 0;\n }, r.prototype.complete = function () {\n var t;\n return \"started\" === this.state ? (this.recordTimingMetric(\"visitEnd\"), this.state = \"completed\", \"function\" == typeof (t = this.adapter).visitCompleted && t.visitCompleted(this), this.controller.visitCompleted(this)) : void 0;\n }, r.prototype.fail = function () {\n var t;\n return \"started\" === this.state ? (this.state = \"failed\", \"function\" == typeof (t = this.adapter).visitFailed ? t.visitFailed(this) : void 0) : void 0;\n }, r.prototype.changeHistory = function () {\n var t, e;\n return this.historyChanged ? void 0 : (t = this.location.isEqualTo(this.referrer) ? \"replace\" : this.action, e = n(t), this.controller[e](this.location, this.restorationIdentifier), this.historyChanged = !0);\n }, r.prototype.issueRequest = function () {\n return this.shouldIssueRequest() && null == this.request ? (this.progress = 0, this.request = new e.HttpRequest(this, this.location, this.referrer), this.request.send()) : void 0;\n }, r.prototype.getCachedSnapshot = function () {\n var t;\n return !(t = this.controller.getCachedSnapshotForLocation(this.location)) || null != this.location.anchor && !t.hasAnchor(this.location.anchor) || \"restore\" !== this.action && !t.isPreviewable() ? void 0 : t;\n }, r.prototype.hasCachedSnapshot = function () {\n return null != this.getCachedSnapshot();\n }, r.prototype.loadCachedSnapshot = function () {\n var t, e;\n return (e = this.getCachedSnapshot()) ? (t = this.shouldIssueRequest(), this.render(function () {\n var r;\n return this.cacheSnapshot(), this.controller.render({\n snapshot: e,\n isPreview: t\n }, this.performScroll), \"function\" == typeof (r = this.adapter).visitRendered && r.visitRendered(this), t ? void 0 : this.complete();\n })) : void 0;\n }, r.prototype.loadResponse = function () {\n return null != this.response ? this.render(function () {\n var t, e;\n return this.cacheSnapshot(), this.request.failed ? (this.controller.render({\n error: this.response\n }, this.performScroll), \"function\" == typeof (t = this.adapter).visitRendered && t.visitRendered(this), this.fail()) : (this.controller.render({\n snapshot: this.response\n }, this.performScroll), \"function\" == typeof (e = this.adapter).visitRendered && e.visitRendered(this), this.complete());\n }) : void 0;\n }, r.prototype.followRedirect = function () {\n return this.redirectedToLocation && !this.followedRedirect ? (this.location = this.redirectedToLocation, this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation, this.restorationIdentifier), this.followedRedirect = !0) : void 0;\n }, r.prototype.requestStarted = function () {\n var t;\n return this.recordTimingMetric(\"requestStart\"), \"function\" == typeof (t = this.adapter).visitRequestStarted ? t.visitRequestStarted(this) : void 0;\n }, r.prototype.requestProgressed = function (t) {\n var e;\n return this.progress = t, \"function\" == typeof (e = this.adapter).visitRequestProgressed ? e.visitRequestProgressed(this) : void 0;\n }, r.prototype.requestCompletedWithResponse = function (t, r) {\n return this.response = t, null != r && (this.redirectedToLocation = e.Location.wrap(r)), this.adapter.visitRequestCompleted(this);\n }, r.prototype.requestFailedWithStatusCode = function (t, e) {\n return this.response = e, this.adapter.visitRequestFailedWithStatusCode(this, t);\n }, r.prototype.requestFinished = function () {\n var t;\n return this.recordTimingMetric(\"requestEnd\"), \"function\" == typeof (t = this.adapter).visitRequestFinished ? t.visitRequestFinished(this) : void 0;\n }, r.prototype.performScroll = function () {\n return this.scrolled ? void 0 : (\"restore\" === this.action ? this.scrollToRestoredPosition() || this.scrollToTop() : this.scrollToAnchor() || this.scrollToTop(), this.scrolled = !0);\n }, r.prototype.scrollToRestoredPosition = function () {\n var t, e;\n return t = null != (e = this.restorationData) ? e.scrollPosition : void 0, null != t ? (this.controller.scrollToPosition(t), !0) : void 0;\n }, r.prototype.scrollToAnchor = function () {\n return null != this.location.anchor ? (this.controller.scrollToAnchor(this.location.anchor), !0) : void 0;\n }, r.prototype.scrollToTop = function () {\n return this.controller.scrollToPosition({\n x: 0,\n y: 0\n });\n }, r.prototype.recordTimingMetric = function (t) {\n var e;\n return null != (e = this.timingMetrics)[t] ? e[t] : e[t] = new Date().getTime();\n }, r.prototype.getTimingMetrics = function () {\n return e.copyObject(this.timingMetrics);\n }, n = function n(t) {\n switch (t) {\n case \"replace\":\n return \"replaceHistoryWithLocationAndRestorationIdentifier\";\n\n case \"advance\":\n case \"restore\":\n return \"pushHistoryWithLocationAndRestorationIdentifier\";\n }\n }, r.prototype.shouldIssueRequest = function () {\n return \"restore\" === this.action ? !this.hasCachedSnapshot() : !0;\n }, r.prototype.cacheSnapshot = function () {\n return this.snapshotCached ? void 0 : (this.controller.cacheSnapshot(), this.snapshotCached = !0);\n }, r.prototype.render = function (t) {\n return this.cancelRender(), this.frame = requestAnimationFrame(function (e) {\n return function () {\n return e.frame = null, t.call(e);\n };\n }(this));\n }, r.prototype.cancelRender = function () {\n return this.frame ? cancelAnimationFrame(this.frame) : void 0;\n }, r;\n }();\n }.call(this), function () {\n var t = function t(_t9, e) {\n return function () {\n return _t9.apply(e, arguments);\n };\n };\n\n e.Controller = function () {\n function r() {\n this.clickBubbled = t(this.clickBubbled, this), this.clickCaptured = t(this.clickCaptured, this), this.pageLoaded = t(this.pageLoaded, this), this.history = new e.History(this), this.view = new e.View(this), this.scrollManager = new e.ScrollManager(this), this.restorationData = {}, this.clearCache(), this.setProgressBarDelay(500);\n }\n\n return r.prototype.start = function () {\n return e.supported && !this.started ? (addEventListener(\"click\", this.clickCaptured, !0), addEventListener(\"DOMContentLoaded\", this.pageLoaded, !1), this.scrollManager.start(), this.startHistory(), this.started = !0, this.enabled = !0) : void 0;\n }, r.prototype.disable = function () {\n return this.enabled = !1;\n }, r.prototype.stop = function () {\n return this.started ? (removeEventListener(\"click\", this.clickCaptured, !0), removeEventListener(\"DOMContentLoaded\", this.pageLoaded, !1), this.scrollManager.stop(), this.stopHistory(), this.started = !1) : void 0;\n }, r.prototype.clearCache = function () {\n return this.cache = new e.SnapshotCache(10);\n }, r.prototype.visit = function (t, r) {\n var n, o;\n return null == r && (r = {}), t = e.Location.wrap(t), this.applicationAllowsVisitingLocation(t) ? this.locationIsVisitable(t) ? (n = null != (o = r.action) ? o : \"advance\", this.adapter.visitProposedToLocationWithAction(t, n)) : window.location = t : void 0;\n }, r.prototype.startVisitToLocationWithAction = function (t, r, n) {\n var o;\n return e.supported ? (o = this.getRestorationDataForIdentifier(n), this.startVisit(t, r, {\n restorationData: o\n })) : window.location = t;\n }, r.prototype.setProgressBarDelay = function (t) {\n return this.progressBarDelay = t;\n }, r.prototype.startHistory = function () {\n return this.location = e.Location.wrap(window.location), this.restorationIdentifier = e.uuid(), this.history.start(), this.history.replace(this.location, this.restorationIdentifier);\n }, r.prototype.stopHistory = function () {\n return this.history.stop();\n }, r.prototype.pushHistoryWithLocationAndRestorationIdentifier = function (t, r) {\n return this.restorationIdentifier = r, this.location = e.Location.wrap(t), this.history.push(this.location, this.restorationIdentifier);\n }, r.prototype.replaceHistoryWithLocationAndRestorationIdentifier = function (t, r) {\n return this.restorationIdentifier = r, this.location = e.Location.wrap(t), this.history.replace(this.location, this.restorationIdentifier);\n }, r.prototype.historyPoppedToLocationWithRestorationIdentifier = function (t, r) {\n var n;\n return this.restorationIdentifier = r, this.enabled ? (n = this.getRestorationDataForIdentifier(this.restorationIdentifier), this.startVisit(t, \"restore\", {\n restorationIdentifier: this.restorationIdentifier,\n restorationData: n,\n historyChanged: !0\n }), this.location = e.Location.wrap(t)) : this.adapter.pageInvalidated();\n }, r.prototype.getCachedSnapshotForLocation = function (t) {\n var e;\n return null != (e = this.cache.get(t)) ? e.clone() : void 0;\n }, r.prototype.shouldCacheSnapshot = function () {\n return this.view.getSnapshot().isCacheable();\n }, r.prototype.cacheSnapshot = function () {\n var t, r;\n return this.shouldCacheSnapshot() ? (this.notifyApplicationBeforeCachingSnapshot(), r = this.view.getSnapshot(), t = this.lastRenderedLocation, e.defer(function (e) {\n return function () {\n return e.cache.put(t, r.clone());\n };\n }(this))) : void 0;\n }, r.prototype.scrollToAnchor = function (t) {\n var e;\n return (e = this.view.getElementForAnchor(t)) ? this.scrollToElement(e) : this.scrollToPosition({\n x: 0,\n y: 0\n });\n }, r.prototype.scrollToElement = function (t) {\n return this.scrollManager.scrollToElement(t);\n }, r.prototype.scrollToPosition = function (t) {\n return this.scrollManager.scrollToPosition(t);\n }, r.prototype.scrollPositionChanged = function (t) {\n var e;\n return e = this.getCurrentRestorationData(), e.scrollPosition = t;\n }, r.prototype.render = function (t, e) {\n return this.view.render(t, e);\n }, r.prototype.viewInvalidated = function () {\n return this.adapter.pageInvalidated();\n }, r.prototype.viewWillRender = function (t) {\n return this.notifyApplicationBeforeRender(t);\n }, r.prototype.viewRendered = function () {\n return this.lastRenderedLocation = this.currentVisit.location, this.notifyApplicationAfterRender();\n }, r.prototype.pageLoaded = function () {\n return this.lastRenderedLocation = this.location, this.notifyApplicationAfterPageLoad();\n }, r.prototype.clickCaptured = function () {\n return removeEventListener(\"click\", this.clickBubbled, !1), addEventListener(\"click\", this.clickBubbled, !1);\n }, r.prototype.clickBubbled = function (t) {\n var e, r, n;\n return this.enabled && this.clickEventIsSignificant(t) && (r = this.getVisitableLinkForNode(t.target)) && (n = this.getVisitableLocationForLink(r)) && this.applicationAllowsFollowingLinkToLocation(r, n) ? (t.preventDefault(), e = this.getActionForLink(r), this.visit(n, {\n action: e\n })) : void 0;\n }, r.prototype.applicationAllowsFollowingLinkToLocation = function (t, e) {\n var r;\n return r = this.notifyApplicationAfterClickingLinkToLocation(t, e), !r.defaultPrevented;\n }, r.prototype.applicationAllowsVisitingLocation = function (t) {\n var e;\n return e = this.notifyApplicationBeforeVisitingLocation(t), !e.defaultPrevented;\n }, r.prototype.notifyApplicationAfterClickingLinkToLocation = function (t, r) {\n return e.dispatch(\"turbolinks:click\", {\n target: t,\n data: {\n url: r.absoluteURL\n },\n cancelable: !0\n });\n }, r.prototype.notifyApplicationBeforeVisitingLocation = function (t) {\n return e.dispatch(\"turbolinks:before-visit\", {\n data: {\n url: t.absoluteURL\n },\n cancelable: !0\n });\n }, r.prototype.notifyApplicationAfterVisitingLocation = function (t) {\n return e.dispatch(\"turbolinks:visit\", {\n data: {\n url: t.absoluteURL\n }\n });\n }, r.prototype.notifyApplicationBeforeCachingSnapshot = function () {\n return e.dispatch(\"turbolinks:before-cache\");\n }, r.prototype.notifyApplicationBeforeRender = function (t) {\n return e.dispatch(\"turbolinks:before-render\", {\n data: {\n newBody: t\n }\n });\n }, r.prototype.notifyApplicationAfterRender = function () {\n return e.dispatch(\"turbolinks:render\");\n }, r.prototype.notifyApplicationAfterPageLoad = function (t) {\n return null == t && (t = {}), e.dispatch(\"turbolinks:load\", {\n data: {\n url: this.location.absoluteURL,\n timing: t\n }\n });\n }, r.prototype.startVisit = function (t, e, r) {\n var n;\n return null != (n = this.currentVisit) && n.cancel(), this.currentVisit = this.createVisit(t, e, r), this.currentVisit.start(), this.notifyApplicationAfterVisitingLocation(t);\n }, r.prototype.createVisit = function (t, r, n) {\n var o, i, s, a, u;\n return i = null != n ? n : {}, a = i.restorationIdentifier, s = i.restorationData, o = i.historyChanged, u = new e.Visit(this, t, r), u.restorationIdentifier = null != a ? a : e.uuid(), u.restorationData = e.copyObject(s), u.historyChanged = o, u.referrer = this.location, u;\n }, r.prototype.visitCompleted = function (t) {\n return this.notifyApplicationAfterPageLoad(t.getTimingMetrics());\n }, r.prototype.clickEventIsSignificant = function (t) {\n return !(t.defaultPrevented || t.target.isContentEditable || t.which > 1 || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey);\n }, r.prototype.getVisitableLinkForNode = function (t) {\n return this.nodeIsVisitable(t) ? e.closest(t, \"a[href]:not([target]):not([download])\") : void 0;\n }, r.prototype.getVisitableLocationForLink = function (t) {\n var r;\n return r = new e.Location(t.getAttribute(\"href\")), this.locationIsVisitable(r) ? r : void 0;\n }, r.prototype.getActionForLink = function (t) {\n var e;\n return null != (e = t.getAttribute(\"data-turbolinks-action\")) ? e : \"advance\";\n }, r.prototype.nodeIsVisitable = function (t) {\n var r;\n return (r = e.closest(t, \"[data-turbolinks]\")) ? \"false\" !== r.getAttribute(\"data-turbolinks\") : !0;\n }, r.prototype.locationIsVisitable = function (t) {\n return t.isPrefixedBy(this.view.getRootLocation()) && t.isHTML();\n }, r.prototype.getCurrentRestorationData = function () {\n return this.getRestorationDataForIdentifier(this.restorationIdentifier);\n }, r.prototype.getRestorationDataForIdentifier = function (t) {\n var e;\n return null != (e = this.restorationData)[t] ? e[t] : e[t] = {};\n }, r;\n }();\n }.call(this), function () {\n !function () {\n var t, e;\n if ((t = e = document.currentScript) && !e.hasAttribute(\"data-turbolinks-suppress-warning\")) for (; t = t.parentNode;) {\n if (t === document.body) return console.warn(\"You are loading Turbolinks from a \n * \n * @example\n *
AMD\n * // main.js\n * require.config({\n * paths: {\n * braintreeClient: 'https://js.braintreegateway.com/web/{@pkg version}/js/client.min'\n * }\n * });\n *\n * require(['braintreeClient'], function (braintreeClient) {\n * braintreeClient.create(...);\n * });\n */\n\n /**\n * @global\n * @callback callback\n * @param {?BraintreeError} [err] `null` or `undefined` if there was no error.\n * @param {?any} [data] The successful result of the asynchronous function call (if data exists).\n * @description The Node.js-style callback pattern used throughout the SDK.\n * @returns {void}\n */\n\n var americanExpress = _dereq_('./american-express');\n\n var applePay = _dereq_('./apple-pay');\n\n var client = _dereq_('./client');\n\n var dataCollector = _dereq_('./data-collector');\n\n var hostedFields = _dereq_('./hosted-fields');\n\n var localPayment = _dereq_('./local-payment');\n\n var masterpass = _dereq_('./masterpass');\n\n var paymentRequest = _dereq_('./payment-request');\n\n var paypal = _dereq_('./paypal');\n\n var paypalCheckout = _dereq_('./paypal-checkout');\n\n var googlePayment = _dereq_('./google-payment');\n\n var threeDSecure = _dereq_('./three-d-secure');\n\n var unionpay = _dereq_('./unionpay');\n\n var usBankAccount = _dereq_('./us-bank-account');\n\n var vaultManager = _dereq_('./vault-manager');\n\n var venmo = _dereq_('./venmo');\n\n var visaCheckout = _dereq_('./visa-checkout');\n\n var preferredPaymentMethods = _dereq_('./preferred-payment-methods');\n\n var VERSION = \"3.76.1\";\n module.exports = {\n /** @type {module:braintree-web/american-express} */\n americanExpress: americanExpress,\n\n /** @type {module:braintree-web/apple-pay} */\n applePay: applePay,\n\n /** @type {module:braintree-web/client} */\n client: client,\n\n /** @type {module:braintree-web/data-collector} */\n dataCollector: dataCollector,\n\n /** @type {module:braintree-web/hosted-fields} */\n hostedFields: hostedFields,\n\n /** @type {module:braintree-web/local-payment} */\n localPayment: localPayment,\n\n /** @type {module:braintree-web/masterpass} */\n masterpass: masterpass,\n\n /** @type {module:braintree-web/google-payment} */\n googlePayment: googlePayment,\n\n /** @type {module:braintree-web/payment-request} */\n paymentRequest: paymentRequest,\n\n /** @type {module:braintree-web/paypal} */\n paypal: paypal,\n\n /** @type {module:braintree-web/paypal-checkout} */\n paypalCheckout: paypalCheckout,\n\n /** @type {module:braintree-web/three-d-secure} */\n threeDSecure: threeDSecure,\n\n /** @type {module:braintree-web/unionpay} */\n unionpay: unionpay,\n\n /** @type {module:braintree-web/us-bank-account} */\n usBankAccount: usBankAccount,\n\n /** @type {module:braintree-web/vault-manager} */\n vaultManager: vaultManager,\n\n /** @type {module:braintree-web/venmo} */\n venmo: venmo,\n\n /** @type {module:braintree-web/visa-checkout} */\n visaCheckout: visaCheckout,\n\n /** @type {module:braintree-web/preferred-payment-methods} */\n preferredPaymentMethods: preferredPaymentMethods,\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"./american-express\": 72,\n \"./apple-pay\": 75,\n \"./client\": 81,\n \"./data-collector\": 100,\n \"./google-payment\": 105,\n \"./hosted-fields\": 112,\n \"./local-payment\": 166,\n \"./masterpass\": 169,\n \"./payment-request\": 174,\n \"./paypal\": 181,\n \"./paypal-checkout\": 178,\n \"./preferred-payment-methods\": 184,\n \"./three-d-secure\": 194,\n \"./unionpay\": 198,\n \"./us-bank-account\": 204,\n \"./vault-manager\": 207,\n \"./venmo\": 212,\n \"./visa-checkout\": 220\n }],\n 120: [function (_dereq_, module, exports) {\n 'use strict';\n\n var createAuthorizationData = _dereq_('./create-authorization-data');\n\n var jsonClone = _dereq_('./json-clone');\n\n var constants = _dereq_('./constants');\n\n function addMetadata(configuration, data) {\n var key;\n var attrs = data ? jsonClone(data) : {};\n var authAttrs = createAuthorizationData(configuration.authorization).attrs;\n\n var _meta = jsonClone(configuration.analyticsMetadata);\n\n attrs.braintreeLibraryVersion = constants.BRAINTREE_LIBRARY_VERSION;\n\n for (key in attrs._meta) {\n if (attrs._meta.hasOwnProperty(key)) {\n _meta[key] = attrs._meta[key];\n }\n }\n\n attrs._meta = _meta;\n\n if (authAttrs.tokenizationKey) {\n attrs.tokenizationKey = authAttrs.tokenizationKey;\n } else {\n attrs.authorizationFingerprint = authAttrs.authorizationFingerprint;\n }\n\n return attrs;\n }\n\n module.exports = addMetadata;\n }, {\n \"./constants\": 128,\n \"./create-authorization-data\": 132,\n \"./json-clone\": 156\n }],\n 121: [function (_dereq_, module, exports) {\n 'use strict';\n\n var Promise = _dereq_('./promise');\n\n var constants = _dereq_('./constants');\n\n var addMetadata = _dereq_('./add-metadata');\n\n function sendAnalyticsEvent(clientInstanceOrPromise, kind, callback) {\n var timestamp = Date.now(); // milliseconds\n\n return Promise.resolve(clientInstanceOrPromise).then(function (client) {\n var timestampInPromise = Date.now();\n var configuration = client.getConfiguration();\n var request = client._request;\n var url = configuration.gatewayConfiguration.analytics.url;\n var data = {\n analytics: [{\n kind: constants.ANALYTICS_PREFIX + kind,\n isAsync: Math.floor(timestampInPromise / 1000) !== Math.floor(timestamp / 1000),\n timestamp: timestamp\n }]\n };\n request({\n url: url,\n method: 'post',\n data: addMetadata(configuration, data),\n timeout: constants.ANALYTICS_REQUEST_TIMEOUT_MS\n }, callback);\n });\n }\n\n module.exports = {\n sendEvent: sendAnalyticsEvent\n };\n }, {\n \"./add-metadata\": 120,\n \"./constants\": 128,\n \"./promise\": 159\n }],\n 122: [function (_dereq_, module, exports) {\n 'use strict';\n\n var loadScript = _dereq_('@braintree/asset-loader/load-script');\n\n module.exports = {\n loadScript: loadScript\n };\n }, {\n \"@braintree/asset-loader/load-script\": 3\n }],\n 123: [function (_dereq_, module, exports) {\n 'use strict';\n\n var assignNormalized = typeof Object.assign === 'function' ? Object.assign : assignPolyfill;\n\n function assignPolyfill(destination) {\n var i, source, key;\n\n for (i = 1; i < arguments.length; i++) {\n source = arguments[i];\n\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = source[key];\n }\n }\n }\n\n return destination;\n }\n\n module.exports = {\n assign: assignNormalized,\n _assign: assignPolyfill\n };\n }, {}],\n 124: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BraintreeError = _dereq_('./braintree-error');\n\n var Promise = _dereq_('./promise');\n\n var sharedErrors = _dereq_('./errors');\n\n var VERSION = \"3.76.1\";\n\n function basicComponentVerification(options) {\n var client, authorization, name;\n\n if (!options) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.INVALID_USE_OF_INTERNAL_FUNCTION.type,\n code: sharedErrors.INVALID_USE_OF_INTERNAL_FUNCTION.code,\n message: 'Options must be passed to basicComponentVerification function.'\n }));\n }\n\n name = options.name;\n client = options.client;\n authorization = options.authorization;\n\n if (!client && !authorization) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.INSTANTIATION_OPTION_REQUIRED.type,\n code: sharedErrors.INSTANTIATION_OPTION_REQUIRED.code,\n // NEXT_MAJOR_VERSION in major version, we expose passing in authorization for all components\n // instead of passing in a client instance. Leave this a silent feature for now.\n message: 'options.client is required when instantiating ' + name + '.'\n }));\n }\n\n if (!authorization && client.getVersion() !== VERSION) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.INCOMPATIBLE_VERSIONS.type,\n code: sharedErrors.INCOMPATIBLE_VERSIONS.code,\n message: 'Client (version ' + client.getVersion() + ') and ' + name + ' (version ' + VERSION + ') components must be from the same SDK version.'\n }));\n }\n\n return Promise.resolve();\n }\n\n module.exports = {\n verify: basicComponentVerification\n };\n }, {\n \"./braintree-error\": 126,\n \"./errors\": 137,\n \"./promise\": 159\n }],\n 125: [function (_dereq_, module, exports) {\n 'use strict';\n\n var once = _dereq_('./once');\n\n function call(fn, callback) {\n var isSync = fn.length === 0;\n\n if (isSync) {\n fn();\n callback(null);\n } else {\n fn(callback);\n }\n }\n\n module.exports = function (functions, cb) {\n var i;\n var length = functions.length;\n var remaining = length;\n var callback = once(cb);\n\n if (length === 0) {\n callback(null);\n return;\n }\n\n function finish(err) {\n if (err) {\n callback(err);\n return;\n }\n\n remaining -= 1;\n\n if (remaining === 0) {\n callback(null);\n }\n }\n\n for (i = 0; i < length; i++) {\n call(functions[i], finish);\n }\n };\n }, {\n \"./once\": 158\n }],\n 126: [function (_dereq_, module, exports) {\n 'use strict';\n\n var enumerate = _dereq_('./enumerate');\n /**\n * @class\n * @global\n * @param {object} options Construction options\n * @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.\n * @description
You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.\n */\n\n\n function BraintreeError(options) {\n if (!BraintreeError.types.hasOwnProperty(options.type)) {\n throw new Error(options.type + ' is not a valid type.');\n }\n\n if (!options.code) {\n throw new Error('Error code required.');\n }\n\n if (!options.message) {\n throw new Error('Error message required.');\n }\n\n this.name = 'BraintreeError';\n /**\n * @type {string}\n * @description A code that corresponds to specific errors.\n */\n\n this.code = options.code;\n /**\n * @type {string}\n * @description A short description of the error.\n */\n\n this.message = options.message;\n /**\n * @type {BraintreeError.types}\n * @description The type of error.\n */\n\n this.type = options.type;\n /**\n * @type {object=}\n * @description Additional information about the error, such as an underlying network error response.\n */\n\n this.details = options.details;\n }\n\n BraintreeError.prototype = Object.create(Error.prototype);\n BraintreeError.prototype.constructor = BraintreeError;\n /**\n * Enum for {@link BraintreeError} types.\n * @name BraintreeError.types\n * @enum\n * @readonly\n * @memberof BraintreeError\n * @property {string} CUSTOMER An error caused by the customer.\n * @property {string} MERCHANT An error that is actionable by the merchant.\n * @property {string} NETWORK An error due to a network problem.\n * @property {string} INTERNAL An error caused by Braintree code.\n * @property {string} UNKNOWN An error where the origin is unknown.\n */\n\n BraintreeError.types = enumerate(['CUSTOMER', 'MERCHANT', 'NETWORK', 'INTERNAL', 'UNKNOWN']);\n\n BraintreeError.findRootError = function (err) {\n if (err instanceof BraintreeError && err.details && err.details.originalError) {\n return BraintreeError.findRootError(err.details.originalError);\n }\n\n return err;\n };\n\n module.exports = BraintreeError;\n }, {\n \"./enumerate\": 136\n }],\n 127: [function (_dereq_, module, exports) {\n 'use strict'; // Taken from https://github.com/sindresorhus/decamelize/blob/95980ab6fb44c40eaca7792bdf93aff7c210c805/index.js\n\n function transformKey(key) {\n return key.replace(/([a-z\\d])([A-Z])/g, '$1_$2').replace(/([A-Z]+)([A-Z][a-z\\d]+)/g, '$1_$2').toLowerCase();\n }\n\n module.exports = function (obj) {\n return Object.keys(obj).reduce(function (newObj, key) {\n var transformedKey = transformKey(key);\n newObj[transformedKey] = obj[key];\n return newObj;\n }, {});\n };\n }, {}],\n 128: [function (_dereq_, module, exports) {\n 'use strict';\n\n var VERSION = \"3.76.1\";\n var PLATFORM = 'web';\n var CLIENT_API_URLS = {\n production: 'https://api.braintreegateway.com:443',\n sandbox: 'https://api.sandbox.braintreegateway.com:443'\n };\n var ASSETS_URLS = {\n production: 'https://assets.braintreegateway.com',\n sandbox: 'https://assets.braintreegateway.com'\n };\n var GRAPHQL_URLS = {\n production: 'https://payments.braintree-api.com/graphql',\n sandbox: 'https://payments.sandbox.braintree-api.com/graphql'\n }; // endRemoveIf(production)\n\n module.exports = {\n ANALYTICS_PREFIX: PLATFORM + '.',\n ANALYTICS_REQUEST_TIMEOUT_MS: 2000,\n ASSETS_URLS: ASSETS_URLS,\n CLIENT_API_URLS: CLIENT_API_URLS,\n FRAUDNET_SOURCE: 'BRAINTREE_SIGNIN',\n FRAUDNET_FNCLS: 'fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99',\n FRAUDNET_URL: 'https://c.paypal.com/da/r/fb.js',\n BUS_CONFIGURATION_REQUEST_EVENT: 'BUS_CONFIGURATION_REQUEST',\n GRAPHQL_URLS: GRAPHQL_URLS,\n INTEGRATION_TIMEOUT_MS: 60000,\n VERSION: VERSION,\n INTEGRATION: 'custom',\n SOURCE: 'client',\n PLATFORM: PLATFORM,\n BRAINTREE_LIBRARY_VERSION: 'braintree/' + PLATFORM + '/' + VERSION\n };\n }, {}],\n 129: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BraintreeError = _dereq_('./braintree-error');\n\n var sharedErrors = _dereq_('./errors');\n\n module.exports = function (instance, methodNames) {\n methodNames.forEach(function (methodName) {\n instance[methodName] = function () {\n throw new BraintreeError({\n type: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.type,\n code: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.code,\n message: methodName + ' cannot be called after teardown.'\n });\n };\n });\n };\n }, {\n \"./braintree-error\": 126,\n \"./errors\": 137\n }],\n 130: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BraintreeError = _dereq_('./braintree-error');\n\n function convertToBraintreeError(originalErr, btErrorObject) {\n if (originalErr instanceof BraintreeError) {\n return originalErr;\n }\n\n return new BraintreeError({\n type: btErrorObject.type,\n code: btErrorObject.code,\n message: btErrorObject.message,\n details: {\n originalError: originalErr\n }\n });\n }\n\n module.exports = convertToBraintreeError;\n }, {\n \"./braintree-error\": 126\n }],\n 131: [function (_dereq_, module, exports) {\n 'use strict'; // endRemoveIf(production)\n\n var ASSETS_URLS = _dereq_('./constants').ASSETS_URLS;\n\n function createAssetsUrl(authorization) {\n // endRemoveIf(production)\n return ASSETS_URLS.production;\n }\n /* eslint-enable */\n\n\n module.exports = {\n create: createAssetsUrl\n };\n }, {\n \"./constants\": 128\n }],\n 132: [function (_dereq_, module, exports) {\n 'use strict';\n\n var atob = _dereq_('../lib/vendor/polyfill').atob;\n\n var CLIENT_API_URLS = _dereq_('../lib/constants').CLIENT_API_URLS;\n\n function _isTokenizationKey(str) {\n return /^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(str);\n }\n\n function _parseTokenizationKey(tokenizationKey) {\n var tokens = tokenizationKey.split('_');\n var environment = tokens[0];\n var merchantId = tokens.slice(2).join('_');\n return {\n merchantId: merchantId,\n environment: environment\n };\n }\n\n function createAuthorizationData(authorization) {\n var parsedClientToken, parsedTokenizationKey;\n var data = {\n attrs: {},\n configUrl: ''\n };\n\n if (_isTokenizationKey(authorization)) {\n parsedTokenizationKey = _parseTokenizationKey(authorization);\n data.environment = parsedTokenizationKey.environment;\n data.attrs.tokenizationKey = authorization;\n data.configUrl = CLIENT_API_URLS[parsedTokenizationKey.environment] + '/merchants/' + parsedTokenizationKey.merchantId + '/client_api/v1/configuration';\n } else {\n parsedClientToken = JSON.parse(atob(authorization));\n data.environment = parsedClientToken.environment;\n data.attrs.authorizationFingerprint = parsedClientToken.authorizationFingerprint;\n data.configUrl = parsedClientToken.configUrl;\n data.graphQL = parsedClientToken.graphQL;\n }\n\n return data;\n }\n\n module.exports = createAuthorizationData;\n }, {\n \"../lib/constants\": 128,\n \"../lib/vendor/polyfill\": 163\n }],\n 133: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BraintreeError = _dereq_('./braintree-error');\n\n var Promise = _dereq_('./promise');\n\n var assets = _dereq_('./assets');\n\n var sharedErrors = _dereq_('./errors');\n\n var VERSION = \"3.76.1\";\n\n function createDeferredClient(options) {\n var promise = Promise.resolve();\n\n if (options.client) {\n return Promise.resolve(options.client);\n }\n\n if (!(window.braintree && window.braintree.client)) {\n promise = assets.loadScript({\n src: options.assetsUrl + '/web/' + VERSION + '/js/client.min.js'\n }).catch(function (err) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.type,\n code: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.code,\n message: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.message,\n details: {\n originalError: err\n }\n }));\n });\n }\n\n return promise.then(function () {\n if (window.braintree.client.VERSION !== VERSION) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.INCOMPATIBLE_VERSIONS.type,\n code: sharedErrors.INCOMPATIBLE_VERSIONS.code,\n message: 'Client (version ' + window.braintree.client.VERSION + ') and ' + options.name + ' (version ' + VERSION + ') components must be from the same SDK version.'\n }));\n }\n\n return window.braintree.client.create({\n authorization: options.authorization,\n debug: options.debug\n });\n });\n }\n\n module.exports = {\n create: createDeferredClient\n };\n }, {\n \"./assets\": 122,\n \"./braintree-error\": 126,\n \"./errors\": 137,\n \"./promise\": 159\n }],\n 134: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = function (fn) {\n return function () {\n // IE9 doesn't support passing arguments to setTimeout so we have to emulate it.\n var args = arguments;\n setTimeout(function () {\n fn.apply(null, args);\n }, 1);\n };\n };\n }, {}],\n 135: [function (_dereq_, module, exports) {\n 'use strict';\n\n var batchExecuteFunctions = _dereq_('./batch-execute-functions');\n\n function Destructor() {\n this._teardownRegistry = [];\n this._isTearingDown = false;\n }\n\n Destructor.prototype.registerFunctionForTeardown = function (fn) {\n if (typeof fn === 'function') {\n this._teardownRegistry.push(fn);\n }\n };\n\n Destructor.prototype.teardown = function (callback) {\n if (this._isTearingDown) {\n callback(new Error('Destructor is already tearing down'));\n return;\n }\n\n this._isTearingDown = true;\n batchExecuteFunctions(this._teardownRegistry, function (err) {\n this._teardownRegistry = [];\n this._isTearingDown = false;\n\n if (typeof callback === 'function') {\n callback(err);\n }\n }.bind(this));\n };\n\n module.exports = Destructor;\n }, {\n \"./batch-execute-functions\": 125\n }],\n 136: [function (_dereq_, module, exports) {\n 'use strict';\n\n function enumerate(values, prefix) {\n prefix = prefix == null ? '' : prefix;\n return values.reduce(function (enumeration, value) {\n enumeration[value] = prefix + value;\n return enumeration;\n }, {});\n }\n\n module.exports = enumerate;\n }, {}],\n 137: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Shared Internal Error Codes\n * @ignore\n * @description These codes should never be experienced by the merchant directly.\n * @property {INTERNAL} INVALID_USE_OF_INTERNAL_FUNCTION Occurs when the client is created without a gateway configuration. Should never happen.\n */\n\n /**\n * @name BraintreeError.Shared Errors - Component Creation Error Codes\n * @description Errors that occur when creating components.\n * @property {MERCHANT} INSTANTIATION_OPTION_REQUIRED Occurs when a component is created that is missing a required option.\n * @property {MERCHANT} INCOMPATIBLE_VERSIONS Occurs when a component is created with a client with a different version than the component.\n * @property {NETWORK} CLIENT_SCRIPT_FAILED_TO_LOAD Occurs when a component attempts to load the Braintree client script, but the request fails.\n */\n\n /**\n * @name BraintreeError.Shared Errors - Component Instance Error Codes\n * @description Errors that occur when using instances of components.\n * @property {MERCHANT} METHOD_CALLED_AFTER_TEARDOWN Occurs when a method is called on a component instance after it has been torn down.\n */\n\n var BraintreeError = _dereq_('./braintree-error');\n\n module.exports = {\n INVALID_USE_OF_INTERNAL_FUNCTION: {\n type: BraintreeError.types.INTERNAL,\n code: 'INVALID_USE_OF_INTERNAL_FUNCTION'\n },\n INSTANTIATION_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'INSTANTIATION_OPTION_REQUIRED'\n },\n INCOMPATIBLE_VERSIONS: {\n type: BraintreeError.types.MERCHANT,\n code: 'INCOMPATIBLE_VERSIONS'\n },\n CLIENT_SCRIPT_FAILED_TO_LOAD: {\n type: BraintreeError.types.NETWORK,\n code: 'CLIENT_SCRIPT_FAILED_TO_LOAD',\n message: 'Braintree client script could not be loaded.'\n },\n METHOD_CALLED_AFTER_TEARDOWN: {\n type: BraintreeError.types.MERCHANT,\n code: 'METHOD_CALLED_AFTER_TEARDOWN'\n }\n };\n }, {\n \"./braintree-error\": 126\n }],\n 138: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = function findRootNode(element) {\n while (element.parentNode) {\n element = element.parentNode;\n }\n\n return element;\n };\n }, {}],\n 139: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = function (array, key, value) {\n var i;\n\n for (i = 0; i < array.length; i++) {\n if (array[i].hasOwnProperty(key) && array[i][key] === value) {\n return array[i];\n }\n }\n\n return null;\n };\n }, {}],\n 140: [function (_dereq_, module, exports) {\n 'use strict';\n\n var Popup = _dereq_('./strategies/popup');\n\n var PopupBridge = _dereq_('./strategies/popup-bridge');\n\n var Modal = _dereq_('./strategies/modal');\n\n var Bus = _dereq_('framebus');\n\n var events = _dereq_('../shared/events');\n\n var errors = _dereq_('../shared/errors');\n\n var constants = _dereq_('../shared/constants');\n\n var uuid = _dereq_('@braintree/uuid');\n\n var iFramer = _dereq_('@braintree/iframer');\n\n var BraintreeError = _dereq_('../../braintree-error');\n\n var browserDetection = _dereq_('../shared/browser-detection');\n\n var isHTTPS = _dereq_('../../is-https');\n\n var assign = _dereq_('./../../assign').assign;\n\n var BUS_CONFIGURATION_REQUEST_EVENT = _dereq_('../../constants').BUS_CONFIGURATION_REQUEST_EVENT;\n\n var REQUIRED_CONFIG_KEYS = ['name', 'dispatchFrameUrl', 'openFrameUrl'];\n\n function noop() {}\n\n function _validateFrameConfiguration(options) {\n if (!options) {\n throw new Error('Valid configuration is required');\n }\n\n REQUIRED_CONFIG_KEYS.forEach(function (key) {\n if (!options.hasOwnProperty(key)) {\n throw new Error('A valid frame ' + key + ' must be provided');\n }\n });\n\n if (!/^[\\w_]+$/.test(options.name)) {\n throw new Error('A valid frame name must be provided');\n }\n }\n\n function FrameService(options) {\n _validateFrameConfiguration(options);\n\n this._serviceId = uuid().replace(/-/g, '');\n this._options = {\n name: options.name + '_' + this._serviceId,\n dispatchFrameUrl: options.dispatchFrameUrl,\n openFrameUrl: options.openFrameUrl,\n height: options.height,\n width: options.width,\n top: options.top,\n left: options.left\n };\n this.state = options.state || {};\n this._bus = new Bus({\n channel: this._serviceId\n });\n\n this._setBusEvents();\n }\n\n FrameService.prototype.initialize = function (callback) {\n var dispatchFrameReadyHandler = function () {\n callback();\n\n this._bus.off(events.DISPATCH_FRAME_READY, dispatchFrameReadyHandler);\n }.bind(this);\n\n this._bus.on(events.DISPATCH_FRAME_READY, dispatchFrameReadyHandler);\n\n this._writeDispatchFrame();\n };\n\n FrameService.prototype._writeDispatchFrame = function () {\n var frameName = constants.DISPATCH_FRAME_NAME + '_' + this._serviceId;\n var frameSrc = this._options.dispatchFrameUrl;\n this._dispatchFrame = iFramer({\n 'aria-hidden': true,\n name: frameName,\n title: frameName,\n src: frameSrc,\n 'class': constants.DISPATCH_FRAME_CLASS,\n height: 0,\n width: 0,\n style: {\n position: 'absolute',\n left: '-9999px'\n }\n });\n document.body.appendChild(this._dispatchFrame);\n };\n\n FrameService.prototype._setBusEvents = function () {\n this._bus.on(events.DISPATCH_FRAME_REPORT, function (res, reply) {\n if (this._onCompleteCallback) {\n this._onCompleteCallback.call(null, res.err, res.payload);\n }\n\n this._frame.close();\n\n this._onCompleteCallback = null;\n\n if (reply) {\n reply();\n }\n }.bind(this));\n\n this._bus.on(BUS_CONFIGURATION_REQUEST_EVENT, function (reply) {\n reply(this.state);\n }.bind(this));\n };\n\n FrameService.prototype.open = function (options, callback) {\n var error;\n options = options || {};\n this._frame = this._getFrameForEnvironment(options);\n\n this._frame.initialize(callback);\n\n if (this._frame instanceof PopupBridge) {\n return;\n }\n\n assign(this.state, options.state);\n this._onCompleteCallback = callback;\n\n this._frame.open();\n\n if (this.isFrameClosed()) {\n this._cleanupFrame();\n\n if (callback) {\n if (browserDetection.isIE() && !isHTTPS.isHTTPS()) {\n error = new BraintreeError(errors.FRAME_SERVICE_FRAME_OPEN_FAILED_IE_BUG);\n } else {\n error = new BraintreeError(errors.FRAME_SERVICE_FRAME_OPEN_FAILED);\n }\n\n callback(error);\n }\n\n return;\n }\n\n this._pollForPopupClose();\n };\n\n FrameService.prototype.redirect = function (url) {\n if (this._frame && !this.isFrameClosed()) {\n this._frame.redirect(url);\n }\n };\n\n FrameService.prototype.close = function () {\n if (!this.isFrameClosed()) {\n this._frame.close();\n }\n };\n\n FrameService.prototype.focus = function () {\n if (!this.isFrameClosed()) {\n this._frame.focus();\n }\n };\n\n FrameService.prototype.createHandler = function (options) {\n options = options || {};\n return {\n close: function () {\n if (options.beforeClose) {\n options.beforeClose();\n }\n\n this.close();\n }.bind(this),\n focus: function () {\n if (options.beforeFocus) {\n options.beforeFocus();\n }\n\n this.focus();\n }.bind(this)\n };\n };\n\n FrameService.prototype.createNoopHandler = function () {\n return {\n close: noop,\n focus: noop\n };\n };\n\n FrameService.prototype.teardown = function () {\n this.close();\n\n this._dispatchFrame.parentNode.removeChild(this._dispatchFrame);\n\n this._dispatchFrame = null;\n\n this._cleanupFrame();\n };\n\n FrameService.prototype.isFrameClosed = function () {\n return this._frame == null || this._frame.isClosed();\n };\n\n FrameService.prototype._cleanupFrame = function () {\n this._frame = null;\n clearInterval(this._popupInterval);\n this._popupInterval = null;\n };\n\n FrameService.prototype._pollForPopupClose = function () {\n this._popupInterval = setInterval(function () {\n if (this.isFrameClosed()) {\n this._cleanupFrame();\n\n if (this._onCompleteCallback) {\n this._onCompleteCallback(new BraintreeError(errors.FRAME_SERVICE_FRAME_CLOSED));\n }\n }\n }.bind(this), constants.POPUP_POLL_INTERVAL);\n return this._popupInterval;\n };\n\n FrameService.prototype._getFrameForEnvironment = function (options) {\n var usePopup = browserDetection.supportsPopups();\n var popupBridgeExists = Boolean(window.popupBridge);\n var initOptions = assign({}, this._options, options);\n\n if (popupBridgeExists) {\n return new PopupBridge(initOptions);\n } else if (usePopup) {\n return new Popup(initOptions);\n }\n\n return new Modal(initOptions);\n };\n\n module.exports = FrameService;\n }, {\n \"../../braintree-error\": 126,\n \"../../constants\": 128,\n \"../../is-https\": 154,\n \"../shared/browser-detection\": 147,\n \"../shared/constants\": 148,\n \"../shared/errors\": 149,\n \"../shared/events\": 150,\n \"./../../assign\": 123,\n \"./strategies/modal\": 142,\n \"./strategies/popup\": 145,\n \"./strategies/popup-bridge\": 143,\n \"@braintree/iframer\": 36,\n \"@braintree/uuid\": 40,\n \"framebus\": 53\n }],\n 141: [function (_dereq_, module, exports) {\n 'use strict';\n\n var FrameService = _dereq_('./frame-service');\n\n module.exports = {\n create: function createFrameService(options, callback) {\n var frameService = new FrameService(options);\n frameService.initialize(function () {\n callback(frameService);\n });\n }\n };\n }, {\n \"./frame-service\": 140\n }],\n 142: [function (_dereq_, module, exports) {\n 'use strict';\n\n var iFramer = _dereq_('@braintree/iframer');\n\n var assign = _dereq_('../../../assign').assign;\n\n var browserDetection = _dereq_('../../shared/browser-detection');\n\n var ELEMENT_STYLES = {\n position: 'fixed',\n top: 0,\n left: 0,\n bottom: 0,\n padding: 0,\n margin: 0,\n border: 0,\n outline: 'none',\n zIndex: 20001,\n background: '#FFFFFF'\n };\n\n function noop() {}\n\n function Modal(options) {\n this._closed = null;\n this._frame = null;\n this._options = options || {};\n this._container = this._options.container || document.body;\n }\n\n Modal.prototype.initialize = noop;\n\n Modal.prototype.open = function () {\n var iframerConfig = {\n src: this._options.openFrameUrl,\n name: this._options.name,\n scrolling: 'yes',\n height: '100%',\n width: '100%',\n style: assign({}, ELEMENT_STYLES),\n title: 'Lightbox Frame'\n };\n\n if (browserDetection.isIos()) {\n // WKWebView has buggy behavior when scrolling a fixed position modal. The workaround is to lock scrolling in\n // the background. When modal is closed, we restore scrolling and return to the previous scroll position.\n if (browserDetection.isIosWKWebview()) {\n this._lockScrolling(); // Allows WKWebView to scroll all the way down to bottom\n\n\n iframerConfig.style = {};\n }\n\n this._el = document.createElement('div');\n assign(this._el.style, ELEMENT_STYLES, {\n height: '100%',\n width: '100%',\n overflow: 'auto',\n '-webkit-overflow-scrolling': 'touch'\n });\n this._frame = iFramer(iframerConfig);\n\n this._el.appendChild(this._frame);\n } else {\n this._el = this._frame = iFramer(iframerConfig);\n }\n\n this._closed = false;\n\n this._container.appendChild(this._el);\n };\n\n Modal.prototype.focus = noop;\n\n Modal.prototype.close = function () {\n this._container.removeChild(this._el);\n\n this._frame = null;\n this._closed = true;\n\n if (browserDetection.isIosWKWebview()) {\n this._unlockScrolling();\n }\n };\n\n Modal.prototype.isClosed = function () {\n return Boolean(this._closed);\n };\n\n Modal.prototype.redirect = function (redirectUrl) {\n this._frame.src = redirectUrl;\n };\n\n Modal.prototype._unlockScrolling = function () {\n document.body.style.overflow = this._savedBodyProperties.overflowStyle;\n document.body.style.position = this._savedBodyProperties.positionStyle;\n window.scrollTo(this._savedBodyProperties.left, this._savedBodyProperties.top);\n delete this._savedBodyProperties;\n };\n\n Modal.prototype._lockScrolling = function () {\n var doc = document.documentElement; // From https://stackoverflow.com/questions/9538868/prevent-body-from-scrolling-when-a-modal-is-opened#comment65626743_24727206\n\n this._savedBodyProperties = {\n left: (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),\n top: (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0),\n overflowStyle: document.body.style.overflow,\n positionStyle: document.body.style.position\n };\n document.body.style.overflow = 'hidden';\n document.body.style.position = 'fixed';\n window.scrollTo(0, 0);\n };\n\n module.exports = Modal;\n }, {\n \"../../../assign\": 123,\n \"../../shared/browser-detection\": 147,\n \"@braintree/iframer\": 36\n }],\n 143: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BraintreeError = _dereq_('../../../braintree-error');\n\n var errors = _dereq_('../../shared/errors');\n\n function noop() {}\n\n function PopupBridge(options) {\n this._closed = null;\n this._options = options;\n }\n\n PopupBridge.prototype.initialize = function (callback) {\n var self = this;\n\n window.popupBridge.onComplete = function (err, payload) {\n var popupDismissed = !payload && !err;\n self._closed = true;\n\n if (err || popupDismissed) {\n // User clicked \"Done\" button of browser view\n callback(new BraintreeError(errors.FRAME_SERVICE_FRAME_CLOSED));\n return;\n } // User completed popup flow (includes success and cancel cases)\n\n\n callback(null, payload);\n };\n };\n\n PopupBridge.prototype.open = function (options) {\n var url;\n options = options || {};\n url = options.openFrameUrl || this._options.openFrameUrl;\n this._closed = false;\n window.popupBridge.open(url);\n };\n\n PopupBridge.prototype.focus = noop;\n PopupBridge.prototype.close = noop;\n\n PopupBridge.prototype.isClosed = function () {\n return Boolean(this._closed);\n };\n\n PopupBridge.prototype.redirect = function (redirectUrl) {\n this.open({\n openFrameUrl: redirectUrl\n });\n };\n\n module.exports = PopupBridge;\n }, {\n \"../../../braintree-error\": 126,\n \"../../shared/errors\": 149\n }],\n 144: [function (_dereq_, module, exports) {\n 'use strict';\n\n var constants = _dereq_('../../../shared/constants');\n\n var position = _dereq_('./position');\n\n function calculatePosition(type, userDefinedPosition, size) {\n if (typeof userDefinedPosition !== 'undefined') {\n return userDefinedPosition;\n }\n\n return position[type](size);\n }\n\n module.exports = function composePopupOptions(options) {\n var height = options.height || constants.DEFAULT_POPUP_HEIGHT;\n var width = options.width || constants.DEFAULT_POPUP_WIDTH;\n var top = calculatePosition('top', options.top, height);\n var left = calculatePosition('left', options.left, width);\n return [constants.POPUP_BASE_OPTIONS, 'height=' + height, 'width=' + width, 'top=' + top, 'left=' + left].join(',');\n };\n }, {\n \"../../../shared/constants\": 148,\n \"./position\": 146\n }],\n 145: [function (_dereq_, module, exports) {\n 'use strict';\n\n var composeOptions = _dereq_('./compose-options');\n\n function noop() {}\n\n function Popup(options) {\n this._frame = null;\n this._options = options || {};\n this.open();\n }\n\n Popup.prototype.initialize = noop;\n\n Popup.prototype.open = function () {\n this._frame = window.open(this._options.openFrameUrl, this._options.name, composeOptions(this._options));\n };\n\n Popup.prototype.focus = function () {\n this._frame.focus();\n };\n\n Popup.prototype.close = function () {\n if (this._frame.closed) {\n return;\n }\n\n this._frame.close();\n };\n\n Popup.prototype.isClosed = function () {\n return !this._frame || Boolean(this._frame.closed);\n };\n\n Popup.prototype.redirect = function (redirectUrl) {\n this._frame.location.href = redirectUrl;\n };\n\n module.exports = Popup;\n }, {\n \"./compose-options\": 144\n }],\n 146: [function (_dereq_, module, exports) {\n 'use strict';\n\n function top(height) {\n var windowHeight = window.outerHeight || document.documentElement.clientHeight;\n var windowTop = window.screenY == null ? window.screenTop : window.screenY;\n return center(windowHeight, height, windowTop);\n }\n\n function left(width) {\n var windowWidth = window.outerWidth || document.documentElement.clientWidth;\n var windowLeft = window.screenX == null ? window.screenLeft : window.screenX;\n return center(windowWidth, width, windowLeft);\n }\n\n function center(windowMetric, popupMetric, offset) {\n return (windowMetric - popupMetric) / 2 + offset;\n }\n\n module.exports = {\n top: top,\n left: left,\n center: center\n };\n }, {}],\n 147: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n isIos: _dereq_('@braintree/browser-detection/is-ios'),\n isIosWKWebview: _dereq_('@braintree/browser-detection/is-ios-wkwebview'),\n isIE: _dereq_('@braintree/browser-detection/is-ie'),\n supportsPopups: _dereq_('@braintree/browser-detection/supports-popups')\n };\n }, {\n \"@braintree/browser-detection/is-ie\": 25,\n \"@braintree/browser-detection/is-ios\": 31,\n \"@braintree/browser-detection/is-ios-wkwebview\": 30,\n \"@braintree/browser-detection/supports-popups\": 32\n }],\n 148: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n DISPATCH_FRAME_NAME: 'dispatch',\n DISPATCH_FRAME_CLASS: 'braintree-dispatch-frame',\n POPUP_BASE_OPTIONS: 'resizable,scrollbars',\n DEFAULT_POPUP_WIDTH: 450,\n DEFAULT_POPUP_HEIGHT: 535,\n POPUP_POLL_INTERVAL: 100,\n POPUP_CLOSE_TIMEOUT: 100\n };\n }, {}],\n 149: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Popup Related Error Codes\n * @ignore\n * @description Errors that occur when using a component that opens a popup window.\n * @property {INTERNAL} FRAME_SERVICE_FRAME_CLOSED - Occurs when the frame is closed before tokenization can occur.\n * @property {INTERNAL} FRAME_SERVICE_FRAME_OPEN_FAILED - Occurs when the popup could not be opened.\n * @property {INTERNAL} FRAME_SERVICE_FRAME_OPEN_FAILED_IE_BUG - Occurs when the frame could not be opened because of a specific bug in Internet Explorer - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11324352/.\n */\n\n var BraintreeError = _dereq_('../../braintree-error');\n\n module.exports = {\n FRAME_SERVICE_FRAME_CLOSED: {\n type: BraintreeError.types.INTERNAL,\n code: 'FRAME_SERVICE_FRAME_CLOSED',\n message: 'Frame closed before tokenization could occur.'\n },\n FRAME_SERVICE_FRAME_OPEN_FAILED: {\n type: BraintreeError.types.INTERNAL,\n code: 'FRAME_SERVICE_FRAME_OPEN_FAILED',\n message: 'Frame failed to open.'\n },\n FRAME_SERVICE_FRAME_OPEN_FAILED_IE_BUG: {\n type: BraintreeError.types.INTERNAL,\n code: 'FRAME_SERVICE_FRAME_OPEN_FAILED_IE_BUG',\n message: 'Could not open frame. This may be due to a bug in IE browsers when attempting to open an HTTPS page from a HTTP page. https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11324352/'\n }\n };\n }, {\n \"../../braintree-error\": 126\n }],\n 150: [function (_dereq_, module, exports) {\n 'use strict';\n\n var enumerate = _dereq_('../../enumerate');\n\n module.exports = enumerate(['DISPATCH_FRAME_READY', 'DISPATCH_FRAME_REPORT'], 'frameService:');\n }, {\n \"../../enumerate\": 136\n }],\n 151: [function (_dereq_, module, exports) {\n 'use strict';\n\n var VERSION = \"3.76.1\";\n\n var assign = _dereq_('./assign').assign;\n\n function generateTokenizationParameters(configuration, overrides) {\n var metadata = configuration.analyticsMetadata;\n var basicTokenizationParameters = {\n gateway: 'braintree',\n 'braintree:merchantId': configuration.gatewayConfiguration.merchantId,\n 'braintree:apiVersion': 'v1',\n 'braintree:sdkVersion': VERSION,\n 'braintree:metadata': JSON.stringify({\n source: metadata.source,\n integration: metadata.integration,\n sessionId: metadata.sessionId,\n version: VERSION,\n platform: metadata.platform\n })\n };\n return assign({}, basicTokenizationParameters, overrides);\n }\n\n module.exports = function (configuration, googlePayVersion, googleMerchantId) {\n var data, paypalPaymentMethod;\n var androidPayConfiguration = configuration.gatewayConfiguration.androidPay;\n var environment = configuration.gatewayConfiguration.environment === 'production' ? 'PRODUCTION' : 'TEST';\n\n if (googlePayVersion === 2) {\n data = {\n apiVersion: 2,\n apiVersionMinor: 0,\n environment: environment,\n allowedPaymentMethods: [{\n type: 'CARD',\n parameters: {\n allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],\n allowedCardNetworks: androidPayConfiguration.supportedNetworks.map(function (card) {\n return card.toUpperCase();\n })\n },\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: generateTokenizationParameters(configuration, {\n 'braintree:authorizationFingerprint': androidPayConfiguration.googleAuthorizationFingerprint\n })\n }\n }]\n };\n\n if (googleMerchantId) {\n data.merchantInfo = {\n merchantId: googleMerchantId\n };\n }\n\n if (androidPayConfiguration.paypalClientId) {\n paypalPaymentMethod = {\n type: 'PAYPAL',\n parameters: {\n /* eslint-disable camelcase */\n purchase_context: {\n purchase_units: [{\n payee: {\n client_id: androidPayConfiguration.paypalClientId\n },\n recurring_payment: true\n }]\n }\n /* eslint-enable camelcase */\n\n },\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: generateTokenizationParameters(configuration, {\n 'braintree:paypalClientId': androidPayConfiguration.paypalClientId\n })\n }\n };\n data.allowedPaymentMethods.push(paypalPaymentMethod);\n }\n } else {\n data = {\n environment: environment,\n allowedPaymentMethods: ['CARD', 'TOKENIZED_CARD'],\n paymentMethodTokenizationParameters: {\n tokenizationType: 'PAYMENT_GATEWAY',\n parameters: generateTokenizationParameters(configuration, {\n 'braintree:authorizationFingerprint': androidPayConfiguration.googleAuthorizationFingerprint\n })\n },\n cardRequirements: {\n allowedCardNetworks: androidPayConfiguration.supportedNetworks.map(function (card) {\n return card.toUpperCase();\n })\n }\n };\n\n if (configuration.authorizationType === 'TOKENIZATION_KEY') {\n data.paymentMethodTokenizationParameters.parameters['braintree:clientKey'] = configuration.authorization;\n }\n\n if (googleMerchantId) {\n data.merchantId = googleMerchantId;\n }\n\n if (googlePayVersion) {\n data.apiVersion = googlePayVersion;\n }\n }\n\n return data;\n };\n }, {\n \"./assign\": 123\n }],\n 152: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = function inIframe(win) {\n win = win || window;\n\n try {\n return win.self !== win.top;\n } catch (e) {\n return true;\n }\n };\n }, {}],\n 153: [function (_dereq_, module, exports) {\n 'use strict';\n\n function convertDateStringToDate(dateString) {\n var splitDate = dateString.split('-');\n return new Date(splitDate[0], splitDate[1], splitDate[2]);\n }\n\n function isDateStringBeforeOrOn(firstDate, secondDate) {\n return convertDateStringToDate(firstDate) <= convertDateStringToDate(secondDate);\n }\n\n module.exports = isDateStringBeforeOrOn;\n }, {}],\n 154: [function (_dereq_, module, exports) {\n 'use strict';\n\n function isHTTPS(protocol) {\n protocol = protocol || window.location.protocol;\n return protocol === 'https:';\n }\n\n module.exports = {\n isHTTPS: isHTTPS\n };\n }, {}],\n 155: [function (_dereq_, module, exports) {\n 'use strict';\n\n var parser;\n var legalHosts = {\n 'paypal.com': 1,\n 'braintreepayments.com': 1,\n 'braintreegateway.com': 1,\n 'braintree-api.com': 1\n }; // endRemoveIf(production)\n\n function stripSubdomains(domain) {\n return domain.split('.').slice(-2).join('.');\n }\n\n function isVerifiedDomain(url) {\n var mainDomain;\n url = url.toLowerCase();\n\n if (!/^https:/.test(url)) {\n return false;\n }\n\n parser = parser || document.createElement('a');\n parser.href = url;\n mainDomain = stripSubdomains(parser.hostname);\n return legalHosts.hasOwnProperty(mainDomain);\n }\n\n module.exports = isVerifiedDomain;\n }, {}],\n 156: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = function (value) {\n return JSON.parse(JSON.stringify(value));\n };\n }, {}],\n 157: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = function (obj) {\n return Object.keys(obj).filter(function (key) {\n return typeof obj[key] === 'function';\n });\n };\n }, {}],\n 158: [function (_dereq_, module, exports) {\n 'use strict';\n\n function once(fn) {\n var called = false;\n return function () {\n if (!called) {\n called = true;\n fn.apply(null, arguments);\n }\n };\n }\n\n module.exports = once;\n }, {}],\n 159: [function (_dereq_, module, exports) {\n 'use strict';\n\n var PromisePolyfill = _dereq_('promise-polyfill');\n\n var ExtendedPromise = _dereq_('@braintree/extended-promise'); // eslint-disable-next-line no-undef\n\n\n var PromiseGlobal = typeof Promise !== 'undefined' ? Promise : PromisePolyfill;\n ExtendedPromise.suppressUnhandledPromiseMessage = true;\n ExtendedPromise.setPromise(PromiseGlobal);\n module.exports = PromiseGlobal;\n }, {\n \"@braintree/extended-promise\": 35,\n \"promise-polyfill\": 66\n }],\n 160: [function (_dereq_, module, exports) {\n 'use strict';\n\n function _notEmpty(obj) {\n var key;\n\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n return true;\n }\n }\n\n return false;\n }\n /* eslint-disable no-mixed-operators */\n\n\n function _isArray(value) {\n return value && _typeof(value) === 'object' && typeof value.length === 'number' && Object.prototype.toString.call(value) === '[object Array]' || false;\n }\n /* eslint-enable no-mixed-operators */\n\n\n function hasQueryParams(url) {\n url = url || window.location.href;\n return /\\?/.test(url);\n }\n\n function parse(url) {\n var query, params;\n url = url || window.location.href;\n\n if (!hasQueryParams(url)) {\n return {};\n }\n\n query = url.replace(/#.*$/, '').replace(/^.*\\?/, '').split('&');\n params = query.reduce(function (toReturn, keyValue) {\n var parts = keyValue.split('=');\n var key = decodeURIComponent(parts[0]);\n var value = decodeURIComponent(parts[1]);\n toReturn[key] = value;\n return toReturn;\n }, {});\n return params;\n }\n\n function stringify(params, namespace) {\n var k, v, p;\n var query = [];\n\n for (p in params) {\n if (!params.hasOwnProperty(p)) {\n continue;\n }\n\n v = params[p];\n\n if (namespace) {\n if (_isArray(params)) {\n k = namespace + '[]';\n } else {\n k = namespace + '[' + p + ']';\n }\n } else {\n k = p;\n }\n\n if (_typeof(v) === 'object') {\n query.push(stringify(v, k));\n } else {\n query.push(encodeURIComponent(k) + '=' + encodeURIComponent(v));\n }\n }\n\n return query.join('&');\n }\n\n function queryify(url, params) {\n url = url || '';\n\n if (params != null && _typeof(params) === 'object' && _notEmpty(params)) {\n url += url.indexOf('?') === -1 ? '?' : '';\n url += url.indexOf('=') !== -1 ? '&' : '';\n url += stringify(params);\n }\n\n return url;\n }\n\n module.exports = {\n parse: parse,\n stringify: stringify,\n queryify: queryify,\n hasQueryParams: hasQueryParams\n };\n }, {}],\n 161: [function (_dereq_, module, exports) {\n 'use strict';\n\n var uuid = _dereq_('@braintree/uuid');\n\n var findRootNode = _dereq_('./find-root-node'); // based on https://github.com/krakenjs/belter/blob/cdddc4f8ddb172d29db9e7e1ad1eeeacfb93e215/src/dom.js#L981-L1031\n // thanks @bluepnume\n\n\n function isShadowElement(element) {\n element = findRootNode(element);\n return element.toString() === '[object ShadowRoot]';\n }\n\n function getShadowHost(element) {\n element = findRootNode(element);\n\n if (!isShadowElement(element)) {\n return null;\n }\n\n return element.host;\n }\n\n function transformToSlot(element, styles) {\n var styleNode = findRootNode(element).querySelector('style');\n var shadowHost = getShadowHost(element);\n var slotName = 'shadow-slot-' + uuid();\n var slot = document.createElement('slot');\n var slotProvider = document.createElement('div');\n slot.setAttribute('name', slotName);\n element.appendChild(slot);\n slotProvider.setAttribute('slot', slotName);\n shadowHost.appendChild(slotProvider);\n\n if (styles) {\n if (!styleNode) {\n styleNode = document.createElement('style');\n element.appendChild(styleNode);\n }\n\n styleNode.sheet.insertRule('::slotted([slot=\"' + slotName + '\"]) { ' + styles + ' }');\n }\n\n return slotProvider;\n }\n\n module.exports = {\n isShadowElement: isShadowElement,\n getShadowHost: getShadowHost,\n transformToSlot: transformToSlot\n };\n }, {\n \"./find-root-node\": 138,\n \"@braintree/uuid\": 40\n }],\n 162: [function (_dereq_, module, exports) {\n 'use strict';\n\n function useMin(isDebug) {\n return isDebug ? '' : '.min';\n }\n\n module.exports = useMin;\n }, {}],\n 163: [function (_dereq_, module, exports) {\n 'use strict';\n\n var atobNormalized = typeof atob === 'function' ? window.atob : atobPolyfill;\n\n function atobPolyfill(base64String) {\n var a, b, c, b1, b2, b3, b4, i;\n var base64Matcher = new RegExp('^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$');\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var result = '';\n\n if (!base64Matcher.test(base64String)) {\n throw new Error('Non base64 encoded input passed to window.atob polyfill');\n }\n\n i = 0;\n\n do {\n b1 = characters.indexOf(base64String.charAt(i++));\n b2 = characters.indexOf(base64String.charAt(i++));\n b3 = characters.indexOf(base64String.charAt(i++));\n b4 = characters.indexOf(base64String.charAt(i++));\n a = (b1 & 0x3F) << 2 | b2 >> 4 & 0x3;\n b = (b2 & 0xF) << 4 | b3 >> 2 & 0xF;\n c = (b3 & 0x3) << 6 | b4 & 0x3F;\n result += String.fromCharCode(a) + (b ? String.fromCharCode(b) : '') + (c ? String.fromCharCode(c) : '');\n } while (i < base64String.length);\n\n return result;\n }\n\n module.exports = {\n atob: function atob(base64String) {\n return atobNormalized.call(window, base64String);\n },\n _atob: atobPolyfill\n };\n }, {}],\n 164: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n REQUIRED_OPTIONS_FOR_START_PAYMENT: ['onPaymentStart', 'paymentType', 'amount', 'fallback']\n };\n }, {}],\n 165: [function (_dereq_, module, exports) {\n 'use strict';\n\n var frameService = _dereq_('../../lib/frame-service/external');\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n var useMin = _dereq_('../../lib/use-min');\n\n var VERSION = \"3.76.1\";\n\n var INTEGRATION_TIMEOUT_MS = _dereq_('../../lib/constants').INTEGRATION_TIMEOUT_MS;\n\n var analytics = _dereq_('../../lib/analytics');\n\n var methods = _dereq_('../../lib/methods');\n\n var convertMethodsToError = _dereq_('../../lib/convert-methods-to-error');\n\n var convertToBraintreeError = _dereq_('../../lib/convert-to-braintree-error');\n\n var Promise = _dereq_('../../lib/promise');\n\n var querystring = _dereq_('../../lib/querystring');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var constants = _dereq_('./constants');\n\n var errors = _dereq_('../shared/errors');\n\n var DEFAULT_WINDOW_WIDTH = 1282;\n var DEFAULT_WINDOW_HEIGHT = 720;\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/local-payment.create|local-payment.create}\n * @classdesc This class represents a LocalPayment component. Instances of this class can open a LocalPayment window for paying with alternate payments local to a specific country. Any additional UI, such as disabling the page while authentication is taking place, is up to the developer.\n *\n * @description
Do not use this constructor directly. Use {@link module:braintree-web/local-payment.create|braintree-web.local-payment.create} instead.\n */\n\n function LocalPayment(options) {\n this._client = options.client;\n this._assetsUrl = options.client.getConfiguration().gatewayConfiguration.assetsUrl + '/web/' + VERSION;\n this._isDebug = options.client.getConfiguration().isDebug;\n this._loadingFrameUrl = this._assetsUrl + '/html/local-payment-landing-frame' + useMin(this._isDebug) + '.html';\n this._authorizationInProgress = false;\n this._paymentType = 'unknown';\n this._merchantAccountId = options.merchantAccountId;\n }\n\n LocalPayment.prototype._initialize = function () {\n var self = this;\n var client = this._client;\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(client, 'local-payment.load.timed-out');\n }, INTEGRATION_TIMEOUT_MS);\n return new Promise(function (resolve) {\n frameService.create({\n name: 'localpaymentlandingpage',\n dispatchFrameUrl: self._assetsUrl + '/html/dispatch-frame' + useMin(self._isDebug) + '.html',\n openFrameUrl: self._loadingFrameUrl\n }, function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(client, 'local-payment.load.succeeded');\n resolve(self);\n });\n });\n };\n /**\n * Launches the local payment flow and returns a nonce payload. Only one local payment flow should be active at a time. One way to achieve this is to disable your local payment button while the flow is open.\n * @public\n * @function\n * @param {object} options All options for initiating the local payment payment flow.\n * @param {object} options.fallback Configuration for what to do when app switching back from a Bank app on a mobile device.\n * @param {string} options.fallback.buttonText The text to insert into a button to redirect back to the merchant page.\n * @param {string} options.fallback.url The url to redirect to when the redirect button is activated. Query params will be added to the url to process the data returned from the bank.\n * @param {object} [options.windowOptions] The options for configuring the window that is opened when starting the payment.\n * @param {number} [options.windowOptions.width=1282] The width in pixels of the window opened when starting the payment. The default width size is this large to allow various banking partner landing pages to display the QR Code to be scanned by the bank's mobile app. Many will not display the QR code when the window size is smaller than a standard desktop screen.\n * @param {number} [options.windowOptions.height=720] The height in pixels of the window opened when starting the payment.\n * @param {string} options.amount The amount to authorize for the transaction.\n * @param {string} options.currencyCode The currency to process the payment.\n * @param {string} options.paymentType The type of local payment.\n * @param {string} options.paymentTypeCountryCode The country code of the local payment. This value must be one of the supported country codes for a given local payment type listed {@link https://developers.braintreepayments.com/guides/local-payment-methods/client-side-custom/javascript/v3#render-local-payment-method-buttons|here}. For local payments supported in multiple countries, this value may determine which banks are presented to the customer.\n * @param {string} options.email Payer email of the customer.\n * @param {string} options.givenName First name of the customer.\n * @param {string} options.surname Last name of the customer.\n * @param {string} options.phone Phone number of the customer.\n * @param {string} options.bic Bank Identification Code of the customer (specific to iDEAL transactions).\n * @param {boolean} options.shippingAddressRequired Indicates whether or not the payment needs to be shipped. For digital goods, this should be false. Defaults to false.\n * @param {string} options.address.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @param {string} options.address.extendedAddress Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @param {string} options.address.locality Customer's city.\n * @param {string} options.address.region Customer's region or state.\n * @param {string} options.address.postalCode Customer's postal code.\n * @param {string} options.address.countryCode Customer's country code.\n * @param {function} options.onPaymentStart A function that will be called with two parameters: an object containing the `paymentId` and a `continueCallback` that must be called to launch the flow. You can use method to do any preprocessing on your server before the flow begins..\n * @param {callback} [callback] The second argument,
data
, is a {@link LocalPayment~startPaymentPayload|startPaymentPayload}. If no callback is provided, the method will return a Promise that resolves with a {@link LocalPayment~startPaymentPayload|startPaymentPayload}.\n * @example\n * button.addEventListener('click', function () {\n * // Disable the button when local payment is in progress\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because startPayment opens a new window, this must be called\n * // as a result of a user action, such as a button click.\n * localPaymentInstance.startPayment({\n * paymentType: 'ideal',\n * paymentTypeCountryCode: 'NL',\n * fallback: {\n * buttonText: 'Return to Merchant',\n * url: 'https://example.com/my-checkout-page'\n * },\n * amount: '10.00',\n * currencyCode: 'EUR',\n * onPaymentStart: function (data, continueCallback) {\n * // Do any preprocessing before starting the flow\n * // data.paymentId is the ID of the localPayment\n * continueCallback();\n * }\n * }).then(function (payload) {\n * button.removeAttribute('disabled');\n * // Submit payload.nonce to your server\n * }).catch(function (startPaymentError) {\n * button.removeAttribute('disabled');\n * // Handle flow errors or premature flow closure\n * console.error('Error!', startPaymentError);\n * });\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n LocalPayment.prototype.startPayment = function (options) {\n var address, params;\n var self = this; // eslint-disable-line no-invalid-this\n\n var serviceId = this._frameService._serviceId; // eslint-disable-line no-invalid-this\n\n var windowOptions = options.windowOptions || {};\n\n if (hasMissingOption(options)) {\n return Promise.reject(new BraintreeError(errors.LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION));\n }\n\n address = options.address || {};\n params = {\n intent: 'sale',\n returnUrl: querystring.queryify(self._assetsUrl + '/html/local-payment-redirect-frame' + useMin(self._isDebug) + '.html', {\n channel: serviceId,\n r: options.fallback.url,\n t: options.fallback.buttonText\n }),\n cancelUrl: querystring.queryify(self._assetsUrl + '/html/cancel-frame' + useMin(self._isDebug) + '.html', {\n channel: serviceId\n }),\n experienceProfile: {\n noShipping: !options.shippingAddressRequired\n },\n fundingSource: options.paymentType,\n paymentTypeCountryCode: options.paymentTypeCountryCode,\n amount: options.amount,\n currencyIsoCode: options.currencyCode,\n firstName: options.givenName,\n lastName: options.surname,\n payerEmail: options.email,\n phone: options.phone,\n line1: address.streetAddress,\n line2: address.extendedAddress,\n city: address.locality,\n state: address.region,\n postalCode: address.postalCode,\n countryCode: address.countryCode,\n merchantAccountId: self._merchantAccountId,\n bic: options.bic\n };\n self._paymentType = options.paymentType.toLowerCase();\n\n if (self._authorizationInProgress) {\n analytics.sendEvent(self._client, self._paymentType + '.local-payment.start-payment.error.already-opened');\n return Promise.reject(new BraintreeError(errors.LOCAL_PAYMENT_ALREADY_IN_PROGRESS));\n }\n\n self._authorizationInProgress = true;\n return new Promise(function (resolve, reject) {\n self._startPaymentCallback = self._createStartPaymentCallback(resolve, reject);\n\n self._frameService.open({\n width: windowOptions.width || DEFAULT_WINDOW_WIDTH,\n height: windowOptions.height || DEFAULT_WINDOW_HEIGHT\n }, self._startPaymentCallback);\n\n self._client.request({\n method: 'post',\n endpoint: 'local_payments/create',\n data: params\n }).then(function (response) {\n analytics.sendEvent(self._client, self._paymentType + '.local-payment.start-payment.opened');\n self._startPaymentOptions = options;\n options.onPaymentStart({\n paymentId: response.paymentResource.paymentToken\n }, function () {\n self._frameService.redirect(response.paymentResource.redirectUrl);\n });\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n\n self._frameService.close();\n\n self._authorizationInProgress = false;\n\n if (status === 422) {\n reject(new BraintreeError({\n type: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.type,\n code: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.code,\n message: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err\n }\n }));\n return;\n }\n\n reject(convertToBraintreeError(err, {\n type: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.type,\n code: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.code,\n message: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.message\n }));\n });\n });\n };\n /**\n * Manually tokenizes params for a local payment received from PayPal.When app switching back from a mobile application (such as a bank application for an iDEAL payment), the window may lose context with the parent page. In that case, a fallback url is used, and this method can be used to finish the flow.\n * @public\n * @function\n * @param {object} [params] All options for tokenizing local payment parameters. If no params are passed in, the params will be pulled off of the query string of the page.\n * @param {string} params.btLpToken The token representing the local payment. Aliased to `token` if `btLpToken` is not present.\n * @param {string} params.btLpPaymentId The payment id for the local payment. Aliased to `paymentId` if `btLpPaymentId` is not present.\n * @param {string} params.btLpPayerId The payer id for the local payment. Aliased to `PayerID` if `btLpPayerId` is not present.\n * @param {callback} [callback] The second argument,
data
, is a {@link LocalPayment~startPaymentPayload|startPaymentPayload}. If no callback is provided, the method will return a Promise that resolves with a {@link LocalPayment~startPaymentPayload|startPaymentPayload}.\n * @example\n * localPaymentInstance.tokenize().then(function (payload) {\n * // send payload.nonce to your server\n * }).catch(function (err) {\n * // handle tokenization error\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n LocalPayment.prototype.tokenize = function (params) {\n var self = this;\n var client = this._client;\n params = params || querystring.parse();\n return client.request({\n endpoint: 'payment_methods/paypal_accounts',\n method: 'post',\n data: this._formatTokenizeData(params)\n }).then(function (response) {\n var payload = self._formatTokenizePayload(response);\n\n if (window.popupBridge) {\n analytics.sendEvent(client, self._paymentType + '.local-payment.tokenization.success-popupbridge');\n } else {\n analytics.sendEvent(client, self._paymentType + '.local-payment.tokenization.success');\n }\n\n return payload;\n }).catch(function (err) {\n analytics.sendEvent(client, self._paymentType + '.local-payment.tokenization.failed');\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.type,\n code: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.code,\n message: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.message\n }));\n });\n };\n /**\n * Closes the LocalPayment window if it is open.\n * @public\n * @example\n * localPaymentInstance.closeWindow();\n * @returns {void}\n */\n\n\n LocalPayment.prototype.closeWindow = function () {\n if (this._authoriztionInProgress) {\n analytics.sendEvent(this._client, this._paymentType + '.local-payment.start-payment.closed.by-merchant');\n }\n\n this._frameService.close();\n };\n /**\n * Focuses the LocalPayment window if it is open.\n * @public\n * @example\n * localPaymentInstance.focusWindow();\n * @returns {void}\n */\n\n\n LocalPayment.prototype.focusWindow = function () {\n this._frameService.focus();\n };\n\n LocalPayment.prototype._createStartPaymentCallback = function (resolve, reject) {\n var self = this;\n var client = this._client;\n return function (err, params) {\n self._authorizationInProgress = false;\n\n if (err) {\n if (err.code === 'FRAME_SERVICE_FRAME_CLOSED') {\n if (params && params.errorcode === 'processing_error') {\n // something failed within the payment window (rather than when\n // tokenizing with Braintree)\n analytics.sendEvent(client, self._paymentType + '.local-payment.failed-in-window');\n reject(new BraintreeError(errors.LOCAL_PAYMENT_START_PAYMENT_FAILED));\n return;\n } // its possible to have a query param with errorcode=payment_error, which\n // indicates that the customer cancelled the flow from within the UI,\n // but as there's no meaningful difference to the merchant whether the\n // customer closes via the UI or by manually closing the window, we\n // don't differentiate these\n\n\n analytics.sendEvent(client, self._paymentType + '.local-payment.tokenization.closed.by-user');\n reject(new BraintreeError(errors.LOCAL_PAYMENT_WINDOW_CLOSED));\n } else if (err.code && err.code.indexOf('FRAME_SERVICE_FRAME_OPEN_FAILED') > -1) {\n reject(new BraintreeError({\n code: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.code,\n type: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.type,\n message: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.message,\n details: {\n originalError: err\n }\n }));\n }\n } else if (params) {\n if (!window.popupBridge) {\n self._frameService.redirect(self._loadingFrameUrl);\n }\n\n self.tokenize(params).then(resolve).catch(reject).then(function () {\n self._frameService.close();\n });\n }\n };\n };\n\n LocalPayment.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type\n };\n\n if (account.details) {\n if (account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n\n if (account.details.correlationId) {\n payload.correlationId = account.details.correlationId;\n }\n }\n\n return payload;\n };\n /**\n * Checks if required tokenization parameters are available in querystring for manual tokenization requests.\n * @public\n * @function\n * @example\n * // if query string contains\n * // ?btLpToken=token&btLpPaymentId=payment-id&btLpPayerId=payer-id\n * localPaymentInstance.hasTokenizationParams(); // true\n *\n * // if query string is missing required params\n * localPaymentInstance.hasTokenizationParams(); // false\n *\n * if (localPaymentInstance.hasTokenizationParams()) {\n * localPaymentInstance.tokenize();\n * }\n * @returns {Boolean} Returns a Boolean value for the state of the query string.\n */\n\n\n LocalPayment.prototype.hasTokenizationParams = function () {\n var params = querystring.parse();\n return Boolean(params.btLpToken && params.btLpPaymentId && params.btLpPayerId);\n };\n\n LocalPayment.prototype._formatTokenizeData = function (params) {\n var clientConfiguration = this._client.getConfiguration();\n\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var data = {\n merchantAccountId: this._merchantAccountId,\n paypalAccount: {\n correlationId: params.btLpToken || params.token,\n paymentToken: params.btLpPaymentId || params.paymentId,\n payerId: params.btLpPayerId || params.PayerID,\n unilateral: gatewayConfiguration.paypal.unvettedMerchant,\n intent: 'sale'\n }\n };\n return data;\n };\n\n function hasMissingOption(options) {\n var i, option;\n\n if (!options) {\n return true;\n }\n\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_START_PAYMENT.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_START_PAYMENT[i];\n\n if (!options.hasOwnProperty(option)) {\n return true;\n }\n }\n\n if (!(options.fallback.url && options.fallback.buttonText)) {\n return true;\n }\n\n return false;\n }\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/local-payment.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * localPaymentInstance.teardown();\n * @example
With callback\n * localPaymentInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n LocalPayment.prototype.teardown = function () {\n var self = this; // eslint-disable-line no-invalid-this\n\n self._frameService.teardown();\n\n convertMethodsToError(self, methods(LocalPayment.prototype));\n analytics.sendEvent(self._client, 'local-payment.teardown-completed');\n return Promise.resolve();\n };\n\n module.exports = wrapPromise.wrapPrototype(LocalPayment);\n }, {\n \"../../lib/analytics\": 121,\n \"../../lib/braintree-error\": 126,\n \"../../lib/constants\": 128,\n \"../../lib/convert-methods-to-error\": 129,\n \"../../lib/convert-to-braintree-error\": 130,\n \"../../lib/frame-service/external\": 141,\n \"../../lib/methods\": 157,\n \"../../lib/promise\": 159,\n \"../../lib/querystring\": 160,\n \"../../lib/use-min\": 162,\n \"../shared/errors\": 167,\n \"./constants\": 164,\n \"@braintree/wrap-promise\": 44\n }],\n 166: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @module braintree-web/local-payment\n * @description A component to integrate with local payment methods. *This component is currently in beta and is subject to change.*\n */\n\n var analytics = _dereq_('../lib/analytics');\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var LocalPayment = _dereq_('./external/local-payment');\n\n var VERSION = \"3.76.1\";\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var errors = _dereq_('./shared/errors');\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {string} [options.merchantAccountId] A non-default merchant account ID to use for tokenization and creation of the authorizing transaction. Braintree strongly recommends specifying this parameter.\n * @param {callback} callback The second argument, `data`, is the {@link LocalPayment} instance.\n * @example
Using the local payment component to set up an iDEAL button\n * var idealButton = document.querySelector('.ideal-button');\n *\n * braintree.client.create({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (clientErr, clientInstance) {\n * if (clientErr) {\n * console.error('Error creating client:', clientErr);\n * return;\n * }\n *\n * braintree.localPayment.create({\n * client: clientInstance,\n * merchantAccountId: 'merchantAccountEUR',\n * }, function (localPaymentErr, localPaymentInstance) {\n * if (localPaymentErr) {\n * console.error('Error creating local payment component:', localPaymentErr);\n * return;\n * }\n *\n * idealButton.removeAttribute('disabled');\n *\n * // When the button is clicked, attempt to start the payment flow.\n * idealButton.addEventListener('click', function (event) {\n * // Because this opens a popup, this has to be called as a result of\n * // customer action, like clicking a button. You cannot call this at any time.\n * localPaymentInstance.startPayment({\n * paymentType: 'ideal',\n * amount: '10.67',\n * city: 'Den Haag',\n * countryCode: 'NL',\n * firstName: 'Test',\n * lastName: 'McTester',\n * line1: '123 of 456 Fake Lane',\n * line2: 'Apartment 789',\n * payerEmail: 'payer@example.com',\n * phone: '123456789',\n * postalCode: '1234 AA',\n * currencyCode: 'EUR',\n * onPaymentStart: function (data, continueCallback) {\n * // Do any preprocessing to store the ID and setup webhook\n * // Call start to initiate the popup\n * continueCallback();\n * }\n ** }, function (startPaymentErr, payload) {\n * if (startPaymentErr) {\n * if (startPaymentErr.type !== 'CUSTOMER') {\n * console.error('Error starting payment:', startPaymentErr);\n * }\n * return;\n * }\n *\n * idealButton.setAttribute('disabled', true);\n *\n * console.log(payload.paymentId);\n * });\n * }, false);\n * });\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n function create(options) {\n var name = 'Local Payment';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var localPaymentInstance;\n var config = client.getConfiguration();\n options.client = client;\n\n if (config.gatewayConfiguration.paypalEnabled !== true) {\n return Promise.reject(new BraintreeError(errors.LOCAL_PAYMENT_NOT_ENABLED));\n }\n\n analytics.sendEvent(client, 'local-payment.initialized');\n localPaymentInstance = new LocalPayment(options);\n return localPaymentInstance._initialize();\n });\n }\n\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 121,\n \"../lib/basic-component-verification\": 124,\n \"../lib/braintree-error\": 126,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/promise\": 159,\n \"./external/local-payment\": 165,\n \"./shared/errors\": 167,\n \"@braintree/wrap-promise\": 44\n }],\n 167: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.LocalPayment - Creation Error Codes\n * @description Errors that occur when [creating the Local Payment component](./module-braintree-web_local-payment.html#.create).\n * @property {MERCHANT} LOCAL_PAYMENT_NOT_ENABLED Occurs when Local Payment is not enabled on the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.LocalPayment - startPayment Error Codes\n * @description Errors that occur when using the [`startPayment` method](./LocalPayment.html#startPayment).\n * @property {MERCHANT} LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION Occurs when a startPayment is missing a required option.\n * @property {MERCHANT} LOCAL_PAYMENT_ALREADY_IN_PROGRESS Occurs when a startPayment call is already in progress.\n * @property {MERCHANT} LOCAL_PAYMENT_INVALID_PAYMENT_OPTION Occurs when a startPayment call has an invalid option.\n * @property {NETWORK} LOCAL_PAYMENT_START_PAYMENT_FAILED Occurs when a startPayment call fails.\n * @property {NETWORK} LOCAL_PAYMENT_TOKENIZATION_FAILED Occurs when a startPayment call fails to tokenize the result from authorization.\n * @property {CUSTOMER} LOCAL_PAYMENT_WINDOW_CLOSED Occurs when the customer closes the Local Payment window.\n * @property {MERCHANT} LOCAL_PAYMENT_WINDOW_OPEN_FAILED Occurs when the Local Payment window fails to open. Usually because `startPayment` was not called as a direct result of a user action.\n */\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n module.exports = {\n LOCAL_PAYMENT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'LOCAL_PAYMENT_NOT_ENABLED',\n message: 'LocalPayment is not enabled for this merchant.'\n },\n LOCAL_PAYMENT_ALREADY_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: 'LOCAL_PAYMENT_ALREADY_IN_PROGRESS',\n message: 'LocalPayment payment is already in progress.'\n },\n LOCAL_PAYMENT_WINDOW_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'LOCAL_PAYMENT_WINDOW_CLOSED',\n message: 'Customer closed LocalPayment window before authorizing.'\n },\n LOCAL_PAYMENT_WINDOW_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: 'LOCAL_PAYMENT_WINDOW_OPEN_FAILED',\n message: 'LocalPayment window failed to open; make sure startPayment was called in response to a user action.'\n },\n LOCAL_PAYMENT_START_PAYMENT_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'LOCAL_PAYMENT_START_PAYMENT_FAILED',\n message: 'LocalPayment startPayment failed.'\n },\n LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: 'LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION',\n message: 'Missing required option for startPayment.'\n },\n LOCAL_PAYMENT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'LOCAL_PAYMENT_TOKENIZATION_FAILED',\n message: 'Could not tokenize user\\'s local payment method.'\n },\n LOCAL_PAYMENT_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: 'LOCAL_PAYMENT_INVALID_PAYMENT_OPTION',\n message: 'Local payment options are invalid.'\n }\n };\n }, {\n \"../../lib/braintree-error\": 126\n }],\n 168: [function (_dereq_, module, exports) {\n 'use strict';\n\n var Promise = _dereq_('../../lib/promise');\n\n var frameService = _dereq_('../../lib/frame-service/external');\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n var errors = _dereq_('../shared/errors');\n\n var VERSION = \"3.76.1\";\n\n var methods = _dereq_('../../lib/methods');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var analytics = _dereq_('../../lib/analytics');\n\n var convertMethodsToError = _dereq_('../../lib/convert-methods-to-error');\n\n var convertToBraintreeError = _dereq_('../../lib/convert-to-braintree-error');\n\n var constants = _dereq_('../shared/constants');\n\n var INTEGRATION_TIMEOUT_MS = _dereq_('../../lib/constants').INTEGRATION_TIMEOUT_MS;\n /**\n * Masterpass Address object.\n * @typedef {object} Masterpass~Address\n * @property {string} countryCodeAlpha2 The customer's country code.\n * @property {string} extendedAddress The customer's extended address.\n * @property {string} locality The customer's locality.\n * @property {string} postalCode The customer's postal code.\n * @property {string} region The customer's region.\n * @property {string} streetAddress The customer's street address.\n */\n\n /**\n * @typedef {object} Masterpass~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} description The human readable description.\n * @property {string} type The payment method type, always `MasterpassCard`.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {object} contact The customer's contact information.\n * @property {string} contact.firstName The customer's first name.\n * @property {string} contact.lastName The customer's last name.\n * @property {string} contact.phoneNumber The customer's phone number.\n * @property {string} contact.emailAddress The customer's email address.\n * @property {Masterpass~Address} billingAddress The customer's billing address.\n * @property {Masterpass~Address} shippingAddress The customer's shipping address.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/masterpass.create|masterpass.create}\n * @description
You cannot use this constructor directly. Use {@link module:braintree-web/masterpass.create|braintree.masterpass.create} instead.\n * @classdesc This class represents an Masterpass component. Instances of this class have methods for launching a new window to process a transaction with Masterpass.\n */\n\n\n function Masterpass(options) {\n var configuration = options.client.getConfiguration();\n this._client = options.client;\n this._assetsUrl = configuration.gatewayConfiguration.assetsUrl + '/web/' + VERSION;\n this._isDebug = configuration.isDebug;\n this._authInProgress = false;\n\n if (window.popupBridge && typeof window.popupBridge.getReturnUrlPrefix === 'function') {\n this._callbackUrl = window.popupBridge.getReturnUrlPrefix() + 'return';\n } else {\n this._callbackUrl = this._assetsUrl + '/html/redirect-frame' + (this._isDebug ? '' : '.min') + '.html';\n }\n }\n\n Masterpass.prototype._initialize = function () {\n var self = this;\n return new Promise(function (resolve) {\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(self._client, 'masterpass.load.timed-out');\n }, INTEGRATION_TIMEOUT_MS);\n frameService.create({\n name: constants.LANDING_FRAME_NAME,\n height: constants.POPUP_HEIGHT,\n width: constants.POPUP_WIDTH,\n dispatchFrameUrl: self._assetsUrl + '/html/dispatch-frame' + (self._isDebug ? '' : '.min') + '.html',\n openFrameUrl: self._assetsUrl + '/html/masterpass-landing-frame' + (self._isDebug ? '' : '.min') + '.html'\n }, function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(self._client, 'masterpass.load.succeeded');\n resolve(self);\n });\n });\n };\n /**\n * Launches the Masterpass flow and returns a nonce payload. Only one Masterpass flow should be active at a time. One way to achieve this is to disable your Masterpass button while the flow is open.\n *\n * Braintree will apply these properties in `options.config`. Merchants should not override these values, except for advanced usage.\n * - `environment`\n * - `requestToken`\n * - `callbackUrl`\n * - `merchantCheckoutId`\n * - `allowedCardTypes`\n * - `version`\n *\n * @public\n * @param {object} options All options for initiating the Masterpass payment flow.\n * @param {string} options.currencyCode The currency code to process the payment.\n * @param {string} options.subtotal The amount to authorize for the transaction.\n * @param {object} [options.config] All configuration parameters accepted by Masterpass lightbox, except `function` data type. These options will override the values set by Braintree server. Please see {@link Masterpass Lightbox Parameters|https://developer.mastercard.com/page/masterpass-lightbox-parameters} for more information.\n * @param {object} [options.frameOptions] Used to configure the window that contains the Masterpass login.\n * @param {number} [options.frameOptions.width] Popup width to be used instead of default value (450px).\n * @param {number} [options.frameOptions.height] Popup height to be used instead of default value (660px).\n * @param {number} [options.frameOptions.top] The top position of the popup window to be used instead of default value, that is calculated based on provided height, and parent window size.\n * @param {number} [options.frameOptions.left] The left position to the popup window to be used instead of default value, that is calculated based on provided width, and parent window size.\n * @param {callback} [callback] The second argument,
data
, is a {@link Masterpass~tokenizePayload|tokenizePayload}. If no callback is provided, the method will return a Promise that resolves with a {@link Masterpass~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because tokenize opens a new window, this must be called\n * // as a result of a user action, such as a button click.\n * masterpassInstance.tokenize({\n * currencyCode: 'USD',\n * subtotal: '10.00'\n * }).then(function (payload) {\n * button.removeAttribute('disabled');\n * // Submit payload.nonce to your server\n * }).catch(function (tokenizeError) {\n * button.removeAttribute('disabled');\n * // Handle flow errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'MASTERPASS_POPUP_CLOSED':\n * console.error('Customer closed Masterpass popup.');\n * break;\n * case 'MASTERPASS_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('Masterpass tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'MASTERPASS_FLOW_FAILED':\n * console.error('Unable to initialize Masterpass flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * });\n * });\n */\n\n\n Masterpass.prototype.tokenize = function (options) {\n var self = this;\n\n if (!options || hasMissingOption(options)) {\n return Promise.reject(new BraintreeError(errors.MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION));\n }\n\n if (self._authInProgress) {\n return Promise.reject(new BraintreeError(errors.MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS));\n }\n\n return new Promise(function (resolve, reject) {\n self._navigateFrameToLoadingPage(options).catch(reject); // This MUST happen after _navigateFrameToLoadingPage for Metro browsers to work.\n\n\n self._frameService.open(options.frameOptions, self._createFrameOpenHandler(resolve, reject));\n });\n };\n\n Masterpass.prototype._navigateFrameToLoadingPage = function (options) {\n var self = this;\n this._authInProgress = true;\n return this._client.request({\n method: 'post',\n endpoint: 'masterpass/request_token',\n data: {\n requestToken: {\n originUrl: window.location.protocol + '//' + window.location.hostname,\n subtotal: options.subtotal,\n currencyCode: options.currencyCode,\n callbackUrl: this._callbackUrl\n }\n }\n }).then(function (response) {\n var redirectUrl = self._assetsUrl + '/html/masterpass-loading-frame' + (self._isDebug ? '' : '.min') + '.html?';\n\n var gatewayConfiguration = self._client.getConfiguration().gatewayConfiguration;\n\n var config = options.config || {};\n var queryParams;\n queryParams = {\n environment: gatewayConfiguration.environment,\n requestToken: response.requestToken,\n callbackUrl: self._callbackUrl,\n merchantCheckoutId: gatewayConfiguration.masterpass.merchantCheckoutId,\n allowedCardTypes: gatewayConfiguration.masterpass.supportedNetworks,\n version: constants.MASTERPASS_VERSION\n };\n Object.keys(config).forEach(function (key) {\n if (typeof config[key] !== 'function') {\n queryParams[key] = config[key];\n }\n });\n redirectUrl += Object.keys(queryParams).map(function (key) {\n return key + '=' + queryParams[key];\n }).join('&');\n\n self._frameService.redirect(redirectUrl);\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n\n self._closeWindow();\n\n if (status === 422) {\n return Promise.reject(convertToBraintreeError(err, errors.MASTERPASS_INVALID_PAYMENT_OPTION));\n }\n\n return Promise.reject(convertToBraintreeError(err, errors.MASTERPASS_FLOW_FAILED));\n });\n };\n\n Masterpass.prototype._createFrameOpenHandler = function (resolve, reject) {\n var self = this;\n\n if (window.popupBridge) {\n return function (popupBridgeErr, payload) {\n self._authInProgress = false;\n\n if (popupBridgeErr) {\n analytics.sendEvent(self._client, 'masterpass.tokenization.closed-popupbridge.by-user');\n reject(convertToBraintreeError(popupBridgeErr, errors.MASTERPASS_POPUP_CLOSED));\n return;\n } else if (!payload.queryItems) {\n analytics.sendEvent(self._client, 'masterpass.tokenization.failed-popupbridge');\n reject(new BraintreeError(errors.MASTERPASS_FLOW_FAILED));\n return;\n }\n\n self._tokenizeMasterpass(payload.queryItems).then(resolve).catch(reject);\n };\n }\n\n return function (frameServiceErr, payload) {\n if (frameServiceErr) {\n self._authInProgress = false;\n\n if (frameServiceErr.code === 'FRAME_SERVICE_FRAME_CLOSED') {\n analytics.sendEvent(self._client, 'masterpass.tokenization.closed.by-user');\n reject(new BraintreeError(errors.MASTERPASS_POPUP_CLOSED));\n return;\n }\n\n if (frameServiceErr.code && frameServiceErr.code.indexOf('FRAME_SERVICE_FRAME_OPEN_FAILED') > -1) {\n analytics.sendEvent(self._client, 'masterpass.tokenization.failed.to-open');\n reject(new BraintreeError({\n code: errors.MASTERPASS_POPUP_OPEN_FAILED.code,\n type: errors.MASTERPASS_POPUP_OPEN_FAILED.type,\n message: errors.MASTERPASS_POPUP_OPEN_FAILED.message,\n details: {\n originalError: frameServiceErr\n }\n }));\n return;\n }\n\n analytics.sendEvent(self._client, 'masterpass.tokenization.failed');\n\n self._closeWindow();\n\n reject(convertToBraintreeError(frameServiceErr, errors.MASTERPASS_FLOW_FAILED));\n return;\n }\n\n self._tokenizeMasterpass(payload).then(resolve).catch(reject);\n };\n };\n\n Masterpass.prototype._tokenizeMasterpass = function (payload) {\n var self = this;\n\n if (payload.mpstatus !== 'success') {\n analytics.sendEvent(self._client, 'masterpass.tokenization.closed.by-user');\n\n self._closeWindow();\n\n return Promise.reject(new BraintreeError(errors.MASTERPASS_POPUP_CLOSED));\n }\n\n if (isMissingRequiredPayload(payload)) {\n analytics.sendEvent(self._client, 'masterpass.tokenization.closed.missing-payload');\n\n self._closeWindow();\n\n return Promise.reject(new BraintreeError(errors.MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS));\n }\n\n return self._client.request({\n endpoint: 'payment_methods/masterpass_cards',\n method: 'post',\n data: {\n masterpassCard: {\n checkoutResourceUrl: payload.checkout_resource_url,\n requestToken: payload.oauth_token,\n verifierToken: payload.oauth_verifier\n }\n }\n }).then(function (response) {\n self._closeWindow();\n\n if (window.popupBridge) {\n analytics.sendEvent(self._client, 'masterpass.tokenization.success-popupbridge');\n } else {\n analytics.sendEvent(self._client, 'masterpass.tokenization.success');\n }\n\n return response.masterpassCards[0];\n }).catch(function (tokenizeErr) {\n self._closeWindow();\n\n if (window.popupBridge) {\n analytics.sendEvent(self._client, 'masterpass.tokenization.failed-popupbridge');\n } else {\n analytics.sendEvent(self._client, 'masterpass.tokenization.failed');\n }\n\n return Promise.reject(convertToBraintreeError(tokenizeErr, errors.MASTERPASS_ACCOUNT_TOKENIZATION_FAILED));\n });\n };\n\n function isMissingRequiredPayload(payload) {\n return [payload.oauth_verifier, payload.oauth_token, payload.checkout_resource_url].some(function (element) {\n return element == null || element === 'null';\n });\n }\n\n Masterpass.prototype._closeWindow = function () {\n this._authInProgress = false;\n\n this._frameService.close();\n };\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/masterpass.create|create}.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is provided, `teardown` returns a promise.\n * @example\n * masterpassInstance.teardown();\n * @example
With callback\n * masterpassInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n Masterpass.prototype.teardown = function () {\n var self = this;\n return new Promise(function (resolve) {\n self._frameService.teardown();\n\n convertMethodsToError(self, methods(Masterpass.prototype));\n analytics.sendEvent(self._client, 'masterpass.teardown-completed');\n resolve();\n });\n };\n\n function hasMissingOption(options) {\n var i, option;\n\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_TOKENIZE.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_TOKENIZE[i];\n\n if (!options.hasOwnProperty(option)) {\n return true;\n }\n }\n\n return false;\n }\n\n module.exports = wrapPromise.wrapPrototype(Masterpass);\n }, {\n \"../../lib/analytics\": 121,\n \"../../lib/braintree-error\": 126,\n \"../../lib/constants\": 128,\n \"../../lib/convert-methods-to-error\": 129,\n \"../../lib/convert-to-braintree-error\": 130,\n \"../../lib/frame-service/external\": 141,\n \"../../lib/methods\": 157,\n \"../../lib/promise\": 159,\n \"../shared/constants\": 171,\n \"../shared/errors\": 172,\n \"@braintree/wrap-promise\": 44\n }],\n 169: [function (_dereq_, module, exports) {\n 'use strict';\n /** @module braintree-web/masterpass\n * @description Processes Masterpass. *This component is currently in beta and is subject to change.*\n */\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var browserDetection = _dereq_('./shared/browser-detection');\n\n var Masterpass = _dereq_('./external/masterpass');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var VERSION = \"3.76.1\";\n\n var errors = _dereq_('./shared/errors');\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link Masterpass} instance. If no callback is passed in, the create function returns a promise that resolves the {@link Masterpass} instance.\n * @example\n * braintree.masterpass.create({\n * client: clientInstance\n * }, function (createErr, masterpassInstance) {\n * if (createErr) {\n * if (createErr.code === 'MASTERPASS_BROWSER_NOT_SUPPORTED') {\n * console.error('This browser is not supported.');\n * } else {\n * console.error('Error!', createErr);\n * }\n * return;\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n function create(options) {\n var name = 'Masterpass';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n if (!isSupported()) {\n return Promise.reject(new BraintreeError(errors.MASTERPASS_BROWSER_NOT_SUPPORTED));\n }\n\n return Promise.resolve();\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var masterpassInstance, configuration;\n options.client = client;\n configuration = options.client.getConfiguration().gatewayConfiguration;\n\n if (!configuration.masterpass) {\n return Promise.reject(new BraintreeError(errors.MASTERPASS_NOT_ENABLED));\n }\n\n masterpassInstance = new Masterpass(options);\n return masterpassInstance._initialize();\n });\n }\n /**\n * @static\n * @function isSupported\n * @description Returns true if Masterpass supports this browser.\n * @example\n * if (braintree.masterpass.isSupported()) {\n * // Add Masterpass button to the page\n * } else {\n * // Hide Masterpass payment option\n * }\n * @returns {Boolean} Returns true if Masterpass supports this browser.\n */\n\n\n function isSupported() {\n return Boolean(window.popupBridge || browserDetection.supportsPopups());\n }\n\n module.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 124,\n \"../lib/braintree-error\": 126,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/promise\": 159,\n \"./external/masterpass\": 168,\n \"./shared/browser-detection\": 170,\n \"./shared/errors\": 172,\n \"@braintree/wrap-promise\": 44\n }],\n 170: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n supportsPopups: _dereq_('@braintree/browser-detection/supports-popups')\n };\n }, {\n \"@braintree/browser-detection/supports-popups\": 32\n }],\n 171: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n LANDING_FRAME_NAME: 'braintreemasterpasslanding',\n POPUP_WIDTH: 450,\n POPUP_HEIGHT: 660,\n MASTERPASS_VERSION: 'v6',\n REQUIRED_OPTIONS_FOR_TOKENIZE: ['subtotal', 'currencyCode']\n };\n }, {}],\n 172: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Masterpass - Creation Error Codes\n * @description Errors that occur when [creating the Masterpass component](./module-braintree-web_masterpass#.create).\n * @property {CUSTOMER} MASTERPASS_BROWSER_NOT_SUPPORTED Occurs when browser is not a supported browser for Masterpass.\n * @property {MERCHANT} MASTERPASS_NOT_ENABLED Occurs when Masterpass is not enabled in the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.Masterpass - Tokenize Error Codes\n * @description Errors that occur when [tokenizing](./Masterpass.html#tokenize).\n * @property {MERCHANT} MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION Occurs when tokenize is called without a required option.\n * @property {MERCHANT} MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS Occurs if tokenization flow is initialized while another flow is already in progress.\n * @property {NETWORK} MASTERPASS_ACCOUNT_TOKENIZATION_FAILED Occurs when tokenization of Masterpass details fails.\n * @property {MERCHANT} MASTERPASS_POPUP_OPEN_FAILED Occurs when the popup fails to open.\n * @property {MERCHANT} MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS Occurs when Masterpass is missing required parameters for tokenization.\n * @property {CUSTOMER} MASTERPASS_POPUP_CLOSED Occurs when the popup is closed by the customer.\n * @property {MERCHANT} MASTERPASS_INVALID_PAYMENT_OPTION Occurs when an invalid payment option is used to tokenize Masterpass.\n * @property {NETWORK} MASTERPASS_FLOW_FAILED Occurs when an error is returned from request to tokenize.\n */\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n module.exports = {\n MASTERPASS_BROWSER_NOT_SUPPORTED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'MASTERPASS_BROWSER_NOT_SUPPORTED',\n message: 'Browser is not supported.'\n },\n MASTERPASS_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'MASTERPASS_NOT_ENABLED',\n message: 'Masterpass is not enabled for this merchant.'\n },\n MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: 'MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION',\n message: 'Missing required option for tokenize.'\n },\n MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: 'MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS',\n message: 'Masterpass tokenization is already in progress.'\n },\n MASTERPASS_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'MASTERPASS_ACCOUNT_TOKENIZATION_FAILED',\n message: 'Could not tokenize user\\'s Masterpass account.'\n },\n MASTERPASS_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: 'MASTERPASS_POPUP_OPEN_FAILED',\n message: 'Masterpass popup failed to open. Make sure to tokenize in response to a user action, such as a click.'\n },\n MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS: {\n type: BraintreeError.types.MERCHANT,\n code: 'MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS',\n message: 'Masterpass popup failed to return all required parameters needed to continue tokenization.'\n },\n MASTERPASS_POPUP_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'MASTERPASS_POPUP_CLOSED',\n message: 'Customer closed Masterpass popup before authorizing.'\n },\n MASTERPASS_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: 'MASTERPASS_INVALID_PAYMENT_OPTION',\n message: 'Masterpass payment options are invalid.'\n },\n MASTERPASS_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'MASTERPASS_FLOW_FAILED',\n message: 'Could not initialize Masterpass flow.'\n }\n };\n }, {\n \"../../lib/braintree-error\": 126\n }],\n 173: [function (_dereq_, module, exports) {\n 'use strict';\n\n var analytics = _dereq_('../../lib/analytics');\n\n var assign = _dereq_('../../lib/assign').assign;\n\n var Bus = _dereq_('framebus');\n\n var convertMethodsToError = _dereq_('../../lib/convert-methods-to-error');\n\n var generateGooglePayConfiguration = _dereq_('../../lib/generate-google-pay-configuration');\n\n var iFramer = _dereq_('@braintree/iframer');\n\n var uuid = _dereq_('@braintree/uuid');\n\n var useMin = _dereq_('../../lib/use-min');\n\n var methods = _dereq_('../../lib/methods');\n\n var Promise = _dereq_('../../lib/promise');\n\n var EventEmitter = _dereq_('@braintree/event-emitter');\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n var VERSION = \"3.76.1\";\n\n var constants = _dereq_('../shared/constants');\n\n var events = constants.events;\n var errors = constants.errors;\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n /**\n * @typedef {object} PaymentRequestComponent~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} details Additional account details.\n * @property {string} details.bin The BIN number of the card..\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {object} details.rawPaymentResponse The raw payment response from the payment request, with sensitive card details removed.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, `CreditCard` or `AndroidPayCard`.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n /**\n * @typedef {object} PaymentRequestComponent~paymentRequestConfiguration\n * @property {object} configuration.details The payment details. For details on this object, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_payment_details).\n * @property {array} [configuration.supportedPaymentMethods] The supported payment methods. If not passed in, the supported payment methods from the merchant account that generated the authorization for the client will be used. For details on this array, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_supported_payment_methods).\n * @property {object} [configuration.options] Additional payment request options. For details on this object, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_options_optional).\n */\n\n /**\n * @typedef {object} PaymentRequestComponent~shippingEventObject\n * @description The event payload sent from {@link PaymentRequestComponent#on|on}.\n * @property {object} target An object which contains data about the event.\n * @property {function} updateWith A method to call with the updated Payment Request details.\n */\n\n /**\n * @name PaymentRequestComponent#on\n * @function\n * @param {string} event The name of the event to which you are subscribing.\n * @param {function} handler A callback to handle the event.\n * @description Subscribes a handler function to a named event. `event` should be {@link PaymentRequestComponent#event:shippingAddressChange|shippingAddressChange} or {@link PaymentRequestComponent#event:shippingOptionChange|shippingOptionChange}. For convenience, you can also listen on `shippingaddresschange` or `shippingoptionchange` to match the event listeners in the [Payment Request API documentation](https://developers.google.com/web/fundamentals/payments/deep-dive-into-payment-request#shipping_in_payment_request_api). Events will emit a {@link PaymentRequestComponent~shippingEventObject|shippingEventObject}.\n * @example\n *
Listening to a Payment Request event, in this case 'shippingAddressChange'\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * console.log(event.target.shippingAddress);\n * });\n * });\n * @returns {void}\n */\n\n /**\n * @name PaymentRequestComponent#off\n * @function\n * @param {string} event The name of the event to which you are unsubscribing.\n * @param {function} handler The callback for the event you are unsubscribing from.\n * @description Unsubscribes the handler function to a named event.\n * @example\n *
Subscribing and then unsubscribing from a Payment Request event, in this case 'shippingAddressChange'\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * var callback = function (event) {\n * console.log(event.target.shippingAddress);\n * };\n * paymentRequestInstance.on('shippingAddressChange', callback);\n *\n * // later on\n * paymentRequestInstance.off('shippingAddressChange', callback);\n * });\n * @returns {void}\n */\n\n /**\n * This event is emitted when the customer selects a shipping address.\n * @event PaymentRequestComponent#shippingAddressChange\n * @type {PaymentRequestComponent~shippingEventObject}\n * @example\n *
Listening to a shipping address change event\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * // validate event.target.shippingAddress if needed\n *\n * event.updateWith(paymentRequestDetails);\n * });\n * });\n */\n\n /**\n * This event is emitted when the customer selects a shipping option.\n * @event PaymentRequestComponent#shippingOptionChange\n * @type {PaymentRequestComponent~shippingEventObject}\n * @example\n *
Listening to a shipping option change event\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingOptionChange', function (event) {\n * // validate event.target.shippingOption if needed\n *\n * paymentRequestDetails.shippingOptions.forEach(function (option) {\n * option.selected = option.id === event.target.shippingOption;\n * });\n *\n * event.updateWith(paymentRequestDetails);\n * });\n * });\n */\n\n\n var CARD_TYPE_MAPPINGS = {\n Visa: 'visa',\n MasterCard: 'mastercard',\n 'American Express': 'amex',\n 'Diners Club': 'diners',\n Discover: 'discover',\n JCB: 'jcb',\n UnionPay: 'unionpay',\n Maestro: 'maestro'\n };\n var BRAINTREE_GOOGLE_PAY_MERCHANT_ID = '18278000977346790994';\n\n function composeUrl(assetsUrl, componentId, isDebug) {\n var baseUrl = assetsUrl; // endRemoveIf(production)\n\n return baseUrl + '/web/' + VERSION + '/html/payment-request-frame' + useMin(isDebug) + '.html#' + componentId;\n }\n /**\n * @class PaymentRequestComponent\n * @param {object} options The Payment Request Component {@link module:braintree-web/payment-request.create create} options.\n * @description
Do not use this constructor directly. Use {@link module:braintree-web/payment-request.create|braintree-web.payment-request.create} instead.\n *\n * @classdesc This class represents a Payment Request component produced by {@link module:braintree-web/payment-request.create|braintree-web/payment-request.create}. Instances of this class have methods for initializing a Payment Request.\n *\n * **Note:** This component is currently in beta and the API may include breaking changes when upgrading. Please review the [Changelog](https://github.com/braintree/braintree-web/blob/master/CHANGELOG.md) for upgrade steps whenever you upgrade the version of braintree-web.\n */\n\n\n function PaymentRequestComponent(options) {\n var enabledPaymentMethods = options.enabledPaymentMethods || {};\n EventEmitter.call(this);\n this._componentId = uuid();\n this._client = options.client;\n this._enabledPaymentMethods = {\n basicCard: enabledPaymentMethods.basicCard !== false,\n googlePay: enabledPaymentMethods.googlePay !== false\n };\n this._googlePayVersion = options.googlePayVersion === 2 ? 2 : 1;\n this._googleMerchantId = BRAINTREE_GOOGLE_PAY_MERCHANT_ID;\n this._supportedPaymentMethods = this._constructDefaultSupportedPaymentMethods();\n this._defaultSupportedPaymentMethods = Object.keys(this._supportedPaymentMethods).map(function (key) {\n return this._supportedPaymentMethods[key];\n }.bind(this));\n this._bus = new Bus({\n channel: this._componentId\n });\n }\n\n EventEmitter.createChild(PaymentRequestComponent);\n\n PaymentRequestComponent.prototype._constructDefaultSupportedPaymentMethods = function () {\n var configuration = this._client.getConfiguration();\n\n var androidPayConfiguration = configuration.gatewayConfiguration.androidPay;\n var cardConfiguration = configuration.gatewayConfiguration.creditCards;\n var supportedPaymentMethods = {};\n\n if (this._enabledPaymentMethods.basicCard && cardConfiguration && cardConfiguration.supportedCardTypes.length > 0) {\n supportedPaymentMethods.basicCard = {\n supportedMethods: 'basic-card',\n data: {\n supportedNetworks: cardConfiguration.supportedCardTypes.reduce(function (types, cardType) {\n if (cardType in CARD_TYPE_MAPPINGS) {\n types.push(CARD_TYPE_MAPPINGS[cardType]);\n }\n\n return types;\n }, [])\n }\n };\n }\n\n if (this._enabledPaymentMethods.googlePay && androidPayConfiguration && androidPayConfiguration.enabled) {\n supportedPaymentMethods.googlePay = {\n supportedMethods: 'https://google.com/pay',\n data: generateGooglePayConfiguration(configuration, this._googlePayVersion, this._googleMerchantId)\n };\n }\n\n return supportedPaymentMethods;\n };\n\n PaymentRequestComponent.prototype.initialize = function () {\n var clientConfiguration = this._client.getConfiguration();\n\n var self = this;\n this._frame = iFramer({\n allowPaymentRequest: true,\n name: 'braintree-payment-request-frame',\n 'class': 'braintree-payment-request-frame',\n height: 0,\n width: 0,\n style: {\n position: 'absolute',\n left: '-9999px'\n },\n title: 'Secure Payment Frame'\n });\n\n if (this._defaultSupportedPaymentMethods.length === 0) {\n return Promise.reject(new BraintreeError(errors.PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS));\n }\n\n return new Promise(function (resolve) {\n self._bus.on(events.FRAME_READY, function (reply) {\n reply(self._client);\n });\n\n self._bus.on(events.FRAME_CAN_MAKE_REQUESTS, function () {\n analytics.sendEvent(self._client, 'payment-request.initialized');\n\n self._bus.on(events.SHIPPING_ADDRESS_CHANGE, function (shippingAddress) {\n var shippingAddressChangeEvent = {\n target: {\n shippingAddress: shippingAddress\n },\n updateWith: function updateWith(paymentDetails) {\n self._bus.emit(events.UPDATE_SHIPPING_ADDRESS, paymentDetails);\n }\n };\n\n self._emit('shippingAddressChange', shippingAddressChangeEvent);\n\n self._emit('shippingaddresschange', shippingAddressChangeEvent);\n });\n\n self._bus.on(events.SHIPPING_OPTION_CHANGE, function (shippingOption) {\n var shippingOptionChangeEvent = {\n target: {\n shippingOption: shippingOption\n },\n updateWith: function updateWith(paymentDetails) {\n self._bus.emit(events.UPDATE_SHIPPING_OPTION, paymentDetails);\n }\n };\n\n self._emit('shippingOptionChange', shippingOptionChangeEvent);\n\n self._emit('shippingoptionchange', shippingOptionChangeEvent);\n });\n\n resolve(self);\n }); // TODO - We may need to apply the same setTimeout hack that Hosted Fields\n // uses for iframes to load correctly in Edge. See:\n // https://github.com/braintree/braintree-web/blob/0c951e5f9859c606652485de14188b6bd6656677/src/hosted-fields/external/hosted-fields.js#L449-L469\n\n\n self._frame.src = composeUrl(clientConfiguration.gatewayConfiguration.assetsUrl, self._componentId, clientConfiguration.isDebug);\n document.body.appendChild(self._frame);\n });\n };\n /**\n * Create an object to pass into tokenize to specify a custom configuration. If no overrides are provided, the default configuration will be provided.\n * @public\n * @param {string} type The supported payment method type. Possible values are `basicCard` and `googlePay`.\n * If no type is provided, the function will throw an error. If the type provided is not an enabled payment method for the merchant account , the function will throw an error.\n * @param {object} [overrides] The configuration overrides for the [data property on the supported payment methods objects](https://developers.google.com/web/fundamentals/payments/deep-dive-into-payment-request). If not passed in, the default configuration for the specified type will be provided. If a property is not provided, the value from the default configuration will be used.\n * @example
Getting the default configuration for a specified type\n * var configuration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard');\n *\n * configuration.supportedMethods; // 'basic-card'\n * configuration.data.supportedNetworks; // ['visa', 'mastercard', 'amex'] <- whatever the supported card networks for the merchant account are\n * @example
Specifying overrides\n * var configuration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard', {\n * supportedNetworks: ['visa'],\n * supportedTypes: ['credit', 'debit']\n * });\n *\n * configuration.supportedMethods; // 'basic-card'\n * configuration.data.supportedNetworks; // ['visa']\n * configuration.data.supportedTypes; // ['credit', 'debit']\n * @returns {object} Returns a configuration object for use in the tokenize function.\n */\n\n\n PaymentRequestComponent.prototype.createSupportedPaymentMethodsConfiguration = function (type, overrides) {\n var configuration;\n\n if (!type) {\n throw new BraintreeError(errors.PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE);\n }\n\n if (!this._enabledPaymentMethods[type]) {\n throw new BraintreeError(errors.PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED);\n }\n\n configuration = assign({}, this._supportedPaymentMethods[type]);\n configuration.data = assign({}, configuration.data, overrides);\n return configuration;\n };\n /**\n * Tokenizes a Payment Request\n * @public\n * @param {object} configuration A {@link PaymentRequestComponent~paymentRequestConfiguration|paymentRequestConfiguration}.\n * @param {callback} [callback] The second argument,
data
, is a {@link PaymentRequest~paymentPayload|paymentPayload}. If no callback is provided, `tokenize` returns a function that resolves with a {@link PaymentRequestComponent~tokenizePayload|tokenizePayload}.\n * @example\n * paymentRequestInstance.tokenize({\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * }\n * }).then(function (payload) {\n * // send payload.nonce to server\n *\n * // examine the raw response (with card details removed for security) from the payment request\n * console.log(payload.details.rawPaymentResponse);\n * }).catch(function (err) {\n * if (err.code === 'PAYMENT_REQUEST_CANCELED') {\n * // payment request was canceled by user\n * } else {\n * // an error occurred while processing\n * }\n * });\n * @example
Tokenize only Visa cards\n * var basicCardConfiguration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard', {\n * supportedNetworks: ['visa']\n * };\n *\n * paymentRequestInstance.tokenize({\n * supportedPaymentMethods: [basicCardConfiguration],\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * });\n * @example
Include payment request options\n * paymentRequestInstance.tokenize({\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * },\n * options: {\n * requestPayerName: true,\n * requestPayerPhone: true,\n * requestPayerEmail: true\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * // collect additional info from the raw response\n * console.log(payload.details.rawPaymentResponse);\n * });\n * @example
Request Shipping Information\n * var shippingOptions = [\n * {\n * id: 'economy',\n * label: 'Economy Shipping (5-7 Days)',\n * amount: {\n * currency: 'USD',\n * value: '0',\n * },\n * }, {\n * id: 'express',\n * label: 'Express Shipping (2-3 Days)',\n * amount: {\n * currency: 'USD',\n * value: '5',\n * },\n * }, {\n * id: 'next-day',\n * label: 'Next Day Delivery',\n * amount: {\n * currency: 'USD',\n * value: '12',\n * },\n * },\n * ];\n * var paymentDetails = {\n * \t total: {\n * label: 'Total',\n * amount: {\n * currency: 'USD',\n * value: '10.00',\n * }\n * },\n * shippingOptions: shippingOptions\n * };\n *\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * // validate shipping address on event.target.shippingAddress\n * // make changes to the paymentDetails or shippingOptions if necessary\n *\n * event.updateWith(paymentDetails)\n * });\n *\n * paymentRequestInstance.on('shippingOptionChange', function (event) {\n * shippingOptions.forEach(function (option) {\n * option.selected = option.id === event.target.shippingOption;\n * });\n *\n * event.updateWith(paymentDetails)\n * });\n *\n * paymentRequestInstance.tokenize({\n * details: paymentDetails,\n * options: {\n * requestShipping: true\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * // collect shipping information from payload\n * console.log(payload.details.rawPaymentResponse.shippingAddress);\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PaymentRequestComponent.prototype.tokenize = function (configuration) {\n var self = this; // NEXT_MAJOR_VERSION fail early if a payment method is passed in\n // that the component does not support\n\n return new Promise(function (resolve, reject) {\n self._bus.emit(events.PAYMENT_REQUEST_INITIALIZED, {\n supportedPaymentMethods: configuration.supportedPaymentMethods || self._defaultSupportedPaymentMethods,\n details: configuration.details,\n options: configuration.options\n }, function (response) {\n var rawError = response[0];\n var payload = response[1];\n\n if (rawError) {\n reject(self._formatTokenizationError(rawError));\n return;\n }\n\n analytics.sendEvent(self._client, 'payment-request.tokenize.succeeded');\n resolve({\n nonce: payload.nonce,\n type: payload.type,\n description: payload.description,\n details: {\n rawPaymentResponse: payload.details.rawPaymentResponse,\n cardType: payload.details.cardType,\n lastFour: payload.details.lastFour,\n lastTwo: payload.details.lastTwo\n },\n binData: payload.binData\n });\n });\n });\n };\n /**\n * Check if the customer can make payments.\n * @public\n * @param {object} configuration A {@link PaymentRequestComponent~paymentRequestConfiguration|paymentRequestConfiguration}.\n * @param {callback} [callback] Called on completion.\n * @example\n * var paymentDetails = {\n * \t total: {\n * label: 'Total',\n * amount: {\n * currency: 'USD',\n * value: '10.00',\n * }\n * }\n * };\n *\n * paymentRequestInstance.canMakePayment({\n * details: paymentDetails\n * }).then(function (result) {\n * if (result) {\n * // set up payment request button\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PaymentRequestComponent.prototype.canMakePayment = function (configuration) {\n var self = this;\n var unsupportedPaymentMethod; // NEXT_MAJOR_VERSION Move this check to component creation\n\n if (!window.PaymentRequest) {\n analytics.sendEvent(self._client, 'payment-request.can-make-payment.not-available');\n return Promise.resolve(false);\n }\n\n if (configuration.supportedPaymentMethods) {\n configuration.supportedPaymentMethods.forEach(function (config) {\n var supportedMethods = config.supportedMethods;\n\n if (!(supportedMethods in constants.SUPPORTED_METHODS)) {\n unsupportedPaymentMethod = supportedMethods;\n }\n });\n\n if (unsupportedPaymentMethod) {\n return Promise.reject(new BraintreeError({\n type: errors.PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD.type,\n code: errors.PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD.code,\n message: unsupportedPaymentMethod + ' is not a supported payment method.'\n }));\n }\n }\n\n return new Promise(function (resolve, reject) {\n self._bus.emit(events.CAN_MAKE_PAYMENT, {\n supportedPaymentMethods: configuration.supportedPaymentMethods || self._defaultSupportedPaymentMethods,\n details: configuration.details,\n options: configuration.options\n }, function (response) {\n var error = response[0];\n var payload = response[1];\n\n if (error) {\n reject(self._formatCanMakePaymentError(error));\n return;\n }\n\n analytics.sendEvent(self._client, 'payment-request.can-make-payment.' + payload);\n resolve(payload);\n });\n });\n };\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/payment-request.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * paymentRequestInstance.teardown();\n * @example
With callback\n * paymentRequestInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PaymentRequestComponent.prototype.teardown = function () {\n this._bus.teardown();\n\n this._frame.parentNode.removeChild(this._frame);\n\n convertMethodsToError(this, methods(PaymentRequestComponent.prototype));\n analytics.sendEvent(this._client, 'payment-request.teardown-completed');\n return Promise.resolve();\n };\n\n PaymentRequestComponent.prototype._formatTokenizationError = function (error) {\n var formattedError;\n\n switch (error.name) {\n case 'AbortError':\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_CANCELED.type,\n code: errors.PAYMENT_REQUEST_CANCELED.code,\n message: errors.PAYMENT_REQUEST_CANCELED.message,\n details: {\n originalError: error\n }\n });\n analytics.sendEvent(this._client, 'payment-request.tokenize.canceled');\n return formattedError;\n\n case 'PAYMENT_REQUEST_INITIALIZATION_FAILED':\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.type,\n code: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.code,\n message: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.message,\n details: {\n originalError: error\n }\n });\n break;\n\n case 'BRAINTREE_GATEWAY_GOOGLE_PAYMENT_TOKENIZATION_ERROR':\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.type,\n code: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.code,\n message: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.message,\n details: {\n originalError: error\n }\n });\n break;\n\n case 'BRAINTREE_GATEWAY_GOOGLE_PAYMENT_PARSING_ERROR':\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.type,\n code: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.code,\n message: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.message,\n details: {\n originalError: error\n }\n });\n break;\n\n default:\n formattedError = new BraintreeError({\n code: errors.PAYMENT_REQUEST_NOT_COMPLETED.code,\n type: error.type || BraintreeError.types.CUSTOMER,\n message: errors.PAYMENT_REQUEST_NOT_COMPLETED.message,\n details: {\n originalError: error\n }\n });\n }\n\n analytics.sendEvent(this._client, 'payment-request.tokenize.failed');\n return formattedError;\n };\n\n PaymentRequestComponent.prototype._formatCanMakePaymentError = function (error) {\n var formattedError;\n\n switch (error.name) {\n case 'PAYMENT_REQUEST_INITIALIZATION_FAILED':\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.type,\n code: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.code,\n message: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.message,\n details: {\n originalError: error\n }\n });\n break;\n\n case 'NotAllowedError':\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.type,\n code: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.code,\n message: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.message,\n details: {\n originalError: error\n }\n });\n break;\n\n default:\n formattedError = new BraintreeError({\n code: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.code,\n type: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.type,\n message: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.message,\n details: {\n originalError: error\n }\n });\n }\n\n analytics.sendEvent(this._client, 'payment-request.can-make-payment.failed');\n return formattedError;\n };\n\n module.exports = wrapPromise.wrapPrototype(PaymentRequestComponent);\n }, {\n \"../../lib/analytics\": 121,\n \"../../lib/assign\": 123,\n \"../../lib/braintree-error\": 126,\n \"../../lib/convert-methods-to-error\": 129,\n \"../../lib/generate-google-pay-configuration\": 151,\n \"../../lib/methods\": 157,\n \"../../lib/promise\": 159,\n \"../../lib/use-min\": 162,\n \"../shared/constants\": 175,\n \"@braintree/event-emitter\": 34,\n \"@braintree/iframer\": 36,\n \"@braintree/uuid\": 40,\n \"@braintree/wrap-promise\": 44,\n \"framebus\": 53\n }],\n 174: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @module braintree-web/payment-request\n * @description A component to integrate with the Payment Request API.\n *\n * **Note:** This component is currently in beta and the API may include breaking changes when upgrading. Please review the [Changelog](https://github.com/braintree/braintree-web/blob/master/CHANGELOG.md) for upgrade steps whenever you upgrade the version of braintree-web.\n * */\n\n var PaymentRequestComponent = _dereq_('./external/payment-request');\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var VERSION = \"3.76.1\";\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {object} [options.enabledPaymentMethods] An object representing which payment methods to display.\n * @param {boolean} [options.enabledPaymentMethods.basicCard=true] Whether or not to display credit card as an option in the Payment Request dialog. If left blank or set to true, credit cards will be displayed in the dialog if the merchant account is set up to process credit cards.\n * @param {boolean} [options.enabledPaymentMethods.googlePay=true] Whether or not to display Google Pay as an option in the Payment Request dialog. If left blank or set to true, Google Pay will be displayed in the dialog if the merchant account is set up to process Google Pay.\n * @param {Number} [options.googlePayVersion=1] Ignored if `options.enabledPaymentMethods.googlePay = false`. If `true`, this option specifies the version of Google Pay to use. Choose either 1 (default) or 2.\n * @param {callback} [callback] The second argument, `data`, is the {@link PaymentRequestComponent} instance. If no callback is provided, `create` returns a promise that resolves with the {@link PaymentRequestComponent} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * if (window.PaymentRequest) {\n * braintree.paymentRequest.create({\n * client: clientInstance\n * }, cb);\n * } else {\n * // fall back to Hosted Fields if browser does not support Payment Request API\n * braintree.hostedFields.create(hostedFieldsOptions, cb);\n * }\n * @example
Explicitly turning off credit cards from Payment Request API dialog\n * braintree.paymentRequest.create({\n * client: clientInstance,\n * enabledPaymentMethods: {\n * googlePay: true,\n * basicCard: false\n * }\n * }, cb);\n * @example
Using Google Pay v2 or basic card\n * braintree.paymentRequest.create({\n * client: clientInstance,\n * enabledPaymentMethods: {\n * basicCard: true,\n * googlePay: true\n * },\n * googlePayVersion: 2\n * }, cb);\n *\n */\n\n function create(options) {\n var name = 'Payment Request';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var paymentRequestInstance;\n options.client = client;\n paymentRequestInstance = new PaymentRequestComponent(options);\n return paymentRequestInstance.initialize();\n });\n }\n\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 124,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"./external/payment-request\": 173,\n \"@braintree/wrap-promise\": 44\n }],\n 175: [function (_dereq_, module, exports) {\n 'use strict';\n\n var enumerate = _dereq_('../../lib/enumerate');\n\n var errors = _dereq_('./errors');\n\n var constants = {};\n constants.events = enumerate(['CAN_MAKE_PAYMENT', 'FRAME_READY', 'FRAME_CAN_MAKE_REQUESTS', 'PAYMENT_REQUEST_INITIALIZED', 'SHIPPING_ADDRESS_CHANGE', 'UPDATE_SHIPPING_ADDRESS', 'SHIPPING_OPTION_CHANGE', 'UPDATE_SHIPPING_OPTION'], 'payment-request:');\n constants.errors = errors;\n constants.SUPPORTED_METHODS = {\n 'basic-card': true,\n 'https://google.com/pay': true\n };\n module.exports = constants;\n }, {\n \"../../lib/enumerate\": 136,\n \"./errors\": 176\n }],\n 176: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Payment Request - Creation Error Codes\n * @description Errors that occur when [creating the Payment Request component](./module-braintree-web_payment-request.html#.create).\n * @property {MERCHANT} PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS Occurs when there are no valid payment methods configured.\n */\n\n /**\n * @name BraintreeError.Payment Request - createSupportedPaymentMethodsConfiguration Error Codes\n * @description Errors that occur when using the [`createSupportedPaymentMethodsConfiguration` method](./PaymentRequestComponent.html#createSupportedPaymentMethodsConfiguration)\n * @property {MERCHANT} PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE Occurs when no type is supplied for method.\n * @property {MERCHANT} PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED Occurs when configured type is not enabled.\n */\n\n /**\n * @name BraintreeError.Payment Request - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./PaymentRequestComponent.html#tokenize)\n * @property {CUSTOMER} PAYMENT_REQUEST_CANCELED Occurs when customer cancels the Payment Request.\n * @property {MERCHANT} PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED Occurs when the Payment Request is closed do to the options being misconfigured.\n * @property {MERCHANT} PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE Occurs when a Google Payment payment method is unable to be tokenized.\n * @property {UNKNOWN} PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR Occurs when the result of tokenizing a Google Payment payment method could not be parsed.\n * @property {CUSTOMER} PAYMENT_REQUEST_NOT_COMPLETED Occurs when an error prevented the Payment Request from being completed.\n */\n\n /**\n * @name BraintreeError.Payment Request - canMakePayment Error Codes\n * @description Errors that occur when using the [`canMakePayment` method](./PaymentRequestComponent.html#canMakePayment)\n * @property {MERCHANT} PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED Occurs when the Payment Request is instantiated with misconfigured options.\n * @property {MERCHANT} PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED Occurs when `canMakePayment` results in a `DomException` with a `NotAllowedError`. This usually occurs when `canMakePayment` is called multiple times with different supported payment options.\n * @property {MERCHANT} PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD Occurs when `canMakePayment` is called with a `supportedPaymentMethods` array that contains a payment method that is not supported by the Braintree SDK.\n * @property {UNKNOWN} PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED Occurs when `canMakePayment` fails for any reason other than a misconfigured Payment Request object.\n */\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n module.exports = {\n PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS',\n message: 'There are no supported payment methods associated with this account.'\n },\n PAYMENT_REQUEST_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'PAYMENT_REQUEST_CANCELED',\n message: 'Payment request was canceled.'\n },\n PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED',\n message: 'Something went wrong when configuring the payment request.'\n },\n PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: 'PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED',\n message: 'Something went wrong when calling `canMakePayment`'\n },\n PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED',\n message: 'Something went wrong when calling `canMakePayment`. Most likely, `canMakePayment` was called multiple times with different supportedMethods configurations.'\n },\n PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD'\n },\n PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE',\n message: 'Something went wrong when tokenizing the Google Pay card.'\n },\n PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: 'PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR',\n message: 'Something went wrong when tokenizing the Google Pay card.'\n },\n PAYMENT_REQUEST_NOT_COMPLETED: {\n code: 'PAYMENT_REQUEST_NOT_COMPLETED',\n message: 'Payment request could not be completed.'\n },\n PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE',\n message: 'createSupportedPaymentMethodsConfiguration must include a type parameter.'\n },\n PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED',\n message: 'createSupportedPaymentMethodsConfiguration type parameter must be valid or enabled.'\n }\n };\n }, {\n \"../../lib/braintree-error\": 126\n }],\n 177: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.PayPal Checkout - Creation Error Codes\n * @description Errors that occur when [creating the PayPal Checkout component](./module-braintree-web_paypal-checkout.html#.create).\n * @property {MERCHANT} PAYPAL_NOT_ENABLED Occurs when PayPal is not enabled on the Braintree control panel.\n * @property {MERCHANT} PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED Occurs only when testing in Sandbox, when a PayPal sandbox account is not linked to the merchant account in the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.PayPal Checkout - createPayment Error Codes\n * @description Errors that occur when using the [`createPayment` method](./PayPalCheckout.html#createPayment).\n * @property {MERCHANT} PAYPAL_FLOW_OPTION_REQUIRED Occurs when a required option is missing.\n * @property {MERCHANT} PAYPAL_INVALID_PAYMENT_OPTION Occurs when an option contains an invalid value.\n * @property {NETWORK} PAYPAL_FLOW_FAILED Occurs when something goes wrong when initializing the flow.\n */\n\n /**\n * @name BraintreeError.PayPal Checkout - startVaultInitiatedCheckout Error Codes\n * @description Errors that occur when using the [`startVaultInitiatedCheckout` method](./PayPalCheckout.html#startVaultInitiatedCheckout).\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED Occurs when a required param is missing when calling the method.\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED Occurs when PayPal window could not be opened. This often occurs because the call to start the vault initiated flow was not triggered from a click event.\n * @property {CUSTOMER} PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED Occurs when a customer closes the PayPal flow before completion.\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS Occurs when the flow is initialized while an authorization is already in progress.\n * @property {NETWORK} PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED Occurs when something went wrong setting up the flow.\n */\n\n /**\n * @name BraintreeError.PayPal Checkout - tokenizePayment Error Codes\n * @description Errors that occur when using the [`tokenizePayment` method](./PayPalCheckout.html#tokenizePayment).\n * @property {NETWORK} PAYPAL_ACCOUNT_TOKENIZATION_FAILED Occurs when PayPal account could not be tokenized.\n */\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n module.exports = {\n PAYPAL_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_NOT_ENABLED',\n message: 'PayPal is not enabled for this merchant.'\n },\n PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED',\n message: 'A linked PayPal Sandbox account is required to use PayPal Checkout in Sandbox. See https://developers.braintreepayments.com/guides/paypal/testing-go-live/#linked-paypal-testing for details on linking your PayPal sandbox with Braintree.'\n },\n PAYPAL_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED',\n message: 'Could not tokenize user\\'s PayPal account.'\n },\n PAYPAL_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'PAYPAL_FLOW_FAILED',\n message: 'Could not initialize PayPal flow.'\n },\n PAYPAL_FLOW_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_FLOW_OPTION_REQUIRED',\n message: 'PayPal flow property is invalid or missing.'\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED'\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED',\n message: 'Something went wrong when setting up the checkout workflow.'\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED',\n message: 'PayPal popup failed to open, make sure to initiate the vault checkout in response to a user action.'\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED',\n message: 'Customer closed PayPal popup before authorizing.'\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS',\n message: 'Vault initiated checkout already in progress.'\n },\n PAYPAL_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_INVALID_PAYMENT_OPTION',\n message: 'PayPal payment options are invalid.'\n }\n };\n }, {\n \"../lib/braintree-error\": 126\n }],\n 178: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @module braintree-web/paypal-checkout\n * @description A component to integrate with the [PayPal JS SDK](https://github.com/paypal/paypal-checkout-components).\n */\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var PayPalCheckout = _dereq_('./paypal-checkout');\n\n var VERSION = \"3.76.1\";\n /**\n * @static\n * @function create\n * @description There are two ways to integrate the PayPal Checkout component. See the [PayPal Checkout constructor documentation](PayPalCheckout.html#PayPalCheckout) for more information and examples.\n *\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {string} [options.merchantAccountId] A non-default merchant account ID to use for tokenization.\n * @param {boolean} [options.autoSetDataUserIdToken=false] Whether or not to render the PayPal SDK button with a customer's vaulted PayPal account. Must be used in conjunction with a Client Token generated with a customer id.\n * @param {callback} [callback] The second argument, `data`, is the {@link PayPalCheckout} instance.\n * @example\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * // set up the PayPal JS SDK\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n function create(options) {\n var name = 'PayPal Checkout';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n var instance = new PayPalCheckout(options);\n return instance._initialize(options);\n });\n }\n /**\n * @static\n * @function isSupported\n * @description Returns true if PayPal Checkout [supports this browser](index.html#browser-support-webviews).\n * @deprecated Previously, this method checked for Popup support in the browser. The PayPal JS SDK now falls back to a modal if popups are not supported.\n * @returns {Boolean} Returns true if PayPal Checkout supports this browser.\n */\n\n\n function isSupported() {\n return true;\n }\n\n module.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 124,\n \"./paypal-checkout\": 179,\n \"@braintree/wrap-promise\": 44\n }],\n 179: [function (_dereq_, module, exports) {\n 'use strict';\n\n var analytics = _dereq_('../lib/analytics');\n\n var assign = _dereq_('../lib/assign').assign;\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var Promise = _dereq_('../lib/promise');\n\n var ExtendedPromise = _dereq_('@braintree/extended-promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var convertToBraintreeError = _dereq_('../lib/convert-to-braintree-error');\n\n var errors = _dereq_('./errors');\n\n var constants = _dereq_('../paypal/shared/constants');\n\n var frameService = _dereq_('../lib/frame-service/external');\n\n var createAuthorizationData = _dereq_('../lib/create-authorization-data');\n\n var methods = _dereq_('../lib/methods');\n\n var useMin = _dereq_('../lib/use-min');\n\n var convertMethodsToError = _dereq_('../lib/convert-methods-to-error');\n\n var querystring = _dereq_('../lib/querystring');\n\n var VERSION = \"3.76.1\";\n\n var INTEGRATION_TIMEOUT_MS = _dereq_('../lib/constants').INTEGRATION_TIMEOUT_MS;\n\n var REQUIRED_PARAMS_FOR_START_VAULT_INITIATED_CHECKOUT = ['amount', 'currency', 'vaultInitiatedCheckoutPaymentMethodToken'];\n var PAYPAL_SDK_PRELOAD_URL = 'https://www.{ENV}paypal.com/smart/buttons/preload';\n /**\n * PayPal Checkout tokenized payload. Returned in {@link PayPalCheckout#tokenizePayment}'s callback as the second argument, `data`.\n * @typedef {object} PayPalCheckout~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `PayPalAccount`.\n * @property {object} details Additional PayPal account details.\n * @property {string} details.email User's email address.\n * @property {string} details.payerId User's payer ID, the unique identifier for each PayPal account.\n * @property {string} details.firstName User's given name.\n * @property {string} details.lastName User's surname.\n * @property {?string} details.countryCode User's 2 character country code.\n * @property {?string} details.phone User's phone number (e.g. 555-867-5309).\n * @property {?object} details.shippingAddress User's shipping address details, only available if shipping address is enabled.\n * @property {string} details.shippingAddress.recipientName Recipient of postage.\n * @property {string} details.shippingAddress.line1 Street number and name.\n * @property {string} details.shippingAddress.line2 Extended address.\n * @property {string} details.shippingAddress.city City or locality.\n * @property {string} details.shippingAddress.state State or region.\n * @property {string} details.shippingAddress.postalCode Postal code.\n * @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} details.billingAddress User's billing address details.\n * Not available to all merchants; [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support) for details on eligibility and enabling this feature.\n * Alternatively, see `shippingAddress` above as an available client option.\n * @property {string} details.billingAddress.line1 Street number and name.\n * @property {string} details.billingAddress.line2 Extended address.\n * @property {string} details.billingAddress.city City or locality.\n * @property {string} details.billingAddress.state State or region.\n * @property {string} details.billingAddress.postalCode Postal code.\n * @property {string} details.billingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} creditFinancingOffered This property will only be present when the customer pays with PayPal Credit.\n * @property {object} creditFinancingOffered.totalCost This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalCost.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalCost.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {number} creditFinancingOffered.term Length of financing terms in months.\n * @property {object} creditFinancingOffered.monthlyPayment This is the estimated amount per month that the customer will need to pay including fees and interest.\n * @property {string} creditFinancingOffered.monthlyPayment.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.monthlyPayment.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {object} creditFinancingOffered.totalInterest Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalInterest.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalInterest.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {boolean} creditFinancingOffered.payerAcceptance Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.\n * @property {boolean} creditFinancingOffered.cartAmountImmutable Indicates whether the cart amount is editable after payer's acceptance on PayPal side.\n */\n\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/paypal-checkout.create|paypal-checkout.create}\n * @classdesc This class represents a PayPal Checkout component that coordinates with the {@link https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page|PayPal SDK}. Instances of this class can generate payment data and tokenize authorized payments.\n *\n * All UI (such as preventing actions on the parent page while authentication is in progress) is managed by the {@link https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page|PayPal SDK}. You must provide your PayPal `client-id` as a query parameter. You can [retrieve this value from the PayPal Dashboard](https://developer.paypal.com/docs/checkout/integrate/#1-get-paypal-rest-api-credentials).\n * @description
Do not use this constructor directly. Use {@link module:braintree-web/paypal-checkout.create|braintree-web.paypal-checkout.create} instead.\n *\n * #### Integrate Checkout Flow with PayPal SDK\n *\n * You must have [PayPal's script, configured with various query parameters](https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page), loaded on your page:\n *\n * ```html\n * \n *
\n * ```\n *\n * When passing values in the `createPayment` method, make sure they match the [corresponding parameters in the query parameters for the PayPal SDK script](https://developer.paypal.com/docs/checkout/reference/customize-sdk/).\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Buttons({\n * createOrder: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * currency: 'USD',\n * amount: '10.00',\n * intent: 'capture' // this value must either be `capture` or match the intent passed into the PayPal SDK intent query parameter\n * // your other createPayment options here\n * });\n * },\n *\n * onApprove: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * },\n *\n * onCancel: function () {\n * // handle case where user cancels\n * },\n *\n * onError: function (err) {\n * // handle case where error occurs\n * }\n * }).render('#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * #### Integrate Vault Flow with PayPal SDK\n *\n * You must have [PayPal's script, configured with various query parameters](https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page), loaded on your page:\n *\n * ```html\n * \n *
\n * ```\n *\n * When passing values in the `createPayment` method, make sure they match the [corresponding parameters in the query parameters for the PayPal SDK script](https://developer.paypal.com/docs/checkout/reference/customize-sdk/).\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Buttons({\n * createBillingAgreement: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'vault'\n * // your other createPayment options here\n * });\n * },\n *\n * onApprove: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * },\n *\n * onCancel: function () {\n * // handle case where user cancels\n * },\n *\n * onError: function (err) {\n * // handle case where error occurs\n * }\n * }).render('#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * #### Integrate with Checkout.js (deprecated PayPal SDK)\n *\n * If you are creating a new PayPal integration, please follow the previous integration guide to use the current version of the PayPal SDK. Use this integration guide only as a reference if you are already integrated with Checkout.js.\n *\n * You must have PayPal's Checkout.js script loaded on your page.\n *\n * ```html\n * \n * ```\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Button.render({\n * env: 'production', // or 'sandbox'\n *\n * payment: function () {\n * return paypalCheckoutInstance.createPayment({\n * // your createPayment options here\n * });\n * },\n *\n * onAuthorize: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * }\n * }, '#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n */\n\n function PayPalCheckout(options) {\n this._merchantAccountId = options.merchantAccountId; // TODO remove this requirement for it to be opt in.\n // This feature is not yet GA, so we're intentionally making\n // it opt in and not publicly documenting it yet. Once it's\n // GA, we can remove the requirement to opt in to it\n\n this._autoSetDataUserIdToken = Boolean(options.autoSetDataUserIdToken);\n }\n\n PayPalCheckout.prototype._initialize = function (options) {\n var config;\n\n if (options.client) {\n config = options.client.getConfiguration();\n this._authorizationInformation = {\n fingerprint: config.authorizationFingerprint,\n environment: config.gatewayConfiguration.environment\n };\n } else {\n config = createAuthorizationData(options.authorization);\n this._authorizationInformation = {\n fingerprint: config.attrs.authorizationFingerprint,\n environment: config.environment\n };\n }\n\n this._clientPromise = createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: 'PayPal Checkout'\n }).then(function (client) {\n this._configuration = client.getConfiguration(); // we skip these checks if a merchant account id is\n // passed in, because the default merchant account\n // may not have paypal enabled\n\n if (!this._merchantAccountId) {\n if (!this._configuration.gatewayConfiguration.paypalEnabled) {\n this._setupError = new BraintreeError(errors.PAYPAL_NOT_ENABLED);\n } else if (this._configuration.gatewayConfiguration.paypal.environmentNoNetwork === true) {\n this._setupError = new BraintreeError(errors.PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED);\n }\n }\n\n if (this._setupError) {\n return Promise.reject(this._setupError);\n }\n\n analytics.sendEvent(client, 'paypal-checkout.initialized');\n this._frameServicePromise = this._setupFrameService(client);\n return client;\n }.bind(this)); // if client was passed in, let config checks happen before\n // resolving the instance. Otherwise, just resolve the instance\n\n if (options.client) {\n return this._clientPromise.then(function () {\n return this;\n }.bind(this));\n }\n\n return Promise.resolve(this);\n };\n\n PayPalCheckout.prototype._setupFrameService = function (client) {\n var frameServicePromise = new ExtendedPromise();\n var config = client.getConfiguration();\n var timeoutRef = setTimeout(function () {\n analytics.sendEvent(client, 'paypal-checkout.frame-service.timed-out');\n frameServicePromise.reject(new BraintreeError(errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED));\n }, INTEGRATION_TIMEOUT_MS);\n this._assetsUrl = config.gatewayConfiguration.paypal.assetsUrl + '/web/' + VERSION;\n this._isDebug = config.isDebug; // Note: this is using the static landing frame that the deprecated PayPal component builds and uses\n\n this._loadingFrameUrl = this._assetsUrl + '/html/paypal-landing-frame' + useMin(this._isDebug) + '.html';\n frameService.create({\n name: 'braintreepaypallanding',\n dispatchFrameUrl: this._assetsUrl + '/html/dispatch-frame' + useMin(this._isDebug) + '.html',\n openFrameUrl: this._loadingFrameUrl\n }, function (service) {\n this._frameService = service;\n clearTimeout(timeoutRef);\n frameServicePromise.resolve();\n }.bind(this));\n return frameServicePromise;\n };\n /**\n * @typedef {object} PayPalCheckout~lineItem\n * @property {string} quantity Number of units of the item purchased. This value must be a whole number and can't be negative or zero.\n * @property {string} unitAmount Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {string} name Item name. Maximum 127 characters.\n * @property {string} kind Indicates whether the line item is a debit (sale) or credit (refund) to the customer. Accepted values: `debit` and `credit`.\n * @property {?string} unitTaxAmount Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {?string} description Item description. Maximum 127 characters.\n * @property {?string} productCode Product or UPC code for the item. Maximum 127 characters.\n * @property {?string} url The URL to product information.\n */\n\n /**\n * @typedef {object} PayPalCheckout~shippingOption\n * @property {string} id A unique ID that identifies a payer-selected shipping option.\n * @property {string} label A description that the payer sees, which helps them choose an appropriate shipping option. For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`, or `USPS yōuxiān fā huò`. Localize this description to the payer's locale.\n * @property {boolean} selected If `selected = true` is specified as part of the API request it represents the shipping option that the payee/merchant expects to be pre-selected for the payer when they first view the shipping options within the PayPal checkout experience. As part of the response if a shipping option has `selected = true` it represents the shipping option that the payer selected during the course of checkout with PayPal. Only 1 `shippingOption` can be set to `selected = true`.\n * @property {string} type The method by which the payer wants to get their items. The possible values are:\n * * `SHIPPING` - The payer intends to receive the items at a specified address.\n * * `PICKUP` - The payer intends to pick up the items at a specified address. For example, a store address.\n * @property {object} amount The shipping cost for the selected option.\n * @property {string} amount.currency The three-character ISO-4217 currency code. PayPal does not support all currencies.\n * @property {string} amount.value The amount the shipping option will cost. Includes the specified number of digits after decimal separator for the ISO-4217 currency code.\n */\n\n /**\n * Creates a PayPal payment ID or billing token using the given options. This is meant to be passed to the PayPal JS SDK.\n * When a {@link callback} is defined, the function returns undefined and invokes the callback with the id to be used with the PayPal JS SDK. Otherwise, it returns a Promise that resolves with the id.\n * @public\n * @param {object} options All options for the PayPalCheckout component.\n * @param {string} options.flow Set to 'checkout' for one-time payment flow, or 'vault' for Vault flow. If 'vault' is used with a client token generated with a customer ID, the PayPal account will be added to that customer as a saved payment method.\n * @param {string} [options.intent=authorize]\n * * `authorize` - Submits the transaction for authorization but not settlement.\n * * `order` - Validates the transaction without an authorization (i.e. without holding funds). Useful for authorizing and capturing funds up to 90 days after the order has been placed. Only available for Checkout flow.\n * * `capture` - Payment will be immediately submitted for settlement upon creating a transaction. `sale` can be used as an alias for this value.\n * @param {boolean} [options.offerCredit=false] Offers PayPal Credit as the default funding instrument for the transaction. If the customer isn't pre-approved for PayPal Credit, they will be prompted to apply for it.\n * @param {(string|number)} [options.amount] The amount of the transaction. Required when using the Checkout flow.\n * @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow.\n * @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account\n * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow. This locale will be used unless the buyer has set a preferred locale for their account. If an unsupported locale is supplied, a fallback locale (determined by buyer preference or browser data) will be used and no error will be thrown.\n * @param {boolean} [options.requestBillingAgreement] If `true` and `flow = checkout`, the customer will be prompted to consent to a billing agreement during the checkout flow. This value is ignored when `flow = vault`.\n * @param {object} [options.billingAgreementDetails] When `requestBillingAgreement = true`, allows for details to be set for the billing agreement portion of the flow.\n * @param {string} [options.billingAgreementDetails.description] Description of the billing agreement to display to the customer.\n * @param {string} [options.vaultInitiatedCheckoutPaymentMethodToken] Use the payment method nonce representing a PayPal account with a Billing Agreement ID to create the payment and redirect the customer to select a new financial instrument. This option is only applicable to the `checkout` flow.\n *\n * Supported locales are:\n * `da_DK`,\n * `de_DE`,\n * `en_AU`,\n * `en_GB`,\n * `en_US`,\n * `es_ES`,\n * `fr_CA`,\n * `fr_FR`,\n * `id_ID`,\n * `it_IT`,\n * `ja_JP`,\n * `ko_KR`,\n * `nl_NL`,\n * `no_NO`,\n * `pl_PL`,\n * `pt_BR`,\n * `pt_PT`,\n * `ru_RU`,\n * `sv_SE`,\n * `th_TH`,\n * `zh_CN`,\n * `zh_HK`,\n * and `zh_TW`.\n *\n * @param {shippingOption[]} [options.shippingOptions] List of shipping options offered by the payee or merchant to the payer to ship or pick up their items. **Note:** `shippingOptions` may not be passed with `intent=\"order\"`.\n * @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}.\n * @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow.\n * @param {string} options.shippingAddressOverride.line1 Street address.\n * @param {string} [options.shippingAddressOverride.line2] Street address (extended).\n * @param {string} options.shippingAddressOverride.city City.\n * @param {string} options.shippingAddressOverride.state State.\n * @param {string} options.shippingAddressOverride.postalCode Postal code.\n * @param {string} options.shippingAddressOverride.countryCode Country.\n * @param {string} [options.shippingAddressOverride.phone] Phone number.\n * @param {string} [options.shippingAddressOverride.recipientName] Recipient's name.\n * @param {boolean} [options.shippingAddressEditable=true] Set to false to disable user editing of the shipping address.\n * @param {string} [options.billingAgreementDescription] Use this option to set the description of the preapproved payment agreement visible to customers in their PayPal profile during Vault flows. Max 255 characters.\n * @param {string} [options.landingPageType] Use this option to specify the PayPal page to display when a user lands on the PayPal site to complete the payment.\n * * `login` - A PayPal account login page is used.\n * * `billing` - A non-PayPal account landing page is used.\n * @param {lineItem[]} [options.lineItems] The {@link PayPalCheckout~lineItem|line items} for this transaction. It can include up to 249 line items.\n * @param {callback} [callback] The second argument is a PayPal `paymentId` or `billingToken` string, depending on whether `options.flow` is `checkout` or `vault`. This is also what is resolved by the promise if no callback is provided.\n * @example\n * // this paypal object is created by the PayPal JS SDK\n * // see https://github.com/paypal/paypal-checkout-components\n * paypal.Buttons({\n * createOrder: function () {\n * // when createPayment resolves, it is automatically passed to the PayPal JS SDK\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * amount: '10.00',\n * currency: 'USD',\n * intent: 'capture' // this value must either be `capture` or match the intent passed into the PayPal SDK intent query parameter\n * });\n * },\n * // Add other options, e.g. onApproved, onCancel, onError\n * }).render('#paypal-button');\n *\n * @example\n * // shippingOptions are passed to createPayment. You can review the result from onAuthorize to determine which shipping option id was selected.\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Button.render({\n * env: 'production'\n *\n * payment: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * amount: '10.00',\n * currency: 'USD',\n * shippingOptions: [\n * {\n * id: 'UUID-9',\n * type: 'PICKUP',\n * label: 'Store Location Five',\n * selected: true,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * },\n * {\n * id: 'shipping-speed-fast',\n * type: 'SHIPPING',\n * label: 'Fast Shipping',\n * selected: false,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * },\n * {\n * id: 'shipping-speed-slow',\n * type: 'SHIPPING',\n * label: 'Slow Shipping',\n * selected: false,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * }\n * ]\n * });\n * },\n *\n * onAuthorize: function (data, actions) {\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * }\n * }, '#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PayPalCheckout.prototype.createPayment = function (options) {\n if (!options || !constants.FLOW_ENDPOINTS.hasOwnProperty(options.flow)) {\n return Promise.reject(new BraintreeError(errors.PAYPAL_FLOW_OPTION_REQUIRED));\n }\n\n analytics.sendEvent(this._clientPromise, 'paypal-checkout.createPayment');\n return this._createPaymentResource(options).then(function (response) {\n var flowToken;\n\n if (options.flow === 'checkout') {\n flowToken = response.paymentResource.redirectUrl.match(/EC-\\w+/)[0];\n } else {\n flowToken = response.agreementSetup.tokenId;\n }\n\n return flowToken;\n });\n };\n\n PayPalCheckout.prototype._createPaymentResource = function (options, config) {\n var self = this;\n var endpoint = 'paypal_hermes/' + constants.FLOW_ENDPOINTS[options.flow];\n delete this.intentFromCreatePayment;\n config = config || {};\n\n if (options.offerCredit === true) {\n analytics.sendEvent(this._clientPromise, 'paypal-checkout.credit.offered');\n }\n\n return this._clientPromise.then(function (client) {\n return client.request({\n endpoint: endpoint,\n method: 'post',\n data: self._formatPaymentResourceData(options, config)\n }).then(function (data) {\n self.intentFromCreatePayment = options.intent;\n return data;\n });\n }).catch(function (err) {\n var status;\n\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n\n status = err.details && err.details.httpStatus;\n\n if (status === 422) {\n return Promise.reject(new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err\n }\n }));\n }\n\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_FLOW_FAILED.type,\n code: errors.PAYPAL_FLOW_FAILED.code,\n message: errors.PAYPAL_FLOW_FAILED.message\n }));\n });\n };\n /**\n * Initializes the PayPal checkout flow with a payment method nonce that represents a vaulted PayPal account.\n * When a {@link callback} is defined, the function returns undefined and invokes the callback with the id to be used with the PayPal JS SDK. Otherwise, it returns a Promise that resolves with the id.\n * @public\n * @ignore\n * @param {object} options These options are identical to the {@link PayPalCheckout#createPayment|options for creating a payment resource}, except for the following:\n * * `flow` cannot be set (will always be `'checkout'`)\n * * `amount`, `currency`, and `vaultInitiatedCheckoutPaymentMethodToken` are required instead of optional\n * * Additional configuration is available (listed below)\n * @param {boolean} [options.optOutOfModalBackdrop=false] By default, the webpage will darken and become unusable while the PayPal window is open. For full control of the UI, pass `true` for this option.\n * @param {callback} [callback] The second argument,
payload
, is a {@link PayPalCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, the promise resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @example\n * paypalCheckoutInstance.startVaultInitiatedCheckout({\n * vaultInitiatedCheckoutPaymentMethodToken: 'nonce-that-represents-a-vaulted-paypal-account',\n * amount: '10.00',\n * currency: 'USD'\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * }).catch(function (err) {\n * if (err.code === 'PAYPAL_POPUP_CLOSED') {\n * // indicates that customer canceled by\n * // manually closing the PayPal popup\n * }\n *\n * // handle other errors\n * });\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PayPalCheckout.prototype.startVaultInitiatedCheckout = function (options) {\n var missingRequiredParam;\n var self = this;\n\n if (this._vaultInitiatedCheckoutInProgress) {\n analytics.sendEvent(this._clientPromise, 'paypal-checkout.startVaultInitiatedCheckout.error.already-in-progress');\n return Promise.reject(new BraintreeError(errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS));\n }\n\n REQUIRED_PARAMS_FOR_START_VAULT_INITIATED_CHECKOUT.forEach(function (param) {\n if (!options.hasOwnProperty(param)) {\n missingRequiredParam = param;\n }\n });\n\n if (missingRequiredParam) {\n return Promise.reject(new BraintreeError({\n type: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED.type,\n code: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED.code,\n message: 'Required param ' + missingRequiredParam + ' is missing.'\n }));\n }\n\n this._vaultInitiatedCheckoutInProgress = true;\n\n this._addModalBackdrop(options);\n\n options = assign({}, options, {\n flow: 'checkout'\n });\n analytics.sendEvent(this._clientPromise, 'paypal-checkout.startVaultInitiatedCheckout.started');\n return this._waitForVaultInitiatedCheckoutDependencies().then(function () {\n var frameCommunicationPromise = new ExtendedPromise();\n\n var startVaultInitiatedCheckoutPromise = self._createPaymentResource(options, {\n returnUrl: self._constructVaultCheckutUrl('redirect-frame'),\n cancelUrl: self._constructVaultCheckutUrl('cancel-frame')\n }).then(function (response) {\n var redirectUrl = response.paymentResource.redirectUrl;\n\n self._frameService.redirect(redirectUrl);\n\n return frameCommunicationPromise;\n });\n\n self._frameService.open({}, self._createFrameServiceCallback(frameCommunicationPromise));\n\n return startVaultInitiatedCheckoutPromise;\n }).catch(function (err) {\n self._vaultInitiatedCheckoutInProgress = false;\n\n self._removeModalBackdrop();\n\n if (err.code === 'FRAME_SERVICE_FRAME_CLOSED') {\n analytics.sendEvent(self._clientPromise, 'paypal-checkout.startVaultInitiatedCheckout.canceled.by-customer');\n return Promise.reject(new BraintreeError(errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED));\n }\n\n if (self._frameService) {\n self._frameService.close();\n }\n\n if (err.code && err.code.indexOf('FRAME_SERVICE_FRAME_OPEN_FAILED') > -1) {\n analytics.sendEvent(self._clientPromise, 'paypal-checkout.startVaultInitiatedCheckout.failed.popup-not-opened');\n return Promise.reject(new BraintreeError({\n code: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.code,\n type: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.type,\n message: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.message,\n details: {\n originalError: err\n }\n }));\n }\n\n return Promise.reject(err);\n }).then(function (response) {\n self._frameService.close();\n\n self._vaultInitiatedCheckoutInProgress = false;\n\n self._removeModalBackdrop();\n\n analytics.sendEvent(self._clientPromise, 'paypal-checkout.startVaultInitiatedCheckout.succeeded');\n return Promise.resolve(response);\n });\n };\n\n PayPalCheckout.prototype._addModalBackdrop = function (options) {\n if (options.optOutOfModalBackdrop) {\n return;\n }\n\n if (!this._modalBackdrop) {\n this._modalBackdrop = document.createElement('div');\n\n this._modalBackdrop.setAttribute('data-braintree-paypal-vault-initiated-checkout-modal', true);\n\n this._modalBackdrop.style.position = 'fixed';\n this._modalBackdrop.style.top = 0;\n this._modalBackdrop.style.bottom = 0;\n this._modalBackdrop.style.left = 0;\n this._modalBackdrop.style.right = 0;\n this._modalBackdrop.style.zIndex = 9999;\n this._modalBackdrop.style.background = 'black';\n this._modalBackdrop.style.opacity = '0.7';\n\n this._modalBackdrop.addEventListener('click', function () {\n this.focusVaultInitiatedCheckoutWindow();\n }.bind(this));\n }\n\n document.body.appendChild(this._modalBackdrop);\n };\n\n PayPalCheckout.prototype._removeModalBackdrop = function () {\n if (!(this._modalBackdrop && this._modalBackdrop.parentNode)) {\n return;\n }\n\n this._modalBackdrop.parentNode.removeChild(this._modalBackdrop);\n };\n /**\n * Closes the PayPal window if it is opened via `startVaultInitiatedCheckout`.\n * @public\n * @ignore\n * @param {callback} [callback] Gets called when window is closed.\n * @example\n * paypalCheckoutInstance.closeVaultInitiatedCheckoutWindow();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PayPalCheckout.prototype.closeVaultInitiatedCheckoutWindow = function () {\n if (this._vaultInitiatedCheckoutInProgress) {\n analytics.sendEvent(this._clientPromise, 'paypal-checkout.startVaultInitiatedCheckout.canceled.by-merchant');\n }\n\n return this._waitForVaultInitiatedCheckoutDependencies().then(function () {\n this._frameService.close();\n }.bind(this));\n };\n /**\n * Focuses the PayPal window if it is opened via `startVaultInitiatedCheckout`.\n * @public\n * @ignore\n * @param {callback} [callback] Gets called when window is focused.\n * @example\n * paypalCheckoutInstance.focusVaultInitiatedCheckoutWindow();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PayPalCheckout.prototype.focusVaultInitiatedCheckoutWindow = function () {\n return this._waitForVaultInitiatedCheckoutDependencies().then(function () {\n this._frameService.focus();\n }.bind(this));\n };\n\n PayPalCheckout.prototype._createFrameServiceCallback = function (frameCommunicationPromise) {\n var self = this; // TODO when a merchant integrates an iOS or Android integration\n // with a webview using the web SDK, we will have to add popupbridge\n // support\n\n return function (err, payload) {\n if (err) {\n frameCommunicationPromise.reject(err);\n } else if (payload) {\n self._frameService.redirect(self._loadingFrameUrl);\n\n self.tokenizePayment({\n paymentToken: payload.token,\n payerID: payload.PayerID,\n paymentID: payload.paymentId\n }).then(function (res) {\n frameCommunicationPromise.resolve(res);\n }).catch(function (tokenizationError) {\n frameCommunicationPromise.reject(tokenizationError);\n });\n }\n };\n };\n\n PayPalCheckout.prototype._waitForVaultInitiatedCheckoutDependencies = function () {\n var self = this;\n return this._clientPromise.then(function () {\n return self._frameServicePromise;\n });\n };\n\n PayPalCheckout.prototype._constructVaultCheckutUrl = function (frameName) {\n var serviceId = this._frameService._serviceId;\n return this._assetsUrl + '/html/' + frameName + useMin(this._isDebug) + '.html?channel=' + serviceId;\n };\n /**\n * Tokenizes the authorize data from the PayPal JS SDK when completing a buyer approval flow.\n * When a {@link callback} is defined, invokes the callback with {@link PayPalCheckout~tokenizePayload|tokenizePayload} and returns undefined. Otherwise, returns a Promise that resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @public\n * @param {object} tokenizeOptions Tokens and IDs required to tokenize the payment.\n * @param {string} tokenizeOptions.payerId Payer ID returned by PayPal `onApproved` callback.\n * @param {string} [tokenizeOptions.paymentId] Payment ID returned by PayPal `onApproved` callback.\n * @param {string} [tokenizeOptions.billingToken] Billing Token returned by PayPal `onApproved` callback.\n * @param {boolean} [tokenizeOptions.vault=true] Whether or not to vault the resulting PayPal account (if using a client token generated with a customer id and the vault flow).\n * @param {callback} [callback] The second argument,
payload
, is a {@link PayPalCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, the promise resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @example
Opt out of auto-vaulting behavior\n * // create the paypalCheckoutInstance with a client token generated with a customer id\n * paypal.Buttons({\n * createBillingAgreement: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'vault'\n * // your other createPayment options here\n * });\n * },\n * onApproved: function (data) {\n * data.vault = false;\n *\n * return paypalCheckoutInstance.tokenizePayment(data);\n * },\n * // Add other options, e.g. onCancel, onError\n * }).render('#paypal-button');\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PayPalCheckout.prototype.tokenizePayment = function (tokenizeOptions) {\n var self = this;\n var shouldVault = true;\n var payload;\n var options = {\n flow: tokenizeOptions.billingToken && !tokenizeOptions.paymentID ? 'vault' : 'checkout',\n intent: tokenizeOptions.intent || this.intentFromCreatePayment\n };\n var params = {\n // The paymentToken provided by the PayPal JS SDK is the EC Token\n ecToken: tokenizeOptions.paymentToken,\n billingToken: tokenizeOptions.billingToken,\n payerId: tokenizeOptions.payerID,\n paymentId: tokenizeOptions.paymentID,\n shippingOptionsId: tokenizeOptions.shippingOptionsId\n };\n\n if (tokenizeOptions.hasOwnProperty('vault')) {\n shouldVault = tokenizeOptions.vault;\n }\n\n options.vault = shouldVault;\n analytics.sendEvent(this._clientPromise, 'paypal-checkout.tokenization.started');\n return this._clientPromise.then(function (client) {\n return client.request({\n endpoint: 'payment_methods/paypal_accounts',\n method: 'post',\n data: self._formatTokenizeData(options, params)\n });\n }).then(function (response) {\n payload = self._formatTokenizePayload(response);\n analytics.sendEvent(self._clientPromise, 'paypal-checkout.tokenization.success');\n\n if (payload.creditFinancingOffered) {\n analytics.sendEvent(self._clientPromise, 'paypal-checkout.credit.accepted');\n }\n\n return payload;\n }).catch(function (err) {\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n\n analytics.sendEvent(self._clientPromise, 'paypal-checkout.tokenization.failed');\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,\n code: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,\n message: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message\n }));\n });\n };\n /**\n * Resolves with the PayPal client id to be used when loading the PayPal SDK.\n * @public\n * @param {callback} [callback] The second argument,
id
, is a the PayPal client id. If no callback is provided, the promise resolves with the PayPal client id.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * paypalCheckoutInstance.getClientId().then(function (id) {\n * var script = document.createElement('script');\n *\n * script.src = 'https://www.paypal.com/sdk/js?client-id=' + id;\n * script.onload = function () {\n * // setup the PayPal SDK\n * };\n *\n * document.body.appendChild(script);\n * });\n */\n\n\n PayPalCheckout.prototype.getClientId = function () {\n return this._clientPromise.then(function (client) {\n return client.getConfiguration().gatewayConfiguration.paypal.clientId;\n });\n };\n /**\n * Resolves when the PayPal SDK has been successfully loaded onto the page.\n * @public\n * @param {object} [options] A configuration object to modify the query params and data-attributes on the PayPal SDK. A subset of the parameters are listed below. For a full list of query params, see the [PayPal docs](https://developer.paypal.com/docs/checkout/reference/customize-sdk/?mark=query#query-parameters).\n * @param {string} [options.client-id] By default, this will be the client id associated with the authorization used to create the Braintree component. When used in conjunction with passing `authorization` when creating the PayPal Checkout component, you can speed up the loading of the PayPal SDK.\n * @param {string} [options.intent=\"authorize\"] By default, the PayPal SDK defaults to an intent of `capture`. Since the default intent when calling {@link PayPalCheckout#createPayment|`createPayment`} is `authorize`, the PayPal SDK will be loaded with `intent=authorize`. If you wish to use a different intent when calling {@link PayPalCheckout#createPayment|`createPayment`}, make sure it matches here. If `sale` is used, it will be converted to `capture` for the PayPal SDK. If the `vault: true` param is used, `tokenize` will be passed as the default intent.\n * @param {string} [options.currency=\"USD\"] If a currency is passed in {@link PayPalCheckout#createPayment|`createPayment`}, it must match the currency passed here.\n * @param {boolean} [options.vault] Must be `true` when using `flow: vault` in {@link PayPalCheckout#createPayment|`createPayment`}.\n * @param {string} [options.components=buttons] By default, the Braintree SDK will only load the PayPal smart buttons component. If you would like to load just the [messages component](https://developer.paypal.com/docs/business/checkout/add-capabilities/credit-messaging/), pass `messages`. If you would like to load both, pass `buttons,messages`\n * @param {object} [options.dataAttributes] The data attributes to apply to the script. Any data attribute can be passed. A subset of the parameters are listed below. For a full list of data attributes, see the [PayPal docs](https://developer.paypal.com/docs/checkout/reference/customize-sdk/#script-parameters).\n * @param {string} [options.dataAttributes.data-client-token] The client token to use in the script. (usually not needed)\n * @param {string} [options.dataAttributes.csp-nonce] See the [PayPal docs about content security nonces](https://developer.paypal.com/docs/checkout/reference/customize-sdk/#csp-nonce).\n * @param {callback} [callback] Called when the PayPal SDK has been loaded onto the page. The second argument is the PayPal Checkout instance. If no callback is provided, the promise resolves with the PayPal Checkout instance when the PayPal SDK has been loaded onto the page.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example
Without options\n * paypalCheckoutInstance.loadPayPalSDK().then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n * @example
With options\n * paypalCheckoutInstance.loadPayPalSDK({\n * 'client-id': 'PayPal Client Id', // Can speed up rendering time to hardcode this value\n *\n * intent: 'capture', // Make sure this value matches the value in createPayment\n * currency: 'USD', // Make sure this value matches the value in createPayment\n * }).then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n * @example
With Vaulting\n * paypalCheckoutInstance.loadPayPalSDK({\n * vault: true\n * }).then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n */\n\n\n PayPalCheckout.prototype.loadPayPalSDK = function (options) {\n var idPromise, src, userIdToken;\n var loadPromise = new ExtendedPromise();\n var dataAttributes = options && options.dataAttributes;\n\n if (dataAttributes && dataAttributes['user-id-token']) {\n userIdToken = dataAttributes['user-id-token'];\n } else {\n userIdToken = this._authorizationInformation.fingerprint && this._authorizationInformation.fingerprint.split('?')[0];\n }\n\n this._paypalScript = document.createElement('script'); // NEXT_MAJOR_VERSION\n // this options object should have 2 properties:\n // * queryParams\n // * dataAttributes\n // should make organizing this better than squashing\n // all the query params at the top level and extracting\n // the data attributes\n\n options = assign({}, {\n components: 'buttons'\n }, options);\n delete options.dataAttributes; // NEXT_MAJOR_VERSION if merchant passes an explicit intent,\n // currency, amount, etc, save those for use in createPayment\n // if no explicit param of that type is passed in when calling\n // createPayment to reduce the number of items that need to be\n // duplicated here and in createPayment\n\n if (options.vault) {\n options.intent = options.intent || 'tokenize';\n } else {\n options.intent = options.intent || 'authorize';\n options.currency = options.currency || 'USD';\n }\n\n src = 'https://www.paypal.com/sdk/js?';\n\n this._paypalScript.onload = function () {\n loadPromise.resolve();\n };\n\n if (dataAttributes) {\n Object.keys(dataAttributes).forEach(function (attribute) {\n this._paypalScript.setAttribute('data-' + attribute, dataAttributes[attribute]);\n }.bind(this));\n }\n\n if (options['client-id']) {\n idPromise = Promise.resolve(options['client-id']);\n } else {\n idPromise = this.getClientId();\n }\n\n idPromise.then(function (id) {\n options['client-id'] = id;\n\n if (this._autoSetDataUserIdToken && userIdToken) {\n this._paypalScript.setAttribute('data-user-id-token', userIdToken); // preloading improves the rendering time of the PayPal button\n\n\n this._attachPreloadPixel({\n id: id,\n userIdToken: userIdToken,\n amount: dataAttributes && dataAttributes.amount,\n currency: options.currency,\n merchantId: options['merchant-id']\n });\n }\n\n this._paypalScript.src = querystring.queryify(src, options);\n document.head.insertBefore(this._paypalScript, document.head.firstElementChild);\n }.bind(this));\n return loadPromise.then(function () {\n return this;\n }.bind(this));\n };\n\n PayPalCheckout.prototype._attachPreloadPixel = function (options) {\n var request;\n var id = options.id;\n var userIdToken = options.userIdToken;\n var env = this._authorizationInformation.environment;\n var subdomain = env === 'production' ? '' : 'sandbox.';\n var url = PAYPAL_SDK_PRELOAD_URL.replace('{ENV}', subdomain);\n var preloadOptions = {\n 'client-id': id,\n 'user-id-token': userIdToken\n };\n\n if (options.amount) {\n preloadOptions.amount = options.amount;\n }\n\n if (options.currency) {\n preloadOptions.currency = options.currency;\n }\n\n if (options.merchantId) {\n preloadOptions['merchant-id'] = options.merchantId;\n }\n\n request = new XMLHttpRequest();\n request.open('GET', querystring.queryify(url, preloadOptions));\n request.send();\n };\n\n PayPalCheckout.prototype._formatPaymentResourceData = function (options, config) {\n var key;\n var gatewayConfiguration = this._configuration.gatewayConfiguration; // NEXT_MAJOR_VERSION default value for intent in PayPal SDK is capture\n // but our integrations default value is authorize. Default this to capture\n // in the next major version.\n\n var intent = options.intent;\n var paymentResource = {\n // returnUrl and cancelUrl are required in hermes create_payment_resource route\n // but are not used by the PayPal sdk, except to redirect to an error page\n returnUrl: config.returnUrl || 'https://www.paypal.com/checkoutnow/error',\n cancelUrl: config.cancelUrl || 'https://www.paypal.com/checkoutnow/error',\n offerPaypalCredit: options.offerCredit === true,\n merchantAccountId: this._merchantAccountId,\n experienceProfile: {\n brandName: options.displayName || gatewayConfiguration.paypal.displayName,\n localeCode: options.locale,\n noShipping: (!options.enableShippingAddress).toString(),\n addressOverride: options.shippingAddressEditable === false,\n landingPageType: options.landingPageType\n },\n shippingOptions: options.shippingOptions\n };\n\n if (options.flow === 'checkout') {\n paymentResource.amount = options.amount;\n paymentResource.currencyIsoCode = options.currency;\n paymentResource.requestBillingAgreement = options.requestBillingAgreement;\n\n if (intent) {\n // 'sale' has been changed to 'capture' in PayPal's backend, but\n // we use an old version with 'sale'. We provide capture as an alias\n // to match the PayPal SDK\n if (intent === 'capture') {\n intent = 'sale';\n }\n\n paymentResource.intent = intent;\n }\n\n if (options.hasOwnProperty('lineItems')) {\n paymentResource.lineItems = options.lineItems;\n }\n\n if (options.hasOwnProperty('vaultInitiatedCheckoutPaymentMethodToken')) {\n paymentResource.vaultInitiatedCheckoutPaymentMethodToken = options.vaultInitiatedCheckoutPaymentMethodToken;\n }\n\n if (options.hasOwnProperty('shippingOptions')) {\n paymentResource.shippingOptions = options.shippingOptions;\n }\n\n for (key in options.shippingAddressOverride) {\n if (options.shippingAddressOverride.hasOwnProperty(key)) {\n paymentResource[key] = options.shippingAddressOverride[key];\n }\n }\n\n if (options.hasOwnProperty('billingAgreementDetails')) {\n paymentResource.billingAgreementDetails = options.billingAgreementDetails;\n }\n } else {\n paymentResource.shippingAddress = options.shippingAddressOverride;\n\n if (options.billingAgreementDescription) {\n paymentResource.description = options.billingAgreementDescription;\n }\n }\n\n return paymentResource;\n };\n\n PayPalCheckout.prototype._formatTokenizeData = function (options, params) {\n var clientConfiguration = this._configuration;\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var isTokenizationKey = clientConfiguration.authorizationType === 'TOKENIZATION_KEY';\n var isVaultFlow = options.flow === 'vault';\n var data = {\n paypalAccount: {\n correlationId: params.billingToken || params.ecToken,\n options: {\n validate: isVaultFlow && !isTokenizationKey && options.vault\n }\n }\n };\n\n if (isVaultFlow) {\n data.paypalAccount.billingAgreementToken = params.billingToken;\n } else {\n data.paypalAccount.paymentToken = params.paymentId;\n data.paypalAccount.payerId = params.payerId;\n data.paypalAccount.unilateral = gatewayConfiguration.paypal.unvettedMerchant;\n\n if (options.intent) {\n data.paypalAccount.intent = options.intent;\n }\n }\n\n if (this._merchantAccountId) {\n data.merchantAccountId = this._merchantAccountId;\n }\n\n return data;\n };\n\n PayPalCheckout.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type\n };\n\n if (account.details && account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n\n if (account.details && account.details.creditFinancingOffered) {\n payload.creditFinancingOffered = account.details.creditFinancingOffered;\n }\n\n if (account.details && account.details.shippingOptionId) {\n payload.shippingOptionId = account.details.shippingOptionId;\n }\n\n if (account.details && account.details.cobrandedCardLabel) {\n payload.cobrandedCardLabel = account.details.cobrandedCardLabel;\n }\n\n return payload;\n };\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/paypal-checkout.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * paypalCheckoutInstance.teardown();\n * @example
With callback\n * paypalCheckoutInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PayPalCheckout.prototype.teardown = function () {\n var self = this;\n convertMethodsToError(this, methods(PayPalCheckout.prototype));\n\n if (this._paypalScript && this._paypalScript.parentNode) {\n this._paypalScript.parentNode.removeChild(this._paypalScript);\n }\n\n return this._frameServicePromise.catch(function () {// no need to error in teardown for an error setting up the frame service\n }).then(function () {\n if (!self._frameService) {\n return Promise.resolve();\n }\n\n return self._frameService.teardown();\n });\n };\n\n module.exports = wrapPromise.wrapPrototype(PayPalCheckout);\n }, {\n \"../lib/analytics\": 121,\n \"../lib/assign\": 123,\n \"../lib/braintree-error\": 126,\n \"../lib/constants\": 128,\n \"../lib/convert-methods-to-error\": 129,\n \"../lib/convert-to-braintree-error\": 130,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-authorization-data\": 132,\n \"../lib/create-deferred-client\": 133,\n \"../lib/frame-service/external\": 141,\n \"../lib/methods\": 157,\n \"../lib/promise\": 159,\n \"../lib/querystring\": 160,\n \"../lib/use-min\": 162,\n \"../paypal/shared/constants\": 182,\n \"./errors\": 177,\n \"@braintree/extended-promise\": 35,\n \"@braintree/wrap-promise\": 44\n }],\n 180: [function (_dereq_, module, exports) {\n 'use strict';\n\n var frameService = _dereq_('../../lib/frame-service/external');\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n var convertToBraintreeError = _dereq_('../../lib/convert-to-braintree-error');\n\n var useMin = _dereq_('../../lib/use-min');\n\n var once = _dereq_('../../lib/once');\n\n var VERSION = \"3.76.1\";\n\n var constants = _dereq_('../shared/constants');\n\n var INTEGRATION_TIMEOUT_MS = _dereq_('../../lib/constants').INTEGRATION_TIMEOUT_MS;\n\n var analytics = _dereq_('../../lib/analytics');\n\n var methods = _dereq_('../../lib/methods');\n\n var deferred = _dereq_('../../lib/deferred');\n\n var errors = _dereq_('../shared/errors');\n\n var convertMethodsToError = _dereq_('../../lib/convert-methods-to-error');\n\n var querystring = _dereq_('../../lib/querystring');\n\n var Promise = _dereq_('../../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n /**\n * @typedef {object} PayPal~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `PayPalAccount`.\n * @property {object} details Additional PayPal account details.\n * @property {string} details.email User's email address.\n * @property {string} details.payerId User's payer ID, the unique identifier for each PayPal account.\n * @property {string} details.firstName User's given name.\n * @property {string} details.lastName User's surname.\n * @property {?string} details.countryCode User's 2 character country code.\n * @property {?string} details.phone User's phone number (e.g. 555-867-5309).\n * @property {?object} details.shippingAddress User's shipping address details, only available if shipping address is enabled.\n * @property {string} details.shippingAddress.recipientName Recipient of postage.\n * @property {string} details.shippingAddress.line1 Street number and name.\n * @property {string} details.shippingAddress.line2 Extended address.\n * @property {string} details.shippingAddress.city City or locality.\n * @property {string} details.shippingAddress.state State or region.\n * @property {string} details.shippingAddress.postalCode Postal code.\n * @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} details.billingAddress User's billing address details.\n * Not available to all merchants; [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support) for details on eligibility and enabling this feature.\n * Alternatively, see `shippingAddress` above as an available client option.\n * @property {string} details.billingAddress.line1 Street number and name.\n * @property {string} details.billingAddress.line2 Extended address.\n * @property {string} details.billingAddress.city City or locality.\n * @property {string} details.billingAddress.state State or region.\n * @property {string} details.billingAddress.postalCode Postal code.\n * @property {string} details.billingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} creditFinancingOffered This property will only be present when the customer pays with PayPal Credit.\n * @property {object} creditFinancingOffered.totalCost This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalCost.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalCost.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {number} creditFinancingOffered.term Length of financing terms in months.\n * @property {object} creditFinancingOffered.monthlyPayment This is the estimated amount per month that the customer will need to pay including fees and interest.\n * @property {string} creditFinancingOffered.monthlyPayment.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.monthlyPayment.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {object} creditFinancingOffered.totalInterest Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalInterest.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalInterest.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {boolean} creditFinancingOffered.payerAcceptance Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.\n * @property {boolean} creditFinancingOffered.cartAmountImmutable Indicates whether the cart amount is editable after payer's acceptance on PayPal side.\n *\n */\n\n /**\n * @typedef {object} PayPal~tokenizeReturn\n * @property {Function} close A handle to close the PayPal checkout flow.\n * @property {Function} focus A handle to focus the PayPal checkout flow. Note that some browsers (notably iOS Safari) do not support focusing popups. Firefox requires the focus call to occur as the result of a user interaction, such as a button click.\n */\n\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/paypal.create|paypal.create}\n * @classdesc This class represents a PayPal component. Instances of this class can open a PayPal window for authenticating a PayPal account. Any additional UI, such as disabling the page while authentication is taking place, is up to the developer.\n *\n * This component has been deprecated in favor of the {@link PayPalCheckout|PayPal Checkout component}, which provides a fully managed UI. New features will not be added to this component.\n * @description
Do not use this constructor directly. Use {@link module:braintree-web/paypal.create|braintree-web.paypal.create} instead.\n */\n\n\n function PayPal(options) {\n this._client = options.client;\n this._assetsUrl = options.client.getConfiguration().gatewayConfiguration.paypal.assetsUrl + '/web/' + VERSION;\n this._isDebug = options.client.getConfiguration().isDebug;\n this._loadingFrameUrl = this._assetsUrl + '/html/paypal-landing-frame' + useMin(this._isDebug) + '.html';\n this._authorizationInProgress = false;\n }\n\n PayPal.prototype._initialize = function () {\n var self = this;\n var client = this._client;\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(client, 'paypal.load.timed-out');\n }, INTEGRATION_TIMEOUT_MS);\n return new Promise(function (resolve) {\n frameService.create({\n name: constants.LANDING_FRAME_NAME,\n dispatchFrameUrl: self._assetsUrl + '/html/dispatch-frame' + useMin(self._isDebug) + '.html',\n openFrameUrl: self._loadingFrameUrl\n }, function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(client, 'paypal.load.succeeded');\n resolve(self);\n });\n });\n };\n /**\n * Launches the PayPal login flow and returns a nonce payload. Only one PayPal login flow should be active at a time. One way to achieve this is to disable your PayPal button while the flow is open.\n * @public\n * @param {object} options All tokenization options for the PayPal component.\n * @param {string} options.flow Set to 'checkout' for one-time payment flow, or 'vault' for Vault flow. If 'vault' is used with a client token generated with a customer id, the PayPal account will be added to that customer as a saved payment method.\n * @param {string} [options.intent=authorize]\n * * `authorize` - Submits the transaction for authorization but not settlement.\n * * `order` - Validates the transaction without an authorization (i.e. without holding funds). Useful for authorizing and capturing funds up to 90 days after the order has been placed. Only available for Checkout flow.\n * * `sale` - Payment will be immediately submitted for settlement upon creating a transaction.\n * @param {boolean} [options.offerCredit=false] Offers PayPal Credit as the default funding instrument for the transaction. If the customer isn't pre-approved for PayPal Credit, they will be prompted to apply for it.\n * @param {boolean} [options.offerPayLater=false] Offers PayPal Pay Later if the customer qualifies. Defaults to false. Only available with `flow: 'checkout'`.\n * @param {string} [options.useraction]\n * Changes the call-to-action in the PayPal flow. By default the final button will show the localized\n * word for \"Continue\" and implies that the final amount billed is not yet known.\n *\n * Setting this option to `commit` changes the button text to \"Pay Now\" and page text will convey to\n * the user that billing will take place immediately.\n * @param {(string|number)} [options.amount] The amount of the transaction. Required when using the Checkout flow.\n * @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow.\n * @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account\n * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow. This locale will be used unless the buyer has set a preferred locale for their account. If an unsupported locale is supplied, a fallback locale (determined by buyer preference or browser data) will be used and no error will be thrown.\n *\n * Supported locales are:\n * `da_DK`,\n * `de_DE`,\n * `en_AU`,\n * `en_GB`,\n * `en_US`,\n * `es_ES`,\n * `fr_CA`,\n * `fr_FR`,\n * `id_ID`,\n * `it_IT`,\n * `ja_JP`,\n * `ko_KR`,\n * `nl_NL`,\n * `no_NO`,\n * `pl_PL`,\n * `pt_BR`,\n * `pt_PT`,\n * `ru_RU`,\n * `sv_SE`,\n * `th_TH`,\n * `zh_CN`,\n * `zh_HK`,\n * and `zh_TW`.\n *\n * @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}.\n * @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow.\n * @param {string} options.shippingAddressOverride.line1 Street address.\n * @param {string} [options.shippingAddressOverride.line2] Street address (extended).\n * @param {string} options.shippingAddressOverride.city City.\n * @param {string} options.shippingAddressOverride.state State.\n * @param {string} options.shippingAddressOverride.postalCode Postal code.\n * @param {string} options.shippingAddressOverride.countryCode Country.\n * @param {string} [options.shippingAddressOverride.phone] Phone number.\n * @param {string} [options.shippingAddressOverride.recipientName] Recipient's name.\n * @param {boolean} [options.shippingAddressEditable=true] Set to false to disable user editing of the shipping address.\n * @param {string} [options.billingAgreementDescription] Use this option to set the description of the preapproved payment agreement visible to customers in their PayPal profile during Vault flows. Max 255 characters.\n * @param {string} [options.landingPageType] Use this option to specify the PayPal page to display when a user lands on the PayPal site to complete the payment.\n * * `login` - A PayPal account login page is used.\n * * `billing` - A non-PayPal account landing page is used.\n * @param {callback} callback The second argument,
data
, is a {@link PayPal~tokenizePayload|tokenizePayload}.\n * @example\n *
Tokenizing with the vault flow\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // if there is any other part of the page that must be disabled\n * // while authentication is in progress, do so now\n *\n * // Because PayPal tokenization opens a popup, this must be called\n * // as a result of a user action, such as a button click.\n * paypalInstance.tokenize({\n * flow: 'vault' // Required\n * // Any other tokenization options\n * }, function (tokenizeErr, payload) {\n * button.removeAttribute('disabled');\n *\n * // if any other part of the page was disabled, re-enable now\n *\n * if (tokenizeErr) {\n * // Handle tokenization errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'PAYPAL_POPUP_CLOSED':\n * console.error('Customer closed PayPal popup.');\n * break;\n * case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('PayPal tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'PAYPAL_FLOW_FAILED':\n * console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * } else {\n * // Submit payload.nonce to your server\n * }\n * });\n * });\n \n * @example\n *
Tokenizing with the checkout flow\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because PayPal tokenization opens a popup, this must be called\n * // as a result of a user action, such as a button click.\n * paypalInstance.tokenize({\n * flow: 'checkout', // Required\n * amount: '10.00', // Required\n * currency: 'USD' // Required\n * // Any other tokenization options\n * }, function (tokenizeErr, payload) {\n * button.removeAttribute('disabled');\n *\n * if (tokenizeErr) {\n * // Handle tokenization errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'PAYPAL_POPUP_CLOSED':\n * console.error('Customer closed PayPal popup.');\n * break;\n * case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('PayPal tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'PAYPAL_FLOW_FAILED':\n * console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * } else {\n * // Submit payload.nonce to your server\n * }\n * });\n * });\n * @returns {Promise|PayPal~tokenizeReturn} A handle to manage the PayPal checkout frame. If no callback is provided, returns a promise.\n */\n\n\n PayPal.prototype.tokenize = function (options, callback) {\n var self = this;\n var client = this._client;\n var tokenizePromise, optionError;\n\n if (callback) {\n callback = once(deferred(callback));\n }\n\n if (!options || !constants.FLOW_ENDPOINTS.hasOwnProperty(options.flow)) {\n optionError = new BraintreeError(errors.PAYPAL_FLOW_OPTION_REQUIRED);\n\n if (callback) {\n callback(optionError);\n return this._frameService.createNoopHandler();\n }\n\n return Promise.reject(optionError);\n }\n\n tokenizePromise = new Promise(function (resolve, reject) {\n if (self._authorizationInProgress) {\n analytics.sendEvent(client, 'paypal.tokenization.error.already-opened');\n reject(new BraintreeError(errors.PAYPAL_TOKENIZATION_REQUEST_ACTIVE));\n } else {\n self._authorizationInProgress = true;\n\n if (!window.popupBridge) {\n analytics.sendEvent(client, 'paypal.tokenization.opened');\n }\n\n if (options.offerCredit === true) {\n analytics.sendEvent(client, 'paypal.credit.offered');\n }\n\n if (options.offerPayLater === true) {\n analytics.sendEvent(client, 'paypal.paylater.offered');\n }\n\n self._navigateFrameToAuth(options).catch(reject); // self MUST happen after _navigateFrameToAuth for Metro browsers to work.\n\n\n self._frameService.open({}, self._createFrameServiceCallback(options, resolve, reject));\n }\n });\n\n if (callback) {\n tokenizePromise.then(function (res) {\n callback(null, res);\n }).catch(callback);\n return this._frameService.createHandler({\n beforeClose: function beforeClose() {\n analytics.sendEvent(client, 'paypal.tokenization.closed.by-merchant');\n }\n });\n }\n\n return tokenizePromise;\n };\n\n PayPal.prototype._createFrameServiceCallback = function (options, resolve, reject) {\n var self = this;\n var client = this._client;\n\n if (window.popupBridge) {\n return function (err, payload) {\n var canceled = payload && payload.path && payload.path.substring(0, 7) === '/cancel';\n self._authorizationInProgress = false; // `err` exists when the user clicks \"Done\" button of browser view\n\n if (err || canceled) {\n analytics.sendEvent(client, 'paypal.tokenization.closed-popupbridge.by-user'); // Call merchant's tokenize callback with an error\n\n reject(new BraintreeError(errors.PAYPAL_POPUP_CLOSED));\n } else if (payload) {\n self._tokenizePayPal(options, payload.queryItems).then(resolve).catch(reject);\n }\n };\n }\n\n return function (err, params) {\n self._authorizationInProgress = false;\n\n if (err) {\n if (err.code === 'FRAME_SERVICE_FRAME_CLOSED') {\n analytics.sendEvent(client, 'paypal.tokenization.closed.by-user');\n reject(new BraintreeError(errors.PAYPAL_POPUP_CLOSED));\n } else if (err.code && err.code.indexOf('FRAME_SERVICE_FRAME_OPEN_FAILED') > -1) {\n reject(new BraintreeError({\n code: errors.PAYPAL_POPUP_OPEN_FAILED.code,\n type: errors.PAYPAL_POPUP_OPEN_FAILED.type,\n message: errors.PAYPAL_POPUP_OPEN_FAILED.message,\n details: {\n originalError: err\n }\n }));\n }\n } else if (params) {\n self._tokenizePayPal(options, params).then(resolve).catch(reject);\n }\n };\n };\n\n PayPal.prototype._tokenizePayPal = function (options, params) {\n var self = this;\n var client = this._client;\n\n if (!window.popupBridge) {\n this._frameService.redirect(this._loadingFrameUrl);\n }\n\n return client.request({\n endpoint: 'payment_methods/paypal_accounts',\n method: 'post',\n data: this._formatTokenizeData(options, params)\n }).then(function (response) {\n var payload = self._formatTokenizePayload(response);\n\n if (window.popupBridge) {\n analytics.sendEvent(client, 'paypal.tokenization.success-popupbridge');\n } else {\n analytics.sendEvent(client, 'paypal.tokenization.success');\n }\n\n if (payload.creditFinancingOffered) {\n analytics.sendEvent(client, 'paypal.credit.accepted');\n }\n\n self._frameService.close();\n\n return payload;\n }).catch(function (err) {\n if (window.popupBridge) {\n analytics.sendEvent(client, 'paypal.tokenization.failed-popupbridge');\n } else {\n analytics.sendEvent(client, 'paypal.tokenization.failed');\n }\n\n self._frameService.close();\n\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,\n code: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,\n message: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message\n }));\n });\n };\n\n PayPal.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type\n };\n\n if (account.details && account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n\n if (account.details && account.details.creditFinancingOffered) {\n payload.creditFinancingOffered = account.details.creditFinancingOffered;\n }\n\n return payload;\n };\n\n PayPal.prototype._formatTokenizeData = function (options, params) {\n var clientConfiguration = this._client.getConfiguration();\n\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var isTokenizationKey = clientConfiguration.authorizationType === 'TOKENIZATION_KEY';\n var data = {\n paypalAccount: {\n correlationId: params.ba_token || params.token,\n options: {\n validate: options.flow === 'vault' && !isTokenizationKey\n }\n }\n };\n\n if (params.ba_token) {\n data.paypalAccount.billingAgreementToken = params.ba_token;\n } else {\n data.paypalAccount.paymentToken = params.paymentId;\n data.paypalAccount.payerId = params.PayerID;\n data.paypalAccount.unilateral = gatewayConfiguration.paypal.unvettedMerchant;\n\n if (options.hasOwnProperty('intent')) {\n data.paypalAccount.intent = options.intent;\n }\n }\n\n return data;\n };\n\n PayPal.prototype._navigateFrameToAuth = function (options) {\n var self = this;\n var client = this._client;\n var endpoint = 'paypal_hermes/' + constants.FLOW_ENDPOINTS[options.flow];\n return client.request({\n endpoint: endpoint,\n method: 'post',\n data: this._formatPaymentResourceData(options)\n }).then(function (response) {\n var redirectUrl;\n\n if (options.flow === 'checkout') {\n redirectUrl = response.paymentResource.redirectUrl;\n } else {\n redirectUrl = response.agreementSetup.approvalUrl;\n }\n\n if (options.useraction === 'commit') {\n redirectUrl = querystring.queryify(redirectUrl, {\n useraction: 'commit'\n });\n }\n\n if (window.popupBridge) {\n analytics.sendEvent(client, 'paypal.tokenization.opened-popupbridge');\n }\n\n self._frameService.redirect(redirectUrl);\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n\n self._frameService.close();\n\n self._authorizationInProgress = false;\n\n if (status === 422) {\n return Promise.reject(new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err\n }\n }));\n }\n\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_FLOW_FAILED.type,\n code: errors.PAYPAL_FLOW_FAILED.code,\n message: errors.PAYPAL_FLOW_FAILED.message\n }));\n });\n };\n\n PayPal.prototype._formatPaymentResourceData = function (options) {\n var key;\n\n var gatewayConfiguration = this._client.getConfiguration().gatewayConfiguration;\n\n var serviceId = this._frameService._serviceId;\n var paymentResource = {\n returnUrl: gatewayConfiguration.paypal.assetsUrl + '/web/' + VERSION + '/html/redirect-frame' + useMin(this._isDebug) + '.html?channel=' + serviceId,\n cancelUrl: gatewayConfiguration.paypal.assetsUrl + '/web/' + VERSION + '/html/cancel-frame' + useMin(this._isDebug) + '.html?channel=' + serviceId,\n offerPaypalCredit: options.offerCredit === true,\n offerPayLater: options.offerPayLater === true,\n experienceProfile: {\n brandName: options.displayName || gatewayConfiguration.paypal.displayName,\n localeCode: options.locale,\n noShipping: (!options.enableShippingAddress).toString(),\n addressOverride: options.shippingAddressEditable === false,\n landingPageType: options.landingPageType\n }\n };\n\n if (window.popupBridge && typeof window.popupBridge.getReturnUrlPrefix === 'function') {\n paymentResource.returnUrl = window.popupBridge.getReturnUrlPrefix() + 'return';\n paymentResource.cancelUrl = window.popupBridge.getReturnUrlPrefix() + 'cancel';\n }\n\n if (options.flow === 'checkout') {\n paymentResource.amount = options.amount;\n paymentResource.currencyIsoCode = options.currency;\n\n if (options.hasOwnProperty('intent')) {\n paymentResource.intent = options.intent;\n }\n\n for (key in options.shippingAddressOverride) {\n if (options.shippingAddressOverride.hasOwnProperty(key)) {\n paymentResource[key] = options.shippingAddressOverride[key];\n }\n }\n } else {\n paymentResource.shippingAddress = options.shippingAddressOverride;\n\n if (options.billingAgreementDescription) {\n paymentResource.description = options.billingAgreementDescription;\n }\n }\n\n return paymentResource;\n };\n /**\n * Closes the PayPal window if it is open.\n * @public\n * @example\n * paypalInstance.closeWindow();\n * @returns {void}\n */\n\n\n PayPal.prototype.closeWindow = function () {\n if (this._authorizationInProgress) {\n analytics.sendEvent(this._client, 'paypal.tokenize.closed.by-merchant');\n }\n\n this._frameService.close();\n };\n /**\n * Focuses the PayPal window if it is open.\n * @public\n * @example\n * paypalInstance.focusWindow();\n * @returns {void}\n */\n\n\n PayPal.prototype.focusWindow = function () {\n this._frameService.focus();\n };\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/paypal.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * paypalInstance.teardown();\n * @example
With callback\n * paypalInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n PayPal.prototype.teardown = wrapPromise(function () {\n var self = this; // eslint-disable-line no-invalid-this\n\n self._frameService.teardown();\n\n convertMethodsToError(self, methods(PayPal.prototype));\n analytics.sendEvent(self._client, 'paypal.teardown-completed');\n return Promise.resolve();\n });\n module.exports = PayPal;\n }, {\n \"../../lib/analytics\": 121,\n \"../../lib/braintree-error\": 126,\n \"../../lib/constants\": 128,\n \"../../lib/convert-methods-to-error\": 129,\n \"../../lib/convert-to-braintree-error\": 130,\n \"../../lib/deferred\": 134,\n \"../../lib/frame-service/external\": 141,\n \"../../lib/methods\": 157,\n \"../../lib/once\": 158,\n \"../../lib/promise\": 159,\n \"../../lib/querystring\": 160,\n \"../../lib/use-min\": 162,\n \"../shared/constants\": 182,\n \"../shared/errors\": 183,\n \"@braintree/wrap-promise\": 44\n }],\n 181: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @module braintree-web/paypal\n * @description A component to integrate with PayPal.\n * @deprecated Use the {@link PayPalCheckout|PayPal Checkout component} instead.\n */\n\n var analytics = _dereq_('../lib/analytics');\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var errors = _dereq_('./shared/errors');\n\n var PayPal = _dereq_('./external/paypal');\n\n var VERSION = \"3.76.1\";\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var Promise = _dereq_('../lib/promise');\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} callback The second argument, `data`, is the {@link PayPal} instance.\n * @example\n * // We recommend creating your PayPal button with button.js\n * // For an example, see https://codepen.io/braintree/pen/LNKJWa\n * var paypalButton = document.querySelector('.paypal-button');\n *\n * braintree.client.create({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (clientErr, clientInstance) {\n * if (clientErr) {\n * console.error('Error creating client:', clientErr);\n * return;\n * }\n *\n * braintree.paypal.create({\n * client: clientInstance\n * }, function (paypalErr, paypalInstance) {\n * if (paypalErr) {\n * console.error('Error creating PayPal:', paypalErr);\n * return;\n * }\n *\n * paypalButton.removeAttribute('disabled');\n *\n * // When the button is clicked, attempt to tokenize.\n * paypalButton.addEventListener('click', function (event) {\n * // Because tokenization opens a popup, this has to be called as a result of\n * // customer action, like clicking a button. You cannot call this at any time.\n * paypalInstance.tokenize({\n * flow: 'vault'\n * // For more tokenization options, see the full PayPal tokenization documentation\n * // https://braintree.github.io/braintree-web/current/PayPal.html#tokenize\n * }, function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * if (tokenizeErr.type !== 'CUSTOMER') {\n * console.error('Error tokenizing:', tokenizeErr);\n * }\n * return;\n * }\n *\n * // Tokenization succeeded\n * paypalButton.setAttribute('disabled', true);\n * console.log('Got a nonce! You should submit this to your server.');\n * console.log(payload.nonce);\n * });\n * }, false);\n * });\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n function create(options) {\n var name = 'PayPal';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var pp;\n var config = client.getConfiguration();\n options.client = client;\n\n if (config.gatewayConfiguration.paypalEnabled !== true) {\n return Promise.reject(new BraintreeError(errors.PAYPAL_NOT_ENABLED));\n }\n\n analytics.sendEvent(options.client, 'paypal.initialized');\n pp = new PayPal(options);\n return pp._initialize();\n });\n }\n /**\n * @static\n * @function isSupported\n * @description Returns true if PayPal [supports this browser](index.html#browser-support-webviews).\n * @example\n * if (braintree.paypal.isSupported()) {\n * // Add PayPal button to the page\n * } else {\n * // Hide PayPal payment option\n * }\n * @returns {Boolean} Returns true if PayPal supports this browser.\n */\n\n\n function isSupported() {\n return true;\n }\n\n module.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 121,\n \"../lib/basic-component-verification\": 124,\n \"../lib/braintree-error\": 126,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/promise\": 159,\n \"./external/paypal\": 180,\n \"./shared/errors\": 183,\n \"@braintree/wrap-promise\": 44\n }],\n 182: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n LANDING_FRAME_NAME: 'braintreepaypallanding',\n FLOW_ENDPOINTS: {\n checkout: 'create_payment_resource',\n vault: 'setup_billing_agreement'\n }\n };\n }, {}],\n 183: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.PayPal - Creation Error Codes\n * @description Errors that occur when [creating the PayPal component](./module-braintree-web_paypal.html#.create).\n * @property {MERCHANT} PAYPAL_NOT_ENABLED Occurs when PayPal is not enabled on the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.PayPal - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./PayPal.html#tokenize).\n * @property {MERCHANT} PAYPAL_TOKENIZATION_REQUEST_ACTIVE Occurs when a tokenization request is already in progress.\n * @property {MERCHANT} PAYPAL_FLOW_OPTION_REQUIRED Occurs when flow option is not provided.\n * @property {NETWORK} PAYPAL_ACCOUNT_TOKENIZATION_FAILED Occurs when PayPal account could not be tokenized.\n * @property {NETWORK} PAYPAL_FLOW_FAILED Occurs when PayPal flow could not be initiated.\n * @property {MERCHANT} PAYPAL_POPUP_OPEN_FAILED Occurs when PayPal window could not be opened.\n * @property {CUSTOMER} PAYPAL_POPUP_CLOSED Occurs when customer closes the PayPal window before completing the flow.\n * @property {MERCHANT} PAYPAL_INVALID_PAYMENT_OPTION Occurs when an invalid payment option is passed.\n */\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n module.exports = {\n PAYPAL_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_NOT_ENABLED',\n message: 'PayPal is not enabled for this merchant.'\n },\n PAYPAL_TOKENIZATION_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_TOKENIZATION_REQUEST_ACTIVE',\n message: 'Another tokenization request is active.'\n },\n PAYPAL_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED',\n message: 'Could not tokenize user\\'s PayPal account.'\n },\n PAYPAL_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'PAYPAL_FLOW_FAILED',\n message: 'Could not initialize PayPal flow.'\n },\n PAYPAL_FLOW_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_FLOW_OPTION_REQUIRED',\n message: 'PayPal flow property is invalid or missing.'\n },\n PAYPAL_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_POPUP_OPEN_FAILED',\n message: 'PayPal popup failed to open, make sure to tokenize in response to a user action.'\n },\n PAYPAL_POPUP_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'PAYPAL_POPUP_CLOSED',\n message: 'Customer closed PayPal popup before authorizing.'\n },\n PAYPAL_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: 'PAYPAL_INVALID_PAYMENT_OPTION',\n message: 'PayPal payment options are invalid.'\n }\n };\n }, {\n \"../../lib/braintree-error\": 126\n }],\n 184: [function (_dereq_, module, exports) {\n 'use strict';\n /** @module braintree-web/preferred-payment-methods */\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var PreferredPaymentMethods = _dereq_('./preferred-payment-methods');\n\n var VERSION = \"3.76.1\";\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link PreferredPaymentMethods} instance.\n * @example\n * braintree.preferredPaymentMethods.create({\n * client: clientInstance\n * }).then(function (preferredPaymentMethodsInstance) {\n * // preferredPaymentMethodsInstance is ready to be used.\n * }).catch(function (error) {\n * // handle creation error\n * });\n * @returns {Promise|void} Returns a Promise with resolves with the PreferredPaymentMethods instance.\n */\n\n function create(options) {\n var name = 'PreferredPaymentMethods';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n var instance = new PreferredPaymentMethods();\n return instance.initialize(options);\n });\n }\n\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 124,\n \"./preferred-payment-methods\": 185,\n \"@braintree/wrap-promise\": 44\n }],\n 185: [function (_dereq_, module, exports) {\n 'use strict';\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var analytics = _dereq_('../lib/analytics');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var Promise = _dereq_('../lib/promise');\n /**\n * @class\n * @param {object} options See {@link module:braintree-web/preferred-payment-methods.create|preferred-payment-methods.create}\n */\n\n\n function PreferredPaymentMethods() {}\n\n PreferredPaymentMethods.prototype.initialize = function (options) {\n var self = this;\n this._clientPromise = createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: 'PreferredPaymentMethods'\n }).catch(function (err) {\n self._setupError = err;\n return Promise.reject(err);\n });\n analytics.sendEvent(this._clientPromise, 'preferred-payment-methods.initialized');\n return Promise.resolve(this);\n };\n /**\n * Fetches information about which payment methods are preferred on the device.\n * Used to determine which payment methods are given preference in your UI,\n * not whether they are presented entirely.\n *\n * This class is currently in beta and may change in future releases.\n * @public\n * @returns {Promise|void} Returns a promise if no callback is provided.\n * @example\n *
Preferred Payment Methods\n * preferredPaymentMethodsInstance.fetchPreferredPaymentMethods().then(function (result) {\n * if (result.paypalPreferred) {\n * // PayPal preferred\n * } else {\n * // PayPal not preferred\n * }\n *\n * if (result.venmoPreferred) {\n * // Venmo preferred\n * } else {\n * // Venmo not preferred\n * }\n * });\n */\n\n\n PreferredPaymentMethods.prototype.fetchPreferredPaymentMethods = function () {\n var client;\n var self = this;\n return this._clientPromise.then(function (clientInstance) {\n client = clientInstance;\n return client.request({\n api: 'graphQLApi',\n data: {\n query: 'query PreferredPaymentMethods { ' + 'preferredPaymentMethods { ' + 'paypalPreferred ' + 'venmoPreferred ' + '} ' + '}'\n }\n });\n }).then(function (result) {\n var paypalPreferred = result.data.preferredPaymentMethods.paypalPreferred;\n var venmoPreferred = result.data.preferredPaymentMethods.venmoPreferred;\n analytics.sendEvent(client, 'preferred-payment-methods.paypal.api-detected.' + paypalPreferred);\n analytics.sendEvent(client, 'preferred-payment-methods.venmo.api-detected.' + venmoPreferred);\n return {\n paypalPreferred: paypalPreferred,\n venmoPreferred: venmoPreferred\n };\n }).catch(function () {\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n\n analytics.sendEvent(client, 'preferred-payment-methods.api-error');\n return {\n paypalPreferred: false,\n venmoPreferred: false\n };\n });\n };\n\n module.exports = wrapPromise.wrapPrototype(PreferredPaymentMethods);\n }, {\n \"../lib/analytics\": 121,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/promise\": 159,\n \"@braintree/wrap-promise\": 44\n }],\n 186: [function (_dereq_, module, exports) {\n 'use strict';\n\n var assign = _dereq_('../../../lib/assign').assign;\n\n var analytics = _dereq_('../../../lib/analytics');\n\n var BraintreeError = _dereq_('../../../lib/braintree-error');\n\n var Promise = _dereq_('../../../lib/promise');\n\n var isVerifiedDomain = _dereq_('../../../lib/is-verified-domain');\n\n var ExtendedPromise = _dereq_('@braintree/extended-promise');\n\n var EventEmitter = _dereq_('@braintree/event-emitter');\n\n var errors = _dereq_('../../shared/errors');\n\n var iFramer = _dereq_('@braintree/iframer');\n\n var Bus = _dereq_('framebus');\n\n var constants = _dereq_('../../shared/constants');\n\n var uuid = _dereq_('@braintree/uuid');\n\n var events = _dereq_('../../shared/events');\n\n var useMin = _dereq_('../../../lib/use-min');\n\n var BUS_CONFIGURATION_REQUEST_EVENT = _dereq_('../../../lib/constants').BUS_CONFIGURATION_REQUEST_EVENT;\n\n var VERSION = \"3.76.1\";\n var IFRAME_HEIGHT = 400;\n var IFRAME_WIDTH = 400;\n\n function BaseFramework(options) {\n EventEmitter.call(this);\n this._client = options.client;\n this._createPromise = options.createPromise;\n this._createOptions = options;\n\n if (this._client) {\n this._isDebug = this._client.getConfiguration().isDebug;\n this._assetsUrl = this._client.getConfiguration().gatewayConfiguration.assetsUrl;\n } else {\n this._isDebug = Boolean(options.isDebug);\n this._assetsUrl = options.assetsUrl;\n }\n\n this._assetsUrl = this._assetsUrl + '/web/' + VERSION;\n }\n\n EventEmitter.createChild(BaseFramework);\n\n BaseFramework.prototype._waitForClient = function () {\n if (this._client) {\n return Promise.resolve();\n }\n\n return this._createPromise.then(function (client) {\n this._client = client;\n }.bind(this));\n };\n\n BaseFramework.prototype.setUpEventListeners = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n\n BaseFramework.prototype.verifyCard = function (options, privateOptions) {\n var formattedOptions, error;\n var self = this;\n privateOptions = privateOptions || {};\n error = this._checkForVerifyCardError(options, privateOptions);\n\n if (error) {\n return Promise.reject(error);\n }\n\n this._verifyCardInProgress = true;\n formattedOptions = this._formatVerifyCardOptions(options);\n return this._formatLookupData(formattedOptions).then(function (data) {\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.started');\n return self._performLookup(formattedOptions.nonce, data);\n }).then(function (response) {\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.3ds-version.' + response.lookup.threeDSecureVersion);\n return self._onLookupComplete(response, formattedOptions);\n }).then(function (response) {\n return self.initializeChallengeWithLookupResponse(response, formattedOptions);\n }).then(function (payload) {\n self._resetVerificationState();\n\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.completed');\n return payload;\n }).catch(function (err) {\n self._resetVerificationState();\n\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.failed');\n return Promise.reject(err);\n });\n };\n\n BaseFramework.prototype._checkForFrameworkSpecificVerifyCardErrors = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n\n BaseFramework.prototype._presentChallenge = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n\n BaseFramework.prototype.prepareLookup = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n\n BaseFramework.prototype._resetVerificationState = function () {\n this._verifyCardInProgress = false;\n this._verifyCardPromisePlus = null;\n };\n\n BaseFramework.prototype._performLookup = function (nonce, data) {\n var self = this;\n var url = 'payment_methods/' + nonce + '/three_d_secure/lookup';\n return this._waitForClient().then(function () {\n return self._client.request({\n endpoint: url,\n method: 'post',\n data: data\n }).catch(function (err) {\n var status = err && err.details && err.details.httpStatus;\n var analyticsMessage = 'three-d-secure.verification-flow.lookup-failed';\n var lookupError;\n\n if (status === 404) {\n lookupError = errors.THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR;\n analyticsMessage += '.404';\n } else if (status === 422) {\n lookupError = errors.THREEDS_LOOKUP_VALIDATION_ERROR;\n analyticsMessage += '.422';\n } else {\n lookupError = errors.THREEDS_LOOKUP_ERROR;\n }\n\n analytics.sendEvent(self._createPromise, analyticsMessage);\n return Promise.reject(new BraintreeError({\n type: lookupError.type,\n code: lookupError.code,\n message: lookupError.message,\n details: {\n originalError: err\n }\n }));\n });\n });\n };\n\n BaseFramework.prototype._checkForVerifyCardError = function (options, privateOptions) {\n var errorOption;\n\n if (this._verifyCardInProgress === true) {\n return new BraintreeError(errors.THREEDS_AUTHENTICATION_IN_PROGRESS);\n } else if (!options.nonce) {\n errorOption = 'a nonce';\n } else if (!options.amount) {\n errorOption = 'an amount';\n }\n\n if (!errorOption) {\n errorOption = this._checkForFrameworkSpecificVerifyCardErrors(options, privateOptions);\n }\n\n if (errorOption) {\n return new BraintreeError({\n type: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.type,\n code: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.code,\n message: 'verifyCard options must include ' + errorOption + '.'\n });\n }\n\n return null;\n };\n\n BaseFramework.prototype.initializeChallengeWithLookupResponse = function (lookupResponse, options) {\n var self = this;\n options = options || {};\n this._lookupPaymentMethod = lookupResponse.paymentMethod; // sets this in the case that initializeChallengeWithLookupResponse is\n // called as a standalone method from a server side lookup. In a normal\n // verifyCard flow, this promise will already exist\n\n self._verifyCardPromisePlus = self._verifyCardPromisePlus || new ExtendedPromise();\n\n self._handleLookupResponse(lookupResponse, options);\n\n return self._verifyCardPromisePlus.then(function (payload) {\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.liability-shifted.' + String(payload.liabilityShifted));\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.liability-shift-possible.' + String(payload.liabilityShiftPossible));\n return payload;\n });\n };\n\n BaseFramework.prototype._handleLookupResponse = function (lookupResponse, options) {\n var challengeShouldBePresented = Boolean(lookupResponse.lookup && lookupResponse.lookup.acsUrl);\n var details;\n analytics.sendEvent(this._createPromise, 'three-d-secure.verification-flow.challenge-presented.' + String(challengeShouldBePresented));\n\n if (challengeShouldBePresented) {\n this._presentChallenge(lookupResponse, options);\n } else {\n details = this._formatAuthResponse(lookupResponse.paymentMethod, lookupResponse.threeDSecureInfo);\n details.verificationDetails = lookupResponse.threeDSecureInfo;\n\n this._verifyCardPromisePlus.resolve(details);\n }\n };\n\n BaseFramework.prototype._onLookupComplete = function (response) {\n this._lookupPaymentMethod = response.paymentMethod;\n this._verifyCardPromisePlus = new ExtendedPromise();\n return Promise.resolve(response);\n };\n\n BaseFramework.prototype._formatAuthResponse = function (paymentMethod, threeDSecureInfo) {\n return {\n nonce: paymentMethod.nonce,\n binData: paymentMethod.binData,\n details: paymentMethod.details,\n description: paymentMethod.description && paymentMethod.description.replace(/\\+/g, ' '),\n liabilityShifted: threeDSecureInfo && threeDSecureInfo.liabilityShifted,\n liabilityShiftPossible: threeDSecureInfo && threeDSecureInfo.liabilityShiftPossible,\n threeDSecureInfo: paymentMethod.threeDSecureInfo\n };\n };\n\n BaseFramework.prototype._formatVerifyCardOptions = function (options) {\n return assign({}, options);\n };\n\n BaseFramework.prototype._formatLookupData = function (options) {\n var data = {\n amount: options.amount\n };\n return Promise.resolve(data);\n };\n\n BaseFramework.prototype._handleV1AuthResponse = function (data) {\n var authResponse = JSON.parse(data.auth_response);\n\n if (authResponse.success) {\n this._verifyCardPromisePlus.resolve(this._formatAuthResponse(authResponse.paymentMethod, authResponse.threeDSecureInfo));\n } else if (authResponse.threeDSecureInfo && authResponse.threeDSecureInfo.liabilityShiftPossible) {\n this._verifyCardPromisePlus.resolve(this._formatAuthResponse(this._lookupPaymentMethod, authResponse.threeDSecureInfo));\n } else {\n this._verifyCardPromisePlus.reject(new BraintreeError({\n type: BraintreeError.types.UNKNOWN,\n code: 'UNKNOWN_AUTH_RESPONSE',\n message: authResponse.error.message\n }));\n }\n };\n\n BaseFramework.prototype.cancelVerifyCard = function () {\n var response, threeDSecureInfo;\n this._verifyCardInProgress = false;\n\n if (!this._lookupPaymentMethod) {\n return Promise.reject(new BraintreeError(errors.THREEDS_NO_VERIFICATION_PAYLOAD));\n }\n\n threeDSecureInfo = this._lookupPaymentMethod.threeDSecureInfo;\n response = assign({}, this._lookupPaymentMethod, {\n liabilityShiftPossible: threeDSecureInfo && threeDSecureInfo.liabilityShiftPossible,\n liabilityShifted: threeDSecureInfo && threeDSecureInfo.liabilityShifted,\n verificationDetails: threeDSecureInfo && threeDSecureInfo.verificationDetails\n });\n return Promise.resolve(response);\n };\n\n BaseFramework.prototype._setupV1Bus = function (options) {\n var parentURL = window.location.href.split('#')[0];\n var lookupResponse = options.lookupResponse;\n var channel = uuid();\n var bus = new Bus({\n channel: channel,\n verifyDomain: isVerifiedDomain\n });\n var authenticationCompleteBaseUrl = this._assetsUrl + '/html/three-d-secure-authentication-complete-frame.html?channel=' + encodeURIComponent(channel) + '&';\n bus.on(BUS_CONFIGURATION_REQUEST_EVENT, function (reply) {\n reply({\n acsUrl: lookupResponse.acsUrl,\n pareq: lookupResponse.pareq,\n termUrl: lookupResponse.termUrl + '&three_d_secure_version=' + VERSION + '&authentication_complete_base_url=' + encodeURIComponent(authenticationCompleteBaseUrl),\n md: lookupResponse.md,\n parentUrl: parentURL\n });\n });\n bus.on(events.AUTHENTICATION_COMPLETE, options.handleAuthResponse);\n return bus;\n };\n\n BaseFramework.prototype._setupV1Iframe = function (options) {\n var url = this._assetsUrl + '/html/three-d-secure-bank-frame' + useMin(this._isDebug) + '.html?showLoader=' + options.showLoader;\n var bankIframe = iFramer({\n src: url,\n height: IFRAME_HEIGHT,\n width: IFRAME_WIDTH,\n name: constants.LANDING_FRAME_NAME + '_' + this._v1Bus.channel,\n title: '3D Secure Authorization Frame'\n });\n return bankIframe;\n };\n\n BaseFramework.prototype._setupV1Elements = function (options) {\n this._v1Bus = this._setupV1Bus(options);\n this._v1Iframe = this._setupV1Iframe(options);\n };\n\n BaseFramework.prototype._teardownV1Elements = function () {\n if (this._v1Bus) {\n this._v1Bus.teardown();\n\n this._v1Bus = null;\n }\n\n if (this._v1Iframe && this._v1Iframe.parentNode) {\n this._v1Iframe.parentNode.removeChild(this._v1Iframe);\n\n this._v1Iframe = null;\n }\n\n if (this._onV1Keyup) {\n document.removeEventListener('keyup', this._onV1Keyup);\n this._onV1Keyup = null;\n }\n };\n\n BaseFramework.prototype.teardown = function () {\n analytics.sendEvent(this._createPromise, 'three-d-secure.teardown-completed');\n\n this._teardownV1Elements();\n\n return Promise.resolve();\n };\n\n module.exports = BaseFramework;\n }, {\n \"../../../lib/analytics\": 121,\n \"../../../lib/assign\": 123,\n \"../../../lib/braintree-error\": 126,\n \"../../../lib/constants\": 128,\n \"../../../lib/is-verified-domain\": 155,\n \"../../../lib/promise\": 159,\n \"../../../lib/use-min\": 162,\n \"../../shared/constants\": 195,\n \"../../shared/errors\": 196,\n \"../../shared/events\": 197,\n \"@braintree/event-emitter\": 34,\n \"@braintree/extended-promise\": 35,\n \"@braintree/iframer\": 36,\n \"@braintree/uuid\": 40,\n \"framebus\": 53\n }],\n 187: [function (_dereq_, module, exports) {\n 'use strict'; // NEXT_MAJOR_VERSION drop support for Bootstrap framework,\n // recomend using inline frame version and putting it in\n // the merchant's own bootstrap modal\n\n var SongbirdFramework = _dereq_('./songbird');\n\n function Bootstrap3ModalFramework(options) {\n SongbirdFramework.call(this, options);\n }\n\n Bootstrap3ModalFramework.prototype = Object.create(SongbirdFramework.prototype, {\n constructor: SongbirdFramework\n });\n\n Bootstrap3ModalFramework.prototype._createV1IframeModalElement = function (iframe) {\n var modal = document.createElement('div');\n modal.innerHTML = '
';\n modal.querySelector('[data-braintree-v1-fallback-iframe-container]').appendChild(iframe);\n return modal;\n };\n\n Bootstrap3ModalFramework.prototype._createCardinalConfigurationOptions = function (setupOptions) {\n var options = SongbirdFramework.prototype._createCardinalConfigurationOptions.call(this, setupOptions);\n\n options.payment.framework = 'bootstrap3';\n return options;\n };\n\n module.exports = Bootstrap3ModalFramework;\n }, {\n \"./songbird\": 192\n }],\n 188: [function (_dereq_, module, exports) {\n 'use strict';\n\n var SongbirdFramework = _dereq_('./songbird');\n\n function CardinalModalFramework(options) {\n SongbirdFramework.call(this, options);\n }\n\n CardinalModalFramework.prototype = Object.create(SongbirdFramework.prototype, {\n constructor: SongbirdFramework\n });\n\n CardinalModalFramework.prototype._createV1IframeModalElement = function (iframe) {\n var modal = document.createElement('div');\n var addCloseButton = Boolean(this._createOptions && this._createOptions.cardinalSDKConfig && this._createOptions.cardinalSDKConfig.payment && this._createOptions.cardinalSDKConfig.payment.displayExitButton);\n modal.innerHTML = '
' + '
' + '' + '
' + // iframe container\n '
' + '
' + // modal backdrop\n '
';\n\n if (!addCloseButton) {\n modal.querySelector('[data-braintree-v1-fallback-close-button]').style.display = 'none';\n }\n\n modal.querySelector('[data-braintree-v1-fallback-iframe-container]').appendChild(iframe);\n return modal;\n };\n\n module.exports = CardinalModalFramework;\n }, {\n \"./songbird\": 192\n }],\n 189: [function (_dereq_, module, exports) {\n 'use strict';\n\n var LegacyFramework = _dereq_('./legacy');\n\n var CardinalModalFramework = _dereq_('./cardinal-modal');\n\n var Bootstrap3ModalFramework = _dereq_('./bootstrap3-modal');\n\n var InlineIframeFramework = _dereq_('./inline-iframe');\n\n module.exports = {\n legacy: LegacyFramework,\n 'cardinal-modal': CardinalModalFramework,\n 'bootstrap3-modal': Bootstrap3ModalFramework,\n 'inline-iframe': InlineIframeFramework\n };\n }, {\n \"./bootstrap3-modal\": 187,\n \"./cardinal-modal\": 188,\n \"./inline-iframe\": 190,\n \"./legacy\": 191\n }],\n 190: [function (_dereq_, module, exports) {\n 'use strict';\n\n var SongbirdFramework = _dereq_('./songbird');\n\n var BraintreeError = _dereq_('../../../lib/braintree-error');\n\n var errors = _dereq_('../../shared/errors');\n\n var enumerate = _dereq_('../../../lib/enumerate');\n\n function InlineIframeFramework(options) {\n SongbirdFramework.call(this, options);\n }\n\n InlineIframeFramework.prototype = Object.create(SongbirdFramework.prototype, {\n constructor: SongbirdFramework\n });\n InlineIframeFramework.events = enumerate(['AUTHENTICATION_IFRAME_AVAILABLE'], 'inline-iframe-framework:');\n\n InlineIframeFramework.prototype.setUpEventListeners = function (reply) {\n SongbirdFramework.prototype.setUpEventListeners.call(this, reply);\n this.on(InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE, function (payload, next) {\n reply('authentication-iframe-available', payload, next);\n });\n };\n\n InlineIframeFramework.prototype._createCardinalConfigurationOptions = function (setupOptions) {\n var options = SongbirdFramework.prototype._createCardinalConfigurationOptions.call(this, setupOptions);\n\n options.payment.framework = 'inline';\n return options;\n };\n\n InlineIframeFramework.prototype._addV1IframeToPage = function () {\n this._emit(InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE, {\n element: this._v1Modal\n }, function () {// NOOP\n });\n };\n\n InlineIframeFramework.prototype._setupFrameworkSpecificListeners = function () {\n this.setCardinalListener('ui.inline.setup', this._onInlineSetup.bind(this));\n };\n\n InlineIframeFramework.prototype._onInlineSetup = function (htmlTemplate, details, resolve, reject) {\n var container, hasError;\n\n if (!htmlTemplate || !details) {\n hasError = true;\n } else if (details.paymentType !== 'CCA') {\n hasError = true;\n } else if (!(details.data.mode === 'suppress' || details.data.mode === 'static')) {\n hasError = true;\n }\n\n if (hasError) {\n reject(new BraintreeError(errors.THREEDS_INLINE_IFRAME_DETAILS_INCORRECT));\n return;\n }\n\n container = document.createElement('div');\n container.innerHTML = htmlTemplate;\n\n if (details.data.mode === 'suppress') {\n container.style.display = 'none';\n document.body.appendChild(container);\n resolve();\n } else if (details.data.mode === 'static') {\n this._emit(InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE, {\n element: container\n }, function () {\n resolve();\n });\n }\n };\n\n module.exports = InlineIframeFramework;\n }, {\n \"../../../lib/braintree-error\": 126,\n \"../../../lib/enumerate\": 136,\n \"../../shared/errors\": 196,\n \"./songbird\": 192\n }],\n 191: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BaseFramework = _dereq_('./base');\n\n var deferred = _dereq_('../../../lib/deferred');\n\n function LegacyFramework(options) {\n BaseFramework.call(this, options);\n }\n\n LegacyFramework.prototype = Object.create(BaseFramework.prototype, {\n constructor: LegacyFramework\n });\n\n LegacyFramework.prototype.setUpEventListeners = function () {// noop\n };\n\n LegacyFramework.prototype.transformV1CustomerBillingAddress = function (customer) {\n customer.billingAddress.line1 = customer.billingAddress.streetAddress;\n customer.billingAddress.line2 = customer.billingAddress.extendedAddress;\n customer.billingAddress.city = customer.billingAddress.locality;\n customer.billingAddress.state = customer.billingAddress.region;\n customer.billingAddress.countryCode = customer.billingAddress.countryCodeAlpha2;\n delete customer.billingAddress.streetAddress;\n delete customer.billingAddress.extendedAddress;\n delete customer.billingAddress.locality;\n delete customer.billingAddress.region;\n delete customer.billingAddress.countryCodeAlpha2;\n return customer;\n };\n\n LegacyFramework.prototype._createIframe = function (options) {\n var self = this;\n\n this._setupV1Elements({\n lookupResponse: options.lookupResponse,\n showLoader: options.showLoader,\n handleAuthResponse: function handleAuthResponse(data) {\n self._handleAuthResponse(data, options);\n }\n });\n\n return this._v1Iframe;\n };\n\n LegacyFramework.prototype._handleAuthResponse = function (data, options) {\n this._v1Bus.teardown();\n\n options.removeFrame(); // This also has to be in a setTimeout so it executes after the `removeFrame`.\n\n deferred(function () {\n this._handleV1AuthResponse(data);\n }.bind(this))();\n };\n\n LegacyFramework.prototype._checkForFrameworkSpecificVerifyCardErrors = function (options) {\n var errorOption;\n\n if (typeof options.addFrame !== 'function') {\n errorOption = 'an addFrame function';\n } else if (typeof options.removeFrame !== 'function') {\n errorOption = 'a removeFrame function';\n }\n\n return errorOption;\n };\n\n LegacyFramework.prototype._formatVerifyCardOptions = function (options) {\n var modifiedOptions = BaseFramework.prototype._formatVerifyCardOptions.call(this, options);\n\n modifiedOptions.addFrame = deferred(options.addFrame);\n modifiedOptions.removeFrame = deferred(options.removeFrame);\n modifiedOptions.showLoader = options.showLoader !== false;\n return modifiedOptions;\n };\n\n LegacyFramework.prototype._formatLookupData = function (options) {\n var self = this;\n return BaseFramework.prototype._formatLookupData.call(this, options).then(function (data) {\n if (options.customer && options.customer.billingAddress) {\n data.customer = self.transformV1CustomerBillingAddress(options.customer);\n }\n\n return data;\n });\n };\n\n LegacyFramework.prototype._presentChallenge = function (lookupResponse, options) {\n options.addFrame(null, this._createIframe({\n showLoader: options.showLoader,\n lookupResponse: lookupResponse.lookup,\n removeFrame: options.removeFrame\n }));\n };\n\n module.exports = LegacyFramework;\n }, {\n \"../../../lib/deferred\": 134,\n \"./base\": 186\n }],\n 192: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BaseFramework = _dereq_('./base');\n\n var assign = _dereq_('../../../lib/assign').assign;\n\n var deferred = _dereq_('../../../lib/deferred');\n\n var BraintreeError = _dereq_('../../../lib/braintree-error');\n\n var convertToBraintreeError = _dereq_('../../../lib/convert-to-braintree-error');\n\n var analytics = _dereq_('../../../lib/analytics');\n\n var assets = _dereq_('../../../lib/assets');\n\n var errors = _dereq_('../../shared/errors');\n\n var enumerate = _dereq_('../../../lib/enumerate');\n\n var constants = _dereq_('../../shared/constants');\n\n var Promise = _dereq_('../../../lib/promise');\n\n var ExtendedPromise = _dereq_('@braintree/extended-promise');\n\n var INTEGRATION_TIMEOUT_MS = _dereq_('../../../lib/constants').INTEGRATION_TIMEOUT_MS;\n\n var PLATFORM = _dereq_('../../../lib/constants').PLATFORM;\n\n var VERSION = \"3.76.1\";\n var CUSTOMER_CANCELED_SONGBIRD_MODAL = '01';\n var SONGBIRD_UI_EVENTS = ['ui.close', 'ui.render', // TODO these events are not documented in the\n // client reference because so far we have\n // not been able to trigger them in our testing\n 'ui.renderHidden', 'ui.loading.close', 'ui.loading.render'];\n\n function SongbirdFramework(options) {\n BaseFramework.call(this, options);\n this._useV1Fallback = false;\n this._clientMetadata = {\n requestedThreeDSecureVersion: '2',\n sdkVersion: PLATFORM + '/' + VERSION\n };\n this._getDfReferenceIdPromisePlus = new ExtendedPromise();\n this.setupSongbird(options);\n this._cardinalEvents = [];\n }\n\n SongbirdFramework.prototype = Object.create(BaseFramework.prototype, {\n constructor: SongbirdFramework\n });\n SongbirdFramework.events = enumerate(['LOOKUP_COMPLETE', 'CUSTOMER_CANCELED', 'UI.CLOSE', 'UI.RENDER', 'UI.RENDERHIDDEN', 'UI.LOADING.CLOSE', 'UI.LOADING.RENDER'], 'songbird-framework:');\n\n SongbirdFramework.prototype.setUpEventListeners = function (reply) {\n this.on(SongbirdFramework.events.LOOKUP_COMPLETE, function (data, next) {\n reply('lookup-complete', data, next);\n });\n this.on(SongbirdFramework.events.CUSTOMER_CANCELED, function () {\n reply('customer-canceled');\n });\n this.on(SongbirdFramework.events['UI.CLOSE'], function () {\n reply('authentication-modal-close');\n });\n this.on(SongbirdFramework.events['UI.RENDER'], function () {\n reply('authentication-modal-render');\n });\n this.on(SongbirdFramework.events['UI.RENDERHIDDEN'], function () {\n reply('authentication-modal-render-hidden');\n });\n this.on(SongbirdFramework.events['UI.LOADING.CLOSE'], function () {\n reply('authentication-modal-loader-close');\n });\n this.on(SongbirdFramework.events['UI.LOADING.RENDER'], function () {\n reply('authentication-modal-loader-render');\n });\n };\n\n SongbirdFramework.prototype.prepareLookup = function (options) {\n var data = assign({}, options);\n var self = this;\n return this.getDfReferenceId().then(function (id) {\n data.dfReferenceId = id;\n }).then(function () {\n return self._triggerCardinalBinProcess(options.bin);\n }).catch(function () {// catch and ignore errors from looking up\n // df reference and Cardinal bin process\n }).then(function () {\n return self._waitForClient();\n }).then(function () {\n data.clientMetadata = self._clientMetadata;\n data.authorizationFingerprint = self._client.getConfiguration().authorizationFingerprint;\n data.braintreeLibraryVersion = 'braintree/web/' + VERSION;\n return data;\n });\n };\n\n SongbirdFramework.prototype.initializeChallengeWithLookupResponse = function (lookupResponse, options) {\n return this.setupSongbird().then(function () {\n return BaseFramework.prototype.initializeChallengeWithLookupResponse.call(this, lookupResponse, options);\n }.bind(this));\n };\n\n SongbirdFramework.prototype._initiateV1Fallback = function (errorType) {\n this._useV1Fallback = true;\n analytics.sendEvent(this._createPromise, 'three-d-secure.v1-fallback.' + errorType);\n\n this._songbirdPromise.resolve();\n };\n\n SongbirdFramework.prototype._triggerCardinalBinProcess = function (bin) {\n var self = this;\n var issuerStartTime = Date.now();\n\n if (!bin) {\n // skip bin lookup because bin wasn't passed in\n return Promise.resolve();\n }\n\n return window.Cardinal.trigger('bin.process', bin).then(function (binResults) {\n self._clientMetadata.issuerDeviceDataCollectionTimeElapsed = Date.now() - issuerStartTime;\n self._clientMetadata.issuerDeviceDataCollectionResult = binResults && binResults.Status;\n });\n };\n\n SongbirdFramework.prototype.transformBillingAddress = function (additionalInformation, billingAddress) {\n if (billingAddress) {\n // map from public API to the API that the Gateway expects\n extractAddressData(billingAddress, additionalInformation, 'billing');\n additionalInformation.billingPhoneNumber = billingAddress.phoneNumber;\n additionalInformation.billingGivenName = billingAddress.givenName;\n additionalInformation.billingSurname = billingAddress.surname;\n }\n\n return additionalInformation;\n };\n\n SongbirdFramework.prototype.transformShippingAddress = function (additionalInformation) {\n var shippingAddress = additionalInformation.shippingAddress;\n\n if (shippingAddress) {\n // map from public API to the API that the Gateway expects\n extractAddressData(shippingAddress, additionalInformation, 'shipping');\n delete additionalInformation.shippingAddress;\n }\n\n return additionalInformation;\n };\n\n SongbirdFramework.prototype._createV1IframeModalElement = function (iframe) {\n var modal = document.createElement('div');\n modal.innerHTML = '
';\n modal.querySelector('[data-braintree-v1-fallback-iframe-container=\"true\"]').appendChild(iframe);\n return modal;\n };\n\n SongbirdFramework.prototype._createV1IframeModal = function (iframe) {\n var modal = this._createV1IframeModalElement(iframe);\n\n var btn = modal.querySelector('[data-braintree-v1-fallback-close-button]');\n var backdrop = modal.querySelector('[data-braintree-v1-fallback-backdrop]');\n var self = this;\n\n function closeHandler() {\n modal.parentNode.removeChild(modal);\n self.cancelVerifyCard(errors.THREEDS_CARDINAL_SDK_CANCELED);\n document.removeEventListener('keyup', self._onV1Keyup);\n self._onV1Keyup = null;\n }\n\n this._onV1Keyup = function (e) {\n if (e.key !== 'Escape') {\n return;\n }\n\n if (!modal.parentNode) {\n // modal not on page\n return;\n }\n\n closeHandler();\n };\n\n if (btn) {\n btn.addEventListener('click', closeHandler);\n }\n\n if (backdrop) {\n backdrop.addEventListener('click', closeHandler);\n }\n\n document.addEventListener('keyup', this._onV1Keyup);\n return modal;\n };\n\n SongbirdFramework.prototype._addV1IframeToPage = function () {\n document.body.appendChild(this._v1Modal);\n };\n\n SongbirdFramework.prototype._handleAuthResponseFromV1Fallback = function (data) {\n this._teardownV1Elements();\n\n this._v1Modal.parentNode.removeChild(this._v1Modal);\n\n this._handleV1AuthResponse(data);\n };\n\n SongbirdFramework.prototype._presentChallengeWithV1Fallback = function (lookupResponse) {\n var self = this;\n\n this._setupV1Elements({\n lookupResponse: lookupResponse,\n showLoader: true,\n handleAuthResponse: function handleAuthResponse(data) {\n self._handleAuthResponseFromV1Fallback(data);\n }\n });\n\n this._v1Modal = this._createV1IframeModal(this._v1Iframe);\n\n this._addV1IframeToPage();\n };\n\n SongbirdFramework.prototype.setupSongbird = function (setupOptions) {\n var self = this;\n var startTime = Date.now();\n\n if (this._songbirdPromise) {\n return this._songbirdPromise;\n }\n\n setupOptions = setupOptions || {};\n this._songbirdPromise = new ExtendedPromise();\n this._v2SetupFailureReason = 'reason-unknown';\n\n self._loadCardinalScript(setupOptions).then(function () {\n if (!window.Cardinal) {\n self._v2SetupFailureReason = 'cardinal-global-unavailable';\n return Promise.reject(new BraintreeError(errors.THREEDS_CARDINAL_SDK_SETUP_FAILED));\n }\n\n return self._configureCardinalSdk({\n setupOptions: setupOptions,\n setupStartTime: startTime\n });\n }).catch(function (err) {\n var error = convertToBraintreeError(err, {\n type: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.type,\n code: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.code,\n message: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.message\n });\n\n self._getDfReferenceIdPromisePlus.reject(error);\n\n window.clearTimeout(self._songbirdSetupTimeoutReference);\n analytics.sendEvent(self._client, 'three-d-secure.cardinal-sdk.init.setup-failed');\n\n self._initiateV1Fallback('cardinal-sdk-setup-failed.' + self._v2SetupFailureReason);\n });\n\n return this._songbirdPromise;\n };\n\n SongbirdFramework.prototype._configureCardinalSdk = function (config) {\n var self = this;\n return this._waitForClient().then(function () {\n var threeDSConfig = self._client.getConfiguration().gatewayConfiguration.threeDSecure;\n\n if (threeDSConfig.hasOwnProperty('versionTwo') && threeDSConfig.versionTwo !== 'cardinal') {\n return Promise.reject(new Error('cardinal-api-not-available-or-configured'));\n }\n\n return threeDSConfig;\n }).then(function (threeDSConfig) {\n var jwt = threeDSConfig.cardinalAuthenticationJWT;\n var setupOptions = config.setupOptions;\n var setupStartTime = config.setupStartTime;\n\n var cardinalConfiguration = self._createCardinalConfigurationOptions(setupOptions);\n\n SONGBIRD_UI_EVENTS.forEach(function (eventName) {\n self.setCardinalListener(eventName, function () {\n self._emit(SongbirdFramework.events[eventName.toUpperCase()]);\n });\n });\n self.setCardinalListener('payments.setupComplete', self._createPaymentsSetupCompleteCallback());\n\n self._setupFrameworkSpecificListeners();\n\n window.Cardinal.configure(cardinalConfiguration);\n window.Cardinal.setup('init', {\n jwt: jwt\n });\n self._clientMetadata.cardinalDeviceDataCollectionTimeElapsed = Date.now() - setupStartTime;\n self.setCardinalListener('payments.validated', self._createPaymentsValidatedCallback());\n }).catch(function (err) {\n if (err.message === 'cardinal-api-not-available-or-configured') {\n self._v2SetupFailureReason = 'cardinal-api-not-available-or-configured';\n } else {\n self._v2SetupFailureReason = 'cardinal-configuration-threw-error';\n }\n\n return Promise.reject(err);\n });\n };\n\n SongbirdFramework.prototype.setCardinalListener = function (eventName, cb) {\n this._cardinalEvents.push(eventName);\n\n window.Cardinal.on(eventName, cb);\n };\n\n SongbirdFramework.prototype._setupFrameworkSpecificListeners = function () {// noop\n };\n\n SongbirdFramework.prototype._createCardinalConfigurationOptions = function (setupOptions) {\n var cardinalConfiguration = setupOptions.cardinalSDKConfig || {};\n var paymentSettings = cardinalConfiguration.payment || {};\n\n if (!cardinalConfiguration.logging && setupOptions.loggingEnabled) {\n cardinalConfiguration.logging = {\n level: 'verbose'\n };\n }\n\n cardinalConfiguration.payment = {};\n\n if (paymentSettings.hasOwnProperty('displayLoading')) {\n cardinalConfiguration.payment.displayLoading = paymentSettings.displayLoading;\n }\n\n if (paymentSettings.hasOwnProperty('displayExitButton')) {\n cardinalConfiguration.payment.displayExitButton = paymentSettings.displayExitButton;\n }\n\n return cardinalConfiguration;\n };\n\n SongbirdFramework.prototype._loadCardinalScript = function (setupOptions) {\n var self = this;\n var scriptSource = constants.CARDINAL_SCRIPT_SOURCE.sandbox;\n return this._waitForClient().then(function () {\n var isProduction = self._client.getConfiguration().gatewayConfiguration.environment === 'production';\n self._songbirdSetupTimeoutReference = window.setTimeout(function () {\n analytics.sendEvent(self._client, 'three-d-secure.cardinal-sdk.init.setup-timeout');\n\n self._initiateV1Fallback('cardinal-sdk-setup-timeout');\n }, setupOptions.timeout || INTEGRATION_TIMEOUT_MS);\n\n if (isProduction) {\n scriptSource = constants.CARDINAL_SCRIPT_SOURCE.production;\n }\n\n return assets.loadScript({\n src: scriptSource\n });\n }).catch(function (err) {\n self._v2SetupFailureReason = 'songbird-js-failed-to-load';\n return Promise.reject(convertToBraintreeError(err, errors.THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED));\n });\n };\n\n SongbirdFramework.prototype._createPaymentsSetupCompleteCallback = function () {\n var self = this;\n return function (data) {\n self._getDfReferenceIdPromisePlus.resolve(data.sessionId);\n\n window.clearTimeout(self._songbirdSetupTimeoutReference);\n analytics.sendEvent(self._createPromise, 'three-d-secure.cardinal-sdk.init.setup-completed');\n\n self._songbirdPromise.resolve();\n };\n };\n\n SongbirdFramework.prototype.getDfReferenceId = function () {\n return this._getDfReferenceIdPromisePlus;\n };\n\n SongbirdFramework.prototype._performJWTValidation = function (rawCardinalSDKVerificationData, jwt) {\n var self = this;\n var nonce = this._lookupPaymentMethod.nonce;\n var url = 'payment_methods/' + nonce + '/three_d_secure/authenticate_from_jwt';\n var cancelCode = rawCardinalSDKVerificationData && rawCardinalSDKVerificationData.Payment && rawCardinalSDKVerificationData.Payment.ExtendedData && rawCardinalSDKVerificationData.Payment.ExtendedData.ChallengeCancel;\n\n if (cancelCode) {\n // see ChallengeCancel docs here for different values:\n // https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects\n analytics.sendEvent(this._createPromise, 'three-d-secure.verification-flow.cardinal-sdk.cancel-code.' + cancelCode);\n\n if (cancelCode === CUSTOMER_CANCELED_SONGBIRD_MODAL) {\n this._emit(SongbirdFramework.events.CUSTOMER_CANCELED);\n }\n }\n\n analytics.sendEvent(this._createPromise, 'three-d-secure.verification-flow.upgrade-payment-method.started');\n return this._waitForClient().then(function () {\n return self._client.request({\n method: 'post',\n endpoint: url,\n data: {\n jwt: jwt,\n paymentMethodNonce: nonce\n }\n });\n }).then(function (response) {\n var paymentMethod = response.paymentMethod || self._lookupPaymentMethod;\n\n var formattedResponse = self._formatAuthResponse(paymentMethod, response.threeDSecureInfo);\n\n formattedResponse.rawCardinalSDKVerificationData = rawCardinalSDKVerificationData;\n analytics.sendEvent(self._client, 'three-d-secure.verification-flow.upgrade-payment-method.succeeded');\n return Promise.resolve(formattedResponse);\n }).catch(function (err) {\n var error = new BraintreeError({\n type: errors.THREEDS_JWT_AUTHENTICATION_FAILED.type,\n code: errors.THREEDS_JWT_AUTHENTICATION_FAILED.code,\n message: errors.THREEDS_JWT_AUTHENTICATION_FAILED.message,\n details: {\n originalError: err\n }\n });\n analytics.sendEvent(self._client, 'three-d-secure.verification-flow.upgrade-payment-method.errored');\n return Promise.reject(error);\n });\n };\n\n SongbirdFramework.prototype._createPaymentsValidatedCallback = function () {\n var self = this;\n /**\n * @param {object} data Response Data\n * @see {@link https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects#ResponseObjects-ObjectDefinition}\n * @param {string} data.ActionCode The resulting state of the transaction.\n * @param {boolean} data.Validated Represents whether transaction was successfully or not.\n * @param {object} data.Payment Represents additional information about the verification.\n * @param {number} data.ErrorNumber A non-zero value represents the error encountered while attempting the process the message request.\n * @param {string} data.ErrorDescription Application error description for the associated error number.\n * @param {string} validatedJwt Response JWT\n * @returns {void}\n * */\n\n return function (data, validatedJwt) {\n var formattedError;\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.cardinal-sdk.action-code.' + data.ActionCode.toLowerCase());\n\n if (!self._verifyCardPromisePlus) {\n self._initiateV1Fallback('cardinal-sdk-setup-error.number-' + data.ErrorNumber);\n\n return;\n }\n\n switch (data.ActionCode) {\n // Handle these scenarios based on liability shift information in the response.\n case 'SUCCESS':\n case 'NOACTION':\n case 'FAILURE':\n self._performJWTValidation(data, validatedJwt).then(function (result) {\n self._verifyCardPromisePlus.resolve(result);\n }).catch(function (err) {\n self._verifyCardPromisePlus.reject(err);\n });\n\n break;\n\n case 'ERROR':\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.cardinal-sdk-error.' + data.ErrorNumber);\n\n switch (data.ErrorNumber) {\n case 10001: // Cardinal Docs: Timeout when sending an /Init message\n\n case 10002:\n // Cardinal Docs: Timeout when sending an /Start message\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT);\n break;\n\n case 10003: // Cardinal Docs: Timeout when sending an /Validate message. Although this code exists we do not yet have a flow where a validate message is sent to Midas. This error should not yet be triggered\n\n case 10007: // Cardinal Docs: Timeout when sending an /Confirm message\n\n case 10009:\n // Cardinal Docs: Timeout when sending an /Continue message\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT);\n break;\n\n case 10005: // Cardinal Docs: Songbird was started without a request jwt.\n\n case 10006:\n // Cardinal Docs: This is a general configuration error. The description is populated by the specific configuration error that caused the error.\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_BAD_CONFIG);\n break;\n\n case 10008: // Cardinal Docs: Songbird was initialized without a merchant JWT.\n\n case 10010:\n // Cardinal Docs: The response JWT was\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_BAD_JWT);\n break;\n\n case 10011:\n // This may never get called, according to the Cardinal docs:\n // The user has canceled the transaction. This is generally found in alternative\n // payments that supply a cancel button on the payment brand side.\n analytics.sendEvent(self._createPromise, 'three-d-secure.verification-flow.canceled');\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_CANCELED);\n break;\n\n default:\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_ERROR);\n }\n\n formattedError.details = {\n originalError: {\n code: data.ErrorNumber,\n description: data.ErrorDescription\n }\n };\n\n self._verifyCardPromisePlus.reject(formattedError);\n\n break;\n\n default:\n }\n };\n };\n\n SongbirdFramework.prototype._checkForVerifyCardError = function (options, privateOptions) {\n return BaseFramework.prototype._checkForVerifyCardError.call(this, options, privateOptions);\n };\n\n SongbirdFramework.prototype._checkForFrameworkSpecificVerifyCardErrors = function (options, privateOptions) {\n var errorOption;\n\n if (typeof options.onLookupComplete !== 'function' && !privateOptions.ignoreOnLookupCompleteRequirement) {\n errorOption = 'an onLookupComplete function';\n }\n\n return errorOption;\n };\n\n SongbirdFramework.prototype._formatVerifyCardOptions = function (options) {\n var modifiedOptions = BaseFramework.prototype._formatVerifyCardOptions.call(this, options);\n\n var additionalInformation = modifiedOptions.additionalInformation || {};\n additionalInformation = this.transformBillingAddress(additionalInformation, options.billingAddress);\n additionalInformation = this.transformShippingAddress(additionalInformation);\n\n if (options.onLookupComplete) {\n modifiedOptions.onLookupComplete = deferred(options.onLookupComplete);\n }\n\n if (options.email) {\n additionalInformation.email = options.email;\n }\n\n if (options.mobilePhoneNumber) {\n additionalInformation.mobilePhoneNumber = options.mobilePhoneNumber;\n }\n\n modifiedOptions.additionalInformation = additionalInformation;\n return modifiedOptions;\n };\n\n SongbirdFramework.prototype._onLookupComplete = function (lookupResponse, options) {\n var self = this;\n return BaseFramework.prototype._onLookupComplete.call(this, lookupResponse).then(function (response) {\n return new Promise(function (resolve, reject) {\n // NEXT_MAJOR_VERSION format this response object to look like the mobile sdk response\n // which is basically the lookup param at the top level with some additional accessors\n response.requiresUserAuthentication = Boolean(response.lookup && response.lookup.acsUrl);\n\n function next() {\n resolve(response);\n }\n\n self._verifyCardPromisePlus.catch(reject); // If both event and callback are mistakenly used together,\n // prefer the callback when it is passed into the verifyCard options\n\n\n if (options.onLookupComplete) {\n options.onLookupComplete(response, next);\n } else {\n self._emit(SongbirdFramework.events.LOOKUP_COMPLETE, response, next);\n }\n });\n });\n };\n\n SongbirdFramework.prototype._presentChallenge = function (lookupResponse) {\n // transactionId is required for the Songbird flow, so if it\n // does not exist, we fallback to the 3ds v1 flow\n if (this._useV1Fallback || !lookupResponse.lookup.transactionId) {\n this._presentChallengeWithV1Fallback(lookupResponse.lookup);\n\n return;\n } // set up listener for ref id to call out to bt before calling verify callback\n\n\n window.Cardinal.continue('cca', {\n AcsUrl: lookupResponse.lookup.acsUrl,\n Payload: lookupResponse.lookup.pareq\n }, {\n OrderDetails: {\n TransactionId: lookupResponse.lookup.transactionId\n }\n });\n };\n\n SongbirdFramework.prototype._formatLookupData = function (options) {\n var self = this;\n return BaseFramework.prototype._formatLookupData.call(this, options).then(function (data) {\n data.additionalInfo = options.additionalInformation;\n\n if (options.accountType) {\n data.accountType = options.accountType;\n }\n\n if (options.challengeRequested) {\n data.challengeRequested = options.challengeRequested;\n }\n\n if (options.dataOnlyRequested) {\n data.dataOnlyRequested = options.dataOnlyRequested;\n }\n\n if (options.exemptionRequested) {\n data.exemptionRequested = options.exemptionRequested;\n }\n\n if (options.bin) {\n data.bin = options.bin;\n }\n\n return self.prepareLookup(data);\n });\n };\n\n SongbirdFramework.prototype.cancelVerifyCard = function (verifyCardError) {\n var self = this;\n return BaseFramework.prototype.cancelVerifyCard.call(this).then(function (response) {\n if (self._verifyCardPromisePlus) {\n verifyCardError = verifyCardError || new BraintreeError(errors.THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT);\n\n self._verifyCardPromisePlus.reject(verifyCardError);\n }\n\n return response;\n });\n };\n\n SongbirdFramework.prototype.teardown = function () {\n if (window.Cardinal) {\n this._cardinalEvents.forEach(function (eventName) {\n window.Cardinal.off(eventName);\n });\n } // we intentionally do not remove the Cardinal SDK\n // from the page when tearing down. Subsequent\n // component creations will be faster because\n // the asset is already on the page\n\n\n return BaseFramework.prototype.teardown.call(this);\n };\n\n function extractAddressData(source, target, prefix) {\n target[prefix + 'Line1'] = source.streetAddress;\n target[prefix + 'Line2'] = source.extendedAddress;\n target[prefix + 'Line3'] = source.line3;\n target[prefix + 'City'] = source.locality;\n target[prefix + 'State'] = source.region;\n target[prefix + 'PostalCode'] = source.postalCode;\n target[prefix + 'CountryCode'] = source.countryCodeAlpha2;\n }\n\n module.exports = SongbirdFramework;\n }, {\n \"../../../lib/analytics\": 121,\n \"../../../lib/assets\": 122,\n \"../../../lib/assign\": 123,\n \"../../../lib/braintree-error\": 126,\n \"../../../lib/constants\": 128,\n \"../../../lib/convert-to-braintree-error\": 130,\n \"../../../lib/deferred\": 134,\n \"../../../lib/enumerate\": 136,\n \"../../../lib/promise\": 159,\n \"../../shared/constants\": 195,\n \"../../shared/errors\": 196,\n \"./base\": 186,\n \"@braintree/extended-promise\": 35\n }],\n 193: [function (_dereq_, module, exports) {\n 'use strict';\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var methods = _dereq_('../../lib/methods');\n\n var convertMethodsToError = _dereq_('../../lib/convert-methods-to-error');\n\n var EventEmitter = _dereq_('@braintree/event-emitter');\n\n var FRAMEWORKS = _dereq_('./frameworks');\n /**\n * @deprecated\n * @callback ThreeDSecure~addFrameCallback\n * @param {?BraintreeError} [err] `null` or `undefined` if there was no error.\n * @param {HTMLIFrameElement} iframe An iframe element containing the bank's authentication page that you must put on your page.\n * @description **Deprecated** The callback used for options.addFrame in 3DS 1.0's {@link ThreeDSecure#verifyCard|verifyCard}.\n * @returns {void}\n */\n\n /**\n * @deprecated\n * @callback ThreeDSecure~removeFrameCallback\n * @description **Deprecated** The callback used for options.removeFrame in 3DS 1.0's {@link ThreeDSecure#verifyCard|verifyCard}.\n * @returns {void}\n */\n\n /**\n * @deprecated\n * @typedef {object} ThreeDSecure~verifyCardCustomerObject\n * @property {string} [customer.mobilePhoneNumber] The mobile phone number used for verification. Only numbers; remove dashes, parenthesis and other characters.\n * @property {string} [customer.email] The email used for verification.\n * @property {string} [customer.shippingMethod] The 2-digit string indicating the shipping method chosen for the transaction.\n * @property {string} [customer.billingAddress.firstName] The first name associated with the address.\n * @property {string} [customer.billingAddress.lastName] The last name associated with the address.\n * @property {string} [customer.billingAddress.streetAddress] Line 1 of the Address (eg. number, street, etc).\n * @property {string} [customer.billingAddress.extendedAddress] Line 2 of the Address (eg. suite, apt #, etc.).\n * @property {string} [customer.billingAddress.locality] The locality (city) name associated with the address.\n * @property {string} [customer.billingAddress.region] The 2 letter code for US states or an ISO-3166-2 country subdivision code of up to three letters.\n * @property {string} [customer.billingAddress.postalCode] The zip code or equivalent for countries that have them.\n * @property {string} [customer.billingAddress.countryCodeAlpha2] The 2 character country code.\n * @property {string} [customer.billingAddress.phoneNumber] The phone number associated with the address. Only numbers; remove dashes, parenthesis and other characters.\n * @description **Deprecated** Optional customer information to be passed to 3DS 1.0 for verification.\n */\n\n /**\n * @typedef {object} ThreeDSecure~verifyPayload\n * @property {string} nonce The new payment method nonce produced by the 3D Secure lookup. The original nonce passed into {@link ThreeDSecure#verifyCard|verifyCard} was consumed. This new nonce should be used to transact on your server.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n * @property {boolean} liabilityShiftPossible *Deprecated:* Use `threeDSecureInfo.liabilityShiftPossible` instead.\n * @property {boolean} liabilityShifted *Deprecated:* Use `threeDSecureInfo.liabilityShifted` instead.\n * @property {object} threeDSecureInfo 3DS information about the card. Note: This information should be verified on the server by using the [payment method nonce find method](https://developers.braintreepayments.com/reference/request/payment-method-nonce/find). The values provided here are merely for convenience. Only values looked up on the server should determine the logic about how to process a transaction.\n * @property {boolean} threeDSecureInfo.liabilityShiftPossible Indicates whether the card was eligible for 3D Secure.\n * @property {boolean} threeDSecureInfo.liabilityShifted Indicates whether the liability for fraud has been shifted away from the merchant.\n * @property {string} threeDSecureInfo.cavv Cardholder authentication verification value or CAVV. The main encrypted message issuers and card networks use to verify authentication has occurred. Mastercard uses an AVV message and American Express uses an AEVV message, each of which should also be passed in the cavv parameter.\n * @property {string} threeDSecureInfo.xid Transaction identifier resulting from 3D Secure authentication. Uniquely identifies the transaction and sometimes required in the authorization message. This is a base64-encoded value. This field will no longer be used in 3D Secure 2 authentications for Visa and Mastercard, however it will be supported by American Express.\n * @property {string} threeDSecureInfo.dsTransactionId Transaction identifier resulting from 3D Secure 2 authentication.\n * @property {string} threeDSecureInfo.threeDSecureVersion The version of 3D Secure authentication used for the transaction.\n * @property {string} threeDSecureInfo.eciFlag The value of the electronic commerce indicator (ECI) flag, which indicates the outcome of the 3DS authentication. This will be a two-digit value.\n * @property {string} threeDSecureInfo.threeDSecureAuthenticationId ID of the 3D Secure authentication performed for this transaction. Do not provide this field as a transaction sale parameter if you are using the returned payment method nonce from the payload.\n * @property {object} rawCardinalSDKVerificationData The response back from the Cardinal SDK after verification has completed. See [Cardinal's Documentation](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects) for more information. If the customer was not required to do a 3D Secure challenge, this object will not be available.\n */\n\n /**\n * @typedef {string} ThreeDSecure~prepareLookupPayload The client data to pass on when doing a server side lookup call.\n */\n\n /**\n * @typedef {object} ThreeDSecure~verificationData\n * @property {boolean} requiresUserAuthentication When `true`, the user will be presented with a 3D Secure challenge when calling `next` in the {@link ThreeDSecure#event:lookup-complete|`lookup-complete` event}.\n * @property {object} threeDSecureInfo Contains liability shift details.\n * @property {boolean} threeDSecureInfo.liabilityShiftPossible Indicates whether the card was eligible for 3D Secure.\n * @property {boolean} threeDSecureInfo.liabilityShifted Indicates whether the liability for fraud has been shifted away from the merchant.\n * @property {object} paymentMethod A {@link ThreeDSecure~verifyPayload|verifyPayload} object.\n * @property {object} lookup Details about the 3D Secure lookup.\n * @property {string} lookup.threeDSecureVersion The version of 3D Secure that will be used for the 3D Secure challenge.\n */\n\n /**\n * @typedef {object} ThreeDSecure~billingAddress\n * @property {string} [givenName] The first name associated with the billing address. (maximum length 50)\n * @property {string} [surname] The last name associated with the billing address. (maximum length 50)\n * @property {string} [phoneNumber] The phone number associated with the billing address. Only numbers; remove dashes, parenthesis and other characters.\n * @property {string} [streetAddress] Line 1 of the billing address (eg. number, street, etc). (maximum length 50)\n * @property {string} [extendedAddress] Line 2 of the billing address (eg. suite, apt #, etc.). (maximum length 50)\n * @property {string} [line3] Line 3 of the billing address if needed (eg. suite, apt #, etc). (maximum length 50)\n * @property {string} [locality] The locality (city) name associated with the billing address.\n * @property {string} [region] The 2 letter code for US states or an ISO-3166-2 country subdivision code of up to three letters.\n * @property {string} [postalCode] The zip code or equivalent for countries that have them.\n * @property {string} [countryCodeAlpha2] The 2 character country code.\n */\n\n /**\n * @typedef {object} ThreeDSecure~additionalInformation\n * @property {string} [workPhoneNumber] The work phone number used for verification. Only numbers; remove dashes, parenthesis and other characters. (maximum length 25)\n * @property {string} [shippingGivenName] The first name associated with the shipping address. (maximum length 50)\n * @property {string} [shippingSurname] The last name associated with the shipping address. (maximum length 50)\n * @property {object} [shippingAddress]\n * @property {string} [shippingAddress.streetAddress] Line 1 of the shipping address (eg. number, street, etc). (maximum length 50)\n * @property {string} [shippingAddress.extendedAddress] Line 2 of the shipping address (eg. suite, apt #, etc.). (maximum length 50)\n * @property {string} [shippingAddress.line3] Line 3 of the shipping address if needed (eg. suite, apt #, etc). (maximum length 50)\n * @property {string} [shippingAddress.locality] The locality (city) name associated with the shipping address. (maximum length 50)\n * @property {string} [shippingAddress.region] The 2 letter code for US states or an ISO-3166-2 country subdivision code of up to three letters. (maximum length 50)\n * @property {string} [shippingAddress.postalCode] The zip code or equivalent for countries that have them. (maximum length 10)\n * @property {string} [shippingAddress.countryCodeAlpha2] The 2 character country code. (maximum length 2)\n * @property {string} [shippingPhone] The phone number associated with the shipping address. Only numbers; remove dashes, parenthesis and other characters. (maximum length 20)\n * @property {string} [shippingMethod] The 2-digit string indicating the name of the shipping method chosen for the transaction. (maximum length 50) Possible values:\n * - `01` Same Day\n * - `02` Overnight / Expedited\n * - `03` Priority (2-3 Days)\n * - `04` Ground\n * - `05` Electronic Delivery\n * - `06` Ship to Store\n * @property {string} [shippingMethodIndicator] The 2-digit string indicating the shipping method chosen for the transaction Possible values.\n * - `01` Ship to cardholder billing address\n * - `02` Ship to another verified address on file with merchant\n * - `03` Ship to address that is different from billing address\n * - `04` Ship to store (store address should be populated on request)\n * - `05` Digital goods\n * - `06` Travel and event tickets, not shipped\n * - `07` Other\n * @property {string} [productCode] The 3-letter string representing the merchant product code. Possible values:\n * - `AIR` Airline\n * - `GEN` General Retail\n * - `DIG` Digital Goods\n * - `SVC` Services\n * - `RES` Restaurant\n * - `TRA` Travel\n * - `DSP` Cash Dispensing\n * - `REN` Car Rental\n * - `GAS` Fuel\n * - `LUX` Luxury Retail\n * - `ACC` Accommodation Retail\n * - `TBD` Other\n * @property {string} [deliveryTimeframe] The 2-digit number indicating the delivery time frame. Possible values:\n * - `01` Electronic delivery\n * - `02` Same day shipping\n * - `03` Overnight shipping\n * - `04` Two or more day shipping\n * @property {string} [deliveryEmail] For electronic delivery, email address to which the merchandise was delivered. (maximum length 254)\n * @property {string} [reorderindicator] The 2-digit number indicating whether the cardholder is reordering previously purchased merchandise. possible values:\n * - `01` First time ordered\n * - `02` Reordered\n * @property {string} [preorderIndicator] The 2-digit number indicating whether cardholder is placing an order with a future availability or release date. possible values:\n * - `01` Merchandise available\n * - `02` Future availability\n * @property {string} [preorderDate] The 8-digit number (format: YYYYMMDD) indicating expected date that a pre-ordered purchase will be available.\n * @property {string} [giftCardAmount] The purchase amount total for prepaid gift cards in major units. (maximum length 15)\n * @property {string} [giftCardCurrencyCode] ISO 4217 currency code for the gift card purchased. (maximum length 3)\n * @property {string} [giftCardCount] Total count of individual prepaid gift cards purchased. (maximum length 2)\n * @property {string} [accountAgeIndicator] The 2-digit value representing the length of time cardholder has had account. Possible values:\n * - `01` No Account\n * - `02` Created during transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [accountCreateDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder opened the account.\n * @property {string} [accountChangeIndicator] The 2-digit value representing the length of time since the last change to the cardholder account. This includes shipping address, new payment account or new user added. Possible values:\n * - `01` Changed during transaction\n * - `02` Less than 30 days\n * - `03` 30-60 days\n * - `04` More than 60 days\n * @property {string} [accountChangeDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder's account was last changed. This includes changes to the billing or shipping address, new payment accounts or new users added.\n * @property {string} [accountPwdChangeIndicator] The 2-digit value representing the length of time since the cardholder changed or reset the password on the account. Possible values:\n * - `01` No change\n * - `02` Changed during transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [accountPwdChangeDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder last changed or reset password on account.\n * @property {string} [shippingAddressUsageIndicator] The 2-digit value indicating when the shipping address used for transaction was first used. Possible values:\n * - `01` This transaction\n * - `02` Less than 30 days\n * - `03` 30-60 days\n * - `04` More than 60 days\n * @property {string} [shippingAddressUsageDate] The 8-digit number (format: YYYYMMDD) indicating the date when the shipping address used for this transaction was first used.\n * @property {string} [transactionCountDay] Number of transactions (successful or abandoned) for this cardholder account within the last 24 hours. (maximum length 3)\n * @property {string} [transactionCountYear] Number of transactions (successful or abandoned) for this cardholder account within the last year. (maximum length 3)\n * @property {string} [addCardAttempts] Number of add card attempts in the last 24 hours. (maximum length 3)\n * @property {string} [accountPurchases] Number of purchases with this cardholder account during the previous six months.\n * @property {string} [fraudActivity] The 2-digit value indicating whether the merchant experienced suspicious activity (including previous fraud) on the account. Possible values:\n * - `01` No suspicious activity\n * - `02` Suspicious activity observed\n * @property {string} [shippingNameIndicator] The 2-digit value indicating if the cardholder name on the account is identical to the shipping name used for the transaction. Possible values:\n * - `01` Account and shipping name identical\n * - `02` Account and shipping name differ\n * @property {string} [paymentAccountIndicator] The 2-digit value indicating the length of time that the payment account was enrolled in the merchant account. Possible values:\n * - `01` No account (guest checkout)\n * - `02` During the transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [paymentAccountAge] The 8-digit number (format: YYYYMMDD) indicating the date the payment account was added to the cardholder account.\n * @property {string} [acsWindowSize] The 2-digit number to set the challenge window size to display to the end cardholder. The ACS will reply with content that is formatted appropriately to this window size to allow for the best user experience. The sizes are width x height in pixels of the window displayed in the cardholder browser window. Possible values:\n * - `01` 250x400\n * - `02` 390x400\n * - `03` 500x600\n * - `04` 600x400\n * - `05` Full page\n * @property {string} [sdkMaxTimeout] The 2-digit number of minutes (minimum 05) to set the maximum amount of time for all 3DS 2.0 messages to be communicated between all components.\n * @property {string} [addressMatch] The 1-character value (Y/N) indicating whether cardholder billing and shipping addresses match.\n * @property {string} [accountId] Additional cardholder account information. (maximum length 64)\n * @property {string} [ipAddress] The IP address of the consumer. IPv4 and IPv6 are supported.\n * @property {string} [orderDescription] Brief description of items purchased. (maximum length 256)\n * @property {string} [taxAmount] Unformatted tax amount without any decimalization (ie. $123.67 = 12367). (maximum length 20)\n * @property {string} [userAgent] The exact content of the HTTP user agent header. (maximum length 500)\n * @property {string} [authenticationIndicator] The 2-digit number indicating the type of authentication request. Possible values:\n * - `02` Recurring\n * - `03` Installment\n * @property {string} [installment] An integer value greater than 1 indicating the maximum number of permitted authorizations for installment payments. (maximum length 3)\n * @property {string} [purchaseDate] The 14-digit number (format: YYYYMMDDHHMMSS) indicating the date in UTC of original purchase.\n * @property {string} [recurringEnd] The 8-digit number (format: YYYYMMDD) indicating the date after which no further recurring authorizations should be performed.\n * @property {string} [recurringFrequency] Integer value indicating the minimum number of days between recurring authorizations. A frequency of monthly is indicated by the value 28. Multiple of 28 days will be used to indicate months (ex. 6 months = 168). (maximum length 3)\n */\n\n /**\n * @name ThreeDSecure#on\n * @function\n * @param {string} event The name of the event to which you are subscribing.\n * @param {function} handler A callback to handle the event.\n * @description Subscribes a handler function to a named event. The following events are available:\n * * {@link ThreeDSecure#event:lookup-complete|lookup-complete}\n * * {@link ThreeDSecure#event:customer-canceled|customer-canceled}\n * * {@link ThreeDSecure#event:authentication-iframe-available|authentication-iframe-available}\n * * {@link ThreeDSecure#event:authentication-modal-render|authentication-modal-render}\n * * {@link ThreeDSecure#event:authentication-modal-close|authentication-modal-close}\n * @example\n *
Listening to a 3D Secure event\n * braintree.threeDSecure.create({ ... }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('lookup-complete', function (data, next) {\n * console.log('data from the lookup', data);\n * next();\n * });\n * threeDSecureInstance.on('customer-canceled', function () {\n * console.log('log that the customer canceled');\n * });\n * });\n * @returns {void}\n */\n\n /**\n * @name ThreeDSecure#off\n * @function\n * @param {string} event The name of the event to which you are unsubscribing.\n * @param {function} handler The callback for the event you are unsubscribing from.\n * @description Unsubscribes the handler function to a named event.\n * @example\n *
Subscribing and then unsubscribing from a 3D Secure eld event\n * braintree.threeDSecure.create({ ... }, function (createErr, threeDSecureInstance) {\n * var lookupCallback = function (data, next) {\n * console.log(data);\n * next();\n * };\n * var cancelCallback = function () {\n * // log the cancelation\n * // or update UI\n * };\n *\n * threeDSecureInstance.on('lookup-complete', lookupCallback);\n * threeDSecureInstance.on('customer-canceled', cancelCallback);\n *\n * // later on\n * threeDSecureInstance.off('lookup-complete', lookupCallback);\n * threeDSecureInstance.off('customer-canceled', cancelCallback);\n * });\n * @returns {void}\n */\n\n /**\n * This event is emitted when the `2-inline-iframe` version is specified when creating the 3D Secure instance and the authentication iframe becomes available.\n * @event ThreeDSecure#authentication-iframe-available\n * @example\n *
Listening for the authentication iframe to be available\n * threeDSecureInstance.on('authentication-iframe-available', function (event, next) {\n * document.body.appendChild(event.element); // add iframe element to page\n *\n * next(); // let the SDK know the iframe is ready\n * });\n * });\n */\n\n /**\n * This event is emitted when using the 3D Secure 2.0 flow and the initial lookup request completes. If this is not used, a `onLookupComplete` callback must be passed into the `verifyCard` method.\n * @event ThreeDSecure#lookup-complete\n * @example\n *
Listening for when the lookup request is complete\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('lookup-complete', function (data, next) {\n * // inspect the data\n *\n * // call next when ready to proceed with the challenge\n * next();\n * });\n * });\n */\n\n /**\n * This event is emitted when using the 3D Secure 2.0 flow and the customer cancels the 3D Secure challenge.\n * @event ThreeDSecure#customer-canceled\n * @example\n *
Listening for when the customer cancels the 3D Secure challenge\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('customer-canceled', function () {\n * // the customer canceled the 3D Secure challenge\n * });\n * });\n */\n\n /**\n * This event is emitted when using the 3D Secure 2.0 flow and the authentication modal closes, either because the authentication was completed or because the customer canceled the process.\n * @event ThreeDSecure#authentication-modal-close\n * @example\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('authentication-modal-close', function () {\n * // the modal was closed\n * });\n * });\n */\n\n /**\n * This event is emitted when using the 3D Secure 2.0 flow and the authentication modal is rendered.\n * @event ThreeDSecure#authentication-modal-render\n * @example\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('authentication-modal-render', function () {\n * // the modal was rendered, presenting the authentication form to the customer\n * });\n * });\n */\n\n /**\n * @class\n * @param {object} options 3D Secure {@link module:braintree-web/three-d-secure.create create} options\n * @description
Do not use this constructor directly. Use {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create} instead.\n * @classdesc This class represents a ThreeDSecure component produced by {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create}. Instances of this class have a method for launching a 3D Secure authentication flow.\n *\n * **Note**: 3D Secure 2.0 is documented below and will become the default integration method in a future version of Braintree-web. Until then, version 1.0 will continue to be supported. To view 3D Secure 1.0 documentation, look at Braintree-web documentation from version [3.40.0](https://braintree.github.io/braintree-web/3.40.0/ThreeDSecure.html) and earlier, or upgrade your integration by referring to the [3D Secure 2.0 adoption guide](https://developers.braintreepayments.com/guides/3d-secure/migration/javascript/v3).\n */\n\n\n function ThreeDSecure(options) {\n var self = this;\n var Framework = FRAMEWORKS[options.framework];\n EventEmitter.call(this);\n this._framework = new Framework(options);\n\n this._framework.setUpEventListeners(function () {\n self._emit.apply(self, arguments);\n });\n }\n\n EventEmitter.createChild(ThreeDSecure);\n /**\n * Launch the 3D Secure login flow, returning a nonce payload.\n *\n * @public\n * @param {object} options Options for card verification.\n * @param {string} options.nonce The nonce representing the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.nonce`.\n * @param {string} options.bin The numeric Bank Identification Number (bin) of the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.details.bin`.\n * @param {string} options.amount The amount of the transaction in the current merchant account's currency. This must be expressed in numbers with an optional decimal (using `.`) and precision up to the hundredths place. For example, if you're processing a transaction for 1.234,56 € then `amount` should be `1234.56`.\n * @param {string} [options.accountType] The account type for the card (if known). Accepted values: `credit` or `debit`.\n * @param {boolean} [options.challengeRequested] If set to true, an authentication challenge will be forced if possible.\n * @param {boolean} [options.exemptionRequested] If set to true, an exemption to the authentication challenge will be requested.\n * @param {function} [options.onLookupComplete] *Deprecated:* Use {@link ThreeDSecure#event:lookup-complete|`threeDSecureInstance.on('lookup-complete')`} instead. Function to execute when lookup completes. The first argument, `data`, is a {@link ThreeDSecure~verificationData|verificationData} object, and the second argument, `next`, is a callback. `next` must be called to continue.\n * @param {string} [options.email] The email used for verification. (maximum length 255)\n * @param {string} [options.mobilePhoneNumber] The mobile phone number used for verification. Only numbers; remove dashes, parenthesis and other characters. (maximum length 25)\n * @param {object} [options.billingAddress] An {@link ThreeDSecure~billingAddress|billingAddress} object for verification.\n * @param {object} [options.additionalInformation] An {@link ThreeDSecure~additionalInformation|additionalInformation} object for verification.\n * @param {object} [options.customer] **Deprecated** Customer information for use in 3DS 1.0 verifications. Can contain any subset of a {@link ThreeDSecure~verifyCardCustomerObject|verifyCardCustomerObject}. Only to be used for 3DS 1.0 integrations.\n * @param {callback} options.addFrame **Deprecated** This {@link ThreeDSecure~addFrameCallback|addFrameCallback} will be called when the bank frame needs to be added to your page. Only to be used for 3DS 1.0 integrations.\n * @param {callback} options.removeFrame **Deprecated** For use in 3DS 1.0 Flows. This {@link ThreeDSecure~removeFrameCallback|removeFrameCallback} will be called when the bank frame needs to be removed from your page. Only to be used in 3DS 1.0 integrations.\n * @param {callback} [callback] The second argument,
data
, is a {@link ThreeDSecure~verifyPayload|verifyPayload}. If no callback is provided, it will return a promise that resolves {@link ThreeDSecure~verifyPayload|verifyPayload}.\n \n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n *
Verifying a payment method nonce with 3DS 2.0\n * var my3DSContainer;\n *\n * // set up listener after initialization\n * threeDSecure.on(('lookup-complete', function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * });\n *\n * // call verifyCard after tokenizing a card\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com'\n * billingAddress: {\n * givenName: 'Jill',\n * surname: 'Doe',\n * phoneNumber: '8101234567',\n * streetAddress: '555 Smith St.',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * },\n * additionalInformation: {\n * workPhoneNumber: '5555555555',\n * shippingGivenName: 'Jill',\n * shippingSurname: 'Doe',\n * shippingAddress: {\n * streetAddress: '555 Smith st',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * }\n * shippingPhone: '8101234567'\n * }\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n *
Verifying a payment method nonce with 3DS 2.0 with onLookupComplete callback\n * var my3DSContainer;\n *\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com'\n * billingAddress: {\n * givenName: 'Jill',\n * surname: 'Doe',\n * phoneNumber: '8101234567',\n * streetAddress: '555 Smith St.',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * },\n * additionalInformation: {\n * workPhoneNumber: '5555555555',\n * shippingGivenName: 'Jill',\n * shippingSurname: 'Doe',\n * shippingAddress: {\n * streetAddress: '555 Smith st',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * }\n * shippingPhone: '8101234567'\n * },\n * onLookupComplete: function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * }\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n * @example\n *
Handling 3DS lookup errors\n * var my3DSContainer;\n *\n * // set up listener after initialization\n * threeDSecure.on(('lookup-complete', function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * });\n *\n * // call verifyCard after tokenizing a card\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com',\n * billingAddress: billingAddressFromCustomer,\n * additionalInformation: additionalInfoFromCustomer\n * }, function (err, payload) {\n * if (err) {\n * if (err.code.indexOf('THREEDS_LOOKUP') === 0) {\n * // an error occurred during the initial lookup request\n *\n * if (err.code === 'THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR') {\n * // either the passed payment method nonce does not exist\n * // or it was already consumed before the lookup call was made\n * } else if (err.code.indexOf('THREEDS_LOOKUP_VALIDATION') === 0) {\n * // a validation error occurred\n * // likely some non-ascii characters were included in the billing\n * // address given name or surname fields, or the cardholdername field\n *\n * // Instruct your user to check their data and try again\n * } else {\n * // an unknown lookup error occurred\n * }\n * } else {\n * // some other kind of error\n * }\n * return;\n * }\n *\n * // handle success\n * });\n * @example\n *
Deprecated: Verifying an existing nonce with 3DS 1.0\n * var my3DSContainer;\n *\n * threeDSecure.verifyCard({\n * nonce: existingNonce,\n * amount: 123.45,\n * addFrame: function (err, iframe) {\n * // Set up your UI and add the iframe.\n * my3DSContainer = document.createElement('div');\n * my3DSContainer.appendChild(iframe);\n * document.body.appendChild(my3DSContainer);\n * },\n * removeFrame: function () {\n * // Remove UI that you added in addFrame.\n * document.body.removeChild(my3DSContainer);\n * }\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n */\n\n ThreeDSecure.prototype.verifyCard = function (options) {\n var privateOptions;\n\n if (this.hasListener('lookup-complete')) {\n privateOptions = {\n ignoreOnLookupCompleteRequirement: true\n };\n }\n\n return this._framework.verifyCard(options, privateOptions);\n };\n /* eslint-disable-next-line valid-jsdoc */\n\n /**\n * Launch the iframe challenge using a 3D Secure lookup response from a server side lookup.\n *\n * @public\n * @param {(object|string)} lookupResponse The lookup response from the server side call to lookup the 3D Secure information. The raw string or a parsed object can be passed.\n * @returns {Promise} Returns a promise.\n * @example\n * var my3DSContainer;\n *\n * threeDSecure.initializeChallengeWithLookupResponse(lookupResponseFromServer).then(function (payload) {\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n */\n\n\n ThreeDSecure.prototype.initializeChallengeWithLookupResponse = function (lookupResponse) {\n if (typeof lookupResponse === 'string') {\n lookupResponse = JSON.parse(lookupResponse);\n }\n\n return this._framework.initializeChallengeWithLookupResponse(lookupResponse);\n };\n /**\n * Gather the data needed for a 3D Secure lookup call.\n *\n * @public\n * @param {object} options Options for 3D Secure lookup.\n * @param {string} options.nonce The nonce representing the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.nonce`.\n * @param {string} [options.bin] The numeric Bank Identification Number (bin) of the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.details.bin`. Though not required to start the verification, it is required to receive a 3DS 2.0 lookup response.\n * @param {callback} [callback] The second argument,
data
, is a {@link ThreeDSecure~prepareLookupPayload|prepareLookupPayload}. If no callback is provided, it will return a promise that resolves {@link ThreeDSecure~prepareLookupPayload|prepareLookupPayload}.\n \n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n *
Preparing data for a 3D Secure lookup\n * threeDSecure.prepareLookup({\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * // send payload to server to do server side lookup\n * });\n */\n\n\n ThreeDSecure.prototype.prepareLookup = function (options) {\n return this._framework.prepareLookup(options).then(function (data) {\n return JSON.stringify(data);\n });\n };\n /**\n * Cancel the 3DS flow and return the verification payload if available. If using 3D Secure version 2, this will not close the UI of the authentication modal. It is recommended that this method only be used in the {@link ThreeDSecure#event:lookup-complete|`lookup-complete`} event or the `onLookupComplete` callback.\n * @public\n * @param {callback} [callback] The second argument is a {@link ThreeDSecure~verifyPayload|verifyPayload}. If there is no verifyPayload (the initial lookup did not complete), an error will be returned. If no callback is passed, `cancelVerifyCard` will return a promise.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example
Cancel the verification in `lookup-complete` event\n * // set up listener after instantiation\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // determine if you want to call next to start the challenge,\n * // if not, call cancelVerifyCard\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n * });\n *\n * // after tokenizing a credit card\n * threeDSecure.verifyCard({\n * amount: '100.00',\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload\n * // other fields such as billing address\n * }, function (verifyError, payload) {\n * if (verifyError) {\n * if (verifyError.code === 'THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT ') {\n * // flow was canceled by merchant, 3ds info can be found in the payload\n * // for cancelVerifyCard\n * }\n * }\n * });\n * @example
Cancel the verification in onLookupComplete callback\n * threeDSecure.verifyCard({\n * amount: '100.00',\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload,\n * // other fields such as billing address\n * onLookupComplete: function (data, next) {\n * // determine if you want to call next to start the challenge,\n * // if not, call cancelVerifyCard\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n * }\n * }, function (verifyError, payload) {\n * if (verifyError) {\n * if (verifyError.code === 'THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT ') {\n * // flow was canceled by merchant, 3ds info can be found in the payload\n * // for cancelVerifyCard\n * }\n * }\n * });\n * @example
Cancel the verification in 3D Secure version 1\n * // unlike with v2, this will not cause `verifyCard` to error, it will simply\n * // never call the callback\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n */\n\n\n ThreeDSecure.prototype.cancelVerifyCard = function () {\n return this._framework.cancelVerifyCard();\n };\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/three-d-secure.create|create}.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is passed, `teardown` will return a promise.\n * @example\n * threeDSecure.teardown();\n * @example
With callback\n * threeDSecure.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n ThreeDSecure.prototype.teardown = function () {\n var methodNames = methods(ThreeDSecure.prototype).concat(methods(EventEmitter.prototype));\n convertMethodsToError(this, methodNames);\n return this._framework.teardown();\n };\n\n module.exports = wrapPromise.wrapPrototype(ThreeDSecure);\n }, {\n \"../../lib/convert-methods-to-error\": 129,\n \"../../lib/methods\": 157,\n \"./frameworks\": 189,\n \"@braintree/event-emitter\": 34,\n \"@braintree/wrap-promise\": 44\n }],\n 194: [function (_dereq_, module, exports) {\n 'use strict';\n /** @module braintree-web/three-d-secure */\n\n var ThreeDSecure = _dereq_('./external/three-d-secure');\n\n var isHTTPS = _dereq_('../lib/is-https').isHTTPS;\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var analytics = _dereq_('../lib/analytics');\n\n var errors = _dereq_('./shared/errors');\n\n var VERSION = \"3.76.1\";\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {object} [options.cardinalSDKConfig] A config for the underlying Cardinal SDK.\n * @param {object} [options.cardinalSDKConfig.logging] The logging configuration for the Cardinal SDK. See [Cardinal's documentation for the logging object](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-Logging) for more information.\n * @param {number} [options.cardinalSDKConfig.timeout] The time in milliseconds to wait before a request to Cardinal's API times out. See [Cardinal's documentation for root level configuration](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-RootLevelConfiguration) for more information.\n * @param {number} [options.cardinalSDKConfig.maxRequestRetries] How many times a request should be re-attempted to Cardinal's API before giving up as a failure. See [Cardinal's documentation for root level configuration](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-RootLevelConfiguration) for more information.\n * @param {object} [options.cardinalSDKConfig.payment] An object to describe how you want the user interactions to behave. Only a subset of the [Cardinal SDK payment configuration object](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-Payment) are supported: `displayLoading` and `displayExitButton`.\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {(number|string)} [options.version=1] The version of 3D Secure to use. Possible options:\n * * 1 - The legacy 3D Secure v1.0 integration.\n * * 2 - A 3D Secure v2.0 integration that uses a modal to host the 3D Secure iframe.\n * * 2-bootstrap3-modal - A 3D Secure v2.0 integration that uses a modal styled with Bootstrap 3 styles to host the 3D Secure iframe. Requires having the Bootstrap 3 script files and stylesheets on your page.\n * * 2-inline-iframe - A 3D Secure v2.0 integration that provides the authentication iframe directly to the merchant.\n * @param {callback} [callback] The second argument, `data`, is the {@link ThreeDSecure} instance. If no callback is provided, it returns a promise that resolves the {@link ThreeDSecure} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n @example\n *
Creating a v2 3D Secure component using 2 version (Cardinal modal)\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n * @example\n *
Creating a v2 3D Secure component using 2-bootstrap3-modal version\n * // must have the boostrap js, css and jquery files on your page\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2-bootstrap3-modal'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * // challenge will be presented in a bootstrap 3 modal\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n * @example\n *
Creating a v2 3D Secure component using 2-inline-iframe version\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2-inline-iframe'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n * // set up iframe listener\n * threeDSecure.on('authentication-iframe-available', function (event, next) {\n * var element = event.element; // an html element that contains the iframe\n *\n * document.body.appendChild(element); // put it on your page\n *\n * next(); // let the sdk know the element has been added to the page\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n */\n\n\n function create(options) {\n var name = '3D Secure';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n var assetsUrl = createAssetsUrl.create(options.authorization);\n var framework = getFramework(options);\n var createPromise = createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: assetsUrl,\n name: name\n }).then(function (client) {\n var error, isProduction;\n var config = client.getConfiguration();\n var gwConfig = config.gatewayConfiguration;\n options.client = client;\n\n if (!gwConfig.threeDSecureEnabled) {\n error = errors.THREEDS_NOT_ENABLED;\n }\n\n if (config.authorizationType === 'TOKENIZATION_KEY') {\n error = errors.THREEDS_CAN_NOT_USE_TOKENIZATION_KEY;\n }\n\n isProduction = gwConfig.environment === 'production';\n\n if (isProduction && !isHTTPS()) {\n error = errors.THREEDS_HTTPS_REQUIRED;\n }\n\n if (framework !== 'legacy' && !(gwConfig.threeDSecure && gwConfig.threeDSecure.cardinalAuthenticationJWT)) {\n analytics.sendEvent(options.client, 'three-d-secure.initialization.failed.missing-cardinalAuthenticationJWT');\n error = errors.THREEDS_NOT_ENABLED_FOR_V2;\n }\n\n if (error) {\n return Promise.reject(new BraintreeError(error));\n }\n\n analytics.sendEvent(options.client, 'three-d-secure.initialized');\n return client;\n });\n var instance = new ThreeDSecure({\n client: options.client,\n assetsUrl: assetsUrl,\n createPromise: createPromise,\n loggingEnabled: options.loggingEnabled,\n cardinalSDKConfig: options.cardinalSDKConfig,\n framework: framework\n });\n\n if (options.client) {\n return createPromise.then(function () {\n return instance;\n });\n }\n\n return instance;\n });\n }\n\n function getFramework(options) {\n var version = String(options.version || '');\n\n if (!version || version === '1') {\n return 'legacy';\n }\n\n switch (version) {\n case '2':\n case '2-cardinal-modal':\n return 'cardinal-modal';\n\n case '2-bootstrap3-modal':\n return 'bootstrap3-modal';\n\n case '2-inline-iframe':\n return 'inline-iframe';\n\n default:\n throw new BraintreeError({\n code: errors.THREEDS_UNRECOGNIZED_VERSION.code,\n type: errors.THREEDS_UNRECOGNIZED_VERSION.type,\n message: 'Version `' + options.version + '` is not a recognized version. You may need to update the version of your Braintree SDK to support this version.'\n });\n }\n }\n\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 121,\n \"../lib/basic-component-verification\": 124,\n \"../lib/braintree-error\": 126,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/is-https\": 154,\n \"../lib/promise\": 159,\n \"./external/three-d-secure\": 193,\n \"./shared/errors\": 196,\n \"@braintree/wrap-promise\": 44\n }],\n 195: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n LANDING_FRAME_NAME: 'braintreethreedsecurelanding',\n CARDINAL_SCRIPT_SOURCE: {\n production: 'https://songbird.cardinalcommerce.com/edge/v1/songbird.js',\n sandbox: 'https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js'\n }\n };\n }, {}],\n 196: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.3D Secure - Creation Error Codes\n * @description Errors that occur when [creating the 3D Secure component](./module-braintree-web_three-d-secure.html#.create).\n * @property {MERCHANT} THREEDS_NOT_ENABLED Occurs when 3D Secure is not enabled in the Braintree control panel.\n * @property {MERCHANT} THREEDS_CAN_NOT_USE_TOKENIZATION_KEY Occurs when 3D Secure component is created without a Client Token.\n * @property {MERCHANT} THREEDS_HTTPS_REQUIRED Occurs when 3D Secure component is created in production over HTTPS.\n * @property {MERCHANT} THREEDS_NOT_ENABLED_FOR_V2 Occurs when 3D Secure component is created with version 2 parameter, but merchant is not enabled to use version 2.\n * @property {MERCHANT} THREEDS_UNRECOGNIZED_VERSION Occurs when unrecognized version enum is passed into the create call.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_SETUP_FAILED Occurs when Cardinal's Songbird.js library fails to setup for an unknown reason.\n * @property {NETWORK} THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED Occurs when using version 2 and Cardinal's Songbird.js script could not be loaded.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT Occurs when Cardinal's Songbird.js library takes longer than 60 seconds to set up.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT Occurs when Cardinal sends a response indicating a timeout on /Validate, /Confirm, or /Continue.\n * @property {MERCHANT} THREEDS_CARDINAL_SDK_BAD_CONFIG Occurs when there is no JWT in the request. Also when there's some other malformed aspect of config.\n * @property {MERCHANT} THREEDS_CARDINAL_SDK_BAD_JWT Occurs when a malformed config causes a either a missing response JWT or a malformed Cardinal response.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_ERROR Occurs when a \"general error\" or a Cardinal hosted fields error happens. Description contains more details.\n * @property {CUSTOMER} THREEDS_CARDINAL_SDK_CANCELED Occurs when customer cancels the transaction mid-flow, usually with alt-pays that have their own cancel buttons.\n */\n\n /**\n * @name BraintreeError.3D Secure - verifyCard Error Codes\n * @description Errors that occur when using the [`verifyCard` method](./ThreeDSecure.html#verifyCard).\n * @property {MERCHANT} THREEDS_AUTHENTICATION_IN_PROGRESS Occurs when another verification is already in progress.\n * @property {MERCHANT} THREEDS_MISSING_VERIFY_CARD_OPTION Occurs when a required option is missing.\n * @property {UNKNOWN} THREEDS_JWT_AUTHENTICATION_FAILED Occurs when something went wrong authenticating the JWT from the Cardinal SDK.\n * @property {MERCHANT} THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR Occurs when the supplied payment method nonce does not exist or the payment method nonce has already been consumed.\n * @property {CUSTOMER} THREEDS_LOOKUP_VALIDATION_ERROR Occurs when a validation error occurs during the 3D Secure lookup.\n * @property {UNKNOWN} THREEDS_LOOKUP_ERROR An unknown error occurred while attempting the 3D Secure lookup.\n * @property {MERCHANT} THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT Occurs when the 3D Secure flow is canceled by the merchant using `cancelVerifyCard` (3D Secure v2 flows only).\n * @property {UNKNOWN} THREEDS_INLINE_IFRAME_DETAILS_INCORRECT An unknown error occurred while attempting to use the inline iframe framework.\n */\n\n /**\n * @name BraintreeError.3D Secure - cancelVerifyCard Error Codes\n * @description Errors that occur when using the [`cancelVerifyCard` method](./ThreeDSecure.html#cancelVerifyCard).\n * @property {MERCHANT} THREEDS_NO_VERIFICATION_PAYLOAD Occurs when the 3D Secure flow is canceled, but there is no 3D Secure information available.\n */\n\n /**\n * @name BraintreeError.3D Secure - Internal Error Codes\n * @ignore\n * @description Errors that occur internally\n * @property {INTERNAL} THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN Occurs when iframe is initialized on a non-verified domain.\n * @property {INTERNAL} THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED Occurs when a 3D Secure framework method is not implemented.\n */\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n module.exports = {\n THREEDS_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_NOT_ENABLED',\n message: '3D Secure is not enabled for this merchant.'\n },\n THREEDS_CAN_NOT_USE_TOKENIZATION_KEY: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_CAN_NOT_USE_TOKENIZATION_KEY',\n message: '3D Secure can not use a tokenization key for authorization.'\n },\n THREEDS_HTTPS_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_HTTPS_REQUIRED',\n message: '3D Secure requires HTTPS.'\n },\n THREEDS_NOT_ENABLED_FOR_V2: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_NOT_ENABLED_FOR_V2',\n message: '3D Secure version 2 is not enabled for this merchant. Contact Braintree Support for assistance at https://help.braintreepayments.com/'\n },\n THREEDS_UNRECOGNIZED_VERSION: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_UNRECOGNIZED_VERSION'\n },\n THREEDS_CARDINAL_SDK_SETUP_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: 'THREEDS_CARDINAL_SDK_SETUP_FAILED',\n message: 'Something went wrong setting up Cardinal\\'s Songbird.js library.'\n },\n THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED',\n message: 'Cardinal\\'s Songbird.js library could not be loaded.'\n },\n THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT: {\n type: BraintreeError.types.UNKNOWN,\n code: 'THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT',\n message: 'Cardinal\\'s Songbird.js took too long to setup.'\n },\n THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT: {\n type: BraintreeError.types.UNKNOWN,\n code: 'THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT',\n message: 'Cardinal\\'s API took too long to respond.'\n },\n THREEDS_CARDINAL_SDK_BAD_CONFIG: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_CARDINAL_SDK_BAD_CONFIG',\n message: 'JWT or other required field missing. Please check your setup configuration.'\n },\n THREEDS_CARDINAL_SDK_BAD_JWT: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_CARDINAL_SDK_BAD_JWT',\n message: 'Cardinal JWT missing or malformed. Please check your setup configuration.'\n },\n THREEDS_CARDINAL_SDK_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: 'THREEDS_CARDINAL_SDK_ERROR',\n message: 'A general error has occurred with Cardinal. See description for more information.'\n },\n THREEDS_CARDINAL_SDK_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'THREEDS_CARDINAL_SDK_CANCELED',\n message: 'Canceled by user.'\n },\n THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT',\n message: '3D Secure verfication canceled by merchant.'\n },\n THREEDS_AUTHENTICATION_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_AUTHENTICATION_IN_PROGRESS',\n message: 'Cannot call verifyCard while existing authentication is in progress.'\n },\n THREEDS_MISSING_VERIFY_CARD_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_MISSING_VERIFY_CARD_OPTION'\n },\n THREEDS_JWT_AUTHENTICATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: 'THREEDS_JWT_AUTHENTICATION_FAILED',\n message: 'Something went wrong authenticating the JWT from Cardinal'\n },\n THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR',\n message: 'Either the payment method nonce passed to `verifyCard` does not exist, or it was already consumed'\n },\n THREEDS_LOOKUP_VALIDATION_ERROR: {\n type: BraintreeError.types.CUSTOMER,\n code: 'THREEDS_LOOKUP_VALIDATION_ERROR',\n message: 'The data passed in `verifyCard` did not pass validation checks. See details for more info'\n },\n THREEDS_LOOKUP_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: 'THREEDS_LOOKUP_ERROR',\n message: 'Something went wrong during the 3D Secure lookup'\n },\n THREEDS_INLINE_IFRAME_DETAILS_INCORRECT: {\n type: BraintreeError.types.UNKNOWN,\n code: 'THREEDS_INLINE_IFRAME_DETAILS_INCORRECT',\n message: 'Something went wrong when attempting to add the authentication iframe to the page.'\n },\n THREEDS_NO_VERIFICATION_PAYLOAD: {\n type: BraintreeError.types.MERCHANT,\n code: 'THREEDS_NO_VERIFICATION_PAYLOAD',\n message: 'No verification payload available.'\n },\n THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN: {\n type: BraintreeError.types.INTERNAL,\n code: 'THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN',\n message: 'Term Url must be on a Braintree domain.'\n },\n THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED: {\n type: BraintreeError.types.INTERNAL,\n code: 'THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED',\n message: 'Method not implemented for this framework.'\n }\n };\n }, {\n \"../../lib/braintree-error\": 126\n }],\n 197: [function (_dereq_, module, exports) {\n 'use strict';\n\n var enumerate = _dereq_('../../lib/enumerate');\n\n module.exports = enumerate(['AUTHENTICATION_COMPLETE'], 'threedsecure:');\n }, {\n \"../../lib/enumerate\": 136\n }],\n 198: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @module braintree-web/unionpay\n * @description This module allows you to accept UnionPay payments. *It is currently in beta and is subject to change.*\n */\n\n var UnionPay = _dereq_('./shared/unionpay');\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var analytics = _dereq_('../lib/analytics');\n\n var errors = _dereq_('./shared/errors');\n\n var VERSION = \"3.76.1\";\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link UnionPay} instance. If no callback is provided, `create` returns a promise that resolves with the {@link UnionPay} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * braintree.unionpay.create({ client: clientInstance }, function (createErr, unionpayInstance) {\n * if (createErr) {\n * console.error(createErr);\n * return;\n * }\n * // ...\n * });\n */\n\n\n function create(options) {\n var name = 'UnionPay';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var config = client.getConfiguration();\n options.client = client;\n\n if (!config.gatewayConfiguration.unionPay || config.gatewayConfiguration.unionPay.enabled !== true) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_NOT_ENABLED));\n }\n\n analytics.sendEvent(options.client, 'unionpay.initialized');\n return new UnionPay(options);\n });\n }\n\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 121,\n \"../lib/basic-component-verification\": 124,\n \"../lib/braintree-error\": 126,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/promise\": 159,\n \"./shared/errors\": 200,\n \"./shared/unionpay\": 201,\n \"@braintree/wrap-promise\": 44\n }],\n 199: [function (_dereq_, module, exports) {\n 'use strict';\n\n var enumerate = _dereq_('../../lib/enumerate');\n\n module.exports = {\n events: enumerate(['HOSTED_FIELDS_FETCH_CAPABILITIES', 'HOSTED_FIELDS_ENROLL', 'HOSTED_FIELDS_TOKENIZE'], 'union-pay:'),\n HOSTED_FIELDS_FRAME_NAME: 'braintreeunionpayhostedfields'\n };\n }, {\n \"../../lib/enumerate\": 136\n }],\n 200: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Union Pay - Creation Error Codes\n * @description Errors that occur when [creating the Union Pay component](./module-braintree-web_union-pay.html#.create).\n * @property {MERCHANT} UNIONPAY_NOT_ENABLED Occurs when Union Pay is not enabled on the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.Union Pay - Shared Error Codes\n * @description Errors that occur when starting the Union Pay Flow\n * @property {MERCHANT} UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES Occurs when a method is used with both card details and a Hosted Fields instance.\n * @property {MERCHANT} UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID Occurs when Hosted Fields instance used is not a valid Hosted Fields instance.\n * @property {MERCHANT} UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED Occurs when neither card details or Hosted Fields are used.\n * @property {MERCHANT} UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED Occurs when Hosted Fields cannot be found on the page.\n */\n\n /**\n * @name BraintreeError.Union Pay - fetchCapabilities Error Codes\n * @description Errors that occur when using the [`fetchCapabilities` method](./UnionPay.html#fetchCapabilities).\n * @property {NETWORK} UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR Occurs when there is an error looking up the Union Pay capabilities.\n */\n\n /**\n * @name BraintreeError.Union Pay - enroll Error Codes\n * @description Errors that occur when using the [`enroll` method](./UnionPay.html#enroll).\n * @property {MERCHANT} UNIONPAY_MISSING_MOBILE_PHONE_DATA Occurs when no mobile phone data is provided.\n * @property {MERCHANT} UNIONPAY_EXPIRATION_DATE_INCOMPLETE Occurs when expiration date is incomplete.\n * @property {CUSTOMER} UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID Occurs when customer enrollment input is invalid.\n * @property {NETWORK} UNIONPAY_ENROLLMENT_NETWORK_ERROR Occurs when there is an error during enrollment.\n */\n\n /**\n * @name BraintreeError.Union Pay - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./UnionPay.html#tokenize).\n * @property {CUSTOMER} UNIONPAY_FAILED_TOKENIZATION Occurs when data cannot be tokenized.\n * @property {NETWORK} UNIONPAY_TOKENIZATION_NETWORK_ERROR Occurs when the Braintree gateway cannot be reached.\n */\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n module.exports = {\n UNIONPAY_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'UNIONPAY_NOT_ENABLED',\n message: 'UnionPay is not enabled for this merchant.'\n },\n UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: 'UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID',\n message: 'Found an invalid Hosted Fields instance. Please use a valid Hosted Fields instance.'\n },\n UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED',\n message: 'Could not find the Hosted Fields instance.'\n },\n UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED',\n message: 'A card or a Hosted Fields instance is required. Please supply a card or a Hosted Fields instance.'\n },\n UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES: {\n type: BraintreeError.types.MERCHANT,\n code: 'UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES',\n message: 'Please supply either a card or a Hosted Fields instance, not both.'\n },\n UNIONPAY_EXPIRATION_DATE_INCOMPLETE: {\n type: BraintreeError.types.MERCHANT,\n code: 'UNIONPAY_EXPIRATION_DATE_INCOMPLETE',\n message: 'You must supply expiration month and year or neither.'\n },\n UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID: {\n type: BraintreeError.types.CUSTOMER,\n code: 'UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID',\n message: 'Enrollment failed due to user input error.'\n },\n UNIONPAY_ENROLLMENT_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: 'UNIONPAY_ENROLLMENT_NETWORK_ERROR',\n message: 'Could not enroll UnionPay card.'\n },\n UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: 'UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR',\n message: 'Could not fetch card capabilities.'\n },\n UNIONPAY_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: 'UNIONPAY_TOKENIZATION_NETWORK_ERROR',\n message: 'A tokenization network error occurred.'\n },\n UNIONPAY_MISSING_MOBILE_PHONE_DATA: {\n type: BraintreeError.types.MERCHANT,\n code: 'UNIONPAY_MISSING_MOBILE_PHONE_DATA',\n message: 'A `mobile` with `countryCode` and `number` is required.'\n },\n UNIONPAY_FAILED_TOKENIZATION: {\n type: BraintreeError.types.CUSTOMER,\n code: 'UNIONPAY_FAILED_TOKENIZATION',\n message: 'The supplied card data failed tokenization.'\n }\n };\n }, {\n \"../../lib/braintree-error\": 126\n }],\n 201: [function (_dereq_, module, exports) {\n 'use strict';\n\n var analytics = _dereq_('../../lib/analytics');\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n var Bus = _dereq_('framebus');\n\n var constants = _dereq_('./constants');\n\n var isVerifiedDomain = _dereq_('../../lib/is-verified-domain');\n\n var useMin = _dereq_('../../lib/use-min');\n\n var convertMethodsToError = _dereq_('../../lib/convert-methods-to-error');\n\n var errors = _dereq_('./errors');\n\n var events = constants.events;\n\n var iFramer = _dereq_('@braintree/iframer');\n\n var methods = _dereq_('../../lib/methods');\n\n var VERSION = \"3.76.1\";\n\n var uuid = _dereq_('@braintree/uuid');\n\n var Promise = _dereq_('../../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var BUS_CONFIGURATION_REQUEST_EVENT = _dereq_('../../lib/constants').BUS_CONFIGURATION_REQUEST_EVENT;\n /**\n * @class\n * @param {object} options See {@link module:braintree-web/unionpay.create|unionpay.create}.\n * @description
You cannot use this constructor directly. Use {@link module:braintree-web/unionpay.create|braintree-web.unionpay.create} instead.\n * @classdesc This class represents a UnionPay component. Instances of this class have methods for {@link UnionPay#fetchCapabilities fetching capabilities} of UnionPay cards, {@link UnionPay#enroll enrolling} a UnionPay card, and {@link UnionPay#tokenize tokenizing} a UnionPay card.\n */\n\n\n function UnionPay(options) {\n this._options = options;\n }\n /**\n * @typedef {object} UnionPay~fetchCapabilitiesPayload\n * @property {boolean} isUnionPay Determines if this card is a UnionPay card.\n * @property {boolean} isDebit Determines if this card is a debit card. This property is only present if `isUnionPay` is `true`.\n * @property {object} unionPay UnionPay specific properties. This property is only present if `isUnionPay` is `true`.\n * @property {boolean} unionPay.supportsTwoStepAuthAndCapture Determines if the card allows for an authorization, but settling the transaction later.\n * @property {boolean} unionPay.isSupported Determines if Braintree can process this UnionPay card. When false, Braintree cannot process this card and the user should use a different card.\n */\n\n /**\n * Fetches the capabilities of a card, including whether or not the SMS enrollment process is required.\n * @public\n * @param {object} options UnionPay {@link UnionPay#fetchCapabilities fetchCapabilities} options\n * @param {object} [options.card] The card from which to fetch capabilities. Note that this will only have one property, `number`. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number Card number.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {callback} [callback] The second argument,
data
, is a {@link UnionPay#fetchCapabilitiesPayload fetchCapabilitiesPayload}. If no callback is provided, `fetchCapabilities` returns a promise that resolves with a {@link UnionPay#fetchCapabilitiesPayload fetchCapabilitiesPayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n UnionPay.prototype.fetchCapabilities = function (options) {\n var self = this;\n var client = this._options.client;\n var cardNumber = options.card ? options.card.number : null;\n var hostedFields = options.hostedFields;\n\n if (cardNumber && hostedFields) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));\n } else if (cardNumber) {\n return client.request({\n method: 'get',\n endpoint: 'payment_methods/credit_cards/capabilities',\n data: {\n _meta: {\n source: 'unionpay'\n },\n creditCard: {\n number: cardNumber\n }\n }\n }).then(function (response) {\n analytics.sendEvent(client, 'unionpay.capabilities-received');\n return response;\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n analytics.sendEvent(client, 'unionpay.capabilities-failed');\n\n if (status === 403) {\n return Promise.reject(err);\n }\n\n return Promise.reject(new BraintreeError({\n type: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.type,\n code: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.code,\n message: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.message,\n details: {\n originalError: err\n }\n }));\n });\n } else if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));\n }\n\n return self._initializeHostedFields().then(function () {\n return new Promise(function (resolve, reject) {\n self._bus.emit(events.HOSTED_FIELDS_FETCH_CAPABILITIES, {\n hostedFields: hostedFields\n }, function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n return;\n }\n\n resolve(response.payload);\n });\n });\n });\n }\n\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));\n };\n /**\n * @typedef {object} UnionPay~enrollPayload\n * @property {string} enrollmentId UnionPay enrollment ID. This value should be passed to `tokenize`.\n * @property {boolean} smsCodeRequired UnionPay `smsCodeRequired` flag.\n *
true - the user will receive an SMS code that needs to be supplied for tokenization.\n *
false - the card can be immediately tokenized.\n */\n\n /**\n * Enrolls a UnionPay card. Use {@link UnionPay#fetchCapabilities|fetchCapabilities} to determine if the SMS enrollment process is required.\n * @public\n * @param {object} options UnionPay enrollment options:\n * @param {object} [options.card] The card to enroll. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number The card number.\n * @param {string} [options.card.expirationDate] The card's expiration date. May be in the form `MM/YY` or `MM/YYYY`. When defined `expirationMonth` and `expirationYear` are ignored.\n * @param {string} [options.card.expirationMonth] The card's expiration month. This should be used with the `expirationYear` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.expirationYear] The card's expiration year. This should be used with the `expirationMonth` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {object} options.mobile The mobile information collected from the customer.\n * @param {string} options.mobile.countryCode The country code of the customer's mobile phone number.\n * @param {string} options.mobile.number The customer's mobile phone number.\n * @param {callback} [callback] The second argument,
data
, is a {@link UnionPay~enrollPayload|enrollPayload}. If no callback is provided, `enroll` returns a promise that resolves with {@link UnionPay~enrollPayload|enrollPayload}.\n * @returns {void}\n */\n\n\n UnionPay.prototype.enroll = function (options) {\n var self = this;\n var client = this._options.client;\n var card = options.card;\n var mobile = options.mobile;\n var hostedFields = options.hostedFields;\n var data;\n\n if (!mobile) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_MISSING_MOBILE_PHONE_DATA));\n }\n\n if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));\n } else if (card) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));\n }\n\n return new Promise(function (resolve, reject) {\n self._initializeHostedFields().then(function () {\n self._bus.emit(events.HOSTED_FIELDS_ENROLL, {\n hostedFields: hostedFields,\n mobile: mobile\n }, function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n return;\n }\n\n resolve(response.payload);\n });\n });\n });\n } else if (card && card.number) {\n data = {\n _meta: {\n source: 'unionpay'\n },\n unionPayEnrollment: {\n number: card.number,\n mobileCountryCode: mobile.countryCode,\n mobileNumber: mobile.number\n }\n };\n\n if (card.expirationDate) {\n data.unionPayEnrollment.expirationDate = card.expirationDate;\n } else if (card.expirationMonth || card.expirationYear) {\n if (card.expirationMonth && card.expirationYear) {\n data.unionPayEnrollment.expirationYear = card.expirationYear;\n data.unionPayEnrollment.expirationMonth = card.expirationMonth;\n } else {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_EXPIRATION_DATE_INCOMPLETE));\n }\n }\n\n return client.request({\n method: 'post',\n endpoint: 'union_pay_enrollments',\n data: data\n }).then(function (response) {\n analytics.sendEvent(client, 'unionpay.enrollment-succeeded');\n return {\n enrollmentId: response.unionPayEnrollmentId,\n smsCodeRequired: response.smsCodeRequired\n };\n }).catch(function (err) {\n var error;\n var status = err.details && err.details.httpStatus;\n\n if (status === 403) {\n error = err;\n } else if (status < 500) {\n error = new BraintreeError(errors.UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID);\n error.details = {\n originalError: err\n };\n } else {\n error = new BraintreeError(errors.UNIONPAY_ENROLLMENT_NETWORK_ERROR);\n error.details = {\n originalError: err\n };\n }\n\n analytics.sendEvent(client, 'unionpay.enrollment-failed');\n return Promise.reject(error);\n });\n }\n\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));\n };\n /**\n * @typedef {object} UnionPay~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type Always
CreditCard
.\n * @property {object} details Additional account details:\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n */\n\n /**\n * Tokenizes a UnionPay card and returns a nonce payload.\n * @public\n * @param {object} options UnionPay tokenization options:\n * @param {object} [options.card] The card to enroll. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number The card number.\n * @param {string} [options.card.expirationDate] The card's expiration date. May be in the form `MM/YY` or `MM/YYYY`. When defined `expirationMonth` and `expirationYear` are ignored.\n * @param {string} [options.card.expirationMonth] The card's expiration month. This should be used with the `expirationYear` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.expirationYear] The card's expiration year. This should be used with the `expirationMonth` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.cvv] The card's security number.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {string} options.enrollmentId The enrollment ID from {@link UnionPay#enroll}.\n * @param {string} [options.smsCode] The SMS code received from the user if {@link UnionPay#enroll} payload have `smsCodeRequired`. if `smsCodeRequired` is false, smsCode should not be passed.\n * @param {callback} [callback] The second argument,
data
, is a {@link UnionPay~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with a {@link UnionPay~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n UnionPay.prototype.tokenize = function (options) {\n var data;\n var self = this;\n var client = this._options.client;\n var card = options.card;\n var hostedFields = options.hostedFields;\n\n if (card && hostedFields) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));\n } else if (card) {\n data = {\n _meta: {\n source: 'unionpay'\n },\n creditCard: {\n number: options.card.number,\n options: {\n unionPayEnrollment: {\n id: options.enrollmentId\n }\n }\n }\n };\n\n if (options.smsCode) {\n data.creditCard.options.unionPayEnrollment.smsCode = options.smsCode;\n }\n\n if (card.expirationDate) {\n data.creditCard.expirationDate = card.expirationDate;\n } else if (card.expirationMonth && card.expirationYear) {\n data.creditCard.expirationYear = card.expirationYear;\n data.creditCard.expirationMonth = card.expirationMonth;\n }\n\n if (options.card.cvv) {\n data.creditCard.cvv = options.card.cvv;\n }\n\n return client.request({\n method: 'post',\n endpoint: 'payment_methods/credit_cards',\n data: data\n }).then(function (response) {\n var tokenizedCard = response.creditCards[0];\n delete tokenizedCard.consumed;\n delete tokenizedCard.threeDSecureInfo;\n analytics.sendEvent(client, 'unionpay.nonce-received');\n return tokenizedCard;\n }).catch(function (err) {\n var error;\n var status = err.details && err.details.httpStatus;\n analytics.sendEvent(client, 'unionpay.nonce-failed');\n\n if (status === 403) {\n error = err;\n } else if (status < 500) {\n error = new BraintreeError(errors.UNIONPAY_FAILED_TOKENIZATION);\n error.details = {\n originalError: err\n };\n } else {\n error = new BraintreeError(errors.UNIONPAY_TOKENIZATION_NETWORK_ERROR);\n error.details = {\n originalError: err\n };\n }\n\n return Promise.reject(error);\n });\n } else if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));\n }\n\n return new Promise(function (resolve, reject) {\n self._initializeHostedFields().then(function () {\n self._bus.emit(events.HOSTED_FIELDS_TOKENIZE, options, function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n return;\n }\n\n resolve(response.payload);\n });\n });\n });\n }\n\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));\n };\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/unionpay.create|create}. This only needs to be called when using UnionPay with Hosted Fields.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is provided, returns a promise.\n * @example\n * unionpayInstance.teardown();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n UnionPay.prototype.teardown = function () {\n if (this._bus) {\n this._hostedFieldsFrame.parentNode.removeChild(this._hostedFieldsFrame);\n\n this._bus.teardown();\n }\n\n convertMethodsToError(this, methods(UnionPay.prototype));\n return Promise.resolve();\n };\n\n UnionPay.prototype._initializeHostedFields = function () {\n var assetsUrl, isDebug;\n var componentId = uuid();\n var self = this;\n\n if (this._hostedFieldsInitializePromise) {\n return this._hostedFieldsInitializePromise;\n }\n\n this._hostedFieldsInitializePromise = new Promise(function (resolve) {\n assetsUrl = self._options.client.getConfiguration().gatewayConfiguration.assetsUrl;\n isDebug = self._options.client.getConfiguration().isDebug;\n self._bus = new Bus({\n channel: componentId,\n verifyDomain: isVerifiedDomain\n });\n self._hostedFieldsFrame = iFramer({\n name: constants.HOSTED_FIELDS_FRAME_NAME + '_' + componentId,\n src: assetsUrl + '/web/' + VERSION + '/html/unionpay-hosted-fields-frame' + useMin(isDebug) + '.html',\n height: 0,\n width: 0\n });\n\n self._bus.on(BUS_CONFIGURATION_REQUEST_EVENT, function (reply) {\n reply(self._options.client);\n resolve();\n });\n\n document.body.appendChild(self._hostedFieldsFrame);\n });\n return this._hostedFieldsInitializePromise;\n };\n\n module.exports = wrapPromise.wrapPrototype(UnionPay);\n }, {\n \"../../lib/analytics\": 121,\n \"../../lib/braintree-error\": 126,\n \"../../lib/constants\": 128,\n \"../../lib/convert-methods-to-error\": 129,\n \"../../lib/is-verified-domain\": 155,\n \"../../lib/methods\": 157,\n \"../../lib/promise\": 159,\n \"../../lib/use-min\": 162,\n \"./constants\": 199,\n \"./errors\": 200,\n \"@braintree/iframer\": 36,\n \"@braintree/uuid\": 40,\n \"@braintree/wrap-promise\": 44,\n \"framebus\": 53\n }],\n 202: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n PLAID_LINK_JS: 'https://cdn.plaid.com/link/v2/stable/link-initialize.js'\n };\n }, {}],\n 203: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Us Bank Account - Creation Error Codes\n * @description Errors that occur when [creating the Us Bank Account component](./module-braintree-web_us-bank-account.html#.create).\n * @property {MERCHANT} US_BANK_ACCOUNT_NOT_ENABLED Occurs when US Bank Account is not enabled in the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.Us Bank Account - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./UsBankAccount.html#tokenize).\n * @property {MERCHANT} US_BANK_ACCOUNT_OPTION_REQUIRED Occurs when a required option is not passed.\n * @property {MERCHANT} US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS Occurs when 1 or more incompatible options are passed.\n * @property {NETWORK} US_BANK_ACCOUNT_LOGIN_LOAD_FAILED Occurs when bank login flow fails.\n * @property {CUSTOMER} US_BANK_ACCOUNT_LOGIN_CLOSED Occurs when bank login window is closed.\n * @property {MERCHANT} US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE Occurs when a bank login flow is already active.\n * @property {NETWORK} US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR Occurs when payment details could not be tokenized.\n * @property {CUSTOMER} US_BANK_ACCOUNT_FAILED_TOKENIZATION Occurs when payment details failed to be tokenized.\n * @property {MERCHANT} US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED Occurs when bank login flow is not enabled in the Braintree control panel.\n */\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n module.exports = {\n US_BANK_ACCOUNT_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'US_BANK_ACCOUNT_OPTION_REQUIRED'\n },\n US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS: {\n type: BraintreeError.types.MERCHANT,\n code: 'US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS'\n },\n US_BANK_ACCOUNT_LOGIN_LOAD_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: 'US_BANK_ACCOUNT_LOGIN_LOAD_FAILED',\n message: 'Bank login flow failed to load.'\n },\n US_BANK_ACCOUNT_LOGIN_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'US_BANK_ACCOUNT_LOGIN_CLOSED',\n message: 'Customer closed bank login flow before authorizing.'\n },\n US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: 'US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE',\n message: 'Another bank login tokenization request is active.'\n },\n US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: 'US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR',\n message: 'A tokenization network error occurred.'\n },\n US_BANK_ACCOUNT_FAILED_TOKENIZATION: {\n type: BraintreeError.types.CUSTOMER,\n code: 'US_BANK_ACCOUNT_FAILED_TOKENIZATION',\n message: 'The supplied data failed tokenization.'\n },\n US_BANK_ACCOUNT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'US_BANK_ACCOUNT_NOT_ENABLED',\n message: 'US bank account is not enabled.'\n },\n US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED',\n message: 'Bank login is not enabled.'\n }\n };\n }, {\n \"../lib/braintree-error\": 126\n }],\n 204: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @module braintree-web/us-bank-account\n * @description This module is for accepting payments of US bank accounts.\n */\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var errors = _dereq_('./errors');\n\n var USBankAccount = _dereq_('./us-bank-account');\n\n var VERSION = \"3.76.1\";\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link USBankAccount} instance. If no callback is provided, `create` returns a promise that resolves with the {@link USBankAccount} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n function create(options) {\n var name = 'US Bank Account';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var usBankAccount;\n options.client = client;\n usBankAccount = options.client.getConfiguration().gatewayConfiguration.usBankAccount;\n\n if (!usBankAccount) {\n return Promise.reject(new BraintreeError(errors.US_BANK_ACCOUNT_NOT_ENABLED));\n }\n\n return new USBankAccount(options);\n });\n }\n\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 124,\n \"../lib/braintree-error\": 126,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/promise\": 159,\n \"./errors\": 203,\n \"./us-bank-account\": 205,\n \"@braintree/wrap-promise\": 44\n }],\n 205: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var constants = _dereq_('./constants');\n\n var errors = _dereq_('./errors');\n\n var sharedErrors = _dereq_('../lib/errors');\n\n var analytics = _dereq_('../lib/analytics');\n\n var once = _dereq_('../lib/once');\n\n var convertMethodsToError = _dereq_('../lib/convert-methods-to-error');\n\n var methods = _dereq_('../lib/methods');\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var TOKENIZE_BANK_DETAILS_MUTATION = createGraphQLMutation('UsBankAccount');\n var TOKENIZE_BANK_LOGIN_MUTATION = createGraphQLMutation('UsBankLogin');\n /**\n * @typedef {object} USBankAccount~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `us_bank_account`.\n * @property {object} details Additional account details. Currently empty.\n */\n\n /**\n * @class\n * @param {object} options See {@link module:braintree-web/us-bank-account.create|us-bank-account.create}.\n * @classdesc This class represents a US Bank Account component. Instances of this class can tokenize raw bank details or present a bank login.
You cannot use this constructor directly. Use {@link module:braintree-web/us-bank-account.create|braintree.us-bank-account.create} instead.\n */\n\n function USBankAccount(options) {\n this._client = options.client;\n this._isTokenizingBankLogin = false;\n analytics.sendEvent(this._client, 'usbankaccount.initialized');\n }\n /**\n * Tokenizes bank information to return a payment method nonce. You can tokenize bank details by providing information like account and routing numbers. You can also tokenize with a bank login UI that prompts the customer to log into their bank account.\n * @public\n * @param {object} options All tokenization options for the US Bank Account component.\n * @param {string} options.mandateText A string for proof of customer authorization. For example, `'I authorize Braintree to debit my bank account on behalf of My Online Store.'`.\n * @param {object} [options.bankDetails] Bank detail information (such as account and routing numbers). `bankDetails` or `bankLogin` option must be provided.\n * @param {string} options.bankDetails.routingNumber The customer's bank routing number, such as `'307075259'`.\n * @param {string} options.bankDetails.accountNumber The customer's bank account number, such as `'999999999'`.\n * @param {string} options.bankDetails.accountType The customer's bank account type. Must be `'checking'` or `'savings'`.\n * @param {string} options.bankDetails.ownershipType The customer's bank account ownership type. Must be `'personal'` or `'business'`.\n * @param {string} [options.bankDetails.firstName] The customer's first name. Required when account ownership type is `personal`.\n * @param {string} [options.bankDetails.lastName] The customer's last name. Required when account ownership type is `personal`.\n * @param {string} [options.bankDetails.businessName] The customer's business name. Required when account ownership type is `business`.\n * @param {object} options.bankDetails.billingAddress The customer's billing address.\n * @param {string} options.bankDetails.billingAddress.streetAddress The street address for the customer's billing address, such as `'123 Fake St'`.\n * @param {string} [options.bankDetails.billingAddress.extendedAddress] The extended street address for the customer's billing address, such as `'Apartment B'`.\n * @param {string} options.bankDetails.billingAddress.locality The locality for the customer's billing address. This is typically a city, such as `'San Francisco'`.\n * @param {string} options.bankDetails.billingAddress.region The region for the customer's billing address. This is typically a state, such as `'CA'`.\n * @param {string} options.bankDetails.billingAddress.postalCode The postal code for the customer's billing address. This is typically a ZIP code, such as `'94119'`.\n * @param {object} [options.bankLogin] Bank login information. `bankLogin` or `bankDetails` option must be provided.\n * @param {string} options.bankLogin.displayName Display name for the bank login UI, such as `'My Store'`.\n * @param {string} options.bankLogin.ownershipType The customer's bank account ownership type. Must be `'personal'` or `'business'`.\n * @param {string} [options.bankLogin.firstName] The customer's first name. Required when account ownership type is `personal`.\n * @param {string} [options.bankLogin.lastName] The customer's last name. Required when account ownership type is `personal`.\n * @param {string} [options.bankLogin.businessName] The customer's business name. Required when account ownership type is `business`.\n * @param {object} options.bankLogin.billingAddress The customer's billing address.\n * @param {string} options.bankLogin.billingAddress.streetAddress The street address for the customer's billing address, such as `'123 Fake St'`.\n * @param {string} [options.bankLogin.billingAddress.extendedAddress] The extended street address for the customer's billing address, such as `'Apartment B'`.\n * @param {string} options.bankLogin.billingAddress.locality The locality for the customer's billing address. This is typically a city, such as `'San Francisco'`.\n * @param {string} options.bankLogin.billingAddress.region The region for the customer's billing address. This is typically a state, such as `'CA'`.\n * @param {string} options.bankLogin.billingAddress.postalCode The postal code for the customer's billing address. This is typically a ZIP code, such as `'94119'`.\n * @param {callback} [callback] The second argument,
data
, is a {@link USBankAccount~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with {@link USBankAccount~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n *
Tokenizing raw bank details\n * var routingNumberInput = document.querySelector('input[name=\"routing-number\"]');\n * var accountNumberInput = document.querySelector('input[name=\"account-number\"]');\n * var accountTypeInput = document.querySelector('input[name=\"account-type\"]:checked');\n * var ownershipTypeInput = document.querySelector('input[name=\"ownership-type\"]:checked');\n * var firstNameInput = document.querySelector('input[name=\"first-name\"]');\n * var lastNameInput = document.querySelector('input[name=\"last-name\"]');\n * var businessNameInput = document.querySelector('input[name=\"business-name\"]');\n * var billingAddressStreetInput = document.querySelector('input[name=\"street-address\"]');\n * var billingAddressExtendedInput = document.querySelector('input[name=\"extended-address\"]');\n * var billingAddressLocalityInput = document.querySelector('input[name=\"locality\"]');\n * var billingAddressRegionSelect = document.querySelector('select[name=\"region\"]');\n * var billingAddressPostalInput = document.querySelector('input[name=\"postal-code\"]');\n *\n * submitButton.addEventListener('click', function (event) {\n * var bankDetails = {\n * routingNumber: routingNumberInput.value,\n * accountNumber: accountNumberInput.value,\n * accountType: accountTypeInput.value,\n * ownershipType: ownershipTypeInput.value,\n * billingAddress: {\n * streetAddress: billingAddressStreetInput.value,\n * extendedAddress: billingAddressExtendedInput.value,\n * locality: billingAddressLocalityInput.value,\n * region: billingAddressRegionSelect.value,\n * postalCode: billingAddressPostalInput.value\n * }\n * };\n *\n * if (bankDetails.ownershipType === 'personal') {\n * bankDetails.firstName = firstNameInput.value;\n * bankDetails.lastName = lastNameInput.value;\n * } else {\n * bankDetails.businessName = businessNameInput.value;\n * }\n *\n * event.preventDefault();\n *\n * usBankAccountInstance.tokenize({\n * bankDetails: bankDetails,\n * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.'\n * }, function (tokenizeErr, tokenizedPayload) {\n * if (tokenizeErr) {\n * console.error('There was an error tokenizing the bank details.');\n * return;\n * }\n *\n * // Send tokenizePayload.nonce to your server here!\n * });\n * });\n * @example\n *
Tokenizing with bank login UI\n * var ownershipTypeInput = document.querySelector('input[name=\"ownership-type\"]:checked');\n * var firstNameInput = document.querySelector('input[name=\"first-name\"]');\n * var lastNameInput = document.querySelector('input[name=\"last-name\"]');\n * var businessNameInput = document.querySelector('input[name=\"business-name\"]');\n * var billingAddressStreetInput = document.querySelector('input[name=\"street-address\"]');\n * var billingAddressExtendedInput = document.querySelector('input[name=\"extended-address\"]');\n * var billingAddressLocalityInput = document.querySelector('input[name=\"locality\"]');\n * var billingAddressRegionSelect = document.querySelector('select[name=\"region\"]');\n * var billingAddressPostalInput = document.querySelector('input[name=\"postal-code\"]');\n *\n * bankLoginButton.addEventListener('click', function (event) {\n * var bankLogin = {\n * displayName: 'My Online Store',\n * ownershipType: ownershipTypeInput.value,\n * billingAddress: {\n * streetAddress: billingAddressStreetInput.value,\n * extendedAddress: billingAddressExtendedInput.value,\n * locality: billingAddressLocalityInput.value,\n * region: billingAddressRegionSelect.value,\n * postalCode: billingAddressPostalInput.value\n * }\n * }\n * event.preventDefault();\n *\n * if (bankLogin.ownershipType === 'personal') {\n * bankLogin.firstName = firstNameInput.value;\n * bankLogin.lastName = lastNameInput.value;\n * } else {\n * bankLogin.businessName = businessNameInput.value;\n * }\n *\n * usBankAccountInstance.tokenize({\n * bankLogin: bankLogin,\n * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.'\n * }, function (tokenizeErr, tokenizedPayload) {\n * if (tokenizeErr) {\n * console.error('There was an error tokenizing the bank details.');\n * return;\n * }\n *\n * // Send tokenizePayload.nonce to your server here!\n * });\n * });\n */\n\n\n USBankAccount.prototype.tokenize = function (options) {\n options = options || {};\n\n if (!options.mandateText) {\n return Promise.reject(new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: 'mandateText property is required.'\n }));\n }\n\n if (options.bankDetails && options.bankLogin) {\n return Promise.reject(new BraintreeError({\n type: errors.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.type,\n code: errors.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.code,\n message: 'tokenize must be called with bankDetails or bankLogin, not both.'\n }));\n } else if (options.bankDetails) {\n return this._tokenizeBankDetails(options);\n } else if (options.bankLogin) {\n return this._tokenizeBankLogin(options);\n }\n\n return Promise.reject(new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: 'tokenize must be called with bankDetails or bankLogin.'\n }));\n };\n\n USBankAccount.prototype._tokenizeBankDetails = function (options) {\n var client = this._client;\n var bankDetails = options.bankDetails;\n var data = {\n achMandate: options.mandateText,\n routingNumber: bankDetails.routingNumber,\n accountNumber: bankDetails.accountNumber,\n accountType: bankDetails.accountType.toUpperCase(),\n billingAddress: formatBillingAddressForGraphQL(bankDetails.billingAddress || {})\n };\n formatDataForOwnershipType(data, bankDetails);\n return client.request({\n api: 'graphQLApi',\n data: {\n query: TOKENIZE_BANK_DETAILS_MUTATION,\n variables: {\n input: {\n usBankAccount: data\n }\n }\n }\n }).then(function (response) {\n analytics.sendEvent(client, 'usbankaccount.bankdetails.tokenization.succeeded');\n return Promise.resolve(formatTokenizeResponseFromGraphQL(response, 'tokenizeUsBankAccount'));\n }).catch(function (err) {\n var error = errorFrom(err);\n analytics.sendEvent(client, 'usbankaccount.bankdetails.tokenization.failed');\n return Promise.reject(error);\n });\n };\n\n USBankAccount.prototype._tokenizeBankLogin = function (options) {\n var self = this;\n var client = this._client;\n var gatewayConfiguration = client.getConfiguration().gatewayConfiguration;\n var isProduction = gatewayConfiguration.environment === 'production';\n var plaidConfig = gatewayConfiguration.usBankAccount.plaid;\n\n if (!options.bankLogin.displayName) {\n return Promise.reject(new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: 'displayName property is required when using bankLogin.'\n }));\n }\n\n if (!plaidConfig) {\n return Promise.reject(new BraintreeError(errors.US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED));\n }\n\n if (this._isTokenizingBankLogin) {\n return Promise.reject(new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE));\n }\n\n this._isTokenizingBankLogin = true;\n return new Promise(function (resolve, reject) {\n self._loadPlaid(function (plaidLoadErr, plaid) {\n if (plaidLoadErr) {\n reject(plaidLoadErr);\n return;\n }\n\n plaid.create({\n clientName: options.bankLogin.displayName,\n apiVersion: 'v2',\n env: isProduction ? 'production' : 'sandbox',\n key: plaidConfig.publicKey,\n product: 'auth',\n selectAccount: true,\n onExit: function onExit() {\n self._isTokenizingBankLogin = false;\n analytics.sendEvent(client, 'usbankaccount.banklogin.tokenization.closed.by-user');\n reject(new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_CLOSED));\n },\n onSuccess: function onSuccess(publicToken, metadata) {\n var bankLogin = options.bankLogin;\n var data = {\n publicToken: publicToken,\n accountId: isProduction ? metadata.account_id : 'plaid_account_id',\n accountType: metadata.account.subtype.toUpperCase(),\n achMandate: options.mandateText,\n billingAddress: formatBillingAddressForGraphQL(bankLogin.billingAddress || {})\n };\n formatDataForOwnershipType(data, bankLogin);\n client.request({\n api: 'graphQLApi',\n data: {\n query: TOKENIZE_BANK_LOGIN_MUTATION,\n variables: {\n input: {\n usBankLogin: data\n }\n }\n }\n }).then(function (response) {\n self._isTokenizingBankLogin = false;\n analytics.sendEvent(client, 'usbankaccount.banklogin.tokenization.succeeded');\n resolve(formatTokenizeResponseFromGraphQL(response, 'tokenizeUsBankLogin'));\n }).catch(function (tokenizeErr) {\n var error;\n self._isTokenizingBankLogin = false;\n error = errorFrom(tokenizeErr);\n analytics.sendEvent(client, 'usbankaccount.banklogin.tokenization.failed');\n reject(error);\n });\n }\n }).open();\n analytics.sendEvent(client, 'usbankaccount.banklogin.tokenization.started');\n });\n });\n };\n\n function errorFrom(err) {\n var error;\n var status = err.details && err.details.httpStatus;\n\n if (status === 401) {\n error = new BraintreeError(sharedErrors.BRAINTREE_API_ACCESS_RESTRICTED);\n } else if (status < 500) {\n error = new BraintreeError(errors.US_BANK_ACCOUNT_FAILED_TOKENIZATION);\n } else {\n error = new BraintreeError(errors.US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR);\n }\n\n error.details = {\n originalError: err\n };\n return error;\n }\n\n function formatTokenizeResponseFromGraphQL(response, type) {\n var data = response.data[type].paymentMethod;\n var last4 = data.details.last4;\n var description = 'US bank account ending in - ' + last4;\n return {\n nonce: data.id,\n details: {},\n description: description,\n type: 'us_bank_account'\n };\n }\n\n USBankAccount.prototype._loadPlaid = function (callback) {\n var existingScript, script;\n callback = once(callback);\n\n if (window.Plaid) {\n callback(null, window.Plaid);\n return;\n }\n\n existingScript = document.querySelector('script[src=\"' + constants.PLAID_LINK_JS + '\"]');\n\n if (existingScript) {\n addLoadListeners(existingScript, callback);\n } else {\n script = document.createElement('script');\n script.src = constants.PLAID_LINK_JS;\n script.async = true;\n addLoadListeners(script, callback);\n document.body.appendChild(script);\n this._plaidScript = script;\n }\n };\n\n function addLoadListeners(script, callback) {\n function loadHandler() {\n var readyState = this.readyState; // eslint-disable-line no-invalid-this\n\n if (!readyState || readyState === 'loaded' || readyState === 'complete') {\n removeLoadListeners();\n callback(null, window.Plaid);\n }\n }\n\n function errorHandler() {\n script.parentNode.removeChild(script);\n callback(new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_LOAD_FAILED));\n }\n\n function removeLoadListeners() {\n script.removeEventListener('error', errorHandler);\n script.removeEventListener('load', loadHandler);\n script.removeEventListener('readystatechange', loadHandler);\n }\n\n script.addEventListener('error', errorHandler);\n script.addEventListener('load', loadHandler);\n script.addEventListener('readystatechange', loadHandler);\n }\n\n function formatBillingAddressForGraphQL(address) {\n return {\n streetAddress: address.streetAddress,\n extendedAddress: address.extendedAddress,\n city: address.locality,\n state: address.region,\n zipCode: address.postalCode\n };\n }\n\n function formatDataForOwnershipType(data, details) {\n if (details.ownershipType === 'personal') {\n data.individualOwner = {\n firstName: details.firstName,\n lastName: details.lastName\n };\n } else if (details.ownershipType === 'business') {\n data.businessOwner = {\n businessName: details.businessName\n };\n }\n }\n\n function createGraphQLMutation(type) {\n return '' + 'mutation Tokenize' + type + '($input: Tokenize' + type + 'Input!) {' + ' tokenize' + type + '(input: $input) {' + ' paymentMethod {' + ' id' + ' details {' + ' ... on UsBankAccountDetails {' + ' last4' + ' }' + ' }' + ' }' + ' }' + '}';\n }\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/us-bank-account.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * usBankAccountInstance.teardown();\n * @example
With callback\n * usBankAccountInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n USBankAccount.prototype.teardown = function () {\n if (this._plaidScript) {\n document.body.removeChild(this._plaidScript);\n }\n\n convertMethodsToError(this, methods(USBankAccount.prototype));\n return Promise.resolve();\n };\n\n module.exports = wrapPromise.wrapPrototype(USBankAccount);\n }, {\n \"../lib/analytics\": 121,\n \"../lib/braintree-error\": 126,\n \"../lib/convert-methods-to-error\": 129,\n \"../lib/errors\": 137,\n \"../lib/methods\": 157,\n \"../lib/once\": 158,\n \"../lib/promise\": 159,\n \"./constants\": 202,\n \"./errors\": 203,\n \"@braintree/wrap-promise\": 44\n }],\n 206: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Vault Manager - deletePaymentMethod Error Codes\n * @description Errors that occur when using the [`deletePaymentMethod` method](./VaultManager.html#deletePaymentMethod).\n * @property {MERCHANT} VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN Occurs when vault manager is initialized with a tokenization key instead of a Client Token.\n * @property {MERCHANT} VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND Occurs when the specified payment method can not be found.\n * @property {UNKNOWN} VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR Occurs when there is an error attempting to delete the payment method.\n */\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n module.exports = {\n VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN: {\n type: BraintreeError.types.MERCHANT,\n code: 'VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN',\n message: 'A client token with a customer id must be used to delete a payment method nonce.'\n },\n VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND: {\n type: BraintreeError.types.MERCHANT,\n code: 'VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND'\n },\n VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: 'VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR'\n }\n };\n }, {\n \"../lib/braintree-error\": 126\n }],\n 207: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @module braintree-web/vault-manager\n * @description Manages customer's payment methods.\n */\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var VaultManager = _dereq_('./vault-manager');\n\n var VERSION = \"3.76.1\";\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} callback The second argument, `data`, is the {@link VaultManager} instance.\n * @returns {void}\n */\n\n\n function create(options) {\n var name = 'Vault Manager';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return new VaultManager({\n createPromise: createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n })\n });\n });\n }\n\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 124,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"./vault-manager\": 208,\n \"@braintree/wrap-promise\": 44\n }],\n 208: [function (_dereq_, module, exports) {\n 'use strict';\n\n var analytics = _dereq_('../lib/analytics');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var errors = _dereq_('./errors');\n\n var convertMethodsToError = _dereq_('../lib/convert-methods-to-error');\n\n var methods = _dereq_('../lib/methods');\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var DELETE_PAYMENT_METHOD_MUTATION = 'mutation DeletePaymentMethodFromSingleUseToken($input: DeletePaymentMethodFromSingleUseTokenInput!) {' + ' deletePaymentMethodFromSingleUseToken(input: $input) {' + ' clientMutationId' + ' }' + '}';\n /**\n * @typedef {array} VaultManager~fetchPaymentMethodsPayload The customer's payment methods.\n * @property {object} paymentMethod The payment method object.\n * @property {string} paymentMethod.nonce A nonce that can be sent to your server to transact on the payment method.\n * @property {boolean} paymentMethod.default Whether or not this is the default payment method for the customer.\n * @property {object} paymentMethod.details Any additional details about the payment method. Varies depending on the type of payment method.\n * @property {string} paymentMethod.type A constant indicating the type of payment method.\n * @property {?string} paymentMethod.description Additional description about the payment method.\n * @property {?object} paymentMethod.binData Bin data about the payment method.\n *\n */\n\n /**\n * @class\n * @param {object} options Options\n * @description
You cannot use this constructor directly. Use {@link module:braintree-web/vault-manager.create|braintree.vault-manager.create} instead.\n * @classdesc This class allows you to manage a customer's payment methods on the client.\n */\n\n function VaultManager(options) {\n this._createPromise = options.createPromise;\n }\n /**\n * Fetches payment methods owned by the customer whose id was used to generate the client token used to create the {@link module:braintree-web/client|client}.\n * @public\n * @param {object} [options] Options for fetching payment methods.\n * @param {boolean} [options.defaultFirst = false] If `true`, the payment methods will be returned with the default payment method for the customer first. Otherwise, the payment methods will be returned with the most recently used payment method first.\n * @param {callback} [callback] The second argument is a {@link VaultManager~fetchPaymentMethodsPayload|fetchPaymentMethodsPayload}. This is also what is resolved by the promise if no callback is provided.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * vaultManagerInstance.fetchPaymentMethods(function (err, paymentMethods) {\n * paymentMethods.forEach(function (paymentMethod) {\n * // add payment method to UI\n * // paymentMethod.nonce <- transactable nonce associated with payment method\n * // paymentMethod.details <- object with additional information about payment method\n * // paymentMethod.type <- a constant signifying the type\n * });\n * });\n */\n\n\n VaultManager.prototype.fetchPaymentMethods = function (options) {\n var defaultFirst;\n options = options || {};\n defaultFirst = options.defaultFirst === true ? 1 : 0;\n return this._createPromise.then(function (client) {\n return client.request({\n endpoint: 'payment_methods',\n method: 'get',\n data: {\n defaultFirst: defaultFirst\n }\n });\n }).then(function (paymentMethodsPayload) {\n analytics.sendEvent(this._createPromise, 'vault-manager.fetch-payment-methods.succeeded');\n return paymentMethodsPayload.paymentMethods.map(formatPaymentMethodPayload);\n }.bind(this));\n }; // TODO hide from jsdoc for now until the GraphQL API is on for all merchants by default\n\n /**\n * Deletes a payment method owned by the customer whose id was used to generate the client token used to create the {@link module:braintree-web/client|client}.\n * @public\n * @ignore\n * @param {string} paymentMethodNonce The payment method nonce that references a vaulted payment method.\n * @param {callback} [callback] No data is returned if the operation is successful.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * vaultManagerInstance.deletePaymentMethod('nonce-to-delete', function (err) {\n * // handle err if it exists\n * });\n */\n\n\n VaultManager.prototype.deletePaymentMethod = function (paymentMethodNonce) {\n return this._createPromise.then(function (client) {\n var usesClientToken = client.getConfiguration().authorizationType === 'CLIENT_TOKEN';\n\n if (!usesClientToken) {\n return Promise.reject(new BraintreeError(errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN));\n }\n\n return client.request({\n api: 'graphQLApi',\n data: {\n query: DELETE_PAYMENT_METHOD_MUTATION,\n variables: {\n input: {\n singleUseTokenId: paymentMethodNonce\n }\n },\n operationName: 'DeletePaymentMethodFromSingleUseToken'\n }\n }).then(function () {\n analytics.sendEvent(client, 'vault-manager.delete-payment-method.succeeded'); // noop to prevent sending back the raw graphql data\n }).catch(function (error) {\n var originalError = error.details.originalError;\n var formattedError;\n analytics.sendEvent(client, 'vault-manager.delete-payment-method.failed');\n\n if (originalError[0] && originalError[0].extensions.errorClass === 'NOT_FOUND') {\n formattedError = new BraintreeError({\n type: errors.VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND.type,\n code: errors.VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND.code,\n message: 'A payment method for payment method nonce `' + paymentMethodNonce + '` could not be found.',\n details: {\n originalError: originalError\n }\n });\n }\n\n if (!formattedError) {\n formattedError = new BraintreeError({\n type: errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR.type,\n code: errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR.code,\n message: 'An unknown error occured when attempting to delete the payment method assocaited with the payment method nonce `' + paymentMethodNonce + '`.',\n details: {\n originalError: originalError\n }\n });\n }\n\n return Promise.reject(formattedError);\n });\n });\n };\n\n function formatPaymentMethodPayload(paymentMethod) {\n var formattedPaymentMethod = {\n nonce: paymentMethod.nonce,\n 'default': paymentMethod.default,\n details: paymentMethod.details,\n hasSubscription: paymentMethod.hasSubscription,\n type: paymentMethod.type\n };\n\n if (paymentMethod.description) {\n formattedPaymentMethod.description = paymentMethod.description;\n }\n\n if (paymentMethod.binData) {\n formattedPaymentMethod.binData = paymentMethod.binData;\n }\n\n return formattedPaymentMethod;\n }\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/vault-manager.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * vaultManagerInstance.teardown();\n * @example
With callback\n * vaultManagerInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n VaultManager.prototype.teardown = function () {\n convertMethodsToError(this, methods(VaultManager.prototype));\n return Promise.resolve();\n };\n\n module.exports = wrapPromise.wrapPrototype(VaultManager);\n }, {\n \"../lib/analytics\": 121,\n \"../lib/braintree-error\": 126,\n \"../lib/convert-methods-to-error\": 129,\n \"../lib/methods\": 157,\n \"../lib/promise\": 159,\n \"./errors\": 206,\n \"@braintree/wrap-promise\": 44\n }],\n 209: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n };\n\n var venmo_desktop_1 = __importDefault(_dereq_(\"./venmo-desktop\"));\n\n module.exports = function createVenmoDesktop(options) {\n var instance = new venmo_desktop_1.default(options);\n return instance.initialize();\n };\n }, {\n \"./venmo-desktop\": 211\n }],\n 210: [function (_dereq_, module, exports) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.VENMO_DESKTOP_PAYMENT_RESOURCE_STATUS_QUERY = exports.UPDATE_VENMO_DESKTOP_PAYMENT_RESOURCE_QUERY = exports.CREATE_VENMO_DESKTOP_PAYMENT_RESOURCE_QUERY = void 0;\n exports.CREATE_VENMO_DESKTOP_PAYMENT_RESOURCE_QUERY = \"mutation CreateVenmoQRCodePaymentContext($input: CreateVenmoQRCodePaymentContextInput!) {\\n createVenmoQRCodePaymentContext(input: $input) {\\n clientMutationId\\n venmoQRCodePaymentContext {\\n id\\n merchantId\\n createdAt\\n expiresAt\\n }\\n }\\n}\";\n exports.UPDATE_VENMO_DESKTOP_PAYMENT_RESOURCE_QUERY = \"mutation UpdateVenmoQRCodePaymentContext($input: UpdateVenmoQRCodePaymentContextInput!) {\\n updateVenmoQRCodePaymentContext(input: $input) {\\n clientMutationId\\n }\\n}\";\n exports.VENMO_DESKTOP_PAYMENT_RESOURCE_STATUS_QUERY = \"query PaymentContext($id: ID!) {\\n node(id: $id) {\\n ... on VenmoQRCodePaymentContext {\\n status\\n paymentMethodId\\n userName\\n }\\n }\\n}\";\n }, {}],\n 211: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n };\n\n var __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n };\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var framebus_1 = __importDefault(_dereq_(\"framebus\"));\n\n var iframer_1 = __importDefault(_dereq_(\"@braintree/iframer\"));\n\n var uuid_1 = __importDefault(_dereq_(\"@braintree/uuid\"));\n\n var events_1 = _dereq_(\"../shared/events\");\n\n var queries_1 = _dereq_(\"./queries\");\n\n var VENMO_DESKTOP_POLLING_INTERVAL = 1000; // 1 second\n\n var VISUAL_DELAY_BEFORE_SIGNALLING_COMPLETION = 2000; // 2 seconds\n\n var VenmoDesktop =\n /** @class */\n function () {\n function VenmoDesktop(options) {\n this.isHidden = true;\n this.env = options.environment;\n this.id = uuid_1.default();\n var frameUrl = options.url + \"#\" + this.env + \"_\" + this.id;\n this.bus = new framebus_1.default({\n channel: this.id,\n verifyDomain: options.verifyDomain\n });\n this.apiRequest = options.apiRequest;\n this.sendEvent = options.sendEvent;\n this.Promise = options.Promise;\n this.alertBox = document.createElement(\"div\");\n this.alertBox.setAttribute(\"data-venmo-desktop-id\", this.id);\n this.alertBox.setAttribute(\"role\", \"alert\");\n this.alertBox.style.position = \"fixed\";\n this.alertBox.style.display = \"none\";\n this.alertBox.style.height = \"1px\";\n this.alertBox.style.width = \"1px\";\n this.alertBox.style.overflow = \"hidden\";\n this.alertBox.style.zIndex = \"0\";\n this.iframe = iframer_1.default({\n src: frameUrl,\n name: \"venmo-desktop-iframe\",\n style: {\n display: \"none\",\n position: \"fixed\",\n top: \"0\",\n bottom: \"0\",\n right: \"0\",\n left: \"0\",\n height: \"100%\",\n width: \"100%\",\n zIndex: \"9999999\"\n },\n title: \"Venmo Desktop\"\n });\n }\n\n VenmoDesktop.prototype.initialize = function () {\n var _this = this;\n\n return new this.Promise(function (resolve) {\n _this.bus.on(events_1.VENMO_DESKTOP_IFRAME_READY, function () {\n resolve(_this);\n });\n\n _this.bus.on(events_1.VENMO_DESKTOP_REQUEST_NEW_QR_CODE, function () {\n _this.sendEvent(\"venmo.tokenize.desktop.restarted-from-error-view\");\n\n _this.startPolling();\n });\n\n document.body.appendChild(_this.iframe);\n document.body.appendChild(_this.alertBox);\n });\n };\n\n VenmoDesktop.prototype.launchDesktopFlow = function () {\n var _this = this;\n\n this.isHidden = false;\n var promise = new this.Promise(function (resolve, reject) {\n _this.launchDesktopPromiseRejectFunction = reject;\n\n var removeListeners = function removeListeners() {\n /* eslint-disable @typescript-eslint/no-use-before-define */\n _this.bus.off(events_1.VENMO_DESKTOP_CUSTOMER_CANCELED, customerCancelledHandler);\n\n _this.bus.off(events_1.VENMO_DESKTOP_AUTHORIZATION_COMPLETED, completedHandler);\n\n _this.bus.off(events_1.VENMO_DESKTOP_UNKNOWN_ERROR, unknownErrorHandler);\n /* eslint-enable @typescript-eslint/no-use-before-define */\n\n };\n\n var unknownErrorHandler = function unknownErrorHandler(err) {\n removeListeners();\n\n _this.sendEvent(\"venmo.tokenize.desktop.unknown-error\");\n\n reject({\n allowUIToHandleError: false,\n reason: \"UNKNOWN_ERROR\",\n err: err\n });\n };\n\n var customerCancelledHandler = function customerCancelledHandler() {\n removeListeners();\n\n _this.updateVenmoDesktopPaymentContext(\"CANCELED\");\n\n _this.sendEvent(\"venmo.tokenize.desktop.status-change.canceled-from-modal\");\n\n reject({\n allowUIToHandleError: false,\n reason: \"CUSTOMER_CANCELED\"\n });\n };\n\n var completedHandler = function completedHandler(payload) {\n removeListeners();\n resolve(payload);\n };\n\n _this.bus.on(events_1.VENMO_DESKTOP_CUSTOMER_CANCELED, customerCancelledHandler);\n\n _this.bus.on(events_1.VENMO_DESKTOP_AUTHORIZATION_COMPLETED, completedHandler);\n\n _this.bus.on(events_1.VENMO_DESKTOP_UNKNOWN_ERROR, unknownErrorHandler);\n });\n this.iframe.style.display = \"block\";\n this.setAlert(\"Generating a QR code, get your Venmo app ready\");\n this.iframe.focus();\n this.startPolling();\n return promise.then(function (result) {\n delete _this.venmoContextId;\n delete _this.launchDesktopPromiseRejectFunction;\n return result;\n }).catch(function (err) {\n delete _this.venmoContextId;\n delete _this.launchDesktopPromiseRejectFunction;\n return _this.Promise.reject(err);\n });\n };\n\n VenmoDesktop.prototype.triggerCompleted = function (result) {\n var _this = this;\n\n if (this.isHidden) {\n return;\n }\n\n setTimeout(function () {\n _this.bus.emit(events_1.VENMO_DESKTOP_AUTHORIZATION_COMPLETED, result);\n }, VISUAL_DELAY_BEFORE_SIGNALLING_COMPLETION);\n };\n\n VenmoDesktop.prototype.triggerRejected = function (err) {\n if (this.launchDesktopPromiseRejectFunction) {\n this.launchDesktopPromiseRejectFunction(err);\n }\n };\n\n VenmoDesktop.prototype.hideDesktopFlow = function () {\n this.setAlert(\"\");\n this.iframe.style.display = \"none\";\n this.bus.emit(events_1.VENMO_DESKTOP_CLOSED_FROM_PARENT);\n this.isHidden = true;\n };\n\n VenmoDesktop.prototype.displayError = function (message) {\n if (this.isHidden) {\n return;\n }\n\n this.bus.emit(events_1.VENMO_DESKTOP_DISPLAY_ERROR, {\n message: message\n });\n this.setAlert(message);\n };\n\n VenmoDesktop.prototype.displayQRCode = function (id, merchantId) {\n if (this.isHidden) {\n return;\n }\n\n this.bus.emit(events_1.VENMO_DESKTOP_DISPLAY_QR_CODE, {\n id: id,\n merchantId: merchantId\n });\n this.setAlert(\"To scan the QR code, open your Venmo app\");\n };\n\n VenmoDesktop.prototype.authorize = function () {\n if (this.isHidden) {\n return;\n }\n\n this.bus.emit(events_1.VENMO_DESKTOP_AUTHORIZE);\n this.setAlert(\"Venmo account authorized\");\n };\n\n VenmoDesktop.prototype.authorizing = function () {\n if (this.isHidden) {\n return;\n }\n\n this.bus.emit(events_1.VENMO_DESKTOP_AUTHORIZING);\n this.setAlert(\"Authorize on your Venmo app\");\n };\n\n VenmoDesktop.prototype.startPolling = function () {\n var _this = this;\n\n return this.createVenmoDesktopPaymentContext().then(function (result) {\n var expiresIn = new Date(result.expiresAt).getTime() - new Date(result.createdAt).getTime();\n var expiredTime = Date.now() + expiresIn;\n\n _this.displayQRCode(result.id, result.merchantId);\n\n return _this.pollForStatusChange(result.status, expiredTime);\n }).then(function (result) {\n if (!result) {\n return;\n } // since we are manually adding a prepended @ sign\n // we want to make sure that the username does not\n // start giving us the @ sign up front in the future\n\n\n var username = result.userName || \"\";\n username = \"@\" + username.replace(\"@\", \"\");\n\n _this.triggerCompleted({\n paymentMethodNonce: result.paymentMethodId,\n username: username\n });\n }).catch(function (err) {\n if (err.allowUIToHandleError) {\n // noop here and let the UI handle the customer error\n return;\n }\n\n _this.sendEvent(\"venmo.tokenize.desktop.unhandled-error\");\n\n _this.triggerRejected(err);\n });\n };\n\n VenmoDesktop.prototype.pollForStatusChange = function (status, expiredTime) {\n var _this = this;\n\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n\n if (Date.now() > expiredTime) {\n return this.updateVenmoDesktopPaymentContext(\"EXPIRED\").then(function () {\n _this.displayError(\"Something went wrong\");\n\n _this.sendEvent(\"venmo.tokenize.desktop.status-change.sdk-timeout\");\n\n return _this.Promise.reject({\n allowUIToHandleError: true,\n reason: \"TIMEOUT\"\n });\n });\n }\n\n return this.lookupVenmoDesktopPaymentContext().then(function (response) {\n if (!_this.venmoContextId || !response) {\n return _this.Promise.resolve();\n }\n\n var newStatus = response.status;\n\n if (newStatus !== status) {\n status = newStatus;\n\n _this.sendEvent(\"venmo.tokenize.desktop.status-change.\" + status.toLowerCase());\n\n switch (status) {\n case \"CREATED\":\n // noop, no need to do anything here\n // should never be able to get to this point\n // but we'll keep it in to enumerate the statuses\n break;\n\n case \"EXPIRED\":\n case \"FAILED\":\n case \"CANCELED\":\n var message = status === \"CANCELED\" ? \"The authorization was canceled\" : \"Something went wrong\";\n\n _this.displayError(message); // these are all terminal states, so we end it here\n\n\n return _this.Promise.reject({\n allowUIToHandleError: true,\n reason: status\n });\n\n case \"SCANNED\":\n _this.authorizing();\n\n break;\n\n case \"APPROVED\":\n _this.authorize();\n\n return _this.Promise.resolve(response);\n\n default: // any other statuses are irrelevant to the polling\n // and can just be ignored\n\n }\n }\n\n return new _this.Promise(function (resolve, reject) {\n setTimeout(function () {\n _this.pollForStatusChange(status, expiredTime).then(resolve).catch(reject);\n }, VENMO_DESKTOP_POLLING_INTERVAL);\n });\n });\n };\n\n VenmoDesktop.prototype.teardown = function () {\n this.bus.teardown();\n\n if (this.iframe.parentNode) {\n this.iframe.parentNode.removeChild(this.iframe);\n }\n\n if (this.alertBox.parentNode) {\n this.alertBox.parentNode.removeChild(this.alertBox);\n }\n };\n\n VenmoDesktop.prototype.setAlert = function (message) {\n this.alertBox.style.display = message ? \"block\" : \"none\";\n this.alertBox.textContent = message;\n };\n\n VenmoDesktop.prototype.createVenmoDesktopPaymentContext = function () {\n var _this = this;\n\n return this.apiRequest(queries_1.CREATE_VENMO_DESKTOP_PAYMENT_RESOURCE_QUERY, {\n input: {\n environment: this.env,\n intent: \"PAY_FROM_APP\"\n }\n }).then(function (response) {\n var context = response.createVenmoQRCodePaymentContext.venmoQRCodePaymentContext;\n _this.venmoContextId = context.id;\n return {\n id: context.id,\n status: context.status,\n merchantId: context.merchantId,\n createdAt: context.createdAt,\n expiresAt: context.expiresAt\n };\n });\n };\n\n VenmoDesktop.prototype.updateVenmoDesktopPaymentContext = function (status, additionalOptions) {\n if (additionalOptions === void 0) {\n additionalOptions = {};\n }\n\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n\n var data = {\n input: __assign({\n id: this.venmoContextId,\n status: status\n }, additionalOptions)\n };\n return this.apiRequest(queries_1.UPDATE_VENMO_DESKTOP_PAYMENT_RESOURCE_QUERY, data).then(function () {// noop so we can resolve without any data to match the type\n });\n };\n\n VenmoDesktop.prototype.lookupVenmoDesktopPaymentContext = function () {\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n\n return this.apiRequest(queries_1.VENMO_DESKTOP_PAYMENT_RESOURCE_STATUS_QUERY, {\n id: this.venmoContextId\n }).then(function (response) {\n return response.node;\n });\n };\n\n return VenmoDesktop;\n }();\n\n exports.default = VenmoDesktop;\n }, {\n \"../shared/events\": 216,\n \"./queries\": 210,\n \"@braintree/iframer\": 36,\n \"@braintree/uuid\": 40,\n \"framebus\": 53\n }],\n 212: [function (_dereq_, module, exports) {\n 'use strict';\n /** @module braintree-web/venmo */\n\n var analytics = _dereq_('../lib/analytics');\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var errors = _dereq_('./shared/errors');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var Venmo = _dereq_('./venmo');\n\n var Promise = _dereq_('../lib/promise');\n\n var supportsVenmo = _dereq_('./shared/supports-venmo');\n\n var VERSION = \"3.76.1\";\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {boolean} [options.allowNewBrowserTab=true] This should be set to false if your payment flow requires returning to the same tab, e.g. single page applications. Doing so causes {@link Venmo#isBrowserSupported|isBrowserSupported} to return true only for mobile web browsers that support returning from the Venmo app to the same tab.\n * @param {boolean} [options.allowWebviews=true] This should be set to false if your payment flow does not occur from within a webview that you control. Doing so causes {@link Venmo#isBrowserSupported|isBrowserSupported} to return true only for mobile web browsers that are not webviews.\n * @param {boolean} [options.ignoreHistoryChanges=false] When the Venmo app returns to the website, it will modify the hash of the url to include data about the tokenization. By default, the SDK will put the state of the hash back to where it was before the change was made. Pass `true` to handle the hash change instead of the SDK.\n * @param {string} [options.profileId] The Venmo profile ID to be used during payment authorization. Customers will see the business name and logo associated with this Venmo profile, and it will show up in the Venmo app as a \"Connected Merchant\". Venmo profile IDs can be found in the Braintree Control Panel. Omitting this value will use the default Venmo profile.\n * @param {string} [options.deepLinkReturnUrl] An override for the URL that the Venmo iOS app opens to return from an app switch.\n * @param {boolean} [options.requireManualReturn=false] When `true`, the customer will have to manually switch back to the browser/webview that is presenting Venmo to complete the payment.\n * @param {boolean} [options.useRedirectForIOS=false] Normally, the Venmo flow is launched using `window.open` and the Venmo app intercepts that call and opens the Venmo app instead. If the customer does not have the Venmo app installed, it opens the Venmo website in a new window and instructs the customer to install the app.\n *\n * In iOS webviews and Safari View Controllers (a webview-like environment which is indistinguishable from Safari for JavaScript environments), this call to `window.open` will always fail to app switch to Venmo, resulting instead in a white screen. Because of this, an alternate approach is required to launch the Venmo flow.\n *\n * When `useRedirectForIOS` is `true` and the Venmo flow is started in an iOS environment, the Venmo flow will be started by setting `window.location.href` to the Venmo website (which will still be intercepted by the Venmo app and should be the same behavior as if `window.open` was called). However, if the customer does not have the Venmo app installed, the merchant page will instead be replaced with the Venmo website and the customer will need to use the browser's back button to return to the merchant's website. Ensure that your customer's checkout information will not be lost if they are navigated away from the website and return using the browser back button.\n *\n * Due to a bug in iOS's implementation of `window.open` in iOS webviews and Safari View Controllers, if `useRedirectForIOS` is not set to `true` and the flow is launched from an iOS webview or Safari View Controller, the customer will be presented with a blank screen, halting the flow and leaving the customer unable to return to the merchant's website. Setting `useRedirectForIOS` to `true` will allow the flow to continue, but the Venmo app will be unable to return back to the webview/Safari View Controller. It will instead open the merchant's site in a new window in the customer's browser, which means the merchant site must be able to process the Venmo payment. If the SDK is configured with `allowNewBrowserTab = false`, it is unlikely that the website is set up to process the Venmo payment from a new window.\n *\n * If processing the payment from a new window is not possible, use this flag in conjunction with `requireManualReturn` so that the customer may start the flow from a webview/Safari View Controller or their Safari browser and manually return to the place that originated the flow once the Venmo app has authorized the payment and instructed them to do so.\n * @param {callback} [callback] The second argument, `data`, is the {@link Venmo} instance. If no callback is provided, `create` returns a promise that resolves with the {@link Venmo} instance.\n * @example\n * braintree.venmo.create({\n * client: clientInstance\n * }).then(function (venmoInstance) {\n * // venmoInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating Venmo instance', createErr);\n * });\n * @example
Allow desktop flow to be used\n * braintree.venmo.create({\n * client: clientInstance,\n * }).then(function (venmoInstance) {\n * // venmoInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating Venmo instance', createErr);\n * });\n * @returns {(Promise|void)} Returns the Venmo instance.\n */\n\n function create(options) {\n var name = 'Venmo';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n var createPromise, instance;\n\n if (options.profileId && typeof options.profileId !== 'string') {\n return Promise.reject(new BraintreeError(errors.VENMO_INVALID_PROFILE_ID));\n }\n\n if (options.deepLinkReturnUrl && typeof options.deepLinkReturnUrl !== 'string') {\n return Promise.reject(new BraintreeError(errors.VENMO_INVALID_DEEP_LINK_RETURN_URL));\n }\n\n createPromise = createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n }).then(function (client) {\n var configuration = client.getConfiguration();\n options.client = client;\n\n if (!configuration.gatewayConfiguration.payWithVenmo) {\n return Promise.reject(new BraintreeError(errors.VENMO_NOT_ENABLED));\n }\n\n return client;\n });\n options.createPromise = createPromise;\n instance = new Venmo(options);\n analytics.sendEvent(createPromise, 'venmo.initialized');\n return createPromise.then(function () {\n return instance;\n });\n });\n }\n /**\n * @static\n * @function isBrowserSupported\n * @param {object} [options] browser support options:\n * @param {boolean} [options.allowNewBrowserTab=true] This should be set to false if your payment flow requires returning to the same tab, e.g. single page applications.\n * @param {boolean} [options.allowWebviews=true] This should be set to false if your payment flow does not occur from within a webview that you control.\n * @example\n * if (braintree.venmo.isBrowserSupported()) {\n * // set up Venmo\n * }\n * @example
Explicitly require browser support returning to the same tab\n * if (braintree.venmo.isBrowserSupported({\n * allowNewBrowserTab: false\n * })) {\n * // set up Venmo\n * }\n * @example
Explicitly set webviews as disallowed browsers\n * if (braintree.venmo.isBrowserSupported({\n * allowWebviews: false\n * })) {\n * // set up Venmo\n * }\n * @returns {boolean} Whether or not the browser supports Venmo.\n */\n\n\n function isBrowserSupported(options) {\n return supportsVenmo.isBrowserSupported(options);\n }\n\n module.exports = {\n create: wrapPromise(create),\n isBrowserSupported: isBrowserSupported,\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 121,\n \"../lib/basic-component-verification\": 124,\n \"../lib/braintree-error\": 126,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/promise\": 159,\n \"./shared/errors\": 215,\n \"./shared/supports-venmo\": 217,\n \"./venmo\": 218,\n \"@braintree/wrap-promise\": 44\n }],\n 213: [function (_dereq_, module, exports) {\n 'use strict';\n\n var isAndroid = _dereq_('@braintree/browser-detection/is-android');\n\n var isChrome = _dereq_('@braintree/browser-detection/is-chrome');\n\n var isIos = _dereq_('@braintree/browser-detection/is-ios');\n\n var isIosSafari = _dereq_('@braintree/browser-detection/is-ios-safari');\n\n var isIosWebview = _dereq_('@braintree/browser-detection/is-ios-webview');\n\n function isAndroidWebview() {\n return isAndroid() && window.navigator.userAgent.toLowerCase().indexOf('wv') > -1;\n }\n\n module.exports = {\n isAndroid: isAndroid,\n isAndroidWebview: isAndroidWebview,\n isChrome: isChrome,\n isIos: isIos,\n isIosSafari: isIosSafari,\n isIosWebview: isIosWebview\n };\n }, {\n \"@braintree/browser-detection/is-android\": 20,\n \"@braintree/browser-detection/is-chrome\": 22,\n \"@braintree/browser-detection/is-ios\": 31,\n \"@braintree/browser-detection/is-ios-safari\": 28,\n \"@braintree/browser-detection/is-ios-webview\": 29\n }],\n 214: [function (_dereq_, module, exports) {\n 'use strict';\n\n module.exports = {\n DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY: 500,\n DEFAULT_PROCESS_RESULTS_DELAY: 1000,\n VENMO_OPEN_URL: 'https://venmo.com/braintree/checkout'\n };\n }, {}],\n 215: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Venmo - Creation Error Codes\n * @description Errors that occur when [creating the Venmo component](./module-braintree-web_venmo.html#.create).\n * @property {MERCHANT} VENMO_NOT_ENABLED Occurs when Venmo is not enabled on the Braintree control panel.\n * @property {MERCHANT} VENMO_INVALID_PROFILE_ID Occurs when Venmo is initialized with a profile id, but it is invalid.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_SETUP_FAILED Occurs when enabling mobile polling alternative for tokenization fails.\n */\n\n /**\n * @name BraintreeError.Venmo - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./Venmo.html#tokenize).\n * @property {MERCHANT} VENMO_TOKENIZATION_REQUEST_ACTIVE Occurs when `tokenize` is called when the flow is already in progress.\n * @property {MERCHANT} VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE Occurs when `cancelTokenization` is called when the flow is not in progress.\n * @property {UNKNOWN} VENMO_APP_FAILED Occurs when tokenization fails.\n * @property {CUSTOMER} VENMO_APP_CANCELED Occurs when customer cancels flow from the Venmo app.\n * @property {CUSTOMER} VENMO_CANCELED Occurs when customer cancels the flow or Venmo app is not available.\n * @property {CUSTOMER} VENMO_DESKTOP_CANCELED Occurs when customer cancels the Venmo Desktop flow by closing the modal.\n * @property {MERCHANT} VENMO_TOKENIZATION_CANCELED_BY_MERCHANT Occurs when `cancelTokenization` is called while tokenization is in progress.\n * @property {UNKNOWN} VENMO_DESKTOP_UNKNOWN_ERROR Occurs when an unknown error causes the Venmo Desktop flow to fail.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR Occurs when an unknown network error causes the mobile polling process to fail.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED Occurs when the polling has expired and the payment cannot be completed.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED Occurs when the polling operation is canceled by the customer.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT Occurs when customer takes too long to complete payment.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_TOKENIZATION_FAILED Occurs if there is an unknown error during the mobile polling process.\n */\n\n var BraintreeError = _dereq_('../../lib/braintree-error');\n\n module.exports = {\n VENMO_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'VENMO_NOT_ENABLED',\n message: 'Venmo is not enabled for this merchant.'\n },\n VENMO_TOKENIZATION_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: 'VENMO_TOKENIZATION_REQUEST_ACTIVE',\n message: 'Another tokenization request is active.'\n },\n VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: 'VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE',\n message: 'No tokenization in progress.'\n },\n VENMO_APP_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: 'VENMO_APP_FAILED',\n message: 'Venmo app encountered a problem.'\n },\n VENMO_APP_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'VENMO_APP_CANCELED',\n message: 'Venmo app authorization was canceled.'\n },\n VENMO_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'VENMO_CANCELED',\n message: 'User canceled Venmo authorization, or Venmo app is not available.'\n },\n VENMO_DESKTOP_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'VENMO_DESKTOP_CANCELED',\n message: 'User canceled Venmo authorization by closing the Venmo Desktop modal.'\n },\n VENMO_TOKENIZATION_CANCELED_BY_MERCHANT: {\n type: BraintreeError.types.MERCHANT,\n code: 'VENMO_TOKENIZATION_CANCELED_BY_MERCHANT',\n message: 'The Venmo tokenization was canceled by the merchant.'\n },\n VENMO_DESKTOP_UNKNOWN_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: 'VENMO_DESKTOP_UNKNOWN_ERROR',\n message: 'Something went wrong with the Venmo Desktop flow.'\n },\n VENMO_MOBILE_POLLING_SETUP_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: 'VENMO_MOBILE_POLLING_SETUP_FAILED',\n message: 'Something went wrong setting up Venmo for mobile polling.'\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: 'VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR',\n message: 'Something went wrong during mobile polling.'\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED',\n message: 'The Venmo authorization request is expired.'\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: 'VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED',\n message: 'The Venmo authorization was canceled'\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT: {\n type: BraintreeError.types.CUSTOMER,\n code: 'VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT',\n message: 'Customer took too long to authorize Venmo payment.'\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: 'VENMO_MOBILE_POLLING_TOKENIZATION_FAILED',\n message: 'The Venmo authorization failed.'\n },\n VENMO_INVALID_PROFILE_ID: {\n type: BraintreeError.types.MERCHANT,\n code: 'VENMO_INVALID_PROFILE_ID',\n message: 'Venmo profile ID is invalid.'\n },\n VENMO_INVALID_DEEP_LINK_RETURN_URL: {\n type: BraintreeError.types.MERCHANT,\n code: 'VENMO_INVALID_DEEP_LINK_RETURN_URL',\n message: 'Venmo deep link return URL is invalid.'\n }\n };\n }, {\n \"../../lib/braintree-error\": 126\n }],\n 216: [function (_dereq_, module, exports) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.VENMO_DESKTOP_UNKNOWN_ERROR = exports.VENMO_DESKTOP_REQUEST_NEW_QR_CODE = exports.VENMO_DESKTOP_CLOSED_FROM_PARENT = exports.VENMO_DESKTOP_IFRAME_READY = exports.VENMO_DESKTOP_DISPLAY_QR_CODE = exports.VENMO_DESKTOP_DISPLAY_ERROR = exports.VENMO_DESKTOP_CUSTOMER_CANCELED = exports.VENMO_DESKTOP_AUTHORIZATION_COMPLETED = exports.VENMO_DESKTOP_AUTHORIZING = exports.VENMO_DESKTOP_AUTHORIZE = exports.VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT = void 0;\n exports.VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT = \"VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT\";\n exports.VENMO_DESKTOP_AUTHORIZE = \"VENMO_DESKTOP_AUTHORIZE\";\n exports.VENMO_DESKTOP_AUTHORIZING = \"VENMO_DESKTOP_AUTHORIZING\";\n exports.VENMO_DESKTOP_AUTHORIZATION_COMPLETED = \"VENMO_DESKTOP_AUTHORIZATION_COMPLETED\";\n exports.VENMO_DESKTOP_CUSTOMER_CANCELED = \"VENMO_DESKTOP_CUSTOMER_CANCELED\";\n exports.VENMO_DESKTOP_DISPLAY_ERROR = \"VENMO_DESKTOP_DISPLAY_ERROR\";\n exports.VENMO_DESKTOP_DISPLAY_QR_CODE = \"VENMO_DESKTOP_DISPLAY_QR_CODE\";\n exports.VENMO_DESKTOP_IFRAME_READY = \"VENMO_DESKTOP_IFRAME_READY\";\n exports.VENMO_DESKTOP_CLOSED_FROM_PARENT = \"VENMO_DESKTOP_CLOSED_FROM_PARENT\";\n exports.VENMO_DESKTOP_REQUEST_NEW_QR_CODE = \"VENMO_DESKTOP_REQUEST_NEW_QR_CODE\";\n exports.VENMO_DESKTOP_UNKNOWN_ERROR = \"VENMO_DESKTOP_UNKNOWN_ERROR\";\n }, {}],\n 217: [function (_dereq_, module, exports) {\n 'use strict';\n\n var browserDetection = _dereq_('./browser-detection');\n\n function isBrowserSupported(options) {\n var merchantAllowsReturningToNewBrowserTab, merchantAllowsWebviews, merchantAllowsDesktopBrowsers;\n var isAndroid = browserDetection.isAndroid();\n var isMobileDevice = isAndroid || browserDetection.isIos();\n var isAndroidChrome = isAndroid && browserDetection.isChrome();\n var isMobileDeviceThatSupportsReturnToSameTab = browserDetection.isIosSafari() || isAndroidChrome;\n options = options || {}; // NEXT_MAJOR_VERSION allowDesktop will default to true, but can be opted out\n\n merchantAllowsDesktopBrowsers = options.allowDesktop === true;\n merchantAllowsReturningToNewBrowserTab = options.hasOwnProperty('allowNewBrowserTab') ? options.allowNewBrowserTab : true; // NEXT_MAJOR_VERSION webviews are not supported, except for the case where\n // the merchant themselves is presenting venmo in a webview using the deep\n // link url to get back to their app. For the next major version, we should\n // just not have this option and instead require the merchant to determine\n // if the venmo button should be displayed when presenting it in the\n // merchant's app via a webview.\n\n merchantAllowsWebviews = options.hasOwnProperty('allowWebviews') ? options.allowWebviews : true;\n\n if (!merchantAllowsWebviews && (browserDetection.isAndroidWebview() || browserDetection.isIosWebview())) {\n return false;\n }\n\n if (!merchantAllowsReturningToNewBrowserTab) {\n if (isMobileDeviceThatSupportsReturnToSameTab) {\n return true;\n }\n\n return merchantAllowsDesktopBrowsers && !isMobileDevice;\n }\n\n if (!merchantAllowsDesktopBrowsers) {\n return isMobileDevice;\n }\n\n return true;\n }\n\n module.exports = {\n isBrowserSupported: isBrowserSupported\n };\n }, {\n \"./browser-detection\": 213\n }],\n 218: [function (_dereq_, module, exports) {\n 'use strict';\n\n var analytics = _dereq_('../lib/analytics');\n\n var isBrowserSupported = _dereq_('./shared/supports-venmo');\n\n var browserDetection = _dereq_('./shared/browser-detection');\n\n var constants = _dereq_('./shared/constants');\n\n var errors = _dereq_('./shared/errors');\n\n var querystring = _dereq_('../lib/querystring');\n\n var isVerifiedDomain = _dereq_('../lib/is-verified-domain');\n\n var methods = _dereq_('../lib/methods');\n\n var convertMethodsToError = _dereq_('../lib/convert-methods-to-error');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var inIframe = _dereq_('../lib/in-iframe');\n\n var Promise = _dereq_('../lib/promise');\n\n var ExtendedPromise = _dereq_('@braintree/extended-promise'); // NEXT_MAJOR_VERSION the source code for this is actually in a\n // typescript repo called venmo-desktop, once the SDK is migrated\n // to typescript, we can move the TS files out of that separate\n // repo and into the web SDK properly\n\n\n var createVenmoDesktop = _dereq_('./external/');\n\n var graphqlQueries = _dereq_('./external/queries');\n\n var VERSION = \"3.76.1\";\n var DEFAULT_MOBILE_POLLING_INTERVAL = 250; // 1/4 second\n\n var DEFAULT_MOBILE_EXPIRING_THRESHOLD = 300000; // 5 minutes\n\n /**\n * Venmo tokenize payload.\n * @typedef {object} Venmo~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `VenmoAccount`.\n * @property {object} details Additional Venmo account details.\n * @property {string} details.username Username of the Venmo account.\n */\n\n /**\n * @class\n * @param {object} options The Venmo {@link module:braintree-web/venmo.create create} options.\n * @description
Do not use this constructor directly. Use {@link module:braintree-web/venmo.create|braintree-web.venmo.create} instead.\n * @classdesc This class represents a Venmo component produced by {@link module:braintree-web/venmo.create|braintree-web/venmo.create}. Instances of this class have methods for tokenizing Venmo payments.\n */\n\n function Venmo(options) {\n var self = this;\n this._createPromise = options.createPromise;\n this._allowNewBrowserTab = options.allowNewBrowserTab !== false;\n this._allowWebviews = options.allowWebviews !== false;\n this._allowDesktop = options.allowDesktop === true;\n this._requireManualReturn = options.requireManualReturn === true;\n this._useRedirectForIOS = options.useRedirectForIOS === true;\n this._profileId = options.profileId;\n this._deepLinkReturnUrl = options.deepLinkReturnUrl;\n this._ignoreHistoryChanges = options.ignoreHistoryChanges;\n this._useDesktopFlow = this._allowDesktop && this._isDesktop();\n this._useMobilePollingStrategy = inIframe() || this._requireManualReturn;\n analytics.sendEvent(this._createPromise, 'venmo.desktop-flow.configured.' + String(Boolean(this._allowDesktop)));\n\n if (this._useDesktopFlow) {\n this._createPromise = this._createPromise.then(function (client) {\n var config = client.getConfiguration().gatewayConfiguration;\n return createVenmoDesktop({\n url: config.assetsUrl + '/web/' + VERSION + '/html/venmo-desktop-frame.html',\n environment: config.environment === 'production' ? 'PRODUCTION' : 'SANDBOX',\n Promise: Promise,\n apiRequest: function apiRequest(query, data) {\n return client.request({\n api: 'graphQLApi',\n data: {\n query: query,\n variables: data\n }\n }).then(function (response) {\n return response.data;\n });\n },\n sendEvent: function sendEvent(eventName) {\n analytics.sendEvent(self._createPromise, eventName);\n },\n verifyDomain: isVerifiedDomain\n }).then(function (venmoDesktopInstance) {\n self._venmoDesktopInstance = venmoDesktopInstance;\n analytics.sendEvent(self._createPromise, 'venmo.desktop-flow.presented');\n return client;\n }).catch(function () {\n analytics.sendEvent(self._createPromise, 'venmo.desktop-flow.setup-failed');\n self._useDesktopFlow = false;\n return client;\n });\n });\n } else if (this._useMobilePollingStrategy) {\n this._mobilePollingInterval = DEFAULT_MOBILE_POLLING_INTERVAL;\n this._mobilePollingExpiresThreshold = DEFAULT_MOBILE_EXPIRING_THRESHOLD;\n this._createPromise = this._createPromise.then(function (client) {\n var config = client.getConfiguration().gatewayConfiguration;\n self._mobilePollingContextEnvironment = config.environment.toUpperCase();\n return client.request({\n api: 'graphQLApi',\n data: {\n query: graphqlQueries.CREATE_VENMO_DESKTOP_PAYMENT_RESOURCE_QUERY,\n variables: {\n input: {\n environment: self._mobilePollingContextEnvironment,\n intent: 'PAY_FROM_APP'\n }\n }\n }\n }).then(function (response) {\n var context = response.data.createVenmoQRCodePaymentContext.venmoQRCodePaymentContext;\n self._mobilePollingContextStatus = context.status;\n self._mobilePollingContextId = context.id; // TODO should maybe do polling here at the halfway point for expiration\n // and recreate the payment context id, and abort if at any time before\n // the payment context switch happens if tokenization is in progress\n\n analytics.sendEvent(self._createPromise, 'venmo.mobile-polling.presented');\n return client;\n }).catch(function (err) {\n analytics.sendEvent(self._createPromise, 'venmo.mobile-polling.setup-failed');\n return Promise.reject(new BraintreeError({\n type: errors.VENMO_MOBILE_POLLING_SETUP_FAILED.type,\n code: errors.VENMO_MOBILE_POLLING_SETUP_FAILED.code,\n message: errors.VENMO_MOBILE_POLLING_SETUP_FAILED.message,\n details: {\n originalError: err\n }\n }));\n });\n });\n }\n }\n\n Venmo.prototype.getUrl = function () {\n return this._createPromise.then(function (client) {\n var configuration = client.getConfiguration();\n var params = {};\n var currentUrl = this._deepLinkReturnUrl || window.location.href.replace(window.location.hash, '');\n var venmoConfiguration = configuration.gatewayConfiguration.payWithVenmo;\n var analyticsMetadata = configuration.analyticsMetadata;\n var accessToken = venmoConfiguration.accessToken;\n var braintreeData = {\n _meta: {\n version: analyticsMetadata.sdkVersion,\n integration: analyticsMetadata.integration,\n platform: analyticsMetadata.platform,\n sessionId: analyticsMetadata.sessionId\n }\n };\n currentUrl = currentUrl.replace(/#*$/, '');\n\n if (this._mobilePollingContextId) {\n accessToken += '|pcid:' + this._mobilePollingContextId;\n }\n\n if (this._shouldIncludeReturnUrls()) {\n params['x-success'] = currentUrl + '#venmoSuccess=1';\n params['x-cancel'] = currentUrl + '#venmoCancel=1';\n params['x-error'] = currentUrl + '#venmoError=1';\n } else {\n params['x-success'] = 'NOOP';\n params['x-cancel'] = 'NOOP';\n params['x-error'] = 'NOOP';\n }\n\n params.ua = window.navigator.userAgent;\n /* eslint-disable camelcase */\n\n params.braintree_merchant_id = this._profileId || venmoConfiguration.merchantId;\n params.braintree_access_token = accessToken;\n params.braintree_environment = venmoConfiguration.environment;\n params.braintree_sdk_data = btoa(JSON.stringify(braintreeData));\n /* eslint-enable camelcase */\n\n return constants.VENMO_OPEN_URL + '?' + querystring.stringify(params);\n }.bind(this));\n };\n /**\n * Returns a boolean indicating whether the current browser supports Venmo as a payment method.\n *\n * If `options.allowNewBrowserTab` is false when calling {@link module:braintree-web/venmo.create|venmo.create}, this method will return true only for browsers known to support returning from the Venmo app to the same browser tab. Currently, this is limited to iOS Safari and Android Chrome.\n * If `options.allowWebviews` is false when calling {@link module:braintree-web/venmo.create|venmo.create}, this method will return true only for mobile browsers that are not webviews.\n * @public\n * @returns {boolean} True if the current browser is supported, false if not.\n */\n\n\n Venmo.prototype.isBrowserSupported = function () {\n return isBrowserSupported.isBrowserSupported({\n allowNewBrowserTab: this._allowNewBrowserTab,\n allowWebviews: this._allowWebviews,\n allowDesktop: this._allowDesktop\n });\n };\n /**\n * Returns a boolean indicating whether a Venmo tokenization result is ready to be processed immediately.\n *\n * This method should be called after initialization to see if the result of Venmo authorization is available. If it returns true, call {@link Venmo#tokenize|tokenize} immediately to process the results.\n *\n * @public\n * @returns {boolean} True if the results of Venmo payment authorization are available and ready to process.\n */\n\n\n Venmo.prototype.hasTokenizationResult = function () {\n return this._hasTokenizationResult();\n }; // a private version that lets us pass in a custom hash\n // when listening on a hashchange event\n\n\n Venmo.prototype._hasTokenizationResult = function (hash) {\n var params = getFragmentParameters(hash);\n return typeof (params.venmoSuccess || params.venmoError || params.venmoCancel) !== 'undefined';\n };\n\n Venmo.prototype._shouldIncludeReturnUrls = function () {\n // when a deep link return url is passed, we should always\n // respect it and include the return urls so the venmo app\n // can app switch back to it\n if (this._deepLinkReturnUrl) {\n return true;\n } // when the sdk is initialized within an iframe, it's\n // impossible to return back to the correct place automatically\n // without also setting a deepLinkReturnUrl. When the return\n // urls are omitted, the Venmo app prompts the user to return\n // manually.\n\n\n return !this._useMobilePollingStrategy;\n };\n\n Venmo.prototype._isDesktop = function () {\n return !(browserDetection.isIos() || browserDetection.isAndroid());\n };\n /**\n * Launches the Venmo flow and returns a nonce payload.\n *\n * If {@link Venmo#hasTokenizationResult|hasTokenizationResult} returns true, calling tokenize will immediately process and return the results without initiating the Venmo payment authorization flow.\n *\n * Only one Venmo flow can be active at a time. One way to achieve this is to disable your Venmo button while the flow is open.\n * @public\n * @param {object} [options] Options for tokenization.\n * @param {number} [options.processResultsDelay=500] The amount of time in milliseconds to delay processing the results. In most cases, this value should be left as the default.\n * @param {callback} [callback] The second argument,
data
, is a {@link Venmo~tokenizePayload|tokenizePayload}. If no callback is provided, the method will return a Promise that resolves with a {@link Venmo~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because tokenize opens a new window, this must be called\n * // as a result of a user action, such as a button click.\n * venmoInstance.tokenize().then(function (payload) {\n * // Submit payload.nonce to your server\n * // Use payload.username to get the Venmo username and display any UI\n * }).catch(function (tokenizeError) {\n * // Handle flow errors or premature flow closure\n * switch (tokenizeErr.code) {\n * case 'VENMO_APP_CANCELED':\n * console.log('User canceled Venmo flow.');\n * break;\n * case 'VENMO_CANCELED':\n * console.log('User canceled Venmo, or Venmo app is not available.');\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * }).then(function () {\n * button.removeAttribute('disabled');\n * });\n * });\n */\n\n\n Venmo.prototype.tokenize = function (options) {\n var self = this;\n var tokenizationPromise;\n options = options || {};\n\n if (this._tokenizationInProgress === true) {\n return Promise.reject(new BraintreeError(errors.VENMO_TOKENIZATION_REQUEST_ACTIVE));\n }\n\n this._tokenizationInProgress = true;\n\n if (this._useDesktopFlow) {\n // for the desktop flow, we create a venmo payment\n // context and then present a qr code modal to the\n // customer and they will open up their venmo app\n // and scan it and approve the purchase on their\n // mobile device. The sdk will start polling\n // in order to determine when the status of the\n // payment context has updated and then pass the\n // resulting nonce back to the merchant.\n tokenizationPromise = this._tokenizeForDesktop(options);\n } else if (this._useMobilePollingStrategy) {\n // when the sdk is in an iframe, venmo cannot app\n // switch back with the nonce params encoded in\n // the hash like the normal mobile flow, so instead\n // we create a venmo payment context and instruct\n // the venmo app to update it with a nonce. We then\n // do polling on the sdk to get updates on the\n // payment context status, and return back the\n // nonce when we receive it.\n tokenizationPromise = this._tokenizeForMobileWithPolling();\n } else {\n // the normal mobile flow is to app switch to the\n // venmo app, and then have the venmo app switch\n // back to the page with the venmo nonce details\n // encoded into the hash portion of the url\n tokenizationPromise = this._tokenizeForMobileWithHashChangeListeners(options);\n }\n\n return tokenizationPromise.then(function (payload) {\n self._tokenizationInProgress = false;\n return formatTokenizePayload(payload);\n }).catch(function (err) {\n self._tokenizationInProgress = false;\n return Promise.reject(err);\n });\n };\n /**\n * Cancels the venmo tokenization process\n *\n * @public\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * venmoTokenizeButton.addEventListener('click', function () {\n * venmoInstance.tokenize().then(function (payload) {\n * // handle payload\n * }).catch(function (err) {\n * if (err.code === 'VENMO_TOKENIZATION_CANCELED_BY_MERCHANT') {\n * // tokenization was canceled by calling cancelTokenization\n * }\n * });\n * });\n *\n * venmoCancelButton.addEventListener('click', function () {\n * // Hide the button when the venmo flow is not in progress\n * venmoCancelButton.style.display = \"none\";\n *\n * venmoInstance.cancelTokenization().then(function () {\n * // done canceling the flow\n * }).catch(function (err) {\n * // should only get here if there is no tokenization in progress\n * });\n * });\n */\n\n\n Venmo.prototype.cancelTokenization = function () {\n if (!this._tokenizationInProgress) {\n return Promise.reject(new BraintreeError(errors.VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE));\n }\n\n this._removeVisibilityEventListener(); // important to reject the tokenization promise first\n // so the tokenize method rejects with this error\n // rather than a customer canceled error in the mobile\n // polling and desktop flows\n\n\n if (this._tokenizePromise) {\n this._tokenizePromise.reject(new BraintreeError(errors.VENMO_TOKENIZATION_CANCELED_BY_MERCHANT));\n }\n\n return Promise.all([this._cancelMobilePollingContext(), this._cancelVenmoDesktopContext()]);\n };\n\n Venmo.prototype._pollForStatusChange = function () {\n var self = this;\n\n if (Date.now() > self._mobilePollingContextExpiresIn) {\n return Promise.reject(new BraintreeError(errors.VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT));\n }\n\n return this._createPromise.then(function (client) {\n return client.request({\n api: 'graphQLApi',\n data: {\n query: graphqlQueries.VENMO_DESKTOP_PAYMENT_RESOURCE_STATUS_QUERY,\n variables: {\n id: self._mobilePollingContextId\n }\n }\n });\n }).catch(function (networkError) {\n return Promise.reject(new BraintreeError({\n type: errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.type,\n code: errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.code,\n message: errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.message,\n details: {\n originalError: networkError\n }\n }));\n }).then(function (response) {\n var node = response.data.node;\n var newStatus = node.status;\n\n if (newStatus !== self._mobilePollingContextStatus) {\n self._mobilePollingContextStatus = newStatus;\n analytics.sendEvent(self._createPromise, 'venmo.tokenize.mobile-polling.status-change.' + newStatus.toLowerCase());\n\n switch (newStatus) {\n case 'EXPIRED':\n case 'FAILED':\n case 'CANCELED':\n return Promise.reject(new BraintreeError(errors['VENMO_MOBILE_POLLING_TOKENIZATION_' + newStatus]));\n\n case 'APPROVED':\n return Promise.resolve(node);\n\n case 'CREATED':\n case 'SCANNED':\n default: // any other statuses are irrelevant to the polling\n // and can just be ignored\n\n }\n }\n\n return new Promise(function (resolve, reject) {\n setTimeout(function () {\n self._pollForStatusChange().then(resolve).catch(reject);\n }, self._mobilePollingInterval);\n });\n });\n };\n\n Venmo.prototype._tokenizeForMobileWithPolling = function () {\n var self = this;\n analytics.sendEvent(this._createPromise, 'venmo.tokenize.mobile-polling.start');\n this._mobilePollingContextExpiresIn = Date.now() + this._mobilePollingExpiresThreshold;\n this._tokenizePromise = new ExtendedPromise();\n\n this._pollForStatusChange().then(function (payload) {\n analytics.sendEvent(self._createPromise, 'venmo.tokenize.mobile-polling.success');\n\n self._tokenizePromise.resolve({\n paymentMethodNonce: payload.paymentMethodId,\n username: '@' + (payload.userName || '').replace('@', '')\n }); // TODO should create a new payment context in case the customer authorizes again\n\n }).catch(function (err) {\n analytics.sendEvent(self._createPromise, 'venmo.tokenize.mobile-polling.failure');\n\n self._tokenizePromise.reject(err);\n });\n\n return this.getUrl().then(function (url) {\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.start.browser');\n\n if (browserDetection.isIosWebview() || self._shouldUseRedirectStrategy()) {\n window.location.href = url;\n } else {\n window.open(url);\n }\n\n return self._tokenizePromise;\n });\n };\n\n Venmo.prototype._shouldUseRedirectStrategy = function () {\n if (!browserDetection.isIos()) {\n return false;\n }\n\n return this._useRedirectForIOS;\n };\n\n Venmo.prototype._tokenizeForMobileWithHashChangeListeners = function (options) {\n var self = this;\n var resultProcessingInProgress, visibilityChangeListenerTimeout;\n\n if (this.hasTokenizationResult()) {\n return this._processResults();\n }\n\n analytics.sendEvent(this._createPromise, 'venmo.tokenize.mobile.start');\n this._tokenizePromise = new ExtendedPromise();\n this._previousHash = window.location.hash;\n\n function completeFlow(hash) {\n var error;\n\n self._processResults(hash).catch(function (err) {\n error = err;\n }).then(function (res) {\n if (!self._ignoreHistoryChanges && window.location.hash !== self._previousHash) {\n window.location.hash = self._previousHash;\n }\n\n self._removeVisibilityEventListener();\n\n if (error) {\n self._tokenizePromise.reject(error);\n } else {\n self._tokenizePromise.resolve(res);\n }\n\n delete self._tokenizePromise;\n });\n } // The Venmo SDK app switches back with the results of the\n // tokenization encoded in the hash\n\n\n this._onHashChangeListener = function (e) {\n var hash = e.newURL.split('#')[1];\n\n if (!self._hasTokenizationResult(hash)) {\n return;\n }\n\n resultProcessingInProgress = true;\n clearTimeout(visibilityChangeListenerTimeout);\n completeFlow(hash);\n };\n\n window.addEventListener('hashchange', this._onHashChangeListener, false); // Subscribe to document visibility change events to detect when app switch\n // has returned. Acts as a fallback for the hashchange listener and catches\n // the cancel case via manual app switch back\n\n this._visibilityChangeListener = function () {\n var delay = options.processResultsDelay || constants.DEFAULT_PROCESS_RESULTS_DELAY;\n\n if (!window.document.hidden) {\n if (!resultProcessingInProgress) {\n visibilityChangeListenerTimeout = setTimeout(completeFlow, delay);\n }\n }\n };\n\n return this.getUrl().then(function (url) {\n if (self._deepLinkReturnUrl) {\n if (isIosWebviewInDeepLinkReturnUrlFlow()) {\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.start.ios-webview'); // Deep link URLs do not launch iOS apps from a webview when using window.open or PopupBridge.open.\n\n window.location.href = url;\n } else if (window.popupBridge && typeof window.popupBridge.open === 'function') {\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.start.popup-bridge');\n window.popupBridge.open(url);\n } else {\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.start.webview');\n window.open(url);\n }\n } else {\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.start.browser');\n\n if (self._shouldUseRedirectStrategy()) {\n window.location.href = url;\n } else {\n window.open(url);\n }\n } // Add a brief delay to ignore visibility change events that occur right before app switch\n\n\n setTimeout(function () {\n window.document.addEventListener(documentVisibilityChangeEventName(), self._visibilityChangeListener);\n }, constants.DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY);\n return self._tokenizePromise;\n });\n };\n\n Venmo.prototype._tokenizeForDesktop = function () {\n var self = this;\n analytics.sendEvent(this._createPromise, 'venmo.tokenize.desktop.start');\n this._tokenizePromise = new ExtendedPromise();\n\n this._createPromise.then(function () {\n return self._venmoDesktopInstance.launchDesktopFlow();\n }).then(function (payload) {\n self._venmoDesktopInstance.hideDesktopFlow();\n\n analytics.sendEvent(self._createPromise, 'venmo.tokenize.desktop.success');\n\n self._tokenizePromise.resolve(payload);\n }).catch(function (err) {\n analytics.sendEvent(self._createPromise, 'venmo.tokenize.desktop.failure');\n\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.hideDesktopFlow();\n }\n\n if (err && err.reason === 'CUSTOMER_CANCELED') {\n self._tokenizePromise.reject(new BraintreeError(errors.VENMO_DESKTOP_CANCELED));\n\n return;\n }\n\n self._tokenizePromise.reject(new BraintreeError({\n type: errors.VENMO_DESKTOP_UNKNOWN_ERROR.type,\n code: errors.VENMO_DESKTOP_UNKNOWN_ERROR.code,\n message: errors.VENMO_DESKTOP_UNKNOWN_ERROR.message,\n details: {\n originalError: err\n }\n }));\n });\n\n return this._tokenizePromise;\n }; // TODO remove this once initial testing is done\n\n\n Venmo.prototype._updateVenmoDesktopPaymentContext = function (status, options) {\n return this._venmoDesktopInstance.updateVenmoDesktopPaymentContext(status, options);\n };\n\n Venmo.prototype._cancelMobilePollingContext = function () {\n var self = this;\n return this._createPromise.then(function (client) {\n if (self._mobilePollingContextId) {\n return client.request({\n api: 'graphQLApi',\n data: {\n query: graphqlQueries.UPDATE_VENMO_DESKTOP_PAYMENT_RESOURCE_QUERY,\n variables: {\n input: {\n id: self._mobilePollingContextId,\n status: 'CANCELED'\n }\n }\n }\n });\n }\n\n return Promise.resolve();\n });\n };\n\n Venmo.prototype._cancelVenmoDesktopContext = function () {\n var self = this;\n return this._createPromise.then(function () {\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.updateVenmoDesktopPaymentContext('CANCELED');\n }\n\n return Promise.resolve();\n });\n };\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/venmo.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * venmoInstance.teardown();\n * @example
With callback\n * venmoInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n Venmo.prototype.teardown = function () {\n var self = this;\n\n this._removeVisibilityEventListener();\n\n return this._createPromise.then(function () {\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.teardown();\n }\n\n self._cancelMobilePollingContext();\n\n convertMethodsToError(this, methods(Venmo.prototype));\n }.bind(this));\n };\n\n Venmo.prototype._removeVisibilityEventListener = function () {\n window.removeEventListener('hashchange', this._onHashChangeListener);\n window.document.removeEventListener(documentVisibilityChangeEventName(), this._visibilityChangeListener);\n delete this._visibilityChangeListener;\n delete this._onHashChangeListener;\n };\n\n Venmo.prototype._processResults = function (hash) {\n var self = this;\n var params = getFragmentParameters(hash);\n return new Promise(function (resolve, reject) {\n if (params.venmoSuccess) {\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.handle.success');\n resolve(params);\n } else if (params.venmoError) {\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.handle.error');\n reject(new BraintreeError({\n type: errors.VENMO_APP_FAILED.type,\n code: errors.VENMO_APP_FAILED.code,\n message: errors.VENMO_APP_FAILED.message,\n details: {\n originalError: {\n message: decodeURIComponent(params.errorMessage),\n code: params.errorCode\n }\n }\n }));\n } else if (params.venmoCancel) {\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.handle.cancel');\n reject(new BraintreeError(errors.VENMO_APP_CANCELED));\n } else {\n // User has either manually switched back to browser, or app is not available for app switch\n analytics.sendEvent(self._createPromise, 'venmo.appswitch.cancel-or-unavailable');\n reject(new BraintreeError(errors.VENMO_CANCELED));\n }\n\n self._clearFragmentParameters();\n });\n };\n\n Venmo.prototype._clearFragmentParameters = function () {\n if (this._ignoreHistoryChanges) {\n return;\n }\n\n if (typeof window.history.replaceState === 'function' && window.location.hash) {\n history.pushState({}, '', window.location.href.slice(0, window.location.href.indexOf('#')));\n }\n };\n\n function getFragmentParameters(hash) {\n var keyValuesArray = (hash || window.location.hash.substring(1)).split('&');\n return keyValuesArray.reduce(function (toReturn, keyValue) {\n var parts = keyValue.split('='); // some Single Page Apps may pre-pend a / to the first value\n // in the hash, assuming it's a route in their app\n // instead of information from Venmo, this removes all\n // non-alphanumeric characters from the keys in the params\n\n var key = decodeURIComponent(parts[0]).replace(/\\W/g, '');\n var value = decodeURIComponent(parts[1]);\n toReturn[key] = value;\n return toReturn;\n }, {});\n }\n\n function formatTokenizePayload(payload) {\n return {\n nonce: payload.paymentMethodNonce,\n type: 'VenmoAccount',\n details: {\n // NEXT_MAJOR_VERSION the web sdks have a prepended @ sign\n // but the ios and android ones do not. This should be standardized\n username: payload.username\n }\n };\n } // From https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n\n\n function documentVisibilityChangeEventName() {\n var visibilityChange;\n\n if (typeof window.document.hidden !== 'undefined') {\n // Opera 12.10 and Firefox 18 and later support\n visibilityChange = 'visibilitychange';\n } else if (typeof window.document.msHidden !== 'undefined') {\n visibilityChange = 'msvisibilitychange';\n } else if (typeof window.document.webkitHidden !== 'undefined') {\n visibilityChange = 'webkitvisibilitychange';\n }\n\n return visibilityChange;\n }\n\n function isIosWebviewInDeepLinkReturnUrlFlow() {\n // we know it's a webview because this flow only gets\n // used when checking the deep link flow\n // test the platform here to get around custom useragents\n return window.navigator.platform && /iPhone|iPad|iPod/.test(window.navigator.platform);\n }\n\n module.exports = wrapPromise.wrapPrototype(Venmo);\n }, {\n \"../lib/analytics\": 121,\n \"../lib/braintree-error\": 126,\n \"../lib/convert-methods-to-error\": 129,\n \"../lib/in-iframe\": 152,\n \"../lib/is-verified-domain\": 155,\n \"../lib/methods\": 157,\n \"../lib/promise\": 159,\n \"../lib/querystring\": 160,\n \"./external/\": 209,\n \"./external/queries\": 210,\n \"./shared/browser-detection\": 213,\n \"./shared/constants\": 214,\n \"./shared/errors\": 215,\n \"./shared/supports-venmo\": 217,\n \"@braintree/extended-promise\": 35,\n \"@braintree/wrap-promise\": 44\n }],\n 219: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @name BraintreeError.Visa Checkout - Creation Error Codes\n * @description Errors that occur when [creating the Visa Checkout component](./module-braintree-web_venmo.html#.create).\n * @property {MERCHANT} VISA_CHECKOUT_NOT_ENABLED Occurs when Visa Checkout is not enabled in the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.Visa Checkout - createInitOptions Error Codes\n * @description Errors that occur when using the [`createInitOptions` method](./VisaCheckout.html#createInitOptions).\n * @property {MERCHANT} VISA_CHECKOUT_INIT_OPTIONS_REQUIRED Occurs when no options are provided to method.\n */\n\n /**\n * @name BraintreeError.Visa Checkout - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./VisaCheckout.html#tokenize).\n * @property {MERCHANT} VISA_CHECKOUT_PAYMENT_REQUIRED Occurs when no payment data is not provided.\n * @property {NETWORK} VISA_CHECKOUT_TOKENIZATION Occurs when tokenization fails.\n */\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n module.exports = {\n VISA_CHECKOUT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: 'VISA_CHECKOUT_NOT_ENABLED',\n message: 'Visa Checkout is not enabled for this merchant.'\n },\n VISA_CHECKOUT_INIT_OPTIONS_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'VISA_CHECKOUT_INIT_OPTIONS_REQUIRED',\n message: 'initOptions requires an object.'\n },\n VISA_CHECKOUT_PAYMENT_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: 'VISA_CHECKOUT_PAYMENT_REQUIRED',\n message: 'tokenize requires callid, encKey, and encPaymentData.'\n },\n VISA_CHECKOUT_TOKENIZATION: {\n type: BraintreeError.types.NETWORK,\n code: 'VISA_CHECKOUT_TOKENIZATION',\n message: 'A network error occurred when processing the Visa Checkout payment.'\n }\n };\n }, {\n \"../lib/braintree-error\": 126\n }],\n 220: [function (_dereq_, module, exports) {\n 'use strict';\n /**\n * @module braintree-web/visa-checkout\n * @description Processes Visa Checkout. *This component is currently in beta and is subject to change.*\n */\n\n var basicComponentVerification = _dereq_('../lib/basic-component-verification');\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var createDeferredClient = _dereq_('../lib/create-deferred-client');\n\n var createAssetsUrl = _dereq_('../lib/create-assets-url');\n\n var VisaCheckout = _dereq_('./visa-checkout');\n\n var analytics = _dereq_('../lib/analytics');\n\n var errors = _dereq_('./errors');\n\n var VERSION = \"3.76.1\";\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link VisaCheckout} instance. If no callback is provided, `create` returns a promise that resolves with the {@link VisaCheckout} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n function create(options) {\n var name = 'Visa Checkout';\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n options.client = client;\n\n if (!options.client.getConfiguration().gatewayConfiguration.visaCheckout) {\n return Promise.reject(new BraintreeError(errors.VISA_CHECKOUT_NOT_ENABLED));\n }\n\n analytics.sendEvent(options.client, 'visacheckout.initialized');\n return new VisaCheckout(options);\n });\n }\n\n module.exports = {\n create: wrapPromise(create),\n\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 121,\n \"../lib/basic-component-verification\": 124,\n \"../lib/braintree-error\": 126,\n \"../lib/create-assets-url\": 131,\n \"../lib/create-deferred-client\": 133,\n \"../lib/promise\": 159,\n \"./errors\": 219,\n \"./visa-checkout\": 221,\n \"@braintree/wrap-promise\": 44\n }],\n 221: [function (_dereq_, module, exports) {\n 'use strict';\n\n var BraintreeError = _dereq_('../lib/braintree-error');\n\n var analytics = _dereq_('../lib/analytics');\n\n var errors = _dereq_('./errors');\n\n var jsonClone = _dereq_('../lib/json-clone');\n\n var methods = _dereq_('../lib/methods');\n\n var convertMethodsToError = _dereq_('../lib/convert-methods-to-error');\n\n var Promise = _dereq_('../lib/promise');\n\n var wrapPromise = _dereq_('@braintree/wrap-promise');\n\n var cardTypeTransformMap = {\n Visa: 'VISA',\n MasterCard: 'MASTERCARD',\n Discover: 'DISCOVER',\n 'American Express': 'AMEX'\n };\n /**\n * Visa Checkout Address object.\n * @typedef {object} VisaCheckout~Address\n * @property {string} countryCode The customer's country code.\n * @property {string} extendedAddress The customer's extended address.\n * @property {string} firstName The customer's first name.\n * @property {string} lastName The customer's last name.\n * @property {string} locality The customer's locality.\n * @property {string} postalCode The customer's postal code.\n * @property {string} region The customer's region.\n * @property {string} streetAddress The customer's street address.\n * @property {string} phoneNumber The customer's phone number.\n */\n\n /**\n * Visa Checkout UserData object.\n * @typedef {object} VisaCheckout~UserData\n * @property {string} userEmail The customer's email address.\n * @property {string} userFirstName The customer's first name.\n * @property {string} userLastName The customer's last name.\n * @property {string} userFullName The customer's full name.\n * @property {string} userName The customer's username.\n */\n\n /**\n * Visa Checkout tokenize payload.\n * @typedef {object} VisaCheckout~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, always `VisaCheckoutCard`.\n * @property {VisaCheckout~Address} billingAddress The customer's billing address.\n * @property {VisaCheckout~Address} shippingAddress The customer's shipping address.\n * @property {VisaCheckout~UserData} userData Information about the customer.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n /**\n * @class\n * @param {object} options The Visa Checkout {@link module:braintree-web/visa-checkout.create create} options.\n * @description
Do not use this constructor directly. Use {@link module:braintree-web/visa-checkout.create|braintree-web.visa-checkout.create} instead.\n * @classdesc This class represents a Visa Checkout component produced by {@link module:braintree-web/visa-checkout.create|braintree-web/visa-checkout.create}. Instances of this class have methods for interacting with Visa Checkout's JavaScript library.\n */\n\n function VisaCheckout(options) {\n this._client = options.client;\n }\n\n function transformCardTypes(cardTypes) {\n return cardTypes.reduce(function (acc, type) {\n if (cardTypeTransformMap.hasOwnProperty(type)) {\n return acc.concat(cardTypeTransformMap[type]);\n }\n\n return acc;\n }, []);\n }\n /**\n * Creates an `initOptions` object from the passed `options`, applying properties that Braintree needs to transact Visa Checkout.\n *\n * Braintree will apply these properties if they do not exist on the given `options`:\n * - `apikey`\n * - `externalClientId`\n * - `settings.payment.cardBrands`\n *\n * Braintree will overwrite `settings.dataLevel = 'FULL'` to access the full payment method.\n * @public\n * @param {object} options The base `initOptions` that will be used to init Visa Checkout.\n * @param {string} [options.apikey] The API key used to initialize Visa Checkout. When not supplied, Braintree will set this property.\n * @param {string} [options.externalClientId] The external client ID key used to initialize Visa Checkout. When not supplied, Braintree will set this property.\n * @param {object} [options.settings] The settings object used to initialize Visa Checkout.\n * @param {string} [options.settings.dataLevel] The data level used to initialize Visa Checkout. Braintree will overwrite this property to 'FULL'.\n * @param {object} [options.settings.payment] The payment object used to initialize Visa Checkout.\n * @param {string[]} [options.settings.payment.cardBrands] The card brands that Visa Checkout will allow the customer to pay with. When not supplied, Braintree will set this property.\n * @returns {object} `initOptions` The `initOptions` that Visa Checkout should be initialized with.\n */\n\n\n VisaCheckout.prototype.createInitOptions = function (options) {\n var initOptions;\n\n var gatewayConfiguration = this._client.getConfiguration().gatewayConfiguration;\n\n var visaCheckoutConfiguration = gatewayConfiguration.visaCheckout;\n\n if (!options) {\n throw new BraintreeError(errors.VISA_CHECKOUT_INIT_OPTIONS_REQUIRED);\n }\n\n initOptions = jsonClone(options);\n initOptions.apikey = initOptions.apikey || visaCheckoutConfiguration.apikey;\n initOptions.externalClientId = initOptions.externalClientId || visaCheckoutConfiguration.externalClientId;\n initOptions.settings = initOptions.settings || {};\n initOptions.settings.dataLevel = 'FULL';\n initOptions.settings.payment = initOptions.settings.payment || {};\n\n if (!initOptions.settings.payment.cardBrands) {\n initOptions.settings.payment.cardBrands = transformCardTypes(gatewayConfiguration.visaCheckout.supportedCardTypes);\n }\n\n return initOptions;\n };\n /**\n * Tokenizes the Visa Checkout payload, returning a payment method nonce.\n * @public\n * @param {object} payment The object that Visa Checkout supplies on `payment.success`.\n * @param {string} payment.callid Visa Checkout transaction ID associated with this payment.\n * @param {string} payment.encKey The encrypted key used to decrypt the payment data.\n * @param {string} payment.encPaymentData The encrypted payment data.\n * @param {callback} [callback] The second argument,
tokenizePayload
is a {@link VisaCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with the {@link VisaCheckout~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n VisaCheckout.prototype.tokenize = function (payment) {\n var self = this;\n\n if (!payment.callid || !payment.encKey || !payment.encPaymentData) {\n return Promise.reject(new BraintreeError(errors.VISA_CHECKOUT_PAYMENT_REQUIRED));\n }\n\n return this._client.request({\n method: 'post',\n endpoint: 'payment_methods/visa_checkout_cards',\n data: {\n _meta: {\n source: 'visa-checkout'\n },\n visaCheckoutCard: {\n callId: payment.callid,\n encryptedPaymentData: payment.encPaymentData,\n encryptedKey: payment.encKey\n }\n }\n }).then(function (response) {\n analytics.sendEvent(self._client, 'visacheckout.tokenize.succeeded');\n return response.visaCheckoutCards[0];\n }).catch(function (err) {\n analytics.sendEvent(self._client, 'visacheckout.tokenize.failed');\n return Promise.reject(new BraintreeError({\n type: errors.VISA_CHECKOUT_TOKENIZATION.type,\n code: errors.VISA_CHECKOUT_TOKENIZATION.code,\n message: errors.VISA_CHECKOUT_TOKENIZATION.message,\n details: {\n originalError: err\n }\n }));\n });\n };\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/visa-checkout.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * visaCheckoutInstance.teardown();\n * @example
With callback\n * visaCheckoutInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n\n VisaCheckout.prototype.teardown = function () {\n convertMethodsToError(this, methods(VisaCheckout.prototype));\n return Promise.resolve();\n };\n\n module.exports = wrapPromise.wrapPrototype(VisaCheckout);\n }, {\n \"../lib/analytics\": 121,\n \"../lib/braintree-error\": 126,\n \"../lib/convert-methods-to-error\": 129,\n \"../lib/json-clone\": 156,\n \"../lib/methods\": 157,\n \"../lib/promise\": 159,\n \"./errors\": 219,\n \"@braintree/wrap-promise\": 44\n }]\n }, {}, [119])(119);\n});","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n } // Copy function arguments\n\n\n var args = new Array(arguments.length - 1);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n } // Store and register the task\n\n\n var task = {\n callback: callback,\n args: args\n };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n\n switch (args.length) {\n case 0:\n callback();\n break;\n\n case 1:\n callback(args[0]);\n break;\n\n case 2:\n callback(args[0], args[1]);\n break;\n\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n\n if (task) {\n currentlyRunningATask = true;\n\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function registerImmediate(handle) {\n process.nextTick(function () {\n runIfPresent(handle);\n });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n\n global.onmessage = function () {\n postMessageIsAsynchronous = false;\n };\n\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n\n var onGlobalMessage = function onGlobalMessage(event) {\n if (event.source === global && typeof event.data === \"string\" && event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function registerImmediate(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n\n channel.port1.onmessage = function (event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function registerImmediate(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n\n registerImmediate = function registerImmediate(handle) {\n // Create a