fake_braintree 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 821e595f81b9834df90fa7b01373a720cec07b44
4
- data.tar.gz: 07583bb46931dcc0422222a2bd771b27ca011134
3
+ metadata.gz: 34f6daceda5853cf110fa0ea5c39ac5069e43e10
4
+ data.tar.gz: 4c82a16df87ea1b1b189d8989161557009516418
5
5
  SHA512:
6
- metadata.gz: 81a2340570cf700684299af8bd8f7546defcdfba11dbfa3914771cef2ead0057d135bf50e73c6dd5d1a4e303ab28ce2399bfdeba6b045f491586e302b7046034
7
- data.tar.gz: e37ec6e462b48578bfa7f2cbd5f4881f21f501ef40edc78240720f89aeaa8536e5dea71944cfd0a5d4e8ac2d321c2d77676de65ddbf8f6763cae5c0ac74b1ee3
6
+ metadata.gz: f387aa40224c07185a35aced9470b8e186fc4918b8c0b69fd6d804994c6b604f230575469d51e5a4b6bc2e54d2dfe1a89536387c61cb865e1feef9271cf635a7
7
+ data.tar.gz: 101de4dea92589532ece819589ad96a62f8bf891d10456be380d4b12b4b0be7977670c56643768a7c250734d5f9b348e3d7c02e143f350778425f67b2cc3b321
data/README.md CHANGED
@@ -45,6 +45,7 @@ of them (yet).
45
45
  * `Braintree::PaymentMethod.create`
46
46
  * `Braintree::PaymentMethod.find`
47
47
  * `Braintree::PaymentMethod.update`
48
+ * `Braintree::PaymentMethod.delete`
48
49
 
49
50
  ### Subscription
50
51
  * `Braintree::Subscription.cancel`
@@ -1,3 +1,3 @@
1
1
  ---
2
- client_version: 2.9.0
3
- dropin_version: 1.7.0
2
+ client_version: 2.11.2
3
+ dropin_version: 1.8.3
@@ -0,0 +1,12 @@
1
+ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),(e.braintree||(e.braintree={})).dropin=t()}}(function(){var define,module,exports;return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){"use strict";var r=t("backbone"),i=t("fastclick");t("json2-browser"),t("es5-shim/es5-shim"),t("es5-shim/es5-sham"),t("./template-helpers"),r.$=window.$,i(document.body),e.exports={InlineFrame:t("./inline-frame/inline-frame"),ModalFrame:t("./modal-frame/modal-frame")}},{"./inline-frame/inline-frame":229,"./modal-frame/modal-frame":234,"./template-helpers":244,backbone:2,"es5-shim/es5-sham":210,"es5-shim/es5-shim":211,fastclick:212,"json2-browser":222}],2:[function(t,e,n){!function(e,r){if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(t,n,i){e.Backbone=r(e,i,t,n)});else if("undefined"!=typeof n){var i=t("underscore");r(e,n,i)}else e.Backbone=r(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(t,e,n,r){{var i=t.Backbone,o=[],a=(o.push,o.slice);o.splice}e.VERSION="1.1.2",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=e.Events={on:function(t,e,n){if(!l(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);return r.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,r){if(!l(this,"once",t,[e,r])||!e)return this;var i=this,o=n.once(function(){i.off(t,o),e.apply(this,arguments)});return o._callback=e,this.on(t,o,r)},off:function(t,e,r){var i,o,a,s,u,c,p,h;if(!this._events||!l(this,"off",t,[e,r]))return this;if(!t&&!e&&!r)return this._events=void 0,this;for(s=t?[t]:n.keys(this._events),u=0,c=s.length;c>u;u++)if(t=s[u],a=this._events[t]){if(this._events[t]=i=[],e||r)for(p=0,h=a.length;h>p;p++)o=a[p],(e&&e!==o.callback&&e!==o.callback._callback||r&&r!==o.context)&&i.push(o);i.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=a.call(arguments,1);if(!l(this,"trigger",t,e))return this;var n=this._events[t],r=this._events.all;return n&&c(n,e),r&&c(r,arguments),this},stopListening:function(t,e,r){var i=this._listeningTo;if(!i)return this;var o=!e&&!r;r||"object"!=typeof e||(r=this),t&&((i={})[t._listenId]=t);for(var a in i)t=i[a],t.off(e,r,this),(o||n.isEmpty(t._events))&&delete this._listeningTo[a];return this}},u=/\s+/,l=function(t,e,n,r){if(!n)return!0;if("object"==typeof n){for(var i in n)t[e].apply(t,[i,n[i]].concat(r));return!1}if(u.test(n)){for(var o=n.split(u),a=0,s=o.length;s>a;a++)t[e].apply(t,[o[a]].concat(r));return!1}return!0},c=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,s);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}},p={listenTo:"on",listenToOnce:"once"};n.each(p,function(t,e){s[e]=function(e,r,i){var o=this._listeningTo||(this._listeningTo={}),a=e._listenId||(e._listenId=n.uniqueId("l"));return o[a]=e,i||"object"!=typeof r||(i=this),e[t](r,i,this),this}}),s.bind=s.on,s.unbind=s.off,n.extend(e,s);var h=e.Model=function(t,e){var r=t||{};e||(e={}),this.cid=n.uniqueId("c"),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{}),r=n.defaults({},r,n.result(this,"defaults")),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(h.prototype,s,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},set:function(t,e,r){var i,o,a,s,u,l,c,p;if(null==t)return this;if("object"==typeof t?(o=t,r=e):(o={})[t]=e,r||(r={}),!this._validate(o,r))return!1;a=r.unset,u=r.silent,s=[],l=this._changing,this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={}),p=this.attributes,c=this._previousAttributes,this.idAttribute in o&&(this.id=o[this.idAttribute]);for(i in o)e=o[i],n.isEqual(p[i],e)||s.push(i),n.isEqual(c[i],e)?delete this.changed[i]:this.changed[i]=e,a?delete p[i]:p[i]=e;if(!u){s.length&&(this._pending=r);for(var h=0,d=s.length;d>h;h++)this.trigger("change:"+s[h],this,p[s[h]],r)}if(l)return this;if(!u)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?n.clone(this.changed):!1;var e,r=!1,i=this._changing?this._previousAttributes:this.attributes;for(var o in t)n.isEqual(i[o],e=t[o])||((r||(r={}))[o]=e);return r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=t?n.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=this,r=t.success;return t.success=function(n){return e.set(e.parse(n,t),t)?(r&&r(e,n,t),void e.trigger("sync",e,n,t)):!1},F(this,t),this.sync("read",this,t)},save:function(t,e,r){var i,o,a,s=this.attributes;if(null==t||"object"==typeof t?(i=t,r=e):(i={})[t]=e,r=n.extend({validate:!0},r),i&&!r.wait){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;i&&r.wait&&(this.attributes=n.extend({},s,i)),void 0===r.parse&&(r.parse=!0);var u=this,l=r.success;return r.success=function(t){u.attributes=s;var e=u.parse(t,r);return r.wait&&(e=n.extend(i||{},e)),n.isObject(e)&&!u.set(e,r)?!1:(l&&l(u,t,r),void u.trigger("sync",u,t,r))},F(this,r),o=this.isNew()?"create":r.patch?"patch":"update","patch"===o&&(r.attrs=i),a=this.sync(o,this,r),i&&r.wait&&(this.attributes=s),a},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,i=function(){e.trigger("destroy",e,e.collection,t)};if(t.success=function(n){(t.wait||e.isNew())&&i(),r&&r(e,n,t),e.isNew()||e.trigger("sync",e,n,t)},this.isNew())return t.success(),!1;F(this,t);var o=this.sync("delete",this,t);return t.wait||i(),o},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||U();return this.isNew()?t:t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.extend(t||{},{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;return r?(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1):!0}});var d=["keys","values","pairs","invert","pick","omit"];n.each(d,function(t){h.prototype[t]=function(){var e=a.call(arguments);return e.unshift(this.attributes),n[t].apply(n,e)}});var f=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},m={add:!0,remove:!0,merge:!0},v={add:!0,remove:!1};n.extend(f.prototype,s,{model:h,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,v))},remove:function(t,e){var r=!n.isArray(t);t=r?[t]:n.clone(t),e||(e={});var i,o,a,s;for(i=0,o=t.length;o>i;i++)s=t[i]=this.get(t[i]),s&&(delete this._byId[s.id],delete this._byId[s.cid],a=this.indexOf(s),this.models.splice(a,1),this.length--,e.silent||(e.index=a,s.trigger("remove",s,this,e)),this._removeReference(s,e));return r?t[0]:t},set:function(t,e){e=n.defaults({},e,m),e.parse&&(t=this.parse(t,e));var r=!n.isArray(t);t=r?t?[t]:[]:n.clone(t);var i,o,a,s,u,l,c,p=e.at,d=this.model,f=this.comparator&&null==p&&e.sort!==!1,v=n.isString(this.comparator)?this.comparator:null,y=[],g=[],b={},w=e.add,_=e.merge,x=e.remove,C=!f&&w&&x?[]:!1;for(i=0,o=t.length;o>i;i++){if(u=t[i]||{},a=u instanceof h?s=u:u[d.prototype.idAttribute||"id"],l=this.get(a))x&&(b[l.cid]=!0),_&&(u=u===s?s.attributes:u,e.parse&&(u=l.parse(u,e)),l.set(u,e),f&&!c&&l.hasChanged(v)&&(c=!0)),t[i]=l;else if(w){if(s=t[i]=this._prepareModel(u,e),!s)continue;y.push(s),this._addReference(s,e)}s=l||s,!C||!s.isNew()&&b[s.id]||C.push(s),b[s.id]=!0}if(x){for(i=0,o=this.length;o>i;++i)b[(s=this.models[i]).cid]||g.push(s);g.length&&this.remove(g,e)}if(y.length||C&&C.length)if(f&&(c=!0),this.length+=y.length,null!=p)for(i=0,o=y.length;o>i;i++)this.models.splice(p+i,0,y[i]);else{C&&(this.models.length=0);var E=C||y;for(i=0,o=E.length;o>i;i++)this.models.push(E[i])}if(c&&this.sort({silent:!0}),!e.silent){for(i=0,o=y.length;o>i;i++)(s=y[i]).trigger("add",s,this,e);(c||C&&C.length)&&this.trigger("sort",this,e)}return r?t[0]:t},reset:function(t,e){e||(e={});for(var r=0,i=this.models.length;i>r;r++)this._removeReference(this.models[r],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t),e},slice:function(){return a.apply(this.models,arguments)},get:function(t){return null==t?void 0:this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){return n.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){for(var n in t)if(t[n]!==e.get(n))return!1;return!0})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),n.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(n.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return n.invoke(this.models,"get",t)},fetch:function(t){t=t?n.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=t.success,r=this;return t.success=function(n){var i=t.reset?"reset":"set";r[i](n,t),e&&e(r,n,t),r.trigger("sync",r,n,t)},F(this,t),this.sync("read",this,t)},create:function(t,e){if(e=e?n.clone(e):{},!(t=this._prepareModel(t,e)))return!1;e.wait||this.add(t,e);var r=this,i=e.success;return e.success=function(t,n){e.wait&&r.add(t,e),i&&i(t,n,e)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(t instanceof h)return t;e=e?n.clone(e):{},e.collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),!1):r},_addReference:function(t,e){this._byId[t.cid]=t,null!=t.id&&(this._byId[t.id]=t),t.collection||(t.collection=this),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){("add"!==t&&"remove"!==t||n===this)&&("destroy"===t&&this.remove(e,r),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],null!=e.id&&(this._byId[e.id]=e)),this.trigger.apply(this,arguments))}});var y=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];n.each(y,function(t){f.prototype[t]=function(){var e=a.call(arguments);return e.unshift(this.models),n[t].apply(n,e)}});var g=["groupBy","countBy","sortBy","indexBy"];n.each(g,function(t){f.prototype[t]=function(e,r){var i=n.isFunction(e)?e:function(t){return t.get(e)};return n[t](this.models,i,r)}});var b=e.View=function(t){this.cid=n.uniqueId("view"),t||(t={}),n.extend(this,n.pick(t,_)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},w=/^(\S+)\s*(.*)$/,_=["model","collection","el","id","attributes","className","tagName","events"];n.extend(b.prototype,s,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,n){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],n!==!1&&this.delegateEvents(),this},delegateEvents:function(t){if(!t&&!(t=n.result(this,"events")))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(n.isFunction(r)||(r=this[t[e]]),r){var i=e.match(w),o=i[1],a=i[2];r=n.bind(r,this),o+=".delegateEvents"+this.cid,""===a?this.$el.on(o,r):this.$el.on(o,a,r)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"),!1);else{var t=n.extend({},n.result(this,"attributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t["class"]=n.result(this,"className"));var r=e.$("<"+n.result(this,"tagName")+">").attr(t);this.setElement(r,!1)}}}),e.sync=function(t,r,i){var o=C[t];n.defaults(i||(i={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:o,dataType:"json"};if(i.url||(a.url=n.result(r,"url")||U()),null!=i.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),i.emulateHTTP&&("PUT"===o||"DELETE"===o||"PATCH"===o)){a.type="POST",i.emulateJSON&&(a.data._method=o);var s=i.beforeSend;i.beforeSend=function(t){return t.setRequestHeader("X-HTTP-Method-Override",o),s?s.apply(this,arguments):void 0}}"GET"===a.type||i.emulateJSON||(a.processData=!1),"PATCH"===a.type&&x&&(a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var u=i.xhr=e.ajax(n.extend(a,i));return r.trigger("request",r,u,i),u};var x=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),C={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var E=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},k=/\((.*?)\)/g,S=/(\(\?)?:\w+/g,P=/\*\w+/g,A=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(E.prototype,s,{initialize:function(){},route:function(t,r,i){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var o=this;return e.history.route(t,function(n){var a=o._extractParameters(t,n);o.execute(i,a),o.trigger.apply(o,["route:"+r].concat(a)),o.trigger("route",r,a),e.history.trigger("route",o,r,a)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(A,"\\$&").replace(k,"(?:$1)?").replace(S,function(t,e){return e?t:"([^/?]+)"}).replace(P,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null})}});var O=e.History=function(){this.handlers=[],n.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},T=/^[#\/]|\s+$/g,I=/^\/+|\/+$/g,M=/msie [\w.]+/,j=/\/$/,N=/#.*$/;O.started=!1,n.extend(O.prototype,s,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var n=this.root.replace(j,"");t.indexOf(n)||(t=t.slice(n.length))}else t=this.getHash();return t.replace(T,"")},start:function(t){if(O.started)throw new Error("Backbone.history has already been started");O.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment(),i=document.documentMode,o=M.exec(navigator.userAgent.toLowerCase())&&(!i||7>=i);if(this.root=("/"+this.root+"/").replace(I,"/"),o&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow,this.navigate(r)}this._hasPushState?e.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!o?e.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=r;var s=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;this._hasPushState&&this.atRoot()&&s.hash&&(this.fragment=this.getHash().replace(T,""),this.history.replaceState({},document.title,this.root+this.fragment))}return this.options.silent?void 0:this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),O.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getFragment(this.getHash(this.iframe))),e===this.fragment?!1:(this.iframe&&this.navigate(e),void this.loadUrl())},loadUrl:function(t){return t=this.fragment=this.getFragment(t),n.any(this.handlers,function(e){return e.route.test(t)?(e.callback(t),!0):void 0})},navigate:function(t,e){if(!O.started)return!1;e&&e!==!0||(e={trigger:!!e});var n=this.root+(t=this.getFragment(t||""));if(t=t.replace(N,""),this.fragment!==t){if(this.fragment=t,""===t&&"/"!==n&&(n=n.slice(0,-1)),this._hasPushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getFragment(this.getHash(this.iframe))&&(e.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,t,e.replace))}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new O;var R=function(t,e){var r,i=this;r=t&&n.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e);var o=function(){this.constructor=r};return o.prototype=i.prototype,r.prototype=new o,t&&n.extend(r.prototype,t),r.__super__=i.prototype,r};h.extend=f.extend=E.extend=b.extend=O.extend=R;var U=function(){throw new Error('A "url" property or function must be specified')},F=function(t,e){var n=e.error;e.error=function(r){n&&n(t,r,e),t.trigger("error",t,r,e)}};return e})},{underscore:3}],3:[function(t,e,n){(function(){function t(t){function e(e,n,r,i,o,a){for(;o>=0&&a>o;o+=t){var s=i?i[o]:o;r=n(r,e[s],s,e)}return r}return function(n,r,i,o){r=_(r,o,4);var a=!A(n)&&w.keys(n),s=(a||n).length,u=t>0?0:s-1;return arguments.length<3&&(i=n[a?a[u]:u],u+=t),e(n,r,i,a,u,s)}}function r(t){return function(e,n,r){n=x(n,r);for(var i=P(e),o=t>0?0:i-1;o>=0&&i>o;o+=t)if(n(e[o],o,e))return o;return-1}}function i(t,e,n){return function(r,i,o){var a=0,s=P(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(h.call(r,a,s),w.isNaN),o>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&s>o;o+=t)if(r[o]===i)return o;return-1}}function o(t,e){var n=j.length,r=t.constructor,i=w.isFunction(r)&&r.prototype||l,o="constructor";for(w.has(t,o)&&!w.contains(e,o)&&e.push(o);n--;)o=j[n],o in t&&t[o]!==i[o]&&!w.contains(e,o)&&e.push(o)}var a=this,s=a._,u=Array.prototype,l=Object.prototype,c=Function.prototype,p=u.push,h=u.slice,d=l.toString,f=l.hasOwnProperty,m=Array.isArray,v=Object.keys,y=c.bind,g=Object.create,b=function(){},w=function(t){return t instanceof w?t:this instanceof w?void(this._wrapped=t):new w(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=w),n._=w):a._=w,w.VERSION="1.8.3";var _=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},x=function(t,e,n){return null==t?w.identity:w.isFunction(t)?_(t,e,n):w.isObject(t)?w.matcher(t):w.property(t)};w.iteratee=function(t,e){return x(t,e,1/0)};var C=function(t,e){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var i=1;r>i;i++)for(var o=arguments[i],a=t(o),s=a.length,u=0;s>u;u++){var l=a[u];e&&void 0!==n[l]||(n[l]=o[l])}return n}},E=function(t){if(!w.isObject(t))return{};if(g)return g(t);b.prototype=t;var e=new b;return b.prototype=null,e},k=function(t){return function(e){return null==e?void 0:e[t]}},S=Math.pow(2,53)-1,P=k("length"),A=function(t){var e=P(t);return"number"==typeof e&&e>=0&&S>=e};w.each=w.forEach=function(t,e,n){e=_(e,n);var r,i;if(A(t))for(r=0,i=t.length;i>r;r++)e(t[r],r,t);else{var o=w.keys(t);for(r=0,i=o.length;i>r;r++)e(t[o[r]],o[r],t)}return t},w.map=w.collect=function(t,e,n){e=x(e,n);for(var r=!A(t)&&w.keys(t),i=(r||t).length,o=Array(i),a=0;i>a;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o},w.reduce=w.foldl=w.inject=t(1),w.reduceRight=w.foldr=t(-1),w.find=w.detect=function(t,e,n){var r;return r=A(t)?w.findIndex(t,e,n):w.findKey(t,e,n),void 0!==r&&-1!==r?t[r]:void 0},w.filter=w.select=function(t,e,n){var r=[];return e=x(e,n),w.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},w.reject=function(t,e,n){return w.filter(t,w.negate(x(e)),n)},w.every=w.all=function(t,e,n){e=x(e,n);for(var r=!A(t)&&w.keys(t),i=(r||t).length,o=0;i>o;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},w.some=w.any=function(t,e,n){e=x(e,n);for(var r=!A(t)&&w.keys(t),i=(r||t).length,o=0;i>o;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},w.contains=w.includes=w.include=function(t,e,n,r){return A(t)||(t=w.values(t)),("number"!=typeof n||r)&&(n=0),w.indexOf(t,e,n)>=0},w.invoke=function(t,e){var n=h.call(arguments,2),r=w.isFunction(e);return w.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},w.pluck=function(t,e){return w.map(t,w.property(e))},w.where=function(t,e){return w.filter(t,w.matcher(e))},w.findWhere=function(t,e){return w.find(t,w.matcher(e))},w.max=function(t,e,n){var r,i,o=-(1/0),a=-(1/0);if(null==e&&null!=t){t=A(t)?t:w.values(t);for(var s=0,u=t.length;u>s;s++)r=t[s],r>o&&(o=r)}else e=x(e,n),w.each(t,function(t,n,r){i=e(t,n,r),(i>a||i===-(1/0)&&o===-(1/0))&&(o=t,a=i)});return o},w.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t){t=A(t)?t:w.values(t);for(var s=0,u=t.length;u>s;s++)r=t[s],o>r&&(o=r)}else e=x(e,n),w.each(t,function(t,n,r){i=e(t,n,r),(a>i||i===1/0&&o===1/0)&&(o=t,a=i)});return o},w.shuffle=function(t){for(var e,n=A(t)?t:w.values(t),r=n.length,i=Array(r),o=0;r>o;o++)e=w.random(0,o),e!==o&&(i[o]=i[e]),i[e]=n[o];return i},w.sample=function(t,e,n){return null==e||n?(A(t)||(t=w.values(t)),t[w.random(t.length-1)]):w.shuffle(t).slice(0,Math.max(0,e))},w.sortBy=function(t,e,n){return e=x(e,n),w.pluck(w.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var O=function(t){return function(e,n,r){var i={};return n=x(n,r),w.each(e,function(r,o){var a=n(r,o,e);t(i,r,a)}),i}};w.groupBy=O(function(t,e,n){w.has(t,n)?t[n].push(e):t[n]=[e]}),w.indexBy=O(function(t,e,n){t[n]=e}),w.countBy=O(function(t,e,n){w.has(t,n)?t[n]++:t[n]=1}),w.toArray=function(t){return t?w.isArray(t)?h.call(t):A(t)?w.map(t,w.identity):w.values(t):[]},w.size=function(t){return null==t?0:A(t)?t.length:w.keys(t).length},w.partition=function(t,e,n){e=x(e,n);var r=[],i=[];return w.each(t,function(t,n,o){(e(t,n,o)?r:i).push(t)}),[r,i]},w.first=w.head=w.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:w.initial(t,t.length-e)},w.initial=function(t,e,n){return h.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},w.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:w.rest(t,Math.max(0,t.length-e))},w.rest=w.tail=w.drop=function(t,e,n){return h.call(t,null==e||n?1:e)},w.compact=function(t){return w.filter(t,w.identity)};var T=function(t,e,n,r){for(var i=[],o=0,a=r||0,s=P(t);s>a;a++){var u=t[a];if(A(u)&&(w.isArray(u)||w.isArguments(u))){e||(u=T(u,e,n));var l=0,c=u.length;for(i.length+=c;c>l;)i[o++]=u[l++]}else n||(i[o++]=u)}return i};w.flatten=function(t,e){return T(t,e,!1)},w.without=function(t){return w.difference(t,h.call(arguments,1))},w.uniq=w.unique=function(t,e,n,r){w.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=x(n,r));for(var i=[],o=[],a=0,s=P(t);s>a;a++){var u=t[a],l=n?n(u,a,t):u;e?(a&&o===l||i.push(u),o=l):n?w.contains(o,l)||(o.push(l),i.push(u)):w.contains(i,u)||i.push(u)}return i},w.union=function(){return w.uniq(T(arguments,!0,!0))},w.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=P(t);i>r;r++){var o=t[r];if(!w.contains(e,o)){for(var a=1;n>a&&w.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},w.difference=function(t){var e=T(arguments,!0,!0,1);return w.filter(t,function(t){return!w.contains(e,t)})},w.zip=function(){return w.unzip(arguments)},w.unzip=function(t){for(var e=t&&w.max(t,P).length||0,n=Array(e),r=0;e>r;r++)n[r]=w.pluck(t,r);return n},w.object=function(t,e){for(var n={},r=0,i=P(t);i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},w.findIndex=r(1),w.findLastIndex=r(-1),w.sortedIndex=function(t,e,n,r){n=x(n,r,1);for(var i=n(e),o=0,a=P(t);a>o;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o},w.indexOf=i(1,w.findIndex,w.sortedIndex),w.lastIndexOf=i(-1,w.findLastIndex),w.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;r>o;o++,t+=n)i[o]=t;return i};var I=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=E(t.prototype),a=t.apply(o,i);return w.isObject(a)?a:o};w.bind=function(t,e){if(y&&t.bind===y)return y.apply(t,h.call(arguments,1));if(!w.isFunction(t))throw new TypeError("Bind must be called on a function");var n=h.call(arguments,2),r=function(){return I(t,r,e,this,n.concat(h.call(arguments)))};return r},w.partial=function(t){var e=h.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),a=0;i>a;a++)o[a]=e[a]===w?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return I(t,n,this,this,o)};return n},w.bindAll=function(t){var e,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(e=1;r>e;e++)n=arguments[e],t[n]=w.bind(t[n],t);return t},w.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return w.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},w.delay=function(t,e){var n=h.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},w.defer=w.partial(w.delay,w,1),w.throttle=function(t,e,n){var r,i,o,a=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:w.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var l=w.now();s||n.leading!==!1||(s=l);var c=e-(l-s);return r=this,i=arguments,0>=c||c>e?(a&&(clearTimeout(a),a=null),s=l,o=t.apply(r,i),a||(r=i=null)):a||n.trailing===!1||(a=setTimeout(u,c)),o}},w.debounce=function(t,e,n){var r,i,o,a,s,u=function(){var l=w.now()-a;e>l&&l>=0?r=setTimeout(u,e-l):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=w.now();var l=n&&!r;return r||(r=setTimeout(u,e)),l&&(s=t.apply(o,i),o=i=null),s}},w.wrap=function(t,e){return w.partial(e,t)},w.negate=function(t){return function(){return!t.apply(this,arguments)}},w.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},w.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},w.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),1>=t&&(e=null),n}},w.once=w.partial(w.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];w.keys=function(t){if(!w.isObject(t))return[];if(v)return v(t);var e=[];for(var n in t)w.has(t,n)&&e.push(n);return M&&o(t,e),e},w.allKeys=function(t){if(!w.isObject(t))return[];var e=[];for(var n in t)e.push(n);return M&&o(t,e),e},w.values=function(t){for(var e=w.keys(t),n=e.length,r=Array(n),i=0;n>i;i++)r[i]=t[e[i]];return r},w.mapObject=function(t,e,n){e=x(e,n);for(var r,i=w.keys(t),o=i.length,a={},s=0;o>s;s++)r=i[s],a[r]=e(t[r],r,t);return a},w.pairs=function(t){for(var e=w.keys(t),n=e.length,r=Array(n),i=0;n>i;i++)r[i]=[e[i],t[e[i]]];return r},w.invert=function(t){for(var e={},n=w.keys(t),r=0,i=n.length;i>r;r++)e[t[n[r]]]=n[r];return e},w.functions=w.methods=function(t){var e=[];for(var n in t)w.isFunction(t[n])&&e.push(n);return e.sort()},w.extend=C(w.allKeys),w.extendOwn=w.assign=C(w.keys),w.findKey=function(t,e,n){e=x(e,n);for(var r,i=w.keys(t),o=0,a=i.length;a>o;o++)if(r=i[o],e(t[r],r,t))return r},w.pick=function(t,e,n){var r,i,o={},a=t;if(null==a)return o;w.isFunction(e)?(i=w.allKeys(a),r=_(e,n)):(i=T(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var s=0,u=i.length;u>s;s++){var l=i[s],c=a[l];r(c,l,a)&&(o[l]=c)}return o},w.omit=function(t,e,n){if(w.isFunction(e))e=w.negate(e);else{var r=w.map(T(arguments,!1,!1,1),String);e=function(t,e){return!w.contains(r,e)}}return w.pick(t,e,n)},w.defaults=C(w.allKeys,!0),w.create=function(t,e){var n=E(t);return e&&w.extendOwn(n,e),n},w.clone=function(t){return w.isObject(t)?w.isArray(t)?t.slice():w.extend({},t):t},w.tap=function(t,e){return e(t),t},w.isMatch=function(t,e){var n=w.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;r>o;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0};var N=function(t,e,n,r){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof w&&(t=t._wrapped),e instanceof w&&(e=e._wrapped);var i=d.call(t);if(i!==d.call(e))return!1;switch(i){case"[object RegExp]":
2
+ case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(w.isFunction(a)&&a instanceof a&&w.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var u=n.length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),o){if(u=t.length,u!==e.length)return!1;for(;u--;)if(!N(t[u],e[u],n,r))return!1}else{var l,c=w.keys(t);if(u=c.length,w.keys(e).length!==u)return!1;for(;u--;)if(l=c[u],!w.has(e,l)||!N(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0};w.isEqual=function(t,e){return N(t,e)},w.isEmpty=function(t){return null==t?!0:A(t)&&(w.isArray(t)||w.isString(t)||w.isArguments(t))?0===t.length:0===w.keys(t).length},w.isElement=function(t){return!(!t||1!==t.nodeType)},w.isArray=m||function(t){return"[object Array]"===d.call(t)},w.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},w.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){w["is"+t]=function(e){return d.call(e)==="[object "+t+"]"}}),w.isArguments(arguments)||(w.isArguments=function(t){return w.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(w.isFunction=function(t){return"function"==typeof t||!1}),w.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},w.isNaN=function(t){return w.isNumber(t)&&t!==+t},w.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===d.call(t)},w.isNull=function(t){return null===t},w.isUndefined=function(t){return void 0===t},w.has=function(t,e){return null!=t&&f.call(t,e)},w.noConflict=function(){return a._=s,this},w.identity=function(t){return t},w.constant=function(t){return function(){return t}},w.noop=function(){},w.property=k,w.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},w.matcher=w.matches=function(t){return t=w.extendOwn({},t),function(e){return w.isMatch(e,t)}},w.times=function(t,e,n){var r=Array(Math.max(0,t));e=_(e,n,1);for(var i=0;t>i;i++)r[i]=e(i);return r},w.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},w.now=Date.now||function(){return(new Date).getTime()};var R={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},U=w.invert(R),F=function(t){var e=function(e){return t[e]},n="(?:"+w.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};w.escape=F(R),w.unescape=F(U),w.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),w.isFunction(r)?r.call(t):r};var D=0;w.uniqueId=function(t){var e=++D+"";return t?t+e:e},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var L=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},$=/\\|'|\r|\n|\u2028|\u2029/g,H=function(t){return"\\"+V[t]};w.template=function(t,e,n){!e&&n&&(e=n),e=w.defaults({},e,w.templateSettings);var r=RegExp([(e.escape||L).source,(e.interpolate||L).source,(e.evaluate||L).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,s){return o+=t.slice(i,s).replace($,H),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(s){throw s.source=o,s}var u=function(t){return a.call(this,t,w)},l=e.variable||"obj";return u.source="function("+l+"){\n"+o+"}",u},w.chain=function(t){var e=w(t);return e._chain=!0,e};var z=function(t,e){return t._chain?w(e).chain():e};w.mixin=function(t){w.each(w.functions(t),function(e){var n=w[e]=t[e];w.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),z(this,n.apply(w,t))}})},w.mixin(w),w.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];w.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],z(this,n)}}),w.each(["concat","join","slice"],function(t){var e=u[t];w.prototype[t]=function(){return z(this,e.apply(this._wrapped,arguments))}}),w.prototype.value=function(){return this._wrapped},w.prototype.valueOf=w.prototype.toJSON=w.prototype.value,w.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return w})}).call(this)},{}],4:[function(t,e,n){(function(n){"use strict";function r(t){var e=t.analyticsConfiguration||{},r=n.braintree?n.braintree.VERSION:null,i=r?"braintree/web/"+r:"";return{sdkVersion:e.sdkVersion||i,merchantAppId:e.merchantAppId||n.location.host}}function i(t){var e,n,i;this.attrs={},t.hasOwnProperty("sharedCustomerIdentifier")&&(this.attrs.sharedCustomerIdentifier=t.sharedCustomerIdentifier),e=s(t.clientToken),i=r(t),this.driver=t.driver||m({enableCORS:v(t)}),this.analyticsUrl=e.analytics?e.analytics.url:void 0,this.clientApiUrl=e.clientApiUrl,this.customerId=t.customerId,this.challenges=e.challenges,this.integration=t.integration||"",this.sdkVersion=i.sdkVersion,this.merchantAppId=i.merchantAppId,n=a.create(this,{container:t.container,clientToken:e}),this.verify3DS=o.bind(n.verify,n),this.attrs.authorizationFingerprint=e.authorizationFingerprint,this.attrs.sharedCustomerIdentifierType=t.sharedCustomerIdentifierType,e.merchantAccountId&&(this.attrs.merchantAccountId=e.merchantAccountId),this.requestTimeout=t.hasOwnProperty("timeout")?t.timeout:6e4}var o=t("braintree-utilities"),a=t("braintree-3ds"),s=t("./parse-client-token"),u=t("./util"),l=t("./sepa-mandate"),c=t("./europe-bank-account"),p=t("./credit-card"),h=t("./coinbase-account"),d=t("./paypal-account"),f=t("./normalize-api-fields").normalizeCreditCardFields,m=t("./request/choose-driver"),v=t("./should-enable-cors");i.prototype.getCreditCards=function(t){this.driver.get(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods"]),this.attrs,function(t){var e=0,n=t.paymentMethods.length,r=[];for(e;n>e;e++)r.push(new p(t.paymentMethods[e]));return r},t,this.requestTimeout)},i.prototype.tokenizeCoinbase=function(t,e){t.options={validate:!1},this.addCoinbase(t,function(t,n){t?e(t,null):n&&n.nonce?e(t,n):e("Unable to tokenize coinbase account.",null)})},i.prototype.tokenizePayPalAccount=function(t,e){t.options={validate:!1},this.addPayPalAccount(t,function(t,n){t?e(t,null):n&&n.nonce?e(null,n):e("Unable to tokenize paypal account.",null)})},i.prototype.tokenizeCard=function(t,e){t.options={validate:!1},this.addCreditCard(t,function(t,n){n&&n.nonce?e(t,n.nonce,{type:n.type,details:n.details}):e("Unable to tokenize card.",null)})},i.prototype.lookup3DS=function(t,e){var n=u.joinUrlFragments([this.clientApiUrl,"v1/payment_methods",t.nonce,"three_d_secure/lookup"]),r=u.mergeOptions(this.attrs,{amount:t.amount});this.driver.post(n,r,function(t){return t},e,this.requestTimeout)},i.prototype.createSEPAMandate=function(t,e){var n=u.mergeOptions(this.attrs,{sepaMandate:t});this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","sepa_mandates.json"]),n,function(t){return{sepaMandate:new l(t.europeBankAccounts[0].sepaMandates[0]),sepaBankAccount:new c(t.europeBankAccounts[0])}},e,this.requestTimeout)},i.prototype.getSEPAMandate=function(t,e){var n=u.mergeOptions(this.attrs,t);this.driver.get(u.joinUrlFragments([this.clientApiUrl,"v1","sepa_mandates.json"]),n,function(t){return{sepaMandate:new l(t.sepaMandates[0])}},e,this.requestTimeout)},i.prototype.addCoinbase=function(t,e){var n;delete t.share,n=u.mergeOptions(this.attrs,{coinbaseAccount:t,_meta:{integration:this.integration||"custom",source:"coinbase"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/coinbase_accounts"]),n,function(t){return new h(t.coinbaseAccounts[0])},e,this.requestTimeout)},i.prototype.addPayPalAccount=function(t,e){var n;delete t.share,n=u.mergeOptions(this.attrs,{paypalAccount:t,_meta:{integration:this.integration||"paypal",source:"paypal"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods","paypal_accounts"]),n,function(t){return new d(t.paypalAccounts[0])},e,this.requestTimeout)},i.prototype.addCreditCard=function(t,e){var n,r,i=t.share;delete t.share,r=f(t),n=u.mergeOptions(this.attrs,{share:i,creditCard:r,_meta:{integration:this.integration||"custom",source:"form"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/credit_cards"]),n,function(t){return new p(t.creditCards[0])},e,this.requestTimeout)},i.prototype.sendAnalyticsEvents=function(t,e){var r,i,o=this.analyticsUrl,a=[];if(t=u.isArray(t)?t:[t],!o)return void(e&&e.apply(null,[null,{}]));for(i in t)t.hasOwnProperty(i)&&a.push({kind:t[i]});r=u.mergeOptions(this.attrs,{braintree_library_version:this.sdkVersion,analytics:a,_meta:{merchantAppId:this.merchantAppId,platform:"web",platformVersion:n.navigator.userAgent,integrationType:this.integration,sdkVersion:this.sdkVersion}}),this.driver.post(o,r,function(t){return t},e,this.requestTimeout)},i.prototype.decryptBrowserswitchPayload=function(t,e){var n=u.mergeOptions(this.attrs,{asymmetric_encrypted_payload:t}),r=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/decrypt"]);this.driver.post(r,n,function(t){return t},e,this.requestTimeout)},i.prototype.encryptBrowserswitchReturnPayload=function(t,e,n){var r=u.mergeOptions(this.attrs,{payload:t,aesKey:e}),i=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/encrypt"]);this.driver.post(i,r,function(t){return t},n,this.requestTimeout)},i.prototype.exchangePaypalTokenForConsentCode=function(t,e){var n=u.mergeOptions(this.attrs,t);this.attrs.merchantAccountId&&(n.merchant_account_id=this.attrs.merchantAccountId);var r=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_account_service/merchant_consent"]);this.driver.post(r,n,function(t){return t},e,this.requestTimeout)},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./coinbase-account":5,"./credit-card":7,"./europe-bank-account":8,"./normalize-api-fields":10,"./parse-client-token":11,"./paypal-account":12,"./request/choose-driver":15,"./sepa-mandate":20,"./should-enable-cors":21,"./util":22,"braintree-3ds":31,"braintree-utilities":43}],5:[function(t,e,n){"use strict";function r(t){var e,n;for(e=0;e<i.length;e++)n=i[e],this[n]=t[n]}var i=["nonce","type","description","details"];e.exports=r},{}],6:[function(t,e,n){e.exports={errors:{UNKNOWN_ERROR:"Unknown error",INVALID_TIMEOUT:"Timeout must be a number"}}},{}],7:[function(t,e,n){"use strict";function r(t){var e,n;for(e=0;e<i.length;e++)n=i[e],this[n]=t[n]}var i=["billingAddress","branding","createdAt","createdAtMerchant","createdAtMerchantName","details","isLocked","lastUsedAt","lastUsedAtMerchant","lastUsedAtMerchantName","lastUsedByCurrentMerchant","nonce","securityQuestions","type"];e.exports=r},{}],8:[function(t,e,n){"use strict";function r(t){var e,n=["bic","maskedIBAN","nonce","accountHolderName"],r=0;for(r=0;r<n.length;r++)e=n[r],this[e]=t[e]}e.exports=r},{}],9:[function(t,e,n){"use strict";function r(t,e){var n=i(t.clientToken),r={authorizationFingerprint:n.authorizationFingerprint},u=a({enableCORS:s(t)});u.get(n.configUrl,r,function(t){return o.mergeOptions(n,t)},e,t.timeout)}var i=t("./parse-client-token"),o=t("./util"),a=t("./request/choose-driver"),s=t("./should-enable-cors");e.exports=r},{"./parse-client-token":11,"./request/choose-driver":15,"./should-enable-cors":21,"./util":22}],10:[function(t,e,n){"use strict";function r(t){var e,n={billingAddress:t.billingAddress||{}};for(e in t)if(t.hasOwnProperty(e))switch(e.replace(/_/,"").toLowerCase()){case"postalcode":case"countryname":case"countrycodenumeric":case"countrycodealpha2":case"countrycodealpha3":case"region":case"extendedaddress":case"locality":case"firstname":case"lastname":case"company":case"streetaddress":n.billingAddress[e]=t[e];break;default:n[e]=t[e]}return n}e.exports={normalizeCreditCardFields:r}},{}],11:[function(t,e,n){"use strict";function r(t){var e;if(!t)throw new Error("Braintree API Client Misconfigured: clientToken required.");if("object"==typeof t&&null!==t)e=t;else{try{t=window.atob(t)}catch(n){}try{e=JSON.parse(t)}catch(r){throw new Error("Braintree API Client Misconfigured: clientToken is not valid JSON.")}}if(!e.hasOwnProperty("clientApiUrl")||!i.isWhitelistedDomain(e.clientApiUrl))throw new Error("Braintree API Client Misconfigured: the clientApiUrl provided in the clientToken is invalid.");return e}var i=t("braintree-utilities");t("./polyfill"),e.exports=r},{"./polyfill":13,"braintree-utilities":43}],12:[function(t,e,n){"use strict";function r(t){var e,n;for(e=0;e<i.length;e++)n=i[e],this[n]=t[n]}var i=["nonce","type","description","details"];e.exports=r},{}],13:[function(t,e,n){(function(t){"use strict";var n=function(t){var e=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="";if(!e.test(t))throw new Error("Non base64 encoded input passed to window.atob polyfill");var i=0;do{var o=n.indexOf(t.charAt(i++)),a=n.indexOf(t.charAt(i++)),s=n.indexOf(t.charAt(i++)),u=n.indexOf(t.charAt(i++)),l=(63&o)<<2|a>>4&3,c=(15&a)<<4|s>>2&15,p=(3&s)<<6|63&u;r+=String.fromCharCode(l)+(c?String.fromCharCode(c):"")+(p?String.fromCharCode(p):"")}while(i<t.length);return r};t.atob=t.atob||n,e.exports={atobPolyfill:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(t,e,n){(function(n){"use strict";function r(){return p?new XMLHttpRequest:new XDomainRequest}function i(t,e,n,r,i){var o=s.createURLParams(t,e);a("GET",o,null,n,r,i)}function o(t,e,n,r,i){a("POST",t,e,n,r,i)}function a(t,e,n,i,o,a){var s,h,d=r();o=o||function(){},p?d.onreadystatechange=function(){4===d.readyState&&(s=d.status,h=l(d.responseText),s>=400||0===s?o.call(null,h||{errors:c.errors.UNKNOWN_ERROR},null):s>0&&o.call(null,null,i(h)))}:(d.onload=function(){o.call(null,null,i(l(d.responseText)))},d.onerror=function(){o.call(null,d.responseText,null)},d.onprogress=function(){},d.ontimeout=function(){o.call(null,{errors:c.errors.UNKNOWN_ERROR},null)}),d.open(t,e,!0),d.timeout=null==a?6e4:a,p&&"POST"===t&&d.setRequestHeader("Content-Type","application/json"),setTimeout(function(){d.send(u(t,n))},0)}var s=t("../util"),u=t("./prep-body"),l=t("./parse-body"),c=t("../constants"),p=n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest;e.exports={get:i,post:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants":6,"../util":22,"./parse-body":18,"./prep-body":19}],15:[function(t,e,n){"use strict";function r(t){var e=a.getUserAgent(),n=!(a.isHTTP()&&/(MSIE\s(8|9))|(Phantom)/.test(e));return t=t||{},t.enableCORS&&n?o:i}var i=t("./jsonp-driver"),o=t("./ajax-driver"),a=t("../util");e.exports=r},{"../util":22,"./ajax-driver":14,"./jsonp-driver":16}],16:[function(t,e,n){"use strict";function r(t,e){return t.status>=400?[t,null]:[null,e(t)]}function i(){}function o(t,e,n,o,a,s){var u;a=a||i,null==s&&(s=6e4),u=o(t,e,function(t,e){c[e]&&(clearTimeout(c[e]),a.apply(null,r(t,function(t){return n(t)})))}),"number"==typeof s?c[u]=setTimeout(function(){c[u]=null,a.apply(null,[{errors:l.errors.UNKNOWN_ERROR},null])},s):a.apply(null,[{errors:l.errors.INVALID_TIMEOUT},null])}function a(t,e,n,r,i){e._method="POST",o(t,e,n,u.get,r,i)}function s(t,e,n,r,i){o(t,e,n,u.get,r,i)}var u=t("./jsonp"),l=t("../constants"),c=[];e.exports={get:s,post:a}},{"../constants":6,"./jsonp":17}],17:[function(t,e,n){(function(n){"use strict";function r(t,e){var n=document.createElement("script"),r=!1;n.src=t,n.async=!0;var i=e||l.error;"function"==typeof i&&(n.onerror=function(e){i({url:t,event:e})}),n.onload=n.onreadystatechange=function(){r||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r=!0,n.onload=n.onreadystatechange=null,n&&n.parentNode&&n.parentNode.removeChild(n))},a||(a=document.getElementsByTagName("head")[0]),a.appendChild(n)}function i(t,e,n,i){var o,a;return i=i||l.callbackName||"callback",a=i+"_json"+s.generateUUID(),e[i]=a,o=s.createURLParams(t,e),u[a]=function(t){n(t,a);try{delete u[a]}catch(e){}u[a]=null},r(o),a}function o(t){l=t}var a,s=t("../util"),u=n,l={};e.exports={get:i,init:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../util":22}],18:[function(t,e,n){"use strict";e.exports=function(t){try{t=JSON.parse(t)}catch(e){}return t}},{}],19:[function(t,e,n){"use strict";var r=t("lodash.isstring");e.exports=function(t,e){if(!r(t))throw new Error("Method must be a string");return"get"!==t.toLowerCase()&&null!=e&&(e=r(e)?e:JSON.stringify(e)),e}},{"lodash.isstring":51}],20:[function(t,e,n){"use strict";function r(t){var e,n=0,r=["accountHolderName","bic","longFormURL","mandateReferenceNumber","maskedIBAN","shortForm"];for(n=0;n<r.length;n++)e=r[n],this[e]=t[e]}e.exports=r},{}],21:[function(t,e,n){"use strict";e.exports=function(t){return null!=t.enableCORS?t.enableCORS:t.merchantConfiguration?t.merchantConfiguration.enableCORS:!1}},{}],22:[function(t,e,n){(function(n){"use strict";function r(t){var e,n,r=[];for(n=0;n<t.length;n++)e=t[n],"/"===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),"/"===e.charAt(0)&&(e=e.substring(1)),r.push(e);return r.join("/")}function i(t){return t&&"object"==typeof t&&"number"==typeof t.length&&"[object Array]"===Object.prototype.toString.call(t)||!1}function o(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.floor(16*Math.random()),n="x"===t?e:3&e|8;return n.toString(16)})}function a(t,e){var n,r={};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return r}function s(t,e){var n,r,o,a=[];for(o in t)t.hasOwnProperty(o)&&(r=t[o],n=e?i(t)?e+"[]":e+"["+o+"]":o,a.push("object"==typeof r?s(r,n):encodeURIComponent(n)+"="+encodeURIComponent(r)));return a.join("&")}function u(t,e){return t=t||"",!p(e)&&h(e)&&(t+=-1===t.indexOf("?")?"?":"",t+=-1!==t.indexOf("=")?"&":"",t+=s(e)),t}function l(){return n.navigator.userAgent}function c(){return"http:"===n.location.protocol}var p=t("lodash.isempty"),h=t("lodash.isobject");e.exports={joinUrlFragments:r,isArray:i,generateUUID:o,mergeOptions:a,stringify:s,createURLParams:u,getUserAgent:l,isHTTP:c}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash.isempty":44,"lodash.isobject":50}],23:[function(t,e,n){"use strict";function r(t){return new i(t)}var i=t("./lib/client"),o=t("./lib/util"),a=t("./lib/parse-client-token"),s=t("./lib/get-configuration");e.exports={Client:i,configure:r,util:o,parseClientToken:a,_getConfiguration:s}},{"./lib/client":4,"./lib/get-configuration":9,"./lib/parse-client-token":11,"./lib/util":22}],24:[function(t,e,n){"use strict";function r(t,e){if(e=e||"["+t+"] is not a valid DOM Element",t&&t.nodeType&&1===t.nodeType)return t;if(t&&window.jQuery&&(t instanceof jQuery||"jquery"in Object(t))&&0!==t.length)return t[0];if("string"==typeof t&&document.getElementById(t))return document.getElementById(t);throw new Error(e)}e.exports={normalizeElement:r}},{}],25:[function(t,e,n){"use strict";function r(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on"+e,n)}function i(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r):t.detachEvent&&t.detachEvent("on"+e,n)}e.exports={addEventListener:r,removeEventListener:i}},{}],26:[function(t,e,n){"use strict";function r(t){return"[object Function]"===o.call(t)}function i(t,e){return function(){t.apply(e,arguments)}}var o=Object.prototype.toString;e.exports={bind:i,isFunction:r}},{}],27:[function(t,e,n){"use strict";function r(){return"https:"===window.location.protocol}function i(t){switch(t){case null:case void 0:return"";case!0:return"1";case!1:return"0";default:return encodeURIComponent(t)}}function o(t,e){var n,r,a=[];for(r in t)if(t.hasOwnProperty(r)){var s=t[r];n=e?e+"["+r+"]":r,"object"==typeof s?a.push(o(s,n)):void 0!==s&&null!==s&&a.push(i(n)+"="+i(s))}return a.join("&")}function a(t){for(var e={},n=t.split("&"),r=0;r<n.length;r++){var i=n[r].split("="),o=i[0],a=decodeURIComponent(i[1]);e[o]=a}return e}function s(t){var e=t.split("?");return 2!==e.length?{}:a(e[1])}e.exports={isBrowserHttps:r,makeQueryString:o,decodeQueryString:a,getParams:s}},{}],28:[function(t,e,n){var r=t("./lib/dom"),i=t("./lib/url"),o=t("./lib/fn"),a=t("./lib/events");e.exports={normalizeElement:r.normalizeElement,isBrowserHttps:i.isBrowserHttps,makeQueryString:i.makeQueryString,decodeQueryString:i.decodeQueryString,getParams:i.getParams,removeEventListener:a.removeEventListener,addEventListener:a.addEventListener,bind:o.bind,isFunction:o.isFunction}},{"./lib/dom":24,"./lib/events":25,"./lib/fn":26,"./lib/url":27}],29:[function(t,e,n){"use strict";function r(t,e){var n=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return n[e]}function i(){return{html:{height:a.style.height||"",overflow:r(a,"overflow"),position:r(a,"position")},body:{height:s.style.height||"",overflow:r(s,"overflow")}}}function o(t,e){this.assetsUrl=t,this.container=e||document.body,this.iframe=null,a=document.documentElement,s=document.body,this.merchantPageDefaultStyles=i()}var a,s,u=t("braintree-utilities"),l=t("../shared/receiver"),c="1.3.0";o.prototype.get=function(t,e){var n=this,r=this.constructAuthorizationURL(t);this.container&&u.isFunction(this.container)?this.container(r+"&no_style=1"):this.insertIframe(r),new l(function(t){u.isFunction(n.container)||n.removeIframe(),e(t)})},o.prototype.removeIframe=function(){this.container&&this.container.nodeType&&1===this.container.nodeType?this.container.removeChild(this.iframe):this.container&&window.jQuery&&this.container instanceof jQuery?$(this.iframe,this.container).remove():"string"==typeof this.container&&document.getElementById(this.container).removeChild(this.iframe),this.unlockMerchantWindowSize()},o.prototype.insertIframe=function(t){var e=document.createElement("iframe");if(e.src=t,this.applyStyles(e),this.lockMerchantWindowSize(),this.container&&this.container.nodeType&&1===this.container.nodeType)this.container.appendChild(e);else if(this.container&&window.jQuery&&this.container instanceof jQuery&&0!==this.container.length)this.container.append(e);else{if("string"!=typeof this.container||!document.getElementById(this.container))throw new Error("Unable to find valid container for iframe.");document.getElementById(this.container).appendChild(e)}this.iframe=e},o.prototype.applyStyles=function(t){t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.height="100%",t.style.width="100%",t.setAttribute("frameborder","0"),t.setAttribute("allowTransparency","true"),t.style.border="0",t.style.zIndex="99999"},o.prototype.lockMerchantWindowSize=function(){a.style.overflow="hidden",s.style.overflow="hidden",s.style.height="100%"},o.prototype.unlockMerchantWindowSize=function(){var t=this.merchantPageDefaultStyles;s.style.height=t.body.height,s.style.overflow=t.body.overflow,a.style.overflow=t.html.overflow},o.prototype.constructAuthorizationURL=function(t){var e,n=window.location.href;return n.indexOf("#")>-1&&(n=n.split("#")[0]),e=u.makeQueryString({acsUrl:t.acsUrl,pareq:t.pareq,termUrl:t.termUrl+"&three_d_secure_version="+c,md:t.md,parentUrl:n}),this.assetsUrl+"/3ds/"+c+"/html/style_frame?"+e},e.exports=o},{"../shared/receiver":36,"braintree-utilities":28}],30:[function(t,e,n){"use strict";function r(){}function i(t,e){e=e||{},this.clientToken=e.clientToken,this.container=e.container,this.api=t,this.nonce=null,this._loader=null,this._boundHandleUserClose=o.bind(this._handleUserClose,this)}var o=t("braintree-utilities"),a=t("./authorization_service"),s=t("./loader");i.prototype.verify=function(t,e){if(!o.isFunction(e))throw this.api.sendAnalyticsEvents("3ds.web.no_callback"),new Error("No suitable callback argument was given");o.isFunction(t.onUserClose)&&(this._onUserClose=t.onUserClose),o.isFunction(t.onLookupComplete)&&(this._onLookupComplete=t.onLookupComplete),(void 0===t.useDefaultLoader||t.useDefaultLoader===!0)&&this._createDefaultLoader();var n={nonce:"",amount:t.amount},r=t.creditCard;if("string"==typeof r)n.nonce=r,this.api.sendAnalyticsEvents("3ds.web.verify.nonce"),this.startVerification(n,e);else{var i=this,a=function(t,r){return t?(i._removeDefaultLoader(),e(t)):(n.nonce=r,void i.startVerification(n,e))};this.api.sendAnalyticsEvents("3ds.web.verify.credit_card"),this.api.tokenizeCard(r,a)}},i.prototype.startVerification=function(t,e){this.api.lookup3DS(t,o.bind(this.handleLookupResponse(e),this))},i.prototype.handleLookupResponse=function(t){var e=this;return function(n,r){var i;this._onLookupComplete(),n?t(n.error):r.lookup&&r.lookup.acsUrl&&r.lookup.acsUrl.length>0?(e.nonce=r.paymentMethod.nonce,i=new a(this.clientToken.assetsUrl,this.container),i.get(r.lookup,o.bind(this.handleAuthenticationResponse(t),this)),this._detachListeners(),this._attachListeners()):(e.nonce=r.paymentMethod.nonce,t(null,{nonce:e.nonce,verificationDetails:r.threeDSecureInfo}))}},i.prototype.handleAuthenticationResponse=function(t){return function(e){var n,r=o.decodeQueryString(e);r.user_closed||(n=JSON.parse(r.auth_response),n.success?t(null,{nonce:n.paymentMethod.nonce,verificationDetails:n.threeDSecureInfo}):n.threeDSecureInfo&&n.threeDSecureInfo.liabilityShiftPossible?t(null,{nonce:this.nonce,verificationDetails:n.threeDSecureInfo}):t(n.error))}},i.prototype._attachListeners=function(){o.addEventListener(window,"message",this._boundHandleUserClose)},i.prototype._detachListeners=function(){o.removeEventListener(window,"message",this._boundHandleUserClose)},i.prototype._createDefaultLoader=function(){this._loader=new s,document.body.appendChild(this._loader.getElement())},i.prototype._removeDefaultLoader=function(){if(this._loader){var t=this._loader.getElement(),e=t.parentNode;e&&e.removeChild(t),this._loader.dispose(),this._loader=null}},i.prototype._handleUserClose=function(t){"user_closed=true"===t.data&&this._onUserClose()},i.prototype._onUserClose=r,i.prototype._onLookupComplete=function(){this._removeDefaultLoader()},e.exports=i},{"./authorization_service":29,"./loader":32,"braintree-utilities":28}],31:[function(t,e,n){"use strict";var r=t("./client");e.exports={create:function(t,e){var n=new r(t,e);return n}}},{"./client":30}],32:[function(t,e,n){"use strict";function r(){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._display=null,this._initialize()}var i=t("./loader_display"),o=t("./loader_message"),a=t("./loader_spinner");r.prototype._cssDeclarations=["filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#7F000000, EndColorStr=#7F000000)","background-color: rgba(0, 0, 0, 0.5)","display: table","height: 100%","left: 0","position: fixed","right: 0","top: 0","width: 100%","z-index: 99999"].join(";"),r.prototype.getElement=function(){return this._element},r.prototype.dispose=function(){this._display.dispose(),this._display=null,this._element=null},r.prototype._initialize=function(){var t=new a,e=window.SVGElement&&window.SVGAnimateElement&&window.SVGAnimateTransformElement;e||(t=new o("Loading...")),this._display=new i(t),this.getElement().appendChild(this._display.getElement())},e.exports=r},{"./loader_display":33,"./loader_message":34,"./loader_spinner":35}],33:[function(t,e,n){"use strict";function r(t){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._displayObject=t,this._initialize()}r.prototype._cssDeclarations=["display: table-cell","vertical-align: middle"].join(";"),r.prototype.getElement=function(){return this._element},r.prototype.dispose=function(){this._displayObject.dispose(),this._displayObject=null,this._element=null},r.prototype._initialize=function(){this.getElement().appendChild(this._displayObject.getElement())},e.exports=r},{}],34:[function(t,e,n){"use strict";function r(t){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._element.innerHTML=t}r.prototype._cssDeclarations=["color: #fff","font-family: Helvetica, sans-serif","font-size: 12px","text-align: center"].join(";"),r.prototype.getElement=function(){return this._element},r.prototype.dispose=function(){this._element=null},e.exports=r},{}],35:[function(t,e,n){"use strict";function r(){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._element.innerHTML=this._markup}r.prototype._cssDeclarations=["height: 36px","margin-left: auto","margin-right: auto","width: 36px"].join(";"),r.prototype._markup=['<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"','width="100%" height="100%" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">',' <path fill="#FFF" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">',' <animateTransform attributeType="xml"',' attributeName="transform"',' type="rotate"',' from="0 25 25"',' to="360 25 25"',' dur="780ms"',' repeatCount="indefinite"',' calcMode="spline"',' keySplines="0.44, 0.22, 0, 1"',' keyTimes="0;1"/>'," </path>","</svg>"].join(""),r.prototype.getElement=function(){return this._element},r.prototype.dispose=function(){this._element=null},e.exports=r},{}],36:[function(t,e,n){"use strict";function r(t){this.postMessageReceiver(t),this.hashChangeReceiver(t)}var i=t("braintree-utilities");r.prototype.postMessageReceiver=function(t){var e=this;this.wrappedCallback=function(n){var r=n.data;(/^(auth_response=)/.test(r)||"user_closed=true"===r)&&(t(r),e.stopListening())},i.addEventListener(window,"message",this.wrappedCallback)},r.prototype.hashChangeReceiver=function(t){var e,n=window.location.hash,r=this;this.poll=setInterval(function(){e=window.location.hash,e.length>0&&e!==n&&(r.stopListening(),e=e.substring(1,e.length),t(e),window.location.hash=n.length>0?n:"")},10)},r.prototype.stopListening=function(){clearTimeout(this.poll),i.removeEventListener(window,"message",this.wrappedCallback)},e.exports=r},{"braintree-utilities":28}],37:[function(t,e,n){"use strict";var r,i=Array.prototype.indexOf;r=i?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},e.exports={indexOf:r}},{}],38:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],39:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],40:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],41:[function(t,e,n){"use strict";function r(t){var e,n,r,i,o=[{min:0,max:180,chars:7},{min:181,max:620,chars:14},{min:621,max:960,chars:22}];for(i=o.length,t=t||window.innerWidth,n=0;i>n;n++)r=o[n],t>=r.min&&t<=r.max&&(e=r.chars);return e||60}function i(t,e){var n,r;return-1===t.indexOf("@")?t:(t=t.split("@"),n=t[0],r=t[1],n.length>e&&(n=n.slice(0,e)+"..."),r.length>e&&(r="..."+r.slice(-e)),n+"@"+r)}e.exports={truncateEmail:i,getMaxCharLength:r}},{}],42:[function(t,e,n){"use strict";function r(){return"https:"===window.location.protocol}function i(t){switch(t){case null:case void 0:return"";case!0:return"1";case!1:return"0";default:return encodeURIComponent(t)}}function o(t,e){var n,r,a=[];for(r in t)if(t.hasOwnProperty(r)){var s=t[r];n=e?e+"["+r+"]":r,"object"==typeof s?a.push(o(s,n)):void 0!==s&&null!==s&&a.push(i(n)+"="+i(s));
3
+
4
+ }return a.join("&")}function a(t){for(var e={},n=t.split("&"),r=0;r<n.length;r++){var i=n[r].split("="),o=i[0],a=decodeURIComponent(i[1]);e[o]=a}return e}function s(t){var e=t.split("?");return 2!==e.length?{}:a(e[1])}function u(t){if(t=t.toLowerCase(),!/^http/.test(t))return!1;c.href=t;var e=c.hostname.split("."),n=e.slice(-2).join(".");return-1===l.indexOf(p,n)?!1:!0}var l=t("./array"),c=document.createElement("a"),p=["paypal.com","braintreepayments.com","braintreegateway.com","localhost"];e.exports={isBrowserHttps:r,makeQueryString:o,decodeQueryString:a,getParams:s,isWhitelistedDomain:u}},{"./array":37}],43:[function(t,e,n){var r=t("./lib/dom"),i=t("./lib/url"),o=t("./lib/fn"),a=t("./lib/events"),s=t("./lib/string"),u=t("./lib/array");e.exports={string:s,array:u,normalizeElement:r.normalizeElement,isBrowserHttps:i.isBrowserHttps,makeQueryString:i.makeQueryString,decodeQueryString:i.decodeQueryString,getParams:i.getParams,isWhitelistedDomain:i.isWhitelistedDomain,removeEventListener:a.removeEventListener,addEventListener:a.addEventListener,bind:o.bind,isFunction:o.isFunction}},{"./lib/array":37,"./lib/dom":38,"./lib/events":39,"./lib/fn":40,"./lib/string":41,"./lib/url":42}],44:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function i(t){return function(e){return null==e?void 0:e[t]}}function o(t){return null!=t&&a(f(t))}function a(t){return"number"==typeof t&&t>-1&&t%1==0&&d>=t}function s(t){return null==t?!0:o(t)&&(l(t)||p(t)||u(t)||r(t)&&c(t.splice))?!t.length:!h(t).length}var u=t("lodash.isarguments"),l=t("lodash.isarray"),c=t("lodash.isfunction"),p=t("lodash.isstring"),h=t("lodash.keys"),d=9007199254740991,f=i("length");e.exports=s},{"lodash.isarguments":45,"lodash.isarray":46,"lodash.isfunction":47,"lodash.isstring":51,"lodash.keys":48}],45:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function i(t){return function(e){return null==e?void 0:e[t]}}function o(t){return null!=t&&a(h(t))}function a(t){return"number"==typeof t&&t>-1&&t%1==0&&p>=t}function s(t){return r(t)&&o(t)&&l.call(t,"callee")&&!c.call(t,"callee")}var u=Object.prototype,l=u.hasOwnProperty,c=u.propertyIsEnumerable,p=9007199254740991,h=i("length");e.exports=s},{}],46:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function i(t,e){var n=null==t?void 0:t[e];return u(n)?n:void 0}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&g>=t}function a(t){return s(t)&&m.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return null==t?!1:a(t)?v.test(d.call(t)):r(t)&&p.test(t)}var l="[object Array]",c="[object Function]",p=/^\[object .+?Constructor\]$/,h=Object.prototype,d=Function.prototype.toString,f=h.hasOwnProperty,m=h.toString,v=RegExp("^"+d.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=i(Array,"isArray"),g=9007199254740991,b=y||function(t){return r(t)&&o(t.length)&&m.call(t)==l};e.exports=b},{}],47:[function(t,e,n){function r(t){return i(t)&&s.call(t)==o}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var o="[object Function]",a=Object.prototype,s=a.toString;e.exports=r},{}],48:[function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&a(g(t))}function o(t,e){return t="number"==typeof t||d.test(t)?+t:-1,e=null==e?y:e,t>-1&&t%1==0&&e>t}function a(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function s(t){for(var e=l(t),n=e.length,r=n&&t.length,i=!!r&&a(r)&&(h(t)||p(t)),s=-1,u=[];++s<n;){var c=e[s];(i&&o(c,r)||m.call(t,c))&&u.push(c)}return u}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){if(null==t)return[];u(t)||(t=Object(t));var e=t.length;e=e&&a(e)&&(h(t)||p(t))&&e||0;for(var n=t.constructor,r=-1,i="function"==typeof n&&n.prototype===t,s=Array(e),l=e>0;++r<e;)s[r]=r+"";for(var c in t)l&&o(c,e)||"constructor"==c&&(i||!m.call(t,c))||s.push(c);return s}var c=t("lodash._getnative"),p=t("lodash.isarguments"),h=t("lodash.isarray"),d=/^\d+$/,f=Object.prototype,m=f.hasOwnProperty,v=c(Object,"keys"),y=9007199254740991,g=r("length"),b=v?function(t){var e=null==t?void 0:t.constructor;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&i(t)?s(t):u(t)?v(t):[]}:s;e.exports=b},{"lodash._getnative":49,"lodash.isarguments":45,"lodash.isarray":46}],49:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function i(t,e){var n=null==t?void 0:t[e];return s(n)?n:void 0}function o(t){return a(t)&&d.call(t)==u}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function s(t){return null==t?!1:o(t)?f.test(p.call(t)):r(t)&&l.test(t)}var u="[object Function]",l=/^\[object .+?Constructor\]$/,c=Object.prototype,p=Function.prototype.toString,h=c.hasOwnProperty,d=c.toString,f=RegExp("^"+p.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=i},{}],50:[function(t,e,n){function r(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}e.exports=r},{}],51:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function i(t){return"string"==typeof t||r(t)&&s.call(t)==o}var o="[object String]",a=Object.prototype,s=a.toString;e.exports=i},{}],52:[function(t,e,n){"use strict";var r=t("framebus");r.events=t("./lib/events"),e.exports=r},{"./lib/events":53,framebus:54}],53:[function(t,e,n){"use strict";for(var r=["PAYMENT_METHOD_REQUEST","PAYMENT_METHOD_RECEIVED","PAYMENT_METHOD_GENERATED","PAYMENT_METHOD_NOT_GENERATED","PAYMENT_METHOD_CANCELLED","PAYMENT_METHOD_ERROR","CONFIGURATION_REQUEST","ROOT_METADATA_REQUEST","ERROR","WARNING","UI_POPUP_DID_OPEN","UI_POPUP_DID_CLOSE","UI_POPUP_FORCE_CLOSE","ASYNC_DEPENDENCY_INITIALIZING","ASYNC_DEPENDENCY_READY","USER_FORM_SUBMIT_REQUEST","SEND_ANALYTICS_EVENTS"],i={},o=0;o<r.length;o++){var a=r[o];i[a]=a}e.exports=i},{}],54:[function(t,e,n){"use strict";!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define([],r):t.framebus=r()}(this,function(){function t(t){return null==t?!1:null==t.Window?!1:t.constructor!==t.Window?!1:(b.push(t),!0)}function e(t){var e,n={};for(e in g)g.hasOwnProperty(e)&&(n[e]=g[e]);return n._origin=t||"*",n}function n(t){var e,n,r=o(this);return a(t)?!1:a(r)?!1:(n=Array.prototype.slice.call(arguments,1),e=s(t,n,r),e===!1?!1:(d(y.top,e,r),!0))}function r(t,e){var n=o(this);return v(t,e,n)?!1:(w[n]=w[n]||{},w[n][t]=w[n][t]||[],w[n][t].push(e),!0)}function i(t,e){var n,r,i=o(this);if(v(t,e,i))return!1;if(r=w[i]&&w[i][t],!r)return!1;for(n=0;n<r.length;n++)if(r[n]===e)return r.splice(n,1),!0;return!1}function o(t){return t&&t._origin||"*"}function a(t){return"string"!=typeof t}function s(t,e,n){var r=!1,i={event:t,origin:n},o=e[e.length-1];"function"==typeof o&&(i.reply=m(o,n),e=e.slice(0,-1)),i.args=e;try{r=_+JSON.stringify(i)}catch(a){throw new Error("Could not stringify event: "+a.message)}return r}function u(t){var e,n,r,i;if(t.data.slice(0,_.length)!==_)return!1;try{e=JSON.parse(t.data.slice(_.length))}catch(o){return!1}return null!=e.reply&&(n=t.origin,r=t.source,i=e.reply,e.reply=function(t){var e=s(i,[t],n);return e===!1?!1:void r.postMessage(e,n)},e.args.push(e.reply)),e}function l(t){y||(y=t||window,y.addEventListener?y.addEventListener("message",p,!1):y.attachEvent?y.attachEvent("onmessage",p):null===y.onmessage?y.onmessage=p:y=null)}function c(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"===t?e:3&e|8;return n.toString(16)})}function p(t){var e;a(t.data)||(e=u(t),e&&(h("*",e.event,e.args,t),h(t.origin,e.event,e.args,t),f(t.data,e.origin,t.source)))}function h(t,e,n,r){var i;if(w[t]&&w[t][e])for(i=0;i<w[t][e].length;i++)w[t][e][i].apply(r,n)}function d(t,e,n){var r;try{t.postMessage(e,n)}catch(i){return}for(t.opener&&!t.opener.closed&&t.opener!==y&&d(t.opener.top,e,n),r=0;r<t.frames.length;r++)d(t.frames[r],e,n)}function f(t,e,n){var r,i;for(r=b.length-1;r>=0;r--)i=b[r],i.closed===!0?b=b.slice(r,1):n!==i&&d(i.top,t,e)}function m(t,e){function n(i,o){t(i,o),g.target(e).unsubscribe(r,n)}var r=c();return g.target(e).subscribe(r,n),r}function v(t,e,n){return a(t)?!0:"function"!=typeof e?!0:a(n)?!0:!1}var y,g,b=[],w={},_="/*framebus*/";return l(),g={target:e,include:t,publish:n,pub:n,trigger:n,emit:n,subscribe:r,sub:r,on:r,unsubscribe:i,unsub:i,off:i}})},{}],55:[function(t,e,n){"use strict";function r(t,e){u.emit(u.events.ERROR,{type:e,message:t})}function i(t){t=t||{};var e=t.coinbase;if(null==t.apiClient)r("settings.apiClient is required for coinbase",l);else if(t.configuration.coinbaseEnabled)if(e&&(e.container||e.button))if(e.container&&e.button)r("options.coinbase.container and options.coinbase.button are mutually exclusive",l);else{if(s.isSupportedBrowser())return!0;r("Coinbase is not supported by your browser. Please consider upgrading","UNSUPPORTED_BROWSER")}else r("Either options.coinbase.container or options.coinbase.button is required for Coinbase integrations",l);else r("Coinbase is not enabled for your merchant account",l);return!1}function o(t){return i(t)?new a(t):void 0}var a=t("./lib/coinbase"),s=t("./lib/detector"),u=t("braintree-bus"),l="CONFIGURATION";e.exports={create:o}},{"./lib/coinbase":58,"./lib/detector":60,"braintree-bus":66}],56:[function(t,e,n){(function(t){"use strict";function n(e){return e=e||t.navigator.userAgent,/AppleWebKit\//.test(e)&&/Mobile\//.test(e)?e.replace(/.* OS ([0-9_]+) like Mac OS X.*/,"$1").replace(/_/g,"."):null}function r(e){e=e||t.navigator.userAgent;var n=null,r=/MSIE.(\d+)/.exec(e);return/Trident/.test(e)&&(n=11),r&&(n=parseInt(r[1],10)),n}function i(e){return e=e||t.navigator.userAgent,/Android/.test(e)?e.replace(/^.* Android ([0-9\.]+).*$/,"$1"):null}e.exports={ieVersion:r,iOSSafariVersion:n,androidVersion:i}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],57:[function(t,e,n){"use strict";function r(t,e,n){return t?(i.emit(i.events.ERROR,t.error),void n._sendAnalyticsEvent("generate.nonce.failed")):(i.emit(i.events.PAYMENT_METHOD_GENERATED,e),void n._sendAnalyticsEvent("generate.nonce.succeeded"))}var i=t("braintree-bus");e.exports={tokenize:r}},{"braintree-bus":66}],58:[function(t,e,n){(function(n){"use strict";function r(t){return{clientId:t.configuration.coinbase.clientId,redirectUrl:t.configuration.coinbase.redirectUrl,scopes:t.configuration.coinbase.scopes||l.SCOPES,meta:{authorizations_merchant_account:t.configuration.coinbase.merchantAccount||""}}}function i(t){var e;this.buttonId=t.coinbase.button||l.BUTTON_ID,this.apiClient=t.apiClient,this.assetsUrl=t.configuration.assetsUrl,this.environment=t.configuration.coinbase.environment,this._onOAuthSuccess=o.bind(this._onOAuthSuccess,this),this._handleButtonClick=o.bind(this._handleButtonClick,this),this.popupParams=r(t),this.redirectDoneInterval=null,t.coinbase.container?(e=o.normalizeElement(t.coinbase.container),this._insertFrame(e)):(n.braintreeCoinbasePopupCallback=this._onOAuthSuccess,e=document.body,o.addEventListener(e,"click",this._handleButtonClick),this._sendAnalyticsEvent("initialized"))}var o=t("braintree-utilities"),a=t("./dom/composer"),s=t("./url-composer"),u=t("./callbacks"),l=t("./constants"),c=t("./detector"),p=t("braintree-bus");i.prototype._sendAnalyticsEvent=function(t){var e=this.apiClient.integration+".web.coinbase.";this.apiClient.sendAnalyticsEvents(e+t)},i.prototype._insertFrame=function(t){var e=a.createFrame({src:this.assetsUrl+"/coinbase/"+l.VERSION+"/coinbase-frame.html"});p.emit(p.events.ASYNC_DEPENDENCY_INITIALIZING),t.appendChild(e)},i.prototype._onOAuthSuccess=function(t){return t.code?(p.emit("coinbase:view:navigate","loading"),this._sendAnalyticsEvent("popup.authorized"),this.apiClient.tokenizeCoinbase({code:t.code,query:s.getQueryString()},o.bind(function(t,e){u.tokenize.apply(null,[t,e,this])},this)),void this._closePopup()):(this._sendAnalyticsEvent("popup.denied"),void this._closePopup())},i.prototype._clearPollForRedirectDone=function(){this.redirectDoneInterval&&(clearInterval(this.redirectDoneInterval),this.redirectDoneInterval=null)},i.prototype._closePopup=function(t){t=t||this.popup,c.shouldCloseFromParent()&&t.close(),this._popupCleanup()},i.prototype._popupCleanup=function(){this._clearPollForRedirectDone(),p.emit(p.events.UI_POPUP_DID_CLOSE,{source:l.INTEGRATION_NAME})},i.prototype._pollForRedirectDone=function(t){var e=setInterval(o.bind(function(){var e;if(null==t||t.closed)return this._sendAnalyticsEvent("popup.aborted"),void this._popupCleanup();try{if("about:blank"===t.location.href)throw new Error("Not finished loading");e=o.decodeQueryString(t.location.search.replace(/^\?/,"")).code}catch(n){return}this._onOAuthSuccess({code:e})},this),100);return this.redirectDoneInterval=e,e},i.prototype._openPopup=function(){var t;this._sendAnalyticsEvent("popup.started"),t=a.createPopup(s.compose(this._getOAuthBaseUrl(),this.popupParams)),t.focus(),this._pollForRedirectDone(t),p.trigger(p.events.UI_POPUP_DID_OPEN,{source:l.INTEGRATION_NAME}),p.on(p.events.UI_POPUP_FORCE_CLOSE,function(e){e.target===l.INTEGRATION_NAME&&t.close()}),this.popup=t},i.prototype._getOAuthBaseUrl=function(){var t;return t="shared_sandbox"===this.environment?l.SANDBOX_OAUTH_BASE_URL:l.PRODUCTION_OAUTH_BASE_URL},i.prototype._handleButtonClick=function(t){for(var e=t.target||t.srcElement;;){if(null==e)return;if(e===t.currentTarget)return;if(e.id===this.buttonId)break;e=e.parentNode}t&&t.preventDefault?t.preventDefault():t.returnValue=!1,this._openPopup()},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./callbacks":57,"./constants":59,"./detector":60,"./dom/composer":62,"./url-composer":65,"braintree-bus":66,"braintree-utilities":75}],59:[function(t,e,n){"use strict";e.exports={PRODUCTION_OAUTH_BASE_URL:"https://coinbase.com",SANDBOX_OAUTH_BASE_URL:"https://sandbox.coinbase.com",ORIGIN_URL:"https://www.coinbase.com",FRAME_NAME:"braintree-coinbase-frame",POPUP_NAME:"coinbase",BUTTON_ID:"bt-coinbase-button",SCOPES:"send",VERSION:"0.2.2",INTEGRATION_NAME:"Coinbase"}},{}],60:[function(t,e,n){"use strict";function r(){var t=s.ieVersion();return!t||t>8}function i(){var t=s.androidVersion();return null==t?!1:/^5/.test(t)}function o(){return!(i()||a())}function a(){var t=s.iOSSafariVersion();return null==t?!1:/^8\.0/.test(t)||/^8\.1$/.test(t)}var s=t("./browser");e.exports={isSupportedBrowser:r,shouldCloseFromParent:o,shouldDisplayIOSClose:a,shouldDisplayLollipopClose:i}},{"./browser":56}],61:[function(t,e,n){"use strict";function r(t){var e=document.createElement("button");return t=t||{},e.id=t.id||"coinbase-button",e.style.backgroundColor=t.backgroundColor||"#EEE",e.style.color=t.color||"#4597C3",e.style.border=t.border||"0",e.style.borderRadius=t.borderRadius||"6px",e.style.padding=t.padding||"12px",e.innerHTML=t.innerHTML||"coinbase",e}e.exports={create:r}},{}],62:[function(t,e,n){"use strict";var r=t("./popup"),i=t("./button"),o=t("./frame");e.exports={createButton:i.create,createPopup:r.create,createFrame:o.create}},{"./button":61,"./frame":63,"./popup":64}],63:[function(t,e,n){"use strict";function r(t){return o({src:t.src,name:i.FRAME_NAME,height:"70px",width:"100%",style:{padding:0,margin:0,border:0,outline:"none"}})}var i=t("../constants"),o=t("iframer");e.exports={create:r}},{"../constants":59,iframer:76}],64:[function(t,e,n){(function(n){"use strict";function r(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push([n,t[n]].join("="));return e.join(",")}function i(){var t=850,e=600;return r({width:t,height:e,left:(screen.width-t)/2,top:(screen.height-e)/4})}function o(t){return n.open(t,a.POPUP_NAME,i())}var a=t("../constants");e.exports={create:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants":59}],65:[function(t,e,n){"use strict";function r(){return"version="+o.VERSION}function i(t,e){var n=t+"/oauth/authorize?response_type=code",i=e.redirectUrl+"?"+r();if(n+="&redirect_uri="+encodeURIComponent(i),n+="&client_id="+e.clientId,e.scopes&&(n+="&scope="+encodeURIComponent(e.scopes)),e.meta)for(var o in e.meta)e.meta.hasOwnProperty(o)&&(n+="&meta["+encodeURIComponent(o)+"]="+encodeURIComponent(e.meta[o]));return n}var o=t("./constants");e.exports={compose:i,getQueryString:r}},{"./constants":59}],66:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{"./lib/events":67,dup:52,framebus:68}],67:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53}],68:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{dup:54}],69:[function(t,e,n){arguments[4][37][0].apply(n,arguments)},{dup:37}],70:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],71:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],72:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],73:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{dup:41}],74:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"./array":69,dup:42}],75:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"./lib/array":69,"./lib/dom":70,"./lib/events":71,"./lib/fn":72,"./lib/string":73,"./lib/url":74,dup:43}],76:[function(t,e,n){"use strict";var r=t("lodash.assign"),i=t("lodash.isstring"),o=t("./lib/default-attributes");e.exports=function(t){var e=document.createElement("iframe"),n=r({},o,t);n.style&&!i(n.style)&&(r(e.style,n.style),delete n.style);for(var a in n)n.hasOwnProperty(a)&&e.setAttribute(a,n[a]);return e.getAttribute("id")||(e.id=e.name),e}},{"./lib/default-attributes":77,"lodash.assign":78,"lodash.isstring":89}],77:[function(t,e,n){e.exports={frameBorder:0,allowtransparency:!0}},{}],78:[function(t,e,n){function r(t,e,n){for(var r=-1,i=a(e),o=i.length;++r<o;){var s=i[r],u=t[s],l=n(u,e[s],s,t,e);(l===l?l===u:u!==u)&&(void 0!==u||s in t)||(t[s]=l)}return t}var i=t("lodash._baseassign"),o=t("lodash._createassigner"),a=t("lodash.keys"),s=o(function(t,e,n){return n?r(t,e,n):i(t,e)});e.exports=s},{"lodash._baseassign":79,"lodash._createassigner":81,"lodash.keys":85}],79:[function(t,e,n){function r(t,e){return null==e?t:i(e,o(e),t)}var i=t("lodash._basecopy"),o=t("lodash.keys");e.exports=r},{"lodash._basecopy":80,"lodash.keys":85}],80:[function(t,e,n){function r(t,e,n){n||(n={});for(var r=-1,i=e.length;++r<i;){var o=e[r];n[o]=t[o]}return n}e.exports=r},{}],81:[function(t,e,n){function r(t){return a(function(e,n){var r=-1,a=null==e?0:n.length,s=a>2?n[a-2]:void 0,u=a>2?n[2]:void 0,l=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,l,5),a-=2):(s="function"==typeof l?l:void 0,a-=s?1:0),u&&o(n[0],n[1],u)&&(s=3>a?void 0:s,a=1);++r<a;){var c=n[r];c&&t(e,c,s)}return e})}var i=t("lodash._bindcallback"),o=t("lodash._isiterateecall"),a=t("lodash.restparam");e.exports=r},{"lodash._bindcallback":82,"lodash._isiterateecall":83,"lodash.restparam":84}],82:[function(t,e,n){function r(t,e,n){if("function"!=typeof t)return i;if(void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)};case 5:return function(n,r,i,o,a){return t.call(e,n,r,i,o,a)}}return function(){return t.apply(e,arguments)}}function i(t){return t}e.exports=r},{}],83:[function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&s(p(t))}function o(t,e){return t="number"==typeof t||l.test(t)?+t:-1,e=null==e?c:e,t>-1&&t%1==0&&e>t}function a(t,e,n){if(!u(n))return!1;var r=typeof e;if("number"==r?i(n)&&o(e,n.length):"string"==r&&e in n){var a=n[e];return t===t?t===a:a!==a}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&c>=t}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var l=/^\d+$/,c=9007199254740991,p=r("length");e.exports=a},{}],84:[function(t,e,n){function r(t,e){if("function"!=typeof t)throw new TypeError(i);return e=o(void 0===e?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=o(n.length-e,0),a=Array(i);++r<i;)a[r]=n[e+r];switch(e){case 0:return t.call(this,a);case 1:return t.call(this,n[0],a);case 2:return t.call(this,n[0],n[1],a)}var s=Array(e+1);for(r=-1;++r<e;)s[r]=n[r];return s[e]=a,t.apply(this,s)}}var i="Expected a function",o=Math.max;e.exports=r},{}],85:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48,"lodash._getnative":86,"lodash.isarguments":87,"lodash.isarray":88}],86:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],87:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],88:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46}],89:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],90:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{"./coinbase-account":91,"./credit-card":93,"./europe-bank-account":94,"./normalize-api-fields":96,"./parse-client-token":97,"./paypal-account":98,"./request/choose-driver":101,"./sepa-mandate":106,"./should-enable-cors":107,"./util":108,"braintree-3ds":117,"braintree-utilities":129,dup:4}],91:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],92:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],93:[function(t,e,n){arguments[4][7][0].apply(n,arguments)},{dup:7}],94:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{dup:8}],95:[function(t,e,n){arguments[4][9][0].apply(n,arguments)},{"./parse-client-token":97,"./request/choose-driver":101,"./should-enable-cors":107,"./util":108,dup:9}],96:[function(t,e,n){arguments[4][10][0].apply(n,arguments)},{dup:10}],97:[function(t,e,n){arguments[4][11][0].apply(n,arguments)},{"./polyfill":99,"braintree-utilities":129,dup:11}],98:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{dup:12}],99:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{dup:13}],100:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{"../constants":92,"../util":108,"./parse-body":104,"./prep-body":105,dup:14}],101:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{"../util":108,"./ajax-driver":100,"./jsonp-driver":102,dup:15}],102:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{"../constants":92,"./jsonp":103,dup:16}],103:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{"../util":108,dup:17}],104:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],105:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19,"lodash.isstring":137}],106:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20}],107:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{dup:21}],108:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22,"lodash.isempty":130,"lodash.isobject":136}],109:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{"./lib/client":90,"./lib/get-configuration":95,"./lib/parse-client-token":97,"./lib/util":108,dup:23}],110:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],111:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],112:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],113:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{dup:27}],114:[function(t,e,n){arguments[4][28][0].apply(n,arguments)},{"./lib/dom":110,"./lib/events":111,"./lib/fn":112,"./lib/url":113,dup:28}],115:[function(t,e,n){arguments[4][29][0].apply(n,arguments)},{"../shared/receiver":122,"braintree-utilities":114,dup:29}],116:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{"./authorization_service":115,"./loader":118,"braintree-utilities":114,dup:30}],117:[function(t,e,n){arguments[4][31][0].apply(n,arguments)},{"./client":116,dup:31}],118:[function(t,e,n){arguments[4][32][0].apply(n,arguments)},{"./loader_display":119,"./loader_message":120,"./loader_spinner":121,dup:32}],119:[function(t,e,n){arguments[4][33][0].apply(n,arguments)},{dup:33}],120:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],121:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],122:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"braintree-utilities":114,dup:36}],123:[function(t,e,n){arguments[4][37][0].apply(n,arguments)},{dup:37}],124:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],125:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],126:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],127:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{dup:41}],128:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"./array":123,dup:42}],129:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"./lib/array":123,"./lib/dom":124,"./lib/events":125,"./lib/fn":126,"./lib/string":127,"./lib/url":128,dup:43}],130:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44,"lodash.isarguments":131,"lodash.isarray":132,"lodash.isfunction":133,"lodash.isstring":137,"lodash.keys":134}],131:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],132:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46}],133:[function(t,e,n){arguments[4][47][0].apply(n,arguments)},{dup:47}],134:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48,"lodash._getnative":135,"lodash.isarguments":131,"lodash.isarray":132}],135:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],136:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{dup:50}],137:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],138:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{"./lib/events":139,dup:52,framebus:140}],139:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53}],140:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{dup:54}],141:[function(t,e,n){arguments[4][37][0].apply(n,arguments)},{dup:37}],142:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],143:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],144:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],145:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{dup:41}],146:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"./array":141,dup:42}],147:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"./lib/array":141,"./lib/dom":142,"./lib/events":143,"./lib/fn":144,"./lib/string":145,"./lib/url":146,dup:43}],148:[function(t,e,n){function r(t){var e=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return{overflow:e.overflow||"",height:t.style.height||""}}function i(){return{html:{node:document.documentElement,styles:r(document.documentElement)},body:{node:document.body,styles:r(document.body)}}}function o(t,e){if(!t)throw new Error('Parameter "clientToken" cannot be null');e=e||{},this._clientToken=a.parseClientToken(t),this._clientOptions=e,this.container=e.container,this.merchantPageDefaultStyles=null,this.paymentMethodNonceInputField=e.paymentMethodNonceInputField,this.frame=null,this.popup=null,this.insertFrameFunction=e.insertFrame,this.onSuccess=e.onSuccess,this.onCancelled=e.onCancelled,this.onUnsupported=e.onUnsupported,this.loggedInView=null,this.loggedOutView=null,this.insertUI=!0}var a=t("braintree-api"),s=t("braintree-bus"),u=t("braintree-utilities"),l=t("./logged-in-view"),c=t("./logged-out-view"),p=t("./overlay-view"),h=t("../shared/util/browser"),d=t("../shared/util/dom"),f=t("../shared/constants"),m=t("../shared/util/util"),v=t("../shared/get-locale");o.prototype.getViewerUrl=function(){var t=this._clientToken.paypal.assetsUrl;return t+"/pwpp/"+f.VERSION+"/html/braintree-frame.html"},o.prototype.getProxyUrl=function(){var t=this._clientToken.paypal.assetsUrl;return t+"/pwpp/"+f.VERSION+"/html/proxy-frame.html"},o.prototype.initialize=function(){if(!this._clientToken.paypalEnabled)return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("PayPal is not enabled")));if(!this._isBrowserSecure())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("unsupported protocol detected")));if(this._isHermesCapable()){if(!this._isHermesSupportedCurrency())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("This PayPal integration does not support this currency")));if(!this._isHermesSupportedCountries())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("This PayPal integration does not support this locale")));if(!this._isValidAmount())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("Amount must be a number")))}return this._isMisconfiguredUnvettedMerchant()?void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("Unvetted merchants must provide a payeeEmail, amount, and currency"))):(this._overrideClientTokenProperties(),h.isProxyFrameRequired()&&this._insertProxyFrame(),this._setupDomElements(),this._setupPaymentMethodNonceInputField(),this._setupViews(),void this._createBusSubscribers())},o.prototype._isSupportedOption=function(t,e){for(var n=e.length,r=!1,i=0;n>i;i++)t.toLowerCase()===e[i].toLowerCase()&&(r=!0);return r},o.prototype._isHermesSupportedCurrency=function(){return this._isSupportedOption(this._clientOptions.currency,f.ARIES_SUPPORTED_CURRENCIES)},o.prototype._isHermesSupportedCountries=function(){return this._isSupportedOption(v(this._clientOptions.locale).split("_")[1],f.ARIES_SUPPORTED_COUNTRIES)},o.prototype._isValidAmount=function(){var t=parseFloat(this._clientOptions.amount);return"number"==typeof t&&!isNaN(t)&&t>=0},o.prototype._isMisconfiguredUnvettedMerchant=function(){return this._clientToken.paypal.unvettedMerchant&&(!this._isHermesCapable()||!this._clientToken.paypal.payeeEmail)},o.prototype._isBrowserSecure=function(){return u.isBrowserHttps()||h.isPopupSupported()||this._clientToken.paypal.allowHttp},o.prototype._overrideClientTokenProperties=function(){this._clientOptions.displayName&&(this._clientToken.paypal.displayName=this._clientOptions.displayName)},o.prototype._setupDomElements=function(){this.insertUI&&(this.container=u.normalizeElement(this.container))},o.prototype._setupPaymentMethodNonceInputField=function(){if(this.insertUI){var t=this.paymentMethodNonceInputField;u.isFunction(t)||(t=void 0!==t?u.normalizeElement(t):this._createPaymentMethodNonceInputField(),this.paymentMethodNonceInputField=t)}},o.prototype._setupViews=function(){var t=this._clientToken.paypal.assetsUrl;this.insertUI&&(this.loggedInView=new l({container:this.container,assetsUrl:t}),this.loggedOutView=new c({assetsUrl:t,container:this.container,isCheckout:this._isHermesCapable(),locale:this._clientOptions.locale,merchantId:"merchantId"}),u.addEventListener(this.loggedOutView.container,"click",u.bind(this._handleContainerClick,this)),u.addEventListener(this.loggedInView.logoutNode,"click",u.bind(this._handleLogout,this)))},o.prototype._createBusSubscribers=function(){s.subscribe("getClientToken",u.bind(this._handleGetClientToken,this)),s.subscribe("getClientOptions",u.bind(this._handleGetClientOptions,this)),s.subscribe("closePayPalModal",u.bind(this._handleCloseMessage,this)),s.subscribe("receivePayPalData",u.bind(this._handleSuccessfulAuthentication,this))},o.prototype._createPaymentMethodNonceInputField=function(){var t=document.createElement("input");return t.name="payment_method_nonce",t.type="hidden",this.container.appendChild(t)},o.prototype._createFrame=function(){var t,e=document.createElement("iframe");return this._isHermesCapable()?(t=f.ARIES_FRAME_NAME,e.style.background="#FFFFFF"):t=f.FRAME_NAME,e.src=this.getViewerUrl(),e.id=t,e.name=t,e.allowTransparency=!0,e.height="100%",e.width="100%",e.frameBorder=0,e.style.position=h.isMobile()?"absolute":"fixed",e.style.top=0,e.style.left=0,e.style.bottom=0,e.style.zIndex=20001,e.style.padding=0,e.style.margin=0,e.style.border=0,e.style.outline="none",e},o.prototype._removeFrame=function(t){t=t||document.body,this.frame&&t.contains(this.frame)&&(t.removeChild(this.frame),
5
+ this._unlockMerchantWindowSize())},o.prototype._insertFrame=function(){this.insertFrameFunction?this.insertFrameFunction(this.getViewerUrl()):(this.frame=this._createFrame(),document.body.appendChild(this.frame)),this._lockMerchantWindowSize()},o.prototype._handleContainerClick=function(t){function e(t){return t.className.match(/paypal-button(?!-widget)/)||"braintree-paypal-button"===t.id}var n=t.target||t.srcElement;(e(n)||e(n.parentNode))&&(t.preventDefault?t.preventDefault():t.returnValue=!1,this._open())},o.prototype._setMerchantPageDefaultStyles=function(){this.merchantPageDefaultStyles=i()},o.prototype._open=function(){this._isHermesCapable()&&this._addCorrelationIdToClientToken(),h.isPopupSupported()?this._openPopup():this._openModal()},o.prototype._close=function(){h.isPopupSupported()?this._closePopup():this._closeModal()},o.prototype._openModal=function(){this._removeFrame(),this._insertFrame()},o.prototype._isHermesCapable=function(){return!!this._clientOptions.singleUse&&!!this._clientOptions.amount&&!!this._clientOptions.currency},o.prototype._openPopup=function(){var t,e,n,r=[],i=window.outerWidth||document.documentElement.clientWidth,o=window.outerHeight||document.documentElement.clientHeight,a="undefined"==typeof window.screenY?window.screenTop:window.screenY,s="undefined"==typeof window.screenX?window.screenLeft:window.screenX;this._isHermesCapable()?(t=f.ARIES_POPUP_NAME,n=f.ARIES_POPUP_HEIGHT,e=f.ARIES_POPUP_WIDTH):(t=f.POPUP_NAME,n=f.POPUP_HEIGHT,e=f.POPUP_WIDTH);var u=(i-e)/2+s,l=(o-n)/2+a;return r.push("height="+n),r.push("width="+e),r.push("top="+l),r.push("left="+u),r.push(f.POPUP_OPTIONS),this.popup=window.open(this.getViewerUrl(),t,r.join(",")),h.isOverlaySupported()&&(this.overlayView=new p(this.popup,this._clientToken.paypal.assetsUrl),this.overlayView.render()),this.popup.focus(),this.popup},o.prototype._addCorrelationIdToClientToken=function(){this._clientToken.correlationId=m.generateUid()},o.prototype._createProxyFrame=function(){var t=document.createElement("iframe");return t.src=this.getProxyUrl(),t.id=f.BRIDGE_FRAME_NAME,t.name=f.BRIDGE_FRAME_NAME,t.allowTransparency=!0,t.height=0,t.width=0,t.frameBorder=0,t.style.position="static",t.style.padding=0,t.style.margin=0,t.style.border=0,t.style.outline="none",t},o.prototype._insertProxyFrame=function(){this.proxyFrame=this._createProxyFrame(),document.body.appendChild(this.proxyFrame)},o.prototype._closeModal=function(){this._removeFrame()},o.prototype._closePopup=function(){this.popup&&(this.popup.close(),this.popup=null),this.overlayView&&h.isOverlaySupported()&&this.overlayView.remove()},o.prototype._clientTokenData=function(){return{analyticsUrl:this._clientToken.analytics?this._clientToken.analytics.url:void 0,authorizationFingerprint:this._clientToken.authorizationFingerprint,clientApiUrl:this._clientToken.clientApiUrl,displayName:this._clientToken.paypal.displayName,paypalBaseUrl:this._clientToken.paypal.assetsUrl,paypalClientId:this._clientToken.paypal.clientId,paypalPrivacyUrl:this._clientToken.paypal.privacyUrl,paypalUserAgreementUrl:this._clientToken.paypal.userAgreementUrl,unvettedMerchant:this._clientToken.paypal.unvettedMerchant,payeeEmail:this._clientToken.paypal.payeeEmail,correlationId:this._clientToken.correlationId,offline:this._clientOptions.offline||this._clientToken.paypal.environmentNoNetwork,sdkVersion:this._clientToken.sdkVersion,merchantAppId:this._clientToken.merchantAppId}},o.prototype._handleGetClientToken=function(t){t(this._clientTokenData())},o.prototype._clientOptionsData=function(){return{locale:this._clientOptions.locale||"en_us",onetime:this._clientOptions.singleUse||!1,integration:this._clientOptions.integration||"paypal",enableShippingAddress:this._clientOptions.enableShippingAddress||!1,enableBillingAddress:this._clientOptions.enableBillingAddress||!1,enableHermes:this._isHermesCapable(),amount:this._clientOptions.amount||null,currency:this._clientOptions.currency||null,shippingAddressOverride:this._clientOptions.shippingAddressOverride||null,enableCORS:this._clientOptions.enableCORS}},o.prototype._handleGetClientOptions=function(t){t(this._clientOptionsData())},o.prototype._handleSuccessfulAuthentication=function(t){this._close(),t.type=f.NONCE_TYPE,u.isFunction(this.paymentMethodNonceInputField)?this.paymentMethodNonceInputField(t.nonce):(this._showLoggedInContent(t.details.email),this._setNonceInputValue(t.nonce)),u.isFunction(this.onSuccess)&&this.onSuccess(t)},o.prototype._lockMerchantWindowSize=function(){this._setMerchantPageDefaultStyles(),document.documentElement.style.height="100%",document.documentElement.style.overflow="hidden",document.body.style.height="100%",document.body.style.overflow="hidden"},o.prototype._unlockMerchantWindowSize=function(){this.merchantPageDefaultStyles&&(document.documentElement.style.height=this.merchantPageDefaultStyles.html.styles.height,document.documentElement.style.overflow=this.merchantPageDefaultStyles.html.styles.overflow,document.body.style.height=this.merchantPageDefaultStyles.body.styles.height,document.body.style.overflow=this.merchantPageDefaultStyles.body.styles.overflow)},o.prototype._handleCloseMessage=function(){this._removeFrame()},o.prototype._showLoggedInContent=function(t){this.loggedOutView.hide(),d.setTextContent(this.loggedInView.emailNode,t),this.loggedInView.show()},o.prototype._handleLogout=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1,this.loggedInView.hide(),this.loggedOutView.show(),this._setNonceInputValue(""),u.isFunction(this.onCancelled)&&this.onCancelled()},o.prototype._setNonceInputValue=function(t){this.paymentMethodNonceInputField.value=t},e.exports=o},{"../shared/constants":152,"../shared/get-locale":154,"../shared/util/browser":159,"../shared/util/dom":160,"../shared/util/util":161,"./logged-in-view":149,"./logged-out-view":150,"./overlay-view":151,"braintree-api":109,"braintree-bus":138,"braintree-utilities":147}],149:[function(t,e,n){function r(t){this.options=t,this.container=this.createViewContainer(),this.createPayPalName(),this.emailNode=this.createEmailNode(),this.logoutNode=this.createLogoutNode()}var i=t("../shared/constants");r.prototype.createViewContainer=function(){var t=document.createElement("div");t.id="braintree-paypal-loggedin";var e=["display: none","max-width: 500px","overflow: hidden","padding: 16px","background-image: url("+this.options.assetsUrl+"/pwpp/"+i.VERSION+"/images/paypal-small.png)","background-image: url("+this.options.assetsUrl+"/pwpp/"+i.VERSION+"/images/paypal-small.svg), none","background-position: 20px 50%","background-repeat: no-repeat","background-size: 13px 15px","border-top: 1px solid #d1d4d6","border-bottom: 1px solid #d1d4d6"].join(";");return t.style.cssText=e,this.options.container.appendChild(t),t},r.prototype.createPayPalName=function(){var t=document.createElement("span");t.id="bt-pp-name",t.innerHTML="PayPal";var e=["color: #283036","font-size: 13px","font-weight: 800",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"margin-left: 36px","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},r.prototype.createEmailNode=function(){var t=document.createElement("span");t.id="bt-pp-email";var e=["color: #6e787f","font-size: 13px",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"margin-left: 5px","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},r.prototype.createLogoutNode=function(){var t=document.createElement("button");t.id="bt-pp-cancel",t.innerHTML="Cancel";var e=["color: #3d95ce","font-size: 11px",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"line-height: 20px","margin: 0 0 0 25px","padding: 0","background-color: transparent","border: 0","cursor: pointer","text-decoration: underline","float: right","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},r.prototype.show=function(){this.container.style.display="block"},r.prototype.hide=function(){this.container.style.display="none"},e.exports=r},{"../shared/constants":152}],150:[function(t,e,n){function r(t){this.options=t,this.assetsUrl=this.options.assetsUrl,this.container=this.createViewContainer(),this.options.isCheckout?this.createCheckoutWithPayPalButton():this.createPayWithPayPalButton()}var i=(t("braintree-utilities"),t("../shared/constants")),o=t("../shared/get-locale");r.prototype.createViewContainer=function(){var t=document.createElement("div");return t.id="braintree-paypal-loggedout",this.options.container.appendChild(t),t},r.prototype.createPayWithPayPalButton=function(){var t=document.createElement("a");t.id="braintree-paypal-button",t.href="#";var e=["display: block","width: 115px","height: 44px","overflow: hidden"].join(";");t.style.cssText=e;var n=new Image;n.src=this.assetsUrl+"/pwpp/"+i.VERSION+"/images/pay-with-paypal.png",n.setAttribute("alt","Pay with PayPal");var r=["max-width: 100%","display: block","width: 100%","height: 100%","outline: none","border: 0"].join(";");n.style.cssText=r,t.appendChild(n),this.container.appendChild(t)},r.prototype.createCheckoutWithPayPalButton=function(){var t=document.createElement("script");t.src="//www.paypalobjects.com/api/button.js",t.async=!0,t.setAttribute("data-merchant",this.options.merchantId),t.setAttribute("data-button","checkout"),t.setAttribute("data-type","button"),t.setAttribute("data-width","150"),t.setAttribute("data-height","44"),t.setAttribute("data-lc",o(this.options.locale)),this.container.appendChild(t)},r.prototype.show=function(){this.container.style.display="block"},r.prototype.hide=function(){this.container.style.display="none"},e.exports=r},{"../shared/constants":152,"../shared/get-locale":154,"braintree-utilities":147}],151:[function(t,e,n){function r(t,e){this.popup=t,this.assetsUrl=e,this.spriteSrc=this.assetsUrl+"/pwpp/"+o.VERSION+"/images/pp_overlay_sprite.png",this._create(),this._setupEvents(),this._pollForPopup()}var i=t("braintree-utilities"),o=t("../shared/constants");r.prototype.render=function(){document.body.contains(this.el)||document.body.appendChild(this.el)},r.prototype.remove=function(){document.body.contains(this.el)&&document.body.removeChild(this.el)},r.prototype._create=function(){this.el=document.createElement("div"),this.el.className="bt-overlay",this._setStyles(this.el,["z-index: 20001","position: fixed","top: 0","left: 0","height: 100%","width: 100%","text-align: center","background: #000","background: rgba(0,0,0,0.7)",'-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=52)"']),this.el.appendChild(this._createCloseIcon()),this.el.appendChild(this._createMessage())},r.prototype._createCloseIcon=function(){return this.closeIcon=document.createElement("div"),this.closeIcon.className="bt-close-overlay",this._setStyles(this.closeIcon,["position: absolute","top: 10px","right: 10px","cursor: pointer","background: url("+this.spriteSrc+") no-repeat 0 -67px","height: 14px","width: 14px"]),this.closeIcon},r.prototype._createMessage=function(){var t=document.createElement("div");return this._setStyles(t,["position: relative","top: 50%","max-width: 350px",'font-family: "HelveticaNeue", "HelveticaNeue-Light", "Helvetica Neue Light", helvetica, arial, sans-serif',"font-size: 14px","line-height: 20px","margin: -70px auto 0"]),t.appendChild(this._createLogo()),t.appendChild(this._createExplanation()),t.appendChild(this._createFocusLink()),t},r.prototype._createExplanation=function(){var t=document.createElement("div");return this._setStyles(t,["color: #FFF","margin-bottom: 20px"]),t.innerHTML="Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",t},r.prototype._createLogo=function(){var t=document.createElement("div");return this._setStyles(t,["background: url("+this.spriteSrc+") no-repeat 0 0","width: 94px","height: 25px","margin: 0 auto 26px auto"]),t},r.prototype._createFocusLink=function(){return this.focusLink=document.createElement("a"),this._setStyles(this.focusLink,["color: #009be1","cursor: pointer"]),this.focusLink.innerHTML="Continue",this.focusLink},r.prototype._setStyles=function(t,e){var n=e.join(";");t.style.cssText=n},r.prototype._setupEvents=function(){i.addEventListener(this.closeIcon,"click",i.bind(this._handleClose,this)),i.addEventListener(this.focusLink,"click",i.bind(this._handleFocus,this))},r.prototype._handleClose=function(t){t.preventDefault(),this.remove(),this.popup.close()},r.prototype._handleFocus=function(t){t.preventDefault(),this.popup.focus()},r.prototype._pollForPopup=function(){var t=setInterval(i.bind(function(){this.popup&&this.popup.closed&&(clearInterval(t),this.remove())},this),100)},e.exports=r},{"../shared/constants":152,"braintree-utilities":147}],152:[function(t,e,n){var r="1.5.3";n.VERSION=r,n.POPUP_NAME="braintree_paypal_popup",n.ARIES_POPUP_NAME="PPFrameRedirect",n.FRAME_NAME="braintree-paypal-frame",n.ARIES_FRAME_NAME="PPFrameRedirect",n.POPUP_PATH="/pwpp/"+r+"/html/braintree-frame.html",n.POPUP_OPTIONS="resizable,scrollbars",n.POPUP_HEIGHT=470,n.POPUP_WIDTH=410,n.ARIES_POPUP_HEIGHT=535,n.ARIES_POPUP_WIDTH=450,n.BRIDGE_FRAME_NAME="bt-proxy-frame",n.ARIES_SUPPORTED_CURRENCIES=["USD","GBP","EUR","AUD","CAD","DKK","NOK","PLN","SEK","CHF","TRY"],n.ARIES_SUPPORTED_COUNTRIES=["US","GB","AU","CA","ES","FR","DE","IT","NL","NO","PL","CH","TR","DK","BE","AT"],n.NONCE_TYPE="PayPalAccount",n.ILLEGAL_XHR_ERROR="Illegal XHR request attempted"},{}],153:[function(t,e,n){"use strict";e.exports={us:"en_us",gb:"en_uk",uk:"en_uk",de:"de_de",fr:"fr_fr",it:"it_it",es:"es_es",ca:"en_ca",au:"en_au",at:"de_de",be:"en_us",ch:"de_de",dk:"da_dk",nl:"nl_nl",no:"no_no",pl:"pl_pl",se:"sv_se",tr:"tr_tr",bg:"en_us",cy:"en_us",hr:"en_us",is:"en_us",kh:"en_us",mt:"en_us",my:"en_us",ru:"ru_ru"}},{}],154:[function(t,e,n){"use strict";function r(t){return-1!==t.indexOf("_")&&5===t.length}function i(t){var e;for(var n in a)a.hasOwnProperty(n)&&(n===t?e=a[n]:a[n]===t&&(e=a[n]));return e}function o(t){var e;if(t=t?t.toLowerCase():"us",t=t.replace(/-/g,"_"),e=r(t)?t:i(t)){var n=e.split("_");return[n[0],n[1].toUpperCase()].join("_")}return"en_US"}var a=t("../shared/data/country-code-lookup");e.exports=o},{"../shared/data/country-code-lookup":153}],155:[function(t,e,n){function r(){return h.matchUserAgent("Android")&&!i()}function i(){return h.matchUserAgent("Chrome")||h.matchUserAgent("CriOS")}function o(){return h.matchUserAgent("Firefox")}function a(){return h.matchUserAgent("Trident")||h.matchUserAgent("MSIE")}function s(){return h.matchUserAgent("Opera")||h.matchUserAgent("OPR")}function u(){return s()&&"[object OperaMini]"===f.call(window.operamini)}function l(){return h.matchUserAgent("Safari")&&!i()&&!r()}function c(){return d.isIos()&&!i()&&!l()}function p(){var t=/Version\/[\w\.]+ Chrome\/[\w\.]+ Mobile/;return d.isAndroid()&&h.matchUserAgent(t)}var h=t("./useragent"),d=t("./platform"),f=Object.prototype.toString;e.exports={isAndroid:r,isChrome:i,isFirefox:o,isIE:a,isOpera:s,isOperaMini:u,isSafari:l,isIosWebView:c,isAndroidWebView:p}},{"./platform":157,"./useragent":158}],156:[function(t,e,n){function r(){return!i()&&(s.isAndroid()||s.isIpod()||s.isIphone()||a.matchUserAgent("IEMobile"))}function i(){return s.isIpad()||s.isAndroid()&&!a.matchUserAgent("Mobile")}function o(){return!r()&&!i()}var a=t("./useragent"),s=t("./platform");e.exports={isMobile:r,isTablet:i,isDesktop:o}},{"./platform":157,"./useragent":158}],157:[function(t,e,n){function r(){return u.matchUserAgent("Android")}function i(){return u.matchUserAgent("iPad")}function o(){return u.matchUserAgent("iPod")}function a(){return u.matchUserAgent("iPhone")&&!o()}function s(){return i()||o()||a()}var u=t("./useragent");e.exports={isAndroid:r,isIpad:i,isIpod:o,isIphone:a,isIos:s}},{"./useragent":158}],158:[function(t,e,n){function r(){return o}function i(t){var e=n.getNativeUserAgent(),r=e.match(t);return r?!0:!1}var o=window.navigator.userAgent;n.getNativeUserAgent=r,n.matchUserAgent=i},{}],159:[function(t,e,n){function r(){return i()&&window.outerWidth<600}function i(){return m.test(f)}function o(){return!!window.postMessage}function a(){if(c.isOperaMini())return!1;if(p.isDesktop())return!0;if(p.isMobile()||p.isTablet()){if(c.isIE())return!1;if(h.isAndroid())return c.isAndroidWebView()?!1:!0;if(h.isIos())return c.isChrome()||c.isSafari()&&d.matchUserAgent(/OS (?:8_1|8_0|8)(?!_\d)/i)||c.isIosWebView()?!1:!0}return!1}function s(){if(c.isIE()&&d.matchUserAgent(/MSIE 8\.0/))return!1;try{return window.self===window.top}catch(t){return!1}}function u(){return c.isIE()}function l(){var t=null,e="";try{new ActiveXObject("")}catch(n){e=n.name}try{t=!!new ActiveXObject("htmlfile")}catch(n){t=!1}return t="ReferenceError"!==e&&t===!1?!1:!0,!t}var c=t("../useragent/browser"),p=t("../useragent/device"),h=t("../useragent/platform"),d=t("../useragent/useragent"),f=window.navigator.userAgent,m=/[Mm]obi|tablet|iOS|Android|IEMobile|Windows\sPhone/;e.exports={isMobile:r,isMobileDevice:i,detectedPostMessage:o,isPopupSupported:a,isOverlaySupported:s,isProxyFrameRequired:u,isMetroBrowser:l}},{"../useragent/browser":155,"../useragent/device":156,"../useragent/platform":157,"../useragent/useragent":158}],160:[function(t,e,n){function r(t,e){var n="innerText";document&&document.body&&"textContent"in document.body&&(n="textContent"),t[n]=e}e.exports={setTextContent:r}},{}],161:[function(t,e,n){function r(){for(var t="",e=0;32>e;e++){var n=Math.floor(16*Math.random());t+=n.toString(16)}return t}function i(t){return/^(true|1)$/i.test(t)}function o(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&apos;")}function a(t){var e=t.indexOf("?"),n={};if(e>=0&&(t=t.substr(e+1)),0!==t.length){for(var r=t.split("&"),i=0,o=r.length;o>i;i++){var a=r[i],s=a.indexOf("="),u=a.substr(0,s),l=a.substr(s+1),c=decodeURIComponent(l);c=c.replace(/</g,"&lt;").replace(/>/g,"&gt;"),"false"===c&&(c=!1),(void 0===c||"true"===c)&&(c=!0),n[u]=c}return n}}function s(t){return t&&"[object Function]"===Object.prototype.toString.call(t)}function u(t){t.preventDefault?t.preventDefault():t.returnValue=!1}var l="function"==typeof String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/,"")},c="function"==typeof window.btoa?function(t){return window.btoa(t)}:function(t){for(var e,n,r,i,o,a,s,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;c<t.length;)e=t.charCodeAt(c++),n=t.charCodeAt(c++),r=t.charCodeAt(c++),i=e>>2,o=(3&e)<<4|n>>4,a=(15&n)<<2|r>>6,s=63&r,isNaN(n)?a=s=64:isNaN(r)&&(s=64),l=l+u.charAt(i)+u.charAt(o)+u.charAt(a)+u.charAt(s);return l};e.exports={trim:l,btoa:c,generateUid:r,castToBoolean:i,htmlEscape:o,parseUrlParams:a,isFunction:s,preventDefault:u}},{}],162:[function(t,e,n){"use strict";function r(t){this.host=t||window,this.handlers=[],i.addEventListener(this.host,"message",i.bind(this.receive,this))}var i=t("braintree-utilities");r.prototype.receive=function(t){var e,n,i,o;try{i=JSON.parse(t.data)}catch(a){return}for(o=i.type,n=new r.Message(this,t.source,i.data),e=0;e<this.handlers.length;e++)this.handlers[e].type===o&&this.handlers[e].handler(n)},r.prototype.send=function(t,e,n){t.postMessage(JSON.stringify({type:e,data:n}),"*")},r.prototype.register=function(t,e){this.handlers.push({type:t,handler:e})},r.prototype.unregister=function(t,e){for(var n=this.handlers.length-1;n>=0;n--)if(this.handlers[n].type===t&&this.handlers[n].handler===e)return this.handlers.splice(n,1)},r.Message=function(t,e,n){this.bus=t,this.source=e,this.content=n},r.Message.prototype.reply=function(t,e){this.bus.send(this.source,t,e)},e.exports=r},{"braintree-utilities":172}],163:[function(t,e,n){"use strict";function r(t,e){this.bus=t,this.target=e,this.handlers=[],this.bus.register("publish",i.bind(this._handleMessage,this))}var i=t("braintree-utilities");r.prototype._handleMessage=function(t){var e,n=t.content,r=this.handlers[n.channel];if("undefined"!=typeof r)for(e=0;e<r.length;e++)r[e](n.data)},r.prototype.publish=function(t,e){this.bus.send(this.target,"publish",{channel:t,data:e})},r.prototype.subscribe=function(t,e){this.handlers[t]=this.handlers[t]||[],this.handlers[t].push(e)},r.prototype.unsubscribe=function(t,e){var n,r=this.handlers[t];if("undefined"!=typeof r)for(n=0;n<r.length;n++)r[n]===e&&r.splice(n,1)},e.exports=r},{"braintree-utilities":172}],164:[function(t,e,n){"use strict";function r(t){this.bus=t,this.frames=[],this.handlers=[]}r.prototype.subscribe=function(t,e){this.handlers[t]=this.handlers[t]||[],this.handlers[t].push(e)},r.prototype.registerFrame=function(t){this.frames.push(t)},r.prototype.unregisterFrame=function(t){for(var e=0;e<this.frames.length;e++)this.frames[e]===t&&this.frames.splice(e,1)},r.prototype.publish=function(t,e){var n,r=this.handlers[t];if("undefined"!=typeof r)for(n=0;n<r.length;n++)r[n](e);for(n=0;n<this.frames.length;n++)this.bus.send(this.frames[n],"publish",{channel:t,data:e})},r.prototype.unsubscribe=function(t,e){var n,r=this.handlers[t];if("undefined"!=typeof r)for(n=0;n<r.length;n++)r[n]===e&&r.splice(n,1)},e.exports=r},{}],165:[function(t,e,n){"use strict";function r(t,e){this.bus=t,this.target=e||window.parent,this.counter=0,this.callbacks={},this.bus.register("rpc_response",i.bind(this._handleResponse,this))}var i=t("braintree-utilities");r.prototype._handleResponse=function(t){var e=t.content,n=this.callbacks[e.id];"function"==typeof n&&(n.apply(null,e.response),delete this.callbacks[e.id])},r.prototype.invoke=function(t,e,n){var r=this.counter++;this.callbacks[r]=n,this.bus.send(this.target,"rpc_request",{id:r,method:t,args:e})},e.exports=r},{"braintree-utilities":172}],166:[function(t,e,n){"use strict";function r(t){this.bus=t,this.methods={},this.bus.register("rpc_request",i.bind(this._handleRequest,this))}var i=t("braintree-utilities");r.prototype._handleRequest=function(t){var e,n=t.content,r=n.args||[],i=this.methods[n.method];"function"==typeof i&&(e=function(){t.reply("rpc_response",{id:n.id,response:Array.prototype.slice.call(arguments)})},r.push(e),i.apply(null,r))},r.prototype.define=function(t,e){this.methods[t]=e},e.exports=r},{"braintree-utilities":172}],167:[function(t,e,n){var r=t("./lib/message-bus"),i=t("./lib/pubsub-client"),o=t("./lib/pubsub-server"),a=t("./lib/rpc-client"),s=t("./lib/rpc-server");e.exports={MessageBus:r,PubsubClient:i,PubsubServer:o,RPCClient:a,RPCServer:s}},{"./lib/message-bus":162,"./lib/pubsub-client":163,"./lib/pubsub-server":164,"./lib/rpc-client":165,"./lib/rpc-server":166}],168:[function(t,e,n){"use strict";function r(t,e){if(e=e||"["+t+"] is not a valid DOM Element",t&&t.nodeType&&1===t.nodeType)return t;if(t&&window.jQuery&&t instanceof jQuery&&0!==t.length)return t[0];if("string"==typeof t&&document.getElementById(t))return document.getElementById(t);throw new Error(e)}e.exports={normalizeElement:r}},{}],169:[function(t,e,n){"use strict";function r(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}function i(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)}e.exports={removeEventListener:i,addEventListener:r}},{}],170:[function(t,e,n){"use strict";function r(t){return"[object Function]"===Object.prototype.toString.call(t)}function i(t,e){return function(){t.apply(e,arguments)}}e.exports={bind:i,isFunction:r}},{}],171:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{dup:27}],172:[function(t,e,n){arguments[4][28][0].apply(n,arguments)},{"./lib/dom":168,"./lib/events":169,"./lib/fn":170,"./lib/url":171,dup:28}],173:[function(t,e,n){function r(){if(!s){s=!0;for(var t,e=a.length;e;){t=a,a=[];for(var n=-1;++n<e;)t[n]();e=a.length}s=!1}}function i(){}var o=e.exports={},a=[],s=!1;o.nextTick=function(t){a.push(t),s||setTimeout(r,0)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=i,o.addListener=i,o.once=i,o.off=i,o.removeListener=i,o.removeAllListeners=i,o.emit=i,o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],174:[function(t,e,n){e.exports={number:t("./src/card-number"),expirationDate:t("./src/expiration-date"),expirationMonth:t("./src/expiration-month"),expirationYear:t("./src/expiration-year"),cvv:t("./src/cvv"),postalCode:t("./src/postal-code")}},{"./src/card-number":188,"./src/cvv":189,"./src/expiration-date":190,"./src/expiration-month":191,"./src/expiration-year":192,"./src/postal-code":195}],175:[function(t,e,n){arguments[4][78][0].apply(n,arguments)},{dup:78,"lodash._baseassign":176,"lodash._createassigner":178,"lodash.keys":182}],176:[function(t,e,n){arguments[4][79][0].apply(n,arguments)},{dup:79,"lodash._basecopy":177,"lodash.keys":182}],177:[function(t,e,n){arguments[4][80][0].apply(n,arguments)},{dup:80}],178:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{dup:81,"lodash._bindcallback":179,"lodash._isiterateecall":180,"lodash.restparam":181}],179:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],180:[function(t,e,n){arguments[4][83][0].apply(n,arguments)},{dup:83}],181:[function(t,e,n){arguments[4][84][0].apply(n,arguments)},{dup:84}],182:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48,"lodash._getnative":183,"lodash.isarguments":184,"lodash.isarray":185}],183:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],184:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],185:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46}],186:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function i(t){return"number"==typeof t||r(t)&&s.call(t)==o}var o="[object Number]",a=Object.prototype,s=a.toString;e.exports=i},{}],187:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],188:[function(t,e,n){function r(t,e,n){return a({},{card:t,isPotentiallyValid:e,isValid:n})}function i(t){var e,n,i,a,c;if(l(t)&&(t=String(t)),!o(t))return r(null,!1,!1);if(t=t.replace(/\-|\s/g,""),!/^\d*$/.test(t))return r(null,!1,!1);if(e=u(t),0===e.length)return r(null,!1,!1);if(1!==e.length)return r(null,!0,!1);for(n=e[0],i="unionpay"===n.type?!0:s(t),a=0;a<n.lengths.length;a++)if(n.lengths[a]===t.length)return r(n,i,i);return c=Math.max.apply(null,n.lengths),t.length<c?r(n,!0,!1):r(n,!1,!1)}var o=t("lodash.isstring"),a=t("lodash.assign"),s=t("./luhn-10"),u=t("credit-card-type"),l=t("lodash.isnumber");e.exports=i},{"./luhn-10":193,"credit-card-type":196,"lodash.assign":175,"lodash.isnumber":186,"lodash.isstring":187}],189:[function(t,e,n){function r(t,e){return{isValid:t,isPotentiallyValid:e}}function i(t,e){return e=e||a,o(t)&&/^\d*$/.test(t)?t.length===e?r(!0,!0):t.length<e?r(!1,!0):t.length>e?r(!1,!1):r(!0,!0):r(!1,!1)}var o=t("lodash.isstring"),a=3;e.exports=i},{"lodash.isstring":187}],190:[function(t,e,n){function r(t,e,n,r){return{isValid:t,isPotentiallyValid:e,month:n,year:r}}function i(t){var e,n,i,l;if(!u(t))return r(!1,!1,null,null);if(t=t.replace(/^(\d\d) (\d\d(\d\d)?)$/,"$1/$2"),e=o(t),n=a(e.month),i=s(e.year),i.isValid){if(i.isCurrentYear)return l=n.isValidForThisYear,r(l,l,e.month,e.year);if(n.isValid)return r(!0,!0,e.month,e.year)}return n.isPotentiallyValid&&i.isPotentiallyValid?r(!1,!0,null,null):r(!1,!1,null,null)}var o=t("./parse-date"),a=t("./expiration-month"),s=t("./expiration-year"),u=t("lodash.isstring");e.exports=i},{"./expiration-month":191,"./expiration-year":192,"./parse-date":194,"lodash.isstring":187}],191:[function(t,e,n){function r(t,e,n){return{isValid:t,isPotentiallyValid:e,isValidForThisYear:n||!1}}function i(t){var e,n,i=(new Date).getMonth()+1;return o(t)?""===t.replace(/\s/g,"")||"0"===t?r(!1,!0):/^\d*$/.test(t)?(e=parseInt(t,10),isNaN(t)?r(!1,!1):(n=e>0&&13>e,r(n,n,n&&e>=i))):r(!1,!1):r(!1,!1)}var o=t("lodash.isstring");e.exports=i},{"lodash.isstring":187}],192:[function(t,e,n){function r(t,e,n){return{isValid:t,isPotentiallyValid:e,isCurrentYear:n||!1}}function i(t){var e,n,i,s,u,l,c;return o(t)?""===t.replace(/\s/g,"")?r(!1,!0):/^\d*$/.test(t)?(s=t.length,2>s?r(!1,!0):(n=(new Date).getFullYear(),3===s?(i=t.slice(0,2),e=String(n).slice(0,2),r(!1,i===e)):s>4?r(!1,!1):(t=parseInt(t,10),u=Number(String(n).substr(2,2)),2===s?(c=u===t,l=t>=u&&u+a>=t):4===s&&(c=n===t,l=t>=n&&n+a>=t),r(l,l,c)))):r(!1,!1):r(!1,!1)}var o=t("lodash.isstring"),a=19;e.exports=i},{"lodash.isstring":187}],193:[function(t,e,n){e.exports=function(t,e,n,r,i){for(r=+t[e=t.length-1],i=0;e--;)n=+t[e],r+=++i%2?2*n%10+(n>4):n;return!(r%10)}},{}],194:[function(t,e,n){function r(t){var e,n;return t.match("/")?(t=t.split(/\s*\/\s*/g),{month:t[0],year:t.slice(1).join()}):(n="0"===t[0]||t.length>5||4===t.length||3===t.length?2:1,e=t.substr(0,n),{month:e,year:t.substr(e.length,4)})}e.exports=r},{}],195:[function(t,e,n){function r(t,e){return{isValid:t,isPotentiallyValid:e}}function i(t){return o(t)?t.length<4?r(!1,!0):r(!0,!0):r(!1,!1)}var o=t("lodash.isstring");e.exports=i},{"lodash.isstring":187}],196:[function(t,e,n){var r=t("lodash.isstring"),i=t("lodash.clonedeep"),o=[{niceType:"Visa",type:"visa",pattern:"^4\\d*$",gaps:[4,8,12],lengths:[16],code:{name:"CVV",size:3}},{niceType:"MasterCard",type:"master-card",pattern:"^5([1-5]\\d*)?$",gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},{niceType:"American Express",type:"american-express",pattern:"^3([47]\\d*)?$",isAmex:!0,gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},{niceType:"DinersClub",type:"diners-club",pattern:"^3((0([0-5]\\d*)?)|[689]\\d*)?$",gaps:[4,10],lengths:[14],code:{name:"CVV",size:3}},{niceType:"Discover",type:"discover",pattern:"^6(0|01|011\\d*|5\\d*|4|4[4-9]\\d*)?$",gaps:[4,8,12],lengths:[16],code:{name:"CID",size:3}},{niceType:"JCB",type:"jcb",pattern:"^((2|21|213|2131\\d*)|(1|18|180|1800\\d*)|(3|35\\d*))$",gaps:[4,8,12],lengths:[16],code:{name:"CVV",size:3}},{niceType:"UnionPay",type:"unionpay",pattern:"^6(2\\d*)?$",gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVN",size:3}},{niceType:"Maestro",type:"maestro",pattern:"^((5((0|[6-9])\\d*)?)|(6|6[37]\\d*))$",gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}}];e.exports=function(t){var e,n,a=[];if(!r(t))return a;if(""===t)return i(o);for(e=0;e<o.length;e++)n=o[e],RegExp(n.pattern).test(t)&&a.push(i(n));return a}},{"lodash.clonedeep":197,"lodash.isstring":209}],197:[function(t,e,n){function r(t,e,n){return"function"==typeof e?i(t,!0,o(e,n,3)):i(t,!0)}var i=t("lodash._baseclone"),o=t("lodash._bindcallback");e.exports=r},{"lodash._baseclone":198,"lodash._bindcallback":208}],198:[function(t,e,n){(function(n){function r(t,e,n,o,d,m,y){var g;if(n&&(g=d?n(t,o,d):n(t)),void 0!==g)return g;if(!l(t))return t;var b=f(t);if(b){if(g=a(t),!e)return c(t,g)}else{var w=z.call(t),x=w==_;if(w!=E&&w!=v&&(!x||d))return V[w]?u(t,w,e):d?t:{};if(g=s(x?{}:t),!e)return h(g,t)}m||(m=[]),y||(y=[]);for(var C=m.length;C--;)if(m[C]==t)return y[C];return m.push(t),y.push(g),(b?p:i)(t,function(i,o){g[o]=r(i,e,n,o,t,m,y)}),g}function i(t,e){return d(t,e,m)}function o(t){var e=new B(t.byteLength),n=new q(e);return n.set(new q(t)),e}function a(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&H.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function s(t){var e=t.constructor;return"function"==typeof e&&e instanceof e||(e=Object),new e}function u(t,e,n){var r=t.constructor;switch(e){case O:return o(t);case g:case b:return new r(+t);case T:case I:case M:case j:case N:case R:case U:case F:case D:var i=t.buffer;return new r(n?o(i):i,t.byteOffset,t.length);case C:case P:return new r(t);case k:var a=new r(t.source,L.exec(t));
6
+
7
+ a.lastIndex=t.lastIndex}return a}function l(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var c=t("lodash._arraycopy"),p=t("lodash._arrayeach"),h=t("lodash._baseassign"),d=t("lodash._basefor"),f=t("lodash.isarray"),m=t("lodash.keys"),v="[object Arguments]",y="[object Array]",g="[object Boolean]",b="[object Date]",w="[object Error]",_="[object Function]",x="[object Map]",C="[object Number]",E="[object Object]",k="[object RegExp]",S="[object Set]",P="[object String]",A="[object WeakMap]",O="[object ArrayBuffer]",T="[object Float32Array]",I="[object Float64Array]",M="[object Int8Array]",j="[object Int16Array]",N="[object Int32Array]",R="[object Uint8Array]",U="[object Uint8ClampedArray]",F="[object Uint16Array]",D="[object Uint32Array]",L=/\w*$/,V={};V[v]=V[y]=V[O]=V[g]=V[b]=V[T]=V[I]=V[M]=V[j]=V[N]=V[C]=V[E]=V[k]=V[P]=V[R]=V[U]=V[F]=V[D]=!0,V[w]=V[_]=V[x]=V[S]=V[A]=!1;var $=Object.prototype,H=$.hasOwnProperty,z=$.toString,B=n.ArrayBuffer,q=n.Uint8Array;e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._arraycopy":199,"lodash._arrayeach":200,"lodash._baseassign":201,"lodash._basefor":203,"lodash.isarray":204,"lodash.keys":205}],199:[function(t,e,n){function r(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}e.exports=r},{}],200:[function(t,e,n){function r(t,e){for(var n=-1,r=t.length;++n<r&&e(t[n],n,t)!==!1;);return t}e.exports=r},{}],201:[function(t,e,n){arguments[4][79][0].apply(n,arguments)},{dup:79,"lodash._basecopy":202,"lodash.keys":205}],202:[function(t,e,n){arguments[4][80][0].apply(n,arguments)},{dup:80}],203:[function(t,e,n){function r(t){return function(e,n,r){for(var o=i(e),a=r(e),s=a.length,u=t?s:-1;t?u--:++u<s;){var l=a[u];if(n(o[l],l,o)===!1)break}return e}}function i(t){return o(t)?t:Object(t)}function o(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var a=r();e.exports=a},{}],204:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46}],205:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48,"lodash._getnative":206,"lodash.isarguments":207,"lodash.isarray":204}],206:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],207:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],208:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],209:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],210:[function(t,e,n){!function(t){"function"==typeof define?define(t):"function"==typeof YUI?YUI.add("es5-sham",t):t()}(function(){function t(t){try{return t.sentinel=0,0===Object.getOwnPropertyDescriptor(t,"sentinel").value}catch(e){}}function e(t){try{return Object.defineProperty(t,"sentinel",{}),"sentinel"in t}catch(e){}}var n,r,i,o,a,s=Function.prototype.call,u=Object.prototype,l=s.bind(u.hasOwnProperty);if((a=l(u,"__defineGetter__"))&&(n=s.bind(u.__defineGetter__),r=s.bind(u.__defineSetter__),i=s.bind(u.__lookupGetter__),o=s.bind(u.__lookupSetter__)),Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:u)}),Object.defineProperty){var c=t({}),p="undefined"==typeof document||t(document.createElement("div"));if(!p||!c)var h=Object.getOwnPropertyDescriptor}if(!Object.getOwnPropertyDescriptor||h){var d="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,e){if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError(d+t);if(h)try{return h.call(Object,t,e)}catch(n){}if(l(t,e)){var r={enumerable:!0,configurable:!0};if(a){var s=t.__proto__;t.__proto__=u;var c=i(t,e),p=o(t,e);if(t.__proto__=s,c||p)return c&&(r.get=c),p&&(r.set=p),r}return r.value=t[e],r.writable=!0,r}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)}),!Object.create){var f,m=null===Object.prototype.__proto__;f=m||"undefined"==typeof document?function(){return{__proto__:null}}:function(){function t(){}var e=document.createElement("iframe"),n=document.body||document.documentElement;e.style.display="none",n.appendChild(e),e.src="javascript:";var r=e.contentWindow.Object.prototype;return n.removeChild(e),e=null,delete r.constructor,delete r.hasOwnProperty,delete r.propertyIsEnumerable,delete r.isPrototypeOf,delete r.toLocaleString,delete r.toString,delete r.valueOf,r.__proto__=null,t.prototype=r,f=function(){return new t},new t},Object.create=function(t,e){function n(){}var r;if(null===t)r=f();else{if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object prototype may only be an Object or null");n.prototype=t,r=new n,r.__proto__=t}return void 0!==e&&Object.defineProperties(r,e),r}}if(Object.defineProperty){var v=e({}),y="undefined"==typeof document||e(document.createElement("div"));if(!v||!y)var g=Object.defineProperty,b=Object.defineProperties}if(!Object.defineProperty||g){var w="Property description must be an object: ",_="Object.defineProperty called on non-object: ",x="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,e,s){if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError(_+t);if("object"!=typeof s&&"function"!=typeof s||null===s)throw new TypeError(w+s);if(g)try{return g.call(Object,t,e,s)}catch(c){}if(l(s,"value"))if(a&&(i(t,e)||o(t,e))){var p=t.__proto__;t.__proto__=u,delete t[e],t[e]=s.value,t.__proto__=p}else t[e]=s.value;else{if(!a)throw new TypeError(x);l(s,"get")&&n(t,e,s.get),l(s,"set")&&r(t,e,s.set)}return t}}(!Object.defineProperties||b)&&(Object.defineProperties=function(t,e){if(b)try{return b.call(Object,t,e)}catch(n){}for(var r in e)l(e,r)&&"__proto__"!=r&&Object.defineProperty(t,r,e[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(C){Object.freeze=function(t){return function(e){return"function"==typeof e?e:t(e)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)!==t)throw new TypeError;for(var e="";l(t,e);)e+="?";t[e]=!0;var n=l(t,e);return delete t[e],n})})},{}],211:[function(t,e,n){!function(t){"function"==typeof define?define(t):"function"==typeof YUI?YUI.add("es5",t):t()}(function(){function t(){}function e(t){return t=+t,t!==t?t=0:0!==t&&t!==1/0&&t!==-(1/0)&&(t=(t>0||-1)*Math.floor(Math.abs(t))),t}function n(t){var e=typeof t;return null===t||"undefined"===e||"boolean"===e||"number"===e||"string"===e}function r(t){var e,r,i;if(n(t))return t;if(r=t.valueOf,"function"==typeof r&&(e=r.call(t),n(e)))return e;if(i=t.toString,"function"==typeof i&&(e=i.call(t),n(e)))return e;throw new TypeError}8!==parseInt("08")&&(parseInt=function(t){var e=/^0[xX]/;return function(n,r){return n=String(n).trim(),+r||(r=e.test(n)?16:10),t(n,r)}}(parseInt)),Function.prototype.bind||(Function.prototype.bind=function(e){var n=this;if("function"!=typeof n)throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var r=h.call(arguments,1),i=function(){if(this instanceof u){var t=n.apply(this,r.concat(h.call(arguments)));return Object(t)===t?t:this}return n.apply(e,r.concat(h.call(arguments)))},o=Math.max(0,n.length-r.length),a=[],s=0;o>s;s++)a.push("$"+s);var u=Function("binder","return function("+a.join(",")+"){return binder.apply(this,arguments)}")(i);return n.prototype&&(t.prototype=n.prototype,u.prototype=new t,t.prototype=null),u});var i,o,a,s,u,l=Function.prototype.call,c=Array.prototype,p=Object.prototype,h=c.slice,d=l.bind(p.toString),f=l.bind(p.hasOwnProperty);if((u=f(p,"__defineGetter__"))&&(i=l.bind(p.__defineGetter__),o=l.bind(p.__defineSetter__),a=l.bind(p.__lookupGetter__),s=l.bind(p.__lookupSetter__)),2!=[1,2].splice(0).length){var m=Array.prototype.splice,v=Array.prototype.push,y=Array.prototype.unshift;Array.prototype.splice=function(){function t(t){for(var e=[];t--;)e.unshift(t);return e}var e,n=[];return n.splice.bind(n,0,0).apply(null,t(20)),n.splice.bind(n,0,0).apply(null,t(26)),e=n.length,n.splice(5,0,"XXX"),e+1==n.length?!0:void 0}()?function(t,e){return arguments.length?m.apply(this,[void 0===t?0:t,void 0===e?this.length-t:e].concat(h.call(arguments,2))):[]}:function(t,e){var n,r=h.call(arguments,2),i=r.length;if(!arguments.length)return[];if(void 0===t&&(t=0),void 0===e&&(e=this.length-t),i>0){if(0>=e){if(t==this.length)return v.apply(this,r),[];if(0==t)return y.apply(this,r),[]}return n=h.call(this,t,t+e),r.push.apply(r,h.call(this,t+e,this.length)),r.unshift.apply(r,h.call(this,0,t)),r.unshift(0,this.length),m.apply(this,r),n}return m.call(this,t,e)}}if(1!=[].unshift(0)){var y=Array.prototype.unshift;Array.prototype.unshift=function(){return y.apply(this,arguments),this.length}}Array.isArray||(Array.isArray=function(t){return"[object Array]"==d(t)});var g=Object("a"),b="a"!=g[0]||!(0 in g),w=!0;if(Array.prototype.forEach&&Array.prototype.forEach.call("foo",function(t,e,n){"object"!=typeof n&&(w=!1)}),Array.prototype.forEach&&w||(Array.prototype.forEach=function(t){var e=N(this),n=b&&"[object String]"==d(this)?this.split(""):e,r=arguments[1],i=-1,o=n.length>>>0;if("[object Function]"!=d(t))throw new TypeError;for(;++i<o;)i in n&&t.call(r,n[i],i,e)}),Array.prototype.map||(Array.prototype.map=function(t){var e=N(this),n=b&&"[object String]"==d(this)?this.split(""):e,r=n.length>>>0,i=Array(r),o=arguments[1];if("[object Function]"!=d(t))throw new TypeError(t+" is not a function");for(var a=0;r>a;a++)a in n&&(i[a]=t.call(o,n[a],a,e));return i}),Array.prototype.filter||(Array.prototype.filter=function(t){var e,n=N(this),r=b&&"[object String]"==d(this)?this.split(""):n,i=r.length>>>0,o=[],a=arguments[1];if("[object Function]"!=d(t))throw new TypeError(t+" is not a function");for(var s=0;i>s;s++)s in r&&(e=r[s],t.call(a,e,s,n)&&o.push(e));return o}),Array.prototype.every||(Array.prototype.every=function(t){var e=N(this),n=b&&"[object String]"==d(this)?this.split(""):e,r=n.length>>>0,i=arguments[1];if("[object Function]"!=d(t))throw new TypeError(t+" is not a function");for(var o=0;r>o;o++)if(o in n&&!t.call(i,n[o],o,e))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(t){var e=N(this),n=b&&"[object String]"==d(this)?this.split(""):e,r=n.length>>>0,i=arguments[1];if("[object Function]"!=d(t))throw new TypeError(t+" is not a function");for(var o=0;r>o;o++)if(o in n&&t.call(i,n[o],o,e))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(t){var e=N(this),n=b&&"[object String]"==d(this)?this.split(""):e,r=n.length>>>0;if("[object Function]"!=d(t))throw new TypeError(t+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,o=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(o in n){i=n[o++];break}if(++o>=r)throw new TypeError("reduce of empty array with no initial value")}for(;r>o;o++)o in n&&(i=t.call(void 0,i,n[o],o,e));return i}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(t){var e=N(this),n=b&&"[object String]"==d(this)?this.split(""):e,r=n.length>>>0;if("[object Function]"!=d(t))throw new TypeError(t+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,o=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(o in n){i=n[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}if(0>o)return i;do o in this&&(i=t.call(void 0,i,n[o],o,e));while(o--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(t){var n=b&&"[object String]"==d(this)?this.split(""):N(this),r=n.length>>>0;if(!r)return-1;var i=0;for(arguments.length>1&&(i=e(arguments[1])),i=i>=0?i:Math.max(0,r+i);r>i;i++)if(i in n&&n[i]===t)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(t){var n=b&&"[object String]"==d(this)?this.split(""):N(this),r=n.length>>>0;if(!r)return-1;var i=r-1;for(arguments.length>1&&(i=Math.min(i,e(arguments[1]))),i=i>=0?i:r-Math.abs(i);i>=0;i--)if(i in n&&t===n[i])return i;return-1}),!Object.keys){var _=!0,x=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],C=x.length;for(var E in{toString:null})_=!1;Object.keys=function R(t){if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError("Object.keys called on a non-object");var R=[];for(var e in t)f(t,e)&&R.push(e);if(_)for(var n=0,r=C;r>n;n++){var i=x[n];f(t,i)&&R.push(i)}return R}}var k=-621987552e5,S="-000001";Date.prototype.toISOString&&-1!==new Date(k).toISOString().indexOf(S)||(Date.prototype.toISOString=function(){var t,e,n,r,i;if(!isFinite(this))throw new RangeError("Date.prototype.toISOString called on non-finite value.");for(r=this.getUTCFullYear(),i=this.getUTCMonth(),r+=Math.floor(i/12),i=(i%12+12)%12,t=[i+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()],r=(0>r?"-":r>9999?"+":"")+("00000"+Math.abs(r)).slice(r>=0&&9999>=r?-4:-6),e=t.length;e--;)n=t[e],10>n&&(t[e]="0"+n);return r+"-"+t.slice(0,2).join("-")+"T"+t.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"});var P=!1;try{P=Date.prototype.toJSON&&null===new Date(0/0).toJSON()&&-1!==new Date(k).toJSON().indexOf(S)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(A){}P||(Date.prototype.toJSON=function(t){var e,n=Object(this),i=r(n);if("number"==typeof i&&!isFinite(i))return null;if(e=n.toISOString,"function"!=typeof e)throw new TypeError("toISOString property is not callable");return e.call(n)}),!Date.parse,0||(Date=function(t){function e(n,r,i,o,a,s,u){var l=arguments.length;if(this instanceof t){var c=1==l&&String(n)===n?new t(e.parse(n)):l>=7?new t(n,r,i,o,a,s,u):l>=6?new t(n,r,i,o,a,s):l>=5?new t(n,r,i,o,a):l>=4?new t(n,r,i,o):l>=3?new t(n,r,i):l>=2?new t(n,r):l>=1?new t(n):new t;return c.constructor=e,c}return t.apply(this,arguments)}function n(t,e){var n=e>1?1:0;return o[e]+Math.floor((t-1969+n)/4)-Math.floor((t-1901+n)/100)+Math.floor((t-1601+n)/400)+365*(t-1970)}function r(e){return Number(new t(1970,0,1,0,0,0,e))}var i=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"),o=[0,31,59,90,120,151,181,212,243,273,304,334,365];for(var a in t)e[a]=t[a];return e.now=t.now,e.UTC=t.UTC,e.prototype=t.prototype,e.prototype.constructor=e,e.parse=function(e){var o=i.exec(e);if(o){var a,s=Number(o[1]),u=Number(o[2]||1)-1,l=Number(o[3]||1)-1,c=Number(o[4]||0),p=Number(o[5]||0),h=Number(o[6]||0),d=Math.floor(1e3*Number(o[7]||0)),f=Boolean(o[4]&&!o[8]),m="-"===o[9]?1:-1,v=Number(o[10]||0),y=Number(o[11]||0);return(p>0||h>0||d>0?24:25)>c&&60>p&&60>h&&1e3>d&&u>-1&&12>u&&24>v&&60>y&&l>-1&&l<n(s,u+1)-n(s,u)&&(a=60*(24*(n(s,u)+l)+c+v*m),a=1e3*(60*(a+p+y*m)+h)+d,f&&(a=r(a)),a>=-864e13&&864e13>=a)?a:0/0}return t.parse.apply(this,arguments)},e}(Date)),Date.now||(Date.now=function(){return(new Date).getTime()}),Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===0xde0b6b3a7640080.toFixed(0)||!function(){function t(t,e){for(var n=-1;++n<a;)e+=t*s[n],s[n]=e%o,e=Math.floor(e/o)}function e(t){for(var e=a,n=0;--e>=0;)n+=s[e],s[e]=Math.floor(n/t),n=n%t*o}function n(){for(var t=a,e="";--t>=0;)if(""!==e||0===t||0!==s[t]){var n=String(s[t]);""===e?e=n:e+="0000000".slice(0,7-n.length)+n}return e}function r(t,e,n){return 0===e?n:e%2===1?r(t,e-1,n*t):r(t*t,e/2,n)}function i(t){for(var e=0;t>=4096;)e+=12,t/=4096;for(;t>=2;)e+=1,t/=2;return e}var o,a,s;o=1e7,a=6,s=[0,0,0,0,0,0],Number.prototype.toFixed=function(o){var a,s,u,l,c,p,h,d;if(a=Number(o),a=a!==a?0:Math.floor(a),0>a||a>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(s=Number(this),s!==s)return"NaN";if(-1e21>=s||s>=1e21)return String(s);if(u="",0>s&&(u="-",s=-s),l="0",s>1e-21)if(c=i(s*r(2,69,1))-69,p=0>c?s*r(2,-c,1):s/r(2,c,1),p*=4503599627370496,c=52-c,c>0){for(t(0,p),h=a;h>=7;)t(1e7,0),h-=7;for(t(r(10,h,1),0),h=c-1;h>=23;)e(1<<23),h-=23;e(1<<h),t(1,1),e(2),l=n()}else t(0,p),t(1<<-c,0),l=n()+"0.00000000000000000000".slice(2,2+a);return a>0?(d=l.length,l=a>=d?u+"0.0000000000000000000".slice(0,a-d+2)+l:u+l.slice(0,d-a)+"."+l.slice(d-a)):l=u+l,l}}();var O=String.prototype.split;if(2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||"".split(/.?/).length||".".split(/()()/).length>1?!function(){var t=void 0===/()??/.exec("")[1];String.prototype.split=function(e,n){var r=this;if(void 0===e&&0===n)return[];if("[object RegExp]"!==Object.prototype.toString.call(e))return O.apply(this,arguments);var i,o,a,s,u=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),c=0,e=new RegExp(e.source,l+"g");for(r+="",t||(i=new RegExp("^"+e.source+"$(?!\\s)",l)),n=void 0===n?-1>>>0:n>>>0;(o=e.exec(r))&&(a=o.index+o[0].length,!(a>c&&(u.push(r.slice(c,o.index)),!t&&o.length>1&&o[0].replace(i,function(){for(var t=1;t<arguments.length-2;t++)void 0===arguments[t]&&(o[t]=void 0)}),o.length>1&&o.index<r.length&&Array.prototype.push.apply(u,o.slice(1)),s=o[0].length,c=a,u.length>=n)));)e.lastIndex===o.index&&e.lastIndex++;return c===r.length?(s||!e.test(""))&&u.push(""):u.push(r.slice(c)),u.length>n?u.slice(0,n):u}}():"0".split(void 0,0).length&&(String.prototype.split=function(t,e){return void 0===t&&0===e?[]:O.apply(this,arguments)}),"".substr&&"b"!=="0b".substr(-1)){var T=String.prototype.substr;String.prototype.substr=function(t,e){return T.call(this,0>t&&(t=this.length+t)<0?0:t,e)}}var I=" \n \f\r   ᠎              \u2028\u2029\ufeff";if(!String.prototype.trim||I.trim()){I="["+I+"]";var M=new RegExp("^"+I+I+"*"),j=new RegExp(I+I+"*$");String.prototype.trim=function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(M,"").replace(j,"")}}var N=function(t){if(null==t)throw new TypeError("can't convert "+t+" to object");return Object(t)}})},{}],212:[function(t,e,n){!function(){"use strict";function t(e,n){function i(t,e){return function(){return t.apply(e,arguments)}}var o;if(n=n||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=n.touchBoundary||10,this.layer=e,this.tapDelay=n.tapDelay||200,this.tapTimeout=n.tapTimeout||700,!t.notNeeded(e)){for(var a=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],s=this,u=0,l=a.length;l>u;u++)s[a[u]]=i(s[a[u]],s);r&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,r){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,r):i.call(e,t,n,r)},e.addEventListener=function(t,n,r){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),r):i.call(e,t,n,r)}),"function"==typeof e.onclick&&(o=e.onclick,e.addEventListener("click",function(t){o(t)},!1),e.onclick=null)}}var n=navigator.userAgent.indexOf("Windows Phone")>=0,r=navigator.userAgent.indexOf("Android")>0&&!n,i=/iP(ad|hone|od)/.test(navigator.userAgent)&&!n,o=i&&/OS 4_\d(_\d)?/.test(navigator.userAgent),a=i&&/OS [6-7]_\d/.test(navigator.userAgent),s=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(i&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!r;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return r&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;i&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,r;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],i){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!o){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTime<this.tapDelay&&t.preventDefault(),!0},t.prototype.touchHasMoved=function(t){var e=t.changedTouches[0],n=this.touchBoundary;return Math.abs(e.pageX-this.touchStartX)>n||Math.abs(e.pageY-this.touchStartY)>n?!0:!1},t.prototype.onTouchMove=function(t){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,n,s,u,l,c=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(t.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,a&&(l=t.changedTouches[0],c=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||c,c.fastClickScrollParent=this.targetElement.fastClickScrollParent),s=c.tagName.toLowerCase(),"label"===s){if(e=this.findControl(c)){if(this.focus(c),r)return!1;c=e}}else if(this.needsFocus(c))return t.timeStamp-n>100||i&&window.top!==window&&"input"===s?(this.targetElement=null,!1):(this.focus(c),this.sendClick(c,t),i&&"select"===s||(this.targetElement=null,t.preventDefault()),!1);return i&&!o&&(u=c.fastClickScrollParent,u&&u.fastClickLastScrollTop!==u.scrollTop)?!0:(this.needsClick(c)||(t.preventDefault(),this.sendClick(c,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return this.targetElement?t.forwardedTouchEvent?!0:t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1):!0:!0},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail?!0:(e=this.onMouse(t),e||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;r&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,n,i,o;if("undefined"==typeof window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!r)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(n>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(s&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction?!0:(o=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],o>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(-1!==e.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===t.style.touchAction||"manipulation"===t.style.touchAction?!0:!1)},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof e&&e.exports?(e.exports=t.attach,e.exports.FastClick=t):window.FastClick=t}()},{}],213:[function(t,e,n){!function(t,r){"function"==typeof define&&define.amd?define([],function(){return t.returnExportsGlobal=r()}):"object"==typeof n?e.exports=r():t.Formatter=r()}(this,function(){var t=function(){var t={},e=4,n=new RegExp("{{([^}]+)}}","g"),r=function(t){for(var e,r=[];e=n.exec(t);)r.push(e);return r};return t.parse=function(t){var n={inpts:{},chars:{}},i=r(t),o=t.length,a=0,s=0,u=0,l=function(t){for(var r=t.length,i=0;r>i;i++)n.inpts[s]=t.charAt(i),s++;a++,u+=t.length+e-1};for(u;o>u;u++)a<i.length&&u===i[a].index?l(i[a][1]):n.chars[u-a*e]=t.charAt(u);return n.mLength=u-a*e,n},t}(),e=function(){{var t={};"undefined"!=typeof navigator?navigator.userAgent:null}return t.extend=function(t){for(var e=1;e<arguments.length;e++)for(var n in arguments[e])t[n]=arguments[e][n];return t},t.addChars=function(t,e,n){return t.substr(0,n)+e+t.substr(n,t.length)},t.removeChars=function(t,e,n){return t.substr(0,e)+t.substr(n,t.length)},t.isBetween=function(t,e){return e.sort(function(t,e){return t-e}),t>e[0]&&t<e[1]},t.addListener=function(t,e,n){return"undefined"!=typeof t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},t.preventDefault=function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1},t.getClip=function(t){return t.clipboardData?t.clipboardData.getData("Text"):window.clipboardData?window.clipboardData.getData("Text"):void 0},t.getMatchingKey=function(t,e,n){for(var r in n){var i=n[r];if(t===i.which&&e===i.keyCode)return r}},t.isDelKeyDown=function(e,n){var r={backspace:{which:8,keyCode:8},"delete":{which:46,keyCode:46}};return t.getMatchingKey(e,n,r)},t.isDelKeyPress=function(e,n){var r={backspace:{which:8,keyCode:8,shiftKey:!1},"delete":{which:0,keyCode:46}};return t.getMatchingKey(e,n,r)},t.isSpecialKeyPress=function(e,n){var r={tab:{which:0,keyCode:9},enter:{which:13,keyCode:13},end:{which:0,keyCode:35},home:{which:0,keyCode:36},leftarrow:{which:0,keyCode:37},uparrow:{which:0,keyCode:38},rightarrow:{which:0,keyCode:39},downarrow:{which:0,keyCode:40}};return t.getMatchingKey(e,n,r)},t.isModifier=function(t){return t.ctrlKey||t.altKey||t.metaKey},t.forEach=function(t,e,n){if(t.hasOwnProperty("length"))for(var r=0,i=t.length;i>r&&e.call(n,t[r],r,t)!==!1;r++);else for(var o in t)if(t.hasOwnProperty(o)&&e.call(n,t[o],o,t)===!1)break},t}(),n=function(t,e){function n(n){var i=[],o=[];e.forEach(n,function(n){e.forEach(n,function(e,n){var a=t.parse(e),s=r(n);return i.push(s),o.push(a),!1})});var a=function(t){var n;return e.forEach(i,function(e,r){return e.test(t)?(n=r,!1):void 0}),void 0===n?null:o[n]};return{getPattern:a,patterns:o,matchers:i}}var r=function(t){return"*"===t?/.*/:new RegExp(t)};return n}(t,e),r=function(){var t={};return t.get=function(t){if("number"==typeof t.selectionStart)return{begin:t.selectionStart,end:t.selectionEnd};var e;try{e=document.selection.createRange()}catch(n){}if(e&&e.parentElement()===t){var r=t.createTextRange(),i=t.createTextRange(),o=t.value.length;return r.moveToBookmark(e.getBookmark()),i.collapse(!1),r.compareEndPoints("StartToEnd",i)>-1?{begin:o,end:o}:{begin:-r.moveStart("character",-o),end:-r.moveEnd("character",-o)}}return{begin:0,end:0}},t.set=function(t,e){if("object"!=typeof e&&(e={begin:e,end:e}),t.setSelectionRange)t.focus(),t.setSelectionRange(e.begin,e.end);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",e.end),n.moveStart("character",e.begin),n.select()}},t}(),i=function(t,e,n){function r(){var t=navigator.userAgent;if(t.match(/Android/i)){var e=t.match(/Chrome\/(\d{2})\./i);if(e&&Number(e[e.length-1])<=31)return!0}}function i(e,i){var a=this;if(a.el=e,!a.el)throw new TypeError("Must provide an existing element");if(a.opts=n.extend({},o,i),"undefined"!=typeof a.opts.pattern&&(a.opts.patterns=a._specFromSinglePattern(a.opts.pattern),delete a.opts.pattern),"undefined"==typeof a.opts.patterns)throw new TypeError("Must provide a pattern or array of patterns");a.patternMatcher=t(a.opts.patterns),a._updatePattern(),a.hldrs={},a.focus=0,n.addListener(a.el,"keydown",function(t){a._keyDown(t)}),n.addListener(a.el,"keypress",function(t){a._keyPress(t)}),r()&&n.addListener(a.el,"input",function(t){a._keyPress(t)}),n.addListener(a.el,"paste",function(t){a._paste(t)}),a.opts.persistent&&(a._processKey("",!1),a.el.blur(),n.addListener(a.el,"focus",function(t){a._focus(t)}),n.addListener(a.el,"click",function(t){a._focus(t)}),n.addListener(a.el,"touchstart",function(t){a._focus(t)}))}var o={persistent:!1,repeat:!1,placeholder:" "},a={9:/[0-9]/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/};return i.addInptType=function(t,e){a[t]=e},i.prototype.resetPattern=function(n){this.opts.patterns=n?this._specFromSinglePattern(n):this.opts.patterns,this.sel=e.get(this.el),this.val=this.el.value,this.delta=0,this._removeChars(),this.patternMatcher=t(this.opts.patterns);var r=this.patternMatcher.getPattern(this.val);this.mLength=r.mLength,this.chars=r.chars,this.inpts=r.inpts,this._processKey("",!1,!0)},i.prototype._updatePattern=function(){var t=this.patternMatcher.getPattern(this.val);t&&(this.mLength=t.mLength,this.chars=t.chars,this.inpts=t.inpts)},i.prototype._keyDown=function(t){var e=t.which||t.keyCode;return e&&n.isDelKeyDown(t.which,t.keyCode)?(this._processKey(null,e),n.preventDefault(t)):void 0},i.prototype._keyPress=function(t){var e,r;return e=t.which||t.keyCode,r=n.isSpecialKeyPress(t.which,t.keyCode),n.isDelKeyPress(t.which,t.keyCode)||r||n.isModifier(t)?void 0:(this._processKey(String.fromCharCode(e),!1),n.preventDefault(t))},i.prototype._paste=function(t){return this._processKey(n.getClip(t),!1),n.preventDefault(t)},i.prototype._focus=function(){var t=this;setTimeout(function(){var n=e.get(t.el),r=n.end>t.focus,i=0===n.end;(r||i)&&e.set(t.el,t.focus)},0)},i.prototype._processKey=function(t,r,i){if(this.sel=e.get(this.el),this.val=this.el.value,this.delta=0,this.sel.begin!==this.sel.end)this.delta=-1*Math.abs(this.sel.begin-this.sel.end),
8
+ this.val=n.removeChars(this.val,this.sel.begin,this.sel.end);else if(r&&46===r)this._delete();else if(r&&this.sel.begin-1>=0)this.val=n.removeChars(this.val,this.sel.end-1,this.sel.end),this.delta-=1;else if(r)return!0;r||(this.val=n.addChars(this.val,t,this.sel.begin),this.delta+=t.length),this._formatValue(i)},i.prototype._delete=function(){for(;this.chars[this.sel.begin];)this._nextPos();this.sel.begin<this.val.length&&(this._nextPos(),this.val=n.removeChars(this.val,this.sel.end-1,this.sel.end),this.delta=-1)},i.prototype._nextPos=function(){this.sel.end++,this.sel.begin++},i.prototype._formatValue=function(t){this.newPos=this.sel.end+this.delta,this._removeChars(),this._updatePattern(),this._validateInpts(),this._addChars(),this.el.value=this.val.substr(0,this.mLength),("undefined"==typeof t||t===!1)&&e.set(this.el,this.newPos)},i.prototype._removeChars=function(){this.sel.end>this.focus&&(this.delta+=this.sel.end-this.focus);for(var t=0,e=0;e<=this.mLength;e++){var r,i=this.chars[e],o=this.hldrs[e],a=e+t;a=e>=this.sel.begin?a+this.delta:a,r=this.val.charAt(a),(i&&i===r||o&&o===r)&&(this.val=n.removeChars(this.val,a,a+1),t--)}this.hldrs={},this.focus=this.val.length},i.prototype._validateInpts=function(){for(var t=0;t<this.val.length;t++){var e=this.inpts[t],r=!a[e],i=!r&&!a[e].test(this.val.charAt(t)),o=this.inpts[t];(r||i)&&o&&(this.val=n.removeChars(this.val,t,t+1),this.focusStart--,this.newPos--,this.delta--,t--)}},i.prototype._addChars=function(){if(this.opts.persistent){for(var t=0;t<=this.mLength;t++)this.val.charAt(t)||(this.val=n.addChars(this.val,this.opts.placeholder,t),this.hldrs[t]=this.opts.placeholder),this._addChar(t);for(;this.chars[this.focus];)this.focus++}else for(var e=0;e<=this.val.length;e++){if(this.delta<=0&&e===this.focus)return!0;this._addChar(e)}},i.prototype._addChar=function(t){var e=this.chars[t];return e?(n.isBetween(t,[this.sel.begin-1,this.newPos+1])&&(this.newPos++,this.delta++),t<=this.focus&&this.focus++,this.hldrs[t]&&(delete this.hldrs[t],this.hldrs[t+1]=this.opts.placeholder),void(this.val=n.addChars(this.val,e,t))):!0},i.prototype._specFromSinglePattern=function(t){return[{"*":t}]},i}(n,r,e);return i})},{}],214:[function(t,e,n){"use strict";var r=t("./handlebars/base"),i=t("./handlebars/safe-string")["default"],o=t("./handlebars/exception")["default"],a=t("./handlebars/utils"),s=t("./handlebars/runtime"),u=function(){var t=new r.HandlebarsEnvironment;return a.extend(t,r),t.SafeString=i,t.Exception=o,t.Utils=a,t.escapeExpression=a.escapeExpression,t.VM=s,t.template=function(e){return s.template(e,t)},t},l=u();l.create=u,l["default"]=l,n["default"]=l},{"./handlebars/base":215,"./handlebars/exception":216,"./handlebars/runtime":217,"./handlebars/safe-string":218,"./handlebars/utils":219}],215:[function(t,e,n){"use strict";function r(t,e){this.helpers=t||{},this.partials=e||{},i(this)}function i(t){t.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new a("Missing helper: '"+arguments[arguments.length-1].name+"'")}),t.registerHelper("blockHelperMissing",function(e,n){var r=n.inverse,i=n.fn;if(e===!0)return i(this);if(e===!1||null==e)return r(this);if(c(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):r(this);if(n.data&&n.ids){var a=v(n.data);a.contextPath=o.appendContextPath(n.data.contextPath,n.name),n={data:a}}return i(e,n)}),t.registerHelper("each",function(t,e){if(!e)throw new a("Must pass iterator to #each");var n,r,i=e.fn,s=e.inverse,u=0,l="";if(e.data&&e.ids&&(r=o.appendContextPath(e.data.contextPath,e.ids[0])+"."),p(t)&&(t=t.call(this)),e.data&&(n=v(e.data)),t&&"object"==typeof t)if(c(t))for(var h=t.length;h>u;u++)n&&(n.index=u,n.first=0===u,n.last=u===t.length-1,r&&(n.contextPath=r+u)),l+=i(t[u],{data:n});else for(var d in t)t.hasOwnProperty(d)&&(n&&(n.key=d,n.index=u,n.first=0===u,r&&(n.contextPath=r+d)),l+=i(t[d],{data:n}),u++);return 0===u&&(l=s(this)),l}),t.registerHelper("if",function(t,e){return p(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||o.isEmpty(t)?e.inverse(this):e.fn(this)}),t.registerHelper("unless",function(e,n){return t.helpers["if"].call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})}),t.registerHelper("with",function(t,e){p(t)&&(t=t.call(this));var n=e.fn;if(o.isEmpty(t))return e.inverse(this);if(e.data&&e.ids){var r=v(e.data);r.contextPath=o.appendContextPath(e.data.contextPath,e.ids[0]),e={data:r}}return n(t,e)}),t.registerHelper("log",function(e,n){var r=n.data&&null!=n.data.level?parseInt(n.data.level,10):1;t.log(r,e)}),t.registerHelper("lookup",function(t,e){return t&&t[e]})}var o=t("./utils"),a=t("./exception")["default"],s="2.0.0";n.VERSION=s;var u=6;n.COMPILER_REVISION=u;var l={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};n.REVISION_CHANGES=l;var c=o.isArray,p=o.isFunction,h=o.toString,d="[object Object]";n.HandlebarsEnvironment=r,r.prototype={constructor:r,logger:f,log:m,registerHelper:function(t,e){if(h.call(t)===d){if(e)throw new a("Arg not supported with multiple helpers");o.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){h.call(t)===d?o.extend(this.partials,t):this.partials[t]=e},unregisterPartial:function(t){delete this.partials[t]}};var f={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(t,e){if(f.level<=t){var n=f.methodMap[t];"undefined"!=typeof console&&console[n]&&console[n].call(console,e)}}};n.logger=f;var m=f.log;n.log=m;var v=function(t){var e=o.extend({},t);return e._parent=t,e};n.createFrame=v},{"./exception":216,"./utils":219}],216:[function(t,e,n){"use strict";function r(t,e){var n;e&&e.firstLine&&(n=e.firstLine,t+=" - "+n+":"+e.firstColumn);for(var r=Error.prototype.constructor.call(this,t),o=0;o<i.length;o++)this[i[o]]=r[i[o]];n&&(this.lineNumber=n,this.column=e.firstColumn)}var i=["description","fileName","lineNumber","message","name","number","stack"];r.prototype=new Error,n["default"]=r},{}],217:[function(t,e,n){"use strict";function r(t){var e=t&&t[0]||1,n=p;if(e!==n){if(n>e){var r=h[n],i=h[e];throw new c("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+i+").")}throw new c("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}}function i(t,e){if(!e)throw new c("No environment passed to template");if(!t||!t.main)throw new c("Unknown template object: "+typeof t);e.VM.checkRevision(t.compiler);var n=function(n,r,i,o,a,s,u,p,h){a&&(o=l.extend({},o,a));var d=e.VM.invokePartial.call(this,n,i,o,s,u,p,h);if(null==d&&e.compile){var f={helpers:s,partials:u,data:p,depths:h};u[i]=e.compile(n,{data:void 0!==p,compat:t.compat},e),d=u[i](o,f)}if(null!=d){if(r){for(var m=d.split("\n"),v=0,y=m.length;y>v&&(m[v]||v+1!==y);v++)m[v]=r+m[v];d=m.join("\n")}return d}throw new c("The partial "+i+" could not be compiled when running in runtime-only mode")},r={lookup:function(t,e){for(var n=t.length,r=0;n>r;r++)if(t[r]&&null!=t[r][e])return t[r][e]},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:l.escapeExpression,invokePartial:n,fn:function(e){return t[e]},programs:[],program:function(t,e,n){var r=this.programs[t],i=this.fn(t);return e||n?r=o(this,t,i,e,n):r||(r=this.programs[t]=o(this,t,i)),r},data:function(t,e){for(;t&&e--;)t=t._parent;return t},merge:function(t,e){var n=t||e;return t&&e&&t!==e&&(n=l.extend({},e,t)),n},noop:e.VM.noop,compilerInfo:t.compiler},i=function(e,n){n=n||{};var o=n.data;i._setup(n),!n.partial&&t.useData&&(o=u(e,o));var a;return t.useDepths&&(a=n.depths?[e].concat(n.depths):[e]),t.main.call(r,e,r.helpers,r.partials,o,a)};return i.isTop=!0,i._setup=function(n){n.partial?(r.helpers=n.helpers,r.partials=n.partials):(r.helpers=r.merge(n.helpers,e.helpers),t.usePartial&&(r.partials=r.merge(n.partials,e.partials)))},i._child=function(e,n,i){if(t.useDepths&&!i)throw new c("must pass parent depths");return o(r,e,t[e],n,i)},i}function o(t,e,n,r,i){var o=function(e,o){return o=o||{},n.call(t,e,t.helpers,t.partials,o.data||r,i&&[e].concat(i))};return o.program=e,o.depth=i?i.length:0,o}function a(t,e,n,r,i,o,a){var s={partial:!0,helpers:r,partials:i,data:o,depths:a};if(void 0===t)throw new c("The partial "+e+" could not be found");return t instanceof Function?t(n,s):void 0}function s(){return""}function u(t,e){return e&&"root"in e||(e=e?d(e):{},e.root=t),e}var l=t("./utils"),c=t("./exception")["default"],p=t("./base").COMPILER_REVISION,h=t("./base").REVISION_CHANGES,d=t("./base").createFrame;n.checkRevision=r,n.template=i,n.program=o,n.invokePartial=a,n.noop=s},{"./base":215,"./exception":216,"./utils":219}],218:[function(t,e,n){"use strict";function r(t){this.string=t}r.prototype.toString=function(){return""+this.string},n["default"]=r},{}],219:[function(t,e,n){"use strict";function r(t){return l[t]}function i(t){for(var e=1;e<arguments.length;e++)for(var n in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],n)&&(t[n]=arguments[e][n]);return t}function o(t){return t instanceof u?t.toString():null==t?"":t?(t=""+t,p.test(t)?t.replace(c,r):t):t+""}function a(t){return t||0===t?f(t)&&0===t.length?!0:!1:!0}function s(t,e){return(t?t+".":"")+e}var u=t("./safe-string")["default"],l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/[&<>"'`]/g,p=/[&<>"'`]/;n.extend=i;var h=Object.prototype.toString;n.toString=h;var d=function(t){return"function"==typeof t};d(/x/)&&(d=function(t){return"function"==typeof t&&"[object Function]"===h.call(t)});var d;n.isFunction=d;var f=Array.isArray||function(t){return t&&"object"==typeof t?"[object Array]"===h.call(t):!1};n.isArray=f,n.escapeExpression=o,n.isEmpty=a,n.appendContextPath=s},{"./safe-string":218}],220:[function(t,e,n){e.exports=t("./dist/cjs/handlebars.runtime")},{"./dist/cjs/handlebars.runtime":214}],221:[function(t,e,n){e.exports=t("handlebars/runtime")["default"]},{"handlebars/runtime":220}],222:[function(require,module,exports){"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return 10>t?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var n,r,i,o,a,s=gap,u=e[t];switch(u&&"object"==typeof u&&"function"==typeof u.toJSON&&(u=u.toJSON(t)),"function"==typeof rep&&(u=rep.call(e,t,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(u)){for(o=u.length,n=0;o>n;n+=1)a[n]=str(n,u)||"null";return i=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,i}if(rep&&"object"==typeof rep)for(o=rep.length,n=0;o>n;n+=1)"string"==typeof rep[n]&&(r=rep[n],i=str(r,u),i&&a.push(quote(r)+(gap?": ":":")+i));else for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(i=str(r,u),i&&a.push(quote(r)+(gap?": ":":")+i));return i=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,i}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var n,r,i=t[e];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),void 0!==r?i[n]=r:delete i[n]);return reviver.call(t,e,i)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},{}],223:[function(t,e,n){(function(t){(function(e,n,r,i,o){(function(){function r(t,e,n){for(var r=(n||0)-1,i=t?t.length:0;++r<i;)if(t[r]===e)return r;return-1}function o(t,e){var n=typeof e;if(t=t.cache,"boolean"==n||null==e)return t[e]?0:-1;"number"!=n&&"string"!=n&&(n="object");var i="number"==n?e:C+e;return t=(t=t[n])&&t[i],"object"==n?t&&r(t,e)>-1?0:-1:t?0:-1}function a(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:C+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function s(t){return t.charCodeAt(0)}function u(t,e){for(var n=t.criteria,r=e.criteria,i=-1,o=n.length;++i<o;){var a=n[i],s=r[i];if(a!==s){if(a>s||"undefined"==typeof a)return 1;if(s>a||"undefined"==typeof s)return-1}}return t.index-e.index}function l(t){var e=-1,n=t.length,r=t[0],i=t[n/2|0],o=t[n-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&o&&"object"==typeof o)return!1;var s=h();s["false"]=s["null"]=s["true"]=s.undefined=!1;var u=h();for(u.array=t,u.cache=s,u.push=a;++e<n;)u.push(t[e]);return u}function c(t){return"\\"+rt[t]}function p(){return b.pop()||[]}function h(){return w.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function d(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function f(t){t.length=0,b.length<S&&b.push(t)}function m(t){var e=t.cache;e&&m(e),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,w.length<S&&w.push(t)}function v(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,i=n-e||0,o=Array(0>i?0:i);++r<i;)o[r]=t[e+r];return o}function y(t){function e(t){return t&&"object"==typeof t&&!pr(t)&&Bn.call(t,"__wrapped__")?t:new n(t)}function n(t,e){this.__chain__=!!e,this.__wrapped__=t}function i(t){function e(){if(r){var t=v(r);qn.apply(t,arguments)}if(this instanceof e){var o=b(n.prototype),a=n.apply(o,t||arguments);return Ft(a)?a:o}return n.apply(i,t||arguments)}var n=t[0],r=t[2],i=t[4];return cr(e,t),e}function a(t,e,n,r,i){if(n){var o=n(t);if("undefined"!=typeof o)return o}var s=Ft(t);if(!s)return t;var u=Fn.call(t);if(!X[u]||!ur.nodeClass&&d(t))return t;var l=ar[u];switch(u){case B:case q:return new l(+t);case G:case Q:return new l(t);case J:return o=l(t.source,M.exec(t)),o.lastIndex=t.lastIndex,o}var c=pr(t);if(e){var h=!r;r||(r=p()),i||(i=p());for(var m=r.length;m--;)if(r[m]==t)return i[m];o=c?l(t.length):{}}else o=c?v(t):xr({},t);return c&&(Bn.call(t,"index")&&(o.index=t.index),Bn.call(t,"input")&&(o.input=t.input)),e?(r.push(t),i.push(o),(c?_r:kr)(t,function(t,s){o[s]=a(t,e,n,r,i)}),h&&(f(r),f(i)),o):o}function b(t,e){return Ft(t)?Qn(t):{}}function w(t,e,n){if("function"!=typeof t)return on;if("undefined"==typeof e||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(ur.funcNames&&(r=!t.name),r=r||!ur.funcDecomp,!r)){var i=Hn.call(t);ur.funcNames||(r=!j.test(i)),r||(r=F.test(i),cr(t,r))}if(r===!1||r!==!0&&1&r[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return $e(t,e)}function S(t){function e(){var t=u?a:this;if(i){var d=v(i);qn.apply(d,arguments)}if((o||c)&&(d||(d=v(arguments)),o&&qn.apply(d,o),c&&d.length<s))return r|=16,S([n,p?r:-4&r,d,null,a,s]);if(d||(d=arguments),l&&(n=t[h]),this instanceof e){t=b(n.prototype);var f=n.apply(t,d);return Ft(f)?f:t}return n.apply(t,d)}var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=1&r,l=2&r,c=4&r,p=8&r,h=n;return cr(e,t),e}function rt(t,e){var n=-1,i=mt(),a=t?t.length:0,s=a>=E&&i===r,u=[];if(s){var c=l(e);c?(i=o,e=c):s=!1}for(;++n<a;){var p=t[n];i(e,p)<0&&u.push(p)}return s&&m(e),u}function ot(t,e,n,r){for(var i=(r||0)-1,o=t?t.length:0,a=[];++i<o;){var s=t[i];if(s&&"object"==typeof s&&"number"==typeof s.length&&(pr(s)||bt(s))){e||(s=ot(s,e,n));var u=-1,l=s.length,c=a.length;for(a.length+=l;++u<l;)a[c++]=s[u]}else n||a.push(s)}return a}function at(t,e,n,r,i,o){if(n){var a=n(t,e);if("undefined"!=typeof a)return!!a}if(t===e)return 0!==t||1/t==1/e;var s=typeof t,u=typeof e;if(!(t!==t||t&&nt[s]||e&&nt[u]))return!1;if(null==t||null==e)return t===e;var l=Fn.call(t),c=Fn.call(e);if(l==H&&(l=Y),c==H&&(c=Y),l!=c)return!1;switch(l){case B:case q:return+t==+e;case G:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case J:case Q:return t==Tn(e)}var h=l==z;if(!h){var m=Bn.call(t,"__wrapped__"),v=Bn.call(e,"__wrapped__");if(m||v)return at(m?t.__wrapped__:t,v?e.__wrapped__:e,n,r,i,o);if(l!=Y||!ur.nodeClass&&(d(t)||d(e)))return!1;var y=!ur.argsObject&&bt(t)?An:t.constructor,g=!ur.argsObject&&bt(e)?An:e.constructor;if(y!=g&&!(Ut(y)&&y instanceof y&&Ut(g)&&g instanceof g)&&"constructor"in t&&"constructor"in e)return!1}var b=!i;i||(i=p()),o||(o=p());for(var w=i.length;w--;)if(i[w]==t)return o[w]==e;var _=0;if(a=!0,i.push(t),o.push(e),h){if(w=t.length,_=e.length,a=_==w,a||r)for(;_--;){var x=w,C=e[_];if(r)for(;x--&&!(a=at(t[x],C,n,r,i,o)););else if(!(a=at(t[_],C,n,r,i,o)))break}}else Er(e,function(e,s,u){return Bn.call(u,s)?(_++,a=Bn.call(t,s)&&at(t[s],e,n,r,i,o)):void 0}),a&&!r&&Er(t,function(t,e,n){return Bn.call(n,e)?a=--_>-1:void 0});return i.pop(),o.pop(),b&&(f(i),f(o)),a}function st(t,e,n,r,i){(pr(e)?re:kr)(e,function(e,o){var a,s,u=e,l=t[o];if(e&&((s=pr(e))||Sr(e))){for(var c=r.length;c--;)if(a=r[c]==e){l=i[c];break}if(!a){var p;n&&(u=n(l,e),(p="undefined"!=typeof u)&&(l=u)),p||(l=s?pr(l)?l:[]:Sr(l)?l:{}),r.push(e),i.push(l),p||st(l,e,n,r,i)}}else n&&(u=n(l,e),"undefined"==typeof u&&(u=e)),"undefined"!=typeof u&&(l=u);t[o]=l})}function ut(t,e){return t+$n(or()*(e-t+1))}function ct(t,e,n){var i=-1,a=mt(),s=t?t.length:0,u=[],c=!e&&s>=E&&a===r,h=n||c?p():u;if(c){var d=l(h);a=o,h=d}for(;++i<s;){var v=t[i],y=n?n(v,i,t):v;(e?!i||h[h.length-1]!==y:a(h,y)<0)&&((n||c)&&h.push(y),u.push(v))}return c?(f(h.array),m(h)):n&&f(h),u}function pt(t){return function(n,r,i){var o={};if(r=e.createCallback(r,i,3),pr(n))for(var a=-1,s=n.length;++a<s;){var u=n[a];t(o,u,r(u,a,n),n)}else _r(n,function(e,n,i){t(o,e,r(e,n,i),i)});return o}}function ht(t,e,n,r,o,a){var s=1&e,u=2&e,l=4&e,c=16&e,p=32&e;if(!u&&!Ut(t))throw new In;c&&!n.length&&(e&=-17,c=n=!1),p&&!r.length&&(e&=-33,p=r=!1);var h=t&&t.__bindData__;if(h&&h!==!0)return h=v(h),h[2]&&(h[2]=v(h[2])),h[3]&&(h[3]=v(h[3])),!s||1&h[1]||(h[4]=o),!s&&1&h[1]&&(e|=8),!l||4&h[1]||(h[5]=a),c&&qn.apply(h[2]||(h[2]=[]),n),p&&Yn.apply(h[3]||(h[3]=[]),r),h[1]|=e,ht.apply(null,h);var d=1==e||17===e?i:S;return d([t,e,n,r,o,a])}function dt(){et.shadowedProps=V,et.array=et.bottom=et.loop=et.top="",et.init="iterable",et.useHas=!0;for(var t,e=0;t=arguments[e];e++)for(var n in t)et[n]=t[n];var r=et.args;et.firstArg=/^[^,]+/.exec(r)[0];var i=kn("baseCreateCallback, errorClass, errorProto, hasOwnProperty, indicatorObject, isArguments, isArray, isString, keys, objectProto, objectTypes, nonEnumProps, stringClass, stringProto, toString","return function("+r+") {\n"+lr(et)+"\n}");return i(w,W,jn,Bn,x,bt,pr,Ht,et.keys,Nn,nt,sr,Q,Rn,Fn)}function ft(t){return yr[t]}function mt(){var t=(t=e.indexOf)===Ee?r:t;return t}function vt(t){return"function"==typeof t&&Dn.test(t)}function yt(t){var e,n;return!t||Fn.call(t)!=Y||(e=t.constructor,Ut(e)&&!(e instanceof e))||!ur.argsClass&&bt(t)||!ur.nodeClass&&d(t)?!1:ur.ownLast?(Er(t,function(t,e,r){return n=Bn.call(r,e),!1}),n!==!1):(Er(t,function(t,e){n=e}),"undefined"==typeof n||Bn.call(t,n))}function gt(t){return gr[t]}function bt(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Fn.call(t)==H||!1}function wt(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),a(t,e,"function"==typeof n&&w(n,r,1))}function _t(t,e,n){return a(t,!0,"function"==typeof e&&w(e,n,1))}function xt(t,e){var n=b(t);return e?xr(n,e):n}function Ct(t,n,r){var i;return n=e.createCallback(n,r,3),kr(t,function(t,e,r){return n(t,e,r)?(i=e,!1):void 0}),i}function Et(t,n,r){var i;return n=e.createCallback(n,r,3),St(t,function(t,e,r){return n(t,e,r)?(i=e,!1):void 0}),i}function kt(t,e,n){var r=[];Er(t,function(t,e){r.push(e,t)});var i=r.length;for(e=w(e,n,3);i--&&e(r[i--],r[i],t)!==!1;);return t}function St(t,e,n){var r=dr(t),i=r.length;for(e=w(e,n,3);i--;){var o=r[i];if(e(t[o],o,t)===!1)break}return t}function Pt(t){var e=[];return Er(t,function(t,n){Ut(t)&&e.push(n)}),e.sort()}function At(t,e){return t?Bn.call(t,e):!1}function Ot(t){for(var e=-1,n=dr(t),r=n.length,i={};++e<r;){var o=n[e];i[t[o]]=o}return i}function Tt(t){return t===!0||t===!1||t&&"object"==typeof t&&Fn.call(t)==B||!1}function It(t){return t&&"object"==typeof t&&Fn.call(t)==q||!1}function Mt(t){return t&&1===t.nodeType||!1}function jt(t){var e=!0;if(!t)return e;var n=Fn.call(t),r=t.length;return n==z||n==Q||(ur.argsClass?n==H:bt(t))||n==Y&&"number"==typeof r&&Ut(t.splice)?!r:(kr(t,function(){return e=!1}),e)}function Nt(t,e,n,r){return at(t,e,"function"==typeof n&&w(n,r,2))}function Rt(t){return Zn(t)&&!tr(parseFloat(t))}function Ut(t){return"function"==typeof t}function Ft(t){return!(!t||!nt[typeof t])}function Dt(t){return Vt(t)&&t!=+t}function Lt(t){return null===t}function Vt(t){return"number"==typeof t||t&&"object"==typeof t&&Fn.call(t)==G||!1}function $t(t){return t&&nt[typeof t]&&Fn.call(t)==J||!1}function Ht(t){return"string"==typeof t||t&&"object"==typeof t&&Fn.call(t)==Q||!1}function zt(t){return"undefined"==typeof t}function Bt(t,n,r){var i={};return n=e.createCallback(n,r,3),kr(t,function(t,e,r){i[e]=n(t,e,r)}),i}function qt(t){var e=arguments,n=2;if(!Ft(t))return t;if("number"!=typeof e[2]&&(n=e.length),n>3&&"function"==typeof e[n-2])var r=w(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var i=v(arguments,1,n),o=-1,a=p(),s=p();++o<n;)st(t,i[o],r,a,s);return f(a),f(s),t}function Wt(t,n,r){var i={};if("function"!=typeof n){var o=[];Er(t,function(t,e){o.push(e)}),o=rt(o,ot(arguments,!0,!1,1));for(var a=-1,s=o.length;++a<s;){var u=o[a];i[u]=t[u]}}else n=e.createCallback(n,r,3),Er(t,function(t,e,r){n(t,e,r)||(i[e]=t)});return i}function Kt(t){for(var e=-1,n=dr(t),r=n.length,i=_n(r);++e<r;){var o=n[e];i[e]=[o,t[o]]}return i}function Gt(t,n,r){var i={};if("function"!=typeof n)for(var o=-1,a=ot(arguments,!0,!1,1),s=Ft(t)?a.length:0;++o<s;){var u=a[o];u in t&&(i[u]=t[u])}else n=e.createCallback(n,r,3),Er(t,function(t,e,r){n(t,e,r)&&(i[e]=t)});return i}function Yt(t,n,r,i){var o=pr(t);if(null==r)if(o)r=[];else{var a=t&&t.constructor,s=a&&a.prototype;r=b(s)}return n&&(n=e.createCallback(n,i,4),(o?_r:kr)(t,function(t,e,i){return n(r,t,e,i)})),r}function Jt(t){for(var e=-1,n=dr(t),r=n.length,i=_n(r);++e<r;)i[e]=t[n[e]];return i}function Qt(t){var e=arguments,n=-1,r=ot(e,!0,!1,1),i=e[2]&&e[2][e[1]]===t?1:r.length,o=_n(i);for(ur.unindexedChars&&Ht(t)&&(t=t.split(""));++n<i;)o[n]=t[r[n]];return o}function Xt(t,e,n){var r=-1,i=mt(),o=t?t.length:0,a=!1;return n=(0>n?nr(0,o+n):n)||0,pr(t)?a=i(t,e,n)>-1:"number"==typeof o?a=(Ht(t)?t.indexOf(e,n):i(t,e,n))>-1:_r(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function Zt(t,n,r){var i=!0;if(n=e.createCallback(n,r,3),pr(t))for(var o=-1,a=t.length;++o<a&&(i=!!n(t[o],o,t)););else _r(t,function(t,e,r){return i=!!n(t,e,r)});return i}function te(t,n,r){var i=[];if(n=e.createCallback(n,r,3),pr(t))for(var o=-1,a=t.length;++o<a;){var s=t[o];n(s,o,t)&&i.push(s)}else _r(t,function(t,e,r){n(t,e,r)&&i.push(t)});return i}function ee(t,n,r){if(n=e.createCallback(n,r,3),!pr(t)){var i;return _r(t,function(t,e,r){return n(t,e,r)?(i=t,!1):void 0}),i}for(var o=-1,a=t.length;++o<a;){var s=t[o];if(n(s,o,t))return s}}function ne(t,n,r){var i;return n=e.createCallback(n,r,3),ie(t,function(t,e,r){return n(t,e,r)?(i=t,!1):void 0}),i}function re(t,e,n){if(e&&"undefined"==typeof n&&pr(t))for(var r=-1,i=t.length;++r<i&&e(t[r],r,t)!==!1;);else _r(t,e,n);return t}function ie(t,e,n){var r=t,i=t?t.length:0;if(e=e&&"undefined"==typeof n?e:w(e,n,3),pr(t))for(;i--&&e(t[i],i,t)!==!1;);else{if("number"!=typeof i){var o=dr(t);i=o.length}else ur.unindexedChars&&Ht(t)&&(r=t.split(""));_r(t,function(t,n,a){return n=o?o[--i]:--i,e(r[n],n,a)})}return t}function oe(t,e){var n=v(arguments,2),r=-1,i="function"==typeof e,o=t?t.length:0,a=_n("number"==typeof o?o:0);return re(t,function(t){a[++r]=(i?e:t[e]).apply(t,n)}),a}function ae(t,n,r){var i=-1,o=t?t.length:0,a=_n("number"==typeof o?o:0);if(n=e.createCallback(n,r,3),pr(t))for(;++i<o;)a[i]=n(t[i],i,t);else _r(t,function(t,e,r){a[++i]=n(t,e,r)});return a}function se(t,n,r){var i=-(1/0),o=i;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&pr(t))for(var a=-1,u=t.length;++a<u;){var l=t[a];l>o&&(o=l)}else n=null==n&&Ht(t)?s:e.createCallback(n,r,3),_r(t,function(t,e,r){var a=n(t,e,r);a>i&&(i=a,o=t)});return o}function ue(t,n,r){var i=1/0,o=i;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&pr(t))for(var a=-1,u=t.length;++a<u;){var l=t[a];o>l&&(o=l)}else n=null==n&&Ht(t)?s:e.createCallback(n,r,3),_r(t,function(t,e,r){var a=n(t,e,r);i>a&&(i=a,o=t)});return o}function le(t,n,r,i){var o=arguments.length<3;if(n=e.createCallback(n,i,4),pr(t)){var a=-1,s=t.length;for(o&&(r=t[++a]);++a<s;)r=n(r,t[a],a,t)}else _r(t,function(t,e,i){r=o?(o=!1,t):n(r,t,e,i)});return r}function ce(t,n,r,i){var o=arguments.length<3;return n=e.createCallback(n,i,4),ie(t,function(t,e,i){r=o?(o=!1,t):n(r,t,e,i)}),r}function pe(t,n,r){return n=e.createCallback(n,r,3),te(t,function(t,e,r){return!n(t,e,r)})}function he(t,e,n){if(t&&"number"!=typeof t.length?t=Jt(t):ur.unindexedChars&&Ht(t)&&(t=t.split("")),null==e||n)return t?t[ut(0,t.length-1)]:g;var r=de(t);return r.length=rr(nr(0,e),r.length),r}function de(t){var e=-1,n=t?t.length:0,r=_n("number"==typeof n?n:0);return re(t,function(t){var n=ut(0,++e);r[e]=r[n],r[n]=t}),r}function fe(t){var e=t?t.length:0;return"number"==typeof e?e:dr(t).length}function me(t,n,r){var i;if(n=e.createCallback(n,r,3),pr(t))for(var o=-1,a=t.length;++o<a&&!(i=n(t[o],o,t)););else _r(t,function(t,e,r){return!(i=n(t,e,r))});return!!i}function ve(t,n,r){var i=-1,o=pr(n),a=t?t.length:0,s=_n("number"==typeof a?a:0);for(o||(n=e.createCallback(n,r,3)),re(t,function(t,e,r){var a=s[++i]=h();o?a.criteria=ae(n,function(e){return t[e]}):(a.criteria=p())[0]=n(t,e,r),a.index=i,a.value=t}),a=s.length,s.sort(u);a--;){var l=s[a];s[a]=l.value,o||f(l.criteria),m(l)}return s}function ye(t){return t&&"number"==typeof t.length?ur.unindexedChars&&Ht(t)?t.split(""):v(t):Jt(t)}function ge(t){for(var e=-1,n=t?t.length:0,r=[];++e<n;){var i=t[e];i&&r.push(i)}return r}function be(t){return rt(t,ot(arguments,!0,!0,1))}function we(t,n,r){var i=-1,o=t?t.length:0;for(n=e.createCallback(n,r,3);++i<o;)if(n(t[i],i,t))return i;return-1}function _e(t,n,r){var i=t?t.length:0;for(n=e.createCallback(n,r,3);i--;)if(n(t[i],i,t))return i;return-1}function xe(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=-1;for(n=e.createCallback(n,r,3);++a<o&&n(t[a],a,t);)i++}else if(i=n,null==i||r)return t?t[0]:g;return v(t,0,rr(nr(0,i),o))}function Ce(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n="function"!=typeof e&&r&&r[e]===t?null:e,e=!1),null!=n&&(t=ae(t,n,r)),ot(t,e)}function Ee(t,e,n){if("number"==typeof n){var i=t?t.length:0;n=0>n?nr(0,i+n):n||0}else if(n){var o=je(t,e);return t[o]===e?o:-1}return r(t,e,n)}function ke(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=o;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)i++}else i=null==n||r?1:n||i;return v(t,0,rr(nr(0,o-i),o))}function Se(){for(var t=[],e=-1,n=arguments.length,i=p(),a=mt(),s=a===r,u=p();++e<n;){var c=arguments[e];(pr(c)||bt(c))&&(t.push(c),i.push(s&&c.length>=E&&l(e?t[e]:u)))}var h=t[0],d=-1,v=h?h.length:0,y=[];t:for(;++d<v;){var g=i[0];if(c=h[d],(g?o(g,c):a(u,c))<0){for(e=n,(g||u).push(c);--e;)if(g=i[e],(g?o(g,c):a(t[e],c))<0)continue t;y.push(c)}}for(;n--;)g=i[n],g&&m(g);return f(i),f(u),y}function Pe(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=o;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)i++}else if(i=n,null==i||r)return t?t[o-1]:g;return v(t,nr(0,o-i))}function Ae(t,e,n){var r=t?t.length:0;for("number"==typeof n&&(r=(0>n?nr(0,r+n):rr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function Oe(t){for(var e=arguments,n=0,r=e.length,i=t?t.length:0;++n<r;)for(var o=-1,a=e[n];++o<i;)t[o]===a&&(Gn.call(t,o--,1),i--);return t}function Te(t,e,n){t=+t||0,n="number"==typeof n?n:+n||1,null==e&&(e=t,t=0);for(var r=-1,i=nr(0,Ln((e-t)/(n||1))),o=_n(i);++r<i;)o[r]=t,t+=n;return o}function Ie(t,n,r){var i=-1,o=t?t.length:0,a=[];for(n=e.createCallback(n,r,3);++i<o;){var s=t[i];n(s,i,t)&&(a.push(s),Gn.call(t,i--,1),o--)}return a}function Me(t,n,r){if("number"!=typeof n&&null!=n){var i=0,o=-1,a=t?t.length:0;for(n=e.createCallback(n,r,3);++o<a&&n(t[o],o,t);)i++}else i=null==n||r?1:nr(0,n);return v(t,i)}function je(t,n,r,i){var o=0,a=t?t.length:o;for(r=r?e.createCallback(r,i,1):on,n=r(n);a>o;){var s=o+a>>>1;r(t[s])<n?o=s+1:a=s}return o}function Ne(){return ct(ot(arguments,!0,!0))}function Re(t,n,r,i){return"boolean"!=typeof n&&null!=n&&(i=r,r="function"!=typeof n&&i&&i[n]===t?null:n,n=!1),null!=r&&(r=e.createCallback(r,i,3)),ct(t,n,r)}function Ue(t){return rt(t,v(arguments,1))}function Fe(){for(var t=-1,e=arguments.length;++t<e;){var n=arguments[t];if(pr(n)||bt(n))var r=r?ct(rt(r,n).concat(rt(n,r))):n}return r||[]}function De(){for(var t=arguments.length>1?arguments:arguments[0],e=-1,n=t?se(Tr(t,"length")):0,r=_n(0>n?0:n);++e<n;)r[e]=Tr(t,e);return r}function Le(t,e){var n=-1,r=t?t.length:0,i={};for(e||!r||pr(t[0])||(e=[]);++n<r;){var o=t[n];e?i[o]=e[n]:o&&(i[o[0]]=o[1])}return i}function Ve(t,e){if(!Ut(e))throw new In;return function(){return--t<1?e.apply(this,arguments):void 0}}function $e(t,e){return arguments.length>2?ht(t,17,v(arguments,2),null,e):ht(t,1,null,null,e)}function He(t){for(var e=arguments.length>1?ot(arguments,!0,!1,1):Pt(t),n=-1,r=e.length;++n<r;){var i=e[n];t[i]=ht(t[i],1,null,null,t)}return t}function ze(t,e){return arguments.length>2?ht(e,19,v(arguments,2),null,t):ht(e,3,null,null,t)}function Be(){for(var t=arguments,e=t.length;e--;)if(!Ut(t[e]))throw new In;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function qe(t,e){return e="number"==typeof e?e:+e||t.length,ht(t,4,null,null,null,e)}function We(t,e,n){var r,i,o,a,s,u,l,c=0,p=!1,h=!0;if(!Ut(t))throw new In;if(e=nr(0,e)||0,n===!0){var d=!0;h=!1}else Ft(n)&&(d=n.leading,p="maxWait"in n&&(nr(e,n.maxWait)||0),h="trailing"in n?n.trailing:h);var f=function(){var n=e-(Mr()-a);if(0>=n){i&&Vn(i);var p=l;i=u=l=g,p&&(c=Mr(),o=t.apply(s,r),u||i||(r=s=null))}else u=Kn(f,n)},m=function(){u&&Vn(u),i=u=l=g,(h||p!==e)&&(c=Mr(),o=t.apply(s,r),u||i||(r=s=null))};return function(){if(r=arguments,a=Mr(),s=this,l=h&&(u||!d),p===!1)var n=d&&!u;else{i||d||(c=a);var v=p-(a-c),y=0>=v;
9
+
10
+ y?(i&&(i=Vn(i)),c=a,o=t.apply(s,r)):i||(i=Kn(m,v))}return y&&u?u=Vn(u):u||e===p||(u=Kn(f,e)),n&&(y=!0,o=t.apply(s,r)),!y||u||i||(r=s=null),o}}function Ke(t){if(!Ut(t))throw new In;var e=v(arguments,1);return Kn(function(){t.apply(g,e)},1)}function Ge(t,e){if(!Ut(t))throw new In;var n=v(arguments,2);return Kn(function(){t.apply(g,n)},e)}function Ye(t,e){if(!Ut(t))throw new In;var n=function(){var r=n.cache,i=e?e.apply(this,arguments):C+arguments[0];return Bn.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return n.cache={},n}function Je(t){var e,n;if(!Ut(t))throw new In;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function Qe(t){return ht(t,16,v(arguments,1))}function Xe(t){return ht(t,32,null,v(arguments,1))}function Ze(t,e,n){var r=!0,i=!0;if(!Ut(t))throw new In;return n===!1?r=!1:Ft(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),Z.leading=r,Z.maxWait=e,Z.trailing=i,We(t,e,Z)}function tn(t,e){return ht(e,16,[t])}function en(t){return function(){return t}}function nn(t,e,n){var r=typeof t;if(null==t||"function"==r)return w(t,e,n);if("object"!=r)return ln(t);var i=dr(t),o=i[0],a=t[o];return 1!=i.length||a!==a||Ft(a)?function(e){for(var n=i.length,r=!1;n--&&(r=at(e[i[n]],t[i[n]],null,!0)););return r}:function(t){var e=t[o];return a===e&&(0!==a||1/a==1/e)}}function rn(t){return null==t?"":Tn(t).replace(wr,ft)}function on(t){return t}function an(t,r,i){var o=!0,a=r&&Pt(r);r&&(i||a.length)||(null==i&&(i=r),s=n,r=t,t=e,a=Pt(r)),i===!1?o=!1:Ft(i)&&"chain"in i&&(o=i.chain);var s=t,u=Ut(s);re(a,function(e){var n=t[e]=r[e];u&&(s.prototype[e]=function(){var e=this.__chain__,r=this.__wrapped__,i=[r];qn.apply(i,arguments);var a=n.apply(t,i);if(o||e){if(r===a&&Ft(a))return this;a=new s(a),a.__chain__=e}return a})})}function sn(){return t._=Un,this}function un(){}function ln(t){return function(e){return e[t]}}function cn(t,e,n){var r=null==t,i=null==e;if(null==n&&("boolean"==typeof t&&i?(n=t,t=1):i||"boolean"!=typeof e||(n=e,i=!0)),r&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0,n||t%1||e%1){var o=or();return rr(t+o*(e-t+parseFloat("1e-"+((o+"").length-1))),e)}return ut(t,e)}function pn(t,e){if(t){var n=t[e];return Ut(n)?t[e]():n}}function hn(t,n,r){var i=e.templateSettings;t=Tn(t||""),r=Cr({},r,i);var o,a=Cr({},r.imports,i.imports),s=dr(a),u=Jt(a),l=0,p=r.interpolate||U,h="__p += '",d=On((r.escape||U).source+"|"+p.source+"|"+(p===N?I:U).source+"|"+(r.evaluate||U).source+"|$","g");t.replace(d,function(e,n,r,i,a,s){return r||(r=i),h+=t.slice(l,s).replace(D,c),n&&(h+="' +\n__e("+n+") +\n'"),a&&(o=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+e.length,e}),h+="';\n";var f=r.variable,m=f;m||(f="obj",h="with ("+f+") {\n"+h+"\n}\n"),h=(o?h.replace(A,""):h).replace(O,"$1").replace(T,"$1;"),h="function("+f+") {\n"+(m?"":f+" || ("+f+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var v="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+$++ +"]")+"\n*/";try{var y=kn(s,"return "+h+v).apply(g,u)}catch(b){throw b.source=h,b}return n?y(n):(y.source=h,y)}function dn(t,e,n){t=(t=+t)>-1?t:0;var r=-1,i=_n(t);for(e=w(e,n,1);++r<t;)i[r]=e(r);return i}function fn(t){return null==t?"":Tn(t).replace(br,gt)}function mn(t){var e=++_;return Tn(null==t?"":t)+e}function vn(t){return t=new n(t),t.__chain__=!0,t}function yn(t,e){return e(t),t}function gn(){return this.__chain__=!0,this}function bn(){return Tn(this.__wrapped__)}function wn(){return this.__wrapped__}t=t?lt.defaults(it.Object(),t,lt.pick(it,L)):it;var _n=t.Array,xn=t.Boolean,Cn=t.Date,En=t.Error,kn=t.Function,Sn=t.Math,Pn=t.Number,An=t.Object,On=t.RegExp,Tn=t.String,In=t.TypeError,Mn=[],jn=En.prototype,Nn=An.prototype,Rn=Tn.prototype,Un=t._,Fn=Nn.toString,Dn=On("^"+Tn(Fn).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Ln=Sn.ceil,Vn=t.clearTimeout,$n=Sn.floor,Hn=kn.prototype.toString,zn=vt(zn=An.getPrototypeOf)&&zn,Bn=Nn.hasOwnProperty,qn=Mn.push,Wn=Nn.propertyIsEnumerable,Kn=t.setTimeout,Gn=Mn.splice,Yn=Mn.unshift,Jn=function(){try{var t={},e=vt(e=An.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),Qn=vt(Qn=An.create)&&Qn,Xn=vt(Xn=_n.isArray)&&Xn,Zn=t.isFinite,tr=t.isNaN,er=vt(er=An.keys)&&er,nr=Sn.max,rr=Sn.min,ir=t.parseInt,or=Sn.random,ar={};ar[z]=_n,ar[B]=xn,ar[q]=Cn,ar[K]=kn,ar[Y]=An,ar[G]=Pn,ar[J]=On,ar[Q]=Tn;var sr={};sr[z]=sr[q]=sr[G]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},sr[B]=sr[Q]={constructor:!0,toString:!0,valueOf:!0},sr[W]=sr[K]=sr[J]={constructor:!0,toString:!0},sr[Y]={constructor:!0},function(){for(var t=V.length;t--;){var e=V[t];for(var n in sr)Bn.call(sr,n)&&!Bn.call(sr[n],e)&&(sr[n][e]=!1)}}(),n.prototype=e.prototype;var ur=e.support={};!function(){var e=function(){this.x=1},n={0:1,length:1},r=[];e.prototype={valueOf:1,y:1};for(var i in new e)r.push(i);for(i in arguments);ur.argsClass=Fn.call(arguments)==H,ur.argsObject=arguments.constructor==An&&!(arguments instanceof _n),ur.enumErrorProps=Wn.call(jn,"message")||Wn.call(jn,"name"),ur.enumPrototypes=Wn.call(e,"prototype"),ur.funcDecomp=!vt(t.WinRTError)&&F.test(y),ur.funcNames="string"==typeof kn.name,ur.nonEnumArgs=0!=i,ur.nonEnumShadows=!/valueOf/.test(r),ur.ownLast="x"!=r[0],ur.spliceObjects=(Mn.splice.call(n,0,1),!n[0]),ur.unindexedChars="x"[0]+An("x")[0]!="xx";try{ur.nodeClass=!(Fn.call(document)==Y&&!({toString:0}+""))}catch(o){ur.nodeClass=!0}}(1),e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:e}};var lr=function(t){var e="var index, iterable = "+t.firstArg+", result = "+t.init+";\nif (!iterable) return result;\n"+t.top+";";t.array?(e+="\nvar length = iterable.length; index = -1;\nif ("+t.array+") { ",ur.unindexedChars&&(e+="\n if (isString(iterable)) {\n iterable = iterable.split('')\n } "),e+="\n while (++index < length) {\n "+t.loop+";\n }\n}\nelse { "):ur.nonEnumArgs&&(e+="\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += '';\n "+t.loop+";\n }\n } else { "),ur.enumPrototypes&&(e+="\n var skipProto = typeof iterable == 'function';\n "),ur.enumErrorProps&&(e+="\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n ");var n=[];if(ur.enumPrototypes&&n.push('!(skipProto && index == "prototype")'),ur.enumErrorProps&&n.push('!(skipErrorProps && (index == "message" || index == "name"))'),t.useHas&&t.keys)e+="\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n",n.length&&(e+=" if ("+n.join(" && ")+") {\n "),e+=t.loop+"; ",n.length&&(e+="\n }"),e+="\n } ";else if(e+="\n for (index in iterable) {\n",t.useHas&&n.push("hasOwnProperty.call(iterable, index)"),n.length&&(e+=" if ("+n.join(" && ")+") {\n "),e+=t.loop+"; ",n.length&&(e+="\n }"),e+="\n } ",ur.nonEnumShadows){for(e+="\n\n if (iterable !== objectProto) {\n var ctor = iterable.constructor,\n isProto = iterable === (ctor && ctor.prototype),\n className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n nonEnum = nonEnumProps[className];\n ",k=0;k<7;k++)e+="\n index = '"+t.shadowedProps[k]+"';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))",t.useHas||(e+=" || (!nonEnum[index] && iterable[index] !== objectProto[index])"),e+=") {\n "+t.loop+";\n } ";e+="\n } "}return(t.array||ur.nonEnumArgs)&&(e+="\n}"),e+=t.bottom+";\nreturn result"};Qn||(b=function(){function e(){}return function(n){if(Ft(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}());var cr=Jn?function(t,e){tt.value=e,Jn(t,"__bindData__",tt),tt.value=null}:un;ur.argsClass||(bt=function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Bn.call(t,"callee")&&!Wn.call(t,"callee")||!1});var pr=Xn||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Fn.call(t)==z||!1},hr=dt({args:"object",init:"[]",top:"if (!(objectTypes[typeof object])) return result",loop:"result.push(index)"}),dr=er?function(t){return Ft(t)?ur.enumPrototypes&&"function"==typeof t||ur.nonEnumArgs&&t.length&&bt(t)?hr(t):er(t):[]}:hr,fr={args:"collection, callback, thisArg",top:"callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)",array:"typeof length == 'number'",keys:dr,loop:"if (callback(iterable[index], index, collection) === false) return result"},mr={args:"object, source, guard",top:"var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;\nwhile (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {",keys:dr,loop:"if (typeof result[index] == 'undefined') result[index] = iterable[index]",bottom:" }\n}"},vr={top:"if (!objectTypes[typeof iterable]) return result;\n"+fr.top,array:!1},yr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},gr=Ot(yr),br=On("("+dr(gr).join("|")+")","g"),wr=On("["+dr(yr).join("")+"]","g"),_r=dt(fr),xr=dt(mr,{top:mr.top.replace(";",";\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n callback = args[--argsLength];\n}"),loop:"result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"}),Cr=dt(mr),Er=dt(fr,vr,{useHas:!1}),kr=dt(fr,vr);Ut(/x/)&&(Ut=function(t){return"function"==typeof t&&Fn.call(t)==K});var Sr=zn?function(t){if(!t||Fn.call(t)!=Y||!ur.argsClass&&bt(t))return!1;var e=t.valueOf,n=vt(e)&&(n=zn(e))&&zn(n);return n?t==n||zn(t)==n:yt(t)}:yt,Pr=pt(function(t,e,n){Bn.call(t,n)?t[n]++:t[n]=1}),Ar=pt(function(t,e,n){(Bn.call(t,n)?t[n]:t[n]=[]).push(e)}),Or=pt(function(t,e,n){t[n]=e}),Tr=ae,Ir=te,Mr=vt(Mr=Cn.now)&&Mr||function(){return(new Cn).getTime()},jr=8==ir(P+"08")?ir:function(t,e){return ir(Ht(t)?t.replace(R,""):t,e||0)};return e.after=Ve,e.assign=xr,e.at=Qt,e.bind=$e,e.bindAll=He,e.bindKey=ze,e.chain=vn,e.compact=ge,e.compose=Be,e.constant=en,e.countBy=Pr,e.create=xt,e.createCallback=nn,e.curry=qe,e.debounce=We,e.defaults=Cr,e.defer=Ke,e.delay=Ge,e.difference=be,e.filter=te,e.flatten=Ce,e.forEach=re,e.forEachRight=ie,e.forIn=Er,e.forInRight=kt,e.forOwn=kr,e.forOwnRight=St,e.functions=Pt,e.groupBy=Ar,e.indexBy=Or,e.initial=ke,e.intersection=Se,e.invert=Ot,e.invoke=oe,e.keys=dr,e.map=ae,e.mapValues=Bt,e.max=se,e.memoize=Ye,e.merge=qt,e.min=ue,e.omit=Wt,e.once=Je,e.pairs=Kt,e.partial=Qe,e.partialRight=Xe,e.pick=Gt,e.pluck=Tr,e.property=ln,e.pull=Oe,e.range=Te,e.reject=pe,e.remove=Ie,e.rest=Me,e.shuffle=de,e.sortBy=ve,e.tap=yn,e.throttle=Ze,e.times=dn,e.toArray=ye,e.transform=Yt,e.union=Ne,e.uniq=Re,e.values=Jt,e.where=Ir,e.without=Ue,e.wrap=tn,e.xor=Fe,e.zip=De,e.zipObject=Le,e.collect=ae,e.drop=Me,e.each=re,e.eachRight=ie,e.extend=xr,e.methods=Pt,e.object=Le,e.select=te,e.tail=Me,e.unique=Re,e.unzip=De,an(e),e.clone=wt,e.cloneDeep=_t,e.contains=Xt,e.escape=rn,e.every=Zt,e.find=ee,e.findIndex=we,e.findKey=Ct,e.findLast=ne,e.findLastIndex=_e,e.findLastKey=Et,e.has=At,e.identity=on,e.indexOf=Ee,e.isArguments=bt,e.isArray=pr,e.isBoolean=Tt,e.isDate=It,e.isElement=Mt,e.isEmpty=jt,e.isEqual=Nt,e.isFinite=Rt,e.isFunction=Ut,e.isNaN=Dt,e.isNull=Lt,e.isNumber=Vt,e.isObject=Ft,e.isPlainObject=Sr,e.isRegExp=$t,e.isString=Ht,e.isUndefined=zt,e.lastIndexOf=Ae,e.mixin=an,e.noConflict=sn,e.noop=un,e.now=Mr,e.parseInt=jr,e.random=cn,e.reduce=le,e.reduceRight=ce,e.result=pn,e.runInContext=y,e.size=fe,e.some=me,e.sortedIndex=je,e.template=hn,e.unescape=fn,e.uniqueId=mn,e.all=Zt,e.any=me,e.detect=ee,e.findWhere=ee,e.foldl=le,e.foldr=ce,e.include=Xt,e.inject=le,an(function(){var t={};return kr(e,function(n,r){e.prototype[r]||(t[r]=n)}),t}(),!1),e.first=xe,e.last=Pe,e.sample=he,e.take=xe,e.head=xe,kr(e,function(t,r){var i="sample"!==r;e.prototype[r]||(e.prototype[r]=function(e,r){var o=this.__chain__,a=t(this.__wrapped__,e,r);return o||null!=e&&(!r||i&&"function"==typeof e)?new n(a,o):a})}),e.VERSION="2.4.2",e.prototype.chain=gn,e.prototype.toString=bn,e.prototype.value=wn,e.prototype.valueOf=wn,_r(["join","pop","shift"],function(t){var r=Mn[t];e.prototype[t]=function(){var t=this.__chain__,e=r.apply(this.__wrapped__,arguments);return t?new n(e,t):e}}),_r(["push","reverse","sort","unshift"],function(t){var n=Mn[t];e.prototype[t]=function(){return n.apply(this.__wrapped__,arguments),this}}),_r(["concat","slice","splice"],function(t){var r=Mn[t];e.prototype[t]=function(){return new n(r.apply(this.__wrapped__,arguments),this.__chain__)}}),ur.spliceObjects||_r(["pop","shift","splice"],function(t){var r=Mn[t],i="splice"==t;e.prototype[t]=function(){var t=this.__chain__,e=this.__wrapped__,o=r.apply(e,arguments);return 0===e.length&&delete e[0],t||i?new n(o,t):o}}),e}var g,b=[],w=[],_=0,x={},C=+new Date+"",E=75,S=40,P=" \f \ufeff\n\r\u2028\u2029 ᠎              ",A=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,T=/(__e\(.*?\)|\b__t\)) \+\n'';/g,I=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,M=/\w*$/,j=/^\s*function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,R=RegExp("^["+P+"]*0+(?=.$)"),U=/($^)/,F=/\bthis\b/,D=/['\n\r\t\u2028\u2029\\]/g,L=["Array","Boolean","Date","Error","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],V=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],$=0,H="[object Arguments]",z="[object Array]",B="[object Boolean]",q="[object Date]",W="[object Error]",K="[object Function]",G="[object Number]",Y="[object Object]",J="[object RegExp]",Q="[object String]",X={};X[K]=!1,X[H]=X[z]=X[B]=X[q]=X[G]=X[Y]=X[J]=X[Q]=!0;var Z={leading:!1,maxWait:0,trailing:!1},tt={configurable:!1,enumerable:!1,value:null,writable:!1},et={args:"",array:null,bottom:"",firstArg:"",init:"",keys:null,loop:"",shadowedProps:null,support:null,top:"",useHas:!1},nt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},rt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},it=nt[typeof window]&&window||this,ot=nt[typeof n]&&n&&!n.nodeType&&n,at=nt[typeof e]&&e&&!e.nodeType&&e,st=at&&at.exports===ot&&ot,ut=nt[typeof t]&&t;!ut||ut.global!==ut&&ut.window!==ut||(it=ut);var lt=y();"function"==typeof i&&"object"==typeof i.amd&&i.amd?(it._=lt,i(function(){return lt})):ot&&at?st?(at.exports=lt)._=lt:ot._=lt:it._=lt}).call(this),o("undefined"!=typeof _?_:window._)}).call(t,void 0,void 0,void 0,void 0,function(t){e.exports=t})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],224:[function(t,e,n){(function(t){!function(t){if("function"==typeof bootstrap)bootstrap("promise",t);else if("object"==typeof n)e.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=t}else Q=t()}(function(){"use strict";function e(t){return function(){return G.apply(t,arguments)}}function n(t){return t===Object(t)}function r(t){return"[object StopIteration]"===nt(t)||t instanceof B}function i(t,e){if($&&e.stack&&"object"==typeof t&&null!==t&&t.stack&&-1===t.stack.indexOf(rt)){for(var n=[],r=e;r;r=r.source)r.stack&&n.unshift(r.stack);n.unshift(t.stack);var i=n.join("\n"+rt+"\n");t.stack=o(i)}}function o(t){for(var e=t.split("\n"),n=[],r=0;r<e.length;++r){var i=e[r];u(i)||a(i)||!i||n.push(i)}return n.join("\n")}function a(t){return-1!==t.indexOf("(module.js:")||-1!==t.indexOf("(node.js:")}function s(t){var e=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);if(e)return[e[1],Number(e[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(t);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(t);return r?[r[1],Number(r[2])]:void 0}function u(t){var e=s(t);if(!e)return!1;var n=e[0],r=e[1];return n===z&&r>=q&&st>=r}function l(){if($)try{throw new Error}catch(t){var e=t.stack.split("\n"),n=e[0].indexOf("@")>0?e[1]:e[2],r=s(n);if(!r)return;return z=r[0],r[1]}}function c(t,e,n){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e+" is deprecated, use "+n+" instead.",new Error("").stack),t.apply(t,arguments)}}function p(t){return g(t)?t:b(t)?A(t):P(t)}function h(){function t(t){e=t,o.source=t,J(n,function(e,n){K(function(){t.promiseDispatch.apply(t,n)})},void 0),n=void 0,r=void 0}var e,n=[],r=[],i=Z(h.prototype),o=Z(m.prototype);if(o.promiseDispatch=function(t,i,o){var a=Y(arguments);n?(n.push(a),"when"===i&&o[1]&&r.push(o[1])):K(function(){e.promiseDispatch.apply(e,a)})},o.valueOf=function(){if(n)return o;var t=y(e);return g(t)&&(e=t),t},o.inspect=function(){return e?e.inspect():{state:"pending"}},p.longStackSupport&&$)try{throw new Error}catch(a){o.stack=a.stack.substring(a.stack.indexOf("\n")+1)}return i.promise=o,i.resolve=function(n){e||t(p(n))},i.fulfill=function(n){e||t(P(n))},i.reject=function(n){e||t(S(n))},i.notify=function(t){e||J(r,function(e,n){K(function(){n(t)})},void 0)},i}function d(t){if("function"!=typeof t)throw new TypeError("resolver must be a function.");var e=h();try{t(e.resolve,e.reject,e.notify)}catch(n){e.reject(n)}return e.promise}function f(t){return d(function(e,n){for(var r=0,i=t.length;i>r;r++)p(t[r]).then(e,n)})}function m(t,e,n){void 0===e&&(e=function(t){return S(new Error("Promise does not support operation: "+t))}),void 0===n&&(n=function(){return{state:"unknown"}});var r=Z(m.prototype);if(r.promiseDispatch=function(n,i,o){var a;try{a=t[i]?t[i].apply(r,o):e.call(r,i,o)}catch(s){a=S(s)}n&&n(a)},r.inspect=n,n){var i=n();"rejected"===i.state&&(r.exception=i.reason),r.valueOf=function(){var t=n();return"pending"===t.state||"rejected"===t.state?r:t.value}}return r}function v(t,e,n,r){return p(t).then(e,n,r)}function y(t){if(g(t)){var e=t.inspect();if("fulfilled"===e.state)return e.value}return t}function g(t){return n(t)&&"function"==typeof t.promiseDispatch&&"function"==typeof t.inspect}function b(t){return n(t)&&"function"==typeof t.then}function w(t){return g(t)&&"pending"===t.inspect().state}function _(t){return!g(t)||"fulfilled"===t.inspect().state}function x(t){return g(t)&&"rejected"===t.inspect().state}function C(){it.length=0,ot.length=0,at||(at=!0)}function E(t,e){at&&(ot.push(t),it.push(e&&"undefined"!=typeof e.stack?e.stack:"(no stack) "+e))}function k(t){if(at){var e=Q(ot,t);-1!==e&&(ot.splice(e,1),it.splice(e,1))}}function S(t){var e=m({when:function(e){return e&&k(this),e?e(t):this}},function(){return this},function(){return{state:"rejected",reason:t}});return E(e,t),e}function P(t){return m({when:function(){return t},get:function(e){return t[e]},set:function(e,n){t[e]=n},"delete":function(e){delete t[e]},post:function(e,n){return null===e||void 0===e?t.apply(void 0,n):t[e].apply(t,n)},apply:function(e,n){return t.apply(e,n)},keys:function(){return et(t)}},void 0,function(){return{state:"fulfilled",value:t}})}function A(t){var e=h();return K(function(){try{t.then(e.resolve,e.reject,e.notify)}catch(n){e.reject(n)}}),e.promise}function O(t){return m({isDef:function(){}},function(e,n){return R(t,e,n)},function(){return p(t).inspect()})}function T(t,e,n){return p(t).spread(e,n)}function I(t){return function(){function e(t,e){var a;if("undefined"==typeof StopIteration){try{a=n[t](e)}catch(s){return S(s)}return a.done?a.value:v(a.value,i,o)}try{a=n[t](e)}catch(s){return r(s)?s.value:S(s)}return v(a,i,o)}var n=t.apply(this,arguments),i=e.bind(e,"next"),o=e.bind(e,"throw");return i()}}function M(t){p.done(p.async(t)())}function j(t){throw new B(t)}function N(t){return function(){return T([this,U(arguments)],function(e,n){return t.apply(e,n)})}}function R(t,e,n){return p(t).dispatch(e,n)}function U(t){return v(t,function(t){var e=0,n=h();return J(t,function(r,i,o){var a;g(i)&&"fulfilled"===(a=i.inspect()).state?t[o]=a.value:(++e,v(i,function(r){t[o]=r,0===--e&&n.resolve(t)},n.reject,function(t){n.notify({index:o,value:t})}))},void 0),0===e&&n.resolve(t),n.promise})}function F(t){return v(t,function(t){return t=X(t,p),v(U(X(t,function(t){return v(t,W,W)})),function(){return t})})}function D(t){return p(t).allSettled()}function L(t,e){return p(t).then(void 0,void 0,e)}function V(t,e){return p(t).nodeify(e)}var $=!1;try{throw new Error}catch(H){$=!!H.stack}var z,B,q=l(),W=function(){},K=function(){function e(){for(;n.next;){n=n.next;var t=n.task;n.task=void 0;var r=n.domain;r&&(n.domain=void 0,r.enter());try{t()}catch(o){if(a)throw r&&r.exit(),setTimeout(e,0),r&&r.enter(),o;setTimeout(function(){throw o},0)}r&&r.exit()}i=!1}var n={task:void 0,next:null},r=n,i=!1,o=void 0,a=!1;if(K=function(e){r=r.next={task:e,domain:a&&t.domain,next:null},i||(i=!0,o())},"undefined"!=typeof t&&t.nextTick)a=!0,o=function(){t.nextTick(e)};else if("function"==typeof setImmediate)o="undefined"!=typeof window?setImmediate.bind(window,e):function(){setImmediate(e)};else if("undefined"!=typeof MessageChannel){var s=new MessageChannel;s.port1.onmessage=function(){o=u,s.port1.onmessage=e,e()};var u=function(){s.port2.postMessage(0)};o=function(){setTimeout(e,0),u()}}else o=function(){setTimeout(e,0)};return K}(),G=Function.call,Y=e(Array.prototype.slice),J=e(Array.prototype.reduce||function(t,e){var n=0,r=this.length;if(1===arguments.length)for(;;){if(n in this){e=this[n++];break}if(++n>=r)throw new TypeError}for(;r>n;n++)n in this&&(e=t(e,this[n],n));return e}),Q=e(Array.prototype.indexOf||function(t){for(var e=0;e<this.length;e++)if(this[e]===t)return e;return-1}),X=e(Array.prototype.map||function(t,e){var n=this,r=[];return J(n,function(i,o,a){r.push(t.call(e,o,a,n))},void 0),r}),Z=Object.create||function(t){function e(){}return e.prototype=t,new e},tt=e(Object.prototype.hasOwnProperty),et=Object.keys||function(t){var e=[];for(var n in t)tt(t,n)&&e.push(n);return e},nt=e(Object.prototype.toString);B="undefined"!=typeof ReturnValue?ReturnValue:function(t){this.value=t};var rt="From previous event:";p.resolve=p,p.nextTick=K,p.longStackSupport=!1,p.defer=h,h.prototype.makeNodeResolver=function(){var t=this;return function(e,n){e?t.reject(e):t.resolve(arguments.length>2?Y(arguments,1):n)}},p.Promise=d,p.promise=d,d.race=f,d.all=U,d.reject=S,d.resolve=p,p.passByCopy=function(t){return t},m.prototype.passByCopy=function(){return this},p.join=function(t,e){return p(t).join(e)},m.prototype.join=function(t){return p([this,t]).spread(function(t,e){if(t===e)return t;throw new Error("Can't join: not the same: "+t+" "+e)})},p.race=f,m.prototype.race=function(){return this.then(p.race)},p.makePromise=m,m.prototype.toString=function(){return"[object Promise]"},m.prototype.then=function(t,e,n){function r(e){try{return"function"==typeof t?t(e):e}catch(n){return S(n)}}function o(t){if("function"==typeof e){i(t,s);try{return e(t)}catch(n){return S(n)}}return S(t)}function a(t){return"function"==typeof n?n(t):t}var s=this,u=h(),l=!1;return K(function(){s.promiseDispatch(function(t){l||(l=!0,u.resolve(r(t)))},"when",[function(t){l||(l=!0,u.resolve(o(t)))}])}),s.promiseDispatch(void 0,"when",[void 0,function(t){var e,n=!1;try{e=a(t)}catch(r){if(n=!0,!p.onerror)throw r;p.onerror(r)}n||u.notify(e)}]),u.promise},p.when=v,m.prototype.thenResolve=function(t){return this.then(function(){return t})},p.thenResolve=function(t,e){return p(t).thenResolve(e)},m.prototype.thenReject=function(t){return this.then(function(){throw t})},p.thenReject=function(t,e){return p(t).thenReject(e)},p.nearer=y,p.isPromise=g,p.isPromiseAlike=b,p.isPending=w,m.prototype.isPending=function(){return"pending"===this.inspect().state},p.isFulfilled=_,m.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},p.isRejected=x,m.prototype.isRejected=function(){return"rejected"===this.inspect().state};var it=[],ot=[],at=!0;p.resetUnhandledRejections=C,p.getUnhandledReasons=function(){return it.slice()},p.stopUnhandledRejectionTracking=function(){C(),at=!1},C(),p.reject=S,p.fulfill=P,p.master=O,p.spread=T,m.prototype.spread=function(t,e){return this.all().then(function(e){return t.apply(void 0,e)},e)},p.async=I,p.spawn=M,p["return"]=j,p.promised=N,p.dispatch=R,m.prototype.dispatch=function(t,e){var n=this,r=h();return K(function(){n.promiseDispatch(r.resolve,t,e)}),r.promise},p.get=function(t,e){return p(t).dispatch("get",[e])},m.prototype.get=function(t){return this.dispatch("get",[t])},p.set=function(t,e,n){return p(t).dispatch("set",[e,n])},m.prototype.set=function(t,e){return this.dispatch("set",[t,e])},p.del=p["delete"]=function(t,e){return p(t).dispatch("delete",[e])},m.prototype.del=m.prototype["delete"]=function(t){return this.dispatch("delete",[t])},p.mapply=p.post=function(t,e,n){return p(t).dispatch("post",[e,n])},m.prototype.mapply=m.prototype.post=function(t,e){return this.dispatch("post",[t,e])},p.send=p.mcall=p.invoke=function(t,e){return p(t).dispatch("post",[e,Y(arguments,2)])},m.prototype.send=m.prototype.mcall=m.prototype.invoke=function(t){return this.dispatch("post",[t,Y(arguments,1)])},p.fapply=function(t,e){return p(t).dispatch("apply",[void 0,e])},m.prototype.fapply=function(t){return this.dispatch("apply",[void 0,t])},p["try"]=p.fcall=function(t){return p(t).dispatch("apply",[void 0,Y(arguments,1)])},m.prototype.fcall=function(){return this.dispatch("apply",[void 0,Y(arguments)])},p.fbind=function(t){var e=p(t),n=Y(arguments,1);return function(){return e.dispatch("apply",[this,n.concat(Y(arguments))])}},m.prototype.fbind=function(){var t=this,e=Y(arguments);return function(){return t.dispatch("apply",[this,e.concat(Y(arguments))])}},p.keys=function(t){return p(t).dispatch("keys",[])},m.prototype.keys=function(){return this.dispatch("keys",[])},p.all=U,m.prototype.all=function(){return U(this)},p.allResolved=c(F,"allResolved","allSettled"),m.prototype.allResolved=function(){return F(this)},p.allSettled=D,m.prototype.allSettled=function(){return this.then(function(t){return U(X(t,function(t){function e(){return t.inspect()}return t=p(t),t.then(e,e)}))})},p.fail=p["catch"]=function(t,e){return p(t).then(void 0,e)},m.prototype.fail=m.prototype["catch"]=function(t){return this.then(void 0,t)},p.progress=L,m.prototype.progress=function(t){return this.then(void 0,void 0,t)},p.fin=p["finally"]=function(t,e){return p(t)["finally"](e)},m.prototype.fin=m.prototype["finally"]=function(t){return t=p(t),this.then(function(e){return t.fcall().then(function(){return e})},function(e){return t.fcall().then(function(){throw e})})},p.done=function(t,e,n,r){return p(t).done(e,n,r)},m.prototype.done=function(e,n,r){var o=function(t){K(function(){if(i(t,a),!p.onerror)throw t;p.onerror(t)})},a=e||n||r?this.then(e,n,r):this;"object"==typeof t&&t&&t.domain&&(o=t.domain.bind(o)),a.then(void 0,o)},p.timeout=function(t,e,n){return p(t).timeout(e,n)},m.prototype.timeout=function(t,e){var n=h(),r=setTimeout(function(){n.reject(new Error(e||"Timed out after "+t+" ms"))},t);return this.then(function(t){clearTimeout(r),n.resolve(t)},function(t){clearTimeout(r),n.reject(t)},n.notify),n.promise},p.delay=function(t,e){return void 0===e&&(e=t,t=void 0),p(t).delay(e)},m.prototype.delay=function(t){return this.then(function(e){var n=h();return setTimeout(function(){n.resolve(e)},t),n.promise})},p.nfapply=function(t,e){return p(t).nfapply(e)},m.prototype.nfapply=function(t){var e=h(),n=Y(t);return n.push(e.makeNodeResolver()),this.fapply(n).fail(e.reject),e.promise},p.nfcall=function(t){var e=Y(arguments,1);return p(t).nfapply(e)},m.prototype.nfcall=function(){var t=Y(arguments),e=h();return t.push(e.makeNodeResolver()),this.fapply(t).fail(e.reject),e.promise},p.nfbind=p.denodeify=function(t){var e=Y(arguments,1);return function(){var n=e.concat(Y(arguments)),r=h();return n.push(r.makeNodeResolver()),p(t).fapply(n).fail(r.reject),r.promise}},m.prototype.nfbind=m.prototype.denodeify=function(){var t=Y(arguments);return t.unshift(this),p.denodeify.apply(void 0,t)},p.nbind=function(t,e){var n=Y(arguments,2);return function(){function r(){return t.apply(e,arguments)}var i=n.concat(Y(arguments)),o=h();return i.push(o.makeNodeResolver()),p(r).fapply(i).fail(o.reject),o.promise}},m.prototype.nbind=function(){var t=Y(arguments,0);return t.unshift(this),p.nbind.apply(void 0,t)},p.nmapply=p.npost=function(t,e,n){return p(t).npost(e,n)},m.prototype.nmapply=m.prototype.npost=function(t,e){var n=Y(e||[]),r=h();return n.push(r.makeNodeResolver()),this.dispatch("post",[t,n]).fail(r.reject),r.promise},p.nsend=p.nmcall=p.ninvoke=function(t,e){var n=Y(arguments,2),r=h();return n.push(r.makeNodeResolver()),p(t).dispatch("post",[e,n]).fail(r.reject),r.promise},m.prototype.nsend=m.prototype.nmcall=m.prototype.ninvoke=function(t){var e=Y(arguments,1),n=h();return e.push(n.makeNodeResolver()),this.dispatch("post",[t,e]).fail(n.reject),n.promise},p.nodeify=V,m.prototype.nodeify=function(t){return t?void this.then(function(e){K(function(){t(null,e)})},function(e){K(function(){t(e)})}):this};var st=l();return p})}).call(this,t("_process"))},{_process:173}],225:[function(t,e,n){"use strict";function r(t){this.rpcClient=t}var i=["getCreditCards","unlockCreditCard","sendAnalyticsEvents"];i.forEach(function(t){r.prototype[t]=function(){var e=[],n=Array.prototype.slice.call(arguments),r=n.splice(-1)[0];e=[t,n],"function"==typeof r?e.push(r):n.push(r),this.rpcClient.invoke.apply(this.rpcClient,e)}}),e.exports=r},{}],226:[function(t,e,n){"use strict";function r(t){this.view=t,this.node=t.$el.find("input").get(0),this.validators=t.config.validatorRules}var i=t("_");r.prototype.isValid=function(t){var e=this.getValue(),n=t?t.partial:!1,r=this.view;return i.chain(this.validators).map(function(t){var i=t.call(r,e);return n?i.isPotentiallyValid:i.isValid}).all().value()},r.prototype.setValue=function(t){this.node.value=t},r.prototype.getValue=function(){var t=this.node.value;return this.view.HAS_PLACEHOLDERS||t!==$(this.node).attr("placeholder")?t:""},e.exports=r},{_:223}],227:[function(t,e,n){"use strict";function r(t){this.settings=t,this.root=t.root||window,this.target=t.target||window.parent,this.container=t.container,this.bus=new a.MessageBus(this.root),this.rpcClient=new a.RPCClient(this.bus,this.target),this.rpcServer=new a.RPCServer(this.bus),this.apiProxyClient=new u(this.rpcClient),this.sharedCustomerIdentificationService=new l}var i=t("_"),o=t("braintree-api"),a=t("braintree-rpc"),s=t("braintree-coinbase"),u=t("./api-proxy-client"),l=t("./session/shared-customer-identification-service"),c=t("../shared/paypal-service"),p=t("braintree-paypal/src/shared/util/browser");r.prototype.initialize=function(){var t=this.sharedCustomerIdentificationService.getIdentifier();this.bus.send(this.target,"ready"),t&&this.rpcClient.invoke("receiveSharedCustomerIdentifier",[t]),this.rpcClient.invoke("getConfiguration",[],i.bind(this.completeInitialization,this))},r.prototype.completeInitialization=function(t){this.clientToken=o.parseClientToken(t.clientToken),this.apiClient=o.configure({clientToken:this.clientToken,enableCORS:t.enableCORS,analyticsConfiguration:t.analyticsConfiguration,integration:"dropin"}),this.hasPaypalEnabled=!1,this.clientToken&&this.clientToken.paypalEnabled&&(t.merchantHttps||this.clientToken.paypal.allowHttp)&&(this.hasPaypalEnabled=!0,p.isPopupSupported()&&this.rpcClient.invoke("getPayPalOptions",[],i.bind(this.paypalOptionsReceived,this))),this.hasCoinbaseEnabled=this.clientToken.coinbaseEnabled,this.hasCoinbaseEnabled&&(this.coinbaseIntegration=s.create({coinbase:{button:"coinbase-container"},apiClient:this.apiClient,configuration:this.clientToken}),null==this.coinbaseIntegration&&(this.hasCoinbaseEnabled=!1))},r.prototype.paypalOptionsReceived=function(t){t=t||{},this.ppClient=new c({clientToken:this.clientToken,paypal:t
11
+ })},e.exports=r},{"../shared/paypal-service":254,"./api-proxy-client":225,"./session/shared-customer-identification-service":242,_:223,"braintree-api":23,"braintree-coinbase":55,"braintree-paypal/src/shared/util/browser":159,"braintree-rpc":167}],228:[function(t,e,n){"use strict";var r=t("_"),i=t("../../shared/router"),o=t("./views/add-payment-method-view"),a=t("./views/show-payment-method-view"),s=t("../../shared/views/cancel-popup-view"),u=i.extend({routes:{addPaymentMethod:"addPaymentMethod","showPaymentMethod(/:status)":"showPaymentMethod"},initialize:function(t){return this.root=t.root,this.container=t.container,this.setViews(),this.root.rpcServer.define("requestNonce",r.bind(this.handleNonceRequest,this)),this},setViews:function(){this.views={addPaymentMethod:new o({root:this.root}),showPaymentMethod:new a({root:this.root})},r.each(this.views,function(t){this.container.appendChild(t.el)},this),this.setGlobalViews()},setGlobalViews:function(){return new s},addPaymentMethod:function(){this.setCurrentView("addPaymentMethod")},showPaymentMethod:function(){this.setCurrentView("showPaymentMethod")},handleNonceRequest:function(t){this.views[this.currentView].handleRequestNonce(t)}});e.exports=u},{"../../shared/router":255,"../../shared/views/cancel-popup-view":257,"./views/add-payment-method-view":230,"./views/show-payment-method-view":232,_:223}],229:[function(t,e,n){"use strict";function r(t){o.call(this,t),this.initializedWithIdentifier=!1,this.paymentMethodsCollection=new a,this.router=new u({root:this,container:this.container}),this.paymentMethodsCollection.on("reset",i.bind(this.onCollectionReset,this))}var i=t("_"),o=t("../frame"),a=t("../../shared/collections/payment-method-collection"),s=t("./views/inline-frame-view"),u=t("./inline-frame-router"),l=t("../../shared/constants");r.prototype=Object.create(o.prototype),r.prototype.constructor=r,r.prototype.initialize=function(){o.prototype.initialize.call(this),this.rpcServer.define("receiveNewPaymentMethod",i.bind(this.receiveNewPaymentMethod,this)),this.rpcServer.define("selectPaymentMethod",i.bind(this.receiveSelectedPaymentMethod,this)),this.inlineFrameView=new s({rpcClient:this.rpcClient,rpcServer:this.rpcServer,container:this.container})},r.prototype.completeInitialization=function(t){o.prototype.completeInitialization.call(this,t),this.apiClient.getCreditCards(i.bind(this.receivePaymentMethods,this))},r.prototype.onCollectionReset=function(){var t=this.paymentMethodsCollection.getActiveModel();t.get("isLocked")||this.rpcClient.invoke("sendUnlockedNonce",[t.toJSON()])},r.prototype.receivePaymentMethods=function(t,e){var n=new RegExp(l.PAYMENT_METHOD_TYPES.join("|")),r=i.filter(e,function(t){return n.test(t.type)});r&&r.length?(this.paymentMethodsCollection.reset(r),this.router.navigate("showPaymentMethod")):this.router.navigate("addPaymentMethod"),this.inlineFrameView.render()},r.prototype.receiveNewPaymentMethod=function(t){var e="showPaymentMethod",n=this.router.currentView===e;this.paymentMethodsCollection.add(t),this.router.navigate(e,{silent:n}),n||requestAnimationFrame(function(){this.inlineFrameView.updateHeight()},this)},r.prototype.receiveSelectedPaymentMethod=function(t){this.paymentMethodsCollection.setActiveModel(t)},e.exports={Manager:r}},{"../../shared/collections/payment-method-collection":249,"../../shared/constants":250,"../frame":227,"./inline-frame-router":228,"./views/inline-frame-view":231,_:223}],230:[function(t,e,n){"use strict";var r=t("backbone"),i=t("../../../shared/views/payment-method-form-view"),o=t("../../../templates/inline/add-payment-method.hbs"),a=t("../../../shared/paypal-integration-manager"),s="hidden",u=r.View.extend({template:o,className:"add-payment-method-view "+s,events:{"click button.paypal":"handlePayPalClick"},initialize:function(t){this.root=t.root,this.paypalIntegration=new a(this.root)},render:function(){this.$el.html(this.template({paypalEnabled:this.root.hasPaypalEnabled,coinbaseEnabled:this.root.hasCoinbaseEnabled})),this.$formContainer=this.$el.find(".form-container"),this.formView=new i({root:this.root}),this.$formContainer.html(this.formView.render().el),this.show()},handlePayPalClick:function(){this.paypalIntegration.run()},handleRequestNonce:function(t){this.formView.successCallback=t,this.formView.submit()},hide:function(){this.$el.addClass(s)},show:function(){this.$el.removeClass(s)},destroy:function(){this.$el.empty()}});e.exports=u},{"../../../shared/paypal-integration-manager":253,"../../../shared/views/payment-method-form-view":261,"../../../templates/inline/add-payment-method.hbs":264,backbone:2}],231:[function(t,e,n){"use strict";function r(t){this.rpcClient=t.rpcClient,this.rpcServer=t.rpcServer,this.container=t.container,this.initialize()}var i=t("_"),o=window,a=$(o),s=$("body"),u="is-loading initial-inline-frame-loading";r.prototype.initialize=function(){this.setEvents()},r.prototype.setEvents=function(){a.on("resize",i.bind(this.handleViewportUpdate,this)),this.rpcServer.define("clearLoadingState",i.bind(this.removeLoadingState,this))},r.prototype.updateHeight=function(){var t=this.container.offsetHeight+2;this.rpcClient.invoke("setInlineFrameHeight",[t])},r.prototype.handleViewportUpdate=i.debounce(function(){this.updateHeight()},160),r.prototype.removeLoadingState=function(){s.removeClass(u)},r.prototype.render=function(){i.delay(i.bind(function(){this.removeLoadingState(),requestAnimationFrame(function(){this.updateHeight()},this)},this),16)},e.exports=r},{_:223}],232:[function(t,e,n){"use strict";var r=t("_"),i=t("backbone"),o=t("../../util/dropin-util"),a=t("../../../shared/models/form-card-model"),s=t("../../../shared/views/cvv-input-view"),u=t("../../../shared/views/postal-code-input-view"),l=t("../../../templates/inline/show-payment-method.hbs"),c="hidden",p=i.View.extend({template:l,className:"show-payment-method-view "+c,events:{"click #choose-payment-method":"handleChoosePaymentClick"},fields:{cvv:{challenge:"cvv",container:".cvv-label",constructor:s},postalCode:{challenge:"postal_code",container:".postal-code-label",constructor:u}},initialize:function(t){this.root=t.root,this.collection=t.root.paymentMethodsCollection,this.fieldViews=[]},setEvents:function(){this.isBoundToCollection||(this.isBoundToCollection=!0,this.listenTo(this.collection,"change:activeModel",this.render))},getViewModel:function(){var t=this.model.toJSON(),e=t.details&&t.details.email;return e&&(t.details.truncatedEmail=o.truncateEmail(e,o.getMaxCharLength())),t},render:function(){var t;this.model=this.collection.getActiveModel(),t=this.template({paymentMethod:this.getViewModel()}),this.$el.html(t),this.model.get("isLocked")&&this.setValidations(),this.show(),this.setEvents()},setValidations:function(){this.formCardModel=new a,this.challenges=this.model.get("securityQuestions"),this.fieldViews.length&&this.destroyFieldViews(),r.each(this.fields,function(t){var e;r.contains(this.challenges,t.challenge)&&(e=new t.constructor({el:this.$el.find(t.container),model:this.formCardModel}),this.fieldViews.push(e))},this)},handleChoosePaymentClick:function(t){t.preventDefault(),this.root.rpcClient.invoke("selectPaymentMethod",[this.root.paymentMethodsCollection])},isValid:function(){return r.chain(this.fieldViews).filter(function(t){return!t.isValid()}).value().length<1},handleRequestNonce:function(t){var e;this.isValid()&&(e={cvv:this.formCardModel.get("cvv")},r.contains(this.challenges,"postal_code")&&(e.postal_code=this.formCardModel.get("postalCode")),this.root.apiProxyClient.unlockCreditCard(this.model,e,function(e,n){t(n.nonce)}))},hide:function(){this.$el.addClass(c)},show:function(){this.$el.removeClass(c)},destroyFieldViews:function(){r.each(this.fieldViews,function(t){t.destroy()}),this.fieldViews=[]},destroy:function(){this.destroyFieldViews(),this.$el.empty()}});e.exports=p},{"../../../shared/models/form-card-model":251,"../../../shared/views/cvv-input-view":259,"../../../shared/views/postal-code-input-view":262,"../../../templates/inline/show-payment-method.hbs":265,"../../util/dropin-util":247,_:223,backbone:2}],233:[function(t,e,n){"use strict";var r=t("q"),i=t("_"),o=t("../../shared/router"),a=t("../../shared/views/cancel-popup-view"),s=t("./views/modal-view"),u=t("./views/list-payment-methods-view"),l=t("./views/add-payment-method-view"),c=o.extend({routes:{listPaymentMethods:"listPaymentMethods",addPaymentMethod:"addPaymentMethod"},initialize:function(t){var e=t.root;return this.viewContainer=new s({root:e}),this.views={listPaymentMethods:new u({root:e}),addPaymentMethod:new l({root:e})},i.each(this.views,function(t){this.viewContainer.$modalBody.append(t.el)},this),this.setGlobalViews(),this},setGlobalViews:function(){return new a},transitionViews:function(t){var e=this.views[this.currentView],n=r.defer();return e&&i.isFunction(e.renderOut)?e.renderOut().then(function(){n.resolve(t)}):n.resolve(t),n.promise},listPaymentMethods:function(){this.transitionViews("listPaymentMethods").then(i.bind(this.setCurrentView,this))},addPaymentMethod:function(){this.transitionViews("addPaymentMethod").then(i.bind(this.setCurrentView,this))},reset:function(){i.each(this.views,function(t){t.reset()}),this.currentView=null}});e.exports=c},{"../../shared/router":255,"../../shared/views/cancel-popup-view":257,"./views/add-payment-method-view":235,"./views/list-payment-methods-view":237,"./views/modal-view":238,_:223,q:224}],234:[function(t,e,n){"use strict";function r(t){s.call(this,t),this.paymentMethods=new u,this.router=new l({root:this}),f.on("keyup",o.bind(this.handleKeyup,this)),this.$container=f.find("#container"),this.rpcServer.define("open",o.bind(this.open,this))}var i=t("q"),o=t("_"),a=t("../util/dropin-util"),s=t("../frame"),u=t("../../shared/collections/payment-method-collection"),l=t("./modal-frame-router"),c="open",p="out",h="out-success",d=a.getPrefixedTransitionEnd(),f=$("body");r.prototype=Object.create(s.prototype),r.prototype.constructor=r,r.prototype.initialize=function(){s.prototype.initialize.call(this),this.isOpen=!1,this.rpcServer.define("selectPaymentMethod",o.bind(this.setSelectPaymentMethodView,this)),this.rpcServer.define("modalViewClose",o.bind(this.close,this))},r.prototype.completeInitialization=function(t){s.prototype.completeInitialization.call(this,t)},r.prototype.handleKeyup=function(t){27===t.which&&this.close({isCancel:!0})},r.prototype.setSelectPaymentMethodView=function(t){this.paymentMethods.reset(t)},r.prototype.open=function(t){this.isOpen=!0,requestAnimationFrame(function(){f.addClass(c),t(),o.defer(this.router.navigate,"listPaymentMethods")},this)},r.prototype.afterClose=function(t){f.removeClass(t),this.router.reset(),this.isOpen=!1,this.rpcClient.invoke("closeDropInModal")},r.prototype.renderOutInnerContent=function(t){var e=i.defer();return f.addClass(t.className),o.delay(e.resolve,t.delay,t),e.promise},r.prototype.renderOutModal=function(t){var e=o.bind(function(){this.afterClose(t.className)},this);Modernizr.csstransitions?this.$container.one(d,e):this.afterClose(t.className),f.removeClass(c)},r.prototype.close=function(t){var e,n,r;this.isOpen&&(e=t&&t.isCancel,n=Modernizr.csstransitions?600:16,r={className:e?p:h,delay:e?n:220},this.renderOutInnerContent(r).then(o.bind(this.renderOutModal,this)))},e.exports=r},{"../../shared/collections/payment-method-collection":249,"../frame":227,"../util/dropin-util":247,"./modal-frame-router":233,_:223,q:224}],235:[function(t,e,n){"use strict";var r=t("_"),i=t("./base-modal-view"),o=t("../../../shared/models/form-card-model"),a=t("../../../shared/views/payment-method-form-view"),s=t("../../../templates/modal/add-payment-method.hbs"),u=t("../../../shared/paypal-integration-manager"),l="is-active",c=".payment-method-add",p="button.paypal, button#coinbase-container",h=i.extend({template:s,className:"add-payment-method-view modal-frame-view ",events:function(){var t={"keyup input":"handleInputChange","click button.paypal":"handlePayPalClick"};return t["click "+c]="triggerFormSubmit",t["click .use-saved-payment-method-link"]="navigateToListView",t},initialize:function(t){this.root=t.root,this.paypalIntegration=new u(this.root),this.postInitialize()},render:function(){this.$el.html(this.template({paypalEnabled:this.root.hasPaypalEnabled,coinbaseEnabled:this.root.hasCoinbaseEnabled})),this.$formContainer=this.$el.find(".form-container"),this.createFormView(),this.$formContainer.html(this.formView.render().el),this.setElements(),this.show()},createFormView:function(){this.formModel=new o,this.formView=new a({root:this.root,isModal:!0,model:this.formModel,setSubmitButtonState:r.bind(this.setSubmitButtonState,this)})},setElements:function(){this.$submitButton=this.$el.find(c),this.$altpayButtons=this.$el.find(p)},triggerFormSubmit:function(){this.formView.submit()},setSubmitButtonState:function(t){r.each(t,function(t,e){this.$submitButton.prop(e,t)},this)},handleInputChange:function(){var t=this.formModel.isEmpty();this.$submitButton.prop("disabled",t),this.$altpayButtons.toggleClass(l,t)},handlePayPalClick:function(){this.paypalIntegration.run()},navigateToListView:function(){this.root.router.navigate("listPaymentMethods")},show:function(){i.prototype.show.apply(this,arguments),r.delay(r.bind(function(){this.formView.setFocusOnFirstInput()},this),240)}});e.exports=h},{"../../../shared/models/form-card-model":251,"../../../shared/paypal-integration-manager":253,"../../../shared/views/payment-method-form-view":261,"../../../templates/modal/add-payment-method.hbs":266,"./base-modal-view":236,_:223}],236:[function(t,e,n){"use strict";var r=t("_"),i=t("q"),o=t("../../util/dropin-util"),a=t("backbone"),s="render-in-assemble",u="render-out",l="has-rendered",c=Modernizr.csstransitions,p=o.getPrefixedAnimationEnd(),h=a.View.extend({constructor:function(){a.View.apply(this,arguments)},postInitialize:function(){c||this.$el.fadeOut(0)},show:function(){var t=r.bind(function(){this.$el.addClass(s)},this);c?r.delay(t,240):this.$el.delay(200).fadeIn(200)},hide:function(){c?this.renderOutModalView().then(r.bind(function(){this.$el.removeClass(u).addClass(l),this.promise.resolve()},this)):this.promise&&this.$el.fadeOut(200,r.bind(function(){this.promise.resolve()},this))},getAnimationBatchSize:function(){var t=this.$el.children();return r.filter(t,function(t){return"none"!==getComputedStyle(t).display}).length||t.length},renderOutModalView:function(){function t(){return r++,r===o?(e.off(p,t),void n.resolve()):void 0}var e=this.$el,n=i.defer(),r=0,o=this.getAnimationBatchSize();return e.on(p,t).addClass(u),n.promise},renderOut:function(){return this.promise=i.defer(),this.hide(),this.promise.promise},destroy:function(){this.$el.empty()},reset:function(){this.destroy(),this.$el.removeClass(function(){return[s,u,l].join(" ")})}});e.exports=h},{"../../util/dropin-util":247,_:223,backbone:2,q:224}],237:[function(t,e,n){"use strict";var r=t("_"),i=t("./base-modal-view"),o=t("./payment-method-item-view"),a=t("../../../templates/modal/list-payment-methods.hbs"),s=i.extend({template:a,className:"list-payment-methods-view modal-frame-view",events:{"click .add-payment-method-link":"handleAddPaymentMethod"},initialize:function(t){this.root=t.root,this.collection=t.root.paymentMethods,this.postInitialize()},render:function(){this.$el.html(this.template),this.renderItems(this.collection.models,this.$el.find(".payment-methods-list")),this.show()},renderItems:function(t,e){var n=r.map(t,function(t){return new o({root:this.root,model:t}).render().el},this);e.append(n)},handleAddPaymentMethod:function(t){t.preventDefault(),this.root.router.navigate("addPaymentMethod")}});e.exports=s},{"../../../templates/modal/list-payment-methods.hbs":267,"./base-modal-view":236,"./payment-method-item-view":239,_:223}],238:[function(t,e,n){"use strict";var r=t("backbone"),i=t("../../../templates/modal/modal.hbs"),o=r.View.extend({template:i,className:"modal",events:{"click .cancel-button":"handleCancelClick"},initialize:function(t){this.root=t.root,this.render()},render:function(){this.$el.html(this.template()),$(".modal-wrap").append(this.el),this.$modalBody=this.$el.find(".modal-container")},handleCancelClick:function(t){t.preventDefault(),this.root.close({isCancel:!0})}});e.exports=o},{"../../../templates/modal/modal.hbs":268,backbone:2}],239:[function(t,e,n){"use strict";var r=t("backbone"),i=t("../../util/dropin-util"),o=t("../../../templates/modal/payment-method-item.hbs"),a=r.View.extend({template:o,events:{click:"selectPaymentMethod"},initialize:function(t){this.root=t.root,this.rpcClient=t.root.rpcClient,this.render()},getViewModel:function(){var t=this.model.toJSON(),e=t.details&&t.details.email;return e&&(t.details.truncatedEmail=i.truncateEmail(e,i.getMaxCharLength(180))),t},render:function(){return this.$el.html(this.template(this.getViewModel())),this},selectPaymentMethod:function(){var t=this.model.toJSON();this.model.get("isLocked")?this.rpcClient.invoke("clearNonce"):this.rpcClient.invoke("sendUnlockedNonce",[t]),this.rpcClient.invoke("sendUsedPaymentMethod",[t]),this.root.close()}});e.exports=a},{"../../../templates/modal/payment-method-item.hbs":269,"../../util/dropin-util":247,backbone:2}],240:[function(t,e,n){"use strict";function r(){}r.prototype.set=function(t,e){document.cookie=t+"="+e+"; path=/; expires=Fri, 31 Dec 9999 23:59:59 GMT;"},r.prototype.get=function(t){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},e.exports=r},{}],241:[function(t,e,n){(function(t){"use strict";function n(){i&&t.localStorage.removeItem(r)}var r="__hls__",i=function(){try{return t.localStorage.setItem(r,!0),!0}catch(e){return!1}}();n.prototype.set=function(e,n){i&&t.localStorage.setItem(e,n)},n.prototype.get=function(e){return i?t.localStorage.getItem(e):null},e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],242:[function(t,e,n){"use strict";function r(){var t;this.sharedCustomerIdentificationStore=new i,this._sharedCustomerIdentifier=null,t=this.sharedCustomerIdentificationStore.get(),t&&this._handleIdentifier(t)}var i=t("./shared-customer-identification-store");r.prototype._handleIdentifier=function(t){this.sharedCustomerIdentificationStore.set(t),this._sharedCustomerIdentifier=t},r.prototype.getIdentifier=function(){return this._sharedCustomerIdentifier},r.prototype.hasIdentifier=function(){return!!this.getIdentifier()},r.prototype.fetchIdentifier=function(t){var e,n=this;this.hasIdentifier()&&t(this._sharedCustomerIdentifier),e=this.sharedCustomerIdentificationStore.get(),e?(this._handleIdentifier(e),t(this._sharedCustomerIdentifier)):this.triggerPopup(function(){e=n.sharedCustomerIdentificationStore.get(),n._handleIdentifier(e),t(n._sharedCustomerIdentifier)})},r.prototype.triggerPopup=function(t){var e,n=this;window.open("/web/popup","braintree.dropinPopup"),e=setInterval(function(){var r=n.sharedCustomerIdentificationStore.get();r&&(n._handleIdentifier(r),t(),clearInterval(e))},100)},e.exports=r},{"./shared-customer-identification-store":243}],243:[function(t,e,n){"use strict";function r(){this.COOKIE_NAME="venmotouch",this.cookie=new i,this.localStorage=new o}var i=t("./cookie"),o=t("./local-storage");r.prototype.set=function(t){this.cookie.set(this.COOKIE_NAME,t),this.localStorage.set(this.COOKIE_NAME,t)},r.prototype.get=function(){return this.localStorage.get(this.COOKIE_NAME)||this.cookie.get(this.COOKIE_NAME)||null},e.exports=r},{"./cookie":240,"./local-storage":241}],244:[function(t,e,n){"use strict";var r=t("_"),i=t("hbsfy/runtime"),o=t("../templates/partials/coinbase-button.hbs"),a={ifEqual:function(t,e,n){return t===e?n.fn(this):n.inverse(this)},ifOr:function(t,e,n){return t||e?n.fn(this):void 0},ifContains:function(t,e,n){return r.contains(t,e)?n.fn(this):""}};r.each(a,function(t,e){i.registerHelper(e,t)}),i.registerPartial("coinbaseButton",o),e.exports=a},{"../templates/partials/coinbase-button.hbs":270,_:223,"hbsfy/runtime":221}],245:[function(t,e,n){"use strict";function r(t){var e,n;return t=t.replace(/\s+/g,""),t.match("/")?(t=t.split("/"),{month:t[0],year:t[1].substr(0,4)}):(n="0"===t[0]||t.length>5||4===t.length?2:1,e=t.substr(0,n),{month:e,year:t.substr(e.length,4)})}e.exports={parseDate:r}},{}],246:[function(t,e,n){(function(t){"use strict";function n(){return Modernizr.touch&&a.match(/Android/i)}function r(){var t=a.match(/Android\s([0-9\.]*)/i);return t&&t[1]?t[1]:void 0}function i(){return a.match("Firefox")}var o,a=t.navigator.userAgent,s="4.4";o={isTouch:Modernizr.touch,shouldAutoTab:function(){return n()&&!i()},shouldFormat:function(){return n()&&(i()||r()<s)?!1:!0}},e.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],247:[function(t,e,n){"use strict";function r(t){var e,n=[{min:0,max:180,chars:7},{min:181,max:620,chars:14},{min:621,max:960,chars:22}];return t=t||$(window).width(),s.each(n,function(n){t>=n.min&&t<=n.max&&(e=n.chars)}),e||60}function i(t,e){var n,r;return-1===t.indexOf("@")?t:(t=t.split("@"),n=t[0],r=t[1],n.length>e&&(n=n.slice(0,e)+"..."),r.length>e&&(r="..."+r.slice(-e)),n+"@"+r)}function o(){var t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};return t[Modernizr.prefixed("transition")]}function a(){var t={WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",animation:"animationend"};return t[Modernizr.prefixed("animation")]}var s=t("_");!function(){var t,e,n,r=0,i=["ms","moz","webkit","o"];for(n=0;n<i.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[i[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[i[n]+"CancelAnimationFrame"]||window[i[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),n=Math.max(0,16-(e-r)),i=window.setTimeout(function(){t(e+n)},n);return r=e+n,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),t=window.requestAnimationFrame,e=window.cancelAnimationFrame,window.requestAnimationFrame=function(e,n){return t(function(){e.call(n,null)})},window.cancelAnimationFrame=function(t,n){return e(function(){t.call(n,null)})}}(),e.exports={getMaxCharLength:r,getPrefixedAnimationEnd:a,getPrefixedTransitionEnd:o,truncateEmail:i}},{_:223}],248:[function(t,e,n){"use strict";function r(){this.resetPattern=function(){}}var i=t("formatter.js/dist/formatter.js"),o=t("./device");e.exports=o.shouldFormat()?i:r},{"./device":246,"formatter.js/dist/formatter.js":213}],249:[function(t,e,n){"use strict";var r=t("backbone"),i=t("../models/payment-method-model"),o=r.Collection.extend({model:i,initialize:function(){this.on("add",function(t){this.setActiveModel(t.toJSON())},this),this.once("reset",this.bootstrap)},bootstrap:function(){var t=this.findWhere({lastUsedByCurrentMerchant:!0})||this.at(0);this.setActiveModel(t.toJSON())},setActiveModel:function(t){var e=t?t.nonce:this.at(0).get("nonce");this.each(function(t){t.set("isActive",t.get("nonce")===e)}),this.trigger("change:activeModel",this.findWhere({isActive:!0}))},getActiveModel:function(){return this.findWhere({isActive:!0})||this.at(0)},getActiveModelAttr:function(t){return this.getActiveModel().get(t)}});e.exports=o},{"../models/payment-method-model":252,backbone:2}],250:[function(t,e,n){e.exports={PAYPAL_INTEGRATION_NAME:"PayPal",INLINE_FRAME_NAME:"braintree-dropin-frame",MODAL_FRAME_NAME:"braintree-dropin-modal-frame",PAYMENT_METHOD_TYPES:["CoinbaseAccount","PayPalAccount","CreditCard"],cssClassMap:{"American Express":"american-express","Diners Club":"diners-club",DinersClub:"diners-club",Discover:"discover",JCB:"jcb",Maestro:"maestro",MasterCard:"master-card",Solo:"solo",Switch:"switch",UKMaestro:"maestro",UnionPay:"unionpay",Visa:"visa"}}},{}],251:[function(t,e,n){"use strict";var r=t("_"),i=t("backbone"),o=t("../../internal/util/date-manager"),a=t("../../internal/util/device").shouldFormat(),s={pattern:"{{9999}} {{9999}} {{9999}} {{9999}}",maxLength:19},u={pattern:"{{9999999999999999999}}",maxLength:19},l={"american-express":{pattern:"{{9999}} {{999999}} {{99999}}",maxLength:17},maestro:u,visa:s,"master-card":s,jcb:s,discover:s},c=i.Model.extend({defaults:{cardType:"",cardClass:"",cardNumber:"",cardNumberMaxLength:19,cardPattern:u.pattern,challenges:["cvv"],cvv:"",cvvAndZip:!1,cvvOnly:!1,cvvPatterns:{nonAmex:{attrs:{maxlength:"3",placeholder:"CVV"},pattern:"{{999}}",id:"cvv-icon",labelText:"CVV (3 digits)"},amex:{attrs:{maxlength:"4",placeholder:"CID"},pattern:"{{9999}}",id:"cid-icon",labelText:"CID (4 digits)"}},expirationDate:"",expirationDateMaxLengths:a?[7,8,9]:[4,5,6],expirationPatterns:[{"^[2-9]/?":"0{{9}} / {{9999}}"},{"*":"{{99}} / {{9999}}"}],postalCode:"",postalCodeMaxLength:8,postalCodePattern:{pattern:"{{********}}"},share:!1,crossMerchantSharing:!1,zipOnly:!1},initialize:function(){this.on("change:cardType",this.setFormatForCardType)},setFormatForCardType:function(){var t=l[this.get("cardType").type]||u;this.set({cardPattern:t.pattern,cardNumberMaxLength:t.maxLength})},splitExpirationDate:function(){var t=this.get("expirationDate").replace(/\s+|\//g,""),e=o.parseDate(t);this.set({expirationMonth:e.month,expirationYear:e.year})},getCardParams:function(){var t;return this.splitExpirationDate(),t={number:this.get("cardNumber"),expirationMonth:this.get("expirationMonth"),expirationYear:this.get("expirationYear"),cvv:this.get("cvv"),share:this.get("share")},r.contains(this.get("challenges"),"postal_code")&&(t.billingAddress={postalCode:this.get("postalCode")}),t},isEmpty:function(t){return t=t||["cardNumber","expirationDate","cvv","postalCode"],r.map(t,function(t){return this.get(t)},this).reduce(function(t,e){return t+e}).length<1}});e.exports=c},{"../../internal/util/date-manager":245,"../../internal/util/device":246,_:223,backbone:2}],252:[function(t,e,n){"use strict";var r=t("backbone"),i=t("../constants").cssClassMap,o=r.Model.extend({idAttribute:"nonce",initialize:function(){this.setClass()},setClass:function(){var t,e;"CreditCard"===this.get("type")?(t=this.get("details").cardType,e=t&&t.type?t.type:i[t]||"",this.set("cardTypeClass",e)):"CoinbaseAccount"===this.get("type")?(this.set("cardTypeClass","coinbase"),this.set("label","Coinbase")):(this.set("cardTypeClass","paypal"),this.set("label","PayPal"),this.normalizePayPalModel())},normalizePayPalModel:function(){this.set("type","PayPalAccount"),this.get("details")||(this.set("details",{email:this.get("email")}),this.unset("email"))}});e.exports=o},{"../constants":250,backbone:2}],253:[function(t,e,n){"use strict";function r(t){this.root=t,this.usePopup=a.isPopupSupported(),this.initialize()}var i=t("_"),o=t("braintree-bus"),a=t("braintree-paypal/src/shared/util/browser"),s=t("./constants");r.prototype.initialize=function(){this.attachEvents()},r.prototype.attachEvents=function(){o.on(o.events.UI_POPUP_FORCE_CLOSE,i.bind(this.handlePopupForceClose,this))},r.prototype.run=function(){this.usePopup?(this.root.ppClient.popup=this.root.ppClient._openPopup(),o.emit(o.events.UI_POPUP_DID_OPEN,{source:s.PAYPAL_INTEGRATION_NAME}),this.pollForPopup(this.root.ppClient.popup)):this.root.rpcClient.invoke("openPayPalModal")},r.prototype.pollForPopup=function(t){var e=setInterval(function(){t&&t.closed&&(clearInterval(e),o.emit(o.events.UI_POPUP_DID_CLOSE,{source:s.PAYPAL_INTEGRATION_NAME}))},100)},r.prototype.handlePopupForceClose=function(t){t.target===s.PAYPAL_INTEGRATION_NAME&&this.root.ppClient.popup&&this.root.ppClient.popup.close()},e.exports=r},{"./constants":250,_:223,"braintree-bus":52,"braintree-paypal/src/shared/util/browser":159}],254:[function(t,e,n){"use strict";function r(t){var e=t.clientToken,n=t.paypal||{},r=new i(e,{container:document.createElement("div"),displayName:n.displayName,locale:n.locale,singleUse:n.singleUse,amount:n.amount,currency:n.currency,onSuccess:n.onSuccess,enableShippingAddress:n.enableShippingAddress,shippingAddressOverride:n.shippingAddressOverride,enableBillingAddress:n.enableBillingAddress});return r.initialize(),r}var i=t("braintree-paypal/src/external/client");e.exports=r},{"braintree-paypal/src/external/client":148}],255:[function(t,e,n){"use strict";var r=t("backbone"),i=r.Router.extend({views:{},navigate:function(t,e){e&&e.silent?this.currentView=t:r.history.loadUrl(t)},setCurrentView:function(t,e){this.currentView&&this.views[this.currentView].destroy(),this.currentView=t,this.views[this.currentView].render(e)}});r.$=window.$,e.exports=i},{backbone:2}],256:[function(t,e,n){"use strict";function r(t){return a.debounce(function(){t.HAS_TRANSITIONS?t.$el.addClass(l):t.$el.find(p).animate({top:14,opacity:1},140)},h,!0)}function i(t){return a.debounce(function(e){t.HAS_TRANSITIONS?t.$el.removeClass(l):t.$el.find(p).animate({top:20,opacity:0},e||0)},h,!0)}var o=t("backbone"),a=t("_"),s=t("../../internal/util/device"),u="active",l="show-label",c="invalid",p=".field-name",h=200,d=o.View.extend({isActive:!1,constructor:function(){this.showLabelSpan=r(this),this.hideLabelSpan=i(this),o.View.apply(this,arguments)},events:{"focus input":"handleFocus","blur input":"handleBlur"},postInitialize:function(t){this.$input=this.$input||$(this.input),this.HAS_TRANSITIONS=Modernizr.csstransitions,this.HAS_PLACEHOLDERS=this.$input.length&&Modernizr.placeholder,this.HAS_PLACEHOLDERS||this.$input.val(this.$input.attr("placeholder")),this.HAS_TRANSITIONS||this.hideLabelSpan(),this.fieldIndex=a.isObject(t)&&a.has(t,"fieldIndex")?t.fieldIndex:999},toggleActive:function(){this.isActive=!this.isActive,this.$el.toggleClass(u,this.isActive)},handleFocus:function(){this.HAS_PLACEHOLDERS||this.$input.val()===this.$input.attr("placeholder")&&(this.$input.val(""),this.showLabelSpan()),this.$el.addClass(u)},autoFocus:function(t){var e=t&&t.force?t.force:!s.isTouch;e&&this.$input.focus()},handleBlur:function(){this.$input.val().length||(this.hideLabelSpan(),this.HAS_PLACEHOLDERS||this.$input.val(this.$input.attr("placeholder"))),this.$el.removeClass(u)},toggleLabelSpan:function(t){t.length||!this.HAS_PLACEHOLDERS?this.showLabelSpan():this.hideLabelSpan()},isEmpty:function(){var t=this.$input.val(),e=""===t;return this.HAS_PLACEHOLDERS?e:e||t===this.$input.attr("placeholder")},isValid:function(t){var e=this.validator?this.validator.isValid(t):!0;return e||this.renderInvalidState(),e},renderInvalidState:function(){this.$el.addClass(c)},renderValidState:function(){this.$el.removeClass(c)},autoAdvanceTab:function(){s.shouldAutoTab()&&o.trigger("ui:autoTab",{fieldIndex:this.fieldIndex})},inputIsComplete:function(t){return function(e){return e=t||e,parseInt(e,10)===this.$input.val().length}},destroy:function(){this.remove()}});e.exports=d},{"../../internal/util/device":246,_:223,backbone:2}],257:[function(t,e,n){"use strict";var r=t("_"),i=t("backbone"),o=t("braintree-bus"),a="ui-disabled",s=$("body"),u=i.View.extend({el:".cancel-popup",events:{"click .cancel-popup-button":"destroyPopup"},initialize:function(){this.currentPopupSource=null,this.setElements(),this.setEvents()},setElements:function(){this.el&&(this.button=this.el.querySelector("button"))},setEvents:function(){o.on(o.events.UI_POPUP_DID_OPEN,r.bind(this.handleOpenPopup,this)),o.on(o.events.UI_POPUP_DID_CLOSE,r.bind(this.handleClosePopup,this))},handleOpenPopup:function(t){var e=t.source;this.currentPopupSource=/Coinbase|PayPal/.test(e)?e:null,this.renderAndDisable()},handleClosePopup:function(){this.enableUI(),this.currentPopupSource=null},renderAndDisable:function(){this.button.innerHTML="Cancel "+(this.currentPopupSource||"")+" Login",this.disableUI()},enableUI:function(){s.removeClass(a)},disableUI:function(){s.addClass(a)},handleCancelClick:function(){this.destroyPopup()},destroyPopup:function(){this.currentPopupSource&&o.emit(o.events.UI_POPUP_FORCE_CLOSE,{target:this.currentPopupSource})}});e.exports=u},{_:223,backbone:2,
12
+ "braintree-bus":52}],258:[function(t,e,n){"use strict";var r=t("_"),i=t("../../internal/util/formatter-factory"),o=t("./base-input-view"),a=t("card-validator"),s=t("../../internal/form/input"),u=t("credit-card-type"),l=o.extend({fieldKey:"number",config:{errorMessage:"Invalid Credit Card Number!",validatorRules:[a.number]},events:function(){return r.chain(o.prototype.events).clone().extend({"change input":"formatInput","blur input":"handleBlur","keyup input":"formatInput","keydown input":"handleKeydown","keypress input":"noop","paste input":"formatInput"}).value()},initialize:function(t){this.setElements(),this.setEvents(),this.isComplete=o.prototype.inputIsComplete.call(this),this.postInitialize(t)},setElements:function(){this.input=this.$el.find("input").get(0),this.$cardHint=this.$el.find(".payment-method-icon"),this.validator=new s(this),this.inputFormatter=new i(this.input,{pattern:this.model.get("cardPattern")})},setEvents:function(){this.listenTo(this.model,"change:cardType",this.updateCreditCardType),this.listenTo(this.model,"change:cardPattern",this.setCreditCardNumberFormatterPattern)},formatInput:function(t){var e,n,r=t.target.value;this.toggleLabelSpan(r),e=u(r.replace(/\s/g,"")),n=1===e.length?e[0]:{},this.model.set({cardType:n,cardNumber:r}),this.isComplete(this.model.get("cardNumberMaxLength"))&&this.isValid()&&this.autoAdvanceTab()},handleBlur:function(t){this.formatInput(t),this.setCreditCardNumberFormatterPattern(),o.prototype.handleBlur.apply(this,arguments)},handleKeydown:function(){this.isComplete(this.model.get("cardNumberMaxLength"))||this.renderValidState()},updateCreditCardType:function(){var t=this.model.get("cardType").type,e=this.model.get("cardClass");this.model.set("cardClass",t),this.$cardHint.removeClass(e).addClass(t)},setCreditCardNumberFormatterPattern:function(){var t=this.model.get("cardPattern");this.inputFormatter.resetPattern(t)}});e.exports=l},{"../../internal/form/input":226,"../../internal/util/formatter-factory":248,"./base-input-view":256,_:223,"card-validator":174,"credit-card-type":196}],259:[function(t,e,n){"use strict";var r=t("_"),i=t("../../internal/util/formatter-factory"),o=t("./base-input-view"),a=t("card-validator"),s=t("../../internal/form/input"),u=o.extend({fieldKey:"cvv",config:{errorMessage:"Invalid CVV!",validatorRules:[function(t){var e=3;try{e=this.model.get("cardType").code.size}catch(n){}return a.cvv(t,e)}]},events:function(){return r.chain(o.prototype.events).clone().extend({"keyup input":"formatInput","keydown input":"handleKeydown","focus input":"handleInstanceFocus","blur input":"handleInstanceBlur","paste input":"formatInput"}).value()},initialize:function(t){this.setElements(),this.setEvents(),this.updateCvvForCardType(),this.isComplete=o.prototype.inputIsComplete.call(this),this.postInitialize(t)},setElements:function(){this.$input=this.$el.find("input"),this.input=this.$input.get(0),this.label=this.$el.find(".field-name").get(0),this.cardHint=this.$el.find(".payment-method-icon").get(0),this.validator=new s(this),this.inputFormatter=new i(this.input,this.model.get("cvvPatterns").nonAmex)},setEvents:function(){this.listenTo(this.model,"change:cardType",this.updateCvvForCardType)},updateCvvForCardType:function(){var t=this.model.get("cvvPatterns");this.formatData="american-express"===this.model.get("cardType").type?t.amex:t.nonAmex,this.inputFormatter.resetPattern(this.formatData.pattern),this.updateCardHint(),this.label.innerHTML=this.formatData.labelText,this.$input.attr(this.formatData.attrs),this.$input.length&&!Modernizr.placeholder&&(this.$input.val().length||this.$input.val(this.$input.attr("placeholder")))},formatInput:function(t){var e=t.target.value;this.toggleLabelSpan(e),this.model.set("cvv",e),this.isComplete(this.formatData.attrs.maxlength)&&this.isValid()&&this.autoAdvanceTab()},handleKeydown:function(){this.renderValidState()},updateCardHint:function(t){this.cardHint.id=t},handleInstanceFocus:function(){this.updateCardHint(this.formatData.id),o.prototype.handleFocus.apply(this,arguments)},handleInstanceBlur:function(){this.updateCardHint(),o.prototype.handleBlur.apply(this,arguments)}});e.exports=u},{"../../internal/form/input":226,"../../internal/util/formatter-factory":248,"./base-input-view":256,_:223,"card-validator":174}],260:[function(t,e,n){"use strict";var r=t("_"),i=t("../../internal/util/formatter-factory"),o=t("./base-input-view"),a=t("card-validator"),s=t("../../internal/form/input"),u=o.extend({fieldKey:"expiration",isActive:!1,config:{errorMessage:"Invalid expiration date!",validatorRules:[a.expirationDate]},events:function(){return r.chain(o.prototype.events).clone().extend({"change input":"formatInput","keyup input":"formatInput","keydown input":"handleKeydown","paste input":"formatInput"}).value()},initialize:function(t){this.setElements(),this.postInitialize(t)},setElements:function(){this.input=this.$el.find("input").get(0),this.validator=new s(this),this.inputFormatter=new i(this.input,{patterns:this.model.get("expirationPatterns")})},formatInput:function(t){var e=t.target.value,n=this.isComplete(e);this.toggleLabelSpan(e),this.model.set("expirationDate",e),n.shouldValidate&&this.isValid({partial:!0})&&(this.renderValidState(),n.shouldAdvance&&this.autoAdvanceTab())},handleKeydown:function(t){this.isComplete(t.target.value)||this.renderValidState()},isComplete:function(t){var e=this.model.get("expirationDateMaxLengths"),n=t.length;return{shouldValidate:n>=e[0],shouldAdvance:!/20/.test(t)||n===r.last(e)}}});e.exports=u},{"../../internal/form/input":226,"../../internal/util/formatter-factory":248,"./base-input-view":256,_:223,"card-validator":174}],261:[function(t,e,n){"use strict";var r=t("_"),i=t("backbone"),o=t("braintree-bus"),a=t("./credit-card-input-view"),s=t("./expiration-input-view"),u=t("./cvv-input-view"),l=t("./postal-code-input-view"),c=t("./save-checkbox-view"),p=t("../models/form-card-model"),h=t("../../internal/util/device"),d=t("../../templates/shared/add-payment-method-form.hbs"),f="hidden",m="is-loading",v="show-server-error",y=$("body"),g=i.View.extend({className:"add-payment-method-form-view",template:d,fields:{creditCard:{container:".credit-card-number-label",constructor:a},expiration:{container:".expiration-label",constructor:s},cvv:{challenge:"cvv",container:".cvv-label",constructor:u},postalCode:{challenge:"postal_code",container:".postal-code-label",constructor:l},saveCheckbox:{container:".checkbox-label",constructor:c}},events:{submit:"submit","click .error-retry":"handleRetry"},initialize:function(t){this.root=t.root,this.model=t.model||new p,this.setSubmitButtonState=t.setSubmitButtonState||null,this.isModal=t.isModal||!1,h.isTouch&&this.listenTo(i,"ui:autoTab",this.handleAutoTab)},render:function(){var t,e={isModal:this.isModal};return this.root.clientToken&&this.root.clientToken.challenges&&this.model.set("challenges",this.root.clientToken.challenges),this.root.clientToken&&this.root.clientToken.crossMerchantSharing&&this.model.set("crossMerchantSharing",this.root.clientToken.crossMerchantSharing),t=this.model.get("challenges"),this.model.set("cvvOnly",r.contains(t,"cvv")&&1===t.length),this.model.set("zipOnly",r.contains(t,"postal_code")&&1===t.length),this.model.set("cvvAndZip",r.contains(t,"postal_code")&&r.contains(t,"cvv")),this.$el.html(this.template(r.extend(e,this.model.toJSON()))),this.setupFields(),this},setupFields:function(){var t=this.model.get("challenges"),e=0;this.fieldViews=[],r.each(this.fields,function(n,i){var o;(!n.challenge||r.contains(t,n.challenge))&&("saveCheckbox"!==i||this.model.get("crossMerchantSharing"))&&(o=new n.constructor({el:this.$el.find(n.container),model:this.model,fieldIndex:e}),this.fieldViews.push(o),e++)},this)},submit:function(){var t=r.chain(this.fieldViews).filter(function(t){return!t.isValid()}).value();return t.length>0?(r.first(t).autoFocus(),o.emit(o.events.ERROR,{type:"VALIDATION",message:"Some payment method input fields are invalid.",details:{invalidFields:r.map(t,function(t){return{fieldKey:t.fieldKey,isEmpty:t.isEmpty()}})}})):this.savePaymentMethod(),!1},savePaymentMethod:function(){var t=this.model.getCardParams();y.addClass(m),requestAnimationFrame(function(){this.root.apiProxyClient.sendAnalyticsEvents(this.isModal?"dropin.web.modal.add-card.start":"dropin.web.inline.add-card.start"),this.root.apiClient.addCreditCard(t,r.bind(this.handlePaymentMethodAdd,this))},this)},handlePaymentMethodAdd:function(t,e){var n=this;t?this.isModal?(this.root.apiProxyClient.sendAnalyticsEvents("dropin.web.modal.add-card.fail"),this.renderErrorStateFromServer()):(this.root.apiProxyClient.sendAnalyticsEvents("dropin.web.inline.add-card.fail"),this.renderErrorStateFromServer()):this.isModal?setTimeout(r.bind(function(){y.removeClass(m),requestAnimationFrame(function(){this.root.apiProxyClient.sendAnalyticsEvents("dropin.web.modal.add-card.success",function(){n.root.rpcClient.invoke("sendAddedPaymentMethod",[e]),n.root.close()})},this)},this),300):this.root.apiProxyClient.sendAnalyticsEvents("dropin.web.inline.add-card.success",function(){n.successCallback(e)})},renderErrorStateFromServer:function(){this.$el.blur(),y.removeClass(m),requestAnimationFrame(function(){this.setSubmitButtonState&&this.setSubmitButtonState({disabled:!0}),y.addClass(v)},this)},handleRetry:function(t){t.preventDefault(),y.removeClass(v),this.setSubmitButtonState&&this.setSubmitButtonState({disabled:!1})},setFocusOnFirstInput:function(){this.fieldViews[0].autoFocus()},handleAutoTab:function(t){var e=t.fieldIndex,n=e>this.fieldViews.length-2;n||this.fieldViews[t.fieldIndex+1].autoFocus({force:!0})},hide:function(){this.$el.addClass(f)},show:function(){this.$el.removeClass(f)},destroy:function(){this.$el.empty()}});e.exports=g},{"../../internal/util/device":246,"../../templates/shared/add-payment-method-form.hbs":271,"../models/form-card-model":251,"./credit-card-input-view":258,"./cvv-input-view":259,"./expiration-input-view":260,"./postal-code-input-view":262,"./save-checkbox-view":263,_:223,backbone:2,"braintree-bus":52}],262:[function(t,e,n){"use strict";var r=t("_"),i=t("../../internal/util/formatter-factory"),o=t("./base-input-view"),a=t("card-validator"),s=t("../../internal/form/input"),u=o.extend({fieldKey:"postalCode",config:{errorMessage:"Invalid Postal Code",validatorRules:[a.postalCode]},events:function(){return r.chain(o.prototype.events).clone().extend({"keyup input":"formatInput","keydown input":"handleKeydown","paste input":"formatInput"}).value()},initialize:function(t){this.setElements(),this.isComplete=o.prototype.inputIsComplete.call(this,this.model.get("postalCodeMaxLength")),this.postInitialize(t)},setElements:function(){this.input=this.$el.find("input").get(0),this.validator=new s(this),this.inputFormatter=new i(this.input,this.model.get("postalCodePattern"))},formatInput:function(t){var e=t.target.value;this.toggleLabelSpan(e),this.model.set("postalCode",e),this.isComplete()&&this.autoAdvanceTab()},handleKeydown:function(){this.renderValidState()}});e.exports=u},{"../../internal/form/input":226,"../../internal/util/formatter-factory":248,"./base-input-view":256,_:223,"card-validator":174}],263:[function(t,e,n){"use strict";var r=t("./base-input-view"),i=r.extend({events:{'change [name="save"]':"setSave"},initialize:function(){this.setElements(),this.isValid=!0,this.setSave()},setElements:function(){this.$checkbox=this.$el.find('[name="save"]')},setSave:function(){this.model.set("share",this.$checkbox.prop("checked"))}});e.exports=i},{"./base-input-view":256}],264:[function(t,e,n){var r=t("hbsfy/runtime");e.exports=r.template({1:function(t,e,n,r){return' <button class="paypal is-active" title="Pay with PayPal"><span class="paypal-button-logo"></span></button>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(t,e,n,r){var i,o='<div class="payment-container">\n <div class="payment-method-options">\n';return i=e["if"].call(t,null!=t?t.paypalEnabled:t,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(o+=i),i=this.invokePartial(n.coinbaseButton," ","coinbaseButton",t,void 0,e,n,r),null!=i&&(o+=i),o+' </div>\n <div class="form-container"></div>\n\n</div>\n'},usePartial:!0,useData:!0})},{"hbsfy/runtime":221}],265:[function(t,e,n){var r=t("hbsfy/runtime");e.exports=r.template({1:function(t,e,n,r){var i,o=this.lambda,a=this.escapeExpression;return' <span class="payment-method-type">'+a(o(null!=(i=null!=(i=null!=t?t.paymentMethod:t)?i.details:i)?i.cardType:i,t))+'</span>\n <span class="payment-method-description">ending in '+a(o(null!=(i=null!=(i=null!=t?t.paymentMethod:t)?i.details:i)?i.lastTwo:i,t))+"</span>\n"},3:function(t,e,n,r){var i,o=this.lambda,a=this.escapeExpression;return' <span class="payment-method-type">'+a(o(null!=(i=null!=t?t.paymentMethod:t)?i.label:i,t))+'</span>\n <span class="payment-method-description">'+a(o(null!=(i=null!=(i=null!=t?t.paymentMethod:t)?i.details:i)?i.truncatedEmail:i,t))+"</span>\n"},5:function(t,e,n,r){var i,o=e.helperMissing,a='<div>\n <form>\n <div class="grid">\n <div class="row">\n <div class="column ';return i=(e.ifContains||t&&t.ifContains||o).call(t,null!=(i=null!=t?t.paymentMethod:t)?i.securityQuestions:i,"postal_code",{name:"ifContains",hash:{},fn:this.program(6,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+='">\n <label class="card-label cvv-label" for="cvv">\n <span class="field-name">CVV</span>\n <input id="cvv" name="cvv" class="cvv card-field" maxlength="3" type="tel" inputmode="numeric" placeholder="CVV" autocomplete="off">\n <span class="payment-method-icon"></span>\n </label>\n </div>\n\n',i=(e.ifContains||t&&t.ifContains||o).call(t,null!=(i=null!=t?t.paymentMethod:t)?i.securityQuestions:i,"postal_code",{name:"ifContains",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+" </div>\n </div>\n </form>\n</div>\n"},6:function(t,e,n,r){return"half"},8:function(t,e,n,r){return' <div class="column half">\n <label class="card-label postal-code-label" for="postal-code">\n <span class="field-name">Postal Code</span>\n <input id="postal-code" name="postal-code" class="postal-code card-field" autocomplete="off" maxlength="8" placeholder="Postal Code" autofill="off" autocomplete="off">\n </label>\n </div>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(t,e,n,r){var i,o=this.lambda,a=this.escapeExpression,s=e.helperMissing,u='<div class="payment-method-item card-label">\n <span class="payment-method-icon stick-left '+a(o(null!=(i=null!=t?t.paymentMethod:t)?i.cardTypeClass:i,t))+'"></span>\n';return i=(e.ifEqual||t&&t.ifEqual||s).call(t,null!=(i=null!=t?t.paymentMethod:t)?i.type:i,"CreditCard",{name:"ifEqual",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),null!=i&&(u+=i),u+='</div>\n<div class="payment-method-action">\n <button class="link link-small" id="choose-payment-method">Change payment method</button>\n</div>\n\n',i=e["if"].call(t,null!=(i=null!=t?t.paymentMethod:t)?i.isLocked:i,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u},useData:!0})},{"hbsfy/runtime":221}],266:[function(t,e,n){var r=t("hbsfy/runtime");e.exports=r.template({1:function(t,e,n,r){return' <button class="paypal is-active" title="Pay with PayPal"><span class="paypal-button-logo"></span></button>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(t,e,n,r){var i,o,a,s="function",u=e.helperMissing,l=e.blockHelperMissing,c='<div class="modal-header">\n <h3>Add new payment method</h3>\n</div>\n<div class="modal-body-content">\n <div class="payment-method-options">\n';return o=null!=(o=e.paypalEnabled||(null!=t?t.paypalEnabled:t))?o:u,a={name:"paypalEnabled",hash:{},fn:this.program(1,r),inverse:this.noop,data:r},i=typeof o===s?o.call(t,a):o,e.paypalEnabled||(i=l.call(t,i,a)),null!=i&&(c+=i),i=this.invokePartial(n.coinbaseButton," ","coinbaseButton",t,void 0,e,n,r),null!=i&&(c+=i),c+' </div>\n <div class="form-container"></div>\n</div>\n<div class="modal-footer">\n <button class="payment-method-add" disabled>Add new payment method</button>\n <div class="use-saved-payment-method">\n <button class="link use-saved-payment-method-link">Use saved payment method</button>\n </div>\n <div class="cancel">\n <a href="#" class="cancel-button">Cancel</a>\n </div>\n</div>\n'},usePartial:!0,useData:!0})},{"hbsfy/runtime":221}],267:[function(t,e,n){var r=t("hbsfy/runtime");e.exports=r.template({compiler:[6,">= 2.0.0-beta.1"],main:function(t,e,n,r){return'<div class="modal-header">\n <h3>Select payment method</h3>\n</div>\n<div class="modal-body-content">\n <div class="payment-methods-list"></div>\n <div class="add-payment-method-item">\n <span class="add-payment-method-link">Add Payment Method</span>\n </div>\n</div>\n<div class="modal-footer">\n <div class="cancel">\n <a href="#" class="cancel-button">Cancel</a>\n </div>\n</div>\n'},useData:!0})},{"hbsfy/runtime":221}],268:[function(t,e,n){var r=t("hbsfy/runtime");e.exports=r.template({compiler:[6,">= 2.0.0-beta.1"],main:function(t,e,n,r){return'<div class="modal-body">\n\n <div class="modal-container"></div>\n\n <div class="loader">\n <div class="loader-background"></div>\n <div class="indicator">\n <svg id="loader-svg-icon" width="14px" height="16px" viewBox="0 0 28 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <g id="New-Customer" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Loading" sketch:type="MSArtboardGroup" transform="translate(-526.000000, -915.000000)" fill="#FFFFFF">\n <g id="Loading-Indicator" sketch:type="MSLayerGroup" transform="translate(468.000000, 862.000000)">\n <g id="Secure" transform="translate(58.000000, 53.000000)" sketch:type="MSShapeGroup">\n <path d="M6,10 L6,7.9998866 C6,3.57774184 9.581722,0 14,0 C18.4092877,0 22,3.58167123 22,7.9998866 L22,10 L18,10 L18,7.9947834 C18,5.78852545 16.2046438,4 14,4 C11.790861,4 10,5.79171562 10,7.9947834 L10,10 L6,10 Z M0.996534824,14 C0.446163838,14 0,14.4449463 0,14.9933977 L0,31.0066023 C0,31.5552407 0.439813137,32 0.996534824,32 L27.0034652,32 C27.5538362,32 28,31.5550537 28,31.0066023 L28,14.9933977 C28,14.4447593 27.5601869,14 27.0034652,14 L0.996534824,14 Z" id="Rectangle-520"></path>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </div>\n <div class="loader-message">Authenticating...</div>\n </div>\n\n <div class="cancel-popup">\n <button class="cancel-popup-button"></button>\n </div>\n</div>\n'},useData:!0})},{"hbsfy/runtime":221}],269:[function(t,e,n){var r=t("hbsfy/runtime");e.exports=r.template({1:function(t,e,n,r){var i,o=this.lambda,a=this.escapeExpression;return' <span class="payment-method-type">'+a(o(null!=(i=null!=t?t.details:t)?i.cardType:i,t))+'</span>\n <span class="payment-method-description">ending in '+a(o(null!=(i=null!=t?t.details:t)?i.lastTwo:i,t))+"</span>\n"},3:function(t,e,n,r){var i,o,a="function",s=e.helperMissing,u=this.escapeExpression,l=this.lambda;return' <span class="payment-method-type">'+u((o=null!=(o=e.label||(null!=t?t.label:t))?o:s,typeof o===a?o.call(t,{name:"label",hash:{},data:r}):o))+'</span>\n <span class="payment-method-description">'+u(l(null!=(i=null!=t?t.details:t)?i.truncatedEmail:i,t))+"</span>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(t,e,n,r){var i,o,a="function",s=e.helperMissing,u=this.escapeExpression,l='<div class="payment-method-item card-label">\n <span class="payment-method-icon stick-left '+u((o=null!=(o=e.cardTypeClass||(null!=t?t.cardTypeClass:t))?o:s,typeof o===a?o.call(t,{name:"cardTypeClass",hash:{},data:r}):o))+'"></span>\n';return i=(e.ifEqual||t&&t.ifEqual||s).call(t,null!=t?t.type:t,"CreditCard",{name:"ifEqual",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),null!=i&&(l+=i),l+"</div>\n"},useData:!0})},{"hbsfy/runtime":221}],270:[function(t,e,n){var r=t("hbsfy/runtime");e.exports=r.template({1:function(t,e,n,r){return' <button id="coinbase-container" class="is-active">\n <span class="coinbase-button-logo">Coinbase</span>\n </button>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(t,e,n,r){var i,o="";return i=e["if"].call(t,null!=t?t.coinbaseEnabled:t,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(o+=i),o},useData:!0})},{"hbsfy/runtime":221}],271:[function(t,e,n){var r=t("hbsfy/runtime");e.exports=r.template({1:function(t,e,n,r){return"half"},3:function(t,e,n,r){return"right-border"},5:function(t,e,n,r){return' <div class="column half">\n <label class="card-label cvv-label" for="cvv">\n <span class="field-name">CVV</span>\n <input id="cvv" name="cvv" class="cvv card-field" maxlength="3" type="tel" inputmode="numeric" placeholder="CVV" autocomplete="off" autocapitalize="off">\n <span class="payment-method-icon"></span>\n <div class="invalid-bottom-bar"></div>\n </label>\n </div>\n'},7:function(t,e,n,r){return' <div class="column half">\n <label class="card-label postal-code-label" for="postal-code">\n <span class="field-name">Postal Code</span>\n <input id="postal-code" name="postal-code" class="postal-code card-field" autocomplete="off" maxlength="8" placeholder="Postal Code" autofill="off" autocapitalize="off">\n <div class="invalid-bottom-bar"></div>\n </label>\n </div>\n'},9:function(t,e,n,r){return' <div class="row">\n <div class="column">\n <label class="card-label postal-code-label" for="postal-code">\n <span class="field-name">Postal Code</span>\n <input id="postal-code" name="postal-code" class="postal-code card-field" autocomplete="off" maxlength="8" placeholder="Postal Code" autofill="off" autocapitalize="off">\n <div class="invalid-bottom-bar"></div>\n </label>\n </div>\n </div>\n'},11:function(t,e,n,r){return' <label class="checkbox-label">\n <input name="save" type="checkbox" class="checkbox-save" value="save" checked="checked" />\n <div class="checkbox-text">\n Save with Paypal for use on other sites\n </div>\n <p class="terms">By saving information you agree to the <a href="#">Paypal Touch</a> <a href="#">Terms of Service</a></p>\n </label>\n'},13:function(t,e,n,r){return' <input type="submit" value="">\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(t,e,n,r){var i,o,a,s=e.helperMissing,u="function",l=e.blockHelperMissing,c='<form action="#" method="post" class="grid card-form">\n <label class="card-label credit-card-number-label" for="credit-card-number">\n <span class="field-name">Card Number</span>\n <input id="credit-card-number" name="credit-card-number" class="card-field" type="tel" inputmode="numeric" placeholder="Card Number" autocomplete="off">\n <span class="payment-method-icon"></span>\n <div class="invalid-bottom-bar"></div>\n </label>\n\n <div class="row">\n <div class="column ';return i=e["if"].call(t,null!=t?t.challenges:t,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(c+=i),c+='">\n <label class="card-label expiration-label ',i=e["if"].call(t,null!=t?t.challenges:t,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(c+=i),c+='" for="expiration">\n <span class="field-name">MM / YY</span>\n <input id="expiration" name="expiration" class="expiration card-field" type="tel" inputmode="numeric" placeholder="Expiration Date" autocomplete="off">\n <div class="invalid-bottom-bar"></div>\n </label>\n </div>\n',i=(e.ifOr||t&&t.ifOr||s).call(t,null!=t?t.cvvOnly:t,null!=t?t.cvvAndZip:t,{name:"ifOr",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),null!=i&&(c+=i),i=e["if"].call(t,null!=t?t.zipOnly:t,{name:"if",hash:{},fn:this.program(7,r),inverse:this.noop,data:r}),null!=i&&(c+=i),c+=" </div>\n\n",o=null!=(o=e.cvvAndZip||(null!=t?t.cvvAndZip:t))?o:s,a={name:"cvvAndZip",hash:{},fn:this.program(9,r),inverse:this.noop,data:r},i=typeof o===u?o.call(t,a):o,e.cvvAndZip||(i=l.call(t,i,a)),null!=i&&(c+=i),c+="\n",o=null!=(o=e.crossMerchantSharing||(null!=t?t.crossMerchantSharing:t))?o:s,a={name:"crossMerchantSharing",hash:{},fn:this.program(11,r),inverse:this.noop,data:r},i=typeof o===u?o.call(t,a):o,e.crossMerchantSharing||(i=l.call(t,i,a)),null!=i&&(c+=i),c+="\n",o=null!=(o=e.isModal||(null!=t?t.isModal:t))?o:s,a={name:"isModal",hash:{},fn:this.program(13,r),inverse:this.noop,data:r},i=typeof o===u?o.call(t,a):o,e.isModal||(i=l.call(t,i,a)),null!=i&&(c+=i),c+'</form>\n\n<div class="server-error">\n <div class="server-error-message-container">\n <div class="server-error-message">\n <span class="error-icon"></span>There was an error processing your request. <a href="#" class="error-retry">Try again</a>\n </div>\n </div>\n</div>\n'},useData:!0})},{"hbsfy/runtime":221}]},{},[1])(1)});
@@ -83,13 +83,13 @@ img {
83
83
  background-repeat: no-repeat;
84
84
  display: block;
85
85
  text-indent: -999em;
86
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
86
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
87
87
  background-position: 0 0;
88
88
  height: 28px;
89
89
  width: 44px; }
90
90
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
91
91
  .payment-method-icon.coinbase {
92
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
92
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
93
93
  background-position: 0 0;
94
94
  height: 28px;
95
95
  width: 44px;
@@ -101,13 +101,13 @@ img {
101
101
  background-repeat: no-repeat;
102
102
  display: block;
103
103
  text-indent: -999em;
104
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
104
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
105
105
  background-position: 0 -72px;
106
106
  height: 29px;
107
107
  width: 44px; }
108
108
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
109
109
  .payment-method-icon.paypal {
110
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
110
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
111
111
  background-position: 0 -212px;
112
112
  height: 29px;
113
113
  width: 44px;
@@ -119,13 +119,13 @@ img {
119
119
  background-repeat: no-repeat;
120
120
  display: block;
121
121
  text-indent: -999em;
122
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
122
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
123
123
  background-position: 0 -231px;
124
124
  height: 28px;
125
125
  width: 44px; }
126
126
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
127
127
  .payment-method-icon.visa {
128
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
128
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
129
129
  background-position: 0 -184px;
130
130
  height: 28px;
131
131
  width: 44px;
@@ -137,13 +137,13 @@ img {
137
137
  background-repeat: no-repeat;
138
138
  display: block;
139
139
  text-indent: -999em;
140
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
140
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
141
141
  background-position: 0 -203px;
142
142
  height: 28px;
143
143
  width: 44px; }
144
144
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
145
145
  .payment-method-icon.master-card {
146
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
146
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
147
147
  background-position: 0 -128px;
148
148
  height: 28px;
149
149
  width: 44px;
@@ -155,13 +155,13 @@ img {
155
155
  background-repeat: no-repeat;
156
156
  display: block;
157
157
  text-indent: -999em;
158
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
158
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
159
159
  background-position: 0 -119px;
160
160
  height: 28px;
161
161
  width: 44px; }
162
162
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
163
163
  .payment-method-icon.american-express {
164
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
164
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
165
165
  background-position: 0 -72px;
166
166
  height: 28px;
167
167
  width: 44px;
@@ -173,13 +173,13 @@ img {
173
173
  background-repeat: no-repeat;
174
174
  display: block;
175
175
  text-indent: -999em;
176
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
176
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
177
177
  background-position: 0 -259px;
178
178
  height: 28px;
179
179
  width: 44px; }
180
180
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
181
181
  .payment-method-icon.diners-club {
182
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
182
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
183
183
  background-position: 0 -259px;
184
184
  height: 28px;
185
185
  width: 44px;
@@ -191,13 +191,13 @@ img {
191
191
  background-repeat: no-repeat;
192
192
  display: block;
193
193
  text-indent: -999em;
194
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
194
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
195
195
  background-position: 0 -147px;
196
196
  height: 28px;
197
197
  width: 44px; }
198
198
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
199
199
  .payment-method-icon.maestro {
200
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
200
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
201
201
  background-position: 0 -156px;
202
202
  height: 28px;
203
203
  width: 44px;
@@ -209,13 +209,13 @@ img {
209
209
  background-repeat: no-repeat;
210
210
  display: block;
211
211
  text-indent: -999em;
212
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
212
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
213
213
  background-position: 0 -287px;
214
214
  height: 28px;
215
215
  width: 44px; }
216
216
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
217
217
  .payment-method-icon.discover {
218
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
218
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
219
219
  background-position: 0 -287px;
220
220
  height: 28px;
221
221
  width: 44px;
@@ -227,13 +227,13 @@ img {
227
227
  background-repeat: no-repeat;
228
228
  display: block;
229
229
  text-indent: -999em;
230
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
230
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
231
231
  background-position: 0 -175px;
232
232
  height: 28px;
233
233
  width: 44px; }
234
234
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
235
235
  .payment-method-icon.jcb {
236
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
236
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
237
237
  background-position: 0 -100px;
238
238
  height: 28px;
239
239
  width: 44px;
@@ -249,13 +249,13 @@ img {
249
249
  background-repeat: no-repeat;
250
250
  display: block;
251
251
  text-indent: -999em;
252
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
252
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
253
253
  background-position: 0 -343px;
254
254
  height: 28px;
255
255
  width: 44px; }
256
256
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
257
257
  .cvv-label .payment-method-icon#cvv-icon {
258
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
258
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
259
259
  background-position: 0 -343px;
260
260
  height: 28px;
261
261
  width: 44px;
@@ -267,13 +267,13 @@ img {
267
267
  background-repeat: no-repeat;
268
268
  display: block;
269
269
  text-indent: -999em;
270
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
270
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
271
271
  background-position: 0 -315px;
272
272
  height: 28px;
273
273
  width: 44px; }
274
274
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
275
275
  .cvv-label .payment-method-icon#cid-icon {
276
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
276
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
277
277
  background-position: 0 -315px;
278
278
  height: 28px;
279
279
  width: 44px;
@@ -2002,14 +2002,14 @@ button#coinbase-container {
2002
2002
  background-repeat: no-repeat;
2003
2003
  display: block;
2004
2004
  text-indent: -999em;
2005
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
2005
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
2006
2006
  background-position: 0 -421px;
2007
2007
  height: 16px;
2008
2008
  width: 79px;
2009
2009
  margin: 0 auto; }
2010
2010
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
2011
2011
  button#coinbase-container .coinbase-button-logo {
2012
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
2012
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
2013
2013
  background-position: 0 -421px;
2014
2014
  height: 16px;
2015
2015
  width: 79px;
@@ -2059,7 +2059,7 @@ button.paypal {
2059
2059
  background-repeat: no-repeat;
2060
2060
  display: block;
2061
2061
  text-indent: -999em;
2062
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
2062
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
2063
2063
  background-position: 0 -399px;
2064
2064
  height: 22px;
2065
2065
  width: 61px;
@@ -2067,7 +2067,7 @@ button.paypal {
2067
2067
  margin: 8px auto 0; }
2068
2068
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
2069
2069
  button.paypal .paypal-button-logo {
2070
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
2070
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
2071
2071
  background-position: 0 -371px;
2072
2072
  height: 22px;
2073
2073
  width: 61px;
@@ -4222,7 +4222,7 @@ button.paypal {
4222
4222
  background-repeat: no-repeat;
4223
4223
  display: block;
4224
4224
  text-indent: -999em;
4225
- background-image: url('/dropin/1.7.0/images/1x-s0fcd0a14c6.png');
4225
+ background-image: url('/dropin/1.8.3/images/1x-s0fcd0a14c6.png');
4226
4226
  background-position: 0 -101px;
4227
4227
  height: 18px;
4228
4228
  width: 18px;
@@ -4231,7 +4231,7 @@ button.paypal {
4231
4231
  margin-bottom: -2px; }
4232
4232
  @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
4233
4233
  .server-error .error-icon {
4234
- background-image: url('/dropin/1.7.0/images/2x-sf9a66b4f5a.png');
4234
+ background-image: url('/dropin/1.8.3/images/2x-sf9a66b4f5a.png');
4235
4235
  background-position: 0 -241px;
4236
4236
  height: 18px;
4237
4237
  width: 18px;
@@ -5,9 +5,9 @@
5
5
  <head>
6
6
  <title>Cards</title>
7
7
  <meta charset="UTF-8">
8
- <link href="/dropin/1.7.0/vendor/normalize.css" rel="stylesheet">
9
- <link href="/dropin/1.7.0/braintree-dropin.css" rel="stylesheet">
10
- <script src="/dropin/1.7.0/vendor/modernizr.js"></script>
8
+ <link href="/dropin/1.8.3/vendor/normalize.css" rel="stylesheet">
9
+ <link href="/dropin/1.8.3/braintree-dropin.css" rel="stylesheet">
10
+ <script src="/dropin/1.8.3/vendor/modernizr.js"></script>
11
11
  </head>
12
12
  <body class="inline-frame is-loading initial-inline-frame-loading">
13
13
  <div id="container">
@@ -35,9 +35,9 @@
35
35
  <button class="cancel-popup-button">Cancel PayPal Login</button>
36
36
  </div>
37
37
 
38
- <!--[if LT IE 9]><script src="/dropin/1.7.0/vendor/jquery-1.11.0.js"></script><![endif]-->
39
- <!--[if gte IE 9]><!--><script src="/dropin/1.7.0/vendor/jquery-2.1.0.js"></script><!--<![endif]-->
40
- <script src="/dropin/1.7.0/braintree-dropin-internal.min.js"></script>
38
+ <!--[if LT IE 9]><script src="/dropin/1.8.3/vendor/jquery-1.11.0.js"></script><![endif]-->
39
+ <!--[if gte IE 9]><!--><script src="/dropin/1.8.3/vendor/jquery-2.1.0.js"></script><!--<![endif]-->
40
+ <script src="/dropin/1.8.3/braintree-dropin-internal.min.js"></script>
41
41
  <script>
42
42
  var inlineFrame = new braintree.dropin.InlineFrame.Manager({
43
43
  container: document.getElementById("container")
@@ -5,16 +5,16 @@
5
5
  <head>
6
6
  <title>Modal</title>
7
7
  <meta charset="UTF-8">
8
- <link href="/dropin/1.7.0/vendor/normalize.css" rel="stylesheet">
9
- <link href="/dropin/1.7.0/braintree-dropin.css" rel="stylesheet">
10
- <script src="/dropin/1.7.0/vendor/modernizr.js"></script>
8
+ <link href="/dropin/1.8.3/vendor/normalize.css" rel="stylesheet">
9
+ <link href="/dropin/1.8.3/braintree-dropin.css" rel="stylesheet">
10
+ <script src="/dropin/1.8.3/vendor/modernizr.js"></script>
11
11
  </head>
12
12
  <body class="modal-frame">
13
13
  <div id="container"></div>
14
14
  <div class="modal-wrap"></div>
15
- <!--[if LT IE 9]><script src="/dropin/1.7.0/vendor/jquery-1.11.0.js"></script><![endif]-->
16
- <!--[if gte IE 9]><!--><script src="/dropin/1.7.0/vendor/jquery-2.1.0.js"></script><!--<![endif]-->
17
- <script src="/dropin/1.7.0/braintree-dropin-internal.min.js"></script>
15
+ <!--[if LT IE 9]><script src="/dropin/1.8.3/vendor/jquery-1.11.0.js"></script><![endif]-->
16
+ <!--[if gte IE 9]><!--><script src="/dropin/1.8.3/vendor/jquery-2.1.0.js"></script><!--<![endif]-->
17
+ <script src="/dropin/1.8.3/braintree-dropin-internal.min.js"></script>
18
18
  <script>
19
19
  var modalFrame = new braintree.dropin.ModalFrame({
20
20
  container: document.getElementById("container")
@@ -20,6 +20,10 @@ module FakeBraintree
20
20
  if invalid?
21
21
  response_for_invalid_card
22
22
  else
23
+ load_payment_method!(
24
+ @customer_hash.delete('payment_method_nonce'),
25
+ @customer_hash['credit_card'] ||= {}
26
+ )
23
27
  credit_cards = customer_hash['credit_cards']
24
28
  create_customer_with(customer_hash)
25
29
  credit_cards.each { |card| add_credit_card_to_registry(card) }
@@ -118,6 +122,11 @@ module FakeBraintree
118
122
 
119
123
  def generate_credit_cards_from(new_credit_card_hash)
120
124
  if new_credit_card_hash.present? && new_credit_card_hash.is_a?(Hash)
125
+ load_payment_method!(
126
+ new_credit_card_hash.delete('payment_method_nonce'),
127
+ new_credit_card_hash
128
+ )
129
+
121
130
  new_credit_card_hash['bin'] = new_credit_card_hash['number'][0..5]
122
131
  new_credit_card_hash['last_4'] = new_credit_card_hash['number'][-4..-1]
123
132
  new_credit_card_hash['token'] = credit_card_token(new_credit_card_hash)
@@ -199,5 +208,11 @@ module FakeBraintree
199
208
  def credit_card_token(credit_card_hash_without_token)
200
209
  md5("#{credit_card_hash_without_token['number']}#{@customer_hash['merchant_id']}")
201
210
  end
211
+
212
+ def load_payment_method!(nonce, credit_card_hash)
213
+ return unless nonce
214
+ payment_method_hash = FakeBraintree.registry.payment_methods[nonce]
215
+ credit_card_hash.merge!(payment_method_hash)
216
+ end
202
217
  end
203
218
  end
@@ -185,6 +185,14 @@ module FakeBraintree
185
185
  CreditCard.new(updates, options).update
186
186
  end
187
187
 
188
+ # Braintree::PaymentMethod.delete
189
+ delete '/merchants/:merchant_id/payment_methods/any/:credit_card_token' do
190
+ cc_hash = {}
191
+ options = {token: params[:credit_card_token], merchant_id: params[:merchant_id]}
192
+
193
+ CreditCard.new(cc_hash, options).delete
194
+ end
195
+
188
196
  # Braintree::CreditCard.delete
189
197
  delete '/merchants/:merchant_id/payment_methods/credit_card/:credit_card_token' do
190
198
  cc_hash = {}
@@ -205,7 +213,8 @@ module FakeBraintree
205
213
  else
206
214
  payment_method_hash = hash_from_request_body_with_key('payment_method')
207
215
  nonce = payment_method_hash.delete('payment_method_nonce')
208
- FakeBraintree.registry.payment_methods[nonce].merge(payment_method_hash)
216
+ h = FakeBraintree.registry.payment_methods
217
+ h[nonce] = (h[nonce] || {}).merge(payment_method_hash)
209
218
  end
210
219
  options = {merchant_id: params[:merchant_id]}
211
220
 
@@ -1,3 +1,3 @@
1
1
  module FakeBraintree
2
- VERSION = '0.7.0'
2
+ VERSION = '0.8.0'
3
3
  end
@@ -1,5 +1,5 @@
1
- !function(){function t(e,n){e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=n)}function e(t,e,n,i,r){this.stream=t,this.header=e,this.length=n,this.tag=i,this.sub=r}function n(t){var e,n,i="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),i+=ee.charAt(n>>6)+ee.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),i+=ee.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),i+=ee.charAt(n>>2)+ee.charAt((3&n)<<4));(3&i.length)>0;)i+=ne;return i}function i(t){var e,n,i,r="",o=0;for(e=0;e<t.length&&t.charAt(e)!=ne;++e)i=ee.indexOf(t.charAt(e)),0>i||(0==o?(r+=l(i>>2),n=3&i,o=1):1==o?(r+=l(n<<2|i>>4),n=15&i,o=2):2==o?(r+=l(n),r+=l(i>>2),n=3&i,o=3):(r+=l(n<<2|i>>4),r+=l(15&i),o=0));return 1==o&&(r+=l(n<<2)),r}function r(t){var e,n=i(t),r=new Array;for(e=0;2*e<n.length;++e)r[e]=parseInt(n.substring(2*e,2*e+2),16);return r}function o(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function s(){return new o(null)}function a(t,e,n,i,r,o){for(;--o>=0;){var s=e*this[t++]+n[i]+r;r=Math.floor(s/67108864),n[i++]=67108863&s}return r}function u(t,e,n,i,r,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,l=a*u+c*s;u=s*u+((32767&l)<<15)+n[i]+(1073741823&r),r=(u>>>30)+(l>>>15)+a*c+(r>>>30),n[i++]=1073741823&u}return r}function c(t,e,n,i,r,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,l=a*u+c*s;u=s*u+((16383&l)<<14)+n[i]+r,r=(u>>28)+(l>>14)+a*c,n[i++]=268435455&u}return r}function l(t){return ue.charAt(t)}function p(t,e){var n=ce[t.charCodeAt(e)];return null==n?-1:n}function h(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function d(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+this.DV:this.t=0}function f(t){var e=s();return e.fromInt(t),e}function m(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,r=!1,s=0;--i>=0;){var a=8==n?255&t[i]:p(t,i);0>a?"-"==t.charAt(i)&&(r=!0):(r=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,s+=n,s>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),r&&o.ZERO.subTo(this,this)}function y(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function g(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,i=(1<<e)-1,r=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-->0)for(a<this.DB&&(n=this[s]>>a)>0&&(r=!0,o=l(n));s>=0;)e>a?(n=(this[s]&(1<<a)-1)<<e-a,n|=this[--s]>>(a+=this.DB-e)):(n=this[s]>>(a-=e)&i,0>=a&&(a+=this.DB,--s)),n>0&&(r=!0),r&&(o+=l(n));return r?o:"0"}function b(){var t=s();return o.ZERO.subTo(this,t),t}function v(){return this.s<0?this.negate():this}function _(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(e=n-t.t,0!=e)return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0}function E(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function w(){return this.t<=0?0:this.DB*(this.t-1)+E(this[this.t-1]^this.s&this.DM)}function A(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function C(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function S(t,e){var n,i=t%this.DB,r=this.DB-i,o=(1<<r)-1,s=Math.floor(t/this.DB),a=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)e[n+s+1]=this[n]>>r|a,a=(this[n]&o)<<i;for(n=s-1;n>=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()}function T(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)return void(e.t=0);var i=t%this.DB,r=this.DB-i,o=(1<<i)-1;e[0]=this[n]>>i;for(var s=n+1;s<this.t;++s)e[s-n-1]|=(this[s]&o)<<r,e[s-n]=this[s]>>i;i>0&&(e[this.t-n-1]|=(this.s&o)<<r),e.t=this.t-n,e.clamp()}function x(t,e){for(var n=0,i=0,r=Math.min(t.t,this.t);r>n;)i+=this[n]-t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i-=t[n],e[n++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=0>i?-1:0,-1>i?e[n++]=this.DV+i:i>0&&(e[n++]=i),e.t=n,e.clamp()}function P(t,e){var n=this.abs(),i=t.abs(),r=n.t;for(e.t=r+i.t;--r>=0;)e[r]=0;for(r=0;r<i.t;++r)e[r+n.t]=n.am(0,i[r],e,r,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&o.ZERO.subTo(e,e)}function O(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var i=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,i,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function I(t,e,n){var i=t.abs();if(!(i.t<=0)){var r=this.abs();if(r.t<i.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=s());var a=s(),u=this.s,c=t.s,l=this.DB-E(i[i.t-1]);l>0?(i.lShiftTo(l,a),r.lShiftTo(l,n)):(i.copyTo(a),r.copyTo(n));var p=a.t,h=a[p-1];if(0!=h){var d=h*(1<<this.F1)+(p>1?a[p-2]>>this.F2:0),f=this.FV/d,m=(1<<this.F1)/d,y=1<<this.F2,g=n.t,b=g-p,v=null==e?s():e;for(a.dlShiftTo(b,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),o.ONE.dlShiftTo(p,v),v.subTo(a,a);a.t<p;)a[a.t++]=0;for(;--b>=0;){var _=n[--g]==h?this.DM:Math.floor(n[g]*f+(n[g-1]+y)*m);if((n[g]+=a.am(0,_,n,b,0,p))<_)for(a.dlShiftTo(b,v),n.subTo(v,n);n[g]<--_;)n.subTo(v,n)}null!=e&&(n.drShiftTo(p,e),u!=c&&o.ZERO.subTo(e,e)),n.t=p,n.clamp(),l>0&&n.rShiftTo(l,n),0>u&&o.ZERO.subTo(n,n)}}}function N(t){var e=s();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e}function k(t){this.m=t}function R(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function U(t){return t}function D(t){t.divRemTo(this.m,null,t)}function M(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function F(t,e){t.squareTo(e),this.reduce(e)}function L(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function B(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function j(t){var e=s();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e}function z(t){var e=s();return t.copyTo(e),this.reduce(e),e}function V(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],i=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,i,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function H(t,e){t.squareTo(e),this.reduce(e)}function Y(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function q(){return 0==(this.t>0?1&this[0]:this.s)}function W(t,e){if(t>4294967295||1>t)return o.ONE;var n=s(),i=s(),r=e.convert(this),a=E(t)-1;for(r.copyTo(n);--a>=0;)if(e.sqrTo(n,i),(t&1<<a)>0)e.mulTo(i,r,n);else{var u=n;n=i,i=u}return e.revert(n)}function G(t,e){var n;return n=256>t||e.isEven()?new k(e):new B(e),this.exp(t,n)}function Q(t,e){return new o(t,e)}function K(t,e){if(e<t.length+11)throw new Error("Message too long for RSA");for(var n=new Array,i=t.length-1;i>=0&&e>0;){var r=t.charCodeAt(i--);128>r?n[--e]=r:r>127&&2048>r?(n[--e]=63&r|128,n[--e]=r>>6|192):(n[--e]=63&r|128,n[--e]=r>>6&63|128,n[--e]=r>>12|224)}n[--e]=0;for(var s=0,a=0,u=0;e>2;)0==u&&(a=le.random.randomWords(1,0)[0]),s=a>>u&255,u=(u+8)%32,0!=s&&(n[--e]=s);return n[--e]=2,n[--e]=0,new o(n)}function Z(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function $(t,e){if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw new Error("Invalid RSA public key");this.n=Q(t,16),this.e=parseInt(e,16)}function X(t){return t.modPowInt(this.e,this.n)}function J(t){var e=K(t,this.n.bitLength()+7>>3);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var i=n.toString(16);return 0==(1&i.length)?i:"0"+i}t.prototype.get=function(t){if(void 0==t&&(t=this.pos++),t>=this.enc.length)throw"Requesting byte offset "+t+" on a stream of length "+this.enc.length;return this.enc[t]},t.prototype.hexDigits="0123456789ABCDEF",t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e){for(var n="",i=t;e>i;++i)switch(n+=this.hexByte(this.get(i)),15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},t.prototype.parseStringISO=function(t,e){for(var n="",i=t;e>i;++i)n+=String.fromCharCode(this.get(i));return n},t.prototype.parseStringUTF=function(t,e){for(var n="",i=0,r=t;e>r;){var i=this.get(r++);n+=String.fromCharCode(128>i?i:i>191&&224>i?(31&i)<<6|63&this.get(r++):(15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},t.prototype.reTime=/^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,t.prototype.parseTime=function(t,e){var n=this.parseStringISO(t,e),i=this.reTime.exec(n);return i?(n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n},t.prototype.parseInteger=function(t,e){var n=e-t;if(n>4){n<<=3;var i=this.get(t);if(0==i)n-=8;else for(;128>i;)i<<=1,--n;return"("+n+" bit)"}for(var r=0,o=t;e>o;++o)r=r<<8|this.get(o);return r},t.prototype.parseBitString=function(t,e){var n=this.get(t),i=(e-t-1<<3)-n,r="("+i+" bit)";if(20>=i){var o=n;r+=" ";for(var s=e-1;s>t;--s){for(var a=this.get(s),u=o;8>u;++u)r+=a>>u&1?"1":"0";o=0}}return r},t.prototype.parseOctetString=function(t,e){var n=e-t,i="("+n+" byte) ";n>20&&(e=t+20);for(var r=t;e>r;++r)i+=this.hexByte(this.get(r));return n>20&&(i+=String.fromCharCode(8230)),i},t.prototype.parseOID=function(t,e){for(var n,i=0,r=0,o=t;e>o;++o){var s=this.get(o);i=i<<7|127&s,r+=7,128&s||(void 0==n?n=parseInt(i/40)+"."+i%40:n+="."+(r>=31?"bigint":i),i=r=0),n+=String.fromCharCode()}return n},e.prototype.typeName=function(){if(void 0==this.tag)return"unknown";var t=this.tag>>6,e=(this.tag>>5&1,31&this.tag);switch(t){case 0:switch(e){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+e.toString(16)}case 1:return"Application_"+e.toString(16);case 2:return"["+e+"]";case 3:return"Private_"+e.toString(16)}},e.prototype.content=function(){if(void 0==this.tag)return null;var t=this.tag>>6;if(0!=t)return null==this.sub?null:"("+this.sub.length+")";var e=31&this.tag,n=this.posContent(),i=Math.abs(this.length);switch(e){case 1:return 0==this.stream.get(n)?"false":"true";case 2:return this.stream.parseInteger(n,n+i);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(n,n+i);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(n,n+i);case 6:return this.stream.parseOID(n,n+i);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(n,n+i);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(n,n+i);case 23:case 24:return this.stream.parseTime(n,n+i)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null==this.sub?"null":this.sub.length)+"]"},e.prototype.print=function(t){if(void 0==t&&(t=""),document.writeln(t+this),null!=this.sub){t+=" ";for(var e=0,n=this.sub.length;n>e;++e)this.sub[e].print(t)}},e.prototype.toPrettyString=function(t){void 0==t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,32&this.tag?e+=" (constructed)":3!=this.tag&&4!=this.tag||null==this.sub||(e+=" (encapsulates)"),e+="\n",null!=this.sub){t+=" ";for(var n=0,i=this.sub.length;i>n;++n)e+=this.sub[n].toPrettyString(t)}return e},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.decodeLength=function(t){var e=t.get(),n=127&e;if(n==e)return n;if(n>3)throw"Length over 24 bits not supported at position "+(t.pos-1);if(0==n)return-1;e=0;for(var i=0;n>i;++i)e=e<<8|t.get();return e},e.hasContent=function(n,i,r){if(32&n)return!0;if(3>n||n>4)return!1;var o=new t(r);3==n&&o.get();var s=o.get();if(s>>6&1)return!1;try{var a=e.decodeLength(o);return o.pos-r.pos+a==i}catch(u){return!1}},e.decode=function(n){n instanceof t||(n=new t(n,0));var i=new t(n),r=n.get(),o=e.decodeLength(n),s=n.pos-i.pos,a=null;if(e.hasContent(r,o,n)){var u=n.pos;if(3==r&&n.get(),a=[],o>=0){for(var c=u+o;n.pos<c;)a[a.length]=e.decode(n);if(n.pos!=c)throw"Content size is not correct for container starting at offset "+u}else try{for(;;){var l=e.decode(n);if(0==l.tag)break;a[a.length]=l}o=u-n.pos}catch(p){throw"Exception while decoding undefined length content: "+p}}else n.pos+=o;return new e(i,s,o,r,a)};var te,ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ne="=",ie=0xdeadbeefcafe,re=15715070==(16777215&ie);re&&"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=u,te=30):re&&"Netscape"!=navigator.appName?(o.prototype.am=a,te=26):(o.prototype.am=c,te=28),o.prototype.DB=te,o.prototype.DM=(1<<te)-1,o.prototype.DV=1<<te;var oe=52;o.prototype.FV=Math.pow(2,oe),o.prototype.F1=oe-te,o.prototype.F2=2*te-oe;var se,ae,ue="0123456789abcdefghijklmnopqrstuvwxyz",ce=new Array;for(se="0".charCodeAt(0),ae=0;9>=ae;++ae)ce[se++]=ae;for(se="a".charCodeAt(0),ae=10;36>ae;++ae)ce[se++]=ae;for(se="A".charCodeAt(0),ae=10;36>ae;++ae)ce[se++]=ae;k.prototype.convert=R,k.prototype.revert=U,k.prototype.reduce=D,k.prototype.mulTo=M,k.prototype.sqrTo=F,B.prototype.convert=j,B.prototype.revert=z,B.prototype.reduce=V,B.prototype.mulTo=Y,B.prototype.sqrTo=H,o.prototype.copyTo=h,o.prototype.fromInt=d,o.prototype.fromString=m,o.prototype.clamp=y,o.prototype.dlShiftTo=A,o.prototype.drShiftTo=C,o.prototype.lShiftTo=S,o.prototype.rShiftTo=T,o.prototype.subTo=x,o.prototype.multiplyTo=P,o.prototype.squareTo=O,o.prototype.divRemTo=I,o.prototype.invDigit=L,o.prototype.isEven=q,o.prototype.exp=W,o.prototype.toString=g,o.prototype.negate=b,o.prototype.abs=v,o.prototype.compareTo=_,o.prototype.bitLength=w,o.prototype.mod=N,o.prototype.modPowInt=G,o.ZERO=f(0),o.ONE=f(1),Z.prototype.doPublic=X,Z.prototype.setPublic=$,Z.prototype.encrypt=J;var le={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};"undefined"!=typeof module&&module.exports&&(module.exports=le),le.cipher.aes=function(t){this._tables[0][0][0]||this._precompute();var e,n,i,r,o,s=this._tables[0][4],a=this._tables[1],u=t.length,c=1;if(4!==u&&6!==u&&8!==u)throw new le.exception.invalid("invalid aes key size");for(this._key=[r=t.slice(0),o=[]],e=u;4*u+28>e;e++)i=r[e-1],(e%u===0||8===u&&e%u===4)&&(i=s[i>>>24]<<24^s[i>>16&255]<<16^s[i>>8&255]<<8^s[255&i],e%u===0&&(i=i<<8^i>>>24^c<<24,c=c<<1^283*(c>>7))),r[e]=r[e-u]^i;for(n=0;e;n++,e--)i=r[3&n?e:e-4],o[n]=4>=e||4>n?i:a[0][s[i>>>24]]^a[1][s[i>>16&255]]^a[2][s[i>>8&255]]^a[3][s[255&i]]},le.cipher.aes.prototype={encrypt:function(t){return this._crypt(t,0)},decrypt:function(t){return this._crypt(t,1)},_tables:[[[],[],[],[],[]],[[],[],[],[],[]]],_precompute:function(){var t,e,n,i,r,o,s,a,u,c=this._tables[0],l=this._tables[1],p=c[4],h=l[4],d=[],f=[];for(t=0;256>t;t++)f[(d[t]=t<<1^283*(t>>7))^t]=t;for(e=n=0;!p[e];e^=i||1,n=f[n]||1)for(s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^255&s^99,p[e]=s,h[s]=e,o=d[r=d[i=d[e]]],u=16843009*o^65537*r^257*i^16843008*e,a=257*d[s]^16843008*s,t=0;4>t;t++)c[t][e]=a=a<<24^a>>>8,l[t][s]=u=u<<24^u>>>8;for(t=0;5>t;t++)c[t]=c[t].slice(0),l[t]=l[t].slice(0)},_crypt:function(t,e){if(4!==t.length)throw new le.exception.invalid("invalid aes block size");var n,i,r,o,s=this._key[e],a=t[0]^s[0],u=t[e?3:1]^s[1],c=t[2]^s[2],l=t[e?1:3]^s[3],p=s.length/4-2,h=4,d=[0,0,0,0],f=this._tables[e],m=f[0],y=f[1],g=f[2],b=f[3],v=f[4];for(o=0;p>o;o++)n=m[a>>>24]^y[u>>16&255]^g[c>>8&255]^b[255&l]^s[h],i=m[u>>>24]^y[c>>16&255]^g[l>>8&255]^b[255&a]^s[h+1],r=m[c>>>24]^y[l>>16&255]^g[a>>8&255]^b[255&u]^s[h+2],l=m[l>>>24]^y[a>>16&255]^g[u>>8&255]^b[255&c]^s[h+3],h+=4,a=n,u=i,c=r;for(o=0;4>o;o++)d[e?3&-o:o]=v[a>>>24]<<24^v[u>>16&255]<<16^v[c>>8&255]<<8^v[255&l]^s[h++],n=a,a=u,u=c,c=l,l=n;return d}},le.bitArray={bitSlice:function(t,e,n){return t=le.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:le.bitArray.clamp(t,n-e)},extract:function(t,e,n){var i,r=Math.floor(-e-n&31);return i=-32&(e+n-1^e)?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r,i&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],i=le.bitArray.getPartial(n);return 32===i?t.concat(e):le.bitArray._shiftRight(e,i,0|n,t.slice(0,t.length-1))},bitLength:function(t){var e,n=t.length;return 0===n?0:(e=t[n-1],32*(n-1)+le.bitArray.getPartial(e))},clamp:function(t,e){if(32*t.length<e)return t;t=t.slice(0,Math.ceil(e/32));var n=t.length;return e=31&e,n>0&&e&&(t[n-1]=le.bitArray.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:function(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(le.bitArray.bitLength(t)!==le.bitArray.bitLength(e))return!1;var n,i=0;for(n=0;n<t.length;n++)i|=t[n]^e[n];return 0===i},_shiftRight:function(t,e,n,i){var r,o,s=0;for(void 0===i&&(i=[]);e>=32;e-=32)i.push(n),n=0;if(0===e)return i.concat(t);for(r=0;r<t.length;r++)i.push(n|t[r]>>>e),n=t[r]<<32-e;return s=t.length?t[t.length-1]:0,o=le.bitArray.getPartial(s),i.push(le.bitArray.partial(e+o&31,e+o>32?n:i.pop(),1)),i},_xor4:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]}},le.codec.hex={fromBits:function(t){var e,n="";for(e=0;e<t.length;e++)n+=((0|t[e])+0xf00000000000).toString(16).substr(4);return n.substr(0,le.bitArray.bitLength(t)/4)},toBits:function(t){var e,n,i=[];for(t=t.replace(/\s|0x/g,""),n=t.length,t+="00000000",e=0;e<t.length;e+=8)i.push(0^parseInt(t.substr(e,8),16));return le.bitArray.clamp(i,4*n)}},le.codec.utf8String={fromBits:function(t){var e,n,i="",r=le.bitArray.bitLength(t);for(e=0;r/8>e;e++)0===(3&e)&&(n=t[e/4]),i+=String.fromCharCode(n>>>24),n<<=8;return decodeURIComponent(escape(i))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,n=[],i=0;for(e=0;e<t.length;e++)i=i<<8|t.charCodeAt(e),3===(3&e)&&(n.push(i),i=0);return 3&e&&n.push(le.bitArray.partial(8*(3&e),i)),n}},le.codec.base64={_chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(t,e,n){var i,r="",o=0,s=le.codec.base64._chars,a=0,u=le.bitArray.bitLength(t);for(n&&(s=s.substr(0,62)+"-_"),i=0;6*r.length<u;)r+=s.charAt((a^t[i]>>>o)>>>26),6>o?(a=t[i]<<6-o,o+=26,i++):(a<<=6,o-=6);for(;3&r.length&&!e;)r+="=";return r},toBits:function(t,e){t=t.replace(/\s|=/g,"");var n,i,r=[],o=0,s=le.codec.base64._chars,a=0;for(e&&(s=s.substr(0,62)+"-_"),n=0;n<t.length;n++){if(i=s.indexOf(t.charAt(n)),0>i)throw new le.exception.invalid("this isn't base64!");o>26?(o-=26,r.push(a^i>>>o),a=i<<32-o):(o+=6,a^=i<<32-o)}return 56&o&&r.push(le.bitArray.partial(56&o,a,1)),r}},le.codec.base64url={fromBits:function(t){return le.codec.base64.fromBits(t,1,1)},toBits:function(t){return le.codec.base64.toBits(t,1)}},void 0===le.beware&&(le.beware={}),le.beware["CBC mode is dangerous because it doesn't protect message integrity."]=function(){le.mode.cbc={name:"cbc",encrypt:function(t,e,n,i){if(i&&i.length)throw new le.exception.invalid("cbc can't authenticate data");if(128!==le.bitArray.bitLength(n))throw new le.exception.invalid("cbc iv must be 128 bits");var r,o=le.bitArray,s=o._xor4,a=o.bitLength(e),u=0,c=[];if(7&a)throw new le.exception.invalid("pkcs#5 padding only works for multiples of a byte");for(r=0;a>=u+128;r+=4,u+=128)n=t.encrypt(s(n,e.slice(r,r+4))),c.splice(r,0,n[0],n[1],n[2],n[3]);return a=16843009*(16-(a>>3&15)),n=t.encrypt(s(n,o.concat(e,[a,a,a,a]).slice(r,r+4))),c.splice(r,0,n[0],n[1],n[2],n[3]),c},decrypt:function(t,e,n,i){if(i&&i.length)throw new le.exception.invalid("cbc can't authenticate data");if(128!==le.bitArray.bitLength(n))throw new le.exception.invalid("cbc iv must be 128 bits");if(127&le.bitArray.bitLength(e)||!e.length)throw new le.exception.corrupt("cbc ciphertext must be a positive multiple of the block size");var r,o,s,a=le.bitArray,u=a._xor4,c=[];for(i=i||[],r=0;r<e.length;r+=4)o=e.slice(r,r+4),s=u(n,t.decrypt(o)),c.splice(r,0,s[0],s[1],s[2],s[3]),n=o;if(o=255&c[r-1],0==o||o>16)throw new le.exception.corrupt("pkcs#5 padding corrupt");if(s=16843009*o,!a.equal(a.bitSlice([s,s,s,s],0,8*o),a.bitSlice(c,32*c.length-8*o,32*c.length)))throw new le.exception.corrupt("pkcs#5 padding corrupt");return a.bitSlice(c,0,32*c.length-8*o)}}},le.misc.hmac=function(t,e){this._hash=e=e||le.hash.sha256;var n,i=[[],[]],r=e.prototype.blockSize/32;for(this._baseHash=[new e,new e],t.length>r&&(t=e.hash(t)),n=0;r>n;n++)i[0][n]=909522486^t[n],i[1][n]=1549556828^t[n];this._baseHash[0].update(i[0]),this._baseHash[1].update(i[1])},le.misc.hmac.prototype.encrypt=le.misc.hmac.prototype.mac=function(t,e){var n=new this._hash(this._baseHash[0]).update(t,e).finalize();return new this._hash(this._baseHash[1]).update(n).finalize()},le.hash.sha256=function(t){this._key[0]||this._precompute(),t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},le.hash.sha256.hash=function(t){return(new le.hash.sha256).update(t).finalize()},le.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=le.codec.utf8String.toBits(t));var e,n=this._buffer=le.bitArray.concat(this._buffer,t),i=this._length,r=this._length=i+le.bitArray.bitLength(t);for(e=512+i&-512;r>=e;e+=512)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(e=le.bitArray.concat(e,[le.bitArray.partial(1,1)]),t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),n},_init:[],_key:[],_precompute:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}var e,n=0,i=2;t:for(;64>n;i++){for(e=2;i>=e*e;e++)if(i%e===0)continue t;8>n&&(this._init[n]=t(Math.pow(i,.5))),this._key[n]=t(Math.pow(i,1/3)),n++}},_block:function(t){var e,n,i,r,o=t.slice(0),s=this._h,a=this._key,u=s[0],c=s[1],l=s[2],p=s[3],h=s[4],d=s[5],f=s[6],m=s[7];for(e=0;64>e;e++)16>e?n=o[e]:(i=o[e+1&15],r=o[e+14&15],n=o[15&e]=(i>>>7^i>>>18^i>>>3^i<<25^i<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+o[15&e]+o[e+9&15]|0),n=n+m+(h>>>6^h>>>11^h>>>25^h<<26^h<<21^h<<7)+(f^h&(d^f))+a[e],m=f,f=d,d=h,h=p+n|0,p=l,l=c,c=u,u=n+(c&l^p&(c^l))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;s[0]=s[0]+u|0,s[1]=s[1]+c|0,s[2]=s[2]+l|0,s[3]=s[3]+p|0,s[4]=s[4]+h|0,s[5]=s[5]+d|0,s[6]=s[6]+f|0,s[7]=s[7]+m|0}},le.random={randomWords:function(t,e){var n,i,r=[],o=this.isReady(e);if(o===this._NOT_READY)throw new le.exception.notReady("generator isn't seeded");for(o&this._REQUIRES_RESEED&&this._reseedFromPools(!(o&this._READY)),n=0;t>n;n+=4)(n+1)%this._MAX_WORDS_PER_BURST===0&&this._gate(),i=this._gen4words(),r.push(i[0],i[1],i[2],i[3]);return this._gate(),r.slice(0,t)},setDefaultParanoia:function(t){this._defaultParanoia=t},addEntropy:function(t,e,n){n=n||"user";var i,r,o,s=(new Date).valueOf(),a=this._robins[n],u=this.isReady(),c=0;switch(i=this._collectorIds[n],void 0===i&&(i=this._collectorIds[n]=this._collectorIdNext++),void 0===a&&(a=this._robins[n]=0),this._robins[n]=(this._robins[n]+1)%this._pools.length,typeof t){case"number":void 0===e&&(e=1),this._pools[a].update([i,this._eventId++,1,e,s,1,0|t]);break;case"object":var l=Object.prototype.toString.call(t);if("[object Uint32Array]"===l){for(o=[],r=0;r<t.length;r++)o.push(t[r]);t=o}else for("[object Array]"!==l&&(c=1),r=0;r<t.length&&!c;r++)"number"!=typeof t[r]&&(c=1);if(!c){if(void 0===e)for(e=0,r=0;r<t.length;r++)for(o=t[r];o>0;)e++,o>>>=1;this._pools[a].update([i,this._eventId++,2,e,s,t.length].concat(t))}break;case"string":void 0===e&&(e=t.length),this._pools[a].update([i,this._eventId++,3,e,s,t.length]),this._pools[a].update(t);break;default:c=1}if(c)throw new le.exception.bug("random: addEntropy only supports number, array of numbers or string");this._poolEntropy[a]+=e,this._poolStrength+=e,u===this._NOT_READY&&(this.isReady()!==this._NOT_READY&&this._fireEvent("seeded",Math.max(this._strength,this._poolStrength)),this._fireEvent("progress",this.getProgress()))},isReady:function(t){var e=this._PARANOIA_LEVELS[void 0!==t?t:this._defaultParanoia];return this._strength&&this._strength>=e?this._poolEntropy[0]>this._BITS_PER_RESEED&&(new Date).valueOf()>this._nextReseed?this._REQUIRES_RESEED|this._READY:this._READY:this._poolStrength>=e?this._REQUIRES_RESEED|this._NOT_READY:this._NOT_READY},getProgress:function(t){var e=this._PARANOIA_LEVELS[t?t:this._defaultParanoia];return this._strength>=e?1:this._poolStrength>e?1:this._poolStrength/e},startCollectors:function(){if(!this._collectorsStarted){if(window.addEventListener)window.addEventListener("load",this._loadTimeCollector,!1),window.addEventListener("mousemove",this._mouseCollector,!1);else{if(!document.attachEvent)throw new le.exception.bug("can't attach event");document.attachEvent("onload",this._loadTimeCollector),document.attachEvent("onmousemove",this._mouseCollector)}this._collectorsStarted=!0}},stopCollectors:function(){this._collectorsStarted&&(window.removeEventListener?(window.removeEventListener("load",this._loadTimeCollector,!1),window.removeEventListener("mousemove",this._mouseCollector,!1)):window.detachEvent&&(window.detachEvent("onload",this._loadTimeCollector),window.detachEvent("onmousemove",this._mouseCollector)),this._collectorsStarted=!1)},addEventListener:function(t,e){this._callbacks[t][this._callbackI++]=e},removeEventListener:function(t,e){var n,i,r=this._callbacks[t],o=[];for(i in r)r.hasOwnProperty(i)&&r[i]===e&&o.push(i);for(n=0;n<o.length;n++)i=o[n],delete r[i]},_pools:[new le.hash.sha256],_poolEntropy:[0],_reseedCount:0,_robins:{},_eventId:0,_collectorIds:{},_collectorIdNext:0,_strength:0,_poolStrength:0,_nextReseed:0,_key:[0,0,0,0,0,0,0,0],_counter:[0,0,0,0],_cipher:void 0,_defaultParanoia:6,_collectorsStarted:!1,_callbacks:{progress:{},seeded:{}},_callbackI:0,_NOT_READY:0,_READY:1,_REQUIRES_RESEED:2,_MAX_WORDS_PER_BURST:65536,_PARANOIA_LEVELS:[0,48,64,96,128,192,256,384,512,768,1024],_MILLISECONDS_PER_RESEED:3e4,_BITS_PER_RESEED:80,_gen4words:function(){for(var t=0;4>t&&(this._counter[t]=this._counter[t]+1|0,!this._counter[t]);t++);return this._cipher.encrypt(this._counter)},_gate:function(){this._key=this._gen4words().concat(this._gen4words()),this._cipher=new le.cipher.aes(this._key)},_reseed:function(t){this._key=le.hash.sha256.hash(this._key.concat(t)),this._cipher=new le.cipher.aes(this._key);for(var e=0;4>e&&(this._counter[e]=this._counter[e]+1|0,!this._counter[e]);e++);},_reseedFromPools:function(t){var e,n=[],i=0;for(this._nextReseed=n[0]=(new Date).valueOf()+this._MILLISECONDS_PER_RESEED,e=0;16>e;e++)n.push(4294967296*Math.random()|0);for(e=0;e<this._pools.length&&(n=n.concat(this._pools[e].finalize()),i+=this._poolEntropy[e],this._poolEntropy[e]=0,t||!(this._reseedCount&1<<e));e++);this._reseedCount>=1<<this._pools.length&&(this._pools.push(new le.hash.sha256),this._poolEntropy.push(0)),this._poolStrength-=i,i>this._strength&&(this._strength=i),this._reseedCount++,this._reseed(n)},_mouseCollector:function(t){var e=t.x||t.clientX||t.offsetX||0,n=t.y||t.clientY||t.offsetY||0;le.random.addEntropy([e,n],2,"mouse")},_loadTimeCollector:function(){le.random.addEntropy((new Date).valueOf(),2,"loadtime")},_fireEvent:function(t,e){var n,i=le.random._callbacks[t],r=[];for(n in i)i.hasOwnProperty(n)&&r.push(i[n]);for(n=0;n<r.length;n++)r[n](e)}},function(){try{var t=new Uint32Array(32);crypto.getRandomValues(t),le.random.addEntropy(t,1024,"crypto.getRandomValues")}catch(e){}}(),function(){for(var t in le.beware)le.beware.hasOwnProperty(t)&&le.beware[t]()}();var pe={sjcl:le,version:"1.3.10"};pe.generateAesKey=function(){return{key:le.random.randomWords(8,0),encrypt:function(t){return this.encryptWithIv(t,le.random.randomWords(4,0))},encryptWithIv:function(t,e){var n=new le.cipher.aes(this.key),i=le.codec.utf8String.toBits(t),r=le.mode.cbc.encrypt(n,i,e),o=le.bitArray.concat(e,r);return le.codec.base64.fromBits(o)}}},pe.create=function(t){return new pe.EncryptionClient(t)},pe.EncryptionClient=function(t){var i=this,o=[];i.publicKey=t,i.version=pe.version;var s=function(t,e){var n,i,r;n=document.createElement(t);for(i in e)e.hasOwnProperty(i)&&(r=e[i],n.setAttribute(i,r));return n},a=function(t){return window.jQuery&&t instanceof jQuery?t[0]:t.nodeType&&1===t.nodeType?t:document.getElementById(t)},u=function(t){var e,n,i,r,o=[];if("INTEGER"===t.typeName()&&(e=t.posContent(),n=t.posEnd(),i=t.stream.hexDump(e,n).replace(/[ \n]/g,""),o.push(i)),null!==t.sub)for(r=0;r<t.sub.length;r++)o=o.concat(u(t.sub[r]));return o},c=function(t){var e,n,i=[],r=t.children;for(n=0;n<r.length;n++)e=r[n],1===e.nodeType&&e.attributes["data-encrypted-name"]?i.push(e):e.children&&e.children.length>0&&(i=i.concat(c(e)));return i},l=function(){var n,i,o,s,a,c;try{a=r(t),n=e.decode(a)}catch(l){throw"Invalid encryption key. Please use the key labeled 'Client-Side Encryption Key'"}if(o=u(n),2!==o.length)throw"Invalid encryption key. Please use the key labeled 'Client-Side Encryption Key'";return s=o[0],i=o[1],c=new Z,c.setPublic(s,i),c},p=function(){return{key:le.random.randomWords(8,0),sign:function(t){var e=new le.misc.hmac(this.key,le.hash.sha256),n=e.encrypt(t);return le.codec.base64.fromBits(n)}}};i.encrypt=function(t){var e=l(),r=pe.generateAesKey(),o=p(),s=r.encrypt(t),a=o.sign(le.codec.base64.toBits(s)),u=le.bitArray.concat(r.key,o.key),c=le.codec.base64.fromBits(u),h=e.encrypt(c),d="$bt4|javascript_"+i.version.replace(/\./g,"_")+"$",f=null;return h&&(f=n(h)),d+f+"$"+s+"$"+a},i.encryptForm=function(t){var e,n,r,u,l,p;for(t=a(t),p=c(t);o.length>0;){try{t.removeChild(o[0])}catch(h){}o.splice(0,1)}for(l=0;l<p.length;l++)e=p[l],r=e.getAttribute("data-encrypted-name"),n=i.encrypt(e.value),e.removeAttribute("name"),u=s("input",{value:n,type:"hidden",name:r}),o.push(u),t.appendChild(u)},i.onSubmitEncryptForm=function(t,e){var n;t=a(t),n=function(n){return i.encryptForm(t),e?e(n):n},window.jQuery?window.jQuery(t).submit(n):t.addEventListener?t.addEventListener("submit",n,!1):t.attachEvent&&t.attachEvent("onsubmit",n)},i.formEncrypter={encryptForm:i.encryptForm,extractForm:a,onSubmitEncryptForm:i.onSubmitEncryptForm},le.random.startCollectors()},window.Braintree=pe
2
- }(),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.braintree=t()}}(function(){var t;return function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return r(n?n:e)},l,l.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e){(function(n){"use strict";function i(){}function r(t){if("CONFIGURATION"===t.type||"IMMEDIATE"===t.type)throw new Error(t.message);try{console.error(JSON.stringify(t))}catch(e){}}function o(t,e,n){if(!(e in d))throw new Error(e+" is an unsupported integration");h.isFunction(n[m.ROOT_SUCCESS_CALLBACK])&&(v=function(t){n[m.ROOT_SUCCESS_CALLBACK](g(t))}),h.isFunction(n[m.ROOT_ERROR_CALLBACK])&&(E=n[m.ROOT_ERROR_CALLBACK]),h.isFunction(n[m.ROOT_READY_CALLBACK])&&(_=n[m.ROOT_READY_CALLBACK]),y(_),b(t,e),f.on(f.events.ERROR,E),f.on(f.events.PAYMENT_METHOD_RECEIVED,v),f.on(f.events.WARNING,function(t){try{console.warn(t)}catch(e){}}),u.getConfiguration(t,function(t,i){t?f.emit(f.events.ERROR,{message:t.errors}):s(i,e,n)})}function s(t,e,i){t.sdkVersion="braintree/web/"+a,t.merchantAppId=n.location.host,i.configuration=t,i.integration=e,f.on(f.events.CONFIGURATION_REQUEST,function(t){t(i)}),f.emit(f.events.ASYNC_DEPENDENCY_INITIALIZING),d[e].initialize(t,i),f.emit(f.events.ASYNC_DEPENDENCY_READY)}var a="2.9.0",u=t("braintree-api"),c=t("braintree-paypal"),l=t("braintree-dropin"),p=t("braintree-form"),h=t("braintree-utilities"),d=t("./integrations"),f=t("braintree-bus"),m=t("./constants"),y=t("./lib/dependency-ready"),g=t("./lib/sanitize-payload"),b=t("./lib/analytics-sender").listenForAnalytics,v=i,_=i,E=r;e.exports={api:u,cse:n.Braintree,paypal:c,dropin:l,Form:p,setup:o,VERSION:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./constants":294,"./integrations":298,"./lib/analytics-sender":300,"./lib/dependency-ready":301,"./lib/sanitize-payload":302,"braintree-api":16,"braintree-bus":37,"braintree-dropin":207,"braintree-form":217,"braintree-paypal":272,"braintree-utilities":292}],2:[function(t,e){(function(n){"use strict";function i(t){var e=t.sdkVersion;return e||(e=n.braintree&&n.braintree.VERSION?"braintree/web/"+n.braintree.VERSION:""),e}function r(t){var e,r;this.attrs={},t.hasOwnProperty("sharedCustomerIdentifier")&&(this.attrs.sharedCustomerIdentifier=t.sharedCustomerIdentifier),e=a(t.clientToken),this.driver=t.driver||u,this.analyticsUrl=e.analytics?e.analytics.url:void 0,this.clientApiUrl=e.clientApiUrl,this.customerId=t.customerId,this.challenges=e.challenges,this.integration=t.integration||"",this.sdkVersion=i(e),this.merchantAppId=e.merchantAppId||n.location.host,r=s.create(this,{container:t.container,clientToken:e}),this.verify3DS=o.bind(r.verify,r),this.attrs.authorizationFingerprint=e.authorizationFingerprint,this.attrs.sharedCustomerIdentifierType=t.sharedCustomerIdentifierType,e.merchantAccountId&&(this.attrs.merchantAccountId=e.merchantAccountId),this.requestTimeout=t.hasOwnProperty("timeout")?t.timeout:6e4}var o=t("braintree-utilities"),s=t("braintree-3ds"),a=t("./parse-client-token"),u=t("./request-driver"),c=t("./util"),l=t("./sepa-mandate"),p=t("./europe-bank-account"),h=t("./credit-card"),d=t("./coinbase-account"),f=t("./paypal-account"),m=t("./normalize-api-fields").normalizeCreditCardFields;r.prototype.getCreditCards=function(t){this.driver.get(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods"]),this.attrs,function(t){var e=0,n=t.paymentMethods.length,i=[];for(e;n>e;e++)i.push(new h(t.paymentMethods[e]));return i},t,this.requestTimeout)},r.prototype.tokenizeCoinbase=function(t,e){t.options={validate:!1},this.addCoinbase(t,function(t,n){t?e(t,null):n&&n.nonce?e(t,n):e("Unable to tokenize coinbase account.",null)})},r.prototype.tokenizePayPalAccount=function(t,e){t.options={validate:!1},this.addPayPalAccount(t,function(t,n){t?e(t,null):n&&n.nonce?e(null,n):e("Unable to tokenize paypal account.",null)})},r.prototype.tokenizeCard=function(t,e){t.options={validate:!1},this.addCreditCard(t,function(t,n){n&&n.nonce?e(t,n.nonce,{type:n.type,details:n.details}):e("Unable to tokenize card.",null)})},r.prototype.lookup3DS=function(t,e){var n=c.joinUrlFragments([this.clientApiUrl,"v1/payment_methods",t.nonce,"three_d_secure/lookup"]),i=c.mergeOptions(this.attrs,{amount:t.amount});this.driver.post(n,i,function(t){return t},e,this.requestTimeout)},r.prototype.createSEPAMandate=function(t,e){var n=c.mergeOptions(this.attrs,{sepaMandate:t});this.driver.post(c.joinUrlFragments([this.clientApiUrl,"v1","sepa_mandates.json"]),n,function(t){return{sepaMandate:new l(t.europeBankAccounts[0].sepaMandates[0]),sepaBankAccount:new p(t.europeBankAccounts[0])}},e,this.requestTimeout)},r.prototype.addCoinbase=function(t,e){var n;delete t.share,n=c.mergeOptions(this.attrs,{coinbaseAccount:t,_meta:{integration:this.integration||"custom",source:"coinbase"}}),this.driver.post(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/coinbase_accounts"]),n,function(t){return new d(t.coinbaseAccounts[0])},e,this.requestTimeout)},r.prototype.addPayPalAccount=function(t,e){var n;delete t.share,n=c.mergeOptions(this.attrs,{paypalAccount:t,_meta:{integration:this.integration||"paypal",source:"paypal"}}),this.driver.post(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods","paypal_accounts"]),n,function(t){return new f(t.paypalAccounts[0])},e,this.requestTimeout)},r.prototype.addCreditCard=function(t,e){var n,i,r=t.share;delete t.share,i=m(t),n=c.mergeOptions(this.attrs,{share:r,creditCard:i,_meta:{integration:this.integration||"custom",source:"form"}}),this.driver.post(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/credit_cards"]),n,function(t){return new h(t.creditCards[0])},e,this.requestTimeout)},r.prototype.unlockCreditCard=function(t,e,n){var i=c.mergeOptions(this.attrs,{challengeResponses:e});this.driver.put(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/",t.nonce]),i,function(t){return new h(t.paymentMethods[0])},n,this.requestTimeout)},r.prototype.sendAnalyticsEvents=function(t,e){var i,r,o=this.analyticsUrl,s=[];if(t=c.isArray(t)?t:[t],!o)return void(e&&e.apply(null,[null,{}]));for(r in t)t.hasOwnProperty(r)&&s.push({kind:t[r]});i=c.mergeOptions(this.attrs,{braintree_library_version:this.sdkVersion,analytics:s,_meta:{merchantAppId:this.merchantAppId,platform:"web",platformVersion:n.navigator.userAgent,integrationType:this.integration,sdkVersion:this.sdkVersion}}),this.driver.post(o,i,function(t){return t},e,this.requestTimeout)},r.prototype.decryptBrowserswitchPayload=function(t,e){var n=c.mergeOptions(this.attrs,{asymmetric_encrypted_payload:t}),i=c.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/decrypt"]);this.driver.post(i,n,function(t){return t},e,this.requestTimeout)},r.prototype.encryptBrowserswitchReturnPayload=function(t,e,n){var i=c.mergeOptions(this.attrs,{payload:t,aesKey:e}),r=c.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/encrypt"]);this.driver.post(r,i,function(t){return t},n,this.requestTimeout)},r.prototype.exchangePaypalTokenForConsentCode=function(t,e){var n=c.mergeOptions(this.attrs,t);this.attrs.merchantAccountId&&(n.merchant_account_id=this.attrs.merchantAccountId);var i=c.joinUrlFragments([this.clientApiUrl,"/v1/paypal_account_service/merchant_consent"]);this.driver.post(i,n,function(t){return t},e,this.requestTimeout)},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./coinbase-account":3,"./credit-card":4,"./europe-bank-account":5,"./normalize-api-fields":9,"./parse-client-token":10,"./paypal-account":11,"./request-driver":13,"./sepa-mandate":14,"./util":15,"braintree-3ds":24,"braintree-utilities":36}],3:[function(t,e){"use strict";function n(t){var e,n;for(e=0;e<i.length;e++)n=i[e],this[n]=t[n]}var i=["nonce","type","description","details"];e.exports=n},{}],4:[function(t,e){"use strict";function n(t){var e,n;for(e=0;e<i.length;e++)n=i[e],this[n]=t[n]}var i=["billingAddress","branding","createdAt","createdAtMerchant","createdAtMerchantName","details","isLocked","lastUsedAt","lastUsedAtMerchant","lastUsedAtMerchantName","lastUsedByCurrentMerchant","nonce","securityQuestions","type"];e.exports=n},{}],5:[function(t,e){"use strict";function n(t){var e,n=["bic","maskedIBAN","nonce","accountHolderName"],i=0;for(i=0;i<n.length;i++)e=n[i],this[e]=t[e]}e.exports=n},{}],6:[function(t,e){"use strict";function n(t,e,n){var s=i(t),a={authorizationFingerprint:s.authorizationFingerprint};r.post(s.configUrl,a,function(t){return o.mergeOptions(s,t)},e,n)}var i=t("./parse-client-token"),r=t("./request-driver"),o=t("./util");e.exports=n},{"./parse-client-token":10,"./request-driver":13,"./util":15}],7:[function(t,e){"use strict";function n(t,e){return t.status>=400?[t,null]:[null,e(t)]}function i(){}function r(t,e,r,o,s,a){var u;s=s||i,null==a&&(a=6e4),u=o(t,e,function(t,e){c[e]&&(clearTimeout(c[e]),s.apply(null,n(t,function(t){return r(t)})))}),"number"==typeof a?c[u]=setTimeout(function(){c[u]=null,s.apply(null,[{errors:"Unknown error"},null])},a):s.apply(null,[{errors:"Timeout must be a number"},null])}function o(t,e,n,i,o){e._method="POST",r(t,e,n,u.get,i,o)}function s(t,e,n,i,o){r(t,e,n,u.get,i,o)}function a(t,e,n,i,o){e._method="PUT",r(t,e,n,u.get,i,o)}var u=t("./jsonp"),c=[];e.exports={get:s,post:o,put:a}},{"./jsonp":8}],8:[function(t,e){(function(n){"use strict";function i(t,e){var n=document.createElement("script"),i=!1;n.src=t,n.async=!0;var r=e||l.error;"function"==typeof r&&(n.onerror=function(e){r({url:t,event:e})}),n.onload=n.onreadystatechange=function(){i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(i=!0,n.onload=n.onreadystatechange=null,n&&n.parentNode&&n.parentNode.removeChild(n))},a||(a=document.getElementsByTagName("head")[0]),a.appendChild(n)}function r(t,e){var n,i,o,s=[];for(var o in t)t.hasOwnProperty(o)&&(i=t[o],n=e?u.isArray(t)?e+"[]":e+"["+o+"]":o,s.push("object"==typeof i?r(i,n):encodeURIComponent(n)+"="+encodeURIComponent(i)));return s.join("&")}function o(t,e,n,o){var s=-1===(t||"").indexOf("?")?"?":"&";o=o||l.callbackName||"callback";var a=o+"_json"+u.generateUUID();return s+=r(e),c[a]=function(t){n(t,a);try{delete c[a]}catch(e){}c[a]=null},i(t+s+"&"+o+"="+a),a}function s(t){l=t}var a,u=t("./util"),c=n,l={};e.exports={get:o,init:s,stringify:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util":15}],9:[function(t,e){"use strict";function n(t){var e,n={billingAddress:t.billingAddress||{}};for(e in t)if(t.hasOwnProperty(e))switch(e.replace(/_/,"").toLowerCase()){case"postalcode":case"countryname":case"countrycodenumeric":case"countrycodealpha2":case"countrycodealpha3":case"region":case"extendedaddress":case"locality":case"firstname":case"lastname":case"company":case"streetaddress":n.billingAddress[e]=t[e];break;default:n[e]=t[e]}return n}e.exports={normalizeCreditCardFields:n}},{}],10:[function(t,e){"use strict";function n(t){var e;if(!t)throw new Error("Braintree API Client Misconfigured: clientToken required.");if("object"==typeof t&&null!==t)e=t;else{try{t=window.atob(t)}catch(n){}try{e=JSON.parse(t)}catch(r){throw new Error("Braintree API Client Misconfigured: clientToken is invalid.")}}if(!e.hasOwnProperty("clientApiUrl")||!i.isWhitelistedDomain(e.clientApiUrl))throw new Error("Braintree API Client Misconfigured: clientToken is invalid.");return e}var i=t("braintree-utilities");t("./polyfill"),e.exports=n},{"./polyfill":12,"braintree-utilities":36}],11:[function(t,e){"use strict";function n(t){var e,n;for(e=0;e<i.length;e++)n=i[e],this[n]=t[n]}var i=["nonce","type","description","details"];e.exports=n},{}],12:[function(){(function(t){"use strict";t.atob=t.atob||function(t){var e=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="";if(!e.test(t))throw new Error("Braintree API Client Misconfigured: clientToken is invalid.");var r=0;do{var o=n.indexOf(t.charAt(r++)),s=n.indexOf(t.charAt(r++)),a=n.indexOf(t.charAt(r++)),u=n.indexOf(t.charAt(r++)),c=(63&o)<<2|s>>4&3,l=(15&s)<<4|a>>2&15,p=(3&a)<<6|63&u;i+=String.fromCharCode(c)+(l?String.fromCharCode(l):"")+(p?String.fromCharCode(p):"")}while(r<t.length);return i}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],13:[function(t,e){"use strict";var n=t("./jsonp-driver");e.exports=n},{"./jsonp-driver":7}],14:[function(t,e){"use strict";function n(t){var e,n=0,i=["accountHolderName","bic","longFormURL","mandateReferenceNumber","maskedIBAN","shortForm"];for(n=0;n<i.length;n++)e=i[n],this[e]=t[e]}e.exports=n},{}],15:[function(t,e){"use strict";function n(t){var e,n,i=[];for(n=0;n<t.length;n++)e=t[n],"/"===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),"/"===e.charAt(0)&&(e=e.substring(1)),i.push(e);return i.join("/")}function i(t){return t&&"object"==typeof t&&"number"==typeof t.length&&"[object Array]"===Object.prototype.toString.call(t)||!1}function r(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.floor(16*Math.random()),n="x"===t?e:3&e|8;return n.toString(16)})}function o(t,e){var n,i={};for(n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);for(n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);return i}e.exports={joinUrlFragments:n,isArray:i,generateUUID:r,mergeOptions:o}},{}],16:[function(t,e){"use strict";function n(t){return new i(t)}var i=t("./lib/client"),r=t("./lib/jsonp"),o=t("./lib/jsonp-driver"),s=t("./lib/util"),a=t("./lib/parse-client-token"),u=t("./lib/get-configuration");e.exports={Client:i,configure:n,util:s,JSONP:r,JSONPDriver:o,parseClientToken:a,getConfiguration:u}},{"./lib/client":2,"./lib/get-configuration":6,"./lib/jsonp":8,"./lib/jsonp-driver":7,"./lib/parse-client-token":10,"./lib/util":15}],17:[function(t,e){"use strict";function n(t,e){if(e=e||"["+t+"] is not a valid DOM Element",t&&t.nodeType&&1===t.nodeType)return t;if(t&&window.jQuery&&(t instanceof jQuery||"jquery"in Object(t))&&0!==t.length)return t[0];if("string"==typeof t&&document.getElementById(t))return document.getElementById(t);throw new Error(e)}e.exports={normalizeElement:n}},{}],18:[function(t,e){"use strict";function n(t,e,n,i){t.addEventListener?t.addEventListener(e,n,i):t.attachEvent&&t.attachEvent("on"+e,n)}function i(t,e,n,i){t.removeEventListener?t.removeEventListener(e,n,i):t.detachEvent&&t.detachEvent("on"+e,n)}e.exports={addEventListener:n,removeEventListener:i}},{}],19:[function(t,e){"use strict";function n(t){return"[object Function]"===r.call(t)}function i(t,e){return function(){t.apply(e,arguments)}}var r=Object.prototype.toString;e.exports={bind:i,isFunction:n}},{}],20:[function(t,e){"use strict";function n(){return"https:"===window.location.protocol}function i(t){switch(t){case null:case void 0:return"";case!0:return"1";case!1:return"0";default:return encodeURIComponent(t)}}function r(t,e){var n,o,s=[];for(o in t)if(t.hasOwnProperty(o)){var a=t[o];n=e?e+"["+o+"]":o,"object"==typeof a?s.push(r(a,n)):void 0!==a&&null!==a&&s.push(i(n)+"="+i(a))}return s.join("&")}function o(t){for(var e={},n=t.split("&"),i=0;i<n.length;i++){var r=n[i].split("="),o=r[0],s=decodeURIComponent(r[1]);e[o]=s}return e}function s(t){var e=t.split("?");return 2!==e.length?{}:o(e[1])}e.exports={isBrowserHttps:n,makeQueryString:r,decodeQueryString:o,getParams:s}},{}],21:[function(t,e){var n=t("./lib/dom"),i=t("./lib/url"),r=t("./lib/fn"),o=t("./lib/events");e.exports={normalizeElement:n.normalizeElement,isBrowserHttps:i.isBrowserHttps,makeQueryString:i.makeQueryString,decodeQueryString:i.decodeQueryString,getParams:i.getParams,removeEventListener:o.removeEventListener,addEventListener:o.addEventListener,bind:r.bind,isFunction:r.isFunction}},{"./lib/dom":17,"./lib/events":18,"./lib/fn":19,"./lib/url":20}],22:[function(t,e){"use strict";function n(t,e){var n=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return n[e]}function i(){return{html:{height:o.style.height||"",overflow:n(o,"overflow"),position:n(o,"position")},body:{height:s.style.height||"",overflow:n(s,"overflow")}}}function r(t,e){this.assetsUrl=t,this.container=e||document.body,this.iframe=null,o=document.documentElement,s=document.body,this.merchantPageDefaultStyles=i()}var o,s,a=t("braintree-utilities"),u=t("../shared/receiver"),c="1.3.0";r.prototype.get=function(t,e){var n=this,i=this.constructAuthorizationURL(t);this.container&&a.isFunction(this.container)?this.container(i+"&no_style=1"):this.insertIframe(i),new u(function(t){a.isFunction(n.container)||n.removeIframe(),e(t)})},r.prototype.removeIframe=function(){this.container&&this.container.nodeType&&1===this.container.nodeType?this.container.removeChild(this.iframe):this.container&&window.jQuery&&this.container instanceof jQuery?$(this.iframe,this.container).remove():"string"==typeof this.container&&document.getElementById(this.container).removeChild(this.iframe),this.unlockMerchantWindowSize()},r.prototype.insertIframe=function(t){var e=document.createElement("iframe");if(e.src=t,this.applyStyles(e),this.lockMerchantWindowSize(),this.container&&this.container.nodeType&&1===this.container.nodeType)this.container.appendChild(e);else if(this.container&&window.jQuery&&this.container instanceof jQuery&&0!==this.container.length)this.container.append(e);else{if("string"!=typeof this.container||!document.getElementById(this.container))throw new Error("Unable to find valid container for iframe.");document.getElementById(this.container).appendChild(e)}this.iframe=e},r.prototype.applyStyles=function(t){t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.height="100%",t.style.width="100%",t.setAttribute("frameborder","0"),t.setAttribute("allowTransparency","true"),t.style.border="0",t.style.zIndex="99999"},r.prototype.lockMerchantWindowSize=function(){o.style.overflow="hidden",s.style.overflow="hidden",s.style.height="100%"},r.prototype.unlockMerchantWindowSize=function(){var t=this.merchantPageDefaultStyles;s.style.height=t.body.height,s.style.overflow=t.body.overflow,o.style.overflow=t.html.overflow},r.prototype.constructAuthorizationURL=function(t){var e,n=window.location.href;return n.indexOf("#")>-1&&(n=n.split("#")[0]),e=a.makeQueryString({acsUrl:t.acsUrl,pareq:t.pareq,termUrl:t.termUrl+"&three_d_secure_version="+c,md:t.md,parentUrl:n}),this.assetsUrl+"/3ds/"+c+"/html/style_frame?"+e},e.exports=r},{"../shared/receiver":29,"braintree-utilities":21}],23:[function(t,e){"use strict";function n(){}function i(t,e){e=e||{},this.clientToken=e.clientToken,this.container=e.container,this.api=t,this.nonce=null,this._loader=null,this._boundHandleUserClose=r.bind(this._handleUserClose,this)}var r=t("braintree-utilities"),o=t("./authorization_service"),s=t("./loader");i.prototype.verify=function(t,e){if(!r.isFunction(e))throw this.api.sendAnalyticsEvents("3ds.web.no_callback"),new Error("No suitable callback argument was given");r.isFunction(t.onUserClose)&&(this._onUserClose=t.onUserClose),r.isFunction(t.onLookupComplete)&&(this._onLookupComplete=t.onLookupComplete),(void 0===t.useDefaultLoader||t.useDefaultLoader===!0)&&this._createDefaultLoader();var n={nonce:"",amount:t.amount},i=t.creditCard;if("string"==typeof i)n.nonce=i,this.api.sendAnalyticsEvents("3ds.web.verify.nonce"),this.startVerification(n,e);else{var o=this,s=function(t,i){return t?(o._removeDefaultLoader(),e(t)):(n.nonce=i,void o.startVerification(n,e))};this.api.sendAnalyticsEvents("3ds.web.verify.credit_card"),this.api.tokenizeCard(i,s)}},i.prototype.startVerification=function(t,e){this.api.lookup3DS(t,r.bind(this.handleLookupResponse(e),this))},i.prototype.handleLookupResponse=function(t){var e=this;return function(n,i){var s;this._onLookupComplete(),n?t(n.error):i.lookup&&i.lookup.acsUrl&&i.lookup.acsUrl.length>0?(e.nonce=i.paymentMethod.nonce,s=new o(this.clientToken.assetsUrl,this.container),s.get(i.lookup,r.bind(this.handleAuthenticationResponse(t),this)),this._detachListeners(),this._attachListeners()):(e.nonce=i.paymentMethod.nonce,t(null,{nonce:e.nonce,verificationDetails:i.threeDSecureInfo}))}},i.prototype.handleAuthenticationResponse=function(t){return function(e){var n,i=r.decodeQueryString(e);i.user_closed||(n=JSON.parse(i.auth_response),n.success?t(null,{nonce:n.paymentMethod.nonce,verificationDetails:n.threeDSecureInfo}):n.threeDSecureInfo&&n.threeDSecureInfo.liabilityShiftPossible?t(null,{nonce:this.nonce,verificationDetails:n.threeDSecureInfo}):t(n.error))}},i.prototype._attachListeners=function(){r.addEventListener(window,"message",this._boundHandleUserClose)},i.prototype._detachListeners=function(){r.removeEventListener(window,"message",this._boundHandleUserClose)},i.prototype._createDefaultLoader=function(){this._loader=new s,document.body.appendChild(this._loader.getElement())},i.prototype._removeDefaultLoader=function(){if(this._loader){var t=this._loader.getElement(),e=t.parentNode;e&&e.removeChild(t),this._loader.dispose(),this._loader=null}},i.prototype._handleUserClose=function(t){"user_closed=true"===t.data&&this._onUserClose()},i.prototype._onUserClose=n,i.prototype._onLookupComplete=function(){this._removeDefaultLoader()},e.exports=i},{"./authorization_service":22,"./loader":25,"braintree-utilities":21}],24:[function(t,e){"use strict";var n=t("./client");e.exports={create:function(t,e){var i=new n(t,e);return i}}},{"./client":23}],25:[function(t,e){"use strict";function n(){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._display=null,this._initialize()}var i=t("./loader_display"),r=t("./loader_message"),o=t("./loader_spinner");n.prototype._cssDeclarations=["filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#7F000000, EndColorStr=#7F000000)","background-color: rgba(0, 0, 0, 0.5)","display: table","height: 100%","left: 0","position: fixed","right: 0","top: 0","width: 100%","z-index: 99999"].join(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._display.dispose(),this._display=null,this._element=null},n.prototype._initialize=function(){var t=new o,e=window.SVGElement&&window.SVGAnimateElement&&window.SVGAnimateTransformElement;e||(t=new r("Loading...")),this._display=new i(t),this.getElement().appendChild(this._display.getElement())},e.exports=n},{"./loader_display":26,"./loader_message":27,"./loader_spinner":28}],26:[function(t,e){"use strict";function n(t){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._displayObject=t,this._initialize()}n.prototype._cssDeclarations=["display: table-cell","vertical-align: middle"].join(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._displayObject.dispose(),this._displayObject=null,this._element=null},n.prototype._initialize=function(){this.getElement().appendChild(this._displayObject.getElement())},e.exports=n},{}],27:[function(t,e){"use strict";function n(t){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._element.innerHTML=t}n.prototype._cssDeclarations=["color: #fff","font-family: Helvetica, sans-serif","font-size: 12px","text-align: center"].join(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._element=null},e.exports=n},{}],28:[function(t,e){"use strict";function n(){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._element.innerHTML=this._markup}n.prototype._cssDeclarations=["height: 36px","margin-left: auto","margin-right: auto","width: 36px"].join(";"),n.prototype._markup=['<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"','width="100%" height="100%" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">',' <path fill="#FFF" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">',' <animateTransform attributeType="xml"',' attributeName="transform"',' type="rotate"',' from="0 25 25"',' to="360 25 25"',' dur="780ms"',' repeatCount="indefinite"',' calcMode="spline"',' keySplines="0.44, 0.22, 0, 1"',' keyTimes="0;1"/>'," </path>","</svg>"].join(""),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._element=null},e.exports=n},{}],29:[function(t,e){"use strict";function n(t){this.postMessageReceiver(t),this.hashChangeReceiver(t)}var i=t("braintree-utilities");n.prototype.postMessageReceiver=function(t){var e=this;this.wrappedCallback=function(n){var i=n.data;(/^(auth_response=)/.test(i)||"user_closed=true"===i)&&(t(i),e.stopListening())},i.addEventListener(window,"message",this.wrappedCallback)},n.prototype.hashChangeReceiver=function(t){var e,n=window.location.hash,i=this;this.poll=setInterval(function(){e=window.location.hash,e.length>0&&e!==n&&(i.stopListening(),e=e.substring(1,e.length),t(e),window.location.hash=n.length>0?n:"")},10)},n.prototype.stopListening=function(){clearTimeout(this.poll),i.removeEventListener(window,"message",this.wrappedCallback)},e.exports=n},{"braintree-utilities":21}],30:[function(t,e){"use strict";var n,i=Array.prototype.indexOf;n=i?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n;return-1},e.exports={indexOf:n}},{}],31:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],32:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],33:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],34:[function(t,e){"use strict";function n(t){var e,n,i,r,o=[{min:0,max:180,chars:7},{min:181,max:620,chars:14},{min:621,max:960,chars:22}];for(r=o.length,t=t||window.innerWidth,n=0;r>n;n++)i=o[n],t>=i.min&&t<=i.max&&(e=i.chars);return e||60}function i(t,e){var n,i;return-1===t.indexOf("@")?t:(t=t.split("@"),n=t[0],i=t[1],n.length>e&&(n=n.slice(0,e)+"..."),i.length>e&&(i="..."+i.slice(-e)),n+"@"+i)}e.exports={truncateEmail:i,getMaxCharLength:n}},{}],35:[function(t,e){"use strict";function n(){return"https:"===window.location.protocol}function i(t){switch(t){case null:case void 0:return"";case!0:return"1";case!1:return"0";default:return encodeURIComponent(t)}}function r(t,e){var n,o,s=[];for(o in t)if(t.hasOwnProperty(o)){var a=t[o];n=e?e+"["+o+"]":o,"object"==typeof a?s.push(r(a,n)):void 0!==a&&null!==a&&s.push(i(n)+"="+i(a))}return s.join("&")}function o(t){for(var e={},n=t.split("&"),i=0;i<n.length;i++){var r=n[i].split("="),o=r[0],s=decodeURIComponent(r[1]);e[o]=s}return e}function s(t){var e=t.split("?");return 2!==e.length?{}:o(e[1])}function a(t){if(t=t.toLowerCase(),!/^http/.test(t))return!1;c.href=t;var e=c.hostname.split("."),n=e.slice(-2).join(".");return-1===u.indexOf(l,n)?!1:!0}var u=t("./array"),c=document.createElement("a"),l=["paypal.com","braintreepayments.com","braintreegateway.com","localhost"];e.exports={isBrowserHttps:n,makeQueryString:r,decodeQueryString:o,getParams:s,isWhitelistedDomain:a}},{"./array":30}],36:[function(t,e){var n=t("./lib/dom"),i=t("./lib/url"),r=t("./lib/fn"),o=t("./lib/events"),s=t("./lib/string"),a=t("./lib/array");e.exports={string:s,array:a,normalizeElement:n.normalizeElement,isBrowserHttps:i.isBrowserHttps,makeQueryString:i.makeQueryString,decodeQueryString:i.decodeQueryString,getParams:i.getParams,isWhitelistedDomain:i.isWhitelistedDomain,removeEventListener:o.removeEventListener,addEventListener:o.addEventListener,bind:r.bind,isFunction:r.isFunction}},{"./lib/array":30,"./lib/dom":31,"./lib/events":32,"./lib/fn":33,"./lib/string":34,"./lib/url":35}],37:[function(t,e){"use strict";var n=t("framebus");n.events=t("./lib/events"),e.exports=n},{"./lib/events":38,framebus:39}],38:[function(t,e){"use strict";for(var n=["PAYMENT_METHOD_REQUEST","PAYMENT_METHOD_RECEIVED","PAYMENT_METHOD_GENERATED","PAYMENT_METHOD_NOT_GENERATED","PAYMENT_METHOD_CANCELLED","PAYMENT_METHOD_ERROR","CONFIGURATION_REQUEST","ROOT_METADATA_REQUEST","ERROR","WARNING","UI_POPUP_DID_OPEN","UI_POPUP_DID_CLOSE","UI_POPUP_FORCE_CLOSE","ASYNC_DEPENDENCY_INITIALIZING","ASYNC_DEPENDENCY_READY","USER_FORM_SUBMIT_REQUEST","SEND_ANALYTICS_EVENTS"],i={},r=0;r<n.length;r++){var o=n[r];i[o]=o}e.exports=i},{}],39:[function(e,n,i){"use strict";!function(e,r){"object"==typeof i&&"undefined"!=typeof n?n.exports=r():"function"==typeof t&&t.amd?t([],r):e.framebus=r()}(this,function(){function t(t){return null==t?!1:null==t.Window?!1:t.constructor!==t.Window?!1:(g.push(t),!0)}function e(t){var e,n={};for(e in y)y.hasOwnProperty(e)&&(n[e]=y[e]);return n._origin=t||"*",n}function n(t){var e,n,i=this._origin||"*";return"string"!=typeof t?!1:"string"!=typeof i?!1:(n=Array.prototype.slice.call(arguments,1),e=o(t,n,i),e===!1?!1:(p(m.top,e,i),!0))}function i(t,e){var n=this._origin||"*";return f(t,e,n)?!1:(b[n]=b[n]||{},b[n][t]=b[n][t]||[],b[n][t].push(e),!0)}function r(t,e){var n,i,r=this._origin||"*";if(f(t,e,r))return!1;if(i=b[r]&&b[r][t],!i)return!1;for(n=0;n<i.length;n++)if(i[n]===e)return i.splice(n,1),!0;return!1}function o(t,e,n){var i=!1,r={event:t,origin:n},o=e[e.length-1];"function"==typeof o&&(r.reply=d(o,n),e=e.slice(0,-1)),r.args=e;try{i=v+JSON.stringify(r)}catch(s){throw new Error("Could not stringify event: "+s.message)}return i}function s(t){var e,n,i,r;if(t.data.slice(0,v.length)!==v)return!1;try{e=JSON.parse(t.data.slice(v.length))}catch(s){return!1}return null!=e.reply&&(n=t.origin,i=t.source,r=e.reply,e.reply=function(t){var e=o(r,[t],n);return e===!1?!1:void i.postMessage(e,n)},e.args.push(e.reply)),e}function a(t){m||(m=t||window,m.addEventListener?m.addEventListener("message",c,!1):m.attachEvent?m.attachEvent("onmessage",c):null===m.onmessage?m.onmessage=c:m=null)}function u(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"===t?e:3&e|8;return n.toString(16)})}function c(t){var e;"string"==typeof t.data&&(e=s(t),e&&(l("*",e.event,e.args,t),l(t.origin,e.event,e.args,t),h(t.data,e.origin,t.source)))}function l(t,e,n,i){var r;if(b[t]&&b[t][e])for(r=0;r<b[t][e].length;r++)b[t][e][r].apply(i,n)}function p(t,e,n){var i;for(t.postMessage(e,n),t.opener&&t.opener!==m&&p(t.opener.top,e,n),i=0;i<t.frames.length;i++)p(t.frames[i],e,n)}function h(t,e,n){var i,r;for(i=g.length-1;i>=0;i--)r=g[i],r.closed===!0?g=g.slice(i,1):n!==r&&p(r.top,t,e)}function d(t,e){function n(r,o){t(r,o),y.target(e).unsubscribe(i,n)}var i=u();return y.target(e).subscribe(i,n),i}function f(t,e,n){return"string"!=typeof t?!0:"function"!=typeof e?!0:"string"!=typeof n?!0:!1}var m,y,g=[],b={},v="/*framebus*/";return a(),y={target:e,include:t,publish:n,pub:n,trigger:n,emit:n,subscribe:i,sub:i,on:i,unsubscribe:r,unsub:r,off:r}})},{}],40:[function(t,e){"use strict";function n(t,e){a.emit(a.events.ERROR,{type:e,message:t})}function i(t){t=t||{};var e=t.coinbase;if(null==t.apiClient)n("settings.apiClient is required for coinbase",u);else if(t.configuration.coinbaseEnabled)if(e&&(e.container||e.button))if(e.container&&e.button)n("options.coinbase.container and options.coinbase.button are mutually exclusive",u);else{if(s.isSupportedBrowser())return!0;n("Coinbase is not supported by your browser. Please consider upgrading","UNSUPPORTED_BROWSER")
3
- }else n("Either options.coinbase.container or options.coinbase.button is required for Coinbase integrations",u);else n("Coinbase is not enabled for your merchant account",u);return!1}function r(t){return i(t)?new o(t):void 0}var o=t("./lib/coinbase"),s=t("./lib/detector"),a=t("braintree-bus"),u="CONFIGURATION";e.exports={create:r}},{"./lib/coinbase":43,"./lib/detector":45,"braintree-bus":51}],41:[function(t,e){(function(t){"use strict";function n(e){return e=e||t.navigator.userAgent,/AppleWebKit\//.test(e)&&/Mobile\//.test(e)?e.replace(/.* OS ([0-9_]+) like Mac OS X.*/,"$1").replace(/_/g,"."):null}function i(e){e=e||t.navigator.userAgent;var n=null,i=/MSIE.(\d+)/.exec(e);return/Trident/.test(e)&&(n=11),i&&(n=parseInt(i[1],10)),n}function r(e){return e=e||t.navigator.userAgent,/Android/.test(e)?e.replace(/^.* Android ([0-9\.]+).*$/,"$1"):null}e.exports={ieVersion:i,iOSSafariVersion:n,androidVersion:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],42:[function(t,e){"use strict";function n(t,e,n){return t?(i.emit(i.events.ERROR,t.error),void n._sendAnalyticsEvent("generate.nonce.failed")):(i.emit(i.events.PAYMENT_METHOD_GENERATED,e),void n._sendAnalyticsEvent("generate.nonce.succeeded"))}var i=t("braintree-bus");e.exports={tokenize:n}},{"braintree-bus":51}],43:[function(t,e){(function(n){"use strict";function i(t){return{clientId:t.configuration.coinbase.clientId,redirectUrl:t.configuration.coinbase.redirectUrl,scopes:t.configuration.coinbase.scopes||c.SCOPES,meta:{authorizations_merchant_account:t.configuration.coinbase.merchantAccount||""}}}function r(t){var e;this.buttonId=t.coinbase.button||c.BUTTON_ID,this.apiClient=t.apiClient,this.assetsUrl=t.configuration.assetsUrl,this.environment=t.configuration.coinbase.environment,this._onOAuthSuccess=o.bind(this._onOAuthSuccess,this),this._handleButtonClick=o.bind(this._handleButtonClick,this),this.popupParams=i(t),this.redirectDoneInterval=null,t.coinbase.container?(e=o.normalizeElement(t.coinbase.container),this._insertFrame(e)):(n.braintreeCoinbasePopupCallback=this._onOAuthSuccess,e=document.body,o.addEventListener(e,"click",this._handleButtonClick),this._sendAnalyticsEvent("initialized"))}var o=t("braintree-utilities"),s=t("./dom/composer"),a=t("./url-composer"),u=t("./callbacks"),c=t("./constants"),l=t("./detector"),p=t("braintree-bus");r.prototype._sendAnalyticsEvent=function(t){var e=this.apiClient.integration+".web.coinbase.";this.apiClient.sendAnalyticsEvents(e+t)},r.prototype._insertFrame=function(t){var e=s.createFrame({src:this.assetsUrl+"/coinbase/"+c.VERSION+"/coinbase-frame.html"});p.emit(p.events.ASYNC_DEPENDENCY_INITIALIZING),t.appendChild(e)},r.prototype._onOAuthSuccess=function(t){return t.code?(p.emit("coinbase:view:navigate","loading"),this._sendAnalyticsEvent("popup.authorized"),this.apiClient.tokenizeCoinbase({code:t.code,query:a.getQueryString()},o.bind(function(t,e){u.tokenize.apply(null,[t,e,this])},this)),void this._closePopup()):void this._sendAnalyticsEvent("popup.denied")},r.prototype._clearPollForRedirectDone=function(){this.redirectDoneInterval&&(clearInterval(this.redirectDoneInterval),this.redirectDoneInterval=null)},r.prototype._closePopup=function(t){t=t||this.popup,l.shouldCloseFromParent()&&t.close(),this._popupCleanup()},r.prototype._popupCleanup=function(){this._clearPollForRedirectDone(),p.emit(p.events.UI_POPUP_DID_CLOSE,{source:c.INTEGRATION_NAME})},r.prototype._pollForRedirectDone=function(t){var e=setInterval(o.bind(function(){var e;if(null==t||t.closed)return this._sendAnalyticsEvent("popup.aborted"),void this._popupCleanup();try{if("about:blank"===t.location.href)throw new Error("Not finished loading");e=o.decodeQueryString(t.location.search.replace(/^\?/,"")).code}catch(n){return}this._onOAuthSuccess({code:e})},this),100);return this.redirectDoneInterval=e,e},r.prototype._openPopup=function(){var t;this._sendAnalyticsEvent("popup.started"),t=s.createPopup(a.compose(this._getOAuthBaseUrl(),this.popupParams)),t.focus(),this._pollForRedirectDone(t),p.trigger(p.events.UI_POPUP_DID_OPEN,{source:c.INTEGRATION_NAME}),p.on(p.events.UI_POPUP_FORCE_CLOSE,function(e){e.target===c.INTEGRATION_NAME&&t.close()}),this.popup=t},r.prototype._getOAuthBaseUrl=function(){var t;return t="shared_sandbox"===this.environment?c.SANDBOX_OAUTH_BASE_URL:c.PRODUCTION_OAUTH_BASE_URL},r.prototype._handleButtonClick=function(t){for(var e=t.target||t.srcElement;;){if(null==e)return;if(e===t.currentTarget)return;if(e.id===this.buttonId)break;e=e.parentNode}t&&t.preventDefault?t.preventDefault():t.returnValue=!1,this._openPopup()},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./callbacks":42,"./constants":44,"./detector":45,"./dom/composer":47,"./url-composer":50,"braintree-bus":51,"braintree-utilities":60}],44:[function(t,e){"use strict";e.exports={PRODUCTION_OAUTH_BASE_URL:"https://coinbase.com",SANDBOX_OAUTH_BASE_URL:"https://sandbox.coinbase.com",ORIGIN_URL:"https://www.coinbase.com",FRAME_NAME:"braintree-coinbase-frame",POPUP_NAME:"coinbase",BUTTON_ID:"bt-coinbase-button",SCOPES:"send",VERSION:"0.1.0",INTEGRATION_NAME:"Coinbase"}},{}],45:[function(t,e){"use strict";function n(){var t=s.ieVersion();return!t||t>8}function i(){var t=s.androidVersion();return null==t?!1:/^5/.test(t)}function r(){return!(i()||o())}function o(){var t=s.iOSSafariVersion();return null==t?!1:/^8\.0/.test(t)||/^8\.1$/.test(t)}var s=t("./browser");e.exports={isSupportedBrowser:n,shouldCloseFromParent:r,shouldDisplayIOSClose:o,shouldDisplayLollipopClose:i}},{"./browser":41}],46:[function(t,e){"use strict";function n(t){var e=document.createElement("button");return t=t||{},e.id=t.id||"coinbase-button",e.style.backgroundColor=t.backgroundColor||"#EEE",e.style.color=t.color||"#4597C3",e.style.border=t.border||"0",e.style.borderRadius=t.borderRadius||"6px",e.style.padding=t.padding||"12px",e.innerHTML=t.innerHTML||"coinbase",e}e.exports={create:n}},{}],47:[function(t,e){"use strict";var n=t("./popup"),i=t("./button"),r=t("./frame");e.exports={createButton:i.create,createPopup:n.create,createFrame:r.create}},{"./button":46,"./frame":48,"./popup":49}],48:[function(t,e){"use strict";function n(t){return r({src:t.src,name:i.FRAME_NAME,height:"70px",width:"100%",style:{padding:0,margin:0,border:0,outline:"none"}})}var i=t("../constants"),r=t("iframer");e.exports={create:n}},{"../constants":44,iframer:61}],49:[function(t,e){(function(n){"use strict";function i(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push([n,t[n]].join("="));return e.join(",")}function r(){var t=850,e=600;return i({width:t,height:e,left:(screen.width-t)/2,top:(screen.height-e)/4})}function o(t){return n.open(t,s.POPUP_NAME,r())}var s=t("../constants");e.exports={create:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants":44}],50:[function(t,e){"use strict";function n(){return"version="+r.VERSION}function i(t,e){var i=t+"/oauth/authorize?response_type=code",r=e.redirectUrl+"?"+n();if(i+="&redirect_uri="+encodeURIComponent(r),i+="&client_id="+e.clientId,e.scopes&&(i+="&scope="+encodeURIComponent(e.scopes)),e.meta)for(var o in e.meta)e.meta.hasOwnProperty(o)&&(i+="&meta["+encodeURIComponent(o)+"]="+encodeURIComponent(e.meta[o]));return i}var r=t("./constants");e.exports={compose:i,getQueryString:n}},{"./constants":44}],51:[function(t,e,n){arguments[4][37][0].apply(n,arguments)},{"./lib/events":52,dup:37,framebus:53}],52:[function(t,e,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],53:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],54:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],55:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],56:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],57:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],58:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],59:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{"./array":54,dup:35}],60:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"./lib/array":54,"./lib/dom":55,"./lib/events":56,"./lib/fn":57,"./lib/string":58,"./lib/url":59,dup:36}],61:[function(t,e){"use strict";var n=t("lodash.assign"),i=t("lodash.isstring"),r=t("./lib/default-attributes");e.exports=function(t){var e=document.createElement("iframe"),o=n({},r,t);o.style&&!i(o.style)&&(n(e.style,o.style),delete o.style);for(var s in o)o.hasOwnProperty(s)&&e.setAttribute(s,o[s]);return e.getAttribute("id")||(e.id=e.name),e}},{"./lib/default-attributes":62,"lodash.assign":63,"lodash.isstring":74}],62:[function(t,e){e.exports={frameBorder:0,allowtransparency:!0}},{}],63:[function(t,e){function n(t,e,n){for(var i=-1,r=o(e),s=r.length;++i<s;){var a=r[i],u=t[a],c=n(u,e[a],a,t,e);(c===c?c===u:u!==u)&&(void 0!==u||a in t)||(t[a]=c)}return t}var i=t("lodash._baseassign"),r=t("lodash._createassigner"),o=t("lodash.keys"),s=r(function(t,e,r){return r?n(t,e,r):i(t,e)});e.exports=s},{"lodash._baseassign":64,"lodash._createassigner":66,"lodash.keys":70}],64:[function(t,e){function n(t,e){return null==e?t:i(e,r(e),t)}var i=t("lodash._basecopy"),r=t("lodash.keys");e.exports=n},{"lodash._basecopy":65,"lodash.keys":70}],65:[function(t,e){function n(t,e,n){n||(n={});for(var i=-1,r=e.length;++i<r;){var o=e[i];n[o]=t[o]}return n}e.exports=n},{}],66:[function(t,e){function n(t){return o(function(e,n){var o=-1,s=null==e?0:n.length,a=s>2?n[s-2]:void 0,u=s>2?n[2]:void 0,c=s>1?n[s-1]:void 0;for("function"==typeof a?(a=i(a,c,5),s-=2):(a="function"==typeof c?c:void 0,s-=a?1:0),u&&r(n[0],n[1],u)&&(a=3>s?void 0:a,s=1);++o<s;){var l=n[o];l&&t(e,l,a)}return e})}var i=t("lodash._bindcallback"),r=t("lodash._isiterateecall"),o=t("lodash.restparam");e.exports=n},{"lodash._bindcallback":67,"lodash._isiterateecall":68,"lodash.restparam":69}],67:[function(t,e){function n(t,e,n){if("function"!=typeof t)return i;if(void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,i,r){return t.call(e,n,i,r)};case 4:return function(n,i,r,o){return t.call(e,n,i,r,o)};case 5:return function(n,i,r,o,s){return t.call(e,n,i,r,o,s)}}return function(){return t.apply(e,arguments)}}function i(t){return t}e.exports=n},{}],68:[function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&s(l(t))}function r(t,e){return t="number"==typeof t||u.test(t)?+t:-1,e=null==e?c:e,t>-1&&t%1==0&&e>t}function o(t,e,n){if(!a(n))return!1;var o=typeof e;if("number"==o?i(n)&&r(e,n.length):"string"==o&&e in n){var s=n[e];return t===t?t===s:s!==s}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&c>=t}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var u=/^\d+$/,c=9007199254740991,l=n("length");e.exports=o},{}],69:[function(t,e){function n(t,e){if("function"!=typeof t)throw new TypeError(i);return e=r(void 0===e?t.length-1:+e||0,0),function(){for(var n=arguments,i=-1,o=r(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];switch(e){case 0:return t.call(this,s);case 1:return t.call(this,n[0],s);case 2:return t.call(this,n[0],n[1],s)}var a=Array(e+1);for(i=-1;++i<e;)a[i]=n[i];return a[e]=s,t.apply(this,a)}}var i="Expected a function",r=Math.max;e.exports=n},{}],70:[function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&o(g(t))}function r(t,e){return t="number"==typeof t||h.test(t)?+t:-1,e=null==e?y:e,t>-1&&t%1==0&&e>t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function s(t){for(var e=u(t),n=e.length,i=n&&t.length,s=!!i&&o(i)&&(p(t)||l(t)),a=-1,c=[];++a<n;){var h=e[a];(s&&r(h,i)||f.call(t,h))&&c.push(h)}return c}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){if(null==t)return[];a(t)||(t=Object(t));var e=t.length;e=e&&o(e)&&(p(t)||l(t))&&e||0;for(var n=t.constructor,i=-1,s="function"==typeof n&&n.prototype===t,u=Array(e),c=e>0;++i<e;)u[i]=i+"";for(var h in t)c&&r(h,e)||"constructor"==h&&(s||!f.call(t,h))||u.push(h);return u}var c=t("lodash._getnative"),l=t("lodash.isarguments"),p=t("lodash.isarray"),h=/^\d+$/,d=Object.prototype,f=d.hasOwnProperty,m=c(Object,"keys"),y=9007199254740991,g=n("length"),b=m?function(t){var e=null==t?void 0:t.constructor;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&i(t)?s(t):a(t)?m(t):[]}:s;e.exports=b},{"lodash._getnative":71,"lodash.isarguments":72,"lodash.isarray":73}],71:[function(t,e){function n(t){return!!t&&"object"==typeof t}function i(t,e){var n=null==t?void 0:t[e];return s(n)?n:void 0}function r(t){return o(t)&&h.call(t)==a}function o(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function s(t){return null==t?!1:r(t)?d.test(l.call(t)):n(t)&&u.test(t)}var a="[object Function]",u=/^\[object .+?Constructor\]$/,c=Object.prototype,l=Function.prototype.toString,p=c.hasOwnProperty,h=c.toString,d=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=i},{}],72:[function(t,e){function n(t){return!!t&&"object"==typeof t}function i(t){return function(e){return null==e?void 0:e[t]}}function r(t){return null!=t&&o(p(t))}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t}function s(t){return n(t)&&r(t)&&u.call(t,"callee")&&!c.call(t,"callee")}var a=Object.prototype,u=a.hasOwnProperty,c=a.propertyIsEnumerable,l=9007199254740991,p=i("length");e.exports=s},{}],73:[function(t,e){function n(t){return!!t&&"object"==typeof t}function i(t,e){var n=null==t?void 0:t[e];return a(n)?n:void 0}function r(t){return"number"==typeof t&&t>-1&&t%1==0&&g>=t}function o(t){return s(t)&&f.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function a(t){return null==t?!1:o(t)?m.test(h.call(t)):n(t)&&l.test(t)}var u="[object Array]",c="[object Function]",l=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,d=p.hasOwnProperty,f=p.toString,m=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=i(Array,"isArray"),g=9007199254740991,b=y||function(t){return n(t)&&r(t.length)&&f.call(t)==u};e.exports=b},{}],74:[function(t,e){function n(t){return!!t&&"object"==typeof t}function i(t){return"string"==typeof t||n(t)&&s.call(t)==r}var r="[object String]",o=Object.prototype,s=o.toString;e.exports=i},{}],75:[function(t,e,n){arguments[4][2][0].apply(n,arguments)},{"./coinbase-account":76,"./credit-card":77,"./europe-bank-account":78,"./normalize-api-fields":82,"./parse-client-token":83,"./paypal-account":84,"./request-driver":86,"./sepa-mandate":87,"./util":88,"braintree-3ds":97,"braintree-utilities":109,dup:2}],76:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{dup:3}],77:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],78:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],79:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{"./parse-client-token":83,"./request-driver":86,"./util":88,dup:6}],80:[function(t,e,n){arguments[4][7][0].apply(n,arguments)},{"./jsonp":81,dup:7}],81:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"./util":88,dup:8}],82:[function(t,e,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],83:[function(t,e,n){arguments[4][10][0].apply(n,arguments)},{"./polyfill":85,"braintree-utilities":109,dup:10}],84:[function(t,e,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],85:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{dup:12}],86:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"./jsonp-driver":80,dup:13}],87:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],88:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],89:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{"./lib/client":75,"./lib/get-configuration":79,"./lib/jsonp":81,"./lib/jsonp-driver":80,"./lib/parse-client-token":83,"./lib/util":88,dup:16}],90:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],91:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],92:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],93:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20}],94:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{"./lib/dom":90,"./lib/events":91,"./lib/fn":92,"./lib/url":93,dup:21}],95:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"../shared/receiver":102,"braintree-utilities":94,dup:22}],96:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{"./authorization_service":95,"./loader":98,"braintree-utilities":94,dup:23}],97:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{"./client":96,dup:24}],98:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{"./loader_display":99,"./loader_message":100,"./loader_spinner":101,dup:25}],99:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],100:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{dup:27}],101:[function(t,e,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],102:[function(t,e,n){arguments[4][29][0].apply(n,arguments)},{"braintree-utilities":94,dup:29}],103:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],104:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],105:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],106:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],107:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],108:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{"./array":103,dup:35}],109:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"./lib/array":103,"./lib/dom":104,"./lib/events":105,"./lib/fn":106,"./lib/string":107,"./lib/url":108,dup:36}],110:[function(t,e,n){arguments[4][37][0].apply(n,arguments)},{"./lib/events":111,dup:37,framebus:112}],111:[function(t,e,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],112:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],113:[function(t,e){(function(n){"use strict";function i(t){var e=t.sdkVersion;return e||(e=n.braintree&&n.braintree.VERSION?"braintree/web/"+n.braintree.VERSION:""),e}function r(t){var e,r;this.attrs={},t.hasOwnProperty("sharedCustomerIdentifier")&&(this.attrs.sharedCustomerIdentifier=t.sharedCustomerIdentifier),e=a(t.clientToken),this.driver=t.driver||u,this.analyticsUrl=e.analytics?e.analytics.url:void 0,this.clientApiUrl=e.clientApiUrl,this.customerId=t.customerId,this.challenges=e.challenges,this.integration=t.integration||"",this.sdkVersion=i(e),this.merchantAppId=e.merchantAppId||n.location.host,r=s.create(this,{container:t.container,clientToken:e}),this.verify3DS=o.bind(r.verify,r),this.attrs.authorizationFingerprint=e.authorizationFingerprint,this.attrs.sharedCustomerIdentifierType=t.sharedCustomerIdentifierType,e.merchantAccountId&&(this.attrs.merchantAccountId=e.merchantAccountId),this.requestTimeout=t.hasOwnProperty("timeout")?t.timeout:6e4}var o=t("braintree-utilities"),s=t("braintree-3ds"),a=t("./parse-client-token"),u=t("./request-driver"),c=t("./util"),l=t("./sepa-mandate"),p=t("./europe-bank-account"),h=t("./credit-card"),d=t("./coinbase-account"),f=t("./paypal-account"),m=t("./normalize-api-fields").normalizeCreditCardFields;r.prototype.getCreditCards=function(t){this.driver.get(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods"]),this.attrs,function(t){var e=0,n=t.paymentMethods.length,i=[];for(e;n>e;e++)i.push(new h(t.paymentMethods[e]));return i},t,this.requestTimeout)},r.prototype.tokenizeCoinbase=function(t,e){t.options={validate:!1},this.addCoinbase(t,function(t,n){t?e(t,null):n&&n.nonce?e(t,n):e("Unable to tokenize coinbase account.",null)})},r.prototype.tokenizePayPalAccount=function(t,e){this.addPayPalAccount(t,function(t,n){t?e(t,null):n&&n.nonce?e(null,n):e("Unable to tokenize paypal account.",null)})},r.prototype.tokenizeCard=function(t,e){t.options={validate:!1},this.addCreditCard(t,function(t,n){n&&n.nonce?e(t,n.nonce,{type:n.type,details:n.details}):e("Unable to tokenize card.",null)})},r.prototype.lookup3DS=function(t,e){var n=c.joinUrlFragments([this.clientApiUrl,"v1/payment_methods",t.nonce,"three_d_secure/lookup"]),i=c.mergeOptions(this.attrs,{amount:t.amount});this.driver.post(n,i,function(t){return t},e,this.requestTimeout)},r.prototype.createSEPAMandate=function(t,e){var n=c.mergeOptions(this.attrs,{sepaMandate:t});this.driver.post(c.joinUrlFragments([this.clientApiUrl,"v1","sepa_mandates.json"]),n,function(t){return{sepaMandate:new l(t.europeBankAccounts[0].sepaMandates[0]),sepaBankAccount:new p(t.europeBankAccounts[0])}},e,this.requestTimeout)},r.prototype.addCoinbase=function(t,e){var n;delete t.share,n=c.mergeOptions(this.attrs,{coinbaseAccount:t,_meta:{integration:this.integration||"custom",source:"coinbase"}}),this.driver.post(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/coinbase_accounts"]),n,function(t){return new d(t.coinbaseAccounts[0])},e,this.requestTimeout)},r.prototype.addPayPalAccount=function(t,e){var n;delete t.share,n=c.mergeOptions(this.attrs,{paypalAccount:t,_meta:{integration:this.integration||"paypal",source:"paypal"}}),this.driver.post(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods","paypal_accounts"]),n,function(t){return new f(t.paypalAccounts[0])},e,this.requestTimeout)},r.prototype.addCreditCard=function(t,e){var n,i,r=t.share;delete t.share,i=m(t),n=c.mergeOptions(this.attrs,{share:r,creditCard:i,_meta:{integration:this.integration||"custom",source:"form"}}),this.driver.post(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/credit_cards"]),n,function(t){return new h(t.creditCards[0])},e,this.requestTimeout)},r.prototype.unlockCreditCard=function(t,e,n){var i=c.mergeOptions(this.attrs,{challengeResponses:e});this.driver.put(c.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/",t.nonce]),i,function(t){return new h(t.paymentMethods[0])},n,this.requestTimeout)},r.prototype.sendAnalyticsEvents=function(t,e){var i,r,o=this.analyticsUrl,s=[];if(t=c.isArray(t)?t:[t],!o)return void(e&&e.apply(null,[null,{}]));for(r in t)t.hasOwnProperty(r)&&s.push({kind:t[r]});i=c.mergeOptions(this.attrs,{braintree_library_version:this.sdkVersion,analytics:s,_meta:{merchantAppId:this.merchantAppId,platform:"web",platformVersion:n.navigator.userAgent,integrationType:this.integration,sdkVersion:this.sdkVersion}}),this.driver.post(o,i,function(t){return t},e,this.requestTimeout)},r.prototype.decryptBrowserswitchPayload=function(t,e){var n=c.mergeOptions(this.attrs,{asymmetric_encrypted_payload:t}),i=c.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/decrypt"]);this.driver.post(i,n,function(t){return t},e,this.requestTimeout)},r.prototype.encryptBrowserswitchReturnPayload=function(t,e,n){var i=c.mergeOptions(this.attrs,{payload:t,aesKey:e}),r=c.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/encrypt"]);this.driver.post(r,i,function(t){return t},n,this.requestTimeout)},r.prototype.exchangePaypalTokenForConsentCode=function(t,e){var n=c.mergeOptions(this.attrs,t);this.attrs.merchantAccountId&&(n.merchant_account_id=this.attrs.merchantAccountId);var i=c.joinUrlFragments([this.clientApiUrl,"/v1/paypal_account_service/merchant_consent"]);this.driver.post(i,n,function(t){return t},e,this.requestTimeout)},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./coinbase-account":114,"./credit-card":115,"./europe-bank-account":116,"./normalize-api-fields":120,"./parse-client-token":121,"./paypal-account":122,"./request-driver":124,"./sepa-mandate":125,"./util":126,"braintree-3ds":135,"braintree-utilities":147}],114:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{dup:3}],115:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],116:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],117:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{"./parse-client-token":121,"./request-driver":124,"./util":126,dup:6}],118:[function(t,e,n){arguments[4][7][0].apply(n,arguments)},{"./jsonp":119,dup:7}],119:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"./util":126,dup:8}],120:[function(t,e,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],121:[function(t,e,n){arguments[4][10][0].apply(n,arguments)},{"./polyfill":123,"braintree-utilities":147,dup:10}],122:[function(t,e,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],123:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{dup:12}],124:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"./jsonp-driver":118,dup:13}],125:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],126:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],127:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{"./lib/client":113,"./lib/get-configuration":117,"./lib/jsonp":119,"./lib/jsonp-driver":118,"./lib/parse-client-token":121,"./lib/util":126,dup:16}],128:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],129:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],130:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],131:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20}],132:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{"./lib/dom":128,"./lib/events":129,"./lib/fn":130,"./lib/url":131,dup:21}],133:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"../shared/receiver":140,"braintree-utilities":132,dup:22}],134:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{"./authorization_service":133,"./loader":136,"braintree-utilities":132,dup:23}],135:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{"./client":134,dup:24}],136:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{"./loader_display":137,"./loader_message":138,"./loader_spinner":139,dup:25}],137:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],138:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{dup:27}],139:[function(t,e,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],140:[function(t,e,n){arguments[4][29][0].apply(n,arguments)},{"braintree-utilities":132,dup:29}],141:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],142:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],143:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],144:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],145:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],146:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{"./array":141,dup:35}],147:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"./lib/array":141,"./lib/dom":142,"./lib/events":143,"./lib/fn":144,"./lib/string":145,"./lib/url":146,dup:36}],148:[function(t,e,n){arguments[4][37][0].apply(n,arguments)},{"./lib/events":149,dup:37,framebus:150}],149:[function(t,e,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],150:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],151:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],152:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],153:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],154:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],155:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],156:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{"./array":151,dup:35}],157:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"./lib/array":151,"./lib/dom":152,"./lib/events":153,"./lib/fn":154,"./lib/string":155,"./lib/url":156,dup:36}],158:[function(t,e){function n(t){var e=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return{overflow:e.overflow||"",height:t.style.height||""}}function i(){return{html:{node:document.documentElement,styles:n(document.documentElement)},body:{node:document.body,styles:n(document.body)}}}function r(t,e){if(!t)throw new Error('Parameter "clientToken" cannot be null');e=e||{},this._clientToken=o.parseClientToken(t),this._clientOptions=e,this.container=e.container,this.merchantPageDefaultStyles=null,this.paymentMethodNonceInputField=e.paymentMethodNonceInputField,this.frame=null,this.popup=null,this.insertFrameFunction=e.insertFrame,this.onSuccess=e.onSuccess,this.onCancelled=e.onCancelled,this.onUnsupported=e.onUnsupported,this.loggedInView=null,this.loggedOutView=null,this.insertUI=!0}var o=t("braintree-api"),s=t("braintree-bus"),a=t("braintree-utilities"),u=t("./logged-in-view"),c=t("./logged-out-view"),l=t("./overlay-view"),p=t("../shared/util/browser"),h=t("../shared/util/dom"),d=t("../shared/constants"),f=t("../shared/util/util"),m=t("../shared/get-locale");r.prototype.getViewerUrl=function(){var t=this._clientToken.paypal.assetsUrl;return t+"/pwpp/"+d.VERSION+"/html/braintree-frame.html"},r.prototype.getProxyUrl=function(){var t=this._clientToken.paypal.assetsUrl;return t+"/pwpp/"+d.VERSION+"/html/proxy-frame.html"},r.prototype.initialize=function(){if(!this._clientToken.paypalEnabled)return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("PayPal is not enabled")));if(!this._isBrowserSecure())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("unsupported protocol detected")));if(this._isHermesCapable()){if(!this._isHermesSupportedCurrency())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("This PayPal integration does not support this currency")));if(!this._isHermesSupportedCountries())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("This PayPal integration does not support this locale")));if(!this._isValidAmount())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("Amount must be a number")))}return this._isMisconfiguredUnvettedMerchant()?void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("Unvetted merchants must provide a payeeEmail, amount, and currency"))):(this._overrideClientTokenProperties(),p.isProxyFrameRequired()&&this._insertProxyFrame(),this._setupDomElements(),this._setupPaymentMethodNonceInputField(),this._setupViews(),void this._createBusSubscribers())},r.prototype._isSupportedOption=function(t,e){for(var n=e.length,i=!1,r=0;n>r;r++)t.toLowerCase()===e[r].toLowerCase()&&(i=!0);return i},r.prototype._isHermesSupportedCurrency=function(){return this._isSupportedOption(this._clientOptions.currency,d.ARIES_SUPPORTED_CURRENCIES)},r.prototype._isHermesSupportedCountries=function(){return this._isSupportedOption(m(this._clientOptions.locale).split("_")[1],d.ARIES_SUPPORTED_COUNTRIES)},r.prototype._isValidAmount=function(){var t=parseFloat(this._clientOptions.amount);return"number"==typeof t&&!isNaN(t)&&t>=0},r.prototype._isMisconfiguredUnvettedMerchant=function(){return this._clientToken.paypal.unvettedMerchant&&(!this._isHermesCapable()||!this._clientToken.paypal.payeeEmail)},r.prototype._isBrowserSecure=function(){return a.isBrowserHttps()||p.isPopupSupported()||this._clientToken.paypal.allowHttp},r.prototype._overrideClientTokenProperties=function(){this._clientOptions.displayName&&(this._clientToken.paypal.displayName=this._clientOptions.displayName)},r.prototype._setupDomElements=function(){this.insertUI&&(this.container=a.normalizeElement(this.container))},r.prototype._setupPaymentMethodNonceInputField=function(){if(this.insertUI){var t=this.paymentMethodNonceInputField;a.isFunction(t)||(t=void 0!==t?a.normalizeElement(t):this._createPaymentMethodNonceInputField(),this.paymentMethodNonceInputField=t)}},r.prototype._setupViews=function(){var t=this._clientToken.paypal.assetsUrl;this.insertUI&&(this.loggedInView=new u({container:this.container,assetsUrl:t}),this.loggedOutView=new c({assetsUrl:t,container:this.container,isCheckout:this._isHermesCapable(),locale:this._clientOptions.locale,merchantId:"merchantId"}),a.addEventListener(this.loggedOutView.container,"click",a.bind(this._handleContainerClick,this)),a.addEventListener(this.loggedInView.logoutNode,"click",a.bind(this._handleLogout,this)))
4
- },r.prototype._createBusSubscribers=function(){s.subscribe("getClientToken",a.bind(this._handleGetClientToken,this)),s.subscribe("getClientOptions",a.bind(this._handleGetClientOptions,this)),s.subscribe("closePayPalModal",a.bind(this._handleCloseMessage,this)),s.subscribe("receivePayPalData",a.bind(this._handleSuccessfulAuthentication,this))},r.prototype._createPaymentMethodNonceInputField=function(){var t=document.createElement("input");return t.name="payment_method_nonce",t.type="hidden",this.container.appendChild(t)},r.prototype._createFrame=function(){var t,e=document.createElement("iframe");return this._isHermesCapable()?(t=d.ARIES_FRAME_NAME,e.style.background="#FFFFFF"):t=d.FRAME_NAME,e.src=this.getViewerUrl(),e.id=t,e.name=t,e.allowTransparency=!0,e.height="100%",e.width="100%",e.frameBorder=0,e.style.position=p.isMobile()?"absolute":"fixed",e.style.top=0,e.style.left=0,e.style.bottom=0,e.style.zIndex=20001,e.style.padding=0,e.style.margin=0,e.style.border=0,e.style.outline="none",e},r.prototype._removeFrame=function(t){t=t||document.body,this.frame&&t.contains(this.frame)&&(t.removeChild(this.frame),this._unlockMerchantWindowSize())},r.prototype._insertFrame=function(){this.insertFrameFunction?this.insertFrameFunction(this.getViewerUrl()):(this.frame=this._createFrame(),document.body.appendChild(this.frame)),this._lockMerchantWindowSize()},r.prototype._handleContainerClick=function(t){function e(t){return t.className.match(/paypal-button(?!-widget)/)||"braintree-paypal-button"===t.id}var n=t.target||t.srcElement;(e(n)||e(n.parentNode))&&(t.preventDefault?t.preventDefault():t.returnValue=!1,this._open())},r.prototype._setMerchantPageDefaultStyles=function(){this.merchantPageDefaultStyles=i()},r.prototype._open=function(){this._isHermesCapable()&&this._addCorrelationIdToClientToken(),p.isPopupSupported()?this._openPopup():this._openModal()},r.prototype._close=function(){p.isPopupSupported()?this._closePopup():this._closeModal()},r.prototype._openModal=function(){this._removeFrame(),this._insertFrame()},r.prototype._isHermesCapable=function(){return!!this._clientOptions.singleUse&&!!this._clientOptions.amount&&!!this._clientOptions.currency},r.prototype._openPopup=function(){var t,e,n,i=[],r=window.outerWidth||document.documentElement.clientWidth,o=window.outerHeight||document.documentElement.clientHeight,s="undefined"==typeof window.screenY?window.screenTop:window.screenY,a="undefined"==typeof window.screenX?window.screenLeft:window.screenX;this._isHermesCapable()?(t=d.ARIES_POPUP_NAME,n=d.ARIES_POPUP_HEIGHT,e=d.ARIES_POPUP_WIDTH):(t=d.POPUP_NAME,n=d.POPUP_HEIGHT,e=d.POPUP_WIDTH);var u=(r-e)/2+a,c=(o-n)/2+s;return i.push("height="+n),i.push("width="+e),i.push("top="+c),i.push("left="+u),i.push(d.POPUP_OPTIONS),this.popup=window.open(this.getViewerUrl(),t,i.join(",")),p.isOverlaySupported()&&(this.overlayView=new l(this.popup,this._clientToken.paypal.assetsUrl),this.overlayView.render()),this.popup.focus(),this.popup},r.prototype._addCorrelationIdToClientToken=function(){this._clientToken.correlationId=f.generateUid()},r.prototype._createProxyFrame=function(){var t=document.createElement("iframe");return t.src=this.getProxyUrl(),t.id=d.BRIDGE_FRAME_NAME,t.name=d.BRIDGE_FRAME_NAME,t.allowTransparency=!0,t.height=0,t.width=0,t.frameBorder=0,t.style.position="static",t.style.padding=0,t.style.margin=0,t.style.border=0,t.style.outline="none",t},r.prototype._insertProxyFrame=function(){this.proxyFrame=this._createProxyFrame(),document.body.appendChild(this.proxyFrame)},r.prototype._closeModal=function(){this._removeFrame()},r.prototype._closePopup=function(){this.popup&&(this.popup.close(),this.popup=null),this.overlayView&&p.isOverlaySupported()&&this.overlayView.remove()},r.prototype._clientTokenData=function(){return{analyticsUrl:this._clientToken.analytics?this._clientToken.analytics.url:void 0,authorizationFingerprint:this._clientToken.authorizationFingerprint,clientApiUrl:this._clientToken.clientApiUrl,displayName:this._clientToken.paypal.displayName,paypalBaseUrl:this._clientToken.paypal.assetsUrl,paypalClientId:this._clientToken.paypal.clientId,paypalPrivacyUrl:this._clientToken.paypal.privacyUrl,paypalUserAgreementUrl:this._clientToken.paypal.userAgreementUrl,unvettedMerchant:this._clientToken.paypal.unvettedMerchant,payeeEmail:this._clientToken.paypal.payeeEmail,correlationId:this._clientToken.correlationId,offline:this._clientOptions.offline||this._clientToken.paypal.environmentNoNetwork,sdkVersion:this._clientToken.sdkVersion,merchantAppId:this._clientToken.merchantAppId}},r.prototype._handleGetClientToken=function(t){t(this._clientTokenData())},r.prototype._clientOptionsData=function(){return{locale:this._clientOptions.locale||"en_us",onetime:this._clientOptions.singleUse||!1,integration:this._clientOptions.integration||"paypal",enableShippingAddress:this._clientOptions.enableShippingAddress||!1,enableBillingAddress:this._clientOptions.enableBillingAddress||!1,enableHermes:this._isHermesCapable(),amount:this._clientOptions.amount||null,currency:this._clientOptions.currency||null,shippingAddressOverride:this._clientOptions.shippingAddressOverride||null}},r.prototype._handleGetClientOptions=function(t){t(this._clientOptionsData())},r.prototype._handleSuccessfulAuthentication=function(t){this._close(),t.type=d.NONCE_TYPE,a.isFunction(this.paymentMethodNonceInputField)?this.paymentMethodNonceInputField(t.nonce):(this._showLoggedInContent(t.details.email),this._setNonceInputValue(t.nonce)),a.isFunction(this.onSuccess)&&this.onSuccess(t)},r.prototype._lockMerchantWindowSize=function(){this._setMerchantPageDefaultStyles(),document.documentElement.style.height="100%",document.documentElement.style.overflow="hidden",document.body.style.height="100%",document.body.style.overflow="hidden"},r.prototype._unlockMerchantWindowSize=function(){this.merchantPageDefaultStyles&&(document.documentElement.style.height=this.merchantPageDefaultStyles.html.styles.height,document.documentElement.style.overflow=this.merchantPageDefaultStyles.html.styles.overflow,document.body.style.height=this.merchantPageDefaultStyles.body.styles.height,document.body.style.overflow=this.merchantPageDefaultStyles.body.styles.overflow)},r.prototype._handleCloseMessage=function(){this._removeFrame()},r.prototype._showLoggedInContent=function(t){this.loggedOutView.hide(),h.setTextContent(this.loggedInView.emailNode,t),this.loggedInView.show()},r.prototype._handleLogout=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1,this.loggedInView.hide(),this.loggedOutView.show(),this._setNonceInputValue(""),a.isFunction(this.onCancelled)&&this.onCancelled()},r.prototype._setNonceInputValue=function(t){this.paymentMethodNonceInputField.value=t},e.exports=r},{"../shared/constants":162,"../shared/get-locale":164,"../shared/util/browser":169,"../shared/util/dom":170,"../shared/util/util":171,"./logged-in-view":159,"./logged-out-view":160,"./overlay-view":161,"braintree-api":127,"braintree-bus":148,"braintree-utilities":157}],159:[function(t,e){function n(t){this.options=t,this.container=this.createViewContainer(),this.createPayPalName(),this.emailNode=this.createEmailNode(),this.logoutNode=this.createLogoutNode()}var i=t("../shared/constants");n.prototype.createViewContainer=function(){var t=document.createElement("div");t.id="braintree-paypal-loggedin";var e=["display: none","max-width: 500px","overflow: hidden","padding: 16px","background-image: url("+this.options.assetsUrl+"/pwpp/"+i.VERSION+"/images/paypal-small.png)","background-image: url("+this.options.assetsUrl+"/pwpp/"+i.VERSION+"/images/paypal-small.svg), none","background-position: 20px 50%","background-repeat: no-repeat","background-size: 13px 15px","border-top: 1px solid #d1d4d6","border-bottom: 1px solid #d1d4d6"].join(";");return t.style.cssText=e,this.options.container.appendChild(t),t},n.prototype.createPayPalName=function(){var t=document.createElement("span");t.id="bt-pp-name",t.innerHTML="PayPal";var e=["color: #283036","font-size: 13px","font-weight: 800",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"margin-left: 36px","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},n.prototype.createEmailNode=function(){var t=document.createElement("span");t.id="bt-pp-email";var e=["color: #6e787f","font-size: 13px",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"margin-left: 5px","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},n.prototype.createLogoutNode=function(){var t=document.createElement("button");t.id="bt-pp-cancel",t.innerHTML="Cancel";var e=["color: #3d95ce","font-size: 11px",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"line-height: 20px","margin: 0 0 0 25px","padding: 0","background-color: transparent","border: 0","cursor: pointer","text-decoration: underline","float: right","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},n.prototype.show=function(){this.container.style.display="block"},n.prototype.hide=function(){this.container.style.display="none"},e.exports=n},{"../shared/constants":162}],160:[function(t,e){function n(t){this.options=t,this.assetsUrl=this.options.assetsUrl,this.container=this.createViewContainer(),this.options.isCheckout?this.createCheckoutWithPayPalButton():this.createPayWithPayPalButton()}var i=(t("braintree-utilities"),t("../shared/constants")),r=t("../shared/get-locale");n.prototype.createViewContainer=function(){var t=document.createElement("div");return t.id="braintree-paypal-loggedout",this.options.container.appendChild(t),t},n.prototype.createPayWithPayPalButton=function(){var t=document.createElement("a");t.id="braintree-paypal-button",t.href="#";var e=["display: block","width: 115px","height: 44px","overflow: hidden"].join(";");t.style.cssText=e;var n=new Image;n.src=this.assetsUrl+"/pwpp/"+i.VERSION+"/images/pay-with-paypal.png",n.setAttribute("alt","Pay with PayPal");var r=["max-width: 100%","display: block","width: 100%","height: 100%","outline: none","border: 0"].join(";");n.style.cssText=r,t.appendChild(n),this.container.appendChild(t)},n.prototype.createCheckoutWithPayPalButton=function(){var t=document.createElement("script");t.src="//www.paypalobjects.com/api/button.js",t.async=!0,t.setAttribute("data-merchant",this.options.merchantId),t.setAttribute("data-button","checkout"),t.setAttribute("data-type","button"),t.setAttribute("data-width","150"),t.setAttribute("data-height","44"),t.setAttribute("data-lc",r(this.options.locale)),this.container.appendChild(t)},n.prototype.show=function(){this.container.style.display="block"},n.prototype.hide=function(){this.container.style.display="none"},e.exports=n},{"../shared/constants":162,"../shared/get-locale":164,"braintree-utilities":157}],161:[function(t,e){function n(t,e){this.popup=t,this.assetsUrl=e,this.spriteSrc=this.assetsUrl+"/pwpp/"+r.VERSION+"/images/pp_overlay_sprite.png",this._create(),this._setupEvents(),this._pollForPopup()}var i=t("braintree-utilities"),r=t("../shared/constants");n.prototype.render=function(){document.body.contains(this.el)||document.body.appendChild(this.el)},n.prototype.remove=function(){document.body.contains(this.el)&&document.body.removeChild(this.el)},n.prototype._create=function(){this.el=document.createElement("div"),this.el.className="bt-overlay",this._setStyles(this.el,["z-index: 20001","position: fixed","top: 0","left: 0","height: 100%","width: 100%","text-align: center","background: #000","background: rgba(0,0,0,0.7)",'-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=52)"']),this.el.appendChild(this._createCloseIcon()),this.el.appendChild(this._createMessage())},n.prototype._createCloseIcon=function(){return this.closeIcon=document.createElement("div"),this.closeIcon.className="bt-close-overlay",this._setStyles(this.closeIcon,["position: absolute","top: 10px","right: 10px","cursor: pointer","background: url("+this.spriteSrc+") no-repeat 0 -67px","height: 14px","width: 14px"]),this.closeIcon},n.prototype._createMessage=function(){var t=document.createElement("div");return this._setStyles(t,["position: relative","top: 50%","max-width: 350px",'font-family: "HelveticaNeue", "HelveticaNeue-Light", "Helvetica Neue Light", helvetica, arial, sans-serif',"font-size: 14px","line-height: 20px","margin: -70px auto 0"]),t.appendChild(this._createLogo()),t.appendChild(this._createExplanation()),t.appendChild(this._createFocusLink()),t},n.prototype._createExplanation=function(){var t=document.createElement("div");return this._setStyles(t,["color: #FFF","margin-bottom: 20px"]),t.innerHTML="Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",t},n.prototype._createLogo=function(){var t=document.createElement("div");return this._setStyles(t,["background: url("+this.spriteSrc+") no-repeat 0 0","width: 94px","height: 25px","margin: 0 auto 26px auto"]),t},n.prototype._createFocusLink=function(){return this.focusLink=document.createElement("a"),this._setStyles(this.focusLink,["color: #009be1","cursor: pointer"]),this.focusLink.innerHTML="Continue",this.focusLink},n.prototype._setStyles=function(t,e){var n=e.join(";");t.style.cssText=n},n.prototype._setupEvents=function(){i.addEventListener(this.closeIcon,"click",i.bind(this._handleClose,this)),i.addEventListener(this.focusLink,"click",i.bind(this._handleFocus,this))},n.prototype._handleClose=function(t){t.preventDefault(),this.remove(),this.popup.close()},n.prototype._handleFocus=function(t){t.preventDefault(),this.popup.focus()},n.prototype._pollForPopup=function(){var t=setInterval(i.bind(function(){this.popup&&this.popup.closed&&(clearInterval(t),this.remove())},this),100)},e.exports=n},{"../shared/constants":162,"braintree-utilities":157}],162:[function(t,e,n){var i="1.4.0";n.VERSION=i,n.POPUP_NAME="braintree_paypal_popup",n.ARIES_POPUP_NAME="PPFrameRedirect",n.FRAME_NAME="braintree-paypal-frame",n.ARIES_FRAME_NAME="PPFrameRedirect",n.POPUP_PATH="/pwpp/"+i+"/html/braintree-frame.html",n.POPUP_OPTIONS="resizable,scrollbars",n.POPUP_HEIGHT=470,n.POPUP_WIDTH=410,n.ARIES_POPUP_HEIGHT=535,n.ARIES_POPUP_WIDTH=450,n.BRIDGE_FRAME_NAME="bt-proxy-frame",n.ARIES_SUPPORTED_CURRENCIES=["USD","GBP","EUR","AUD","CAD","DKK","NOK","PLN","SEK","CHF","TRY"],n.ARIES_SUPPORTED_COUNTRIES=["US","GB","AU","CA","ES","FR","DE","IT","NL","NO","PL","CH","TR","DK","BE","AT"],n.NONCE_TYPE="PayPalAccount",n.ILLEGAL_XHR_ERROR="Illegal XHR request attempted"},{}],163:[function(t,e){"use strict";e.exports={us:"en_us",gb:"en_uk",uk:"en_uk",de:"de_de",fr:"fr_fr",it:"it_it",es:"es_es",ca:"en_ca",au:"en_au",at:"de_de",be:"en_us",ch:"de_de",dk:"da_dk",nl:"nl_nl",no:"no_no",pl:"pl_pl",se:"sv_se",tr:"tr_tr",bg:"en_us",cy:"en_us",hr:"en_us",is:"en_us",kh:"en_us",mt:"en_us",my:"en_us",ru:"ru_ru"}},{}],164:[function(t,e){"use strict";function n(t){return-1!==t.indexOf("_")&&5===t.length}function i(t){var e;for(var n in o)o.hasOwnProperty(n)&&(n===t?e=o[n]:o[n]===t&&(e=o[n]));return e}function r(t){var e;if(t=t?t.toLowerCase():"us",t=t.replace(/-/g,"_"),e=n(t)?t:i(t)){var r=e.split("_");return[r[0],r[1].toUpperCase()].join("_")}return"en_US"}var o=t("../shared/data/country-code-lookup");e.exports=r},{"../shared/data/country-code-lookup":163}],165:[function(t,e){function n(){return p.matchUserAgent("Android")&&!i()}function i(){return p.matchUserAgent("Chrome")||p.matchUserAgent("CriOS")}function r(){return p.matchUserAgent("Firefox")}function o(){return p.matchUserAgent("Trident")||p.matchUserAgent("MSIE")}function s(){return p.matchUserAgent("Opera")||p.matchUserAgent("OPR")}function a(){return s()&&"[object OperaMini]"===d.call(window.operamini)}function u(){return p.matchUserAgent("Safari")&&!i()&&!n()}function c(){return h.isIos()&&!i()&&!u()}function l(){var t=/Version\/[\w\.]+ Chrome\/[\w\.]+ Mobile/;return h.isAndroid()&&p.matchUserAgent(t)}var p=t("./useragent"),h=t("./platform"),d=Object.prototype.toString;e.exports={isAndroid:n,isChrome:i,isFirefox:r,isIE:o,isOpera:s,isOperaMini:a,isSafari:u,isIosWebView:c,isAndroidWebView:l}},{"./platform":167,"./useragent":168}],166:[function(t,e){function n(){return!i()&&(s.isAndroid()||s.isIpod()||s.isIphone()||o.matchUserAgent("IEMobile"))}function i(){return s.isIpad()||s.isAndroid()&&!o.matchUserAgent("Mobile")}function r(){return!n()&&!i()}var o=t("./useragent"),s=t("./platform");e.exports={isMobile:n,isTablet:i,isDesktop:r}},{"./platform":167,"./useragent":168}],167:[function(t,e){function n(){return a.matchUserAgent("Android")}function i(){return a.matchUserAgent("iPad")}function r(){return a.matchUserAgent("iPod")}function o(){return a.matchUserAgent("iPhone")&&!r()}function s(){return i()||r()||o()}var a=t("./useragent");e.exports={isAndroid:n,isIpad:i,isIpod:r,isIphone:o,isIos:s}},{"./useragent":168}],168:[function(t,e,n){function i(){return o}function r(t){var e=n.getNativeUserAgent(),i=e.match(t);return i?!0:!1}var o=window.navigator.userAgent;n.getNativeUserAgent=i,n.matchUserAgent=r},{}],169:[function(t,e){function n(){return i()&&window.outerWidth<600}function i(){return f.test(d)}function r(){return!!window.postMessage}function o(){if(c.isOperaMini())return!1;if(l.isDesktop())return!0;if(l.isMobile()||l.isTablet()){if(c.isIE())return!1;if(p.isAndroid())return c.isAndroidWebView()?!1:!0;if(p.isIos())return c.isChrome()||c.isSafari()&&h.matchUserAgent(/OS (?:8_1|8_0|8)(?!_\d)/i)||c.isIosWebView()?!1:!0}return!1}function s(){if(c.isIE()&&h.matchUserAgent(/MSIE 8\.0/))return!1;try{return window.self===window.top}catch(t){return!1}}function a(){return c.isIE()&&!u()}function u(){var t=null,e="";try{new ActiveXObject("")}catch(n){e=n.name}try{t=!!new ActiveXObject("htmlfile")}catch(n){t=!1}return t="ReferenceError"!==e&&t===!1?!1:!0,!t}var c=t("../useragent/browser"),l=t("../useragent/device"),p=t("../useragent/platform"),h=t("../useragent/useragent"),d=window.navigator.userAgent,f=/[Mm]obi|tablet|iOS|Android|IEMobile|Windows\sPhone/;e.exports={isMobile:n,isMobileDevice:i,detectedPostMessage:r,isPopupSupported:o,isOverlaySupported:s,isProxyFrameRequired:a}},{"../useragent/browser":165,"../useragent/device":166,"../useragent/platform":167,"../useragent/useragent":168}],170:[function(t,e){function n(t,e){var n="innerText";document&&document.body&&"textContent"in document.body&&(n="textContent"),t[n]=e}e.exports={setTextContent:n}},{}],171:[function(t,e){function n(){for(var t="",e=0;32>e;e++){var n=Math.floor(16*Math.random());t+=n.toString(16)}return t}function i(t){return/^(true|1)$/i.test(t)}function r(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&apos;")}function o(t){var e=t.indexOf("?"),n={};if(e>=0&&(t=t.substr(e+1)),0!==t.length){for(var i=t.split("&"),r=0,o=i.length;o>r;r++){var s=i[r],a=s.indexOf("="),u=s.substr(0,a),c=s.substr(a+1),l=decodeURIComponent(c);l=l.replace(/</g,"&lt;").replace(/>/g,"&gt;"),"false"===l&&(l=!1),(void 0===l||"true"===l)&&(l=!0),n[u]=l}return n}}function s(t){return t&&"[object Function]"===Object.prototype.toString.call(t)}function a(t){t.preventDefault?t.preventDefault():t.returnValue=!1}var u="function"==typeof String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/,"")},c="function"==typeof window.btoa?function(t){return window.btoa(t)}:function(t){for(var e,n,i,r,o,s,a,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",l=0;l<t.length;)e=t.charCodeAt(l++),n=t.charCodeAt(l++),i=t.charCodeAt(l++),r=e>>2,o=(3&e)<<4|n>>4,s=(15&n)<<2|i>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),c=c+u.charAt(r)+u.charAt(o)+u.charAt(s)+u.charAt(a);return c};e.exports={trim:u,btoa:c,generateUid:n,castToBoolean:i,htmlEscape:r,parseUrlParams:o,isFunction:s,preventDefault:a}},{}],172:[function(t,e){"use strict";function n(t){this.host=t||window,this.handlers=[],i.addEventListener(this.host,"message",i.bind(this.receive,this))}var i=t("braintree-utilities");n.prototype.receive=function(t){var e,i,r,o;try{r=JSON.parse(t.data)}catch(s){return}for(o=r.type,i=new n.Message(this,t.source,r.data),e=0;e<this.handlers.length;e++)this.handlers[e].type===o&&this.handlers[e].handler(i)},n.prototype.send=function(t,e,n){t.postMessage(JSON.stringify({type:e,data:n}),"*")},n.prototype.register=function(t,e){this.handlers.push({type:t,handler:e})},n.prototype.unregister=function(t,e){for(var n=this.handlers.length-1;n>=0;n--)if(this.handlers[n].type===t&&this.handlers[n].handler===e)return this.handlers.splice(n,1)},n.Message=function(t,e,n){this.bus=t,this.source=e,this.content=n},n.Message.prototype.reply=function(t,e){this.bus.send(this.source,t,e)},e.exports=n},{"braintree-utilities":182}],173:[function(t,e){"use strict";function n(t,e){this.bus=t,this.target=e,this.handlers=[],this.bus.register("publish",i.bind(this._handleMessage,this))}var i=t("braintree-utilities");n.prototype._handleMessage=function(t){var e,n=t.content,i=this.handlers[n.channel];if("undefined"!=typeof i)for(e=0;e<i.length;e++)i[e](n.data)},n.prototype.publish=function(t,e){this.bus.send(this.target,"publish",{channel:t,data:e})},n.prototype.subscribe=function(t,e){this.handlers[t]=this.handlers[t]||[],this.handlers[t].push(e)},n.prototype.unsubscribe=function(t,e){var n,i=this.handlers[t];if("undefined"!=typeof i)for(n=0;n<i.length;n++)i[n]===e&&i.splice(n,1)},e.exports=n},{"braintree-utilities":182}],174:[function(t,e){"use strict";function n(t){this.bus=t,this.frames=[],this.handlers=[]}n.prototype.subscribe=function(t,e){this.handlers[t]=this.handlers[t]||[],this.handlers[t].push(e)},n.prototype.registerFrame=function(t){this.frames.push(t)},n.prototype.unregisterFrame=function(t){for(var e=0;e<this.frames.length;e++)this.frames[e]===t&&this.frames.splice(e,1)},n.prototype.publish=function(t,e){var n,i=this.handlers[t];if("undefined"!=typeof i)for(n=0;n<i.length;n++)i[n](e);for(n=0;n<this.frames.length;n++)this.bus.send(this.frames[n],"publish",{channel:t,data:e})},n.prototype.unsubscribe=function(t,e){var n,i=this.handlers[t];if("undefined"!=typeof i)for(n=0;n<i.length;n++)i[n]===e&&i.splice(n,1)},e.exports=n},{}],175:[function(t,e){"use strict";function n(t,e){this.bus=t,this.target=e||window.parent,this.counter=0,this.callbacks={},this.bus.register("rpc_response",i.bind(this._handleResponse,this))}var i=t("braintree-utilities");n.prototype._handleResponse=function(t){var e=t.content,n=this.callbacks[e.id];"function"==typeof n&&(n.apply(null,e.response),delete this.callbacks[e.id])},n.prototype.invoke=function(t,e,n){var i=this.counter++;this.callbacks[i]=n,this.bus.send(this.target,"rpc_request",{id:i,method:t,args:e})},e.exports=n},{"braintree-utilities":182}],176:[function(t,e){"use strict";function n(t){this.bus=t,this.methods={},this.bus.register("rpc_request",i.bind(this._handleRequest,this))}var i=t("braintree-utilities");n.prototype._handleRequest=function(t){var e,n=t.content,i=n.args||[],r=this.methods[n.method];"function"==typeof r&&(e=function(){t.reply("rpc_response",{id:n.id,response:Array.prototype.slice.call(arguments)})},i.push(e),r.apply(null,i))},n.prototype.define=function(t,e){this.methods[t]=e},e.exports=n},{"braintree-utilities":182}],177:[function(t,e){var n=t("./lib/message-bus"),i=t("./lib/pubsub-client"),r=t("./lib/pubsub-server"),o=t("./lib/rpc-client"),s=t("./lib/rpc-server");e.exports={MessageBus:n,PubsubClient:i,PubsubServer:r,RPCClient:o,RPCServer:s}},{"./lib/message-bus":172,"./lib/pubsub-client":173,"./lib/pubsub-server":174,"./lib/rpc-client":175,"./lib/rpc-server":176}],178:[function(t,e){"use strict";function n(t,e){if(e=e||"["+t+"] is not a valid DOM Element",t&&t.nodeType&&1===t.nodeType)return t;if(t&&window.jQuery&&t instanceof jQuery&&0!==t.length)return t[0];if("string"==typeof t&&document.getElementById(t))return document.getElementById(t);throw new Error(e)}e.exports={normalizeElement:n}},{}],179:[function(t,e){"use strict";function n(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}function i(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)}e.exports={removeEventListener:i,addEventListener:n}},{}],180:[function(t,e){"use strict";function n(t){return"[object Function]"===Object.prototype.toString.call(t)}function i(t,e){return function(){t.apply(e,arguments)}}e.exports={bind:i,isFunction:n}},{}],181:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20}],182:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{"./lib/dom":178,"./lib/events":179,"./lib/fn":180,"./lib/url":181,dup:21}],183:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],184:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],185:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],186:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],187:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],188:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{"./array":183,dup:35}],189:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"./lib/array":183,"./lib/dom":184,"./lib/events":185,"./lib/fn":186,"./lib/string":187,"./lib/url":188,dup:36}],190:[function(t,e){(function(t){"use strict";function n(t){if(("string"==typeof t||t instanceof String)&&(t=document.getElementById(t)),!(t instanceof HTMLFormElement))throw new TypeError("FormNapper requires an HTMLFormElement element or the id string of one.");this.htmlForm=t}n.prototype.hijack=function(e){function n(t){t.preventDefault?t.preventDefault():t.returnValue=!1,e(t)}null!=t.addEventListener?this.htmlForm.addEventListener("submit",n,!1):null!=t.attachEvent?this.htmlForm.attachEvent("onsubmit",n):this.htmlForm.onsubmit=n},n.prototype.inject=function(t,e){var n=this.htmlForm.querySelector('input[name="'+t+'"]');null==n&&(n=document.createElement("input"),n.type="hidden",n.name=t,this.htmlForm.appendChild(n)),n.value=e},n.prototype.submit=function(){HTMLFormElement.prototype.submit.call(this.htmlForm)},e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],191:[function(t,e,n){arguments[4][61][0].apply(n,arguments)},{"./lib/default-attributes":192,dup:61,"lodash.assign":193,"lodash.isstring":204}],192:[function(t,e,n){arguments[4][62][0].apply(n,arguments)},{dup:62}],193:[function(t,e,n){arguments[4][63][0].apply(n,arguments)},{dup:63,"lodash._baseassign":194,"lodash._createassigner":196,"lodash.keys":200}],194:[function(t,e,n){arguments[4][64][0].apply(n,arguments)},{dup:64,"lodash._basecopy":195,"lodash.keys":200}],195:[function(t,e,n){arguments[4][65][0].apply(n,arguments)},{dup:65}],196:[function(t,e,n){arguments[4][66][0].apply(n,arguments)},{dup:66,"lodash._bindcallback":197,"lodash._isiterateecall":198,"lodash.restparam":199}],197:[function(t,e,n){arguments[4][67][0].apply(n,arguments)},{dup:67}],198:[function(t,e,n){arguments[4][68][0].apply(n,arguments)},{dup:68}],199:[function(t,e,n){arguments[4][69][0].apply(n,arguments)},{dup:69}],200:[function(t,e,n){arguments[4][70][0].apply(n,arguments)},{dup:70,"lodash._getnative":201,"lodash.isarguments":202,"lodash.isarray":203}],201:[function(t,e,n){arguments[4][71][0].apply(n,arguments)},{dup:71}],202:[function(t,e,n){arguments[4][72][0].apply(n,arguments)},{dup:72}],203:[function(t,e,n){arguments[4][73][0].apply(n,arguments)},{dup:73}],204:[function(t,e,n){arguments[4][74][0].apply(n,arguments)},{dup:74}],205:[function(t,e){"use strict";function n(t){this.apiClient=t}var i=["getCreditCards","unlockCreditCard","sendAnalyticsEvents"];n.prototype.attach=function(t){function e(e){t.define(e,function(){n.apiClient[e].apply(n.apiClient,arguments)})}var n=this,r=0,o=i.length;for(r;o>r;r++)e(i[r])},e.exports=n},{}],206:[function(t,e){"use strict";function n(t,e){var n=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return n[e]}function i(){return{html:{height:s.style.height||"",overflow:n(s,"overflow"),position:n(s,"position")},body:{height:a.style.height||"",overflow:n(a,"overflow")}}}function r(){var t=/Android|iPhone|iPod|iPad/i.test(window.navigator.userAgent);return t}function o(t){var e,n,i;this.encodedClientToken=t.clientToken,this.paypalOptions=t.paypal,this.container=null,this.merchantFormManager=null,this.root=t.root,this.configurationRequests=[],this.braintreeApiClient=u.configure({clientToken:t.clientToken,integration:"dropin"}),this.paymentMethodNonceReceivedCallback=t.paymentMethodNonceReceived,this.clientToken=u.parseClientToken(t.clientToken),this.bus=new l.MessageBus(this.root),this.rpcServer=new l.RPCServer(this.bus),this.apiProxyServer=new h(this.braintreeApiClient),this.apiProxyServer.attach(this.rpcServer),e=t.inlineFramePath||this.clientToken.assetsUrl+"/dropin/"+b+"/inline-frame.html",n=t.modalFramePath||this.clientToken.assetsUrl+"/dropin/"+b+"/modal-frame.html",s=document.documentElement,a=document.body,this.frames={inline:this._createFrame(e,y.INLINE_FRAME_NAME),modal:this._createFrame(n,y.MODAL_FRAME_NAME)},this.container=p.normalizeElement(t.container,"Unable to find valid container."),i=p.normalizeElement(t.form||this._findClosest(this.container,"form")),this.merchantFormManager=new d({form:i,frames:this.frames,onSubmit:this.paymentMethodNonceReceivedCallback,apiClient:this.braintreeApiClient}).initialize(),this.clientToken.paypalEnabled&&this.clientToken.paypal&&(p.isBrowserHttps()||this.clientToken.paypal.allowHttp)&&this._configurePayPal(),this.braintreeApiClient.sendAnalyticsEvents("dropin.web.initialized")}var s,a,u=t("braintree-api"),c=t("braintree-bus"),l=t("braintree-rpc"),p=t("braintree-utilities"),h=t("./api-proxy-server"),d=t("./merchant-form-manager"),f=t("./frame-container"),m=t("../shared/paypal-service"),y=t("../shared/constants"),g=t("braintree-paypal/src/shared/util/browser"),b="1.7.0";o.prototype.initialize=function(){var t,e=this;this._initializeModal(),c.emit(c.events.ASYNC_DEPENDENCY_INITIALIZING),this.container.appendChild(this.frames.inline.element),a.appendChild(this.frames.modal.element),this.rpcServer.define("receiveSharedCustomerIdentifier",function(n){for(e.braintreeApiClient.attrs.sharedCustomerIdentifier=n,e.braintreeApiClient.attrs.sharedCustomerIdentifierType="browser_session_cookie_store",t=0;t<e.configurationRequests.length;t++)e.configurationRequests[t](e.encodedClientToken);e.configurationRequests=[]}),c.on(c.events.PAYMENT_METHOD_GENERATED,p.bind(this._handleAltPayData,this)),this.rpcServer.define("getConfiguration",function(t){t({clientToken:e.encodedClientToken,merchantHttps:p.isBrowserHttps()})}),this.rpcServer.define("getPayPalOptions",function(t){t(e.paypalOptions)}),this.rpcServer.define("selectPaymentMethod",function(t){e.frames.modal.rpcClient.invoke("selectPaymentMethod",[t]),e._showModal()}),this.rpcServer.define("sendAddedPaymentMethod",function(t){e.merchantFormManager.setNoncePayload(t),e.frames.inline.rpcClient.invoke("receiveNewPaymentMethod",[t])}),this.rpcServer.define("sendUsedPaymentMethod",function(t){e.frames.inline.rpcClient.invoke("selectPaymentMethod",[t])}),this.rpcServer.define("sendUnlockedNonce",function(t){e.merchantFormManager.setNoncePayload(t)}),this.rpcServer.define("clearNonce",function(){e.merchantFormManager.clearNoncePayload()}),this.rpcServer.define("closeDropInModal",function(){e._hideModal()}),this.rpcServer.define("setInlineFrameHeight",function(t){e.frames.inline.element.style.height=t+"px"}),this.bus.register("ready",function(t){t.source===e.frames.inline.element.contentWindow?e.frames.inline.rpcClient=new l.RPCClient(e.bus,t.source):t.source===e.frames.modal.element.contentWindow&&(e.frames.modal.rpcClient=new l.RPCClient(e.bus,t.source))
5
- })},o.prototype._createFrame=function(t,e){return new f(t,e)},o.prototype._initializeModal=function(){this.frames.modal.element.style.display="none",this.frames.modal.element.style.position=r()?"absolute":"fixed",this.frames.modal.element.style.top="0",this.frames.modal.element.style.left="0",this.frames.modal.element.style.height="100%",this.frames.modal.element.style.width="100%"},o.prototype._lockMerchantWindowSize=function(){setTimeout(function(){s.style.overflow="hidden",a.style.overflow="hidden",a.style.height="100%",r()&&(s.style.position="relative",s.style.height=window.innerHeight+"px")},160)},o.prototype._unlockMerchantWindowSize=function(){var t=this.merchantPageDefaultStyles;a.style.height=t.body.height,a.style.overflow=t.body.overflow,s.style.overflow=t.html.overflow,r()&&(s.style.height=t.html.height,s.style.position=t.html.position)},o.prototype._showModal=function(){var t=this,e=this.frames.modal.element;this.merchantPageDefaultStyles=i(),e.style.display="block",this.frames.modal.rpcClient.invoke("open",[],function(){setTimeout(function(){t._lockMerchantWindowSize(),e.contentWindow.focus()},200)})},o.prototype._hideModal=function(){this._unlockMerchantWindowSize(),this.frames.modal.element.style.display="none"},o.prototype._configurePayPal=function(){g.isPopupSupported()||(this.ppClient=new m({clientToken:this.clientToken,paypal:this.paypalOptions}),this.rpcServer.define("openPayPalModal",p.bind(this.ppClient._openModal,this.ppClient))),c.on("receivePayPalData",p.bind(this._handleAltPayData,this))},o.prototype._handleAltPayData=function(t){this.merchantFormManager.setNoncePayload(t),this.frames.inline.rpcClient.invoke("receiveNewPaymentMethod",[t]),this.frames.modal.rpcClient.invoke("modalViewClose")},o.prototype._findClosest=function(t,e){e=e.toUpperCase();do if(t.nodeName===e)return t;while(t=t.parentNode);throw"Unable to find a valid "+e},e.exports=o},{"../shared/constants":210,"../shared/paypal-service":211,"./api-proxy-server":205,"./frame-container":208,"./merchant-form-manager":209,"braintree-api":89,"braintree-bus":110,"braintree-paypal/src/shared/util/browser":169,"braintree-rpc":177,"braintree-utilities":189}],207:[function(t,e){"use strict";function n(t,e){var n;return e.clientToken=t,n=new i(e),n.initialize(),n}var i=t("./client"),r="1.7.0";e.exports={create:n,VERSION:r}},{"./client":206}],208:[function(t,e){"use strict";function n(){var t,e=document.createElement("fakeelement");for(t in u)if("undefined"!=typeof e.style[t])return u[t];return null}function i(t){function e(n){n.target===t&&"height"===n.propertyName&&(o.emit(o.events.ASYNC_DEPENDENCY_READY),t.removeEventListener(i,e))}var i=n();i?t.addEventListener(i,e):setTimeout(function(){o.emit(o.events.ASYNC_DEPENDENCY_READY)},500)}function r(t,e){var n="height 210ms cubic-bezier(0.390, 0.575, 0.565, 1.000)";this.element=a({name:e,width:"100%",height:"68",style:{transition:n,WebkitTransition:n,MozTransition:n,msTransition:n,OTransition:n,border:"0",zIndex:"9999"}}),this.element.src=t,e===s.INLINE_FRAME_NAME&&i(this.element)}var o=t("braintree-bus"),s=t("../shared/constants"),a=t("iframer"),u={transition:"transitionend","-o-transition":"otransitionEnd","-moz-transition":"transitionend","-webkit-transition":"webkitTransitionEnd"};e.exports=r},{"../shared/constants":210,"braintree-bus":110,iframer:191}],209:[function(t,e){"use strict";function n(t){this.formNapper=new r(t.form),this.frames=t.frames,this.onSubmit=t.onSubmit,this.apiClient=t.apiClient}var i=t("braintree-utilities"),r=t("form-napper");n.prototype.initialize=function(){return this._isSubmitBased()&&this._setElements(),this._setEvents(),this},n.prototype.setNoncePayload=function(t){this.noncePayload=t},n.prototype.clearNoncePayload=function(){this.noncePayload=null},n.prototype._isSubmitBased=function(){return!this.onSubmit},n.prototype._isCallbackBased=function(){return!!this.onSubmit},n.prototype._setElements=function(){this.formNapper.inject("payment_method_nonce","")},n.prototype._setEvents=function(){this.formNapper.hijack(i.bind(this._handleFormSubmit,this))},n.prototype._handleFormSubmit=function(t){this.noncePayload&&this.noncePayload.nonce?this._handleNonceReply(t):this.frames.inline.rpcClient.invoke("requestNonce",[],i.bind(function(e){this.setNoncePayload(e),this._handleNonceReply(t)},this))},n.prototype._handleNonceReply=function(t){this._isCallbackBased()?this.apiClient.sendAnalyticsEvents("dropin.web.end.callback",i.bind(function(){var e=this.noncePayload;e.originalEvent=t,this.onSubmit(e),setTimeout(i.bind(function(){this.frames.inline.rpcClient.invoke("clearLoadingState"),this.frames.inline.rpcClient.invoke("receiveNewPaymentMethod",[e])},this),200)},this)):this._triggerFormSubmission()},n.prototype._triggerFormSubmission=function(){this.formNapper.inject("payment_method_nonce",this.noncePayload.nonce),this.apiClient.sendAnalyticsEvents("dropin.web.end.auto-submit",i.bind(function(){this.formNapper.submit()},this))},e.exports=n},{"braintree-utilities":189,"form-napper":190}],210:[function(t,e){e.exports={PAYPAL_INTEGRATION_NAME:"PayPal",INLINE_FRAME_NAME:"braintree-dropin-frame",MODAL_FRAME_NAME:"braintree-dropin-modal-frame",PAYMENT_METHOD_TYPES:["CoinbaseAccount","PayPalAccount","CreditCard"],cssClassMap:{"American Express":"american-express","Diners Club":"diners-club",DinersClub:"diners-club",Discover:"discover",JCB:"jcb",Maestro:"maestro",MasterCard:"master-card",Solo:"solo",Switch:"switch",UKMaestro:"maestro",UnionPay:"unionpay",Visa:"visa"}}},{}],211:[function(t,e){"use strict";function n(t){var e=t.clientToken,n=t.paypal||{},r=new i(e,{container:document.createElement("div"),displayName:n.displayName,locale:n.locale,singleUse:n.singleUse,amount:n.amount,currency:n.currency,onSuccess:n.onSuccess,enableShippingAddress:n.enableShippingAddress,shippingAddressOverride:n.shippingAddressOverride,enableBillingAddress:n.enableBillingAddress});return r.initialize(),r}var i=t("braintree-paypal/src/external/client");e.exports=n},{"braintree-paypal/src/external/client":158}],212:[function(t,e){(function(t){"use strict";function n(t,e){e=e||{};var r,s,a=t.children;for(s=0;s<a.length;s++)if(r=a[s],o(r)){var u=r.getAttribute("data-braintree-name");"postal_code"===u?e.billingAddress={postalCode:r.value}:e[u]=r.value,i(r)}else r.children&&r.children.length>0&&n(r,e);return e}function i(t){try{t.attributes.removeNamedItem("name")}catch(e){}}function r(t){n(t)}function o(t){return t.nodeType===s&&t.attributes["data-braintree-name"]}var s=t.Node?t.Node.ELEMENT_NODE:1;e.exports={extractValues:n,scrubAllAttributes:r,scrubAttributes:i,isBraintreeNode:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],213:[function(t,e){"use strict";function n(t,e,n,i){this.client=t,this.htmlForm=e,this.isCreditCardForm=i===!1?!1:!0,this.paymentMethodNonceInput=n,this.model=new s,this.setEvents()}var i=t("braintree-utilities"),r=t("./fields"),o=t("braintree-bus"),s=t("./models/payment-method-model"),a={message:"Unable to process payments at this time",type:"IMMEDIATE"};n.prototype.setEvents=function(){this.onSubmitHandler=i.bind(this.handleSubmit,this),this.onExternalNonceReceived=i.bind(this.onExternalNonceReceived,this),this.clearExternalNonce=i.bind(this.clearExternalNonce,this),i.addEventListener(this.htmlForm,"submit",this.onSubmitHandler),o.on(o.events.PAYMENT_METHOD_GENERATED,this.onExternalNonceReceived),o.on(o.events.PAYMENT_METHOD_CANCELLED,this.clearExternalNonce)},n.prototype.handleSubmit=function(t){var e;return t.preventDefault?t.preventDefault():t.returnValue=!1,this.isCreditCardForm?(e=this.model.get("type"),e&&"CreditCard"!==e?(r.scrubAllAttributes(this.htmlForm),void this.onNonceReceived(null,this.model.attributes)):void this.client.tokenizeCard(r.extractValues(this.htmlForm),i.bind(function(t,e,n){t?this.onNonceReceived(a,null):(this.model.set({nonce:e,type:n.type,details:n.details}),this.onNonceReceived(null,this.model.attributes))},this))):void this.onNonceReceived(null,this.model.attributes)},n.prototype.writeNonceToDOM=function(){this.paymentMethodNonceInput.value=this.model.get("nonce")},n.prototype.onExternalNonceReceived=function(t){this.model.set(t),this.writeNonceToDOM()},n.prototype.clearExternalNonce=function(){this.model.reset()},n.prototype.onNonceReceived=function(t){var e=this.htmlForm;return t?void o.emit(o.events.ERROR,a):(i.removeEventListener(e,"submit",this.onSubmitHandler),this.writeNonceToDOM(),void(e.submit&&("function"==typeof e.submit||e.submit.call)?e.submit():setTimeout(function(){e.querySelector('[type="submit"]').click()},1)))},e.exports=n},{"./fields":212,"./models/payment-method-model":215,"braintree-bus":218,"braintree-utilities":225}],214:[function(t,e){"use strict";e.exports=function(t){var e;if("object"==typeof t)return t;e="payment_method_nonce","string"==typeof t&&(e=t);var n=document.createElement("input");return n.name=e,n.type="hidden",n}},{}],215:[function(t,e){"use strict";function n(){this.reset()}n.prototype.get=function(t){return this.attributes[t]},n.prototype.set=function(t){this.attributes=t||{}},n.prototype.reset=function(){this.attributes={}},e.exports=n},{}],216:[function(t,e){"use strict";e.exports=function(t){for(var e=t.getElementsByTagName("*"),n={},i=0;i<e.length;i++){var r=e[i].getAttribute("data-braintree-name");n[r]=!0}if(!n.number)throw new Error('Unable to find an input with data-braintree-name="number" in your form. Please add one.');if(n.expiration_date){if(n.expiration_month||n.expiration_year)throw new Error('You have inputs with data-braintree-name="expiration_date" AND data-braintree-name="expiration_(year|month)". Please use either "expiration_date" or "expiration_year" and "expiration_month".')}else{if(!n.expiration_month&&!n.expiration_year)throw new Error('Unable to find an input with data-braintree-name="expiration_date" in your form. Please add one.');if(!n.expiration_month)throw new Error('Unable to find an input with data-braintree-name="expiration_month" in your form. Please add one.');if(!n.expiration_year)throw new Error('Unable to find an input with data-braintree-name="expiration_year" in your form. Please add one.')}}},{}],217:[function(t,e){"use strict";function n(t,e){var n,s,a=document.getElementById(e.id),u=e&&e.hasOwnProperty("useCreditCard")?e.useCreditCard:!0;if(!a)throw new Error('Unable to find form with id: "'+e.id+'"');return u&&r(a),n=o(e.paymentMethodNonceInputField),a.appendChild(n),s=new i(t,a,n,u)}var i=t("./lib/form"),r=t("./lib/validate-annotations"),o=t("./lib/get-nonce-input");e.exports={setup:n}},{"./lib/form":213,"./lib/get-nonce-input":214,"./lib/validate-annotations":216}],218:[function(t,e,n){arguments[4][37][0].apply(n,arguments)},{"./lib/events":219,dup:37,framebus:220}],219:[function(t,e,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],220:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],221:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],222:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],223:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],224:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20}],225:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{"./lib/dom":221,"./lib/events":222,"./lib/fn":223,"./lib/url":224,dup:21}],226:[function(t,e,n){arguments[4][113][0].apply(n,arguments)},{"./coinbase-account":227,"./credit-card":228,"./europe-bank-account":229,"./normalize-api-fields":233,"./parse-client-token":234,"./paypal-account":235,"./request-driver":237,"./sepa-mandate":238,"./util":239,"braintree-3ds":248,"braintree-utilities":260,dup:113}],227:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{dup:3}],228:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],229:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],230:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{"./parse-client-token":234,"./request-driver":237,"./util":239,dup:6}],231:[function(t,e,n){arguments[4][7][0].apply(n,arguments)},{"./jsonp":232,dup:7}],232:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"./util":239,dup:8}],233:[function(t,e,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],234:[function(t,e,n){arguments[4][10][0].apply(n,arguments)},{"./polyfill":236,"braintree-utilities":260,dup:10}],235:[function(t,e,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],236:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{dup:12}],237:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"./jsonp-driver":231,dup:13}],238:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],239:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],240:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{"./lib/client":226,"./lib/get-configuration":230,"./lib/jsonp":232,"./lib/jsonp-driver":231,"./lib/parse-client-token":234,"./lib/util":239,dup:16}],241:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],242:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],243:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],244:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20}],245:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{"./lib/dom":241,"./lib/events":242,"./lib/fn":243,"./lib/url":244,dup:21}],246:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"../shared/receiver":253,"braintree-utilities":245,dup:22}],247:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{"./authorization_service":246,"./loader":249,"braintree-utilities":245,dup:23}],248:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{"./client":247,dup:24}],249:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{"./loader_display":250,"./loader_message":251,"./loader_spinner":252,dup:25}],250:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],251:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{dup:27}],252:[function(t,e,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],253:[function(t,e,n){arguments[4][29][0].apply(n,arguments)},{"braintree-utilities":245,dup:29}],254:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],255:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],256:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],257:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],258:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],259:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{"./array":254,dup:35}],260:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"./lib/array":254,"./lib/dom":255,"./lib/events":256,"./lib/fn":257,"./lib/string":258,"./lib/url":259,dup:36}],261:[function(t,e,n){arguments[4][37][0].apply(n,arguments)},{"./lib/events":262,dup:37,framebus:263}],262:[function(t,e,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],263:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],264:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],265:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],266:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],267:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],268:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],269:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{"./array":264,dup:35}],270:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"./lib/array":264,"./lib/dom":265,"./lib/events":266,"./lib/fn":267,"./lib/string":268,"./lib/url":269,dup:36}],271:[function(t,e,n){arguments[4][158][0].apply(n,arguments)},{"../shared/constants":276,"../shared/get-locale":278,"../shared/util/browser":283,"../shared/util/dom":284,"../shared/util/util":285,"./logged-in-view":273,"./logged-out-view":274,"./overlay-view":275,"braintree-api":240,"braintree-bus":261,"braintree-utilities":270,dup:158}],272:[function(t,e){function n(t,e){if(!r.detectedPostMessage())return void("function"==typeof e.onUnsupported&&e.onUnsupported(new Error("unsupported browser detected")));var n=new i(t,e);return n.initialize(),n}var i=t("./client"),r=t("../shared/util/browser"),o="1.4.0";e.exports={create:n,_browser:r,VERSION:o}},{"../shared/util/browser":283,"./client":271}],273:[function(t,e,n){arguments[4][159][0].apply(n,arguments)},{"../shared/constants":276,dup:159}],274:[function(t,e,n){arguments[4][160][0].apply(n,arguments)},{"../shared/constants":276,"../shared/get-locale":278,"braintree-utilities":270,dup:160}],275:[function(t,e,n){arguments[4][161][0].apply(n,arguments)},{"../shared/constants":276,"braintree-utilities":270,dup:161}],276:[function(t,e,n){arguments[4][162][0].apply(n,arguments)},{dup:162}],277:[function(t,e,n){arguments[4][163][0].apply(n,arguments)},{dup:163}],278:[function(t,e,n){arguments[4][164][0].apply(n,arguments)},{"../shared/data/country-code-lookup":277,dup:164}],279:[function(t,e,n){arguments[4][165][0].apply(n,arguments)},{"./platform":281,"./useragent":282,dup:165}],280:[function(t,e,n){arguments[4][166][0].apply(n,arguments)},{"./platform":281,"./useragent":282,dup:166}],281:[function(t,e,n){arguments[4][167][0].apply(n,arguments)},{"./useragent":282,dup:167}],282:[function(t,e,n){arguments[4][168][0].apply(n,arguments)},{dup:168}],283:[function(t,e,n){arguments[4][169][0].apply(n,arguments)},{"../useragent/browser":279,"../useragent/device":280,"../useragent/platform":281,"../useragent/useragent":282,dup:169}],284:[function(t,e,n){arguments[4][170][0].apply(n,arguments)},{dup:170}],285:[function(t,e,n){arguments[4][171][0].apply(n,arguments)},{dup:171}],286:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],287:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17}],288:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],289:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],290:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],291:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{"./array":286,dup:35}],292:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{"./lib/array":286,"./lib/dom":287,"./lib/events":288,"./lib/fn":289,"./lib/string":290,"./lib/url":291,dup:36}],293:[function(t,e){"use strict";function n(t){var e,n={};if(t){for(e in t)t.hasOwnProperty(e)&&(n[i(e)]=t[e]);return n}}function i(t){return t.replace(/([A-Z])/g,function(t){return"_"+t.toLowerCase()})}e.exports={convertToLegacyShippingAddress:n}},{}],294:[function(t,e){"use strict";e.exports={ROOT_SUCCESS_CALLBACK:"onPaymentMethodReceived",ROOT_ERROR_CALLBACK:"onError",ROOT_READY_CALLBACK:"onReady"}},{}],295:[function(t,e){"use strict";function n(t,e){return o.on(o.events.PAYMENT_METHOD_GENERATED,function(t){o.emit(o.events.PAYMENT_METHOD_RECEIVED,t)}),e.coinbase=e.coinbase||{},e.apiClient=new i.Client({clientToken:t,integration:"coinbase"}),r.create(e)}var i=t("braintree-api"),r=t("braintree-coinbase"),o=t("braintree-bus");e.exports={initialize:n}},{"braintree-api":16,"braintree-bus":37,"braintree-coinbase":40}],296:[function(t,e){"use strict";function n(t,e){var n=new a.Client({clientToken:t,integration:"custom"});i(e,n),r(e,t),o(e,n)}function i(t,e){var n;t.id?(n=u.setup(e,t),p.isFunction(t[h.ROOT_SUCCESS_CALLBACK])&&(n.onNonceReceived=function(e,n){e?d.emit(d.events.ERROR,e):t[h.ROOT_SUCCESS_CALLBACK](n)})):d.on(d.events.PAYMENT_METHOD_GENERATED,function(t){d.emit(d.events.PAYMENT_METHOD_RECEIVED,t)})}function r(t,e){var n,i,r,o;t.paypal&&(n=s(t,"paypal"),i=n("onSuccess"),r=n("onCancelled"),t.paypal.paymentMethodNonceInputField||(o=document.createElement("input"),o.id="braintree-custom-integration-dummy-input",t.paypal.paymentMethodNonceInputField=o),t.paypal.onSuccess=function(t){d.emit(d.events.PAYMENT_METHOD_GENERATED,t),i.apply(null,[t.nonce,t.details.email,f(t.details.shippingAddress)])},t.paypal.onCancelled=function(){d.emit(d.events.PAYMENT_METHOD_CANCELLED),r()},c.create(e,t.paypal))}function o(t,e){t.coinbase&&(t.apiClient=e,t.paypal&&delete t.paypal,l.create(t))}function s(t,e){return function(n){return e in t&&p.isFunction(t[e][n])?t[e][n]:function(){}}}var a=t("braintree-api"),u=t("braintree-form"),c=t("braintree-paypal"),l=t("braintree-coinbase"),p=t("braintree-utilities"),h=t("../constants"),d=t("braintree-bus"),f=t("../compatibility").convertToLegacyShippingAddress;e.exports={initialize:n}},{"../compatibility":293,"../constants":294,"braintree-api":16,"braintree-bus":37,"braintree-coinbase":40,"braintree-form":217,"braintree-paypal":272,"braintree-utilities":292}],297:[function(t,e){"use strict";function n(t){return s.isFunction(t.paymentMethodNonceReceived)?t.paymentMethodNonceReceived:null}function i(t){return s.isFunction(t[u.ROOT_SUCCESS_CALLBACK])}function r(t,e){var r=n(e),s=i(e);return(r||s)&&(e.paymentMethodNonceReceived=function(t){r&&r.apply(null,[t.originalEvent,t.nonce]),delete t.originalEvent,a.emit(a.events.PAYMENT_METHOD_RECEIVED,c(t))}),o.create(t,e)}var o=t("braintree-dropin"),s=t("braintree-utilities"),a=t("braintree-bus"),u=t("../constants"),c=t("../lib/sanitize-payload");e.exports={initialize:r}},{"../constants":294,"../lib/sanitize-payload":302,"braintree-bus":37,"braintree-dropin":207,"braintree-utilities":292}],298:[function(t,e){"use strict";e.exports={custom:t("./custom"),dropin:t("./dropin"),paypal:t("./paypal"),coinbase:t("./coinbase")}},{"./coinbase":295,"./custom":296,"./dropin":297,"./paypal":299}],299:[function(t,e){"use strict";function n(t){return"onSuccess"in t&&s.isFunction(t.onSuccess)?t.onSuccess:"paypal"in t&&s.isFunction(t.paypal.onSuccess)?t.paypal.onSuccess:null}function i(t){return s.isFunction(t[a.ROOT_SUCCESS_CALLBACK])}function r(t,e){var r=n(e),s=i(e);return(r||s)&&(e.onSuccess=function(t){r&&r.apply(null,[t.nonce,t.details.email,c(t.details.shippingAddress)]),u.emit(u.events.PAYMENT_METHOD_RECEIVED,t)}),o.create(t,e)}var o=t("braintree-paypal"),s=t("braintree-utilities"),a=t("../constants"),u=t("braintree-bus"),c=t("../compatibility").convertToLegacyShippingAddress;e.exports={initialize:r}},{"../compatibility":293,"../constants":294,"braintree-bus":37,"braintree-paypal":272,"braintree-utilities":292}],300:[function(t,e){"use strict";function n(t,e){var n="web."+e+".",s=r.configure({clientToken:t,integration:e}),a=i(n,s);o.on(o.events.SEND_ANALYTICS_EVENTS,a)}function i(t,e){return function(n,i){var r;for(n instanceof Array||(n=[n]),r=0;r<n.length;r++)n[r]=t+n[r];e.sendAnalyticsEvents(n,i)}}var r=t("braintree-api"),o=t("braintree-bus");e.exports={listenForAnalytics:n,_createSender:i}},{"braintree-api":16,"braintree-bus":37}],301:[function(t,e){"use strict";function n(t){this.callback=t,this.counter=0,this.attachEvents()}var i=t("braintree-bus"),r=t("braintree-utilities");n.prototype.attachEvents=function(){this.initHandler=r.bind(this.handleDependencyInitializing,this),this.readyHandler=r.bind(this.handleDependencyReady,this),i.on(i.events.ASYNC_DEPENDENCY_INITIALIZING,this.initHandler),i.on(i.events.ASYNC_DEPENDENCY_READY,this.readyHandler)},n.prototype.handleDependencyInitializing=function(){this.counter++},n.prototype.handleDependencyReady=function(){this.counter--,0===this.counter&&(this.detachEvents(),this.callback())},n.prototype.detachEvents=function(){i.off(i.events.ASYNC_DEPENDENCY_INITIALIZING,this.initHandler),i.off(i.events.ASYNC_DEPENDENCY_READY,this.readyHandler)},e.exports=function(t){return new n(t)}},{"braintree-bus":37,"braintree-utilities":292}],302:[function(t,e){"use strict";e.exports=function(t){return{nonce:t.nonce,details:t.details,type:t.type}}},{}]},{},[1])(1)});
1
+ !function(){function t(e,n){e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=n)}function e(t,e,n,r,i){this.stream=t,this.header=e,this.length=n,this.tag=r,this.sub=i}function n(t){var e,n,r="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),r+=ee.charAt(n>>6)+ee.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),r+=ee.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),r+=ee.charAt(n>>2)+ee.charAt((3&n)<<4));(3&r.length)>0;)r+=ne;return r}function r(t){var e,n,r,i="",o=0;for(e=0;e<t.length&&t.charAt(e)!=ne;++e)r=ee.indexOf(t.charAt(e)),0>r||(0==o?(i+=l(r>>2),n=3&r,o=1):1==o?(i+=l(n<<2|r>>4),n=15&r,o=2):2==o?(i+=l(n),i+=l(r>>2),n=3&r,o=3):(i+=l(n<<2|r>>4),i+=l(15&r),o=0));return 1==o&&(i+=l(n<<2)),i}function i(t){var e,n=r(t),i=new Array;for(e=0;2*e<n.length;++e)i[e]=parseInt(n.substring(2*e,2*e+2),16);return i}function o(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function s(){return new o(null)}function a(t,e,n,r,i,o){for(;--o>=0;){var s=e*this[t++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i}function u(t,e,n,r,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,l=a*u+c*s;u=s*u+((32767&l)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(l>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i}function c(t,e,n,r,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,l=a*u+c*s;u=s*u+((16383&l)<<14)+n[r]+i,i=(u>>28)+(l>>14)+a*c,n[r++]=268435455&u}return i}function l(t){return ue.charAt(t)}function p(t,e){var n=ce[t.charCodeAt(e)];return null==n?-1:n}function h(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function d(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+this.DV:this.t=0}function f(t){var e=s();return e.fromInt(t),e}function m(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var r=t.length,i=!1,s=0;--r>=0;){var a=8==n?255&t[r]:p(t,r);0>a?"-"==t.charAt(r)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,s+=n,s>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&o.ZERO.subTo(this,this)}function g(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function y(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-->0)for(a<this.DB&&(n=this[s]>>a)>0&&(i=!0,o=l(n));s>=0;)e>a?(n=(this[s]&(1<<a)-1)<<e-a,n|=this[--s]>>(a+=this.DB-e)):(n=this[s]>>(a-=e)&r,0>=a&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=l(n));return i?o:"0"}function b(){var t=s();return o.ZERO.subTo(this,t),t}function v(){return this.s<0?this.negate():this}function _(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(e=n-t.t,0!=e)return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0}function E(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function w(){return this.t<=0?0:this.DB*(this.t-1)+E(this[this.t-1]^this.s&this.DM)}function C(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function A(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function S(t,e){var n,r=t%this.DB,i=this.DB-r,o=(1<<i)-1,s=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e[n+s+1]=this[n]>>i|a,a=(this[n]&o)<<r;for(n=s-1;n>=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()}function x(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)return void(e.t=0);var r=t%this.DB,i=this.DB-r,o=(1<<r)-1;e[0]=this[n]>>r;for(var s=n+1;s<this.t;++s)e[s-n-1]|=(this[s]&o)<<i,e[s-n]=this[s]>>r;r>0&&(e[this.t-n-1]|=(this.s&o)<<i),e.t=this.t-n,e.clamp()}function T(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);i>n;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=0>r?-1:0,-1>r?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function O(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e[i]=0;for(i=0;i<r.t;++i)e[i+n.t]=n.am(0,r[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&o.ZERO.subTo(e,e)}function P(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function N(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=s());var a=s(),u=this.s,c=t.s,l=this.DB-E(r[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,n)):(r.copyTo(a),i.copyTo(n));var p=a.t,h=a[p-1];if(0!=h){var d=h*(1<<this.F1)+(p>1?a[p-2]>>this.F2:0),f=this.FV/d,m=(1<<this.F1)/d,g=1<<this.F2,y=n.t,b=y-p,v=null==e?s():e;for(a.dlShiftTo(b,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),o.ONE.dlShiftTo(p,v),v.subTo(a,a);a.t<p;)a[a.t++]=0;for(;--b>=0;){var _=n[--y]==h?this.DM:Math.floor(n[y]*f+(n[y-1]+g)*m);if((n[y]+=a.am(0,_,n,b,0,p))<_)for(a.dlShiftTo(b,v),n.subTo(v,n);n[y]<--_;)n.subTo(v,n)}null!=e&&(n.drShiftTo(p,e),u!=c&&o.ZERO.subTo(e,e)),n.t=p,n.clamp(),l>0&&n.rShiftTo(l,n),0>u&&o.ZERO.subTo(n,n)}}}function I(t){var e=s();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e}function R(t){this.m=t}function k(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function D(t){return t}function M(t){t.divRemTo(this.m,null,t)}function U(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function L(t,e){t.squareTo(e),this.reduce(e)}function F(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function j(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function B(t){var e=s();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e}function z(t){var e=s();return t.copyTo(e),this.reduce(e),e}function H(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function V(t,e){t.squareTo(e),this.reduce(e)}function Y(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function q(){return 0==(this.t>0?1&this[0]:this.s)}function W(t,e){if(t>4294967295||1>t)return o.ONE;var n=s(),r=s(),i=e.convert(this),a=E(t)-1;for(i.copyTo(n);--a>=0;)if(e.sqrTo(n,r),(t&1<<a)>0)e.mulTo(r,i,n);else{var u=n;n=r,r=u}return e.revert(n)}function G(t,e){var n;return n=256>t||e.isEven()?new R(e):new j(e),this.exp(t,n)}function Q(t,e){return new o(t,e)}function K(t,e){if(e<t.length+11)throw new Error("Message too long for RSA");for(var n=new Array,r=t.length-1;r>=0&&e>0;){var i=t.charCodeAt(r--);128>i?n[--e]=i:i>127&&2048>i?(n[--e]=63&i|128,n[--e]=i>>6|192):(n[--e]=63&i|128,n[--e]=i>>6&63|128,n[--e]=i>>12|224)}n[--e]=0;for(var s=0,a=0,u=0;e>2;)0==u&&(a=le.random.randomWords(1,0)[0]),s=a>>u&255,u=(u+8)%32,0!=s&&(n[--e]=s);return n[--e]=2,n[--e]=0,new o(n)}function $(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function Z(t,e){if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw new Error("Invalid RSA public key");this.n=Q(t,16),this.e=parseInt(e,16)}function X(t){return t.modPowInt(this.e,this.n)}function J(t){var e=K(t,this.n.bitLength()+7>>3);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r}t.prototype.get=function(t){if(void 0==t&&(t=this.pos++),t>=this.enc.length)throw"Requesting byte offset "+t+" on a stream of length "+this.enc.length;return this.enc[t]},t.prototype.hexDigits="0123456789ABCDEF",t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e){for(var n="",r=t;e>r;++r)switch(n+=this.hexByte(this.get(r)),15&r){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},t.prototype.parseStringISO=function(t,e){for(var n="",r=t;e>r;++r)n+=String.fromCharCode(this.get(r));return n},t.prototype.parseStringUTF=function(t,e){for(var n="",r=0,i=t;e>i;){var r=this.get(i++);n+=String.fromCharCode(128>r?r:r>191&&224>r?(31&r)<<6|63&this.get(i++):(15&r)<<12|(63&this.get(i++))<<6|63&this.get(i++))}return n},t.prototype.reTime=/^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,t.prototype.parseTime=function(t,e){var n=this.parseStringISO(t,e),r=this.reTime.exec(n);return r?(n=r[1]+"-"+r[2]+"-"+r[3]+" "+r[4],r[5]&&(n+=":"+r[5],r[6]&&(n+=":"+r[6],r[7]&&(n+="."+r[7]))),r[8]&&(n+=" UTC","Z"!=r[8]&&(n+=r[8],r[9]&&(n+=":"+r[9]))),n):"Unrecognized time: "+n},t.prototype.parseInteger=function(t,e){var n=e-t;if(n>4){n<<=3;var r=this.get(t);if(0==r)n-=8;else for(;128>r;)r<<=1,--n;return"("+n+" bit)"}for(var i=0,o=t;e>o;++o)i=i<<8|this.get(o);return i},t.prototype.parseBitString=function(t,e){var n=this.get(t),r=(e-t-1<<3)-n,i="("+r+" bit)";if(20>=r){var o=n;i+=" ";for(var s=e-1;s>t;--s){for(var a=this.get(s),u=o;8>u;++u)i+=a>>u&1?"1":"0";o=0}}return i},t.prototype.parseOctetString=function(t,e){var n=e-t,r="("+n+" byte) ";n>20&&(e=t+20);for(var i=t;e>i;++i)r+=this.hexByte(this.get(i));return n>20&&(r+=String.fromCharCode(8230)),r},t.prototype.parseOID=function(t,e){for(var n,r=0,i=0,o=t;e>o;++o){var s=this.get(o);r=r<<7|127&s,i+=7,128&s||(void 0==n?n=parseInt(r/40)+"."+r%40:n+="."+(i>=31?"bigint":r),r=i=0),n+=String.fromCharCode()}return n},e.prototype.typeName=function(){if(void 0==this.tag)return"unknown";var t=this.tag>>6,e=(this.tag>>5&1,31&this.tag);switch(t){case 0:switch(e){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+e.toString(16)}case 1:return"Application_"+e.toString(16);case 2:return"["+e+"]";case 3:return"Private_"+e.toString(16)}},e.prototype.content=function(){if(void 0==this.tag)return null;var t=this.tag>>6;if(0!=t)return null==this.sub?null:"("+this.sub.length+")";var e=31&this.tag,n=this.posContent(),r=Math.abs(this.length);switch(e){case 1:return 0==this.stream.get(n)?"false":"true";case 2:return this.stream.parseInteger(n,n+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(n,n+r);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(n,n+r);case 6:return this.stream.parseOID(n,n+r);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(n,n+r);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(n,n+r);case 23:case 24:return this.stream.parseTime(n,n+r)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null==this.sub?"null":this.sub.length)+"]"},e.prototype.print=function(t){if(void 0==t&&(t=""),document.writeln(t+this),null!=this.sub){t+=" ";for(var e=0,n=this.sub.length;n>e;++e)this.sub[e].print(t)}},e.prototype.toPrettyString=function(t){void 0==t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,32&this.tag?e+=" (constructed)":3!=this.tag&&4!=this.tag||null==this.sub||(e+=" (encapsulates)"),e+="\n",null!=this.sub){t+=" ";for(var n=0,r=this.sub.length;r>n;++n)e+=this.sub[n].toPrettyString(t)}return e},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.decodeLength=function(t){var e=t.get(),n=127&e;if(n==e)return n;if(n>3)throw"Length over 24 bits not supported at position "+(t.pos-1);if(0==n)return-1;e=0;for(var r=0;n>r;++r)e=e<<8|t.get();return e},e.hasContent=function(n,r,i){if(32&n)return!0;if(3>n||n>4)return!1;var o=new t(i);3==n&&o.get();var s=o.get();if(s>>6&1)return!1;try{var a=e.decodeLength(o);return o.pos-i.pos+a==r}catch(u){return!1}},e.decode=function(n){n instanceof t||(n=new t(n,0));var r=new t(n),i=n.get(),o=e.decodeLength(n),s=n.pos-r.pos,a=null;if(e.hasContent(i,o,n)){var u=n.pos;if(3==i&&n.get(),a=[],o>=0){for(var c=u+o;n.pos<c;)a[a.length]=e.decode(n);if(n.pos!=c)throw"Content size is not correct for container starting at offset "+u}else try{for(;;){var l=e.decode(n);if(0==l.tag)break;a[a.length]=l}o=u-n.pos}catch(p){throw"Exception while decoding undefined length content: "+p}}else n.pos+=o;return new e(r,s,o,i,a)};var te,ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ne="=",re=0xdeadbeefcafe,ie=15715070==(16777215&re);ie&&"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=u,te=30):ie&&"Netscape"!=navigator.appName?(o.prototype.am=a,te=26):(o.prototype.am=c,te=28),o.prototype.DB=te,o.prototype.DM=(1<<te)-1,o.prototype.DV=1<<te;var oe=52;o.prototype.FV=Math.pow(2,oe),o.prototype.F1=oe-te,o.prototype.F2=2*te-oe;var se,ae,ue="0123456789abcdefghijklmnopqrstuvwxyz",ce=new Array;for(se="0".charCodeAt(0),ae=0;9>=ae;++ae)ce[se++]=ae;for(se="a".charCodeAt(0),ae=10;36>ae;++ae)ce[se++]=ae;for(se="A".charCodeAt(0),ae=10;36>ae;++ae)ce[se++]=ae;R.prototype.convert=k,R.prototype.revert=D,R.prototype.reduce=M,R.prototype.mulTo=U,R.prototype.sqrTo=L,j.prototype.convert=B,j.prototype.revert=z,j.prototype.reduce=H,j.prototype.mulTo=Y,j.prototype.sqrTo=V,o.prototype.copyTo=h,o.prototype.fromInt=d,o.prototype.fromString=m,o.prototype.clamp=g,o.prototype.dlShiftTo=C,o.prototype.drShiftTo=A,o.prototype.lShiftTo=S,o.prototype.rShiftTo=x,o.prototype.subTo=T,o.prototype.multiplyTo=O,o.prototype.squareTo=P,o.prototype.divRemTo=N,o.prototype.invDigit=F,o.prototype.isEven=q,o.prototype.exp=W,o.prototype.toString=y,o.prototype.negate=b,o.prototype.abs=v,o.prototype.compareTo=_,o.prototype.bitLength=w,o.prototype.mod=I,o.prototype.modPowInt=G,o.ZERO=f(0),o.ONE=f(1),$.prototype.doPublic=X,$.prototype.setPublic=Z,$.prototype.encrypt=J;var le={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};"undefined"!=typeof module&&module.exports&&(module.exports=le),le.cipher.aes=function(t){this._tables[0][0][0]||this._precompute();var e,n,r,i,o,s=this._tables[0][4],a=this._tables[1],u=t.length,c=1;if(4!==u&&6!==u&&8!==u)throw new le.exception.invalid("invalid aes key size");for(this._key=[i=t.slice(0),o=[]],e=u;4*u+28>e;e++)r=i[e-1],(e%u===0||8===u&&e%u===4)&&(r=s[r>>>24]<<24^s[r>>16&255]<<16^s[r>>8&255]<<8^s[255&r],e%u===0&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7))),i[e]=i[e-u]^r;for(n=0;e;n++,e--)r=i[3&n?e:e-4],o[n]=4>=e||4>n?r:a[0][s[r>>>24]]^a[1][s[r>>16&255]]^a[2][s[r>>8&255]]^a[3][s[255&r]]},le.cipher.aes.prototype={encrypt:function(t){return this._crypt(t,0)},decrypt:function(t){return this._crypt(t,1)},_tables:[[[],[],[],[],[]],[[],[],[],[],[]]],_precompute:function(){var t,e,n,r,i,o,s,a,u,c=this._tables[0],l=this._tables[1],p=c[4],h=l[4],d=[],f=[];for(t=0;256>t;t++)f[(d[t]=t<<1^283*(t>>7))^t]=t;for(e=n=0;!p[e];e^=r||1,n=f[n]||1)for(s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^255&s^99,p[e]=s,h[s]=e,o=d[i=d[r=d[e]]],u=16843009*o^65537*i^257*r^16843008*e,a=257*d[s]^16843008*s,t=0;4>t;t++)c[t][e]=a=a<<24^a>>>8,l[t][s]=u=u<<24^u>>>8;for(t=0;5>t;t++)c[t]=c[t].slice(0),l[t]=l[t].slice(0)},_crypt:function(t,e){if(4!==t.length)throw new le.exception.invalid("invalid aes block size");var n,r,i,o,s=this._key[e],a=t[0]^s[0],u=t[e?3:1]^s[1],c=t[2]^s[2],l=t[e?1:3]^s[3],p=s.length/4-2,h=4,d=[0,0,0,0],f=this._tables[e],m=f[0],g=f[1],y=f[2],b=f[3],v=f[4];for(o=0;p>o;o++)n=m[a>>>24]^g[u>>16&255]^y[c>>8&255]^b[255&l]^s[h],r=m[u>>>24]^g[c>>16&255]^y[l>>8&255]^b[255&a]^s[h+1],i=m[c>>>24]^g[l>>16&255]^y[a>>8&255]^b[255&u]^s[h+2],l=m[l>>>24]^g[a>>16&255]^y[u>>8&255]^b[255&c]^s[h+3],h+=4,a=n,u=r,c=i;for(o=0;4>o;o++)d[e?3&-o:o]=v[a>>>24]<<24^v[u>>16&255]<<16^v[c>>8&255]<<8^v[255&l]^s[h++],n=a,a=u,u=c,c=l,l=n;return d}},le.bitArray={bitSlice:function(t,e,n){return t=le.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:le.bitArray.clamp(t,n-e)},extract:function(t,e,n){var r,i=Math.floor(-e-n&31);return r=-32&(e+n-1^e)?t[e/32|0]<<32-i^t[e/32+1|0]>>>i:t[e/32|0]>>>i,r&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],r=le.bitArray.getPartial(n);return 32===r?t.concat(e):le.bitArray._shiftRight(e,r,0|n,t.slice(0,t.length-1))},bitLength:function(t){var e,n=t.length;return 0===n?0:(e=t[n-1],32*(n-1)+le.bitArray.getPartial(e))},clamp:function(t,e){if(32*t.length<e)return t;t=t.slice(0,Math.ceil(e/32));var n=t.length;return e=31&e,n>0&&e&&(t[n-1]=le.bitArray.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:function(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(le.bitArray.bitLength(t)!==le.bitArray.bitLength(e))return!1;var n,r=0;for(n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r},_shiftRight:function(t,e,n,r){var i,o,s=0;for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(i=0;i<t.length;i++)r.push(n|t[i]>>>e),n=t[i]<<32-e;return s=t.length?t[t.length-1]:0,o=le.bitArray.getPartial(s),r.push(le.bitArray.partial(e+o&31,e+o>32?n:r.pop(),1)),r},_xor4:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]}},le.codec.hex={fromBits:function(t){var e,n="";for(e=0;e<t.length;e++)n+=((0|t[e])+0xf00000000000).toString(16).substr(4);return n.substr(0,le.bitArray.bitLength(t)/4)},toBits:function(t){var e,n,r=[];for(t=t.replace(/\s|0x/g,""),n=t.length,t+="00000000",e=0;e<t.length;e+=8)r.push(0^parseInt(t.substr(e,8),16));return le.bitArray.clamp(r,4*n)}},le.codec.utf8String={fromBits:function(t){var e,n,r="",i=le.bitArray.bitLength(t);for(e=0;i/8>e;e++)0===(3&e)&&(n=t[e/4]),r+=String.fromCharCode(n>>>24),n<<=8;return decodeURIComponent(escape(r))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,n=[],r=0;for(e=0;e<t.length;e++)r=r<<8|t.charCodeAt(e),3===(3&e)&&(n.push(r),r=0);return 3&e&&n.push(le.bitArray.partial(8*(3&e),r)),n}},le.codec.base64={_chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(t,e,n){var r,i="",o=0,s=le.codec.base64._chars,a=0,u=le.bitArray.bitLength(t);for(n&&(s=s.substr(0,62)+"-_"),r=0;6*i.length<u;)i+=s.charAt((a^t[r]>>>o)>>>26),6>o?(a=t[r]<<6-o,o+=26,r++):(a<<=6,o-=6);for(;3&i.length&&!e;)i+="=";return i},toBits:function(t,e){t=t.replace(/\s|=/g,"");var n,r,i=[],o=0,s=le.codec.base64._chars,a=0;for(e&&(s=s.substr(0,62)+"-_"),n=0;n<t.length;n++){if(r=s.indexOf(t.charAt(n)),0>r)throw new le.exception.invalid("this isn't base64!");o>26?(o-=26,i.push(a^r>>>o),a=r<<32-o):(o+=6,a^=r<<32-o)}return 56&o&&i.push(le.bitArray.partial(56&o,a,1)),i}},le.codec.base64url={fromBits:function(t){return le.codec.base64.fromBits(t,1,1)},toBits:function(t){return le.codec.base64.toBits(t,1)}},void 0===le.beware&&(le.beware={}),le.beware["CBC mode is dangerous because it doesn't protect message integrity."]=function(){le.mode.cbc={name:"cbc",encrypt:function(t,e,n,r){if(r&&r.length)throw new le.exception.invalid("cbc can't authenticate data");if(128!==le.bitArray.bitLength(n))throw new le.exception.invalid("cbc iv must be 128 bits");var i,o=le.bitArray,s=o._xor4,a=o.bitLength(e),u=0,c=[];if(7&a)throw new le.exception.invalid("pkcs#5 padding only works for multiples of a byte");for(i=0;a>=u+128;i+=4,u+=128)n=t.encrypt(s(n,e.slice(i,i+4))),c.splice(i,0,n[0],n[1],n[2],n[3]);return a=16843009*(16-(a>>3&15)),n=t.encrypt(s(n,o.concat(e,[a,a,a,a]).slice(i,i+4))),c.splice(i,0,n[0],n[1],n[2],n[3]),c},decrypt:function(t,e,n,r){if(r&&r.length)throw new le.exception.invalid("cbc can't authenticate data");if(128!==le.bitArray.bitLength(n))throw new le.exception.invalid("cbc iv must be 128 bits");if(127&le.bitArray.bitLength(e)||!e.length)throw new le.exception.corrupt("cbc ciphertext must be a positive multiple of the block size");var i,o,s,a=le.bitArray,u=a._xor4,c=[];for(r=r||[],i=0;i<e.length;i+=4)o=e.slice(i,i+4),s=u(n,t.decrypt(o)),c.splice(i,0,s[0],s[1],s[2],s[3]),n=o;if(o=255&c[i-1],0==o||o>16)throw new le.exception.corrupt("pkcs#5 padding corrupt");if(s=16843009*o,!a.equal(a.bitSlice([s,s,s,s],0,8*o),a.bitSlice(c,32*c.length-8*o,32*c.length)))throw new le.exception.corrupt("pkcs#5 padding corrupt");return a.bitSlice(c,0,32*c.length-8*o)}}},le.misc.hmac=function(t,e){this._hash=e=e||le.hash.sha256;var n,r=[[],[]],i=e.prototype.blockSize/32;for(this._baseHash=[new e,new e],t.length>i&&(t=e.hash(t)),n=0;i>n;n++)r[0][n]=909522486^t[n],r[1][n]=1549556828^t[n];this._baseHash[0].update(r[0]),this._baseHash[1].update(r[1])},le.misc.hmac.prototype.encrypt=le.misc.hmac.prototype.mac=function(t,e){var n=new this._hash(this._baseHash[0]).update(t,e).finalize();return new this._hash(this._baseHash[1]).update(n).finalize()},le.hash.sha256=function(t){this._key[0]||this._precompute(),t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},le.hash.sha256.hash=function(t){return(new le.hash.sha256).update(t).finalize()},le.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=le.codec.utf8String.toBits(t));var e,n=this._buffer=le.bitArray.concat(this._buffer,t),r=this._length,i=this._length=r+le.bitArray.bitLength(t);for(e=512+r&-512;i>=e;e+=512)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(e=le.bitArray.concat(e,[le.bitArray.partial(1,1)]),t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),n},_init:[],_key:[],_precompute:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}var e,n=0,r=2;t:for(;64>n;r++){for(e=2;r>=e*e;e++)if(r%e===0)continue t;8>n&&(this._init[n]=t(Math.pow(r,.5))),this._key[n]=t(Math.pow(r,1/3)),n++}},_block:function(t){var e,n,r,i,o=t.slice(0),s=this._h,a=this._key,u=s[0],c=s[1],l=s[2],p=s[3],h=s[4],d=s[5],f=s[6],m=s[7];for(e=0;64>e;e++)16>e?n=o[e]:(r=o[e+1&15],i=o[e+14&15],n=o[15&e]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+o[15&e]+o[e+9&15]|0),n=n+m+(h>>>6^h>>>11^h>>>25^h<<26^h<<21^h<<7)+(f^h&(d^f))+a[e],m=f,f=d,d=h,h=p+n|0,p=l,l=c,c=u,u=n+(c&l^p&(c^l))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;s[0]=s[0]+u|0,s[1]=s[1]+c|0,s[2]=s[2]+l|0,s[3]=s[3]+p|0,s[4]=s[4]+h|0,s[5]=s[5]+d|0,s[6]=s[6]+f|0,s[7]=s[7]+m|0}},le.random={randomWords:function(t,e){var n,r,i=[],o=this.isReady(e);if(o===this._NOT_READY)throw new le.exception.notReady("generator isn't seeded");for(o&this._REQUIRES_RESEED&&this._reseedFromPools(!(o&this._READY)),n=0;t>n;n+=4)(n+1)%this._MAX_WORDS_PER_BURST===0&&this._gate(),r=this._gen4words(),i.push(r[0],r[1],r[2],r[3]);return this._gate(),i.slice(0,t)},setDefaultParanoia:function(t){this._defaultParanoia=t},addEntropy:function(t,e,n){n=n||"user";var r,i,o,s=(new Date).valueOf(),a=this._robins[n],u=this.isReady(),c=0;switch(r=this._collectorIds[n],void 0===r&&(r=this._collectorIds[n]=this._collectorIdNext++),void 0===a&&(a=this._robins[n]=0),this._robins[n]=(this._robins[n]+1)%this._pools.length,typeof t){case"number":void 0===e&&(e=1),this._pools[a].update([r,this._eventId++,1,e,s,1,0|t]);break;case"object":var l=Object.prototype.toString.call(t);if("[object Uint32Array]"===l){for(o=[],i=0;i<t.length;i++)o.push(t[i]);t=o}else for("[object Array]"!==l&&(c=1),i=0;i<t.length&&!c;i++)"number"!=typeof t[i]&&(c=1);if(!c){if(void 0===e)for(e=0,i=0;i<t.length;i++)for(o=t[i];o>0;)e++,o>>>=1;this._pools[a].update([r,this._eventId++,2,e,s,t.length].concat(t))}break;case"string":void 0===e&&(e=t.length),this._pools[a].update([r,this._eventId++,3,e,s,t.length]),this._pools[a].update(t);break;default:c=1}if(c)throw new le.exception.bug("random: addEntropy only supports number, array of numbers or string");this._poolEntropy[a]+=e,this._poolStrength+=e,u===this._NOT_READY&&(this.isReady()!==this._NOT_READY&&this._fireEvent("seeded",Math.max(this._strength,this._poolStrength)),this._fireEvent("progress",this.getProgress()))},isReady:function(t){var e=this._PARANOIA_LEVELS[void 0!==t?t:this._defaultParanoia];return this._strength&&this._strength>=e?this._poolEntropy[0]>this._BITS_PER_RESEED&&(new Date).valueOf()>this._nextReseed?this._REQUIRES_RESEED|this._READY:this._READY:this._poolStrength>=e?this._REQUIRES_RESEED|this._NOT_READY:this._NOT_READY},getProgress:function(t){var e=this._PARANOIA_LEVELS[t?t:this._defaultParanoia];return this._strength>=e?1:this._poolStrength>e?1:this._poolStrength/e},startCollectors:function(){if(!this._collectorsStarted){if(window.addEventListener)window.addEventListener("load",this._loadTimeCollector,!1),window.addEventListener("mousemove",this._mouseCollector,!1);else{if(!document.attachEvent)throw new le.exception.bug("can't attach event");document.attachEvent("onload",this._loadTimeCollector),document.attachEvent("onmousemove",this._mouseCollector)}this._collectorsStarted=!0}},stopCollectors:function(){this._collectorsStarted&&(window.removeEventListener?(window.removeEventListener("load",this._loadTimeCollector,!1),window.removeEventListener("mousemove",this._mouseCollector,!1)):window.detachEvent&&(window.detachEvent("onload",this._loadTimeCollector),window.detachEvent("onmousemove",this._mouseCollector)),this._collectorsStarted=!1)},addEventListener:function(t,e){this._callbacks[t][this._callbackI++]=e},removeEventListener:function(t,e){var n,r,i=this._callbacks[t],o=[];for(r in i)i.hasOwnProperty(r)&&i[r]===e&&o.push(r);for(n=0;n<o.length;n++)r=o[n],delete i[r]},_pools:[new le.hash.sha256],_poolEntropy:[0],_reseedCount:0,_robins:{},_eventId:0,_collectorIds:{},_collectorIdNext:0,_strength:0,_poolStrength:0,_nextReseed:0,_key:[0,0,0,0,0,0,0,0],_counter:[0,0,0,0],_cipher:void 0,_defaultParanoia:6,_collectorsStarted:!1,_callbacks:{progress:{},seeded:{}},_callbackI:0,_NOT_READY:0,_READY:1,_REQUIRES_RESEED:2,_MAX_WORDS_PER_BURST:65536,_PARANOIA_LEVELS:[0,48,64,96,128,192,256,384,512,768,1024],_MILLISECONDS_PER_RESEED:3e4,_BITS_PER_RESEED:80,_gen4words:function(){for(var t=0;4>t&&(this._counter[t]=this._counter[t]+1|0,!this._counter[t]);t++);return this._cipher.encrypt(this._counter)},_gate:function(){this._key=this._gen4words().concat(this._gen4words()),this._cipher=new le.cipher.aes(this._key)},_reseed:function(t){this._key=le.hash.sha256.hash(this._key.concat(t)),this._cipher=new le.cipher.aes(this._key);for(var e=0;4>e&&(this._counter[e]=this._counter[e]+1|0,!this._counter[e]);e++);},_reseedFromPools:function(t){var e,n=[],r=0;for(this._nextReseed=n[0]=(new Date).valueOf()+this._MILLISECONDS_PER_RESEED,e=0;16>e;e++)n.push(4294967296*Math.random()|0);for(e=0;e<this._pools.length&&(n=n.concat(this._pools[e].finalize()),r+=this._poolEntropy[e],this._poolEntropy[e]=0,t||!(this._reseedCount&1<<e));e++);this._reseedCount>=1<<this._pools.length&&(this._pools.push(new le.hash.sha256),this._poolEntropy.push(0)),this._poolStrength-=r,r>this._strength&&(this._strength=r),this._reseedCount++,this._reseed(n)},_mouseCollector:function(t){var e=t.x||t.clientX||t.offsetX||0,n=t.y||t.clientY||t.offsetY||0;le.random.addEntropy([e,n],2,"mouse")},_loadTimeCollector:function(){le.random.addEntropy((new Date).valueOf(),2,"loadtime")},_fireEvent:function(t,e){var n,r=le.random._callbacks[t],i=[];for(n in r)r.hasOwnProperty(n)&&i.push(r[n]);for(n=0;n<i.length;n++)i[n](e)}},function(){try{var t=new Uint32Array(32);crypto.getRandomValues(t),le.random.addEntropy(t,1024,"crypto.getRandomValues")}catch(e){}}(),function(){for(var t in le.beware)le.beware.hasOwnProperty(t)&&le.beware[t]()}();var pe={sjcl:le,version:"1.3.10"};pe.generateAesKey=function(){return{key:le.random.randomWords(8,0),encrypt:function(t){return this.encryptWithIv(t,le.random.randomWords(4,0))},encryptWithIv:function(t,e){var n=new le.cipher.aes(this.key),r=le.codec.utf8String.toBits(t),i=le.mode.cbc.encrypt(n,r,e),o=le.bitArray.concat(e,i);return le.codec.base64.fromBits(o)}}},pe.create=function(t){return new pe.EncryptionClient(t)},pe.EncryptionClient=function(t){var r=this,o=[];r.publicKey=t,r.version=pe.version;var s=function(t,e){var n,r,i;n=document.createElement(t);for(r in e)e.hasOwnProperty(r)&&(i=e[r],n.setAttribute(r,i));return n},a=function(t){return window.jQuery&&t instanceof jQuery?t[0]:t.nodeType&&1===t.nodeType?t:document.getElementById(t)},u=function(t){var e,n,r,i,o=[];if("INTEGER"===t.typeName()&&(e=t.posContent(),n=t.posEnd(),r=t.stream.hexDump(e,n).replace(/[ \n]/g,""),o.push(r)),null!==t.sub)for(i=0;i<t.sub.length;i++)o=o.concat(u(t.sub[i]));return o},c=function(t){var e,n,r=[],i=t.children;for(n=0;n<i.length;n++)e=i[n],1===e.nodeType&&e.attributes["data-encrypted-name"]?r.push(e):e.children&&e.children.length>0&&(r=r.concat(c(e)));return r},l=function(){var n,r,o,s,a,c;try{a=i(t),n=e.decode(a)}catch(l){throw"Invalid encryption key. Please use the key labeled 'Client-Side Encryption Key'"}if(o=u(n),2!==o.length)throw"Invalid encryption key. Please use the key labeled 'Client-Side Encryption Key'";return s=o[0],r=o[1],c=new $,c.setPublic(s,r),c},p=function(){return{key:le.random.randomWords(8,0),sign:function(t){var e=new le.misc.hmac(this.key,le.hash.sha256),n=e.encrypt(t);return le.codec.base64.fromBits(n)}}};r.encrypt=function(t){var e=l(),i=pe.generateAesKey(),o=p(),s=i.encrypt(t),a=o.sign(le.codec.base64.toBits(s)),u=le.bitArray.concat(i.key,o.key),c=le.codec.base64.fromBits(u),h=e.encrypt(c),d="$bt4|javascript_"+r.version.replace(/\./g,"_")+"$",f=null;return h&&(f=n(h)),d+f+"$"+s+"$"+a},r.encryptForm=function(t){var e,n,i,u,l,p;for(t=a(t),p=c(t);o.length>0;){try{t.removeChild(o[0])}catch(h){}o.splice(0,1)}for(l=0;l<p.length;l++)e=p[l],i=e.getAttribute("data-encrypted-name"),n=r.encrypt(e.value),e.removeAttribute("name"),u=s("input",{value:n,type:"hidden",name:i}),o.push(u),t.appendChild(u)},r.onSubmitEncryptForm=function(t,e){var n;t=a(t),n=function(n){return r.encryptForm(t),e?e(n):n},window.jQuery?window.jQuery(t).submit(n):t.addEventListener?t.addEventListener("submit",n,!1):t.attachEvent&&t.attachEvent("onsubmit",n)},r.formEncrypter={encryptForm:r.encryptForm,extractForm:a,onSubmitEncryptForm:r.onSubmitEncryptForm},le.random.startCollectors()},window.Braintree=pe
2
+ }(),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.braintree=t()}}(function(){var t;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return i(n?n:e)},l,l.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e){(function(n){"use strict";function r(){}function i(t){if("CONFIGURATION"===t.type||"IMMEDIATE"===t.type)throw new Error(t.message);try{console.error(JSON.stringify(t))}catch(e){}}function o(t,e,r){var i;if(!(e in h))throw new Error(e+" is an unsupported integration");p.isFunction(r[f.ROOT_SUCCESS_CALLBACK])&&(b=function(t){r[f.ROOT_SUCCESS_CALLBACK](g(t))}),p.isFunction(r[f.ROOT_ERROR_CALLBACK])&&(_=r[f.ROOT_ERROR_CALLBACK]),p.isFunction(r[f.ROOT_READY_CALLBACK])&&(v=r[f.ROOT_READY_CALLBACK]),m(v),d.on(d.events.ERROR,_),d.on(d.events.PAYMENT_METHOD_RECEIVED,b),d.on(d.events.WARNING,function(t){try{console.warn(t)}catch(e){}}),i={clientToken:t,integrationType:e,merchantConfiguration:r,analyticsConfiguration:{sdkVersion:"braintree/web"+s,merchantAppId:n.location.host}},a._getConfiguration(i,function(t,n){return t?void d.emit(d.events.ERROR,{message:t.errors}):(i.gatewayConfiguration=n,y(i),d.on(d.events.CONFIGURATION_REQUEST,function(t){t({enableCORS:i.merchantConfiguration.enableCORS,configuration:i.gatewayConfiguration,integration:i.integrationType,analyticsConfiguration:i.analyticsConfiguration})}),d.emit(d.events.ASYNC_DEPENDENCY_INITIALIZING),h[e].initialize(i),void d.emit(d.events.ASYNC_DEPENDENCY_READY))})}var s="2.11.2",a=t("braintree-api"),u=t("braintree-paypal"),c=t("braintree-dropin"),l=t("braintree-form"),p=t("braintree-utilities"),h=t("./integrations"),d=t("braintree-bus"),f=t("./constants"),m=t("./lib/dependency-ready"),g=t("./lib/sanitize-payload"),y=t("./lib/analytics-sender").listenForAnalytics,b=r,v=r,_=i;e.exports={api:a,cse:n.Braintree,paypal:u,dropin:c,Form:l,setup:o,VERSION:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./constants":358,"./integrations":362,"./lib/analytics-sender":364,"./lib/dependency-ready":365,"./lib/sanitize-payload":366,"braintree-api":21,"braintree-bus":50,"braintree-dropin":246,"braintree-form":256,"braintree-paypal":324,"braintree-utilities":344}],2:[function(t,e){(function(n){"use strict";function r(t){var e=t.analyticsConfiguration||{},r=n.braintree?n.braintree.VERSION:null,i=r?"braintree/web/"+r:"";return{sdkVersion:e.sdkVersion||i,merchantAppId:e.merchantAppId||n.location.host}}function i(t){var e,n,i;this.attrs={},t.hasOwnProperty("sharedCustomerIdentifier")&&(this.attrs.sharedCustomerIdentifier=t.sharedCustomerIdentifier),e=a(t.clientToken),i=r(t),this.driver=t.driver||m({enableCORS:g(t)}),this.analyticsUrl=e.analytics?e.analytics.url:void 0,this.clientApiUrl=e.clientApiUrl,this.customerId=t.customerId,this.challenges=e.challenges,this.integration=t.integration||"",this.sdkVersion=i.sdkVersion,this.merchantAppId=i.merchantAppId,n=s.create(this,{container:t.container,clientToken:e}),this.verify3DS=o.bind(n.verify,n),this.attrs.authorizationFingerprint=e.authorizationFingerprint,this.attrs.sharedCustomerIdentifierType=t.sharedCustomerIdentifierType,e.merchantAccountId&&(this.attrs.merchantAccountId=e.merchantAccountId),this.requestTimeout=t.hasOwnProperty("timeout")?t.timeout:6e4}var o=t("braintree-utilities"),s=t("braintree-3ds"),a=t("./parse-client-token"),u=t("./util"),c=t("./sepa-mandate"),l=t("./europe-bank-account"),p=t("./credit-card"),h=t("./coinbase-account"),d=t("./paypal-account"),f=t("./normalize-api-fields").normalizeCreditCardFields,m=t("./request/choose-driver"),g=t("./should-enable-cors");i.prototype.getCreditCards=function(t){this.driver.get(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods"]),this.attrs,function(t){var e=0,n=t.paymentMethods.length,r=[];for(e;n>e;e++)r.push(new p(t.paymentMethods[e]));return r},t,this.requestTimeout)},i.prototype.tokenizeCoinbase=function(t,e){t.options={validate:!1},this.addCoinbase(t,function(t,n){t?e(t,null):n&&n.nonce?e(t,n):e("Unable to tokenize coinbase account.",null)})},i.prototype.tokenizePayPalAccount=function(t,e){t.options={validate:!1},this.addPayPalAccount(t,function(t,n){t?e(t,null):n&&n.nonce?e(null,n):e("Unable to tokenize paypal account.",null)})},i.prototype.tokenizeCard=function(t,e){t.options={validate:!1},this.addCreditCard(t,function(t,n){n&&n.nonce?e(t,n.nonce,{type:n.type,details:n.details}):e("Unable to tokenize card.",null)})},i.prototype.lookup3DS=function(t,e){var n=u.joinUrlFragments([this.clientApiUrl,"v1/payment_methods",t.nonce,"three_d_secure/lookup"]),r=u.mergeOptions(this.attrs,{amount:t.amount});this.driver.post(n,r,function(t){return t},e,this.requestTimeout)},i.prototype.createSEPAMandate=function(t,e){var n=u.mergeOptions(this.attrs,{sepaMandate:t});this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","sepa_mandates.json"]),n,function(t){return{sepaMandate:new c(t.europeBankAccounts[0].sepaMandates[0]),sepaBankAccount:new l(t.europeBankAccounts[0])}},e,this.requestTimeout)},i.prototype.getSEPAMandate=function(t,e){var n=u.mergeOptions(this.attrs,t);this.driver.get(u.joinUrlFragments([this.clientApiUrl,"v1","sepa_mandates.json"]),n,function(t){return{sepaMandate:new c(t.sepaMandates[0])}},e,this.requestTimeout)},i.prototype.addCoinbase=function(t,e){var n;delete t.share,n=u.mergeOptions(this.attrs,{coinbaseAccount:t,_meta:{integration:this.integration||"custom",source:"coinbase"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/coinbase_accounts"]),n,function(t){return new h(t.coinbaseAccounts[0])},e,this.requestTimeout)},i.prototype.addPayPalAccount=function(t,e){var n;delete t.share,n=u.mergeOptions(this.attrs,{paypalAccount:t,_meta:{integration:this.integration||"paypal",source:"paypal"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods","paypal_accounts"]),n,function(t){return new d(t.paypalAccounts[0])},e,this.requestTimeout)},i.prototype.addCreditCard=function(t,e){var n,r,i=t.share;delete t.share,r=f(t),n=u.mergeOptions(this.attrs,{share:i,creditCard:r,_meta:{integration:this.integration||"custom",source:"form"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/credit_cards"]),n,function(t){return new p(t.creditCards[0])},e,this.requestTimeout)},i.prototype.sendAnalyticsEvents=function(t,e){var r,i,o=this.analyticsUrl,s=[];if(t=u.isArray(t)?t:[t],!o)return void(e&&e.apply(null,[null,{}]));for(i in t)t.hasOwnProperty(i)&&s.push({kind:t[i]});r=u.mergeOptions(this.attrs,{braintree_library_version:this.sdkVersion,analytics:s,_meta:{merchantAppId:this.merchantAppId,platform:"web",platformVersion:n.navigator.userAgent,integrationType:this.integration,sdkVersion:this.sdkVersion}}),this.driver.post(o,r,function(t){return t},e,this.requestTimeout)},i.prototype.decryptBrowserswitchPayload=function(t,e){var n=u.mergeOptions(this.attrs,{asymmetric_encrypted_payload:t}),r=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/decrypt"]);this.driver.post(r,n,function(t){return t},e,this.requestTimeout)},i.prototype.encryptBrowserswitchReturnPayload=function(t,e,n){var r=u.mergeOptions(this.attrs,{payload:t,aesKey:e}),i=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/encrypt"]);this.driver.post(i,r,function(t){return t},n,this.requestTimeout)},i.prototype.exchangePaypalTokenForConsentCode=function(t,e){var n=u.mergeOptions(this.attrs,t);this.attrs.merchantAccountId&&(n.merchant_account_id=this.attrs.merchantAccountId);var r=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_account_service/merchant_consent"]);this.driver.post(r,n,function(t){return t},e,this.requestTimeout)},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./coinbase-account":3,"./credit-card":5,"./europe-bank-account":6,"./normalize-api-fields":8,"./parse-client-token":9,"./paypal-account":10,"./request/choose-driver":13,"./sepa-mandate":18,"./should-enable-cors":19,"./util":20,"braintree-3ds":29,"braintree-utilities":41}],3:[function(t,e){"use strict";function n(t){var e,n;for(e=0;e<r.length;e++)n=r[e],this[n]=t[n]}var r=["nonce","type","description","details"];e.exports=n},{}],4:[function(t,e){e.exports={errors:{UNKNOWN_ERROR:"Unknown error",INVALID_TIMEOUT:"Timeout must be a number"}}},{}],5:[function(t,e){"use strict";function n(t){var e,n;for(e=0;e<r.length;e++)n=r[e],this[n]=t[n]}var r=["billingAddress","branding","createdAt","createdAtMerchant","createdAtMerchantName","details","isLocked","lastUsedAt","lastUsedAtMerchant","lastUsedAtMerchantName","lastUsedByCurrentMerchant","nonce","securityQuestions","type"];e.exports=n},{}],6:[function(t,e){"use strict";function n(t){var e,n=["bic","maskedIBAN","nonce","accountHolderName"],r=0;for(r=0;r<n.length;r++)e=n[r],this[e]=t[e]}e.exports=n},{}],7:[function(t,e){"use strict";function n(t,e){var n=r(t.clientToken),a={authorizationFingerprint:n.authorizationFingerprint},u=o({enableCORS:s(t)});u.get(n.configUrl,a,function(t){return i.mergeOptions(n,t)},e,t.timeout)}var r=t("./parse-client-token"),i=t("./util"),o=t("./request/choose-driver"),s=t("./should-enable-cors");e.exports=n},{"./parse-client-token":9,"./request/choose-driver":13,"./should-enable-cors":19,"./util":20}],8:[function(t,e){"use strict";function n(t){var e,n={billingAddress:t.billingAddress||{}};for(e in t)if(t.hasOwnProperty(e))switch(e.replace(/_/,"").toLowerCase()){case"postalcode":case"countryname":case"countrycodenumeric":case"countrycodealpha2":case"countrycodealpha3":case"region":case"extendedaddress":case"locality":case"firstname":case"lastname":case"company":case"streetaddress":n.billingAddress[e]=t[e];break;default:n[e]=t[e]}return n}e.exports={normalizeCreditCardFields:n}},{}],9:[function(t,e){"use strict";function n(t){var e;if(!t)throw new Error("Braintree API Client Misconfigured: clientToken required.");if("object"==typeof t&&null!==t)e=t;else{try{t=window.atob(t)}catch(n){}try{e=JSON.parse(t)}catch(i){throw new Error("Braintree API Client Misconfigured: clientToken is not valid JSON.")}}if(!e.hasOwnProperty("clientApiUrl")||!r.isWhitelistedDomain(e.clientApiUrl))throw new Error("Braintree API Client Misconfigured: the clientApiUrl provided in the clientToken is invalid.");return e}var r=t("braintree-utilities");t("./polyfill"),e.exports=n},{"./polyfill":11,"braintree-utilities":41}],10:[function(t,e){"use strict";function n(t){var e,n;for(e=0;e<r.length;e++)n=r[e],this[n]=t[n]}var r=["nonce","type","description","details"];e.exports=n},{}],11:[function(t,e){(function(t){"use strict";var n=function(t){var e=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="";if(!e.test(t))throw new Error("Non base64 encoded input passed to window.atob polyfill");var i=0;do{var o=n.indexOf(t.charAt(i++)),s=n.indexOf(t.charAt(i++)),a=n.indexOf(t.charAt(i++)),u=n.indexOf(t.charAt(i++)),c=(63&o)<<2|s>>4&3,l=(15&s)<<4|a>>2&15,p=(3&a)<<6|63&u;r+=String.fromCharCode(c)+(l?String.fromCharCode(l):"")+(p?String.fromCharCode(p):"")}while(i<t.length);return r};t.atob=t.atob||n,e.exports={atobPolyfill:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(t,e){(function(n){"use strict";function r(){return p?new XMLHttpRequest:new XDomainRequest}function i(t,e,n,r,i){var o=a.createURLParams(t,e);s("GET",o,null,n,r,i)}function o(t,e,n,r,i){s("POST",t,e,n,r,i)}function s(t,e,n,i,o,s){var a,h,d=r();o=o||function(){},p?d.onreadystatechange=function(){4===d.readyState&&(a=d.status,h=c(d.responseText),a>=400||0===a?o.call(null,h||{errors:l.errors.UNKNOWN_ERROR},null):a>0&&o.call(null,null,i(h)))}:(d.onload=function(){o.call(null,null,i(c(d.responseText)))},d.onerror=function(){o.call(null,d.responseText,null)},d.onprogress=function(){},d.ontimeout=function(){o.call(null,{errors:l.errors.UNKNOWN_ERROR},null)}),d.open(t,e,!0),d.timeout=null==s?6e4:s,p&&"POST"===t&&d.setRequestHeader("Content-Type","application/json"),setTimeout(function(){d.send(u(t,n))},0)}var a=t("../util"),u=t("./prep-body"),c=t("./parse-body"),l=t("../constants"),p=n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest;e.exports={get:i,post:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants":4,"../util":20,"./parse-body":16,"./prep-body":17}],13:[function(t,e){"use strict";function n(t){var e=o.getUserAgent(),n=!(o.isHTTP()&&/(MSIE\s(8|9))|(Phantom)/.test(e));return t=t||{},t.enableCORS&&n?i:r}var r=t("./jsonp-driver"),i=t("./ajax-driver"),o=t("../util");e.exports=n},{"../util":20,"./ajax-driver":12,"./jsonp-driver":14}],14:[function(t,e){"use strict";function n(t,e){return t.status>=400?[t,null]:[null,e(t)]}function r(){}function i(t,e,i,o,s,a){var l;s=s||r,null==a&&(a=6e4),l=o(t,e,function(t,e){c[e]&&(clearTimeout(c[e]),s.apply(null,n(t,function(t){return i(t)})))}),"number"==typeof a?c[l]=setTimeout(function(){c[l]=null,s.apply(null,[{errors:u.errors.UNKNOWN_ERROR},null])},a):s.apply(null,[{errors:u.errors.INVALID_TIMEOUT},null])}function o(t,e,n,r,o){e._method="POST",i(t,e,n,a.get,r,o)}function s(t,e,n,r,o){i(t,e,n,a.get,r,o)}var a=t("./jsonp"),u=t("../constants"),c=[];e.exports={get:s,post:o}},{"../constants":4,"./jsonp":15}],15:[function(t,e){(function(n){"use strict";function r(t,e){var n=document.createElement("script"),r=!1;n.src=t,n.async=!0;var i=e||c.error;"function"==typeof i&&(n.onerror=function(e){i({url:t,event:e})}),n.onload=n.onreadystatechange=function(){r||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r=!0,n.onload=n.onreadystatechange=null,n&&n.parentNode&&n.parentNode.removeChild(n))},s||(s=document.getElementsByTagName("head")[0]),s.appendChild(n)}function i(t,e,n,i){var o,s;return i=i||c.callbackName||"callback",s=i+"_json"+a.generateUUID(),e[i]=s,o=a.createURLParams(t,e),u[s]=function(t){n(t,s);try{delete u[s]}catch(e){}u[s]=null},r(o),s}function o(t){c=t}var s,a=t("../util"),u=n,c={};e.exports={get:i,init:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../util":20}],16:[function(t,e){"use strict";e.exports=function(t){try{t=JSON.parse(t)}catch(e){}return t}},{}],17:[function(t,e){"use strict";var n=t("lodash.isstring");e.exports=function(t,e){if(!n(t))throw new Error("Method must be a string");return"get"!==t.toLowerCase()&&null!=e&&(e=n(e)?e:JSON.stringify(e)),e}},{"lodash.isstring":49}],18:[function(t,e){"use strict";function n(t){var e,n=0,r=["accountHolderName","bic","longFormURL","mandateReferenceNumber","maskedIBAN","shortForm"];for(n=0;n<r.length;n++)e=r[n],this[e]=t[e]}e.exports=n},{}],19:[function(t,e){"use strict";e.exports=function(t){return null!=t.enableCORS?t.enableCORS:t.merchantConfiguration?t.merchantConfiguration.enableCORS:!1}},{}],20:[function(t,e){(function(n){"use strict";function r(t){var e,n,r=[];for(n=0;n<t.length;n++)e=t[n],"/"===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),"/"===e.charAt(0)&&(e=e.substring(1)),r.push(e);return r.join("/")}function i(t){return t&&"object"==typeof t&&"number"==typeof t.length&&"[object Array]"===Object.prototype.toString.call(t)||!1}function o(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.floor(16*Math.random()),n="x"===t?e:3&e|8;return n.toString(16)})}function s(t,e){var n,r={};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return r}function a(t,e){var n,r,o,s=[];for(o in t)t.hasOwnProperty(o)&&(r=t[o],n=e?i(t)?e+"[]":e+"["+o+"]":o,s.push("object"==typeof r?a(r,n):encodeURIComponent(n)+"="+encodeURIComponent(r)));return s.join("&")}function u(t,e){return t=t||"",!p(e)&&h(e)&&(t+=-1===t.indexOf("?")?"?":"",t+=-1!==t.indexOf("=")?"&":"",t+=a(e)),t}function c(){return n.navigator.userAgent}function l(){return"http:"===n.location.protocol}var p=t("lodash.isempty"),h=t("lodash.isobject");e.exports={joinUrlFragments:r,isArray:i,generateUUID:o,mergeOptions:s,stringify:a,createURLParams:u,getUserAgent:c,isHTTP:l}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash.isempty":42,"lodash.isobject":48}],21:[function(t,e){"use strict";function n(t){return new r(t)}var r=t("./lib/client"),i=t("./lib/util"),o=t("./lib/parse-client-token"),s=t("./lib/get-configuration");e.exports={Client:r,configure:n,util:i,parseClientToken:o,_getConfiguration:s}},{"./lib/client":2,"./lib/get-configuration":7,"./lib/parse-client-token":9,"./lib/util":20}],22:[function(t,e){"use strict";function n(t,e){if(e=e||"["+t+"] is not a valid DOM Element",t&&t.nodeType&&1===t.nodeType)return t;if(t&&window.jQuery&&(t instanceof jQuery||"jquery"in Object(t))&&0!==t.length)return t[0];if("string"==typeof t&&document.getElementById(t))return document.getElementById(t);throw new Error(e)}e.exports={normalizeElement:n}},{}],23:[function(t,e){"use strict";function n(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on"+e,n)}function r(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r):t.detachEvent&&t.detachEvent("on"+e,n)}e.exports={addEventListener:n,removeEventListener:r}},{}],24:[function(t,e){"use strict";function n(t){return"[object Function]"===i.call(t)}function r(t,e){return function(){t.apply(e,arguments)}}var i=Object.prototype.toString;e.exports={bind:r,isFunction:n}},{}],25:[function(t,e){"use strict";function n(){return"https:"===window.location.protocol}function r(t){switch(t){case null:case void 0:return"";case!0:return"1";case!1:return"0";default:return encodeURIComponent(t)}}function i(t,e){var n,o,s=[];for(o in t)if(t.hasOwnProperty(o)){var a=t[o];n=e?e+"["+o+"]":o,"object"==typeof a?s.push(i(a,n)):void 0!==a&&null!==a&&s.push(r(n)+"="+r(a))}return s.join("&")}function o(t){for(var e={},n=t.split("&"),r=0;r<n.length;r++){var i=n[r].split("="),o=i[0],s=decodeURIComponent(i[1]);e[o]=s}return e}function s(t){var e=t.split("?");return 2!==e.length?{}:o(e[1])}e.exports={isBrowserHttps:n,makeQueryString:i,decodeQueryString:o,getParams:s}},{}],26:[function(t,e){var n=t("./lib/dom"),r=t("./lib/url"),i=t("./lib/fn"),o=t("./lib/events");e.exports={normalizeElement:n.normalizeElement,isBrowserHttps:r.isBrowserHttps,makeQueryString:r.makeQueryString,decodeQueryString:r.decodeQueryString,getParams:r.getParams,removeEventListener:o.removeEventListener,addEventListener:o.addEventListener,bind:i.bind,isFunction:i.isFunction}},{"./lib/dom":22,"./lib/events":23,"./lib/fn":24,"./lib/url":25}],27:[function(t,e){"use strict";function n(t,e){var n=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return n[e]}function r(){return{html:{height:o.style.height||"",overflow:n(o,"overflow"),position:n(o,"position")},body:{height:s.style.height||"",overflow:n(s,"overflow")}}}function i(t,e){this.assetsUrl=t,this.container=e||document.body,this.iframe=null,o=document.documentElement,s=document.body,this.merchantPageDefaultStyles=r()}var o,s,a=t("braintree-utilities"),u=t("../shared/receiver"),c="1.3.0";i.prototype.get=function(t,e){var n=this,r=this.constructAuthorizationURL(t);this.container&&a.isFunction(this.container)?this.container(r+"&no_style=1"):this.insertIframe(r),new u(function(t){a.isFunction(n.container)||n.removeIframe(),e(t)})},i.prototype.removeIframe=function(){this.container&&this.container.nodeType&&1===this.container.nodeType?this.container.removeChild(this.iframe):this.container&&window.jQuery&&this.container instanceof jQuery?$(this.iframe,this.container).remove():"string"==typeof this.container&&document.getElementById(this.container).removeChild(this.iframe),this.unlockMerchantWindowSize()},i.prototype.insertIframe=function(t){var e=document.createElement("iframe");if(e.src=t,this.applyStyles(e),this.lockMerchantWindowSize(),this.container&&this.container.nodeType&&1===this.container.nodeType)this.container.appendChild(e);else if(this.container&&window.jQuery&&this.container instanceof jQuery&&0!==this.container.length)this.container.append(e);else{if("string"!=typeof this.container||!document.getElementById(this.container))throw new Error("Unable to find valid container for iframe.");document.getElementById(this.container).appendChild(e)}this.iframe=e},i.prototype.applyStyles=function(t){t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.height="100%",t.style.width="100%",t.setAttribute("frameborder","0"),t.setAttribute("allowTransparency","true"),t.style.border="0",t.style.zIndex="99999"},i.prototype.lockMerchantWindowSize=function(){o.style.overflow="hidden",s.style.overflow="hidden",s.style.height="100%"},i.prototype.unlockMerchantWindowSize=function(){var t=this.merchantPageDefaultStyles;s.style.height=t.body.height,s.style.overflow=t.body.overflow,o.style.overflow=t.html.overflow},i.prototype.constructAuthorizationURL=function(t){var e,n=window.location.href;return n.indexOf("#")>-1&&(n=n.split("#")[0]),e=a.makeQueryString({acsUrl:t.acsUrl,pareq:t.pareq,termUrl:t.termUrl+"&three_d_secure_version="+c,md:t.md,parentUrl:n}),this.assetsUrl+"/3ds/"+c+"/html/style_frame?"+e},e.exports=i},{"../shared/receiver":34,"braintree-utilities":26}],28:[function(t,e){"use strict";function n(){}function r(t,e){e=e||{},this.clientToken=e.clientToken,this.container=e.container,this.api=t,this.nonce=null,this._loader=null,this._boundHandleUserClose=i.bind(this._handleUserClose,this)}var i=t("braintree-utilities"),o=t("./authorization_service"),s=t("./loader");r.prototype.verify=function(t,e){if(!i.isFunction(e))throw this.api.sendAnalyticsEvents("3ds.web.no_callback"),new Error("No suitable callback argument was given");i.isFunction(t.onUserClose)&&(this._onUserClose=t.onUserClose),i.isFunction(t.onLookupComplete)&&(this._onLookupComplete=t.onLookupComplete),(void 0===t.useDefaultLoader||t.useDefaultLoader===!0)&&this._createDefaultLoader();var n={nonce:"",amount:t.amount},r=t.creditCard;if("string"==typeof r)n.nonce=r,this.api.sendAnalyticsEvents("3ds.web.verify.nonce"),this.startVerification(n,e);else{var o=this,s=function(t,r){return t?(o._removeDefaultLoader(),e(t)):(n.nonce=r,void o.startVerification(n,e))};this.api.sendAnalyticsEvents("3ds.web.verify.credit_card"),this.api.tokenizeCard(r,s)}},r.prototype.startVerification=function(t,e){this.api.lookup3DS(t,i.bind(this.handleLookupResponse(e),this))},r.prototype.handleLookupResponse=function(t){var e=this;return function(n,r){var s;this._onLookupComplete(),n?t(n.error):r.lookup&&r.lookup.acsUrl&&r.lookup.acsUrl.length>0?(e.nonce=r.paymentMethod.nonce,s=new o(this.clientToken.assetsUrl,this.container),s.get(r.lookup,i.bind(this.handleAuthenticationResponse(t),this)),this._detachListeners(),this._attachListeners()):(e.nonce=r.paymentMethod.nonce,t(null,{nonce:e.nonce,verificationDetails:r.threeDSecureInfo}))}},r.prototype.handleAuthenticationResponse=function(t){return function(e){var n,r=i.decodeQueryString(e);r.user_closed||(n=JSON.parse(r.auth_response),n.success?t(null,{nonce:n.paymentMethod.nonce,verificationDetails:n.threeDSecureInfo}):n.threeDSecureInfo&&n.threeDSecureInfo.liabilityShiftPossible?t(null,{nonce:this.nonce,verificationDetails:n.threeDSecureInfo}):t(n.error))}},r.prototype._attachListeners=function(){i.addEventListener(window,"message",this._boundHandleUserClose)},r.prototype._detachListeners=function(){i.removeEventListener(window,"message",this._boundHandleUserClose)},r.prototype._createDefaultLoader=function(){this._loader=new s,document.body.appendChild(this._loader.getElement())},r.prototype._removeDefaultLoader=function(){if(this._loader){var t=this._loader.getElement(),e=t.parentNode;e&&e.removeChild(t),this._loader.dispose(),this._loader=null}},r.prototype._handleUserClose=function(t){"user_closed=true"===t.data&&this._onUserClose()},r.prototype._onUserClose=n,r.prototype._onLookupComplete=function(){this._removeDefaultLoader()},e.exports=r},{"./authorization_service":27,"./loader":30,"braintree-utilities":26}],29:[function(t,e){"use strict";var n=t("./client");e.exports={create:function(t,e){var r=new n(t,e);return r}}},{"./client":28}],30:[function(t,e){"use strict";function n(){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._display=null,this._initialize()}var r=t("./loader_display"),i=t("./loader_message"),o=t("./loader_spinner");n.prototype._cssDeclarations=["filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#7F000000, EndColorStr=#7F000000)","background-color: rgba(0, 0, 0, 0.5)","display: table","height: 100%","left: 0","position: fixed","right: 0","top: 0","width: 100%","z-index: 99999"].join(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._display.dispose(),this._display=null,this._element=null},n.prototype._initialize=function(){var t=new o,e=window.SVGElement&&window.SVGAnimateElement&&window.SVGAnimateTransformElement;e||(t=new i("Loading...")),this._display=new r(t),this.getElement().appendChild(this._display.getElement())},e.exports=n},{"./loader_display":31,"./loader_message":32,"./loader_spinner":33}],31:[function(t,e){"use strict";function n(t){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._displayObject=t,this._initialize()}n.prototype._cssDeclarations=["display: table-cell","vertical-align: middle"].join(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._displayObject.dispose(),this._displayObject=null,this._element=null},n.prototype._initialize=function(){this.getElement().appendChild(this._displayObject.getElement())},e.exports=n},{}],32:[function(t,e){"use strict";function n(t){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._element.innerHTML=t}n.prototype._cssDeclarations=["color: #fff","font-family: Helvetica, sans-serif","font-size: 12px","text-align: center"].join(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._element=null},e.exports=n},{}],33:[function(t,e){"use strict";function n(){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._element.innerHTML=this._markup}n.prototype._cssDeclarations=["height: 36px","margin-left: auto","margin-right: auto","width: 36px"].join(";"),n.prototype._markup=['<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"','width="100%" height="100%" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">',' <path fill="#FFF" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">',' <animateTransform attributeType="xml"',' attributeName="transform"',' type="rotate"',' from="0 25 25"',' to="360 25 25"',' dur="780ms"',' repeatCount="indefinite"',' calcMode="spline"',' keySplines="0.44, 0.22, 0, 1"',' keyTimes="0;1"/>'," </path>","</svg>"].join(""),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._element=null},e.exports=n},{}],34:[function(t,e){"use strict";function n(t){this.postMessageReceiver(t),this.hashChangeReceiver(t)}var r=t("braintree-utilities");n.prototype.postMessageReceiver=function(t){var e=this;this.wrappedCallback=function(n){var r=n.data;(/^(auth_response=)/.test(r)||"user_closed=true"===r)&&(t(r),e.stopListening())},r.addEventListener(window,"message",this.wrappedCallback)},n.prototype.hashChangeReceiver=function(t){var e,n=window.location.hash,r=this;this.poll=setInterval(function(){e=window.location.hash,e.length>0&&e!==n&&(r.stopListening(),e=e.substring(1,e.length),t(e),window.location.hash=n.length>0?n:"")},10)},n.prototype.stopListening=function(){clearTimeout(this.poll),r.removeEventListener(window,"message",this.wrappedCallback)},e.exports=n},{"braintree-utilities":26}],35:[function(t,e){"use strict";var n,r=Array.prototype.indexOf;n=r?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},e.exports={indexOf:n}},{}],36:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],37:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],38:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],39:[function(t,e){"use strict";function n(t){var e,n,r,i,o=[{min:0,max:180,chars:7},{min:181,max:620,chars:14},{min:621,max:960,chars:22}];for(i=o.length,t=t||window.innerWidth,n=0;i>n;n++)r=o[n],t>=r.min&&t<=r.max&&(e=r.chars);return e||60}function r(t,e){var n,r;return-1===t.indexOf("@")?t:(t=t.split("@"),n=t[0],r=t[1],n.length>e&&(n=n.slice(0,e)+"..."),r.length>e&&(r="..."+r.slice(-e)),n+"@"+r)}e.exports={truncateEmail:r,getMaxCharLength:n}},{}],40:[function(t,e){"use strict";function n(){return"https:"===window.location.protocol}function r(t){switch(t){case null:case void 0:return"";case!0:return"1";case!1:return"0";default:return encodeURIComponent(t)}}function i(t,e){var n,o,s=[];for(o in t)if(t.hasOwnProperty(o)){var a=t[o];n=e?e+"["+o+"]":o,"object"==typeof a?s.push(i(a,n)):void 0!==a&&null!==a&&s.push(r(n)+"="+r(a))}return s.join("&")}function o(t){for(var e={},n=t.split("&"),r=0;r<n.length;r++){var i=n[r].split("="),o=i[0],s=decodeURIComponent(i[1]);e[o]=s}return e}function s(t){var e=t.split("?");return 2!==e.length?{}:o(e[1])}function a(t){if(t=t.toLowerCase(),!/^http/.test(t))return!1;c.href=t;var e=c.hostname.split("."),n=e.slice(-2).join(".");return-1===u.indexOf(l,n)?!1:!0}var u=t("./array"),c=document.createElement("a"),l=["paypal.com","braintreepayments.com","braintreegateway.com","localhost"];e.exports={isBrowserHttps:n,makeQueryString:i,decodeQueryString:o,getParams:s,isWhitelistedDomain:a}},{"./array":35}],41:[function(t,e){var n=t("./lib/dom"),r=t("./lib/url"),i=t("./lib/fn"),o=t("./lib/events"),s=t("./lib/string"),a=t("./lib/array");e.exports={string:s,array:a,normalizeElement:n.normalizeElement,isBrowserHttps:r.isBrowserHttps,makeQueryString:r.makeQueryString,decodeQueryString:r.decodeQueryString,getParams:r.getParams,isWhitelistedDomain:r.isWhitelistedDomain,removeEventListener:o.removeEventListener,addEventListener:o.addEventListener,bind:i.bind,isFunction:i.isFunction}},{"./lib/array":35,"./lib/dom":36,"./lib/events":37,"./lib/fn":38,"./lib/string":39,"./lib/url":40}],42:[function(t,e){function n(t){return!!t&&"object"==typeof t}function r(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&o(d(t))}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&h>=t}function s(t){return null==t?!0:i(t)&&(u(t)||l(t)||a(t)||n(t)&&c(t.splice))?!t.length:!p(t).length}var a=t("lodash.isarguments"),u=t("lodash.isarray"),c=t("lodash.isfunction"),l=t("lodash.isstring"),p=t("lodash.keys"),h=9007199254740991,d=r("length");e.exports=s},{"lodash.isarguments":43,"lodash.isarray":44,"lodash.isfunction":45,"lodash.isstring":49,"lodash.keys":46}],43:[function(t,e){function n(t){return!!t&&"object"==typeof t}function r(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&o(p(t))}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t
3
+ }function s(t){return n(t)&&i(t)&&u.call(t,"callee")&&!c.call(t,"callee")}var a=Object.prototype,u=a.hasOwnProperty,c=a.propertyIsEnumerable,l=9007199254740991,p=r("length");e.exports=s},{}],44:[function(t,e){function n(t){return!!t&&"object"==typeof t}function r(t,e){var n=null==t?void 0:t[e];return a(n)?n:void 0}function i(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function o(t){return s(t)&&f.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function a(t){return null==t?!1:o(t)?m.test(h.call(t)):n(t)&&l.test(t)}var u="[object Array]",c="[object Function]",l=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,d=p.hasOwnProperty,f=p.toString,m=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),y=9007199254740991,b=g||function(t){return n(t)&&i(t.length)&&f.call(t)==u};e.exports=b},{}],45:[function(t,e){function n(t){return r(t)&&s.call(t)==i}function r(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var i="[object Function]",o=Object.prototype,s=o.toString;e.exports=n},{}],46:[function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}function r(t){return null!=t&&o(y(t))}function i(t,e){return t="number"==typeof t||h.test(t)?+t:-1,e=null==e?g:e,t>-1&&t%1==0&&e>t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&g>=t}function s(t){for(var e=u(t),n=e.length,r=n&&t.length,s=!!r&&o(r)&&(p(t)||l(t)),a=-1,c=[];++a<n;){var h=e[a];(s&&i(h,r)||f.call(t,h))&&c.push(h)}return c}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){if(null==t)return[];a(t)||(t=Object(t));var e=t.length;e=e&&o(e)&&(p(t)||l(t))&&e||0;for(var n=t.constructor,r=-1,s="function"==typeof n&&n.prototype===t,u=Array(e),c=e>0;++r<e;)u[r]=r+"";for(var h in t)c&&i(h,e)||"constructor"==h&&(s||!f.call(t,h))||u.push(h);return u}var c=t("lodash._getnative"),l=t("lodash.isarguments"),p=t("lodash.isarray"),h=/^\d+$/,d=Object.prototype,f=d.hasOwnProperty,m=c(Object,"keys"),g=9007199254740991,y=n("length"),b=m?function(t){var e=null==t?void 0:t.constructor;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&r(t)?s(t):a(t)?m(t):[]}:s;e.exports=b},{"lodash._getnative":47,"lodash.isarguments":43,"lodash.isarray":44}],47:[function(t,e){function n(t){return!!t&&"object"==typeof t}function r(t,e){var n=null==t?void 0:t[e];return s(n)?n:void 0}function i(t){return o(t)&&h.call(t)==a}function o(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function s(t){return null==t?!1:i(t)?d.test(l.call(t)):n(t)&&u.test(t)}var a="[object Function]",u=/^\[object .+?Constructor\]$/,c=Object.prototype,l=Function.prototype.toString,p=c.hasOwnProperty,h=c.toString,d=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},{}],48:[function(t,e){function n(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}e.exports=n},{}],49:[function(t,e){function n(t){return!!t&&"object"==typeof t}function r(t){return"string"==typeof t||n(t)&&s.call(t)==i}var i="[object String]",o=Object.prototype,s=o.toString;e.exports=r},{}],50:[function(t,e){"use strict";var n=t("framebus");n.events=t("./lib/events"),e.exports=n},{"./lib/events":51,framebus:52}],51:[function(t,e){"use strict";for(var n=["PAYMENT_METHOD_REQUEST","PAYMENT_METHOD_RECEIVED","PAYMENT_METHOD_GENERATED","PAYMENT_METHOD_NOT_GENERATED","PAYMENT_METHOD_CANCELLED","PAYMENT_METHOD_ERROR","CONFIGURATION_REQUEST","ROOT_METADATA_REQUEST","ERROR","WARNING","UI_POPUP_DID_OPEN","UI_POPUP_DID_CLOSE","UI_POPUP_FORCE_CLOSE","ASYNC_DEPENDENCY_INITIALIZING","ASYNC_DEPENDENCY_READY","USER_FORM_SUBMIT_REQUEST","SEND_ANALYTICS_EVENTS"],r={},i=0;i<n.length;i++){var o=n[i];r[o]=o}e.exports=r},{}],52:[function(e,n,r){"use strict";!function(e,i){"object"==typeof r&&"undefined"!=typeof n?n.exports=i():"function"==typeof t&&t.amd?t([],i):e.framebus=i()}(this,function(){function t(t){return null==t?!1:null==t.Window?!1:t.constructor!==t.Window?!1:(v.push(t),!0)}function e(t){var e,n={};for(e in b)b.hasOwnProperty(e)&&(n[e]=b[e]);return n._origin=t||"*",n}function n(t){var e,n,r=o(this);return s(t)?!1:s(r)?!1:(n=Array.prototype.slice.call(arguments,1),e=a(t,n,r),e===!1?!1:(d(y.top,e,r),!0))}function r(t,e){var n=o(this);return g(t,e,n)?!1:(_[n]=_[n]||{},_[n][t]=_[n][t]||[],_[n][t].push(e),!0)}function i(t,e){var n,r,i=o(this);if(g(t,e,i))return!1;if(r=_[i]&&_[i][t],!r)return!1;for(n=0;n<r.length;n++)if(r[n]===e)return r.splice(n,1),!0;return!1}function o(t){return t&&t._origin||"*"}function s(t){return"string"!=typeof t}function a(t,e,n){var r=!1,i={event:t,origin:n},o=e[e.length-1];"function"==typeof o&&(i.reply=m(o,n),e=e.slice(0,-1)),i.args=e;try{r=E+JSON.stringify(i)}catch(s){throw new Error("Could not stringify event: "+s.message)}return r}function u(t){var e,n,r,i;if(t.data.slice(0,E.length)!==E)return!1;try{e=JSON.parse(t.data.slice(E.length))}catch(o){return!1}return null!=e.reply&&(n=t.origin,r=t.source,i=e.reply,e.reply=function(t){var e=a(i,[t],n);return e===!1?!1:void r.postMessage(e,n)},e.args.push(e.reply)),e}function c(t){y||(y=t||window,y.addEventListener?y.addEventListener("message",p,!1):y.attachEvent?y.attachEvent("onmessage",p):null===y.onmessage?y.onmessage=p:y=null)}function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"===t?e:3&e|8;return n.toString(16)})}function p(t){var e;s(t.data)||(e=u(t),e&&(h("*",e.event,e.args,t),h(t.origin,e.event,e.args,t),f(t.data,e.origin,t.source)))}function h(t,e,n,r){var i;if(_[t]&&_[t][e])for(i=0;i<_[t][e].length;i++)_[t][e][i].apply(r,n)}function d(t,e,n){var r;try{t.postMessage(e,n)}catch(i){return}for(t.opener&&!t.opener.closed&&t.opener!==y&&d(t.opener.top,e,n),r=0;r<t.frames.length;r++)d(t.frames[r],e,n)}function f(t,e,n){var r,i;for(r=v.length-1;r>=0;r--)i=v[r],i.closed===!0?v=v.slice(r,1):n!==i&&d(i.top,t,e)}function m(t,e){function n(i,o){t(i,o),b.target(e).unsubscribe(r,n)}var r=l();return b.target(e).subscribe(r,n),r}function g(t,e,n){return s(t)?!0:"function"!=typeof e?!0:s(n)?!0:!1}var y,b,v=[],_={},E="/*framebus*/";return c(),b={target:e,include:t,publish:n,pub:n,trigger:n,emit:n,subscribe:r,sub:r,on:r,unsubscribe:i,unsub:i,off:i}})},{}],53:[function(t,e){"use strict";function n(t,e){a.emit(a.events.ERROR,{type:e,message:t})}function r(t){t=t||{};var e=t.coinbase;if(null==t.apiClient)n("settings.apiClient is required for coinbase",u);else if(t.configuration.coinbaseEnabled)if(e&&(e.container||e.button))if(e.container&&e.button)n("options.coinbase.container and options.coinbase.button are mutually exclusive",u);else{if(s.isSupportedBrowser())return!0;n("Coinbase is not supported by your browser. Please consider upgrading","UNSUPPORTED_BROWSER")}else n("Either options.coinbase.container or options.coinbase.button is required for Coinbase integrations",u);else n("Coinbase is not enabled for your merchant account",u);return!1}function i(t){return r(t)?new o(t):void 0}var o=t("./lib/coinbase"),s=t("./lib/detector"),a=t("braintree-bus"),u="CONFIGURATION";e.exports={create:i}},{"./lib/coinbase":56,"./lib/detector":58,"braintree-bus":64}],54:[function(t,e){(function(t){"use strict";function n(e){return e=e||t.navigator.userAgent,/AppleWebKit\//.test(e)&&/Mobile\//.test(e)?e.replace(/.* OS ([0-9_]+) like Mac OS X.*/,"$1").replace(/_/g,"."):null}function r(e){e=e||t.navigator.userAgent;var n=null,r=/MSIE.(\d+)/.exec(e);return/Trident/.test(e)&&(n=11),r&&(n=parseInt(r[1],10)),n}function i(e){return e=e||t.navigator.userAgent,/Android/.test(e)?e.replace(/^.* Android ([0-9\.]+).*$/,"$1"):null}e.exports={ieVersion:r,iOSSafariVersion:n,androidVersion:i}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],55:[function(t,e){"use strict";function n(t,e,n){return t?(r.emit(r.events.ERROR,t.error),void n._sendAnalyticsEvent("generate.nonce.failed")):(r.emit(r.events.PAYMENT_METHOD_GENERATED,e),void n._sendAnalyticsEvent("generate.nonce.succeeded"))}var r=t("braintree-bus");e.exports={tokenize:n}},{"braintree-bus":64}],56:[function(t,e){(function(n){"use strict";function r(t){return{clientId:t.configuration.coinbase.clientId,redirectUrl:t.configuration.coinbase.redirectUrl,scopes:t.configuration.coinbase.scopes||c.SCOPES,meta:{authorizations_merchant_account:t.configuration.coinbase.merchantAccount||""}}}function i(t){var e;this.buttonId=t.coinbase.button||c.BUTTON_ID,this.apiClient=t.apiClient,this.assetsUrl=t.configuration.assetsUrl,this.environment=t.configuration.coinbase.environment,this._onOAuthSuccess=o.bind(this._onOAuthSuccess,this),this._handleButtonClick=o.bind(this._handleButtonClick,this),this.popupParams=r(t),this.redirectDoneInterval=null,t.coinbase.container?(e=o.normalizeElement(t.coinbase.container),this._insertFrame(e)):(n.braintreeCoinbasePopupCallback=this._onOAuthSuccess,e=document.body,o.addEventListener(e,"click",this._handleButtonClick),this._sendAnalyticsEvent("initialized"))}var o=t("braintree-utilities"),s=t("./dom/composer"),a=t("./url-composer"),u=t("./callbacks"),c=t("./constants"),l=t("./detector"),p=t("braintree-bus");i.prototype._sendAnalyticsEvent=function(t){var e=this.apiClient.integration+".web.coinbase.";this.apiClient.sendAnalyticsEvents(e+t)},i.prototype._insertFrame=function(t){var e=s.createFrame({src:this.assetsUrl+"/coinbase/"+c.VERSION+"/coinbase-frame.html"});p.emit(p.events.ASYNC_DEPENDENCY_INITIALIZING),t.appendChild(e)},i.prototype._onOAuthSuccess=function(t){return t.code?(p.emit("coinbase:view:navigate","loading"),this._sendAnalyticsEvent("popup.authorized"),this.apiClient.tokenizeCoinbase({code:t.code,query:a.getQueryString()},o.bind(function(t,e){u.tokenize.apply(null,[t,e,this])},this)),void this._closePopup()):(this._sendAnalyticsEvent("popup.denied"),void this._closePopup())},i.prototype._clearPollForRedirectDone=function(){this.redirectDoneInterval&&(clearInterval(this.redirectDoneInterval),this.redirectDoneInterval=null)},i.prototype._closePopup=function(t){t=t||this.popup,l.shouldCloseFromParent()&&t.close(),this._popupCleanup()},i.prototype._popupCleanup=function(){this._clearPollForRedirectDone(),p.emit(p.events.UI_POPUP_DID_CLOSE,{source:c.INTEGRATION_NAME})},i.prototype._pollForRedirectDone=function(t){var e=setInterval(o.bind(function(){var e;if(null==t||t.closed)return this._sendAnalyticsEvent("popup.aborted"),void this._popupCleanup();try{if("about:blank"===t.location.href)throw new Error("Not finished loading");e=o.decodeQueryString(t.location.search.replace(/^\?/,"")).code}catch(n){return}this._onOAuthSuccess({code:e})},this),100);return this.redirectDoneInterval=e,e},i.prototype._openPopup=function(){var t;this._sendAnalyticsEvent("popup.started"),t=s.createPopup(a.compose(this._getOAuthBaseUrl(),this.popupParams)),t.focus(),this._pollForRedirectDone(t),p.trigger(p.events.UI_POPUP_DID_OPEN,{source:c.INTEGRATION_NAME}),p.on(p.events.UI_POPUP_FORCE_CLOSE,function(e){e.target===c.INTEGRATION_NAME&&t.close()}),this.popup=t},i.prototype._getOAuthBaseUrl=function(){var t;return t="shared_sandbox"===this.environment?c.SANDBOX_OAUTH_BASE_URL:c.PRODUCTION_OAUTH_BASE_URL},i.prototype._handleButtonClick=function(t){for(var e=t.target||t.srcElement;;){if(null==e)return;if(e===t.currentTarget)return;if(e.id===this.buttonId)break;e=e.parentNode}t&&t.preventDefault?t.preventDefault():t.returnValue=!1,this._openPopup()},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./callbacks":55,"./constants":57,"./detector":58,"./dom/composer":60,"./url-composer":63,"braintree-bus":64,"braintree-utilities":73}],57:[function(t,e){"use strict";e.exports={PRODUCTION_OAUTH_BASE_URL:"https://coinbase.com",SANDBOX_OAUTH_BASE_URL:"https://sandbox.coinbase.com",ORIGIN_URL:"https://www.coinbase.com",FRAME_NAME:"braintree-coinbase-frame",POPUP_NAME:"coinbase",BUTTON_ID:"bt-coinbase-button",SCOPES:"send",VERSION:"0.2.2",INTEGRATION_NAME:"Coinbase"}},{}],58:[function(t,e){"use strict";function n(){var t=s.ieVersion();return!t||t>8}function r(){var t=s.androidVersion();return null==t?!1:/^5/.test(t)}function i(){return!(r()||o())}function o(){var t=s.iOSSafariVersion();return null==t?!1:/^8\.0/.test(t)||/^8\.1$/.test(t)}var s=t("./browser");e.exports={isSupportedBrowser:n,shouldCloseFromParent:i,shouldDisplayIOSClose:o,shouldDisplayLollipopClose:r}},{"./browser":54}],59:[function(t,e){"use strict";function n(t){var e=document.createElement("button");return t=t||{},e.id=t.id||"coinbase-button",e.style.backgroundColor=t.backgroundColor||"#EEE",e.style.color=t.color||"#4597C3",e.style.border=t.border||"0",e.style.borderRadius=t.borderRadius||"6px",e.style.padding=t.padding||"12px",e.innerHTML=t.innerHTML||"coinbase",e}e.exports={create:n}},{}],60:[function(t,e){"use strict";var n=t("./popup"),r=t("./button"),i=t("./frame");e.exports={createButton:r.create,createPopup:n.create,createFrame:i.create}},{"./button":59,"./frame":61,"./popup":62}],61:[function(t,e){"use strict";function n(t){return i({src:t.src,name:r.FRAME_NAME,height:"70px",width:"100%",style:{padding:0,margin:0,border:0,outline:"none"}})}var r=t("../constants"),i=t("iframer");e.exports={create:n}},{"../constants":57,iframer:74}],62:[function(t,e){(function(n){"use strict";function r(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push([n,t[n]].join("="));return e.join(",")}function i(){var t=850,e=600;return r({width:t,height:e,left:(screen.width-t)/2,top:(screen.height-e)/4})}function o(t){return n.open(t,s.POPUP_NAME,i())}var s=t("../constants");e.exports={create:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants":57}],63:[function(t,e){"use strict";function n(){return"version="+i.VERSION}function r(t,e){var r=t+"/oauth/authorize?response_type=code",i=e.redirectUrl+"?"+n();if(r+="&redirect_uri="+encodeURIComponent(i),r+="&client_id="+e.clientId,e.scopes&&(r+="&scope="+encodeURIComponent(e.scopes)),e.meta)for(var o in e.meta)e.meta.hasOwnProperty(o)&&(r+="&meta["+encodeURIComponent(o)+"]="+encodeURIComponent(e.meta[o]));return r}var i=t("./constants");e.exports={compose:r,getQueryString:n}},{"./constants":57}],64:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{"./lib/events":65,dup:50,framebus:66}],65:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],66:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],67:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],68:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],69:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],70:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],71:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],72:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{"./array":67,dup:40}],73:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./lib/array":67,"./lib/dom":68,"./lib/events":69,"./lib/fn":70,"./lib/string":71,"./lib/url":72,dup:41}],74:[function(t,e){"use strict";var n=t("lodash.assign"),r=t("lodash.isstring"),i=t("./lib/default-attributes");e.exports=function(t){var e=document.createElement("iframe"),o=n({},i,t);o.style&&!r(o.style)&&(n(e.style,o.style),delete o.style);for(var s in o)o.hasOwnProperty(s)&&e.setAttribute(s,o[s]);return e.getAttribute("id")||(e.id=e.name),e}},{"./lib/default-attributes":75,"lodash.assign":76,"lodash.isstring":87}],75:[function(t,e){e.exports={frameBorder:0,allowtransparency:!0}},{}],76:[function(t,e){function n(t,e,n){for(var r=-1,i=o(e),s=i.length;++r<s;){var a=i[r],u=t[a],c=n(u,e[a],a,t,e);(c===c?c===u:u!==u)&&(void 0!==u||a in t)||(t[a]=c)}return t}var r=t("lodash._baseassign"),i=t("lodash._createassigner"),o=t("lodash.keys"),s=i(function(t,e,i){return i?n(t,e,i):r(t,e)});e.exports=s},{"lodash._baseassign":77,"lodash._createassigner":79,"lodash.keys":83}],77:[function(t,e){function n(t,e){return null==e?t:r(e,i(e),t)}var r=t("lodash._basecopy"),i=t("lodash.keys");e.exports=n},{"lodash._basecopy":78,"lodash.keys":83}],78:[function(t,e){function n(t,e,n){n||(n={});for(var r=-1,i=e.length;++r<i;){var o=e[r];n[o]=t[o]}return n}e.exports=n},{}],79:[function(t,e){function n(t){return o(function(e,n){var o=-1,s=null==e?0:n.length,a=s>2?n[s-2]:void 0,u=s>2?n[2]:void 0,c=s>1?n[s-1]:void 0;for("function"==typeof a?(a=r(a,c,5),s-=2):(a="function"==typeof c?c:void 0,s-=a?1:0),u&&i(n[0],n[1],u)&&(a=3>s?void 0:a,s=1);++o<s;){var l=n[o];l&&t(e,l,a)}return e})}var r=t("lodash._bindcallback"),i=t("lodash._isiterateecall"),o=t("lodash.restparam");e.exports=n},{"lodash._bindcallback":80,"lodash._isiterateecall":81,"lodash.restparam":82}],80:[function(t,e){function n(t,e,n){if("function"!=typeof t)return r;if(void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)};case 5:return function(n,r,i,o,s){return t.call(e,n,r,i,o,s)}}return function(){return t.apply(e,arguments)}}function r(t){return t}e.exports=n},{}],81:[function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}function r(t){return null!=t&&s(l(t))}function i(t,e){return t="number"==typeof t||u.test(t)?+t:-1,e=null==e?c:e,t>-1&&t%1==0&&e>t}function o(t,e,n){if(!a(n))return!1;var o=typeof e;if("number"==o?r(n)&&i(e,n.length):"string"==o&&e in n){var s=n[e];return t===t?t===s:s!==s}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&c>=t}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var u=/^\d+$/,c=9007199254740991,l=n("length");e.exports=o},{}],82:[function(t,e){function n(t,e){if("function"!=typeof t)throw new TypeError(r);return e=i(void 0===e?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-e,0),s=Array(o);++r<o;)s[r]=n[e+r];switch(e){case 0:return t.call(this,s);case 1:return t.call(this,n[0],s);case 2:return t.call(this,n[0],n[1],s)}var a=Array(e+1);for(r=-1;++r<e;)a[r]=n[r];return a[e]=s,t.apply(this,a)}}var r="Expected a function",i=Math.max;e.exports=n},{}],83:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46,"lodash._getnative":84,"lodash.isarguments":85,"lodash.isarray":86}],84:[function(t,e,n){arguments[4][47][0].apply(n,arguments)},{dup:47}],85:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{dup:43}],86:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44}],87:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],88:[function(t,e,n){arguments[4][2][0].apply(n,arguments)},{"./coinbase-account":89,"./credit-card":91,"./europe-bank-account":92,"./normalize-api-fields":94,"./parse-client-token":95,"./paypal-account":96,"./request/choose-driver":99,"./sepa-mandate":104,"./should-enable-cors":105,"./util":106,"braintree-3ds":115,"braintree-utilities":127,dup:2}],89:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{dup:3}],90:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],91:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],92:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],93:[function(t,e,n){arguments[4][7][0].apply(n,arguments)},{"./parse-client-token":95,"./request/choose-driver":99,"./should-enable-cors":105,"./util":106,dup:7}],94:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{dup:8}],95:[function(t,e,n){arguments[4][9][0].apply(n,arguments)},{"./polyfill":97,"braintree-utilities":127,dup:9}],96:[function(t,e,n){arguments[4][10][0].apply(n,arguments)},{dup:10}],97:[function(t,e,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],98:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{"../constants":90,"../util":106,"./parse-body":102,"./prep-body":103,dup:12}],99:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"../util":106,"./ajax-driver":98,"./jsonp-driver":100,dup:13}],100:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{"../constants":90,"./jsonp":101,dup:14}],101:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{"../util":106,dup:15}],102:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{dup:16}],103:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17,"lodash.isstring":135}],104:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],105:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],106:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20,"lodash.isempty":128,"lodash.isobject":134}],107:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{"./lib/client":88,"./lib/get-configuration":93,"./lib/parse-client-token":95,"./lib/util":106,dup:21}],108:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],109:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],110:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],111:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],112:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{"./lib/dom":108,"./lib/events":109,"./lib/fn":110,"./lib/url":111,dup:26}],113:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{"../shared/receiver":120,"braintree-utilities":112,dup:27}],114:[function(t,e,n){arguments[4][28][0].apply(n,arguments)},{"./authorization_service":113,"./loader":116,"braintree-utilities":112,dup:28}],115:[function(t,e,n){arguments[4][29][0].apply(n,arguments)},{"./client":114,dup:29}],116:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{"./loader_display":117,"./loader_message":118,"./loader_spinner":119,dup:30}],117:[function(t,e,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],118:[function(t,e,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],119:[function(t,e,n){arguments[4][33][0].apply(n,arguments)},{dup:33}],120:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"braintree-utilities":112,dup:34}],121:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],122:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],123:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],124:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],125:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],126:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{"./array":121,dup:40}],127:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./lib/array":121,"./lib/dom":122,"./lib/events":123,"./lib/fn":124,"./lib/string":125,"./lib/url":126,dup:41}],128:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{dup:42,"lodash.isarguments":129,"lodash.isarray":130,"lodash.isfunction":131,"lodash.isstring":135,"lodash.keys":132}],129:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{dup:43}],130:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44}],131:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],132:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46,"lodash._getnative":133,"lodash.isarguments":129,"lodash.isarray":130}],133:[function(t,e,n){arguments[4][47][0].apply(n,arguments)},{dup:47}],134:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48}],135:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],136:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{"./lib/events":137,dup:50,framebus:138}],137:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],138:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],139:[function(t,e,n){arguments[4][2][0].apply(n,arguments)},{"./coinbase-account":140,"./credit-card":142,"./europe-bank-account":143,"./normalize-api-fields":145,"./parse-client-token":146,"./paypal-account":147,"./request/choose-driver":150,"./sepa-mandate":155,"./should-enable-cors":156,"./util":157,"braintree-3ds":166,"braintree-utilities":178,dup:2}],140:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{dup:3}],141:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],142:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],143:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],144:[function(t,e,n){arguments[4][7][0].apply(n,arguments)},{"./parse-client-token":146,"./request/choose-driver":150,"./should-enable-cors":156,"./util":157,dup:7}],145:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{dup:8}],146:[function(t,e,n){arguments[4][9][0].apply(n,arguments)},{"./polyfill":148,"braintree-utilities":178,dup:9}],147:[function(t,e,n){arguments[4][10][0].apply(n,arguments)},{dup:10}],148:[function(t,e,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],149:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{"../constants":141,"../util":157,"./parse-body":153,"./prep-body":154,dup:12}],150:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"../util":157,"./ajax-driver":149,"./jsonp-driver":151,dup:13}],151:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{"../constants":141,"./jsonp":152,dup:14}],152:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{"../util":157,dup:15}],153:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{dup:16}],154:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17,"lodash.isstring":186}],155:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],156:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],157:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20,"lodash.isempty":179,"lodash.isobject":185}],158:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{"./lib/client":139,"./lib/get-configuration":144,"./lib/parse-client-token":146,"./lib/util":157,dup:21}],159:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],160:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],161:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],162:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],163:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{"./lib/dom":159,"./lib/events":160,"./lib/fn":161,"./lib/url":162,dup:26}],164:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{"../shared/receiver":171,"braintree-utilities":163,dup:27}],165:[function(t,e,n){arguments[4][28][0].apply(n,arguments)},{"./authorization_service":164,"./loader":167,"braintree-utilities":163,dup:28}],166:[function(t,e,n){arguments[4][29][0].apply(n,arguments)},{"./client":165,dup:29}],167:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{"./loader_display":168,"./loader_message":169,"./loader_spinner":170,dup:30}],168:[function(t,e,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],169:[function(t,e,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],170:[function(t,e,n){arguments[4][33][0].apply(n,arguments)},{dup:33}],171:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"braintree-utilities":163,dup:34}],172:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],173:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],174:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],175:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],176:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],177:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{"./array":172,dup:40}],178:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./lib/array":172,"./lib/dom":173,"./lib/events":174,"./lib/fn":175,"./lib/string":176,"./lib/url":177,dup:41}],179:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{dup:42,"lodash.isarguments":180,"lodash.isarray":181,"lodash.isfunction":182,"lodash.isstring":186,"lodash.keys":183}],180:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{dup:43}],181:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44}],182:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],183:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46,"lodash._getnative":184,"lodash.isarguments":180,"lodash.isarray":181}],184:[function(t,e,n){arguments[4][47][0].apply(n,arguments)},{dup:47}],185:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48}],186:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],187:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{"./lib/events":188,dup:50,framebus:189}],188:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],189:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],190:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],191:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],192:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],193:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],194:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],195:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{"./array":190,dup:40}],196:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./lib/array":190,"./lib/dom":191,"./lib/events":192,"./lib/fn":193,"./lib/string":194,"./lib/url":195,dup:41}],197:[function(t,e){function n(t){var e=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return{overflow:e.overflow||"",height:t.style.height||""}}function r(){return{html:{node:document.documentElement,styles:n(document.documentElement)},body:{node:document.body,styles:n(document.body)}}}function i(t,e){if(!t)throw new Error('Parameter "clientToken" cannot be null');e=e||{},this._clientToken=o.parseClientToken(t),this._clientOptions=e,this.container=e.container,this.merchantPageDefaultStyles=null,this.paymentMethodNonceInputField=e.paymentMethodNonceInputField,this.frame=null,this.popup=null,this.insertFrameFunction=e.insertFrame,this.onSuccess=e.onSuccess,this.onCancelled=e.onCancelled,this.onUnsupported=e.onUnsupported,this.loggedInView=null,this.loggedOutView=null,this.insertUI=!0}var o=t("braintree-api"),s=t("braintree-bus"),a=t("braintree-utilities"),u=t("./logged-in-view"),c=t("./logged-out-view"),l=t("./overlay-view"),p=t("../shared/util/browser"),h=t("../shared/util/dom"),d=t("../shared/constants"),f=t("../shared/util/util"),m=t("../shared/get-locale");i.prototype.getViewerUrl=function(){var t=this._clientToken.paypal.assetsUrl;return t+"/pwpp/"+d.VERSION+"/html/braintree-frame.html"},i.prototype.getProxyUrl=function(){var t=this._clientToken.paypal.assetsUrl;return t+"/pwpp/"+d.VERSION+"/html/proxy-frame.html"},i.prototype.initialize=function(){if(!this._clientToken.paypalEnabled)return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("PayPal is not enabled")));if(!this._isBrowserSecure())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("unsupported protocol detected")));if(this._isHermesCapable()){if(!this._isHermesSupportedCurrency())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("This PayPal integration does not support this currency")));if(!this._isHermesSupportedCountries())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("This PayPal integration does not support this locale")));if(!this._isValidAmount())return void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("Amount must be a number")))}return this._isMisconfiguredUnvettedMerchant()?void("function"==typeof this.onUnsupported&&this.onUnsupported(new Error("Unvetted merchants must provide a payeeEmail, amount, and currency"))):(this._overrideClientTokenProperties(),p.isProxyFrameRequired()&&this._insertProxyFrame(),this._setupDomElements(),this._setupPaymentMethodNonceInputField(),this._setupViews(),void this._createBusSubscribers())},i.prototype._isSupportedOption=function(t,e){for(var n=e.length,r=!1,i=0;n>i;i++)t.toLowerCase()===e[i].toLowerCase()&&(r=!0);
4
+ return r},i.prototype._isHermesSupportedCurrency=function(){return this._isSupportedOption(this._clientOptions.currency,d.ARIES_SUPPORTED_CURRENCIES)},i.prototype._isHermesSupportedCountries=function(){return this._isSupportedOption(m(this._clientOptions.locale).split("_")[1],d.ARIES_SUPPORTED_COUNTRIES)},i.prototype._isValidAmount=function(){var t=parseFloat(this._clientOptions.amount);return"number"==typeof t&&!isNaN(t)&&t>=0},i.prototype._isMisconfiguredUnvettedMerchant=function(){return this._clientToken.paypal.unvettedMerchant&&(!this._isHermesCapable()||!this._clientToken.paypal.payeeEmail)},i.prototype._isBrowserSecure=function(){return a.isBrowserHttps()||p.isPopupSupported()||this._clientToken.paypal.allowHttp},i.prototype._overrideClientTokenProperties=function(){this._clientOptions.displayName&&(this._clientToken.paypal.displayName=this._clientOptions.displayName)},i.prototype._setupDomElements=function(){this.insertUI&&(this.container=a.normalizeElement(this.container))},i.prototype._setupPaymentMethodNonceInputField=function(){if(this.insertUI){var t=this.paymentMethodNonceInputField;a.isFunction(t)||(t=void 0!==t?a.normalizeElement(t):this._createPaymentMethodNonceInputField(),this.paymentMethodNonceInputField=t)}},i.prototype._setupViews=function(){var t=this._clientToken.paypal.assetsUrl;this.insertUI&&(this.loggedInView=new u({container:this.container,assetsUrl:t}),this.loggedOutView=new c({assetsUrl:t,container:this.container,isCheckout:this._isHermesCapable(),locale:this._clientOptions.locale,merchantId:"merchantId"}),a.addEventListener(this.loggedOutView.container,"click",a.bind(this._handleContainerClick,this)),a.addEventListener(this.loggedInView.logoutNode,"click",a.bind(this._handleLogout,this)))},i.prototype._createBusSubscribers=function(){s.subscribe("getClientToken",a.bind(this._handleGetClientToken,this)),s.subscribe("getClientOptions",a.bind(this._handleGetClientOptions,this)),s.subscribe("closePayPalModal",a.bind(this._handleCloseMessage,this)),s.subscribe("receivePayPalData",a.bind(this._handleSuccessfulAuthentication,this))},i.prototype._createPaymentMethodNonceInputField=function(){var t=document.createElement("input");return t.name="payment_method_nonce",t.type="hidden",this.container.appendChild(t)},i.prototype._createFrame=function(){var t,e=document.createElement("iframe");return this._isHermesCapable()?(t=d.ARIES_FRAME_NAME,e.style.background="#FFFFFF"):t=d.FRAME_NAME,e.src=this.getViewerUrl(),e.id=t,e.name=t,e.allowTransparency=!0,e.height="100%",e.width="100%",e.frameBorder=0,e.style.position=p.isMobile()?"absolute":"fixed",e.style.top=0,e.style.left=0,e.style.bottom=0,e.style.zIndex=20001,e.style.padding=0,e.style.margin=0,e.style.border=0,e.style.outline="none",e},i.prototype._removeFrame=function(t){t=t||document.body,this.frame&&t.contains(this.frame)&&(t.removeChild(this.frame),this._unlockMerchantWindowSize())},i.prototype._insertFrame=function(){this.insertFrameFunction?this.insertFrameFunction(this.getViewerUrl()):(this.frame=this._createFrame(),document.body.appendChild(this.frame)),this._lockMerchantWindowSize()},i.prototype._handleContainerClick=function(t){function e(t){return t.className.match(/paypal-button(?!-widget)/)||"braintree-paypal-button"===t.id}var n=t.target||t.srcElement;(e(n)||e(n.parentNode))&&(t.preventDefault?t.preventDefault():t.returnValue=!1,this._open())},i.prototype._setMerchantPageDefaultStyles=function(){this.merchantPageDefaultStyles=r()},i.prototype._open=function(){this._isHermesCapable()&&this._addCorrelationIdToClientToken(),p.isPopupSupported()?this._openPopup():this._openModal()},i.prototype._close=function(){p.isPopupSupported()?this._closePopup():this._closeModal()},i.prototype._openModal=function(){this._removeFrame(),this._insertFrame()},i.prototype._isHermesCapable=function(){return!!this._clientOptions.singleUse&&!!this._clientOptions.amount&&!!this._clientOptions.currency},i.prototype._openPopup=function(){var t,e,n,r=[],i=window.outerWidth||document.documentElement.clientWidth,o=window.outerHeight||document.documentElement.clientHeight,s="undefined"==typeof window.screenY?window.screenTop:window.screenY,a="undefined"==typeof window.screenX?window.screenLeft:window.screenX;this._isHermesCapable()?(t=d.ARIES_POPUP_NAME,n=d.ARIES_POPUP_HEIGHT,e=d.ARIES_POPUP_WIDTH):(t=d.POPUP_NAME,n=d.POPUP_HEIGHT,e=d.POPUP_WIDTH);var u=(i-e)/2+a,c=(o-n)/2+s;return r.push("height="+n),r.push("width="+e),r.push("top="+c),r.push("left="+u),r.push(d.POPUP_OPTIONS),this.popup=window.open(this.getViewerUrl(),t,r.join(",")),p.isOverlaySupported()&&(this.overlayView=new l(this.popup,this._clientToken.paypal.assetsUrl),this.overlayView.render()),this.popup.focus(),this.popup},i.prototype._addCorrelationIdToClientToken=function(){this._clientToken.correlationId=f.generateUid()},i.prototype._createProxyFrame=function(){var t=document.createElement("iframe");return t.src=this.getProxyUrl(),t.id=d.BRIDGE_FRAME_NAME,t.name=d.BRIDGE_FRAME_NAME,t.allowTransparency=!0,t.height=0,t.width=0,t.frameBorder=0,t.style.position="static",t.style.padding=0,t.style.margin=0,t.style.border=0,t.style.outline="none",t},i.prototype._insertProxyFrame=function(){this.proxyFrame=this._createProxyFrame(),document.body.appendChild(this.proxyFrame)},i.prototype._closeModal=function(){this._removeFrame()},i.prototype._closePopup=function(){this.popup&&(this.popup.close(),this.popup=null),this.overlayView&&p.isOverlaySupported()&&this.overlayView.remove()},i.prototype._clientTokenData=function(){return{analyticsUrl:this._clientToken.analytics?this._clientToken.analytics.url:void 0,authorizationFingerprint:this._clientToken.authorizationFingerprint,clientApiUrl:this._clientToken.clientApiUrl,displayName:this._clientToken.paypal.displayName,paypalBaseUrl:this._clientToken.paypal.assetsUrl,paypalClientId:this._clientToken.paypal.clientId,paypalPrivacyUrl:this._clientToken.paypal.privacyUrl,paypalUserAgreementUrl:this._clientToken.paypal.userAgreementUrl,unvettedMerchant:this._clientToken.paypal.unvettedMerchant,payeeEmail:this._clientToken.paypal.payeeEmail,correlationId:this._clientToken.correlationId,offline:this._clientOptions.offline||this._clientToken.paypal.environmentNoNetwork,sdkVersion:this._clientToken.sdkVersion,merchantAppId:this._clientToken.merchantAppId}},i.prototype._handleGetClientToken=function(t){t(this._clientTokenData())},i.prototype._clientOptionsData=function(){return{locale:this._clientOptions.locale||"en_us",onetime:this._clientOptions.singleUse||!1,integration:this._clientOptions.integration||"paypal",enableShippingAddress:this._clientOptions.enableShippingAddress||!1,enableBillingAddress:this._clientOptions.enableBillingAddress||!1,enableHermes:this._isHermesCapable(),amount:this._clientOptions.amount||null,currency:this._clientOptions.currency||null,shippingAddressOverride:this._clientOptions.shippingAddressOverride||null,enableCORS:this._clientOptions.enableCORS}},i.prototype._handleGetClientOptions=function(t){t(this._clientOptionsData())},i.prototype._handleSuccessfulAuthentication=function(t){this._close(),t.type=d.NONCE_TYPE,a.isFunction(this.paymentMethodNonceInputField)?this.paymentMethodNonceInputField(t.nonce):(this._showLoggedInContent(t.details.email),this._setNonceInputValue(t.nonce)),a.isFunction(this.onSuccess)&&this.onSuccess(t)},i.prototype._lockMerchantWindowSize=function(){this._setMerchantPageDefaultStyles(),document.documentElement.style.height="100%",document.documentElement.style.overflow="hidden",document.body.style.height="100%",document.body.style.overflow="hidden"},i.prototype._unlockMerchantWindowSize=function(){this.merchantPageDefaultStyles&&(document.documentElement.style.height=this.merchantPageDefaultStyles.html.styles.height,document.documentElement.style.overflow=this.merchantPageDefaultStyles.html.styles.overflow,document.body.style.height=this.merchantPageDefaultStyles.body.styles.height,document.body.style.overflow=this.merchantPageDefaultStyles.body.styles.overflow)},i.prototype._handleCloseMessage=function(){this._removeFrame()},i.prototype._showLoggedInContent=function(t){this.loggedOutView.hide(),h.setTextContent(this.loggedInView.emailNode,t),this.loggedInView.show()},i.prototype._handleLogout=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1,this.loggedInView.hide(),this.loggedOutView.show(),this._setNonceInputValue(""),a.isFunction(this.onCancelled)&&this.onCancelled()},i.prototype._setNonceInputValue=function(t){this.paymentMethodNonceInputField.value=t},e.exports=i},{"../shared/constants":201,"../shared/get-locale":203,"../shared/util/browser":208,"../shared/util/dom":209,"../shared/util/util":210,"./logged-in-view":198,"./logged-out-view":199,"./overlay-view":200,"braintree-api":158,"braintree-bus":187,"braintree-utilities":196}],198:[function(t,e){function n(t){this.options=t,this.container=this.createViewContainer(),this.createPayPalName(),this.emailNode=this.createEmailNode(),this.logoutNode=this.createLogoutNode()}var r=t("../shared/constants");n.prototype.createViewContainer=function(){var t=document.createElement("div");t.id="braintree-paypal-loggedin";var e=["display: none","max-width: 500px","overflow: hidden","padding: 16px","background-image: url("+this.options.assetsUrl+"/pwpp/"+r.VERSION+"/images/paypal-small.png)","background-image: url("+this.options.assetsUrl+"/pwpp/"+r.VERSION+"/images/paypal-small.svg), none","background-position: 20px 50%","background-repeat: no-repeat","background-size: 13px 15px","border-top: 1px solid #d1d4d6","border-bottom: 1px solid #d1d4d6"].join(";");return t.style.cssText=e,this.options.container.appendChild(t),t},n.prototype.createPayPalName=function(){var t=document.createElement("span");t.id="bt-pp-name",t.innerHTML="PayPal";var e=["color: #283036","font-size: 13px","font-weight: 800",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"margin-left: 36px","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},n.prototype.createEmailNode=function(){var t=document.createElement("span");t.id="bt-pp-email";var e=["color: #6e787f","font-size: 13px",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"margin-left: 5px","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},n.prototype.createLogoutNode=function(){var t=document.createElement("button");t.id="bt-pp-cancel",t.innerHTML="Cancel";var e=["color: #3d95ce","font-size: 11px",'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif',"line-height: 20px","margin: 0 0 0 25px","padding: 0","background-color: transparent","border: 0","cursor: pointer","text-decoration: underline","float: right","-webkit-font-smoothing: antialiased","-moz-font-smoothing: antialiased","-ms-font-smoothing: antialiased","font-smoothing: antialiased"].join(";");return t.style.cssText=e,this.container.appendChild(t)},n.prototype.show=function(){this.container.style.display="block"},n.prototype.hide=function(){this.container.style.display="none"},e.exports=n},{"../shared/constants":201}],199:[function(t,e){function n(t){this.options=t,this.assetsUrl=this.options.assetsUrl,this.container=this.createViewContainer(),this.options.isCheckout?this.createCheckoutWithPayPalButton():this.createPayWithPayPalButton()}var r=(t("braintree-utilities"),t("../shared/constants")),i=t("../shared/get-locale");n.prototype.createViewContainer=function(){var t=document.createElement("div");return t.id="braintree-paypal-loggedout",this.options.container.appendChild(t),t},n.prototype.createPayWithPayPalButton=function(){var t=document.createElement("a");t.id="braintree-paypal-button",t.href="#";var e=["display: block","width: 115px","height: 44px","overflow: hidden"].join(";");t.style.cssText=e;var n=new Image;n.src=this.assetsUrl+"/pwpp/"+r.VERSION+"/images/pay-with-paypal.png",n.setAttribute("alt","Pay with PayPal");var i=["max-width: 100%","display: block","width: 100%","height: 100%","outline: none","border: 0"].join(";");n.style.cssText=i,t.appendChild(n),this.container.appendChild(t)},n.prototype.createCheckoutWithPayPalButton=function(){var t=document.createElement("script");t.src="//www.paypalobjects.com/api/button.js",t.async=!0,t.setAttribute("data-merchant",this.options.merchantId),t.setAttribute("data-button","checkout"),t.setAttribute("data-type","button"),t.setAttribute("data-width","150"),t.setAttribute("data-height","44"),t.setAttribute("data-lc",i(this.options.locale)),this.container.appendChild(t)},n.prototype.show=function(){this.container.style.display="block"},n.prototype.hide=function(){this.container.style.display="none"},e.exports=n},{"../shared/constants":201,"../shared/get-locale":203,"braintree-utilities":196}],200:[function(t,e){function n(t,e){this.popup=t,this.assetsUrl=e,this.spriteSrc=this.assetsUrl+"/pwpp/"+i.VERSION+"/images/pp_overlay_sprite.png",this._create(),this._setupEvents(),this._pollForPopup()}var r=t("braintree-utilities"),i=t("../shared/constants");n.prototype.render=function(){document.body.contains(this.el)||document.body.appendChild(this.el)},n.prototype.remove=function(){document.body.contains(this.el)&&document.body.removeChild(this.el)},n.prototype._create=function(){this.el=document.createElement("div"),this.el.className="bt-overlay",this._setStyles(this.el,["z-index: 20001","position: fixed","top: 0","left: 0","height: 100%","width: 100%","text-align: center","background: #000","background: rgba(0,0,0,0.7)",'-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=52)"']),this.el.appendChild(this._createCloseIcon()),this.el.appendChild(this._createMessage())},n.prototype._createCloseIcon=function(){return this.closeIcon=document.createElement("div"),this.closeIcon.className="bt-close-overlay",this._setStyles(this.closeIcon,["position: absolute","top: 10px","right: 10px","cursor: pointer","background: url("+this.spriteSrc+") no-repeat 0 -67px","height: 14px","width: 14px"]),this.closeIcon},n.prototype._createMessage=function(){var t=document.createElement("div");return this._setStyles(t,["position: relative","top: 50%","max-width: 350px",'font-family: "HelveticaNeue", "HelveticaNeue-Light", "Helvetica Neue Light", helvetica, arial, sans-serif',"font-size: 14px","line-height: 20px","margin: -70px auto 0"]),t.appendChild(this._createLogo()),t.appendChild(this._createExplanation()),t.appendChild(this._createFocusLink()),t},n.prototype._createExplanation=function(){var t=document.createElement("div");return this._setStyles(t,["color: #FFF","margin-bottom: 20px"]),t.innerHTML="Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",t},n.prototype._createLogo=function(){var t=document.createElement("div");return this._setStyles(t,["background: url("+this.spriteSrc+") no-repeat 0 0","width: 94px","height: 25px","margin: 0 auto 26px auto"]),t},n.prototype._createFocusLink=function(){return this.focusLink=document.createElement("a"),this._setStyles(this.focusLink,["color: #009be1","cursor: pointer"]),this.focusLink.innerHTML="Continue",this.focusLink},n.prototype._setStyles=function(t,e){var n=e.join(";");t.style.cssText=n},n.prototype._setupEvents=function(){r.addEventListener(this.closeIcon,"click",r.bind(this._handleClose,this)),r.addEventListener(this.focusLink,"click",r.bind(this._handleFocus,this))},n.prototype._handleClose=function(t){t.preventDefault(),this.remove(),this.popup.close()},n.prototype._handleFocus=function(t){t.preventDefault(),this.popup.focus()},n.prototype._pollForPopup=function(){var t=setInterval(r.bind(function(){this.popup&&this.popup.closed&&(clearInterval(t),this.remove())},this),100)},e.exports=n},{"../shared/constants":201,"braintree-utilities":196}],201:[function(t,e,n){var r="1.5.3";n.VERSION=r,n.POPUP_NAME="braintree_paypal_popup",n.ARIES_POPUP_NAME="PPFrameRedirect",n.FRAME_NAME="braintree-paypal-frame",n.ARIES_FRAME_NAME="PPFrameRedirect",n.POPUP_PATH="/pwpp/"+r+"/html/braintree-frame.html",n.POPUP_OPTIONS="resizable,scrollbars",n.POPUP_HEIGHT=470,n.POPUP_WIDTH=410,n.ARIES_POPUP_HEIGHT=535,n.ARIES_POPUP_WIDTH=450,n.BRIDGE_FRAME_NAME="bt-proxy-frame",n.ARIES_SUPPORTED_CURRENCIES=["USD","GBP","EUR","AUD","CAD","DKK","NOK","PLN","SEK","CHF","TRY"],n.ARIES_SUPPORTED_COUNTRIES=["US","GB","AU","CA","ES","FR","DE","IT","NL","NO","PL","CH","TR","DK","BE","AT"],n.NONCE_TYPE="PayPalAccount",n.ILLEGAL_XHR_ERROR="Illegal XHR request attempted"},{}],202:[function(t,e){"use strict";e.exports={us:"en_us",gb:"en_uk",uk:"en_uk",de:"de_de",fr:"fr_fr",it:"it_it",es:"es_es",ca:"en_ca",au:"en_au",at:"de_de",be:"en_us",ch:"de_de",dk:"da_dk",nl:"nl_nl",no:"no_no",pl:"pl_pl",se:"sv_se",tr:"tr_tr",bg:"en_us",cy:"en_us",hr:"en_us",is:"en_us",kh:"en_us",mt:"en_us",my:"en_us",ru:"ru_ru"}},{}],203:[function(t,e){"use strict";function n(t){return-1!==t.indexOf("_")&&5===t.length}function r(t){var e;for(var n in o)o.hasOwnProperty(n)&&(n===t?e=o[n]:o[n]===t&&(e=o[n]));return e}function i(t){var e;if(t=t?t.toLowerCase():"us",t=t.replace(/-/g,"_"),e=n(t)?t:r(t)){var i=e.split("_");return[i[0],i[1].toUpperCase()].join("_")}return"en_US"}var o=t("../shared/data/country-code-lookup");e.exports=i},{"../shared/data/country-code-lookup":202}],204:[function(t,e){function n(){return p.matchUserAgent("Android")&&!r()}function r(){return p.matchUserAgent("Chrome")||p.matchUserAgent("CriOS")}function i(){return p.matchUserAgent("Firefox")}function o(){return p.matchUserAgent("Trident")||p.matchUserAgent("MSIE")}function s(){return p.matchUserAgent("Opera")||p.matchUserAgent("OPR")}function a(){return s()&&"[object OperaMini]"===d.call(window.operamini)}function u(){return p.matchUserAgent("Safari")&&!r()&&!n()}function c(){return h.isIos()&&!r()&&!u()}function l(){var t=/Version\/[\w\.]+ Chrome\/[\w\.]+ Mobile/;return h.isAndroid()&&p.matchUserAgent(t)}var p=t("./useragent"),h=t("./platform"),d=Object.prototype.toString;e.exports={isAndroid:n,isChrome:r,isFirefox:i,isIE:o,isOpera:s,isOperaMini:a,isSafari:u,isIosWebView:c,isAndroidWebView:l}},{"./platform":206,"./useragent":207}],205:[function(t,e){function n(){return!r()&&(s.isAndroid()||s.isIpod()||s.isIphone()||o.matchUserAgent("IEMobile"))}function r(){return s.isIpad()||s.isAndroid()&&!o.matchUserAgent("Mobile")}function i(){return!n()&&!r()}var o=t("./useragent"),s=t("./platform");e.exports={isMobile:n,isTablet:r,isDesktop:i}},{"./platform":206,"./useragent":207}],206:[function(t,e){function n(){return a.matchUserAgent("Android")}function r(){return a.matchUserAgent("iPad")}function i(){return a.matchUserAgent("iPod")}function o(){return a.matchUserAgent("iPhone")&&!i()}function s(){return r()||i()||o()}var a=t("./useragent");e.exports={isAndroid:n,isIpad:r,isIpod:i,isIphone:o,isIos:s}},{"./useragent":207}],207:[function(t,e,n){function r(){return o}function i(t){var e=n.getNativeUserAgent(),r=e.match(t);return r?!0:!1}var o=window.navigator.userAgent;n.getNativeUserAgent=r,n.matchUserAgent=i},{}],208:[function(t,e){function n(){return r()&&window.outerWidth<600}function r(){return f.test(d)}function i(){return!!window.postMessage}function o(){if(c.isOperaMini())return!1;if(l.isDesktop())return!0;if(l.isMobile()||l.isTablet()){if(c.isIE())return!1;if(p.isAndroid())return c.isAndroidWebView()?!1:!0;if(p.isIos())return c.isChrome()||c.isSafari()&&h.matchUserAgent(/OS (?:8_1|8_0|8)(?!_\d)/i)||c.isIosWebView()?!1:!0}return!1}function s(){if(c.isIE()&&h.matchUserAgent(/MSIE 8\.0/))return!1;try{return window.self===window.top}catch(t){return!1}}function a(){return c.isIE()}function u(){var t=null,e="";try{new ActiveXObject("")}catch(n){e=n.name}try{t=!!new ActiveXObject("htmlfile")}catch(n){t=!1}return t="ReferenceError"!==e&&t===!1?!1:!0,!t}var c=t("../useragent/browser"),l=t("../useragent/device"),p=t("../useragent/platform"),h=t("../useragent/useragent"),d=window.navigator.userAgent,f=/[Mm]obi|tablet|iOS|Android|IEMobile|Windows\sPhone/;e.exports={isMobile:n,isMobileDevice:r,detectedPostMessage:i,isPopupSupported:o,isOverlaySupported:s,isProxyFrameRequired:a,isMetroBrowser:u}},{"../useragent/browser":204,"../useragent/device":205,"../useragent/platform":206,"../useragent/useragent":207}],209:[function(t,e){function n(t,e){var n="innerText";document&&document.body&&"textContent"in document.body&&(n="textContent"),t[n]=e}e.exports={setTextContent:n}},{}],210:[function(t,e){function n(){for(var t="",e=0;32>e;e++){var n=Math.floor(16*Math.random());t+=n.toString(16)}return t}function r(t){return/^(true|1)$/i.test(t)}function i(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&apos;")}function o(t){var e=t.indexOf("?"),n={};if(e>=0&&(t=t.substr(e+1)),0!==t.length){for(var r=t.split("&"),i=0,o=r.length;o>i;i++){var s=r[i],a=s.indexOf("="),u=s.substr(0,a),c=s.substr(a+1),l=decodeURIComponent(c);l=l.replace(/</g,"&lt;").replace(/>/g,"&gt;"),"false"===l&&(l=!1),(void 0===l||"true"===l)&&(l=!0),n[u]=l}return n}}function s(t){return t&&"[object Function]"===Object.prototype.toString.call(t)}function a(t){t.preventDefault?t.preventDefault():t.returnValue=!1}var u="function"==typeof String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/,"")},c="function"==typeof window.btoa?function(t){return window.btoa(t)}:function(t){for(var e,n,r,i,o,s,a,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",l=0;l<t.length;)e=t.charCodeAt(l++),n=t.charCodeAt(l++),r=t.charCodeAt(l++),i=e>>2,o=(3&e)<<4|n>>4,s=(15&n)<<2|r>>6,a=63&r,isNaN(n)?s=a=64:isNaN(r)&&(a=64),c=c+u.charAt(i)+u.charAt(o)+u.charAt(s)+u.charAt(a);return c};e.exports={trim:u,btoa:c,generateUid:n,castToBoolean:r,htmlEscape:i,parseUrlParams:o,isFunction:s,preventDefault:a}},{}],211:[function(t,e){"use strict";function n(t){this.host=t||window,this.handlers=[],r.addEventListener(this.host,"message",r.bind(this.receive,this))}var r=t("braintree-utilities");n.prototype.receive=function(t){var e,r,i,o;try{i=JSON.parse(t.data)}catch(s){return}for(o=i.type,r=new n.Message(this,t.source,i.data),e=0;e<this.handlers.length;e++)this.handlers[e].type===o&&this.handlers[e].handler(r)},n.prototype.send=function(t,e,n){t.postMessage(JSON.stringify({type:e,data:n}),"*")},n.prototype.register=function(t,e){this.handlers.push({type:t,handler:e})},n.prototype.unregister=function(t,e){for(var n=this.handlers.length-1;n>=0;n--)if(this.handlers[n].type===t&&this.handlers[n].handler===e)return this.handlers.splice(n,1)},n.Message=function(t,e,n){this.bus=t,this.source=e,this.content=n},n.Message.prototype.reply=function(t,e){this.bus.send(this.source,t,e)},e.exports=n},{"braintree-utilities":221}],212:[function(t,e){"use strict";function n(t,e){this.bus=t,this.target=e,this.handlers=[],this.bus.register("publish",r.bind(this._handleMessage,this))}var r=t("braintree-utilities");n.prototype._handleMessage=function(t){var e,n=t.content,r=this.handlers[n.channel];if("undefined"!=typeof r)for(e=0;e<r.length;e++)r[e](n.data)},n.prototype.publish=function(t,e){this.bus.send(this.target,"publish",{channel:t,data:e})},n.prototype.subscribe=function(t,e){this.handlers[t]=this.handlers[t]||[],this.handlers[t].push(e)},n.prototype.unsubscribe=function(t,e){var n,r=this.handlers[t];if("undefined"!=typeof r)for(n=0;n<r.length;n++)r[n]===e&&r.splice(n,1)},e.exports=n},{"braintree-utilities":221}],213:[function(t,e){"use strict";function n(t){this.bus=t,this.frames=[],this.handlers=[]}n.prototype.subscribe=function(t,e){this.handlers[t]=this.handlers[t]||[],this.handlers[t].push(e)},n.prototype.registerFrame=function(t){this.frames.push(t)},n.prototype.unregisterFrame=function(t){for(var e=0;e<this.frames.length;e++)this.frames[e]===t&&this.frames.splice(e,1)},n.prototype.publish=function(t,e){var n,r=this.handlers[t];if("undefined"!=typeof r)for(n=0;n<r.length;n++)r[n](e);for(n=0;n<this.frames.length;n++)this.bus.send(this.frames[n],"publish",{channel:t,data:e})},n.prototype.unsubscribe=function(t,e){var n,r=this.handlers[t];if("undefined"!=typeof r)for(n=0;n<r.length;n++)r[n]===e&&r.splice(n,1)},e.exports=n},{}],214:[function(t,e){"use strict";function n(t,e){this.bus=t,this.target=e||window.parent,this.counter=0,this.callbacks={},this.bus.register("rpc_response",r.bind(this._handleResponse,this))}var r=t("braintree-utilities");n.prototype._handleResponse=function(t){var e=t.content,n=this.callbacks[e.id];"function"==typeof n&&(n.apply(null,e.response),delete this.callbacks[e.id])},n.prototype.invoke=function(t,e,n){var r=this.counter++;this.callbacks[r]=n,this.bus.send(this.target,"rpc_request",{id:r,method:t,args:e})},e.exports=n},{"braintree-utilities":221}],215:[function(t,e){"use strict";function n(t){this.bus=t,this.methods={},this.bus.register("rpc_request",r.bind(this._handleRequest,this))}var r=t("braintree-utilities");n.prototype._handleRequest=function(t){var e,n=t.content,r=n.args||[],i=this.methods[n.method];"function"==typeof i&&(e=function(){t.reply("rpc_response",{id:n.id,response:Array.prototype.slice.call(arguments)})},r.push(e),i.apply(null,r))},n.prototype.define=function(t,e){this.methods[t]=e},e.exports=n},{"braintree-utilities":221}],216:[function(t,e){var n=t("./lib/message-bus"),r=t("./lib/pubsub-client"),i=t("./lib/pubsub-server"),o=t("./lib/rpc-client"),s=t("./lib/rpc-server");e.exports={MessageBus:n,PubsubClient:r,PubsubServer:i,RPCClient:o,RPCServer:s}},{"./lib/message-bus":211,"./lib/pubsub-client":212,"./lib/pubsub-server":213,"./lib/rpc-client":214,"./lib/rpc-server":215}],217:[function(t,e){"use strict";function n(t,e){if(e=e||"["+t+"] is not a valid DOM Element",t&&t.nodeType&&1===t.nodeType)return t;if(t&&window.jQuery&&t instanceof jQuery&&0!==t.length)return t[0];if("string"==typeof t&&document.getElementById(t))return document.getElementById(t);throw new Error(e)}e.exports={normalizeElement:n}},{}],218:[function(t,e){"use strict";function n(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}function r(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)}e.exports={removeEventListener:r,addEventListener:n}},{}],219:[function(t,e){"use strict";function n(t){return"[object Function]"===Object.prototype.toString.call(t)}function r(t,e){return function(){t.apply(e,arguments)}}e.exports={bind:r,isFunction:n}},{}],220:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],221:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{"./lib/dom":217,"./lib/events":218,"./lib/fn":219,"./lib/url":220,dup:26}],222:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],223:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],224:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],225:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],226:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],227:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{"./array":222,dup:40}],228:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./lib/array":222,"./lib/dom":223,"./lib/events":224,"./lib/fn":225,"./lib/string":226,"./lib/url":227,dup:41}],229:[function(t,e){(function(t){"use strict";function n(t){if(("string"==typeof t||t instanceof String)&&(t=document.getElementById(t)),!(t instanceof HTMLFormElement))throw new TypeError("FormNapper requires an HTMLFormElement element or the id string of one.");this.htmlForm=t}n.prototype.hijack=function(e){function n(t){t.preventDefault?t.preventDefault():t.returnValue=!1,e(t)}null!=t.addEventListener?this.htmlForm.addEventListener("submit",n,!1):null!=t.attachEvent?this.htmlForm.attachEvent("onsubmit",n):this.htmlForm.onsubmit=n},n.prototype.inject=function(t,e){var n=this.htmlForm.querySelector('input[name="'+t+'"]');null==n&&(n=document.createElement("input"),n.type="hidden",n.name=t,this.htmlForm.appendChild(n)),n.value=e},n.prototype.submit=function(){HTMLFormElement.prototype.submit.call(this.htmlForm)},e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],230:[function(t,e,n){arguments[4][74][0].apply(n,arguments)},{"./lib/default-attributes":231,dup:74,"lodash.assign":232,"lodash.isstring":243}],231:[function(t,e,n){arguments[4][75][0].apply(n,arguments)},{dup:75}],232:[function(t,e,n){arguments[4][76][0].apply(n,arguments)},{dup:76,"lodash._baseassign":233,"lodash._createassigner":235,"lodash.keys":239}],233:[function(t,e,n){arguments[4][77][0].apply(n,arguments)},{dup:77,"lodash._basecopy":234,"lodash.keys":239}],234:[function(t,e,n){arguments[4][78][0].apply(n,arguments)},{dup:78}],235:[function(t,e,n){arguments[4][79][0].apply(n,arguments)},{dup:79,"lodash._bindcallback":236,"lodash._isiterateecall":237,"lodash.restparam":238}],236:[function(t,e,n){arguments[4][80][0].apply(n,arguments)},{dup:80}],237:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{dup:81}],238:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],239:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46,"lodash._getnative":240,"lodash.isarguments":241,"lodash.isarray":242}],240:[function(t,e,n){arguments[4][47][0].apply(n,arguments)},{dup:47}],241:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{dup:43}],242:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44}],243:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],244:[function(t,e){"use strict";function n(t){this.apiClient=t}var r=["getCreditCards","unlockCreditCard","sendAnalyticsEvents"];n.prototype.attach=function(t){function e(e){t.define(e,function(){n.apiClient[e].apply(n.apiClient,arguments)})}var n=this,i=0,o=r.length;for(i;o>i;i++)e(r[i])},e.exports=n},{}],245:[function(t,e){"use strict";function n(t,e){var n=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return n[e]}function r(){return{html:{height:s.style.height||"",overflow:n(s,"overflow"),position:n(s,"position")},body:{height:a.style.height||"",overflow:n(a,"overflow")}}}function i(){var t=/Android|iPhone|iPod|iPad/i.test(window.navigator.userAgent);return t}function o(t){var e,n,r;this.merchantConfiguration=t.merchantConfiguration,this.encodedClientToken=t.gatewayConfiguration,this.analyticsConfiguration=t.analyticsConfiguration,this.paypalOptions=t.merchantConfiguration.paypal,this.container=null,this.merchantFormManager=null,this.root=t.root,this.configurationRequests=[],this.braintreeApiClient=u.configure({clientToken:t.gatewayConfiguration,analyticsConfiguration:this.analyticsConfiguration,integration:"dropin",enableCORS:this.merchantConfiguration.enableCORS}),this.paymentMethodNonceReceivedCallback=t.merchantConfiguration.paymentMethodNonceReceived,this.clientToken=u.parseClientToken(t.gatewayConfiguration),this.bus=new l.MessageBus(this.root),this.rpcServer=new l.RPCServer(this.bus),this.apiProxyServer=new h(this.braintreeApiClient),this.apiProxyServer.attach(this.rpcServer),e=t.inlineFramePath||this.clientToken.assetsUrl+"/dropin/"+b+"/inline-frame.html",n=t.modalFramePath||this.clientToken.assetsUrl+"/dropin/"+b+"/modal-frame.html",s=document.documentElement,a=document.body,this.frames={inline:this._createFrame(e,g.INLINE_FRAME_NAME),modal:this._createFrame(n,g.MODAL_FRAME_NAME)},this.container=p.normalizeElement(t.merchantConfiguration.container,"Unable to find valid container."),r=p.normalizeElement(t.merchantConfiguration.form||this._findClosest(this.container,"form")),this.merchantFormManager=new d({form:r,frames:this.frames,onSubmit:this.paymentMethodNonceReceivedCallback,apiClient:this.braintreeApiClient}).initialize(),t.gatewayConfiguration.paypalEnabled&&t.gatewayConfiguration.paypal&&(p.isBrowserHttps()||t.gatewayConfiguration.paypal.allowHttp)&&this._configurePayPal(),this.braintreeApiClient.sendAnalyticsEvents("dropin.web.initialized")
5
+ }var s,a,u=t("braintree-api"),c=t("braintree-bus"),l=t("braintree-rpc"),p=t("braintree-utilities"),h=t("./api-proxy-server"),d=t("./merchant-form-manager"),f=t("./frame-container"),m=t("../shared/paypal-service"),g=t("../shared/constants"),y=t("braintree-paypal/src/shared/util/browser"),b="1.8.3";o.prototype.initialize=function(){var t,e=this;this._initializeModal(),c.emit(c.events.ASYNC_DEPENDENCY_INITIALIZING),this.container.appendChild(this.frames.inline.element),a.appendChild(this.frames.modal.element),this.rpcServer.define("receiveSharedCustomerIdentifier",function(n){for(e.braintreeApiClient.attrs.sharedCustomerIdentifier=n,e.braintreeApiClient.attrs.sharedCustomerIdentifierType="browser_session_cookie_store",t=0;t<e.configurationRequests.length;t++)e.configurationRequests[t](e.encodedClientToken);e.configurationRequests=[]}),c.on(c.events.PAYMENT_METHOD_GENERATED,p.bind(this._handleAltPayData,this)),this.rpcServer.define("getConfiguration",function(t){t({enableCORS:e.merchantConfiguration.enableCORS,clientToken:e.encodedClientToken,analyticsConfiguration:e.analyticsConfiguration,merchantHttps:p.isBrowserHttps()})}),this.rpcServer.define("getPayPalOptions",function(t){t(e.paypalOptions)}),this.rpcServer.define("selectPaymentMethod",function(t){e.frames.modal.rpcClient.invoke("selectPaymentMethod",[t]),e._showModal()}),this.rpcServer.define("sendAddedPaymentMethod",function(t){e.merchantFormManager.setNoncePayload(t),e.frames.inline.rpcClient.invoke("receiveNewPaymentMethod",[t])}),this.rpcServer.define("sendUsedPaymentMethod",function(t){e.frames.inline.rpcClient.invoke("selectPaymentMethod",[t])}),this.rpcServer.define("sendUnlockedNonce",function(t){e.merchantFormManager.setNoncePayload(t)}),this.rpcServer.define("clearNonce",function(){e.merchantFormManager.clearNoncePayload()}),this.rpcServer.define("closeDropInModal",function(){e._hideModal()}),this.rpcServer.define("setInlineFrameHeight",function(t){e.frames.inline.element.style.height=t+"px"}),this.bus.register("ready",function(t){t.source===e.frames.inline.element.contentWindow?e.frames.inline.rpcClient=new l.RPCClient(e.bus,t.source):t.source===e.frames.modal.element.contentWindow&&(e.frames.modal.rpcClient=new l.RPCClient(e.bus,t.source))})},o.prototype._createFrame=function(t,e){return new f(t,e)},o.prototype._initializeModal=function(){this.frames.modal.element.style.display="none",this.frames.modal.element.style.position=i()?"absolute":"fixed",this.frames.modal.element.style.top="0",this.frames.modal.element.style.left="0",this.frames.modal.element.style.height="100%",this.frames.modal.element.style.width="100%"},o.prototype._lockMerchantWindowSize=function(){setTimeout(function(){s.style.overflow="hidden",a.style.overflow="hidden",a.style.height="100%",i()&&(s.style.position="relative",s.style.height=window.innerHeight+"px")},160)},o.prototype._unlockMerchantWindowSize=function(){var t=this.merchantPageDefaultStyles;a.style.height=t.body.height,a.style.overflow=t.body.overflow,s.style.overflow=t.html.overflow,i()&&(s.style.height=t.html.height,s.style.position=t.html.position)},o.prototype._showModal=function(){var t=this,e=this.frames.modal.element;this.merchantPageDefaultStyles=r(),e.style.display="block",this.frames.modal.rpcClient.invoke("open",[],function(){setTimeout(function(){t._lockMerchantWindowSize(),e.contentWindow.focus()},200)})},o.prototype._hideModal=function(){this._unlockMerchantWindowSize(),this.frames.modal.element.style.display="none"},o.prototype._configurePayPal=function(){y.isPopupSupported()||(this.ppClient=new m({clientToken:this.clientToken,paypal:this.paypalOptions}),this.rpcServer.define("openPayPalModal",p.bind(this.ppClient._openModal,this.ppClient))),c.on("receivePayPalData",p.bind(this._handleAltPayData,this))},o.prototype._handleAltPayData=function(t){this.merchantFormManager.setNoncePayload(t),this.frames.inline.rpcClient.invoke("receiveNewPaymentMethod",[t]),this.frames.modal.rpcClient.invoke("modalViewClose")},o.prototype._findClosest=function(t,e){e=e.toUpperCase();do if(t.nodeName===e)return t;while(t=t.parentNode);throw"Unable to find a valid "+e},e.exports=o},{"../shared/constants":249,"../shared/paypal-service":250,"./api-proxy-server":244,"./frame-container":247,"./merchant-form-manager":248,"braintree-api":107,"braintree-bus":136,"braintree-paypal/src/shared/util/browser":208,"braintree-rpc":216,"braintree-utilities":228}],246:[function(t,e){"use strict";function n(t){var e=new r(t);return e.initialize(),e}var r=t("./client"),i="1.8.3";e.exports={create:n,VERSION:i}},{"./client":245}],247:[function(t,e){"use strict";function n(){var t,e=document.createElement("fakeelement");for(t in u)if("undefined"!=typeof e.style[t])return u[t];return null}function r(t){function e(n){n.target===t&&"height"===n.propertyName&&(o.emit(o.events.ASYNC_DEPENDENCY_READY),t.removeEventListener(r,e))}var r=n();r?t.addEventListener(r,e):setTimeout(function(){o.emit(o.events.ASYNC_DEPENDENCY_READY)},500)}function i(t,e){var n="height 210ms cubic-bezier(0.390, 0.575, 0.565, 1.000)";this.element=a({name:e,width:"100%",height:"68",style:{transition:n,WebkitTransition:n,MozTransition:n,msTransition:n,OTransition:n,border:"0",zIndex:"9999"}}),this.element.src=t,e===s.INLINE_FRAME_NAME&&r(this.element)}var o=t("braintree-bus"),s=t("../shared/constants"),a=t("iframer"),u={transition:"transitionend","-o-transition":"otransitionEnd","-moz-transition":"transitionend","-webkit-transition":"webkitTransitionEnd"};e.exports=i},{"../shared/constants":249,"braintree-bus":136,iframer:230}],248:[function(t,e){"use strict";function n(t){this.formNapper=new i(t.form),this.frames=t.frames,this.onSubmit=t.onSubmit,this.apiClient=t.apiClient}var r=t("braintree-utilities"),i=t("form-napper");n.prototype.initialize=function(){return this._isSubmitBased()&&this._setElements(),this._setEvents(),this},n.prototype.setNoncePayload=function(t){this.noncePayload=t},n.prototype.clearNoncePayload=function(){this.noncePayload=null},n.prototype._isSubmitBased=function(){return!this.onSubmit},n.prototype._isCallbackBased=function(){return!!this.onSubmit},n.prototype._setElements=function(){this.formNapper.inject("payment_method_nonce","")},n.prototype._setEvents=function(){this.formNapper.hijack(r.bind(this._handleFormSubmit,this))},n.prototype._handleFormSubmit=function(t){this.noncePayload&&this.noncePayload.nonce?this._handleNonceReply(t):this.frames.inline.rpcClient.invoke("requestNonce",[],r.bind(function(e){this.setNoncePayload(e),this._handleNonceReply(t)},this))},n.prototype._handleNonceReply=function(t){this._isCallbackBased()?this.apiClient.sendAnalyticsEvents("dropin.web.end.callback",r.bind(function(){var e=this.noncePayload;e.originalEvent=t,this.onSubmit(e),setTimeout(r.bind(function(){this.frames.inline.rpcClient.invoke("clearLoadingState"),this.frames.inline.rpcClient.invoke("receiveNewPaymentMethod",[e])},this),200)},this)):this._triggerFormSubmission()},n.prototype._triggerFormSubmission=function(){this.formNapper.inject("payment_method_nonce",this.noncePayload.nonce),this.apiClient.sendAnalyticsEvents("dropin.web.end.auto-submit",r.bind(function(){this.formNapper.submit()},this))},e.exports=n},{"braintree-utilities":228,"form-napper":229}],249:[function(t,e){e.exports={PAYPAL_INTEGRATION_NAME:"PayPal",INLINE_FRAME_NAME:"braintree-dropin-frame",MODAL_FRAME_NAME:"braintree-dropin-modal-frame",PAYMENT_METHOD_TYPES:["CoinbaseAccount","PayPalAccount","CreditCard"],cssClassMap:{"American Express":"american-express","Diners Club":"diners-club",DinersClub:"diners-club",Discover:"discover",JCB:"jcb",Maestro:"maestro",MasterCard:"master-card",Solo:"solo",Switch:"switch",UKMaestro:"maestro",UnionPay:"unionpay",Visa:"visa"}}},{}],250:[function(t,e){"use strict";function n(t){var e=t.clientToken,n=t.paypal||{},i=new r(e,{container:document.createElement("div"),displayName:n.displayName,locale:n.locale,singleUse:n.singleUse,amount:n.amount,currency:n.currency,onSuccess:n.onSuccess,enableShippingAddress:n.enableShippingAddress,shippingAddressOverride:n.shippingAddressOverride,enableBillingAddress:n.enableBillingAddress});return i.initialize(),i}var r=t("braintree-paypal/src/external/client");e.exports=n},{"braintree-paypal/src/external/client":197}],251:[function(t,e){(function(t){"use strict";function n(t,e){e=e||{};var i,s,a=t.children;for(s=0;s<a.length;s++)if(i=a[s],o(i)){var u=i.getAttribute("data-braintree-name");"postal_code"===u?e.billingAddress={postalCode:i.value}:e[u]=i.value,r(i)}else i.children&&i.children.length>0&&n(i,e);return e}function r(t){try{t.attributes.removeNamedItem("name")}catch(e){}}function i(t){n(t)}function o(t){return t.nodeType===s&&t.attributes["data-braintree-name"]}var s=t.Node?t.Node.ELEMENT_NODE:1;e.exports={extractValues:n,scrubAllAttributes:i,scrubAttributes:r,isBraintreeNode:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],252:[function(t,e){"use strict";function n(t,e,n,r){this.client=t,this.htmlForm=e,this.isCreditCardForm=r===!1?!1:!0,this.paymentMethodNonceInput=n,this.model=new s,this.setEvents()}var r=t("braintree-utilities"),i=t("./fields"),o=t("braintree-bus"),s=t("./models/payment-method-model"),a={message:"Unable to process payments at this time",type:"IMMEDIATE"};n.prototype.setEvents=function(){this.onSubmitHandler=r.bind(this.handleSubmit,this),this.onExternalNonceReceived=r.bind(this.onExternalNonceReceived,this),this.clearExternalNonce=r.bind(this.clearExternalNonce,this),r.addEventListener(this.htmlForm,"submit",this.onSubmitHandler),o.on(o.events.PAYMENT_METHOD_GENERATED,this.onExternalNonceReceived),o.on(o.events.PAYMENT_METHOD_CANCELLED,this.clearExternalNonce)},n.prototype.handleSubmit=function(t){var e;return t.preventDefault?t.preventDefault():t.returnValue=!1,this.isCreditCardForm?(e=this.model.get("type"),e&&"CreditCard"!==e?(i.scrubAllAttributes(this.htmlForm),void this.onNonceReceived(null,this.model.attributes)):void this.client.tokenizeCard(i.extractValues(this.htmlForm),r.bind(function(t,e,n){t?this.onNonceReceived(a,null):(this.model.set({nonce:e,type:n.type,details:n.details}),this.onNonceReceived(null,this.model.attributes))},this))):void this.onNonceReceived(null,this.model.attributes)},n.prototype.writeNonceToDOM=function(){this.paymentMethodNonceInput.value=this.model.get("nonce")},n.prototype.onExternalNonceReceived=function(t){this.model.set(t),this.writeNonceToDOM()},n.prototype.clearExternalNonce=function(){this.model.reset()},n.prototype.onNonceReceived=function(t){var e=this.htmlForm;return t?void o.emit(o.events.ERROR,a):(r.removeEventListener(e,"submit",this.onSubmitHandler),this.writeNonceToDOM(),void(e.submit&&("function"==typeof e.submit||e.submit.call)?e.submit():setTimeout(function(){e.querySelector('[type="submit"]').click()},1)))},e.exports=n},{"./fields":251,"./models/payment-method-model":254,"braintree-bus":257,"braintree-utilities":264}],253:[function(t,e){"use strict";e.exports=function(t){var e;if("object"==typeof t)return t;e="payment_method_nonce","string"==typeof t&&(e=t);var n=document.createElement("input");return n.name=e,n.type="hidden",n}},{}],254:[function(t,e){"use strict";function n(){this.reset()}n.prototype.get=function(t){return this.attributes[t]},n.prototype.set=function(t){this.attributes=t||{}},n.prototype.reset=function(){this.attributes={}},e.exports=n},{}],255:[function(t,e){"use strict";e.exports=function(t){for(var e=t.getElementsByTagName("*"),n={},r=0;r<e.length;r++){var i=e[r].getAttribute("data-braintree-name");n[i]=!0}if(!n.number)throw new Error('Unable to find an input with data-braintree-name="number" in your form. Please add one.');if(n.expiration_date){if(n.expiration_month||n.expiration_year)throw new Error('You have inputs with data-braintree-name="expiration_date" AND data-braintree-name="expiration_(year|month)". Please use either "expiration_date" or "expiration_year" and "expiration_month".')}else{if(!n.expiration_month&&!n.expiration_year)throw new Error('Unable to find an input with data-braintree-name="expiration_date" in your form. Please add one.');if(!n.expiration_month)throw new Error('Unable to find an input with data-braintree-name="expiration_month" in your form. Please add one.');if(!n.expiration_year)throw new Error('Unable to find an input with data-braintree-name="expiration_year" in your form. Please add one.')}}},{}],256:[function(t,e){"use strict";function n(t,e){var n,s,a=document.getElementById(e.id),u=e&&e.hasOwnProperty("useCreditCard")?e.useCreditCard:!0;if(!a)throw new Error('Unable to find form with id: "'+e.id+'"');return u&&i(a),n=o(e.paymentMethodNonceInputField),a.appendChild(n),s=new r(t,a,n,u)}var r=t("./lib/form"),i=t("./lib/validate-annotations"),o=t("./lib/get-nonce-input");e.exports={setup:n}},{"./lib/form":252,"./lib/get-nonce-input":253,"./lib/validate-annotations":255}],257:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{"./lib/events":258,dup:50,framebus:259}],258:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],259:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],260:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],261:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],262:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],263:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],264:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{"./lib/dom":260,"./lib/events":261,"./lib/fn":262,"./lib/url":263,dup:26}],265:[function(t,e,n){arguments[4][2][0].apply(n,arguments)},{"./coinbase-account":266,"./credit-card":268,"./europe-bank-account":269,"./normalize-api-fields":271,"./parse-client-token":272,"./paypal-account":273,"./request/choose-driver":276,"./sepa-mandate":281,"./should-enable-cors":282,"./util":283,"braintree-3ds":292,"braintree-utilities":304,dup:2}],266:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{dup:3}],267:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],268:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],269:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],270:[function(t,e,n){arguments[4][7][0].apply(n,arguments)},{"./parse-client-token":272,"./request/choose-driver":276,"./should-enable-cors":282,"./util":283,dup:7}],271:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{dup:8}],272:[function(t,e,n){arguments[4][9][0].apply(n,arguments)},{"./polyfill":274,"braintree-utilities":304,dup:9}],273:[function(t,e,n){arguments[4][10][0].apply(n,arguments)},{dup:10}],274:[function(t,e,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],275:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{"../constants":267,"../util":283,"./parse-body":279,"./prep-body":280,dup:12}],276:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"../util":283,"./ajax-driver":275,"./jsonp-driver":277,dup:13}],277:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{"../constants":267,"./jsonp":278,dup:14}],278:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{"../util":283,dup:15}],279:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{dup:16}],280:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{dup:17,"lodash.isstring":312}],281:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],282:[function(t,e,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],283:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{dup:20,"lodash.isempty":305,"lodash.isobject":311}],284:[function(t,e,n){arguments[4][21][0].apply(n,arguments)},{"./lib/client":265,"./lib/get-configuration":270,"./lib/parse-client-token":272,"./lib/util":283,dup:21}],285:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],286:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],287:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],288:[function(t,e,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],289:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{"./lib/dom":285,"./lib/events":286,"./lib/fn":287,"./lib/url":288,dup:26}],290:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{"../shared/receiver":297,"braintree-utilities":289,dup:27}],291:[function(t,e,n){arguments[4][28][0].apply(n,arguments)},{"./authorization_service":290,"./loader":293,"braintree-utilities":289,dup:28}],292:[function(t,e,n){arguments[4][29][0].apply(n,arguments)},{"./client":291,dup:29}],293:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{"./loader_display":294,"./loader_message":295,"./loader_spinner":296,dup:30}],294:[function(t,e,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],295:[function(t,e,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],296:[function(t,e,n){arguments[4][33][0].apply(n,arguments)},{dup:33}],297:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"braintree-utilities":289,dup:34}],298:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],299:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],300:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],301:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],302:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],303:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{"./array":298,dup:40}],304:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./lib/array":298,"./lib/dom":299,"./lib/events":300,"./lib/fn":301,"./lib/string":302,"./lib/url":303,dup:41}],305:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{dup:42,"lodash.isarguments":306,"lodash.isarray":307,"lodash.isfunction":308,"lodash.isstring":312,"lodash.keys":309}],306:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{dup:43}],307:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44}],308:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],309:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46,"lodash._getnative":310,"lodash.isarguments":306,"lodash.isarray":307}],310:[function(t,e,n){arguments[4][47][0].apply(n,arguments)},{dup:47}],311:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48}],312:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],313:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{"./lib/events":314,dup:50,framebus:315}],314:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{dup:51}],315:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],316:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],317:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],318:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],319:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],320:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],321:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{"./array":316,dup:40}],322:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./lib/array":316,"./lib/dom":317,"./lib/events":318,"./lib/fn":319,"./lib/string":320,"./lib/url":321,dup:41}],323:[function(t,e,n){arguments[4][197][0].apply(n,arguments)},{"../shared/constants":328,"../shared/get-locale":330,"../shared/util/browser":335,"../shared/util/dom":336,"../shared/util/util":337,"./logged-in-view":325,"./logged-out-view":326,"./overlay-view":327,"braintree-api":284,"braintree-bus":313,"braintree-utilities":322,dup:197}],324:[function(t,e){function n(t,e){if(!i.detectedPostMessage())return void("function"==typeof e.onUnsupported&&e.onUnsupported(new Error("unsupported browser detected")));var n=new r(t,e);return n.initialize(),n}var r=t("./client"),i=t("../shared/util/browser"),o="1.5.3";e.exports={create:n,_browser:i,VERSION:o}},{"../shared/util/browser":335,"./client":323}],325:[function(t,e,n){arguments[4][198][0].apply(n,arguments)},{"../shared/constants":328,dup:198}],326:[function(t,e,n){arguments[4][199][0].apply(n,arguments)},{"../shared/constants":328,"../shared/get-locale":330,"braintree-utilities":322,dup:199}],327:[function(t,e,n){arguments[4][200][0].apply(n,arguments)},{"../shared/constants":328,"braintree-utilities":322,dup:200}],328:[function(t,e,n){arguments[4][201][0].apply(n,arguments)},{dup:201}],329:[function(t,e,n){arguments[4][202][0].apply(n,arguments)},{dup:202}],330:[function(t,e,n){arguments[4][203][0].apply(n,arguments)},{"../shared/data/country-code-lookup":329,dup:203}],331:[function(t,e,n){arguments[4][204][0].apply(n,arguments)},{"./platform":333,"./useragent":334,dup:204}],332:[function(t,e,n){arguments[4][205][0].apply(n,arguments)},{"./platform":333,"./useragent":334,dup:205}],333:[function(t,e,n){arguments[4][206][0].apply(n,arguments)},{"./useragent":334,dup:206}],334:[function(t,e,n){arguments[4][207][0].apply(n,arguments)},{dup:207}],335:[function(t,e,n){arguments[4][208][0].apply(n,arguments)},{"../useragent/browser":331,"../useragent/device":332,"../useragent/platform":333,"../useragent/useragent":334,dup:208}],336:[function(t,e,n){arguments[4][209][0].apply(n,arguments)},{dup:209}],337:[function(t,e,n){arguments[4][210][0].apply(n,arguments)},{dup:210}],338:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],339:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],340:[function(t,e,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],341:[function(t,e,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],342:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],343:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{"./array":338,dup:40}],344:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./lib/array":338,"./lib/dom":339,"./lib/events":340,"./lib/fn":341,"./lib/string":342,"./lib/url":343,dup:41}],345:[function(t,e){function n(t,e,n){return"function"==typeof e?r(t,!0,i(e,n,1)):r(t,!0)}var r=t("lodash._baseclone"),i=t("lodash._bindcallback");e.exports=n},{"lodash._baseclone":346,"lodash._bindcallback":356}],346:[function(t,e){(function(n){function r(t,e,n,o,d,m,y){var b;if(n&&(b=d?n(t,o,d):n(t)),void 0!==b)return b;if(!c(t))return t;var v=f(t);if(v){if(b=s(t),!e)return l(t,b)}else{var _=V.call(t),w=_==E;if(_!=A&&_!=g&&(!w||d))return B[_]?u(t,_,e):d?t:{};if(b=a(w?{}:t),!e)return h(b,t)}m||(m=[]),y||(y=[]);for(var C=m.length;C--;)if(m[C]==t)return y[C];return m.push(t),y.push(b),(v?p:i)(t,function(i,o){b[o]=r(i,e,n,o,t,m,y)}),b}function i(t,e){return d(t,e,m)}function o(t){var e=new Y(t.byteLength),n=new q(e);return n.set(new q(t)),e}function s(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&H.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function a(t){var e=t.constructor;return"function"==typeof e&&e instanceof e||(e=Object),new e}function u(t,e,n){var r=t.constructor;switch(e){case P:return o(t);case b:case v:return new r(+t);case N:case I:case R:case k:case D:case M:case U:case L:case F:var i=t.buffer;return new r(n?o(i):i,t.byteOffset,t.length);case C:case T:return new r(t);case S:var s=new r(t.source,j.exec(t));s.lastIndex=t.lastIndex}return s}function c(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var l=t("lodash._arraycopy"),p=t("lodash._arrayeach"),h=t("lodash._baseassign"),d=t("lodash._basefor"),f=t("lodash.isarray"),m=t("lodash.keys"),g="[object Arguments]",y="[object Array]",b="[object Boolean]",v="[object Date]",_="[object Error]",E="[object Function]",w="[object Map]",C="[object Number]",A="[object Object]",S="[object RegExp]",x="[object Set]",T="[object String]",O="[object WeakMap]",P="[object ArrayBuffer]",N="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",k="[object Int16Array]",D="[object Int32Array]",M="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",F="[object Uint32Array]",j=/\w*$/,B={};B[g]=B[y]=B[P]=B[b]=B[v]=B[N]=B[I]=B[R]=B[k]=B[D]=B[C]=B[A]=B[S]=B[T]=B[M]=B[U]=B[L]=B[F]=!0,B[_]=B[E]=B[w]=B[x]=B[O]=!1;var z=Object.prototype,H=z.hasOwnProperty,V=z.toString,Y=n.ArrayBuffer,q=n.Uint8Array;e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._arraycopy":347,"lodash._arrayeach":348,"lodash._baseassign":349,"lodash._basefor":351,"lodash.isarray":352,"lodash.keys":353}],347:[function(t,e){function n(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}e.exports=n},{}],348:[function(t,e){function n(t,e){for(var n=-1,r=t.length;++n<r&&e(t[n],n,t)!==!1;);return t}e.exports=n},{}],349:[function(t,e,n){arguments[4][77][0].apply(n,arguments)},{dup:77,"lodash._basecopy":350,"lodash.keys":353}],350:[function(t,e,n){arguments[4][78][0].apply(n,arguments)},{dup:78}],351:[function(t,e){function n(t){return function(e,n,i){for(var o=r(e),s=i(e),a=s.length,u=t?a:-1;t?u--:++u<a;){var c=s[u];if(n(o[c],c,o)===!1)break}return e}}function r(t){return i(t)?t:Object(t)}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var o=n();e.exports=o},{}],352:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44}],353:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{dup:46,"lodash._getnative":354,"lodash.isarguments":355,"lodash.isarray":352}],354:[function(t,e,n){arguments[4][47][0].apply(n,arguments)},{dup:47}],355:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{dup:43}],356:[function(t,e,n){arguments[4][80][0].apply(n,arguments)},{dup:80}],357:[function(t,e){"use strict";function n(t){var e,n={};if(t){for(e in t)t.hasOwnProperty(e)&&(n[r(e)]=t[e]);return n}}function r(t){return t.replace(/([A-Z])/g,function(t){return"_"+t.toLowerCase()})}e.exports={convertToLegacyShippingAddress:n}},{}],358:[function(t,e){"use strict";e.exports={ROOT_SUCCESS_CALLBACK:"onPaymentMethodReceived",ROOT_ERROR_CALLBACK:"onError",ROOT_READY_CALLBACK:"onReady"}},{}],359:[function(t,e){"use strict";function n(t){var e=s(t.merchantConfiguration);return o.on(o.events.PAYMENT_METHOD_GENERATED,function(t){o.emit(o.events.PAYMENT_METHOD_RECEIVED,t)}),e.configuration=s(t.gatewayConfiguration),e.coinbase=s(e.coinbase||{}),e.apiClient=new r.Client({enableCORS:t.merchantConfiguration.enableCORS,clientToken:t.gatewayConfiguration,integration:"coinbase"}),i.create(e)}var r=t("braintree-api"),i=t("braintree-coinbase"),o=t("braintree-bus"),s=t("lodash.clonedeep");e.exports={initialize:n}},{"braintree-api":21,"braintree-bus":50,"braintree-coinbase":53,"lodash.clonedeep":345}],360:[function(t,e){"use strict";function n(t){var e,n={clientToken:t.gatewayConfiguration,integration:t.integrationType};t.merchantConfiguration.enableCORS&&(n.enableCORS=!0),e=new a.Client(n),r(t,e),i(t),o(t,e)}function r(t,e){var n,r=t.merchantConfiguration,i=r[h.ROOT_SUCCESS_CALLBACK];r.id?(n=u.setup(e,r),p.isFunction(i)&&(n.onNonceReceived=function(t,e){t?d.emit(d.events.ERROR,t):i(e)})):d.on(d.events.PAYMENT_METHOD_GENERATED,function(t){d.emit(d.events.PAYMENT_METHOD_RECEIVED,t)})}function i(t){var e,n,r,i,o=t.merchantConfiguration,a=o.paypal;a&&(e=s(o,"paypal"),n=e("onSuccess"),r=e("onCancelled"),a.paymentMethodNonceInputField||(i=document.createElement("input"),i.id="braintree-custom-integration-dummy-input",a.paymentMethodNonceInputField=i),a.onSuccess=function(t){d.emit(d.events.PAYMENT_METHOD_GENERATED,t),n.apply(null,[t.nonce,t.details.email,f(t.details.shippingAddress)])},a.onCancelled=function(){d.emit(d.events.PAYMENT_METHOD_CANCELLED),r()},o.enableCORS&&(a.enableCORS=!0),c.create(t.gatewayConfiguration,a))}function o(t,e){var n=t.merchantConfiguration;n.coinbase&&(n.configuration=t.gatewayConfiguration,n.apiClient=e,delete n.paypal,l.create(n))}function s(t,e){return function(n){return e in t&&p.isFunction(t[e][n])?t[e][n]:function(){}}}var a=t("braintree-api"),u=t("braintree-form"),c=t("braintree-paypal"),l=t("braintree-coinbase"),p=t("braintree-utilities"),h=t("../constants"),d=t("braintree-bus"),f=t("../compatibility").convertToLegacyShippingAddress;e.exports={initialize:n}},{"../compatibility":357,"../constants":358,"braintree-api":21,"braintree-bus":50,"braintree-coinbase":53,"braintree-form":256,"braintree-paypal":324,"braintree-utilities":344}],361:[function(t,e){"use strict";function n(t){return s.isFunction(t.paymentMethodNonceReceived)?t.paymentMethodNonceReceived:null}function r(t){return s.isFunction(t[u.ROOT_SUCCESS_CALLBACK])}function i(t){var e=t.merchantConfiguration,i=n(e),s=r(e);return(i||s)&&(e.paymentMethodNonceReceived=function(t){i&&i.apply(null,[t.originalEvent,t.nonce]),delete t.originalEvent,a.emit(a.events.PAYMENT_METHOD_RECEIVED,c(t))}),o.create(t)}var o=t("braintree-dropin"),s=t("braintree-utilities"),a=t("braintree-bus"),u=t("../constants"),c=t("../lib/sanitize-payload");e.exports={initialize:i}},{"../constants":358,"../lib/sanitize-payload":366,"braintree-bus":50,"braintree-dropin":246,"braintree-utilities":344}],362:[function(t,e){"use strict";e.exports={custom:t("./custom"),dropin:t("./dropin"),paypal:t("./paypal"),coinbase:t("./coinbase")}},{"./coinbase":359,"./custom":360,"./dropin":361,"./paypal":363}],363:[function(t,e){"use strict";function n(t){return"onSuccess"in t&&s.isFunction(t.onSuccess)?t.onSuccess:"paypal"in t&&s.isFunction(t.paypal.onSuccess)?t.paypal.onSuccess:null}function r(t){return s.isFunction(t[a.ROOT_SUCCESS_CALLBACK])}function i(t){var e=t.merchantConfiguration,i=n(e),s=r(e);return(i||s)&&(e.onSuccess=function(t){i&&i.apply(null,[t.nonce,t.details.email,c(t.details.shippingAddress)]),u.emit(u.events.PAYMENT_METHOD_RECEIVED,t)}),o.create(t.gatewayConfiguration,e)}var o=t("braintree-paypal"),s=t("braintree-utilities"),a=t("../constants"),u=t("braintree-bus"),c=t("../compatibility").convertToLegacyShippingAddress;e.exports={initialize:i}},{"../compatibility":357,"../constants":358,"braintree-bus":50,"braintree-paypal":324,"braintree-utilities":344}],364:[function(t,e){"use strict";function n(t){var e="web."+t.integrationType+".",n=i.configure({enableCORS:t.merchantConfiguration.enableCORS,clientToken:t.gatewayConfiguration,analyticsConfiguration:t.analyticsConfiguration,integration:t.integrationType}),s=r(e,n);o.on(o.events.SEND_ANALYTICS_EVENTS,s)}function r(t,e){return function(n,r){var i;for(n instanceof Array||(n=[n]),i=0;i<n.length;i++)n[i]=t+n[i];e.sendAnalyticsEvents(n,r)}}var i=t("braintree-api"),o=t("braintree-bus");e.exports={listenForAnalytics:n,_createSender:r}},{"braintree-api":21,"braintree-bus":50}],365:[function(t,e){"use strict";function n(t){this.callback=t,this.counter=0,this.attachEvents()}var r=t("braintree-bus"),i=t("braintree-utilities");n.prototype.attachEvents=function(){this.initHandler=i.bind(this.handleDependencyInitializing,this),this.readyHandler=i.bind(this.handleDependencyReady,this),r.on(r.events.ASYNC_DEPENDENCY_INITIALIZING,this.initHandler),r.on(r.events.ASYNC_DEPENDENCY_READY,this.readyHandler)},n.prototype.handleDependencyInitializing=function(){this.counter++},n.prototype.handleDependencyReady=function(){this.counter--,0===this.counter&&(this.detachEvents(),this.callback())},n.prototype.detachEvents=function(){r.off(r.events.ASYNC_DEPENDENCY_INITIALIZING,this.initHandler),r.off(r.events.ASYNC_DEPENDENCY_READY,this.readyHandler)},e.exports=function(t){return new n(t)}},{"braintree-bus":50,"braintree-utilities":344}],366:[function(t,e){"use strict";e.exports=function(t){return{nonce:t.nonce,details:t.details,type:t.type}}},{}]},{},[1])(1)});
@@ -54,6 +54,32 @@ describe 'Braintree::Customer.create' do
54
54
  expect(result).to be_success
55
55
  end
56
56
 
57
+ it 'creates a credit card from payment method nonce in credit card hash' do
58
+ nonce = FakeBraintree::PaymentMethod.tokenize_card({
59
+ number: TEST_CC_NUMBER,
60
+ expiration_date: '04/2016'
61
+ })
62
+ result = Braintree::Customer.create(
63
+ credit_card: { payment_method_nonce: nonce }
64
+ )
65
+
66
+ credit_cards = Braintree::Customer.find(result.customer.id).credit_cards
67
+ expect(credit_cards.size).to eq 1
68
+ expect(credit_cards.first.expiration_date).to eq '04/2016'
69
+ end
70
+
71
+ it 'creates a credit card from payment method nonce' do
72
+ nonce = FakeBraintree::PaymentMethod.tokenize_card({
73
+ number: TEST_CC_NUMBER,
74
+ expiration_date: '04/2016'
75
+ })
76
+ result = Braintree::Customer.create('payment_method_nonce' => nonce)
77
+
78
+ credit_cards = Braintree::Customer.find(result.customer.id).credit_cards
79
+ expect(credit_cards.size).to eq 1
80
+ expect(credit_cards.first.expiration_date).to eq '04/2016'
81
+ end
82
+
57
83
  it 'does not overwrite a passed customer id' do
58
84
  result = Braintree::Customer.create({ 'id' => '123' })
59
85
 
@@ -34,6 +34,26 @@ describe 'Braintree::PaymentMethod.update' do
34
34
  end
35
35
  end
36
36
 
37
+ describe 'Braintree::PaymentMethod.delete' do
38
+ it 'successfully deletes a payment method' do
39
+ token = cc_token # creates card
40
+
41
+ result = Braintree::PaymentMethod.delete(token)
42
+
43
+ expect(result).to eq true
44
+
45
+ expect {
46
+ Braintree::PaymentMethod.find(token)
47
+ }.to raise_error(Braintree::NotFoundError)
48
+ end
49
+
50
+ it 'raises an error for a nonexistent payment method' do
51
+ expect {
52
+ Braintree::PaymentMethod.delete('foo')
53
+ }.to raise_error(Braintree::NotFoundError)
54
+ end
55
+ end
56
+
37
57
  describe 'Braintree::PaymentMethod.create' do
38
58
  it 'allows creating a credit card without a customer' do
39
59
  nonce = FakeBraintree::PaymentMethod.tokenize_card(build_credit_card_hash)