btcpayserver/BTCPayServer/wwwroot/vendor/bc-ur/web-bundle.js

2 lines
41 KiB
JavaScript
Raw Normal View History

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).bcur=t()}}((function(){for(var t=function(t){var r;return function(e){return r||t(r={exports:{},parent:e},r.exports),r.exports}},r=t((function(t,r){(function(t){(function(){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeBc32Data=r.encodeBc32Data=r.Bech32Version=void 0;var i,o=n(e({}));!function(t){t[t.Origin=1]="Origin",t[t.bis=2]="bis"}(i=r.Bech32Version||(r.Bech32Version={}));var h=function(t,r,e,n){for(var i=0,o=0,h=[],s=(1<<e)-1,u=0;u<t.length;++u){var f=t[u];if(f<0||f>>r!=0)return null;for(i=i<<r|f,o+=r;o>=e;)o-=e,h.push(i>>o&s)}if(n)o>0&&h.push(i<<e-o&s);else if(o>=r||i<<e-o&s)return null;return h};r.encodeBc32Data=function(r){var e=t.from(r,"hex"),n=h(e,8,5,!0);if(n)return o.default.encode(void 0,n,i.bis);throw new Error("invalid input")},r.decodeBc32Data=function(r){var e=o.default.decode(r);if(e){var n=h(t.from(e.data),5,8,!1);return n?t.from(n).toString("hex"):null}return null}}).call(this)}).call(this,n({}).Buffer)})),e=t((function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r({}),i="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o=[996825010,642813549,513874426,1027748829,705979059],h=function(t){for(var r=1,e=0;e<t.length;++e){var n=r>>25;r=(33554431&r)<<5^t[e];for(var i=0;i<6;++i)n>>i&1&&(r^=o[i])}return r},s=function(t){var r,e=[];for(r=0;r<t.length;++r)e.push(t.charCodeAt(r)>>5);for(e.push(0),r=0;r<t.length;++r)e.push(31&t.charCodeAt(r));return e},u=function(t,r,e){var i;i=t?s(t):[0];var o=e===n.Bech32Version.Origin?1:1073741823;return h(i.concat(r))===o};e.default={encode:function(t,r,e){var o,u=r.concat(function(t,r,e){var i;i=t?s(t).concat(r).concat([0,0,0,0,0,0]):[0].concat(r).concat([0,0,0,0,0,0]);for(var o=e===n.Bech32Version.Origin?1:1073741823,u=h(i)^o,f=[],a=0;a<6;++a)f.push(u>>5*(5-a)&31);return f}(t,r,e));o=t?t+"1":"";for(var f=0;f<u.length;++f)o+=i.charAt(u[f]);return o},decode:function(t){var r,e=!1,o=!1;for(r=0;r<t.length;++r){if(t.charCodeAt(r)<33||t.charCodeAt(r)>126)return null;t.charCodeAt(r)>=97&&t.charCodeAt(r)<=122&&(e=!0),t.charCodeAt(r)>=65&&t.charCodeAt(r)<=90&&(o=!0)}if(e&&o)return null;var h=(t=t.toLowerCase()).lastIndexOf("1");if(-1===h)return function(t){for(var r=[],e=0;e<t.length;++e){var o=i.indexOf(t.charAt(e));if(-1===o)return null;r.push(o)}return u(void 0,r,n.Bech32Version.bis)?{hrp:null,data:r.slice(0,r.length-6)}:null}(t);if(h<1||h+7>t.length||t.length>90)return null;var s=t.substring(0,h),f=[];for(r=h+1;r<t.length;++r){var a=i.indexOf(t.charAt(r));if(-1===a)return null;f.push(a)}return u(s,f,n.Bech32Version.Origin)?{hrp:s,data:f.slice(0,f.length-6)}:null}}})),n=t((function(t,r){(function(t){(function(){"use strict";r.Buffer=e,r.SlowBuffer=function(t){return+t!=t&&(t=0),e.alloc(+t)},r.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return r.__proto__=e.prototype,r}function e(t,r,e){if("number"==typeof t){if("string"==typeof r)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return n(t,r,e)}function n(r,n,i){if("string"==typeof r)return function(r,n){if("string"==typeof n&&""!==n||(n="utf8"),!e.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=0|f(r,n),o=t(i),h=o.write(r,n);return h!==i&&(o=o.slice(0,h)),o}(r,n);if(ArrayBuffer.isView(r))return s(r);if(null==r)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(P(r,ArrayBuffer)||r&&P(r.buffer,ArrayBuffer))return function(t,r,n){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(n||0))throw new RangeError('"length" is outside of buffer bounds');v