-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnebPay.min.js
1 lines (1 loc) · 53.2 KB
/
nebPay.min.js
1
require=function i(a,u,s){function f(e,t){if(!u[e]){if(!a[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(c)return c(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=u[e]={exports:{}};a[e][0].call(o.exports,function(t){return f(a[e][1][t]||t)},o,o.exports,i,a,u,s)}return u[e].exports}for(var c="function"==typeof require&&require,t=0;t<s.length;t++)f(s[t]);return f}({1:[function(t,e,r){"use strict";e.exports={isChrome:function(){if("undefined"!=typeof window&&navigator.userAgent.toLowerCase().match(/chrome\/([\d\.]+)/))return!0;return!1},randomCode:function(t){var e,r,n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",o="";for(e=0;e<t;e+=1)r=Math.random()*n.length,r=Math.floor(r),o+=n.charAt(r);return o}}},{}],2:[function(t,e,r){"use strict";e.exports={mainnetUrl:"https://pay.nebulas.io/api/mainnet/pay",testnetUrl:"https://pay.nebulas.io/api/pay"}},{}],3:[function(t,e,r){"use strict";var n={};window.addEventListener("message",function(t){if(console.log("nebpay: received resp.data: "+JSON.stringify(t.data)),"content"===t.data.src){var e=t.data.serialNumber,r=n[e];"function"==typeof r&&r(t.data.resp)}}),e.exports=function(t){t.listener&&(n[t.serialNumber]=t.listener),t.listener=void 0,window.postMessage({src:"nebPay",logo:"nebulas",params:t},"*")}},{}],4:[function(t,e,r){"use strict";var n=function(n){return new Promise(function(t,e){var r=new XMLHttpRequest;r.open(n.method||"GET",n.url),n.headers&&Object.keys(n.headers).forEach(function(t){r.setRequestHeader(t,n.headers[t])}),r.onload=function(){200<=r.status&&r.status<300?t(r.response):e(r.statusText)},r.onerror=function(){return e(r.statusText)},r.send(n.body)})};e.exports={get:function(t,e){return n({url:t,method:"GET",body:e})},post:function(t,e){return n({url:t,method:"POST",body:e})},request:n}},{}],5:[function(t,e,r){"use strict";var h=t("bignumber.js"),d=t("./Utils"),g=t("./qrcode"),p=t("./extensionUtils.js"),n=function(t,e){this.appKey=t,this.appSecret=e};n.prototype={submit:function(t,e,r,n,o){o.serialNumber=d.randomCode(32);var i,a,u,s,f,c=new h(r=r||"0").times("1000000000000000000"),l={serialNumber:o.serialNumber,goods:o.goods,pay:{currency:t,to:e,value:c.toString(10),payload:n},callback:o.callback,listener:o.listener,nrc20:o.nrc20};return p(l),i=o,a={category:"jump",des:"confirmTransfer",pageParams:l},u="openapp.NASnano://virtual?params="+JSON.stringify(a),window.location.href=u,i.qrcode.showQRCode&&(s=JSON.stringify(a),f=i,g.showQRCode(s,f.qrcode.container)),o.serialNumber}},e.exports=n},{"./Utils":1,"./extensionUtils.js":3,"./qrcode":6,"bignumber.js":7}],6:[function(t,e,r){"use strict";var n,o,i=t("qrcode"),a=((n=document.createElement("style")).type="text/css",document.head.appendChild(n),o=n.sheet,function(t,e,r){r=r||0,o.insertRule(t+"{"+e+"}",r)});e.exports={showQRCode:function(t,e){"undefined"!=typeof window&&(void 0===e&&(e=function(){var t=document.createElement("canvas");t.className="qrcode",a(".qrcode","box-shadow: 2px 2px 12px lightgray;");var e=document.createElement("div");e.className="qrcode-container";var r="text-align: center; background-color: #fff0; border-radius: 20px; width: 300px; height: 300px; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);";a(".qrcode-container",r),e.appendChild(t);var n=document.createElement("div");n.className="qrcode-background",a(".qrcode-background",r="position:absolute;\tleft:0;\ttop:0;\tz-index:100;\theight:100%;\twidth:100%;\tbackground-color: rgba(0, 0, 0, 0.4);"),n.appendChild(e);var o=document.getElementsByTagName("body");return o[0].appendChild(n),n.onclick=function(){o[0].removeChild(n)},t}()),i.toCanvas(e,t,function(t){t&&console.error(t)}))}}},{qrcode:12}],7:[function(t,r,e){!function(t){"use strict";var e,U=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,O=Math.ceil,k=Math.floor,D=" not a boolean or binary digit",F="rounding mode",q="number type has more than 15 significant digits",j="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",Y=1e14,z=14,H=9007199254740991,J=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],K=1e7,V=1e9;function $(t){var e=0|t;return 0<t||t===e?e:e-1}function Q(t){for(var e,r,n=1,o=t.length,i=t[0]+"";n<o;){for(e=t[n++]+"",r=z-e.length;r--;e="0"+e);i+=e}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function i(t,e){var r,n,o=t.c,i=e.c,a=t.s,u=e.s,s=t.e,f=e.e;if(!a||!u)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-u:a;if(a!=u)return a;if(r=a<0,n=s==f,!o||!i)return n?0:!o^r?1:-1;if(!n)return f<s^r?1:-1;for(u=(s=o.length)<(f=i.length)?s:f,a=0;a<u;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return s==f?0:f<s^r?1:-1}function G(t,e,r){return(t=et(t))>=e&&t<=r}function W(t){return"[object Array]"==Object.prototype.toString.call(t)}function X(t,e,r){for(var n,o,i=[0],a=0,u=t.length;a<u;){for(o=i.length;o--;i[o]*=e);for(i[n=0]+=j.indexOf(t.charAt(a++));n<i.length;n++)i[n]>r-1&&(null==i[n+1]&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Z(t,e){return(1<t.length?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function tt(t,e){var r,n;if(e<0){for(n="0.";++e;n+="0");t=n+t}else if(++e>(r=t.length)){for(n="0",e-=r;--e;n+="0");t+=n}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}function et(t){return(t=parseFloat(t))<0?O(t):k(t)}(e=function t(e){var v,f,r,c,a,u,s,l,h,b=0,n=P.prototype,m=new P(1),g=20,y=4,d=-7,p=21,w=-1e7,E=1e7,A=!0,N=M,R=!1,B=1,C=0,T={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0};function P(t,e){var r,n,o,i,a,u,s=this;if(!(s instanceof P))return new P(t,e);if(null!=e&&N(e,2,64,b,"base")){if(u=t+"",10==(e|=0))return L(s=new P(t instanceof P?t:u),g+s.e+1,y);if((i="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(r="["+j.slice(0,e)+"]+")+"(?:\\."+r+")?$",e<37?"i":"").test(u))return f(s,u,i,e);i?(s.s=1/t<0?(u=u.slice(1),-1):1,A&&15<u.replace(/^0\.0*|\./,"").length&&_(b,q,t),i=!1):s.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1,u=x(u,10,e,s.s)}else{if(t instanceof P)return s.s=t.s,s.e=t.e,s.c=(t=t.c)?t.slice():t,void(b=0);if((i="number"==typeof t)&&0*t==0){if(s.s=1/t<0?(t=-t,-1):1,t===~~t){for(n=0,o=t;10<=o;o/=10,n++);return s.e=n,s.c=[t],void(b=0)}u=t+""}else{if(!U.test(u=t+""))return f(s,u,i);s.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1}}for(-1<(n=u.indexOf("."))&&(u=u.replace(".","")),0<(o=u.search(/e/i))?(n<0&&(n=o),n+=+u.slice(o+1),u=u.substring(0,o)):n<0&&(n=u.length),o=0;48===u.charCodeAt(o);o++);for(a=u.length;48===u.charCodeAt(--a););if(u=u.slice(o,a+1))if(a=u.length,i&&A&&15<a&&(H<t||t!==k(t))&&_(b,q,s.s*t),E<(n=n-o-1))s.c=s.e=null;else if(n<w)s.c=[s.e=0];else{if(s.e=n,s.c=[],o=(n+1)%z,n<0&&(o+=z),o<a){for(o&&s.c.push(+u.slice(0,o)),a-=z;o<a;)s.c.push(+u.slice(o,o+=z));u=u.slice(o),o=z-u.length}else o-=a;for(;o--;u+="0");s.c.push(+u)}else s.c=[s.e=0];b=0}function x(t,e,r,n){var o,i,a,u,s,f,c,l=t.indexOf("."),h=g,d=y;for(r<37&&(t=t.toLowerCase()),0<=l&&(a=C,C=0,t=t.replace(".",""),s=(c=new P(r)).pow(t.length-l),C=a,c.c=X(tt(Q(s.c),s.e),10,e),c.e=c.c.length),i=a=(f=X(t,r,e)).length;0==f[--a];f.pop());if(!f[0])return"0";if(l<0?--i:(s.c=f,s.e=i,s.s=n,f=(s=v(s,c,h,d,e)).c,u=s.r,i=s.e),l=f[o=i+h+1],a=e/2,u=u||o<0||null!=f[o+1],u=d<4?(null!=l||u)&&(0==d||d==(s.s<0?3:2)):a<l||l==a&&(4==d||u||6==d&&1&f[o-1]||d==(s.s<0?8:7)),o<1||!f[0])t=u?tt("1",-h):"0";else{if(f.length=o,u)for(--e;++f[--o]>e;)f[o]=0,o||(++i,f=[1].concat(f));for(a=f.length;!f[--a];);for(l=0,t="";l<=a;t+=j.charAt(f[l++]));t=tt(t,i)}return t}function I(t,e,r,n){var o,i,a,u,s;if(r=null!=r&&N(r,0,8,n,F)?0|r:y,!t.c)return t.toString();if(o=t.c[0],a=t.e,null==e)s=Q(t.c),s=19==n||24==n&&a<=d?Z(s,a):tt(s,a);else if(i=(t=L(new P(t),e,r)).e,u=(s=Q(t.c)).length,19==n||24==n&&(e<=i||i<=d)){for(;u<e;s+="0",u++);s=Z(s,i)}else if(e-=a,s=tt(s,i),u<i+1){if(0<--e)for(s+=".";e--;s+="0");}else if(0<(e+=i-u))for(i+1==u&&(s+=".");e--;s+="0");return t.s<0&&o?"-"+s:s}function o(t,e){var r,n,o=0;for(W(t[0])&&(t=t[0]),r=new P(t[0]);++o<t.length;){if(!(n=new P(t[o])).s){r=n;break}e.call(r,n)&&(r=n)}return r}function M(t,e,r,n,o){return(t<e||r<t||t!=et(t))&&_(n,(o||"decimal places")+(t<e||r<t?" out of range":" not an integer"),t),!0}function S(t,e,r){for(var n=1,o=e.length;!e[--o];e.pop());for(o=e[0];10<=o;o/=10,n++);return(r=n+r*z-1)>E?t.c=t.e=null:r<w?t.c=[t.e=0]:(t.e=r,t.c=e),t}function _(t,e,r){var n=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][t]+"() "+e+": "+r);throw n.name="BigNumber Error",b=0,n}function L(t,e,r,n){var o,i,a,u,s,f,c,l=t.c,h=J;if(l){t:{for(o=1,u=l[0];10<=u;u/=10,o++);if((i=e-o)<0)i+=z,a=e,c=(s=l[f=0])/h[o-a-1]%10|0;else if((f=O((i+1)/z))>=l.length){if(!n)break t;for(;l.length<=f;l.push(0));s=c=0,a=(i%=z)-z+(o=1)}else{for(s=u=l[f],o=1;10<=u;u/=10,o++);c=(a=(i%=z)-z+o)<0?0:s/h[o-a-1]%10|0}if(n=n||e<0||null!=l[f+1]||(a<0?s:s%h[o-a-1]),n=r<4?(c||n)&&(0==r||r==(t.s<0?3:2)):5<c||5==c&&(4==r||n||6==r&&(0<i?0<a?s/h[o-a]:0:l[f-1])%10&1||r==(t.s<0?8:7)),e<1||!l[0])return l.length=0,n?(e-=t.e+1,l[0]=h[(z-e%z)%z],t.e=-e||0):l[0]=t.e=0,t;if(0==i?(l.length=f,u=1,f--):(l.length=f+1,u=h[z-i],l[f]=0<a?k(s/h[o-a]%h[a])*u:0),n)for(;;){if(0==f){for(i=1,a=l[0];10<=a;a/=10,i++);for(a=l[0]+=u,u=1;10<=a;a/=10,u++);i!=u&&(t.e++,l[0]==Y&&(l[0]=1));break}if(l[f]+=u,l[f]!=Y)break;l[f--]=0,u=1}for(i=l.length;0===l[--i];l.pop());}t.e>E?t.c=t.e=null:t.e<w&&(t.c=[t.e=0])}return t}return P.another=t,P.ROUND_UP=0,P.ROUND_DOWN=1,P.ROUND_CEIL=2,P.ROUND_FLOOR=3,P.ROUND_HALF_UP=4,P.ROUND_HALF_DOWN=5,P.ROUND_HALF_EVEN=6,P.ROUND_HALF_CEIL=7,P.ROUND_HALF_FLOOR=8,P.EUCLID=9,P.config=P.set=function(){var t,e,r=0,n={},o=arguments,i=o[0],a=i&&"object"==typeof i?function(){if(i.hasOwnProperty(e))return null!=(t=i[e])}:function(){if(o.length>r)return null!=(t=o[r++])};return a(e="DECIMAL_PLACES")&&N(t,0,V,2,e)&&(g=0|t),n[e]=g,a(e="ROUNDING_MODE")&&N(t,0,8,2,e)&&(y=0|t),n[e]=y,a(e="EXPONENTIAL_AT")&&(W(t)?N(t[0],-V,0,2,e)&&N(t[1],0,V,2,e)&&(d=0|t[0],p=0|t[1]):N(t,-V,V,2,e)&&(d=-(p=0|(t<0?-t:t)))),n[e]=[d,p],a(e="RANGE")&&(W(t)?N(t[0],-V,-1,2,e)&&N(t[1],1,V,2,e)&&(w=0|t[0],E=0|t[1]):N(t,-V,V,2,e)&&(0|t?w=-(E=0|(t<0?-t:t)):A&&_(2,e+" cannot be zero",t))),n[e]=[w,E],a(e="ERRORS")&&(t===!!t||1===t||0===t?(b=0,N=(A=!!t)?M:G):A&&_(2,e+D,t)),n[e]=A,a(e="CRYPTO")&&(!0===t||!1===t||1===t||0===t?t?!(t="undefined"==typeof crypto)&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?R=!0:A?_(2,"crypto unavailable",t?void 0:crypto):R=!1:R=!1:A&&_(2,e+D,t)),n[e]=R,a(e="MODULO_MODE")&&N(t,0,9,2,e)&&(B=0|t),n[e]=B,a(e="POW_PRECISION")&&N(t,0,V,2,e)&&(C=0|t),n[e]=C,a(e="FORMAT")&&("object"==typeof t?T=t:A&&_(2,e+" not an object",t)),n[e]=T,n},P.max=function(){return o(arguments,n.lt)},P.min=function(){return o(arguments,n.gt)},P.random=(r=9007199254740992,c=Math.random()*r&2097151?function(){return k(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,o,i,a=0,u=[],s=new P(m);if(t=null!=t&&N(t,0,V,14)?0|t:g,o=O(t/z),R)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(o*=2));a<o;)9e15<=(i=131072*e[a]+(e[a+1]>>>11))?(r=crypto.getRandomValues(new Uint32Array(2)),e[a]=r[0],e[a+1]=r[1]):(u.push(i%1e14),a+=2);a=o/2}else if(crypto.randomBytes){for(e=crypto.randomBytes(o*=7);a<o;)9e15<=(i=281474976710656*(31&e[a])+1099511627776*e[a+1]+4294967296*e[a+2]+16777216*e[a+3]+(e[a+4]<<16)+(e[a+5]<<8)+e[a+6])?crypto.randomBytes(7).copy(e,a):(u.push(i%1e14),a+=7);a=o/7}else R=!1,A&&_(14,"crypto unavailable",crypto);if(!R)for(;a<o;)(i=c())<9e15&&(u[a++]=i%1e14);for(o=u[--a],t%=z,o&&t&&(i=J[z-t],u[a]=k(o/i)*i);0===u[a];u.pop(),a--);if(a<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=z);for(a=1,i=u[0];10<=i;i/=10,a++);a<z&&(n-=z-a)}return s.e=n,s.c=u,s}),v=function(){function B(t,e,r){var n,o,i,a,u=0,s=t.length,f=e%K,c=e/K|0;for(t=t.slice();s--;)u=((o=f*(i=t[s]%K)+(n=c*i+(a=t[s]/K|0)*f)%K*K+u)/r|0)+(n/K|0)+c*a,t[s]=o%r;return u&&(t=[u].concat(t)),t}function C(t,e,r,n){var o,i;if(r!=n)i=n<r?1:-1;else for(o=i=0;o<r;o++)if(t[o]!=e[o]){i=t[o]>e[o]?1:-1;break}return i}function T(t,e,r,n){for(var o=0;r--;)t[r]-=o,o=t[r]<e[r]?1:0,t[r]=o*n+t[r]-e[r];for(;!t[0]&&1<t.length;t.splice(0,1));}return function(t,e,r,n,o){var i,a,u,s,f,c,l,h,d,g,p,v,m,y,w,b,E,A=t.s==e.s?1:-1,N=t.c,R=e.c;if(!(N&&N[0]&&R&&R[0]))return new P(t.s&&e.s&&(N?!R||N[0]!=R[0]:R)?N&&0==N[0]||!R?0*A:A/0:NaN);for(d=(h=new P(A)).c=[],A=r+(a=t.e-e.e)+1,o||(o=Y,a=$(t.e/z)-$(e.e/z),A=A/z|0),u=0;R[u]==(N[u]||0);u++);if(R[u]>(N[u]||0)&&a--,A<0)d.push(1),s=!0;else{for(y=N.length,b=R.length,A+=2,1<(f=k(o/(R[u=0]+1)))&&(R=B(R,f,o),N=B(N,f,o),b=R.length,y=N.length),m=b,p=(g=N.slice(0,b)).length;p<b;g[p++]=0);E=R.slice(),E=[0].concat(E),w=R[0],R[1]>=o/2&&w++;do{if(f=0,(i=C(R,g,b,p))<0){if(v=g[0],b!=p&&(v=v*o+(g[1]||0)),1<(f=k(v/w)))for(o<=f&&(f=o-1),l=(c=B(R,f,o)).length,p=g.length;1==C(c,g,l,p);)f--,T(c,b<l?E:R,l,o),l=c.length,i=1;else 0==f&&(i=f=1),l=(c=R.slice()).length;if(l<p&&(c=[0].concat(c)),T(g,c,p,o),p=g.length,-1==i)for(;C(R,g,b,p)<1;)f++,T(g,b<p?E:R,p,o),p=g.length}else 0===i&&(f++,g=[0]);d[u++]=f,g[0]?g[p++]=N[m]||0:(g=[N[m]],p=1)}while((m++<y||null!=g[0])&&A--);s=null!=g[0],d[0]||d.splice(0,1)}if(o==Y){for(u=1,A=d[0];10<=A;A/=10,u++);L(h,r+(h.e=u+a*z-1)+1,n,s)}else h.e=a,h.r=+s;return h}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,s=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,f=function(t,e,r,n){var o,i=r?e:e.replace(h,"");if(l.test(i))t.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(a,function(t,e,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?t:e}),n&&(o=n,i=i.replace(u,"$1").replace(s,"0.$1")),e!=i))return new P(i,o);A&&_(b,"not a"+(n?" base "+n:"")+" number",e),t.s=null}t.c=t.e=null,b=0},n.absoluteValue=n.abs=function(){var t=new P(this);return t.s<0&&(t.s=1),t},n.ceil=function(){return L(new P(this),this.e+1,2)},n.comparedTo=n.cmp=function(t,e){return b=1,i(this,new P(t,e))},n.decimalPlaces=n.dp=function(){var t,e,r=this.c;if(!r)return null;if(t=((e=r.length-1)-$(this.e/z))*z,e=r[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},n.dividedBy=n.div=function(t,e){return b=3,v(this,new P(t,e),g,y)},n.dividedToIntegerBy=n.divToInt=function(t,e){return b=4,v(this,new P(t,e),0,1)},n.equals=n.eq=function(t,e){return b=5,0===i(this,new P(t,e))},n.floor=function(){return L(new P(this),this.e+1,3)},n.greaterThan=n.gt=function(t,e){return b=6,0<i(this,new P(t,e))},n.greaterThanOrEqualTo=n.gte=function(t,e){return b=7,1===(e=i(this,new P(t,e)))||0===e},n.isFinite=function(){return!!this.c},n.isInteger=n.isInt=function(){return!!this.c&&$(this.e/z)>this.c.length-2},n.isNaN=function(){return!this.s},n.isNegative=n.isNeg=function(){return this.s<0},n.isZero=function(){return!!this.c&&0==this.c[0]},n.lessThan=n.lt=function(t,e){return b=8,i(this,new P(t,e))<0},n.lessThanOrEqualTo=n.lte=function(t,e){return b=9,-1===(e=i(this,new P(t,e)))||0===e},n.minus=n.sub=function(t,e){var r,n,o,i,a=this,u=a.s;if(b=10,e=(t=new P(t,e)).s,!u||!e)return new P(NaN);if(u!=e)return t.s=-e,a.plus(t);var s=a.e/z,f=t.e/z,c=a.c,l=t.c;if(!s||!f){if(!c||!l)return c?(t.s=-e,t):new P(l?a:NaN);if(!c[0]||!l[0])return l[0]?(t.s=-e,t):new P(c[0]?a:3==y?-0:0)}if(s=$(s),f=$(f),c=c.slice(),u=s-f){for((i=u<0)?(u=-u,o=c):(f=s,o=l),o.reverse(),e=u;e--;o.push(0));o.reverse()}else for(n=(i=(u=c.length)<(e=l.length))?u:e,u=e=0;e<n;e++)if(c[e]!=l[e]){i=c[e]<l[e];break}if(i&&(o=c,c=l,l=o,t.s=-t.s),0<(e=(n=l.length)-(r=c.length)))for(;e--;c[r++]=0);for(e=Y-1;u<n;){if(c[--n]<l[n]){for(r=n;r&&!c[--r];c[r]=e);--c[r],c[n]+=Y}c[n]-=l[n]}for(;0==c[0];c.splice(0,1),--f);return c[0]?S(t,c,f):(t.s=3==y?-1:1,t.c=[t.e=0],t)},n.modulo=n.mod=function(t,e){var r,n,o=this;return b=11,t=new P(t,e),!o.c||!t.s||t.c&&!t.c[0]?new P(NaN):!t.c||o.c&&!o.c[0]?new P(o):(9==B?(n=t.s,t.s=1,r=v(o,t,0,3),t.s=n,r.s*=n):r=v(o,t,0,B),o.minus(r.times(t)))},n.negated=n.neg=function(){var t=new P(this);return t.s=-t.s||null,t},n.plus=n.add=function(t,e){var r,n=this,o=n.s;if(b=12,e=(t=new P(t,e)).s,!o||!e)return new P(NaN);if(o!=e)return t.s=-e,n.minus(t);var i=n.e/z,a=t.e/z,u=n.c,s=t.c;if(!i||!a){if(!u||!s)return new P(o/0);if(!u[0]||!s[0])return s[0]?t:new P(u[0]?n:0*o)}if(i=$(i),a=$(a),u=u.slice(),o=i-a){for(0<o?(a=i,r=s):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(e=s.length)<0&&(r=s,s=u,u=r,e=o),o=0;e;)o=(u[--e]=u[e]+s[e]+o)/Y|0,u[e]=Y===u[e]?0:u[e]%Y;return o&&(u=[o].concat(u),++a),S(t,u,a)},n.precision=n.sd=function(t){var e,r,n=this.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(A&&_(13,"argument"+D,t),t!=!!t&&(t=null)),!n)return null;if(e=(r=n.length-1)*z+1,r=n[r]){for(;r%10==0;r/=10,e--);for(r=n[0];10<=r;r/=10,e++);}return t&&this.e+1>e&&(e=this.e+1),e},n.round=function(t,e){var r=new P(this);return(null==t||N(t,0,V,15))&&L(r,~~t+this.e+1,null!=e&&N(e,0,8,15,F)?0|e:y),r},n.shift=function(t){var e=this;return N(t,-H,H,16,"argument")?e.times("1e"+et(t)):new P(e.c&&e.c[0]&&(t<-H||H<t)?e.s*(t<0?0:1/0):e)},n.squareRoot=n.sqrt=function(){var t,e,r,n,o,i=this,a=i.c,u=i.s,s=i.e,f=g+4,c=new P("0.5");if(1!==u||!a||!a[0])return new P(!u||u<0&&(!a||a[0])?NaN:a?i:1/0);if(0==(u=Math.sqrt(+i))||u==1/0?(((e=Q(a)).length+s)%2==0&&(e+="0"),u=Math.sqrt(e),s=$((s+1)/2)-(s<0||s%2),r=new P(e=u==1/0?"1e"+s:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+s)):r=new P(u+""),r.c[0])for((u=(s=r.e)+f)<3&&(u=0);;)if(o=r,r=c.times(o.plus(v(i,o,f,1))),Q(o.c).slice(0,u)===(e=Q(r.c)).slice(0,u)){if(r.e<s&&--u,"9999"!=(e=e.slice(u-3,u+1))&&(n||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(L(r,r.e+g+2,1),t=!r.times(r).eq(i));break}if(!n&&(L(o,o.e+g+2,0),o.times(o).eq(i))){r=o;break}f+=4,u+=4,n=1}return L(r,r.e+g+1,y,t)},n.times=n.mul=function(t,e){var r,n,o,i,a,u,s,f,c,l,h,d,g,p,v,m=this,y=m.c,w=(b=17,t=new P(t,e)).c;if(!(y&&w&&y[0]&&w[0]))return!m.s||!t.s||y&&!y[0]&&!w||w&&!w[0]&&!y?t.c=t.e=t.s=null:(t.s*=m.s,y&&w?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=$(m.e/z)+$(t.e/z),t.s*=m.s,(s=y.length)<(l=w.length)&&(g=y,y=w,w=g,o=s,s=l,l=o),o=s+l,g=[];o--;g.push(0));for(p=Y,v=K,o=l;0<=--o;){for(r=0,h=w[o]%v,d=w[o]/v|0,i=o+(a=s);o<i;)r=((f=h*(f=y[--a]%v)+(u=d*f+(c=y[a]/v|0)*h)%v*v+g[i]+r)/p|0)+(u/v|0)+d*c,g[i--]=f%p;g[i]=r}return r?++n:g.splice(0,1),S(t,g,n)},n.toDigits=function(t,e){var r=new P(this);return t=null!=t&&N(t,1,V,18,"precision")?0|t:null,e=null!=e&&N(e,0,8,18,F)?0|e:y,t?L(r,t,e):r},n.toExponential=function(t,e){return I(this,null!=t&&N(t,0,V,19)?1+~~t:null,e,19)},n.toFixed=function(t,e){return I(this,null!=t&&N(t,0,V,20)?~~t+this.e+1:null,e,20)},n.toFormat=function(t,e){var r=I(this,null!=t&&N(t,0,V,21)?~~t+this.e+1:null,e,21);if(this.c){var n,o=r.split("."),i=+T.groupSize,a=+T.secondaryGroupSize,u=T.groupSeparator,s=o[0],f=o[1],c=this.s<0,l=c?s.slice(1):s,h=l.length;if(a&&(n=i,i=a,h-=a=n),0<i&&0<h){for(n=h%i||i,s=l.substr(0,n);n<h;n+=i)s+=u+l.substr(n,i);0<a&&(s+=u+l.slice(n)),c&&(s="-"+s)}r=f?s+T.decimalSeparator+((a=+T.fractionGroupSize)?f.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+T.fractionGroupSeparator):f):s}return r},n.toFraction=function(t){var e,r,n,o,i,a,u,s,f,c=A,l=this,h=l.c,d=new P(m),g=r=new P(m),p=u=new P(m);if(null!=t&&(A=!1,a=new P(t),A=c,(c=a.isInt())&&!a.lt(m)||(A&&_(22,"max denominator "+(c?"out of range":"not an integer"),t),t=!c&&a.c&&L(a,a.e+1,1).gte(m)?a:null)),!h)return l.toString();for(f=Q(h),o=d.e=f.length-l.e-1,d.c[0]=J[(i=o%z)<0?z+i:i],t=!t||0<a.cmp(d)?0<o?d:g:a,i=E,E=1/0,a=new P(f),u.c[0]=0;s=v(a,d,0,1),1!=(n=r.plus(s.times(p))).cmp(t);)r=p,p=n,g=u.plus(s.times(n=g)),u=n,d=a.minus(s.times(n=d)),a=n;return n=v(t.minus(r),p,0,1),u=u.plus(n.times(g)),r=r.plus(n.times(p)),u.s=g.s=l.s,e=v(g,p,o*=2,y).minus(l).abs().cmp(v(u,r,o,y).minus(l).abs())<1?[g.toString(),p.toString()]:[u.toString(),r.toString()],E=i,e},n.toNumber=function(){return+this},n.toPower=n.pow=function(t,e){var r,n,o,i=k(t<0?-t:+t),a=this;if(null!=e&&(b=23,e=new P(e)),!N(t,-H,H,23,"exponent")&&(!isFinite(t)||H<i&&(t/=0)||parseFloat(t)!=t&&!(t=NaN))||0==t)return r=Math.pow(+a,t),new P(e?r%e:r);for(e?1<t&&a.gt(m)&&a.isInt()&&e.gt(m)&&e.isInt()?a=a.mod(e):(o=e,e=null):C&&(r=O(C/z+2)),n=new P(m);;){if(i%2){if(!(n=n.times(a)).c)break;r?n.c.length>r&&(n.c.length=r):e&&(n=n.mod(e))}if(!(i=k(i/2)))break;a=a.times(a),r?a.c&&a.c.length>r&&(a.c.length=r):e&&(a=a.mod(e))}return e?n:(t<0&&(n=m.div(n)),o?n.mod(o):r?L(n,C,y):n)},n.toPrecision=function(t,e){return I(this,null!=t&&N(t,1,V,24,"precision")?0|t:null,e,24)},n.toString=function(t){var e,r=this.s,n=this.e;return null===n?r?(e="Infinity",r<0&&(e="-"+e)):e="NaN":(e=Q(this.c),e=null!=t&&N(t,2,64,25,"base")?x(tt(e,n),0|t,10,r):n<=d||p<=n?Z(e,n):tt(e,n),r<0&&this.c[0]&&(e="-"+e)),e},n.truncated=n.trunc=function(){return L(new P(this),this.e+1,1)},n.valueOf=n.toJSON=function(){var t,e=this.e;return null===e?this.toString():(t=Q(this.c),t=e<=d||p<=e?Z(t,e):tt(t,e),this.s<0?"-"+t:t)},n.isBigNumber=!0,null!=e&&P.config(e),P}()).default=e.BigNumber=e,"function"==typeof define&&define.amd?define(function(){return e}):void 0!==r&&r.exports?r.exports=e:(t||(t="undefined"!=typeof self?self:Function("return this")()),t.BigNumber=e)}(this)},{}],8:[function(t,e,r){"use strict";var n=t("window-or-global");e.exports=function(){return"function"==typeof n.Promise&&"function"==typeof n.Promise.prototype.then}},{"window-or-global":38}],9:[function(t,e,r){"use strict";var g={single_source_shortest_paths:function(t,e,r){var n={},o={};o[e]=0;var i,a,u,s,f,c,l,h=g.PriorityQueue.make();for(h.push(e,0);!h.empty();)for(u in a=(i=h.pop()).value,s=i.cost,f=t[a]||{})f.hasOwnProperty(u)&&(c=s+f[u],l=o[u],(void 0===o[u]||c<l)&&(o[u]=c,h.push(u,c),n[u]=a));if(void 0!==r&&void 0===o[r]){var d=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(d)}return n},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var n=g.single_source_shortest_paths(t,e,r);return g.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(t){var e,r=g.PriorityQueue,n={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(n[e]=r[e]);return n.queue=[],n.sorter=t.sorter||r.default_sorter,n},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==e&&(e.exports=g)},{}],10:[function(t,e,r){"use strict";var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===i.call(t)},h=function(t){if(!t||"[object Object]"!==i.call(t))return!1;var e,r=o.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&o.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||o.call(t,e)};e.exports=function t(){var e,r,n,o,i,a,u=arguments[0],s=1,f=arguments.length,c=!1;for("boolean"==typeof u&&(c=u,u=arguments[1]||{},s=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});s<f;++s)if(null!=(e=arguments[s]))for(r in e)n=u[r],u!==(o=e[r])&&(c&&o&&(h(o)||(i=l(o)))?(i?(i=!1,a=n&&l(n)?n:[]):a=n&&h(n)?n:{},u[r]=t(c,a,o)):void 0!==o&&(u[r]=o));return u}},{}],11:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],12:[function(t,e,r){var f=t("can-promise"),c=t("./core/qrcode"),n=t("./renderer/canvas"),o=t("./renderer/svg-tag.js");function i(n,o,i,a,e){var t=[].slice.call(arguments,1),r=t.length,u="function"==typeof t[r-1];if(!u&&!f())throw new Error("Callback required as last argument");if(!u){if(r<1)throw new Error("Too few arguments provided");return 1===r?(i=o,o=a=void 0):2!==r||o.getContext||(a=i,i=o,o=void 0),new Promise(function(t,e){try{var r=c.create(i,a);t(n(r,o,a))}catch(t){e(t)}})}if(r<2)throw new Error("Too few arguments provided");2===r?(e=i,i=o,o=a=void 0):3===r&&(o.getContext&&void 0===e?(e=a,a=void 0):(e=a,a=i,i=o,o=void 0));try{var s=c.create(i,a);e(null,n(s,o,a))}catch(t){e(t)}}r.create=c.create,r.toCanvas=i.bind(null,n.render),r.toDataURL=i.bind(null,n.renderToDataURL),r.toString=i.bind(null,function(t,e,r){return o.render(t,r)})},{"./core/qrcode":28,"./renderer/canvas":34,"./renderer/svg-tag.js":35,"can-promise":8}],13:[function(t,e,a){var u=t("./utils").getSymbolSize;a.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,r=u(t),n=145===r?26:2*Math.ceil((r-13)/(2*e-2)),o=[r-7],i=1;i<e-1;i++)o[i]=o[i-1]-n;return o.push(6),o.reverse()},a.getPositions=function(t){for(var e=[],r=a.getRowColCoords(t),n=r.length,o=0;o<n;o++)for(var i=0;i<n;i++)0===o&&0===i||0===o&&i===n-1||o===n-1&&0===i||e.push([r[o],r[i]]);return e}},{"./utils":32}],14:[function(t,e,r){var n=t("./mode"),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(t){this.mode=n.ALPHANUMERIC,this.data=t}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e+2<=this.data.length;e+=2){var r=45*o.indexOf(this.data[e]);r+=o.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},e.exports=i},{"./mode":25}],15:[function(t,e,r){function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},e.exports=n},{}],16:[function(t,e,r){var n=t("../utils/buffer");function o(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new n(t*t),this.data.fill(0),this.reservedBit=new n(t*t),this.reservedBit.fill(0)}o.prototype.set=function(t,e,r,n){var o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)},o.prototype.get=function(t,e){return this.data[t*this.size+e]},o.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},o.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=o},{"../utils/buffer":37}],17:[function(t,e,r){var n=t("../utils/buffer"),o=t("./mode");function i(t){this.mode=o.BYTE,this.data=new n(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)},e.exports=i},{"../utils/buffer":37,"./mode":25}],18:[function(t,e,r){var n=t("./error-correction-level"),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];r.getBlocksCount=function(t,e){switch(e){case n.L:return o[4*(t-1)+0];case n.M:return o[4*(t-1)+1];case n.Q:return o[4*(t-1)+2];case n.H:return o[4*(t-1)+3];default:return}},r.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return i[4*(t-1)+0];case n.M:return i[4*(t-1)+1];case n.Q:return i[4*(t-1)+2];case n.H:return i[4*(t-1)+3];default:return}}},{"./error-correction-level":19}],19:[function(t,e,r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2},r.isValid=function(t){return t&&void 0!==t.bit&&0<=t.bit&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return e}}},{}],20:[function(t,e,r){var n=t("./utils").getSymbolSize;r.getPositions=function(t){var e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},{"./utils":32}],21:[function(t,e,r){var o=t("./utils"),i=o.getBCHDigit(1335);r.getEncodedBits=function(t,e){for(var r=t.bit<<3|e,n=r<<10;0<=o.getBCHDigit(n)-i;)n^=1335<<o.getBCHDigit(n)-i;return 21522^(r<<10|n)}},{"./utils":32}],22:[function(t,e,r){var n=t("../utils/buffer"),o=new n(512),i=new n(256);!function(){for(var t=1,e=0;e<255;e++)o[e]=t,i[t]=e,256&(t<<=1)&&(t^=285);for(e=255;e<512;e++)o[e]=o[e-255]}(),r.log=function(t){if(t<1)throw new Error("log("+t+")");return i[t]},r.exp=function(t){return o[t]},r.mul=function(t,e){return 0===t||0===e?0:o[i[t]+i[e]]}},{"../utils/buffer":37}],23:[function(t,e,r){var n=t("./mode"),o=t("./utils");function i(t){this.mode=n.KANJI,this.data=t}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var r=o.toSJIS(this.data[e]);if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},e.exports=i},{"./mode":25,"./utils":32}],24:[function(t,e,u){u.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var c=3,a=3,s=40,o=10;function i(t,e,r){switch(t){case u.Patterns.PATTERN000:return(e+r)%2==0;case u.Patterns.PATTERN001:return e%2==0;case u.Patterns.PATTERN010:return r%3==0;case u.Patterns.PATTERN011:return(e+r)%3==0;case u.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case u.Patterns.PATTERN101:return e*r%2+e*r%3==0;case u.Patterns.PATTERN110:return(e*r%2+e*r%3)%2==0;case u.Patterns.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}u.isValid=function(t){return t&&""!==t&&!isNaN(t)&&0<=t&&t<=7},u.from=function(t){return u.isValid(t)?parseInt(t,10):void 0},u.getPenaltyN1=function(t){for(var e=t.size,r=0,n=0,o=0,i=null,a=null,u=0;u<e;u++){n=o=0,i=a=null;for(var s=0;s<e;s++){var f=t.get(u,s);f===i?n++:(5<=n&&(r+=c+(n-5)),i=f,n=1),(f=t.get(s,u))===a?o++:(5<=o&&(r+=c+(o-5)),a=f,o=1)}5<=n&&(r+=c+(n-5)),5<=o&&(r+=c+(o-5))}return r},u.getPenaltyN2=function(t){for(var e=t.size,r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var i=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==i&&0!==i||r++}return r*a},u.getPenaltyN3=function(t){for(var e=t.size,r=0,n=0,o=0,i=0;i<e;i++){n=o=0;for(var a=0;a<e;a++)n=n<<1&2047|t.get(i,a),10<=a&&(1488===n||93===n)&&r++,o=o<<1&2047|t.get(a,i),10<=a&&(1488===o||93===o)&&r++}return r*s},u.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n<r;n++)e+=t.data[n];return Math.abs(Math.ceil(100*e/r/5)-10)*o},u.applyMask=function(t,e){for(var r=e.size,n=0;n<r;n++)for(var o=0;o<r;o++)e.isReserved(o,n)||e.xor(o,n,i(t,o,n))},u.getBestMask=function(t,e){for(var r=Object.keys(u.Patterns).length,n=0,o=1/0,i=0;i<r;i++){e(i),u.applyMask(i,t);var a=u.getPenaltyN1(t)+u.getPenaltyN2(t)+u.getPenaltyN3(t)+u.getPenaltyN4(t);u.applyMask(i,t),a<o&&(o=a,n=i)}return n}},{}],25:[function(t,e,r){var n=t("./version"),o=t("./regex");r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(e))throw new Error("Invalid version: "+e);return 1<=e&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return o.testNumeric(t)?r.NUMERIC:o.testAlphanumeric(t)?r.ALPHANUMERIC:o.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return e}}},{"./regex":30,"./version":33}],26:[function(t,e,r){var n=t("./mode");function o(t){this.mode=n.NUMERIC,this.data=t.toString()}o.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){var e,r,n;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),n=parseInt(r,10),t.put(n,10);var o=this.data.length-e;0<o&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*o+1))},e.exports=o},{"./mode":25}],27:[function(t,e,n){var a=t("../utils/buffer"),u=t("./galois-field");n.mul=function(t,e){var r=new a(t.length+e.length-1);r.fill(0);for(var n=0;n<t.length;n++)for(var o=0;o<e.length;o++)r[n+o]^=u.mul(t[n],e[o]);return r},n.mod=function(t,e){for(var r=new a(t);0<=r.length-e.length;){for(var n=r[0],o=0;o<e.length;o++)r[o]^=u.mul(e[o],n);for(var i=0;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},n.generateECPolynomial=function(t){for(var e=new a([1]),r=0;r<t;r++)e=n.mul(e,[1,u.exp(r)]);return e}},{"../utils/buffer":37,"./galois-field":22}],28:[function(t,e,r){var R=t("../utils/buffer"),B=t("./utils"),i=t("./error-correction-level"),u=t("./bit-buffer"),l=t("./bit-matrix"),h=t("./alignment-pattern"),d=t("./finder-pattern"),g=t("./mask-pattern"),C=t("./error-correction-code"),T=t("./reed-solomon-encoder"),p=t("./version"),s=t("./format-info"),f=t("./mode"),v=t("./segments"),m=t("isarray");function y(t,e,r){var n,o,i=t.size,a=s.getEncodedBits(e,r);for(n=0;n<15;n++)o=1==(a>>n&1),n<6?t.set(n,8,o,!0):n<8?t.set(n+1,8,o,!0):t.set(i-15+n,8,o,!0),n<8?t.set(8,i-n-1,o,!0):n<9?t.set(8,15-n-1+1,o,!0):t.set(8,15-n-1,o,!0);t.set(i-8,8,1,!0)}function w(e,t,r){var n=new u;r.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(n)});var o=8*(B.getSymbolTotalCodewords(e)-C.getTotalCodewordsCount(e,t));for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var i=(o-n.getLengthInBits())/8,a=0;a<i;a++)n.put(a%2?17:236,8);return function(t,e,r){for(var n=B.getSymbolTotalCodewords(e),o=C.getTotalCodewordsCount(e,r),i=n-o,a=C.getBlocksCount(e,r),u=a-n%a,s=Math.floor(n/a),f=Math.floor(i/a),c=f+1,l=s-f,h=new T(l),d=0,g=new Array(a),p=new Array(a),v=0,m=new R(t.buffer),y=0;y<a;y++){var w=y<u?f:c;g[y]=m.slice(d,d+w),p[y]=h.encode(g[y]),d+=w,v=Math.max(v,w)}var b,E,A=new R(n),N=0;for(b=0;b<v;b++)for(E=0;E<a;E++)b<g[E].length&&(A[N++]=g[E][b]);for(b=0;b<l;b++)for(E=0;E<a;E++)A[N++]=p[E][b];return A}(n,e,t)}function a(t,e,r,n){var o;if(m(t))o=v.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var i=e;if(!i){var a=v.rawSplit(t);i=p.getBestVersionForData(a,r)}o=v.fromString(t,i||40)}var u=p.getBestVersionForData(o,r);if(!u)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<u)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+u+".\n")}else e=u;var s=w(e,r,o),f=B.getSymbolSize(e),c=new l(f);return function(t,e){for(var r=t.size,n=d.getPositions(e),o=0;o<n.length;o++)for(var i=n[o][0],a=n[o][1],u=-1;u<=7;u++)if(!(i+u<=-1||r<=i+u))for(var s=-1;s<=7;s++)a+s<=-1||r<=a+s||(0<=u&&u<=6&&(0===s||6===s)||0<=s&&s<=6&&(0===u||6===u)||2<=u&&u<=4&&2<=s&&s<=4?t.set(i+u,a+s,!0,!0):t.set(i+u,a+s,!1,!0))}(c,e),function(t){for(var e=t.size,r=8;r<e-8;r++){var n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}(c),function(t,e){for(var r=h.getPositions(e),n=0;n<r.length;n++)for(var o=r[n][0],i=r[n][1],a=-2;a<=2;a++)for(var u=-2;u<=2;u++)-2===a||2===a||-2===u||2===u||0===a&&0===u?t.set(o+a,i+u,!0,!0):t.set(o+a,i+u,!1,!0)}(c,e),y(c,r,0),7<=e&&function(t,e){for(var r,n,o,i=t.size,a=p.getEncodedBits(e),u=0;u<18;u++)r=Math.floor(u/3),n=u%3+i-8-3,o=1==(a>>u&1),t.set(r,n,o,!0),t.set(n,r,o,!0)}(c,e),function(t,e){for(var r=t.size,n=-1,o=r-1,i=7,a=0,u=r-1;0<u;u-=2)for(6===u&&u--;;){for(var s=0;s<2;s++)if(!t.isReserved(o,u-s)){var f=!1;a<e.length&&(f=1==(e[a]>>>i&1)),t.set(o,u-s,f),-1==--i&&(a++,i=7)}if((o+=n)<0||r<=o){o-=n,n=-n;break}}}(c,s),n||(n=g.getBestMask(c,y.bind(null,c,r))),g.applyMask(n,c),y(c,r,n),{modules:c,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}r.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var r,n,o=i.M;return void 0!==e&&(o=i.from(e.errorCorrectionLevel,i.M),r=p.from(e.version),n=g.from(e.maskPattern),e.toSJISFunc&&B.setToSJISFunction(e.toSJISFunc)),a(t,r,o,n)}},{"../utils/buffer":37,"./alignment-pattern":13,"./bit-buffer":15,"./bit-matrix":16,"./error-correction-code":18,"./error-correction-level":19,"./finder-pattern":20,"./format-info":21,"./mask-pattern":24,"./mode":25,"./reed-solomon-encoder":29,"./segments":31,"./utils":32,"./version":33,isarray:11}],29:[function(t,e,r){var a=t("../utils/buffer"),u=t("./polynomial");function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(t){this.degree=t,this.genPoly=u.generateECPolynomial(this.degree)},n.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new a(this.degree);e.fill(0);var r=a.concat([t,e],t.length+this.degree),n=u.mod(r,this.genPoly),o=this.degree-n.length;if(0<o){var i=new a(this.degree);return i.fill(0),n.copy(i,o),i}return n},e.exports=n},{"../utils/buffer":37,"./polynomial":27}],30:[function(t,e,r){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",o="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+").)+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(o,"g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var i=new RegExp("^"+n+"$"),a=new RegExp("^[0-9]+$"),u=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(t){return i.test(t)},r.testNumeric=function(t){return a.test(t)},r.testAlphanumeric=function(t){return u.test(t)}},{}],31:[function(t,e,a){var d=t("./mode"),o=t("./numeric-data"),i=t("./alphanumeric-data"),u=t("./byte-data"),s=t("./kanji-data"),f=t("./regex"),c=t("./utils"),l=t("dijkstrajs");function h(t){return unescape(encodeURIComponent(t)).length}function g(t,e,r){for(var n,o=[];null!==(n=t.exec(r));)o.push({data:n[0],index:n.index,mode:e,length:n[0].length});return o}function p(t){var e,r,n=g(f.NUMERIC,d.NUMERIC,t),o=g(f.ALPHANUMERIC,d.ALPHANUMERIC,t);return c.isKanjiModeEnabled()?(e=g(f.BYTE,d.BYTE,t),r=g(f.KANJI,d.KANJI,t)):(e=g(f.BYTE_KANJI,d.BYTE,t),r=[]),n.concat(o,e,r).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function v(t,e){switch(e){case d.NUMERIC:return o.getBitsLength(t);case d.ALPHANUMERIC:return i.getBitsLength(t);case d.KANJI:return s.getBitsLength(t);case d.BYTE:return u.getBitsLength(t)}}function r(t,e){var r,n=d.getBestModeForData(t);if((r=d.from(e,n))!==d.BYTE&&r.bit<n.bit)throw new Error('"'+t+'" cannot be encoded with mode '+d.toString(r)+".\n Suggested mode is: "+d.toString(n));switch(r!==d.KANJI||c.isKanjiModeEnabled()||(r=d.BYTE),r){case d.NUMERIC:return new o(t);case d.ALPHANUMERIC:return new i(t);case d.KANJI:return new s(t);case d.BYTE:return new u(t)}}a.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(r(e,null)):e.data&&t.push(r(e.data,e.mode)),t},[])},a.fromString=function(t,e){for(var r=function(t,e){for(var r={},n={start:{}},o=["start"],i=0;i<t.length;i++){for(var a=t[i],u=[],s=0;s<a.length;s++){var f=a[s],c=""+i+s;u.push(c),r[c]={node:f,lastCount:0},n[c]={};for(var l=0;l<o.length;l++){var h=o[l];r[h]&&r[h].node.mode===f.mode?(n[h][c]=v(r[h].lastCount+f.length,f.mode)-v(r[h].lastCount,f.mode),r[h].lastCount+=f.length):(r[h]&&(r[h].lastCount=f.length),n[h][c]=v(f.length,f.mode)+4+d.getCharCountIndicator(f.mode,e))}}o=u}for(l=0;l<o.length;l++)n[o[l]].end=0;return{map:n,table:r}}(function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];switch(n.mode){case d.NUMERIC:e.push([n,{data:n.data,mode:d.ALPHANUMERIC,length:n.length},{data:n.data,mode:d.BYTE,length:n.length}]);break;case d.ALPHANUMERIC:e.push([n,{data:n.data,mode:d.BYTE,length:n.length}]);break;case d.KANJI:e.push([n,{data:n.data,mode:d.BYTE,length:h(n.data)}]);break;case d.BYTE:e.push([{data:n.data,mode:d.BYTE,length:h(n.data)}])}}return e}(p(t,c.isKanjiModeEnabled())),e),n=l.find_path(r.map,"start","end"),o=[],i=1;i<n.length-1;i++)o.push(r.table[n[i]].node);return a.fromArray(o.reduce(function(t,e){var r=0<=t.length-1?t[t.length-1]:null;return r&&r.mode===e.mode?t[t.length-1].data+=e.data:t.push(e),t},[]))},a.rawSplit=function(t){return a.fromArray(p(t,c.isKanjiModeEnabled()))}},{"./alphanumeric-data":14,"./byte-data":17,"./kanji-data":23,"./mode":25,"./numeric-data":26,"./regex":30,"./utils":32,dijkstrajs:9}],32:[function(t,e,r){var n,o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||40<t)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return o[t]},r.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},r.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},r.isKanjiModeEnabled=function(){return void 0!==n},r.toSJIS=function(t){return n(t)}},{}],33:[function(t,e,i){var a=t("./utils"),u=t("./error-correction-code"),o=t("./error-correction-level"),s=t("./mode"),f=t("isarray"),r=a.getBCHDigit(7973);function c(t,e){return s.getCharCountIndicator(t,e)+4}function l(t,r){var n=0;return t.forEach(function(t){var e=c(t.mode,r);n+=e+t.getBitsLength()}),n}i.isValid=function(t){return!isNaN(t)&&1<=t&&t<=40},i.from=function(t,e){return i.isValid(t)?parseInt(t,10):e},i.getCapacity=function(t,e,r){if(!i.isValid(t))throw new Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);var n=8*(a.getSymbolTotalCodewords(t)-u.getTotalCodewordsCount(t,e));if(r===s.MIXED)return n;var o=n-c(r,t);switch(r){case s.NUMERIC:return Math.floor(o/10*3);case s.ALPHANUMERIC:return Math.floor(o/11*2);case s.KANJI:return Math.floor(o/13);case s.BYTE:default:return Math.floor(o/8)}},i.getBestVersionForData=function(t,e){var r,n=o.from(e,o.M);if(f(t)){if(1<t.length)return function(t,e){for(var r=1;r<=40;r++)if(l(t,r)<=i.getCapacity(r,e,s.MIXED))return r}(t,n);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,e,r){for(var n=1;n<=40;n++)if(e<=i.getCapacity(n,r,t))return n}(r.mode,r.getLength(),n)},i.getEncodedBits=function(t){if(!i.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;0<=a.getBCHDigit(e)-r;)e^=7973<<a.getBCHDigit(e)-r;return t<<12|e}},{"./error-correction-code":18,"./error-correction-level":19,"./mode":25,"./utils":32,isarray:11}],34:[function(t,e,u){var c=t("./utils");u.render=function(t,e,r){var n=r,o=e;void 0!==n||e&&e.getContext||(n=e,e=void 0),e||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),n=c.getOptions(n);var i,a,u=c.getImageWidth(t.modules.size,n),s=o.getContext("2d"),f=s.createImageData(u,u);return c.qrToImageData(f.data,t,n),i=o,a=u,s.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px",s.putImageData(f,0,0),o},u.renderToDataURL=function(t,e,r){var n=r;void 0!==n||e&&e.getContext||(n=e,e=void 0),n||(n={});var o=u.render(t,e,n),i=n.type||"image/png",a=n.rendererOpts||{};return o.toDataURL(i,a.quality)}},{"./utils":36}],35:[function(t,e,r){var l=t("./utils");function h(t,e){var r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function d(t,e,r){var n=t+e;return void 0!==r&&(n+=" "+r),n}r.render=function(t,e,r){var n=l.getOptions(e),o=t.modules.size,i=t.modules.data,a=o+2*n.margin,u=n.color.light.a?"<path "+h(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",s="<path "+h(n.color.dark,"stroke")+' d="'+function(t,e,r){for(var n="",o=0,i=!1,a=0,u=0;u<t.length;u++){var s=Math.floor(u%e),f=Math.floor(u/e);s||i||(i=!0),t[u]?(a++,0<u&&0<s&&t[u-1]||(n+=i?d("M",s+r,.5+f+r):d("m",o,0),o=0,i=!1),s+1<e&&t[u+1]||(n+=d("h",a),a=0)):o++}return n}(i,o,n.margin)+'"/>',f='viewBox="0 0 '+a+" "+a+'"',c='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+f+">"+u+s+"</svg>";return"function"==typeof r&&r(null,c),c}},{"./utils":36}],36:[function(t,e,d){function o(t){if("string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||8<e.length)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");var r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}d.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&21<=t.width?t.width:void 0,n=t.scale||4;return{width:r,scale:r?4:n,margin:e,color:{dark:o(t.color.dark||"#000000ff"),light:o(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},d.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},d.getImageWidth=function(t,e){var r=d.getScale(t,e);return Math.floor((t+2*e.margin)*r)},d.qrToImageData=function(t,e,r){for(var n=e.modules.size,o=e.modules.data,i=d.getScale(n,r),a=Math.floor((n+2*r.margin)*i),u=r.margin*i,s=[r.color.light,r.color.dark],f=0;f<a;f++)for(var c=0;c<a;c++){var l=4*(f*a+c),h=r.color.light;if(u<=f&&u<=c&&f<a-u&&c<a-u)h=s[o[Math.floor((f-u)/i)*n+Math.floor((c-u)/i)]?1:0];t[l++]=h.r,t[l++]=h.g,t[l++]=h.b,t[l]=h.a}}},{}],37:[function(t,e,r){"use strict";var a=t("isarray");var n=(u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())?2147483647:1073741823;function u(t,e,r){return u.TYPED_ARRAY_SUPPORT||this instanceof u?"number"==typeof t?f(this,t):function(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return function(t,e,r,n){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");var o;o=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?o.__proto__=u.prototype:o=c(t,o);return o}(t,e,r,n);if("string"==typeof e)return function(t,e){var r=0|h(e),n=s(t,r),o=n.write(e);o!==r&&(n=n.slice(0,o));return n}(t,e);return function(t,e){if(u.isBuffer(e)){var r=0|i(e.length),n=s(t,r);return 0===n.length||e.copy(n,0,0,r),n}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(o=e.length)!=o?s(t,0):c(t,e);if("Buffer"===e.type&&Array.isArray(e.data))return c(t,e.data)}var o;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}(this,t,e,r):new u(t,e,r)}function i(t){if(n<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function s(t,e){var r;return u.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e)).__proto__=u.prototype:(null===(r=t)&&(r=new u(e)),r.length=e),r}function f(t,e){var r=s(t,e<0?0:0|i(e));if(!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)r[n]=0;return r}function c(t,e){for(var r=e.length<0?0:0|i(e.length),n=s(t,r),o=0;o<r;o+=1)n[o]=255&e[o];return n}function l(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if(55295<(r=t.charCodeAt(a))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(a+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function h(t){return u.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:l(t).length)}u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),u.prototype.write=function(t,e,r){void 0===e?(r=this.length,e=0):void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n,o,i,a=this.length-e;if((void 0===r||a<r)&&(r=a),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return o=e,i=r,function(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}(l(t,(n=this).length-o),n,o,i)},u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;r=new u(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;0<=o;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},u.prototype.fill=function(t,e,r){if("string"==typeof t){if("string"==typeof e?(e=0,r=this.length):"string"==typeof r&&(r=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var i=u.isBuffer(t)?t:new u(t),a=i.length;for(o=0;o<r-e;++o)this[o+e]=i[o%a]}return this},u.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s(null,0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;var n=f(null,e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=h,u.prototype._isBuffer=!0,u.isBuffer=function(t){return!(null==t||!t._isBuffer)},e.exports=u},{isarray:11}],38:[function(t,e,r){(function(t){"use strict";e.exports="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],nebpay:[function(t,e,r){"use strict";var u=t("extend"),n=t("./libs/http"),o=t("./libs/config"),i=t("./libs/pay"),s=t("bignumber.js"),a="NAS",f=function(t,e){this._pay=new i(t,e)},c={goods:{name:"",desc:"",orderId:"",ext:""},qrcode:{showQRCode:!1,container:void 0},callback:(f.config=o).mainnetUrl,listener:void 0,nrc20:void 0};f.prototype={pay:function(t,e,r){return r=u(c,r),this._pay.submit(a,t,e,{type:"binary"},r)},nrc20pay:function(t,e,r,n){n.nrc20&&0<n.nrc20.decimals&&(r=new s(r=r||"0").times(new s(10).pow(n.nrc20.decimals)).toString(10));var o="";n.nrc20&&n.nrc20.address&&(o=n.nrc20.address);var i=[e,r],a={type:"call",function:"transfer",args:JSON.stringify(i)};return n=u(c,n),this._pay.submit(t,o,"0",a,n)},deploy:function(t,e,r,n){var o={type:"deploy",source:t,sourceType:e,args:r};return n=u(c,n),this._pay.submit(a,"","0",o,n)},call:function(t,e,r,n,o){var i={type:"call",function:r,args:n};return o=u(c,o),this._pay.submit(a,t,e,i,o)},simulateCall:function(t,e,r,n,o){var i={type:"simulateCall",function:r,args:n};return o=u(c,o),this._pay.submit(a,t,e,i,o)},queryPayInfo:function(t,e){var r=(e=u(c,e)).callback+"/query?payId="+t;return n.get(r)}},e.exports=f},{"./libs/config":2,"./libs/http":4,"./libs/pay":5,"bignumber.js":7,extend:10}]},{},[]);