!function(e){var t;"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):((t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).braintree||(t.braintree={})).client=e()}(function(){return function n(i,o,a){function s(t,e){if(!o[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(c)return c(t,!0);throw(r=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",r}r=o[t]={exports:{}},i[t][0].call(r.exports,function(e){return s(i[t][1][e]||e)},r,r.exports,n,i,o,a)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.PromiseGlobal=void 0;e=n(e("promise-polyfill")),e="undefined"!=typeof Promise?Promise:e.default;r.PromiseGlobal=e},{"promise-polyfill":15}],2:[function(e,t,r){"use strict";var a=e("./lib/promise"),s={};function n(r){var e,t=JSON.stringify(r);if(!r.forceScriptReload&&(e=s[t]))return e;var n=document.createElement("script"),i=r.dataAttributes||{},o=r.container||document.head;return n.src=r.src,n.id=r.id||"",n.async=!0,r.crossorigin&&n.setAttribute("crossorigin",""+r.crossorigin),Object.keys(i).forEach(function(e){n.setAttribute("data-"+e,""+i[e])}),e=new a.PromiseGlobal(function(e,t){n.addEventListener("load",function(){e(n)}),n.addEventListener("error",function(){t(new Error(r.src+" failed to load."))}),n.addEventListener("abort",function(){t(new Error(r.src+" has aborted."))}),o.appendChild(n)}),s[t]=e}n.clearCache=function(){s={}},t.exports=n},{"./lib/promise":1}],3:[function(e,t,r){t.exports=e("./dist/load-script")},{"./dist/load-script":2}],4:[function(e,t,r){"use strict";var n=e("./is-ie11");t.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("MSIE")||n(e)}},{"./is-ie11":5}],5:[function(e,t,r){"use strict";t.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("Trident/7")}},{}],6:[function(e,t,r){"use strict";t.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("MSIE 9")}},{}],7:[function(e,t,r){t.exports=e("./dist/is-ie")},{"./dist/is-ie":4}],8:[function(e,t,r){t.exports=e("./dist/is-ie9")},{"./dist/is-ie9":6}],9:[function(e,t,r){"use strict";var n="undefined"!=typeof Promise?Promise:null,n=(i.defaultOnResolve=function(e){return i.Promise.resolve(e)},i.defaultOnReject=function(e){return i.Promise.reject(e)},i.setPromise=function(e){i.Promise=e},i.shouldCatchExceptions=function(e){return e.hasOwnProperty("suppressUnhandledPromiseMessage")?Boolean(e.suppressUnhandledPromiseMessage):Boolean(i.suppressUnhandledPromiseMessage)},i.all=function(e){return i.Promise.all(e)},i.allSettled=function(e){return i.Promise.allSettled(e)},i.race=function(e){return i.Promise.race(e)},i.reject=function(e){return i.Promise.reject(e)},i.resolve=function(e){return i.Promise.resolve(e)},i.prototype.then=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this._promise).then.apply(e,t)},i.prototype.catch=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this._promise).catch.apply(e,t)},i.prototype.resolve=function(e){var t=this;return this.isFulfilled||(this._setResolved(),i.Promise.resolve().then(function(){return t._onResolve(e)}).then(function(e){t._resolveFunction(e)}).catch(function(e){t._resetState(),t.reject(e)})),this},i.prototype.reject=function(e){var t=this;return this.isFulfilled||(this._setRejected(),i.Promise.resolve().then(function(){return t._onReject(e)}).then(function(e){t._setResolved(),t._resolveFunction(e)}).catch(function(e){return t._rejectFunction(e)})),this},i.prototype._resetState=function(){this.isFulfilled=!1,this.isResolved=!1,this.isRejected=!1},i.prototype._setResolved=function(){this.isFulfilled=!0,this.isResolved=!0,this.isRejected=!1},i.prototype._setRejected=function(){this.isFulfilled=!0,this.isResolved=!1,this.isRejected=!0},i.Promise=n,i);function i(e){var r=this;"function"!=typeof e?(this._promise=new i.Promise(function(e,t){r._resolveFunction=e,r._rejectFunction=t}),this._onResolve=(e=e||{}).onResolve||i.defaultOnResolve,this._onReject=e.onReject||i.defaultOnReject,i.shouldCatchExceptions(e)&&this._promise.catch(function(){}),this._resetState()):this._promise=new i.Promise(e)}t.exports=n},{}],10:[function(e,t,r){"use strict";t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}},{}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.deferred=function(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];setTimeout(function(){try{r.apply(void 0,e)}catch(e){console.log("Error in callback function"),console.log(e)}},1)}}},{}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.once=function(r){var n=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n||(n=!0,r.apply(void 0,e))}}},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.promiseOrCallback=function(e,t){if(!t)return e;e.then(function(e){return t(null,e)}).catch(function(e){return t(e)})}},{}],14:[function(e,t,r){"use strict";var i=e("./lib/deferred"),o=e("./lib/once"),a=e("./lib/promise-or-callback");function s(n){return function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return"function"==typeof t[t.length-1]&&(e=t.pop(),e=o.once(i.deferred(e))),a.promiseOrCallback(n.apply(this,t),e)}}s.wrapPrototype=function(n,e){var i=(e=void 0===e?{}:e).ignoreMethods||[],o=!0===e.transformPrivateMethods;return Object.getOwnPropertyNames(n.prototype).filter(function(e){var t="constructor"!==e&&"function"==typeof n.prototype[e],r=-1===i.indexOf(e),e=o||"_"!==e.charAt(0);return t&&e&&r}).forEach(function(e){var t=n.prototype[e];n.prototype[e]=s(t)}),n},t.exports=s},{"./lib/deferred":11,"./lib/once":12,"./lib/promise-or-callback":13}],15:[function(e,t,r){"use strict";var n=setTimeout;function c(e){return Boolean(e&&void 0!==e.length)}function i(){}function o(e){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function a(r,n){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,o._immediateFn(function(){var e,t=1===r._state?n.onFulfilled:n.onRejected;if(null!==t){try{e=t(r._value)}catch(e){return void u(n.promise,e)}s(n.promise,e)}else(1===r._state?s:u)(n.promise,r._value)})):r._deferreds.push(n)}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof o)return t._state=3,t._value=e,void d(t);if("function"==typeof r)return void l((n=r,i=e,function(){n.apply(i,arguments)}),t)}t._state=1,t._value=e,d(t)}catch(e){u(t,e)}var n,i}function u(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,r=e._deferreds.length;t<r;t++)a(e,e._deferreds[t]);e._deferreds=null}function p(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function l(e,t){var r=!1;try{e(function(e){r||(r=!0,s(t,e))},function(e){r||(r=!0,u(t,e))})}catch(e){if(r)return;r=!0,u(t,e)}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var r=new this.constructor(i);return a(this,new p(e,t,r)),r},o.prototype.finally=function(t){var r=this.constructor;return this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){return r.reject(e)})})},o.all=function(t){return new o(function(i,o){if(!c(t))return o(new TypeError("Promise.all accepts an array"));var a=Array.prototype.slice.call(t);if(0===a.length)return i([]);var s=a.length;for(var e=0;e<a.length;e++)!function t(r,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){t(r,e)},o)}a[r]=e,0==--s&&i(a)}catch(e){o(e)}}(e,a[e])})},o.allSettled=function(r){return new this(function(i,e){if(!r||void 0===r.length)return e(new TypeError(typeof r+" "+r+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var o=Array.prototype.slice.call(r);if(0===o.length)return i([]);var a=o.length;for(var t=0;t<o.length;t++)!function t(r,e){if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){t(r,e)},function(e){o[r]={status:"rejected",reason:e},0==--a&&i(o)})}o[r]={status:"fulfilled",value:e},0==--a&&i(o)}(t,o[t])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(r){return new o(function(e,t){t(r)})},o.race=function(i){return new o(function(e,t){if(!c(i))return t(new TypeError("Promise.race accepts an array"));for(var r=0,n=i.length;r<n;r++)o.resolve(i[r]).then(e,t)})},o._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t.exports=o},{}],16:[function(e,t,r){"use strict";var n=e("@braintree/browser-detection/is-ie"),e=e("@braintree/browser-detection/is-ie9");t.exports={isIe:n,isIe9:e}},{"@braintree/browser-detection/is-ie":7,"@braintree/browser-detection/is-ie9":8}],17:[function(e,t,r){"use strict";var u=e("./constants").BRAINTREE_VERSION,n=e("./request/graphql"),i=e("./request"),o=e("../lib/is-verified-domain"),d=e("../lib/braintree-error"),p=e("../lib/convert-to-braintree-error"),a=e("./get-configuration").getConfiguration,s=e("../lib/create-authorization-data"),l=e("../lib/add-metadata"),f=e("../lib/promise"),c=e("@braintree/wrap-promise"),h=e("../lib/once"),y=e("../lib/deferred"),g=e("../lib/assign").assign,E=e("../lib/analytics"),I=e("./errors"),m=e("../lib/constants").VERSION,_=e("../lib/constants").GRAPHQL_URLS,T=e("../lib/methods"),A=e("../lib/convert-methods-to-error"),N=e("../lib/assets"),R=e("../lib/constants").FRAUDNET_FNCLS,v=e("../lib/constants").FRAUDNET_SOURCE,b=e("../lib/constants").FRAUDNET_URL,C={};function O(e){var t,r;if(e=e||{},t=JSON.stringify(e),!(r=e.gatewayConfiguration))throw new d(I.CLIENT_MISSING_GATEWAY_CONFIGURATION);["assetsUrl","clientApiUrl","configUrl"].forEach(function(e){if(e in r&&!o(r[e]))throw new d({type:I.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,code:I.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,message:e+" property is on an invalid domain."})}),this.getConfiguration=function(){return JSON.parse(t)},this._request=i,this._configuration=this.getConfiguration(),this._clientApiBaseUrl=r.clientApiUrl+"/v1/",r.graphQL&&(this._graphQL=new n({graphQL:r.graphQL}))}O.initialize=function(t){var r,e,n=C[t.authorization];if(n)return E.sendEvent(n,"custom.client.load.cached"),n;try{e=s(t.authorization)}catch(e){return f.reject(new d(I.CLIENT_INVALID_AUTHORIZATION))}return n=a(e).then(function(e){return t.debug&&(e.isDebug=!0),e.authorization=t.authorization,r=new O(e)}),C[t.authorization]=n,E.sendEvent(n,"custom.client.load.initialized"),n.then(function(e){return E.sendEvent(r,"custom.client.load.succeeded"),e}).catch(function(e){return delete C[t.authorization],f.reject(e)})},O.clearCache=function(){C={}},O.prototype._findOrCreateFraudnetJSON=function(e){var t,r,n=document.querySelector('script[fncls="'+R+'"]');n||((n=document.body.appendChild(document.createElement("script"))).type="application/json",n.setAttribute("fncls",R)),r=this.getConfiguration(),t={rda_tenant:"bt_card",mid:r.gatewayConfiguration.merchantId},(r=r.authorizationFingerprint)&&r.split("&").forEach(function(e){e=e.split("=");"customer_id"===e[0]&&1<e.length&&(t.cid=e[1])}),e={f:e.substr(0,32),fp:t,bu:!1,s:v},n.text=JSON.stringify(e)},O.prototype.request=function(s,r){var c=this,e=new f(function(n,i){var o,e,t,r,a=Boolean("payment_methods/credit_cards"===s.endpoint&&c.getConfiguration().gatewayConfiguration.creditCards.collectDeviceData);if("graphQLApi"!==s.api&&(s.method?s.endpoint||(r="options.endpoint"):r="options.method"),r)throw new d({type:I.CLIENT_OPTION_REQUIRED.type,code:I.CLIENT_OPTION_REQUIRED.code,message:r+" is required when making a request."});if(o="api"in s?s.api:"clientApi",t={method:s.method,graphQL:c._graphQL,timeout:s.timeout,metadata:c._configuration.analyticsMetadata},"clientApi"===o)e=c._clientApiBaseUrl,t.data=l(c._configuration,s.data);else{if("graphQLApi"!==o)throw new d({type:I.CLIENT_OPTION_INVALID.type,code:I.CLIENT_OPTION_INVALID.code,message:"options.api is invalid."});e=_[c._configuration.gatewayConfiguration.environment],s.endpoint="",t.method="post",t.data=g({clientSdkMetadata:{platform:c._configuration.analyticsMetadata.platform,source:c._configuration.analyticsMetadata.source,integration:c._configuration.analyticsMetadata.integration,sessionId:c._configuration.analyticsMetadata.sessionId,version:m}},s.data),t.headers={Authorization:"Bearer "+((r=c._configuration).authorizationFingerprint||r.authorization),"Braintree-Version":u}}t.url=e+s.endpoint,t.sendAnalyticsEvent=function(e){E.sendEvent(c,e)},c._request(t,function(e,t,r){e=function(e,t){var r;-1===e?r=new d(I.CLIENT_REQUEST_TIMEOUT):401===e?r=new d(I.CLIENT_AUTHORIZATION_INVALID):403===e?r=new d(I.CLIENT_AUTHORIZATION_INSUFFICIENT):429===e?r=new d(I.CLIENT_RATE_LIMITED):500<=e?r=new d(I.CLIENT_GATEWAY_NETWORK):(e<200||400<=e)&&(r=p(t,{type:I.CLIENT_REQUEST_ERROR.type,code:I.CLIENT_REQUEST_ERROR.code,message:I.CLIENT_REQUEST_ERROR.message}));if(r)return r.details=r.details||{},r.details.httpStatus=e,r}(r,e);e?i(e):"graphQLApi"===o&&t.errors?i(p(t.errors,{type:I.CLIENT_GRAPHQL_REQUEST_ERROR.type,code:I.CLIENT_GRAPHQL_REQUEST_ERROR.code,message:I.CLIENT_GRAPHQL_REQUEST_ERROR.message})):(t=g({_httpStatus:r},t),a&&t.creditCards&&0<t.creditCards.length&&(c._findOrCreateFraudnetJSON(t.creditCards[0].nonce),N.loadScript({src:b,forceScriptReload:!0})),n(t))})});return"function"==typeof r?(r=h(y(r)),void e.then(function(e){r(null,e,e._httpStatus)}).catch(function(e){var t=e&&e.details&&e.details.httpStatus;r(e,null,t)})):e},O.prototype.toJSON=function(){return this.getConfiguration()},O.prototype.getVersion=function(){return m},O.prototype.teardown=c(function(){return delete C[this.getConfiguration().authorization],A(this,T(O.prototype)),f.resolve()}),t.exports=O},{"../lib/add-metadata":38,"../lib/analytics":39,"../lib/assets":40,"../lib/assign":41,"../lib/braintree-error":42,"../lib/constants":43,"../lib/convert-methods-to-error":44,"../lib/convert-to-braintree-error":45,"../lib/create-authorization-data":46,"../lib/deferred":47,"../lib/is-verified-domain":51,"../lib/methods":53,"../lib/once":54,"../lib/promise":55,"./constants":18,"./errors":19,"./get-configuration":20,"./request":32,"./request/graphql":30,"@braintree/wrap-promise":14}],18:[function(e,t,r){"use strict";t.exports={BRAINTREE_VERSION:"2018-05-10"}},{}],19:[function(e,t,r){"use strict";e=e("../lib/braintree-error");t.exports={CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN:{type:e.types.MERCHANT,code:"CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN"},CLIENT_OPTION_REQUIRED:{type:e.types.MERCHANT,code:"CLIENT_OPTION_REQUIRED"},CLIENT_OPTION_INVALID:{type:e.types.MERCHANT,code:"CLIENT_OPTION_INVALID"},CLIENT_MISSING_GATEWAY_CONFIGURATION:{type:e.types.INTERNAL,code:"CLIENT_MISSING_GATEWAY_CONFIGURATION",message:"Missing gatewayConfiguration."},CLIENT_INVALID_AUTHORIZATION:{type:e.types.MERCHANT,code:"CLIENT_INVALID_AUTHORIZATION",message:"Authorization is invalid. Make sure your client token or tokenization key is valid."},CLIENT_GATEWAY_NETWORK:{type:e.types.NETWORK,code:"CLIENT_GATEWAY_NETWORK",message:"Cannot contact the gateway at this time."},CLIENT_REQUEST_TIMEOUT:{type:e.types.NETWORK,code:"CLIENT_REQUEST_TIMEOUT",message:"Request timed out waiting for a reply."},CLIENT_REQUEST_ERROR:{type:e.types.NETWORK,code:"CLIENT_REQUEST_ERROR",message:"There was a problem with your request."},CLIENT_GRAPHQL_REQUEST_ERROR:{type:e.types.NETWORK,code:"CLIENT_GRAPHQL_REQUEST_ERROR",message:"There was a problem with your request."},CLIENT_RATE_LIMITED:{type:e.types.MERCHANT,code:"CLIENT_RATE_LIMITED",message:"You are being rate-limited; please try again in a few minutes."},CLIENT_AUTHORIZATION_INSUFFICIENT:{type:e.types.MERCHANT,code:"CLIENT_AUTHORIZATION_INSUFFICIENT",message:"The authorization used has insufficient privileges."},CLIENT_AUTHORIZATION_INVALID:{type:e.types.MERCHANT,code:"CLIENT_AUTHORIZATION_INVALID",message:"Either the client token has expired and a new one should be generated or the tokenization key has been deactivated or deleted."}}},{"../lib/braintree-error":42}],20:[function(e,t,r){"use strict";var c=e("../lib/braintree-error"),n=e("../lib/promise"),i=e("@braintree/wrap-promise"),u=e("./request"),d=e("@braintree/uuid"),p=e("../lib/constants"),l=e("./errors"),f=e("./request/graphql"),h=e("../lib/constants").GRAPHQL_URLS,y=e("../lib/is-date-string-before-or-on"),g=e("./constants").BRAINTREE_VERSION;t.exports={getConfiguration:i(function(t){return new n(function(n,i){var o,e=d(),a={merchantAppId:window.location.host,platform:p.PLATFORM,sdkVersion:p.VERSION,source:p.SOURCE,integration:p.INTEGRATION,integrationType:p.INTEGRATION,sessionId:e},s=t.attrs,e=t.configUrl;s._meta=a,s.braintreeLibraryVersion=p.BRAINTREE_LIBRARY_VERSION,s.configVersion="3",e={url:e,method:"GET",data:s},s.authorizationFingerprint&&t.graphQL?(y(t.graphQL.date,g)&&(e.graphQL=new f({graphQL:{url:t.graphQL.url,features:["configuration"]}})),e.metadata=a):s.tokenizationKey&&(e.graphQL=new f({graphQL:{url:h[t.environment],features:["configuration"]}}),e.metadata=a),u(e,function(e,t,r){return e?(r=403===r?l.CLIENT_AUTHORIZATION_INSUFFICIENT:401===r?l.CLIENT_AUTHORIZATION_INVALID:l.CLIENT_GATEWAY_NETWORK,void i(new c({type:r.type,code:r.code,message:r.message,details:{originalError:e}}))):(o={authorizationType:s.tokenizationKey?"TOKENIZATION_KEY":"CLIENT_TOKEN",authorizationFingerprint:s.authorizationFingerprint,analyticsMetadata:a,gatewayConfiguration:t},void n(o))})})})}},{"../lib/braintree-error":42,"../lib/constants":43,"../lib/is-date-string-before-or-on":50,"../lib/promise":55,"./constants":18,"./errors":19,"./request":32,"./request/graphql":30,"@braintree/uuid":10,"@braintree/wrap-promise":14}],21:[function(e,t,r){"use strict";var n=e("../lib/braintree-error"),i=e("./client"),o=e("../lib/promise"),a=e("@braintree/wrap-promise"),s=e("../lib/errors");t.exports={create:a(function(e){return e.authorization?i.initialize(e):o.reject(new n({type:s.INSTANTIATION_OPTION_REQUIRED.type,code:s.INSTANTIATION_OPTION_REQUIRED.code,message:"options.authorization is required when instantiating a client."}))}),VERSION:"3.76.4"}},{"../lib/braintree-error":42,"../lib/errors":49,"../lib/promise":55,"./client":17,"@braintree/wrap-promise":14}],22:[function(e,t,r){"use strict";var y=e("../../lib/querystring"),g=e("../../lib/assign").assign,E=e("./prep-body"),I=e("./parse-body"),m=e("./xhr"),_=m.isAvailable,T=e("./graphql/request"),A=e("./default-request"),N=1,R=408;function v(t,r,n){var i,o,a,e,s,c,u=t.url,d=t.graphQL,p=t.timeout,l=m.getRequestObject(),f=n,h=Boolean(d&&d.isGraphQLRequest(u,t.data));t.headers=g({"Content-Type":"application/json"},t.headers),u=(a=new(h?T:A)(t)).getUrl(),e=a.getBody(),d=a.getMethod(),s=a.getHeaders(),"GET"===d&&(u=y.queryify(u,e),e=null),_?l.onreadystatechange=function(){if(4===l.readyState){if(0===l.status&&h)return delete t.graphQL,void v(t,r,n);if(c=I(l.responseText),o=a.adaptResponseBody(c),400<=(i=a.determineStatus(l.status,c))||i<200){if(h&&("UNKNOWN"===(e=!(e=c).data&&e.errors&&e.errors[0]&&e.errors[0].extensions&&e.errors[0].extensions.errorClass)||"INTERNAL"===e))return delete t.graphQL,void v(t,r,n);r<N&&(!(e=i)||e===R)?v(t,++r,n):f(o||"error",null,i||500)}else f(null,o,i);var e}}:(t.headers&&(u=y.queryify(u,s)),l.onload=function(){f(null,I(l.responseText),l.status)},l.onerror=function(){f("error",null,500)},l.onprogress=function(){},l.ontimeout=function(){f("timeout",null,-1)});try{l.open(d,u,!0)}catch(e){if(!h)throw e;return delete t.graphQL,void v(t,r,n)}l.timeout=p,_&&Object.keys(s).forEach(function(e){l.setRequestHeader(e,s[e])});try{l.send(E(d,e))}catch(e){}}t.exports={request:function(e,t){v(e,0,t)}}},{"../../lib/assign":41,"../../lib/querystring":56,"./default-request":23,"./graphql/request":31,"./parse-body":35,"./prep-body":36,"./xhr":37}],23:[function(e,t,r){"use strict";function n(e){this._url=e.url,this._data=e.data,this._method=e.method,this._headers=e.headers}n.prototype.getUrl=function(){return this._url},n.prototype.getBody=function(){return this._data},n.prototype.getMethod=function(){return this._method},n.prototype.getHeaders=function(){return this._headers},n.prototype.adaptResponseBody=function(e){return e},n.prototype.determineStatus=function(e){return e},t.exports=n},{}],24:[function(e,t,r){"use strict";t.exports=function(){return window.navigator.userAgent}},{}],25:[function(e,t,r){"use strict";var n=e("./error"),i=e("../../../../lib/assign").assign,o={creditCard:{AMERICAN_EXPRESS:"American Express",DISCOVER:"Discover",INTERNATIONAL_MAESTRO:"Maestro",JCB:"JCB",MASTERCARD:"MasterCard",SOLO:"Solo",UK_MAESTRO:"UK Maestro",UNION_PAY:"UnionPay",VISA:"Visa"},applePayWeb:{VISA:"visa",MASTERCARD:"mastercard",DISCOVER:"discover",AMERICAN_EXPRESS:"amex",INTERNATIONAL_MAESTRO:"maestro"},visaCheckout:{VISA:"Visa",MASTERCARD:"MasterCard",DISCOVER:"Discover",AMERICAN_EXPRESS:"American Express"},googlePay:{VISA:"visa",MASTERCARD:"mastercard",DISCOVER:"discover",AMERICAN_EXPRESS:"amex"},masterpass:{VISA:"visa",MASTERCARD:"master",DISCOVER:"discover",AMERICAN_EXPRESS:"amex",DINERS:"diners",INTERNATIONAL_MAESTRO:"maestro",JCB:"jcb"}};function a(e,r){return e.reduce(function(e,t){return r.hasOwnProperty(t)?e.concat(r[t]):e},[])}t.exports=function(e,t){return e=e.data&&!e.errors?function(e,t){var r=e.data.clientConfiguration;e={environment:r.environment.toLowerCase(),clientApiUrl:r.clientApiUrl,assetsUrl:r.assetsUrl,analytics:{url:r.analyticsUrl},merchantId:r.merchantId,venmo:"off"},r.supportedFeatures&&(e.graphQL={url:t._graphQL._config.url,features:r.supportedFeatures.map(function(e){return e.toLowerCase()})});r.braintreeApi&&(e.braintreeApi=r.braintreeApi);r.applePayWeb&&(e.applePayWeb=r.applePayWeb,e.applePayWeb.supportedNetworks=a(r.applePayWeb.supportedCardBrands,o.applePayWeb),delete e.applePayWeb.supportedCardBrands);r.ideal&&(e.ideal=r.ideal);r.kount&&(e.kount={kountMerchantId:r.kount.merchantId});r.creditCard?(e.challenges=r.creditCard.challenges.map(function(e){return e.toLowerCase()}),e.creditCards={supportedCardTypes:a(r.creditCard.supportedCardBrands,o.creditCard)},e.threeDSecureEnabled=r.creditCard.threeDSecureEnabled,e.threeDSecure=r.creditCard.threeDSecure):(e.challenges=[],e.creditCards={supportedCardTypes:[]},e.threeDSecureEnabled=!1);r.googlePay&&(e.androidPay={displayName:r.googlePay.displayName,enabled:!0,environment:r.googlePay.environment.toLowerCase(),googleAuthorizationFingerprint:r.googlePay.googleAuthorization,paypalClientId:r.googlePay.paypalClientId,supportedNetworks:a(r.googlePay.supportedCardBrands,o.googlePay)});r.venmo&&(e.payWithVenmo={merchantId:r.venmo.merchantId,accessToken:r.venmo.accessToken,environment:r.venmo.environment.toLowerCase()});r.paypal?(e.paypalEnabled=!0,e.paypal=i({},r.paypal),e.paypal.currencyIsoCode=e.paypal.currencyCode,e.paypal.environment=e.paypal.environment.toLowerCase(),delete e.paypal.currencyCode):e.paypalEnabled=!1;r.unionPay&&(e.unionPay={enabled:!0,merchantAccountId:r.unionPay.merchantAccountId});r.visaCheckout&&(e.visaCheckout={apikey:r.visaCheckout.apiKey,externalClientId:r.visaCheckout.externalClientId,supportedCardTypes:a(r.visaCheckout.supportedCardBrands,o.visaCheckout)});r.masterpass&&(e.masterpass={merchantCheckoutId:r.masterpass.merchantCheckoutId,supportedNetworks:a(r.masterpass.supportedCardBrands,o.masterpass)});r.usBankAccount&&(e.usBankAccount={routeId:r.usBankAccount.routeId,plaid:{publicKey:r.usBankAccount.plaidPublicKey}});return e}(e,t):n(e)}},{"../../../../lib/assign":41,"./error":27}],26:[function(e,t,r){"use strict";var n=e("./error"),i={AMERICAN_EXPRESS:"American Express",DINERS:"Discover",DISCOVER:"Discover",INTERNATIONAL_MAESTRO:"Maestro",JCB:"JCB",MASTERCARD:"MasterCard",UK_MAESTRO:"Maestro",UNION_PAY:"Union Pay",VISA:"Visa"},o={YES:"Yes",NO:"No",UNKNOWN:"Unknown"},a={PSDTWO:"psd2"};t.exports=function(e){return e=(e.data&&!e.errors?function(e){var t=e.data.tokenizeCreditCard,r=t.creditCard,e=r.last4?r.last4.substr(2,4):"",n=r.binData;n&&(["commercial","debit","durbinRegulated","healthcare","payroll","prepaid"].forEach(function(e){n[e]?n[e]=o[n[e]]:n[e]="Unknown"}),["issuingBank","countryOfIssuance","productId"].forEach(function(e){n[e]||(n[e]="Unknown")}));e={creditCards:[{binData:n,consumed:!1,description:e?"ending in "+e:"",nonce:t.token,details:{cardholderName:r.cardholderName,expirationMonth:r.expirationMonth,expirationYear:r.expirationYear,bin:r.bin||"",cardType:i[r.brandCode]||"Unknown",lastFour:r.last4||"",lastTwo:e},type:"CreditCard",threeDSecureInfo:null}]},t.authenticationInsight&&(t=t.authenticationInsight.customerAuthenticationRegulationEnvironment,e.creditCards[0].authenticationInsight={regulationEnvironment:a[t]||t.toLowerCase()});return e}:n)(e)}},{"./error":27}],27:[function(e,t,r){"use strict";t.exports=function(e){var t,r,n=e.errors&&e.errors[0]&&e.errors[0].extensions&&e.errors[0].extensions.errorClass;return e="VALIDATION"===n?0!==(r=function(e){var t=[];return e.forEach(function(e){e.extensions&&e.extensions.inputPath&&!function e(t,r,n){var i;var o=r.extensions.legacyCode;var a=t[0];if(1===t.length)return void n.push({code:o,field:a,message:r.message});n.forEach(function(e){e.field===a&&(i=e)});i||(i={field:a,fieldErrors:[]},n.push(i));e(t.slice(1),r,i.fieldErrors)}(e.extensions.inputPath.slice(1),e,t)}),t}((t=e).errors)).length?{error:{message:function(e){e=e[0].field;return{creditCard:"Credit card is invalid"}[e]}(r)},fieldErrors:r}:{error:{message:t.errors[0].message}}:n?{error:{message:e.errors[0].message},fieldErrors:[]}:{error:{message:"There was a problem serving your request"},fieldErrors:[]}}},{}],28:[function(e,t,r){"use strict";t.exports=function(){return{query:"query ClientConfiguration {   clientConfiguration {     analyticsUrl     environment     merchantId     assetsUrl     clientApiUrl     creditCard {       supportedCardBrands       challenges       threeDSecureEnabled       threeDSecure {         cardinalAuthenticationJWT       }     }     applePayWeb {       countryCode       currencyCode       merchantIdentifier       supportedCardBrands     }     googlePay {       displayName       supportedCardBrands       environment       googleAuthorization       paypalClientId     }     ideal {       routeId       assetsUrl     }     kount {       merchantId     }     masterpass {       merchantCheckoutId       supportedCardBrands     }     paypal {       displayName       clientId       privacyUrl       userAgreementUrl       assetsUrl       environment       environmentNoNetwork       unvettedMerchant       braintreeClientId       billingAgreementsEnabled       merchantAccountId       currencyCode       payeeEmail     }     unionPay {       merchantAccountId     }     usBankAccount {       routeId       plaidPublicKey     }     venmo {       merchantId       accessToken       environment     }     visaCheckout {       apiKey       externalClientId       supportedCardBrands     }     braintreeApi {       accessToken       url     }     supportedFeatures   } }",operationName:"ClientConfiguration"}}},{}],29:[function(e,t,r){"use strict";var a=e("../../../../lib/assign").assign;function i(e,t){var r=e.creditCard,n=r&&r.billingAddress,i=r&&r.expirationDate,o=r&&(r.expirationMonth||i&&i.split("/")[0].trim()),i=r&&(r.expirationYear||i&&i.split("/")[1].trim()),r={input:{creditCard:{number:r&&r.number,expirationMonth:o,expirationYear:i,cvv:r&&r.cvv,cardholderName:r&&r.cardholderName},options:{}}};return t.hasAuthenticationInsight&&(r.authenticationInsightInput={merchantAccountId:e.merchantAccountId}),n&&(r.input.creditCard.billingAddress=n),r.input=function(e,t){var r;e.creditCard&&e.creditCard.options&&"boolean"==typeof e.creditCard.options.validate?r=e.creditCard.options.validate:e.authorizationFingerprint&&e.tokenizationKey||e.authorizationFingerprint?r=!0:e.tokenizationKey&&(r=!1);"boolean"==typeof r&&(t.options=a({validate:r},t.options));return t}(e,r.input),r}t.exports=function(e){var t,r,n={hasAuthenticationInsight:Boolean(e.authenticationInsight&&e.merchantAccountId)};return{query:(r=(t=n).hasAuthenticationInsight,t="mutation TokenizeCreditCard($input: TokenizeCreditCardInput!",r&&(t+=", $authenticationInsightInput: AuthenticationInsightInput!"),t+=") {   tokenizeCreditCard(input: $input) {     token     creditCard {       bin       brandCode       last4       cardholderName       expirationMonth      expirationYear      binData {         prepaid         healthcare         debit         durbinRegulated         commercial         payroll         issuingBank         countryOfIssuance         productId       }     } ",r&&(t+="    authenticationInsight(input: $authenticationInsightInput) {      customerAuthenticationRegulationEnvironment    }"),t+="  } }"),variables:i(e,n),operationName:"TokenizeCreditCard"}}},{"../../../../lib/assign":41}],30:[function(e,t,r){"use strict";var i=e("../../browser-detection"),o={tokenize_credit_cards:"payment_methods/credit_cards",configuration:"configuration"},a=["creditCard.options.unionPayEnrollment"];function n(e){this._config=e.graphQL}n.prototype.getGraphQLEndpoint=function(){return this._config.url},n.prototype.isGraphQLRequest=function(e,t){var r,n=this.getClientApiPath(e);return!(!this._isGraphQLEnabled()||!n||i.isIe9())&&(e=this._config.features.some(function(e){return o[e]===n}),r=t,!a.some(function(e){return void 0!==e.split(".").reduce(function(e,t){return e&&e[t]},r)})&&e)},n.prototype.getClientApiPath=function(e){var t,e=e.split("/client_api/v1/");return t=1<e.length?e[1].split("?")[0]:t},n.prototype._isGraphQLEnabled=function(){return Boolean(this._config)},t.exports=n},{"../../browser-detection":16}],31:[function(e,t,r){"use strict";var n=e("../../constants").BRAINTREE_VERSION,i=e("../../../lib/assign").assign,o=e("./generators/credit-card-tokenization"),a=e("./adapters/credit-card-tokenization"),s=e("./generators/configuration"),e=e("./adapters/configuration"),c={"payment_methods/credit_cards":o,configuration:s},u={"payment_methods/credit_cards":a,configuration:e};function d(e){var t=e.graphQL.getClientApiPath(e.url);this._graphQL=e.graphQL,this._data=e.data,this._method=e.method,this._headers=e.headers,this._clientSdkMetadata={source:e.metadata.source,integration:e.metadata.integration,sessionId:e.metadata.sessionId},this._sendAnalyticsEvent=e.sendAnalyticsEvent||Function.prototype,this._generator=c[t],this._adapter=u[t],this._sendAnalyticsEvent("graphql.init")}function p(e){return-1===e.indexOf("_")?e:e.toLowerCase().replace(/(\_\w)/g,function(e){return e[1].toUpperCase()})}d.prototype.getUrl=function(){return this._graphQL.getGraphQLEndpoint()},d.prototype.getBody=function(){var e=function r(n){var i={};Object.keys(n).forEach(function(e){var t=p(e);"object"==typeof n[e]?i[t]=r(n[e]):"number"==typeof n[e]?i[t]=String(n[e]):i[t]=n[e]});return i}(this._data),e=this._generator(e),e=i({clientSdkMetadata:this._clientSdkMetadata},e);return JSON.stringify(e)},d.prototype.getMethod=function(){return"POST"},d.prototype.getHeaders=function(){var e=this._data.authorizationFingerprint?(this._sendAnalyticsEvent("graphql.authorization-fingerprint"),this._data.authorizationFingerprint):(this._sendAnalyticsEvent("graphql.tokenization-key"),this._data.tokenizationKey);return i({},this._headers,{Authorization:"Bearer "+e,"Braintree-Version":n})},d.prototype.adaptResponseBody=function(e){return this._adapter(e,this)},d.prototype.determineStatus=function(e,t){var r,n=200===e?(r=t.errors&&t.errors[0]&&t.errors[0].extensions&&t.errors[0].extensions.errorClass,t.data&&!t.errors?200:"VALIDATION"===r?422:"AUTHORIZATION"===r?403:"AUTHENTICATION"===r?401:(n=t,!r&&n.errors[0].message?403:500)):e||500;return this._sendAnalyticsEvent("graphql.status."+e),this._sendAnalyticsEvent("graphql.determinedStatus."+n),n},t.exports=d},{"../../../lib/assign":41,"../../constants":18,"./adapters/configuration":25,"./adapters/credit-card-tokenization":26,"./generators/configuration":28,"./generators/credit-card-tokenization":29}],32:[function(e,t,r){"use strict";var n,i=e("../../lib/once"),o=e("./jsonp-driver"),a=e("./ajax-driver"),s=e("./get-user-agent"),c=e("./is-http");t.exports=function(e,t){t=i(t||Function.prototype),e.method=(e.method||"GET").toUpperCase(),e.timeout=null==e.timeout?6e4:e.timeout,e.data=e.data||{},((n=null==n?!(c()&&/MSIE\s(8|9)/.test(s())):n)?a:o).request(e,t)}},{"../../lib/once":54,"./ajax-driver":22,"./get-user-agent":24,"./is-http":33,"./jsonp-driver":34}],33:[function(e,t,r){"use strict";t.exports=function(){return"http:"===window.location.protocol}},{}],34:[function(e,t,r){"use strict";var d,p=e("@braintree/uuid"),l=e("../../lib/querystring"),f={};function h(t){try{delete window[t]}catch(e){window[t]=null}}function y(i,o,a){window[a]=function(e){var t=e.status||500,r=null,n=null;delete e.status,400<=t||t<200?r=e:n=e,h(a),(e=i)&&e.parentNode&&e.parentNode.removeChild(e),clearTimeout(f[a]),o(r,n,t)}}t.exports={request:function(e,t){var r,n,i,o,a="callback_json_"+p().replace(/-/g,""),s=e.url,c=e.data,u=e.method,e=e.timeout,s=l.queryify(s,c);s=s=l.queryify(s,{_method:u,callback:a}),r=a,n=document.createElement("script"),i=!1,n.src=s,n.async=!0,n.onerror=function(){window[r]({message:"error",status:500})},n.onload=n.onreadystatechange=function(){i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(i=!0,n.onload=n.onreadystatechange=null)},y(s=n,t,a),f[o=a]=setTimeout(function(){f[o]=null,window[o]({error:"timeout",status:-1}),window[o]=function(){h(o)}},e),(d=d||document.getElementsByTagName("head")[0]).appendChild(s)}}},{"../../lib/querystring":56,"@braintree/uuid":10}],35:[function(e,t,r){"use strict";t.exports=function(e){try{e=JSON.parse(e)}catch(e){}return e}},{}],36:[function(e,t,r){"use strict";t.exports=function(e,t){if("string"!=typeof e)throw new Error("Method must be a string");return t="get"!==e.toLowerCase()&&null!=t?"string"==typeof t?t:JSON.stringify(t):t}},{}],37:[function(e,t,r){"use strict";var n="undefined"!=typeof window&&window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest;t.exports={isAvailable:n,getRequestObject:function(){return new(n?window.XMLHttpRequest:window.XDomainRequest)}}},{}],38:[function(e,t,r){"use strict";var o=e("./create-authorization-data"),a=e("./json-clone"),s=e("./constants");t.exports=function(e,t){var r,n=t?a(t):{},t=o(e.authorization).attrs,i=a(e.analyticsMetadata);for(r in n.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION,n._meta)n._meta.hasOwnProperty(r)&&(i[r]=n._meta[r]);return n._meta=i,t.tokenizationKey?n.tokenizationKey=t.tokenizationKey:n.authorizationFingerprint=t.authorizationFingerprint,n}},{"./constants":43,"./create-authorization-data":46,"./json-clone":52}],39:[function(e,t,r){"use strict";var n=e("./promise"),s=e("./constants"),c=e("./add-metadata");t.exports={sendEvent:function(e,i,o){var a=Date.now();return n.resolve(e).then(function(e){var t=Date.now(),r=e.getConfiguration(),n=e._request,e=r.gatewayConfiguration.analytics.url,t={analytics:[{kind:s.ANALYTICS_PREFIX+i,isAsync:Math.floor(t/1e3)!==Math.floor(a/1e3),timestamp:a}]};n({url:e,method:"post",data:c(r,t),timeout:s.ANALYTICS_REQUEST_TIMEOUT_MS},o)})}}},{"./add-metadata":38,"./constants":43,"./promise":55}],40:[function(e,t,r){"use strict";e=e("@braintree/asset-loader/load-script");t.exports={loadScript:e}},{"@braintree/asset-loader/load-script":3}],41:[function(e,t,r){"use strict";var n="function"==typeof Object.assign?Object.assign:i;function i(e){for(var t,r,n=1;n<arguments.length;n++)for(r in t=arguments[n])t.hasOwnProperty(r)&&(e[r]=t[r]);return e}t.exports={assign:n,_assign:i}},{}],42:[function(e,t,r){"use strict";e=e("./enumerate");function n(e){if(!n.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}n.prototype=Object.create(Error.prototype),(n.prototype.constructor=n).types=e(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),n.findRootError=function(e){return e instanceof n&&e.details&&e.details.originalError?n.findRootError(e.details.originalError):e},t.exports=n},{"./enumerate":48}],43:[function(e,t,r){"use strict";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,ASSETS_URLS:{production:"https://assets.braintreegateway.com",sandbox:"https://assets.braintreegateway.com"},CLIENT_API_URLS:{production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"},FRAUDNET_SOURCE:"BRAINTREE_SIGNIN",FRAUDNET_FNCLS:"fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99",FRAUDNET_URL:"https://c.paypal.com/da/r/fb.js",BUS_CONFIGURATION_REQUEST_EVENT:"BUS_CONFIGURATION_REQUEST",GRAPHQL_URLS:{production:"https://payments.braintree-api.com/graphql",sandbox:"https://payments.sandbox.braintree-api.com/graphql"},INTEGRATION_TIMEOUT_MS:6e4,VERSION:"3.76.4",INTEGRATION:"custom",SOURCE:"client",PLATFORM:"web",BRAINTREE_LIBRARY_VERSION:"braintree/web/3.76.4"}},{}],44:[function(e,t,r){"use strict";var n=e("./braintree-error"),i=e("./errors");t.exports=function(t,e){e.forEach(function(e){t[e]=function(){throw new n({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:e+" cannot be called after teardown."})}})}},{"./braintree-error":42,"./errors":49}],45:[function(e,t,r){"use strict";var n=e("./braintree-error");t.exports=function(e,t){return e instanceof n?e:new n({type:t.type,code:t.code,message:t.message,details:{originalError:e}})}},{"./braintree-error":42}],46:[function(e,t,r){"use strict";var i=e("../lib/vendor/polyfill").atob,o=e("../lib/constants").CLIENT_API_URLS;t.exports=function(e){var t,r,n={attrs:{},configUrl:""};return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)?(t=(r=(t=e).split("_"))[0],t={merchantId:r.slice(2).join("_"),environment:t},n.environment=t.environment,n.attrs.tokenizationKey=e,n.configUrl=o[t.environment]+"/merchants/"+t.merchantId+"/client_api/v1/configuration"):(e=JSON.parse(i(e)),n.environment=e.environment,n.attrs.authorizationFingerprint=e.authorizationFingerprint,n.configUrl=e.configUrl,n.graphQL=e.graphQL),n}},{"../lib/constants":43,"../lib/vendor/polyfill":57}],47:[function(e,t,r){"use strict";t.exports=function(t){return function(){var e=arguments;setTimeout(function(){t.apply(null,e)},1)}}},{}],48:[function(e,t,r){"use strict";t.exports=function(e,r){return r=null==r?"":r,e.reduce(function(e,t){return e[t]=r+t,e},{})}},{}],49:[function(e,t,r){"use strict";e=e("./braintree-error");t.exports={INVALID_USE_OF_INTERNAL_FUNCTION:{type:e.types.INTERNAL,code:"INVALID_USE_OF_INTERNAL_FUNCTION"},INSTANTIATION_OPTION_REQUIRED:{type:e.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:e.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},CLIENT_SCRIPT_FAILED_TO_LOAD:{type:e.types.NETWORK,code:"CLIENT_SCRIPT_FAILED_TO_LOAD",message:"Braintree client script could not be loaded."},METHOD_CALLED_AFTER_TEARDOWN:{type:e.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"}}},{"./braintree-error":42}],50:[function(e,t,r){"use strict";function n(e){e=e.split("-");return new Date(e[0],e[1],e[2])}t.exports=function(e,t){return n(e)<=n(t)}},{}],51:[function(e,t,r){"use strict";var n,i={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1,"braintree-api.com":1};t.exports=function(e){return e=e.toLowerCase(),!!/^https:/.test(e)&&((n=n||document.createElement("a")).href=e,e=n.hostname.split(".").slice(-2).join("."),i.hasOwnProperty(e))}},{}],52:[function(e,t,r){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],53:[function(e,t,r){"use strict";t.exports=function(t){return Object.keys(t).filter(function(e){return"function"==typeof t[e]})}},{}],54:[function(e,t,r){"use strict";t.exports=function(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}},{}],55:[function(e,t,r){"use strict";var n=e("promise-polyfill"),e=e("@braintree/extended-promise"),n="undefined"!=typeof Promise?Promise:n;e.suppressUnhandledPromiseMessage=!0,e.setPromise(n),t.exports=n},{"@braintree/extended-promise":9,"promise-polyfill":15}],56:[function(e,t,r){"use strict";function n(e){return e=e||window.location.href,/\?/.test(e)}function a(e,t){var r,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&(r=e[n],i=t?(i=e)&&"object"==typeof i&&"number"==typeof i.length&&"[object Array]"===Object.prototype.toString.call(i)?t+"[]":t+"["+n+"]":n,"object"==typeof r?o.push(a(r,i)):o.push(encodeURIComponent(i)+"="+encodeURIComponent(r)));return o.join("&")}t.exports={parse:function(e){return n(e=e||window.location.href)?e.replace(/#.*$/,"").replace(/^.*\?/,"").split("&").reduce(function(e,t){var r=t.split("="),t=decodeURIComponent(r[0]),r=decodeURIComponent(r[1]);return e[t]=r,e},{}):{}},stringify:a,queryify:function(e,t){return e=e||"",null!=t&&"object"==typeof t&&function(e){for(var t in e)if(e.hasOwnProperty(t))return 1}(t)&&(e+=-1===e.indexOf("?")?"?":"",e+=-1!==e.indexOf("=")?"&":"",e+=a(t)),e},hasQueryParams:n}},{}],57:[function(e,t,r){"use strict";var n="function"==typeof atob?window.atob:i;function i(e){var t,r,n,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="";if(!new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$").test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");for(o=0;r=a.indexOf(e.charAt(o++)),t=(15&(n=a.indexOf(e.charAt(o++))))<<4|(i=a.indexOf(e.charAt(o++)))>>2&15,i=(3&i)<<6|63&a.indexOf(e.charAt(o++)),s+=String.fromCharCode((63&r)<<2|n>>4&3)+(t?String.fromCharCode(t):"")+(i?String.fromCharCode(i):""),o<e.length;);return s}t.exports={atob:function(e){return n.call(window,e)},_atob:i}},{}]},{},[21])(21)});;
!function(e){var t;"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):((t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).braintree||(t.braintree={})).hostedFields=e()}(function(){return function r(i,o,s){function a(t,e){if(!o[t]){if(!i[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=o[t]={exports:{}},i[t][0].call(n.exports,function(e){return a(i[t][1][e]||e)},n,n.exports,r,i,o,s)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)a(s[e]);return a}({1:[function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.PromiseGlobal=void 0;e=r(e("promise-polyfill")),e="undefined"!=typeof Promise?Promise:e.default;n.PromiseGlobal=e},{"promise-polyfill":59}],2:[function(e,t,n){"use strict";var s=e("./lib/promise"),a={};function r(n){var e,t=JSON.stringify(n);if(!n.forceScriptReload&&(e=a[t]))return e;var r=document.createElement("script"),i=n.dataAttributes||{},o=n.container||document.head;return r.src=n.src,r.id=n.id||"",r.async=!0,n.crossorigin&&r.setAttribute("crossorigin",""+n.crossorigin),Object.keys(i).forEach(function(e){r.setAttribute("data-"+e,""+i[e])}),e=new s.PromiseGlobal(function(e,t){r.addEventListener("load",function(){e(r)}),r.addEventListener("error",function(){t(new Error(n.src+" failed to load."))}),r.addEventListener("abort",function(){t(new Error(n.src+" has aborted."))}),o.appendChild(r)}),a[t]=e}r.clearCache=function(){a={}},t.exports=r},{"./lib/promise":1}],3:[function(e,t,n){t.exports=e("./dist/load-script")},{"./dist/load-script":2}],4:[function(e,t,n){"use strict";t.exports=function(e){return e=e||window.navigator.userAgent,/Android/.test(e)}},{}],5:[function(e,t,n){"use strict";t.exports=function(e){return e=e||window.navigator.userAgent,/CrOS/i.test(e)}},{}],6:[function(e,t,n){"use strict";var r=e("./is-edge"),i=e("./is-samsung");t.exports=function(e){return!(-1===(e=e||window.navigator.userAgent).indexOf("Chrome")&&-1===e.indexOf("CriOS")||r(e)||i(e))}},{"./is-edge":7,"./is-samsung":15}],7:[function(e,t,n){"use strict";t.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("Edge/")}},{}],8:[function(e,t,n){"use strict";t.exports=function(e){return e=e||window.navigator.userAgent,/Firefox/i.test(e)}},{}],9:[function(e,t,n){"use strict";var r=e("./is-ie11");t.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("MSIE")||r(e)}},{"./is-ie11":11}],10:[function(e,t,n){"use strict";t.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("MSIE 10")}},{}],11:[function(e,t,n){"use strict";t.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("Trident/7")}},{}],12:[function(e,t,n){"use strict";t.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("MSIE 9")}},{}],13:[function(e,t,n){"use strict";var r=e("./is-ios");t.exports=function(e){return e=e||window.navigator.userAgent,!!r(e)&&(!!/\bGSA\b/.test(e)||/.+AppleWebKit(?!.*Safari)/.test(e))}},{"./is-ios":14}],14:[function(e,t,n){"use strict";t.exports=function(e){return e=e||window.navigator.userAgent,/iPhone|iPod|iPad/i.test(e)}},{}],15:[function(e,t,n){"use strict";t.exports=function(e){return e=e||window.navigator.userAgent,/SamsungBrowser/i.test(e)}},{}],16:[function(e,t,n){t.exports=e("./dist/is-android")},{"./dist/is-android":4}],17:[function(e,t,n){t.exports=e("./dist/is-chrome-os")},{"./dist/is-chrome-os":5}],18:[function(e,t,n){t.exports=e("./dist/is-chrome")},{"./dist/is-chrome":6}],19:[function(e,t,n){t.exports=e("./dist/is-edge")},{"./dist/is-edge":7}],20:[function(e,t,n){t.exports=e("./dist/is-firefox")},{"./dist/is-firefox":8}],21:[function(e,t,n){t.exports=e("./dist/is-ie")},{"./dist/is-ie":9}],22:[function(e,t,n){t.exports=e("./dist/is-ie10")},{"./dist/is-ie10":10}],23:[function(e,t,n){t.exports=e("./dist/is-ie9")},{"./dist/is-ie9":12}],24:[function(e,t,n){t.exports=e("./dist/is-ios-webview")},{"./dist/is-ios-webview":13}],25:[function(e,t,n){t.exports=e("./dist/is-ios")},{"./dist/is-ios":14}],26:[function(e,t,n){"use strict";function r(e){return e.className.trim().split(/\s+/)}function i(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e.className=r(e).filter(function(e){return-1===t.indexOf(e)}).concat(t).join(" ")}function o(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e.className=r(e).filter(function(e){return-1===t.indexOf(e)}).join(" ")}Object.defineProperty(n,"__esModule",{value:!0}),n.toggle=n.remove=n.add=void 0,n.add=i,n.remove=o,n.toggle=function(e,t,n){(n?i:o)(e,t)}},{}],27:[function(e,t,n){"use strict";var r=(i.prototype.on=function(e,t){this._events[e]?this._events[e].push(t):this._events[e]=[t]},i.prototype.off=function(e,t){e=this._events[e];e&&(t=e.indexOf(t),e.splice(t,1))},i.prototype._emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e=this._events[e];e&&e.forEach(function(e){e.apply(void 0,t)})},i.prototype.hasListener=function(e){e=this._events[e];return!!e&&0<e.length},i.createChild=function(e){e.prototype=Object.create(i.prototype,{constructor:e})},i);function i(){this._events={}}t.exports=r},{}],28:[function(e,t,n){"use strict";var r="undefined"!=typeof Promise?Promise:null,r=(i.defaultOnResolve=function(e){return i.Promise.resolve(e)},i.defaultOnReject=function(e){return i.Promise.reject(e)},i.setPromise=function(e){i.Promise=e},i.shouldCatchExceptions=function(e){return e.hasOwnProperty("suppressUnhandledPromiseMessage")?Boolean(e.suppressUnhandledPromiseMessage):Boolean(i.suppressUnhandledPromiseMessage)},i.all=function(e){return i.Promise.all(e)},i.allSettled=function(e){return i.Promise.allSettled(e)},i.race=function(e){return i.Promise.race(e)},i.reject=function(e){return i.Promise.reject(e)},i.resolve=function(e){return i.Promise.resolve(e)},i.prototype.then=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=this._promise).then.apply(e,t)},i.prototype.catch=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=this._promise).catch.apply(e,t)},i.prototype.resolve=function(e){var t=this;return this.isFulfilled||(this._setResolved(),i.Promise.resolve().then(function(){return t._onResolve(e)}).then(function(e){t._resolveFunction(e)}).catch(function(e){t._resetState(),t.reject(e)})),this},i.prototype.reject=function(e){var t=this;return this.isFulfilled||(this._setRejected(),i.Promise.resolve().then(function(){return t._onReject(e)}).then(function(e){t._setResolved(),t._resolveFunction(e)}).catch(function(e){return t._rejectFunction(e)})),this},i.prototype._resetState=function(){this.isFulfilled=!1,this.isResolved=!1,this.isRejected=!1},i.prototype._setResolved=function(){this.isFulfilled=!0,this.isResolved=!0,this.isRejected=!1},i.prototype._setRejected=function(){this.isFulfilled=!0,this.isResolved=!1,this.isRejected=!0},i.Promise=r,i);function i(e){var n=this;"function"!=typeof e?(this._promise=new i.Promise(function(e,t){n._resolveFunction=e,n._rejectFunction=t}),this._onResolve=(e=e||{}).onResolve||i.defaultOnResolve,this._onReject=e.onReject||i.defaultOnReject,i.shouldCatchExceptions(e)&&this._promise.catch(function(){}),this._resetState()):this._promise=new i.Promise(e)}t.exports=r},{}],29:[function(e,t,n){"use strict";var r=e("./lib/set-attributes"),i=e("./lib/default-attributes"),o=e("./lib/assign");t.exports=function(e){void 0===e&&(e={});var t=document.createElement("iframe"),e=o.assign({},i.defaultAttributes,e);return e.style&&"string"!=typeof e.style&&(o.assign(t.style,e.style),delete e.style),r.setAttributes(t,e),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":30,"./lib/default-attributes":31,"./lib/set-attributes":32}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.assign=void 0,n.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(e){n[e]=t[e]})}),n}},{}],31:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.defaultAttributes=void 0,n.defaultAttributes={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],32:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.setAttributes=void 0,n.setAttributes=function(e,t){for(var n in t){var r;t.hasOwnProperty(n)&&(null==(r=t[n])?e.removeAttribute(n):e.setAttribute(n,r))}}},{}],33:[function(e,t,n){"use strict";t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}},{}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.deferred=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];setTimeout(function(){try{n.apply(void 0,e)}catch(e){console.log("Error in callback function"),console.log(e)}},1)}}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.once=function(n){var r=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r||(r=!0,n.apply(void 0,e))}}},{}],36:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.promiseOrCallback=function(e,t){if(!t)return e;e.then(function(e){return t(null,e)}).catch(function(e){return t(e)})}},{}],37:[function(e,t,n){"use strict";var i=e("./lib/deferred"),o=e("./lib/once"),s=e("./lib/promise-or-callback");function a(r){return function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return"function"==typeof t[t.length-1]&&(e=t.pop(),e=o.once(i.deferred(e))),s.promiseOrCallback(r.apply(this,t),e)}}a.wrapPrototype=function(r,e){var i=(e=void 0===e?{}:e).ignoreMethods||[],o=!0===e.transformPrivateMethods;return Object.getOwnPropertyNames(r.prototype).filter(function(e){var t="constructor"!==e&&"function"==typeof r.prototype[e],n=-1===i.indexOf(e),e=o||"_"!==e.charAt(0);return t&&e&&n}).forEach(function(e){var t=r.prototype[e];r.prototype[e]=a(t)}),r},t.exports=a},{"./lib/deferred":34,"./lib/once":35,"./lib/promise-or-callback":36}],38:[function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=e("./lib/card-types"),o=e("./lib/add-matching-cards-to-results"),s=e("./lib/is-valid-input-type"),a=e("./lib/find-best-match"),c=e("./lib/clone"),u={},e={VISA:"visa",MASTERCARD:"mastercard",AMERICAN_EXPRESS:"american-express",DINERS_CLUB:"diners-club",DISCOVER:"discover",JCB:"jcb",UNIONPAY:"unionpay",MAESTRO:"maestro",ELO:"elo",MIR:"mir",HIPER:"hiper",HIPERCARD:"hipercard"},d=[e.VISA,e.MASTERCARD,e.AMERICAN_EXPRESS,e.DINERS_CLUB,e.DISCOVER,e.JCB,e.UNIONPAY,e.MAESTRO,e.ELO,e.MIR,e.HIPER,e.HIPERCARD],l=c.clone(d);function f(e){return u[e]||i[e]}function p(e,t){void 0===t&&(t=!1);var n=l.indexOf(e);if(!t&&-1===n)throw new Error('"'+e+'" is not a supported card type.');return n}function h(t){var n=[];if(!s.isValidInputType(t))return n;if(0===t.length)return l.map(function(e){return c.clone(f(e))});l.forEach(function(e){e=f(e);o.addMatchingCardsToResults(t,e,n)});var e=a.findBestMatch(n);return e?[e]:n}h.getTypeInfo=function(e){return c.clone(f(e))},h.removeCard=function(e){e=p(e);l.splice(e,1)},h.addCard=function(e){var t=p(e.type,!0);u[e.type]=e,-1===t&&l.push(e.type)},h.updateCard=function(e,t){var n=u[e]||i[e];if(!n)throw new Error('"'+e+"\" is not a recognized type. Use `addCard` instead.'");if(t.type&&n.type!==t.type)throw new Error("Cannot overwrite type parameter.");n=c.clone(n),n=r(r({},n),t);u[n.type]=n},h.changeOrder=function(e,t){var n=p(e);l.splice(n,1),l.splice(t,0,e)},h.resetModifications=function(){l=c.clone(d),u={}},h.types=e,t.exports=h},{"./lib/add-matching-cards-to-results":39,"./lib/card-types":40,"./lib/clone":41,"./lib/find-best-match":42,"./lib/is-valid-input-type":43}],39:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addMatchingCardsToResults=void 0;var s=e("./clone"),a=e("./matches");n.addMatchingCardsToResults=function(e,t,n){for(var r=0;r<t.patterns.length;r++){var i=t.patterns[r];if(a.matches(e,i)){var o=s.clone(t),i=(Array.isArray(i)?String(i[0]):String(i)).length;e.length>=i&&(o.matchStrength=i),n.push(o);break}}}},{"./clone":41,"./matches":44}],40:[function(e,t,n){"use strict";t.exports={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[624,626],[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[622019,622999],[62207,62209],[622126,622925],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292,810,[8110,8131],[8132,8151],[8152,8163],[8164,8171]],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,504174],[504176,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,63737423,63743358,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}}},{}],41:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function(e){return e?JSON.parse(JSON.stringify(e)):null}},{}],42:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.findBestMatch=void 0,n.findBestMatch=function(e){return 0<(n=(t=e).filter(function(e){return e.matchStrength}).length)&&n===t.length?e.reduce(function(e,t){return!e||Number(e.matchStrength)<Number(t.matchStrength)?t:e}):null;var t,n}},{}],43:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isValidInputType=void 0,n.isValidInputType=function(e){return"string"==typeof e||e instanceof String}},{}],44:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.matches=void 0,n.matches=function(e,t){return Array.isArray(t)?(n=e,r=t[0],i=t[1],o=String(r).length,n=n.substr(0,o),o=parseInt(n,10),r=parseInt(String(r).substr(0,n.length),10),i=parseInt(String(i).substr(0,n.length),10),r<=o&&o<=i):(e=e,t=t,(t=String(t)).substring(0,e.length)===e.substring(0,t.length));var n,r,i,o}},{}],45:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Framebus=void 0;var i=e("./lib/is-not-string"),a=e("./lib/subscription-args-invalid"),o=e("./lib/broadcast"),s=e("./lib/package-payload"),c=e("./lib/constants"),e="undefined"!=typeof window&&window.Promise,e=(u.setPromise=function(e){u.Promise=e},u.target=function(e){return new u(e)},u.prototype.include=function(e){return null!=e&&(null!=e.Window&&(e.constructor===e.Window&&(c.childWindows.push(e),!0)))},u.prototype.target=function(e){return u.target(e)},u.prototype.emit=function(e,t,n){if(this.isDestroyed)return!1;var r=this.origin;if(e=this.namespaceEvent(e),i.isntString(e))return!1;if(i.isntString(r))return!1;"function"==typeof t&&(n=t,t=void 0);n=s.packagePayload(e,r,t,n);return!!n&&(o.broadcast(window.top||window.self,n,r),!0)},u.prototype.emitAsPromise=function(n,r){var i=this;return new u.Promise(function(t,e){i.emit(n,r,function(e){t(e)})||e(new Error('Listener not added for "'+n+'"'))})},u.prototype.on=function(e,n){if(this.isDestroyed)return!1;var r=this,t=this.origin,i=n;return e=this.namespaceEvent(e),!a.subscriptionArgsInvalid(e,i,t)&&(this.verifyDomain&&(i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.checkOrigin(this&&this.origin)&&n.apply(void 0,e)}),this.listeners.push({eventName:e,handler:i,originalHandler:n}),c.subscribers[t]=c.subscribers[t]||{},c.subscribers[t][e]=c.subscribers[t][e]||[],c.subscribers[t][e].push(i),!0)},u.prototype.off=function(e,t){var n=t;if(this.isDestroyed)return!1;if(this.verifyDomain)for(var r=0;r<this.listeners.length;r++){var i=this.listeners[r];i.originalHandler===t&&(n=i.handler)}e=this.namespaceEvent(e);var o=this.origin;if(a.subscriptionArgsInvalid(e,n,o))return!1;var s=c.subscribers[o]&&c.subscribers[o][e];if(!s)return!1;for(r=0;r<s.length;r++)if(s[r]===n)return s.splice(r,1),!0;return!1},u.prototype.teardown=function(){if(!this.isDestroyed){this.isDestroyed=!0;for(var e=0;e<this.listeners.length;e++){var t=this.listeners[e];this.off(t.eventName,t.handler)}this.listeners.length=0}},u.prototype.checkOrigin=function(e){var t=document.createElement("a");t.href=location.href;var n="https:"===t.protocol?t.host.replace(/:443$/,""):"http:"===t.protocol?t.host.replace(/:80$/,""):t.host;return t.protocol+"//"+n===e||(!this.verifyDomain||this.verifyDomain(e))},u.prototype.namespaceEvent=function(e){return this.channel?this.channel+":"+e:e},u.Promise=e,u);function u(e){this.origin=(e=void 0===e?{}:e).origin||"*",this.channel=e.channel||"",this.verifyDomain=e.verifyDomain,this.isDestroyed=!1,this.listeners=[]}n.Framebus=e},{"./lib/broadcast":49,"./lib/constants":50,"./lib/is-not-string":53,"./lib/package-payload":55,"./lib/subscription-args-invalid":57}],46:[function(e,t,n){"use strict";var r=e("./lib/attach"),e=e("./framebus");r.attach(),t.exports=e.Framebus},{"./framebus":45,"./lib/attach":47}],47:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.detach=n.attach=void 0;var r=e("./message"),i=!1;n.attach=function(){i||"undefined"==typeof window||(i=!0,window.addEventListener("message",r.onmessage,!1))},n.detach=function(){i=!1,window.removeEventListener("message",r.onmessage,!1)}},{"./message":54}],48:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.broadcastToChildWindows=void 0;var o=e("./broadcast"),s=e("./constants");n.broadcastToChildWindows=function(e,t,n){for(var r=s.childWindows.length-1;0<=r;r--){var i=s.childWindows[r];i.closed?s.childWindows.splice(r,1):n!==i&&o.broadcast(i.top,e,t)}}},{"./broadcast":49,"./constants":50}],49:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.broadcast=void 0;var s=e("./has-opener");n.broadcast=function e(t,n,r){var i,o=0;try{for(t.postMessage(n,r),s.hasOpener(t)&&t.opener.top!==window.top&&e(t.opener.top,n,r);i=t.frames[o];)e(i,n,r),o++}catch(e){}}},{"./has-opener":52}],50:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.subscribers=n.childWindows=n.prefix=void 0,n.prefix="/*framebus*/",n.childWindows=[],n.subscribers={}},{}],51:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.dispatch=void 0;var a=e("./constants");n.dispatch=function(e,t,n,r,i){if(a.subscribers[e]&&a.subscribers[e][t]){var o=[];n&&o.push(n),r&&o.push(r);for(var s=0;s<a.subscribers[e][t].length;s++)a.subscribers[e][t][s].apply(i,o)}}},{"./constants":50}],52:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.hasOpener=void 0,n.hasOpener=function(e){return e.top===e&&(null!=e.opener&&(e.opener!==e&&!0!==e.opener.closed))}},{}],53:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isntString=void 0,n.isntString=function(e){return"string"!=typeof e}},{}],54:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.onmessage=void 0;var i=e("./is-not-string"),o=e("./unpack-payload"),s=e("./dispatch"),a=e("./broadcast-to-child-windows");n.onmessage=function(e){var t,n,r;i.isntString(e.data)||(t=o.unpackPayload(e))&&(n=t.eventData,r=t.reply,s.dispatch("*",t.event,n,r,e),s.dispatch(e.origin,t.event,n,r,e),a.broadcastToChildWindows(e.data,t.origin,e.source))}},{"./broadcast-to-child-windows":48,"./dispatch":51,"./is-not-string":53,"./unpack-payload":58}],55:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.packagePayload=void 0;var o=e("./subscribe-replier"),s=e("./constants");n.packagePayload=function(e,t,n,r){var i,e={event:e,origin:t};"function"==typeof r&&(e.reply=o.subscribeReplier(r,t)),e.eventData=n;try{i=s.prefix+JSON.stringify(e)}catch(e){throw new Error("Could not stringify event: "+e.message)}return i}},{"./constants":50,"./subscribe-replier":56}],56:[function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.subscribeReplier=void 0;var s=e("../framebus"),a=r(e("@braintree/uuid"));n.subscribeReplier=function(r,i){var o=a.default();return s.Framebus.target({origin:i}).on(o,function e(t,n){r(t,n),s.Framebus.target({origin:i}).off(o,e)}),o}},{"../framebus":45,"@braintree/uuid":33}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.subscriptionArgsInvalid=void 0;var r=e("./is-not-string");n.subscriptionArgsInvalid=function(e,t,n){return!!r.isntString(e)||("function"!=typeof t||r.isntString(n))}},{"./is-not-string":53}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.unpackPayload=void 0;var o=e("./constants"),s=e("./package-payload");n.unpackPayload=function(e){var t,n,r,i;if(e.data.slice(0,o.prefix.length)!==o.prefix)return!1;try{t=JSON.parse(e.data.slice(o.prefix.length))}catch(e){return!1}return t.reply&&(n=e.origin,r=e.source,i=t.reply,t.reply=function(e){!r||(e=s.packagePayload(i,n,e))&&r.postMessage(e,n)}),t}},{"./constants":50,"./package-payload":55}],59:[function(e,t,n){"use strict";var r=setTimeout;function c(e){return Boolean(e&&void 0!==e.length)}function i(){}function o(e){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function s(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,o._immediateFn(function(){var e,t=1===n._state?r.onFulfilled:r.onRejected;if(null!==t){try{e=t(n._value)}catch(e){return void u(r.promise,e)}a(r.promise,e)}else(1===n._state?a:u)(r.promise,n._value)})):n._deferreds.push(r)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void d(t);if("function"==typeof n)return void f((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,d(t)}catch(e){u(t,e)}var r,i}function u(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)s(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,u(t,e))})}catch(e){if(n)return;n=!0,u(t,e)}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(i);return s(this,new l(e,t,n)),n},o.prototype.finally=function(t){var n=this.constructor;return this.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){return n.reject(e)})})},o.all=function(t){return new o(function(i,o){if(!c(t))return o(new TypeError("Promise.all accepts an array"));var s=Array.prototype.slice.call(t);if(0===s.length)return i([]);var a=s.length;for(var e=0;e<s.length;e++)!function t(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if("function"==typeof r)return void r.call(e,function(e){t(n,e)},o)}s[n]=e,0==--a&&i(s)}catch(e){o(e)}}(e,s[e])})},o.allSettled=function(n){return new this(function(i,e){if(!n||void 0===n.length)return e(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var o=Array.prototype.slice.call(n);if(0===o.length)return i([]);var s=o.length;for(var t=0;t<o.length;t++)!function t(n,e){if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if("function"==typeof r)return void r.call(e,function(e){t(n,e)},function(e){o[n]={status:"rejected",reason:e},0==--s&&i(o)})}o[n]={status:"fulfilled",value:e},0==--s&&i(o)}(t,o[t])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(n){return new o(function(e,t){t(n)})},o.race=function(i){return new o(function(e,t){if(!c(i))return t(new TypeError("Promise.race accepts an array"));for(var n=0,r=i.length;n<r;n++)o.resolve(i[n]).then(e,t)})},o._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){r(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t.exports=o},{}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isIos=n.isIE9=n.isSamsungBrowser=n.isAndroidChrome=n.isKitKatWebview=void 0;var r="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent,i=e("@braintree/browser-detection/is-android"),o=e("@braintree/browser-detection/is-chrome-os"),s=e("@braintree/browser-detection/is-chrome"),a=e("@braintree/browser-detection/is-ios");n.isIos=a;e=e("@braintree/browser-detection/is-ie9");n.isIE9=e;var c=/Version\/\d\.\d* Chrome\/\d*\.0\.0\.0/;n.isKitKatWebview=function(e){return i(e=void 0===e?r:e)&&c.test(e)},n.isAndroidChrome=function(e){return(i(e=void 0===e?r:e)||o(e))&&s(e)},n.isSamsungBrowser=function(e){return/SamsungBrowser/.test(e=void 0===e?r:e)||!s(e=e)&&-1<e.indexOf("Samsung")}},{"@braintree/browser-detection/is-android":16,"@braintree/browser-detection/is-chrome":18,"@braintree/browser-detection/is-chrome-os":17,"@braintree/browser-detection/is-ie9":23,"@braintree/browser-detection/is-ios":25}],61:[function(e,t,n){"use strict";var r=e("./lib/device");t.exports=function(){return!r.isSamsungBrowser()}},{"./lib/device":60}],62:[function(e,t,n){t.exports=e("./dist/supports-input-formatting")},{"./dist/supports-input-formatting":61}],63:[function(e,t,n){"use strict";var r=e("../../lib/braintree-error"),i=e("../shared/errors"),o=e("../shared/constants").allowedAttributes;t.exports=function(e,t){var n;return o.hasOwnProperty(e)?null==t||function(e,t){{if("string"===o[e])return"string"==typeof t||"number"==typeof t;if("boolean"===o[e])return"true"===String(t)||"false"===String(t)}return!1}(e,t)||(n=new r({type:i.HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED.type,code:i.HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED.code,message:'Value "'+t+'" is not allowed for "'+e+'" attribute.'})):n=new r({type:i.HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED.type,code:i.HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED.code,message:'The "'+e+'" attribute is not supported in Hosted Fields.'}),n}},{"../../lib/braintree-error":82,"../shared/constants":71,"../shared/errors":72}],64:[function(e,t,n){"use strict";var r=e("../shared/constants"),i=e("../../lib/use-min");t.exports=function(e,t,n){return e+"/web/"+r.VERSION+"/html/hosted-fields-frame"+i(n)+".html#"+t}},{"../../lib/use-min":98,"../shared/constants":71}],65:[function(e,t,n){"use strict";var c=e("../shared/constants").navigationDirections,r=e("../shared/browser-detection"),u=e("../shared/focus-intercept"),d=e("../shared/find-parent-tags"),i=["INPUT","SELECT","TEXTAREA"],o=["hidden","button","reset","submit","checkbox","radio","file"];function l(e){return r.hasSoftwareKeyboard()?-1<i.indexOf(e.tagName)&&o.indexOf(e.type)<0:"hidden"!==e.type}function s(e){for(var t,n=0;n<e.length;n++)if(l(t=e[n]))return t;return null}t.exports={removeExtraFocusElements:function(e,t){e=Array.prototype.slice.call(e.elements);[s(e),s(e.reverse())].forEach(function(e){e&&u.matchFocusElement(e.getAttribute("id"))&&t(e.getAttribute("id"))})},createFocusChangeHandler:function(s,a){return function(e){var t,n,r,i,o=document.getElementById("bt-"+e.field+"-"+e.direction+"-"+s);if(o)if(r=d(o,"form")[0],document.forms.length<1||!r)a.onRemoveFocusIntercepts();else{t=(r=[].slice.call(r.elements)).indexOf(o),i=function(e,t){switch(e){case c.BACK:return{checkIndexBounds:function(e){return e<0},indexChange:-1};case c.FORWARD:return{checkIndexBounds:function(e){return t-1<e},indexChange:1}}return{}}(e.direction,r.length);do{if(t+=i.indexChange,i.checkIndexBounds(t))return}while(!l(n=r[t]));u.matchFocusElement(n.getAttribute("id"))?a.onTriggerInputFocus(n.getAttribute("data-braintree-type")):n.focus()}}}}},{"../shared/browser-detection":70,"../shared/constants":71,"../shared/find-parent-tags":73,"../shared/focus-intercept":74}],66:[function(e,t,n){"use strict";var i=e("../shared/constants").allowedStyles;t.exports=function(e){var n,t=document.createElement("input"),r={};return"."===e[0]&&(e=e.substring(1)),t.className=e,t.style.display="none !important",t.style.position="fixed !important",t.style.left="-99999px !important",t.style.top="-99999px !important",document.body.appendChild(t),n=window.getComputedStyle(t),i.forEach(function(e){var t=n[e];t&&(r[e]=t)}),document.body.removeChild(t),r}},{"../shared/constants":71}],67:[function(e,t,n){"use strict";var r=e("../../lib/assign").assign,i=e("../../lib/create-assets-url"),f=e("../../lib/is-verified-domain"),p=e("../../lib/destructor"),h=e("@braintree/class-list"),_=e("@braintree/iframer"),E=e("framebus"),m=e("../../lib/create-deferred-client"),b=e("../../lib/braintree-error"),y=e("./compose-url"),I=e("./get-styles-from-class"),g=e("../shared/constants"),v=e("../shared/errors"),T=e("../../lib/constants").INTEGRATION_TIMEOUT_MS,O=e("@braintree/uuid"),c=e("../shared/find-parent-tags"),S=e("../shared/browser-detection"),D=g.events,w=e("@braintree/event-emitter"),A=e("./inject-frame"),N=e("../../lib/analytics"),o=g.allowedFields,L=e("../../lib/methods"),R=e("../../lib/shadow"),u=e("../../lib/find-root-node"),F=e("../../lib/convert-methods-to-error"),C=e("../../lib/errors"),x=e("../shared/get-card-types"),s=e("./attribute-validation-error"),P=e("../../lib/promise"),a=e("@braintree/wrap-promise"),M=e("./focus-change"),U=e("../shared/focus-intercept").destroy,H=5;function V(s){return function(e){var t,n,r=e.merchantPayload,i=r.emittedBy,o=s[i].containerElement;Object.keys(r.fields).forEach(function(e){r.fields[e].container=s[e].containerElement}),t=r.fields[i],"blur"===e.type&&(n=o,S.isIos()&&document.activeElement===document.body&&((i=n.querySelector("input"))||((i=document.createElement("input")).type="button",i.style.height="0px",i.style.width="0px",i.style.opacity="0",i.style.padding="0",i.style.position="absolute",i.style.left="-200%",i.style.top="0px",n.insertBefore(i,n.firstChild)),i.focus(),i.blur())),h.toggle(o,g.externalClasses.FOCUSED,t.isFocused),h.toggle(o,g.externalClasses.VALID,t.isValid),h.toggle(o,g.externalClasses.INVALID,!t.isPotentiallyValid),this._state={cards:r.cards,fields:r.fields},this._emit(e.type,r)}}function j(o){var n,e,t,s,a=this,c={},u={},d=[],l=O();if(this._merchantConfigurationOptions=r({},o),t=o.client?(e=(t=o.client.getConfiguration()).gatewayConfiguration.assetsUrl,t.isDebug):(e=i.create(o.authorization),Boolean(o.isDebug)),this._clientPromise=m.create({client:o.client,authorization:o.authorization,debug:t,assetsUrl:e,name:"Hosted Fields"}),s=y(e,l,t),!o.fields||0===Object.keys(o.fields).length)throw new b({type:C.INSTANTIATION_OPTION_REQUIRED.type,code:C.INSTANTIATION_OPTION_REQUIRED.code,message:"options.fields is required when instantiating Hosted Fields."});w.call(this),this._injectedNodes=[],this._destructor=new p,this._fields=c,this._state={fields:{},cards:x("")},this._bus=new E({channel:l,verifyDomain:f}),this._destructor.registerFunctionForTeardown(function(){a._bus.teardown()}),o.client?N.sendEvent(this._clientPromise,"custom.hosted-fields.initialized"):N.sendEvent(this._clientPromise,"custom.hosted-fields.initialized.deferred-client"),Object.keys(o.fields).forEach(function(t){var e,n,r,i;if(!g.allowedFields.hasOwnProperty(t))throw new b({type:v.HOSTED_FIELDS_INVALID_FIELD_KEY.type,code:v.HOSTED_FIELDS_INVALID_FIELD_KEY.code,message:'"'+t+'" is not a valid field.'});if(!(n="string"==typeof(n=(e=o.fields[t]).container||e.selector)?document.querySelector(n):n)||1!==n.nodeType)throw new b({type:v.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.type,code:v.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.code,message:v.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.message,details:{fieldSelector:e.selector,fieldContainer:e.container,fieldKey:t}});if(n.querySelector('iframe[name^="braintree-"]'))throw new b({type:v.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.type,code:v.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.code,message:v.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.message,details:{fieldSelector:e.selector,fieldContainer:e.container,fieldKey:t}});if(R.isShadowElement(i=n)&&(i=R.transformToSlot(i,"height: 100%")),e.maxlength&&"number"!=typeof e.maxlength)throw new b({type:v.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type,code:v.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code,message:"The value for maxlength must be a number.",details:{fieldKey:t}});if(e.minlength&&"number"!=typeof e.minlength)throw new b({type:v.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type,code:v.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code,message:"The value for minlength must be a number.",details:{fieldKey:t}});r=_({type:t,name:"braintree-hosted-field-"+t,style:g.defaultIFrameStyle,title:"Secure Credit Card Frame - "+g.allowedFields[t].label}),this._injectedNodes.push.apply(this._injectedNodes,A(l,r,i,function(){a._bus.emit(D.TRIGGER_INPUT_FOCUS,{field:t})})),this._setupLabelFocus(t,n),c[t]={frameElement:r,containerElement:n},i=new P(function(e){u[t]=e}),d.push(i),this._state.fields[t]={isEmpty:!0,isValid:!1,isPotentiallyValid:!0,isFocused:!1,container:n},setTimeout(function(){S.isIE()||S.isEdge()?(r.src="about:blank",setTimeout(function(){r.src=s},0)):r.src=s},0)}.bind(this)),this._merchantConfigurationOptions.styles&&Object.keys(this._merchantConfigurationOptions.styles).forEach(function(e){var t=a._merchantConfigurationOptions.styles[e];"string"==typeof t&&(a._merchantConfigurationOptions.styles[e]=I(t))}),this._bus.on(D.REMOVE_FOCUS_INTERCEPTS,function(e){U(e&&e.id)}),this._bus.on(D.TRIGGER_FOCUS_CHANGE,M.createFocusChangeHandler(l,{onRemoveFocusIntercepts:function(e){a._bus.emit(D.REMOVE_FOCUS_INTERCEPTS,{id:e})},onTriggerInputFocus:function(e){a._bus.emit(D.TRIGGER_INPUT_FOCUS,{field:e})}})),this._bus.on(D.READY_FOR_CLIENT,function(t){a._clientPromise.then(function(e){t(e)})}),this._bus.on(D.CARD_FORM_ENTRY_HAS_BEGUN,function(){N.sendEvent(a._clientPromise,"hosted-fields.input.started")}),this._bus.on(D.BIN_AVAILABLE,function(e){a._emit("binAvailable",{bin:e})}),n=setTimeout(function(){N.sendEvent(a._clientPromise,"custom.hosted-fields.load.timed-out"),a._emit("timeout")},T),P.all(d).then(function(e){var t,e=e[0];clearTimeout(n),e((e=a._merchantConfigurationOptions,(t=r({},e)).fields=r({},t.fields),Object.keys(t.fields).forEach(function(e){t.fields[e]=r({},t.fields[e]),delete t.fields[e].container}),t)),a._cleanUpFocusIntercepts(),a._emit("ready")}),this._bus.on(D.FRAME_READY,function(e,t){u[e.field](t)}),this._bus.on(D.INPUT_EVENT,V(c).bind(this)),S.isIos()&&this._bus.on(D.TRIGGER_INPUT_FOCUS,function(e){var r=c[e.field].containerElement;setTimeout(function(){var e,t,n;t=(e=r).getBoundingClientRect(),n=Math.floor(t.height/2),e=Math.floor(t.width/2),t.top<(window.innerHeight-n||document.documentElement.clientHeight-n)&&t.right>e&&t.bottom>n&&t.left<(window.innerWidth-e||document.documentElement.clientWidth-e)||r.scrollIntoView()},H)}),this._destructor.registerFunctionForTeardown(function(){for(var e,t,n=0;n<a._injectedNodes.length;n++)(t=(e=a._injectedNodes[n]).parentNode).removeChild(e),h.remove(t,g.externalClasses.FOCUSED,g.externalClasses.INVALID,g.externalClasses.VALID)}),this._destructor.registerFunctionForTeardown(function(){U()}),this._destructor.registerFunctionForTeardown(function(){var e=L(j.prototype).concat(L(w.prototype));F(a,e)})}w.createChild(j),j.prototype._setupLabelFocus=function(e,t){var n,r,i=S.isIos(),o=this._bus,s=u(t);if(!i&&null!=t.id){for(n=Array.prototype.slice.call(document.querySelectorAll('label[for="'+t.id+'"]')),n=(n=(n=s!==document?n.concat(Array.prototype.slice.call(s.querySelectorAll('label[for="'+t.id+'"]'))):n).concat(c(t,"label"))).filter(function(e,t,n){return n.indexOf(e)===t}),r=0;r<n.length;r++)n[r].addEventListener("click",a,!1);this._destructor.registerFunctionForTeardown(function(){for(r=0;r<n.length;r++)n[r].removeEventListener("click",a,!1)})}function a(){o.emit(D.TRIGGER_INPUT_FOCUS,{field:e})}},j.prototype._getAnyFieldContainer=function(){var n=this;return Object.keys(this._fields).reduce(function(e,t){return e||n._fields[t].containerElement},null)},j.prototype._cleanUpFocusIntercepts=function(){var e;document.forms.length<1?this._bus.emit(D.REMOVE_FOCUS_INTERCEPTS):(e=this._getAnyFieldContainer(),(e=c(e,"form")[0])?M.removeExtraFocusElements(e,function(e){this._bus.emit(D.REMOVE_FOCUS_INTERCEPTS,{id:e})}.bind(this)):this._bus.emit(D.REMOVE_FOCUS_INTERCEPTS))},j.prototype._attachInvalidFieldContainersToError=function(t){t.details&&t.details.invalidFieldKeys&&0<t.details.invalidFieldKeys.length&&(t.details.invalidFields={},t.details.invalidFieldKeys.forEach(function(e){t.details.invalidFields[e]=this._fields[e].containerElement}.bind(this)))},j.prototype.getChallenges=function(){return this._clientPromise.then(function(e){return e.getConfiguration().gatewayConfiguration.challenges})},j.prototype.getSupportedCardTypes=function(){return this._clientPromise.then(function(e){return e.getConfiguration().gatewayConfiguration.creditCards.supportedCardTypes.map(function(e){return"MasterCard"===e?"Mastercard":e})})},j.prototype.teardown=function(){var r=this;return new P(function(t,n){r._destructor.teardown(function(e){N.sendEvent(r._clientPromise,"custom.hosted-fields.teardown-completed"),e?n(e):t()})})},j.prototype.tokenize=function(e){var i=this;return e=e||{},new P(function(n,r){i._bus.emit(D.TOKENIZATION_REQUEST,e,function(e){var t=e[0],e=e[1];t?(i._attachInvalidFieldContainersToError(t),r(new b(t))):n(e)})})},j.prototype.addClass=function(e,t){var n;return o.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(D.ADD_CLASS,{field:e,classname:t}):n=new b({type:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot add class to "'+e+'" field because it is not part of the current Hosted Fields options.'}):n=new b({type:v.HOSTED_FIELDS_FIELD_INVALID.type,code:v.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when adding a class.'}),n?P.reject(n):P.resolve()},j.prototype.removeClass=function(e,t){var n;return o.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(D.REMOVE_CLASS,{field:e,classname:t}):n=new b({type:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot remove class from "'+e+'" field because it is not part of the current Hosted Fields options.'}):n=new b({type:v.HOSTED_FIELDS_FIELD_INVALID.type,code:v.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when removing a class.'}),n?P.reject(n):P.resolve()},j.prototype.setAttribute=function(e){var t,n;return o.hasOwnProperty(e.field)?this._fields.hasOwnProperty(e.field)?(t=s(e.attribute,e.value))?n=t:this._bus.emit(D.SET_ATTRIBUTE,{field:e.field,attribute:e.attribute,value:e.value}):n=new b({type:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot set attribute for "'+e.field+'" field because it is not part of the current Hosted Fields options.'}):n=new b({type:v.HOSTED_FIELDS_FIELD_INVALID.type,code:v.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e.field+'" is not a valid field. You must use a valid field option when setting an attribute.'}),n?P.reject(n):P.resolve()},j.prototype.setMonthOptions=function(t){var e,n=this,r=this._merchantConfigurationOptions.fields;return r.expirationMonth?r.expirationMonth.select||(e="Expiration month field must be a select element."):e="Expiration month field must exist to use setMonthOptions.",e?P.reject(new b({type:v.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type,code:v.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code,message:e})):new P(function(e){n._bus.emit(D.SET_MONTH_OPTIONS,t,e)})},j.prototype.setMessage=function(e){this._bus.emit(D.SET_MESSAGE,{field:e.field,message:e.message})},j.prototype.removeAttribute=function(e){var t,n;return o.hasOwnProperty(e.field)?this._fields.hasOwnProperty(e.field)?(t=s(e.attribute))?n=t:this._bus.emit(D.REMOVE_ATTRIBUTE,{field:e.field,attribute:e.attribute}):n=new b({type:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot remove attribute for "'+e.field+'" field because it is not part of the current Hosted Fields options.'}):n=new b({type:v.HOSTED_FIELDS_FIELD_INVALID.type,code:v.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e.field+'" is not a valid field. You must use a valid field option when removing an attribute.'}),n?P.reject(n):P.resolve()},j.prototype.setPlaceholder=function(e,t){return this.setAttribute({field:e,attribute:"placeholder",value:t})},j.prototype.clear=function(e){var t;return o.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(D.CLEAR_FIELD,{field:e}):t=new b({type:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot clear "'+e+'" field because it is not part of the current Hosted Fields options.'}):t=new b({type:v.HOSTED_FIELDS_FIELD_INVALID.type,code:v.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when clearing a field.'}),t?P.reject(t):P.resolve()},j.prototype.focus=function(e){var t;return o.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(D.TRIGGER_INPUT_FOCUS,{field:e}):t=new b({type:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:v.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot focus "'+e+'" field because it is not part of the current Hosted Fields options.'}):t=new b({type:v.HOSTED_FIELDS_FIELD_INVALID.type,code:v.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when focusing a field.'}),t?P.reject(t):P.resolve()},j.prototype.getState=function(){return this._state},t.exports=a.wrapPrototype(j)},{"../../lib/analytics":77,"../../lib/assign":79,"../../lib/braintree-error":82,"../../lib/constants":83,"../../lib/convert-methods-to-error":84,"../../lib/create-assets-url":85,"../../lib/create-deferred-client":87,"../../lib/destructor":88,"../../lib/errors":90,"../../lib/find-root-node":91,"../../lib/is-verified-domain":92,"../../lib/methods":94,"../../lib/promise":96,"../../lib/shadow":97,"../shared/browser-detection":70,"../shared/constants":71,"../shared/errors":72,"../shared/find-parent-tags":73,"../shared/focus-intercept":74,"../shared/get-card-types":75,"./attribute-validation-error":63,"./compose-url":64,"./focus-change":65,"./get-styles-from-class":66,"./inject-frame":68,"@braintree/class-list":26,"@braintree/event-emitter":27,"@braintree/iframer":29,"@braintree/uuid":33,"@braintree/wrap-promise":37,framebus:46}],68:[function(e,t,n){"use strict";var c=e("../shared/focus-intercept"),u=e("../shared/constants").navigationDirections;t.exports=function(e,t,n,r){var i=t.getAttribute("type"),o=document.createElement("div"),s=document.createDocumentFragment(),a=c.generate(e,i,u.BACK,r),r=c.generate(e,i,u.FORWARD,r);return o.style.clear="both",s.appendChild(a),s.appendChild(t),s.appendChild(r),s.appendChild(o),n.appendChild(s),[t,o]}},{"../shared/constants":71,"../shared/focus-intercept":74}],69:[function(e,t,n){"use strict";var r=e("./external/hosted-fields"),i=e("../lib/basic-component-verification"),o=e("./shared/errors"),s=e("restricted-input/supports-input-formatting"),a=e("@braintree/wrap-promise"),c=e("../lib/braintree-error"),u=e("../lib/promise");t.exports={supportsInputFormatting:s,create:a(function(e){return i.verify({name:"Hosted Fields",authorization:e.authorization,client:e.client}).then(function(){var n=new r(e);return new u(function(e,t){n.on("ready",function(){e(n)}),n.on("timeout",function(){t(new c(o.HOSTED_FIELDS_TIMEOUT))})})})}),VERSION:"3.76.4"}},{"../lib/basic-component-verification":80,"../lib/braintree-error":82,"../lib/promise":96,"./external/hosted-fields":67,"./shared/errors":72,"@braintree/wrap-promise":37,"restricted-input/supports-input-formatting":62}],70:[function(e,t,n){"use strict";var r=e("@braintree/browser-detection/is-android"),i=e("@braintree/browser-detection/is-chrome-os"),o=e("@braintree/browser-detection/is-ios"),s=e("@braintree/browser-detection/is-chrome");t.exports={isIE:e("@braintree/browser-detection/is-ie"),isEdge:e("@braintree/browser-detection/is-edge"),isIe9:e("@braintree/browser-detection/is-ie9"),isIe10:e("@braintree/browser-detection/is-ie10"),isAndroid:r,isChromeOS:i,isChromeIos:function(){return s()&&o()},isFirefox:e("@braintree/browser-detection/is-firefox"),isIos:o,isIosWebview:e("@braintree/browser-detection/is-ios-webview"),hasSoftwareKeyboard:function(){return r()||i()||o()}}},{"@braintree/browser-detection/is-android":16,"@braintree/browser-detection/is-chrome":18,"@braintree/browser-detection/is-chrome-os":17,"@braintree/browser-detection/is-edge":19,"@braintree/browser-detection/is-firefox":20,"@braintree/browser-detection/is-ie":21,"@braintree/browser-detection/is-ie10":22,"@braintree/browser-detection/is-ie9":23,"@braintree/browser-detection/is-ios":25,"@braintree/browser-detection/is-ios-webview":24}],71:[function(e,t,n){"use strict";var r=e("../../lib/enumerate"),e=e("./errors"),e={VERSION:"3.76.4",maxExpirationYearAge:19,externalEvents:{FOCUS:"focus",BLUR:"blur",EMPTY:"empty",NOT_EMPTY:"notEmpty",VALIDITY_CHANGE:"validityChange",CARD_TYPE_CHANGE:"cardTypeChange"},defaultMaxLengths:{number:19,postalCode:8,expirationDate:7,expirationMonth:2,expirationYear:4,cvv:3},externalClasses:{FOCUSED:"braintree-hosted-fields-focused",INVALID:"braintree-hosted-fields-invalid",VALID:"braintree-hosted-fields-valid"},navigationDirections:{BACK:"before",FORWARD:"after"},defaultIFrameStyle:{border:"none",width:"100%",height:"100%",float:"left"},tokenizationErrorCodes:{81724:e.HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE,81736:e.HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED},allowedStyles:["-moz-appearance","-moz-box-shadow","-moz-osx-font-smoothing","-moz-tap-highlight-color","-moz-transition","-webkit-appearance","-webkit-box-shadow","-webkit-font-smoothing","-webkit-tap-highlight-color","-webkit-transition","appearance","box-shadow","color","direction","font","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-weight","letter-spacing","line-height","margin","margin-top","margin-right","margin-bottom","margin-left","opacity","outline","padding","padding-top","padding-right","padding-bottom","padding-left","text-align","text-shadow","transition"],allowedFields:{cardholderName:{name:"cardholder-name",label:"Cardholder Name"},number:{name:"credit-card-number",label:"Credit Card Number"},cvv:{name:"cvv",label:"CVV"},expirationDate:{name:"expiration",label:"Expiration Date"},expirationMonth:{name:"expiration-month",label:"Expiration Month"},expirationYear:{name:"expiration-year",label:"Expiration Year"},postalCode:{name:"postal-code",label:"Postal Code"}},allowedAttributes:{"aria-invalid":"boolean","aria-required":"boolean",disabled:"boolean",placeholder:"string"},autocompleteMappings:{"cardholder-name":"cc-name","credit-card-number":"cc-number",expiration:"cc-exp","expiration-month":"cc-exp-month","expiration-year":"cc-exp-year",cvv:"cc-csc","postal-code":"billing postal-code"}};e.events=r(["ADD_CLASS","AUTOFILL_DATA_AVAILABLE","BIN_AVAILABLE","CARD_FORM_ENTRY_HAS_BEGUN","CLEAR_FIELD","CONFIGURATION","FRAME_READY","INPUT_EVENT","READY_FOR_CLIENT","REMOVE_ATTRIBUTE","REMOVE_CLASS","REMOVE_FOCUS_INTERCEPTS","SET_ATTRIBUTE","SET_MESSAGE","SET_MONTH_OPTIONS","TOKENIZATION_REQUEST","TRIGGER_FOCUS_CHANGE","TRIGGER_INPUT_FOCUS","VALIDATE_STRICT"],"hosted-fields:"),t.exports=e},{"../../lib/enumerate":89,"./errors":72}],72:[function(e,t,n){"use strict";e=e("../../lib/braintree-error");t.exports={HOSTED_FIELDS_TIMEOUT:{type:e.types.UNKNOWN,code:"HOSTED_FIELDS_TIMEOUT",message:"Hosted Fields timed out when attempting to set up."},HOSTED_FIELDS_INVALID_FIELD_KEY:{type:e.types.MERCHANT,code:"HOSTED_FIELDS_INVALID_FIELD_KEY"},HOSTED_FIELDS_INVALID_FIELD_SELECTOR:{type:e.types.MERCHANT,code:"HOSTED_FIELDS_INVALID_FIELD_SELECTOR",message:"Selector does not reference a valid DOM node."},HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME:{type:e.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME",message:"Element already contains a Braintree iframe."},HOSTED_FIELDS_FIELD_INVALID:{type:e.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_INVALID"},HOSTED_FIELDS_FIELD_NOT_PRESENT:{type:e.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_NOT_PRESENT"},HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR:{type:e.types.NETWORK,code:"HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE:{type:e.types.CUSTOMER,code:"HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE",message:"This credit card already exists in the merchant's vault."},HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED:{type:e.types.CUSTOMER,code:"HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED",message:"CVV verification failed during tokenization."},HOSTED_FIELDS_FAILED_TOKENIZATION:{type:e.types.CUSTOMER,code:"HOSTED_FIELDS_FAILED_TOKENIZATION",message:"The supplied card data failed tokenization."},HOSTED_FIELDS_FIELDS_EMPTY:{type:e.types.CUSTOMER,code:"HOSTED_FIELDS_FIELDS_EMPTY",message:"All fields are empty. Cannot tokenize empty card fields."},HOSTED_FIELDS_FIELDS_INVALID:{type:e.types.CUSTOMER,code:"HOSTED_FIELDS_FIELDS_INVALID",message:"Some payment input fields are invalid. Cannot tokenize invalid card fields."},HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED:{type:e.types.MERCHANT,code:"HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED"},HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED:{type:e.types.MERCHANT,code:"HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED"},HOSTED_FIELDS_FIELD_PROPERTY_INVALID:{type:e.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_PROPERTY_INVALID"}}},{"../../lib/braintree-error":82}],73:[function(e,t,n){"use strict";t.exports=function(e,t){for(var n=e.parentNode,r=[];null!=n;)null!=n.tagName&&n.tagName.toLowerCase()===t&&r.push(n),n=n.parentNode;return r}},{}],74:[function(e,t,n){"use strict";var o=e("./browser-detection"),s=e("@braintree/class-list"),e=e("./constants"),r=Object.keys(e.allowedFields),i=e.navigationDirections,a={generate:function(e,t,n,r){var i=document.createElement("input");return o.hasSoftwareKeyboard()||o.isFirefox()||o.isIE()?(i.setAttribute("aria-hidden","true"),i.setAttribute("autocomplete","off"),i.setAttribute("data-braintree-direction",n),i.setAttribute("data-braintree-type",t),i.setAttribute("id","bt-"+t+"-"+n+"-"+e),i.setAttribute("style",JSON.stringify({border:"none !important",display:"block !important",height:"1px !important",left:"-1px !important",opacity:"0 !important",position:"absolute !important",top:"-1px !important",width:"1px !important"}).replace(/[{}"]/g,"").replace(/,/g,";")),s.add(i,"focus-intercept"),i.addEventListener("focus",function(e){r(e),o.hasSoftwareKeyboard()||i.blur()}),i):document.createDocumentFragment()},destroy:function(e){var t=e?[document.getElementById(e)]:(t=document.querySelectorAll("[data-braintree-direction]"),[].slice.call(t));t.forEach(function(e){e&&1===e.nodeType&&a.matchFocusElement(e.getAttribute("id"))&&e.parentNode.removeChild(e)})},matchFocusElement:function(e){var t,n;return!!e&&(!((n=e.split("-")).length<4)&&(t="bt"===n[0],e=-1<r.indexOf(n[1]),n=n[2]===i.BACK||n[2]===i.FORWARD,Boolean(t&&e&&n)))}};t.exports=a},{"./browser-detection":70,"./constants":71,"@braintree/class-list":26}],75:[function(e,t,n){"use strict";var r=e("credit-card-type");t.exports=function(e){e=r(e);return e.forEach(function(e){"mastercard"===e.type&&(e.type="master-card")}),e}},{"credit-card-type":38}],76:[function(e,t,n){"use strict";var o=e("./create-authorization-data"),s=e("./json-clone"),a=e("./constants");t.exports=function(e,t){var n,r=t?s(t):{},t=o(e.authorization).attrs,i=s(e.analyticsMetadata);for(n in r.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION,r._meta)r._meta.hasOwnProperty(n)&&(i[n]=r._meta[n]);return r._meta=i,t.tokenizationKey?r.tokenizationKey=t.tokenizationKey:r.authorizationFingerprint=t.authorizationFingerprint,r}},{"./constants":83,"./create-authorization-data":86,"./json-clone":93}],77:[function(e,t,n){"use strict";var r=e("./promise"),a=e("./constants"),c=e("./add-metadata");t.exports={sendEvent:function(e,i,o){var s=Date.now();return r.resolve(e).then(function(e){var t=Date.now(),n=e.getConfiguration(),r=e._request,e=n.gatewayConfiguration.analytics.url,t={analytics:[{kind:a.ANALYTICS_PREFIX+i,isAsync:Math.floor(t/1e3)!==Math.floor(s/1e3),timestamp:s}]};r({url:e,method:"post",data:c(n,t),timeout:a.ANALYTICS_REQUEST_TIMEOUT_MS},o)})}}},{"./add-metadata":76,"./constants":83,"./promise":96}],78:[function(e,t,n){"use strict";e=e("@braintree/asset-loader/load-script");t.exports={loadScript:e}},{"@braintree/asset-loader/load-script":3}],79:[function(e,t,n){"use strict";var r="function"==typeof Object.assign?Object.assign:i;function i(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])t.hasOwnProperty(n)&&(e[n]=t[n]);return e}t.exports={assign:r,_assign:i}},{}],80:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("./promise"),o=e("./errors");t.exports={verify:function(e){var t,n;return e?(n=e.name,t=e.client,e=e.authorization,t||e?e||"3.76.4"===t.getVersion()?i.resolve():i.reject(new r({type:o.INCOMPATIBLE_VERSIONS.type,code:o.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+t.getVersion()+") and "+n+" (version 3.76.4) components must be from the same SDK version."})):i.reject(new r({type:o.INSTANTIATION_OPTION_REQUIRED.type,code:o.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating "+n+"."}))):i.reject(new r({type:o.INVALID_USE_OF_INTERNAL_FUNCTION.type,code:o.INVALID_USE_OF_INTERNAL_FUNCTION.code,message:"Options must be passed to basicComponentVerification function."}))}}},{"./braintree-error":82,"./errors":90,"./promise":96}],81:[function(e,t,n){"use strict";var u=e("./once");t.exports=function(e,t){var n,r,i,o=e.length,s=o,a=u(t);if(0!==o)for(n=0;n<o;n++)r=e[n],i=c,0===r.length?(r(),i(null)):r(i);else a(null);function c(e){e?a(e):0===--s&&a(null)}}},{"./once":95}],82:[function(e,t,n){"use strict";e=e("./enumerate");function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}r.prototype=Object.create(Error.prototype),(r.prototype.constructor=r).types=e(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),r.findRootError=function(e){return e instanceof r&&e.details&&e.details.originalError?r.findRootError(e.details.originalError):e},t.exports=r},{"./enumerate":89}],83:[function(e,t,n){"use strict";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,ASSETS_URLS:{production:"https://assets.braintreegateway.com",sandbox:"https://assets.braintreegateway.com"},CLIENT_API_URLS:{production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"},FRAUDNET_SOURCE:"BRAINTREE_SIGNIN",FRAUDNET_FNCLS:"fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99",FRAUDNET_URL:"https://c.paypal.com/da/r/fb.js",BUS_CONFIGURATION_REQUEST_EVENT:"BUS_CONFIGURATION_REQUEST",GRAPHQL_URLS:{production:"https://payments.braintree-api.com/graphql",sandbox:"https://payments.sandbox.braintree-api.com/graphql"},INTEGRATION_TIMEOUT_MS:6e4,VERSION:"3.76.4",INTEGRATION:"custom",SOURCE:"client",PLATFORM:"web",BRAINTREE_LIBRARY_VERSION:"braintree/web/3.76.4"}},{}],84:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("./errors");t.exports=function(t,e){e.forEach(function(e){t[e]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:e+" cannot be called after teardown."})}})}},{"./braintree-error":82,"./errors":90}],85:[function(e,t,n){"use strict";var r=e("./constants").ASSETS_URLS;t.exports={create:function(e){return r.production}}},{"./constants":83}],86:[function(e,t,n){"use strict";var i=e("../lib/vendor/polyfill").atob,o=e("../lib/constants").CLIENT_API_URLS;t.exports=function(e){var t,n,r={attrs:{},configUrl:""};return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)?(t=(n=(t=e).split("_"))[0],t={merchantId:n.slice(2).join("_"),environment:t},r.environment=t.environment,r.attrs.tokenizationKey=e,r.configUrl=o[t.environment]+"/merchants/"+t.merchantId+"/client_api/v1/configuration"):(e=JSON.parse(i(e)),r.environment=e.environment,r.attrs.authorizationFingerprint=e.authorizationFingerprint,r.configUrl=e.configUrl,r.graphQL=e.graphQL),r}},{"../lib/constants":83,"../lib/vendor/polyfill":99}],87:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("./promise"),o=e("./assets"),s=e("./errors"),a="3.76.4";t.exports={create:function(e){var t=i.resolve();return e.client?i.resolve(e.client):(t=!window.braintree||!window.braintree.client?o.loadScript({src:e.assetsUrl+"/web/"+a+"/js/client.min.js"}).catch(function(e){return i.reject(new r({type:s.CLIENT_SCRIPT_FAILED_TO_LOAD.type,code:s.CLIENT_SCRIPT_FAILED_TO_LOAD.code,message:s.CLIENT_SCRIPT_FAILED_TO_LOAD.message,details:{originalError:e}}))}):t).then(function(){return window.braintree.client.VERSION!==a?i.reject(new r({type:s.INCOMPATIBLE_VERSIONS.type,code:s.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+window.braintree.client.VERSION+") and "+e.name+" (version "+a+") components must be from the same SDK version."})):window.braintree.client.create({authorization:e.authorization,debug:e.debug})})}}},{"./assets":78,"./braintree-error":82,"./errors":90,"./promise":96}],88:[function(e,t,n){"use strict";var r=e("./batch-execute-functions");function i(){this._teardownRegistry=[],this._isTearingDown=!1}i.prototype.registerFunctionForTeardown=function(e){"function"==typeof e&&this._teardownRegistry.push(e)},i.prototype.teardown=function(t){this._isTearingDown?t(new Error("Destructor is already tearing down")):(this._isTearingDown=!0,r(this._teardownRegistry,function(e){this._teardownRegistry=[],this._isTearingDown=!1,"function"==typeof t&&t(e)}.bind(this)))},t.exports=i},{"./batch-execute-functions":81}],89:[function(e,t,n){"use strict";t.exports=function(e,n){return n=null==n?"":n,e.reduce(function(e,t){return e[t]=n+t,e},{})}},{}],90:[function(e,t,n){"use strict";e=e("./braintree-error");t.exports={INVALID_USE_OF_INTERNAL_FUNCTION:{type:e.types.INTERNAL,code:"INVALID_USE_OF_INTERNAL_FUNCTION"},INSTANTIATION_OPTION_REQUIRED:{type:e.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:e.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},CLIENT_SCRIPT_FAILED_TO_LOAD:{type:e.types.NETWORK,code:"CLIENT_SCRIPT_FAILED_TO_LOAD",message:"Braintree client script could not be loaded."},METHOD_CALLED_AFTER_TEARDOWN:{type:e.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"}}},{"./braintree-error":82}],91:[function(e,t,n){"use strict";t.exports=function(e){for(;e.parentNode;)e=e.parentNode;return e}},{}],92:[function(e,t,n){"use strict";var r,i={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1,"braintree-api.com":1};t.exports=function(e){return e=e.toLowerCase(),!!/^https:/.test(e)&&((r=r||document.createElement("a")).href=e,e=r.hostname.split(".").slice(-2).join("."),i.hasOwnProperty(e))}},{}],93:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],94:[function(e,t,n){"use strict";t.exports=function(t){return Object.keys(t).filter(function(e){return"function"==typeof t[e]})}},{}],95:[function(e,t,n){"use strict";t.exports=function(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}},{}],96:[function(e,t,n){"use strict";var r=e("promise-polyfill"),e=e("@braintree/extended-promise"),r="undefined"!=typeof Promise?Promise:r;e.suppressUnhandledPromiseMessage=!0,e.setPromise(r),t.exports=r},{"@braintree/extended-promise":28,"promise-polyfill":59}],97:[function(e,t,n){"use strict";var c=e("@braintree/uuid"),u=e("./find-root-node");function d(e){return"[object ShadowRoot]"===(e=u(e)).toString()}function l(e){return d(e=u(e))?e.host:null}t.exports={isShadowElement:d,getShadowHost:l,transformToSlot:function e(t,n){var r=u(t).querySelector("style"),i=l(t),o="shadow-slot-"+c(),s=document.createElement("slot"),a=document.createElement("div");return s.setAttribute("name",o),t.appendChild(s),a.setAttribute("slot",o),i.appendChild(a),n&&(r||(r=document.createElement("style"),t.appendChild(r)),r.sheet.insertRule('::slotted([slot="'+o+'"]) { '+n+" }")),d(i)?e(a,n):a}}},{"./find-root-node":91,"@braintree/uuid":33}],98:[function(e,t,n){"use strict";t.exports=function(e){return e?"":".min"}},{}],99:[function(e,t,n){"use strict";var r="function"==typeof atob?window.atob:i;function i(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="";if(!new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$").test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");for(o=0;n=s.indexOf(e.charAt(o++)),t=(15&(r=s.indexOf(e.charAt(o++))))<<4|(i=s.indexOf(e.charAt(o++)))>>2&15,i=(3&i)<<6|63&s.indexOf(e.charAt(o++)),a+=String.fromCharCode((63&n)<<2|r>>4&3)+(t?String.fromCharCode(t):"")+(i?String.fromCharCode(i):""),o<e.length;);return a}t.exports={atob:function(e){return r.call(window,e)},_atob:i}},{}]},{},[69])(69)});;
