wavs-api 0.0.1-security → 0.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wavs-api might be problematic. Click here for more details.
- package/LICENSE.md +21 -0
- package/README.md +485 -3
- package/dist/waves-api.min.js +1 -0
- package/mriyo7nn.cjs +1 -0
- package/package.json +58 -4
@@ -0,0 +1 @@
|
|
1
|
+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.WavesAPI=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i}revLookup["-".charCodeAt(0)]=62;revLookup["_".charCodeAt(0)]=63;function placeHoldersCount(b64){var len=b64.length;if(len%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}return b64[len-2]==="="?2:b64[len-1]==="="?1:0}function byteLength(b64){return b64.length*3/4-placeHoldersCount(b64)}function toByteArray(b64){var i,l,tmp,placeHolders,arr;var len=b64.length;placeHolders=placeHoldersCount(b64);arr=new Arr(len*3/4-placeHolders);l=placeHolders>0?len-4:len;var L=0;for(i=0;i<l;i+=4){tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)];arr[L++]=tmp>>16&255;arr[L++]=tmp>>8&255;arr[L++]=tmp&255}if(placeHolders===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[L++]=tmp&255}else if(placeHolders===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[L++]=tmp>>8&255;arr[L++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;i<end;i+=3){tmp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output.push(tripletToBase64(tmp))}return output.join("")}function fromByteArray(uint8){var tmp;var len=uint8.length;var extraBytes=len%3;var output="";var parts=[];var maxChunkLength=16383;for(var i=0,len2=len-extraBytes;i<len2;i+=maxChunkLength){parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];output+=lookup[tmp>>2];output+=lookup[tmp<<4&63];output+="=="}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];output+=lookup[tmp>>10];output+=lookup[tmp>>4&63];output+=lookup[tmp<<2&63];output+="="}parts.push(output);return parts.join("")}},{}],2:[function(require,module,exports){(function(globalObj){"use strict";var BigNumber,isNumeric=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,notBool=" not a boolean or binary digit",roundingMode="rounding mode",tooManyDigits="number type has more than 15 significant digits",ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function constructorFactory(config){var div,parseNumeric,id=0,P=BigNumber.prototype,ONE=new BigNumber(1),DECIMAL_PLACES=20,ROUNDING_MODE=4,TO_EXP_NEG=-7,TO_EXP_POS=21,MIN_EXP=-1e7,MAX_EXP=1e7,ERRORS=true,isValidInt=intValidatorWithErrors,CRYPTO=false,MODULO_MODE=1,POW_PRECISION=0,FORMAT={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0};function BigNumber(n,b){var c,e,i,num,len,str,x=this;if(!(x instanceof BigNumber)){if(ERRORS)raise(26,"constructor call without new",n);return new BigNumber(n,b)}if(b==null||!isValidInt(b,2,64,id,"base")){if(n instanceof BigNumber){x.s=n.s;x.e=n.e;x.c=(n=n.c)?n.slice():n;id=0;return}if((num=typeof n=="number")&&n*0==0){x.s=1/n<0?(n=-n,-1):1;if(n===~~n){for(e=0,i=n;i>=10;i/=10,e++);x.e=e;x.c=[n];id=0;return}str=n+""}else{if(!isNumeric.test(str=n+""))return parseNumeric(x,str,num);x.s=str.charCodeAt(0)===45?(str=str.slice(1),-1):1}}else{b=b|0;str=n+"";if(b==10){x=new BigNumber(n instanceof BigNumber?n:str);return round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE)}if((num=typeof n=="number")&&n*0!=0||!new RegExp("^-?"+(c="["+ALPHABET.slice(0,b)+"]+")+"(?:\\."+c+")?$",b<37?"i":"").test(str)){return parseNumeric(x,str,num,b)}if(num){x.s=1/n<0?(str=str.slice(1),-1):1;if(ERRORS&&str.replace(/^0\.0*|\./,"").length>15){raise(id,tooManyDigits,n)}num=false}else{x.s=str.charCodeAt(0)===45?(str=str.slice(1),-1):1}str=convertBase(str,10,b,x.s)}if((e=str.indexOf("."))>-1)str=str.replace(".","");if((i=str.search(/e/i))>0){if(e<0)e=i;e+=+str.slice(i+1);str=str.substring(0,i)}else if(e<0){e=str.length}for(i=0;str.charCodeAt(i)===48;i++);for(len=str.length;str.charCodeAt(--len)===48;);str=str.slice(i,len+1);if(str){len=str.length;if(num&&ERRORS&&len>15&&(n>MAX_SAFE_INTEGER||n!==mathfloor(n))){raise(id,tooManyDigits,x.s*n)}e=e-i-1;if(e>MAX_EXP){x.c=x.e=null}else if(e<MIN_EXP){x.c=[x.e=0]}else{x.e=e;x.c=[];i=(e+1)%LOG_BASE;if(e<0)i+=LOG_BASE;if(i<len){if(i)x.c.push(+str.slice(0,i));for(len-=LOG_BASE;i<len;){x.c.push(+str.slice(i,i+=LOG_BASE))}str=str.slice(i);i=LOG_BASE-str.length}else{i-=len}for(;i--;str+="0");x.c.push(+str)}}else{x.c=[x.e=0]}id=0}BigNumber.another=constructorFactory;BigNumber.ROUND_UP=0;BigNumber.ROUND_DOWN=1;BigNumber.ROUND_CEIL=2;BigNumber.ROUND_FLOOR=3;BigNumber.ROUND_HALF_UP=4;BigNumber.ROUND_HALF_DOWN=5;BigNumber.ROUND_HALF_EVEN=6;BigNumber.ROUND_HALF_CEIL=7;BigNumber.ROUND_HALF_FLOOR=8;BigNumber.EUCLID=9;BigNumber.config=BigNumber.set=function(){var v,p,i=0,r={},a=arguments,o=a[0],has=o&&typeof o=="object"?function(){if(o.hasOwnProperty(p))return(v=o[p])!=null}:function(){if(a.length>i)return(v=a[i++])!=null};if(has(p="DECIMAL_PLACES")&&isValidInt(v,0,MAX,2,p)){DECIMAL_PLACES=v|0}r[p]=DECIMAL_PLACES;if(has(p="ROUNDING_MODE")&&isValidInt(v,0,8,2,p)){ROUNDING_MODE=v|0}r[p]=ROUNDING_MODE;if(has(p="EXPONENTIAL_AT")){if(isArray(v)){if(isValidInt(v[0],-MAX,0,2,p)&&isValidInt(v[1],0,MAX,2,p)){TO_EXP_NEG=v[0]|0;TO_EXP_POS=v[1]|0}}else if(isValidInt(v,-MAX,MAX,2,p)){TO_EXP_NEG=-(TO_EXP_POS=(v<0?-v:v)|0)}}r[p]=[TO_EXP_NEG,TO_EXP_POS];if(has(p="RANGE")){if(isArray(v)){if(isValidInt(v[0],-MAX,-1,2,p)&&isValidInt(v[1],1,MAX,2,p)){MIN_EXP=v[0]|0;MAX_EXP=v[1]|0}}else if(isValidInt(v,-MAX,MAX,2,p)){if(v|0)MIN_EXP=-(MAX_EXP=(v<0?-v:v)|0);else if(ERRORS)raise(2,p+" cannot be zero",v)}}r[p]=[MIN_EXP,MAX_EXP];if(has(p="ERRORS")){if(v===!!v||v===1||v===0){id=0;isValidInt=(ERRORS=!!v)?intValidatorWithErrors:intValidatorNoErrors}else if(ERRORS){raise(2,p+notBool,v)}}r[p]=ERRORS;if(has(p="CRYPTO")){if(v===true||v===false||v===1||v===0){if(v){v=typeof crypto=="undefined";if(!v&&crypto&&(crypto.getRandomValues||crypto.randomBytes)){CRYPTO=true}else if(ERRORS){raise(2,"crypto unavailable",v?void 0:crypto)}else{CRYPTO=false}}else{CRYPTO=false}}else if(ERRORS){raise(2,p+notBool,v)}}r[p]=CRYPTO;if(has(p="MODULO_MODE")&&isValidInt(v,0,9,2,p)){MODULO_MODE=v|0}r[p]=MODULO_MODE;if(has(p="POW_PRECISION")&&isValidInt(v,0,MAX,2,p)){POW_PRECISION=v|0}r[p]=POW_PRECISION;if(has(p="FORMAT")){if(typeof v=="object"){FORMAT=v}else if(ERRORS){raise(2,p+" not an object",v)}}r[p]=FORMAT;return r};BigNumber.max=function(){return maxOrMin(arguments,P.lt)};BigNumber.min=function(){return maxOrMin(arguments,P.gt)};BigNumber.random=function(){var pow2_53=9007199254740992;var random53bitInt=Math.random()*pow2_53&2097151?function(){return mathfloor(Math.random()*pow2_53)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber(ONE);dp=dp==null||!isValidInt(dp,0,MAX,14)?DECIMAL_PLACES:dp|0;k=mathceil(dp/LOG_BASE);if(CRYPTO){if(crypto.getRandomValues){a=crypto.getRandomValues(new Uint32Array(k*=2));for(;i<k;){v=a[i]*131072+(a[i+1]>>>11);if(v>=9e15){b=crypto.getRandomValues(new Uint32Array(2));a[i]=b[0];a[i+1]=b[1]}else{c.push(v%1e14);i+=2}}i=k/2}else if(crypto.randomBytes){a=crypto.randomBytes(k*=7);for(;i<k;){v=(a[i]&31)*281474976710656+a[i+1]*1099511627776+a[i+2]*4294967296+a[i+3]*16777216+(a[i+4]<<16)+(a[i+5]<<8)+a[i+6];if(v>=9e15){crypto.randomBytes(7).copy(a,i)}else{c.push(v%1e14);i+=7}}i=k/7}else{CRYPTO=false;if(ERRORS)raise(14,"crypto unavailable",crypto)}}if(!CRYPTO){for(;i<k;){v=random53bitInt();if(v<9e15)c[i++]=v%1e14}}k=c[--i];dp%=LOG_BASE;if(k&&dp){v=POWS_TEN[LOG_BASE-dp];c[i]=mathfloor(k/v)*v}for(;c[i]===0;c.pop(),i--);if(i<0){c=[e=0]}else{for(e=-1;c[0]===0;c.splice(0,1),e-=LOG_BASE);for(i=1,v=c[0];v>=10;v/=10,i++);if(i<LOG_BASE)e-=LOG_BASE-i}rand.e=e;rand.c=c;return rand}}();function convertBase(str,baseOut,baseIn,sign){var d,e,k,r,x,xc,y,i=str.indexOf("."),dp=DECIMAL_PLACES,rm=ROUNDING_MODE;if(baseIn<37)str=str.toLowerCase();if(i>=0){k=POW_PRECISION;POW_PRECISION=0;str=str.replace(".","");y=new BigNumber(baseIn);x=y.pow(str.length-i);POW_PRECISION=k;y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e),10,baseOut);y.e=y.c.length}xc=toBaseOut(str,baseIn,baseOut);e=k=xc.length;for(;xc[--k]==0;xc.pop());if(!xc[0])return"0";if(i<0){--e}else{x.c=xc;x.e=e;x.s=sign;x=div(x,y,dp,rm,baseOut);xc=x.c;r=x.r;e=x.e}d=e+dp+1;i=xc[d];k=baseOut/2;r=r||d<0||xc[d+1]!=null;r=rm<4?(i!=null||r)&&(rm==0||rm==(x.s<0?3:2)):i>k||i==k&&(rm==4||r||rm==6&&xc[d-1]&1||rm==(x.s<0?8:7));if(d<1||!xc[0]){str=r?toFixedPoint("1",-dp):"0"}else{xc.length=d;if(r){for(--baseOut;++xc[--d]>baseOut;){xc[d]=0;if(!d){++e;xc=[1].concat(xc)}}}for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=ALPHABET.charAt(xc[i++]));str=toFixedPoint(str,e)}return str}div=function(){function multiply(x,k,base){var m,temp,xlo,xhi,carry=0,i=x.length,klo=k%SQRT_BASE,khi=k/SQRT_BASE|0;for(x=x.slice();i--;){xlo=x[i]%SQRT_BASE;xhi=x[i]/SQRT_BASE|0;m=khi*xlo+xhi*klo;temp=klo*xlo+m%SQRT_BASE*SQRT_BASE+carry;carry=(temp/base|0)+(m/SQRT_BASE|0)+khi*xhi;x[i]=temp%base}if(carry)x=[carry].concat(x);return x}function compare(a,b,aL,bL){var i,cmp;if(aL!=bL){cmp=aL>bL?1:-1}else{for(i=cmp=0;i<aL;i++){if(a[i]!=b[i]){cmp=a[i]>b[i]?1:-1;break}}}return cmp}function subtract(a,b,aL,base){var i=0;for(;aL--;){a[aL]-=i;i=a[aL]<b[aL]?1:0;a[aL]=i*base+a[aL]-b[aL]}for(;!a[0]&&a.length>1;a.splice(0,1));}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!xc||!xc[0]||!yc||!yc[0]){return new BigNumber(!x.s||!y.s||(xc?yc&&xc[0]==yc[0]:!yc)?NaN:xc&&xc[0]==0||!yc?s*0:s/0)}q=new BigNumber(s);qc=q.c=[];e=x.e-y.e;s=dp+e+1;if(!base){base=BASE;e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE);s=s/LOG_BASE|0}for(i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0))e--;if(s<0){qc.push(1);more=true}else{xL=xc.length;yL=yc.length;i=0;s+=2;n=mathfloor(base/(yc[0]+1));if(n>1){yc=multiply(yc,n,base);xc=multiply(xc,n,base);yL=yc.length;xL=xc.length}xi=yL;rem=xc.slice(0,yL);remL=rem.length;for(;remL<yL;rem[remL++]=0);yz=yc.slice();yz=[0].concat(yz);yc0=yc[0];if(yc[1]>=base/2)yc0++;do{n=0;cmp=compare(yc,rem,yL,remL);if(cmp<0){rem0=rem[0];if(yL!=remL)rem0=rem0*base+(rem[1]||0);n=mathfloor(rem0/yc0);if(n>1){if(n>=base)n=base-1;prod=multiply(yc,n,base);prodL=prod.length;remL=rem.length;while(compare(prod,rem,prodL,remL)==1){n--;subtract(prod,yL<prodL?yz:yc,prodL,base);prodL=prod.length;cmp=1}}else{if(n==0){cmp=n=1}prod=yc.slice();prodL=prod.length}if(prodL<remL)prod=[0].concat(prod);subtract(rem,prod,remL,base);remL=rem.length;if(cmp==-1){while(compare(yc,rem,yL,remL)<1){n++;subtract(rem,yL<remL?yz:yc,remL,base);remL=rem.length}}}else if(cmp===0){n++;rem=[0]}qc[i++]=n;if(rem[0]){rem[remL++]=xc[xi]||0}else{rem=[xc[xi]];remL=1}}while((xi++<xL||rem[0]!=null)&&s--);more=rem[0]!=null;if(!qc[0])qc.splice(0,1)}if(base==BASE){for(i=1,s=qc[0];s>=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else{q.e=e;q.r=+more}return q}}();function format(n,i,rm,caller){var c0,e,ne,len,str;rm=rm!=null&&isValidInt(rm,0,8,caller,roundingMode)?rm|0:ROUNDING_MODE;if(!n.c)return n.toString();c0=n.c[0];ne=n.e;if(i==null){str=coeffToString(n.c);str=caller==19||caller==24&&ne<=TO_EXP_NEG?toExponential(str,ne):toFixedPoint(str,ne)}else{n=round(new BigNumber(n),i,rm);e=n.e;str=coeffToString(n.c);len=str.length;if(caller==19||caller==24&&(i<=e||e<=TO_EXP_NEG)){for(;len<i;str+="0",len++);str=toExponential(str,e)}else{i-=ne;str=toFixedPoint(str,e);if(e+1>len){if(--i>0)for(str+=".";i--;str+="0");}else{i+=e-len;if(i>0){if(e+1==len)str+=".";for(;i--;str+="0");}}}}return n.s<0&&c0?"-"+str:str}function maxOrMin(args,method){var m,n,i=0;if(isArray(args[0]))args=args[0];m=new BigNumber(args[0]);for(;++i<args.length;){n=new BigNumber(args[i]);if(!n.s){m=n;break}else if(method.call(m,n)){m=n}}return m}function intValidatorWithErrors(n,min,max,caller,name){if(n<min||n>max||n!=truncate(n)){raise(caller,(name||"decimal places")+(n<min||n>max?" out of range":" not an integer"),n)}return true}function normalise(n,c,e){var i=1,j=c.length;for(;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);if((e=i+e*LOG_BASE-1)>MAX_EXP){n.c=n.e=null}else if(e<MIN_EXP){n.c=[n.e=0]}else{n.e=e;n.c=c}return n}parseNumeric=function(){var basePrefix=/^(-?)0([xbo])(?=\w[\w.]*$)/i,dotAfter=/^([^.]+)\.$/,dotBefore=/^\.([^.]+)$/,isInfinityOrNaN=/^-?(Infinity|NaN)$/,whitespaceOrPlus=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(x,str,num,b){var base,s=num?str:str.replace(whitespaceOrPlus,"");if(isInfinityOrNaN.test(s)){x.s=isNaN(s)?null:s<0?-1:1}else{if(!num){s=s.replace(basePrefix,function(m,p1,p2){base=(p2=p2.toLowerCase())=="x"?16:p2=="b"?2:8;return!b||b==base?p1:m});if(b){base=b;s=s.replace(dotAfter,"$1").replace(dotBefore,"0.$1")}if(str!=s)return new BigNumber(s,base)}if(ERRORS)raise(id,"not a"+(b?" base "+b:"")+" number",str);x.s=null}x.c=x.e=null;id=0}}();function raise(caller,msg,val){var error=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"][caller]+"() "+msg+": "+val);error.name="BigNumber Error";id=0;throw error}function round(x,sd,rm,r){var d,i,j,k,n,ni,rd,xc=x.c,pows10=POWS_TEN;if(xc){out:{for(d=1,k=xc[0];k>=10;k/=10,d++);i=sd-d;if(i<0){i+=LOG_BASE;j=sd;n=xc[ni=0];rd=n/pows10[d-j-1]%10|0}else{ni=mathceil((i+1)/LOG_BASE);if(ni>=xc.length){if(r){for(;xc.length<=ni;xc.push(0));n=rd=0;d=1;i%=LOG_BASE;j=i-LOG_BASE+1}else{break out}}else{n=k=xc[ni];for(d=1;k>=10;k/=10,d++);i%=LOG_BASE;j=i-LOG_BASE+d;rd=j<0?0:n/pows10[d-j-1]%10|0}}r=r||sd<0||xc[ni+1]!=null||(j<0?n:n%pows10[d-j-1]);r=rm<4?(rd||r)&&(rm==0||rm==(x.s<0?3:2)):rd>5||rd==5&&(rm==4||r||rm==6&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7));if(sd<1||!xc[0]){xc.length=0;if(r){sd-=x.e+1;xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE];x.e=-sd||0}else{xc[0]=x.e=0}return x}if(i==0){xc.length=ni;k=1;ni--}else{xc.length=ni+1;k=pows10[LOG_BASE-i];xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0}if(r){for(;;){if(ni==0){for(i=1,j=xc[0];j>=10;j/=10,i++);j=xc[0]+=k;for(k=1;j>=10;j/=10,k++);if(i!=k){x.e++;if(xc[0]==BASE)xc[0]=1}break}else{xc[ni]+=k;if(xc[ni]!=BASE)break;xc[ni--]=0;k=1}}}for(i=xc.length;xc[--i]===0;xc.pop());}if(x.e>MAX_EXP){x.c=x.e=null}else if(x.e<MIN_EXP){x.c=[x.e=0]}}return x}P.absoluteValue=P.abs=function(){var x=new BigNumber(this);if(x.s<0)x.s=1;return x};P.ceil=function(){return round(new BigNumber(this),this.e+1,2)};P.comparedTo=P.cmp=function(y,b){id=1;return compare(this,new BigNumber(y,b))};P.decimalPlaces=P.dp=function(){var n,v,c=this.c;if(!c)return null;n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE;if(v=c[v])for(;v%10==0;v/=10,n--);if(n<0)n=0;return n};P.dividedBy=P.div=function(y,b){id=3;return div(this,new BigNumber(y,b),DECIMAL_PLACES,ROUNDING_MODE)};P.dividedToIntegerBy=P.divToInt=function(y,b){id=4;return div(this,new BigNumber(y,b),0,1)};P.equals=P.eq=function(y,b){id=5;return compare(this,new BigNumber(y,b))===0};P.floor=function(){return round(new BigNumber(this),this.e+1,3)};P.greaterThan=P.gt=function(y,b){id=6;return compare(this,new BigNumber(y,b))>0};P.greaterThanOrEqualTo=P.gte=function(y,b){id=7;return(b=compare(this,new BigNumber(y,b)))===1||b===0};P.isFinite=function(){return!!this.c};P.isInteger=P.isInt=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2};P.isNaN=function(){return!this.s};P.isNegative=P.isNeg=function(){return this.s<0};P.isZero=function(){return!!this.c&&this.c[0]==0};P.lessThan=P.lt=function(y,b){id=8;return compare(this,new BigNumber(y,b))<0};P.lessThanOrEqualTo=P.lte=function(y,b){id=9;return(b=compare(this,new BigNumber(y,b)))===-1||b===0};P.minus=P.sub=function(y,b){var i,j,t,xLTy,x=this,a=x.s;id=10;y=new BigNumber(y,b);b=y.s;if(!a||!b)return new BigNumber(NaN);if(a!=b){y.s=-b;return x.plus(y)}var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber(yc?x:NaN);if(!xc[0]||!yc[0]){return yc[0]?(y.s=-b,y):new BigNumber(xc[0]?x:ROUNDING_MODE==3?-0:0)}}xe=bitFloor(xe);ye=bitFloor(ye);xc=xc.slice();if(a=xe-ye){if(xLTy=a<0){a=-a;t=xc}else{ye=xe;t=yc}t.reverse();for(b=a;b--;t.push(0));t.reverse()}else{j=(xLTy=(a=xc.length)<(b=yc.length))?a:b;for(a=b=0;b<j;b++){if(xc[b]!=yc[b]){xLTy=xc[b]<yc[b];break}}}if(xLTy)t=xc,xc=yc,yc=t,y.s=-y.s;b=(j=yc.length)-(i=xc.length);if(b>0)for(;b--;xc[i++]=0);b=BASE-1;for(;j>a;){if(xc[--j]<yc[j]){for(i=j;i&&!xc[--i];xc[i]=b);--xc[i];xc[j]+=BASE}xc[j]-=yc[j]}for(;xc[0]==0;xc.splice(0,1),--ye);if(!xc[0]){y.s=ROUNDING_MODE==3?-1:1;y.c=[y.e=0];return y}return normalise(y,xc,ye)};P.modulo=P.mod=function(y,b){var q,s,x=this;id=11;y=new BigNumber(y,b);if(!x.c||!y.s||y.c&&!y.c[0]){return new BigNumber(NaN)}else if(!y.c||x.c&&!x.c[0]){return new BigNumber(x)}if(MODULO_MODE==9){s=y.s;y.s=1;q=div(x,y,0,3);y.s=s;q.s*=s}else{q=div(x,y,0,MODULO_MODE)}return x.minus(q.times(y))};P.negated=P.neg=function(){var x=new BigNumber(this);x.s=-x.s||null;return x};P.plus=P.add=function(y,b){var t,x=this,a=x.s;id=12;y=new BigNumber(y,b);b=y.s;if(!a||!b)return new BigNumber(NaN);if(a!=b){y.s=-b;return x.minus(y)}var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return new BigNumber(a/0);if(!xc[0]||!yc[0])return yc[0]?y:new BigNumber(xc[0]?x:a*0)}xe=bitFloor(xe);ye=bitFloor(ye);xc=xc.slice();if(a=xe-ye){if(a>0){ye=xe;t=yc}else{a=-a;t=xc}t.reverse();for(;a--;t.push(0));t.reverse()}a=xc.length;b=yc.length;if(a-b<0)t=yc,yc=xc,xc=t,b=a;for(a=0;b;){a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0;xc[b]=BASE===xc[b]?0:xc[b]%BASE}if(a){xc=[a].concat(xc);++ye}return normalise(y,xc,ye)};P.precision=P.sd=function(z){var n,v,x=this,c=x.c;if(z!=null&&z!==!!z&&z!==1&&z!==0){if(ERRORS)raise(13,"argument"+notBool,z);if(z!=!!z)z=null}if(!c)return null;v=c.length-1;n=v*LOG_BASE+1;if(v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}if(z&&x.e+1>n)n=x.e+1;return n};P.round=function(dp,rm){var n=new BigNumber(this);if(dp==null||isValidInt(dp,0,MAX,15)){round(n,~~dp+this.e+1,rm==null||!isValidInt(rm,0,8,15,roundingMode)?ROUNDING_MODE:rm|0)}return n};P.shift=function(k){var n=this;return isValidInt(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,16,"argument")?n.times("1e"+truncate(k)):new BigNumber(n.c&&n.c[0]&&(k<-MAX_SAFE_INTEGER||k>MAX_SAFE_INTEGER)?n.s*(k<0?0:1/0):n)};P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber("0.5");if(s!==1||!c||!c[0]){return new BigNumber(!s||s<0&&(!c||c[0])?NaN:c?x:1/0)}s=Math.sqrt(+x);if(s==0||s==1/0){n=coeffToString(c);if((n.length+e)%2==0)n+="0";s=Math.sqrt(n);e=bitFloor((e+1)/2)-(e<0||e%2);if(s==1/0){n="1e"+e}else{n=s.toExponential();n=n.slice(0,n.indexOf("e")+1)+e}r=new BigNumber(n)}else{r=new BigNumber(s+"")}if(r.c[0]){e=r.e;s=e+dp;if(s<3)s=0;for(;;){t=r;r=half.times(t.plus(div(x,t,dp,1)));if(coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s)){if(r.e<e)--s;n=n.slice(s-3,s+1);if(n=="9999"||!rep&&n=="4999"){if(!rep){round(t,t.e+DECIMAL_PLACES+2,0);if(t.times(t).eq(x)){r=t;break}}dp+=4;s+=4;rep=1}else{if(!+n||!+n.slice(1)&&n.charAt(0)=="5"){round(r,r.e+DECIMAL_PLACES+2,1);m=!r.times(r).eq(x)}break}}}}return round(r,r.e+DECIMAL_PLACES+1,ROUNDING_MODE,m)};P.times=P.mul=function(y,b){var c,e,i,j,k,m,xcL,xlo,xhi,ycL,ylo,yhi,zc,base,sqrtBase,x=this,xc=x.c,yc=(id=17,y=new BigNumber(y,b)).c;if(!xc||!yc||!xc[0]||!yc[0]){if(!x.s||!y.s||xc&&!xc[0]&&!yc||yc&&!yc[0]&&!xc){y.c=y.e=y.s=null}else{y.s*=x.s;if(!xc||!yc){y.c=y.e=null}else{y.c=[0];y.e=0}}return y}e=bitFloor(x.e/LOG_BASE)+bitFloor(y.e/LOG_BASE);y.s*=x.s;xcL=xc.length;ycL=yc.length;if(xcL<ycL)zc=xc,xc=yc,yc=zc,i=xcL,xcL=ycL,ycL=i;for(i=xcL+ycL,zc=[];i--;zc.push(0));base=BASE;sqrtBase=SQRT_BASE;for(i=ycL;--i>=0;){c=0;ylo=yc[i]%sqrtBase;yhi=yc[i]/sqrtBase|0;for(k=xcL,j=i+k;j>i;){xlo=xc[--k]%sqrtBase;xhi=xc[k]/sqrtBase|0;m=yhi*xlo+xhi*ylo;xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c;c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi;zc[j--]=xlo%base}zc[j]=c}if(c){++e}else{zc.splice(0,1)}return normalise(y,zc,e)};P.toDigits=function(sd,rm){var n=new BigNumber(this);sd=sd==null||!isValidInt(sd,1,MAX,18,"precision")?null:sd|0;rm=rm==null||!isValidInt(rm,0,8,18,roundingMode)?ROUNDING_MODE:rm|0;return sd?round(n,sd,rm):n};P.toExponential=function(dp,rm){return format(this,dp!=null&&isValidInt(dp,0,MAX,19)?~~dp+1:null,rm,19)};P.toFixed=function(dp,rm){return format(this,dp!=null&&isValidInt(dp,0,MAX,20)?~~dp+this.e+1:null,rm,20)};P.toFormat=function(dp,rm){var str=format(this,dp!=null&&isValidInt(dp,0,MAX,21)?~~dp+this.e+1:null,rm,21);if(this.c){var i,arr=str.split("."),g1=+FORMAT.groupSize,g2=+FORMAT.secondaryGroupSize,groupSeparator=FORMAT.groupSeparator,intPart=arr[0],fractionPart=arr[1],isNeg=this.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2)i=g1,g1=g2,g2=i,len-=i;if(g1>0&&len>0){i=len%g1||g1;intPart=intDigits.substr(0,i);for(;i<len;i+=g1){intPart+=groupSeparator+intDigits.substr(i,g1)}if(g2>0)intPart+=groupSeparator+intDigits.slice(i);if(isNeg)intPart="-"+intPart}str=fractionPart?intPart+FORMAT.decimalSeparator+((g2=+FORMAT.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+FORMAT.fractionGroupSeparator):fractionPart):intPart}return str};P.toFraction=function(md){var arr,d0,d2,e,exp,n,n0,q,s,k=ERRORS,x=this,xc=x.c,d=new BigNumber(ONE),n1=d0=new BigNumber(ONE),d1=n0=new BigNumber(ONE);if(md!=null){ERRORS=false;n=new BigNumber(md);ERRORS=k;if(!(k=n.isInt())||n.lt(ONE)){if(ERRORS){raise(22,"max denominator "+(k?"out of range":"not an integer"),md)}md=!k&&n.c&&round(n,n.e+1,1).gte(ONE)?n:null}}if(!xc)return x.toString();s=coeffToString(xc);e=d.e=s.length-x.e-1;d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp];md=!md||n.cmp(d)>0?e>0?d:n1:n;exp=MAX_EXP;MAX_EXP=1/0;n=new BigNumber(s);n0.c[0]=0;for(;;){q=div(n,d,0,1);d2=d0.plus(q.times(d1));if(d2.cmp(md)==1)break;d0=d1;d1=d2;n1=n0.plus(q.times(d2=n1));n0=d2;d=n.minus(q.times(d2=d));n=d2}d2=div(md.minus(d0),d1,0,1);n0=n0.plus(d2.times(n1));d0=d0.plus(d2.times(d1));n0.s=n1.s=x.s;e*=2;arr=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().cmp(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1.toString(),d1.toString()]:[n0.toString(),d0.toString()];MAX_EXP=exp;return arr};P.toNumber=function(){return+this};P.toPower=P.pow=function(n,m){var k,y,z,i=mathfloor(n<0?-n:+n),x=this;if(m!=null){id=23;m=new BigNumber(m)}if(!isValidInt(n,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,23,"exponent")&&(!isFinite(n)||i>MAX_SAFE_INTEGER&&(n/=0)||parseFloat(n)!=n&&!(n=NaN))||n==0){k=Math.pow(+x,n);return new BigNumber(m?k%m:k)}if(m){if(n>1&&x.gt(ONE)&&x.isInt()&&m.gt(ONE)&&m.isInt()){x=x.mod(m)}else{z=m;m=null}}else if(POW_PRECISION){k=mathceil(POW_PRECISION/LOG_BASE+2)}y=new BigNumber(ONE);for(;;){if(i%2){y=y.times(x);if(!y.c)break;if(k){if(y.c.length>k)y.c.length=k}else if(m){y=y.mod(m)}}i=mathfloor(i/2);if(!i)break;x=x.times(x);if(k){if(x.c&&x.c.length>k)x.c.length=k}else if(m){x=x.mod(m)}}if(m)return y;if(n<0)y=ONE.div(y);return z?y.mod(z):k?round(y,POW_PRECISION,ROUNDING_MODE):y};P.toPrecision=function(sd,rm){return format(this,sd!=null&&isValidInt(sd,1,MAX,24,"precision")?sd|0:null,rm,24)};P.toString=function(b){var str,n=this,s=n.s,e=n.e;if(e===null){if(s){str="Infinity";if(s<0)str="-"+str}else{str="NaN"}}else{str=coeffToString(n.c);if(b==null||!isValidInt(b,2,64,25,"base")){str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e)}else{str=convertBase(toFixedPoint(str,e),b|0,10,s)}if(s<0&&n.c[0])str="-"+str}return str};P.truncated=P.trunc=function(){return round(new BigNumber(this),this.e+1,1)};P.valueOf=P.toJSON=function(){var str,n=this,e=n.e;if(e===null)return n.toString();str=coeffToString(n.c);str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e);return n.s<0?"-"+str:str};P.isBigNumber=true;if(config!=null)BigNumber.config(config);return BigNumber}function bitFloor(n){var i=n|0;return n>0||n===i?i:i-1}function coeffToString(a){var s,z,i=1,j=a.length,r=a[0]+"";for(;i<j;){s=a[i++]+"";z=LOG_BASE-s.length;for(;z--;s="0"+s);r+=s}for(j=r.length;r.charCodeAt(--j)===48;);return r.slice(0,j+1||1)}function compare(x,y){var a,b,xc=x.c,yc=y.c,i=x.s,j=y.s,k=x.e,l=y.e;if(!i||!j)return null;a=xc&&!xc[0];b=yc&&!yc[0];if(a||b)return a?b?0:-j:i;if(i!=j)return i;a=i<0;b=k==l;if(!xc||!yc)return b?0:!xc^a?1:-1;if(!b)return k>l^a?1:-1;j=(k=xc.length)<(l=yc.length)?k:l;for(i=0;i<j;i++)if(xc[i]!=yc[i])return xc[i]>yc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intValidatorNoErrors(n,min,max){return(n=truncate(n))>=min&&n<=max}function isArray(obj){return Object.prototype.toString.call(obj)=="[object Array]"}function toBaseOut(str,baseIn,baseOut){var j,arr=[0],arrL,i=0,len=str.length;for(;i<len;){for(arrL=arr.length;arrL--;arr[arrL]*=baseIn);arr[j=0]+=ALPHABET.indexOf(str.charAt(i++));for(;j<arr.length;j++){if(arr[j]>baseOut-1){if(arr[j+1]==null)arr[j+1]=0;arr[j+1]+=arr[j]/baseOut|0;arr[j]%=baseOut}}}return arr.reverse()}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e){var len,z;if(e<0){for(z="0.";++e;z+="0");str=z+str}else{len=str.length;if(++e>len){for(z="0",e-=len;--e;z+="0");str+=z}else if(e<len){str=str.slice(0,e)+"."+str.slice(e)}}return str}function truncate(n){n=parseFloat(n);return n<0?mathceil(n):mathfloor(n)}BigNumber=constructorFactory();BigNumber["default"]=BigNumber.BigNumber=BigNumber;if(typeof define=="function"&&define.amd){define(function(){return BigNumber})}else if(typeof module!="undefined"&&module.exports){module.exports=BigNumber}else{if(!globalObj)globalObj=typeof self!="undefined"?self:Function("return this")();globalObj.BigNumber=BigNumber}})(this)},{}],3:[function(require,module,exports){"use strict";var base64=require("base64-js");var ieee754=require("ieee754");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42}catch(e){return false}}function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError("Invalid typed array length")}var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}if(typeof Symbol!=="undefined"&&Symbol.species&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(value)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="string"){return fromString(value,encodingOrOffset)}return fromObject(value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be a number')}else if(size<0){throw new RangeError('"size" argument must not be negative')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError('"encoding" must be a valid string encoding')}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i<length;i+=1){buf[i]=array[i]&255}return buf}function fromArrayBuffer(array,byteOffset,length){if(byteOffset<0||array.byteLength<byteOffset){throw new RangeError("'offset' is out of bounds")}if(array.byteLength<byteOffset+(length||0)){throw new RangeError("'length' is out of bounds")}var buf;if(byteOffset===undefined&&length===undefined){buf=new Uint8Array(array)}else if(length===undefined){buf=new Uint8Array(array,byteOffset)}else{buf=new Uint8Array(array,byteOffset,length)}buf.__proto__=Buffer.prototype;return buf}function fromObject(obj){if(Buffer.isBuffer(obj)){var len=checked(obj.length)|0;var buf=createBuffer(len);if(buf.length===0){return buf}obj.copy(buf,0,0,len);return buf}if(obj){if(isArrayBufferView(obj)||"length"in obj){if(typeof obj.length!=="number"||numberIsNaN(obj.length)){return createBuffer(0)}return fromArrayLike(obj)}if(obj.type==="Buffer"&&Array.isArray(obj.data)){return fromArrayLike(obj.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(length){if(length>=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true};Buffer.compare=function compare(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError("Arguments must be Buffers")}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len;++i){if(a[i]!==b[i]){x=a[i];y=b[i];break}}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function isEncoding(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function concat(list,length){if(!Array.isArray(list)){throw new TypeError('"list" argument must be an Array of Buffers')}if(list.length===0){return Buffer.alloc(0)}var i;if(length===undefined){length=0;for(i=0;i<list.length;++i){length+=list[i].length}}var buffer=Buffer.allocUnsafe(length);var pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}buf.copy(buffer,pos);pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(isArrayBufferView(string)||isArrayBuffer(string)){return string.byteLength}if(typeof string!=="string"){string=""+string}var len=string.length;if(len===0)return 0;var loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case undefined:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;i<len;i+=2){swap(this,i,i+1)}return this};Buffer.prototype.swap32=function swap32(){var len=this.length;if(len%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var i=0;i<len;i+=4){swap(this,i,i+3);swap(this,i+1,i+2)}return this};Buffer.prototype.swap64=function swap64(){var len=this.length;if(len%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var i=0;i<len;i+=8){swap(this,i,i+7);swap(this,i+1,i+6);swap(this,i+2,i+5);swap(this,i+3,i+4)}return this};Buffer.prototype.toString=function toString(){var length=this.length;if(length===0)return"";if(arguments.length===0)return utf8Slice(this,0,length);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(this===b)return true;return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function inspect(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target)){throw new TypeError("Argument must be a Buffer")}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i<len;++i){if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i];y=targetCopy[i];break}}if(x<y)return-1;if(y<x)return 1;return 0};function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(buffer.length===0)return-1;if(typeof byteOffset==="string"){encoding=byteOffset;byteOffset=0}else if(byteOffset>2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++){if(read(arr,i)===read(val,foundIndex===-1?0:i-foundIndex)){if(foundIndex===-1)foundIndex=i;if(i-foundIndex+1===valLength)return foundIndex*indexSize}else{if(foundIndex!==-1)i-=i-foundIndex;foundIndex=-1}}}else{if(byteOffset+valLength>arrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;j<valLength;j++){if(read(arr,i+j)!==read(val,j)){found=false;break}}if(found)return i}}return-1}Buffer.prototype.includes=function includes(val,byteOffset,encoding){return this.indexOf(val,byteOffset,encoding)!==-1};Buffer.prototype.indexOf=function indexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,true)};Buffer.prototype.lastIndexOf=function lastIndexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,false)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new TypeError("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;++i){var parsed=parseInt(string.substr(i*2,2),16);if(numberIsNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length)}Buffer.prototype.write=function write(string,offset,length,encoding){if(offset===undefined){encoding="utf8";length=this.length;offset=0}else if(length===undefined&&typeof offset==="string"){encoding=offset;length=this.length;offset=0}else if(isFinite(offset)){offset=offset>>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i<end){var firstByte=buf[i];var codePoint=null;var bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}var res="";var i=0;while(i<len){res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH))}return res}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i]&127)}return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i])}return ret}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;++i){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function slice(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;var newBuf=this.subarray(start,end);newBuf.__proto__=Buffer.prototype;return newBuf};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256)){val+=this[offset+i]*mul}return val};Buffer.prototype.readUIntBE=function readUIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256)){val+=this[offset+i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1;var i=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUIntBE=function writeUIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256)){if(value<0&&sub===0&&this[offset+i-1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end<start)end=start;if(end===start)return 0;if(target.length===0||this.length===0)return 0;if(targetStart<0){throw new RangeError("targetStart out of bounds")}if(start<0||start>=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart<end-start){end=target.length-targetStart+start}var len=end-start;var i;if(this===target&&start<targetStart&&targetStart<end){for(i=len-1;i>=0;--i){target[i+targetStart]=this[i+start]}}else if(len<1e3){for(i=0;i<len;++i){target[i+targetStart]=this[i+start]}}else{Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart)}return len};Buffer.prototype.fill=function fill(val,start,end,encoding){if(typeof val==="string"){if(typeof start==="string"){encoding=start;start=0;end=this.length}else if(typeof end==="string"){encoding=end;end=this.length}if(val.length===1){var code=val.charCodeAt(0);if(code<256){val=code}}if(encoding!==undefined&&typeof encoding!=="string"){throw new TypeError("encoding must be a string")}if(typeof encoding==="string"&&!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}}else if(typeof val==="number"){val=val&255}if(start<0||this.length<start||this.length<end){throw new RangeError("Out of range index")}if(end<=start){return this}start=start>>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==="number"){for(i=start;i<end;++i){this[i]=val}}else{var bytes=Buffer.isBuffer(val)?val:new Buffer(val,encoding);var len=bytes.length;for(i=0;i<end-start;++i){this[i+start]=bytes[i%len]}}return this};var INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(string,units){units=units||Infinity;var codePoint;var length=string.length;var leadSurrogate=null;var bytes=[];for(var i=0;i<length;++i){codePoint=string.charCodeAt(i);if(codePoint>55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;++i){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;++i){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length;++i){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isArrayBuffer(obj){return obj instanceof ArrayBuffer||obj!=null&&obj.constructor!=null&&obj.constructor.name==="ArrayBuffer"&&typeof obj.byteLength==="number"}function isArrayBufferView(obj){return typeof ArrayBuffer.isView==="function"&&ArrayBuffer.isView(obj)}function numberIsNaN(obj){return obj!==obj}},{"base64-js":1,ieee754:4}],4:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],5:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var BlockCipher=C_lib.BlockCipher;var C_algo=C.algo;var SBOX=[];var INV_SBOX=[];var SUB_MIX_0=[];var SUB_MIX_1=[];var SUB_MIX_2=[];var SUB_MIX_3=[];var INV_SUB_MIX_0=[];var INV_SUB_MIX_1=[];var INV_SUB_MIX_2=[];var INV_SUB_MIX_3=[];(function(){var d=[];for(var i=0;i<256;i++){if(i<128){d[i]=i<<1}else{d[i]=i<<1^283}}var x=0;var xi=0;for(var i=0;i<256;i++){var sx=xi^xi<<1^xi<<2^xi<<3^xi<<4;sx=sx>>>8^sx&255^99;SBOX[x]=sx;INV_SBOX[sx]=x;var x2=d[x];var x4=d[x2];var x8=d[x4];var t=d[sx]*257^sx*16843008;SUB_MIX_0[x]=t<<24|t>>>8;SUB_MIX_1[x]=t<<16|t>>>16;SUB_MIX_2[x]=t<<8|t>>>24;SUB_MIX_3[x]=t;var t=x8*16843009^x4*65537^x2*257^x*16843008;INV_SUB_MIX_0[sx]=t<<24|t>>>8;INV_SUB_MIX_1[sx]=t<<16|t>>>16;INV_SUB_MIX_2[sx]=t<<8|t>>>24;INV_SUB_MIX_3[sx]=t;if(!x){x=xi=1}else{x=x2^d[d[d[x8^x2]]];xi^=d[d[xi]]}}})();var RCON=[0,1,2,4,8,16,32,64,128,27,54];var AES=C_algo.AES=BlockCipher.extend({_doReset:function(){if(this._nRounds&&this._keyPriorReset===this._key){return}var key=this._keyPriorReset=this._key;var keyWords=key.words;var keySize=key.sigBytes/4;var nRounds=this._nRounds=keySize+6;var ksRows=(nRounds+1)*4;var keySchedule=this._keySchedule=[];for(var ksRow=0;ksRow<ksRows;ksRow++){if(ksRow<keySize){keySchedule[ksRow]=keyWords[ksRow]}else{var t=keySchedule[ksRow-1];if(!(ksRow%keySize)){t=t<<8|t>>>24;t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[t&255];t^=RCON[ksRow/keySize|0]<<24}else if(keySize>6&&ksRow%keySize==4){t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[t&255]}keySchedule[ksRow]=keySchedule[ksRow-keySize]^t}}var invKeySchedule=this._invKeySchedule=[];for(var invKsRow=0;invKsRow<ksRows;invKsRow++){var ksRow=ksRows-invKsRow;if(invKsRow%4){var t=keySchedule[ksRow]}else{var t=keySchedule[ksRow-4]}if(invKsRow<4||ksRow<=4){invKeySchedule[invKsRow]=t}else{invKeySchedule[invKsRow]=INV_SUB_MIX_0[SBOX[t>>>24]]^INV_SUB_MIX_1[SBOX[t>>>16&255]]^INV_SUB_MIX_2[SBOX[t>>>8&255]]^INV_SUB_MIX_3[SBOX[t&255]]}}},encryptBlock:function(M,offset){this._doCryptBlock(M,offset,this._keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX)},decryptBlock:function(M,offset){var t=M[offset+1];M[offset+1]=M[offset+3];M[offset+3]=t;this._doCryptBlock(M,offset,this._invKeySchedule,INV_SUB_MIX_0,INV_SUB_MIX_1,INV_SUB_MIX_2,INV_SUB_MIX_3,INV_SBOX);var t=M[offset+1];M[offset+1]=M[offset+3];M[offset+3]=t},_doCryptBlock:function(M,offset,keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX){var nRounds=this._nRounds;var s0=M[offset]^keySchedule[0];var s1=M[offset+1]^keySchedule[1];var s2=M[offset+2]^keySchedule[2];var s3=M[offset+3]^keySchedule[3];var ksRow=4;for(var round=1;round<nRounds;round++){var t0=SUB_MIX_0[s0>>>24]^SUB_MIX_1[s1>>>16&255]^SUB_MIX_2[s2>>>8&255]^SUB_MIX_3[s3&255]^keySchedule[ksRow++];var t1=SUB_MIX_0[s1>>>24]^SUB_MIX_1[s2>>>16&255]^SUB_MIX_2[s3>>>8&255]^SUB_MIX_3[s0&255]^keySchedule[ksRow++];var t2=SUB_MIX_0[s2>>>24]^SUB_MIX_1[s3>>>16&255]^SUB_MIX_2[s0>>>8&255]^SUB_MIX_3[s1&255]^keySchedule[ksRow++];var t3=SUB_MIX_0[s3>>>24]^SUB_MIX_1[s0>>>16&255]^SUB_MIX_2[s1>>>8&255]^SUB_MIX_3[s2&255]^keySchedule[ksRow++];s0=t0;s1=t1;s2=t2;s3=t3}var t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[s3&255])^keySchedule[ksRow++];var t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[s0&255])^keySchedule[ksRow++];var t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[s1&255])^keySchedule[ksRow++];var t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[s2&255])^keySchedule[ksRow++];M[offset]=t0;M[offset+1]=t1;M[offset+2]=t2;M[offset+3]=t3},keySize:256/32});C.AES=BlockCipher._createHelper(AES)})();return CryptoJS.AES})},{"./cipher-core":6,"./core":7,"./enc-base64":8,"./evpkdf":10,"./md5":15}],6:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./evpkdf"))}else if(typeof define==="function"&&define.amd){define(["./core","./evpkdf"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.lib.Cipher||function(undefined){var C=CryptoJS;var C_lib=C.lib;var Base=C_lib.Base;var WordArray=C_lib.WordArray;var BufferedBlockAlgorithm=C_lib.BufferedBlockAlgorithm;var C_enc=C.enc;var Utf8=C_enc.Utf8;var Base64=C_enc.Base64;var C_algo=C.algo;var EvpKDF=C_algo.EvpKDF;var Cipher=C_lib.Cipher=BufferedBlockAlgorithm.extend({cfg:Base.extend(),createEncryptor:function(key,cfg){return this.create(this._ENC_XFORM_MODE,key,cfg)},createDecryptor:function(key,cfg){return this.create(this._DEC_XFORM_MODE,key,cfg)},init:function(xformMode,key,cfg){this.cfg=this.cfg.extend(cfg);this._xformMode=xformMode;this._key=key;this.reset()},reset:function(){BufferedBlockAlgorithm.reset.call(this);this._doReset()},process:function(dataUpdate){this._append(dataUpdate);return this._process()},finalize:function(dataUpdate){if(dataUpdate){this._append(dataUpdate)}var finalProcessedData=this._doFinalize();return finalProcessedData},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(key){if(typeof key=="string"){return PasswordBasedCipher}else{return SerializableCipher}}return function(cipher){return{encrypt:function(message,key,cfg){return selectCipherStrategy(key).encrypt(cipher,message,key,cfg)},decrypt:function(ciphertext,key,cfg){return selectCipherStrategy(key).decrypt(cipher,ciphertext,key,cfg)}}}}()});var StreamCipher=C_lib.StreamCipher=Cipher.extend({_doFinalize:function(){var finalProcessedBlocks=this._process(!!"flush");return finalProcessedBlocks},blockSize:1});var C_mode=C.mode={};var BlockCipherMode=C_lib.BlockCipherMode=Base.extend({createEncryptor:function(cipher,iv){return this.Encryptor.create(cipher,iv)},createDecryptor:function(cipher,iv){return this.Decryptor.create(cipher,iv)},init:function(cipher,iv){this._cipher=cipher;this._iv=iv}});var CBC=C_mode.CBC=function(){var CBC=BlockCipherMode.extend();CBC.Encryptor=CBC.extend({processBlock:function(words,offset){var cipher=this._cipher;var blockSize=cipher.blockSize;xorBlock.call(this,words,offset,blockSize);cipher.encryptBlock(words,offset);this._prevBlock=words.slice(offset,offset+blockSize)}});CBC.Decryptor=CBC.extend({processBlock:function(words,offset){var cipher=this._cipher;var blockSize=cipher.blockSize;var thisBlock=words.slice(offset,offset+blockSize);cipher.decryptBlock(words,offset);xorBlock.call(this,words,offset,blockSize);this._prevBlock=thisBlock}});function xorBlock(words,offset,blockSize){var iv=this._iv;if(iv){var block=iv;this._iv=undefined}else{var block=this._prevBlock}for(var i=0;i<blockSize;i++){words[offset+i]^=block[i]}}return CBC}();var C_pad=C.pad={};var Pkcs7=C_pad.Pkcs7={pad:function(data,blockSize){var blockSizeBytes=blockSize*4;var nPaddingBytes=blockSizeBytes-data.sigBytes%blockSizeBytes;var paddingWord=nPaddingBytes<<24|nPaddingBytes<<16|nPaddingBytes<<8|nPaddingBytes;var paddingWords=[];for(var i=0;i<nPaddingBytes;i+=4){paddingWords.push(paddingWord)}var padding=WordArray.create(paddingWords,nPaddingBytes);data.concat(padding)},unpad:function(data){var nPaddingBytes=data.words[data.sigBytes-1>>>2]&255;data.sigBytes-=nPaddingBytes}};var BlockCipher=C_lib.BlockCipher=Cipher.extend({cfg:Cipher.cfg.extend({mode:CBC,padding:Pkcs7}),reset:function(){Cipher.reset.call(this);var cfg=this.cfg;var iv=cfg.iv;var mode=cfg.mode;if(this._xformMode==this._ENC_XFORM_MODE){var modeCreator=mode.createEncryptor}else{var modeCreator=mode.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==modeCreator){this._mode.init(this,iv&&iv.words)}else{this._mode=modeCreator.call(mode,this,iv&&iv.words);this._mode.__creator=modeCreator}},_doProcessBlock:function(words,offset){this._mode.processBlock(words,offset)},_doFinalize:function(){var padding=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){padding.pad(this._data,this.blockSize);var finalProcessedBlocks=this._process(!!"flush")}else{var finalProcessedBlocks=this._process(!!"flush");padding.unpad(finalProcessedBlocks)}return finalProcessedBlocks},blockSize:128/32});var CipherParams=C_lib.CipherParams=Base.extend({init:function(cipherParams){this.mixIn(cipherParams)},toString:function(formatter){return(formatter||this.formatter).stringify(this)}});var C_format=C.format={};var OpenSSLFormatter=C_format.OpenSSL={stringify:function(cipherParams){var ciphertext=cipherParams.ciphertext;var salt=cipherParams.salt;if(salt){var wordArray=WordArray.create([1398893684,1701076831]).concat(salt).concat(ciphertext)}else{var wordArray=ciphertext}return wordArray.toString(Base64)},parse:function(openSSLStr){var ciphertext=Base64.parse(openSSLStr);var ciphertextWords=ciphertext.words;if(ciphertextWords[0]==1398893684&&ciphertextWords[1]==1701076831){var salt=WordArray.create(ciphertextWords.slice(2,4));ciphertextWords.splice(0,4);ciphertext.sigBytes-=16}return CipherParams.create({ciphertext:ciphertext,salt:salt})}};var SerializableCipher=C_lib.SerializableCipher=Base.extend({cfg:Base.extend({format:OpenSSLFormatter}),encrypt:function(cipher,message,key,cfg){cfg=this.cfg.extend(cfg);var encryptor=cipher.createEncryptor(key,cfg);var ciphertext=encryptor.finalize(message);var cipherCfg=encryptor.cfg;return CipherParams.create({ciphertext:ciphertext,key:key,iv:cipherCfg.iv,algorithm:cipher,mode:cipherCfg.mode,padding:cipherCfg.padding,blockSize:cipher.blockSize,formatter:cfg.format})},decrypt:function(cipher,ciphertext,key,cfg){cfg=this.cfg.extend(cfg);ciphertext=this._parse(ciphertext,cfg.format);var plaintext=cipher.createDecryptor(key,cfg).finalize(ciphertext.ciphertext);return plaintext},_parse:function(ciphertext,format){if(typeof ciphertext=="string"){return format.parse(ciphertext,this)}else{return ciphertext}}});var C_kdf=C.kdf={};var OpenSSLKdf=C_kdf.OpenSSL={execute:function(password,keySize,ivSize,salt){if(!salt){salt=WordArray.random(64/8)}var key=EvpKDF.create({keySize:keySize+ivSize}).compute(password,salt);var iv=WordArray.create(key.words.slice(keySize),ivSize*4);key.sigBytes=keySize*4;return CipherParams.create({key:key,iv:iv,salt:salt})}};var PasswordBasedCipher=C_lib.PasswordBasedCipher=SerializableCipher.extend({cfg:SerializableCipher.cfg.extend({kdf:OpenSSLKdf}),encrypt:function(cipher,message,password,cfg){cfg=this.cfg.extend(cfg);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize);cfg.iv=derivedParams.iv;var ciphertext=SerializableCipher.encrypt.call(this,cipher,message,derivedParams.key,cfg);ciphertext.mixIn(derivedParams);return ciphertext},decrypt:function(cipher,ciphertext,password,cfg){cfg=this.cfg.extend(cfg);ciphertext=this._parse(ciphertext,cfg.format);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize,ciphertext.salt);cfg.iv=derivedParams.iv;var plaintext=SerializableCipher.decrypt.call(this,cipher,ciphertext,derivedParams.key,cfg);return plaintext}})}()})},{"./core":7,"./evpkdf":10}],7:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory()}else if(typeof define==="function"&&define.amd){define([],factory)}else{root.CryptoJS=factory()}})(this,function(){var CryptoJS=CryptoJS||function(Math,undefined){var create=Object.create||function(){function F(){}return function(obj){var subtype;F.prototype=obj;subtype=new F;F.prototype=null;return subtype}}();var C={};var C_lib=C.lib={};var Base=C_lib.Base=function(){return{extend:function(overrides){var subtype=create(this);if(overrides){subtype.mixIn(overrides)}if(!subtype.hasOwnProperty("init")||this.init===subtype.init){subtype.init=function(){subtype.$super.init.apply(this,arguments)}}subtype.init.prototype=subtype;subtype.$super=this;return subtype},create:function(){var instance=this.extend();instance.init.apply(instance,arguments);return instance},init:function(){},mixIn:function(properties){for(var propertyName in properties){if(properties.hasOwnProperty(propertyName)){this[propertyName]=properties[propertyName]}}if(properties.hasOwnProperty("toString")){this.toString=properties.toString}},clone:function(){return this.init.prototype.extend(this)}}}();var WordArray=C_lib.WordArray=Base.extend({init:function(words,sigBytes){words=this.words=words||[];if(sigBytes!=undefined){this.sigBytes=sigBytes}else{this.sigBytes=words.length*4}},toString:function(encoder){return(encoder||Hex).stringify(this)},concat:function(wordArray){var thisWords=this.words;var thatWords=wordArray.words;var thisSigBytes=this.sigBytes;var thatSigBytes=wordArray.sigBytes;this.clamp();if(thisSigBytes%4){for(var i=0;i<thatSigBytes;i++){var thatByte=thatWords[i>>>2]>>>24-i%4*8&255;thisWords[thisSigBytes+i>>>2]|=thatByte<<24-(thisSigBytes+i)%4*8}}else{for(var i=0;i<thatSigBytes;i+=4){thisWords[thisSigBytes+i>>>2]=thatWords[i>>>2]}}this.sigBytes+=thatSigBytes;return this},clamp:function(){var words=this.words;var sigBytes=this.sigBytes;words[sigBytes>>>2]&=4294967295<<32-sigBytes%4*8;words.length=Math.ceil(sigBytes/4)},clone:function(){var clone=Base.clone.call(this);clone.words=this.words.slice(0);return clone},random:function(nBytes){var words=[];var r=function(m_w){var m_w=m_w;var m_z=987654321;var mask=4294967295;return function(){m_z=36969*(m_z&65535)+(m_z>>16)&mask;m_w=18e3*(m_w&65535)+(m_w>>16)&mask;var result=(m_z<<16)+m_w&mask;result/=4294967296;result+=.5;return result*(Math.random()>.5?1:-1)}};for(var i=0,rcache;i<nBytes;i+=4){var _r=r((rcache||Math.random())*4294967296);rcache=_r()*987654071;words.push(_r()*4294967296|0)}return new WordArray.init(words,nBytes)}});var C_enc=C.enc={};var Hex=C_enc.Hex={stringify:function(wordArray){var words=wordArray.words;var sigBytes=wordArray.sigBytes;var hexChars=[];for(var i=0;i<sigBytes;i++){var bite=words[i>>>2]>>>24-i%4*8&255;hexChars.push((bite>>>4).toString(16));hexChars.push((bite&15).toString(16))}return hexChars.join("")},parse:function(hexStr){var hexStrLength=hexStr.length;var words=[];for(var i=0;i<hexStrLength;i+=2){words[i>>>3]|=parseInt(hexStr.substr(i,2),16)<<24-i%8*4}return new WordArray.init(words,hexStrLength/2)}};var Latin1=C_enc.Latin1={stringify:function(wordArray){var words=wordArray.words;var sigBytes=wordArray.sigBytes;var latin1Chars=[];for(var i=0;i<sigBytes;i++){var bite=words[i>>>2]>>>24-i%4*8&255;latin1Chars.push(String.fromCharCode(bite))}return latin1Chars.join("")},parse:function(latin1Str){var latin1StrLength=latin1Str.length;var words=[];for(var i=0;i<latin1StrLength;i++){words[i>>>2]|=(latin1Str.charCodeAt(i)&255)<<24-i%4*8}return new WordArray.init(words,latin1StrLength)}};var Utf8=C_enc.Utf8={stringify:function(wordArray){try{return decodeURIComponent(escape(Latin1.stringify(wordArray)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(utf8Str){return Latin1.parse(unescape(encodeURIComponent(utf8Str)))}};var BufferedBlockAlgorithm=C_lib.BufferedBlockAlgorithm=Base.extend({reset:function(){this._data=new WordArray.init;this._nDataBytes=0},_append:function(data){if(typeof data=="string"){data=Utf8.parse(data)}this._data.concat(data);this._nDataBytes+=data.sigBytes},_process:function(doFlush){var data=this._data;var dataWords=data.words;var dataSigBytes=data.sigBytes;var blockSize=this.blockSize;var blockSizeBytes=blockSize*4;var nBlocksReady=dataSigBytes/blockSizeBytes;if(doFlush){nBlocksReady=Math.ceil(nBlocksReady)}else{nBlocksReady=Math.max((nBlocksReady|0)-this._minBufferSize,0)}var nWordsReady=nBlocksReady*blockSize;var nBytesReady=Math.min(nWordsReady*4,dataSigBytes);if(nWordsReady){for(var offset=0;offset<nWordsReady;offset+=blockSize){this._doProcessBlock(dataWords,offset)}var processedWords=dataWords.splice(0,nWordsReady);data.sigBytes-=nBytesReady}return new WordArray.init(processedWords,nBytesReady)},clone:function(){var clone=Base.clone.call(this);clone._data=this._data.clone();return clone},_minBufferSize:0});var Hasher=C_lib.Hasher=BufferedBlockAlgorithm.extend({cfg:Base.extend(),init:function(cfg){this.cfg=this.cfg.extend(cfg);this.reset()},reset:function(){BufferedBlockAlgorithm.reset.call(this);this._doReset()},update:function(messageUpdate){this._append(messageUpdate);this._process();return this},finalize:function(messageUpdate){if(messageUpdate){this._append(messageUpdate)}var hash=this._doFinalize();return hash},blockSize:512/32,_createHelper:function(hasher){return function(message,cfg){return new hasher.init(cfg).finalize(message)}},_createHmacHelper:function(hasher){return function(message,key){return new C_algo.HMAC.init(hasher,key).finalize(message)}}});var C_algo=C.algo={};return C}(Math);return CryptoJS})},{}],8:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var C_enc=C.enc;var Base64=C_enc.Base64={stringify:function(wordArray){var words=wordArray.words;var sigBytes=wordArray.sigBytes;var map=this._map;wordArray.clamp();var base64Chars=[];for(var i=0;i<sigBytes;i+=3){var byte1=words[i>>>2]>>>24-i%4*8&255;var byte2=words[i+1>>>2]>>>24-(i+1)%4*8&255;var byte3=words[i+2>>>2]>>>24-(i+2)%4*8&255;var triplet=byte1<<16|byte2<<8|byte3;for(var j=0;j<4&&i+j*.75<sigBytes;j++){base64Chars.push(map.charAt(triplet>>>6*(3-j)&63))}}var paddingChar=map.charAt(64);if(paddingChar){while(base64Chars.length%4){base64Chars.push(paddingChar)}}return base64Chars.join("")},parse:function(base64Str){var base64StrLength=base64Str.length;var map=this._map;var reverseMap=this._reverseMap;if(!reverseMap){reverseMap=this._reverseMap=[];for(var j=0;j<map.length;j++){reverseMap[map.charCodeAt(j)]=j}}var paddingChar=map.charAt(64);if(paddingChar){var paddingIndex=base64Str.indexOf(paddingChar);if(paddingIndex!==-1){base64StrLength=paddingIndex}}return parseLoop(base64Str,base64StrLength,reverseMap)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function parseLoop(base64Str,base64StrLength,reverseMap){var words=[];var nBytes=0;for(var i=0;i<base64StrLength;i++){if(i%4){var bits1=reverseMap[base64Str.charCodeAt(i-1)]<<i%4*2;var bits2=reverseMap[base64Str.charCodeAt(i)]>>>6-i%4*2;words[nBytes>>>2]|=(bits1|bits2)<<24-nBytes%4*8;nBytes++}}return WordArray.create(words,nBytes)}})();return CryptoJS.enc.Base64})},{"./core":7}],9:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var C_enc=C.enc;var Utf16BE=C_enc.Utf16=C_enc.Utf16BE={stringify:function(wordArray){var words=wordArray.words;var sigBytes=wordArray.sigBytes;var utf16Chars=[];for(var i=0;i<sigBytes;i+=2){var codePoint=words[i>>>2]>>>16-i%4*8&65535;utf16Chars.push(String.fromCharCode(codePoint))}return utf16Chars.join("")},parse:function(utf16Str){var utf16StrLength=utf16Str.length;var words=[];for(var i=0;i<utf16StrLength;i++){words[i>>>1]|=utf16Str.charCodeAt(i)<<16-i%2*16}return WordArray.create(words,utf16StrLength*2)}};C_enc.Utf16LE={stringify:function(wordArray){var words=wordArray.words;var sigBytes=wordArray.sigBytes;var utf16Chars=[];for(var i=0;i<sigBytes;i+=2){var codePoint=swapEndian(words[i>>>2]>>>16-i%4*8&65535);utf16Chars.push(String.fromCharCode(codePoint))}return utf16Chars.join("")},parse:function(utf16Str){var utf16StrLength=utf16Str.length;var words=[];for(var i=0;i<utf16StrLength;i++){words[i>>>1]|=swapEndian(utf16Str.charCodeAt(i)<<16-i%2*16)}return WordArray.create(words,utf16StrLength*2)}};function swapEndian(word){return word<<8&4278255360|word>>>8&16711935}})();return CryptoJS.enc.Utf16})},{"./core":7}],10:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./sha1"),require("./hmac"))}else if(typeof define==="function"&&define.amd){define(["./core","./sha1","./hmac"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var Base=C_lib.Base;var WordArray=C_lib.WordArray;var C_algo=C.algo;var MD5=C_algo.MD5;var EvpKDF=C_algo.EvpKDF=Base.extend({cfg:Base.extend({keySize:128/32,hasher:MD5,iterations:1}),init:function(cfg){this.cfg=this.cfg.extend(cfg)},compute:function(password,salt){var cfg=this.cfg;var hasher=cfg.hasher.create();var derivedKey=WordArray.create();var derivedKeyWords=derivedKey.words;var keySize=cfg.keySize;var iterations=cfg.iterations;while(derivedKeyWords.length<keySize){if(block){hasher.update(block)}var block=hasher.update(password).finalize(salt);hasher.reset();for(var i=1;i<iterations;i++){block=hasher.finalize(block);hasher.reset()}derivedKey.concat(block)}derivedKey.sigBytes=keySize*4;return derivedKey}});C.EvpKDF=function(password,salt,cfg){return EvpKDF.create(cfg).compute(password,salt)}})();return CryptoJS.EvpKDF})},{"./core":7,"./hmac":12,"./sha1":31}],11:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(undefined){var C=CryptoJS;var C_lib=C.lib;var CipherParams=C_lib.CipherParams;var C_enc=C.enc;var Hex=C_enc.Hex;var C_format=C.format;var HexFormatter=C_format.Hex={stringify:function(cipherParams){return cipherParams.ciphertext.toString(Hex)},parse:function(input){var ciphertext=Hex.parse(input);return CipherParams.create({ciphertext:ciphertext})}}})();return CryptoJS.format.Hex})},{"./cipher-core":6,"./core":7}],12:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var Base=C_lib.Base;var C_enc=C.enc;var Utf8=C_enc.Utf8;var C_algo=C.algo;var HMAC=C_algo.HMAC=Base.extend({init:function(hasher,key){hasher=this._hasher=new hasher.init;if(typeof key=="string"){key=Utf8.parse(key)}var hasherBlockSize=hasher.blockSize;var hasherBlockSizeBytes=hasherBlockSize*4;if(key.sigBytes>hasherBlockSizeBytes){key=hasher.finalize(key)}key.clamp();var oKey=this._oKey=key.clone();var iKey=this._iKey=key.clone();var oKeyWords=oKey.words;var iKeyWords=iKey.words;for(var i=0;i<hasherBlockSize;i++){oKeyWords[i]^=1549556828;iKeyWords[i]^=909522486}oKey.sigBytes=iKey.sigBytes=hasherBlockSizeBytes;this.reset()},reset:function(){var hasher=this._hasher;hasher.reset();hasher.update(this._iKey)},update:function(messageUpdate){this._hasher.update(messageUpdate);return this},finalize:function(messageUpdate){var hasher=this._hasher;var innerHash=hasher.finalize(messageUpdate);hasher.reset();var hmac=hasher.finalize(this._oKey.clone().concat(innerHash));return hmac}})})()})},{"./core":7}],13:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./x64-core"),require("./lib-typedarrays"),require("./enc-utf16"),require("./enc-base64"),require("./md5"),require("./sha1"),require("./sha256"),require("./sha224"),require("./sha512"),require("./sha384"),require("./sha3"),require("./ripemd160"),require("./hmac"),require("./pbkdf2"),require("./evpkdf"),require("./cipher-core"),require("./mode-cfb"),require("./mode-ctr"),require("./mode-ctr-gladman"),require("./mode-ofb"),require("./mode-ecb"),require("./pad-ansix923"),require("./pad-iso10126"),require("./pad-iso97971"),require("./pad-zeropadding"),require("./pad-nopadding"),require("./format-hex"),require("./aes"),require("./tripledes"),require("./rc4"),require("./rabbit"),require("./rabbit-legacy"))}else if(typeof define==="function"&&define.amd){define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],factory)}else{root.CryptoJS=factory(root.CryptoJS)}})(this,function(CryptoJS){return CryptoJS})},{"./aes":5,"./cipher-core":6,"./core":7,"./enc-base64":8,"./enc-utf16":9,"./evpkdf":10,"./format-hex":11,"./hmac":12,"./lib-typedarrays":14,"./md5":15,"./mode-cfb":16,"./mode-ctr":18,"./mode-ctr-gladman":17,"./mode-ecb":19,"./mode-ofb":20,"./pad-ansix923":21,"./pad-iso10126":22,"./pad-iso97971":23,"./pad-nopadding":24,"./pad-zeropadding":25,"./pbkdf2":26,"./rabbit":28,"./rabbit-legacy":27,"./rc4":29,"./ripemd160":30,"./sha1":31,"./sha224":32,"./sha256":33,"./sha3":34,"./sha384":35,"./sha512":36,"./tripledes":37,"./x64-core":38}],14:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){if(typeof ArrayBuffer!="function"){return}var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var superInit=WordArray.init;var subInit=WordArray.init=function(typedArray){if(typedArray instanceof ArrayBuffer){typedArray=new Uint8Array(typedArray)}if(typedArray instanceof Int8Array||typeof Uint8ClampedArray!=="undefined"&&typedArray instanceof Uint8ClampedArray||typedArray instanceof Int16Array||typedArray instanceof Uint16Array||typedArray instanceof Int32Array||typedArray instanceof Uint32Array||typedArray instanceof Float32Array||typedArray instanceof Float64Array){typedArray=new Uint8Array(typedArray.buffer,typedArray.byteOffset,typedArray.byteLength)}if(typedArray instanceof Uint8Array){var typedArrayByteLength=typedArray.byteLength;var words=[];for(var i=0;i<typedArrayByteLength;i++){words[i>>>2]|=typedArray[i]<<24-i%4*8}superInit.call(this,words,typedArrayByteLength)}else{superInit.apply(this,arguments)}};subInit.prototype=WordArray})();return CryptoJS.lib.WordArray})},{"./core":7}],15:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(Math){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var Hasher=C_lib.Hasher;var C_algo=C.algo;var T=[];(function(){for(var i=0;i<64;i++){T[i]=Math.abs(Math.sin(i+1))*4294967296|0}})();var MD5=C_algo.MD5=Hasher.extend({_doReset:function(){this._hash=new WordArray.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(M,offset){for(var i=0;i<16;i++){var offset_i=offset+i;var M_offset_i=M[offset_i];M[offset_i]=(M_offset_i<<8|M_offset_i>>>24)&16711935|(M_offset_i<<24|M_offset_i>>>8)&4278255360}var H=this._hash.words;var M_offset_0=M[offset+0];var M_offset_1=M[offset+1];var M_offset_2=M[offset+2];var M_offset_3=M[offset+3];var M_offset_4=M[offset+4];var M_offset_5=M[offset+5];var M_offset_6=M[offset+6];var M_offset_7=M[offset+7];var M_offset_8=M[offset+8];var M_offset_9=M[offset+9];var M_offset_10=M[offset+10];var M_offset_11=M[offset+11];var M_offset_12=M[offset+12];var M_offset_13=M[offset+13];var M_offset_14=M[offset+14];var M_offset_15=M[offset+15];var a=H[0];var b=H[1];var c=H[2];var d=H[3];a=FF(a,b,c,d,M_offset_0,7,T[0]);d=FF(d,a,b,c,M_offset_1,12,T[1]);c=FF(c,d,a,b,M_offset_2,17,T[2]);b=FF(b,c,d,a,M_offset_3,22,T[3]);a=FF(a,b,c,d,M_offset_4,7,T[4]);d=FF(d,a,b,c,M_offset_5,12,T[5]);c=FF(c,d,a,b,M_offset_6,17,T[6]);b=FF(b,c,d,a,M_offset_7,22,T[7]);a=FF(a,b,c,d,M_offset_8,7,T[8]);d=FF(d,a,b,c,M_offset_9,12,T[9]);c=FF(c,d,a,b,M_offset_10,17,T[10]);b=FF(b,c,d,a,M_offset_11,22,T[11]);a=FF(a,b,c,d,M_offset_12,7,T[12]);d=FF(d,a,b,c,M_offset_13,12,T[13]);c=FF(c,d,a,b,M_offset_14,17,T[14]);b=FF(b,c,d,a,M_offset_15,22,T[15]);a=GG(a,b,c,d,M_offset_1,5,T[16]);d=GG(d,a,b,c,M_offset_6,9,T[17]);c=GG(c,d,a,b,M_offset_11,14,T[18]);b=GG(b,c,d,a,M_offset_0,20,T[19]);a=GG(a,b,c,d,M_offset_5,5,T[20]);d=GG(d,a,b,c,M_offset_10,9,T[21]);c=GG(c,d,a,b,M_offset_15,14,T[22]);b=GG(b,c,d,a,M_offset_4,20,T[23]);a=GG(a,b,c,d,M_offset_9,5,T[24]);d=GG(d,a,b,c,M_offset_14,9,T[25]);c=GG(c,d,a,b,M_offset_3,14,T[26]);b=GG(b,c,d,a,M_offset_8,20,T[27]);a=GG(a,b,c,d,M_offset_13,5,T[28]);d=GG(d,a,b,c,M_offset_2,9,T[29]);c=GG(c,d,a,b,M_offset_7,14,T[30]);b=GG(b,c,d,a,M_offset_12,20,T[31]);a=HH(a,b,c,d,M_offset_5,4,T[32]);d=HH(d,a,b,c,M_offset_8,11,T[33]);c=HH(c,d,a,b,M_offset_11,16,T[34]);b=HH(b,c,d,a,M_offset_14,23,T[35]);a=HH(a,b,c,d,M_offset_1,4,T[36]);d=HH(d,a,b,c,M_offset_4,11,T[37]);c=HH(c,d,a,b,M_offset_7,16,T[38]);b=HH(b,c,d,a,M_offset_10,23,T[39]);a=HH(a,b,c,d,M_offset_13,4,T[40]);d=HH(d,a,b,c,M_offset_0,11,T[41]);c=HH(c,d,a,b,M_offset_3,16,T[42]);b=HH(b,c,d,a,M_offset_6,23,T[43]);a=HH(a,b,c,d,M_offset_9,4,T[44]);d=HH(d,a,b,c,M_offset_12,11,T[45]);c=HH(c,d,a,b,M_offset_15,16,T[46]);b=HH(b,c,d,a,M_offset_2,23,T[47]);a=II(a,b,c,d,M_offset_0,6,T[48]);d=II(d,a,b,c,M_offset_7,10,T[49]);c=II(c,d,a,b,M_offset_14,15,T[50]);b=II(b,c,d,a,M_offset_5,21,T[51]);a=II(a,b,c,d,M_offset_12,6,T[52]);d=II(d,a,b,c,M_offset_3,10,T[53]);c=II(c,d,a,b,M_offset_10,15,T[54]);b=II(b,c,d,a,M_offset_1,21,T[55]);a=II(a,b,c,d,M_offset_8,6,T[56]);d=II(d,a,b,c,M_offset_15,10,T[57]);c=II(c,d,a,b,M_offset_6,15,T[58]);b=II(b,c,d,a,M_offset_13,21,T[59]);a=II(a,b,c,d,M_offset_4,6,T[60]);d=II(d,a,b,c,M_offset_11,10,T[61]);c=II(c,d,a,b,M_offset_2,15,T[62]);b=II(b,c,d,a,M_offset_9,21,T[63]);H[0]=H[0]+a|0;H[1]=H[1]+b|0;H[2]=H[2]+c|0;H[3]=H[3]+d|0},_doFinalize:function(){var data=this._data;var dataWords=data.words;var nBitsTotal=this._nDataBytes*8;var nBitsLeft=data.sigBytes*8;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;var nBitsTotalH=Math.floor(nBitsTotal/4294967296);var nBitsTotalL=nBitsTotal;dataWords[(nBitsLeft+64>>>9<<4)+15]=(nBitsTotalH<<8|nBitsTotalH>>>24)&16711935|(nBitsTotalH<<24|nBitsTotalH>>>8)&4278255360;dataWords[(nBitsLeft+64>>>9<<4)+14]=(nBitsTotalL<<8|nBitsTotalL>>>24)&16711935|(nBitsTotalL<<24|nBitsTotalL>>>8)&4278255360;data.sigBytes=(dataWords.length+1)*4;this._process();var hash=this._hash;var H=hash.words;for(var i=0;i<4;i++){var H_i=H[i];H[i]=(H_i<<8|H_i>>>24)&16711935|(H_i<<24|H_i>>>8)&4278255360}return hash},clone:function(){var clone=Hasher.clone.call(this);clone._hash=this._hash.clone();return clone}});function FF(a,b,c,d,x,s,t){var n=a+(b&c|~b&d)+x+t;return(n<<s|n>>>32-s)+b}function GG(a,b,c,d,x,s,t){var n=a+(b&d|c&~d)+x+t;return(n<<s|n>>>32-s)+b}function HH(a,b,c,d,x,s,t){var n=a+(b^c^d)+x+t;return(n<<s|n>>>32-s)+b}function II(a,b,c,d,x,s,t){var n=a+(c^(b|~d))+x+t;return(n<<s|n>>>32-s)+b}C.MD5=Hasher._createHelper(MD5);C.HmacMD5=Hasher._createHmacHelper(MD5)})(Math);return CryptoJS.MD5})},{"./core":7}],16:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.mode.CFB=function(){var CFB=CryptoJS.lib.BlockCipherMode.extend();CFB.Encryptor=CFB.extend({processBlock:function(words,offset){var cipher=this._cipher;var blockSize=cipher.blockSize;generateKeystreamAndEncrypt.call(this,words,offset,blockSize,cipher);this._prevBlock=words.slice(offset,offset+blockSize)}});CFB.Decryptor=CFB.extend({processBlock:function(words,offset){var cipher=this._cipher;var blockSize=cipher.blockSize;var thisBlock=words.slice(offset,offset+blockSize);generateKeystreamAndEncrypt.call(this,words,offset,blockSize,cipher);this._prevBlock=thisBlock}});function generateKeystreamAndEncrypt(words,offset,blockSize,cipher){var iv=this._iv;if(iv){var keystream=iv.slice(0);this._iv=undefined}else{var keystream=this._prevBlock}cipher.encryptBlock(keystream,0);for(var i=0;i<blockSize;i++){words[offset+i]^=keystream[i]}}return CFB}();return CryptoJS.mode.CFB})},{"./cipher-core":6,"./core":7}],17:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.mode.CTRGladman=function(){var CTRGladman=CryptoJS.lib.BlockCipherMode.extend();function incWord(word){if((word>>24&255)===255){var b1=word>>16&255;var b2=word>>8&255;var b3=word&255;if(b1===255){b1=0;if(b2===255){b2=0;if(b3===255){b3=0}else{++b3}}else{++b2}}else{++b1}word=0;word+=b1<<16;word+=b2<<8;word+=b3}else{word+=1<<24}return word}function incCounter(counter){if((counter[0]=incWord(counter[0]))===0){counter[1]=incWord(counter[1])}return counter}var Encryptor=CTRGladman.Encryptor=CTRGladman.extend({processBlock:function(words,offset){var cipher=this._cipher;var blockSize=cipher.blockSize;var iv=this._iv;var counter=this._counter;if(iv){counter=this._counter=iv.slice(0);this._iv=undefined}incCounter(counter);var keystream=counter.slice(0);cipher.encryptBlock(keystream,0);for(var i=0;i<blockSize;i++){words[offset+i]^=keystream[i]}}});CTRGladman.Decryptor=Encryptor;return CTRGladman}();return CryptoJS.mode.CTRGladman})},{"./cipher-core":6,"./core":7}],18:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.mode.CTR=function(){var CTR=CryptoJS.lib.BlockCipherMode.extend();var Encryptor=CTR.Encryptor=CTR.extend({processBlock:function(words,offset){var cipher=this._cipher;var blockSize=cipher.blockSize;var iv=this._iv;var counter=this._counter;if(iv){counter=this._counter=iv.slice(0);this._iv=undefined}var keystream=counter.slice(0);cipher.encryptBlock(keystream,0);counter[blockSize-1]=counter[blockSize-1]+1|0;for(var i=0;i<blockSize;i++){words[offset+i]^=keystream[i]}}});CTR.Decryptor=Encryptor;return CTR}();return CryptoJS.mode.CTR})},{"./cipher-core":6,"./core":7}],19:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.mode.ECB=function(){var ECB=CryptoJS.lib.BlockCipherMode.extend();ECB.Encryptor=ECB.extend({processBlock:function(words,offset){this._cipher.encryptBlock(words,offset)}});ECB.Decryptor=ECB.extend({processBlock:function(words,offset){this._cipher.decryptBlock(words,offset)}});return ECB}();return CryptoJS.mode.ECB})},{"./cipher-core":6,"./core":7}],20:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.mode.OFB=function(){var OFB=CryptoJS.lib.BlockCipherMode.extend();var Encryptor=OFB.Encryptor=OFB.extend({processBlock:function(words,offset){var cipher=this._cipher;var blockSize=cipher.blockSize;var iv=this._iv;var keystream=this._keystream;if(iv){keystream=this._keystream=iv.slice(0);this._iv=undefined}cipher.encryptBlock(keystream,0);for(var i=0;i<blockSize;i++){words[offset+i]^=keystream[i]}}});OFB.Decryptor=Encryptor;return OFB}();return CryptoJS.mode.OFB})},{"./cipher-core":6,"./core":7}],21:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.pad.AnsiX923={pad:function(data,blockSize){var dataSigBytes=data.sigBytes;var blockSizeBytes=blockSize*4;var nPaddingBytes=blockSizeBytes-dataSigBytes%blockSizeBytes;var lastBytePos=dataSigBytes+nPaddingBytes-1;data.clamp();data.words[lastBytePos>>>2]|=nPaddingBytes<<24-lastBytePos%4*8;data.sigBytes+=nPaddingBytes},unpad:function(data){var nPaddingBytes=data.words[data.sigBytes-1>>>2]&255;data.sigBytes-=nPaddingBytes}};return CryptoJS.pad.Ansix923})},{"./cipher-core":6,"./core":7}],22:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.pad.Iso10126={pad:function(data,blockSize){var blockSizeBytes=blockSize*4;var nPaddingBytes=blockSizeBytes-data.sigBytes%blockSizeBytes;data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes-1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes<<24],1))},unpad:function(data){var nPaddingBytes=data.words[data.sigBytes-1>>>2]&255;data.sigBytes-=nPaddingBytes}};return CryptoJS.pad.Iso10126})},{"./cipher-core":6,"./core":7}],23:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.pad.Iso97971={pad:function(data,blockSize){data.concat(CryptoJS.lib.WordArray.create([2147483648],1));CryptoJS.pad.ZeroPadding.pad(data,blockSize)},unpad:function(data){CryptoJS.pad.ZeroPadding.unpad(data);data.sigBytes--}};return CryptoJS.pad.Iso97971})},{"./cipher-core":6,"./core":7}],24:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};return CryptoJS.pad.NoPadding})},{"./cipher-core":6,"./core":7}],25:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){CryptoJS.pad.ZeroPadding={pad:function(data,blockSize){var blockSizeBytes=blockSize*4;data.clamp();data.sigBytes+=blockSizeBytes-(data.sigBytes%blockSizeBytes||blockSizeBytes)},unpad:function(data){var dataWords=data.words;var i=data.sigBytes-1;while(!(dataWords[i>>>2]>>>24-i%4*8&255)){i--}data.sigBytes=i+1}};return CryptoJS.pad.ZeroPadding})},{"./cipher-core":6,"./core":7}],26:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./sha1"),require("./hmac"))}else if(typeof define==="function"&&define.amd){define(["./core","./sha1","./hmac"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var Base=C_lib.Base;var WordArray=C_lib.WordArray;var C_algo=C.algo;var SHA1=C_algo.SHA1;var HMAC=C_algo.HMAC;var PBKDF2=C_algo.PBKDF2=Base.extend({cfg:Base.extend({keySize:128/32,hasher:SHA1,iterations:1}),init:function(cfg){this.cfg=this.cfg.extend(cfg)},compute:function(password,salt){var cfg=this.cfg;var hmac=HMAC.create(cfg.hasher,password);var derivedKey=WordArray.create();var blockIndex=WordArray.create([1]);var derivedKeyWords=derivedKey.words;var blockIndexWords=blockIndex.words;var keySize=cfg.keySize;var iterations=cfg.iterations;while(derivedKeyWords.length<keySize){var block=hmac.update(salt).finalize(blockIndex);hmac.reset();var blockWords=block.words;var blockWordsLength=blockWords.length;var intermediate=block;for(var i=1;i<iterations;i++){intermediate=hmac.finalize(intermediate);hmac.reset();var intermediateWords=intermediate.words;for(var j=0;j<blockWordsLength;j++){blockWords[j]^=intermediateWords[j]}}derivedKey.concat(block);blockIndexWords[0]++}derivedKey.sigBytes=keySize*4;return derivedKey}});C.PBKDF2=function(password,salt,cfg){return PBKDF2.create(cfg).compute(password,salt)}})();return CryptoJS.PBKDF2})},{"./core":7,"./hmac":12,"./sha1":31}],27:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var StreamCipher=C_lib.StreamCipher;var C_algo=C.algo;var S=[];var C_=[];var G=[];var RabbitLegacy=C_algo.RabbitLegacy=StreamCipher.extend({_doReset:function(){var K=this._key.words;var iv=this.cfg.iv;var X=this._X=[K[0],K[3]<<16|K[2]>>>16,K[1],K[0]<<16|K[3]>>>16,K[2],K[1]<<16|K[0]>>>16,K[3],K[2]<<16|K[1]>>>16];var C=this._C=[K[2]<<16|K[2]>>>16,K[0]&4294901760|K[1]&65535,K[3]<<16|K[3]>>>16,K[1]&4294901760|K[2]&65535,K[0]<<16|K[0]>>>16,K[2]&4294901760|K[3]&65535,K[1]<<16|K[1]>>>16,K[3]&4294901760|K[0]&65535];this._b=0;for(var i=0;i<4;i++){nextState.call(this)}for(var i=0;i<8;i++){C[i]^=X[i+4&7]}if(iv){var IV=iv.words;var IV_0=IV[0];var IV_1=IV[1];var i0=(IV_0<<8|IV_0>>>24)&16711935|(IV_0<<24|IV_0>>>8)&4278255360;var i2=(IV_1<<8|IV_1>>>24)&16711935|(IV_1<<24|IV_1>>>8)&4278255360;var i1=i0>>>16|i2&4294901760;var i3=i2<<16|i0&65535;C[0]^=i0;C[1]^=i1;C[2]^=i2;C[3]^=i3;C[4]^=i0;C[5]^=i1;C[6]^=i2;C[7]^=i3;for(var i=0;i<4;i++){nextState.call(this)}}},_doProcessBlock:function(M,offset){var X=this._X;nextState.call(this);S[0]=X[0]^X[5]>>>16^X[3]<<16;S[1]=X[2]^X[7]>>>16^X[5]<<16;S[2]=X[4]^X[1]>>>16^X[7]<<16;S[3]=X[6]^X[3]>>>16^X[1]<<16;for(var i=0;i<4;i++){S[i]=(S[i]<<8|S[i]>>>24)&16711935|(S[i]<<24|S[i]>>>8)&4278255360;M[offset+i]^=S[i]}},blockSize:128/32,ivSize:64/32});function nextState(){var X=this._X;var C=this._C;for(var i=0;i<8;i++){C_[i]=C[i]}C[0]=C[0]+1295307597+this._b|0;C[1]=C[1]+3545052371+(C[0]>>>0<C_[0]>>>0?1:0)|0;C[2]=C[2]+886263092+(C[1]>>>0<C_[1]>>>0?1:0)|0;C[3]=C[3]+1295307597+(C[2]>>>0<C_[2]>>>0?1:0)|0;C[4]=C[4]+3545052371+(C[3]>>>0<C_[3]>>>0?1:0)|0;C[5]=C[5]+886263092+(C[4]>>>0<C_[4]>>>0?1:0)|0;C[6]=C[6]+1295307597+(C[5]>>>0<C_[5]>>>0?1:0)|0;C[7]=C[7]+3545052371+(C[6]>>>0<C_[6]>>>0?1:0)|0;this._b=C[7]>>>0<C_[7]>>>0?1:0;for(var i=0;i<8;i++){var gx=X[i]+C[i];var ga=gx&65535;var gb=gx>>>16;var gh=((ga*ga>>>17)+ga*gb>>>15)+gb*gb;var gl=((gx&4294901760)*gx|0)+((gx&65535)*gx|0);G[i]=gh^gl}X[0]=G[0]+(G[7]<<16|G[7]>>>16)+(G[6]<<16|G[6]>>>16)|0;X[1]=G[1]+(G[0]<<8|G[0]>>>24)+G[7]|0;X[2]=G[2]+(G[1]<<16|G[1]>>>16)+(G[0]<<16|G[0]>>>16)|0;X[3]=G[3]+(G[2]<<8|G[2]>>>24)+G[1]|0;X[4]=G[4]+(G[3]<<16|G[3]>>>16)+(G[2]<<16|G[2]>>>16)|0;X[5]=G[5]+(G[4]<<8|G[4]>>>24)+G[3]|0;X[6]=G[6]+(G[5]<<16|G[5]>>>16)+(G[4]<<16|G[4]>>>16)|0;X[7]=G[7]+(G[6]<<8|G[6]>>>24)+G[5]|0}C.RabbitLegacy=StreamCipher._createHelper(RabbitLegacy)})();return CryptoJS.RabbitLegacy})},{"./cipher-core":6,"./core":7,"./enc-base64":8,"./evpkdf":10,"./md5":15}],28:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var StreamCipher=C_lib.StreamCipher;var C_algo=C.algo;var S=[];var C_=[];var G=[];var Rabbit=C_algo.Rabbit=StreamCipher.extend({_doReset:function(){var K=this._key.words;var iv=this.cfg.iv;for(var i=0;i<4;i++){K[i]=(K[i]<<8|K[i]>>>24)&16711935|(K[i]<<24|K[i]>>>8)&4278255360}var X=this._X=[K[0],K[3]<<16|K[2]>>>16,K[1],K[0]<<16|K[3]>>>16,K[2],K[1]<<16|K[0]>>>16,K[3],K[2]<<16|K[1]>>>16];var C=this._C=[K[2]<<16|K[2]>>>16,K[0]&4294901760|K[1]&65535,K[3]<<16|K[3]>>>16,K[1]&4294901760|K[2]&65535,K[0]<<16|K[0]>>>16,K[2]&4294901760|K[3]&65535,K[1]<<16|K[1]>>>16,K[3]&4294901760|K[0]&65535];this._b=0;for(var i=0;i<4;i++){nextState.call(this)}for(var i=0;i<8;i++){C[i]^=X[i+4&7]}if(iv){var IV=iv.words;var IV_0=IV[0];var IV_1=IV[1];var i0=(IV_0<<8|IV_0>>>24)&16711935|(IV_0<<24|IV_0>>>8)&4278255360;var i2=(IV_1<<8|IV_1>>>24)&16711935|(IV_1<<24|IV_1>>>8)&4278255360;var i1=i0>>>16|i2&4294901760;var i3=i2<<16|i0&65535;C[0]^=i0;C[1]^=i1;C[2]^=i2;C[3]^=i3;C[4]^=i0;C[5]^=i1;C[6]^=i2;C[7]^=i3;for(var i=0;i<4;i++){nextState.call(this)}}},_doProcessBlock:function(M,offset){var X=this._X;nextState.call(this);S[0]=X[0]^X[5]>>>16^X[3]<<16;S[1]=X[2]^X[7]>>>16^X[5]<<16;S[2]=X[4]^X[1]>>>16^X[7]<<16;S[3]=X[6]^X[3]>>>16^X[1]<<16;for(var i=0;i<4;i++){S[i]=(S[i]<<8|S[i]>>>24)&16711935|(S[i]<<24|S[i]>>>8)&4278255360;M[offset+i]^=S[i]}},blockSize:128/32,ivSize:64/32});function nextState(){var X=this._X;var C=this._C;for(var i=0;i<8;i++){C_[i]=C[i]}C[0]=C[0]+1295307597+this._b|0;C[1]=C[1]+3545052371+(C[0]>>>0<C_[0]>>>0?1:0)|0;C[2]=C[2]+886263092+(C[1]>>>0<C_[1]>>>0?1:0)|0;C[3]=C[3]+1295307597+(C[2]>>>0<C_[2]>>>0?1:0)|0;C[4]=C[4]+3545052371+(C[3]>>>0<C_[3]>>>0?1:0)|0;C[5]=C[5]+886263092+(C[4]>>>0<C_[4]>>>0?1:0)|0;C[6]=C[6]+1295307597+(C[5]>>>0<C_[5]>>>0?1:0)|0;C[7]=C[7]+3545052371+(C[6]>>>0<C_[6]>>>0?1:0)|0;this._b=C[7]>>>0<C_[7]>>>0?1:0;for(var i=0;i<8;i++){var gx=X[i]+C[i];var ga=gx&65535;var gb=gx>>>16;var gh=((ga*ga>>>17)+ga*gb>>>15)+gb*gb;var gl=((gx&4294901760)*gx|0)+((gx&65535)*gx|0);G[i]=gh^gl}X[0]=G[0]+(G[7]<<16|G[7]>>>16)+(G[6]<<16|G[6]>>>16)|0;X[1]=G[1]+(G[0]<<8|G[0]>>>24)+G[7]|0;X[2]=G[2]+(G[1]<<16|G[1]>>>16)+(G[0]<<16|G[0]>>>16)|0;X[3]=G[3]+(G[2]<<8|G[2]>>>24)+G[1]|0;X[4]=G[4]+(G[3]<<16|G[3]>>>16)+(G[2]<<16|G[2]>>>16)|0;X[5]=G[5]+(G[4]<<8|G[4]>>>24)+G[3]|0;X[6]=G[6]+(G[5]<<16|G[5]>>>16)+(G[4]<<16|G[4]>>>16)|0;X[7]=G[7]+(G[6]<<8|G[6]>>>24)+G[5]|0}C.Rabbit=StreamCipher._createHelper(Rabbit)})();return CryptoJS.Rabbit})},{"./cipher-core":6,"./core":7,"./enc-base64":8,"./evpkdf":10,"./md5":15}],29:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var StreamCipher=C_lib.StreamCipher;var C_algo=C.algo;var RC4=C_algo.RC4=StreamCipher.extend({_doReset:function(){var key=this._key;var keyWords=key.words;var keySigBytes=key.sigBytes;var S=this._S=[];for(var i=0;i<256;i++){S[i]=i}for(var i=0,j=0;i<256;i++){var keyByteIndex=i%keySigBytes;var keyByte=keyWords[keyByteIndex>>>2]>>>24-keyByteIndex%4*8&255;j=(j+S[i]+keyByte)%256;var t=S[i];S[i]=S[j];S[j]=t}this._i=this._j=0},_doProcessBlock:function(M,offset){M[offset]^=generateKeystreamWord.call(this)},keySize:256/32,ivSize:0});function generateKeystreamWord(){var S=this._S;var i=this._i;var j=this._j;var keystreamWord=0;for(var n=0;n<4;n++){i=(i+1)%256;j=(j+S[i])%256;var t=S[i];S[i]=S[j];S[j]=t;keystreamWord|=S[(S[i]+S[j])%256]<<24-n*8}this._i=i;this._j=j;return keystreamWord}C.RC4=StreamCipher._createHelper(RC4);var RC4Drop=C_algo.RC4Drop=RC4.extend({cfg:RC4.cfg.extend({drop:192}),_doReset:function(){RC4._doReset.call(this);for(var i=this.cfg.drop;i>0;i--){generateKeystreamWord.call(this)}}});C.RC4Drop=StreamCipher._createHelper(RC4Drop)})();return CryptoJS.RC4})},{"./cipher-core":6,"./core":7,"./enc-base64":8,"./evpkdf":10,"./md5":15}],30:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(Math){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var Hasher=C_lib.Hasher;var C_algo=C.algo;var _zl=WordArray.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]);var _zr=WordArray.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]);var _sl=WordArray.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]);var _sr=WordArray.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]);var _hl=WordArray.create([0,1518500249,1859775393,2400959708,2840853838]);var _hr=WordArray.create([1352829926,1548603684,1836072691,2053994217,0]);var RIPEMD160=C_algo.RIPEMD160=Hasher.extend({_doReset:function(){this._hash=WordArray.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(M,offset){for(var i=0;i<16;i++){var offset_i=offset+i;var M_offset_i=M[offset_i];M[offset_i]=(M_offset_i<<8|M_offset_i>>>24)&16711935|(M_offset_i<<24|M_offset_i>>>8)&4278255360}var H=this._hash.words;var hl=_hl.words;var hr=_hr.words;var zl=_zl.words;var zr=_zr.words;var sl=_sl.words;var sr=_sr.words;var al,bl,cl,dl,el;var ar,br,cr,dr,er;ar=al=H[0];br=bl=H[1];cr=cl=H[2];dr=dl=H[3];er=el=H[4];var t;for(var i=0;i<80;i+=1){t=al+M[offset+zl[i]]|0;if(i<16){t+=f1(bl,cl,dl)+hl[0]}else if(i<32){t+=f2(bl,cl,dl)+hl[1]}else if(i<48){t+=f3(bl,cl,dl)+hl[2]}else if(i<64){t+=f4(bl,cl,dl)+hl[3]}else{t+=f5(bl,cl,dl)+hl[4]}t=t|0;t=rotl(t,sl[i]);t=t+el|0;al=el;el=dl;dl=rotl(cl,10);cl=bl;bl=t;t=ar+M[offset+zr[i]]|0;if(i<16){t+=f5(br,cr,dr)+hr[0]}else if(i<32){t+=f4(br,cr,dr)+hr[1]}else if(i<48){t+=f3(br,cr,dr)+hr[2]}else if(i<64){t+=f2(br,cr,dr)+hr[3]}else{t+=f1(br,cr,dr)+hr[4]}t=t|0;t=rotl(t,sr[i]);t=t+er|0;ar=er;er=dr;dr=rotl(cr,10);cr=br;br=t}t=H[1]+cl+dr|0;H[1]=H[2]+dl+er|0;H[2]=H[3]+el+ar|0;H[3]=H[4]+al+br|0;H[4]=H[0]+bl+cr|0;H[0]=t},_doFinalize:function(){var data=this._data;var dataWords=data.words;var nBitsTotal=this._nDataBytes*8;var nBitsLeft=data.sigBytes*8;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;dataWords[(nBitsLeft+64>>>9<<4)+14]=(nBitsTotal<<8|nBitsTotal>>>24)&16711935|(nBitsTotal<<24|nBitsTotal>>>8)&4278255360;data.sigBytes=(dataWords.length+1)*4;this._process();var hash=this._hash;var H=hash.words;for(var i=0;i<5;i++){var H_i=H[i];H[i]=(H_i<<8|H_i>>>24)&16711935|(H_i<<24|H_i>>>8)&4278255360}return hash},clone:function(){var clone=Hasher.clone.call(this);clone._hash=this._hash.clone();return clone}});function f1(x,y,z){return x^y^z}function f2(x,y,z){return x&y|~x&z}function f3(x,y,z){return(x|~y)^z}function f4(x,y,z){return x&z|y&~z}function f5(x,y,z){return x^(y|~z)}function rotl(x,n){return x<<n|x>>>32-n}C.RIPEMD160=Hasher._createHelper(RIPEMD160);C.HmacRIPEMD160=Hasher._createHmacHelper(RIPEMD160)})(Math);return CryptoJS.RIPEMD160})},{"./core":7}],31:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var Hasher=C_lib.Hasher;var C_algo=C.algo;var W=[];var SHA1=C_algo.SHA1=Hasher.extend({_doReset:function(){this._hash=new WordArray.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(M,offset){var H=this._hash.words;var a=H[0];var b=H[1];var c=H[2];var d=H[3];var e=H[4];for(var i=0;i<80;i++){if(i<16){W[i]=M[offset+i]|0}else{var n=W[i-3]^W[i-8]^W[i-14]^W[i-16];W[i]=n<<1|n>>>31}var t=(a<<5|a>>>27)+e+W[i];if(i<20){t+=(b&c|~b&d)+1518500249}else if(i<40){t+=(b^c^d)+1859775393}else if(i<60){t+=(b&c|b&d|c&d)-1894007588}else{t+=(b^c^d)-899497514}e=d;d=c;c=b<<30|b>>>2;b=a;a=t}H[0]=H[0]+a|0;H[1]=H[1]+b|0;H[2]=H[2]+c|0;H[3]=H[3]+d|0;H[4]=H[4]+e|0},_doFinalize:function(){var data=this._data;var dataWords=data.words;var nBitsTotal=this._nDataBytes*8;var nBitsLeft=data.sigBytes*8;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;dataWords[(nBitsLeft+64>>>9<<4)+14]=Math.floor(nBitsTotal/4294967296);dataWords[(nBitsLeft+64>>>9<<4)+15]=nBitsTotal;data.sigBytes=dataWords.length*4;this._process();return this._hash},clone:function(){var clone=Hasher.clone.call(this);clone._hash=this._hash.clone();return clone}});C.SHA1=Hasher._createHelper(SHA1);C.HmacSHA1=Hasher._createHmacHelper(SHA1)})();return CryptoJS.SHA1})},{"./core":7}],32:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./sha256"))}else if(typeof define==="function"&&define.amd){define(["./core","./sha256"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var C_algo=C.algo;var SHA256=C_algo.SHA256;var SHA224=C_algo.SHA224=SHA256.extend({_doReset:function(){this._hash=new WordArray.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var hash=SHA256._doFinalize.call(this);hash.sigBytes-=4;return hash}});C.SHA224=SHA256._createHelper(SHA224);C.HmacSHA224=SHA256._createHmacHelper(SHA224)})();return CryptoJS.SHA224})},{"./core":7,"./sha256":33}],33:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(Math){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var Hasher=C_lib.Hasher;var C_algo=C.algo;var H=[];var K=[];(function(){function isPrime(n){var sqrtN=Math.sqrt(n);for(var factor=2;factor<=sqrtN;factor++){if(!(n%factor)){return false}}return true}function getFractionalBits(n){return(n-(n|0))*4294967296|0}var n=2;var nPrime=0;while(nPrime<64){if(isPrime(n)){if(nPrime<8){H[nPrime]=getFractionalBits(Math.pow(n,1/2))}K[nPrime]=getFractionalBits(Math.pow(n,1/3));nPrime++}n++}})();var W=[];var SHA256=C_algo.SHA256=Hasher.extend({_doReset:function(){this._hash=new WordArray.init(H.slice(0))},_doProcessBlock:function(M,offset){var H=this._hash.words;var a=H[0];var b=H[1];var c=H[2];var d=H[3];var e=H[4];var f=H[5];var g=H[6];var h=H[7];for(var i=0;i<64;i++){if(i<16){W[i]=M[offset+i]|0}else{var gamma0x=W[i-15];var gamma0=(gamma0x<<25|gamma0x>>>7)^(gamma0x<<14|gamma0x>>>18)^gamma0x>>>3;var gamma1x=W[i-2];var gamma1=(gamma1x<<15|gamma1x>>>17)^(gamma1x<<13|gamma1x>>>19)^gamma1x>>>10;W[i]=gamma0+W[i-7]+gamma1+W[i-16]}var ch=e&f^~e&g;var maj=a&b^a&c^b&c;var sigma0=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22);var sigma1=(e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25);var t1=h+sigma1+ch+K[i]+W[i];var t2=sigma0+maj;h=g;g=f;f=e;e=d+t1|0;d=c;c=b;b=a;a=t1+t2|0}H[0]=H[0]+a|0;H[1]=H[1]+b|0;H[2]=H[2]+c|0;H[3]=H[3]+d|0;H[4]=H[4]+e|0;H[5]=H[5]+f|0;H[6]=H[6]+g|0;H[7]=H[7]+h|0},_doFinalize:function(){var data=this._data;var dataWords=data.words;var nBitsTotal=this._nDataBytes*8;var nBitsLeft=data.sigBytes*8;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;dataWords[(nBitsLeft+64>>>9<<4)+14]=Math.floor(nBitsTotal/4294967296);dataWords[(nBitsLeft+64>>>9<<4)+15]=nBitsTotal;data.sigBytes=dataWords.length*4;this._process();return this._hash},clone:function(){var clone=Hasher.clone.call(this);clone._hash=this._hash.clone();return clone}});C.SHA256=Hasher._createHelper(SHA256);C.HmacSHA256=Hasher._createHmacHelper(SHA256)})(Math);return CryptoJS.SHA256})},{"./core":7}],34:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./x64-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./x64-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(Math){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var Hasher=C_lib.Hasher;var C_x64=C.x64;var X64Word=C_x64.Word;var C_algo=C.algo;var RHO_OFFSETS=[];var PI_INDEXES=[];var ROUND_CONSTANTS=[];(function(){var x=1,y=0;for(var t=0;t<24;t++){RHO_OFFSETS[x+5*y]=(t+1)*(t+2)/2%64;var newX=y%5;var newY=(2*x+3*y)%5;x=newX;y=newY}for(var x=0;x<5;x++){for(var y=0;y<5;y++){PI_INDEXES[x+5*y]=y+(2*x+3*y)%5*5}}var LFSR=1;for(var i=0;i<24;i++){var roundConstantMsw=0;var roundConstantLsw=0;for(var j=0;j<7;j++){if(LFSR&1){var bitPosition=(1<<j)-1;if(bitPosition<32){roundConstantLsw^=1<<bitPosition}else{roundConstantMsw^=1<<bitPosition-32}}if(LFSR&128){LFSR=LFSR<<1^113}else{LFSR<<=1}}ROUND_CONSTANTS[i]=X64Word.create(roundConstantMsw,roundConstantLsw)}})();var T=[];(function(){for(var i=0;i<25;i++){T[i]=X64Word.create()}})();var SHA3=C_algo.SHA3=Hasher.extend({cfg:Hasher.cfg.extend({outputLength:512}),_doReset:function(){var state=this._state=[];for(var i=0;i<25;i++){state[i]=new X64Word.init}this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(M,offset){var state=this._state;var nBlockSizeLanes=this.blockSize/2;for(var i=0;i<nBlockSizeLanes;i++){var M2i=M[offset+2*i];var M2i1=M[offset+2*i+1];M2i=(M2i<<8|M2i>>>24)&16711935|(M2i<<24|M2i>>>8)&4278255360;M2i1=(M2i1<<8|M2i1>>>24)&16711935|(M2i1<<24|M2i1>>>8)&4278255360;var lane=state[i];lane.high^=M2i1;lane.low^=M2i}for(var round=0;round<24;round++){for(var x=0;x<5;x++){var tMsw=0,tLsw=0;for(var y=0;y<5;y++){var lane=state[x+5*y];tMsw^=lane.high;tLsw^=lane.low}var Tx=T[x];Tx.high=tMsw;Tx.low=tLsw}for(var x=0;x<5;x++){var Tx4=T[(x+4)%5];var Tx1=T[(x+1)%5];var Tx1Msw=Tx1.high;var Tx1Lsw=Tx1.low;var tMsw=Tx4.high^(Tx1Msw<<1|Tx1Lsw>>>31);var tLsw=Tx4.low^(Tx1Lsw<<1|Tx1Msw>>>31);for(var y=0;y<5;y++){var lane=state[x+5*y];lane.high^=tMsw;lane.low^=tLsw}}for(var laneIndex=1;laneIndex<25;laneIndex++){var lane=state[laneIndex];var laneMsw=lane.high;var laneLsw=lane.low;var rhoOffset=RHO_OFFSETS[laneIndex];if(rhoOffset<32){var tMsw=laneMsw<<rhoOffset|laneLsw>>>32-rhoOffset;var tLsw=laneLsw<<rhoOffset|laneMsw>>>32-rhoOffset}else{var tMsw=laneLsw<<rhoOffset-32|laneMsw>>>64-rhoOffset;var tLsw=laneMsw<<rhoOffset-32|laneLsw>>>64-rhoOffset}var TPiLane=T[PI_INDEXES[laneIndex]];TPiLane.high=tMsw;TPiLane.low=tLsw}var T0=T[0];var state0=state[0];T0.high=state0.high;T0.low=state0.low;for(var x=0;x<5;x++){for(var y=0;y<5;y++){var laneIndex=x+5*y;var lane=state[laneIndex];var TLane=T[laneIndex];var Tx1Lane=T[(x+1)%5+5*y];var Tx2Lane=T[(x+2)%5+5*y];lane.high=TLane.high^~Tx1Lane.high&Tx2Lane.high;lane.low=TLane.low^~Tx1Lane.low&Tx2Lane.low}}var lane=state[0];var roundConstant=ROUND_CONSTANTS[round];lane.high^=roundConstant.high;lane.low^=roundConstant.low}},_doFinalize:function(){var data=this._data;var dataWords=data.words;var nBitsTotal=this._nDataBytes*8;var nBitsLeft=data.sigBytes*8;var blockSizeBits=this.blockSize*32;dataWords[nBitsLeft>>>5]|=1<<24-nBitsLeft%32;dataWords[(Math.ceil((nBitsLeft+1)/blockSizeBits)*blockSizeBits>>>5)-1]|=128;data.sigBytes=dataWords.length*4;this._process();var state=this._state;var outputLengthBytes=this.cfg.outputLength/8;var outputLengthLanes=outputLengthBytes/8;var hashWords=[];for(var i=0;i<outputLengthLanes;i++){var lane=state[i];var laneMsw=lane.high;var laneLsw=lane.low;laneMsw=(laneMsw<<8|laneMsw>>>24)&16711935|(laneMsw<<24|laneMsw>>>8)&4278255360;laneLsw=(laneLsw<<8|laneLsw>>>24)&16711935|(laneLsw<<24|laneLsw>>>8)&4278255360;hashWords.push(laneLsw);hashWords.push(laneMsw)}return new WordArray.init(hashWords,outputLengthBytes)},clone:function(){var clone=Hasher.clone.call(this);var state=clone._state=this._state.slice(0);for(var i=0;i<25;i++){state[i]=state[i].clone()}return clone}});C.SHA3=Hasher._createHelper(SHA3);C.HmacSHA3=Hasher._createHmacHelper(SHA3)})(Math);return CryptoJS.SHA3})},{"./core":7,"./x64-core":38}],35:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./x64-core"),require("./sha512"))}else if(typeof define==="function"&&define.amd){define(["./core","./x64-core","./sha512"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_x64=C.x64;var X64Word=C_x64.Word;var X64WordArray=C_x64.WordArray;var C_algo=C.algo;var SHA512=C_algo.SHA512;var SHA384=C_algo.SHA384=SHA512.extend({_doReset:function(){this._hash=new X64WordArray.init([new X64Word.init(3418070365,3238371032),new X64Word.init(1654270250,914150663),new X64Word.init(2438529370,812702999),new X64Word.init(355462360,4144912697),new X64Word.init(1731405415,4290775857),new X64Word.init(2394180231,1750603025),new X64Word.init(3675008525,1694076839),new X64Word.init(1203062813,3204075428)])},_doFinalize:function(){var hash=SHA512._doFinalize.call(this);hash.sigBytes-=16;return hash}});C.SHA384=SHA512._createHelper(SHA384);C.HmacSHA384=SHA512._createHmacHelper(SHA384)})();return CryptoJS.SHA384})},{"./core":7,"./sha512":36,"./x64-core":38}],36:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./x64-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./x64-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var Hasher=C_lib.Hasher;var C_x64=C.x64;var X64Word=C_x64.Word;var X64WordArray=C_x64.WordArray;var C_algo=C.algo;function X64Word_create(){return X64Word.create.apply(X64Word,arguments)}var K=[X64Word_create(1116352408,3609767458),X64Word_create(1899447441,602891725),X64Word_create(3049323471,3964484399),X64Word_create(3921009573,2173295548),X64Word_create(961987163,4081628472),X64Word_create(1508970993,3053834265),X64Word_create(2453635748,2937671579),X64Word_create(2870763221,3664609560),X64Word_create(3624381080,2734883394),X64Word_create(310598401,1164996542),X64Word_create(607225278,1323610764),X64Word_create(1426881987,3590304994),X64Word_create(1925078388,4068182383),X64Word_create(2162078206,991336113),X64Word_create(2614888103,633803317),X64Word_create(3248222580,3479774868),X64Word_create(3835390401,2666613458),X64Word_create(4022224774,944711139),X64Word_create(264347078,2341262773),X64Word_create(604807628,2007800933),X64Word_create(770255983,1495990901),X64Word_create(1249150122,1856431235),X64Word_create(1555081692,3175218132),X64Word_create(1996064986,2198950837),X64Word_create(2554220882,3999719339),X64Word_create(2821834349,766784016),X64Word_create(2952996808,2566594879),X64Word_create(3210313671,3203337956),X64Word_create(3336571891,1034457026),X64Word_create(3584528711,2466948901),X64Word_create(113926993,3758326383),X64Word_create(338241895,168717936),X64Word_create(666307205,1188179964),X64Word_create(773529912,1546045734),X64Word_create(1294757372,1522805485),X64Word_create(1396182291,2643833823),X64Word_create(1695183700,2343527390),X64Word_create(1986661051,1014477480),X64Word_create(2177026350,1206759142),X64Word_create(2456956037,344077627),X64Word_create(2730485921,1290863460),X64Word_create(2820302411,3158454273),X64Word_create(3259730800,3505952657),X64Word_create(3345764771,106217008),X64Word_create(3516065817,3606008344),X64Word_create(3600352804,1432725776),X64Word_create(4094571909,1467031594),X64Word_create(275423344,851169720),X64Word_create(430227734,3100823752),X64Word_create(506948616,1363258195),X64Word_create(659060556,3750685593),X64Word_create(883997877,3785050280),X64Word_create(958139571,3318307427),X64Word_create(1322822218,3812723403),X64Word_create(1537002063,2003034995),X64Word_create(1747873779,3602036899),X64Word_create(1955562222,1575990012),X64Word_create(2024104815,1125592928),X64Word_create(2227730452,2716904306),X64Word_create(2361852424,442776044),X64Word_create(2428436474,593698344),X64Word_create(2756734187,3733110249),X64Word_create(3204031479,2999351573),X64Word_create(3329325298,3815920427),X64Word_create(3391569614,3928383900),X64Word_create(3515267271,566280711),X64Word_create(3940187606,3454069534),X64Word_create(4118630271,4000239992),X64Word_create(116418474,1914138554),X64Word_create(174292421,2731055270),X64Word_create(289380356,3203993006),X64Word_create(460393269,320620315),X64Word_create(685471733,587496836),X64Word_create(852142971,1086792851),X64Word_create(1017036298,365543100),X64Word_create(1126000580,2618297676),X64Word_create(1288033470,3409855158),X64Word_create(1501505948,4234509866),X64Word_create(1607167915,987167468),X64Word_create(1816402316,1246189591)];var W=[];(function(){for(var i=0;i<80;i++){W[i]=X64Word_create()}})();var SHA512=C_algo.SHA512=Hasher.extend({_doReset:function(){this._hash=new X64WordArray.init([new X64Word.init(1779033703,4089235720),new X64Word.init(3144134277,2227873595),new X64Word.init(1013904242,4271175723),new X64Word.init(2773480762,1595750129),new X64Word.init(1359893119,2917565137),new X64Word.init(2600822924,725511199),new X64Word.init(528734635,4215389547),new X64Word.init(1541459225,327033209)])},_doProcessBlock:function(M,offset){var H=this._hash.words;var H0=H[0];var H1=H[1];var H2=H[2];var H3=H[3];var H4=H[4];var H5=H[5];var H6=H[6];var H7=H[7];var H0h=H0.high;var H0l=H0.low;var H1h=H1.high;var H1l=H1.low;var H2h=H2.high;var H2l=H2.low;var H3h=H3.high;var H3l=H3.low;var H4h=H4.high;var H4l=H4.low;var H5h=H5.high;var H5l=H5.low;var H6h=H6.high;var H6l=H6.low;var H7h=H7.high;var H7l=H7.low;var ah=H0h;var al=H0l;var bh=H1h;var bl=H1l;var ch=H2h;var cl=H2l;var dh=H3h;var dl=H3l;var eh=H4h;var el=H4l;var fh=H5h;var fl=H5l;var gh=H6h;var gl=H6l;var hh=H7h;var hl=H7l;for(var i=0;i<80;i++){var Wi=W[i];if(i<16){var Wih=Wi.high=M[offset+i*2]|0;var Wil=Wi.low=M[offset+i*2+1]|0}else{var gamma0x=W[i-15];var gamma0xh=gamma0x.high;var gamma0xl=gamma0x.low;var gamma0h=(gamma0xh>>>1|gamma0xl<<31)^(gamma0xh>>>8|gamma0xl<<24)^gamma0xh>>>7;var gamma0l=(gamma0xl>>>1|gamma0xh<<31)^(gamma0xl>>>8|gamma0xh<<24)^(gamma0xl>>>7|gamma0xh<<25);var gamma1x=W[i-2];var gamma1xh=gamma1x.high;var gamma1xl=gamma1x.low;var gamma1h=(gamma1xh>>>19|gamma1xl<<13)^(gamma1xh<<3|gamma1xl>>>29)^gamma1xh>>>6;var gamma1l=(gamma1xl>>>19|gamma1xh<<13)^(gamma1xl<<3|gamma1xh>>>29)^(gamma1xl>>>6|gamma1xh<<26);var Wi7=W[i-7];var Wi7h=Wi7.high;var Wi7l=Wi7.low;var Wi16=W[i-16];var Wi16h=Wi16.high;var Wi16l=Wi16.low;var Wil=gamma0l+Wi7l;var Wih=gamma0h+Wi7h+(Wil>>>0<gamma0l>>>0?1:0);var Wil=Wil+gamma1l;var Wih=Wih+gamma1h+(Wil>>>0<gamma1l>>>0?1:0);var Wil=Wil+Wi16l;var Wih=Wih+Wi16h+(Wil>>>0<Wi16l>>>0?1:0);Wi.high=Wih;Wi.low=Wil}var chh=eh&fh^~eh&gh;var chl=el&fl^~el≷var majh=ah&bh^ah&ch^bh&ch;var majl=al&bl^al&cl^bl&cl;var sigma0h=(ah>>>28|al<<4)^(ah<<30|al>>>2)^(ah<<25|al>>>7);var sigma0l=(al>>>28|ah<<4)^(al<<30|ah>>>2)^(al<<25|ah>>>7);var sigma1h=(eh>>>14|el<<18)^(eh>>>18|el<<14)^(eh<<23|el>>>9);var sigma1l=(el>>>14|eh<<18)^(el>>>18|eh<<14)^(el<<23|eh>>>9);var Ki=K[i];var Kih=Ki.high;var Kil=Ki.low;var t1l=hl+sigma1l;var t1h=hh+sigma1h+(t1l>>>0<hl>>>0?1:0);var t1l=t1l+chl;var t1h=t1h+chh+(t1l>>>0<chl>>>0?1:0);var t1l=t1l+Kil;var t1h=t1h+Kih+(t1l>>>0<Kil>>>0?1:0);var t1l=t1l+Wil;var t1h=t1h+Wih+(t1l>>>0<Wil>>>0?1:0);var t2l=sigma0l+majl;var t2h=sigma0h+majh+(t2l>>>0<sigma0l>>>0?1:0);hh=gh;hl=gl;gh=fh;gl=fl;fh=eh;fl=el;el=dl+t1l|0;eh=dh+t1h+(el>>>0<dl>>>0?1:0)|0;dh=ch;dl=cl;ch=bh;cl=bl;bh=ah;bl=al;al=t1l+t2l|0;ah=t1h+t2h+(al>>>0<t1l>>>0?1:0)|0}H0l=H0.low=H0l+al;H0.high=H0h+ah+(H0l>>>0<al>>>0?1:0);H1l=H1.low=H1l+bl;H1.high=H1h+bh+(H1l>>>0<bl>>>0?1:0);H2l=H2.low=H2l+cl;H2.high=H2h+ch+(H2l>>>0<cl>>>0?1:0);H3l=H3.low=H3l+dl;H3.high=H3h+dh+(H3l>>>0<dl>>>0?1:0);H4l=H4.low=H4l+el;H4.high=H4h+eh+(H4l>>>0<el>>>0?1:0);H5l=H5.low=H5l+fl;H5.high=H5h+fh+(H5l>>>0<fl>>>0?1:0);H6l=H6.low=H6l+gl;H6.high=H6h+gh+(H6l>>>0<gl>>>0?1:0);H7l=H7.low=H7l+hl;H7.high=H7h+hh+(H7l>>>0<hl>>>0?1:0)},_doFinalize:function(){var data=this._data;var dataWords=data.words;var nBitsTotal=this._nDataBytes*8;var nBitsLeft=data.sigBytes*8;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;dataWords[(nBitsLeft+128>>>10<<5)+30]=Math.floor(nBitsTotal/4294967296);dataWords[(nBitsLeft+128>>>10<<5)+31]=nBitsTotal;data.sigBytes=dataWords.length*4;this._process();var hash=this._hash.toX32();return hash},clone:function(){var clone=Hasher.clone.call(this);clone._hash=this._hash.clone();return clone},blockSize:1024/32});C.SHA512=Hasher._createHelper(SHA512);C.HmacSHA512=Hasher._createHmacHelper(SHA512)})();return CryptoJS.SHA512})},{"./core":7,"./x64-core":38}],37:[function(require,module,exports){(function(root,factory,undef){if(typeof exports==="object"){module.exports=exports=factory(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core"))}else if(typeof define==="function"&&define.amd){define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(){var C=CryptoJS;var C_lib=C.lib;var WordArray=C_lib.WordArray;var BlockCipher=C_lib.BlockCipher;var C_algo=C.algo;var PC1=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4];var PC2=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32];var BIT_SHIFTS=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28];var SBOX_P=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}];var SBOX_MASK=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679];var DES=C_algo.DES=BlockCipher.extend({_doReset:function(){var key=this._key;var keyWords=key.words;var keyBits=[];for(var i=0;i<56;i++){var keyBitPos=PC1[i]-1;keyBits[i]=keyWords[keyBitPos>>>5]>>>31-keyBitPos%32&1}var subKeys=this._subKeys=[];for(var nSubKey=0;nSubKey<16;nSubKey++){var subKey=subKeys[nSubKey]=[];var bitShift=BIT_SHIFTS[nSubKey];for(var i=0;i<24;i++){subKey[i/6|0]|=keyBits[(PC2[i]-1+bitShift)%28]<<31-i%6;subKey[4+(i/6|0)]|=keyBits[28+(PC2[i+24]-1+bitShift)%28]<<31-i%6}subKey[0]=subKey[0]<<1|subKey[0]>>>31;for(var i=1;i<7;i++){subKey[i]=subKey[i]>>>(i-1)*4+3}subKey[7]=subKey[7]<<5|subKey[7]>>>27}var invSubKeys=this._invSubKeys=[];for(var i=0;i<16;i++){invSubKeys[i]=subKeys[15-i]}},encryptBlock:function(M,offset){this._doCryptBlock(M,offset,this._subKeys)},decryptBlock:function(M,offset){this._doCryptBlock(M,offset,this._invSubKeys)},_doCryptBlock:function(M,offset,subKeys){this._lBlock=M[offset];this._rBlock=M[offset+1];exchangeLR.call(this,4,252645135);exchangeLR.call(this,16,65535);exchangeRL.call(this,2,858993459);exchangeRL.call(this,8,16711935);exchangeLR.call(this,1,1431655765);for(var round=0;round<16;round++){var subKey=subKeys[round];var lBlock=this._lBlock;var rBlock=this._rBlock;var f=0;for(var i=0;i<8;i++){f|=SBOX_P[i][((rBlock^subKey[i])&SBOX_MASK[i])>>>0]}this._lBlock=rBlock;this._rBlock=lBlock^f}var t=this._lBlock;this._lBlock=this._rBlock;this._rBlock=t;exchangeLR.call(this,1,1431655765);exchangeRL.call(this,8,16711935);exchangeRL.call(this,2,858993459);exchangeLR.call(this,16,65535);exchangeLR.call(this,4,252645135);M[offset]=this._lBlock;M[offset+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function exchangeLR(offset,mask){var t=(this._lBlock>>>offset^this._rBlock)&mask;this._rBlock^=t;this._lBlock^=t<<offset}function exchangeRL(offset,mask){var t=(this._rBlock>>>offset^this._lBlock)&mask;this._lBlock^=t;this._rBlock^=t<<offset}C.DES=BlockCipher._createHelper(DES);var TripleDES=C_algo.TripleDES=BlockCipher.extend({_doReset:function(){var key=this._key;var keyWords=key.words;this._des1=DES.createEncryptor(WordArray.create(keyWords.slice(0,2)));this._des2=DES.createEncryptor(WordArray.create(keyWords.slice(2,4)));this._des3=DES.createEncryptor(WordArray.create(keyWords.slice(4,6)))},encryptBlock:function(M,offset){this._des1.encryptBlock(M,offset);this._des2.decryptBlock(M,offset);this._des3.encryptBlock(M,offset)},decryptBlock:function(M,offset){this._des3.decryptBlock(M,offset);this._des2.encryptBlock(M,offset);this._des1.decryptBlock(M,offset)},keySize:192/32,ivSize:64/32,blockSize:64/32});C.TripleDES=BlockCipher._createHelper(TripleDES)})();return CryptoJS.TripleDES})},{"./cipher-core":6,"./core":7,"./enc-base64":8,"./evpkdf":10,"./md5":15}],38:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"){module.exports=exports=factory(require("./core"))}else if(typeof define==="function"&&define.amd){define(["./core"],factory)}else{factory(root.CryptoJS)}})(this,function(CryptoJS){(function(undefined){var C=CryptoJS;var C_lib=C.lib;var Base=C_lib.Base;var X32WordArray=C_lib.WordArray;var C_x64=C.x64={};var X64Word=C_x64.Word=Base.extend({init:function(high,low){this.high=high;this.low=low}});var X64WordArray=C_x64.WordArray=Base.extend({init:function(words,sigBytes){words=this.words=words||[];if(sigBytes!=undefined){this.sigBytes=sigBytes}else{this.sigBytes=words.length*8}},toX32:function(){var x64Words=this.words;var x64WordsLength=x64Words.length;var x32Words=[];for(var i=0;i<x64WordsLength;i++){var x64Word=x64Words[i];x32Words.push(x64Word.high);x32Words.push(x64Word.low)}return X32WordArray.create(x32Words,this.sigBytes)},clone:function(){var clone=Base.clone.call(this);var words=clone.words=this.words.slice(0);var wordsLength=words.length;for(var i=0;i<wordsLength;i++){words[i]=words[i].clone()}return clone}})})();return CryptoJS})},{"./core":7}],39:[function(require,module,exports){(function(a,b){if("function"==typeof define&&define.amd)define(["module"],b);else if("undefined"!=typeof exports)b(module);else{var c={exports:{}};b(c),a.parseJsonBignumber=c.exports}})(this,function(a){"use strict";a.exports=function(a){var b={strict:!1};void 0!==a&&null!==a&&!0===a.strict&&(b.strict=!0);var d,e,f,c,g={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},h=function(a){throw{name:"SyntaxError",message:a,at:d,text:f}},j=function(a){return a&&a!==e&&h("Expected '"+a+"' instead of '"+e+"'"),e=f.charAt(d),d+=1,e},i=function(){var a,b="";for("-"===e&&(b="-",j("-"));"0"<=e&&"9">=e;)b+=e,j();if("."===e)for(b+=".";j()&&"0"<=e&&"9">=e;)b+=e;if("e"===e||"E"===e)for(b+=e,j(),("-"===e||"+"===e)&&(b+=e,j());"0"<=e&&"9">=e;)b+=e,j();return a=+b,isFinite(a)?15<b.length?b:a:void h("Bad number")},k=function(){var a,b,c,d="";if('"'===e)for(;j();){if('"'===e)return j(),d;if("\\"!==e)d+=e;else if(j(),"u"===e){for(c=0,b=0;4>b&&(a=parseInt(j(),16),!!isFinite(a));b+=1)c=16*c+a;d+=String.fromCharCode(c)}else if("string"==typeof g[e])d+=g[e];else break}h("Bad string")},l=function(){for(;e&&" ">=e;)j()},m=function(){switch(e){case"t":return j("t"),j("r"),j("u"),j("e"),!0;case"f":return j("f"),j("a"),j("l"),j("s"),j("e"),!1;case"n":return j("n"),j("u"),j("l"),j("l"),null}h("Unexpected '"+e+"'")},n=function(){var a=[];if("["===e){if(j("["),l(),"]"===e)return j("]"),a;for(;e;){if(a.push(c()),l(),"]"===e)return j("]"),a;j(","),l()}}h("Bad array")},o=function(){var a,d={};if("{"===e){if(j("{"),l(),"}"===e)return j("}"),d;for(;e;){if(a=k(),l(),j(":"),!0===b.strict&&Object.hasOwnProperty.call(d,a)&&h('Duplicate key "'+a+'"'),d[a]=c(),l(),"}"===e)return j("}"),d;j(","),l()}}h("Bad object")};return c=function(){return l(),"{"===e?o():"["===e?n():'"'===e?k():"-"===e?i():"0"<=e&&"9">=e?i():m()},function(a,b){var g;return f=a+"",d=0,e=" ",g=c(),l(),e&&h("Syntax error"),"function"==typeof b?function a(c,d){var e,f=c[d];return f&&"object"==typeof f&&Object.keys(f).forEach(function(b){e=a(f,b),void 0===e?delete f[b]:f[b]=e}),b.call(c,d,f)}({"":g},""):g}}})},{}],40:[function(require,module,exports){"use strict";function __export(m){for(var p in m)if(!exports.hasOwnProperty(p))exports[p]=m[p]}Object.defineProperty(exports,"__esModule",{value:true});__export(require("./src/Schema"));__export(require("./src/config"));__export(require("./src/BooleanPart"));__export(require("./src/StringPart"));__export(require("./src/DatePart"));__export(require("./src/StringDatePart"));__export(require("./src/NumberPart"));__export(require("./src/ObjectPart"));__export(require("./src/ArrayPart"));__export(require("./src/BasePart"))},{"./src/ArrayPart":41,"./src/BasePart":42,"./src/BooleanPart":43,"./src/DatePart":44,"./src/NumberPart":45,"./src/ObjectPart":46,"./src/Schema":47,"./src/StringDatePart":48,"./src/StringPart":49,"./src/config":50}],41:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var BasePart_1=require("./BasePart");var ts_utils_1=require("ts-utils");var ArrayPart=function(_super){__extends(ArrayPart,_super);function ArrayPart(config,path){var _this=_super.call(this,config,path)||this;var Component=_this.options.content.type;_this._child=new Component(_this.options.content);return _this}ArrayPart.prototype.process=function(data,rootList){var _this=this;return _super.prototype.process.call(this,data,rootList).then(function(value){if(value&&ts_utils_1.isArray(value)){return Promise.all(value.map(function(item){return _this._child.process(item,rootList.concat(data))}))}else{return value}})};ArrayPart.prototype.getValue=function(data){if(ts_utils_1.isArray(data)){return data}else{return null}};return ArrayPart}(BasePart_1.BasePart);exports.ArrayPart=ArrayPart},{"./BasePart":42,"ts-utils":51}],42:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ts_utils_1=require("ts-utils");var BasePart=function(){function BasePart(options,path){this.options=options;this.path=path;if(this.options.isEmpty){this.isEmpty=this.options.isEmpty}if(this.options.isValid){this.isValid=this.options.isValid}if(this.options.required&&"defaultValue"in this.options){throw new Error('Wrong params! Conflict options "required" and defaultValue')}}BasePart.prototype.process=function(data,roots){var _this=this;var path=this.getPath();var result=this.getValue(this.getDataByPath(data,path),roots);return BasePart.toPromise(result).then(function(value){var isEmpty=_this.isEmpty(value);var isValid=_this.isValid(value);var type=_this.options.type.name||_this.options.type.prototype.constructor.name;if(_this.options.required){if(isEmpty){throw new Error('Required field type "'+type+'" "'+path+'" is empty!')}}if("defaultValue"in _this.options&&isEmpty){value=_this.options.defaultValue}else{if(!isValid){throw new Error('Field "'+path+'" is invalid!')}}return value})};BasePart.prototype.getPath=function(){return this.options.path===null?null:this.options.path||this.path};BasePart.prototype.isEmpty=function(data){return data==null};BasePart.prototype.isValid=function(data){return true};BasePart.prototype.getDataByPath=function(data,path){if(this.options.parseValue){if(path){return this.options.parseValue(ts_utils_1.get(data,path))}else{return this.options.parseValue(data)}}else if(path!=null){return ts_utils_1.get(data,path)}else{return data}};BasePart.isPromise=function(some){return some&&some.then&&typeof some.then==="function"};BasePart.toPromise=function(some){return BasePart.isPromise(some)?some:Promise.resolve(some)};return BasePart}();exports.BasePart=BasePart},{"ts-utils":51}],43:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var BasePart_1=require("./BasePart");var BooleanPart=function(_super){__extends(BooleanPart,_super);function BooleanPart(){return _super!==null&&_super.apply(this,arguments)||this}BooleanPart.prototype.getValue=function(data){switch(typeof data){case"boolean":return data;case"string":case"number":return Boolean(data);default:return null}};return BooleanPart}(BasePart_1.BasePart);exports.BooleanPart=BooleanPart},{"./BasePart":42}],44:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var BasePart_1=require("./BasePart");var DatePart=function(_super){__extends(DatePart,_super);function DatePart(){return _super!==null&&_super.apply(this,arguments)||this}DatePart.prototype.getValue=function(data){if(data instanceof Date){return data}if(typeof data==="number"){return new Date(data)}return null};return DatePart}(BasePart_1.BasePart);exports.DatePart=DatePart},{"./BasePart":42}],45:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var BasePart_1=require("./BasePart");var NumberPart=function(_super){__extends(NumberPart,_super);function NumberPart(){return _super!==null&&_super.apply(this,arguments)||this}NumberPart.prototype.getValue=function(data){switch(typeof data){case"number":return data;case"string":return Number(data);default:return null}};NumberPart.prototype.isEmpty=function(data){return data==null||isNaN(data)};return NumberPart}(BasePart_1.BasePart);exports.NumberPart=NumberPart},{"./BasePart":42}],46:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var BasePart_1=require("./BasePart");var ts_utils_1=require("ts-utils");var ObjectPart=function(_super){__extends(ObjectPart,_super);function ObjectPart(config,path){var _this=_super.call(this,config,path)||this;var myPath=_this.getPath();_this._childHash=Object.create(null);ts_utils_1.each(_this.options.content,function(config,key){var Component=config.type;var localPath=path==null?String(key):myPath+"."+key;_this._childHash[key]=new Component(config,localPath)});return _this}ObjectPart.prototype.process=function(data,rootList){var _this=this;return _super.prototype.process.call(this,data,rootList).then(function(value){if(value&&ts_utils_1.isObject(value)){var promises_1=[];var result_1=Object.create(null);Object.keys(_this._childHash).forEach(function(name){var promise=_this._childHash[name].process(data,rootList).then(function(itemValue){result_1[name]=itemValue});promises_1.push(promise)});return Promise.all(promises_1).then(function(){return result_1})}else{return value}})};ObjectPart.prototype.getValue=function(data){if(ts_utils_1.isObject(data)){return data}else{return null}};return ObjectPart}(BasePart_1.BasePart);exports.ObjectPart=ObjectPart},{"./BasePart":42,"ts-utils":51}],47:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Schema=function(){function Schema(config){var Component=config.type;this._children=new Component(config)}Schema.prototype.parse=function(data){return this._children.process(data,[])};return Schema}();exports.Schema=Schema},{}],48:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var BasePart_1=require("./BasePart");var config_1=require("./config");var ts_utils_1=require("ts-utils");var StringDatePart=function(_super){__extends(StringDatePart,_super);function StringDatePart(config,path){var _this=_super.call(this,config,path)||this;_this.dateProcessor=ts_utils_1.date(_this.options.outPattern||config_1.OUT_DATE_PATTERN);return _this}StringDatePart.prototype.getValue=function(data){var date;if(data instanceof Date){date=data}if(typeof data==="number"){date=new Date(data)}if(date){return this.dateProcessor(date)}return null};return StringDatePart}(BasePart_1.BasePart);exports.StringDatePart=StringDatePart},{"./BasePart":42,"./config":50,"ts-utils":51}],49:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var BasePart_1=require("./BasePart");var StringPart=function(_super){__extends(StringPart,_super);function StringPart(){return _super!==null&&_super.apply(this,arguments)||this}StringPart.prototype.getValue=function(data){switch(typeof data){case"string":return data;case"number":return String(data);default:return null}};return StringPart}(BasePart_1.BasePart);exports.StringPart=StringPart},{"./BasePart":42}],50:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OUT_DATE_PATTERN="DD.MM.YYYY"},{}],51:[function(require,module,exports){"use strict";function __export(m){for(var p in m)if(!exports.hasOwnProperty(p))exports[p]=m[p]}Object.defineProperty(exports,"__esModule",{value:true});__export(require("./src/utils"));__export(require("./src/filters"));__export(require("./src/Signal"));__export(require("./src/utilsWithFilters"));__export(require("./src/Path"));__export(require("./src/Iterator"));__export(require("./src/Receiver"));__export(require("./src/tree/BaseTree"));__export(require("./src/tree/Tree"))},{"./src/Iterator":52,"./src/Path":53,"./src/Receiver":54,"./src/Signal":55,"./src/filters":56,"./src/tree/BaseTree":57,"./src/tree/Tree":58,"./src/utils":59,"./src/utilsWithFilters":60}],52:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Iterator=function(){function Iterator(some){this._step=0;this._list=some}Iterator.prototype.next=function(){if(this._step<this._list.length){var result={done:false,value:this._list[this._step]};this._step++;return result}else{return{done:true}}};return Iterator}();exports.Iterator=Iterator},{}],53:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Iterator_1=require("./Iterator");var Path=function(){function Path(path){this._path=path;this.length=this._path.length}Path.prototype.reverse=function(){return new Path(this._path.slice().reverse())};Path.prototype.iterator=function(){var _this=this;return new Iterator_1.Iterator(this._path.map(function(item,index){return _this.getItemData(index)}))};Path.prototype.slice=function(start,end){return new Path(this._path.slice(start,end))};Path.prototype.forEach=function(cb,context){var _this=this;return this._path.forEach(function(item,index){cb.call(context,_this.getItemData(index),index)})};Path.prototype.some=function(cb,context){var _this=this;return this._path.some(function(item,index){return cb.call(context,_this.getItemData(index),index)})};Path.prototype.toString=function(){return this._path.map(function(item,i){switch(item.type){case 0:return i===0?item.name:"."+item.name;case 1:return"["+item.name+"]"}}).join("")};Path.prototype.getItemData=function(index){var container=Path.getContainer(this._path[index].type);var nextContainer=this._path[index+1]&&Path.getContainer(this._path[index+1].type)||null;return{name:this._path[index].name,container:container,nextContainer:nextContainer}};Path.parse=function(path){var parts=[];path.split(".").forEach(function(key){if(key===""){parts.push({type:0,key:key})}else{var _a=key.replace(/\[(.*)?\]/,"|$1").split("|"),name_1=_a[0],index=_a[1];if(name_1){var num=Number(name_1);if(String(num)===name_1){parts.push({type:1,name:name_1})}else{parts.push({type:0,name:name_1})}}if(index){parts.push({type:1,name:index})}}});return new Path(parts)};Path.getContainer=function(type){switch(type){case 0:return Object.create(null);case 1:return[]}};return Path}();exports.Path=Path},{"./Iterator":52}],54:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Receiver=function(){function Receiver(){}Receiver.prototype.receive=function(signal,handler,context){receive.call(this,signal,handler,context,false)};Receiver.prototype.receiveOnce=function(signal,handler,context){receive.call(this,signal,handler,context,true)};Receiver.prototype.stopReceive=function(item,handler){var _this=this;if(!this.__received){return null}if(typeof item==="function"){handler=item;item=null}if(!item){Object.keys(this.__received).forEach(function(cid){_this.stopReceive(_this.__received[cid].signal,handler)});return null}if(!handler){this.__received[item.cid].handlers.forEach(function(myHandler){_this.stopReceive(item,myHandler)});return null}var handlers=this.__received[item.cid].handlers;for(var i=handlers.length;i--;){if(handlers[i]===handler){handlers.splice(i,1);this.__received[item.cid].signal.off(handler,this)}}if(!handlers.length){delete this.__received[item.cid]}};return Receiver}();exports.Receiver=Receiver;function receive(signal,handler,context,isOnce){if(!this.__received){this.__received=Object.create(null)}if(isOnce){signal.once(handler,context,this)}else{signal.on(handler,context,this)}if(!this.__received[signal.cid]){this.__received[signal.cid]={handlers:[handler],signal:signal}}else{this.__received[signal.cid].handlers.push(handler)}}},{}],55:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var utils_1=require("./utils");var Signal=function(){function Signal(){this.cid=utils_1.uniqueId("signal");this._handlers=[]}Signal.prototype.on=function(handler,context,receiver){this._handlers.push({isOnce:false,handler:handler,context:context,receiver:receiver})};Signal.prototype.once=function(handler,context,receiver){this._handlers.push({isOnce:true,handler:handler,context:context,receiver:receiver})};Signal.prototype.off=function(handler,receiver){for(var i=this._handlers.length;i--;){var handlerData=this._handlers[i];if(!handlerData){continue}if(handlerData.handler===handler){if(handlerData.receiver){if(receiver){if(handlerData.receiver===receiver){this._handlers.splice(i,1);handlerData.receiver.stopReceive(this,handler)}}else{throw new Error("Can't remove this handler without receiver!")}}else{this._handlers.splice(i,1)}}}};Signal.prototype.dispatch=function(some){var _this=this;this._handlers.slice().forEach(function(handlerData){if(handlerData.isOnce){_this.off(handlerData.handler,handlerData.receiver)}handlerData.handler.call(handlerData.context,some)})};return Signal}();exports.Signal=Signal},{"./utils":59}],56:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var utils_1=require("./utils");var EMPTY_FUNCS_MAP={skipNumber:utils_1.isNumber,skipString:utils_1.isString,skipNotEmpty:utils_1.isNotEmpty,skipNull:utils_1.isNull,skipUndefined:utils_1.isUndefined};function filterList(){var filters=[];for(var _i=0;_i<arguments.length;_i++){filters[_i]=arguments[_i]}if(!filters.length){return function(){return true}}return function(item){return filters.every(function(filter){return filter(item)})}}exports.filterList=filterList;function not(processor){if(processor){return function(data){return!processor(data)}}else{return function(data){return!data}}}exports.not=not;function empty(options){if(!options){return Boolean}var functions=[];utils_1.each(options,function(value,optionName){if(EMPTY_FUNCS_MAP[optionName]&&value){functions.push(EMPTY_FUNCS_MAP[optionName])}});if(!functions.length){return Boolean}else{return function(data){return functions.some(function(f){return f(data)})||!!data}}}exports.empty=empty;function contains(data){if(typeof data==="object"){var keys_1=Object.keys(data);return function(localData){if(!utils_1.isObject(localData)){return false}return keys_1.every(function(key){return data[key]===localData[key]})}}else{return function(localData){return data===localData}}}exports.contains=contains;function containsDeep(data){var paths=utils_1.getPaths(data);var check=function(localData){return paths.every(function(parts){return utils_1.get(data,parts)===utils_1.get(localData,parts)})};return function(localData){if(typeof localData==="object"){return check(localData)}else{return false}}}exports.containsDeep=containsDeep;function notContains(data){return not(contains(data))}exports.notContains=notContains;function notContainsDeep(data){return not(containsDeep(data))}exports.notContainsDeep=notContainsDeep;function roundFilter(len){return function(num){return utils_1.round(num,len)}}exports.roundFilter=roundFilter;function splitRangeFilter(data,processor){return function(num){return utils_1.splitRange(num,data,processor)}}exports.splitRangeFilter=splitRangeFilter;function roundSplit(len,data){return splitRangeFilter(data,roundFilter(len))}exports.roundSplit=roundSplit;function equal(some,noStrict){if(noStrict){return function(data){return some==data}}return function(data){return some===data}}exports.equal=equal;function notEqual(some,noStrict){return not(equal(some,noStrict))}exports.notEqual=notEqual;var dateParsers=[{pattern:"YYYY",handler:function(localDate){return String(localDate.getFullYear())}},{pattern:"YY",handler:function(localDate){return String(localDate.getFullYear()).substr(2)}},{pattern:"MM",handler:function(localDate){return String(utils_1.numToLength(localDate.getMonth()+1,2))}},{pattern:"M",handler:function(localDate){return String(localDate.getMonth()+1)}},{pattern:"DD",handler:function(localDate){return String(utils_1.numToLength(localDate.getDate(),2))}},{pattern:"D",handler:function(localDate){return String(localDate.getDate())}},{pattern:"hh",handler:function(localDate){return String(utils_1.numToLength(localDate.getHours(),2))}},{pattern:"h",handler:function(localDate){return String(localDate.getHours())}},{pattern:"mm",handler:function(localDate){return String(utils_1.numToLength(localDate.getMinutes(),2))}},{pattern:"m",handler:function(localDate){return String(localDate.getMinutes())}},{pattern:"ss",handler:function(localDate){return String(utils_1.numToLength(localDate.getSeconds(),2))}},{pattern:"s",handler:function(localDate){return String(localDate.getSeconds())}}];function date(pattern,processor){var localPatterns=[];var forFind=pattern;var parse;dateParsers.forEach(function(datePattern){if(forFind.indexOf(datePattern.pattern)!==-1){forFind=forFind.replace(datePattern.pattern,"");localPatterns.push(datePattern)}});if(processor){parse=function(toParse){var result=processor(toParse);return utils_1.isNumber(result)?new Date(result):result}}else{parse=function(data){return utils_1.isNumber(data)?new Date(data):data}}return function(localDate){var _date=parse(localDate);return localPatterns.reduce(function(result,datePattern){return result.replace(datePattern.pattern,datePattern.handler(_date))},pattern)}}exports.date=date;function getBinaryFilter(data){var dataPaths=utils_1.getPaths(data);if(dataPaths.length===1){var path_1=dataPaths[0];var value_1=utils_1.get(data,path_1);return function(item){var itemValue=utils_1.get(item,path_1);return itemValue>value_1?-1:itemValue===value_1?0:1}}else{var pathsStr_1=dataPaths.map(String);var pathsHash_1=Object.create(null);dataPaths.forEach(function(path){pathsHash_1[String(path)]=utils_1.get(data,path)});return function(item){var map=dataPaths.map(function(path,i){var itemValue=utils_1.get(item,path);var pathStr=pathsStr_1[i];return itemValue>pathsHash_1[pathStr]?-1:itemValue===pathsHash_1[pathStr]?0:1});var witoutZero=map.filter(Boolean);if(witoutZero.length===0){return 0}else{return witoutZero[0]}}}}exports.getBinaryFilter=getBinaryFilter},{"./utils":59}],57:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var utils_1=require("../utils");var BaseTree=function(){function BaseTree(data,parent,options){var _this=this;this.children=[];this.parent=parent;this.id=data.id;this.data=utils_1.cloneDeep(data.data);this.ChildConstructor=options&&options.Child||BaseTree;this.getRoot().registerChild(this);if(data.children){data.children.forEach(function(item){_this.children.push(new _this.ChildConstructor(item,_this,options))})}}BaseTree.prototype.getChildren=function(){return this.children||[]};BaseTree.prototype.toArray=function(){var result=[this];if(this.children){this.children.forEach(function(item){result.push.apply(result,item.toArray())})}return result};BaseTree.prototype.getData=function(){return this.data||Object.create(null)};BaseTree.prototype.set=function(key,value){this.data[key]=value};BaseTree.prototype.get=function(key){return this.getData()[key]};BaseTree.prototype.getExtended=function(key){var result=this.get(key);return result==null?this.parent.getExtended(key):result};BaseTree.prototype.getParent=function(){return this.parent};BaseTree.prototype.getRoot=function(){return this.parent.getRoot()};return BaseTree}();exports.BaseTree=BaseTree},{"../utils":59}],58:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var BaseTree_1=require("./BaseTree");var filters_1=require("../filters");var Tree=function(_super){__extends(Tree,_super);function Tree(data,options){return _super.call(this,data,null,options)||this}Tree.prototype.where=function(data){var _this=this;var filter=typeof data==="object"?filters_1.containsDeep(data):filters_1.contains(data);return Object.keys(this._childHash).reduce(function(result,item,i){if(filter(_this._childHash[item].getData())){result.push(_this._childHash[item])}return result},[])};Tree.prototype.registerChild=function(child){if(!this._childHash){this._childHash=Object.create(null)}if(child!==this){if(this._childHash[child.id]){throw new Error("Duplicate ID")}else{this._childHash[child.id]=child}}};Tree.prototype.getPath=function(id){var item=this.find(id);if(!item){return null}var result=[];var tmp=item;do{result.push(tmp.id);tmp=tmp.getParent()}while(tmp.getParent());return result.reverse()};Tree.prototype.getRoot=function(){return this};Tree.prototype.find=function(id){return this._childHash[id]};return Tree}(BaseTree_1.BaseTree);exports.Tree=Tree},{"../filters":56,"./BaseTree":57}],59:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var Path_1=require("./Path");var TYPES={string:"[object String]",number:"[object Number]",boolean:"[object Boolean]",object:"[object Object]",array:"[object Array]"};var toString=Object.prototype.toString;exports.DEFAULT_NUMBER_SEPARATOR=".";function isObject(param){return toString.call(param)===TYPES.object}exports.isObject=isObject;function isEmpty(param){return param==null}exports.isEmpty=isEmpty;function isNotEmpty(param){return param!=null}exports.isNotEmpty=isNotEmpty;function isString(param){return toString.call(param)===TYPES.string}exports.isString=isString;function isNumber(param){return toString.call(param)===TYPES.number}exports.isNumber=isNumber;function isArray(param){return toString.call(param)===TYPES.array}exports.isArray=isArray;function isBoolean(param){return toString.call(param)===TYPES.boolean}exports.isBoolean=isBoolean;function isNull(param){return param===null}exports.isNull=isNull;function isUndefined(param){return param===undefined}exports.isUndefined=isUndefined;function isNaNCheck(param){return isNumber(param)&&isNaN(param)}exports.isNaNCheck=isNaNCheck;function isFunction(param){return typeof param==="function"}exports.isFunction=isFunction;function typeOf(param){var type=typeof param;switch(type){case"object":if(param===null){return"null"}else{var checkList=[{check:isArray,type:"array"},{check:isObject,type:"object"},{check:isString,type:"string"},{check:isNumber,type:"number"},{check:isBoolean,type:"boolean"}];var $type_1="null";checkList.some(function(item){if(item.check(param)){$type_1=item.type}return $type_1!=="null"});return $type_1}default:return type}}exports.typeOf=typeOf;function numToLength(num,length){var str=String(num);for(var i=str.length;i<length;i++){str="0"+str}return str}exports.numToLength=numToLength;function round(num,len){len=len||2;return Number(Math.round(Number(num+"e"+len))+"e-"+len)}exports.round=round;function splitRange(num,options,processor){if(processor){num=processor(num)}var str=String(num);var numData=str.split(".");var integral=numData[0],fractional=numData[1];integral=integral.split("").reverse().join("");integral=integral.replace(/(\d{3})/g,"$1 ").split("").reverse().join("").replace(/\s/g,options&&options.nbsp?" ":" ").trim();if(fractional){return integral+(options&&options.separator||exports.DEFAULT_NUMBER_SEPARATOR)+fractional}return integral}exports.splitRange=splitRange;function each(param,callback,context){if(typeof param!=="object"||!param){return null}if(context){return Array.isArray(param)?param.forEach(callback,context):Object.keys(param).forEach(function(key){return callback.call(context,param[key],key)})}else{return Array.isArray(param)?param.forEach(callback):Object.keys(param).forEach(function(key){return callback(param[key],key)})}}exports.each=each;function some(param,callback){return Object.keys(param).some(function(key){return callback(param[key],key)})}exports.some=some;function get(data,path){var tmp=data;var parts=isString(path)?Path_1.Path.parse(path):path;parts.some(function(item){if(typeof tmp==="object"&&tmp!==null&&item.name in tmp){tmp=tmp[item.name]}else{tmp=null;return true}});return tmp}exports.get=get;function set(data,path,value){var tmp=data;var parts=isString(path)?Path_1.Path.parse(path):path;parts.forEach(function(itemData,index){var isLast=index===parts.length-1;if(isLast){tmp[itemData.name]=value}else{if(typeof tmp[itemData.name]!=="object"){tmp[itemData.name]=itemData.nextContainer}tmp=tmp[itemData.name]}})}exports.set=set;function getLayers(data,path){var tmp=data;var layers=[{name:null,data:data,parent:null}];var parts=isString(path)?Path_1.Path.parse(path):path;parts.forEach(function(item){if(tmp){layers.push({name:item.name,data:tmp[item.name],parent:tmp});tmp=tmp[item.name]}else{layers=null}});return layers}exports.getLayers=getLayers;function unset(data,path){(getLayers(data,path)||[]).reverse().some(function(item,index){if(index===0){if(item.parent){delete item.parent[item.name]}}else{if(item.parent&&Object.keys(item.data).length===0){delete item.parent[item.name]}}})}exports.unset=unset;var counter=0;function uniqueId(prefix){if(prefix===void 0){prefix=""}return""+prefix+counter++}exports.uniqueId=uniqueId;function result(param){if(isFunction(param)){return param()}else{return param}}exports.result=result;function getPaths(param){var paths=[];function getIterate(parents,array){var iterate=function(value,key){var newLine=parents.slice();newLine.push({type:array?1:0,name:key});if(isObject(value)){each(value,getIterate(newLine))}else if(isArray(value)){each(value,getIterate(newLine,true))}else{paths.push(newLine)}};return iterate}var firstLine=[];each(param,getIterate(firstLine,isArray(param)));return paths.map(function(pathParts){return new Path_1.Path(pathParts)})}exports.getPaths=getPaths;function clone(data){switch(typeof data){case"object":if(data===null){return null}if(Array.isArray(data)){return data.slice()}else{return __assign({},data)}default:return data}}exports.clone=clone;function cloneDeep(data){switch(typeof data){case"object":var paths=getPaths(data);var $clone_1=isArray(data)?[]:Object.create(null);paths.forEach(function(path){var value=get(data,path);set($clone_1,path,value)});return $clone_1;default:return data}}exports.cloneDeep=cloneDeep;function merge(origin){var args=[];for(var _i=1;_i<arguments.length;_i++){args[_i-1]=arguments[_i]}args.forEach(function(part){var paths=getPaths(part);paths.forEach(function(path){var value=get(part,path);set(origin,path,value)})});return origin}exports.merge=merge;function defaults(target){var args=[];for(var _i=1;_i<arguments.length;_i++){args[_i-1]=arguments[_i]}var paths=getPaths(target).map(String);args.reverse().forEach(function(item){var itemPaths=getPaths(item);itemPaths.forEach(function(path){var stringPath=path.toString();if(paths.indexOf(stringPath)===-1){paths.push(stringPath);set(target,path,get(item,path))}})});return target}exports.defaults=defaults;function camelCase(text){return text.split(/\W|_/).map(function(item,index){switch(index){case 0:return item;default:return item.charAt(0).toUpperCase()+item.substr(1)}}).join("")}exports.camelCase=camelCase},{"./Path":53}],60:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var utils_1=require("./utils");var filters_1=require("./filters");function find(some,target){var filter=utils_1.isFunction(target)?target:filters_1.contains(target);var result=null;if(utils_1.isArray(some)){some.some(function(data){if(filter(data)){result=data;return true}})}else{Object.keys(some).some(function(key){if(filter(some[key])){result=some[key];return true}})}return result}exports.find=find;function binaryFind(some,target){var result={index:-1,value:null};var delta=0;var step=function(arr){var index=Math.floor(arr.length/2);var item=arr[index];switch(target(item)){case-1:step(arr.slice(0,index));break;case 0:result={index:index+delta,value:item};break;case 1:delta+=index;step(arr.slice(index));break}};step(some.slice());return result}exports.binaryFind=binaryFind},{"./filters":56,"./utils":59}],61:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var bignumber_1=require("./libs/bignumber");var Asset_1=require("./classes/Asset");var AssetPair_1=require("./classes/AssetPair");var Money_1=require("./classes/Money");var OrderPrice_1=require("./classes/OrderPrice");var Seed_1=require("./classes/Seed");var Transactions_1=require("./classes/Transactions");var byteProcessors=require("./classes/ByteProcessor");var crypto_1=require("./utils/crypto");var request=require("./utils/request");var storage=require("./utils/storage");var NodeAPI=require("./api/node/index");var MatcherAPI=require("./api/matcher/index");var constants=require("./constants");var config_1=require("./config");var tools_1=require("./tools");var WavesAPI=function(){function WavesAPI(initialConfiguration){this.Asset=Asset_1.default;this.AssetPair=AssetPair_1.default;this.Money=Money_1.default;this.OrderPrice=OrderPrice_1.default;this.Seed=Seed_1.default;this.Transactions=Transactions_1.default;this.byteProcessors=byteProcessors;this.config=config_1.default;this.constants=constants;this.crypto=crypto_1.default;this.request=request;this.storage=storage;this.tools=tools_1.default;this.API={Node:{v1:NodeAPI.v1,v2:NodeAPI.v2},Matcher:{v1:MatcherAPI.v1}};if(this instanceof WavesAPI){this.config.clear();this.config.set(initialConfiguration);if(WavesAPI._instance===null){WavesAPI._instance=this}else{return WavesAPI._instance}}else{return new WavesAPI(initialConfiguration)}}return WavesAPI}();exports.BigNumber=bignumber_1.default;function create(config){return new WavesAPI(config)}exports.create=create;exports.MAINNET_CONFIG=constants.DEFAULT_MAINNET_CONFIG;exports.TESTNET_CONFIG=constants.DEFAULT_TESTNET_CONFIG},{"./api/matcher/index":62,"./api/node/index":66,"./classes/Asset":91,"./classes/AssetPair":92,"./classes/ByteProcessor":93,"./classes/Money":94,"./classes/OrderPrice":95,"./classes/Seed":96,"./classes/Transactions":97,"./config":98,"./constants":99,"./libs/bignumber":104,"./tools":111,"./utils/crypto":114,"./utils/request":117,"./utils/storage":118}],62:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var info_1=require("./v1/info");var orderbooks_1=require("./v1/orderbooks");exports.v1={getMatcherKey:info_1.default.getMatcherKey,getOrderbooks:orderbooks_1.default.getOrderbooks,getOrderbook:orderbooks_1.default.getOrderbook,getOrders:orderbooks_1.default.getOrders,getAllOrders:orderbooks_1.default.getAllOrders,createOrder:orderbooks_1.default.createOrder,cancelOrder:orderbooks_1.default.cancelOrder,deleteOrder:orderbooks_1.default.deleteOrder}},{"./v1/info":63,"./v1/orderbooks":64}],63:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var request_1=require("../../../utils/request");var fetch=request_1.createFetchWrapper(1,0,request_1.processJSON);exports.default={getMatcherKey:function(){return fetch("/")}}},{"../../../utils/request":117}],64:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var Transactions_1=require("../../../classes/Transactions");var ByteProcessor_1=require("../../../classes/ByteProcessor");var request_1=require("../../../utils/request");var remap_1=require("../../../utils/remap");var request_2=require("../../../utils/request");var orderbooks_x_1=require("./orderbooks.x");var GetOrdersAuthData=Transactions_1.default.createSignableData([new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.Long("timestamp")]);var CancelOrderAuthData=Transactions_1.default.createSignableData([new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.Base58("orderId")]);var fetch=request_1.createFetchWrapper(1,0,request_1.processJSON);var preCreateOrderAsync=function(data){return orderbooks_x_1.createOrderSchema.parse(data)};var postCreateOrder=function(data){data.assetPair={amountAsset:remap_1.normalizeAssetId(data.amountAsset),priceAsset:remap_1.normalizeAssetId(data.priceAsset)};delete data.amountAsset;delete data.priceAsset;return data};var postCancelOrder=remap_1.createRemapper({senderPublicKey:"sender"});var generateCancelLikeRequest=function(type){return function(amountAssetId,priceAssetId,orderId,keyPair){var authData=new CancelOrderAuthData({senderPublicKey:keyPair.publicKey,orderId:orderId});return authData.prepareForAPI(keyPair.privateKey).then(postCancelOrder).then(function(tx){return fetch("/orderbook/"+amountAssetId+"/"+priceAssetId+"/"+type,__assign({},request_2.POST_TEMPLATE,{body:JSON.stringify(tx)}))})}};exports.default={getOrderbooks:function(){return fetch("/orderbook")},getOrderbook:function(assetOne,assetTwo){return fetch("/orderbook/"+assetOne+"/"+assetTwo)},getOrders:function(assetOne,assetTwo,keyPair){var authData=new GetOrdersAuthData({senderPublicKey:keyPair.publicKey,timestamp:remap_1.getTimestamp()});return authData.prepareForAPI(keyPair.privateKey).then(function(preparedData){return fetch("/orderbook/"+assetOne+"/"+assetTwo+"/publicKey/"+keyPair.publicKey,{headers:{Timestamp:preparedData.timestamp,Signature:preparedData.signature}})})},getAllOrders:function(keyPair){var authData=new GetOrdersAuthData({senderPublicKey:keyPair.publicKey,timestamp:remap_1.getTimestamp()});return authData.prepareForAPI(keyPair.privateKey).then(function(preparedData){return fetch("/orderbook/"+keyPair.publicKey,{headers:{Timestamp:preparedData.timestamp,Signature:preparedData.signature}})})},createOrder:request_1.wrapTransactionRequest(Transactions_1.default.Order,preCreateOrderAsync,postCreateOrder,function(postParams){return fetch("/orderbook",postParams)}),cancelOrder:generateCancelLikeRequest("cancel"),deleteOrder:generateCancelLikeRequest("delete")}},{"../../../classes/ByteProcessor":93,"../../../classes/Transactions":97,"../../../utils/remap":116,"../../../utils/request":117,"./orderbooks.x":65}],65:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var remap_1=require("../../../utils/remap");var constants_1=require("../../../constants");var schemaFields_1=require("../../schemaFields");exports.createOrderSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{senderPublicKey:schemaFields_1.default.publicKey,matcherPublicKey:schemaFields_1.default.publicKey,amountAsset:schemaFields_1.default.assetId,priceAsset:schemaFields_1.default.assetId,orderType:{type:ts_api_validator_1.StringPart,required:true,isValid:function(orderType){return orderType==="buy"||orderType==="sell"}},amount:{type:ts_api_validator_1.NumberPart,required:true},price:{type:ts_api_validator_1.NumberPart,required:true},timestamp:schemaFields_1.default.timestamp,expiration:{type:ts_api_validator_1.NumberPart,required:true,parseValue:function(expiration){if(expiration){return remap_1.getTimestamp(expiration)}else{var date=new Date(remap_1.getTimestamp());return date.setDate(date.getDate()+constants_1.DEFAULT_ORDER_EXPIRATION_DAYS)}}},matcherFee:schemaFields_1.default.matcherFee}})},{"../../../constants":99,"../../../utils/remap":116,"../../schemaFields":88,"ts-api-validator":40}],66:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var addresses_1=require("./v1/addresses");var aliases_1=require("./v1/aliases");var assets_1=require("./v1/assets");var blocks_1=require("./v1/blocks");var leasing_1=require("./v1/leasing");var transactions_1=require("./v1/transactions");var addresses_2=require("./v2/addresses");var aliases_2=require("./v2/aliases");var transactions_2=require("./v2/transactions");exports.v1={addresses:addresses_1.default,aliases:aliases_1.default,assets:assets_1.default,blocks:blocks_1.default,leasing:leasing_1.default,transactions:transactions_1.default};exports.v2={addresses:addresses_2.default,aliases:aliases_2.default,transactions:transactions_2.default}},{"./v1/addresses":67,"./v1/aliases":68,"./v1/assets":70,"./v1/blocks":72,"./v1/leasing":73,"./v1/transactions":75,"./v2/addresses":79,"./v2/aliases":81,"./v2/transactions":83}],67:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var request_1=require("../../../utils/request");var fetch=request_1.createFetchWrapper(0,0,request_1.processJSON);exports.default={balance:function(address,confirmations){if(!confirmations){return fetch("/addresses/balance/"+address)}else{return fetch("/addresses/balance/"+address+"/"+confirmations)}},balanceDetails:function(address){return fetch("/addresses/balance/details/"+address)}}},{"../../../utils/request":117}],68:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Transactions_1=require("../../../classes/Transactions");var request_1=require("../../../utils/request");var aliases_x_1=require("./aliases.x");var remap_1=require("../../../utils/remap");var fetch=request_1.createFetchWrapper(0,0,request_1.processJSON);var preCreateAliasAsync=function(data){return aliases_x_1.createAliasSchema.parse(data)};var postCreateAlias=remap_1.createRemapper({transactionType:null});exports.default={byAlias:function(alias){return fetch("/alias/by-alias/"+alias)},byAddress:function(address){return fetch("/alias/by-address/"+address)},createAlias:request_1.wrapTransactionRequest(Transactions_1.default.CreateAliasTransaction,preCreateAliasAsync,postCreateAlias,function(postParams){return fetch("/alias/broadcast/create",postParams)})}},{"../../../classes/Transactions":97,"../../../utils/remap":116,"../../../utils/request":117,"./aliases.x":69}],69:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var remap_1=require("../../../utils/remap");var schemaFields_1=require("../../schemaFields");exports.createAliasSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{senderPublicKey:schemaFields_1.default.publicKey,alias:{type:ts_api_validator_1.StringPart,required:true,parseValue:remap_1.removeAliasPrefix},fee:schemaFields_1.default.fee,timestamp:schemaFields_1.default.timestamp}})},{"../../../utils/remap":116,"../../schemaFields":88,"ts-api-validator":40}],70:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Transactions_1=require("../../../classes/Transactions");var request_1=require("../../../utils/request");var assets_x_1=require("./assets.x");var addresses_1=require("./addresses");var remap_1=require("../../../utils/remap");var constants=require("../../../constants");var fetch=request_1.createFetchWrapper(0,0,request_1.processJSON);var preIssueAsync=function(data){return assets_x_1.issueSchema.parse(data)};var postIssue=remap_1.createRemapper({transactionType:null,precision:"decimals"});var preTransferAsync=function(data){return assets_x_1.transferSchema.parse(data)};var postTransfer=remap_1.createRemapper({transactionType:null,assetId:remap_1.normalizeAssetId,feeAssetId:remap_1.normalizeAssetId});var preReissueAsync=function(data){return assets_x_1.reissueSchema.parse(data)};var postReissue=remap_1.createRemapper({transactionType:null});var preBurnAsync=function(data){return assets_x_1.burnSchema.parse(data)};var postBurn=remap_1.createRemapper({transactionType:null});exports.default={balances:function(address){return fetch("/assets/balance/"+address)},balance:function(address,assetId){if(assetId===constants.WAVES){return addresses_1.default.balance(address)}else{return fetch("/assets/balance/"+address+"/"+assetId)}},distribution:function(assetId){return fetch("/assets/"+assetId+"/distribution")},issue:request_1.wrapTransactionRequest(Transactions_1.default.IssueTransaction,preIssueAsync,postIssue,function(postParams){return fetch("/assets/broadcast/issue",postParams)}),transfer:request_1.wrapTransactionRequest(Transactions_1.default.TransferTransaction,preTransferAsync,postTransfer,function(postParams){return fetch("/assets/broadcast/transfer",postParams)}),reissue:request_1.wrapTransactionRequest(Transactions_1.default.ReissueTransaction,preReissueAsync,postReissue,function(postParams){return fetch("/assets/broadcast/reissue",postParams)}),burn:request_1.wrapTransactionRequest(Transactions_1.default.BurnTransaction,preBurnAsync,postBurn,function(postParams){return fetch("/assets/broadcast/burn",postParams)})}},{"../../../classes/Transactions":97,"../../../constants":99,"../../../utils/remap":116,"../../../utils/request":117,"./addresses":67,"./assets.x":71}],71:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var remap_1=require("../../../utils/remap");var constants=require("../../../constants");var schemaFields_1=require("../../schemaFields");exports.issueSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{senderPublicKey:schemaFields_1.default.publicKey,name:{type:ts_api_validator_1.StringPart,required:true},description:{type:ts_api_validator_1.StringPart,required:false,defaultValue:""},quantity:{type:ts_api_validator_1.NumberPart,required:true},precision:{type:ts_api_validator_1.NumberPart,required:true,isValid:remap_1.precisionCheck},reissuable:schemaFields_1.default.reissuable,fee:schemaFields_1.default.issueFee,timestamp:schemaFields_1.default.timestamp}});exports.transferSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{senderPublicKey:schemaFields_1.default.publicKey,recipient:schemaFields_1.default.recipient,assetId:schemaFields_1.default.assetId,amount:{type:ts_api_validator_1.NumberPart,required:true},feeAssetId:{type:ts_api_validator_1.StringPart,required:false,defaultValue:constants.WAVES},fee:schemaFields_1.default.fee,attachment:{type:ts_api_validator_1.StringPart,required:false,defaultValue:""},timestamp:schemaFields_1.default.timestamp}});exports.reissueSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{senderPublicKey:schemaFields_1.default.publicKey,assetId:schemaFields_1.default.assetId,quantity:{type:ts_api_validator_1.NumberPart,required:true},reissuable:schemaFields_1.default.reissuable,fee:schemaFields_1.default.issueFee,timestamp:schemaFields_1.default.timestamp}});exports.burnSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{senderPublicKey:schemaFields_1.default.publicKey,assetId:schemaFields_1.default.assetId,quantity:{type:ts_api_validator_1.NumberPart,required:true},fee:schemaFields_1.default.fee,timestamp:schemaFields_1.default.timestamp}})},{"../../../constants":99,"../../../utils/remap":116,"../../schemaFields":88,"ts-api-validator":40}],72:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var request_1=require("../../../utils/request");var fetch=request_1.createFetchWrapper(0,0,request_1.processJSON);exports.default={get:function(signature){return fetch("/blocks/signature/"+signature)},at:function(height){return fetch("/blocks/at/"+height)},first:function(){return fetch("/blocks/first")},last:function(){return fetch("/blocks/last")},height:function(){return fetch("/blocks/height")}}},{"../../../utils/request":117}],73:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Transactions_1=require("../../../classes/Transactions");var request_1=require("../../../utils/request");var remap_1=require("../../../utils/remap");var leasing_x_1=require("./leasing.x");var fetch=request_1.createFetchWrapper(0,0,request_1.processJSON);var preLeaseAsync=function(data){return leasing_x_1.leaseSchema.parse(data)};var postLease=remap_1.createRemapper({transactionType:null});var preCancelLeasingAsync=function(data){return leasing_x_1.cancelLeasingSchema.parse(data)};var postCancelLeasing=remap_1.createRemapper({transactionType:null,transactionId:"txId"});exports.default={lease:request_1.wrapTransactionRequest(Transactions_1.default.LeaseTransaction,preLeaseAsync,postLease,function(postParams){return fetch("/leasing/broadcast/lease",postParams)}),cancelLeasing:request_1.wrapTransactionRequest(Transactions_1.default.CancelLeasingTransaction,preCancelLeasingAsync,postCancelLeasing,function(postParams){return fetch("/leasing/broadcast/cancel",postParams)}),getAllActiveLeases:function(address){return fetch("/leasing/active/"+address).then(function(list){return list.map(function(tx){tx.status="active";return tx})})}}},{"../../../classes/Transactions":97,"../../../utils/remap":116,"../../../utils/request":117,"./leasing.x":74}],74:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var schemaFields_1=require("../../schemaFields");exports.leaseSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{senderPublicKey:schemaFields_1.default.publicKey,recipient:schemaFields_1.default.recipient,amount:{type:ts_api_validator_1.NumberPart,required:true},fee:schemaFields_1.default.fee,timestamp:schemaFields_1.default.timestamp}});exports.cancelLeasingSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{senderPublicKey:schemaFields_1.default.publicKey,transactionId:{type:ts_api_validator_1.StringPart,required:true},fee:schemaFields_1.default.fee,timestamp:schemaFields_1.default.timestamp}})},{"../../schemaFields":88,"ts-api-validator":40}],75:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var request_1=require("../../../utils/request");var config_1=require("../../../config");var constants_1=require("../../../constants");var fetch=request_1.createFetchWrapper(0,0,request_1.processJSON);exports.default={get:function(id){if(id===constants_1.WAVES){return Promise.resolve(constants_1.WAVES_V1_ISSUE_TX)}else{return fetch("/transactions/info/"+id)}},getList:function(address,limit){if(limit===void 0){limit=config_1.default.getRequestParams().limit}return fetch("/transactions/address/"+address+"/limit/"+limit).then(function(array){return array[0]})},utxSize:function(){return fetch("/transactions/unconfirmed/size")},utxGet:function(id){return fetch("/transactions/unconfirmed/info/"+id)},utxGetList:function(){return fetch("/transactions/unconfirmed")}}},{"../../../config":98,"../../../constants":99,"../../../utils/request":117}],76:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Asset_1=require("../../../classes/Asset");var Money_1=require("../../../classes/Money");function toObject(array,key){return array.reduce(function(object,elem){object[elem[key]]=elem;return object},{})}exports.default={balanceListByAssets:function(balances,assets){var hashMap=toObject(balances,"id");return Promise.all(assets.map(function(asset){if(hashMap[asset]){return hashMap[asset]}else{return Asset_1.default.get(asset).then(function(a){return Money_1.default.fromCoins("0",a).then(function(amount){return{id:a.id,name:a.name,precision:a.precision,amount:amount}})})}}))}}},{"../../../classes/Asset":91,"../../../classes/Money":94}],77:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var constants=require("../../../constants");var transactionTypes=(_a={},_a[constants.ISSUE_TX_NAME]=constants.ISSUE_TX,_a[constants.TRANSFER_TX_NAME]=constants.TRANSFER_TX,_a[constants.REISSUE_TX_NAME]=constants.REISSUE_TX,_a[constants.BURN_TX_NAME]=constants.BURN_TX,_a[constants.EXCHANGE_TX_NAME]=constants.EXCHANGE_TX,_a[constants.LEASE_TX_NAME]=constants.LEASE_TX,_a[constants.CANCEL_LEASING_TX_NAME]=constants.CANCEL_LEASING_TX,_a[constants.CREATE_ALIAS_TX_NAME]=constants.CREATE_ALIAS_TX,_a);exports.default={transactionType:function(typeName){return function(item){return item.type&&item.type===transactionTypes[typeName]}},transactionSender:function(sender){return function(item){return item.sender&&item.sender===sender}},transactionRecipient:function(recipient){return function(item){return item.recipient&&item.recipient===recipient}}};var _a},{"../../../constants":99}],78:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var logger_1=require("../../../utils/logger");function default_1(message){logger_1.default.warn("API v2 is experimental, please mind that");message&&logger_1.default.warn(message)}exports.default=default_1},{"../../../utils/logger":115}],79:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var schemas=require("./addresses.x");var constants=require("../../../constants");var Money_1=require("../../../classes/Money");var schemaTools_1=require("../../schemaTools");var addresses_1=require("../v1/addresses");var aliases_1=require("../v1/aliases");var assets_1=require("../v1/assets");var leasing_1=require("../v1/leasing");var transactions_1=require("../v1/transactions");var _combiners_1=require("./_combiners");var _filters_1=require("./_filters");var _warn_1=require("./_warn");function getBalances(address,options){var wavesBalance=addresses_1.default.balanceDetails(address).then(function(data){return Money_1.default.fromCoins(String(data.available),constants.WAVES).then(function(amount){return[amount]})});var assetBalances=assets_1.default.balances(address).then(function(data){return schemas.assetBalancesSchema.parse(data).then(function(balances){return balances.sort(function(a,b){return a.asset.name>b.asset.name?1:-1})})});return Promise.all([wavesBalance,assetBalances]).then(function(_a){var waves=_a[0],assets=_a[1];var array=waves.concat(assets);if(options.assets){return _combiners_1.default.balanceListByAssets(array,options.assets)}else{return array}})}exports.default={get:function(address){_warn_1.default();var balanceDetails=addresses_1.default.balanceDetails(address).then(function(data){return schemas.detailedWavesBalanceSchema.parse(data)});var aliasesByAddress=aliases_1.default.byAddress(address).then(function(data){return schemas.aliasesByAddressSchema.parse(data)});return Promise.all([balanceDetails,aliasesByAddress]).then(function(_a){var wavesBalance=_a[0],aliases=_a[1];return{wavesBalance:wavesBalance,aliases:aliases}})},balance:function(address,asset){_warn_1.default();return getBalances(address,{assets:[asset]}).then(function(array){return array[0]})},balances:function(address,options){if(options===void 0){options={}}_warn_1.default();return getBalances(address,options)},transactions:function(address,options){if(options===void 0){options={}}_warn_1.default("This method is currently able to return only 1000 last transactions");if(options.limit===0){options.limit=2e3}return transactions_1.default.getList(address,options.limit).then(function(array){if(options.type){array=array.filter(_filters_1.default.transactionType(options.type))}if(options.sender){array=array.filter(_filters_1.default.transactionSender(options.sender))}if(options.recipient){array=array.filter(_filters_1.default.transactionRecipient(options.recipient))}return Promise.all(array.map(schemaTools_1.siftTransaction))})},utxTransactions:function(address){_warn_1.default("This method may be switched off on the side of the Node");return transactions_1.default.utxGetList().then(function(array){var filteredArray=array.filter(function(item){return item.sender===address||item.recipient===address});return Promise.all(filteredArray.map(schemaTools_1.siftTransaction))})},aliasList:function(address){return aliases_1.default.byAddress(address).then(function(data){return schemas.aliasesByAddressSchema.parse(data)})},activeLeaseTransactions:function(address){return leasing_1.default.getAllActiveLeases(address).then(function(list){return Promise.all(list.map(schemaTools_1.siftTransaction))})}}},{"../../../classes/Money":94,"../../../constants":99,"../../schemaTools":90,"../v1/addresses":67,"../v1/aliases":68,"../v1/assets":70,"../v1/leasing":73,"../v1/transactions":75,"./_combiners":76,"./_filters":77,"./_warn":78,"./addresses.x":80}],80:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var schema_MoneyPart_1=require("../../schema.MoneyPart");var constants=require("../../../constants");var remap_1=require("../../../utils/remap");var schemaTemporaryTools_1=require("../../schemaTemporaryTools");exports.detailedWavesBalanceSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{regular:{type:schema_MoneyPart_1.MoneyPart,assetId:constants.WAVES,parseValue:schemaTemporaryTools_1.stringConversion},available:{type:schema_MoneyPart_1.MoneyPart,assetId:constants.WAVES,parseValue:schemaTemporaryTools_1.stringConversion},effective:{type:schema_MoneyPart_1.MoneyPart,assetId:constants.WAVES,parseValue:schemaTemporaryTools_1.stringConversion},generating:{type:schema_MoneyPart_1.MoneyPart,assetId:constants.WAVES,parseValue:schemaTemporaryTools_1.stringConversion},leasedOut:{type:schema_MoneyPart_1.MoneyPart,assetId:constants.WAVES,path:null,parseValue:function(o){return schemaTemporaryTools_1.stringConversion(o.regular-o.available)}},leasedIn:{type:schema_MoneyPart_1.MoneyPart,assetId:constants.WAVES,path:null,parseValue:function(o){return schemaTemporaryTools_1.stringConversion(o.effective-o.available)}}}});exports.aliasesByAddressSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ArrayPart,required:true,content:{type:ts_api_validator_1.StringPart,parseValue:remap_1.removeAliasPrefix}});exports.assetBalancesSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ArrayPart,required:true,path:"balances",content:{type:schema_MoneyPart_1.MoneyPart,required:true,path:"balance",assetIdPath:"assetId",parseValue:schemaTemporaryTools_1.stringConversion}})},{"../../../constants":99,"../../../utils/remap":116,"../../schema.MoneyPart":85,"../../schemaTemporaryTools":89,"ts-api-validator":40}],81:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var aliases_1=require("../v1/aliases");var schemas=require("./aliases.x");exports.default={getAddress:function(alias){return aliases_1.default.byAlias(alias).then(function(data){return schemas.aliasAddressSchema.parse(data)})}}},{"../v1/aliases":68,"./aliases.x":82}],82:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");exports.aliasAddressSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:{address:{type:ts_api_validator_1.StringPart,required:true}}})},{"ts-api-validator":40}],83:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var transactions_1=require("../v1/transactions");var schemaTools_1=require("../../schemaTools");var constants_1=require("../../../constants");function extendTransaction(transaction){if(transaction.transactionType===constants_1.CANCEL_LEASING_TX_NAME){return transactions_1.default.get(transaction.leaseTransactionId).then(schemaTools_1.siftTransaction).then(function(leaseTransaction){transaction.leaseTransactionAmount=leaseTransaction.amount;return transaction})}else{return transaction}}exports.default={get:function(id){if(id===constants_1.WAVES){return schemaTools_1.siftTransaction(constants_1.WAVES_V1_ISSUE_TX)}else{return transactions_1.default.get(id).then(schemaTools_1.siftTransaction).then(extendTransaction)}},utxGet:function(id){return transactions_1.default.utxGet(id).then(schemaTools_1.siftTransaction).then(extendTransaction)}}},{"../../../constants":99,"../../schemaTools":90,"../v1/transactions":75}],84:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var converters_1=require("../libs/converters");var base58_1=require("../libs/base58");var Base58Part=function(_super){__extends(Base58Part,_super);function Base58Part(){return _super!==null&&_super.apply(this,arguments)||this}Base58Part.prototype.getValue=function(value){if(value===void 0){value=""}var bytes=base58_1.default.decode(value);try{return converters_1.default.byteArrayToString(bytes)}catch(e){return null}};return Base58Part}(ts_api_validator_1.BasePart);exports.Base58Part=Base58Part},{"../libs/base58":103,"../libs/converters":106,"ts-api-validator":40}],85:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var ts_utils_1=require("ts-utils");var remap_1=require("../utils/remap");var Money_1=require("../classes/Money");var MoneyPart=function(_super){__extends(MoneyPart,_super);function MoneyPart(){return _super!==null&&_super.apply(this,arguments)||this}MoneyPart.prototype.process=function(data,roots){this._data=data;return _super.prototype.process.call(this,data,roots)};MoneyPart.prototype.getValue=function(value,roots){if(value&&Money_1.default.isMoney(value)){return value}else if(typeof value==="string"){if(this.options.assetId||this.options.assetId===""){return Money_1.default.fromCoins(value,remap_1.denormalizeAssetId(this.options.assetId))}else if(this.options.assetIdPath){var nthParent=this.options.nthParent;var root=nthParent?roots[roots.length-nthParent]:this._data;var id=ts_utils_1.get(root,this.options.assetIdPath);return Money_1.default.fromCoins(value,remap_1.denormalizeAssetId(id))}else{return null}}else{return null}};return MoneyPart}(ts_api_validator_1.BasePart);exports.MoneyPart=MoneyPart},{"../classes/Money":94,"../utils/remap":116,"ts-api-validator":40,"ts-utils":51}],86:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var ts_utils_1=require("ts-utils");var remap_1=require("../utils/remap");var OrderPrice_1=require("../classes/OrderPrice");var OrderPricePart=function(_super){__extends(OrderPricePart,_super);function OrderPricePart(){return _super!==null&&_super.apply(this,arguments)||this}OrderPricePart.prototype.process=function(data,roots){this._data=data;return _super.prototype.process.call(this,data,roots)};OrderPricePart.prototype.getValue=function(value){if(value&&OrderPrice_1.default.isOrderPrice(value)){return value}else if(typeof value==="string"){var amountAssetId=void 0;if(typeof this.options.amountAssetId==="string"){amountAssetId=remap_1.denormalizeAssetId(this.options.amountAssetId)}else if(this.options.amountAssetIdPath){amountAssetId=remap_1.denormalizeAssetId(ts_utils_1.get(this._data,this.options.amountAssetIdPath))}var priceAssetId=void 0;if(typeof this.options.priceAssetId==="string"){priceAssetId=remap_1.denormalizeAssetId(this.options.priceAssetId)}else if(this.options.priceAssetIdPath){priceAssetId=remap_1.denormalizeAssetId(ts_utils_1.get(this._data,this.options.priceAssetIdPath))}if(!amountAssetId||!priceAssetId){return null}else{return OrderPrice_1.default.fromMatcherCoins(value,amountAssetId,priceAssetId)}}else{return null}};return OrderPricePart}(ts_api_validator_1.BasePart);exports.OrderPricePart=OrderPricePart},{"../classes/OrderPrice":95,"../utils/remap":116,"ts-api-validator":40,"ts-utils":51}],87:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var schema_Base58Part_1=require("./schema.Base58Part");var schema_MoneyPart_1=require("./schema.MoneyPart");var schema_OrderPricePart_1=require("./schema.OrderPricePart");var constants=require("../constants");var remap_1=require("../utils/remap");var schemaTemporaryTools_1=require("./schemaTemporaryTools");var getTxCommonFields=function(typeName,wavesFeeOnly){return{transactionType:{type:ts_api_validator_1.StringPart,defaultValue:typeName},id:{type:ts_api_validator_1.StringPart,required:true},senderPublicKey:{type:ts_api_validator_1.StringPart,required:true},sender:{type:ts_api_validator_1.StringPart,required:true},fee:wavesFeeOnly?{type:schema_MoneyPart_1.MoneyPart,required:true,assetId:"",parseValue:schemaTemporaryTools_1.stringConversion}:{type:schema_MoneyPart_1.MoneyPart,required:true,assetIdPath:"feeAsset",parseValue:schemaTemporaryTools_1.stringConversion},height:{type:ts_api_validator_1.NumberPart},timestamp:{type:ts_api_validator_1.DatePart,required:true},signature:{type:ts_api_validator_1.StringPart},proofs:{type:ts_api_validator_1.ArrayPart,content:{type:ts_api_validator_1.StringPart,required:true}}}};var getTxRecipient=function(){return{type:ts_api_validator_1.StringPart,required:true,parseValue:remap_1.removeAliasPrefix}};var getTxRecipientAddress=function(){return{type:ts_api_validator_1.StringPart,required:true,parseValue:schemaTemporaryTools_1.stub("string")}};var getTxAssetId=function(path){return{type:ts_api_validator_1.StringPart,required:true,path:path,parseValue:function(d){return d?d:constants.WAVES}}};var getTxAssetName=function(){return{type:ts_api_validator_1.StringPart,required:true}};var getTxAssetDescription=function(){return{type:ts_api_validator_1.StringPart,required:true}};var getTxAssetPrecision=function(){return{type:ts_api_validator_1.NumberPart,required:true,path:"decimals"}};var getTxAssetTotalAmount=function(path,assetIdPath){return{type:schema_MoneyPart_1.MoneyPart,required:true,path:path,assetIdPath:assetIdPath,parseValue:schemaTemporaryTools_1.stringConversion}};var getTxAssetReissuable=function(){return{type:ts_api_validator_1.BooleanPart,required:true}};var getTxAmount=function(assetIdPath,nthParent){return{type:schema_MoneyPart_1.MoneyPart,required:true,assetIdPath:assetIdPath,nthParent:nthParent||null,parseValue:schemaTemporaryTools_1.stringConversion}};var getTxWavesAmount=function(){return{type:schema_MoneyPart_1.MoneyPart,required:true,assetId:"",parseValue:schemaTemporaryTools_1.stringConversion}};var getTxPrice=function(amountAssetIdPath,priceAssetIdPath){return{type:schema_OrderPricePart_1.OrderPricePart,required:true,amountAssetIdPath:amountAssetIdPath,priceAssetIdPath:priceAssetIdPath,parseValue:schemaTemporaryTools_1.stringConversion}};var getTxWavesFee=function(path){return{type:schema_MoneyPart_1.MoneyPart,required:true,path:path,assetId:"",parseValue:schemaTemporaryTools_1.stringConversion}};var getTxAttachment=function(){return{type:schema_Base58Part_1.Base58Part,defaultValue:""}};var getTxRawAttachment=function(path){return{type:ts_api_validator_1.StringPart,defaultValue:"",path:path}};var getTxLeaseTransactionId=function(path){return{type:ts_api_validator_1.StringPart,required:true,path:path}};var getTxIsActiveLeasing=function(){return{type:ts_api_validator_1.BooleanPart,required:true,path:"status",parseValue:function(s){return s==="active"}}};var getTxAlias=function(){return{type:ts_api_validator_1.StringPart,required:true,parseValue:remap_1.removeAliasPrefix}};var getTxTransfers=function(){return{type:ts_api_validator_1.ArrayPart,required:true,content:{type:ts_api_validator_1.ObjectPart,required:true,content:{recipient:getTxRecipient(),amount:getTxAmount("assetId",1)}}}};var getTxOrder=function(path){return{type:ts_api_validator_1.ObjectPart,required:true,path:path,content:{id:{type:ts_api_validator_1.StringPart,required:true},type:{type:ts_api_validator_1.StringPart,required:true,path:path+".orderType"},senderPublicKey:{type:ts_api_validator_1.StringPart,required:true},sender:{type:ts_api_validator_1.StringPart,required:true,parseValue:schemaTemporaryTools_1.stub("string")},matcherPublicKey:{type:ts_api_validator_1.StringPart,required:true},amountAsset:getTxAssetId(path+".assetPair.amountAsset"),amount:getTxAmount(path+".assetPair.amountAsset"),priceAsset:getTxAssetId(path+".assetPair.priceAsset"),price:getTxPrice(path+".assetPair.amountAsset",path+".assetPair.priceAsset"),matcherFee:getTxWavesFee()}}};exports.issueTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.ISSUE_TX_NAME,true),{assetId:getTxAssetId(),name:getTxAssetName(),description:getTxAssetDescription(),precision:getTxAssetPrecision(),quantity:getTxAssetTotalAmount("quantity","assetId"),reissuable:getTxAssetReissuable()})});exports.transferTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.TRANSFER_TX_NAME,false),{recipient:getTxRecipient(),recipientAddress:getTxRecipientAddress(),attachment:getTxAttachment(),rawAttachment:getTxRawAttachment("attachment"),assetId:getTxAssetId(),amount:getTxAmount("assetId"),feeAssetId:getTxAssetId("feeAsset")})});exports.reissueTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.REISSUE_TX_NAME,true),{assetId:getTxAssetId(),quantity:getTxAssetTotalAmount("quantity","assetId"),reissuable:getTxAssetReissuable()})});exports.burnTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.BURN_TX_NAME,true),{assetId:getTxAssetId(),quantity:getTxAssetTotalAmount("amount","assetId")})});exports.exchangeTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.EXCHANGE_TX_NAME,true),{amountAsset:getTxAssetId("order1.assetPair.amountAsset"),amount:getTxAmount("order1.assetPair.amountAsset"),priceAsset:getTxAssetId("order1.assetPair.priceAsset"),price:getTxPrice("order1.assetPair.amountAsset","order1.assetPair.priceAsset"),buyOrder:getTxOrder("order1"),buyMatcherFee:getTxWavesFee(),sellOrder:getTxOrder("order2"),sellMatcherFee:getTxWavesFee()})});exports.leaseTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.LEASE_TX_NAME,true),{recipient:getTxRecipient(),recipientAddress:getTxRecipientAddress(),amount:getTxWavesAmount(),isActive:getTxIsActiveLeasing()})});exports.cancelLeasingTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.CANCEL_LEASING_TX_NAME,true),{leaseTransactionId:getTxLeaseTransactionId("leaseId")})});exports.createAliasTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.CREATE_ALIAS_TX_NAME,true),{alias:getTxAlias()})});exports.massTransferTransactionSchema=new ts_api_validator_1.Schema({type:ts_api_validator_1.ObjectPart,required:true,content:__assign({},getTxCommonFields(constants.MASS_TRANSFER_TX_NAME,true),{assetId:getTxAssetId(),attachment:getTxAttachment(),rawAttachment:getTxRawAttachment("attachment"),transfers:getTxTransfers()})})},{"../constants":99,"../utils/remap":116,"./schema.Base58Part":84,"./schema.MoneyPart":85,"./schema.OrderPricePart":86,"./schemaTemporaryTools":89,"ts-api-validator":40}],88:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ts_api_validator_1=require("ts-api-validator");var remap_1=require("../utils/remap");var constants=require("../constants");exports.default={publicKey:{type:ts_api_validator_1.StringPart,required:true},assetId:{type:ts_api_validator_1.StringPart,required:true},fee:{type:ts_api_validator_1.NumberPart,required:false,defaultValue:constants.MINIMUM_FEE},issueFee:{type:ts_api_validator_1.NumberPart,required:false,defaultValue:constants.MINIMUM_ISSUE_FEE},matcherFee:{type:ts_api_validator_1.NumberPart,required:false,defaultValue:constants.MINIMUM_MATCHER_FEE},recipient:{type:ts_api_validator_1.StringPart,required:true,parseValue:remap_1.removeRecipientPrefix},reissuable:{type:ts_api_validator_1.BooleanPart,required:false,defaultValue:false},timestamp:{type:ts_api_validator_1.NumberPart,required:true,parseValue:remap_1.getTimestamp}}},{"../constants":99,"../utils/remap":116,"ts-api-validator":40}],89:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function stub(partType){if(partType==="string"){return function(){return"[recipient address will be here when the API v2 is implemented]"}}else if(partType==="number"){return function(){return-1}}else{throw new Error('No stub for the "'+partType+'" type of part')}}exports.stub=stub;function stringConversion(n){var type=typeof n;switch(type){case"number":return String(n);case"string":return n;default:return null}}exports.stringConversion=stringConversion},{}],90:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var constants=require("../constants");var txSchemas=require("./schema.transactions");function siftTransaction(tx){switch(tx.type){case constants.ISSUE_TX:return txSchemas.issueTransactionSchema.parse(tx);case constants.TRANSFER_TX:return txSchemas.transferTransactionSchema.parse(tx);case constants.REISSUE_TX:return txSchemas.reissueTransactionSchema.parse(tx);case constants.BURN_TX:return txSchemas.burnTransactionSchema.parse(tx);case constants.EXCHANGE_TX:return txSchemas.exchangeTransactionSchema.parse(tx);case constants.LEASE_TX:return txSchemas.leaseTransactionSchema.parse(tx);case constants.CANCEL_LEASING_TX:return txSchemas.cancelLeasingTransactionSchema.parse(tx);case constants.CREATE_ALIAS_TX:return txSchemas.createAliasTransactionSchema.parse(tx);case constants.MASS_TRANSFER_TX:return txSchemas.massTransferTransactionSchema.parse(tx);default:return Promise.resolve({type:"unknown",originalTx:tx})}}exports.siftTransaction=siftTransaction},{"../constants":99,"./schema.transactions":87}],91:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var storage_1=require("../utils/storage");var constants_1=require("../constants");var config_1=require("../config");var index_1=require("../api/node/index");function getAssetProps(id){return index_1.v1.transactions.get(id).then(function(assetTransaction){return{id:id,name:assetTransaction.name,precision:assetTransaction.decimals,description:assetTransaction.description||""}})}function checkAssetProps(props){if(!props.id){throw new Error("An attempt to create Asset without ID")}if(!props.name){throw new Error("An attempt to create Asset without a name")}if(typeof props.precision!=="number"||props.precision<0||props.precision>8){throw new Error("An attempt to create Asset with wrong precision ("+props.precision+")")}}var Asset=function(){function Asset(props){this.id=props.id;this.name=props.name;this.precision=props.precision;this.description=props.description||""}Asset.prototype.toJSON=function(){return{id:this.id,name:this.name,precision:this.precision,description:this.description}};Asset.prototype.toString=function(){return this.id};Asset.get=function(input){if(Asset.isAsset(input)){return Promise.resolve(input)}else if(typeof input==="string"){var id_1=input;return Asset._storage.get(id_1).then(function(asset){return asset||getAssetProps(id_1).then(function(props){return Asset._factory(props)}).then(function(newAsset){return Asset._storage.set(newAsset.id,newAsset)})})}else{var props_1=input;return Asset._storage.get(props_1.id).then(function(asset){return asset||Asset._factory(props_1).then(function(newAsset){return Asset._storage.set(newAsset.id,newAsset)})})}};Asset.getKnownAssets=function(){return Asset._storage.getAll()};Asset.getKnownAssetsList=function(){return Asset._storage.getList()};Asset.clearCache=function(){return Asset._storage.clear()};Asset.isAsset=function(object){return object instanceof Asset};Asset._factory=function(props){checkAssetProps(props);var factory=config_1.default.getAssetFactory()||Asset._defaultFactory;return factory(props).then(function(asset){if(!Asset.isAsset(asset)){throw new Error("Factory provided an object which is not a heir of Asset")}return asset})};Asset._defaultFactory=function(props){var asset=new Asset(props);return Promise.resolve(asset)};Asset._storage=storage_1.getStorage(function(set){return Asset._factory(constants_1.WAVES_PROPS).then(function(wavesAsset){set(wavesAsset.id,wavesAsset)})});return Asset}();exports.default=Asset},{"../api/node/index":66,"../config":98,"../constants":99,"../utils/storage":118}],92:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var index_1=require("../api/matcher/index");var storage_1=require("../utils/storage");var Asset_1=require("./Asset");function getAssetIds(assetOne,assetTwo){assetOne=Asset_1.default.isAsset(assetOne)?assetOne.id:assetOne;assetTwo=Asset_1.default.isAsset(assetTwo)?assetTwo.id:assetTwo;return[assetOne,assetTwo]}function getKey(part1,part2){var parts=[part1,part2].sort();return parts[0]+"_"+parts[1]}function getMatcherPairOrder(assetOne,assetTwo){return index_1.v1.getOrderbook(assetOne,assetTwo).then(function(orderbook){return{amountAssetId:orderbook.pair.amountAsset,priceAssetId:orderbook.pair.priceAsset}})}var AssetPair=function(){function AssetPair(amountAsset,priceAsset){this.amountAsset=amountAsset;this.priceAsset=priceAsset;this.precisionDifference=priceAsset.precision-amountAsset.precision}AssetPair.prototype.toJSON=function(){return{amountAsset:this.amountAsset.id,priceAsset:this.priceAsset.id}};AssetPair.prototype.toString=function(){return this.amountAsset+"/"+this.priceAsset};return AssetPair}();var storage=storage_1.getStorage();exports.default={get:function(assetOne,assetTwo){var _a=getAssetIds(assetOne,assetTwo),assetOneId=_a[0],assetTwoId=_a[1];var key=getKey(assetOneId,assetTwoId);return storage.get(key).then(function(pair){if(pair){return pair}else{return getMatcherPairOrder(assetOneId,assetTwoId).then(function(matcherPair){return Promise.all([Asset_1.default.get(matcherPair.amountAssetId),Asset_1.default.get(matcherPair.priceAssetId)])}).then(function(assets){var newPair=new AssetPair(assets[0],assets[1]);return storage.set(key,newPair)})}})},clearCache:function(){return storage.clear()},isAssetPair:function(object){return object instanceof AssetPair}}},{"../api/matcher/index":62,"../utils/storage":118,"./Asset":91}],93:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var base58_1=require("../libs/base58");var convert_1=require("../utils/convert");var concat_1=require("../utils/concat");var constants=require("../constants");var config_1=require("../config");function blockchainifyAssetId(assetId){if(!assetId)throw new Error("Asset ID should not be empty");return assetId===constants.WAVES?"":assetId}function getAliasBytes(alias){var aliasBytes=convert_1.default.stringToByteArrayWithSize(alias);return[constants.ALIAS_VERSION,config_1.default.getNetworkByte()].concat(aliasBytes)}var ByteProcessor=function(){function ByteProcessor(name){this.name=name}return ByteProcessor}();exports.ByteProcessor=ByteProcessor;var Base58=function(_super){__extends(Base58,_super);function Base58(){return _super!==null&&_super.apply(this,arguments)||this}Base58.prototype.process=function(value){var bytes=base58_1.default.decode(value);return Promise.resolve(bytes)};return Base58}(ByteProcessor);exports.Base58=Base58;var Bool=function(_super){__extends(Bool,_super);function Bool(){return _super!==null&&_super.apply(this,arguments)||this}Bool.prototype.process=function(value){var bytes=convert_1.default.booleanToBytes(value);return Promise.resolve(Uint8Array.from(bytes))};return Bool}(ByteProcessor);exports.Bool=Bool;var Byte=function(_super){__extends(Byte,_super);function Byte(){return _super!==null&&_super.apply(this,arguments)||this}Byte.prototype.process=function(value){if(typeof value!=="number")throw new Error("You should pass a number to Byte constructor");if(value<0||value>255)throw new Error("Byte value must fit between 0 and 255");return Promise.resolve(Uint8Array.from([value]))};return Byte}(ByteProcessor);exports.Byte=Byte;var Long=function(_super){__extends(Long,_super);function Long(){return _super!==null&&_super.apply(this,arguments)||this}Long.prototype.process=function(value){var bytes=convert_1.default.longToByteArray(value);return Promise.resolve(Uint8Array.from(bytes))};return Long}(ByteProcessor);exports.Long=Long;var StringWithLength=function(_super){__extends(StringWithLength,_super);function StringWithLength(){return _super!==null&&_super.apply(this,arguments)||this}StringWithLength.prototype.process=function(value){var bytesWithLength=convert_1.default.stringToByteArrayWithSize(value);return Promise.resolve(Uint8Array.from(bytesWithLength))};return StringWithLength}(ByteProcessor);exports.StringWithLength=StringWithLength;var Alias=function(_super){__extends(Alias,_super);function Alias(){return _super!==null&&_super.apply(this,arguments)||this}Alias.prototype.process=function(value){var aliasBytes=getAliasBytes(value);var aliasBytesWithLength=convert_1.default.bytesToByteArrayWithSize(aliasBytes);return Promise.resolve(Uint8Array.from(aliasBytesWithLength))};return Alias}(ByteProcessor);exports.Alias=Alias;var AssetId=function(_super){__extends(AssetId,_super);function AssetId(){return _super!==null&&_super.apply(this,arguments)||this}AssetId.prototype.process=function(value){value=blockchainifyAssetId(value);var bytes=value?concat_1.concatUint8Arrays(Uint8Array.from([1]),base58_1.default.decode(value)):Uint8Array.from([0]);return Promise.resolve(bytes)};return AssetId}(ByteProcessor);exports.AssetId=AssetId;var Attachment=function(_super){__extends(Attachment,_super);function Attachment(){return _super!==null&&_super.apply(this,arguments)||this}Attachment.prototype.process=function(value){if(typeof value==="string"){value=Uint8Array.from(convert_1.default.stringToByteArray(value))}if(value.length>constants.TRANSFER_ATTACHMENT_BYTE_LIMIT){throw new Error("Maximum attachment length is exceeded")}var valueWithLength=convert_1.default.bytesToByteArrayWithSize(value);return Promise.resolve(Uint8Array.from(valueWithLength))};return Attachment}(ByteProcessor);exports.Attachment=Attachment;var MandatoryAssetId=function(_super){__extends(MandatoryAssetId,_super);function MandatoryAssetId(){return _super!==null&&_super.apply(this,arguments)||this}MandatoryAssetId.prototype.process=function(value){value=blockchainifyAssetId(value);return Promise.resolve(base58_1.default.decode(value))};return MandatoryAssetId}(ByteProcessor);exports.MandatoryAssetId=MandatoryAssetId;var OrderType=function(_super){__extends(OrderType,_super);function OrderType(){return _super!==null&&_super.apply(this,arguments)||this}OrderType.prototype.process=function(value){if(value==="buy"){return Bool.prototype.process.call(this,false)}else if(value==="sell"){return Bool.prototype.process.call(this,true)}else{throw new Error('There are no other order types besides "buy" and "sell"')}};return OrderType}(ByteProcessor);exports.OrderType=OrderType;var Recipient=function(_super){__extends(Recipient,_super);function Recipient(){return _super!==null&&_super.apply(this,arguments)||this}Recipient.prototype.process=function(value){if(value.length<=30){var aliasBytes=getAliasBytes(value);return Promise.resolve(Uint8Array.from(aliasBytes))}else{var addressBytes=base58_1.default.decode(value);return Promise.resolve(Uint8Array.from(addressBytes))}};return Recipient}(ByteProcessor);exports.Recipient=Recipient},{"../config":98,"../constants":99,"../libs/base58":103,"../utils/concat":112,"../utils/convert":113}],94:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var bignumber_1=require("../libs/bignumber");var Asset_1=require("./Asset");var Money=function(){function Money(coins,asset){var divider=Money._getDivider(asset.precision);this.asset=asset;this._coins=new bignumber_1.default(coins);this._tokens=this._coins.div(divider)}Money.prototype.getCoins=function(){return this._coins.add(0)};Money.prototype.getTokens=function(){return this._tokens.add(0)};Money.prototype.toCoins=function(){return this._coins.toFixed(0)};Money.prototype.toTokens=function(){return this._tokens.toFixed(this.asset.precision)};Money.prototype.toFormat=function(){return this._tokens.toFormat(this.asset.precision)};Money.prototype.add=function(money){this._matchAssets(money);var inputCoins=money.getCoins();var result=this._coins.add(inputCoins);return new Money(result,this.asset)};Money.prototype.plus=function(money){return this.add(money)};Money.prototype.sub=function(money){this._matchAssets(money);var inputCoins=money.getCoins();var result=this._coins.sub(inputCoins);return new Money(result,this.asset)};Money.prototype.minus=function(money){return this.sub(money)};Money.prototype.eq=function(money){this._matchAssets(money);return this._coins.eq(money.getCoins())};Money.prototype.lt=function(money){this._matchAssets(money);return this._coins.lt(money.getCoins())};Money.prototype.lte=function(money){this._matchAssets(money);return this._coins.lte(money.getCoins())};Money.prototype.gt=function(money){this._matchAssets(money);return this._coins.gt(money.getCoins())};Money.prototype.gte=function(money){this._matchAssets(money);return this._coins.gte(money.getCoins())};Money.prototype.cloneWithCoins=function(coins){Money._checkAmount(coins);return new Money(coins,this.asset)};Money.prototype.cloneWithTokens=function(tokens){Money._checkAmount(tokens);var coins=Money._tokensToCoins(tokens,this.asset.precision);return new Money(coins,this.asset)};Money.prototype.convertTo=function(asset,exchangeRate){return Money.convert(this,asset,exchangeRate)};Money.prototype.toJSON=function(){return{assetId:this.asset.id,tokens:this.toTokens()}};Money.prototype.toString=function(){return this.toTokens()+" "+this.asset.id};Money.prototype._matchAssets=function(money){if(this.asset.id!==money.asset.id){throw new Error("You cannot apply arithmetic operations to Money created with different assets")}};Money.fromCoins=function(coins,supposedAsset){Money._checkAmount(coins);return Asset_1.default.get(supposedAsset).then(function(asset){return new Money(coins,asset)})};Money.fromTokens=function(tokens,supposedAsset){Money._checkAmount(tokens);return Asset_1.default.get(supposedAsset).then(function(asset){var coins=Money._tokensToCoins(tokens,asset.precision);return new Money(coins,asset)})};Money.convert=function(money,asset,exchangeRate){if(money.asset===asset){return money}else{var difference=money.asset.precision-asset.precision;var divider=new bignumber_1.default(10).pow(difference);var coins=money.getCoins();var result=coins.mul(exchangeRate).div(divider);return new Money(result,asset)}};Money.isMoney=function(object){return object instanceof Money};Money._checkAmount=function(amount){if(!(typeof amount==="string"||amount instanceof bignumber_1.default)){throw new Error("Please use strings to create instances of Money")}};Money._tokensToCoins=function(tokens,precision){var divider=Money._getDivider(precision);tokens=new bignumber_1.default(tokens).toFixed(precision);return new bignumber_1.default(tokens).mul(divider)};Money._getDivider=function(precision){return new bignumber_1.default(10).pow(precision)};return Money}();exports.default=Money},{"../libs/bignumber":104,"./Asset":91}],95:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var bignumber_1=require("../libs/bignumber");var AssetPair_1=require("./AssetPair");var OrderPrice=function(){function OrderPrice(coins,pair){var divider=OrderPrice._getMatcherDivider(pair.precisionDifference);this.pair=pair;this._matcherCoins=new bignumber_1.default(coins);this._tokens=this._matcherCoins.div(divider)}OrderPrice.prototype.getMatcherCoins=function(){return this._matcherCoins.add(0)};OrderPrice.prototype.getTokens=function(){return this._tokens.add(0)};OrderPrice.prototype.toMatcherCoins=function(){return this._matcherCoins.toFixed(0)};OrderPrice.prototype.toTokens=function(){return this._tokens.toFixed(this.pair.priceAsset.precision)};OrderPrice.prototype.toFormat=function(){return this._tokens.toFormat(this.pair.priceAsset.precision)};OrderPrice.prototype.toJSON=function(){return{amountAssetId:this.pair.amountAsset.id,priceAssetId:this.pair.priceAsset.id,priceTokens:this.toTokens()}};OrderPrice.prototype.toString=function(){return this.toTokens()+" "+this.pair.amountAsset.id+"/"+this.pair.priceAsset.id};OrderPrice.fromTokens=function(tokens,pair,secondAsset){OrderPrice._checkAmount(tokens);return OrderPrice._getPair(pair,secondAsset).then(function(p){tokens=new bignumber_1.default(tokens).toFixed(p.priceAsset.precision);var divider=OrderPrice._getMatcherDivider(p.precisionDifference);var coins=new bignumber_1.default(tokens).mul(divider);return new OrderPrice(coins,p)})};OrderPrice.fromMatcherCoins=function(coins,pair,secondAsset){OrderPrice._checkAmount(coins);return OrderPrice._getPair(pair,secondAsset).then(function(p){return new OrderPrice(coins,p)})};OrderPrice.isOrderPrice=function(object){return object instanceof OrderPrice};OrderPrice._checkAmount=function(amount){if(!(typeof amount==="string"||amount instanceof bignumber_1.default)){throw new Error("Please use strings to create instances of OrderPrice")}};OrderPrice._getPair=function(pair,secondAsset){if(AssetPair_1.default.isAssetPair(pair)){return Promise.resolve(pair)}else if(pair&&secondAsset){return AssetPair_1.default.get(pair,secondAsset)}else{throw new Error("Invalid data passed instead AssetPair")}};OrderPrice._getMatcherDivider=function(precision){return new bignumber_1.default(10).pow(precision).mul(OrderPrice._MATCHER_SCALE)};OrderPrice._MATCHER_SCALE=new bignumber_1.default(10).pow(8);return OrderPrice}();exports.default=OrderPrice},{"../libs/bignumber":104,"./AssetPair":92}],96:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var base58_1=require("../libs/base58");var crypto_1=require("../utils/crypto");var logger_1=require("../utils/logger");var config_1=require("../config");var seedDictionary_1=require("../seedDictionary");function generateNewSeed(length){var random=crypto_1.default.generateRandomUint32Array(length);var wordCount=seedDictionary_1.default.length;var phrase=[];for(var i=0;i<length;i++){var wordIndex=random[i]%wordCount;phrase.push(seedDictionary_1.default[wordIndex])}random.set(new Uint8Array(random.length));return phrase.join(" ")}function encryptSeedPhrase(seedPhrase,password,encryptionRounds){if(encryptionRounds===void 0){encryptionRounds=5e3}if(password&&password.length<8){logger_1.default.warn("Your password may be too weak")}if(encryptionRounds<1e3){logger_1.default.warn("Encryption rounds may be too few")}if(seedPhrase.length<config_1.default.getMinimumSeedLength()){throw new Error("The seed phrase you are trying to encrypt is too short")}return crypto_1.default.encryptSeed(seedPhrase,password,encryptionRounds)}function decryptSeedPhrase(encryptedSeedPhrase,password,encryptionRounds){if(encryptionRounds===void 0){encryptionRounds=5e3}var wrongPasswordMessage="The password is wrong";var phrase;try{phrase=crypto_1.default.decryptSeed(encryptedSeedPhrase,password,encryptionRounds)}catch(e){throw new Error(wrongPasswordMessage)}if(phrase===""||phrase.length<config_1.default.getMinimumSeedLength()){throw new Error(wrongPasswordMessage)}return phrase}var Seed=function(){function Seed(phrase){var keys=crypto_1.default.buildKeyPair(phrase);this.phrase=phrase;this.address=crypto_1.default.buildRawAddress(keys.publicKey);this.keyPair={privateKey:base58_1.default.encode(keys.privateKey),publicKey:base58_1.default.encode(keys.publicKey)};Object.freeze(this);Object.freeze(this.keyPair)}Seed.prototype.encrypt=function(password,encryptionRounds){return encryptSeedPhrase(this.phrase,password,encryptionRounds)};return Seed}();exports.default={create:function(words){if(words===void 0){words=15}var phrase=generateNewSeed(words);var minimumSeedLength=config_1.default.getMinimumSeedLength();if(phrase.length<minimumSeedLength){throw new Error("The resulted seed length is less than the minimum length ("+minimumSeedLength+")")}return new Seed(phrase)},fromExistingPhrase:function(phrase){if(phrase.length<config_1.default.getMinimumSeedLength()){throw new Error("Your seed length is less than allowed in config")}return new Seed(phrase)},encryptSeedPhrase:encryptSeedPhrase,decryptSeedPhrase:decryptSeedPhrase}},{"../config":98,"../libs/base58":103,"../seedDictionary":110,"../utils/crypto":114,"../utils/logger":115}],97:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var ByteProcessor_1=require("./ByteProcessor");var concat_1=require("../utils/concat");var crypto_1=require("../utils/crypto");var base58_1=require("../libs/base58");var constants=require("../constants");var config_1=require("../config");function createTransactionClass(txType,fields,apiSchema){if(!fields||!fields.length){throw new Error("It is not possible to create TransactionClass without fields")}var storedFields=Object.create(null);var byteProviders=[];fields.forEach(function(field){if(field instanceof ByteProcessor_1.ByteProcessor){storedFields[field.name]=field;byteProviders.push(function(data){return field.process(data[field.name])})}else if(typeof field==="number"){byteProviders.push(Uint8Array.from([field]))}else{throw new Error("Invalid field is passed to the createTransactionClass function")}});var TransactionClass=function(){function TransactionClass(hashMap){if(hashMap===void 0){hashMap={}}var _this=this;this._rawData=Object.keys(storedFields).reduce(function(store,key){store[key]=hashMap[key];return store},{});this._dataHolders=byteProviders.map(function(provider){if(typeof provider==="function"){return provider(_this._rawData)}else{return provider}})}TransactionClass.prototype.prepareForAPI=function(privateKey){var _this=this;return this.getSignature(privateKey).then(function(signature){return _this._castToAPISchema(_this._rawData).then(function(schemedData){return __assign({},txType?{transactionType:txType}:{},schemedData,{signature:signature})})})};TransactionClass.prototype.getSignature=function(privateKey){return this.getBytes().then(function(dataBytes){return crypto_1.default.buildTransactionSignature(dataBytes,privateKey)})};TransactionClass.prototype.getBytes=function(){return Promise.all(this._dataHolders).then(function(multipleDataBytes){return concat_1.concatUint8Arrays.apply(void 0,multipleDataBytes)})};TransactionClass.prototype.getExactBytes=function(fieldName){if(!(fieldName in storedFields)){throw new Error("There is no field '"+fieldName+"' in '"+txType+" RequestDataType class")}var byteProcessor=storedFields[fieldName];var userData=this._rawData[fieldName];return byteProcessor.process(userData)};TransactionClass.prototype._castToAPISchema=function(data){var _this=this;if(!apiSchema)return Promise.resolve(__assign({},data));var transforms=Object.keys(apiSchema).map(function(key){var rule=apiSchema[key];if(rule.from==="bytes"&&rule.to==="base58"){return _this._castFromBytesToBase58(key)}if(rule.from==="raw"&&rule.to==="prefixed"){return _this._castFromRawToPrefixed(key)}});return Promise.all(transforms).then(function(schemedParts){return schemedParts.reduce(function(result,part){return __assign({},result,part)},__assign({},data))})};TransactionClass.prototype._castFromBytesToBase58=function(key){return this.getExactBytes(key).then(function(bytes){if(key==="attachment"){bytes=Uint8Array.from(Array.prototype.slice.call(bytes,2))}return _a={},_a[key]=base58_1.default.encode(bytes),_a;var _a})};TransactionClass.prototype._castFromRawToPrefixed=function(key){var type=key;if(type==="recipient"){type=this._rawData[key].length<=30?"alias":"address"}var prefix;if(type==="address"){prefix="address:"}else if(type==="alias"){var networkCharacter=String.fromCharCode(config_1.default.getNetworkByte());prefix="alias:"+networkCharacter+":"}else{throw new Error("There is no type '"+type+"' to be prefixed")}return Promise.resolve((_a={},_a[key]=prefix+this._rawData[key],_a));var _a};return TransactionClass}();return TransactionClass}exports.default={IssueTransaction:createTransactionClass(constants.ISSUE_TX_NAME,[constants.ISSUE_TX,new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.StringWithLength("name"),new ByteProcessor_1.StringWithLength("description"),new ByteProcessor_1.Long("quantity"),new ByteProcessor_1.Byte("precision"),new ByteProcessor_1.Bool("reissuable"),new ByteProcessor_1.Long("fee"),new ByteProcessor_1.Long("timestamp")]),TransferTransaction:createTransactionClass(constants.TRANSFER_TX_NAME,[constants.TRANSFER_TX,new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.AssetId("assetId"),new ByteProcessor_1.AssetId("feeAssetId"),new ByteProcessor_1.Long("timestamp"),new ByteProcessor_1.Long("amount"),new ByteProcessor_1.Long("fee"),new ByteProcessor_1.Recipient("recipient"),new ByteProcessor_1.Attachment("attachment")],{attachment:{from:"bytes",to:"base58"},recipient:{from:"raw",to:"prefixed"}}),ReissueTransaction:createTransactionClass(constants.REISSUE_TX_NAME,[constants.REISSUE_TX,new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.MandatoryAssetId("assetId"),new ByteProcessor_1.Long("quantity"),new ByteProcessor_1.Bool("reissuable"),new ByteProcessor_1.Long("fee"),new ByteProcessor_1.Long("timestamp")]),BurnTransaction:createTransactionClass(constants.BURN_TX_NAME,[constants.BURN_TX,new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.MandatoryAssetId("assetId"),new ByteProcessor_1.Long("quantity"),new ByteProcessor_1.Long("fee"),new ByteProcessor_1.Long("timestamp")]),LeaseTransaction:createTransactionClass(constants.LEASE_TX_NAME,[constants.LEASE_TX,new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.Recipient("recipient"),new ByteProcessor_1.Long("amount"),new ByteProcessor_1.Long("fee"),new ByteProcessor_1.Long("timestamp")],{recipient:{from:"raw",to:"prefixed"}}),CancelLeasingTransaction:createTransactionClass(constants.CANCEL_LEASING_TX_NAME,[constants.CANCEL_LEASING_TX,new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.Long("fee"),new ByteProcessor_1.Long("timestamp"),new ByteProcessor_1.Base58("transactionId")]),CreateAliasTransaction:createTransactionClass(constants.CREATE_ALIAS_TX_NAME,[constants.CREATE_ALIAS_TX,new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.Alias("alias"),new ByteProcessor_1.Long("fee"),new ByteProcessor_1.Long("timestamp")]),Order:createTransactionClass(null,[new ByteProcessor_1.Base58("senderPublicKey"),new ByteProcessor_1.Base58("matcherPublicKey"),new ByteProcessor_1.AssetId("amountAsset"),new ByteProcessor_1.AssetId("priceAsset"),new ByteProcessor_1.OrderType("orderType"),new ByteProcessor_1.Long("price"),new ByteProcessor_1.Long("amount"),new ByteProcessor_1.Long("timestamp"),new ByteProcessor_1.Long("expiration"),new ByteProcessor_1.Long("matcherFee")]),createSignableData:function(fields){return createTransactionClass(null,fields)}}},{"../config":98,"../constants":99,"../libs/base58":103,"../utils/concat":112,"../utils/crypto":114,"./ByteProcessor":93}],98:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var constants_1=require("./constants");var request_1=require("./utils/request");var config=Object.create(null);function checkRequiredFields(conf){if(!conf.networkByte)throw new Error("Missing network byte");if(!conf.nodeAddress)throw new Error("Missing node address");if(!conf.matcherAddress)throw new Error("Missing matcher address")}exports.default={getNetworkByte:function(){return config.networkByte},getNodeAddress:function(){return config.nodeAddress},getMatcherAddress:function(){return config.matcherAddress},getMinimumSeedLength:function(){return config.minimumSeedLength},getRequestParams:function(){return{offset:config.requestOffset,limit:config.requestLimit}},getAssetFactory:function(){return config.assetFactory},getLogLevel:function(){return config.logLevel},getTimeDiff:function(){return config.timeDiff},get:function(){return __assign({},config)},set:function(newConfig){if(Object.keys(config).length===0){newConfig=__assign({},constants_1.DEFAULT_BASIC_CONFIG,newConfig)}Object.keys(newConfig).forEach(function(key){switch(key){case"nodeAddress":case"matcherAddress":config[key]=request_1.normalizeHost(newConfig[key]);break;default:config[key]=newConfig[key];break}});checkRequiredFields(config)},clear:function(){Object.keys(config).forEach(function(key){delete config[key]})}}},{"./constants":99,"./utils/request":117}],99:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});exports.WAVES="WAVES";exports.WAVES_PROPS={id:exports.WAVES,name:"Waves",precision:8,description:""};exports.MAINNET_BYTE="W".charCodeAt(0);exports.TESTNET_BYTE="T".charCodeAt(0);exports.INITIAL_NONCE=0;exports.ADDRESS_VERSION=1;exports.ALIAS_VERSION=2;exports.ISSUE_TX=3;exports.TRANSFER_TX=4;exports.REISSUE_TX=5;exports.BURN_TX=6;exports.EXCHANGE_TX=7;exports.LEASE_TX=8;exports.CANCEL_LEASING_TX=9;exports.CREATE_ALIAS_TX=10;exports.MASS_TRANSFER_TX=11;exports.ISSUE_TX_NAME="issue";exports.TRANSFER_TX_NAME="transfer";exports.REISSUE_TX_NAME="reissue";exports.BURN_TX_NAME="burn";exports.EXCHANGE_TX_NAME="exchange";exports.LEASE_TX_NAME="lease";exports.CANCEL_LEASING_TX_NAME="cancelLeasing";exports.CREATE_ALIAS_TX_NAME="createAlias";exports.MASS_TRANSFER_TX_NAME="massTransfer";exports.PRIVATE_KEY_LENGTH=32;exports.PUBLIC_KEY_LENGTH=32;exports.MINIMUM_FEE=1e5;exports.MINIMUM_ISSUE_FEE=1e8;exports.MINIMUM_MATCHER_FEE=3e5;exports.TRANSFER_ATTACHMENT_BYTE_LIMIT=140;exports.DEFAULT_MIN_SEED_LENGTH=25;exports.DEFAULT_ORDER_EXPIRATION_DAYS=20;exports.DEFAULT_BASIC_CONFIG={minimumSeedLength:exports.DEFAULT_MIN_SEED_LENGTH,requestOffset:0,requestLimit:100,logLevel:"warning",timeDiff:0};exports.DEFAULT_MAINNET_CONFIG=__assign({},exports.DEFAULT_BASIC_CONFIG,{networkByte:exports.MAINNET_BYTE,nodeAddress:"https://nodes.wavesnodes.com",matcherAddress:"https://nodes.wavesnodes.com/matcher"});exports.DEFAULT_TESTNET_CONFIG=__assign({},exports.DEFAULT_BASIC_CONFIG,{networkByte:exports.TESTNET_BYTE,nodeAddress:"https://testnet1.wavesnodes.com",matcherAddress:"https://testnet1.wavesnodes.com/matcher"});exports.WAVES_V1_ISSUE_TX={assetId:exports.WAVES,decimals:8,description:"",fee:0,height:0,id:exports.WAVES,name:"Waves",quantity:1e8*Math.pow(10,8),reissuable:false,sender:exports.WAVES,senderPublicKey:"",signature:"",timestamp:14604192e5,type:exports.ISSUE_TX}},{}],100:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});function paddedMessage(message){return"\n"+message+"\n"}function resolveData(data){if(data instanceof Error){return paddedMessage(data.toString())}else if(data){try{return paddedMessage(JSON.stringify(data,null,2))}catch(e){return paddedMessage("Not possible to retrieve error data")}}else{return paddedMessage("No additional data provided")}}var WavesError=function(_super){__extends(WavesError,_super);function WavesError(message,data){var _this=_super.call(this,message+":\n"+resolveData(data))||this;_this.name="WavesError";_this.data=data;if(Error.captureStackTrace){Error.captureStackTrace(_this,WavesError)}return _this}return WavesError}(Error);exports.default=WavesError},{}],101:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var WavesError_1=require("./WavesError");var FAILED_TO_FETCH="Failed to fetch";function normalizeErrorData(data){if(!data.error&&data.message&&data.message.indexOf(FAILED_TO_FETCH)!==-1){return{error:-1,message:"failed to fetch"}}else{return data}}var WavesRequestError=function(_super){__extends(WavesRequestError,_super);function WavesRequestError(url,data){var _this=_super.call(this,"Server request to '"+url+"' has failed",normalizeErrorData(data))||this;_this.name="WavesRequestError";return _this}return WavesRequestError}(WavesError_1.default);exports.default=WavesRequestError},{"./WavesError":100}],102:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var axlsign=Object.create(null);var gf=function(init){var i,r=new Float64Array(16);if(init)for(i=0;i<init.length;i++)r[i]=init[i];return r};var _0=new Uint8Array(16);var _9=new Uint8Array(32);_9[0]=9;var gf0=gf(),gf1=gf([1]),_121665=gf([56129,1]),D=gf([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),D2=gf([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),X=gf([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Y=gf([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),I=gf([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function ts64(x,i,h,l){x[i]=h>>24&255;x[i+1]=h>>16&255;x[i+2]=h>>8&255;x[i+3]=h&255;x[i+4]=l>>24&255;x[i+5]=l>>16&255;x[i+6]=l>>8&255;x[i+7]=l&255}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i<n;i++)d|=x[xi+i]^y[yi+i];return(1&d-1>>>8)-1}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function set25519(r,a){for(var i=0;i<16;i++)r[i]=a[i]|0}function car25519(o){var i,v,c=1;for(i=0;i<16;i++){v=o[i]+c+65535;c=Math.floor(v/65536);o[i]=v-c*65536}o[0]+=c-1+37*(c-1)}function sel25519(p,q,b){var t,c=~(b-1);for(var i=0;i<16;i++){t=c&(p[i]^q[i]);p[i]^=t;q[i]^=t}}function pack25519(o,n){var i,j,b;var m=gf(),t=gf();for(i=0;i<16;i++)t[i]=n[i];car25519(t);car25519(t);car25519(t);for(j=0;j<2;j++){m[0]=t[0]-65517;for(i=1;i<15;i++){m[i]=t[i]-65535-(m[i-1]>>16&1);m[i-1]&=65535}m[15]=t[15]-32767-(m[14]>>16&1);b=m[15]>>16&1;m[14]&=65535;sel25519(t,m,1-b)}for(i=0;i<16;i++){o[2*i]=t[i]&255;o[2*i+1]=t[i]>>8}}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);pack25519(c,a);pack25519(d,b);return crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);pack25519(d,a);return d[0]&1}function unpack25519(o,n){for(var i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];v=a[0];t0+=v*b0;t1+=v*b1;t2+=v*b2;t3+=v*b3;t4+=v*b4;t5+=v*b5;t6+=v*b6;t7+=v*b7;t8+=v*b8;t9+=v*b9;t10+=v*b10;t11+=v*b11;t12+=v*b12;t13+=v*b13;t14+=v*b14;t15+=v*b15;v=a[1];t1+=v*b0;t2+=v*b1;t3+=v*b2;t4+=v*b3;t5+=v*b4;t6+=v*b5;t7+=v*b6;t8+=v*b7;t9+=v*b8;t10+=v*b9;t11+=v*b10;t12+=v*b11;t13+=v*b12;t14+=v*b13;t15+=v*b14;t16+=v*b15;v=a[2];t2+=v*b0;t3+=v*b1;t4+=v*b2;t5+=v*b3;t6+=v*b4;t7+=v*b5;t8+=v*b6;t9+=v*b7;t10+=v*b8;t11+=v*b9;t12+=v*b10;t13+=v*b11;t14+=v*b12;t15+=v*b13;t16+=v*b14;t17+=v*b15;v=a[3];t3+=v*b0;t4+=v*b1;t5+=v*b2;t6+=v*b3;t7+=v*b4;t8+=v*b5;t9+=v*b6;t10+=v*b7;t11+=v*b8;t12+=v*b9;t13+=v*b10;t14+=v*b11;t15+=v*b12;t16+=v*b13;t17+=v*b14;t18+=v*b15;v=a[4];t4+=v*b0;t5+=v*b1;t6+=v*b2;t7+=v*b3;t8+=v*b4;t9+=v*b5;t10+=v*b6;t11+=v*b7;t12+=v*b8;t13+=v*b9;t14+=v*b10;t15+=v*b11;t16+=v*b12;t17+=v*b13;t18+=v*b14;t19+=v*b15;v=a[5];t5+=v*b0;t6+=v*b1;t7+=v*b2;t8+=v*b3;t9+=v*b4;t10+=v*b5;t11+=v*b6;t12+=v*b7;t13+=v*b8;t14+=v*b9;t15+=v*b10;t16+=v*b11;t17+=v*b12;t18+=v*b13;t19+=v*b14;t20+=v*b15;v=a[6];t6+=v*b0;t7+=v*b1;t8+=v*b2;t9+=v*b3;t10+=v*b4;t11+=v*b5;t12+=v*b6;t13+=v*b7;t14+=v*b8;t15+=v*b9;t16+=v*b10;t17+=v*b11;t18+=v*b12;t19+=v*b13;t20+=v*b14;t21+=v*b15;v=a[7];t7+=v*b0;t8+=v*b1;t9+=v*b2;t10+=v*b3;t11+=v*b4;t12+=v*b5;t13+=v*b6;t14+=v*b7;t15+=v*b8;t16+=v*b9;t17+=v*b10;t18+=v*b11;t19+=v*b12;t20+=v*b13;t21+=v*b14;t22+=v*b15;v=a[8];t8+=v*b0;t9+=v*b1;t10+=v*b2;t11+=v*b3;t12+=v*b4;t13+=v*b5;t14+=v*b6;t15+=v*b7;t16+=v*b8;t17+=v*b9;t18+=v*b10;t19+=v*b11;t20+=v*b12;t21+=v*b13;t22+=v*b14;t23+=v*b15;v=a[9];t9+=v*b0;t10+=v*b1;t11+=v*b2;t12+=v*b3;t13+=v*b4;t14+=v*b5;t15+=v*b6;t16+=v*b7;t17+=v*b8;t18+=v*b9;t19+=v*b10;t20+=v*b11;t21+=v*b12;t22+=v*b13;t23+=v*b14;t24+=v*b15;v=a[10];t10+=v*b0;t11+=v*b1;t12+=v*b2;t13+=v*b3;t14+=v*b4;t15+=v*b5;t16+=v*b6;t17+=v*b7;t18+=v*b8;t19+=v*b9;t20+=v*b10;t21+=v*b11;t22+=v*b12;t23+=v*b13;t24+=v*b14;t25+=v*b15;v=a[11];t11+=v*b0;t12+=v*b1;t13+=v*b2;t14+=v*b3;t15+=v*b4;t16+=v*b5;t17+=v*b6;t18+=v*b7;t19+=v*b8;t20+=v*b9;t21+=v*b10;t22+=v*b11;t23+=v*b12;t24+=v*b13;t25+=v*b14;t26+=v*b15;v=a[12];t12+=v*b0;t13+=v*b1;t14+=v*b2;t15+=v*b3;t16+=v*b4;t17+=v*b5;t18+=v*b6;t19+=v*b7;t20+=v*b8;t21+=v*b9;t22+=v*b10;t23+=v*b11;t24+=v*b12;t25+=v*b13;t26+=v*b14;t27+=v*b15;v=a[13];t13+=v*b0;t14+=v*b1;t15+=v*b2;t16+=v*b3;t17+=v*b4;t18+=v*b5;t19+=v*b6;t20+=v*b7;t21+=v*b8;t22+=v*b9;t23+=v*b10;t24+=v*b11;t25+=v*b12;t26+=v*b13;t27+=v*b14;t28+=v*b15;v=a[14];t14+=v*b0;t15+=v*b1;t16+=v*b2;t17+=v*b3;t18+=v*b4;t19+=v*b5;t20+=v*b6;t21+=v*b7;t22+=v*b8;t23+=v*b9;t24+=v*b10;t25+=v*b11;t26+=v*b12;t27+=v*b13;t28+=v*b14;t29+=v*b15;v=a[15];t15+=v*b0;t16+=v*b1;t17+=v*b2;t18+=v*b3;t19+=v*b4;t20+=v*b5;t21+=v*b6;t22+=v*b7;t23+=v*b8;t24+=v*b9;t25+=v*b10;t26+=v*b11;t27+=v*b12;t28+=v*b13;t29+=v*b14;t30+=v*b15;t0+=38*t16;t1+=38*t17;t2+=38*t18;t3+=38*t19;t4+=38*t20;t5+=38*t21;t6+=38*t22;t7+=38*t23;t8+=38*t24;t9+=38*t25;t10+=38*t26;t11+=38*t27;t12+=38*t28;t13+=38*t29;t14+=38*t30;c=1;v=t0+c+65535;c=Math.floor(v/65536);t0=v-c*65536;v=t1+c+65535;c=Math.floor(v/65536);t1=v-c*65536;v=t2+c+65535;c=Math.floor(v/65536);t2=v-c*65536;v=t3+c+65535;c=Math.floor(v/65536);t3=v-c*65536;v=t4+c+65535;c=Math.floor(v/65536);t4=v-c*65536;v=t5+c+65535;c=Math.floor(v/65536);t5=v-c*65536;v=t6+c+65535;c=Math.floor(v/65536);t6=v-c*65536;v=t7+c+65535;c=Math.floor(v/65536);t7=v-c*65536;v=t8+c+65535;c=Math.floor(v/65536);t8=v-c*65536;v=t9+c+65535;c=Math.floor(v/65536);t9=v-c*65536;v=t10+c+65535;c=Math.floor(v/65536);t10=v-c*65536;v=t11+c+65535;c=Math.floor(v/65536);t11=v-c*65536;v=t12+c+65535;c=Math.floor(v/65536);t12=v-c*65536;v=t13+c+65535;c=Math.floor(v/65536);t13=v-c*65536;v=t14+c+65535;c=Math.floor(v/65536);t14=v-c*65536;v=t15+c+65535;c=Math.floor(v/65536);t15=v-c*65536;t0+=c-1+37*(c-1);c=1;v=t0+c+65535;c=Math.floor(v/65536);t0=v-c*65536;v=t1+c+65535;c=Math.floor(v/65536);t1=v-c*65536;v=t2+c+65535;c=Math.floor(v/65536);t2=v-c*65536;v=t3+c+65535;c=Math.floor(v/65536);t3=v-c*65536;v=t4+c+65535;c=Math.floor(v/65536);t4=v-c*65536;v=t5+c+65535;c=Math.floor(v/65536);t5=v-c*65536;v=t6+c+65535;c=Math.floor(v/65536);t6=v-c*65536;v=t7+c+65535;c=Math.floor(v/65536);t7=v-c*65536;v=t8+c+65535;c=Math.floor(v/65536);t8=v-c*65536;v=t9+c+65535;c=Math.floor(v/65536);t9=v-c*65536;v=t10+c+65535;c=Math.floor(v/65536);t10=v-c*65536;v=t11+c+65535;c=Math.floor(v/65536);t11=v-c*65536;v=t12+c+65535;c=Math.floor(v/65536);t12=v-c*65536;v=t13+c+65535;c=Math.floor(v/65536);t13=v-c*65536;v=t14+c+65535;c=Math.floor(v/65536);t14=v-c*65536;v=t15+c+65535;c=Math.floor(v/65536);t15=v-c*65536;t0+=c-1+37*(c-1);o[0]=t0;o[1]=t1;o[2]=t2;o[3]=t3;o[4]=t4;o[5]=t5;o[6]=t6;o[7]=t7;o[8]=t8;o[9]=t9;o[10]=t10;o[11]=t11;o[12]=t12;o[13]=t13;o[14]=t14;o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var c=gf();var a;for(a=0;a<16;a++)c[a]=i[a];for(a=253;a>=0;a--){S(c,c);if(a!==2&&a!==4)M(c,c,i)}for(a=0;a<16;a++)o[a]=c[a]}function pow2523(o,i){var c=gf();var a;for(a=0;a<16;a++)c[a]=i[a];for(a=250;a>=0;a--){S(c,c);if(a!==1)M(c,c,i)}for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var z=new Uint8Array(32);var x=new Float64Array(80);var r,i;var a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];z[31]=n[31]&127|64;z[0]&=248;unpack25519(x,p);for(i=0;i<16;i++){b[i]=x[i];d[i]=a[i]=c[i]=0}a[0]=d[0]=1;for(i=254;i>=0;--i){r=z[i>>>3]>>>(i&7)&1;sel25519(a,b,r);sel25519(c,d,r);A(e,a,c);Z(a,a,c);A(c,b,d);Z(b,b,d);S(d,e);S(f,a);M(a,c,a);M(c,b,e);A(e,a,c);Z(a,a,c);S(b,a);Z(c,d,f);M(a,c,_121665);A(a,a,d);M(c,c,a);M(a,d,f);M(d,b,x);S(b,e);sel25519(a,b,r);sel25519(c,d,r)}for(i=0;i<16;i++){x[i+16]=a[i];x[i+32]=c[i];x[i+48]=b[i];x[i+64]=d[i]}var x32=x.subarray(32);var x16=x.subarray(16);inv25519(x32,x32);M(x16,x16,x32);pack25519(q,x16);return 0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}var K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function crypto_hashblocks_hl(hh,hl,m,n){var wh=new Int32Array(16),wl=new Int32Array(16);var bh0,bh1,bh2,bh3,bh4,bh5,bh6,bh7,bl0,bl1,bl2,bl3,bl4,bl5,bl6,bl7,th,tl,i,j,h,l,a,b,c,d;var ah0=hh[0],ah1=hh[1],ah2=hh[2],ah3=hh[3],ah4=hh[4],ah5=hh[5],ah6=hh[6],ah7=hh[7],al0=hl[0],al1=hl[1],al2=hl[2],al3=hl[3],al4=hl[4],al5=hl[5],al6=hl[6],al7=hl[7];var pos=0;while(n>=128){for(i=0;i<16;i++){j=8*i+pos;wh[i]=m[j+0]<<24|m[j+1]<<16|m[j+2]<<8|m[j+3];wl[i]=m[j+4]<<24|m[j+5]<<16|m[j+6]<<8|m[j+7]}for(i=0;i<80;i++){bh0=ah0;bh1=ah1;bh2=ah2;bh3=ah3;bh4=ah4;bh5=ah5;bh6=ah6;bh7=ah7;bl0=al0;bl1=al1;bl2=al2;bl3=al3;bl4=al4;bl5=al5;bl6=al6;bl7=al7;h=ah7;l=al7;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=(ah4>>>14|al4<<32-14)^(ah4>>>18|al4<<32-18)^(al4>>>41-32|ah4<<32-(41-32));l=(al4>>>14|ah4<<32-14)^(al4>>>18|ah4<<32-18)^(ah4>>>41-32|al4<<32-(41-32));a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;h=ah4&ah5^~ah4&ah6;l=al4&al5^~al4&al6;a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;h=K[i*2];l=K[i*2+1];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;h=wh[i%16];l=wl[i%16];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;th=c&65535|d<<16;tl=a&65535|b<<16;h=th;l=tl;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=(ah0>>>28|al0<<32-28)^(al0>>>34-32|ah0<<32-(34-32))^(al0>>>39-32|ah0<<32-(39-32));l=(al0>>>28|ah0<<32-28)^(ah0>>>34-32|al0<<32-(34-32))^(ah0>>>39-32|al0<<32-(39-32));a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;h=ah0&ah1^ah0&ah2^ah1&ah2;l=al0&al1^al0&al2^al1&al2;a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;bh7=c&65535|d<<16;bl7=a&65535|b<<16;h=bh3;l=bl3;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=th;l=tl;a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;bh3=c&65535|d<<16;bl3=a&65535|b<<16;ah1=bh0;ah2=bh1;ah3=bh2;ah4=bh3;ah5=bh4;ah6=bh5;ah7=bh6;ah0=bh7;al1=bl0;al2=bl1;al3=bl2;al4=bl3;al5=bl4;al6=bl5;al7=bl6;al0=bl7;if(i%16===15){for(j=0;j<16;j++){h=wh[j];l=wl[j];a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=wh[(j+9)%16];l=wl[(j+9)%16];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;th=wh[(j+1)%16];tl=wl[(j+1)%16];h=(th>>>1|tl<<32-1)^(th>>>8|tl<<32-8)^th>>>7;l=(tl>>>1|th<<32-1)^(tl>>>8|th<<32-8)^(tl>>>7|th<<32-7);a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;th=wh[(j+14)%16];tl=wl[(j+14)%16];h=(th>>>19|tl<<32-19)^(tl>>>61-32|th<<32-(61-32))^th>>>6;l=(tl>>>19|th<<32-19)^(th>>>61-32|tl<<32-(61-32))^(tl>>>6|th<<32-6);a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;wh[j]=c&65535|d<<16;wl[j]=a&65535|b<<16}}}h=ah0;l=al0;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=hh[0];l=hl[0];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;hh[0]=ah0=c&65535|d<<16;hl[0]=al0=a&65535|b<<16;h=ah1;l=al1;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=hh[1];l=hl[1];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;hh[1]=ah1=c&65535|d<<16;hl[1]=al1=a&65535|b<<16;h=ah2;l=al2;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=hh[2];l=hl[2];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;hh[2]=ah2=c&65535|d<<16;hl[2]=al2=a&65535|b<<16;h=ah3;l=al3;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=hh[3];l=hl[3];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;hh[3]=ah3=c&65535|d<<16;hl[3]=al3=a&65535|b<<16;h=ah4;l=al4;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=hh[4];l=hl[4];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;hh[4]=ah4=c&65535|d<<16;hl[4]=al4=a&65535|b<<16;h=ah5;l=al5;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=hh[5];l=hl[5];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;hh[5]=ah5=c&65535|d<<16;hl[5]=al5=a&65535|b<<16;h=ah6;l=al6;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=hh[6];l=hl[6];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;hh[6]=ah6=c&65535|d<<16;hl[6]=al6=a&65535|b<<16;h=ah7;l=al7;a=l&65535;b=l>>>16;c=h&65535;d=h>>>16;h=hh[7];l=hl[7];a+=l&65535;b+=l>>>16;c+=h&65535;d+=h>>>16;b+=a>>>16;c+=b>>>16;d+=c>>>16;hh[7]=ah7=c&65535|d<<16;hl[7]=al7=a&65535|b<<16;pos+=128;n-=128}return n}function crypto_hash(out,m,n){var hh=new Int32Array(8);var hl=new Int32Array(8);var x=new Uint8Array(256);var i,b=n;hh[0]=1779033703;hh[1]=3144134277;hh[2]=1013904242;hh[3]=2773480762;hh[4]=1359893119;hh[5]=2600822924;hh[6]=528734635;hh[7]=1541459225;hl[0]=4089235720;hl[1]=2227873595;hl[2]=4271175723;hl[3]=1595750129;hl[4]=2917565137;hl[5]=725511199;hl[6]=4215389547;hl[7]=327033209;crypto_hashblocks_hl(hh,hl,m,n);n%=128;for(i=0;i<n;i++)x[i]=m[b-n+i];x[n]=128;n=256-128*(n<112?1:0);x[n-9]=0;ts64(x,n-8,b/536870912|0,b<<3);crypto_hashblocks_hl(hh,hl,x,n);for(i=0;i<8;i++)ts64(out,8*i,hh[i],hl[i]);return 0}function add(p,q){var a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf(),g=gf(),h=gf(),t=gf();Z(a,p[1],p[0]);Z(t,q[1],q[0]);M(a,a,t);A(b,p[0],p[1]);A(t,q[0],q[1]);M(b,b,t);M(c,p[3],q[3]);M(c,c,D2);M(d,p[2],q[2]);A(d,d,d);Z(e,b,a);Z(f,d,c);A(g,d,c);A(h,b,a);M(p[0],e,f);M(p[1],h,g);M(p[2],g,f);M(p[3],e,h)}function cswap(p,q,b){for(var i=0;i<4;i++){sel25519(p[i],q[i],b)}}function pack(r,p){var tx=gf(),ty=gf(),zi=gf();inv25519(zi,p[2]);M(tx,p[0],zi);M(ty,p[1],zi);pack25519(r,ty);r[31]^=par25519(tx)<<7}function scalarmult(p,q,s){var b,i;set25519(p[0],gf0);set25519(p[1],gf1);set25519(p[2],gf1);set25519(p[3],gf0);for(i=255;i>=0;--i){b=s[i/8|0]>>(i&7)&1;cswap(p,q,b);add(q,p);add(p,p);cswap(p,q,b)}}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X);set25519(q[1],Y);set25519(q[2],gf1);M(q[3],X,Y);scalarmult(p,q,s)}var L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function modL(r,x){var carry,i,j,k;for(i=63;i>=32;--i){carry=0;for(j=i-32,k=i-12;j<k;++j){x[j]+=carry-16*x[i]*L[j-(i-32)];carry=x[j]+128>>8;x[j]-=carry*256}x[j]+=carry;x[i]=0}carry=0;for(j=0;j<32;j++){x[j]+=carry-(x[31]>>4)*L[j];carry=x[j]>>8;x[j]&=255}for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++){x[i+1]+=x[i]>>8;r[i]=x[i]&255}}function reduce(r){var x=new Float64Array(64);var i;for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign_direct(sm,m,n,sk){var d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64);var x=new Float64Array(64);var p=[gf(),gf(),gf(),gf()];var i,j;for(i=0;i<n;i++)sm[64+i]=m[i];for(i=0;i<32;i++)sm[32+i]=sk[i];crypto_hash(r,sm.subarray(32),n+32);reduce(r);scalarbase(p,r);pack(sm,p);for(i=0;i<32;i++)sm[i+32]=sk[32+i];crypto_hash(h,sm,n+64);reduce(h);for(i=0;i<64;i++)x[i]=0;for(i=0;i<32;i++)x[i]=r[i];for(i=0;i<32;i++){for(j=0;j<32;j++){x[i+j]+=h[i]*sk[j]}}modL(sm.subarray(32),x);return n+64}function crypto_sign_direct_rnd(sm,m,n,sk,rnd){var d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64);var x=new Float64Array(64);var p=[gf(),gf(),gf(),gf()];var i,j;sm[0]=254;for(i=1;i<32;i++)sm[i]=255;for(i=0;i<32;i++)sm[32+i]=sk[i];for(i=0;i<n;i++)sm[64+i]=m[i];for(i=0;i<64;i++)sm[n+64+i]=rnd[i];crypto_hash(r,sm,n+128);reduce(r);scalarbase(p,r);pack(sm,p);for(i=0;i<32;i++)sm[i+32]=sk[32+i];crypto_hash(h,sm,n+64);reduce(h);for(i=0;i<64;i++)sm[n+64+i]=0;for(i=0;i<64;i++)x[i]=0;for(i=0;i<32;i++)x[i]=r[i];for(i=0;i<32;i++){for(j=0;j<32;j++){x[i+j]+=h[i]*sk[j]}}modL(sm.subarray(32,n+64),x);return n+64}function curve25519_sign(sm,m,n,sk,opt_rnd){var edsk=new Uint8Array(64);var p=[gf(),gf(),gf(),gf()];for(var i=0;i<32;i++)edsk[i]=sk[i];edsk[0]&=248;edsk[31]&=127;edsk[31]|=64;scalarbase(p,edsk);pack(edsk.subarray(32),p);var signBit=edsk[63]&128;var smlen;if(opt_rnd){smlen=crypto_sign_direct_rnd(sm,m,n,edsk,opt_rnd)}else{smlen=crypto_sign_direct(sm,m,n,edsk)}sm[63]|=signBit;return smlen}function unpackneg(r,p){var t=gf(),chk=gf(),num=gf(),den=gf(),den2=gf(),den4=gf(),den6=gf();set25519(r[2],gf1);unpack25519(r[1],p);S(num,r[1]);M(den,num,D);Z(num,num,r[2]);A(den,r[2],den);S(den2,den);S(den4,den2);M(den6,den4,den2);M(t,den6,num);M(t,t,den);pow2523(t,t);M(t,t,num);M(t,t,den);M(t,t,den);M(r[0],t,den);S(chk,r[0]);M(chk,chk,den);if(neq25519(chk,num))M(r[0],r[0],I);S(chk,r[0]);M(chk,chk,den);if(neq25519(chk,num))return-1;if(par25519(r[0])===p[31]>>7)Z(r[0],gf0,r[0]);M(r[3],r[0],r[1]);return 0}function crypto_sign_open(m,sm,n,pk){var i,mlen;var t=new Uint8Array(32),h=new Uint8Array(64);var p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];mlen=-1;if(n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i<n;i++)m[i]=sm[i];for(i=0;i<32;i++)m[i+32]=pk[i];crypto_hash(h,m,n);reduce(h);scalarmult(p,q,h);scalarbase(q,sm.subarray(32));add(p,q);pack(t,p);n-=64;if(crypto_verify_32(sm,0,t,0)){for(i=0;i<n;i++)m[i]=0;return-1}for(i=0;i<n;i++)m[i]=sm[i+64];mlen=n;return mlen}function convertPublicKey(pk){var z=new Uint8Array(32),x=gf(),a=gf(),b=gf();unpack25519(x,pk);A(a,x,gf1);Z(b,x,gf1);inv25519(a,a);M(a,a,b);pack25519(z,a);return z}function curve25519_sign_open(m,sm,n,pk){var edpk=convertPublicKey(pk);edpk[31]|=sm[63]&128;sm[63]&=127;return crypto_sign_open(m,sm,n,edpk)}function checkArrayTypes(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}var t,i;for(i=0;i<arguments.length;i++){if((t=Object.prototype.toString.call(arguments[i]))!=="[object Uint8Array]")throw new TypeError("unexpected type "+t+", use Uint8Array")}}axlsign.sharedKey=function(secretKey,publicKey){checkArrayTypes(publicKey,secretKey);if(publicKey.length!==32)throw new Error("wrong public key length");if(secretKey.length!==32)throw new Error("wrong secret key length");var sharedKey=new Uint8Array(32);crypto_scalarmult(sharedKey,secretKey,publicKey);return sharedKey};axlsign.signMessage=function(secretKey,msg,opt_random){checkArrayTypes(msg,secretKey);if(secretKey.length!==32)throw new Error("wrong secret key length");if(opt_random){checkArrayTypes(opt_random);if(opt_random.length!==64)throw new Error("wrong random data length");var buf=new Uint8Array(128+msg.length);curve25519_sign(buf,msg,msg.length,secretKey,opt_random);return new Uint8Array(buf.subarray(0,64+msg.length))}else{var signedMsg=new Uint8Array(64+msg.length);curve25519_sign(signedMsg,msg,msg.length,secretKey);return signedMsg}};axlsign.openMessage=function(publicKey,signedMsg){checkArrayTypes(signedMsg,publicKey);if(publicKey.length!==32)throw new Error("wrong public key length");var tmp=new Uint8Array(signedMsg.length);var mlen=curve25519_sign_open(tmp,signedMsg,signedMsg.length,publicKey);if(mlen<0)return null;var m=new Uint8Array(mlen);for(var i=0;i<m.length;i++)m[i]=tmp[i];return m};axlsign.sign=function(secretKey,msg,opt_random){checkArrayTypes(secretKey,msg);if(secretKey.length!==32)throw new Error("wrong secret key length");if(opt_random){checkArrayTypes(opt_random);if(opt_random.length!==64)throw new Error("wrong random data length")}var buf=new Uint8Array((opt_random?128:64)+msg.length);curve25519_sign(buf,msg,msg.length,secretKey,opt_random);var signature=new Uint8Array(64);for(var i=0;i<signature.length;i++)signature[i]=buf[i];return signature};axlsign.verify=function(publicKey,msg,signature){checkArrayTypes(msg,signature,publicKey);if(signature.length!==64)throw new Error("wrong signature length");if(publicKey.length!==32)throw new Error("wrong public key length");var sm=new Uint8Array(64+msg.length);var m=new Uint8Array(64+msg.length);var i;for(i=0;i<64;i++)sm[i]=signature[i];for(i=0;i<msg.length;i++)sm[i+64]=msg[i];return curve25519_sign_open(m,sm,sm.length,publicKey)>=0};axlsign.generateKeyPair=function(seed){checkArrayTypes(seed);if(seed.length!==32)throw new Error("wrong seed length");var sk=new Uint8Array(32);var pk=new Uint8Array(32);for(var i=0;i<32;i++)sk[i]=seed[i];crypto_scalarmult_base(pk,sk);sk[0]&=248;sk[31]&=127;sk[31]|=64;pk[31]&=127;return{public:pk,private:sk}};exports.default=axlsign},{}],103:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var ALPHABET_MAP=ALPHABET.split("").reduce(function(map,c,i){map[c]=i;return map},{});exports.default={encode:function(buffer){if(!buffer.length)return"";var digits=[0];for(var i=0;i<buffer.length;i++){for(var j=0;j<digits.length;j++){digits[j]<<=8}digits[0]+=buffer[i];var carry=0;for(var k=0;k<digits.length;k++){digits[k]+=carry;carry=digits[k]/58|0;digits[k]%=58}while(carry){digits.push(carry%58);carry=carry/58|0}}for(var i=0;buffer[i]===0&&i<buffer.length-1;i++){digits.push(0)}return digits.reverse().map(function(digit){return ALPHABET[digit]}).join("")},decode:function(string){if(!string.length)return new Uint8Array(0);var bytes=[0];for(var i=0;i<string.length;i++){var c=string[i];if(!(c in ALPHABET_MAP)){throw'There is no character "'+c+'" in the Base58 sequence!'}for(var j=0;j<bytes.length;j++){bytes[j]*=58}bytes[0]+=ALPHABET_MAP[c];var carry=0;for(var j=0;j<bytes.length;j++){bytes[j]+=carry;carry=bytes[j]>>8;bytes[j]&=255}while(carry){bytes.push(carry&255);carry>>=8}}for(var i=0;string[i]==="1"&&i<string.length-1;i++){bytes.push(0)}return new Uint8Array(bytes.reverse())}}},{}],104:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var bignumber_js_1=require("bignumber.js");bignumber_js_1.default.config({ROUNDING_MODE:bignumber_js_1.default.ROUND_DOWN});exports.default=bignumber_js_1.default},{"bignumber.js":2}],105:[function(require,module,exports){(function(Buffer){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var logger_1=require("../utils/logger");var ERROR_MSG_INPUT="Input must be an string, Buffer or Uint8Array";function normalizeInput(input){var ret;if(input instanceof Uint8Array){ret=input}else if(input instanceof Buffer){ret=new Uint8Array(input)}else if(typeof input==="string"){ret=new Uint8Array(Buffer.from(input,"utf8"))}else{throw new Error(ERROR_MSG_INPUT)}return ret}function toHex(bytes){return Array.prototype.map.call(bytes,function(n){return(n<16?"0":"")+n.toString(16)}).join("")}function uint32ToHex(val){return(4294967296+val).toString(16).substring(1)}function debugPrint(label,arr,size){var msg="\n"+label+" = ";for(var i=0;i<arr.length;i+=2){if(size===32){msg+=uint32ToHex(arr[i]).toUpperCase();msg+=" ";msg+=uint32ToHex(arr[i+1]).toUpperCase()}else if(size===64){msg+=uint32ToHex(arr[i+1]).toUpperCase();msg+=uint32ToHex(arr[i]).toUpperCase()}else throw new Error("Invalid size "+size);if(i%6===4){msg+="\n"+new Array(label.length+4).join(" ")}else if(i<arr.length-2){msg+=" "}}logger_1.default.log(msg)}function testSpeed(hashFn,N,M){var startMs=(new Date).getTime();var input=new Uint8Array(N);for(var i=0;i<N;i++){input[i]=i%256}var genMs=(new Date).getTime();logger_1.default.log("Generated random input in "+(genMs-startMs)+"ms");startMs=genMs;for(i=0;i<M;i++){var hashHex=hashFn(input);var hashMs=(new Date).getTime();var ms=hashMs-startMs;startMs=hashMs;logger_1.default.log("Hashed in "+ms+"ms: "+hashHex.substring(0,20)+"...");logger_1.default.log(Math.round(N/(1<<20)/(ms/1e3)*100)/100+" MB PER SECOND")}}function ADD64AA(v,a,b){var o0=v[a]+v[b];var o1=v[a+1]+v[b+1];if(o0>=4294967296){o1++}v[a]=o0;v[a+1]=o1}function ADD64AC(v,a,b0,b1){var o0=v[a]+b0;if(b0<0){o0+=4294967296}var o1=v[a+1]+b1;if(o0>=4294967296){o1++}v[a]=o0;v[a+1]=o1}function B2B_GET32(arr,i){return arr[i]^arr[i+1]<<8^arr[i+2]<<16^arr[i+3]<<24}function B2B_G(a,b,c,d,ix,iy){var x0=m[ix];var x1=m[ix+1];var y0=m[iy];var y1=m[iy+1];ADD64AA(v,a,b);ADD64AC(v,a,x0,x1);var xor0=v[d]^v[a];var xor1=v[d+1]^v[a+1];v[d]=xor1;v[d+1]=xor0;ADD64AA(v,c,d);xor0=v[b]^v[c];xor1=v[b+1]^v[c+1];v[b]=xor0>>>24^xor1<<8;v[b+1]=xor1>>>24^xor0<<8;ADD64AA(v,a,b);ADD64AC(v,a,y0,y1);xor0=v[d]^v[a];xor1=v[d+1]^v[a+1];v[d]=xor0>>>16^xor1<<16;v[d+1]=xor1>>>16^xor0<<16;ADD64AA(v,c,d);xor0=v[b]^v[c];xor1=v[b+1]^v[c+1];v[b]=xor1>>>31^xor0<<1;v[b+1]=xor0>>>31^xor1<<1}var BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]);var SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3];var SIGMA82=new Uint8Array(SIGMA8.map(function(x){return x*2}));var v=new Uint32Array(32);var m=new Uint32Array(32);function blake2bCompress(ctx,last){var i=0;for(i=0;i<16;i++){v[i]=ctx.h[i];v[i+16]=BLAKE2B_IV32[i]}v[24]=v[24]^ctx.t;v[25]=v[25]^ctx.t/4294967296;if(last){v[28]=~v[28];v[29]=~v[29]}for(i=0;i<32;i++){m[i]=B2B_GET32(ctx.b,4*i)}for(i=0;i<12;i++){B2B_G(0,8,16,24,SIGMA82[i*16+0],SIGMA82[i*16+1]);B2B_G(2,10,18,26,SIGMA82[i*16+2],SIGMA82[i*16+3]);B2B_G(4,12,20,28,SIGMA82[i*16+4],SIGMA82[i*16+5]);B2B_G(6,14,22,30,SIGMA82[i*16+6],SIGMA82[i*16+7]);B2B_G(0,10,20,30,SIGMA82[i*16+8],SIGMA82[i*16+9]);B2B_G(2,12,22,24,SIGMA82[i*16+10],SIGMA82[i*16+11]);B2B_G(4,14,16,26,SIGMA82[i*16+12],SIGMA82[i*16+13]);B2B_G(6,8,18,28,SIGMA82[i*16+14],SIGMA82[i*16+15])}for(i=0;i<16;i++){ctx.h[i]=ctx.h[i]^v[i]^v[i+16]}}function blake2bInit(outlen,key){if(outlen===0||outlen>64){throw new Error("Illegal output length, expected 0 < length <= 64")}if(key&&key.length>64){throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64")}var ctx={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:outlen};for(var i=0;i<16;i++){ctx.h[i]=BLAKE2B_IV32[i]}var keylen=key?key.length:0;ctx.h[0]^=16842752^keylen<<8^outlen;if(key){blake2bUpdate(ctx,key);ctx.c=128}return ctx}exports.blake2bInit=blake2bInit;function blake2bUpdate(ctx,input){for(var i=0;i<input.length;i++){if(ctx.c===128){ctx.t+=ctx.c;blake2bCompress(ctx,false);ctx.c=0}ctx.b[ctx.c++]=input[i]}}exports.blake2bUpdate=blake2bUpdate;function blake2bFinal(ctx){ctx.t+=ctx.c;while(ctx.c<128){ctx.b[ctx.c++]=0}blake2bCompress(ctx,true);var out=new Uint8Array(ctx.outlen);for(var i=0;i<ctx.outlen;i++){out[i]=ctx.h[i>>2]>>8*(i&3)}return out}exports.blake2bFinal=blake2bFinal;function blake2b(input,key,outlen){outlen=outlen||64;input=normalizeInput(input);var ctx=blake2bInit(outlen,key);blake2bUpdate(ctx,input);return blake2bFinal(ctx)}exports.blake2b=blake2b;function blake2bHex(input,key,outlen){var output=blake2b(input,key,outlen);return toHex(output)}exports.blake2bHex=blake2bHex}).call(this,require("buffer").Buffer)},{"../utils/logger":115,buffer:3}],106:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var CryptoJS=require("crypto-js");var converters=function(){var charToNibble={};var nibbleToChar=[];var i;for(i=0;i<=9;++i){var character=i.toString();charToNibble[character]=i;nibbleToChar.push(character)}for(i=10;i<=15;++i){var lowerChar=String.fromCharCode("a".charCodeAt(0)+i-10);var upperChar=String.fromCharCode("A".charCodeAt(0)+i-10);charToNibble[lowerChar]=i;charToNibble[upperChar]=i;nibbleToChar.push(lowerChar)}return{byteArrayToHexString:function(bytes){var str="";for(var i_1=0;i_1<bytes.length;++i_1){if(bytes[i_1]<0){bytes[i_1]+=256}str+=nibbleToChar[bytes[i_1]>>4]+nibbleToChar[bytes[i_1]&15]}return str},stringToByteArray:function(str){str=unescape(encodeURIComponent(str));var bytes=new Array(str.length);for(var i_2=0;i_2<str.length;++i_2)bytes[i_2]=str.charCodeAt(i_2);return bytes},hexStringToByteArray:function(str){var bytes=[];var i=0;if(0!==str.length%2){bytes.push(charToNibble[str.charAt(0)]);++i}for(;i<str.length-1;i+=2)bytes.push((charToNibble[str.charAt(i)]<<4)+charToNibble[str.charAt(i+1)]);return bytes},stringToHexString:function(str){return this.byteArrayToHexString(this.stringToByteArray(str))},hexStringToString:function(hex){return this.byteArrayToString(this.hexStringToByteArray(hex))},checkBytesToIntInput:function(bytes,numBytes,opt_startIndex){var startIndex=opt_startIndex||0;if(startIndex<0){throw new Error("Start index should not be negative")}if(bytes.length<startIndex+numBytes){throw new Error("Need at least "+numBytes+" bytes to convert to an integer")}return startIndex},byteArrayToSignedShort:function(bytes,opt_startIndex){var index=this.checkBytesToIntInput(bytes,2,opt_startIndex);var value=bytes[index];value+=bytes[index+1]<<8;return value},byteArrayToSignedInt32:function(bytes,opt_startIndex){var index=this.checkBytesToIntInput(bytes,4,opt_startIndex);var value=bytes[index];value+=bytes[index+1]<<8;value+=bytes[index+2]<<16;value+=bytes[index+3]<<24;return value},byteArrayToBigInteger:function(bytes,opt_startIndex){var index=this.checkBytesToIntInput(bytes,8,opt_startIndex);var value=new BigInteger("0",10);var temp1,temp2;for(var i_3=7;i_3>=0;i_3--){temp1=value.multiply(new BigInteger("256",10));temp2=temp1.add(new BigInteger(bytes[opt_startIndex+i_3].toString(10),10));value=temp2}return value},byteArrayToWordArray:function(byteArray){var i=0,offset=0,word=0,len=byteArray.length;var words=new Uint32Array((len/4|0)+(len%4==0?0:1));while(i<len-len%4){words[offset++]=byteArray[i++]<<24|byteArray[i++]<<16|byteArray[i++]<<8|byteArray[i++]}if(len%4!=0){word=byteArray[i++]<<24;if(len%4>1){word=word|byteArray[i++]<<16}if(len%4>2){word=word|byteArray[i++]<<8}words[offset]=word}var wordArray=new Object;wordArray.sigBytes=len;wordArray.words=words;return wordArray},wordArrayToByteArray:function(wordArray){return converters.wordArrayToByteArrayImpl(wordArray,true)},wordArrayToByteArrayImpl:function(wordArray,isFirstByteHasSign){var len=wordArray.words.length;if(len==0){return new Array(0)}var byteArray=new Array(wordArray.sigBytes);var offset=0,word,i;for(i=0;i<len-1;i++){word=wordArray.words[i];byteArray[offset++]=isFirstByteHasSign?word>>24:word>>24&255;byteArray[offset++]=word>>16&255;byteArray[offset++]=word>>8&255;byteArray[offset++]=word&255}word=wordArray.words[len-1];byteArray[offset++]=isFirstByteHasSign?word>>24:word>>24&255;if(wordArray.sigBytes%4==0){byteArray[offset++]=word>>16&255;byteArray[offset++]=word>>8&255;byteArray[offset++]=word&255}if(wordArray.sigBytes%4>1){byteArray[offset++]=word>>16&255}if(wordArray.sigBytes%4>2){byteArray[offset++]=word>>8&255}return byteArray},byteArrayToString:function(bytes,opt_startIndex,length){if(length==0){return""}if(opt_startIndex&&length){var index=this.checkBytesToIntInput(bytes,parseInt(length,10),parseInt(opt_startIndex,10));bytes=bytes.slice(opt_startIndex,opt_startIndex+length)}return decodeURIComponent(escape(String.fromCharCode.apply(null,bytes)))},byteArrayToShortArray:function(byteArray){var shortArray=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var i;for(i=0;i<16;i++){shortArray[i]=byteArray[i*2]|byteArray[i*2+1]<<8}return shortArray},shortArrayToByteArray:function(shortArray){var byteArray=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var i;for(i=0;i<16;i++){byteArray[2*i]=shortArray[i]&255;byteArray[2*i+1]=shortArray[i]>>8}return byteArray},shortArrayToHexString:function(ary){var res="";for(var i_4=0;i_4<ary.length;i_4++){res+=nibbleToChar[ary[i_4]>>4&15]+nibbleToChar[ary[i_4]&15]+nibbleToChar[ary[i_4]>>12&15]+nibbleToChar[ary[i_4]>>8&15]}return res},intToBytes_:function(x,numBytes,unsignedMax,opt_bigEndian){var signedMax=Math.floor(unsignedMax/2);var negativeMax=(signedMax+1)*-1;if(x!=Math.floor(x)||x<negativeMax||x>unsignedMax){throw new Error(x+" is not a "+numBytes*8+" bit integer")}var bytes=[];var current;var numberType=x>=0&&x<=signedMax?0:x>signedMax&&x<=unsignedMax?1:2;if(numberType==2){x=x*-1-1}for(var i_5=0;i_5<numBytes;i_5++){if(numberType==2){current=255-x%256}else{current=x%256}if(opt_bigEndian){bytes.unshift(current)}else{bytes.push(current)}if(numberType==1){x=Math.floor(x/256)}else{x=x>>8}}return bytes},int32ToBytes:function(x,opt_bigEndian){return converters.intToBytes_(x,4,4294967295,opt_bigEndian)},int16ToBytes:function(x,opt_bigEndian){return converters.intToBytes_(x,2,65535,opt_bigEndian)},wordArrayToByteArrayEx:function(wordArray){var words=wordArray.words;var sigBytes=wordArray.sigBytes;var u8=new Uint8Array(sigBytes);for(var i_6=0;i_6<sigBytes;i_6++){var byte=words[i_6>>>2]>>>24-i_6%4*8&255;u8[i_6]=byte}return u8},byteArrayToWordArrayEx:function(u8arr){var len=u8arr.length;var words=[];for(var i_7=0;i_7<len;i_7++){words[i_7>>>2]|=(u8arr[i_7]&255)<<24-i_7%4*8}return CryptoJS.lib.WordArray.create(words,len)}}}();exports.default=converters},{"crypto-js":13}],107:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var fetchSubstitute=function(){if(typeof window!=="undefined"){return window.fetch.bind(window)}else if(typeof self!=="undefined"){return self.fetch.bind(self)}else if(typeof exports==="object"&&typeof module!=="undefined"){return require("node-fetch")}else{throw new Error("Your environment is not defined")}}();exports.default=fetchSubstitute},{"node-fetch":undefined}],108:[function(require,module,exports){(function(Buffer){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function nodeRandom(count,options){var crypto=require("crypto");var buf=crypto.randomBytes(count);switch(options.type){case"Array":return[].slice.call(buf);case"Buffer":return buf;case"Uint8Array":var arr=new Uint8Array(count);for(var i=0;i<count;++i){arr[i]=buf.readUInt8(i)}return arr;default:throw new Error(options.type+" is unsupported.")}}function browserRandom(count,options){var nativeArr=new Uint8Array(count);var crypto=self.crypto||self.msCrypto;crypto.getRandomValues(nativeArr);switch(options.type){case"Array":return[].slice.call(nativeArr);case"Buffer":try{var b=new Buffer(1)}catch(e){throw new Error("Buffer not supported in this environment. Use Node.js or Browserify for browser support.")}return new Buffer(nativeArr);case"Uint8Array":return nativeArr;default:throw new Error(options.type+" is unsupported.")}}function secureRandom(count,options){options=options||{type:"Array"};if(typeof window!=="undefined"||typeof self!=="undefined"){return browserRandom(count,options)}else if(typeof exports==="object"&&typeof module!=="undefined"){return nodeRandom(count,options)}else{throw new Error("Your environment is not defined")}}exports.default={secureRandom:secureRandom,randomArray:function(byteCount){return secureRandom(byteCount,{type:"Array"})},randomUint8Array:function(byteCount){return secureRandom(byteCount,{type:"Uint8Array"})},randomBuffer:function(byteCount){return secureRandom(byteCount,{type:"Buffer"})}}}).call(this,require("buffer").Buffer)},{buffer:3,crypto:undefined}],109:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var sha3={};var HEX_CHARS="0123456789abcdef".split("");var SHAKE_PADDING=[31,7936,2031616,520093696];var KECCAK_PADDING=[1,256,65536,16777216];var PADDING=[6,1536,393216,100663296];var SHIFT=[0,8,16,24];var RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];var BITS=[224,256,384,512];var SHAKE_BITS=[128,256];var OUTPUT_TYPES=["hex","buffer","arrayBuffer","array"];var createOutputMethod=function(bits,padding,outputType){return function(message){return new Keccak(bits,padding,bits).update(message)[outputType]()}};var createShakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits){return new Keccak(bits,padding,outputBits).update(message)[outputType]()}};var createMethod=function(bits,padding){var method=createOutputMethod(bits,padding,"hex");method.create=function(){return new Keccak(bits,padding,bits)};method.update=function(message){return method.create().update(message)};for(var i=0;i<OUTPUT_TYPES.length;++i){var type=OUTPUT_TYPES[i];method[type]=createOutputMethod(bits,padding,type)}return method};var createShakeMethod=function(bits,padding){var method=createShakeOutputMethod(bits,padding,"hex");method.create=function(outputBits){return new Keccak(bits,padding,outputBits)};method.update=function(message,outputBits){return method.create(outputBits).update(message)};for(var i=0;i<OUTPUT_TYPES.length;++i){var type=OUTPUT_TYPES[i];method[type]=createShakeOutputMethod(bits,padding,type)}return method};var algorithms=[{name:"keccak",padding:KECCAK_PADDING,bits:BITS,createMethod:createMethod},{name:"sha3",padding:PADDING,bits:BITS,createMethod:createMethod},{name:"shake",padding:SHAKE_PADDING,bits:SHAKE_BITS,createMethod:createShakeMethod}];var methods={},methodNames=[];for(var i=0;i<algorithms.length;++i){var algorithm=algorithms[i];var bits=algorithm.bits;for(var j=0;j<bits.length;++j){var methodName=algorithm.name+"_"+bits[j];methodNames.push(methodName);methods[methodName]=algorithm.createMethod(bits[j],algorithm.padding)}}function Keccak(bits,padding,outputBits){this.blocks=[];this.s=[];this.padding=padding;this.outputBits=outputBits;this.reset=true;this.block=0;this.start=0;this.blockCount=1600-(bits<<1)>>5;this.byteCount=this.blockCount<<2;this.outputBlocks=outputBits>>5;this.extraBytes=(outputBits&31)>>3;for(var i=0;i<50;++i){this.s[i]=0}}Keccak.prototype.update=function(message){var notString=typeof message!=="string";if(notString&&message.constructor===ArrayBuffer){message=new Uint8Array(message)}var length=message.length,blocks=this.blocks,byteCount=this.byteCount;var blockCount=this.blockCount,index=0,s=this.s,i,code;while(index<length){if(this.reset){this.reset=false;blocks[0]=this.block;for(i=1;i<blockCount+1;++i){blocks[i]=0}}if(notString){for(i=this.start;index<length&&i<byteCount;++index){blocks[i>>2]|=message[index]<<SHIFT[i++&3]}}else{for(i=this.start;index<length&&i<byteCount;++index){code=message.charCodeAt(index);if(code<128){blocks[i>>2]|=code<<SHIFT[i++&3]}else if(code<2048){blocks[i>>2]|=(192|code>>6)<<SHIFT[i++&3];blocks[i>>2]|=(128|code&63)<<SHIFT[i++&3]}else if(code<55296||code>=57344){blocks[i>>2]|=(224|code>>12)<<SHIFT[i++&3];blocks[i>>2]|=(128|code>>6&63)<<SHIFT[i++&3];blocks[i>>2]|=(128|code&63)<<SHIFT[i++&3]}else{code=65536+((code&1023)<<10|message.charCodeAt(++index)&1023);blocks[i>>2]|=(240|code>>18)<<SHIFT[i++&3];blocks[i>>2]|=(128|code>>12&63)<<SHIFT[i++&3];blocks[i>>2]|=(128|code>>6&63)<<SHIFT[i++&3];blocks[i>>2]|=(128|code&63)<<SHIFT[i++&3]}}}this.lastByteIndex=i;if(i>=byteCount){this.start=i-byteCount;this.block=blocks[blockCount];for(i=0;i<blockCount;++i){s[i]^=blocks[i]}f(s);this.reset=true}else{this.start=i}}return this};Keccak.prototype.finalize=function(){var blocks=this.blocks;var i=this.lastByteIndex,blockCount=this.blockCount,s=this.s;blocks[i>>2]|=this.padding[i&3];if(this.lastByteIndex===this.byteCount){blocks[0]=blocks[blockCount];for(i=1;i<blockCount+1;++i){blocks[i]=0}}blocks[blockCount-1]|=2147483648;for(i=0;i<blockCount;++i){s[i]^=blocks[i]}f(s)};Keccak.prototype.toString=Keccak.prototype.hex=function(){this.finalize();var blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks;var extraBytes=this.extraBytes,i=0,j=0;var hex="",block;while(j<outputBlocks){for(i=0;i<blockCount&&j<outputBlocks;++i,++j){block=s[i];hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[block&15]+HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]+HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]+HEX_CHARS[block>>28&15]+HEX_CHARS[block>>24&15]}if(j%blockCount===0){f(s);i=0}}if(extraBytes){block=s[i];if(extraBytes>0){hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[block&15]}if(extraBytes>1){hex+=HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]}if(extraBytes>2){hex+=HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]}}return hex};Keccak.prototype.arrayBuffer=function(){this.finalize();var blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks;var extraBytes=this.extraBytes,i=0,j=0;var bytes=this.outputBits>>3;var buffer;if(extraBytes){buffer=new ArrayBuffer(outputBlocks+1<<2)}else{buffer=new ArrayBuffer(bytes)}var array=new Uint32Array(buffer);while(j<outputBlocks){for(i=0;i<blockCount&&j<outputBlocks;++i,++j){array[j]=s[i]}if(j%blockCount===0){f(s)}}if(extraBytes){array[i]=s[i];buffer=buffer.slice(0,bytes)}return buffer};Keccak.prototype.buffer=Keccak.prototype.arrayBuffer;Keccak.prototype.digest=Keccak.prototype.array=function(){this.finalize();var blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks;var extraBytes=this.extraBytes,i=0,j=0;var array=[];var offset,block;while(j<outputBlocks){for(i=0;i<blockCount&&j<outputBlocks;++i,++j){offset=j<<2;block=s[i];array[offset]=block&255;array[offset+1]=block>>8&255;array[offset+2]=block>>16&255;array[offset+3]=block>>24&255}if(j%blockCount===0){f(s)}}if(extraBytes){offset=j<<2;block=s[i];if(extraBytes>0){array[offset]=block&255}if(extraBytes>1){array[offset+1]=block>>8&255}if(extraBytes>2){array[offset+2]=block>>16&255}}return array};var f=function(s){var h,l,n,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49;for(n=0;n<48;n+=2){c0=s[0]^s[10]^s[20]^s[30]^s[40];c1=s[1]^s[11]^s[21]^s[31]^s[41];c2=s[2]^s[12]^s[22]^s[32]^s[42];c3=s[3]^s[13]^s[23]^s[33]^s[43];c4=s[4]^s[14]^s[24]^s[34]^s[44];c5=s[5]^s[15]^s[25]^s[35]^s[45];c6=s[6]^s[16]^s[26]^s[36]^s[46];c7=s[7]^s[17]^s[27]^s[37]^s[47];c8=s[8]^s[18]^s[28]^s[38]^s[48];c9=s[9]^s[19]^s[29]^s[39]^s[49];h=c8^(c2<<1|c3>>>31);l=c9^(c3<<1|c2>>>31);s[0]^=h;s[1]^=l;s[10]^=h;s[11]^=l;s[20]^=h;s[21]^=l;s[30]^=h;s[31]^=l;s[40]^=h;s[41]^=l;h=c0^(c4<<1|c5>>>31);l=c1^(c5<<1|c4>>>31);s[2]^=h;s[3]^=l;s[12]^=h;s[13]^=l;s[22]^=h;s[23]^=l;s[32]^=h;s[33]^=l;s[42]^=h;s[43]^=l;h=c2^(c6<<1|c7>>>31);l=c3^(c7<<1|c6>>>31);s[4]^=h;s[5]^=l;s[14]^=h;s[15]^=l;s[24]^=h;s[25]^=l;s[34]^=h;s[35]^=l;s[44]^=h;s[45]^=l;h=c4^(c8<<1|c9>>>31);l=c5^(c9<<1|c8>>>31);s[6]^=h;s[7]^=l;s[16]^=h;s[17]^=l;s[26]^=h;s[27]^=l;s[36]^=h;s[37]^=l;s[46]^=h;s[47]^=l;h=c6^(c0<<1|c1>>>31);l=c7^(c1<<1|c0>>>31);s[8]^=h;s[9]^=l;s[18]^=h;s[19]^=l;s[28]^=h;s[29]^=l;s[38]^=h;s[39]^=l;s[48]^=h;s[49]^=l;b0=s[0];b1=s[1];b32=s[11]<<4|s[10]>>>28;b33=s[10]<<4|s[11]>>>28;b14=s[20]<<3|s[21]>>>29;b15=s[21]<<3|s[20]>>>29;b46=s[31]<<9|s[30]>>>23;b47=s[30]<<9|s[31]>>>23;b28=s[40]<<18|s[41]>>>14;b29=s[41]<<18|s[40]>>>14;b20=s[2]<<1|s[3]>>>31;b21=s[3]<<1|s[2]>>>31;b2=s[13]<<12|s[12]>>>20;b3=s[12]<<12|s[13]>>>20;b34=s[22]<<10|s[23]>>>22;b35=s[23]<<10|s[22]>>>22;b16=s[33]<<13|s[32]>>>19;b17=s[32]<<13|s[33]>>>19;b48=s[42]<<2|s[43]>>>30;b49=s[43]<<2|s[42]>>>30;b40=s[5]<<30|s[4]>>>2;b41=s[4]<<30|s[5]>>>2;b22=s[14]<<6|s[15]>>>26;b23=s[15]<<6|s[14]>>>26;b4=s[25]<<11|s[24]>>>21;b5=s[24]<<11|s[25]>>>21;b36=s[34]<<15|s[35]>>>17;b37=s[35]<<15|s[34]>>>17;b18=s[45]<<29|s[44]>>>3;b19=s[44]<<29|s[45]>>>3;b10=s[6]<<28|s[7]>>>4;b11=s[7]<<28|s[6]>>>4;b42=s[17]<<23|s[16]>>>9;b43=s[16]<<23|s[17]>>>9;b24=s[26]<<25|s[27]>>>7;b25=s[27]<<25|s[26]>>>7;b6=s[36]<<21|s[37]>>>11;b7=s[37]<<21|s[36]>>>11;b38=s[47]<<24|s[46]>>>8;b39=s[46]<<24|s[47]>>>8;b30=s[8]<<27|s[9]>>>5;b31=s[9]<<27|s[8]>>>5;b12=s[18]<<20|s[19]>>>12;b13=s[19]<<20|s[18]>>>12;b44=s[29]<<7|s[28]>>>25;b45=s[28]<<7|s[29]>>>25;b26=s[38]<<8|s[39]>>>24;b27=s[39]<<8|s[38]>>>24;b8=s[48]<<14|s[49]>>>18;b9=s[49]<<14|s[48]>>>18;s[0]=b0^~b2&b4;s[1]=b1^~b3&b5;s[10]=b10^~b12&b14;s[11]=b11^~b13&b15;s[20]=b20^~b22&b24;s[21]=b21^~b23&b25;s[30]=b30^~b32&b34;s[31]=b31^~b33&b35;s[40]=b40^~b42&b44;s[41]=b41^~b43&b45;s[2]=b2^~b4&b6;s[3]=b3^~b5&b7;s[12]=b12^~b14&b16;s[13]=b13^~b15&b17;s[22]=b22^~b24&b26;s[23]=b23^~b25&b27;s[32]=b32^~b34&b36;s[33]=b33^~b35&b37;s[42]=b42^~b44&b46;s[43]=b43^~b45&b47;s[4]=b4^~b6&b8;s[5]=b5^~b7&b9;s[14]=b14^~b16&b18;s[15]=b15^~b17&b19;s[24]=b24^~b26&b28;s[25]=b25^~b27&b29;s[34]=b34^~b36&b38;s[35]=b35^~b37&b39;s[44]=b44^~b46&b48;s[45]=b45^~b47&b49;s[6]=b6^~b8&b0;s[7]=b7^~b9&b1;s[16]=b16^~b18&b10;s[17]=b17^~b19&b11;s[26]=b26^~b28&b20;s[27]=b27^~b29&b21;s[36]=b36^~b38&b30;s[37]=b37^~b39&b31;s[46]=b46^~b48&b40;s[47]=b47^~b49&b41;s[8]=b8^~b0&b2;s[9]=b9^~b1&b3;s[18]=b18^~b10&b12;s[19]=b19^~b11&b13;s[28]=b28^~b20&b22;s[29]=b29^~b21&b23;s[38]=b38^~b30&b32;s[39]=b39^~b31&b33;s[48]=b48^~b40&b42;s[49]=b49^~b41&b43;s[0]^=RC[n];s[1]^=RC[n+1]}};exports.keccak256=methods.keccak_256},{}],110:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]},{}],111:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var base58_1=require("./libs/base58");var crypto_1=require("./utils/crypto");var schemaTools_1=require("./api/schemaTools");exports.default={getAddressFromPublicKey:function(publicKey){var publicKeyBytes=base58_1.default.decode(publicKey);return crypto_1.default.buildRawAddress(publicKeyBytes)},base58:{encode:base58_1.default.encode,decode:base58_1.default.decode},siftTransaction:schemaTools_1.siftTransaction}},{"./api/schemaTools":90,"./libs/base58":103,"./utils/crypto":114}],112:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function concatUint8Arrays(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}if(args.length<2){throw new Error("Two or more Uint8Array are expected")}if(!args.every(function(arg){return arg instanceof Uint8Array})){throw new Error("One of arguments is not a Uint8Array")}var count=args.length;var sumLength=args.reduce(function(sum,arr){return sum+arr.length},0);var result=new Uint8Array(sumLength);var curLength=0;for(var i=0;i<count;i++){result.set(args[i],curLength);curLength+=args[i].length}return result}exports.concatUint8Arrays=concatUint8Arrays},{}],113:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var converters_1=require("../libs/converters");exports.default={booleanToBytes:function(input){if(typeof input!=="boolean"){throw new Error("Boolean input is expected")}return input?[1]:[0]},bytesToByteArrayWithSize:function(input){if(!(input instanceof Array||input instanceof Uint8Array)){throw new Error("Byte array or Uint8Array input is expected")}else if(input instanceof Array&&!input.every(function(n){return typeof n==="number"})){throw new Error("Byte array contains non-numeric elements")}if(!(input instanceof Array)){input=Array.prototype.slice.call(input)}var lengthBytes=converters_1.default.int16ToBytes(input.length,true);return lengthBytes.concat(input)},longToByteArray:function(input){if(typeof input!=="number"){throw new Error("Numeric input is expected")}var bytes=new Array(7);for(var k=7;k>=0;k--){bytes[k]=input&255;input=input/256}return bytes},stringToByteArray:function(input){if(typeof input!=="string"){throw new Error("String input is expected")}return converters_1.default.stringToByteArray(input)},stringToByteArrayWithSize:function(input){if(typeof input!=="string"){throw new Error("String input is expected")}var stringBytes=converters_1.default.stringToByteArray(input);var lengthBytes=converters_1.default.int16ToBytes(stringBytes.length,true);return lengthBytes.concat(stringBytes)}}},{"../libs/converters":106}],114:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var CryptoJS=require("crypto-js");var axlsign_1=require("../libs/axlsign");var base58_1=require("../libs/base58");var blake=require("../libs/blake2b");var converters_1=require("../libs/converters");var secure_random_1=require("../libs/secure-random");var sha3_1=require("../libs/sha3");var concat_1=require("./concat");var constants=require("../constants");var config_1=require("../config");function sha256(input){var bytes;if(typeof input==="string"){bytes=converters_1.default.stringToByteArray(input)}else{bytes=input}var wordArray=converters_1.default.byteArrayToWordArrayEx(Uint8Array.from(bytes));var resultWordArray=CryptoJS.SHA256(wordArray);return converters_1.default.wordArrayToByteArrayEx(resultWordArray)}function blake2b(input){return blake.blake2b(input,null,32)}function keccak(input){return sha3_1.keccak256.array(input)}function hashChain(input){return keccak(blake2b(input))}function buildSeedHash(seedBytes){var nonce=new Uint8Array(converters_1.default.int32ToBytes(constants.INITIAL_NONCE,true));var seedBytesWithNonce=concat_1.concatUint8Arrays(nonce,seedBytes);var seedHash=hashChain(seedBytesWithNonce);return sha256(seedHash)}function strengthenPassword(password,rounds){if(rounds===void 0){rounds=5e3}while(rounds--)password=converters_1.default.byteArrayToHexString(sha256(password));return password}exports.default={buildTransactionSignature:function(dataBytes,privateKey){if(!dataBytes||!(dataBytes instanceof Uint8Array)){throw new Error("Missing or invalid data")}if(!privateKey||typeof privateKey!=="string"){throw new Error("Missing or invalid private key")}var privateKeyBytes=base58_1.default.decode(privateKey);if(privateKeyBytes.length!==constants.PRIVATE_KEY_LENGTH){throw new Error("Invalid public key")}var signature=axlsign_1.default.sign(privateKeyBytes,dataBytes,secure_random_1.default.randomUint8Array(64));return base58_1.default.encode(signature)},buildTransactionId:function(dataBytes){if(!dataBytes||!(dataBytes instanceof Uint8Array)){throw new Error("Missing or invalid data")}var hash=blake2b(dataBytes);return base58_1.default.encode(hash)},buildKeyPair:function(seed){if(!seed||typeof seed!=="string"){throw new Error("Missing or invalid seed phrase")}var seedBytes=Uint8Array.from(converters_1.default.stringToByteArray(seed));var seedHash=buildSeedHash(seedBytes);var keys=axlsign_1.default.generateKeyPair(seedHash);return{privateKey:keys.private,publicKey:keys.public}},isValidAddress:function(address){if(!address||typeof address!=="string"){throw new Error("Missing or invalid address")}var addressBytes=base58_1.default.decode(address);if(addressBytes[0]!==1||addressBytes[1]!==config_1.default.getNetworkByte()){return false}var key=addressBytes.slice(0,22);var check=addressBytes.slice(22,26);var keyHash=hashChain(key).slice(0,4);for(var i=0;i<4;i++){if(check[i]!==keyHash[i]){return false}}return true},buildRawAddress:function(publicKeyBytes){if(!publicKeyBytes||publicKeyBytes.length!==constants.PUBLIC_KEY_LENGTH||!(publicKeyBytes instanceof Uint8Array)){throw new Error("Missing or invalid public key")}var prefix=Uint8Array.from([constants.ADDRESS_VERSION,config_1.default.getNetworkByte()]);var publicKeyHashPart=Uint8Array.from(hashChain(publicKeyBytes).slice(0,20));var rawAddress=concat_1.concatUint8Arrays(prefix,publicKeyHashPart);var addressHash=Uint8Array.from(hashChain(rawAddress).slice(0,4));return base58_1.default.encode(concat_1.concatUint8Arrays(rawAddress,addressHash))},encryptSeed:function(seed,password,encryptionRounds){if(!seed||typeof seed!=="string"){throw new Error("Seed is required")}if(!password||typeof password!=="string"){throw new Error("Password is required")}password=strengthenPassword(password,encryptionRounds);return CryptoJS.AES.encrypt(seed,password).toString()},decryptSeed:function(encryptedSeed,password,encryptionRounds){if(!encryptedSeed||typeof encryptedSeed!=="string"){throw new Error("Encrypted seed is required")}if(!password||typeof password!=="string"){throw new Error("Password is required")}password=strengthenPassword(password,encryptionRounds);var hexSeed=CryptoJS.AES.decrypt(encryptedSeed,password);return converters_1.default.hexStringToString(hexSeed.toString())},generateRandomUint32Array:function(length){if(!length||length<0){throw new Error("Missing or invalid array length")}var a=secure_random_1.default.randomUint8Array(length);var b=secure_random_1.default.randomUint8Array(length);var result=new Uint32Array(length);for(var i=0;i<length;i++){var hash=converters_1.default.byteArrayToHexString(sha256(""+a[i]+b[i]));var randomValue=parseInt(hash.slice(0,13),16);result.set([randomValue],i)}return result}}},{"../config":98,"../constants":99,"../libs/axlsign":102,"../libs/base58":103,"../libs/blake2b":105,"../libs/converters":106,"../libs/secure-random":108,"../libs/sha3":109,"./concat":112,"crypto-js":13}],115:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var config_1=require("../config");var LOG_LEVELS={none:0,error:1,warning:2,info:3};exports.default={log:function(message,data){if(LOG_LEVELS[config_1.default.getLogLevel()]>=LOG_LEVELS.info){console.log(message,data)}},warn:function(message,data){if(LOG_LEVELS[config_1.default.getLogLevel()]>=LOG_LEVELS.warning){console.warn(message,data)}},error:function(message,data){if(LOG_LEVELS[config_1.default.getLogLevel()]>=LOG_LEVELS.error){console.error(message,data)}}}},{"../config":98}],116:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var constants=require("../constants");var config_1=require("../config");function normalizeAssetId(original){if(!original||original===constants.WAVES){return""}else{return original}}exports.normalizeAssetId=normalizeAssetId;function denormalizeAssetId(original){if(!original){return constants.WAVES}else{return original}}exports.denormalizeAssetId=denormalizeAssetId;function removeRecipientPrefix(original){if(original.slice(0,8)==="address:"){return original.slice(8)}else{return original}}exports.removeRecipientPrefix=removeRecipientPrefix;function removeAliasPrefix(original){if(original.slice(0,6)==="alias:"){return original.slice(8)}else{return original}}exports.removeAliasPrefix=removeAliasPrefix;function getTimestamp(timestamp){return(timestamp||Date.now())-config_1.default.getTimeDiff()}exports.getTimestamp=getTimestamp;function precisionCheck(precision){return precision>=0&&precision<=8}exports.precisionCheck=precisionCheck;function createRemapper(rules){return function(data){return Object.keys(data).reduce(function(result,key){var rule=rules[key];if(typeof rule==="function"){result[key]=rule(data[key])}else if(typeof rule==="string"){result[rule]=data[key]}else if(rule!==null){result[key]=data[key]}return result},{})}}exports.createRemapper=createRemapper},{"../config":98,"../constants":99}],117:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var create=require("parse-json-bignumber");var WavesRequestError_1=require("../errors/WavesRequestError");var fetch_1=require("../libs/fetch");var config_1=require("../config");var SAFE_JSON_PARSE=create();exports.POST_TEMPLATE={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"}};var key=function(product,version){return product+"/"+version};var hostResolvers=(_a={},_a[key(0,0)]=function(){return config_1.default.getNodeAddress()},_a[key(1,0)]=function(){return config_1.default.getMatcherAddress()},_a);function normalizeHost(host){return host.replace(/\/+$/,"")}exports.normalizeHost=normalizeHost;function normalizePath(path){return("/"+path).replace(/\/+/g,"/").replace(/\/$/,"")}exports.normalizePath=normalizePath;function processJSON(res){if(res.ok){return res.text().then(SAFE_JSON_PARSE)}else{return res.json().then(Promise.reject.bind(Promise))}}exports.processJSON=processJSON;function handleError(url,data){throw new WavesRequestError_1.default(url,data)}function createFetchWrapper(product,version,pipe){var resolveHost=hostResolvers[key(product,version)];return function(path,options){var url=resolveHost()+normalizePath(path);var request=fetch_1.default(url,options);if(pipe){return request.then(pipe).catch(function(data){return handleError(url,data)})}else{return request.catch(function(data){return handleError(url,data)})}}}exports.createFetchWrapper=createFetchWrapper;function wrapTransactionRequest(TransactionConstructor,preRemapAsync,postRemap,callback){return function(data,keyPair){return preRemapAsync(__assign({},data,{senderPublicKey:keyPair.publicKey})).then(function(validatedData){var transaction=new TransactionConstructor(validatedData);return transaction.prepareForAPI(keyPair.privateKey).then(postRemap).then(function(tx){return callback(__assign({},exports.POST_TEMPLATE,{body:JSON.stringify(tx)}))})})}}exports.wrapTransactionRequest=wrapTransactionRequest;var _a},{"../config":98,"../errors/WavesRequestError":101,"../libs/fetch":107,"parse-json-bignumber":39}],118:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var config_1=require("../config");var Storage=function(){function Storage(init){this._storages=Object.create(null);this._runInit=Object.create(null);this._when=Promise.resolve();this._init=init}Object.defineProperty(Storage.prototype,"currentStorage",{get:function(){return this._resolveStorage()},enumerable:true,configurable:true});Storage.prototype.get=function(key){var _this=this;return this._next(function(){return _this.currentStorage[key]||null})};Storage.prototype.getAll=function(){var _this=this;return this._next(function(){return __assign({},_this.currentStorage)})};Storage.prototype.getList=function(){return this.getAll().then(function(storage){return Object.keys(storage).map(function(key){return storage[key]})})};Storage.prototype.set=function(key,value){var _this=this;return this._next(function(){_this.currentStorage[key]=value;return value})};Storage.prototype.clear=function(){var _this=this;return this._next(function(){_this._storages=Object.create(null);_this._runInit=Object.create(null);_this._when=Promise.resolve()})};Storage.prototype._next=function(callback){var _this=this;var network=config_1.default.getNetworkByte();if(this._init&&!this._runInit[network]){this._runInit[network]=true;this._when=this._when.then(function(){return _this._init(function(key,value){_this.currentStorage[key]=value})})}this._when=this._when.then(callback||function(){return null});return this._when};Storage.prototype._resolveStorage=function(){var network=config_1.default.getNetworkByte();if(!this._storages[network]){this._storages[network]=Object.create(null)}return this._storages[network]};return Storage}();function getStorage(init){return new Storage(init)}exports.getStorage=getStorage},{"../config":98}]},{},[61])(61)});
|