UNPKG

sumeru

Version:

A Realtime Javascript RIA Framework For Mobile WebApp

2 lines 247 kB
function BigInteger(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function nbi(){return new BigInteger(null)}function am1(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i}function am2(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this[e],l=this[e++]>>15,c=s*u+l*a;u=a*u+((32767&c)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(c>>>15)+s*l+(i>>>30),n[r++]=1073741823&u}return i}function am3(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this[e],l=this[e++]>>14,c=s*u+l*a;u=a*u+((16383&c)<<14)+n[r]+i,i=(u>>28)+(c>>14)+s*l,n[r++]=268435455&u}return i}function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var n=BI_RC[e.charCodeAt(t)];return null==n?-1:n}function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function bnpFromInt(e){this.t=1,this.s=0>e?-1:0,e>0?this[0]=e:-1>e?this[0]=e+DV:this.t=0}function nbv(e){var t=nbi();return t.fromInt(e),t}function bnpFromString(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return this.fromRadix(e,t),void 0;n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var a=8==n?255&e[r]:intAt(e,r);0>a?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=n,o>=this.DB&&(o-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function bnToString(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n=(1<<t)-1,r,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-->0)for(s<this.DB&&(r=this[a]>>s)>0&&(i=!0,o=int2char(r));a>=0;)t>s?(r=(this[a]&(1<<s)-1)<<t-s,r|=this[--a]>>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,0>=s&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=int2char(r));return i?o:"0"}function bnNegate(){var e=nbi();return BigInteger.ZERO.subTo(this,e),e}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(t=n-e.t,0!=t)return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0}function nbits(e){var t=1,n;return 0!=(n=e>>>16)&&(e=n,t+=16),0!=(n=e>>8)&&(e=n,t+=8),0!=(n=e>>4)&&(e=n,t+=4),0!=(n=e>>2)&&(e=n,t+=2),0!=(n=e>>1)&&(e=n,t+=1),t}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function bnpDRShiftTo(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s}function bnpLShiftTo(e,t){var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM,s;for(s=this.t-1;s>=0;--s)t[s+o+1]=this[s]>>r|a,a=(this[s]&i)<<n;for(s=o-1;s>=0;--s)t[s]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()}function bnpRShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)return t.t=0,void 0;var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}function bnpSubTo(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);i>n;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=0>r?-1:0,-1>r?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()}function bnpMultiplyTo(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+n.t]=n.am(0,r[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&BigInteger.ZERO.subTo(t,t)}function bnpSquareTo(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}function bnpDivRemTo(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=t&&t.fromInt(0),null!=n&&this.copyTo(n),void 0;null==n&&(n=nbi());var o=nbi(),a=this.s,s=e.s,u=this.DB-nbits(r[r.t-1]);u>0?(r.lShiftTo(u,o),i.lShiftTo(u,n)):(r.copyTo(o),i.copyTo(n));var l=o.t,c=o[l-1];if(0!=c){var f=c*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),d=this.FV/f,p=(1<<this.F1)/f,h=1<<this.F2,g=n.t,_=g-l,m=null==t?nbi():t;for(o.dlShiftTo(_,m),n.compareTo(m)>=0&&(n[n.t++]=1,n.subTo(m,n)),BigInteger.ONE.dlShiftTo(l,m),m.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--_>=0;){var v=n[--g]==c?this.DM:Math.floor(n[g]*d+(n[g-1]+h)*p);if((n[g]+=o.am(0,v,n,_,0,l))<v)for(o.dlShiftTo(_,m),n.subTo(m,n);n[g]<--v;)n.subTo(m,n)}null!=t&&(n.drShiftTo(l,t),a!=s&&BigInteger.ZERO.subTo(t,t)),n.t=l,n.clamp(),u>0&&n.rShiftTo(u,n),0>a&&BigInteger.ZERO.subTo(n,n)}}}function bnMod(e){var t=nbi();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(BigInteger.ZERO)>0&&e.subTo(t,t),t}function Classic(e){this.m=e}function cConvert(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function cRevert(e){return e}function cReduce(e){e.divRemTo(this.m,null,e)}function cMulTo(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function cSqrTo(e,t){e.squareTo(t),this.reduce(t)}function bnpInvDigit(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=15&t*(2-(15&e)*t),t=255&t*(2-(255&e)*t),t=65535&t*(2-(65535&(65535&e)*t)),t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Montgomery(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function montConvert(e){var t=nbi();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(BigInteger.ZERO)>0&&this.m.subTo(t,t),t}function montRevert(e){var t=nbi();return e.copyTo(t),this.reduce(t),t}function montReduce(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e[n]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function montSqrTo(e,t){e.squareTo(t),this.reduce(t)}function montMulTo(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(e,t){if(e>4294967295||1>e)return BigInteger.ONE;var n=nbi(),r=nbi(),i=t.convert(this),o=nbits(e)-1;for(i.copyTo(n);--o>=0;)if(t.sqrTo(n,r),(e&1<<o)>0)t.mulTo(r,i,n);else{var a=n;n=r,r=a}return t.revert(n)}function bnModPowInt(e,t){var n;return n=256>e||t.isEven()?new Classic(t):new Montgomery(t),this.exp(e,n)}function Arcfour(){this.i=0,this.j=0,this.S=new Array}function ARC4init(e){var t,n,r;for(t=0;256>t;++t)this.S[t]=t;for(n=0,t=0;256>t;++t)n=255&n+this.S[t]+e[t%e.length],r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0}function ARC4next(){var e;return this.i=255&this.i+1,this.j=255&this.j+this.S[this.i],e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[255&e+this.S[this.i]]}function prng_newstate(){return new Arcfour}function rng_seed_int(e){rng_pool[rng_pptr++]^=255&e,rng_pool[rng_pptr++]^=255&e>>8,rng_pool[rng_pptr++]^=255&e>>16,rng_pool[rng_pptr++]^=255&e>>24,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(e){var t;for(t=0;t<e.length;++t)e[t]=rng_get_byte()}function SecureRandom(){}function parseBigInt(e,t){return new BigInteger(e,t)}function linebrk(e,t){for(var n="",r=0;r+t<e.length;)n+=e.substring(r,r+t)+"\n",r+=t;return n+e.substring(r,e.length)}function byte2Hex(e){return 16>e?"0"+e.toString(16):e.toString(16)}function pkcs1pad2(e,t){if(t<e.length+11)return console.log("Message too long for RSA"),null;for(var n=new Array,r=e.length-1;r>=0&&t>0;){var i=e.charCodeAt(r--);128>i?n[--t]=i:i>127&&2048>i?(n[--t]=128|63&i,n[--t]=192|i>>6):(n[--t]=128|63&i,n[--t]=128|63&i>>6,n[--t]=224|i>>12)}n[--t]=0;for(var o=new SecureRandom,a=new Array;t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new BigInteger(n)}function RSAKey(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function RSASetPublic(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=parseBigInt(e,16),this.e=parseInt(t,16)):console.log("Invalid RSA public key")}function RSADoPublic(e){return e.modPowInt(this.e,this.n)}function RSAEncrypt(e){var t=pkcs1pad2(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r}function bnClone(){var e=nbi();return this.copyTo(e),e}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(e){if(null==e&&(e=10),0==this.signum()||2>e||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=nbv(n),i=nbi(),o=nbi(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substr(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a}function bnpFromRadix(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),i=!1,o=0,a=0,s=0;s<e.length;++s){var u=intAt(e,s);0>u?"-"==e.charAt(s)&&0==this.signum()&&(i=!0):(a=t*a+u,++o>=n&&(this.dMultiply(r),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),i&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(e,t,n){if("number"==typeof t)if(2>e)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(e-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(BigInteger.ONE.shiftLeft(e-1),this);else{var r=new Array,i=7&e;r.length=(e>>3)+1,t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function bnToByteArray(){var e=this.t,t=new Array;t[0]=this.s;var n=this.DB-e*this.DB%8,r,i=0;if(e-->0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)8>n?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=255&this[e]>>(n-=8),0>=n&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t}function bnEquals(e){return 0==this.compareTo(e)}function bnMin(e){return this.compareTo(e)<0?this:e}function bnMax(e){return this.compareTo(e)>0?this:e}function bnpBitwiseTo(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;o>r;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()}function op_and(e,t){return e&t}function bnAnd(e){var t=nbi();return this.bitwiseTo(e,op_and,t),t}function op_or(e,t){return e|t}function bnOr(e){var t=nbi();return this.bitwiseTo(e,op_or,t),t}function op_xor(e,t){return e^t}function bnXor(e){var t=nbi();return this.bitwiseTo(e,op_xor,t),t}function op_andnot(e,t){return e&~t}function bnAndNot(e){var t=nbi();return this.bitwiseTo(e,op_andnot,t),t}function bnNot(){for(var e=nbi(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function bnShiftLeft(e){var t=nbi();return 0>e?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function bnShiftRight(e){var t=nbi();return 0>e?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function lbit(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function bnGetLowestSetBit(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+lbit(this[e]);return this.s<0?this.t*this.DB:-1}function cbit(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function bnBitCount(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=cbit(this[n]^t);return e}function bnTestBit(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)}function bnpChangeBit(e,t){var n=BigInteger.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n}function bnSetBit(e){return this.changeBit(e,op_or)}function bnClearBit(e){return this.changeBit(e,op_andnot)}function bnFlipBit(e){return this.changeBit(e,op_xor)}function bnpAddTo(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);i>n;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=0>r?-1:0,r>0?t[n++]=r:-1>r&&(t[n++]=this.DV+r),t.t=n,t.clamp()}function bnAdd(e){var t=nbi();return this.addTo(e,t),t}function bnSubtract(e){var t=nbi();return this.subTo(e,t),t}function bnMultiply(e){var t=nbi();return this.multiplyTo(e,t),t}function bnSquare(){var e=nbi();return this.squareTo(e),e}function bnDivide(e){var t=nbi();return this.divRemTo(e,t,null),t}function bnRemainder(e){var t=nbi();return this.divRemTo(e,null,t),t}function bnDivideAndRemainder(e){var t=nbi(),n=nbi();return this.divRemTo(e,t,n),new Array(t,n)}function bnpDMultiply(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function NullExp(){}function nNop(e){return e}function nMulTo(e,t,n){e.multiplyTo(t,n)}function nSqrTo(e,t){e.squareTo(t)}function bnPow(e){return this.exp(e,new NullExp)}function bnpMultiplyLowerTo(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;var i;for(i=n.t-this.t;i>r;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(i=Math.min(e.t,t);i>r;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()}function bnpMultiplyUpperTo(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)}function Barrett(e){this.r2=nbi(),this.q3=nbi(),BigInteger.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function barrettConvert(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=nbi();return e.copyTo(t),this.reduce(t),t}function barrettRevert(e){return e}function barrettReduce(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function barrettSqrTo(e,t){e.squareTo(t),this.reduce(t)}function barrettMulTo(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function bnModPow(e,t){var n=e.bitLength(),r,i=nbv(1),o;if(0>=n)return i;r=18>n?1:48>n?3:144>n?4:768>n?5:6,o=8>n?new Classic(t):t.isEven()?new Barrett(t):new Montgomery(t);var a=new Array,s=3,u=r-1,l=(1<<r)-1;if(a[1]=o.convert(this),r>1){var c=nbi();for(o.sqrTo(a[1],c);l>=s;)a[s]=nbi(),o.mulTo(c,a[s-2],a[s]),s+=2}var f=e.t-1,d,p=!0,h=nbi(),g;for(n=nbits(e[f])-1;f>=0;){for(n>=u?d=e[f]>>n-u&l:(d=(e[f]&(1<<n+1)-1)<<u-n,f>0&&(d|=e[f-1]>>this.DB+n-u)),s=r;0==(1&d);)d>>=1,--s;if((n-=s)<0&&(n+=this.DB,--f),p)a[d].copyTo(i),p=!1;else{for(;s>1;)o.sqrTo(i,h),o.sqrTo(h,i),s-=2;s>0?o.sqrTo(i,h):(g=i,i=h,h=g),o.mulTo(h,a[d],i)}for(;f>=0&&0==(e[f]&1<<n);)o.sqrTo(i,h),g=i,i=h,h=g,--n<0&&(n=this.DB-1,--f)}return o.revert(i)}function bnGCD(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(0>o)return t;for(o>i&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n}function bnpModInt(e){if(0>=e)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n}function bnModInverse(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return BigInteger.ZERO;for(var n=e.clone(),r=this.clone(),i=nbv(1),o=nbv(0),a=nbv(0),s=nbv(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;r.isEven();)r.rShiftTo(1,r),t?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(e,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);n.compareTo(r)>=0?(n.subTo(r,n),t&&i.subTo(a,i),o.subTo(s,o)):(r.subTo(n,r),t&&a.subTo(i,a),s.subTo(o,s))}return 0!=r.compareTo(BigInteger.ONE)?BigInteger.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s}function bnIsProbablePrime(e){var t,n=this.abs();if(1==n.t&&n[0]<=lowprimes[lowprimes.length-1]){for(t=0;t<lowprimes.length;++t)if(n[0]==lowprimes[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<lowprimes.length;){for(var r=lowprimes[t],i=t+1;i<lowprimes.length&&lplim>r;)r*=lowprimes[i++];for(r=n.modInt(r);i>t;)if(0==r%lowprimes[t++])return!1}return n.millerRabin(e)}function bnpMillerRabin(e){var t=this.subtract(BigInteger.ONE),n=t.getLowestSetBit();if(0>=n)return!1;var r=t.shiftRight(n);e=e+1>>1,e>lowprimes.length&&(e=lowprimes.length);for(var i=nbi(),o=0;e>o;++o){i.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var a=i.modPow(r,this);if(0!=a.compareTo(BigInteger.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<n&&0!=a.compareTo(t);)if(a=a.modPowInt(2,this),0==a.compareTo(BigInteger.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0}function pkcs1unpad2(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var i="";++r<n.length;){var o=255&n[r];128>o?i+=String.fromCharCode(o):o>191&&224>o?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}function RSASetPrivate(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=parseBigInt(e,16),this.e=parseInt(t,16),this.d=parseBigInt(n,16)):console.log("Invalid RSA private key")}function RSASetPrivateEx(e,t,n,r,i,o,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=parseBigInt(e,16),this.e=parseInt(t,16),this.d=parseBigInt(n,16),this.p=parseBigInt(r,16),this.q=parseBigInt(i,16),this.dmp1=parseBigInt(o,16),this.dmq1=parseBigInt(a,16),this.coeff=parseBigInt(s,16)):console.log("Invalid RSA private key")}function RSAGenerate(e,t){var n=new SecureRandom,r=e>>1;this.e=parseInt(t,16);for(var i=new BigInteger(t,16);;){for(;this.p=new BigInteger(e-r,1,n),0!=this.p.subtract(BigInteger.ONE).gcd(i).compareTo(BigInteger.ONE)||!this.p.isProbablePrime(10););for(;this.q=new BigInteger(r,1,n),0!=this.q.subtract(BigInteger.ONE).gcd(i).compareTo(BigInteger.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(BigInteger.ONE),s=this.q.subtract(BigInteger.ONE),u=a.multiply(s);if(0==u.gcd(i).compareTo(BigInteger.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(u),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}}function RSADoPrivate(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(n)<0;)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)}function RSADecrypt(e){var t=parseBigInt(e,16),n=this.doPrivate(t);return null==n?null:pkcs1unpad2(n,this.n.bitLength()+7>>3)}var SUMERU_APP_FW_DEBUG=!1;!function(e,t){var n="NAMESPACE",r="sumeru_AppFW",i={},o=!1,a=function(e,t){Library.net.get({url:e,callback:function(e){var n={};new Function("exports",e).call(null,n),t&&t(n)}})},s=function(e){function t(){}var r,o={};return Object.create?r=Object.create(o):(t.prototype=o,r=new t,r.__getPrototypeof=function(){return o}),r.__namespace=n,r.__isSeal=!1,r.__require=function(e,t,n){a(e,function(e){t&&t(e),n&&r.__reg(n,e)})},r.__runTraps=function(t){var n=i[e].traps[t];n&&n.length>0&&n.forEach(function(e){e(r[t])})},r.__reg=function(e,t,n){return n?r[e]=t:o[e]=t,r.__runTraps(e),t},r.__regAsync=function(e,t){return function(n){t?r[e]=n:o[e]=n,r.__runTraps(e)}},r.__load=function(e){return r[e]},r.__loadAsync=function(t,n){var o;o=i[e].traps[t]?i[e].traps[t]:i[e].traps[t]=[],o.push(n),void 0!==r[t]&&n(r[t])},r.addSubPackage=function(t){var n=e+"."+t;if(i[e].isSeal)throw'package ["'+e+'"] has sealed.';if(i[n])throw'package ["'+n+'"] already exists';return o[t]=s(n),i[n]={spaceObj:r[t],isSeal:!1,traps:{}},o[t]},r.__clear=function(){var t;if(!i[e].isSeal){for(var a in o)t=o[a],t.__namespace===n&&(t.__clear(),o[a]=Object.getPrototypeOf?Object.getPrototypeOf(t):t.__getPrototypeof(),r[a]=t);i[e].isSeal=!0}},r};if(o=e[t],e[t]=s(r),i[r]={spaceObj:e[t],isSeal:!1,traps:{}},o)for(var u in o)e[t].__reg([u],o[u]);e[t].clear=function(){e[t].__clear(),e[t].seal=void 0,delete e[t].seal,e[t]=Object.getPrototypeOf(e[t])},"undefined"!=typeof module&&module.exports&&(GLOBAL[t]=e[t],module.exports=function(){return e[t]}),SUMERU_APP_FW_DEBUG&&(e.DEBUG_PKG_MAPPING=i,e[t].__reg("SUMERU_APP_FW_DEBUG",!0))}(this,"sumeru");var Run_UnitTest_PKG=function(){var e=sumeru;a=fw.addSubPackage("a"),b=a.addSubPackage("b"),a.__loadAsync("name",function(e){console.log("fire trap...fw.a.name : "+e)}),b.__loadAsync("name",function(e){console.log("fire trap...fw.b.name : "+e)}),fw.a.b.__reg("age",100,!0),b.__loadAsync("age",function(e){console.log("fire trap...fw.b.age : "+e)});var t=a.__regAsync("name"),n=fw.a.b.__regAsync("name");setTimeout(function(){t("package fw.a"),n("package fw.a.b");for(var e=100;110>e;e++)n("name _ "+e);console.log(a.b.age),console.log(fw.a.b.age),console.log("async done...")},1e3),fw.clear(),console.log(void 0===fw.a.b.age),console.log(100===e.a.b.age),console.log(void 0===fw.addSubPackage),console.log(void 0===fw.a.addSubPackage),console.log(void 0===fw.a.b.addSubPackage),console.log(void 0===a.addSubPackage),console.log(void 0===b.addSubPackage)},_log=function(){console&&console.log.apply(this,arguments)},logTrace_level=1,configLogTrace=function(e){logTrace_level=e},getLogTrace=function(e){if(0==logTrace_level)return"";if(sumeru.IS_SUMERU_SERVER&&logTrace_level&!1)return"";if(!sumeru.IS_SUMERU_SERVER&&logTrace_level&!1)return"";var t="",n="";try{throw new Error}catch(r){t=r.stack.split("\n")}return n="Error"==t[0]?t[3]:t[2]},arrPush=Array.prototype.push,runnable=function(e){var t=e.SUMERU_APP_FW_DEBUG||!1,n={log:function(){arrPush.call(arguments,getLogTrace(arguments.callee)),_log.apply(console,arguments)},dev:function(){t!==!1&&(arrPush.call(arguments,getLogTrace(arguments.callee)),_log.apply(console,arguments))}};e.__reg("log",n.log),e.__reg("dev",n.dev),e.__reg("ConfigLogTrace",configLogTrace);var r={};return e.__reg("logtimeclear",function(e){delete r[e]}),e.__reg("logtime",function(e,t){if("string"!=typeof e||null===e.match(/\w{11}/))return console.log(e,t),void 0;var n=0;r[e]&&(n=(new Date).getTime()-r[e]),r[e]=(new Date).getTime(),_log("["+e+"] ["+n+"]"+t)}),e.__reg("logerror",function(){arguments[0]=formatDate()+arguments[0],console&&console.error.apply(this,arguments)}),n};"undefined"!=typeof module&&module.exports?module.exports=runnable:runnable(sumeru);var runnable=function(e){function t(e){s(e).forEach(function(t){this[t]=e[t]},this)}if(e.utils)return e.utils;var n=e.addSubPackage("utils"),r=Array.prototype.splice,i=Array.prototype.concat,o=Array.isArray,a=function(e){return r.apply(e,r.call(arguments,1))},s=Object.keys,u=function(e){return i.apply(a(e,0),a(arguments,1))},l=n.__reg("cpp",function(e){var n=a(arguments,1);return n.forEach(t,e),e}),c=n.__reg("extendFrom",function(e,t){var n=null,r=function(){};return Object.create?n=Object.create(e):(r.prototype=e,n=new r),l(n,t)}),f=n.__reg("getProxy",function(e,t){var n={};return t.forEach(function(e){var t=this;n[e]=function(){if(t[e]instanceof Function)return t[e].apply(t,arguments);throw e+" is not a function"}},e),n}),d=n.__reg("cleanObj",function(e,t){var n=Object.keys(e);n.forEach(function(e){try{"isDestroy"!=e&&(t&&t(this[e]),"array"==typeof this[e]&&(this[e].length=0),delete this[e])}catch(n){}},e)}),p=n.__reg("encodeURIComponentFull",function(e){var t=encodeURIComponent(e);return t=t.replace(/!/g,"%21"),t=t.replace(/\*/g,"%2A"),t=t.replace(/'/g,"%27"),t=t.replace(/\(/g,"%28"),t=t.replace(/\)/g,"%29"),t=t.replace(/\./g,"%2E"),t=t.replace(/\-/g,"%2D"),t=t.replace(/\_/g,"%5F"),t=t.replace(/\~/g,"%7E")}),h=n.__reg("uriParamToMap",function(e){var t={};if(!e)return t;var n=e.split("&");return n.forEach(function(e){var t=e.split("=");t[0]&&(this[t[0]]=decodeURIComponent(t[1]))},t),t}),g=function(e,t){var n=[];return e.forEach(function(e){n.push(p(e))}),n.join(t)},_=n.__reg("mapToUriParam",function(e){var t=[],n=null;return"object"!=typeof e||Array.isArray(e)?"":(n=Object.keys(e),n.forEach(function(n){var r=e[n];switch(typeof r){case"string":case"number":case"boolean":t.push(n+"="+p(r));case"object":Array.isArray(r)&&t.push(n+"="+g(r));default:return}}),t.join("&"))}),m=n.__reg("randomInt",function(e,t){return Math.floor(Math.random()*(t-e+1)+e)}),v="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ",b=v.length-1;n.__reg("randomStr",function M(e){for(var t="",n=0;e>n;n++)t+=v[m(0,b)];return t});var y=n.__reg("parseJSON",function(e){return new Function("window","document","sumeru","XMLHttpRequest","return "+e+";").call({},void 0,void 0,void 0,void 0)}),S=n.__reg("isSimpleType",function(e){switch(typeof e){case"string":case"number":case"boolean":return!0}return!1}),w=n.__reg("setStyles",function k(e,t){var n=e.style,r="",i=/^(left|top|bottom|right|width|height)$/i;for(var o in t)r=t[o],"number"==typeof t[o]&&i.test(o)&&(r+="px"),n[o]=r;return e});e.utils.__reg("chain",function(e,t){if(!Array.isArray(e))return!1;var n=e[0].length;if(!e.every(function(e){return e instanceof Function&&e.length===n}))return!1;var r=0,i=null;return i=function(){var n=e[r++];if(void 0!==n){var o=u(arguments,i);n.apply(this,o)}else t.apply(this,a(arguments,0))}}),e.utils.__reg("getTimeStamp",function(){return(new Date).valueOf()});var E={};e.__random=function(e){e=e||10;for(var t="qwertyuiopasdfghjklzxcvbnm1234567890",n=t.length,r=e,i="";r--;)i+=t.charAt(Math.floor(Math.random()*n));return E[i]?random(e):(E[i]=1,i)};var T=function(e){if(!e)return e;var t=[Number,String,Boolean],n;if(t.forEach(function(t){e instanceof t&&(n=t(e))}),"undefined"==typeof n)if("[object Array]"===Object.prototype.toString.call(e))n=[],e.forEach(function(e,t,r){n[t]=T(e)});else if("object"==typeof e)if(e.nodeType&&"function"==typeof e.cloneNode)var n=e.cloneNode(!0);else if(e.prototype)n=e;else if(e instanceof Date)n=new Date(e);else{n={};for(var r in e)n[r]=T(e[r])}else n=e;return n};e.utils.__reg("deepClone",T);var C=function(e,t){var n=T(e);for(x in t)"undefined"!=typeof n[x]?!1:n[x]=t[x];return n};e.utils.__reg("merge",C);var I=function(){this._events={}};I.prototype={addEventListener:function(e,t){if("function"!=typeof t)throw new Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",e,"function"==typeof t.listener?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned){var n;n=this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}return this},on:function(e,t){return this.addEventListener.apply(this,arguments)},once:function(e,t){function n(){r.removeListener(e,n),t.apply(this,arguments)}if("function"!=typeof t)throw new Error(".once only takes instances of Function");var r=this;return n.listener=t,r.on(e,n),this},removeListener:function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[e])return this;var n=this._events[e];if(o(n)){for(var r=-1,i=0,a=n.length;a>i;i++)if(n[i]===t||n[i].listener&&n[i].listener===t){r=i;break}if(0>r)return this;n.splice(r,1),0==n.length&&delete this._events[e]}else(n===t||n.listener&&n.listener===t)&&delete this._events[e];return this},removeAllListeners:function(e){return 0===arguments.length?(this._events={},this):(e&&this._events&&this._events[e]&&(this._events[e]=null),this)},emit:function(e){var t=arguments[0];if(!this._events)return!1;var n=this._events[t];if(!n)return!1;if("function"==typeof n){switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(var r=arguments.length,i=new Array(r-1),a=1;r>a;a++)i[a-1]=arguments[a];n.apply(this,i)}return!0}if(o(n)){for(var r=arguments.length,i=new Array(r-1),a=1;r>a;a++)i[a-1]=arguments[a];for(var s=n.slice(),a=0,r=s.length;r>a;a++)s[a].apply(this,i);return!0}return!1}},e.utils.__reg("emitter",I)};"undefined"!=typeof module&&module.exports?module.exports=runnable:runnable(sumeru);var runnable=function(e){e.event=e.event||{},e.event.domReady=function(e){/complete|loaded|interactive/.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",function(){e()},!1)},e.event.onload=function(e){/complete/.test(document.readyState)?e():window.onload=function(){e()}},e.event.mapEvent=function(e,t){var n=document.querySelector(e);if(n)for(var r in t)"function"==typeof t[r]&&(r=r.split(","),r.forEach(function(e){n.addEventListener(e.trim(),t[r])}))}};"undefined"!=typeof module&&module.exports?module.exports=runnable:runnable(sumeru);var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);BigInteger.prototype.am=am3,dbits=28,BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;9>=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next; var rng_psize=256,rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new Array,rng_pptr=0;for(var t,z;rng_psize>rng_pptr;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=255&t;rng_pptr=0,rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes,RSAKey.prototype.doPublic=RSADoPublic,RSAKey.prototype.setPublic=RSASetPublic,RSAKey.prototype.encrypt=RSAEncrypt,NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,RSAKey.prototype.doPrivate=RSADoPrivate,RSAKey.prototype.setPrivate=RSASetPrivate,RSAKey.prototype.setPrivateEx=RSASetPrivateEx,RSAKey.prototype.generate=RSAGenerate,RSAKey.prototype.decrypt=RSADecrypt;var runnable=function(e,t,n){var r={e:"3"};e.addSubPackage("myrsa");var i=function(e,t){var n=new RSAKey,i="";n.setPublic(t,r.e);var o=n.encrypt(e);return o&&(o=linebrk(o,64)),o},o=function(e){var t=new RSAKey;if(0==e.length)return e;t.setPrivateEx(r.n,r.e,r.d,r.p,r.q,r.dmp1,r.dmq1,r.coeff);var n=t.decrypt(e);return n&&(n=n),n},a=function(e,t){if("string"!=typeof e||!f())return console.log("RSA encrypt canceled",e),e;if(!r.pk2&&"undefined"==typeof t)return console.log("pk2 没传入,rsa加密不启用"),e;t="string"==typeof t?t:r.pk2;for(var n=[],o=0,a=e.length;a>o;o+=5)n.push(i(e.substr(o,5),t));return n.join("|")},s=function(e){if("string"!=typeof e||!f())return console.log("RSA decrypt canceled",e),e;for(var t="",n=e.split("|"),r=0,i=n.length;i>r;r++)t+=o(n[r]);return t},u=function(e){var t=new RSAKey;return r.bits="number"==typeof e?e:128,t.generate(parseInt(r.bits),r.e),r.n=linebrk(t.n.toString(16),64),r.d=linebrk(t.d.toString(16),64),r.p=linebrk(t.p.toString(16),64),r.q=linebrk(t.q.toString(16),64),r.dmp1=linebrk(t.dmp1.toString(16),64),r.dmq1=linebrk(t.dmq1.toString(16),64),r.coeff=linebrk(t.coeff.toString(16),64),r},l=function(){return r.n},c=function(e){r.pk2=e},f=function(){return e.config.get("rsa_enable")},d=function(){return r.pk2};"undefined"!=typeof t&&u(),e.myrsa.__reg("encrypt",a,"private"),e.myrsa.__reg("decrypt",s,"private"),e.myrsa.__reg("generate",u,"private"),e.myrsa.__reg("getPk",l,"private"),e.myrsa.__reg("setPk2",c,"private"),e.myrsa.__reg("getPk2",d,"private")};"undefined"!=typeof module&&module.exports?module.exports=runnable:runnable(sumeru);var runnable=function(e){if(!e.netMessage){var t=e.addSubPackage("netMessage"),n={0:"onLocalMessage",100:"onError",200:"onMessage",300:"onGlobalError",400:"onGlobalMessage",500:"onLogMessage"},r=Array.prototype.splice,i=e.IS_SUMERU_SERVER,o=Object.create(n),a=null,s=null,u=!1,l=null,c=[],f=[],d=[],p=[],h=function(e){var t=[];return e.forEach(function(e){t.push(e.filter)}),t},g=function(t){var n=null;return n=e.utils.parseJSON(t),void 0===n.number||void 0===n.type||void 0===n.content?!1:n};t.__reg("decodeMessage",g);var _=function(t,n,r){var i={number:n+"",type:null,target:r+"",content:null};return e.utils.isSimpleType(t)?(i.type="simple",i.content=t):(i.type="json",i.content="0"!==n?JSON.stringify(t):t),i};t.__reg("encodeMessage",_);var m=function(e){var t=null;if("0"===e.number)return S(e);if(t=i===!0&&"600"===e.number?l:s,null===t)throw"no output";return Array.prototype.splice.call(arguments,0,1,JSON.stringify(e)),t.apply({},arguments)},v=function(t){return function(n,i){var o=_(n,t,i),a=r.call(arguments,0),s=a[a.length-2];if(0!==p.length){var u=e.utils.chain(p,function(e){a.splice(0,2,e),m.apply({},a)});u(o,s instanceof Function?s:function(){})}else a.splice(0,2,o),m.apply({},a)}},b=function(){var e;for(var n in o)e=o[n],e="send"+e.substr(2),t.__reg(e,v(n));u=!0},y=function(e,t){return e.order<t.order};t.__reg("addInFilter",function(t,n){var r=2==t.length?function(n,r,i){var o=null;try{o=t(n,r)}catch(a){return e.log(a),void 0}i(o,r)}:t;c.push({filter:r,order:void 0===n?Number.MIN_VALUE:n}),c.sort(y),f=h(c)},!1),t.__reg("addOutFilter",function(e,t){var n=1==e.length?function(t,n,r){var i=null;try{i=e(t)}catch(o){n(o)}r(i,n)}:e;d.push({filter:n,order:void 0===t?Number.MIN_VALUE:t}),d.sort(y),p=h(d)},!1),t.__reg("onData",function(t,n){var r=null;try{r=g(t)}catch(o){throw"Server : "+t}if(i&&e.SUMERU_APP_FW_DEBUG===!1)try{S(r,n)}catch(o){console.error(o)}else S(r,n)},!1),t.__reg("addACL",function(e,t){var r=t;0!==t.indexOf("on")&&(r="on"+t.substr(0,1).toUpperCase()+t.substr(1)),void 0===n[e]&&(o[e]=r,b())},!1),t.__reg("setOutput",function(e){if(!(e instanceof Function))throw"__output is not a function.";s=e},!1),i&&(n["600"]="onS2SMessage",t.__reg("setOutputToServer",function(e){if(!(e instanceof Function))throw"__output is not a function.";l=e})),t.__reg("setReceiver",function(e){a=a||{};var t,n,r,i,s,l=!1;for(var c in o)if(t=o[c],s=e[t],void 0!==s){if(s instanceof Function)n="",r=s;else{if(n=s.target||"",l=!!s.overwrite,!(r=s.handle)instanceof Function)continue;r.once=!!s.once}i=a[t]=a[t]||{},Array.isArray(n)?n.forEach(function(e){l!==!0&&this[e]?Array.isArray(this[e])===!0&&this[e].push(r):this[e]=[r]},i):l!==!0&&i[n]?Array.isArray(i[n])===!0&&i[n].push(r):i[n]=[r]}Object.keys(o).forEach(function(e){this[o[e]]instanceof Function&&(a[o[e]]=this[o[e]])},e),0==u&&b()},!1);var S=function(t,n){var r=null,i=null,s=!1,u=null;if(null===a)throw"no receiver";if(void 0===t.number)return!1;if(void 0===(r=o[t.number]))return e.log("unidentifiable message number"),!1;if(void 0===a[r])return e.log("no receiver found"),!1;if(i=a[r][t.target||""],void 0===i&&""!==t.target&&(i=a[r][""],void 0===i))return!1;var l=function(){u="json"==t.type&&"0"!==t.number?e.utils.parseJSON(t.content):t.content;var o=[];if(i.forEach(function(e,r){e instanceof Function&&(s=s||e(u,t.target,n)),e.once&&o.push(r)}),o.length>0)if(o.length==i.length)i.length=0,delete a[r][t.target||""];else for(var l=void 0;void 0!==(l=o.pop());)i.splice(l,1);return s===!1&&"100"==t.number?(t.number="300",S(t,n)):s===!1&&"200"==t.number?(t.number="400",S(t,n)):void 0};if(0!==f.length){var c=e.utils.chain(f,l);c(t,n)}else l()};return e.dev("runing [NetMessage] in "+(e.IS_SUMERU_SERVER?"server":"client")),t}};"undefined"!=typeof module&&module.exports?module.exports=runnable:runnable(sumeru);var runnable=function(e){!function(e){if(e.sense)return e.sense;var t=e.addSubPackage("sense");t.__reg("runSenseContext",function(e){t.__reg("_senseInspector",function(t,n){t.addObserver(n,e)},!0),e(),t.__reg("_senseInspector",function(){},!0)});var n={get:function(e){return t._senseInspector&&t._senseInspector(this,e),"object"!=typeof this.container?(console.warn("no container error in sense get on line 38 "+e),void 0):this.container[e]},set:function(e,t){if(this.container[e]=t,0!=this.observer.length)for(var n=0,r=this.observer.length;r>n;n++)this.observer[n].key!=e||this.toBeCommited.some(function(e){return e(this.observer[n])},this)||this.toBeCommited.push(function(t,n){return function(r){return 0!==arguments.length?r==n:(n.customClosure.call(t,e),void 0)}}(this,this.observer[n]))},commit:function(){var t=this.toBeCommited;if(0===t.length)return!0;var n=[];e.controller.__reg("_tapped_blocks",n,!0);for(var r=0,i=t.length;i>r;r++)t[r]();e.controller.__load("reactiveRender")(n),t.length=0},addObserver:function(e,t){for(var n=0,r=this.observer.length;r>n;n++)if(this.observer[n].key===e&&this.observer[n].customClosure==t)return;this.observer.push({key:e,customClosure:t})},removeObserver:function(e){for(var t=0,n=this.observer.length;n>t;t++)if(this.observer[t].customClosure===e)return this.observer.splice(t,1),void 0},cleanObserver:function(){this.observer.length=0,this.toBeCommited.length=0}};t.__reg("extend",function(t,r){var i=function(){return function(){this.toBeCommited=[],this.observer=[],this.container={},t.apply(this,arguments)}}(t);return i.prototype=e.utils.cpp(r||t.prototype,n),i})}(e)};"undefined"!=typeof module&&module.exports?module.exports=runnable:runnable(sumeru);var runnable=function(e){var t=e.addSubPackage("session"),n={},r={},i=e.utils.parseJSON,o=function(e){return JSON.parse(JSON.stringify(resumeObj))},a=e.utils.isSimpleType,s,u,l,c=e.sense.extend(function(e){this.__identifier=e,this.__hashKey=[],this.__snapshot={},this.__getId=function(){return e}});s=c.prototype.get,u=c.prototype.set,l=c.prototype.commit,c.prototype.get=function(e){return function(){return e.apply(this,arguments)}}(s),c.prototype.getContainer=function(){return this.container},c.prototype.set=function(e){return function(t,n){return e.call(this,t,n)}}(u),c.prototype.setIfNull=function(e){return function(t,n){if(!this.container.hasOwnProperty(t)){if(!a(n))throw"data type error";return e.call(this,t,n)}}}(u),c.prototype.commit=function(e){return function(){var n={},r=e.apply(this,arguments);return t.serialize(JSON.stringify(this.container),this.__identifier),r}}(l),c.prototype.__unserialize=function(){var e=!1,t=this.__identifier,r=n[t],o,a;if(this.__snapshot[r]&&(o=i(this.__snapshot[r])))this.container=o,e=!0;else if(""!==r&&null!=r){this.container={};for(var s in a=i(r))this.set(s,a[s]);e=!0}return e},c.prototype.clean=function(e){this.container={}},t.__reg("create",function(e){var t=null;return(t=r[e])?t:(t=r[e]=new c(e),t.__unserialize(),t)}),t.__reg("destroy",function(t){var i="string"==typeof t?r[t]:t;t=i.__identifier,e.utils.cleanObj(i),r[t]=void 0,n[t]=void 0,delete r[t],delete n[t]}),t.__reg("serialize",function(t){e.router.joinSessionToHash(t)},!0),t.__reg("setResumeNew",function(e,t){var o=e&&i("{"+e+"}")||{};for(var a in o)"{}"==o[a]&&(o[a]=""),n[t]=o[a];var a=t;r[a].__unserialize()&&r[a].commit()},!0),t.__reg("preResume",function(e,o){var a=e&&i("{"+e+"}")||{};for(var s in a)r[s]||t.create(s),"{}"==a[s]&&(a[s]=""),n[s]=a[s];var s=o+"!";r[s].__unserialize()},!0),t.__reg("getSessionByController",function(e){return n[e+"!"]},!0)};"undefined"!=typeof module&&module.exports?module.exports=runnable:runnable(sumeru);var ObjectId=function(){var e=0,t=Math.floor(32767*Math.random()),n=Math.floor(16777216*Math.random());if("undefined"!=typeof localStorage){var r=parseInt(localStorage.mongoMachineId);r>=0&&16777215>=r&&(n=Math.floor(localStorage.mongoMachineId)),localStorage.mongoMachineId=n,document.cookie="mongoMachineId="+n+"; path=/; expires=Tue, 19 Jan 2038 05:00:00 GMT"}else{var i=document.cookie.split("; ");for(var o in i){var a=i[o].split("=");if("mongoMachineId"==a[0]&&a[1]>=0&&a[1]<=16777215){n=a[1];break}}document.cookie="mongoMachineId="+n+";expires=Tue, 19 Jan 2038 05:00:00 GMT"}return function(){return this instanceof ObjectId?("object"==typeof arguments[0]?(this.timestamp=arguments[0].timestamp,this.machine=arguments[0].machine,this.pid=arguments[0].pid,this.increment=arguments[0].increment):"string"==typeof arguments[0]&&24==arguments[0].length?(this.timestamp=Number("0x"+arguments[0].substr(0,8)),this.machine=Number("0x"+arguments[0].substr(8,6)),this.pid=Number("0x"+arguments[0].substr(14,4)),this.increment=Number("0x"+arguments[0].substr(18,6))):4==arguments.length&&null!=arguments[0]?(this.timestamp=arguments[0],this.machine=arguments[1],this.pid=arguments[2],this.increment=arguments[3]):(this.timestamp=Math.floor((new Date).valueOf()/1e3),this.machine=n,this.pid=t,e>16777215&&(e=0),this.increment=e++),void 0):new ObjectId(arguments[0],arguments[1],arguments[2],arguments[3]).toString()}}();ObjectId.prototype.getDate=function(){return new Date(1e3*this.timestamp)},ObjectId.prototype.toString=function(){var e=this.timestamp.toString(16),t=this.machine.toString(16),n=this.pid.toString(16),r=this.increment.toString(16);return"00000000".substr(0,6-e.length)+e+"000000".substr(0,6-t.length)+t+"0000".substr(0,4-n.length)+n+"000000".substr(0,6-r.length)+r},sumeru.__reg("__ObjectId",ObjectId,!0),delete ObjectID,App="undefined"!=typeof App?App:{};var runnable=function(e){!function(e){var t=e.sense.extend(function(){}),n=function(){var e=function(){this.configMap={}},n=new t,r=function(){};return r.prototype=n,e.prototype=new r,e.prototype.set=function(){this.define.apply(this,arguments)},e.prototype.get=function(e){return n.get(e),this.configMap[e]},e.prototype.define=function(){var e;if(1==arguments.length)e=arguments[0];else{if(2!=arguments.length)throw new Error("config define error");e={},e[arguments[0]]=arguments[1]}for(var t in e)e.hasOwnProperty(t)&&(n.set(t,e[t]),this.configMap[t]=e[t])},new e},r=function(t){if("undefined"!=typeof t){var i=n(),o=function(){i.set.apply(i,arguments)};return o.defineModule=r,o.config=function(){i.set.apply(i,arguments)},o.get=function(){return i.get.apply(i,arguments)},o.set=function(e,t){i.set.apply(i,arguments)},o.commit=function(){i.commit.apply(i,arguments),"undefined"!=typeof module&&"undefined"!=typeof exports?e.pushUpdateOfConfig(i.configMap):e.netMessage.sendMessage(i.configMap,"config_push",function(e){},function(){})},this[t]=o,o}};r.call(e,"defineConfig"),e.config=e.defineConfig}(e)};"undefined"!=typeof module&&module.exports?module.exports=runnable:runnable(sumeru),function(e){e.addSubPackage("transition");var t="__viewBlock__",n=function(e){return e.replace(/(^\s*)|(\s*$)/g,"")},r=function(e){return document.getElementById(e)},i=function(e){return document.createElement(e)},o=function(e,t){var t=a(e,t);if(0!==t.length){var r=n(e.className).replace(/\s+/g," ").split(" ");r=r.concat(t),e.className=r.join(" ")}},a=function(e,t){"string"==typeof t&&(t=[t]);var n=[];return Array.prototype.forEach.call(t,function(t){var r=new RegExp("( |^)"+t+"( |$)",["i"]);e.className.match(r)||n.push(t)}),n},s=function(e,t){var r=n(e.className).replace(/\s+/g," ").split(" ");if(t instanceof Array)for(var i=0,o=r.length;o>i;i++)t.indexOf(r[i])>-1&&r.splice(i,1);else if(0===t.search("^"))for(var a=new RegExp(t,""),i=0,o=r.length;o>i;i++)r[i]&&r[i].match(a)&&r.splice(i,1);else for(var i=0,o=r.length;o>i;i++)r[i]===t&&r.splice(i,1);e.className=r.join(" ")},u=function(e,t,r){var i=n(e.className).replace(/\s+/g," ").split(" ");if(r instanceof Array)for(var o=0,a=i.length;a>o;o++)r.indexOf(i[o])>-1&&i.splice(o,1);else for(var o=0,a=i.length;a>o;o++)i[o]===r&&i.splice(o,1);i=i.concat(t),e.className=i.join(" ")},l=function(e,t,r){var i=n(e.className).replace(/\s+/g," ").split(" "),o=i.indexOf(t),a=r?i.indexOf(r):-1;o>=0?(i.splice(o,1),r&&i.push(r)):(i.push(t),a>=0&&i.splice(a,1)),e.className=i.join(" ")},c=function(e){e.style.width="100%"},f={push:[1,1,1,1],rotate:[0,1,0,1],fade:[0,0,0,0,2],shake:[0,1,0,1],none:[0,0,0,0,2]},d={show:"_g_{$}_sw",standby:"_g_{$}_sb",hide:"_g_{$}_hd"},p=["top","right","bottom","left",""],h={push:{up:"Up",down:"Down",left:"Left",right:"Right"},bounce:{"":"",up:"Up",down:"Down",left:"Left",right:"Right"},fade:{"":"",up:"Up",down:"Down",left:"Left",right:"Right"},rotate:{"":"",up:"UpLeft",down:"DownRight",left:"DownLeft",right:"UpRight"},fl