├── dist └── out-tsc │ ├── main.d.ts │ ├── app │ ├── app.module.d.ts │ ├── app.component.d.ts │ ├── globals.d.ts │ ├── routes.d.ts │ ├── home │ │ └── home.component.d.ts │ ├── sendether │ │ └── sendether.component.d.ts │ ├── service │ │ └── shared.service.d.ts │ ├── history │ │ └── history.component.d.ts │ ├── permission │ │ └── permission.component.d.ts │ ├── withdraw-form │ │ └── withdraw-form.component.d.ts │ └── deposit-form │ │ └── deposit-form.component.d.ts │ ├── polyfills.d.ts │ ├── environments │ └── environment.d.ts │ └── vendor.d.ts ├── src ├── assets │ ├── .gitkeep │ └── style.css ├── app │ ├── app.component.css │ ├── home │ │ ├── home.component.css │ │ ├── home.component.html │ │ ├── home.component.spec.ts │ │ └── home.component.ts │ ├── history │ │ ├── history.component.css │ │ ├── history.component.html │ │ ├── history.component.spec.ts │ │ └── history.component.ts │ ├── permission │ │ ├── permission.component.css │ │ ├── permission.component.ts │ │ ├── permission.component.spec.ts │ │ └── permission.component.html │ ├── sendether │ │ ├── sendether.component.css │ │ ├── sendether.component.html │ │ ├── sendether.component.ts │ │ └── sendether.component.spec.ts │ ├── deposit-form │ │ ├── deposit-form.component.css │ │ ├── deposit-form.component.spec.ts │ │ ├── deposit-form.component.html │ │ └── deposit-form.component.ts │ ├── withdraw-form │ │ ├── withdraw-form.component.css │ │ ├── withdraw-form.component.spec.ts │ │ ├── withdraw-form.component.ts │ │ └── withdraw-form.component.html │ ├── service │ │ ├── shared.service.spec.ts │ │ └── shared.service.ts │ ├── app.component.ts │ ├── routes.ts │ ├── app.component.spec.ts │ ├── app.module.ts │ ├── app.component.html │ └── globals.ts ├── favicon.ico ├── styles.css ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── polyfills.ts ├── index.html ├── main.ts ├── tsconfig.json ├── vendor.ts ├── test.ts └── js │ └── web3.min.js ├── .gitignore ├── webpack.config.js ├── migrations ├── 1_initial_migration.js └── 2_deploy_contracts.js ├── config ├── helpers.js ├── index.html ├── webpack.dev.js ├── webpack.prod.js └── webpack.common.js ├── e2e ├── app.po.ts ├── app.e2e-spec.ts └── tsconfig.json ├── .editorconfig ├── contracts ├── Migrations.sol └── SimpleWallet.sol ├── protractor.conf.js ├── karma.conf.js ├── .angular-cli.json ├── truffle.js ├── README.md ├── package.json ├── tslint.json ├── test └── simplewallet.js └── .bootstraprc /dist/out-tsc/main.d.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | .DS_Store -------------------------------------------------------------------------------- /src/app/history/history.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/permission/permission.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/sendether/sendether.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/deposit-form/deposit-form.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/withdraw-form/withdraw-form.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./config/webpack.dev.js'); -------------------------------------------------------------------------------- /dist/out-tsc/app/app.module.d.ts: -------------------------------------------------------------------------------- 1 | export declare class AppModule { 2 | } 3 | -------------------------------------------------------------------------------- /dist/out-tsc/app/app.component.d.ts: -------------------------------------------------------------------------------- 1 | export declare class AppComponent { 2 | } 3 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ratimon/MyDWallet/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /dist/out-tsc/polyfills.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es6'; 2 | import 'core-js/es7/reflect'; 3 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /dist/out-tsc/app/globals.d.ts: -------------------------------------------------------------------------------- 1 | export declare var web3: any; 2 | export declare var SimpleWallet: any; 3 | -------------------------------------------------------------------------------- /dist/out-tsc/app/routes.d.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from "@angular/router"; 2 | export declare const routes: Routes; 3 | -------------------------------------------------------------------------------- /dist/out-tsc/environments/environment.d.ts: -------------------------------------------------------------------------------- 1 | export declare const environment: { 2 | production: boolean; 3 | }; 4 | -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | var Migrations = artifacts.require("./Migrations.sol"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | var SimpleWallet = artifacts.require("./SimpleWallet.sol"); 2 | module.exports = function(deployer) { 3 | deployer.deploy(SimpleWallet); 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /src/app/sendether/sendether.component.html: -------------------------------------------------------------------------------- 1 |
2 | Under Development 3 |
4 | 5 | 6 | 34 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | }); 11 | TestBed.compileComponents(); 12 | }); 13 | 14 | it('should create the app', async(() => { 15 | const fixture = TestBed.createComponent(AppComponent); 16 | const app = fixture.debugElement.componentInstance; 17 | expect(app).toBeTruthy(); 18 | })); 19 | 20 | it(`should have as title 'app works!'`, async(() => { 21 | const fixture = TestBed.createComponent(AppComponent); 22 | const app = fixture.debugElement.componentInstance; 23 | expect(app.title).toEqual('app works!'); 24 | })); 25 | 26 | it('should render title in a h1 tag', async(() => { 27 | const fixture = TestBed.createComponent(AppComponent); 28 | fixture.detectChanges(); 29 | const compiled = fixture.debugElement.nativeElement; 30 | expect(compiled.querySelector('h1').textContent).toContain('app works!'); 31 | })); 32 | }); 33 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare var __karma__: any; 17 | declare var require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import {SharedService} from '../service/shared.service' 3 | import * as myGlobals from '../globals' 4 | import * as _ from "lodash"; 5 | 6 | 7 | @Component({ 8 | selector: 'app-home', 9 | templateUrl: './home.component.html', 10 | styleUrls: ['./home.component.css'] 11 | }) 12 | export class HomeComponent implements OnInit { 13 | 14 | constructor(private ss: SharedService) { 15 | myGlobals.SimpleWallet.deployed().then(function(contract:any) { 16 | 17 | // var addressStore = contract.address 18 | ss.balanceInEther = myGlobals.web3.fromWei(myGlobals.web3.eth.getBalance(contract.address).toNumber(), "ether"); 19 | 20 | ss.contract_address = contract.address; 21 | ss.contract_abi = JSON.stringify(contract.contract.abi); 22 | 23 | ss.accounts = []; 24 | _.forEach(myGlobals.web3.eth.accounts, function(obj:Object) { 25 | contract.isAllowedToSend.call(obj).then(function(isAllowed:any) { 26 | ss.accounts.push({address: obj, isAllowed:isAllowed}); 27 | }) 28 | }); 29 | }); 30 | 31 | 32 | } 33 | 34 | ngOnInit() { 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 4 | import { HttpModule } from '@angular/http'; 5 | 6 | import { AppComponent } from './app.component'; 7 | import { HomeComponent } from './home/home.component'; 8 | import { HistoryComponent } from './history/history.component'; 9 | 10 | import {RouterModule} from "@angular/router" 11 | import {routes} from "./routes"; 12 | import { SendetherComponent } from './sendether/sendether.component'; 13 | import { DepositFormComponent } from './deposit-form/deposit-form.component'; 14 | import { WithdrawFormComponent } from './withdraw-form/withdraw-form.component'; 15 | 16 | import {SharedService} from './service/shared.service'; 17 | import { PermissionComponent } from './permission/permission.component' 18 | 19 | 20 | 21 | @NgModule({ 22 | declarations: [ 23 | AppComponent, 24 | HomeComponent, 25 | HistoryComponent, 26 | SendetherComponent, 27 | DepositFormComponent, 28 | WithdrawFormComponent, 29 | PermissionComponent 30 | ], 31 | imports: [ 32 | BrowserModule, 33 | FormsModule, 34 | ReactiveFormsModule, 35 | HttpModule, 36 | RouterModule.forRoot(routes, {useHash: true}) 37 | ], 38 | providers: [SharedService], 39 | bootstrap: [AppComponent] 40 | }) 41 | export class AppModule { } 42 | -------------------------------------------------------------------------------- /config/webpack.prod.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var webpackMerge = require('webpack-merge'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var commonConfig = require('./webpack.common.js'); 5 | var helpers = require('./helpers'); 6 | var path = require('path'); 7 | 8 | const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; 9 | 10 | module.exports = webpackMerge(commonConfig, { 11 | devtool: 'source-map', 12 | 13 | output: { 14 | path: path.resolve(__dirname, '../build'), 15 | publicPath: '/', 16 | filename: '[name].[hash].js', 17 | chunkFilename: '[id].[hash].chunk.js' 18 | }, 19 | 20 | // output: { 21 | // path: path.resolve(__dirname, '../src/app/dist'), 22 | // publicPath: '/', 23 | // filename: '[name].[hash].js', 24 | // chunkFilename: '[id].[hash].chunk.js' 25 | // }, 26 | 27 | plugins: [ 28 | new webpack.NoEmitOnErrorsPlugin(), 29 | new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618 30 | mangle: { 31 | keep_fnames: true 32 | } 33 | }), 34 | new ExtractTextPlugin('[name].[hash].css'), 35 | new webpack.DefinePlugin({ 36 | 'process.env': { 37 | 'ENV': JSON.stringify(ENV) 38 | } 39 | }), 40 | new webpack.LoaderOptionsPlugin({ 41 | htmlLoader: { 42 | minimize: false // workaround for ng2 43 | } 44 | }) 45 | ] 46 | }); 47 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/0.13/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | files: [ 19 | { pattern: './src/test.ts', watched: false } 20 | ], 21 | preprocessors: { 22 | './src/test.ts': ['@angular/cli'] 23 | }, 24 | mime: { 25 | 'text/x-typescript': ['ts','tsx'] 26 | }, 27 | coverageIstanbulReporter: { 28 | reports: [ 'html', 'lcovonly' ], 29 | fixWebpackSourcePaths: true 30 | }, 31 | angularCli: { 32 | config: './.angular-cli.json', 33 | environment: 'dev' 34 | }, 35 | reporters: config.angularCli && config.angularCli.codeCoverage 36 | ? ['progress', 'coverage-istanbul'] 37 | : ['progress', 'kjhtml'], 38 | port: 9876, 39 | colors: true, 40 | logLevel: config.LOG_INFO, 41 | autoWatch: true, 42 | browsers: ['Chrome'], 43 | singleRun: false 44 | }); 45 | }; 46 | -------------------------------------------------------------------------------- /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "version": "1.0.0-beta.32.3", 5 | "name": "my-dwallet" 6 | }, 7 | "apps": [ 8 | { 9 | "root": "src", 10 | "outDir": "dist", 11 | "assets": [ 12 | "assets", 13 | "favicon.ico" 14 | ], 15 | "index": "index.html", 16 | "main": "main.ts", 17 | "polyfills": "polyfills.ts", 18 | "test": "test.ts", 19 | "tsconfig": "tsconfig.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css", 23 | "../node_modules/bootstrap/dist/css/bootstrap.css" 24 | ], 25 | "scripts": [ 26 | "../node_modules/jquery/dist/jquery.js", 27 | "../node_modules/tether/dist/js/tether.js", 28 | "../node_modules/bootstrap/dist/js/bootstrap.js" 29 | ], 30 | "environmentSource": "environments/environment.ts", 31 | "environments": { 32 | "dev": "environments/environment.ts", 33 | "prod": "environments/environment.prod.ts" 34 | } 35 | } 36 | ], 37 | "e2e": { 38 | "protractor": { 39 | "config": "./protractor.conf.js" 40 | } 41 | }, 42 | "lint": [ 43 | { 44 | "files": "src/**/*.ts", 45 | "project": "src/tsconfig.json" 46 | }, 47 | { 48 | "files": "e2e/**/*.ts", 49 | "project": "e2e/tsconfig.json" 50 | } 51 | ], 52 | "test": { 53 | "karma": { 54 | "config": "./karma.conf.js" 55 | } 56 | }, 57 | "defaults": { 58 | "styleExt": "css", 59 | "component": {} 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 24 | 25 | 37 | 38 |>>0?1:0),$=$+ot,X=X+rt+($>>>0>>0?1:0),$=$+ft,X=X+ut+($>>>0 >>0?1:0);G.high=X,G.low=$}var lt=M&j^~M&z,pt=H&q^~H&L,ht=I&N^I&D^N&D,dt=O&T^O&E^T&E,mt=(I>>>28|O<<4)^(I<<30|O>>>2)^(I<<25|O>>>7),yt=(O>>>28|I<<4)^(O<<30|I>>>2)^(O<<25|I>>>7),gt=(M>>>14|H<<18)^(M>>>18|H<<14)^(M<<23|H>>>9),vt=(H>>>14|M<<18)^(H>>>18|M<<14)^(H<<23|M>>>9),bt=u[J],_t=bt.high,wt=bt.low,xt=W+vt,kt=U+gt+(xt>>>0 >>0?1:0),xt=xt+pt,kt=kt+lt+(xt>>>0 >>0?1:0),xt=xt+wt,kt=kt+_t+(xt>>>0 >>0?1:0),xt=xt+$,kt=kt+X+(xt>>>0<$>>>0?1:0),Bt=yt+dt,St=mt+ht+(Bt>>>0 >>0?1:0);U=z,W=L,z=j,L=q,j=M,q=H,H=R+xt|0,M=P+kt+(H>>>0 >>0?1:0)|0,P=D,R=E,D=N,E=T,N=I,T=O,O=xt+Bt|0,I=kt+St+(O>>>0 >>0?1:0)|0}d=r.low=d+O,r.high=h+I+(d>>>0 >>0?1:0),y=o.low=y+T,o.high=m+N+(y>>>0 >>0?1:0),v=i.low=v+E,i.high=g+D+(v>>>0 >>0?1:0),_=a.low=_+R,a.high=b+P+(_>>>0 >>0?1:0),x=s.low=x+H,s.high=w+M+(x>>>0 >>0?1:0),B=c.low=B+q,c.high=k+j+(B>>>0 >>0?1:0),C=l.low=C+L,l.high=S+z+(C>>>0>>0?1:0),F=p.low=F+W,p.high=A+U+(F>>>0 >>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),e[(r+128>>>10<<5)+31]=n,t.sigBytes=4*e.length,this._process();var o=this._hash.toX32();return o},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});n.SHA512=o._createHelper(l),n.HmacSHA512=o._createHmacHelper(l)}(),t.SHA512})},{"./core":53,"./x64-core":84}],83:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./enc-base64"),t("./md5"),t("./evpkdf"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return function(){function e(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n< >>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n< >>5]>>>31-o%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){for(var s=i[a]=[],l=f[a],r=0;r<24;r++)s[r/6|0]|=n[(u[r]-1+l)%28]<<31-r%6,s[4+(r/6|0)]|=n[28+(u[r+24]-1+l)%28]<<31-r%6;s[0]=s[0]<<1|s[0]>>>31;for(var r=1;r<7;r++)s[r]=s[r]>>>4*(r-1)+3;s[7]=s[7]<<5|s[7]>>>27}for(var p=this._invSubKeys=[],r=0;r<16;r++)p[r]=i[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,r,o){this._lBlock=t[r],this._rBlock=t[r+1],e.call(this,4,252645135),e.call(this,16,65535),n.call(this,2,858993459),n.call(this,8,16711935),e.call(this,1,1431655765);for(var i=0;i<16;i++){for(var a=o[i],s=this._lBlock,c=this._rBlock,u=0,f=0;f<8;f++)u|=l[f][((c^a[f])&p[f])>>>0];this._lBlock=c,this._rBlock=s^u}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,e.call(this,1,1431655765),n.call(this,8,16711935),n.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),t[r]=this._lBlock,t[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=a._createHelper(h);var d=s.TripleDES=a.extend({_doReset:function(){var t=this._key,e=t.words;this._des1=h.createEncryptor(i.create(e.slice(0,2))),this._des2=h.createEncryptor(i.create(e.slice(2,4))),this._des3=h.createEncryptor(i.create(e.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});r.TripleDES=a._createHelper(d)}(),t.TripleDES})},{"./cipher-core":52,"./core":53,"./enc-base64":54,"./evpkdf":56,"./md5":61}],84:[function(t,e,n){!function(r,o){"object"==typeof n?e.exports=n=o(t("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(r.CryptoJS)}(this,function(t){return function(e){var n=t,r=n.lib,o=r.Base,i=r.WordArray,a=n.x64={};a.Word=o.extend({init:function(t,e){this.high=t,this.low=e}}),a.WordArray=o.extend({init:function(t,n){t=this.words=t||[],n!=e?this.sigBytes=n:this.sigBytes=8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r =55296&&e<=56319&&o65535&&(e-=65536,o+=v(e>>>10&1023|55296),e=56320|1023&e),o+=v(e);return o}function i(t){if(t>=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function a(t,e){return v(t>>e&63|128)}function s(t){if(0==(4294967168&t))return v(t);var e="";return 0==(4294965248&t)?e=v(t>>6&31|192):0==(4294901760&t)?(i(t),e=v(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=v(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+=v(63&t|128)}function c(t){for(var e,n=r(t),o=n.length,i=-1,a="";++i =y)throw Error("Invalid byte index");var t=255&m[g];if(g++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(){var t,e,n,r,o;if(g>y)throw Error("Invalid byte index");if(g==y)return!1;if(t=255&m[g],g++,0==(128&t))return t;if(192==(224&t)){if(e=u(),o=(31&t)<<6|e,o>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=u(),n=u(),o=(15&t)<<12|e<<6|n,o>=2048)return i(o),o;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=u(),n=u(),r=u(),o=(7&t)<<18|e<<12|n<<6|r,o>=65536&&o<=1114111))return o;throw Error("Invalid UTF-8 detected")}function l(t){m=r(t),y=m.length,g=0;for(var e,n=[];(e=f())!==!1;)n.push(e);return o(n)}var p="object"==typeof n&&n,h="object"==typeof e&&e&&e.exports==p&&e,d="object"==typeof global&&global;d.global!==d&&d.window!==d||(t=d);var m,y,g,v=String.fromCharCode,b={version:"2.1.2",encode:c,decode:l};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return b});else if(p&&!p.nodeType)if(h)h.exports=b;else{var _={},w=_.hasOwnProperty;for(var x in b)w.call(b,x)&&(p[x]=b[x])}else t.utf8=b}(this)},{}],86:[function(t,e,n){e.exports=XMLHttpRequest},{}],"bignumber.js":[function(t,e,n){!function(n){"use strict";function r(t){function e(t,r){var o,i,a,s,c,u,f=this;if(!(f instanceof e))return W&&T(26,"constructor call without new",t),new e(t,r);if(null!=r&&J(r,2,64,P,"base")){if(r=0|r,u=t+"",10==r)return f=new e(t instanceof e?t:u),D(f,H+f.e+1,j);if((s="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(o="["+x.slice(0,r)+"]+")+"(?:\\."+o+")?$",r<37?"i":"").test(u))return m(f,u,s,r);s?(f.s=1/t<0?(u=u.slice(1),-1):1,W&&u.replace(/^0\.0*|\./,"").length>15&&T(P,w,t),s=!1):f.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1,u=n(u,10,r,f.s)}else{if(t instanceof e)return f.s=t.s,f.e=t.e,f.c=(t=t.c)?t.slice():t,void(P=0);if((s="number"==typeof t)&&0*t==0){if(f.s=1/t<0?(t=-t,-1):1,t===~~t){for(i=0,a=t;a>=10;a/=10,i++);return f.e=i,f.c=[t],void(P=0)}u=t+""}else{if(!y.test(u=t+""))return m(f,u,s);f.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1}}for((i=u.indexOf("."))>-1&&(u=u.replace(".","")),(a=u.search(/e/i))>0?(i<0&&(i=a),i+=+u.slice(a+1),u=u.substring(0,a)):i<0&&(i=u.length),a=0;48===u.charCodeAt(a);a++);for(c=u.length;48===u.charCodeAt(--c););if(u=u.slice(a,c+1))if(c=u.length,s&&W&&c>15&&T(P,w,f.s*t),i=i-a-1,i>U)f.c=f.e=null;else if(i =0&&(c=$,$=0,t=t.replace(".",""),d=new e(r),p=d.pow(t.length-m),$=c,d.c=u(l(i(p.c),p.e),10,n),d.e=d.c.length),h=u(t,r,n),s=c=h.length;0==h[--c];h.pop());if(!h[0])return"0";if(m<0?--s:(p.c=h,p.e=s,p.s=o,p=E(p,d,y,g,n),h=p.c,f=p.r,s=p.e),a=s+y+1,m=h[a],c=n/2,f=f||a<0||null!=h[a+1],f=g<4?(null!=m||f)&&(0==g||g==(p.s<0?3:2)):m>c||m==c&&(4==g||f||6==g&&1&h[a-1]||g==(p.s<0?8:7)),a<1||!h[0])t=f?l("1",-y):"0";else{if(h.length=a,f)for(--n;++h[--a]>n;)h[a]=0,a||(++s,h.unshift(1));for(c=h.length;!h[--c];);for(m=0,t="";m<=c;t+=x.charAt(h[m++]));t=l(t,s)}return t}function h(t,n,r,o){var a,s,c,u,p;if(r=null!=r&&J(r,0,8,o,_)?0|r:j,!t.c)return t.toString();if(a=t.c[0],c=t.e,null==n)p=i(t.c),p=19==o||24==o&&c<=q?f(p,c):l(p,c);else if(t=D(new e(t),n,r),s=t.e,p=i(t.c),u=p.length,19==o||24==o&&(n<=s||s<=q)){for(;u u){if(--n>0)for(p+=".";n--;p+="0");}else if(n+=s-u,n>0)for(s+1==u&&(p+=".");n--;p+="0");return t.s<0&&a?"-"+p:p}function I(t,n){var r,o,i=0;for(c(t[0])&&(t=t[0]),r=new e(t[0]);++i n||t!=p(t))&&T(r,(o||"decimal places")+(t n?" out of range":" not an integer"),t),!0}function N(t,e,n){for(var r=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,r++);return(n=r+n*B-1)>U?t.c=t.e=null:n =10;s/=10,o++);if(i=e-o,i<0)i+=B,a=e,c=l[u=0],f=c/p[o-a-1]%10|0;else if(u=g((i+1)/B),u>=l.length){if(!r)break t;for(;l.length<=u;l.push(0));c=f=0,o=1,i%=B,a=i-B+1}else{for(c=s=l[u],o=1;s>=10;s/=10,o++);i%=B,a=i-B+o,f=a<0?0:c/p[o-a-1]%10|0}if(r=r||e<0||null!=l[u+1]||(a<0?c:c%p[o-a-1]),r=n<4?(f||r)&&(0==n||n==(t.s<0?3:2)):f>5||5==f&&(4==n||r||6==n&&(i>0?a>0?c/p[o-a]:0:l[u-1])%10&1||n==(t.s<0?8:7)),e<1||!l[0])return l.length=0,r?(e-=t.e+1,l[0]=p[e%B],t.e=-e||0):l[0]=t.e=0,t;if(0==i?(l.length=u,s=1,u--):(l.length=u+1,s=p[B-i],l[u]=a>0?v(c/p[o-a]%p[a])*s:0),r)for(;;){if(0==u){for(i=1,a=l[0];a>=10;a/=10,i++);for(a=l[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(t.e++,l[0]==k&&(l[0]=1));break}if(l[u]+=s,l[u]!=k)break;l[u--]=0,s=1}for(i=l.length;0===l[--i];l.pop());}t.e>U?t.c=t.e=null:t.e n)return null!=(t=o[n++])};return a(e="DECIMAL_PLACES")&&J(t,0,F,2,e)&&(H=0|t),r[e]=H,a(e="ROUNDING_MODE")&&J(t,0,8,2,e)&&(j=0|t),r[e]=j,a(e="EXPONENTIAL_AT")&&(c(t)?J(t[0],-F,0,2,e)&&J(t[1],0,F,2,e)&&(q=0|t[0],z=0|t[1]):J(t,-F,F,2,e)&&(q=-(z=0|(t<0?-t:t)))),r[e]=[q,z],a(e="RANGE")&&(c(t)?J(t[0],-F,-1,2,e)&&J(t[1],1,F,2,e)&&(L=0|t[0],U=0|t[1]):J(t,-F,F,2,e)&&(0|t?L=-(U=0|(t<0?-t:t)):W&&T(2,e+" cannot be zero",t))),r[e]=[L,U],a(e="ERRORS")&&(t===!!t||1===t||0===t?(P=0,J=(W=!!t)?O:s):W&&T(2,e+b,t)),r[e]=W,a(e="CRYPTO")&&(t===!!t||1===t||0===t?(G=!(!t||!d||"object"!=typeof d),t&&!G&&W&&T(2,"crypto unavailable",d)):W&&T(2,e+b,t)),r[e]=G,a(e="MODULO_MODE")&&J(t,0,9,2,e)&&(X=0|t),r[e]=X,a(e="POW_PRECISION")&&J(t,0,F,2,e)&&($=0|t),r[e]=$,a(e="FORMAT")&&("object"==typeof t?V=t:W&&T(2,e+" not an object",t)),r[e]=V,r},e.max=function(){return I(arguments,R.lt)},e.min=function(){return I(arguments,R.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return v(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,o,i,a,s,c=0,u=[],f=new e(M);if(t=null!=t&&J(t,0,F,14)?0|t:H,a=g(t/B),G)if(d&&d.getRandomValues){for(r=d.getRandomValues(new Uint32Array(a*=2));c>>11),s>=9e15?(o=d.getRandomValues(new Uint32Array(2)),r[c]=o[0], 5 | r[c+1]=o[1]):(u.push(s%1e14),c+=2);c=a/2}else if(d&&d.randomBytes){for(r=d.randomBytes(a*=7);c=9e15?d.randomBytes(7).copy(r,c):(u.push(s%1e14),c+=7);c=a/7}else W&&T(14,"crypto unavailable",d);if(!c)for(;c=10;s/=10,c++);cr?1:-1;else for(o=i=0;o e[o]?1:-1;break}return i}function r(t,e,n,r){for(var o=0;n--;)t[n]-=o,o=t[n] 1;t.shift());}return function(i,a,s,c,u){var f,l,p,h,d,m,y,g,b,_,w,x,S,C,A,F,I,O=i.s==a.s?1:-1,N=i.c,T=a.c;if(!(N&&N[0]&&T&&T[0]))return new e(i.s&&a.s&&(N?!T||N[0]!=T[0]:T)?N&&0==N[0]||!T?0*O:O/0:NaN);for(g=new e(O),b=g.c=[],l=i.e-a.e,O=s+l+1,u||(u=k,l=o(i.e/B)-o(a.e/B),O=O/B|0),p=0;T[p]==(N[p]||0);p++);if(T[p]>(N[p]||0)&&l--,O<0)b.push(1),h=!0;else{for(C=N.length,F=T.length,p=0,O+=2,d=v(u/(T[0]+1)),d>1&&(T=t(T,d,u),N=t(N,d,u),F=T.length,C=N.length),S=F,_=N.slice(0,F),w=_.length;w =u/2&&A++;do{if(d=0,f=n(T,_,F,w),f<0){if(x=_[0],F!=w&&(x=x*u+(_[1]||0)),d=v(x/A),d>1)for(d>=u&&(d=u-1),m=t(T,d,u),y=m.length,w=_.length;1==n(m,_,y,w);)d--,r(m,F =10;O/=10,p++);D(g,s+(g.e=p+l*B-1)+1,c,h)}else g.e=l,g.r=+h;return g}}(),m=function(){var t=/^(-?)0([xbo])/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,o=/^-?(Infinity|NaN)$/,i=/^\s*\+|^\s+|\s+$/g;return function(a,s,c,u){var f,l=c?s:s.replace(i,"");if(o.test(l))a.s=isNaN(l)?null:l<0?-1:1;else{if(!c&&(l=l.replace(t,function(t,e,n){return f="x"==(n=n.toLowerCase())?16:"b"==n?2:8,u&&u!=f?t:e}),u&&(f=u,l=l.replace(n,"$1").replace(r,"0.$1")),s!=l))return new e(l,f);W&&T(P,"not a"+(u?" base "+u:"")+" number",s),a.s=null}a.c=a.e=null,P=0}}(),R.absoluteValue=R.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},R.ceil=function(){return D(new e(this),this.e+1,2)},R.comparedTo=R.cmp=function(t,n){return P=1,a(this,new e(t,n))},R.decimalPlaces=R.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-o(this.e/B))*B,e=n[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},R.dividedBy=R.div=function(t,n){return P=3,E(this,new e(t,n),H,j)},R.dividedToIntegerBy=R.divToInt=function(t,n){return P=4,E(this,new e(t,n),0,1)},R.equals=R.eq=function(t,n){return P=5,0===a(this,new e(t,n))},R.floor=function(){return D(new e(this),this.e+1,3)},R.greaterThan=R.gt=function(t,n){return P=6,a(this,new e(t,n))>0},R.greaterThanOrEqualTo=R.gte=function(t,n){return P=7,1===(n=a(this,new e(t,n)))||0===n},R.isFinite=function(){return!!this.c},R.isInteger=R.isInt=function(){return!!this.c&&o(this.e/B)>this.c.length-2},R.isNaN=function(){return!this.s},R.isNegative=R.isNeg=function(){return this.s<0},R.isZero=function(){return!!this.c&&0==this.c[0]},R.lessThan=R.lt=function(t,n){return P=8,a(this,new e(t,n))<0},R.lessThanOrEqualTo=R.lte=function(t,n){return P=9,(n=a(this,new e(t,n)))===-1||0===n},R.minus=R.sub=function(t,n){var r,i,a,s,c=this,u=c.s;if(P=10,t=new e(t,n),n=t.s,!u||!n)return new e(NaN);if(u!=n)return t.s=-n,c.plus(t);var f=c.e/B,l=t.e/B,p=c.c,h=t.c;if(!f||!l){if(!p||!h)return p?(t.s=-n,t):new e(h?c:NaN);if(!p[0]||!h[0])return h[0]?(t.s=-n,t):new e(p[0]?c:3==j?-0:0)}if(f=o(f),l=o(l),p=p.slice(),u=f-l){for((s=u<0)?(u=-u,a=p):(l=f,a=h),a.reverse(),n=u;n--;a.push(0));a.reverse()}else for(i=(s=(u=p.length)<(n=h.length))?u:n,u=n=0;n0)for(;n--;p[r++]=0);for(n=k-1;i>u;){if(p[--i] 0?(c=s,r=f):(a=-a,r=u),r.reverse();a--;r.push(0));r.reverse()}for(a=u.length,n=f.length,a-n<0&&(r=f,f=u,u=r,n=a),a=0;n;)a=(u[--n]=u[n]+f[n]+a)/k|0,u[n]%=k;return a&&(u.unshift(a),++c),N(t,u,c)},R.precision=R.sd=function(t){var e,n,r=this,o=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(W&&T(13,"argument"+b,t),t!=!!t&&(t=null)),!o)return null;if(n=o.length-1,e=n*B+1,n=o[n]){for(;n%10==0;n/=10,e--);for(n=o[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},R.round=function(t,n){var r=new e(this);return(null==t||J(t,0,F,15))&&D(r,~~t+this.e+1,null!=n&&J(n,0,8,15,_)?0|n:j),r},R.shift=function(t){var n=this;return J(t,-S,S,16,"argument")?n.times("1e"+p(t)):new e(n.c&&n.c[0]&&(t<-S||t>S)?n.s*(t<0?0:1/0):n)},R.squareRoot=R.sqrt=function(){var t,n,r,a,s,c=this,u=c.c,f=c.s,l=c.e,p=H+4,h=new e("0.5");if(1!==f||!u||!u[0])return new e(!f||f<0&&(!u||u[0])?NaN:u?c:1/0);if(f=Math.sqrt(+c),0==f||f==1/0?(n=i(u),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=o((l+1)/2)-(l<0||l%2),f==1/0?n="1e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),r=new e(n)):r=new e(f+""),r.c[0])for(l=r.e,f=l+p,f<3&&(f=0);;)if(s=r,r=h.times(s.plus(E(c,s,p,1))),i(s.c).slice(0,f)===(n=i(r.c)).slice(0,f)){if(r.e =0;){for(r=0,d=w[a]%v,m=w[a]/v|0,c=f,s=a+c;s>a;)l=_[--c]%v,p=_[c]/v|0,u=m*l+p*d,l=d*l+u%v*v+y[s]+r,r=(l/g|0)+(u/v|0)+m*p,y[s--]=l%g;y[s]=r}return r?++i:y.shift(),N(t,y,i)},R.toDigits=function(t,n){var r=new e(this);return t=null!=t&&J(t,1,F,18,"precision")?0|t:null,n=null!=n&&J(n,0,8,18,_)?0|n:j,t?D(r,t,n):r},R.toExponential=function(t,e){return h(this,null!=t&&J(t,0,F,19)?~~t+1:null,e,19)},R.toFixed=function(t,e){return h(this,null!=t&&J(t,0,F,20)?~~t+this.e+1:null,e,20)},R.toFormat=function(t,e){var n=h(this,null!=t&&J(t,0,F,21)?~~t+this.e+1:null,e,21);if(this.c){var r,o=n.split("."),i=+V.groupSize,a=+V.secondaryGroupSize,s=V.groupSeparator,c=o[0],u=o[1],f=this.s<0,l=f?c.slice(1):c,p=l.length;if(a&&(r=i,i=a,a=r,p-=r),i>0&&p>0){for(r=p%i||i,c=l.substr(0,r);r 0&&(c+=s+l.slice(r)),f&&(c="-"+c)}n=u?c+V.decimalSeparator+((a=+V.fractionGroupSize)?u.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+V.fractionGroupSeparator):u):c}return n},R.toFraction=function(t){var n,r,o,a,s,c,u,f,l,p=W,h=this,d=h.c,m=new e(M),y=r=new e(M),g=u=new e(M);if(null!=t&&(W=!1,c=new e(t),W=p,(p=c.isInt())&&!c.lt(M)||(W&&T(22,"max denominator "+(p?"out of range":"not an integer"),t),t=!p&&c.c&&D(c,c.e+1,1).gte(M)?c:null)),!d)return h.toString();for(l=i(d),a=m.e=l.length-h.e-1,m.c[0]=C[(s=a%B)<0?B+s:s],t=!t||c.cmp(m)>0?a>0?m:y:c,s=U,U=1/0,c=new e(l),u.c[0]=0;f=E(c,m,0,1),o=r.plus(f.times(g)),1!=o.cmp(t);)r=g,g=o,y=u.plus(f.times(o=y)),u=o,m=c.minus(f.times(o=m)),c=o;return o=E(t.minus(r),g,0,1),u=u.plus(o.times(y)),r=r.plus(o.times(g)),u.s=y.s=h.s,a*=2,n=E(y,g,a,j).minus(h).abs().cmp(E(u,r,a,j).minus(h).abs())<1?[y.toString(),g.toString()]:[u.toString(),r.toString()],U=s,n},R.toNumber=function(){var t=this;return+t||(t.s?0*t.s:NaN)},R.toPower=R.pow=function(t){var n,r,o=v(t<0?-t:+t),i=this;if(!J(t,-S,S,23,"exponent")&&(!isFinite(t)||o>S&&(t/=0)||parseFloat(t)!=t&&!(t=NaN)))return new e(Math.pow(+i,t));for(n=$?g($/B+2):0,r=new e(M);;){if(o%2){if(r=r.times(i),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(o=v(o/2),!o)break;i=i.times(i),n&&i.c&&i.c.length>n&&(i.c.length=n)}return t<0&&(r=M.div(r)),n?D(r,$,j):r},R.toPrecision=function(t,e){return h(this,null!=t&&J(t,1,F,24,"precision")?0|t:null,e,24)},R.toString=function(t){var e,r=this,o=r.s,a=r.e;return null===a?o?(e="Infinity",o<0&&(e="-"+e)):e="NaN":(e=i(r.c),e=null!=t&&J(t,2,64,25,"base")?n(l(e,a),0|t,10,o):a<=q||a>=z?f(e,a):l(e,a),o<0&&r.c[0]&&(e="-"+e)),e},R.truncated=R.trunc=function(){return D(new e(this),this.e+1,1)},R.valueOf=R.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function o(t){var e=0|t;return t>0||t===e?e:e-1}function i(t){for(var e,n,r=1,o=t.length,i=t[0]+"";r
u^n?1:-1;for(s=(c=o.length)<(u=i.length)?c:u,a=0;a i[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function s(t,e,n){return(t=p(t))>=e&&t<=n}function c(t){return"[object Array]"==Object.prototype.toString.call(t)}function u(t,e,n){for(var r,o,i=[0],a=0,s=t.length;an-1&&(null==i[r+1]&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function f(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function l(t,e){var n,r;if(e<0){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else e