!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=new(n(1).CashP)(window);window.cashp=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),r=function(){return function(t){this.window=t,this.badgerButton=new o.BadgerButton(this.window)}}();e.CashP=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="Your BadgerWallet is locked. Please open it in your browser toolbar and enter your password before sending money.",r=function(){function t(t){var e=this;this.window=t,this.window.document.addEventListener("DOMContentLoaded",function(){e.addEventListeners()},!1)}return t.prototype.isInstalled=function(){return void 0!==this.window.web4bch},t.prototype.isLoggedIn=function(){var t=this.window;return"string"==typeof t.web4bch.bch.defaultAccount&&""!==t.web4bch.bch.defaultAccount},t.prototype.addEventListeners=function(){for(var e=this,n=this.window.document.getElementsByClassName("cashp-button"),r=0;r<n.length;r++)n[r].addEventListener("click",function(n){!1===e.isInstalled()?e.window.open(t.INSTALL_URL,"",""):!1===e.isLoggedIn()?(n.preventDefault(),e.window.alert(o)):e.sendPayment(n.target)})},t.prototype.sendPayment=function(t){var e=this,n=this.window,o=n.web4bch;o=new n.Web4Bch(o.currentProvider);var r=t.getAttribute("data-tokens"),i={to:t.getAttribute("data-to"),from:o.bch.defaultAccount,value:r||t.getAttribute("data-satoshis")};r&&(i.sendTokenData={tokenId:t.getAttribute("data-token-id"),tokenProtocol:"slp"}),o.bch.sendTransaction(i,function(n,o){if(n)e.window.console.log("Error sending payment",n);else{var r=t.getAttribute("data-success-callback");r&&"function"==typeof e.window[r]&&e.window[r](o)}})},t.INSTALL_URL="https://badger.bitcoin.com/",t}();e.BadgerButton=r}]);
//# sourceMappingURL=bundle.js.map