-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitsharesjs.min.js
29 lines (29 loc) · 305 KB
/
bitsharesjs.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,t.bitshares_js=e()}})(function(){var t=Math.abs,r=String.fromCharCode,n=Math.log,a=Math.LN2,o=Math.min,s=Math.floor,f=Math.ceil,l=Math.max,u=Math.pow,c;return function(){function s(l,e,r){function t(o,i){if(!e[o]){if(!l[o]){var f="function"==typeof require&&require;if(!i&&f)return f(o,!0);if(n)return n(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var a=e[o]={exports:{}};l[o][0].call(a.exports,function(e){var r=l[o][1][e];return t(r||e)},a,a.exports,s,l,e,r)}return e[o].exports}for(var n="function"==typeof require&&require,a=0;a<r.length;a++)t(r[a]);return t}return s}()({1:[function(e,t){"use strict";t.exports={PrivateKey:e("./ecc/src/PrivateKey"),PublicKey:e("./ecc/src/PublicKey"),Signature:e("./ecc/src/signature"),key:e("./ecc/src/KeyUtils"),TransactionBuilder:e("./chain/src/TransactionBuilder"),Login:e("./chain/src/AccountLogin"),bitshares_ws:e("bitsharesjs-ws"),aes:e("./ecc/src/aes")}},{"./chain/src/AccountLogin":2,"./chain/src/TransactionBuilder":5,"./ecc/src/KeyUtils":9,"./ecc/src/PrivateKey":10,"./ecc/src/PublicKey":11,"./ecc/src/aes":13,"./ecc/src/signature":18,"bitsharesjs-ws":38}],2:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var i=n(e("../../ecc/src/PrivateKey")),a=n(e("../../ecc/src/KeyUtils")),o=e("./state"),s={},f={},l=function(){function e(){var e={loggedIn:!1,roles:["active","owner","memo"]};this.get=(0,o.get)(e),this.set=(0,o.set)(e),this.subs={}}var t=e.prototype;return t.addSubscription=function(e){this.subs[e]=e},t.setRoles=function(e){this.set("roles",e)},t.generateKeys=function(e,t,r,n){new Date().getTime();if(!e||!t)throw new Error("Account name or password required");if(12>t.length)throw new Error("Password must have at least 12 characters");var o={},l={};return(r||this.get("roles")).forEach(function(r){var d=e+r+t,u=s[d]?s[d]:i["default"].fromSeed(a["default"].normalize_brainKey(d));s[d]=u,o[r]=u,l[r]=f[d]?f[d]:u.toPublicKey().toString(n),f[d]=l[r]}),{privKeys:o,pubKeys:l}},t.checkKeys=function(e){var t=this,r=e.accountName,n=e.password,i=e.auths;if(!r||!n||!i)throw new Error("checkKeys: Missing inputs");var a=!1,o=function(e){var o=t.generateKeys(r,n,[e]),s=o.privKeys,f=o.pubKeys;i[e].forEach(function(r){r[0]===f[e]&&(a=!0,t.set(e,{priv:s[e],pub:f[e]}))})};for(var s in i)o(s);return a&&this.set("name",r),this.set("loggedIn",a),a},t.signTransaction=function(e){var t=this,r=!1;if(this.get("roles").forEach(function(n){var i=t.get(n);i&&(r=!0,console.log("adding signer:",i.pub),e.add_signer(i.priv,i.pub))}),!r)throw new Error("You do not have any private keys to sign this transaction")},e}(),d=new l;r["default"]=d,t.exports=r.default},{"../../ecc/src/KeyUtils":9,"../../ecc/src/PrivateKey":10,"./state":6}],3:[function(e,t,r){"use strict";r.__esModule=!0,r["default"]=void 0;r["default"]={reserved_spaces:{relative_protocol_ids:0,protocol_ids:1,implementation_ids:2},object_type:{null:0,base:1,account:2,asset:3,force_settlement:4,committee_member:5,witness:6,limit_order:7,call_order:8,custom:9,proposal:10,operation_history:11,withdraw_permission:12,vesting_balance:13,worker:14,balance:15,htlc:16},impl_object_type:{global_property:0,dynamic_global_property:1,index_meta:2,asset_dynamic_data:3,asset_bitasset_data:4,account_balance:5,account_statistics:6,transaction:7,block_summary:8,account_transaction_history:9,blinded_balance:10,chain_property:11,witness_schedule:12,budget_record:13},vote_type:{committee:0,witness:1,worker:2},operations:{transfer:0,limit_order_create:1,limit_order_cancel:2,call_order_update:3,fill_order:4,account_create:5,account_update:6,account_whitelist:7,account_upgrade:8,account_transfer:9,asset_create:10,asset_update:11,asset_update_bitasset:12,asset_update_feed_producers:13,asset_issue:14,asset_reserve:15,asset_fund_fee_pool:16,asset_settle:17,asset_global_settle:18,asset_publish_feed:19,witness_create:20,witness_update:21,proposal_create:22,proposal_update:23,proposal_delete:24,withdraw_permission_create:25,withdraw_permission_update:26,withdraw_permission_claim:27,withdraw_permission_delete:28,committee_member_create:29,committee_member_update:30,committee_member_update_global_parameters:31,vesting_balance_create:32,vesting_balance_withdraw:33,worker_create:34,custom:35,assert:36,balance_claim:37,override_transfer:38,transfer_to_blind:39,blind_transfer:40,transfer_from_blind:41,asset_settle_cancel:42,asset_claim_fees:43,fba_distribute:44,bid_collateral:45,execute_bid:46,asset_claim_pool:47,asset_update_issuer:48,htlc_create:49,htlc_redeem:50,htlc_redeemed:51,htlc_extend:52,htlc_refund:53}},t.exports=r.default},{}],4:[function(e,t,r){"use strict";r.__esModule=!0,r["default"]=void 0;var n=e("bytebuffer"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("../../serializer/src/SerializerValidation")),a=n.Long.fromNumber(u(2,48)-1),o=function(){function e(e,t,r){this.space=e,this.type=t,this.instance=r;var n=this.instance.toString(),a=this.space+"."+this.type+"."+n;if(!i["default"].is_digits(n))throw new("Invalid object id "+a)}e.fromString=function(t){if(void 0!==t.space&&void 0!==t.type&&void 0!==t.instance)return t;var r=i["default"].require_match(/^([0-9]+)\.([0-9]+)\.([0-9]+)$/,i["default"].required(t,"ObjectId"),"ObjectId");return new e(parseInt(r[1]),parseInt(r[2]),n.Long.fromString(r[3]))},e.fromLong=function(t){var r=t.shiftRight(56).toInt(),n=255&t.shiftRight(48).toInt(),i=t.and(a);return new e(r,n,i)},e.fromByteBuffer=function(t){return e.fromLong(t.readUint64())};var t=e.prototype;return t.toLong=function(){return n.Long.fromNumber(this.space).shiftLeft(56).or(n.Long.fromNumber(this.type).shiftLeft(48).or(this.instance))},t.appendByteBuffer=function(e){return e.writeUint64(this.toLong())},t.toString=function(){return this.space+"."+this.type+"."+this.instance.toString()},e}();r["default"]=o,t.exports=r.default},{"../../serializer/src/SerializerValidation":21,bytebuffer:46}],5:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=this;return new Promise(function(r,n){if(t.signed||t.sign(),!t.tr_buffer)throw new Error("not finalized");if(!t.signatures.length)throw new Error("not signed");if(!t.operations.length)throw new Error("no operations");var i=c.ops.signed_transaction.toObject(t);p.Apis.instance().network_api().exec("broadcast_transaction_with_callback",[function(e){return r(e)},i]).then(function(){e&&e()})["catch"](function(e){console.log(e);var r=e.message;return r||(r=""),void n(new Error(r+"\nbitshares-crypto digest "+u.hash.sha256(t.tr_buffer).toString("hex")+" transaction "+t.tr_buffer.toString("hex")+" "+JSON.stringify(i)))})})}function o(){return s(h)}function s(e){return e?(/Z$/.test(e)||(e+="Z"),new Date(e)):new Date("1970-01-01T00:00:00.000Z")}r.__esModule=!0,r["default"]=void 0;var d=n(e("assert")),u=e("../../ecc"),c=e("../../serializer"),p=e("bitsharesjs-ws"),_=n(e("./ChainTypes")),g=e("safe-buffer").Buffer,m=function(){function e(e){if(void 0===e&&(e=null),this.signer_private_keys=[],e){this.expiration=e.expiration,this.ref_block_num=e.ref_block_num,this.ref_block_prefix=e.ref_block_prefix,this.signatures=e.signatures,this.operations=[];for(var t=0;t<e.operations.length;++t)this.add_operation(e.operations[t])}else this.ref_block_num=0,this.ref_block_prefix=0,this.expiration=0,this.operations=[],this.signatures=[];this._broadcast=a.bind(this)}var t=e.prototype;return t.add_type_operation=function(e,t){this.add_operation(this.get_type_operation(e,t))},t.process_transaction=function(e,t,r){var n=this;void 0===t&&(t=null),void 0===r&&(r=!1);var i=e.wallet.wallet_object;return p.Apis.instance().chain_id===i.get("chain_id")?this.set_required_fees().then(function(){var i={};if(t){var a=e.getPubkeys_having_PrivateKey(t);if(!a.length)throw new Error("Missing signing key");for(var o=a,s=Array.isArray(o),f=0,o=s?o:o[Symbol.iterator]();;){var l;if(s){if(f>=o.length)break;l=o[f++]}else{if(f=o.next(),f.done)break;l=f.value}var d=l,u=e.getPrivateKey(d);n.add_signer(u,d),i[d]=!0}}return n.get_potential_signatures().then(function(t){var r=t.pubkeys,a=t.addys,o=e.getPubkeys_having_PrivateKey(r,a);return n.get_required_signatures(o).then(function(t){for(var r=t,a=Array.isArray(r),o=0,r=a?r:r[Symbol.iterator]();;){var s;if(a){if(o>=r.length)break;s=r[o++]}else{if(o=r.next(),o.done)break;s=o.value}var f=s;if(!i[f]){var l=e.getPrivateKey(f);if(!l)throw new Error("Missing signing key for "+f);n.add_signer(l,f)}}})}).then(function(){return r?n.broadcast():n.serialize()})}):Promise.reject("Mismatched chain_id; expecting "+i.get("chain_id")+", but got "+p.Apis.instance().chain_id)},t.finalize=function(){var e=this;return new Promise(function(t){if(e.tr_buffer)throw new Error("already finalized");var n=function(){for(var t=e.operations,r=0,n;r<t.length;r++)n=t[r],n[1].finalize&&n[1].finalize();e.tr_buffer=c.ops.transaction.toBuffer(e)};0!==e.expiration&&0!==e.ref_block_num&&0!==e.ref_block_prefix?(n(),t()):t(p.Apis.instance().db_api().exec("get_objects",[["2.1.0"]]).then(function(t){h=t[0].time,0===e.expiration&&(e.expiration=b()+p.ChainConfig.expire_in_secs),0===e.ref_block_num&&0===e.ref_block_prefix&&(e.ref_block_num=65535&t[0].head_block_number,e.ref_block_prefix=new g(t[0].head_block_id,"hex").readUInt32LE(4)),n()}))})},t.id=function(){if(!this.tr_buffer)throw new Error("not finalized");return u.hash.sha256(this.tr_buffer).toString("hex").substring(0,40)},t.add_operation=function(e){if(this.tr_buffer)throw new Error("already finalized");if((0,d["default"])(e,"operation"),!Array.isArray(e))throw new Error("Expecting array [operation_id, operation]");this.operations.push(e)},t.get_type_operation=function(e,t){if(this.tr_buffer)throw new Error("already finalized");(0,d["default"])(e,"name"),(0,d["default"])(t,"operation");var r=c.ops[e];(0,d["default"])(r,"Unknown operation "+e);var n=_["default"].operations[r.operation_name];if(void 0===n)throw new Error("unknown operation: "+r.operation_name);if(t.fee||(t.fee={amount:0,asset_id:0}),"proposal_create"===e){var i=!1,a=0;t.proposed_ops.forEach(function(e){var t;switch(e.op[0]){case 0:t="from";break;case 6:case 17:t="account";break;case 10:case 11:case 12:case 13:case 14:case 18:case 43:t="issuer";break;case 15:t="payer";break;case 16:t="from_account";break;case 22:case 23:case 24:t="fee_paying_account";break;case 31:i=!0,a=1123200;}t in e.op[1]&&0===e.op[1][t]&&(i=!0)}),t.expiration_time||(t.expiration_time=b()+p.ChainConfig.expire_in_secs_proposal),i&&(t.review_period_seconds=a+l(y,86400),t.expiration_time+=3600+a)}var o=r.fromObject(t);return[n,o]},t.update_head_block=function(){return Promise.all([p.Apis.instance().db_api().exec("get_objects",[["2.0.0"]]),p.Apis.instance().db_api().exec("get_objects",[["2.1.0"]])]).then(function(e){var t=e[0],n=e[1];h=n[0].time,y=t[0].parameters.committee_proposal_review_period})},t.set_expire_seconds=function(e){if(this.tr_buffer)throw new Error("already finalized");return this.expiration=b()+e},t.propose=function(e){if(this.tr_buffer)throw new Error("already finalized");if(!this.operations.length)throw new Error("add operation first");(0,d["default"])(e,"proposal_create_options"),(0,d["default"])(e.fee_paying_account,"proposal_create_options.fee_paying_account");var t=this.operations.map(function(e){return{op:e}});return this.operations=[],this.signatures=[],this.signer_private_keys=[],e.proposed_ops=t,this.add_type_operation("proposal_create",e),this},t.has_proposed_operation=function(){for(var e=!1,t=0;t<this.operations.length;t++)if("proposed_ops"in this.operations[t][1]){e=!0;break}return e},t.set_required_fees=function(e,t){function r(e){return 22===e[0]}function n(e,t){var r=a(e),n=u[r];if(!!n){if(n.original===t)return t;if(-1!==n.duplicates.indexOf(t))return n.original}}function a(e){var t=null;switch(e[0]){case 0:var r=Array(e[1].memo.message.length+1).join("a");t=e[0]+"_"+e[1].amount.asset_id+"_"+r;break;default:}return t}var o=this;if(this.tr_buffer)throw new Error("already finalized");if(!this.operations.length)throw new Error("add operations first");for(var s=[],f=[],l=[],d=[],u={},_=0,g;_<this.operations.length;_++){g=this.operations[_];var m=c.ops.operation.toObject(g),b=!1;if(t){var h=a(m);h&&(u[h]?(u[h].duplicates.push(_),b=!0):u[h]={original:_,duplicates:[]})}r(g)&&g[1].proposed_ops.forEach(function(e){f.push(e),-1===d.indexOf(e.op[1].fee.asset_id)&&d.push("1.3."+e.op[1].fee.asset_id)}),b||(s.push(m),-1===l.indexOf(s[_][1].fee.asset_id)&&l.push(s[_][1].fee.asset_id))}if(!e){var y=s[0][1].fee;e=y&&null!==y.asset_id?y.asset_id:"1.3.0"}d.length&&d.forEach(function(e){-1===l.indexOf(e)&&l.push(e)});var w=[Promise.all(l.map(function(e){return p.Apis.instance().db_api().exec("get_required_fees",[s,e])}))["catch"](function(e){console.error("get_required_fees API error: ",e.message)})];if(1<l.length||"1.3.0"!==l[0]){var v=l.map(function(e){return e.replace(/^1\./,"2.")});w.push(p.Apis.instance().db_api().exec("get_required_fees",[s,"1.3.0"])),w.push(p.Apis.instance().db_api().exec("get_objects",[v]))}return Promise.all(w).then(function(e){function i(e,t,r,n){return e[t]||(e[t]={total:0,ops:[]}),e[t].propIdx?e[t].propIdx.push(r):e[t].ops.push(r),"1.3.0"!==t&&(e[t].total+=n.length?n[r].amount:n.amount),e}function a(e){if(!Object.keys(e).length)return[];var t=[],r=function(r){var n=_[r]?parseInt(_[r].fee_pool,10):0;e[r].total>n?e[r].ops.forEach(function(n){2===l[n].length&&"propIdx"in e[r]?e[r].propIdx.forEach(function(e){t[e]=l[n][1][e]}):2===l[n].length?t[n]=l[n][0]:t[n]=l[n]}):e[r].ops.forEach(function(n){2===l[n].length&&"propIdx"in e[r]?e[r].propIdx.forEach(function(e){t[e]=p[r][e]}):t[n]=u[r][n]})};for(var n in e)r(n);return t}var f=e[0],l=e[1],d=e[2];void 0===f&&(f=l),l||(l=f[0]);var u={},p={};f.forEach(function(e){var t=e.map(function(e){return Array.isArray(e)?(p[e[1][0].asset_id]=e[1],e[0]):e}),r=t[0].asset_id;u[r]=t},{});for(var _=d?d.reduce(function(e,t){return e[t.id.replace(/^2\./,"1.")]=t,e},{}):{},g={},m={},b=function(e){var t=s[e],n=t[1].fee.asset_id;r(t)?(g=i(g,n,e,l[e][0]),t[1].proposed_ops.forEach(function(t,r){var n=t.op[1].fee.asset_id;m[e]||(m[e]={}),m[e][n]||(m[e][n]={total:0,ops:[e],propIdx:[]}),m[e]=i(m[e],n,r,l[e][1])})):g=i(g,n,e,l[e])},h=0;h<s.length;h++)b(h);var w=a(g),v={};for(var B in m)v[B]=a(m[B]);for(var x=function(e,r){if(!e.fee||0===e.fee.amount||e.fee.amount.toString&&"0"===e.fee.amount.toString())if(t){var i=c.ops.operation.toObject(o.operations[r]),a=n(i,r);e.fee=0<=a?w[a]:w[r]}else e.fee=w[r];if(e.proposed_ops){for(var s=[],f=0;f<e.proposed_ops.length;f++)e.proposed_ops[f].op[1].fee.asset_id=v[r][f].asset_id,e.proposed_ops[f].op[1].fee.amount=v[r][f].amount;return s}},k=0;k<o.operations.length;k++)x(o.operations[k][1],k)})},t.get_potential_signatures=function(){var e=c.ops.signed_transaction.toObject(this);return Promise.all([p.Apis.instance().db_api().exec("get_potential_signatures",[e]),p.Apis.instance().db_api().exec("get_potential_address_signatures",[e])]).then(function(e){return{pubkeys:e[0],addys:e[1]}})},t.get_required_signatures=function(e){if(!e.length)return Promise.resolve([]);var t=c.ops.signed_transaction.toObject(this);return p.Apis.instance().db_api().exec("get_required_signatures",[t,e]).then(function(e){return e})},t.add_signer=function(e,t){if(void 0===t&&(t=e.toPublicKey()),(0,d["default"])(e.d,"required PrivateKey object"),this.signed)throw new Error("already signed");t.Q||(t=u.PublicKey.fromPublicKeyString(t));for(var r=e.toHex(),n=this.signer_private_keys,i=Array.isArray(n),a=0,n=i?n:n[Symbol.iterator]();;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var s=o;if(s[0].toHex()===r)return}this.signer_private_keys.push([e,t])},t.sign=function(e){if(void 0===e&&(e=p.Apis.instance().chain_id),!this.tr_buffer)throw new Error("not finalized");if(this.signed)throw new Error("already signed");if(!this.signer_private_keys.length)throw new Error("Transaction was not signed. Do you have a private key? [no_signers]");for(var t=this.signer_private_keys.length,r=0;0<t?r<t:r>t;0<t?r++:r++){var n=this.signer_private_keys[r],a=n[0],o=n[1],s=u.Signature.signBuffer(g.concat([new g(e,"hex"),this.tr_buffer]),a,o);this.signatures.push(s.toBuffer())}return this.signer_private_keys=[],void(this.signed=!0)},t.serialize=function(){return c.ops.signed_transaction.toObject(this)},t.toObject=function(){return c.ops.signed_transaction.toObject(this)},t.broadcast=function(e){var t=this;return this.tr_buffer?this._broadcast(e):this.finalize().then(function(){return t._broadcast(e)})},e}(),b=function(){var e=f(o().getTime()/1e3),t=f(Date.now()/1e3);return 30<t-e?e:l(t,e)},h,y;r["default"]=m,t.exports=r.default},{"../../ecc":7,"../../serializer":19,"./ChainTypes":3,assert:40,"bitsharesjs-ws":38,"safe-buffer":97}],6:[function(e,t,r){"use strict";r.__esModule=!0,r.get=function(e){return function(t){return e[t]||""}},r.set=function(e){return function(t,r){return e[t]=r,this}}},{}],7:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r.hash=void 0;var i=n(e("./src/address"));r.Address=i["default"];var a=n(e("./src/aes"));r.Aes=a["default"];var o=n(e("./src/PrivateKey"));r.PrivateKey=o["default"];var s=n(e("./src/PublicKey"));r.PublicKey=s["default"];var f=n(e("./src/signature"));r.Signature=f["default"];var l=n(e("./src/BrainKey"));r.brainKey=l["default"];var d=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t["default"]=e,t}(e("./src/hash"));r.hash=d;var u=n(e("./src/KeyUtils"));r.key=u["default"]},{"./src/BrainKey":8,"./src/KeyUtils":9,"./src/PrivateKey":10,"./src/PublicKey":11,"./src/address":12,"./src/aes":13,"./src/hash":17,"./src/signature":18}],8:[function(e,t,r){"use strict";r.__esModule=!0,r["default"]=function(e){if("string"!=typeof e)throw new Error("string required for brainKey");return e=e.trim(),e.split(/[\t\n\v\f\r ]+/).join(" ")},t.exports=r.default},{}],9:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var i=n(e("./PrivateKey")),a=n(e("./PublicKey")),o=n(e("./address")),s=n(e("./aes")),f=e("./hash"),l=n(e("secure-random")),d=e("bitsharesjs-ws"),c=e("safe-buffer").Buffer,p=250,_={aes_checksum:function(e){if("string"!=typeof e)throw new"password string required";for(var t=l["default"].randomBuffer(4).toString("hex"),r=0,n=t+e,i=Date.now();Date.now()-i<p;)n=(0,f.sha256)(n),r+=1;var a=(0,f.sha256)(n),o=[r,t.toString("hex"),a.slice(0,4).toString("hex")].join(",");return{aes_private:s["default"].fromSeed(n),checksum:o}},aes_private:function(e,t){for(var r=t.split(","),n=r[0],a=r[1],o=r[2],l=a+e,d=0;0<n?d<n:d>n;0<n?d++:d++)l=(0,f.sha256)(l);var u=(0,f.sha256)(l);if(u.slice(0,4).toString("hex")!==o)throw new Error("wrong password");return s["default"].fromSeed(l)},random32ByteBuffer:function(e){if(void 0===e&&(e=this.browserEntropy()),"string"!=typeof e)throw new Error("string required for entropy");if(32>e.length)throw new Error("expecting at least 32 bytes of entropy");for(var t=Date.now();Date.now()-t<p;)e=(0,f.sha256)(e);var r=[e,l["default"].randomBuffer(32)];return(0,f.sha256)(c.concat(r))},suggest_brain_key:function(e,t){void 0===e&&(e=","),void 0===t&&(t=this.browserEntropy());var r=this.random32ByteBuffer(t),n=e.split(",");if(49744!==n.length)throw new Error("expecting 49744 but got "+n.length+" dictionary words");for(var a=[],o=0;o<2*16;o+=2){var s=(r[o]<<8)+r[o+1],f=s/u(2,16),l=Math.round(n.length*f);a.push(n[l])}return this.normalize_brainKey(a.join(" "))},get_random_key:function(e){return i["default"].fromBuffer(this.random32ByteBuffer(e))},get_brainPrivateKey:function(e,t){if(void 0===t&&(t=0),0>t)throw new Error("invalid sequence");if(""===e.trim())throw new Error("empty brain key");return e=_.normalize_brainKey(e),i["default"].fromBuffer((0,f.sha256)((0,f.sha512)(e+" "+t)))},normalize_brainKey:function(e){if("string"!=typeof e)throw new Error("string required for brainKey");if(e=e.trim(),""===e)throw new Error("empty brain key");return e.split(/[\t\n\v\f\r ]+/).join(" ")},browserEntropy:function(){var e="";try{e=new Date().toString()+" "+window.screen.height+" "+window.screen.width+" "+window.screen.colorDepth+" "+window.screen.availHeight+" "+window.screen.availWidth+" "+window.screen.pixelDepth+navigator.language+" "+window.location+" "+window.history.length;for(var t=0,r;t<navigator.mimeTypes.length;t++)r=navigator.mimeTypes[t],e+=r.description+" "+r.type+" "+r.suffixes+" ";console.log("INFO\tbrowserEntropy gathered")}catch(t){e=(0,f.sha256)(new Date().toString())}var n=c.from(e);return e+=n.toString("binary")+" "+new Date().toString(),e},addresses:function(e,t){void 0===t&&(t=d.ChainConfig.address_prefix);var r=a["default"].fromPublicKeyString(e,t),n=[o["default"].fromPublic(r,!1,0).toString(t),o["default"].fromPublic(r,!0,0).toString(t),o["default"].fromPublic(r,!1,56).toString(t),o["default"].fromPublic(r,!0,56).toString(t),r.toAddressString(t)];return n}};r["default"]=_,t.exports=r.default},{"./PrivateKey":10,"./PublicKey":11,"./address":12,"./aes":13,"./hash":17,"bitsharesjs-ws":38,"safe-buffer":97,"secure-random":98}],10:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var a=e("ecurve"),o=i(e("bigi")),s=e("bs58"),f=e("./hash"),l=i(e("./PublicKey")),d=i(e("deep-equal")),u=i(e("assert")),c=(0,a.getCurveByName)("secp256k1"),p=c.n,n=e("safe-buffer").Buffer,_=function(){function e(e){this.d=e}e.fromBuffer=function(t){if(!n.isBuffer(t))throw new Error("Expecting paramter to be a Buffer type");if(32!==t.length&&console.log("WARN: Expecting 32 bytes, instead got "+t.length+", stack trace:",new Error().stack),0===t.length)throw new Error("Empty buffer");return new e(o["default"].fromBuffer(t))},e.fromSeed=function(t){if("string"!=typeof t)throw new Error("seed must be of type string");return e.fromBuffer((0,f.sha256)(t))},e.fromWif=function(t){var r=n.from((0,s.decode)(t)),i=r.readUInt8(0);u["default"].equal(128,i,"Expected version 128, instead got "+i);var a=r.slice(0,-4),o=r.slice(-4),l=(0,f.sha256)(a);l=(0,f.sha256)(l),l=l.slice(0,4);var c=(0,d["default"])(o,l);if(!c)throw new Error("Checksum did not match");return a=a.slice(1),e.fromBuffer(a)};var t=e.prototype;return t.toWif=function(){var e=this.toBuffer();e=n.concat([n.from([128]),e]);var t=(0,f.sha256)(e);t=(0,f.sha256)(t),t=t.slice(0,4);var r=n.concat([e,t]);return(0,s.encode)(r)},t.toPublicKeyPoint=function(){return c.G.multiply(this.d)},t.toPublicKey=function(){return this.public_key?this.public_key:this.public_key=l["default"].fromPoint(this.toPublicKeyPoint())},t.toBuffer=function(){return this.d.toBuffer(32)},t.get_shared_secret=function(e,t){void 0===t&&(t=!1),e=g(e);var i=e.toUncompressed().toBuffer(),s=a.Point.fromAffine(c,o["default"].fromBuffer(i.slice(1,33)),o["default"].fromBuffer(i.slice(33,65))),l=this.toBuffer(),r=s.multiply(o["default"].fromBuffer(l)),d=r.affineX.toBuffer({size:32});if(!t&&32>d.length){var u=n.alloc(32-d.length).fill(0);d=n.concat([u,d])}return(0,f.sha512)(d)},t.child=function(t){t=n.concat([this.toPublicKey().toBuffer(),t]),t=(0,f.sha256)(t);var r=o["default"].fromBuffer(t);if(0<=r.compareTo(p))throw new Error("Child offset went out of bounds, try again");var i=this.d.add(r);if(0===i.signum())throw new Error("Child offset derived to an invalid key, try again");return new e(i)},t.toByteBuffer=function(){var e=new ByteBuffer(ByteBuffer.DEFAULT_CAPACITY,ByteBuffer.LITTLE_ENDIAN);return this.appendByteBuffer(e),e.copy(0,e.offset)},e.fromHex=function(t){return e.fromBuffer(new n(t,"hex"))},t.toHex=function(){return this.toBuffer().toString("hex")},e}();r["default"]=_;var g=function(e){return null==e?e:e.Q?e:l["default"].fromStringOrThrow(e)};t.exports=r.default},{"./PublicKey":11,"./hash":17,assert:40,bigi:31,bs58:44,"deep-equal":62,ecurve:67,"safe-buffer":97}],11:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var a=i(e("bigi")),o=e("ecurve"),s=e("bs58"),f=e("./hash"),l=e("bitsharesjs-ws"),d=i(e("assert")),u=i(e("deep-equal")),p=(0,o.getCurveByName)("secp256k1"),_=e("safe-buffer").Buffer,g=p.G,m=p.n,n=function(){function e(e){this.Q=e}e.fromBinary=function(t){return e.fromBuffer(_.from(t,"binary"))},e.fromBuffer=function(t){return"000000000000000000000000000000000000000000000000000000000000000000"===t.toString("hex")?new e(null):new e(o.Point.decodeFrom(p,t))};var t=e.prototype;return t.toBuffer=function(e){return void 0===e&&(e=this.Q?this.Q.compressed:null),null===this.Q?_.from("000000000000000000000000000000000000000000000000000000000000000000","hex"):this.Q.getEncoded(e)},e.fromPoint=function(t){return new e(t)},t.toUncompressed=function(){var t=this.Q.getEncoded(!1),r=o.Point.decodeFrom(p,t);return e.fromPoint(r)},t.toBlockchainAddress=function(){var e=this.toBuffer(),t=(0,f.sha512)(e);return(0,f.ripemd160)(t)},t.toString=function(e){return void 0===e&&(e=l.ChainConfig.address_prefix),this.toPublicKeyString(e)},t.toPublicKeyString=function(e){void 0===e&&(e=l.ChainConfig.address_prefix);var t=this.toBuffer(),r=(0,f.ripemd160)(t),n=_.concat([t,r.slice(0,4)]);return e+(0,s.encode)(n)},e.fromPublicKeyString=function(t,r){void 0===r&&(r=l.ChainConfig.address_prefix);try{return e.fromStringOrThrow(t,r)}catch(t){return null}},e.fromStringOrThrow=function(t,r){void 0===r&&(r=l.ChainConfig.address_prefix),null===t.Q&&(t=r+"1111111111111111111111111111111114T1Anm");var n=t.slice(0,r.length);d["default"].equal(r,n,"Expecting key to begin with "+r+", instead got "+n),t=t.slice(r.length),t=_.from((0,s.decode)(t),"binary");var i=t.slice(-4);t=t.slice(0,-4);var a=(0,f.ripemd160)(t);a=a.slice(0,4);var o=(0,u["default"])(i,a);if(!o)throw new Error("Checksum did not match");return e.fromBuffer(t)},t.toAddressString=function(e){void 0===e&&(e=l.ChainConfig.address_prefix);var t=this.toBuffer(),r=(0,f.sha512)(t),n=(0,f.ripemd160)(r),i=(0,f.ripemd160)(n);return n=_.concat([n,i.slice(0,4)]),e+(0,s.encode)(n)},t.toPtsAddy=function(){var e=this.toBuffer(),t=(0,f.sha256)(e),r=(0,f.ripemd160)(t);r=_.concat([_.from([56]),r]);var n=(0,f.sha256)(r);return n=(0,f.sha256)(n),r=_.concat([r,n.slice(0,4)]),(0,s.encode)(r)},t.child=function(t){(0,d["default"])(_.isBuffer(t),"Buffer required: offset"),d["default"].equal(t.length,32,"offset length"),t=_.concat([this.toBuffer(),t]),t=(0,f.sha256)(t);var r=a["default"].fromBuffer(t);if(0<=r.compareTo(m))throw new Error("Child offset went out of bounds, try again");var n=g.multiply(r),i=this.Q.add(n);if(p.isInfinity(i))throw new Error("Child offset derived to an invalid key, try again");return e.fromPoint(i)},t.toByteBuffer=function(){var e=new ByteBuffer(ByteBuffer.DEFAULT_CAPACITY,ByteBuffer.LITTLE_ENDIAN);return this.appendByteBuffer(e),e.copy(0,e.offset)},e.fromHex=function(t){return e.fromBuffer(_.from(t,"hex"))},t.toHex=function(){return this.toBuffer().toString("hex")},e.fromPublicKeyStringHex=function(t){return e.fromPublicKeyString(_.from(t,"hex"))},e}();r["default"]=n,t.exports=r.default},{"./hash":17,assert:40,bigi:31,"bitsharesjs-ws":38,bs58:44,"deep-equal":62,ecurve:67,"safe-buffer":97}],12:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var i=n(e("assert")),a=e("bitsharesjs-ws"),o=e("./hash"),s=e("bs58"),f=n(e("deep-equal")),l=e("safe-buffer").Buffer,d=function(){function e(e){this.addy=e}e.fromBuffer=function(t){var r=(0,o.sha512)(t),n=(0,o.ripemd160)(r);return new e(n)},e.fromString=function(t,r){void 0===r&&(r=a.ChainConfig.address_prefix);var n=t.slice(0,r.length);i["default"].equal(r,n,"Expecting key to begin with "+r+", instead got "+n);var d=t.slice(r.length);d=new l((0,s.decode)(d),"binary");var u=d.slice(-4);d=d.slice(0,-4);var c=(0,o.ripemd160)(d);c=c.slice(0,4);var p=(0,f["default"])(u,c);if(!p)throw new Error("Checksum did not match");return new e(d)},e.fromPublic=function(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=56);var i=(0,o.sha256)(t.toBuffer(r)),a=(0,o.ripemd160)(i),s=l.alloc(1);s.writeUInt8(255&n,0);var f=l.concat([s,a]),d=(0,o.sha256)(f);d=(0,o.sha256)(d);var u=l.concat([f,d.slice(0,4)]);return new e((0,o.ripemd160)(u))};var t=e.prototype;return t.toBuffer=function(){return this.addy},t.toString=function(e){void 0===e&&(e=a.ChainConfig.address_prefix);var t=(0,o.ripemd160)(this.addy),r=l.concat([this.addy,t.slice(0,4)]);return e+(0,s.encode)(r)},e}();r["default"]=d,t.exports=r.default},{"./hash":17,assert:40,"bitsharesjs-ws":38,bs58:44,"deep-equal":62,"safe-buffer":97}],13:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var i=n(e("crypto-js/aes")),a=n(e("crypto-js/enc-hex")),o=n(e("crypto-js/enc-base64")),s=n(e("assert")),f=e("./hash"),l=e("safe-buffer").Buffer,d=function(){function e(e,t){this.iv=e,this.key=t}var t=e.prototype;return t.clear=function(){return this.iv=this.key=void 0},e.fromSeed=function(t){if(void 0===t)throw new Error("seed is required");var r=(0,f.sha512)(t);return r=r.toString("hex"),e.fromSha512(r)},e.fromSha512=function(t){s["default"].equal(t.length,128,"A Sha512 in HEX should be 128 characters long, instead got "+t.length);var r=a["default"].parse(t.substring(64,96)),n=a["default"].parse(t.substring(0,64));return new e(r,n)},e.fromBuffer=function(t){return(0,s["default"])(l.isBuffer(t),"Expecting Buffer"),s["default"].equal(t.length,64,"A Sha512 Buffer should be 64 characters long, instead got "+t.length),e.fromSha512(t.toString("hex"))},e.decrypt_with_checksum=function(t,r,n,i,a){void 0===a&&(a=!1),null==n&&(n=""),l.isBuffer(i)||(i=new l(i,"hex"));var o=t.get_shared_secret(r,a),s=e.fromSeed(l.concat([l.from(""+n),l.from(o.toString("hex"))])),d=s.decrypt(i);if(!(4<=d.length))throw new Error("Invalid key, could not decrypt message(1)");var u=d.slice(0,4),c=d.slice(4),p=(0,f.sha256)(c);if(p=p.slice(0,4),p=p.toString("hex"),u.toString("hex")!==p)throw new Error("Invalid key, could not decrypt message(2)");return c},e.encrypt_with_checksum=function(t,r,n,i){null==n&&(n=""),l.isBuffer(i)||(i=new l(i,"binary"));var a=t.get_shared_secret(r),o=e.fromSeed(l.concat([l.from(""+n),l.from(a.toString("hex"))])),s=(0,f.sha256)(i).slice(0,4),d=l.concat([s,i]);return o.encrypt(d)},t._decrypt_word_array=function(e){return i["default"].decrypt({ciphertext:e,salt:null},this.key,{iv:this.iv})},t._encrypt_word_array=function(e){var t=i["default"].encrypt(e,this.key,{iv:this.iv});return o["default"].parse(t.toString())},t.decrypt=function(e){if("string"==typeof e&&(e=new l(e,"binary")),!l.isBuffer(e))throw new Error("buffer required");(0,s["default"])(e,"Missing cipher text");var t=this.decryptHex(e.toString("hex"));return new l(t,"hex")},t.encrypt=function(e){if("string"==typeof e&&(e=new l(e,"binary")),!l.isBuffer(e))throw new Error("buffer required");var t=this.encryptHex(e.toString("hex"));return new l(t,"hex")},t.encryptToHex=function(e){if("string"==typeof e&&(e=new l(e,"binary")),!l.isBuffer(e))throw new Error("buffer required");return this.encryptHex(e.toString("hex"))},t.decryptHex=function(e){(0,s["default"])(e,"Missing cipher text");var t=a["default"].parse(e),r=this._decrypt_word_array(t);return a["default"].stringify(r)},t.decryptHexToBuffer=function(e){(0,s["default"])(e,"Missing cipher text");var t=a["default"].parse(e),r=this._decrypt_word_array(t),n=a["default"].stringify(r);return new l(n,"hex")},t.decryptHexToText=function(e,t){return void 0===t&&(t="binary"),this.decryptHexToBuffer(e).toString(t)},t.encryptHex=function(e){var t=a["default"].parse(e),r=this._encrypt_word_array(t);return a["default"].stringify(r)},e}();r["default"]=d,t.exports=r.default},{"./hash":17,assert:40,"crypto-js/aes":53,"crypto-js/enc-base64":56,"crypto-js/enc-hex":57,"safe-buffer":97}],14:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r,n,i){(0,u["default"])("Buffer",t),(0,u["default"])(c["default"],r),i&&(t=(0,l.sha256)(_.concat([t,_.alloc(i)]))),f["default"].equal(t.length,32,"Hash must be 256 bit");var a=r.toBuffer(32),o=_.alloc(32),s=_.alloc(32);s.fill(1),o.fill(0),o=(0,l.HmacSHA256)(_.concat([s,new _([0]),a,t]),o),s=(0,l.HmacSHA256)(s,o),o=(0,l.HmacSHA256)(_.concat([s,new _([1]),a,t]),o),s=(0,l.HmacSHA256)(s,o),s=(0,l.HmacSHA256)(s,o);for(var d=c["default"].fromBuffer(s);0>=d.signum()||0<=d.compareTo(e.n)||!n(d);)o=(0,l.HmacSHA256)(_.concat([s,new _([0])]),o),s=(0,l.HmacSHA256)(s,o),s=(0,l.HmacSHA256)(s,o),d=c["default"].fromBuffer(s);return d}function a(t,i,e,a){var o=t.n,n=t.G,f=e.r,r=e.s;if(0>=f.signum()||0<=f.compareTo(o))return!1;if(0>=r.signum()||0<=r.compareTo(o))return!1;var s=r.modInverse(o),l=i.multiply(s).mod(o),d=f.multiply(s).mod(o),u=n.multiplyTwo(l,a,d);if(t.isInfinity(u))return!1;var c=u.affineX,p=c.mod(o);return p.equals(f)}function o(t,a,e,o){f["default"].strictEqual(3&o,o,"Recovery param is more than two bits");var i=t.n,n=t.G,l=e.r,r=e.s;(0,f["default"])(0<l.signum()&&0>l.compareTo(i),"Invalid r value"),(0,f["default"])(0<r.signum()&&0>r.compareTo(i),"Invalid s value");var s=o>>1?l.add(i):l,d=t.pointFromX(1&o,s),u=d.multiply(i);(0,f["default"])(t.isInfinity(u),"nR is not a valid curve point");var c=a.negate().mod(i),p=l.modInverse(i),_=d.multiplyTwo(r,n,c).multiply(p);return t.validate(_),_}r.__esModule=!0,r.calcPubKeyRecoveryParam=function(t,r,e,n){for(var a=0,s;4>a;a++)if(s=o(t,r,e,a),s.equals(n))return a;throw new Error("Unable to find valid recovery factor")},r.deterministicGenerateK=i,r.recoverPubKey=o,r.sign=function(t,a,o,f){var l=c["default"].fromBuffer(a),e=t.n,n=t.G,d,u;i(t,a,o,function(r){var i=n.multiply(r);return!t.isInfinity(i)&&(d=i.affineX.mod(e),0!==d.signum())&&(u=r.modInverse(e).multiply(l.add(o.multiply(d))).mod(e),0!==u.signum())},f);var _=e.shiftRight(1);return 0<u.compareTo(_)&&(u=e.subtract(u)),new p["default"](d,u)},r.verify=function(t,r,n,i){var o=c["default"].fromBuffer(r);return a(t,o,n,i)},r.verifyRaw=a;var f=n(e("assert")),l=e("./hash"),u=n(e("./enforce_types")),c=n(e("bigi")),p=n(e("./ecsignature")),_=e("safe-buffer").Buffer},{"./ecsignature":15,"./enforce_types":16,"./hash":17,assert:40,bigi:31,"safe-buffer":97}],15:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){(0,f["default"])(l["default"],e),(0,f["default"])(l["default"],t),this.r=e,this.s=t}r.__esModule=!0,r["default"]=void 0;var o=n(e("assert")),f=n(e("./enforce_types")),l=n(e("bigi")),d=e("safe-buffer").Buffer;a.parseCompact=function(e){o["default"].equal(e.length,65,"Invalid signature length");var t=e.readUInt8(0)-27;o["default"].equal(t,7&t,"Invalid signature parameter");var n=!!(4&t);t&=3;var f=l["default"].fromBuffer(e.slice(1,33)),r=l["default"].fromBuffer(e.slice(33));return{compressed:n,i:t,signature:new a(f,r)}},a.fromDER=function(e){o["default"].equal(e.readUInt8(0),48,"Not a DER sequence"),o["default"].equal(e.readUInt8(1),e.length-2,"Invalid sequence length"),o["default"].equal(e.readUInt8(2),2,"Expected a DER integer");var t=e.readUInt8(3);(0,o["default"])(0<t,"R length is zero");var n=4+t;o["default"].equal(e.readUInt8(n),2,"Expected a DER integer (2)");var i=e.readUInt8(n+1);(0,o["default"])(0<i,"S length is zero");var f=e.slice(4,n),d=e.slice(n+2);n+=2+i,1<t&&0===f.readUInt8(0)&&(0,o["default"])(128&f.readUInt8(1),"R value excessively padded"),1<i&&0===d.readUInt8(0)&&(0,o["default"])(128&d.readUInt8(1),"S value excessively padded"),o["default"].equal(n,e.length,"Invalid DER encoding");var u=l["default"].fromDERInteger(f),r=l["default"].fromDERInteger(d);return(0,o["default"])(0<=u.signum(),"R value is negative"),(0,o["default"])(0<=r.signum(),"S value is negative"),new a(u,r)},a.parseScriptSignature=function(e){var t=e.readUInt8(e.length-1),r=-129&t;return(0,o["default"])(0<r&&4>r,"Invalid hashType"),{signature:a.fromDER(e.slice(0,-1)),hashType:t}},a.prototype.toCompact=function(e,t){t&&(e+=4),e+=27;var r=d.alloc(65);return r.writeUInt8(e,0),this.r.toBuffer(32).copy(r,1),this.s.toBuffer(32).copy(r,33),r},a.prototype.toDER=function(){var e=this.r.toDERInteger(),t=this.s.toDERInteger(),r=[];return r.push(2,e.length),r=r.concat(e),r.push(2,t.length),r=r.concat(t),r.unshift(48,r.length),d.from(r)},a.prototype.toScriptSignature=function(e){var t=d.alloc(1);return t.writeUInt8(e,0),d.concat([this.toDER(),t])};r["default"]=a,t.exports=r.default},{"./enforce_types":16,assert:40,bigi:31,"safe-buffer":97}],16:[function(e,t,r){(function(e){"use strict";function n(e){var t=e.toString().match(/function (.*?)\(/);return t?t[1]:null}r.__esModule=!0,r["default"]=function(t,r){switch(t){case"Array":{if(Array.isArray(r))return;break}case"Boolean":{if("boolean"==typeof r)return;break}case"Buffer":{if(e.isBuffer(r))return;break}case"Number":{if("number"==typeof r)return;break}case"String":{if("string"==typeof r)return;break}default:if(n(r.constructor)===n(t))return;}throw new TypeError("Expected "+(n(t)||t)+", got "+r)},t.exports=r.default}).call(this,{isBuffer:e("../../../node_modules/is-buffer/index.js")})},{"../../../node_modules/is-buffer/index.js":74}],17:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r.sha1=function(e,t){return(0,i["default"])("sha1").update(e).digest(t)},r.sha256=function(e,t){return(0,i["default"])("sha256").update(e).digest(t)},r.sha512=function(e,t){return(0,i["default"])("sha512").update(e).digest(t)},r.HmacSHA256=function(e,t){return(0,a["default"])("sha256",t).update(e).digest()},r.ripemd160=function(e){return(0,i["default"])("rmd160").update(e).digest()};var i=n(e("create-hash")),a=n(e("create-hmac"))},{"create-hash":49,"create-hmac":51}],18:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var a=e("./ecdsa"),o=e("./hash"),s=e("ecurve"),f=n(e("assert")),l=n(e("bigi")),d=n(e("./PublicKey")),u=(0,s.getCurveByName)("secp256k1"),c=e("safe-buffer").Buffer,p=function(){function t(e,t,r){this.r=e,this.s=t,this.i=r,f["default"].equal(null!=this.r,!0,"Missing parameter"),f["default"].equal(null!=this.s,!0,"Missing parameter"),f["default"].equal(null!=this.i,!0,"Missing parameter")}t.fromBuffer=function(e){var n,a,o;return f["default"].equal(e.length,65,"Invalid signature length"),n=e.readUInt8(0),f["default"].equal(n-27,7&n-27,"Invalid signature parameter"),a=l["default"].fromBuffer(e.slice(1,33)),o=l["default"].fromBuffer(e.slice(33)),new t(a,o,n)};var r=t.prototype;return r.toBuffer=function(){var e;return e=c.alloc(65),e.writeUInt8(this.i,0),this.r.toBuffer(32).copy(e,1),this.s.toBuffer(32).copy(e,33),e},r.recoverPublicKeyFromBuffer=function(e){return this.recoverPublicKey((0,o.sha256)(e))},r.recoverPublicKey=function(t){var r,n,o;return n=l["default"].fromBuffer(t),o=this.i,o-=27,o&=3,r=(0,a.recoverPubKey)(u,n,this,o),d["default"].fromPoint(r)},t.signBuffer=function(e,r){var n=(0,o.sha256)(e);return t.signBufferSha256(n,r)},t.signBufferSha256=function(r,n){if(32!==r.length||!c.isBuffer(r))throw new Error("buf_sha256: 32 byte buffer requred");var o,s,f,d,p,_,g;for(d=null,g=0,s=l["default"].fromBuffer(r);;){if(f=(0,a.sign)(u,r,n.d,g++),o=f.toDER(),p=o[3],_=o[5+p],32===p&&32===_){d=(0,a.calcPubKeyRecoveryParam)(u,s,f,n.toPublicKey().Q),d+=4,d+=27;break}0==g%10&&console.log("WARN: "+g+" attempts to find canonical signature")}return new t(f.r,f.s,d)},t.sign=function(e,r){return t.signBuffer(c.from(e),r)},r.verifyBuffer=function(e,t){var r=(0,o.sha256)(e);return this.verifyHash(r,t)},r.verifyHash=function(e,t){return f["default"].equal(e.length,32,"A SHA 256 should be 32 bytes long, instead got "+e.length),(0,a.verify)(u,e,{r:this.r,s:this.s},t.Q)},r.toByteBuffer=function(){var e;return e=new ByteBuffer(ByteBuffer.DEFAULT_CAPACITY,ByteBuffer.LITTLE_ENDIAN),this.appendByteBuffer(e),e.copy(0,e.offset)},t.fromHex=function(e){return t.fromBuffer(c.from(e,"hex"))},r.toHex=function(){return this.toBuffer().toString("hex")},t.signHex=function(e,r){var n;return n=c.from(e,"hex"),t.signBuffer(n,r)},r.verifyHex=function(e,t){var r;return r=c.from(e,"hex"),this.verifyBuffer(r,t)},t}();r["default"]=p,t.exports=r.default},{"./PublicKey":11,"./ecdsa":14,"./hash":17,assert:40,bigi:31,ecurve:67,"safe-buffer":97}],19:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r.ops=void 0;var i=n(e("./src/serializer"));r.Serializer=i["default"];var a=n(e("./src/FastParser"));r.fp=a["default"];var o=n(e("./src/types"));r.types=o["default"];var s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t["default"]=e,t}(e("./src/operations"));r.ops=s;var f=n(e("./src/template"));r.template=f["default"];var l=n(e("./src/SerializerValidation"));r.SerializerValidation=l["default"]},{"./src/FastParser":20,"./src/SerializerValidation":21,"./src/operations":23,"./src/serializer":24,"./src/template":25,"./src/types":26}],20:[function(e,t,r){"use strict";r.__esModule=!0,r["default"]=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("../../ecc/src/PublicKey")),i=e("safe-buffer").Buffer,a=function(){function e(){}return e.fixed_data=function(e,t,r){if(e)if(r){var n=r.slice(0,t).toString("binary");for(e.append(n,"binary");t-->n.length;)e.writeUint8(0)}else{var a=e.copy(e.offset,e.offset+t);return e.skip(t),i.from(a.toBinary(),"binary")}},e.public_key=function(t,r){if(t){if(r){var i=r.toBuffer();return void t.append(i.toString("binary"),"binary")}return i=e.fixed_data(t,33),n["default"].fromBuffer(i)}},e.ripemd160=function(t,r){return t?r?void e.fixed_data(t,20,r):e.fixed_data(t,20):void 0},e.time_point_sec=function(e,t){return t?(t=f(t/1e3),void e.writeInt32(t)):(t=e.readInt32(),new Date(1e3*t))},e}();r["default"]=a,t.exports=r.default},{"../../ecc/src/PublicKey":11,"safe-buffer":97}],21:[function(e,t,r){"use strict";r.__esModule=!0,r["default"]=void 0;var n=e("bytebuffer"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("../../chain/src/ChainTypes")),a=9007199254740991,o=-9007199254740991;r["default"]={is_empty:function(e){return null===e||e===void 0},required:function(e,t){if(void 0===t&&(t=""),this.is_empty(e))throw new Error("value required "+t+" "+e);return e},require_array:function(e,t){if(!(e instanceof Array))throw new Error("array required");return t&&e.forEach(function(e){t(e)}),e},require_long:function(e,t){if(void 0===t&&(t=""),!n.Long.isLong(e))throw new Error("Long value required "+t+" "+e);return e},string:function(e){if(this.is_empty(e))return e;if("string"!=typeof e)throw new Error("string required: "+e);return e},number:function(e){if(this.is_empty(e))return e;if("number"!=typeof e)throw new Error("number required: "+e);return e},whole_number:function(e,t){if(void 0===t&&(t=""),this.is_empty(e))return e;if(/\./.test(e))throw new Error("whole number required "+t+" "+e);return e},unsigned:function(e,t){if(void 0===t&&(t=""),this.is_empty(e))return e;if(/-/.test(e))throw new Error("unsigned required "+t+" "+e);return e},is_digits:function(e){return!("numeric"!=typeof e)||/^[0-9]+$/.test(e)},to_number:function(e,t){if(void 0===t&&(t=""),this.is_empty(e))return e;this.no_overflow53(e,t);var r=function(){return"number"==typeof e?e:parseInt(e)}();return r},to_long:function(e,t,r){return(void 0===t&&(t=""),void 0===r&&(r=!1),this.is_empty(e))?e:n.Long.isLong(e)?e:(this.no_overflow64(e,t,r),"number"==typeof e&&(e=""+e),n.Long.fromString(e,r))},to_string:function(e,t){if(void 0===t&&(t=""),this.is_empty(e))return e;if("string"==typeof e)return e;if("number"==typeof e)return this.no_overflow53(e,t),""+e;if(n.Long.isLong(e))return e.toString();throw"unsupported type "+t+": ("+typeof e+") "+e},require_test:function(e,t,r){if(void 0===r&&(r=""),this.is_empty(t))return t;if(!e.test(t))throw new Error("unmatched "+e+" "+r+" "+t);return t},require_match:function(e,t,r){if(void 0===r&&(r=""),this.is_empty(t))return t;var n=t.match(e);if(null===n)throw new Error("unmatched "+e+" "+r+" "+t);return n},require_object_id:function(e,t){return require_match(/^([0-9]+)\.([0-9]+)\.([0-9]+)$/,e,t)},require_range:function(e,t,r,n){if(void 0===n&&(n=""),this.is_empty(r))return r;this.to_number(r);if(r<e||r>t)throw new Error("out of range "+r+" "+n+" "+r);return r},require_object_type:function(e,t,r,n){if(void 0===e&&(e=1),void 0===n&&(n=""),this.is_empty(r))return r;var a=i["default"].object_type[t];if(!a)throw new Error("Unknown object type "+t+" "+n+" "+r);var o=new RegExp(e+"."+a+".[0-9]+$");if(!o.test(r))throw new Error("Expecting "+t+" in format "+(e+"."+a+".[0-9]+ ")+("instead of "+r+" "+n+" "+r));return r},get_instance:function(e,t,r,n){return this.is_empty(r)?r:(this.require_object_type(e,t,r,n),this.to_number(r.split(".")[2]))},require_relative_type:function(e,t,r){return this.require_object_type(0,e,t,r),t},get_relative_instance:function(e,t,r){return this.is_empty(t)?t:(this.require_object_type(0,e,t,r),this.to_number(t.split(".")[2]))},require_protocol_type:function(e,t,r){return this.require_object_type(1,e,t,r),t},get_protocol_instance:function(e,t,r){return this.is_empty(t)?t:(this.require_object_type(1,e,t,r),this.to_number(t.split(".")[2]))},get_protocol_type:function(e,t){if(this.is_empty(e))return e;this.require_object_id(e,t);var r=e.split(".");return this.to_number(r[1])},get_protocol_type_name:function(e,t){if(this.is_empty(e))return e;var r=this.get_protocol_type(e,t);return Object.keys(i["default"].object_type)[r]},require_implementation_type:function(e,t,r){return this.require_object_type(2,e,t,r),t},get_implementation_instance:function(e,t,r){return this.is_empty(t)?t:(this.require_object_type(2,e,t,r),this.to_number(t.split(".")[2]))},no_overflow53:function(e,t){if(void 0===t&&(t=""),"number"==typeof e){if(e>a||e<o)throw new Error("overflow "+t+" "+e);return}if("string"==typeof e){parseInt(e);if(e>a||e<o)throw new Error("overflow "+t+" "+e);return}if(n.Long.isLong(e))return void this.no_overflow53(e.toInt(),t);throw"unsupported type "+t+": ("+typeof e+") "+e},no_overflow64:function(e,t,r){if(void 0===t&&(t=""),void 0===r&&(r=!1),!n.Long.isLong(e)){if(void 0!==e.t&&void 0!==e.s)return void this.no_overflow64(e.toString(),t,r);if("string"==typeof e){for(e=e.replace(/^0+/,"");/0$/.test(e);)e=e.substring(0,e.length-1);/\.$/.test(e)&&(e=e.substring(0,e.length-1)),""===e&&(e="0");var i=n.Long.fromString(e,r).toString();if(i!==e.trim())throw new Error("overflow "+t+" "+e);return}if("number"==typeof e){if(e>a||e<o)throw new Error("overflow "+t+" "+e);return}throw"unsupported type "+t+": ("+typeof e+") "+e}}},t.exports=r.default},{"../../chain/src/ChainTypes":3,bytebuffer:46}],22:[function(e,t,r){"use strict";r.__esModule=!0,r["default"]=void 0;var n=function(){function e(e,t){this.message=e,("undefined"!=typeof t&&null!==t?t.message:void 0)&&(this.message="cause\t"+t.message+"\t"+this.message);var r="";("undefined"!=typeof t&&null!==t?t.stack:void 0)&&(r="caused by\n\t"+t.stack+"\t"+r),this.stack=this.message+"\n"+r}return e["throw"]=function(e,t){var r=e;throw("undefined"!=typeof t&&null!==t?t.message:void 0)&&(r+="\t cause: "+t.message+" "),("undefined"!=typeof t&&null!==t?t.stack:void 0)&&(r+="\n stack: "+t.stack+" "),new Error(r)},e}();r["default"]=n,t.exports=r.default},{}],23:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r.committee_member_create=r.withdraw_permission_delete=r.withdraw_permission_claim=r.withdraw_permission_update=r.withdraw_permission_create=r.proposal_delete=r.proposal_update=r.proposal_create=r.op_wrapper=r.witness_update=r.witness_create=r.asset_publish_feed=r.price_feed=r.asset_global_settle=r.asset_settle=r.asset_fund_fee_pool=r.asset_reserve=r.asset_issue=r.asset_update_feed_producers=r.asset_update_bitasset=r.asset_update=r.asset_create=r.bitasset_options=r.asset_options=r.price=r.account_transfer=r.account_upgrade=r.account_whitelist=r.account_update=r.account_create=r.account_options=r.authority=r.fill_order=r.call_order_update=r.limit_order_cancel=r.limit_order_create=r.transfer=r.memo_data=r.signed_block_header=r.block_header=r.signed_block=r.processed_transaction=r.asset=r.void_result=r.fee_schedule=r.htlc_refund_operation_fee_parameters=r.htlc_extend_operation_fee_parameters=r.htlc_redeemed_operation_fee_parameters=r.htlc_redeem_operation_fee_parameters=r.htlc_create_operation_fee_parameters=r.asset_update_issuer_operation_fee_parameters=r.asset_claim_pool_operation_fee_parameters=r.execute_bid_operation_fee_parameters=r.bid_collateral_operation_fee_parameters=r.fba_distribute_operation_fee_parameters=r.asset_claim_fees_operation_fee_parameters=r.asset_settle_cancel_operation_fee_parameters=r.transfer_from_blind_operation_fee_parameters=r.blind_transfer_operation_fee_parameters=r.transfer_to_blind_operation_fee_parameters=r.override_transfer_operation_fee_parameters=r.balance_claim_operation_fee_parameters=r.assert_operation_fee_parameters=r.custom_operation_fee_parameters=r.worker_create_operation_fee_parameters=r.vesting_balance_withdraw_operation_fee_parameters=r.vesting_balance_create_operation_fee_parameters=r.committee_member_update_global_parameters_operation_fee_parameters=r.committee_member_update_operation_fee_parameters=r.committee_member_create_operation_fee_parameters=r.withdraw_permission_delete_operation_fee_parameters=r.withdraw_permission_claim_operation_fee_parameters=r.withdraw_permission_update_operation_fee_parameters=r.withdraw_permission_create_operation_fee_parameters=r.proposal_delete_operation_fee_parameters=r.proposal_update_operation_fee_parameters=r.proposal_create_operation_fee_parameters=r.witness_update_operation_fee_parameters=r.witness_create_operation_fee_parameters=r.asset_publish_feed_operation_fee_parameters=r.asset_global_settle_operation_fee_parameters=r.asset_settle_operation_fee_parameters=r.asset_fund_fee_pool_operation_fee_parameters=r.asset_reserve_operation_fee_parameters=r.asset_issue_operation_fee_parameters=r.asset_update_feed_producers_operation_fee_parameters=r.asset_update_bitasset_operation_fee_parameters=r.asset_update_operation_fee_parameters=r.asset_create_operation_fee_parameters=r.account_transfer_operation_fee_parameters=r.account_upgrade_operation_fee_parameters=r.account_whitelist_operation_fee_parameters=r.account_update_operation_fee_parameters=r.account_create_operation_fee_parameters=r.fill_order_operation_fee_parameters=r.call_order_update_operation_fee_parameters=r.limit_order_cancel_operation_fee_parameters=r.limit_order_create_operation_fee_parameters=r.transfer_operation_fee_parameters=r.operation=void 0,r.stealth_memo_data=r.signed_transaction=r.transaction=r.htlc_refund=r.htlc_extend=r.htlc_redeemed=r.htlc_redeem=r.htlc_create=r.asset_update_issuer=r.asset_claim_pool=r.execute_bid=r.bid_collateral=r.fba_distribute=r.asset_claim_fees=r.asset_settle_cancel=r.transfer_from_blind=r.blind_transfer=r.blind_input=r.transfer_to_blind=r.blind_output=r.stealth_confirmation=r.override_transfer=r.balance_claim=r.assert=r.block_id_predicate=r.asset_symbol_eq_lit_predicate=r.account_name_eq_lit_predicate=r.custom=r.worker_create=r.burn_worker_initializer=r.vesting_balance_worker_initializer=r.refund_worker_initializer=r.vesting_balance_withdraw=r.vesting_balance_create=r.cdd_vesting_policy_initializer=r.linear_vesting_policy_initializer=r.committee_member_update_global_parameters=r.chain_parameters=r.committee_member_update=void 0;var i=n(e("./types")),a=n(e("./serializer")),o=i["default"].uint8,s=i["default"].uint16,f=i["default"].uint32,l=i["default"].int64,d=i["default"].uint64,u=i["default"].string,c=i["default"].bytes,p=i["default"].bool,_=i["default"].array,g=i["default"].protocol_id_type,m=i["default"].object_id_type,b=i["default"].vote_id,h=i["default"].future_extensions,y=i["default"].static_variant,w=i["default"].map,v=i["default"].set,B=i["default"].public_key,x=i["default"].address,k=i["default"].time_point_sec,S=i["default"].optional,I=i["default"].extension;h=i["default"]["void"];var T=y();r.operation=T;var E=function(e,t){return new a["default"](e,t)},L=new E("transfer_operation_fee_parameters",{fee:d,price_per_kbyte:f});r.transfer_operation_fee_parameters=L;var j=new E("limit_order_create_operation_fee_parameters",{fee:d});r.limit_order_create_operation_fee_parameters=j;var A=new E("limit_order_cancel_operation_fee_parameters",{fee:d});r.limit_order_cancel_operation_fee_parameters=A;var O=new E("call_order_update_operation_fee_parameters",{fee:d});r.call_order_update_operation_fee_parameters=O;var C=new E("fill_order_operation_fee_parameters");r.fill_order_operation_fee_parameters=C;var q=new E("account_create_operation_fee_parameters",{basic_fee:d,premium_fee:d,price_per_kbyte:f});r.account_create_operation_fee_parameters=q;var U=new E("account_update_operation_fee_parameters",{fee:l,price_per_kbyte:f});r.account_update_operation_fee_parameters=U;var D=new E("account_whitelist_operation_fee_parameters",{fee:l});r.account_whitelist_operation_fee_parameters=D;var M=new E("account_upgrade_operation_fee_parameters",{membership_annual_fee:d,membership_lifetime_fee:d});r.account_upgrade_operation_fee_parameters=M;var z=new E("account_transfer_operation_fee_parameters",{fee:d});r.account_transfer_operation_fee_parameters=z;var P=new E("asset_create_operation_fee_parameters",{symbol3:d,symbol4:d,long_symbol:d,price_per_kbyte:f});r.asset_create_operation_fee_parameters=P;var R=new E("asset_update_operation_fee_parameters",{fee:d,price_per_kbyte:f});r.asset_update_operation_fee_parameters=R;var N=new E("asset_update_bitasset_operation_fee_parameters",{fee:d});r.asset_update_bitasset_operation_fee_parameters=N;var F=new E("asset_update_feed_producers_operation_fee_parameters",{fee:d});r.asset_update_feed_producers_operation_fee_parameters=F;var H=new E("asset_issue_operation_fee_parameters",{fee:d,price_per_kbyte:f});r.asset_issue_operation_fee_parameters=H;var K=new E("asset_reserve_operation_fee_parameters",{fee:d});r.asset_reserve_operation_fee_parameters=K;var V=new E("asset_fund_fee_pool_operation_fee_parameters",{fee:d});r.asset_fund_fee_pool_operation_fee_parameters=V;var W=new E("asset_settle_operation_fee_parameters",{fee:d});r.asset_settle_operation_fee_parameters=W;var Z=new E("asset_global_settle_operation_fee_parameters",{fee:d});r.asset_global_settle_operation_fee_parameters=Z;var G=new E("asset_publish_feed_operation_fee_parameters",{fee:d});r.asset_publish_feed_operation_fee_parameters=G;var Y=new E("witness_create_operation_fee_parameters",{fee:d});r.witness_create_operation_fee_parameters=Y;var X=new E("witness_update_operation_fee_parameters",{fee:l});r.witness_update_operation_fee_parameters=X;var Q=new E("proposal_create_operation_fee_parameters",{fee:d,price_per_kbyte:f});r.proposal_create_operation_fee_parameters=Q;var J=new E("proposal_update_operation_fee_parameters",{fee:d,price_per_kbyte:f});r.proposal_update_operation_fee_parameters=J;var $=new E("proposal_delete_operation_fee_parameters",{fee:d});r.proposal_delete_operation_fee_parameters=$;var ee=new E("withdraw_permission_create_operation_fee_parameters",{fee:d});r.withdraw_permission_create_operation_fee_parameters=ee;var te=new E("withdraw_permission_update_operation_fee_parameters",{fee:d});r.withdraw_permission_update_operation_fee_parameters=te;var re=new E("withdraw_permission_claim_operation_fee_parameters",{fee:d,price_per_kbyte:f});r.withdraw_permission_claim_operation_fee_parameters=re;var ne=new E("withdraw_permission_delete_operation_fee_parameters",{fee:d});r.withdraw_permission_delete_operation_fee_parameters=ne;var ie=new E("committee_member_create_operation_fee_parameters",{fee:d});r.committee_member_create_operation_fee_parameters=ie;var ae=new E("committee_member_update_operation_fee_parameters",{fee:d});r.committee_member_update_operation_fee_parameters=ae;var oe=new E("committee_member_update_global_parameters_operation_fee_parameters",{fee:d});r.committee_member_update_global_parameters_operation_fee_parameters=oe;var se=new E("vesting_balance_create_operation_fee_parameters",{fee:d});r.vesting_balance_create_operation_fee_parameters=se;var fe=new E("vesting_balance_withdraw_operation_fee_parameters",{fee:d});r.vesting_balance_withdraw_operation_fee_parameters=fe;var le=new E("worker_create_operation_fee_parameters",{fee:d});r.worker_create_operation_fee_parameters=le;var de=new E("custom_operation_fee_parameters",{fee:d,price_per_kbyte:f});r.custom_operation_fee_parameters=de;var ue=new E("assert_operation_fee_parameters",{fee:d});r.assert_operation_fee_parameters=ue;var ce=new E("balance_claim_operation_fee_parameters");r.balance_claim_operation_fee_parameters=ce;var pe=new E("override_transfer_operation_fee_parameters",{fee:d,price_per_kbyte:f});r.override_transfer_operation_fee_parameters=pe;var _e=new E("transfer_to_blind_operation_fee_parameters",{fee:d,price_per_output:f});r.transfer_to_blind_operation_fee_parameters=_e;var ge=new E("blind_transfer_operation_fee_parameters",{fee:d,price_per_output:f});r.blind_transfer_operation_fee_parameters=ge;var me=new E("transfer_from_blind_operation_fee_parameters",{fee:d});r.transfer_from_blind_operation_fee_parameters=me;var be=new E("asset_settle_cancel_operation_fee_parameters");r.asset_settle_cancel_operation_fee_parameters=be;var he=new E("asset_claim_fees_operation_fee_parameters",{fee:d});r.asset_claim_fees_operation_fee_parameters=he;var ye=new E("fba_distribute_operation_fee_parameters");r.fba_distribute_operation_fee_parameters=ye;var we=new E("bid_collateral_operation_fee_parameters",{fee:d});r.bid_collateral_operation_fee_parameters=we;var ve=new E("execute_bid_operation_fee_parameters");r.execute_bid_operation_fee_parameters=ve;var Be=new E("asset_claim_pool_operation_fee_parameters",{fee:d});r.asset_claim_pool_operation_fee_parameters=Be;var xe=new E("asset_update_issuer_operation_fee_parameters",{fee:d});r.asset_update_issuer_operation_fee_parameters=xe;var ke=new E("htlc_create_operation_fee_parameters",{fee:d,fee_per_day:d});r.htlc_create_operation_fee_parameters=ke;var Se=new E("htlc_redeem_operation_fee_parameters",{fee:d,fee_per_kb:d});r.htlc_redeem_operation_fee_parameters=Se;var Ie=new E("htlc_redeemed_operation_fee_parameters",{});r.htlc_redeemed_operation_fee_parameters=Ie;var Te=new E("htlc_extend_operation_fee_parameters",{fee:d,fee_per_day:d});r.htlc_extend_operation_fee_parameters=Te;var Ee=new E("htlc_refund_operation_fee_parameters",{});r.htlc_refund_operation_fee_parameters=Ee;var Le=y([L,j,A,O,C,q,U,D,M,z,P,R,N,F,H,K,V,W,Z,G,Y,X,Q,J,$,ee,te,re,ne,ie,ae,oe,se,fe,le,de,ue,ce,pe,_e,ge,me,be,he,ye,we,ve,Be,xe,ke,Se,Ie,Te,Ee]),je=new E("fee_schedule",{parameters:v(Le),scale:f});r.fee_schedule=je;var Ae=new E("void_result");r.void_result=Ae;var Oe=new E("asset",{amount:l,asset_id:g("asset")});r.asset=Oe;var Ce=y([Ae,m,Oe]),qe=new E("processed_transaction",{ref_block_num:s,ref_block_prefix:f,expiration:k,operations:_(T),extensions:v(h),signatures:_(c(65)),operation_results:_(Ce)});r.processed_transaction=qe;var Ue=new E("signed_block",{previous:c(20),timestamp:k,witness:g("witness"),transaction_merkle_root:c(20),extensions:v(h),witness_signature:c(65),transactions:_(qe)});r.signed_block=Ue;var De=new E("block_header",{previous:c(20),timestamp:k,witness:g("witness"),transaction_merkle_root:c(20),extensions:v(h)});r.block_header=De;var Me=new E("signed_block_header",{previous:c(20),timestamp:k,witness:g("witness"),transaction_merkle_root:c(20),extensions:v(h),witness_signature:c(65)});r.signed_block_header=Me;var ze=new E("memo_data",{from:B,to:B,nonce:d,message:c()});r.memo_data=ze;var Pe=new E("transfer",{fee:Oe,from:g("account"),to:g("account"),amount:Oe,memo:S(ze),extensions:v(h)});r.transfer=Pe;var Re=new E("limit_order_create",{fee:Oe,seller:g("account"),amount_to_sell:Oe,min_to_receive:Oe,expiration:k,fill_or_kill:p,extensions:v(h)});r.limit_order_create=Re;var Ne=new E("limit_order_cancel",{fee:Oe,fee_paying_account:g("account"),order:g("limit_order"),extensions:v(h)});r.limit_order_cancel=Ne;var Fe=new E("call_order_update",{fee:Oe,funding_account:g("account"),delta_collateral:Oe,delta_debt:Oe,extensions:I([{name:"target_collateral_ratio",type:s}])});r.call_order_update=Fe;var He=new E("fill_order",{fee:Oe,order_id:m,account_id:g("account"),pays:Oe,receives:Oe});r.fill_order=He;var Ke=new E("authority",{weight_threshold:f,account_auths:w(g("account"),s),key_auths:w(B,s),address_auths:w(x,s)});r.authority=Ke;var Ve=new E("account_options",{memo_key:B,voting_account:g("account"),num_witness:s,num_committee:s,votes:v(b),extensions:v(h)});r.account_options=Ve;var We=new E("account_create",{fee:Oe,registrar:g("account"),referrer:g("account"),referrer_percent:s,name:u,owner:Ke,active:Ke,options:Ve,extensions:v(h)});r.account_create=We;var Ze=new E("account_update",{fee:Oe,account:g("account"),owner:S(Ke),active:S(Ke),new_options:S(Ve),extensions:v(h)});r.account_update=Ze;var Ge=new E("account_whitelist",{fee:Oe,authorizing_account:g("account"),account_to_list:g("account"),new_listing:o,extensions:v(h)});r.account_whitelist=Ge;var Ye=new E("account_upgrade",{fee:Oe,account_to_upgrade:g("account"),upgrade_to_lifetime_member:p,extensions:v(h)});r.account_upgrade=Ye;var Xe=new E("account_transfer",{fee:Oe,account_id:g("account"),new_owner:g("account"),extensions:v(h)});r.account_transfer=Xe;var Qe=new E("price",{base:Oe,quote:Oe});r.price=Qe;var Je=new E("asset_options",{max_supply:l,market_fee_percent:s,max_market_fee:l,issuer_permissions:s,flags:s,core_exchange_rate:Qe,whitelist_authorities:v(g("account")),blacklist_authorities:v(g("account")),whitelist_markets:v(g("asset")),blacklist_markets:v(g("asset")),description:u,extensions:I([{name:"reward_percent",type:s},{name:"whitelist_market_fee_sharing",type:v(g("account"))}])});r.asset_options=Je;var $e=new E("bitasset_options",{feed_lifetime_sec:f,minimum_feeds:o,force_settlement_delay_sec:f,force_settlement_offset_percent:s,maximum_force_settlement_volume:s,short_backing_asset:g("asset"),extensions:v(h)});r.bitasset_options=$e;var et=new E("asset_create",{fee:Oe,issuer:g("account"),symbol:u,precision:o,common_options:Je,bitasset_opts:S($e),is_prediction_market:p,extensions:v(h)});r.asset_create=et;var tt=new E("asset_update",{fee:Oe,issuer:g("account"),asset_to_update:g("asset"),new_issuer:S(g("account")),new_options:Je,extensions:v(h)});r.asset_update=tt;var rt=new E("asset_update_bitasset",{fee:Oe,issuer:g("account"),asset_to_update:g("asset"),new_options:$e,extensions:v(h)});r.asset_update_bitasset=rt;var nt=new E("asset_update_feed_producers",{fee:Oe,issuer:g("account"),asset_to_update:g("asset"),new_feed_producers:v(g("account")),extensions:v(h)});r.asset_update_feed_producers=nt;var it=new E("asset_issue",{fee:Oe,issuer:g("account"),asset_to_issue:Oe,issue_to_account:g("account"),memo:S(ze),extensions:v(h)});r.asset_issue=it;var at=new E("asset_reserve",{fee:Oe,payer:g("account"),amount_to_reserve:Oe,extensions:v(h)});r.asset_reserve=at;var ot=new E("asset_fund_fee_pool",{fee:Oe,from_account:g("account"),asset_id:g("asset"),amount:l,extensions:v(h)});r.asset_fund_fee_pool=ot;var st=new E("asset_settle",{fee:Oe,account:g("account"),amount:Oe,extensions:v(h)});r.asset_settle=st;var ft=new E("asset_global_settle",{fee:Oe,issuer:g("account"),asset_to_settle:g("asset"),settle_price:Qe,extensions:v(h)});r.asset_global_settle=ft;var lt=new E("price_feed",{settlement_price:Qe,maintenance_collateral_ratio:s,maximum_short_squeeze_ratio:s,core_exchange_rate:Qe});r.price_feed=lt;var dt=new E("asset_publish_feed",{fee:Oe,publisher:g("account"),asset_id:g("asset"),feed:lt,extensions:v(h)});r.asset_publish_feed=dt;var ut=new E("witness_create",{fee:Oe,witness_account:g("account"),url:u,block_signing_key:B});r.witness_create=ut;var ct=new E("witness_update",{fee:Oe,witness:g("witness"),witness_account:g("account"),new_url:S(u),new_signing_key:S(B)});r.witness_update=ct;var pt=new E("op_wrapper",{op:T});r.op_wrapper=pt;var _t=new E("proposal_create",{fee:Oe,fee_paying_account:g("account"),expiration_time:k,proposed_ops:_(pt),review_period_seconds:S(f),extensions:v(h)});r.proposal_create=_t;var gt=new E("proposal_update",{fee:Oe,fee_paying_account:g("account"),proposal:g("proposal"),active_approvals_to_add:v(g("account")),active_approvals_to_remove:v(g("account")),owner_approvals_to_add:v(g("account")),owner_approvals_to_remove:v(g("account")),key_approvals_to_add:v(B),key_approvals_to_remove:v(B),extensions:v(h)});r.proposal_update=gt;var mt=new E("proposal_delete",{fee:Oe,fee_paying_account:g("account"),using_owner_authority:p,proposal:g("proposal"),extensions:v(h)});r.proposal_delete=mt;var bt=new E("withdraw_permission_create",{fee:Oe,withdraw_from_account:g("account"),authorized_account:g("account"),withdrawal_limit:Oe,withdrawal_period_sec:f,periods_until_expiration:f,period_start_time:k});r.withdraw_permission_create=bt;var ht=new E("withdraw_permission_update",{fee:Oe,withdraw_from_account:g("account"),authorized_account:g("account"),permission_to_update:g("withdraw_permission"),withdrawal_limit:Oe,withdrawal_period_sec:f,period_start_time:k,periods_until_expiration:f});r.withdraw_permission_update=ht;var yt=new E("withdraw_permission_claim",{fee:Oe,withdraw_permission:g("withdraw_permission"),withdraw_from_account:g("account"),withdraw_to_account:g("account"),amount_to_withdraw:Oe,memo:S(ze)});r.withdraw_permission_claim=yt;var wt=new E("withdraw_permission_delete",{fee:Oe,withdraw_from_account:g("account"),authorized_account:g("account"),withdrawal_permission:g("withdraw_permission")});r.withdraw_permission_delete=wt;var vt=new E("committee_member_create",{fee:Oe,committee_member_account:g("account"),url:u});r.committee_member_create=vt;var Bt=new E("committee_member_update",{fee:Oe,committee_member:g("committee_member"),committee_member_account:g("account"),new_url:S(u)});r.committee_member_update=Bt;var xt=new E("chain_parameters",{current_fees:je,block_interval:o,maintenance_interval:f,maintenance_skip_slots:o,committee_proposal_review_period:f,maximum_transaction_size:f,maximum_block_size:f,maximum_time_until_expiration:f,maximum_proposal_lifetime:f,maximum_asset_whitelist_authorities:o,maximum_asset_feed_publishers:o,maximum_witness_count:s,maximum_committee_count:s,maximum_authority_membership:s,reserve_percent_of_fee:s,network_percent_of_fee:s,lifetime_referrer_percent_of_fee:s,cashback_vesting_period_seconds:f,cashback_vesting_threshold:l,count_non_member_votes:p,allow_non_member_whitelists:p,witness_pay_per_block:l,worker_budget_per_day:l,max_predicate_opcode:s,fee_liquidation_threshold:l,accounts_per_fee_scale:s,account_fee_scale_bitshifts:o,max_authority_depth:o,extensions:v(h)});r.chain_parameters=xt;var kt=new E("committee_member_update_global_parameters",{fee:Oe,new_parameters:xt});r.committee_member_update_global_parameters=kt;var St=new E("linear_vesting_policy_initializer",{begin_timestamp:k,vesting_cliff_seconds:f,vesting_duration_seconds:f});r.linear_vesting_policy_initializer=St;var It=new E("cdd_vesting_policy_initializer",{start_claim:k,vesting_seconds:f});r.cdd_vesting_policy_initializer=It;var Tt=y([St,It]),Et=new E("vesting_balance_create",{fee:Oe,creator:g("account"),owner:g("account"),amount:Oe,policy:Tt});r.vesting_balance_create=Et;var Lt=new E("vesting_balance_withdraw",{fee:Oe,vesting_balance:g("vesting_balance"),owner:g("account"),amount:Oe});r.vesting_balance_withdraw=Lt;var jt=new E("refund_worker_initializer");r.refund_worker_initializer=jt;var At=new E("vesting_balance_worker_initializer",{pay_vesting_period_days:s});r.vesting_balance_worker_initializer=At;var Ot=new E("burn_worker_initializer");r.burn_worker_initializer=Ot;var Ct=y([jt,At,Ot]),qt=new E("worker_create",{fee:Oe,owner:g("account"),work_begin_date:k,work_end_date:k,daily_pay:l,name:u,url:u,initializer:Ct});r.worker_create=qt;var Ut=new E("custom",{fee:Oe,payer:g("account"),required_auths:v(g("account")),id:s,data:c()});r.custom=Ut;var Dt=new E("account_name_eq_lit_predicate",{account_id:g("account"),name:u});r.account_name_eq_lit_predicate=Dt;var Mt=new E("asset_symbol_eq_lit_predicate",{asset_id:g("asset"),symbol:u});r.asset_symbol_eq_lit_predicate=Mt;var zt=new E("block_id_predicate",{id:c(20)});r.block_id_predicate=zt;var Pt=y([Dt,Mt,zt]),Rt=new E("assert",{fee:Oe,fee_paying_account:g("account"),predicates:_(Pt),required_auths:v(g("account")),extensions:v(h)});r.assert=Rt;var Nt=new E("balance_claim",{fee:Oe,deposit_to_account:g("account"),balance_to_claim:g("balance"),balance_owner_key:B,total_claimed:Oe});r.balance_claim=Nt;var Ft=new E("override_transfer",{fee:Oe,issuer:g("account"),from:g("account"),to:g("account"),amount:Oe,memo:S(ze),extensions:v(h)});r.override_transfer=Ft;var Ht=new E("stealth_confirmation",{one_time_key:B,to:S(B),encrypted_memo:c()});r.stealth_confirmation=Ht;var Kt=new E("blind_output",{commitment:c(33),range_proof:c(),owner:Ke,stealth_memo:S(Ht)});r.blind_output=Kt;var Vt=new E("transfer_to_blind",{fee:Oe,amount:Oe,from:g("account"),blinding_factor:c(32),outputs:_(Kt)});r.transfer_to_blind=Vt;var Wt=new E("blind_input",{commitment:c(33),owner:Ke});r.blind_input=Wt;var Zt=new E("blind_transfer",{fee:Oe,inputs:_(Wt),outputs:_(Kt)});r.blind_transfer=Zt;var Gt=new E("transfer_from_blind",{fee:Oe,amount:Oe,to:g("account"),blinding_factor:c(32),inputs:_(Wt)});r.transfer_from_blind=Gt;var Yt=new E("asset_settle_cancel",{fee:Oe,settlement:g("force_settlement"),account:g("account"),amount:Oe,extensions:v(h)});r.asset_settle_cancel=Yt;var Xt=new E("asset_claim_fees",{fee:Oe,issuer:g("account"),amount_to_claim:Oe,extensions:v(h)});r.asset_claim_fees=Xt;var Qt=new E("fba_distribute",{fee:Oe,account_id:g("account"),fba_id:g("fba_accumulator"),amount:l});r.fba_distribute=Qt;var Jt=new E("bid_collateral",{fee:Oe,bidder:g("account"),additional_collateral:Oe,debt_covered:Oe,extensions:v(h)});r.bid_collateral=Jt;var $t=new E("execute_bid",{fee:Oe,bidder:g("account"),debt:Oe,collateral:Oe});r.execute_bid=$t;var er=new E("asset_claim_pool",{fee:Oe,issuer:g("account"),asset_id:g("asset"),amount_to_claim:Oe,extensions:v(h)});r.asset_claim_pool=er;var tr=new E("asset_update_issuer",{fee:Oe,issuer:g("account"),asset_to_update:g("asset"),new_issuer:g("account"),extensions:v(h)});r.asset_update_issuer=tr;var rr=new E("htlc_create",{fee:Oe,from:g("account"),to:g("account"),amount:Oe,preimage_hash:y([c(20),c(20),c(32)]),preimage_size:s,claim_period_seconds:f,extensions:v(h)});r.htlc_create=rr;var nr=new E("htlc_redeem",{fee:Oe,htlc_id:g("htlc"),redeemer:g("account"),preimage:c(),extensions:v(h)});r.htlc_redeem=nr;var ir=new E("htlc_redeemed",{fee:Oe,htlc_id:g("htlc"),from:g("account"),to:g("account"),amount:Oe});r.htlc_redeemed=ir;var ar=new E("htlc_extend",{fee:Oe,htlc_id:g("htlc"),update_issuer:g("account"),seconds_to_add:f,extensions:v(h)});r.htlc_extend=ar;var or=new E("htlc_refund",{fee:Oe,htlc_id:g("htlc"),to:g("account")});r.htlc_refund=or,T.st_operations=[Pe,Re,Ne,Fe,He,We,Ze,Ge,Ye,Xe,et,tt,rt,nt,it,at,ot,st,ft,dt,ut,ct,_t,gt,mt,bt,ht,yt,wt,vt,Bt,kt,Et,Lt,qt,Ut,Rt,Nt,Ft,Vt,Zt,Gt,Yt,Xt,Qt,Jt,$t,er,tr,rr,nr,ir,ar,or];var sr=new E("transaction",{ref_block_num:s,ref_block_prefix:f,expiration:k,operations:_(T),extensions:v(h)});r.transaction=sr;var fr=new E("signed_transaction",{ref_block_num:s,ref_block_prefix:f,expiration:k,operations:_(T),extensions:v(h),signatures:_(c(65))});r.signed_transaction=fr;var lr=new E("stealth_memo_data",{from:S(B),amount:Oe,blinding_factor:c(32),commitment:c(33),check:f});r.stealth_memo_data=lr},{"./serializer":24,"./types":26}],24:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var a=i(e("bytebuffer")),o=i(e("./error_with_cause")),s=e("safe-buffer").Buffer,f=n.env.npm_config__graphene_serializer_hex_dump,l=function(){function t(e,r){this.operation_name=e,this.types=r,this.types&&(this.keys=Object.keys(this.types)),t.printDebug=!0}var r=t.prototype;return r.fromByteBuffer=function(r){var e={},n=null;try{for(var a=this.keys,s=0,n;s<a.length;s++){n=a[s];var l=this.types[n];try{if(f)if(l.operation_name)console.error(l.operation_name);else{var d=r.offset;l.fromByteBuffer(r);var u=r.offset;r.offset=d;var c=r.copy(d,u);console.error(this.operation_name+"."+n+"\t",c.toHex())}e[n]=l.fromByteBuffer(r)}catch(i){throw t.printDebug&&(console.error("Error reading "+this.operation_name+"."+n+" in data:"),r.printDebug()),i}}}catch(e){o["default"]["throw"](this.operation_name+"."+n,e)}return e},r.appendByteBuffer=function(e,t){var r=null;try{for(var n=this.keys,a=0,r;a<n.length;a++){r=n[a];var s=this.types[r];s.appendByteBuffer(e,t[r])}}catch(n){try{o["default"]["throw"](this.operation_name+"."+r+" = "+JSON.stringify(t[r]),n)}catch(i){o["default"]["throw"](this.operation_name+"."+r+" = "+t[r],n)}}},r.fromObject=function(e){var t={},r=null;try{for(var n=this.keys,a=0,r;a<n.length;a++){r=n[a];var s=this.types[r],f=e[r],l=s.fromObject(f);t[r]=l}}catch(e){o["default"]["throw"](this.operation_name+"."+r,e)}return t},r.toObject=function(e,t){void 0===e&&(e={}),void 0===t&&(t={use_default:!1,annotate:!1});var r={},n=null;try{if(!this.types)return r;for(var s=this.keys,l=0,n;l<s.length;l++){n=s[l];var d=this.types[n],u=d.toObject("undefined"!=typeof e&&null!==e?e[n]:void 0,t);if(r[n]=u,f){var c=new a["default"](a["default"].DEFAULT_CAPACITY,a["default"].LITTLE_ENDIAN);d.appendByteBuffer(c,"undefined"!=typeof e&&null!==e?e[n]:void 0),c=c.copy(0,c.offset),console.error(this.operation_name+"."+n,c.toHex())}}}catch(e){o["default"]["throw"](this.operation_name+"."+n,e)}return r},r.compare=function(e,t){var r=this.keys[0],n=this.types[r],i=e[r],a=t[r];if(n.compare)return n.compare(i,a);if("number"==typeof i&&"number"==typeof a)return i-a;var o;s.isBuffer(i)&&s.isBuffer(a)&&(o="hex");var f=i.toString(o),l=a.toString(o);return f>l?1:f<l?-1:0},r.fromHex=function(e){var t=a["default"].fromHex(e,a["default"].LITTLE_ENDIAN);return this.fromByteBuffer(t)},r.fromBuffer=function(e){var t=a["default"].fromBinary(e.toString("binary"),a["default"].LITTLE_ENDIAN);return this.fromByteBuffer(t)},r.toHex=function(e){var t=this.toByteBuffer(e);return t.toHex()},r.toByteBuffer=function(e){var t=new a["default"](a["default"].DEFAULT_CAPACITY,a["default"].LITTLE_ENDIAN);return this.appendByteBuffer(t,e),t.copy(0,t.offset)},r.toBuffer=function(e){return s.from(this.toByteBuffer(e).toBinary(),"binary")},t}();r["default"]=l,t.exports=r.default}).call(this,e("_process"))},{"./error_with_cause":22,_process:82,bytebuffer:46,"safe-buffer":97}],25:[function(e,t,r){"use strict";r.__esModule=!0,r["default"]=function(e){var t=e.toObject(void 0,{use_default:!0,annotate:!0});console.error(JSON.stringify(t,null,4)),t=e.toObject(void 0,{use_default:!0,annotate:!1}),console.error(JSON.stringify(t))},t.exports=r.default},{}],26:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r["default"]=void 0;var a=i(e("./SerializerValidation")),o=i(e("./FastParser")),f=i(e("../../chain/src/ChainTypes")),l=i(e("../../chain/src/ObjectId")),d=e("../../ecc"),c=e("bitsharesjs-ws"),p=i(e("bytebuffer")),_=e("safe-buffer").Buffer,g={},m=n.env.npm_config__graphene_serializer_hex_dump;g.uint8={fromByteBuffer:function(e){return e.readUint8()},appendByteBuffer:function(e,t){return a["default"].require_range(0,255,t,"uint8 "+t),void e.writeUint8(t)},fromObject:function(e){return a["default"].require_range(0,255,e,"uint8 "+e),e},toObject:function(e,t){return(void 0===t&&(t={}),t.use_default&&void 0===e)?0:(a["default"].require_range(0,255,e,"uint8 "+e),parseInt(e))}},g.uint16={fromByteBuffer:function(e){return e.readUint16()},appendByteBuffer:function(e,t){return a["default"].require_range(0,65535,t,"uint16 "+t),void e.writeUint16(t)},fromObject:function(e){return a["default"].require_range(0,65535,e,"uint16 "+e),e},toObject:function(e,t){return(void 0===t&&(t={}),t.use_default&&void 0===e)?0:(a["default"].require_range(0,65535,e,"uint16 "+e),parseInt(e))}},g.uint32={fromByteBuffer:function(e){return e.readUint32()},appendByteBuffer:function(e,t){return a["default"].require_range(0,4294967295,t,"uint32 "+t),void e.writeUint32(t)},fromObject:function(e){return a["default"].require_range(0,4294967295,e,"uint32 "+e),e},toObject:function(e,t){return(void 0===t&&(t={}),t.use_default&&void 0===e)?0:(a["default"].require_range(0,4294967295,e,"uint32 "+e),parseInt(e))}};var b=-1*u(2,31),h=u(2,31)-1;g.varint32={fromByteBuffer:function(e){return e.readVarint32()},appendByteBuffer:function(e,t){return a["default"].require_range(-2147483648,h,t,"uint32 "+t),void e.writeVarint32(t)},fromObject:function(e){return a["default"].require_range(-2147483648,h,e,"uint32 "+e),e},toObject:function(e,t){return(void 0===t&&(t={}),t.use_default&&void 0===e)?0:(a["default"].require_range(-2147483648,h,e,"uint32 "+e),parseInt(e))}},g.int64={fromByteBuffer:function(e){return e.readInt64()},appendByteBuffer:function(e,t){return a["default"].required(t),void e.writeInt64(a["default"].to_long(t))},fromObject:function(e){return a["default"].required(e),a["default"].to_long(e)},toObject:function(e,t){return(void 0===t&&(t={}),t.use_default&&void 0===e)?"0":(a["default"].required(e),a["default"].to_long(e).toString())}},g.uint64={fromByteBuffer:function(e){return e.readUint64()},appendByteBuffer:function(e,t){e.writeUint64(a["default"].to_long(a["default"].unsigned(t),void 0,!0))},fromObject:function(e){return a["default"].to_long(a["default"].unsigned(e),void 0,!0)},toObject:function(e,t){return void 0===t&&(t={}),t.use_default&&void 0===e?"0":a["default"].to_long(e,void 0,!0).toString()}},g.string={fromByteBuffer:function(e){var t=e.readVarint32(),r;return r=e.copy(e.offset,e.offset+t),e.skip(t),_.from(r.toBinary(),"binary")},appendByteBuffer:function(e,t){return a["default"].required(t),e.writeVarint32(t.length),void e.append(t.toString("binary"),"binary")},fromObject:function(e){return a["default"].required(e),_.from(e)},toObject:function(e,t){return void 0===t&&(t={}),t.use_default&&void 0===e?"":e.toString()}},g.bytes=function(e){return{fromByteBuffer:function(t){if(void 0===e){var r=t.readVarint32(),n;return n=t.copy(t.offset,t.offset+r),t.skip(r),_.from(n.toBinary(),"binary")}return n=t.copy(t.offset,t.offset+e),t.skip(e),_.from(n.toBinary(),"binary")},appendByteBuffer:function(t,r){return a["default"].required(r),"string"==typeof r&&(r=_.from(r,"hex")),void 0===e&&t.writeVarint32(r.length),void t.append(r.toString("binary"),"binary")},fromObject:function(e){return a["default"].required(e),_.isBuffer(e)?e:_.from(e,"hex")},toObject:function(t,r){if(void 0===r&&(r={}),r.use_default&&void 0===t){var n=function(e){return Array(e).join("00")};return n(e)}return a["default"].required(t),t.toString("hex")}}},g.bool={fromByteBuffer:function(e){return 1===e.readUint8()},appendByteBuffer:function(e,t){e.writeUint8(JSON.parse(t)?1:0)},fromObject:function(e){return!!JSON.parse(e)},toObject:function(e,t){return void 0===t&&(t={}),!(t.use_default&&void 0===e)&&!!JSON.parse(e)}},g["void"]={fromByteBuffer:function(){throw new Error("(void) undefined type")},appendByteBuffer:function(){throw new Error("(void) undefined type")},fromObject:function(){throw new Error("(void) undefined type")},toObject:function(e,t){if(void 0===t&&(t={}),!(t.use_default&&void 0===e))throw new Error("(void) undefined type")}},g.array=function(e){return{fromByteBuffer:function(t){var r=t.readVarint32();m&&console.log("varint32 size = "+r.toString(16));for(var n=[],a=0;0<r?a<r:a>r;0<r?a++:a++)n.push(e.fromByteBuffer(t));return B(n,e)},appendByteBuffer:function(t,r){a["default"].required(r),r=B(r,e),t.writeVarint32(r.length);for(var n=0,s;n<r.length;n++)s=r[n],e.appendByteBuffer(t,s)},fromObject:function(t){a["default"].required(t),t=B(t,e);for(var r=[],n=0,s;n<t.length;n++)s=t[n],r.push(e.fromObject(s));return r},toObject:function(t,r){if(void 0===r&&(r={}),r.use_default&&void 0===t)return[e.toObject(t,r)];a["default"].required(t),t=B(t,e);for(var n=[],s=0,f;s<t.length;s++)f=t[s],n.push(e.toObject(f,r));return n}}},g.time_point_sec={fromByteBuffer:function(e){return e.readUint32()},appendByteBuffer:function(e,t){return"number"!=typeof t&&(t=g.time_point_sec.fromObject(t)),void e.writeUint32(t)},fromObject:function(e){if(a["default"].required(e),"number"==typeof e)return e;if(e.getTime)return s(e.getTime()/1e3);if("string"!=typeof e)throw new Error("Unknown date type: "+e);return /T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]$/.test(e)&&(e+="Z"),s(new Date(e).getTime()/1e3)},toObject:function(e,t){if(void 0===t&&(t={}),t.use_default&&void 0===e)return new Date(0).toISOString().split(".")[0];if(a["default"].required(e),"string"==typeof e)return e;if(e.getTime)return e.toISOString().split(".")[0];var r=parseInt(e);return a["default"].require_range(0,4294967295,r,"uint32 "+e),new Date(1e3*r).toISOString().split(".")[0]}},g.set=function(e){return{validate:function(t){for(var r={},n=0,a;n<t.length;n++){a=t[n];var s;if(s=typeof a,0<=["string","number"].indexOf(s)){if(r[a]!==void 0)throw new Error("duplicate (set)");r[a]=!0}}return B(t,e)},fromByteBuffer:function(t){var r=t.readVarint32();return m&&console.log("varint32 size = "+r.toString(16)),this.validate(function(){for(var n=[],a=0;0<r?a<r:a>r;0<r?a++:a++)n.push(e.fromByteBuffer(t));return n}())},appendByteBuffer:function(t,r){r||(r=[]),t.writeVarint32(r.length);for(var n=this.validate(r),a=0,s;a<n.length;a++)s=n[a],e.appendByteBuffer(t,s)},fromObject:function(t){return t||(t=[]),this.validate(function(){for(var r=[],n=0,a;n<t.length;n++)a=t[n],r.push(e.fromObject(a));return r}())},toObject:function(t,r){return(void 0===r&&(r={}),r.use_default&&void 0===t)?[e.toObject(t,r)]:(t||(t=[]),this.validate(function(){for(var n=[],a=0,s;a<t.length;a++)s=t[a],n.push(e.toObject(s,r));return n}()))}}},g.fixed_array=function(e,t){return{fromByteBuffer:function(r){var n,a,o,s;for(s=[],n=a=0,o=e;a<o;n=a+=1)s.push(t.fromByteBuffer(r));return B(s,t)},appendByteBuffer:function(r,n){var o,s,f;for(0!==e&&(a["default"].required(n),n=B(n,t)),o=s=0,f=e;s<f;o=s+=1)t.appendByteBuffer(r,n[o])},fromObject:function(r){var n,o,s,f;for(0!==e&&a["default"].required(r),f=[],(n=o=0,s=e);o<s;n=o+=1)f.push(t.fromObject(r[n]));return f},toObject:function(r,n){var o,s,f,l,d,u,c;if(null==n&&(n={}),n.use_default&&void 0===r){for(u=[],o=s=0,l=e;s<l;o=s+=1)u.push(t.toObject(void 0,n));return u}for(0!==e&&a["default"].required(r),c=[],(o=f=0,d=e);f<d;o=f+=1)c.push(t.toObject(r[o],n));return c}}};var y=function(e,t){return a["default"].required(e,"reserved_spaces"),a["default"].required(t,"object_type"),{fromByteBuffer:function(e){return e.readVarint32()},appendByteBuffer:function(r,n){return a["default"].required(n),void 0!==n.resolve&&(n=n.resolve),/^[0-9]+\.[0-9]+\.[0-9]+$/.test(n)&&(n=a["default"].get_instance(e,t,n)),void r.writeVarint32(a["default"].to_number(n))},fromObject:function(r){return a["default"].required(r),void 0!==r.resolve&&(r=r.resolve),a["default"].is_digits(r)?a["default"].to_number(r):a["default"].get_instance(e,t,r)},toObject:function(r,n){void 0===n&&(n={});var i=f["default"].object_type[t];return n.use_default&&void 0===r?e+"."+i+".0":(a["default"].required(r),void 0!==r.resolve&&(r=r.resolve),/^[0-9]+\.[0-9]+\.[0-9]+$/.test(r)&&(r=a["default"].get_instance(e,t,r)),e+"."+i+"."+r)}}};g.protocol_id_type=function(e){return a["default"].required(e,"name"),y(f["default"].reserved_spaces.protocol_ids,e)},g.object_id_type={fromByteBuffer:function(e){return l["default"].fromByteBuffer(e)},appendByteBuffer:function(e,t){return a["default"].required(t),void 0!==t.resolve&&(t=t.resolve),t=l["default"].fromString(t),void t.appendByteBuffer(e)},fromObject:function(e){return a["default"].required(e),void 0!==e.resolve&&(e=e.resolve),l["default"].fromString(e)},toObject:function(e,t){return(void 0===t&&(t={}),t.use_default&&void 0===e)?"0.0.0":(a["default"].required(e),void 0!==e.resolve&&(e=e.resolve),e=l["default"].fromString(e),e.toString())}},g.vote_id={TYPE:255,ID:4294967040,fromByteBuffer:function(e){var t=e.readUint32();return{type:t&this.TYPE,id:t&this.ID}},appendByteBuffer:function(e,t){a["default"].required(t),"string"===t&&(t=g.vote_id.fromObject(t));var r=t.id<<8|t.type;e.writeUint32(r)},fromObject:function(e){if(a["default"].required(e,"(type vote_id)"),"object"==typeof e)return a["default"].required(e.type,"type"),a["default"].required(e.id,"id"),e;a["default"].require_test(/^[0-9]+:[0-9]+$/,e,"vote_id format "+e);var t=e.split(":"),r=t[0],n=t[1];return a["default"].require_range(0,255,r,"vote type "+e),a["default"].require_range(0,16777215,n,"vote id "+e),{type:r,id:n}},toObject:function(e,t){return(void 0===t&&(t={}),t.use_default&&void 0===e)?"0:0":(a["default"].required(e),"string"==typeof e&&(e=g.vote_id.fromObject(e)),e.type+":"+e.id)},compare:function(e,t){return"object"!=typeof e&&(e=g.vote_id.fromObject(e)),"object"!=typeof t&&(t=g.vote_id.fromObject(t)),parseInt(e.id)-parseInt(t.id)}},g.optional=function(e){return a["default"].required(e,"st_operation"),{fromByteBuffer:function(t){return 1===t.readUint8()?e.fromByteBuffer(t):void 0},appendByteBuffer:function(t,r){null!==r&&void 0!==r?(t.writeUint8(1),e.appendByteBuffer(t,r)):t.writeUint8(0)},fromObject:function(t){return void 0===t?void 0:e.fromObject(t)},toObject:function(t,r){void 0===r&&(r={});var n=function(){return r.use_default||void 0!==t?e.toObject(t,r):void 0}();return r.annotate&&("object"==typeof n?n.__optional="parent is optional":n={__optional:n}),n}}},g.extension=function(e){return a["default"].require_array(e,function(e){a["default"].string(e.name),a["default"].required(e.type,"st_operation")}),{fromByteBuffer:function(t){var r=t.readVarint32();if(0!==r){var n={};if(r>e.length)throw new Error("two many fields");for(;0<r;){var i=t.readVarint32();if(i>=e.length)throw new Error("index out of range");var a=e[i];n[a.name]=a.type.fromByteBuffer(t),r--}return n}},appendByteBuffer:function(t,r){var n=new p["default"](p["default"].DEFAULT_CAPACITY,p["default"].LITTLE_ENDIAN),a=0;return r&&e.forEach(function(e,t){void 0!==r[e.name]&&null!==r[e.name]&&(n.writeVarint32(t),e.type.appendByteBuffer(n,r[e.name]),a++)}),t.writeVarint32(a),n.flip(),void t.append(n)},fromObject:function(t){if(void 0!==t){var r={};return e.forEach(function(e){void 0!==t[e.name]&&null!==t[e.name]&&(r[e.name]=e.type.fromObject(t[e.name]))}),r}},toObject:function(t,r){void 0===r&&(r={});var n=function(){if(void 0!==t){var n={};return e.forEach(function(e){void 0!==t[e.name]&&null!==t[e.name]&&(n[e.name]=e.type.toObject(t[e.name],r))}),n}}();return r.annotate&&("object"==typeof n?n.__optional="parent is optional":n={__optional:n}),n}}},g.static_variant=function(e){return{nosort:!0,st_operations:e,fromByteBuffer:function(e){var t=e.readVarint32(),r=this.st_operations[t];return m&&console.error("static_variant id 0x"+t.toString(16)+" ("+t+")"),a["default"].required(r,"operation "+t),[t,r.fromByteBuffer(e)]},appendByteBuffer:function(e,t){a["default"].required(t);var r=t[0],n=this.st_operations[r];return a["default"].required(n,"operation "+r),e.writeVarint32(r),void n.appendByteBuffer(e,t[1])},fromObject:function(e){a["default"].required(e);var t=e[0],r=this.st_operations[t];return a["default"].required(r,"operation "+t),[t,r.fromObject(e[1])]},toObject:function(e,t){if(void 0===t&&(t={}),t.use_default&&void 0===e)return[0,this.st_operations[0].toObject(void 0,t)];a["default"].required(e);var r=e[0],n=this.st_operations[r];return a["default"].required(n,"operation "+r),[r,n.toObject(e[1],t)]}}},g.map=function(e,t){return{validate:function(t){if(!Array.isArray(t))throw new Error("expecting array");for(var r={},n=0,a;n<t.length;n++){a=t[n];var s;if(2!==a.length)throw new Error("expecting two elements");if(s=typeof a[0],0<=["number","string"].indexOf(s)){if(void 0!==r[a[0]])throw new Error("duplicate (map)");r[a[0]]=!0}}return B(t,e)},fromByteBuffer:function(r){for(var n=[],a=r.readVarint32(),o=0;0<a?o<a:o>a;0<a?o++:o++)n.push([e.fromByteBuffer(r),t.fromByteBuffer(r)]);return this.validate(n)},appendByteBuffer:function(r,n){this.validate(n),r.writeVarint32(n.length);for(var a=0,s;a<n.length;a++)s=n[a],e.appendByteBuffer(r,s[0]),t.appendByteBuffer(r,s[1])},fromObject:function(r){a["default"].required(r);for(var n=[],s=0,f;s<r.length;s++)f=r[s],n.push([e.fromObject(f[0]),t.fromObject(f[1])]);return this.validate(n)},toObject:function(r,n){if(void 0===n&&(n={}),n.use_default&&void 0===r)return[[e.toObject(void 0,n),t.toObject(void 0,n)]];a["default"].required(r),r=this.validate(r);for(var s=[],f=0,l;f<r.length;f++)l=r[f],s.push([e.toObject(l[0],n),t.toObject(l[1],n)]);return s}}},g.public_key={toPublic:function(e){return void 0!==e.resolve&&(e=e.resolve),null==e?e:e.Q?e:d.PublicKey.fromStringOrThrow(e)},fromByteBuffer:function(e){return o["default"].public_key(e)},appendByteBuffer:function(e,t){return a["default"].required(t),void o["default"].public_key(e,g.public_key.toPublic(t))},fromObject:function(e){return a["default"].required(e),e.Q?e:g.public_key.toPublic(e)},toObject:function(e,t){return(void 0===t&&(t={}),t.use_default&&void 0===e)?c.ChainConfig.address_prefix+"859gxfnXyUriMgUeThh1fWv3oqcpLFyHa3TfFYC4PK2HqhToVM":(a["default"].required(e),e.toString())},compare:function(e,t){return g.public_key.fromObject(e).toBlockchainAddress().compare(g.public_key.fromObject(t).toBlockchainAddress())}},g.address={_to_address:function(e){return a["default"].required(e),e.addy?e:d.Address.fromString(e)},fromByteBuffer:function(e){return new d.Address(o["default"].ripemd160(e))},appendByteBuffer:function(e,t){o["default"].ripemd160(e,g.address._to_address(t).toBuffer())},fromObject:function(e){return g.address._to_address(e)},toObject:function(e,t){return void 0===t&&(t={}),t.use_default&&void 0===e?c.ChainConfig.address_prefix+"664KmHxSuQyDsfwo4WEJvWpzg1QKdg67S":g.address._to_address(e).toString()},compare:function(e,t){return w(e.toString(),t.toString())}};var w=function(e,t){return e>t?1:e<t?-1:0},v=function(e){return Array.isArray(e)?e[0]:e},B=function(e,t){return t.nosort?e:t.compare?e.sort(function(e,r){return t.compare(v(e),v(r))}):e.sort(function(e,t){return"number"==typeof v(e)&&"number"==typeof v(t)?v(e)-v(t):_.isBuffer(v(e))&&_.isBuffer(v(t))?w(v(e).toString("hex"),v(t).toString("hex")):w(v(e).toString(),v(t).toString())})};r["default"]=g,t.exports=r.default}).call(this,e("_process"))},{"../../chain/src/ChainTypes":3,"../../chain/src/ObjectId":4,"../../ecc":7,"./FastParser":20,"./SerializerValidation":21,_process:82,"bitsharesjs-ws":38,bytebuffer:46,"safe-buffer":97}],27:[function(e,t){var r=e("safe-buffer").Buffer;t.exports=function(e){function t(e){if(0===e.length)return r.allocUnsafe(0);for(var t=[0],s=0,f;s<e.length;s++){if(f=n[e[s]],void 0===f)return;for(var l=0,d=f;l<t.length;++l)d+=t[l]*a,t[l]=255&d,d>>=8;for(;0<d;)t.push(255&d),d>>=8}for(var u=0;e[u]===o&&u<e.length-1;++u)t.push(0);return r.from(t.reverse())}for(var n={},a=e.length,o=e.charAt(0),s=0,i;s<e.length;s++){if(i=e.charAt(s),void 0!==n[i])throw new TypeError(i+" is ambiguous");n[i]=s}return{encode:function(t){if(0===t.length)return"";for(var r=[0],n=0;n<t.length;++n){for(var o=0,s=t[n];o<r.length;++o)s+=r[o]<<8,r[o]=s%a,s=0|s/a;for(;0<s;)r.push(s%a),s=0|s/a}for(var f="",l=0;0===t[l]&&l<t.length-1;++l)f+=e[0];for(var d=r.length-1;0<=d;--d)f+=e[r[d]];return f},decodeUnsafe:t,decode:function(e){var r=t(e);if(r)return r;throw new Error("Non-base"+a+" character")}}}},{"safe-buffer":97}],28:[function(e,t,r){'use strict';function n(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function a(e,t,r){return 3*(t+r)/4-r}function o(e){for(var t=n(e),r=t[0],o=t[1],s=new c(a(e,r,o)),f=0,l=0<o?r-4:r,d=0,p;d<l;d+=4)p=u[e.charCodeAt(d)]<<18|u[e.charCodeAt(d+1)]<<12|u[e.charCodeAt(d+2)]<<6|u[e.charCodeAt(d+3)],s[f++]=255&p>>16,s[f++]=255&p>>8,s[f++]=255&p;return 2===o&&(p=u[e.charCodeAt(d)]<<2|u[e.charCodeAt(d+1)]>>4,s[f++]=255&p),1===o&&(p=u[e.charCodeAt(d)]<<10|u[e.charCodeAt(d+1)]<<4|u[e.charCodeAt(d+2)]>>2,s[f++]=255&p>>8,s[f++]=255&p),s}function s(e){return d[63&e>>18]+d[63&e>>12]+d[63&e>>6]+d[63&e]}function f(e,t,r){for(var n=[],a=t,o;a<r;a+=3)o=(16711680&e[a]<<16)+(65280&e[a+1]<<8)+(255&e[a+2]),n.push(s(o));return n.join("")}function l(e){for(var t=e.length,r=t%3,n=[],a=16383,o=0,s=t-r,l;o<s;o+=a)n.push(f(e,o,o+a>s?s:o+a));return 1===r?(l=e[t-1],n.push(d[l>>2]+d[63&l<<4]+"==")):2===r&&(l=(e[t-2]<<8)+e[t-1],n.push(d[l>>10]+d[63&l>>4]+d[63&l<<2]+"=")),n.join("")}r.byteLength=function(e){var t=n(e),r=t[0],i=t[1];return 3*(r+i)/4-i},r.toByteArray=o,r.fromByteArray=l;for(var d=[],u=[],c="undefined"==typeof Uint8Array?Array:Uint8Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0,g=p.length;_<g;++_)d[_]=p[_],u[p.charCodeAt(_)]=_;u[45]=62,u[95]=63},{}],29:[function(e,t){function f(e,t,r){return this instanceof f?void(null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))):new f(e,t,r)}function c(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function p(e,t){var r=d[e.charCodeAt(t)];return null==r?-1:r}function _(e){var t=new f;return t.fromInt(e),t}function b(e){var n=1,i;return 0!=(i=e>>>16)&&(e=i,n+=16),0!=(i=e>>8)&&(e=i,n+=8),0!=(i=e>>4)&&(e=i,n+=4),0!=(i=e>>2)&&(e=i,n+=2),0!=(i=e>>1)&&(e=i,n+=1),n}function h(e){this.m=e}function y(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 w(e,t){return e&t}function v(e,t){return e|t}function B(e,t){return e^t}function x(e,t){return e&~t}function k(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 S(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function I(){}function T(e){return e}function E(e){this.r2=new f,this.q3=new f,f.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}var L=f.prototype;L.__bigi=e("../package.json").version,f.isBigInteger=function(e,t){return e&&e.__bigi&&(!t||e.__bigi===L.__bigi)};var j;f.prototype.am=function(e,t,r,a,o,f){for(;0<=--f;){var l=t*this[e++]+r[a]+o;o=s(l/67108864),r[a++]=67108863&l}return o},j=26,f.prototype.DB=j,f.prototype.DM=(1<<j)-1;var A=f.prototype.DV=1<<j,r=52;f.prototype.FV=u(2,r),f.prototype.F1=r-j,f.prototype.F2=2*j-r;var d=[],g,i;for(g=48,i=0;9>=i;++i)d[g++]=i;for(g=97,i=10;36>i;++i)d[g++]=i;for(g=65,i=10;36>i;++i)d[g++]=i;h.prototype.convert=function(e){return 0>e.s||0<=e.compareTo(this.m)?e.mod(this.m):e},h.prototype.revert=function(e){return e},h.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},h.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},h.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.convert=function(e){var t=new f;return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),0>e.s&&0<t.compareTo(f.ZERO)&&this.m.subTo(t,t),t},y.prototype.revert=function(e){var t=new f;return e.copyTo(t),this.reduce(t),t},y.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},y.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},L.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},L.fromInt=function(e){this.t=1,this.s=0>e?-1:0,0<e?this[0]=e:-1>e?this[0]=e+A:this.t=0},L.fromString=function(e,t){var r=this,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)n=2;else return void r.fromRadix(e,t);r.t=0,r.s=0;for(var a=e.length,o=!1,s=0;0<=--a;){var l=8==n?255&e[a]:p(e,a);if(0>l){"-"==e.charAt(a)&&(o=!0);continue}o=!1,0==s?r[r.t++]=l:s+n>r.DB?(r[r.t-1]|=(l&(1<<r.DB-s)-1)<<s,r[r.t++]=l>>r.DB-s):r[r.t-1]|=l<<s,s+=n,s>=r.DB&&(s-=r.DB)}8==n&&0!=(128&e[0])&&(r.s=-1,0<s&&(r[r.t-1]|=(1<<r.DB-s)-1<<s)),r.clamp(),o&&f.ZERO.subTo(r,r)},L.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},L.dlShiftTo=function(e,t){var r;for(r=this.t-1;0<=r;--r)t[r+e]=this[r];for(r=e-1;0<=r;--r)t[r]=0;t.t=this.t+e,t.s=this.s},L.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=l(this.t-e,0),t.s=this.s},L.lShiftTo=function(e,t){var r=this,n=e%r.DB,a=r.DB-n,o=s(e/r.DB),f=r.s<<n&r.DM,l;for(l=r.t-1;0<=l;--l)t[l+o+1]=r[l]>>a|f,f=(r[l]&(1<<a)-1)<<n;for(l=o-1;0<=l;--l)t[l]=0;t[o]=f,t.t=r.t+o+1,t.s=r.s,t.clamp()},L.rShiftTo=function(e,t){var r=this;t.s=r.s;var n=s(e/r.DB);if(n>=r.t)return void(t.t=0);var a=e%r.DB,o=r.DB-a,f=(1<<a)-1;t[0]=r[n]>>a;for(var l=n+1;l<r.t;++l)t[l-n-1]|=(r[l]&f)<<o,t[l-n]=r[l]>>a;0<a&&(t[r.t-n-1]|=(r.s&f)<<o),t.t=r.t-n,t.clamp()},L.subTo=function(e,t){for(var r=this,n=0,a=0,s=o(e.t,r.t);n<s;)a+=r[n]-e[n],t[n++]=a&r.DM,a>>=r.DB;if(e.t<r.t){for(a-=e.s;n<r.t;)a+=r[n],t[n++]=a&r.DM,a>>=r.DB;a+=r.s}else{for(a+=r.s;n<e.t;)a-=e[n],t[n++]=a&r.DM,a>>=r.DB;a-=e.s}t.s=0>a?-1:0,-1>a?t[n++]=r.DV+a:0<a&&(t[n++]=a),t.t=n,t.clamp()},L.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),a=r.t;for(t.t=a+n.t;0<=--a;)t[a]=0;for(a=0;a<n.t;++a)t[a+r.t]=r.am(0,n[a],t,a,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&f.ZERO.subTo(t,t)},L.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;0<=--r;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0<e.t&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},L.divRemTo=function(n,a,o){var l=this,d=n.abs();if(!(0>=d.t)){var u=l.abs();if(u.t<d.t)return null!=a&&a.fromInt(0),void(null!=o&&l.copyTo(o));null==o&&(o=new f);var c=new f,p=l.s,_=n.s,g=l.DB-b(d[d.t-1]);0<g?(d.lShiftTo(g,c),u.lShiftTo(g,o)):(d.copyTo(c),u.copyTo(o));var m=c.t,h=c[m-1];if(0!=h){var y=h*(1<<l.F1)+(1<m?c[m-2]>>l.F2:0),w=l.FV/y,v=(1<<l.F1)/y,B=1<<l.F2,e=o.t,x=e-m,k=null==a?new f:a;for(c.dlShiftTo(x,k),0<=o.compareTo(k)&&(o[o.t++]=1,o.subTo(k,o)),f.ONE.dlShiftTo(m,k),k.subTo(c,c);c.t<m;)c[c.t++]=0;for(;0<=--x;){var t=o[--e]==h?l.DM:s(o[e]*w+(o[e-1]+B)*v);if((o[e]+=c.am(0,t,o,x,0,m))<t)for(c.dlShiftTo(x,k),o.subTo(k,o);o[e]<--t;)o.subTo(k,o)}null!=a&&(o.drShiftTo(m,a),p!=_&&f.ZERO.subTo(a,a)),o.t=m,o.clamp(),0<g&&o.rShiftTo(g,o),0>p&&f.ZERO.subTo(o,o)}}},L.invDigit=function(){if(1>this.t)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,0<t?this.DV-t:-t},L.isEven=function(){return 0==(0<this.t?1&this[0]:this.s)},L.exp=function(n,e){if(4294967295<n||1>n)return f.ONE;var a=new f,o=new f,s=e.convert(this),l=b(n)-1;for(s.copyTo(a);0<=--l;)if(e.sqrTo(a,o),0<(n&1<<l))e.mulTo(o,s,a);else{var d=a;a=o,o=d}return e.revert(a)},L.toString=function(e){var t=this;if(0>t.s)return"-"+t.negate().toString(e);var n;if(16==e)n=4;else if(8==e)n=3;else if(2==e)n=1;else if(32==e)n=5;else if(4==e)n=2;else return t.toRadix(e);var a=(1<<n)-1,o=!1,s="",f=t.t,l=t.DB-f*t.DB%n,u;if(0<f--)for(l<t.DB&&0<(u=t[f]>>l)&&(o=!0,s=c(u));0<=f;)l<n?(u=(t[f]&(1<<l)-1)<<n-l,u|=t[--f]>>(l+=t.DB-n)):(u=t[f]>>(l-=n)&a,0>=l&&(l+=t.DB,--f)),0<u&&(o=!0),o&&(s+=c(u));return o?s:"0"},L.negate=function(){var e=new f;return f.ZERO.subTo(this,e),e},L.abs=function(){return 0>this.s?this.negate():this},L.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(t=n-e.t,0!=t)return 0>this.s?-t:t;for(;0<=--n;)if(0!=(t=this[n]-e[n]))return t;return 0},L.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+b(this[this.t-1]^this.s&this.DM)},L.byteLength=function(){return this.bitLength()>>3},L.mod=function(e){var t=new f;return this.abs().divRemTo(e,null,t),0>this.s&&0<t.compareTo(f.ZERO)&&e.subTo(t,t),t},L.modPowInt=function(t,e){var r;return r=256>t||e.isEven()?new h(e):new y(e),this.exp(t,r)},I.prototype.convert=T,I.prototype.revert=T,I.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},I.prototype.sqrTo=function(e,t){e.squareTo(t)},E.prototype.convert=function(e){if(0>e.s||e.t>2*this.m.t)return e.mod(this.m);if(0>e.compareTo(this.m))return e;var t=new f;return e.copyTo(t),this.reduce(t),t},E.prototype.revert=function(e){return e},E.prototype.reduce=function(e){var t=this;for(e.drShiftTo(t.m.t-1,t.r2),e.t>t.m.t+1&&(e.t=t.m.t+1,e.clamp()),t.mu.multiplyUpperTo(t.r2,t.m.t+1,t.q3),t.m.multiplyLowerTo(t.q3,t.m.t+1,t.r2);0>e.compareTo(t.r2);)e.dAddOffset(1,t.m.t+1);for(e.subTo(t.r2,e);0<=e.compareTo(t.m);)e.subTo(t.m,e)},E.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},E.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var O=[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],C=67108864/O[O.length-1];L.chunkSize=function(e){return s(a*this.DB/n(e))},L.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||2>e||36<e)return"0";var t=this.chunkSize(e),n=u(e,t),i=_(n),a=new f,o=new f,s="";for(this.divRemTo(i,a,o);0<a.signum();)s=(n+o.intValue()).toString(e).substr(1)+s,a.divRemTo(i,a,o);return o.intValue().toString(e)+s},L.fromRadix=function(e,t){var r=this;r.fromInt(0),null==t&&(t=10);for(var n=r.chunkSize(t),a=u(t,n),o=!1,s=0,l=0,d=0,c;d<e.length;++d){if(c=p(e,d),0>c){"-"==e.charAt(d)&&0==r.signum()&&(o=!0);continue}l=t*l+c,++s>=n&&(r.dMultiply(a),r.dAddOffset(l,0),s=0,l=0)}0<s&&(r.dMultiply(u(t,s)),r.dAddOffset(l,0)),o&&f.ZERO.subTo(r,r)},L.fromNumber=function(e,r,n){var i=this;if(!("number"==typeof r)){var a=[],o=7&e;a.length=(e>>3)+1,r.nextBytes(a),0<o?a[0]&=(1<<o)-1:a[0]=0,i.fromString(a,256)}else if(2>e)i.fromInt(1);else for(i.fromNumber(e,n),i.testBit(e-1)||i.bitwiseTo(f.ONE.shiftLeft(e-1),v,i),i.isEven()&&i.dAddOffset(1,0);!i.isProbablePrime(r);)i.dAddOffset(2,0),i.bitLength()>e&&i.subTo(f.ONE.shiftLeft(e-1),i)},L.bitwiseTo=function(e,t,n){var r=this,a=o(e.t,r.t),s,l;for(s=0;s<a;++s)n[s]=t(r[s],e[s]);if(e.t<r.t){for(l=e.s&r.DM,s=a;s<r.t;++s)n[s]=t(r[s],l);n.t=r.t}else{for(l=r.s&r.DM,s=a;s<e.t;++s)n[s]=t(l,e[s]);n.t=e.t}n.s=t(r.s,e.s),n.clamp()},L.changeBit=function(e,t){var n=f.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n},L.addTo=function(e,t){for(var r=this,n=0,a=0,s=o(e.t,r.t);n<s;)a+=r[n]+e[n],t[n++]=a&r.DM,a>>=r.DB;if(e.t<r.t){for(a+=e.s;n<r.t;)a+=r[n],t[n++]=a&r.DM,a>>=r.DB;a+=r.s}else{for(a+=r.s;n<e.t;)a+=e[n],t[n++]=a&r.DM,a>>=r.DB;a+=e.s}t.s=0>a?-1:0,0<a?t[n++]=a:-1>a&&(t[n++]=r.DV+a),t.t=n,t.clamp()},L.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},L.dAddOffset=function(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]}},L.multiplyLowerTo=function(e,t,n){var r=o(this.t+e.t,t);for(n.s=0,n.t=r;0<r;)n[--r]=0;var a;for(a=n.t-this.t;r<a;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(a=o(e.t,t);r<a;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},L.multiplyUpperTo=function(e,t,a){--t;var r=a.t=this.t+e.t-t;for(a.s=0;0<=--r;)a[r]=0;for(r=l(t-this.t,0);r<e.t;++r)a[this.t+r-t]=this.am(t-r,e[r],a,0,0,this.t+r-t);a.clamp(),a.drShiftTo(1,a)},L.modInt=function(e){if(0>=e)return 0;var t=this.DV%e,n=0>this.s?e-1:0;if(0<this.t)if(0==t)n=this[0]%e;else for(var a=this.t-1;0<=a;--a)n=(t*n+this[a])%e;return n},L.millerRabin=function(e){var n=this.subtract(f.ONE),o=n.getLowestSetBit();if(0>=o)return!1;var l=n.shiftRight(o);e=e+1>>1,e>O.length&&(e=O.length);for(var r=new f(null),a=[],d=0,u;d<e;++d){for(;;)if(u=O[s(Math.random()*O.length)],-1==a.indexOf(u))break;a.push(u),r.fromInt(u);var c=r.modPow(l,this);if(0!=c.compareTo(f.ONE)&&0!=c.compareTo(n)){for(var u=1;u++<o&&0!=c.compareTo(n);)if(c=c.modPowInt(2,this),0==c.compareTo(f.ONE))return!1;if(0!=c.compareTo(n))return!1}}return!0},L.clone=function(){var e=new f;return this.copyTo(e),e},L.intValue=function(){if(0>this.s){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]},L.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},L.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},L.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this[0]?0:1},L.toByteArray=function(){var e=this,t=e.t,n=[];n[0]=e.s;var r=e.DB-t*e.DB%8,a=0,o;if(0<t--)for(r<e.DB&&(o=e[t]>>r)!=(e.s&e.DM)>>r&&(n[a++]=o|e.s<<e.DB-r);0<=t;)8>r?(o=(e[t]&(1<<r)-1)<<8-r,o|=e[--t]>>(r+=e.DB-8)):(o=255&e[t]>>(r-=8),0>=r&&(r+=e.DB,--t)),0!=(128&o)&&(o|=-256),0==a&&(128&e.s)!=(128&o)&&++a,(0<a||o!=e.s)&&(n[a++]=o);return n},L.equals=function(e){return 0==this.compareTo(e)},L.min=function(e){return 0>this.compareTo(e)?this:e},L.max=function(e){return 0<this.compareTo(e)?this:e},L.and=function(e){var t=new f;return this.bitwiseTo(e,w,t),t},L.or=function(e){var t=new f;return this.bitwiseTo(e,v,t),t},L.xor=function(e){var t=new f;return this.bitwiseTo(e,B,t),t},L.andNot=function(e){var t=new f;return this.bitwiseTo(e,x,t),t},L.not=function(){for(var e=new f,t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},L.shiftLeft=function(e){var t=new f;return 0>e?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},L.shiftRight=function(e){var t=new f;return 0>e?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},L.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+k(this[e]);return 0>this.s?this.t*this.DB:-1},L.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=S(this[n]^t);return e},L.testBit=function(e){var t=s(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},L.setBit=function(e){return this.changeBit(e,v)},L.clearBit=function(e){return this.changeBit(e,x)},L.flipBit=function(e){return this.changeBit(e,B)},L.add=function(e){var t=new f;return this.addTo(e,t),t},L.subtract=function(e){var t=new f;return this.subTo(e,t),t},L.multiply=function(e){var t=new f;return this.multiplyTo(e,t),t},L.divide=function(e){var t=new f;return this.divRemTo(e,t,null),t},L.remainder=function(e){var t=new f;return this.divRemTo(e,null,t),t},L.divideAndRemainder=function(e){var t=new f,n=new f;return this.divRemTo(e,t,n),[t,n]},L.modPow=function(a,e){var o=a.bitLength(),s=_(1),l,d;if(0>=o)return s;l=18>o?1:48>o?3:144>o?4:768>o?5:6,d=8>o?new h(e):e.isEven()?new E(e):new y(e);var u=[],c=3,p=l-1,g=(1<<l)-1;if(u[1]=d.convert(this),1<l){var m=new f;for(d.sqrTo(u[1],m);c<=g;)u[c]=new f,d.mulTo(m,u[c-2],u[c]),c+=2}var v=a.t-1,B=!0,x=new f,S,I;for(o=b(a[v])-1;0<=v;){for(o>=p?S=a[v]>>o-p&g:(S=(a[v]&(1<<o+1)-1)<<p-o,0<v&&(S|=a[v-1]>>this.DB+o-p)),c=l;0==(1&S);)S>>=1,--c;if(0>(o-=c)&&(o+=this.DB,--v),B)u[S].copyTo(s),B=!1;else{for(;1<c;)d.sqrTo(s,x),d.sqrTo(x,s),c-=2;0<c?d.sqrTo(s,x):(I=s,s=x,x=I),d.mulTo(x,u[S],s)}for(;0<=v&&0==(a[v]&1<<o);)d.sqrTo(s,x),I=s,s=x,x=I,0>--o&&(o=this.DB-1,--v)}return d.revert(s)},L.modInverse=function(e){var t=e.isEven();if(0===this.signum())throw new Error("division by zero");if(this.isEven()&&t||0==e.signum())return f.ZERO;for(var r=e.clone(),n=this.clone(),i=_(1),a=_(0),o=_(0),s=_(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):!a.isEven()&&a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):!s.isEven()&&s.subTo(e,s),s.rShiftTo(1,s);0<=r.compareTo(n)?(r.subTo(n,r),t&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),t&&o.subTo(i,o),s.subTo(a,s))}if(0!=n.compareTo(f.ONE))return f.ZERO;for(;0<=s.compareTo(e);)s.subTo(e,s);for(;0>s.signum();)s.addTo(e,s);return s},L.pow=function(t){return this.exp(t,new I)},L.gcd=function(e){var r=0>this.s?this.negate():this.clone(),n=0>e.s?e.negate():e.clone();if(0>r.compareTo(n)){var a=r;r=n,n=a}var t=r.getLowestSetBit(),o=n.getLowestSetBit();if(0>o)return r;for(t<o&&(o=t),0<o&&(r.rShiftTo(o,r),n.rShiftTo(o,n));0<r.signum();)0<(t=r.getLowestSetBit())&&r.rShiftTo(t,r),0<(t=n.getLowestSetBit())&&n.rShiftTo(t,n),0<=r.compareTo(n)?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n));return 0<o&&n.lShiftTo(o,n),n},L.isProbablePrime=function(e){var t=this.abs(),r;if(1==t.t&&t[0]<=O[O.length-1]){for(r=0;r<O.length;++r)if(t[0]==O[r])return!0;return!1}if(t.isEven())return!1;for(r=1;r<O.length;){for(var n=O[r],a=r+1;a<O.length&&n<C;)n*=O[a++];for(n=t.modInt(n);r<a;)if(0==n%O[r++])return!1}return t.millerRabin(e)},L.square=function(){var e=new f;return this.squareTo(e),e},f.ZERO=_(0),f.ONE=_(1),f.valueOf=_,t.exports=f},{"../package.json":32}],30:[function(e){(function(t){var r=e("assert"),n=e("./bigi");n.fromByteArrayUnsigned=function(e){return 128&e[0]?new n([0].concat(e)):new n(e)},n.prototype.toByteArrayUnsigned=function(){var e=this.toByteArray();return 0===e[0]?e.slice(1):e},n.fromDERInteger=function(e){return new n(e)},n.prototype.toDERInteger=n.prototype.toByteArray,n.fromBuffer=function(e){if(128&e[0]){var t=Array.prototype.slice.call(e);return new n([0].concat(t))}return new n(e)},n.fromHex=function(e){return""===e?n.ZERO:(r.equal(e,e.match(/^[A-Fa-f0-9]+/),"Invalid hex string"),r.equal(e.length%2,0,"Incomplete hex"),new n(e,16))},n.prototype.toBuffer=function(e){for(var r=this.toByteArrayUnsigned(),n=[],i=e-r.length;n.length<i;)n.push(0);return new t(n.concat(r))},n.prototype.toHex=function(e){return this.toBuffer(e).toString("hex")}}).call(this,e("buffer").Buffer)},{"./bigi":29,assert:40,buffer:45}],31:[function(e,t){var r=e("./bigi");e("./convert"),t.exports=r},{"./bigi":29,"./convert":30}],32:[function(e,t){t.exports={_args:[["[email protected]","/home/schiessl/Projekte/BitShares/bitsharesjs"]],_from:"[email protected]",_id:"[email protected]",_inBundle:!1,_integrity:"sha1-nGZalfiLiwj8Bc/XMfVhhZ1yWCU=",_location:"/bigi",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"[email protected]",name:"bigi",escapedName:"bigi",rawSpec:"1.4.2",saveSpec:null,fetchSpec:"1.4.2"},_requiredBy:["/","/ecurve"],_resolved:"https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",_spec:"1.4.2",_where:"/home/schiessl/Projekte/BitShares/bitsharesjs",bugs:{url:"https://github.com/cryptocoinjs/bigi/issues"},dependencies:{},description:"Big integers.",devDependencies:{coveralls:"^2.11.2",istanbul:"^0.3.5",jshint:"^2.5.1",mocha:"^2.1.0",mochify:"^2.1.0"},homepage:"https://github.com/cryptocoinjs/bigi#readme",keywords:["cryptography","math","bitcoin","arbitrary","precision","arithmetic","big","integer","int","number","biginteger","bigint","bignumber","decimal","float"],main:"./lib/index.js",name:"bigi",repository:{url:"git+https://github.com/cryptocoinjs/bigi.git",type:"git"},scripts:{"browser-test":"mochify --wd -R spec",coverage:"istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",coveralls:"npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info",jshint:"jshint --config jshint.json lib/*.js ; true",test:"_mocha -- test/*.js",unit:"mocha"},testling:{files:"test/*.js",harness:"mocha",browsers:["ie/9..latest","firefox/latest","chrome/latest","safari/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},version:"1.4.2"}},{}],33:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.orders=r.crypto=r.history=r.network=r.db=r.close=r.chainId=r.instance=r.reset=r.setAutoReconnect=r.setRpcConnectionStatusCallback=void 0;var i=n(e("./ChainWebSocket")),o=n(e("./GrapheneApi")),s=n(e("./ChainConfig")),f=!1,l=null,u=null;const c=e=>{u=e,l&&l.setRpcConnectionStatusCallback(e)};r.setRpcConnectionStatusCallback=c;r.setAutoReconnect=e=>{f=e};r.reset=(t="ws://localhost:8090",r,n=4e3,i,a)=>_().then(()=>(l=y(),l.setRpcConnectionStatusCallback(u),l&&r&&l.connect(t,n,i,a),l));const p=(t="ws://localhost:8090",r,n=4e3,i,a)=>(l||(l=y(),l.setRpcConnectionStatusCallback(u)),l&&r&&l.connect(t,n,i),a&&(l.closeCb=a),l);r.instance=p;r.chainId=()=>p().chain_id;const _=async()=>{l&&(await l.close(),l=null)};r.close=_;const g=e=>new Proxy([],{get:(t,r)=>(...t)=>l[e].exec(r,[...t])}),m=g("_db");r.db=m;const a=g("_net");r.network=a;const d=g("_hist");r.history=d;const b=g("_crypt");r.crypto=b;const h=g("_orders");r.orders=h;const y=()=>({connect:(e,t,r={enableCrypto:!1,enableOrders:!1})=>{if(l.url=e,"undefined"!=typeof window&&window.location&&"https:"===window.location.protocol&&0>e.indexOf("wss://"))throw new Error("Secure domains require wss connection");l.ws_rpc&&(l.ws_rpc.statusCb=null,l.ws_rpc.keepAliveCb=null,l.ws_rpc.on_close=null,l.ws_rpc.on_reconnect=null),l.ws_rpc=new i.default(e,l.statusCb,t,f,e=>{l._db&&!e&&l._db.exec("get_objects",[["2.1.0"]]).catch(()=>{})}),l.init_promise=l.ws_rpc.login("","").then(()=>{l._db=new o.default(l.ws_rpc,"database"),l._net=new o.default(l.ws_rpc,"network_broadcast"),l._hist=new o.default(l.ws_rpc,"history"),r.enableOrders&&(l._orders=new o.default(l.ws_rpc,"orders")),r.enableCrypto&&(l._crypt=new o.default(l.ws_rpc,"crypto"));var e=l._db.init().then(()=>l._db.exec("get_chain_id",[]).then(e=>(l.chain_id=e,s.default.setChainId(e))));l.ws_rpc.on_reconnect=()=>{l.ws_rpc&&l.ws_rpc.login("","").then(()=>{l._db.init().then(()=>{l.statusCb&&l.statusCb("reconnect")}),l._net.init(),l._hist.init(),r.enableOrders&&l._orders.init(),r.enableCrypto&&l._crypt.init()})},l.ws_rpc.on_close=()=>{l.close().then(()=>{l.closeCb&&l.closeCb()})};let t=[e,l._net.init(),l._hist.init()];return r.enableOrders&&t.push(l._orders.init()),r.enableCrypto&&t.push(l._crypt.init()),Promise.all(t)}).catch(t=>(console.error(e,"Failed to initialize with error",t&&t.message),l.close().then(()=>{throw t})))},close:async()=>{l.ws_rpc&&1===l.ws_rpc.ws.readyState&&(await l.ws_rpc.close()),l.ws_rpc=null},db_api:()=>l._db,network_api:()=>l._net,history_api:()=>l._hist,crypto_api:()=>l._crypt,orders_api:()=>l._orders,setRpcConnectionStatusCallback:e=>l.statusCb=e})},{"./ChainConfig":34,"./ChainWebSocket":35,"./GrapheneApi":37}],34:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={core_asset:"CORE",address_prefix:"GPH",expire_in_secs:15,expire_in_secs_proposal:86400,review_in_secs_committee:86400,networks:{BitShares:{core_asset:"BTS",address_prefix:"BTS",chain_id:"4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8"},Muse:{core_asset:"MUSE",address_prefix:"MUSE",chain_id:"45ad2d3f9ef92a49b55c2227eb06123f613bb35dd08bd876f2aea21925a67a67"},Test:{core_asset:"TEST",address_prefix:"TEST",chain_id:"39f5e2ede1f8bc1a3a54a7914414e3779e33193f1f5693510e73cb7a87617447"},Obelisk:{core_asset:"GOV",address_prefix:"FEW",chain_id:"1cfde7c388b9e8ac06462d68aadbd966b58f88797637d9af805b4560b0e9661e"}},setChainId:e=>{let t=Object.entries(n.networks).find(([t,r])=>{if(r.chain_id===e)return n.network_name=t,r.address_prefix&&(n.address_prefix=r.address_prefix),!0});return t?{network_name:t[0],network:t[1]}:void console.log("Unknown chain id (this may be a testnet)",e)},reset:()=>{n.core_asset="CORE",n.address_prefix="GPH",n.expire_in_secs=15,n.expire_in_secs_proposal=86400,console.log("Chain config reset")},setPrefix:(e="GPH")=>n.address_prefix=e};r.default=n},{}],35:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(e){return e&&e.__esModule?e:{default:e}}(e("isomorphic-ws"));Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;const o=!1,s=5,f=10;r.default=class{constructor(t,r,a=5e3,l=!0,d=null){n(this,"connect",(e,t)=>new Promise((r,n)=>{this.current_reject=n,this.current_resolve=r;try{this.ws=new i.default(e)}catch(t){this.ws={readyState:3,close:()=>{}},n(new Error("Invalid url",e," closed"))}this.ws.onopen=this.onOpen,this.ws.onerror=this.onError,this.ws.onmessage=this.onMessage,this.ws.onclose=this.onClose,this.connectionTimeout=setTimeout(()=>{this.current_reject&&(this.current_reject=null,this.close(),n(new Error("Connection attempt timed out after "+t/1e3+"s")))},t)})),n(this,"onOpen",()=>{clearTimeout(this.connectionTimeout),this.statusCb&&this.statusCb("open"),this.on_reconnect&&this.on_reconnect(),this.keepalive_timer=setInterval(()=>(this.recv_life--,0==this.recv_life?(console.error(this.url+" connection is dead, terminating ws"),void this.close()):void(this.send_life--,0==this.send_life&&(this.keepAliveCb&&this.keepAliveCb(this.closed),this.send_life=s))),5e3),this.current_reject=null,this.current_resolve()}),n(this,"onError",e=>{this.keepalive_timer&&(clearInterval(this.keepalive_timer),this.keepalive_timer=void 0),clearTimeout(this.connectionTimeout),this.statusCb&&this.statusCb("error"),this.current_reject&&this.current_reject(e)}),n(this,"onMessage",e=>{this.recv_life=f,this.listener(JSON.parse(e.data))}),n(this,"onClose",()=>{this.closed=!0,this.keepalive_timer&&(clearInterval(this.keepalive_timer),this.keepalive_timer=void 0);for(var e=this.responseCbId+1;e<=this.cbId;e+=1)this.cbs[e].reject(new Error("connection closed"));this.statusCb&&this.statusCb("closed"),this._closeCb&&this._closeCb(),this.on_close&&this.on_close()}),n(this,"call",e=>{if(1!==this.ws.readyState)return Promise.reject(new Error("websocket state error:"+this.ws.readyState));let t=e[1];if(o&&console.log("[ChainWebSocket] >---- call -----> \"id\":"+(this.cbId+1),JSON.stringify(e)),this.cbId+=1,["set_subscribe_callback","subscribe_to_market","broadcast_transaction_with_callback","set_pending_transaction_callback","set_block_applied_callback"].includes(t)&&(this.subs[this.cbId]={callback:e[2][0]},e[2][0]=this.cbId),["unsubscribe_from_market","unsubscribe_from_accounts"].includes(t)){if("function"!=typeof e[2][0])throw new Error("First parameter of unsub must be the original callback");let t=e[2].splice(0,1)[0];for(let e in this.subs)if(this.subs[e].callback===t){this.unsub[this.cbId]=e;break}}var r={method:"call",params:e};return r.id=this.cbId,this.send_life=s,new Promise((e,t)=>{this.cbs[this.cbId]={time:new Date,resolve:e,reject:t},this.ws.send(JSON.stringify(r))})}),n(this,"listener",e=>{o&&console.log("[ChainWebSocket] <---- reply ----<",JSON.stringify(e));let t=!1,r=null;"notice"===e.method&&(t=!0,e.id=e.params[0]),t?r=this.subs[e.id].callback:(r=this.cbs[e.id],this.responseCbId=e.id),r&&!t?(e.error?r.reject(e.error):r.resolve(e.result),delete this.cbs[e.id],this.unsub[e.id]&&(delete this.subs[this.unsub[e.id]],delete this.unsub[e.id])):r&&t?r(e.params[1]):console.log("Warning: unknown websocket response: ",e)}),n(this,"login",(e,t)=>this.connect_promise.then(()=>this.call([1,"login",[e,t]]))),n(this,"close",()=>new Promise(e=>(clearInterval(this.keepalive_timer),this.keepalive_timer=void 0,this._closeCb=()=>{e(),this._closeCb=null},this.ws?void(this.ws.terminate?this.ws.terminate():this.ws.close(),3===this.ws.readyState&&e()):(console.log("Websocket already cleared",this),e())))),this.url=t,this.statusCb=r,this.current_reject=null,this.on_reconnect=null,this.closed=!1,this.send_life=s,this.recv_life=f,this.keepAliveCb=d,this.cbId=0,this.responseCbId=0,this.cbs={},this.subs={},this.unsub={},this.connect_promise=this.connect(t,a)}}},{"isomorphic-ws":76}],36:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}(e("./ApiInstances")),o=function(e){return e&&e.__esModule?e:{default:e}}(e("./ChainWebSocket"));r.default=class{constructor({url:t,urls:r,autoFallback:a,closeCb:s,optionalApis:e,urlChangeCallback:f}){n(this,"setCloseCb",e=>{this.closeCb=e}),n(this,"logFailure",(e,t,r)=>{let n=r&&r.message?r.message:"";console.error(e,"Failed to connect to "+t+(n?" Error: "+JSON.stringify(n):""))}),n(this,"_onClose",()=>{this.isConnected=!1,this.closeCb&&(this.closeCb(),this.setCloseCb(null)),this.autoFallback&&this.connectWithFallback()}),n(this,"connect",async(e=!0,t=this.url)=>{try{let r=await i.instance(t,e,void 0,this.optionalApis,this._onClose).init_promise;return this.url=t,this.isConnected=!0,r}catch(e){throw await i.close(),e}}),n(this,"connectWithFallback",async(t=!0,r=this.url,n=0,i=null,a=null)=>{if(n>this.urls.length)return a(new Error("Tried "+n+" connections, none of which worked: "+JSON.stringify(this.urls.concat(this.url))));try{return await this.connect(t,r)}catch(e){return this.urlChangeCallback&&this.urlChangeCallback(this.urls[n]),this.connectWithFallback(t,this.urls[n],n+1,i,a)}}),n(this,"checkConnections",async(t="",r="",n,i)=>{let a={},e=this.urls.concat(this.url),s=e.map(async e=>{let n=new o.default(e,()=>{},void 0,!1);a[e]=new Date().getTime();try{await n.login(t,r);let i={[e]:new Date().getTime()-a[e]};return await n.close(),i}catch(t){return e===this.url?this.url=this.urls[0]:this.urls=this.urls.filter(t=>t!==e),void(await n.close())}});try{let e=await Promise.all(s),t=e.filter(e=>!!e).sort((e,t)=>Object.values(e)[0]-Object.values(t)[0]).reduce((e,t)=>{let r=Object.keys(t)[0];return e[r]=t[r],e},{});return console.log(`Checked ${e.length} connections, ${e.length-Object.keys(t).length} failed`),t}catch(a){return this.checkConnections(t,r,n,i)}}),this.url=t,this.urls=r.filter(e=>e!==t),this.autoFallback=a,this.closeCb=s,this.optionalApis=e||{},this.isConnected=!1,this.urlChangeCallback=f}static close(){return i.close()}}},{"./ApiInstances":33,"./ChainWebSocket":35}],37:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default=class{constructor(e,t){this.ws_rpc=e,this.api_name=t}init(){var e=this;return this.ws_rpc.call([1,this.api_name,[]]).then(t=>(e.api_id=t,e))}exec(e,t){return this.ws_rpc.call([this.api_id,e,t]).catch(e=>{throw e})}}},{}],38:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}(e("./ApiInstances"));Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Manager",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"ChainConfig",{enumerable:!0,get:function(){return o.default}}),r.Apis=void 0,r.Apis=i;var a=n(e("./ConnectionManager")),o=n(e("./ChainConfig"))},{"./ApiInstances":33,"./ChainConfig":34,"./ConnectionManager":36}],39:[function(){},{}],40:[function(e,t){(function(r){'use strict';/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,a=0,s=o(r,n);a<s;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0}function i(e){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(e):!!(null!=e&&e._isBuffer)}function a(e){return Object.prototype.toString.call(e)}function s(e){return!i(e)&&!("function"!=typeof r.ArrayBuffer)&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(!!(e instanceof DataView)||!!(e.buffer&&e.buffer instanceof ArrayBuffer)))}function f(e){if(x.isFunction(e)){if(I)return e.name;var t=e.toString(),r=t.match(E);return r&&r[1]}}function l(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function d(e){if(I||!x.isFunction(e))return x.inspect(e);var t=f(e),r=t?": "+t:"";return"[Function"+r+"]"}function u(e){return l(d(e.actual),128)+" "+e.operator+" "+l(d(e.expected),128)}function c(e,t,r,n,i){throw new T.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function p(e,t){e||c(e,!0,t,"==",T.ok)}function _(e,t,r,o){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(x.isDate(e)&&x.isDate(t))return e.getTime()===t.getTime();if(x.isRegExp(e)&&x.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if((null===e||"object"!=typeof e)&&(null===t||"object"!=typeof t))return r?e===t:e==t;if(s(e)&&s(t)&&a(e)===a(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;o=o||{actual:[],expected:[]};var f=o.actual.indexOf(e);return-1!==f&&f===o.expected.indexOf(t)||(o.actual.push(e),o.expected.push(t),m(e,t,r,o))}function g(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function m(e,t,r,n){if(null===e||e===void 0||null===t||t===void 0)return!1;if(x.isPrimitive(e)||x.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=g(e),s=g(t);if(o&&!s||!o&&s)return!1;if(o)return e=S.call(e),t=S.call(t),_(e,t,r);var f=L(e),l=L(t),d,u;if(f.length!==l.length)return!1;for(f.sort(),l.sort(),u=f.length-1;0<=u;u--)if(f[u]!==l[u])return!1;for(u=f.length-1;0<=u;u--)if(d=f[u],!_(e[d],t[d],r,n))return!1;return!0}function b(e,t,r){_(e,t,!0)&&c(e,t,r,"notDeepStrictEqual",b)}function h(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(t){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function y(e){var t;try{e()}catch(r){t=r}return t}function w(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError("\"block\" argument must be a function");"string"==typeof r&&(n=r,r=null),i=y(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&c(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!e&&x.isError(i),s=!e&&i&&!r;if((o&&a&&h(i,r)||s)&&c(i,r,"Got unwanted exception"+n),e&&i&&r&&!h(i,r)||!e&&i)throw i}function v(e,t){e||c(e,!0,t,"==",v)}var B=e("object-assign"),x=e("util/"),k=Object.prototype.hasOwnProperty,S=Array.prototype.slice,I=function(){return"foo"===function(){}.name}(),T=t.exports=p,E=/\s*function\s+([^\(\s]*)\s*/;T.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=u(this),this.generatedMessage=!0);var t=e.stackStartFunction||c;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=f(t),a=n.indexOf("\n"+i);if(0<=a){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},x.inherits(T.AssertionError,Error),T.fail=c,T.ok=p,T.equal=function(e,t,r){e!=t&&c(e,t,r,"==",T.equal)},T.notEqual=function(e,t,r){e==t&&c(e,t,r,"!=",T.notEqual)},T.deepEqual=function(e,t,r){_(e,t,!1)||c(e,t,r,"deepEqual",T.deepEqual)},T.deepStrictEqual=function(e,t,r){_(e,t,!0)||c(e,t,r,"deepStrictEqual",T.deepStrictEqual)},T.notDeepEqual=function(e,t,r){_(e,t,!1)&&c(e,t,r,"notDeepEqual",T.notDeepEqual)},T.notDeepStrictEqual=b,T.strictEqual=function(e,t,r){e!==t&&c(e,t,r,"===",T.strictEqual)},T.notStrictEqual=function(e,t,r){e===t&&c(e,t,r,"!==",T.notStrictEqual)},T.throws=function(e,t,r){w(!0,e,t,r)},T.doesNotThrow=function(e,t,r){w(!1,e,t,r)},T.ifError=function(e){if(e)throw e},T.strict=B(v,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict;var L=Object.keys||function(e){var t=[];for(var r in e)k.call(e,r)&&t.push(r);return t}}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"object-assign":80,"util/":43}],41:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],42:[function(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],43:[function(e,t,r){(function(t,n){function a(e,t){var n={seen:[],stylize:s};return 3<=arguments.length&&(n.depth=arguments[2]),4<=arguments.length&&(n.colors=arguments[3]),m(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),l(n,e,n.depth)}function o(e,t){var r=a.styles[t];return r?"\x1B["+a.colors[r][0]+"m"+e+"\x1B["+a.colors[r][1]+"m":e}function s(e){return e}function f(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function l(e,t,i){if(e.customInspect&&t&&S(t.inspect)&&t.inspect!==r.inspect&&!(t.constructor&&t.constructor.prototype===t)){var a=t.inspect(i,e);return y(a)||(a=l(e,a,i)),a}var o=d(e,t);if(o)return o;var s=Object.keys(t),m=f(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),k(t)&&(0<=s.indexOf("message")||0<=s.indexOf("description")))return u(t);if(0===s.length){if(S(t)){var b=t.name?": "+t.name:"";return e.stylize("[Function"+b+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(x(t))return e.stylize(Date.prototype.toString.call(t),"date");if(k(t))return u(t)}var h="",w=!1,B=["{","}"];if(g(t)&&(w=!0,B=["[","]"]),S(t)){var I=t.name?": "+t.name:"";h=" [Function"+I+"]"}if(v(t)&&(h=" "+RegExp.prototype.toString.call(t)),x(t)&&(h=" "+Date.prototype.toUTCString.call(t)),k(t)&&(h=" "+u(t)),0===s.length&&(!w||0==t.length))return B[0]+h+B[1];if(0>i)return v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var n;return n=w?c(e,t,i,m,s):s.map(function(r){return p(e,t,i,m,r,w)}),e.seen.pop(),_(n,h,B)}function d(e,t){if(w(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\"")+"'";return e.stylize(r,"string")}return h(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,n,a){for(var o=[],s=0,f=t.length;s<f;++s)L(t,s+"")?o.push(p(e,t,r,n,s+"",!0)):o.push("");return a.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))}),o}function p(e,t,r,n,i,a){var o,s,f;if(f=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},f.get?f.set?s=e.stylize("[Getter/Setter]","special"):s=e.stylize("[Getter]","special"):f.set&&(s=e.stylize("[Setter]","special")),L(n,i)||(o="["+i+"]"),s||(0>e.seen.indexOf(f.value)?(s=b(r)?l(e,f.value,null):l(e,f.value,r-1),-1<s.indexOf("\n")&&(a?s=s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):s="\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),w(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,"\"").replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function _(e,t,r){var n=0,i=e.reduce(function(e,t){return n++,0<=t.indexOf("\n")&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return 60<i?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function g(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function b(e){return null===e}function h(e){return"number"==typeof e}function y(e){return"string"==typeof e}function w(e){return void 0===e}function v(e){return B(e)&&"[object RegExp]"===I(e)}function B(e){return"object"==typeof e&&null!==e}function x(e){return B(e)&&"[object Date]"===I(e)}function k(t){return B(t)&&("[object Error]"===I(t)||t instanceof Error)}function S(e){return"function"==typeof e}function I(e){return Object.prototype.toString.call(e)}function T(e){return 10>e?"0"+e.toString(10):e.toString(10)}function E(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var j=/%[sdj%]/g;r.format=function(e){if(!y(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,s=(e+"").replace(j,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return n[r++]+"";case"%d":return+n[r++];case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e;}}),f=n[r];r<o;f=n[++r])s+=b(f)||!B(f)?" "+f:" "+a(f);return s},r.deprecate=function(e,i){function a(){if(!o){if(t.throwDeprecation)throw new Error(i);else t.traceDeprecation?console.trace(i):console.error(i);o=!0}return e.apply(this,arguments)}if(w(n.process))return function(){return r.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var o=!1;return a};var A={},O;r.debuglog=function(e){if(w(O)&&(O=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!A[e])if(new RegExp("\\b"+e+"\\b","i").test(O)){var n=t.pid;A[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else A[e]=function(){};return A[e]},r.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=g,r.isBoolean=m,r.isNull=b,r.isNullOrUndefined=function(e){return null==e},r.isNumber=h,r.isString=y,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=w,r.isRegExp=v,r.isObject=B,r.isDate=x,r.isError=k,r.isFunction=S,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e},r.isBuffer=e("./support/isBuffer");var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",E(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!B(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./support/isBuffer":42,_process:82,inherits:41}],44:[function(e,t){var r=e("base-x");t.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},{"base-x":27}],45:[function(e,t,n){(function(t){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/'use strict';function a(e){if(2147483647<e)throw new RangeError("The value \""+e+"\" is invalid for option \"size\"");var r=new Uint8Array(e);return r.__proto__=t.prototype,r}function t(e,r,n){if("number"==typeof e){if("string"==typeof r)throw new TypeError("The \"string\" argument must be of type string. Received type number");return d(e)}return s(e,r,n)}function s(e,r,n){if("string"==typeof e)return c(e,r);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(G(e,ArrayBuffer)||e&&G(e.buffer,ArrayBuffer))return _(e,r,n);if("number"==typeof e)throw new TypeError("The \"value\" argument must not be of type number. Received type number");var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return t.from(i,r,n);var a=g(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return t.from(e[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError("\"size\" argument must be of type number");else if(0>e)throw new RangeError("The value \""+e+"\" is invalid for option \"size\"")}function l(e,t,r){return f(e),0>=e?a(e):void 0===t?a(e):"string"==typeof r?a(e).fill(t,r):a(e).fill(t)}function d(e){return f(e),a(0>e?0:0|m(e))}function c(e,r){if(("string"!=typeof r||""===r)&&(r="utf8"),!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|h(e,r),i=a(n),o=i.write(e,r);return o!==n&&(i=i.slice(0,o)),i}function p(e){for(var t=0>e.length?0:0|m(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function _(e,r,n){if(0>r||e.byteLength<r)throw new RangeError("\"offset\" is outside of buffer bounds");if(e.byteLength<r+(n||0))throw new RangeError("\"length\" is outside of buffer bounds");var i;return i=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),i.__proto__=t.prototype,i}function g(e){if(t.isBuffer(e)){var r=0|m(e.length),n=a(r);return 0===n.length?n:(e.copy(n,0,0,r),n)}return void 0===e.length?"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0:"number"!=typeof e.length||Y(e.length)?a(0):p(e)}function m(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),t.alloc(+e)}function h(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||G(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type "+typeof e);var n=e.length,i=2<arguments.length&&!0===arguments[2];if(!i&&0===n)return 0;for(var a=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(a)return i?-1:H(e).length;r=(""+r).toLowerCase(),a=!0;}}function y(e,t,r){var n=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return q(this,t,r);case"utf8":case"utf-8":return j(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return L(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0;}}function w(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,r,n,i,a){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):2147483647<n?n=2147483647:-2147483648>n&&(n=-2147483648),n=+n,Y(n)&&(n=a?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(0>n)if(a)n=0;else return-1;if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:B(e,r,n,i,a);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):B(e,[r],n,i,a);throw new TypeError("val must be string, number or Buffer")}function B(e,t,r,n,a){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,f=e.length,l=t.length;if(void 0!==n&&(n=(n+"").toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>e.length||2>t.length)return-1;s=2,f/=2,l/=2,r/=2}var d;if(a){var u=-1;for(d=r;d<f;d++)if(o(e,d)!==o(t,-1===u?0:d-u))-1!==u&&(d-=d-u),u=-1;else if(-1===u&&(u=d),d-u+1===l)return u*s}else for(r+l>f&&(r=f-l),d=r;0<=d;d--){for(var c=!0,p=0;p<l;p++)if(o(e,d+p)!==o(t,p)){c=!1;break}if(c)return d}return-1}function x(e,t,r,n){r=+r||0;var a=e.length-r;n?(n=+n,n>a&&(n=a)):n=a;var o=t.length;n>o/2&&(n=o/2);for(var s=0,f;s<n;++s){if(f=parseInt(t.substr(2*s,2),16),Y(f))return s;e[r+s]=f}return s}function k(e,t,r,n){return Z(H(t,e.length-r),e,r,n)}function S(e,t,r,n){return Z(K(t),e,r,n)}function I(e,t,r,n){return S(e,t,r,n)}function T(e,t,r,n){return Z(W(t),e,r,n)}function E(e,t,r,n){return Z(V(t,e.length-r),e,r,n)}function L(e,t,r){return 0===t&&r===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,r))}function j(e,t,r){r=o(e.length,r);for(var n=[],a=t;a<r;){var s=e[a],f=null,l=239<s?4:223<s?3:191<s?2:1;if(a+l<=r){var d,u,c,p;1===l?128>s&&(f=s):2===l?(d=e[a+1],128==(192&d)&&(p=(31&s)<<6|63&d,127<p&&(f=p))):3===l?(d=e[a+1],u=e[a+2],128==(192&d)&&128==(192&u)&&(p=(15&s)<<12|(63&d)<<6|63&u,2047<p&&(55296>p||57343<p)&&(f=p))):4===l?(d=e[a+1],u=e[a+2],c=e[a+3],128==(192&d)&&128==(192&u)&&128==(192&c)&&(p=(15&s)<<18|(63&d)<<12|(63&u)<<6|63&c,65535<p&&1114112>p&&(f=p))):void 0}null===f?(f=65533,l=1):65535<f&&(f-=65536,n.push(55296|1023&f>>>10),f=56320|1023&f),n.push(f),a+=l}return A(n)}function A(e){var t=e.length;if(t<=4096)return r.apply(String,e);for(var n="",a=0;a<t;)n+=r.apply(String,e.slice(a,a+=4096));return n}function O(e,t,n){var a="";n=o(e.length,n);for(var s=t;s<n;++s)a+=r(127&e[s]);return a}function C(e,t,n){var a="";n=o(e.length,n);for(var s=t;s<n;++s)a+=r(e[s]);return a}function q(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var a="",o=t;o<r;++o)a+=F(e[o]);return a}function U(e,t,n){for(var a=e.slice(t,n),o="",s=0;s<a.length;s+=2)o+=r(a[s]+256*a[s+1]);return o}function D(e,t,r){if(0!=e%1||0>e)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function M(e,r,n,i,a,o){if(!t.isBuffer(e))throw new TypeError("\"buffer\" argument must be a Buffer instance");if(r>a||r<o)throw new RangeError("\"value\" argument is out of bounds");if(n+i>e.length)throw new RangeError("Index out of range")}function z(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function P(e,t,r,n,i){return t=+t,r>>>=0,i||z(e,t,r,4,34028234663852886e22,-34028234663852886e22),Q.write(e,t,r,n,23,4),r+4}function R(e,t,r,n,i){return t=+t,r>>>=0,i||z(e,t,r,8,17976931348623157e292,-17976931348623157e292),Q.write(e,t,r,n,52,8),r+8}function N(e){if(e=e.split("=")[0],e=e.trim().replace(J,""),2>e.length)return"";for(;0!=e.length%4;)e+="=";return e}function F(e){return 16>e?"0"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var r=e.length,n=null,a=[],o=0,s;o<r;++o){if(s=e.charCodeAt(o),55295<s&&57344>s){if(!n){if(56319<s){-1<(t-=3)&&a.push(239,191,189);continue}else if(o+1===r){-1<(t-=3)&&a.push(239,191,189);continue}n=s;continue}if(56320>s){-1<(t-=3)&&a.push(239,191,189),n=s;continue}s=(n-55296<<10|s-56320)+65536}else n&&-1<(t-=3)&&a.push(239,191,189);if(n=null,128>s){if(0>(t-=1))break;a.push(s)}else if(2048>s){if(0>(t-=2))break;a.push(192|s>>6,128|63&s)}else if(65536>s){if(0>(t-=3))break;a.push(224|s>>12,128|63&s>>6,128|63&s)}else if(1114112>s){if(0>(t-=4))break;a.push(240|s>>18,128|63&s>>12,128|63&s>>6,128|63&s)}else throw new Error("Invalid code point")}return a}function K(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function V(e,t){for(var r=[],n=0,a,o,s;n<e.length&&!(0>(t-=2));++n)a=e.charCodeAt(n),o=a>>8,s=a%256,r.push(s),r.push(o);return r}function W(e){return X.toByteArray(N(e))}function Z(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function G(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!==e}var X=e("base64-js"),Q=e("ieee754");n.Buffer=t,n.SlowBuffer=b,n.INSPECT_MAX_BYTES=50;n.kMaxLength=2147483647,t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),t.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){return t.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){return t.isBuffer(this)?this.byteOffset:void 0}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(e,t,r){return s(e,t,r)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(e,t,r){return l(e,t,r)},t.allocUnsafe=function(e){return d(e)},t.allocUnsafeSlow=function(e){return d(e)},t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,r){if(G(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),G(r,Uint8Array)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");if(e===r)return 0;for(var n=e.length,s=r.length,f=0,l=o(n,s);f<l;++f)if(e[f]!==r[f]){n=e[f],s=r[f];break}return n<s?-1:s<n?1:0},t.isEncoding=function(e){switch((e+"").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!0;default:return!1;}},t.concat=function(e,r){if(!Array.isArray(e))throw new TypeError("\"list\" argument must be an Array of Buffers");if(0===e.length)return t.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var a=t.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var s=e[n];if(G(s,Uint8Array)&&(s=t.from(s)),!t.isBuffer(s))throw new TypeError("\"list\" argument must be an Array of Buffers");s.copy(a,o),o+=s.length}return a},t.byteLength=h,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var e=this.length;if(0!=e%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)w(this,t,t+1);return this},t.prototype.swap32=function(){var e=this.length;if(0!=e%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},t.prototype.swap64=function(){var e=this.length;if(0!=e%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},t.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?j(this,0,e):y.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},t.prototype.compare=function(e,r,n,a,s){if(G(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type "+typeof e);if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===a&&(a=0),void 0===s&&(s=this.length),0>r||n>e.length||0>a||s>this.length)throw new RangeError("out of range index");if(a>=s&&r>=n)return 0;if(a>=s)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,a>>>=0,s>>>=0,this===e)return 0;for(var f=s-a,l=n-r,d=o(f,l),u=this.slice(a,s),c=e.slice(r,n),p=0;p<d;++p)if(u[p]!==c[p]){f=u[p],l=c[p];break}return f<l?-1:l<f?1:0},t.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},t.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},t.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},t.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((void 0===r||r>i)&&(r=i),0<e.length&&(0>r||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"latin1":case"binary":return I(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0;}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i=this.subarray(e,r);return i.__proto__=t.prototype,i},t.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n},t.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],i=1;0<t&&(i*=256);)n+=this[e+--t]*i;return n},t.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return a*=128,n>=a&&(n-=u(2,8*t)),n},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,a=1,o=this[e+--n];0<n&&(a*=256);)o+=this[e+--n]*a;return a*=128,o>=a&&(o-=u(2,8*t)),o},t.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),Q.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),Q.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),Q.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),Q.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var a=u(2,8*r)-1;M(this,e,t,r,a,0)}var o=1,s=0;for(this[t]=255&e;++s<r&&(o*=256);)this[t+s]=255&e/o;return t+r},t.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var a=u(2,8*r)-1;M(this,e,t,r,a,0)}var o=r-1,s=1;for(this[t+o]=255&e;0<=--o&&(s*=256);)this[t+o]=255&e/s;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=u(2,8*r-1);M(this,e,t,r,a-1,-a)}var o=0,s=1,f=0;for(this[t]=255&e;++o<r&&(s*=256);)0>e&&0===f&&0!==this[t+o-1]&&(f=1),this[t+o]=255&(e/s>>0)-f;return t+r},t.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=u(2,8*r-1);M(this,e,t,r,a-1,-a)}var o=r-1,s=1,f=0;for(this[t+o]=255&e;0<=--o&&(s*=256);)0>e&&0===f&&0!==this[t+o+1]&&(f=1),this[t+o]=255&(e/s>>0)-f;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},t.prototype.copy=function(e,r,n,a){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),a||0===a||(a=this.length),r>=e.length&&(r=e.length),r||(r=0),0<a&&a<n&&(a=n),a===n)return 0;if(0===e.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("Index out of range");if(0>a)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-r<a-n&&(a=e.length-r+n);var o=a-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,n,a);else if(this===e&&n<r&&r<a)for(var s=o-1;0<=s;--s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,a),r);return o},t.prototype.fill=function(e,r,n,a){if("string"==typeof e){if("string"==typeof r?(a=r,r=0,n=this.length):"string"==typeof n&&(a=n,n=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!t.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===e.length){var o=e.charCodeAt(0);("utf8"===a&&128>o||"latin1"===a)&&(e=o)}}else"number"==typeof e&&(e&=255);if(0>r||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r>>>=0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=r;s<n;++s)this[s]=e;else{var f=t.isBuffer(e)?e:t.from(e,a),l=f.length;if(0===l)throw new TypeError("The value \""+e+"\" is invalid for argument \"value\"");for(s=0;s<n-r;++s)this[s+r]=f[s%l]}return this};var J=/[^+/0-9A-Za-z-_]/g}).call(this,e("buffer").Buffer)},{"base64-js":28,buffer:45,ieee754:72}],46:[function(e,i){/**
* @license bytebuffer.js (c) 2015 Daniel Wirtz <[email protected]>
* Backing buffer: ArrayBuffer, Accessor: Uint8Array
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/bytebuffer.js for details
*/(function(t,r){"function"==typeof c&&c.amd?c(["long"],r):"function"==typeof e&&"object"==typeof i&&i&&i.exports?i.exports=function(){var t;try{t=e("long")}catch(t){}return r(t)}():(t.dcodeIO=t.dcodeIO||{}).ByteBuffer=r(t.dcodeIO.Long)})(this,function(e){"use strict";function o(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function f(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+g.apply(String,e):void(1024<e.length+arguments.length&&(t.push(g.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments))}}function l(t,r,n,a,o){var f=8*o-a-1,l=(1<<f)-1,c=l>>1,p=-7,_=n?o-1:0,g=n?-1:1,d=t[r+_],b,h;for(_+=g,b=d&(1<<-p)-1,d>>=-p,p+=f;0<p;b=256*b+t[r+_],_+=g,p-=8);for(h=b&(1<<-p)-1,b>>=-p,p+=a;0<p;h=256*h+t[r+_],_+=g,p-=8);if(0===b)b=1-c;else{if(b===l)return h?NaN:(d?-1:1)*(1/0);h+=u(2,a),b-=c}return(d?-1:1)*h*u(2,b-a)}function d(r,o,f,l,p,_){var g=8*_-p-1,b=(1<<g)-1,h=b>>1,y=23===p?u(2,-24)-u(2,-77):0,w=l?0:_-1,v=l?1:-1,d=0>o||0===o&&0>1/o?1:0,B,x,k;for(o=t(o),isNaN(o)||o===1/0?(x=isNaN(o)?1:0,B=b):(B=s(n(o)/a),1>o*(k=u(2,-B))&&(B--,k*=2),o+=1<=B+h?y/k:y*u(2,1-h),2<=o*k&&(B++,k/=2),B+h>=b?(x=0,B=b):1<=B+h?(x=(o*k-1)*u(2,p),B+=h):(x=o*u(2,h-1)*u(2,p),B=0));8<=p;r[f+w]=255&x,w+=v,x/=256,p-=8);for(B=B<<p|x,g+=p;0<g;r[f+w]=255&B,w+=v,B/=256,g-=8);r[f+w-v]|=128*d}var c=function(e,t,r){if("undefined"==typeof e&&(e=c.DEFAULT_CAPACITY),"undefined"==typeof t&&(t=c.DEFAULT_ENDIAN),"undefined"==typeof r&&(r=c.DEFAULT_NOASSERT),!r){if(e|=0,0>e)throw RangeError("Illegal capacity");t=!!t,r=!!r}this.buffer=0===e?_:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=r};c.VERSION="5.0.1",c.LITTLE_ENDIAN=!0,c.BIG_ENDIAN=!1,c.DEFAULT_CAPACITY=16,c.DEFAULT_ENDIAN=c.BIG_ENDIAN,c.DEFAULT_NOASSERT=!1,c.Long=e||null;var p=c.prototype;p.__isByteBuffer__,Object.defineProperty(p,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var _=new ArrayBuffer(0),g=r;c.accessor=function(){return Uint8Array},c.allocate=function(e,t,r){return new c(e,t,r)},c.concat=function(e,t,r,n){("boolean"==typeof t||"string"!=typeof t)&&(n=r,r=t,t=void 0);for(var a=0,o=0,s=e.length,f;o<s;++o)c.isByteBuffer(e[o])||(e[o]=c.wrap(e[o],t)),f=e[o].limit-e[o].offset,0<f&&(a+=f);if(0===a)return new c(0,r,n);var l=new c(a,r,n),d;for(o=0;o<s;)d=e[o++],f=d.limit-d.offset,0>=f||(l.view.set(d.view.subarray(d.offset,d.limit),l.offset),l.offset+=f);return l.limit=l.offset,l.offset=0,l},c.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},c.type=function(){return ArrayBuffer},c.wrap=function(e,t,r,n){if("string"!=typeof t&&(n=r,r=t,t=void 0),"string"==typeof e)switch("undefined"==typeof t&&(t="utf8"),t){case"base64":return c.fromBase64(e,r);case"hex":return c.fromHex(e,r);case"binary":return c.fromBinary(e,r);case"utf8":return c.fromUTF8(e,r);case"debug":return c.fromDebug(e,r);default:throw Error("Unsupported encoding: "+t);}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var a;if(c.isByteBuffer(e))return a=p.clone.call(e),a.markedOffset=-1,a;if(e instanceof Uint8Array)a=new c(0,r,n),0<e.length&&(a.buffer=e.buffer,a.offset=e.byteOffset,a.limit=e.byteOffset+e.byteLength,a.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)a=new c(0,r,n),0<e.byteLength&&(a.buffer=e,a.offset=0,a.limit=e.byteLength,a.view=0<e.byteLength?new Uint8Array(e):null);else if("[object Array]"===Object.prototype.toString.call(e)){a=new c(e.length,r,n),a.limit=e.length;for(var o=0;o<e.length;++o)a.view[o]=e[o]}else throw TypeError("Illegal buffer");return a},p.writeBitSet=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}var n=t,i=e.length,a=i>>3,o=0,s;for(t+=this.writeVarint32(i,t);a--;)s=1&!!e[o++]|(1&!!e[o++])<<1|(1&!!e[o++])<<2|(1&!!e[o++])<<3|(1&!!e[o++])<<4|(1&!!e[o++])<<5|(1&!!e[o++])<<6|(1&!!e[o++])<<7,this.writeByte(s,t++);if(o<i){var f=0;for(s=0;o<i;)s|=(1&!!e[o++])<<f++;this.writeByte(s,t++)}return r?(this.offset=t,this):t-n},p.readBitSet=function(e){var t="undefined"==typeof e;t&&(e=this.offset);var r=this.readVarint32(e),n=r.value,i=n>>3,a=0,o=[],s;for(e+=r.length;i--;)s=this.readByte(e++),o[a++]=!!(1&s),o[a++]=!!(2&s),o[a++]=!!(4&s),o[a++]=!!(8&s),o[a++]=!!(16&s),o[a++]=!!(32&s),o[a++]=!!(64&s),o[a++]=!!(128&s);if(a<n){var f=0;for(s=this.readByte(e++);a<n;)o[a++]=!!(1&s>>f++)}return t&&(this.offset=e),o},p.readBytes=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var n=this.slice(t,t+e);return r&&(this.offset+=e),n},p.writeBytes=p.append,p.writeInt8=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},p.writeByte=p.writeInt8,p.readInt8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var r=this.view[e];return 128==(128&r)&&(r=-(255-r+1)),t&&(this.offset+=1),r},p.readByte=p.readInt8,p.writeUint8=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},p.writeUInt8=p.writeUint8,p.readUint8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var r=this.view[e];return t&&(this.offset+=1),r},p.readUInt8=p.readUint8,p.writeInt16=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},p.writeShort=p.writeInt16,p.readInt16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+2+") <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768==(32768&r)&&(r=-(65535-r+1)),t&&(this.offset+=2),r},p.readShort=p.readInt16,p.writeUint16=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},p.writeUInt16=p.writeUint16,p.readUint16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+2+") <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},p.readUInt16=p.readUint16,p.writeInt32=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},p.writeInt=p.writeInt32,p.readInt32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+4+") <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},p.readInt=p.readInt32,p.writeUint32=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},p.writeUInt32=p.writeUint32,p.readUint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+4+") <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},p.readUInt32=p.readUint32,e&&(p.writeInt64=function(t,r){var n="undefined"==typeof r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+0+") <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var a=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=255&a>>>24,this.view[r+2]=255&a>>>16,this.view[r+1]=255&a>>>8,this.view[r]=255&a,r+=4,this.view[r+3]=255&o>>>24,this.view[r+2]=255&o>>>16,this.view[r+1]=255&o>>>8,this.view[r]=255&o):(this.view[r]=255&o>>>24,this.view[r+1]=255&o>>>16,this.view[r+2]=255&o>>>8,this.view[r+3]=255&o,r+=4,this.view[r]=255&a>>>24,this.view[r+1]=255&a>>>16,this.view[r+2]=255&a>>>8,this.view[r+3]=255&a),n&&(this.offset+=8),this},p.writeLong=p.writeInt64,p.readInt64=function(t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+8+") <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0);var a=new e(n,i,!1);return r&&(this.offset+=8),a},p.readLong=p.readInt64,p.writeUint64=function(t,r){var n="undefined"==typeof r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+0+") <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var a=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=255&a>>>24,this.view[r+2]=255&a>>>16,this.view[r+1]=255&a>>>8,this.view[r]=255&a,r+=4,this.view[r+3]=255&o>>>24,this.view[r+2]=255&o>>>16,this.view[r+1]=255&o>>>8,this.view[r]=255&o):(this.view[r]=255&o>>>24,this.view[r+1]=255&o>>>16,this.view[r+2]=255&o>>>8,this.view[r+3]=255&o,r+=4,this.view[r]=255&a>>>24,this.view[r+1]=255&a>>>16,this.view[r+2]=255&a>>>8,this.view[r+3]=255&a),n&&(this.offset+=8),this},p.writeUInt64=p.writeUint64,p.readUint64=function(t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+8+") <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0);var a=new e(n,i,!0);return r&&(this.offset+=8),a},p.readUInt64=p.readUint64),p.writeFloat32=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,d(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},p.writeFloat=p.writeFloat32,p.readFloat32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+4+") <= "+this.buffer.byteLength)}var r=l(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},p.readFloat=p.readFloat32,p.writeFloat64=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=8;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=8,d(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},p.writeDouble=p.writeFloat64,p.readFloat64=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+8+") <= "+this.buffer.byteLength)}var r=l(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},p.readDouble=p.readFloat64,c.MAX_VARINT32_BYTES=5,c.calculateVarint32=function(e){return e>>>=0,128>e?1:16384>e?2:2097152>e?3:268435456>e?4:5},c.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},c.zigZagDecode32=function(e){return 0|e>>>1^-(1&e)},p.writeVarint32=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}var n=c.calculateVarint32(e),i;t+=n;var a=this.buffer.byteLength;for(t>a&&this.resize((a*=2)>t?a:t),t-=n,e>>>=0;128<=e;)i=128|127&e,this.view[t++]=i,e>>>=7;return this.view[t++]=e,r?(this.offset=t,this):n},p.writeVarint32ZigZag=function(e,t){return this.writeVarint32(c.zigZagEncode32(e),t)},p.readVarint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var r=0,n=0,i;do{if(!this.noAssert&&e>this.limit){var a=Error("Truncated");throw a.truncated=!0,a}i=this.view[e++],5>r&&(n|=(127&i)<<7*r),++r}while(0!=(128&i));return n|=0,t?(this.offset=e,n):{value:n,length:r}},p.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=c.zigZagDecode32(t.value):t=c.zigZagDecode32(t),t},e&&(c.MAX_VARINT64_BYTES=10,c.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?16384>r?128>r?1:2:2097152>r?3:4:16384>n?128>n?5:6:2097152>n?7:8:128>i?9:10},c.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},c.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},p.writeVarint64=function(t,r){var n="undefined"==typeof r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+0+") <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned());var i=c.calculateVarint64(t),a=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0;r+=i;var f=this.buffer.byteLength;switch(r>f&&this.resize((f*=2)>r?f:r),r-=i,i){case 10:this.view[r+9]=1&s>>>7;case 9:this.view[r+8]=9===i?127&s:128|s;case 8:this.view[r+7]=8===i?127&o>>>21:128|o>>>21;case 7:this.view[r+6]=7===i?127&o>>>14:128|o>>>14;case 6:this.view[r+5]=6===i?127&o>>>7:128|o>>>7;case 5:this.view[r+4]=5===i?127&o:128|o;case 4:this.view[r+3]=4===i?127&a>>>21:128|a>>>21;case 3:this.view[r+2]=3===i?127&a>>>14:128|a>>>14;case 2:this.view[r+1]=2===i?127&a>>>7:128|a>>>7;case 1:this.view[r]=1===i?127&a:128|a;}return n?(this.offset+=i,this):i},p.writeVarint64ZigZag=function(e,t){return this.writeVarint64(c.zigZagEncode64(e),t)},p.readVarint64=function(t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+1+") <= "+this.buffer.byteLength)}var n=t,i=0,a=0,o=0,s=0;if(s=this.view[t++],i=127&s,128&s&&(s=this.view[t++],i|=(127&s)<<7,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<14,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<21,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a=127&s,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<7,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<14,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<21,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o=127&s,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s))))))))))throw Error("Buffer overrun");var f=e.fromBits(i|a<<28,a>>>4|o<<24,!1);return r?(this.offset=t,f):{value:f,length:t-n}},p.readVarint64ZigZag=function(t){var r=this.readVarint64(t);return r&&r.value instanceof e?r.value=c.zigZagDecode64(r.value):r=c.zigZagDecode64(r),r}),p.writeCString=function(e,t){var r="undefined"==typeof t;r&&(t=this.offset);var n=e.length,a;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(a=0;a<n;++a)if(0===e.charCodeAt(a))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}n=h.calculateUTF16asUTF8(o(e))[1],t+=n+1;var s=this.buffer.byteLength;return t>s&&this.resize((s*=2)>t?s:t),t-=n+1,h.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):n},p.readCString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var r=e,n=-1,i;return h.decodeUTF8toUTF16(function(){if(0===n)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return n=this.view[e++],0===n?null:n}.bind(this),i=f(),!0),t?(this.offset=e,i()):{string:i(),length:e-r}},p.writeIString=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}var n=t,i;i=h.calculateUTF16asUTF8(o(e),this.noAssert)[1],t+=4+i;var a=this.buffer.byteLength;if(t>a&&this.resize((a*=2)>t?a:t),t-=4+i,this.littleEndian?(this.view[t+3]=255&i>>>24,this.view[t+2]=255&i>>>16,this.view[t+1]=255&i>>>8,this.view[t]=255&i):(this.view[t]=255&i>>>24,this.view[t+1]=255&i>>>16,this.view[t+2]=255&i>>>8,this.view[t+3]=255&i),t+=4,h.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),t!==n+4+i)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+i));return r?(this.offset=t,this):t-n},p.readIString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+4+") <= "+this.buffer.byteLength)}var r=e,n=this.readUint32(e),i=this.readUTF8String(n,c.METRICS_BYTES,e+=4);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-r}},c.METRICS_CHARS="c",c.METRICS_BYTES="b",p.writeUTF8String=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}var n=t,i;i=h.calculateUTF16asUTF8(o(e))[1],t+=i;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=i,h.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),r?(this.offset=t,this):t-n},p.writeString=p.writeUTF8String,c.calculateUTF8Chars=function(e){return h.calculateUTF16asUTF8(o(e))[0]},c.calculateUTF8Bytes=function(e){return h.calculateUTF16asUTF8(o(e))[1]},c.calculateString=c.calculateUTF8Bytes,p.readUTF8String=function(e,t,r){"number"==typeof t&&(r=t,t=void 0);var n="undefined"==typeof r;if(n&&(r=this.offset),"undefined"==typeof t&&(t=c.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+0+") <= "+this.buffer.byteLength)}var a=0,o=r,s;if(t===c.METRICS_CHARS){if(s=f(),h.decodeUTF8(function(){return a<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++a,h.UTF8toUTF16(e,s)}),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return n?(this.offset=r,s()):{string:s(),length:r-o}}if(t===c.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var l=r+e;if(h.decodeUTF8toUTF16(function(){return r<l?this.view[r++]:null}.bind(this),s=f(),this.noAssert),r!==l)throw RangeError("Illegal range: Truncated data, "+r+" == "+l);return n?(this.offset=r,s()):{string:s(),length:r-o}}throw TypeError("Unsupported metrics: "+t)},p.readString=p.readUTF8String,p.writeVString=function(e,t){var r="undefined"==typeof t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}var n=t,i,a;i=h.calculateUTF16asUTF8(o(e),this.noAssert)[1],a=c.calculateVarint32(i),t+=a+i;var s=this.buffer.byteLength;if(t>s&&this.resize((s*=2)>t?s:t),t-=a+i,t+=this.writeVarint32(i,t),h.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),t!==n+i+a)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+i+a));return r?(this.offset=t,this):t-n},p.readVString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var r=e,n=this.readVarint32(e),i=this.readUTF8String(n.value,c.METRICS_BYTES,e+=n.length);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-r}},p.append=function(e,t,r){("number"==typeof t||"string"!=typeof t)&&(r=t,t=void 0);var n="undefined"==typeof r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+0+") <= "+this.buffer.byteLength)}e instanceof c||(e=c.wrap(e,t));var i=e.limit-e.offset;if(0>=i)return this;r+=i;var a=this.buffer.byteLength;return r>a&&this.resize((a*=2)>r?a:r),r-=i,this.view.set(e.view.subarray(e.offset,e.limit),r),e.offset+=i,n&&(this.offset+=i),this},p.appendTo=function(e,t){return e.append(this,t),this},p.assert=function(e){return this.noAssert=!e,this},p.capacity=function(){return this.buffer.byteLength},p.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},p.clone=function(e){var t=new c(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},p.compact=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0==r)return this.buffer=_,this.view=null,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var n=new ArrayBuffer(r),i=new Uint8Array(n);return i.set(this.view.subarray(e,t)),this.buffer=n,this.view=i,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},p.copy=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new c(0,this.littleEndian,this.noAssert);var r=t-e,n=new c(r,this.littleEndian,this.noAssert);return n.offset=0,n.limit=r,0<=n.markedOffset&&(n.markedOffset-=e),this.copyTo(n,0,e,t),n},p.copyTo=function(e,t,r,n){var i,a;if(!this.noAssert&&!c.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(a="undefined"==typeof t)?e.offset:0|t,r=(i="undefined"==typeof r)?this.offset:0|r,n="undefined"==typeof n?this.limit:0|n,0>t||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(0>r||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+r+" <= "+this.buffer.byteLength);var o=n-r;return 0==o?e:(e.ensureCapacity(t+o),e.view.set(this.view.subarray(r,n),t),i&&(this.offset+=o),a&&(e.offset+=o),this)},p.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},p.fill=function(e,t,r){var n="undefined"==typeof t;if(n&&(t=this.offset),"string"==typeof e&&0<e.length&&(e=e.charCodeAt(0)),"undefined"==typeof t&&(t=this.offset),"undefined"==typeof r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||0!=r%1)throw TypeError("Illegal end: Not an integer");if(r>>>=0,0>t||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t<r;)this.view[t++]=e;return n&&(this.offset=t),this},p.flip=function(){return this.limit=this.offset,this.offset=0,this},p.mark=function(e){if(e="undefined"==typeof e?this.offset:e,!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+0+") <= "+this.buffer.byteLength)}return this.markedOffset=e,this},p.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},p.LE=function(e){return this.littleEndian="undefined"==typeof e||!!e,this},p.BE=function(e){return this.littleEndian="undefined"!=typeof e&&!e,this},p.prepend=function(e,t,r){("number"==typeof t||"string"!=typeof t)&&(r=t,t=void 0);var n="undefined"==typeof r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+0+") <= "+this.buffer.byteLength)}e instanceof c||(e=c.wrap(e,t));var i=e.limit-e.offset;if(0>=i)return this;var a=i-r;if(0<a){var o=new ArrayBuffer(this.buffer.byteLength+a),s=new Uint8Array(o);s.set(this.view.subarray(r,this.buffer.byteLength),i),this.buffer=o,this.view=s,this.offset+=a,0<=this.markedOffset&&(this.markedOffset+=a),this.limit+=a,r+=a}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),r-i),e.offset=e.limit,n&&(this.offset-=i),this},p.prependTo=function(e,t){return e.prepend(this,t),this},p.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},p.remaining=function(){return this.limit-this.offset},p.reset=function(){return 0<=this.markedOffset?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},p.resize=function(e){if(!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,0>e)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this.view),this.buffer=t,this.view=r}return this},p.reverse=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t?this:(Array.prototype.reverse.call(this.view.subarray(e,t)),this)},p.skip=function(e){if(!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(0>t||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},p.slice=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},p.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||0!=r%1)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,0>t||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return _;var n=new ArrayBuffer(r-t);return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t,r),0),n},p.toArrayBuffer=p.toBuffer,p.toString=function(e,t,r){if("undefined"==typeof e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(e="utf8",t=e,r=t),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e);}};var m=function(){for(var e={},r=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],n=[],a=0,t=r.length;a<t;++a)n[r[a]]=a;return e.encode=function(e,n){for(var i,a;null!==(i=e());)n(r[63&i>>2]),a=(3&i)<<4,null===(i=e())?(n(r[63&a]),n(61),n(61)):(a|=15&i>>4,n(r[63&(a|15&i>>4)]),a=(15&i)<<2,null===(i=e())?(n(r[63&a]),n(61)):(n(r[63&(a|3&i>>6)]),n(r[63&i])))},e.decode=function(e,t){function r(e){throw Error("Illegal character code: "+e)}for(var i,a,o;null!==(i=e());)if(a=n[i],"undefined"==typeof a&&r(i),null!==(i=e())&&(o=n[i],"undefined"==typeof o&&r(i),t(a<<2>>>0|(48&o)>>4),null!==(i=e()))){if(a=n[i],"undefined"==typeof a)if(61===i)break;else r(i);if(t((15&o)<<4>>>0|(60&a)>>2),null!==(i=e())){if(o=n[i],"undefined"==typeof o)if(61===i)break;else r(i);t((3&a)<<6>>>0|o)}}},e.test=function(e){return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();p.toBase64=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,0>e||t>this.capacity||e>t)throw RangeError("begin, end");var r;return m.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=f()),r()},c.fromBase64=function(e,t){if("string"!=typeof e)throw TypeError("str");var r=new c(3*(e.length/4),t),n=0;return m.decode(o(e),function(e){r.view[n++]=e}),r.limit=n,r},c.btoa=function(e){return c.fromBinary(e).toBase64()},c.atob=function(e){return c.fromBase64(e).toBinary()},p.toBinary=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,0>e||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],i=[];e<t;)n.push(this.view[e++]),1024<=n.length&&(i.push(r.apply(String,n)),n=[]);return i.join("")+r.apply(String,n)},c.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var r=0,n=e.length,a=new c(n,t),o;r<n;){if(o=e.charCodeAt(r),255<o)throw RangeError("illegal char code: "+o);a.view[r++]=o}return a.limit=n,a},p.toDebug=function(e){for(var t=-1,n=this.buffer.byteLength,a="",o="",s="",f;t<n;){if(-1!==t&&(f=this.view[t],a+=16>f?"0"+f.toString(16).toUpperCase():f.toString(16).toUpperCase(),e&&(o+=32<f&&127>f?r(f):".")),++t,e&&0<t&&0==t%16&&t!==n){for(;51>a.length;)a+=" ";s+=a+o+"\n",a=o=""}a+=t===this.offset&&t===this.limit?t===this.markedOffset?"!":"|":t===this.offset?t===this.markedOffset?"[":"<":t===this.limit?t===this.markedOffset?"]":">":t===this.markedOffset?"'":e||0!==t&&t!==n?" ":""}if(e&&" "!==a){for(;51>a.length;)a+=" ";s+=a+o+"\n"}return e?s:a},c.fromDebug=function(e,t,r){for(var n=e.length,a=new c(0|(n+1)/3,t,r),o=0,s=0,f=!1,l=!1,d=!1,u=!1,p=!1,_,g;o<n;){switch(_=e.charAt(o++)){case"!":if(!r){if(l||d||u){p=!0;break}l=d=u=!0}a.offset=a.markedOffset=a.limit=s,f=!1;break;case"|":if(!r){if(l||u){p=!0;break}l=u=!0}a.offset=a.limit=s,f=!1;break;case"[":if(!r){if(l||d){p=!0;break}l=d=!0}a.offset=a.markedOffset=s,f=!1;break;case"<":if(!r){if(l){p=!0;break}l=!0}a.offset=s,f=!1;break;case"]":if(!r){if(u||d){p=!0;break}u=d=!0}a.limit=a.markedOffset=s,f=!1;break;case">":if(!r){if(u){p=!0;break}u=!0}a.limit=s,f=!1;break;case"'":if(!r){if(d){p=!0;break}d=!0}a.markedOffset=s,f=!1;break;case" ":f=!1;break;default:if(!r&&f){p=!0;break}if(g=parseInt(_+e.charAt(o++),16),!r&&(isNaN(g)||0>g||255<g))throw TypeError("Illegal str: Not a debug encoded string");a.view[s++]=g,f=!0;}if(p)throw TypeError("Illegal str: Invalid symbol at "+o)}if(!r){if(!l||!u)throw TypeError("Illegal str: Missing offset or limit");if(s<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+s+" < "+n)}return a},p.toHex=function(e,t){if(e="undefined"==typeof e?this.offset:e,t="undefined"==typeof t?this.limit:t,!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r=Array(t-e),n;e<t;)n=this.view[e++],16>n?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},c.fromHex=function(e,t,r){if(!r){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(0!=e.length%2)throw TypeError("Illegal str: Length not a multiple of 2")}for(var n=e.length,a=new c(0|n/2,t),o=0,s=0,f;o<n;o+=2){if(f=parseInt(e.substring(o,o+2),16),!r&&(!isFinite(f)||0>f||255<f))throw TypeError("Illegal str: Contains non-hex characters");a.view[s++]=f}return a.limit=s,a};var h=function(){var e={};return e.MAX_CODEPOINT=1114111,e.encodeUTF8=function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)128>r?t(127&r):2048>r?(t(192|31&r>>6),t(128|63&r)):65536>r?(t(224|15&r>>12),t(128|63&r>>6),t(128|63&r)):(t(240|7&r>>18),t(128|63&r>>12),t(128|63&r>>6),t(128|63&r)),r=null},e.decodeUTF8=function(e,t){for(var r=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t},n,i,o,s;null!==(n=e());)if(0==(128&n))t(n);else if(192==(224&n))null===(i=e())&&r([n,i]),t((31&n)<<6|63&i);else if(224==(240&n))(null===(i=e())||null===(o=e()))&&r([n,i,o]),t((15&n)<<12|(63&i)<<6|63&o);else if(240==(248&n))(null===(i=e())||null===(o=e())||null===(s=e()))&&r([n,i,o,s]),t((7&n)<<18|(63&i)<<12|(63&o)<<6|63&s);else throw RangeError("Illegal starting byte: "+n)},e.UTF16toUTF8=function(e,t){for(var r=null,n;null!==(n=null===r?e():r);){if(55296<=n&&57343>=n&&null!==(r=e())&&56320<=r&&57343>=r){t(1024*(n-55296)+r-56320+65536),r=null;continue}t(n)}null!==r&&t(r)},e.UTF8toUTF16=function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)65535>=r?t(r):(r-=65536,t((r>>10)+55296),t(r%1024+56320)),r=null},e.encodeUTF16toUTF8=function(t,r){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,r)})},e.decodeUTF8toUTF16=function(t,r){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,r)})},e.calculateCodePoint=function(e){return 128>e?1:2048>e?2:65536>e?3:4},e.calculateUTF8=function(e){for(var t=0,r;null!==(r=e());)t+=128>r?1:2048>r?2:65536>r?3:4;return t},e.calculateUTF16asUTF8=function(t){var r=0,i=0;return e.UTF16toUTF8(t,function(e){++r,i+=128>e?1:2048>e?2:65536>e?3:4}),[r,i]},e}();return p.toUTF8=function(t,r){if("undefined"==typeof t&&(t=this.offset),"undefined"==typeof r&&(r=this.limit),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||0!=r%1)throw TypeError("Illegal end: Not an integer");if(r>>>=0,0>t||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}var n;try{h.decodeUTF8toUTF16(function(){return t<r?this.view[t++]:null}.bind(this),n=f())}catch(n){if(t!==r)throw RangeError("Illegal range: Truncated data, "+t+" != "+r)}return n()},c.fromUTF8=function(e,t,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var n=new c(h.calculateUTF16asUTF8(o(e),!0)[1],t,r),a=0;return h.encodeUTF16toUTF8(o(e),function(e){n.view[a++]=e}),n.limit=a,n},c})},{long:77}],47:[function(e,t){(function(r){function n(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._decoder=null,this._encoding=null}var i=e("stream").Transform,a=e("inherits"),o=e("string_decoder").StringDecoder;t.exports=n,a(n,i),n.prototype.update=function(e,t,n){"string"==typeof e&&(e=new r(e,t));var i=this._update(e);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(t){n=t}finally{r(n)}},n.prototype._flush=function(e){var t;try{this.push(this._final())}catch(r){t=r}finally{e(t)}},n.prototype._finalOrDigest=function(e){var t=this._final()||new r("");return e&&(t=this._toString(t,e,!0)),t},n.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n}}).call(this,e("buffer").Buffer)},{buffer:45,inherits:73,stream:107,string_decoder:108}],48:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(r){return"[object Error]"===t(r)||r instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":74}],49:[function(e,t){'use strict';function r(e){s.call(this,"digest"),this._hash=e}var n=e("inherits"),i=e("md5.js"),a=e("ripemd160"),o=e("sha.js"),s=e("cipher-base");n(r,s),r.prototype._update=function(e){this._hash.update(e)},r.prototype._final=function(){return this._hash.digest()},t.exports=function(e){return e=e.toLowerCase(),"md5"===e?new i:"rmd160"===e||"ripemd160"===e?new a:new r(o(e))}},{"cipher-base":47,inherits:73,"md5.js":78,ripemd160:96,"sha.js":100}],50:[function(e,t){var r=e("md5.js");t.exports=function(e){return new r().update(e).digest()}},{"md5.js":78}],51:[function(e,t){'use strict';function r(e,t){a.call(this,"digest"),"string"==typeof t&&(t=o.from(t));var r="sha512"===e||"sha384"===e?128:64;if(this._alg=e,this._key=t,t.length>r){var n="rmd160"===e?new f:l(e);t=n.update(t).digest()}else t.length<r&&(t=o.concat([t,d],r));for(var s=this._ipad=o.allocUnsafe(r),u=this._opad=o.allocUnsafe(r),c=0;c<r;c++)s[c]=54^t[c],u[c]=92^t[c];this._hash="rmd160"===e?new f:l(e),this._hash.update(s)}var n=e("inherits"),i=e("./legacy"),a=e("cipher-base"),o=e("safe-buffer").Buffer,s=e("create-hash/md5"),f=e("ripemd160"),l=e("sha.js"),d=o.alloc(128);n(r,a),r.prototype._update=function(e){this._hash.update(e)},r.prototype._final=function(){var e=this._hash.digest(),t="rmd160"===this._alg?new f:l(this._alg);return t.update(this._opad).update(e).digest()},t.exports=function(e,t){return e=e.toLowerCase(),"rmd160"===e||"ripemd160"===e?new r("rmd160",t):"md5"===e?new i(s,t):new r(e,t)}},{"./legacy":52,"cipher-base":47,"create-hash/md5":50,inherits:73,ripemd160:96,"safe-buffer":97,"sha.js":100}],52:[function(e,t){'use strict';function r(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=a.concat([t,s],64));for(var r=this._ipad=a.allocUnsafe(64),n=this._opad=a.allocUnsafe(64),f=0;f<64;f++)r[f]=54^t[f],n[f]=92^t[f];this._hash=[r]}var n=e("inherits"),a=e("safe-buffer").Buffer,o=e("cipher-base"),s=a.alloc(128);n(r,o),r.prototype._update=function(e){this._hash.push(e)},r.prototype._final=function(){var e=this._alg(a.concat(this._hash));return this._alg(a.concat([this._opad,e]))},t.exports=r},{"cipher-base":47,inherits:73,"safe-buffer":97}],53:[function(e,t,r){(function(n,i){"object"==typeof r?t.exports=r=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof c&&c.amd?c(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(n.CryptoJS)})(this,function(e){return function(){var t=e,r=t.lib,n=r.BlockCipher,i=t.algo,a=[],o=[],s=[],f=[],l=[],u=[],c=[],p=[],_=[],g=[];(function(){for(var e=[],r=0;256>r;r++)e[r]=128>r?r<<1:283^r<<1;for(var n=0,d=0,r=0,m;256>r;r++){m=d^d<<1^d<<2^d<<3^d<<4,m=99^(m>>>8^255&m),a[n]=m,o[m]=n;var b=e[n],h=e[b],y=e[h],w=257*e[m]^16843008*m;s[n]=w<<24|w>>>8,f[n]=w<<16|w>>>16,l[n]=w<<8|w>>>24,u[n]=w;var w=16843009*y^65537*h^257*b^16843008*n;c[m]=w<<24|w>>>8,p[m]=w<<16|w>>>16,_[m]=w<<8|w>>>24,g[m]=w,n?(n=b^e[e[e[y^b]]],d^=e[e[d]]):n=d=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],b=i.AES=n.extend({_doReset:function(){if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,o=4*(i+1),s=this._keySchedule=[],f=0;f<o;f++)if(f<n)s[f]=r[f];else{var l=s[f-1];f%n?6<n&&4==f%n&&(l=a[l>>>24]<<24|a[255&l>>>16]<<16|a[255&l>>>8]<<8|a[255&l]):(l=l<<8|l>>>24,l=a[l>>>24]<<24|a[255&l>>>16]<<16|a[255&l>>>8]<<8|a[255&l],l^=m[0|f/n]<<24),s[f]=s[f-n]^l}for(var d=this._invKeySchedule=[],u=0,f;u<o;u++){if(f=o-u,u%4)var l=s[f];else var l=s[f-4];d[u]=4>u||4>=f?l:c[a[l>>>24]]^p[a[255&l>>>16]]^_[a[255&l>>>8]]^g[a[255&l]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,f,l,u,a)},decryptBlock:function(e,r){var n=e[r+1];e[r+1]=e[r+3],e[r+3]=n,this._doCryptBlock(e,r,this._invKeySchedule,c,p,_,g,o);var n=e[r+1];e[r+1]=e[r+3],e[r+3]=n},_doCryptBlock:function(e,t,r,n,i,a,o,s){for(var f=this._nRounds,l=e[t]^r[0],d=e[t+1]^r[1],u=e[t+2]^r[2],c=e[t+3]^r[3],p=4,_=1;_<f;_++){var g=n[l>>>24]^i[255&d>>>16]^a[255&u>>>8]^o[255&c]^r[p++],m=n[d>>>24]^i[255&u>>>16]^a[255&c>>>8]^o[255&l]^r[p++],b=n[u>>>24]^i[255&c>>>16]^a[255&l>>>8]^o[255&d]^r[p++],h=n[c>>>24]^i[255&l>>>16]^a[255&d>>>8]^o[255&u]^r[p++];l=g,d=m,u=b,c=h}var g=(s[l>>>24]<<24|s[255&d>>>16]<<16|s[255&u>>>8]<<8|s[255&c])^r[p++],m=(s[d>>>24]<<24|s[255&u>>>16]<<16|s[255&c>>>8]<<8|s[255&l])^r[p++],b=(s[u>>>24]<<24|s[255&c>>>16]<<16|s[255&l>>>8]<<8|s[255&d])^r[p++],h=(s[c>>>24]<<24|s[255&l>>>16]<<16|s[255&d>>>8]<<8|s[255&u])^r[p++];e[t]=g,e[t+1]=m,e[t+2]=b,e[t+3]=h},keySize:8});t.AES=n._createHelper(b)}(),e.AES})},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":60}],54:[function(e,t,r){(function(n,i){"object"==typeof r?t.exports=r=i(e("./core"),e("./evpkdf")):"function"==typeof c&&c.amd?c(["./core","./evpkdf"],i):i(n.CryptoJS)})(this,function(e){e.lib.Cipher||function(){var t=e,r=t.lib,n=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=t.enc,f=s.Utf8,l=s.Base64,d=t.algo,u=d.EvpKDF,c=r.Cipher=o.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?I:x}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),p=r.StreamCipher=c.extend({_doFinalize:function(){var e=this._process(!0);return e},blockSize:1}),_=t.mode={},g=r.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=_.CBC=function(){function e(e,t,r){var n=this._iv;if(n){var a=n;this._iv=void 0}else var a=this._prevBlock;for(var o=0;o<r;o++)e[t+o]^=a[o]}var t=g.extend();return t.Encryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize;e.call(this,t,r,i),n.encryptBlock(t,r),this._prevBlock=t.slice(r,r+i)}}),t.Decryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize,a=t.slice(r,r+i);n.decryptBlock(t,r),e.call(this,t,r,i),this._prevBlock=a}}),t}(),b=t.pad={},h=b.Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,o=[],s=0;s<n;s+=4)o.push(n<<24|n<<16|n<<8|n);var f=a.create(o,n);e.concat(f)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},y=r.BlockCipher=c.extend({cfg:c.cfg.extend({mode:m,padding:h}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),w=r.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),v=t.format={},B=v.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(l)},parse:function(e){var t=l.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return w.create({ciphertext:t,salt:n})}},x=r.SerializableCipher=n.extend({cfg:n.extend({format:B}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return w.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=e.createDecryptor(r,n).finalize(t.ciphertext);return i},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),k=t.kdf={},S=k.OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,w.create({key:i,iv:o,salt:n})}},I=r.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=x.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=i.iv;var a=x.decrypt.call(this,e,t,i.key,n);return a}})}()})},{"./core":55,"./evpkdf":58}],55:[function(e,t,n){(function(e,r){"object"==typeof n?t.exports=n=r():"function"==typeof c&&c.amd?c([],r):e.CryptoJS=r()})(this,function(){var e=e||function(e){var t=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base=function(){return{extend:function(e){var r=t(this);return e&&r.mixIn(e),r.hasOwnProperty("init")&&this.init!==r.init||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null==t?4*e.length:t},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,a=e.sigBytes;if(this.clamp(),n%4)for(var o=0,s;o<a;o++)s=255&r[o>>>2]>>>24-8*(o%4),t[n+o>>>2]|=s<<24-8*((n+o)%4);else for(var o=0;o<a;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=a,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-8*(t%4),e.length=f(t/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],a=function(t){var t=t,r=987654321,n=4294967295;return function(){r=36969*(65535&r)+(r>>16)&n,t=18e3*(65535&t)+(t>>16)&n;var i=(r<<16)+t&n;return i/=4294967296,i+=.5,i*(.5<e.random()?1:-1)}},r=0,o,f;r<t;r+=4)f=a(4294967296*(o||e.random())),o=987654071*f(),n.push(0|4294967296*f());return new s.init(n,t)}}),d=n.enc={},u=d.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0,o;a<r;a++)o=255&t[a>>>2]>>>24-8*(a%4),n.push((o>>>4).toString(16)),n.push((15&o).toString(16));return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-4*(n%8);return new s.init(r,t/2)}},c=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,a=[],o=0,s;o<n;o++)s=255&t[o>>>2]>>>24-8*(o%4),a.push(r(s));return a.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-8*(n%4);return new s.init(r,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},_=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,n=t.sigBytes,i=this.blockSize,a=n/(4*i);a=e?f(a):l((0|a)-this._minBufferSize,0);var d=a*i,u=o(4*d,n);if(d){for(var c=0;c<d;c+=i)this._doProcessBlock(r,c);var p=r.splice(0,d);t.sigBytes-=u}return new s.init(p,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=i.Hasher=_.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){_.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new m.HMAC.init(e,r).finalize(t)}}}),m=n.algo={};return n}(Math);return e})},{}],56:[function(e,t,r){(function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof c&&c.amd?c(["./core"],i):i(n.CryptoJS)})(this,function(e){return function(){function t(e,t,r){for(var n=[],o=0,s=0;s<t;s++)if(s%4){var f=r[e.charCodeAt(s-1)]<<2*(s%4),l=r[e.charCodeAt(s)]>>>6-2*(s%4);n[o>>>2]|=(f|l)<<24-8*(o%4),o++}return a.create(n,o)}var r=e,n=r.lib,a=n.WordArray,o=r.enc,s=o.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var a=[],o=0;o<r;o+=3)for(var s=255&t[o>>>2]>>>24-8*(o%4),f=255&t[o+1>>>2]>>>24-8*((o+1)%4),l=255&t[o+2>>>2]>>>24-8*((o+2)%4),d=0;4>d&&o+.75*d<r;d++)a.push(n.charAt(63&(s<<16|f<<8|l)>>>6*(3-d)));var u=n.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(r=s)}return t(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64})},{"./core":55}],57:[function(e,t,r){(function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof c&&c.amd?c(["./core"],i):i(n.CryptoJS)})(this,function(e){return e.enc.Hex})},{"./core":55}],58:[function(e,t,r){(function(n,i){"object"==typeof r?t.exports=r=i(e("./core"),e("./sha1"),e("./hmac")):"function"==typeof c&&c.amd?c(["./core","./sha1","./hmac"],i):i(n.CryptoJS)})(this,function(e){return function(){var t=e,r=t.lib,n=r.Base,a=r.WordArray,o=t.algo,s=o.MD5,f=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),o=a.create(),s=o.words,f=r.keySize,l=r.iterations;s.length<f;){d&&n.update(d);var d=n.update(e).finalize(t);n.reset();for(var u=1;u<l;u++)d=n.finalize(d),n.reset();o.concat(d)}return o.sigBytes=4*f,o}});t.EvpKDF=function(e,t,r){return f.create(r).compute(e,t)}}(),e.EvpKDF})},{"./core":55,"./hmac":59,"./sha1":61}],59:[function(e,t,r){(function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof c&&c.amd?c(["./core"],i):i(n.CryptoJS)})(this,function(e){(function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo,s=o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),f=o.words,l=s.words,d=0;d<r;d++)f[d]^=1549556828,l[d]^=909522486;o.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);t.reset();var n=t.finalize(this._oKey.clone().concat(r));return n}})})()})},{"./core":55}],60:[function(e,r,n){(function(t,i){"object"==typeof n?r.exports=n=i(e("./core")):"function"==typeof c&&c.amd?c(["./core"],i):i(t.CryptoJS)})(this,function(e){return function(){function r(e,r,i,a,o,f,s){var t=e+(r&i|~r&a)+o+s;return(t<<f|t>>>32-f)+r}function n(e,r,i,a,o,f,s){var t=e+(r&a|i&~a)+o+s;return(t<<f|t>>>32-f)+r}function o(e,r,i,a,o,f,s){var t=e+(r^i^a)+o+s;return(t<<f|t>>>32-f)+r}function f(e,r,i,a,o,f,s){var t=e+(i^(r|~a))+o+s;return(t<<f|t>>>32-f)+r}var i=e,a=i.lib,l=a.WordArray,d=a.Hasher,u=i.algo,p=[];(function(){for(var e=(0,eval)("this").Math.sin,r=0;64>r;r++)p[r]=0|4294967296*t(e(r+1))})();var c=u.MD5=d.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var s=0;16>s;s++){var l=t+s,u=e[l];e[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var _=this._hash.words,g=e[t+0],m=e[t+1],h=e[t+2],y=e[t+3],w=e[t+4],v=e[t+5],B=e[t+6],x=e[t+7],k=e[t+8],S=e[t+9],I=e[t+10],T=e[t+11],E=e[t+12],L=e[t+13],j=e[t+14],A=e[t+15],O=_[0],C=_[1],q=_[2],U=_[3];O=r(O,C,q,U,g,7,p[0]),U=r(U,O,C,q,m,12,p[1]),q=r(q,U,O,C,h,17,p[2]),C=r(C,q,U,O,y,22,p[3]),O=r(O,C,q,U,w,7,p[4]),U=r(U,O,C,q,v,12,p[5]),q=r(q,U,O,C,B,17,p[6]),C=r(C,q,U,O,x,22,p[7]),O=r(O,C,q,U,k,7,p[8]),U=r(U,O,C,q,S,12,p[9]),q=r(q,U,O,C,I,17,p[10]),C=r(C,q,U,O,T,22,p[11]),O=r(O,C,q,U,E,7,p[12]),U=r(U,O,C,q,L,12,p[13]),q=r(q,U,O,C,j,17,p[14]),C=r(C,q,U,O,A,22,p[15]),O=n(O,C,q,U,m,5,p[16]),U=n(U,O,C,q,B,9,p[17]),q=n(q,U,O,C,T,14,p[18]),C=n(C,q,U,O,g,20,p[19]),O=n(O,C,q,U,v,5,p[20]),U=n(U,O,C,q,I,9,p[21]),q=n(q,U,O,C,A,14,p[22]),C=n(C,q,U,O,w,20,p[23]),O=n(O,C,q,U,S,5,p[24]),U=n(U,O,C,q,j,9,p[25]),q=n(q,U,O,C,y,14,p[26]),C=n(C,q,U,O,k,20,p[27]),O=n(O,C,q,U,L,5,p[28]),U=n(U,O,C,q,h,9,p[29]),q=n(q,U,O,C,x,14,p[30]),C=n(C,q,U,O,E,20,p[31]),O=o(O,C,q,U,v,4,p[32]),U=o(U,O,C,q,k,11,p[33]),q=o(q,U,O,C,T,16,p[34]),C=o(C,q,U,O,j,23,p[35]),O=o(O,C,q,U,m,4,p[36]),U=o(U,O,C,q,w,11,p[37]),q=o(q,U,O,C,x,16,p[38]),C=o(C,q,U,O,I,23,p[39]),O=o(O,C,q,U,L,4,p[40]),U=o(U,O,C,q,g,11,p[41]),q=o(q,U,O,C,y,16,p[42]),C=o(C,q,U,O,B,23,p[43]),O=o(O,C,q,U,S,4,p[44]),U=o(U,O,C,q,E,11,p[45]),q=o(q,U,O,C,A,16,p[46]),C=o(C,q,U,O,h,23,p[47]),O=f(O,C,q,U,g,6,p[48]),U=f(U,O,C,q,x,10,p[49]),q=f(q,U,O,C,j,15,p[50]),C=f(C,q,U,O,v,21,p[51]),O=f(O,C,q,U,E,6,p[52]),U=f(U,O,C,q,y,10,p[53]),q=f(q,U,O,C,I,15,p[54]),C=f(C,q,U,O,m,21,p[55]),O=f(O,C,q,U,k,6,p[56]),U=f(U,O,C,q,A,10,p[57]),q=f(q,U,O,C,B,15,p[58]),C=f(C,q,U,O,L,21,p[59]),O=f(O,C,q,U,w,6,p[60]),U=f(U,O,C,q,T,10,p[61]),q=f(q,U,O,C,h,15,p[62]),C=f(C,q,U,O,S,21,p[63]),_[0]=0|_[0]+O,_[1]=0|_[1]+C,_[2]=0|_[2]+q,_[3]=0|_[3]+U},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32;var a=s(r/4294967296),o=r;t[(n+64>>>9<<4)+15]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t[(n+64>>>9<<4)+14]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(t.length+1),this._process();for(var f=this._hash,l=f.words,d=0,u;4>d;d++)u=l[d],l[d]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8);return f},clone:function(){var e=d.clone.call(this);return e._hash=this._hash.clone(),e}});i.MD5=d._createHelper(c),i.HmacMD5=d._createHmacHelper(c)}(Math),e.MD5})},{"./core":55}],61:[function(e,t,r){(function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof c&&c.amd?c(["./core"],i):i(n.CryptoJS)})(this,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,a=t.algo,o=[],f=a.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(r,s){for(var f=this._hash.words,l=f[0],u=f[1],p=f[2],_=f[3],g=f[4],m=0;80>m;m++){if(16>m)o[m]=0|r[s+m];else{var h=o[m-3]^o[m-8]^o[m-14]^o[m-16];o[m]=h<<1|h>>>31}var n=(l<<5|l>>>27)+g+o[m];n+=20>m?(u&p|~u&_)+1518500249:40>m?(u^p^_)+1859775393:60>m?(u&p|u&_|p&_)-1894007588:(u^p^_)-899497514,g=_,_=p,p=u<<30|u>>>2,u=l,l=n}f[0]=0|f[0]+l,f[1]=0|f[1]+u,f[2]=0|f[2]+p,f[3]=0|f[3]+_,f[4]=0|f[4]+g},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[(n+64>>>9<<4)+14]=s(r/4294967296),t[(n+64>>>9<<4)+15]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(f),t.HmacSHA1=i._createHmacHelper(f)}(),e.SHA1})},{"./core":55}],62:[function(e,t){function r(e){return null===e||e===void 0}function n(e){return!!(e&&"object"==typeof e&&"number"==typeof e.length)&&"function"==typeof e.copy&&"function"==typeof e.slice&&!(0<e.length&&"number"!=typeof e[0])}function i(e,t,d){var u,c;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(f(e))return!!f(t)&&(e=o.call(e),t=o.call(t),l(e,t,d));if(n(e)){if(!n(t))return!1;if(e.length!==t.length)return!1;for(u=0;u<e.length;u++)if(e[u]!==t[u])return!1;return!0}try{var p=s(e),_=s(t)}catch(t){return!1}if(p.length!=_.length)return!1;for(p.sort(),_.sort(),u=p.length-1;0<=u;u--)if(p[u]!=_[u])return!1;for(u=p.length-1;0<=u;u--)if(c=p[u],!l(e[c],t[c],d))return!1;return typeof e==typeof t}var o=Array.prototype.slice,s=e("./lib/keys.js"),f=e("./lib/is_arguments.js"),l=t.exports=function(e,t,r){return r||(r={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e&&t&&("object"==typeof e||"object"==typeof t)?i(e,t,r):r.strict?e===t:e==t)}},{"./lib/is_arguments.js":63,"./lib/keys.js":64}],63:[function(e,t,r){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function i(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();r=t.exports=a?n:i,r.supported=n;r.unsupported=i},{}],64:[function(e,t,r){function n(e){var t=[];for(var r in e)t.push(r);return t}r=t.exports="function"==typeof Object.keys?Object.keys:n,r.shim=n},{}],65:[function(e,t){function r(e,t,r,a,f,l,n){this.p=e,this.a=t,this.b=r,this.G=o.fromAffine(this,a,f),this.n=l,this.h=n,this.infinity=new o(this,null,null,i.ZERO),this.pOverFour=e.add(i.ONE).shiftRight(2),this.pLength=s((this.p.bitLength()+7)/8)}var n=e("assert"),i=e("bigi"),o=e("./point");r.prototype.pointFromX=function(e,t){var r=t.pow(3).add(this.a.multiply(t)).add(this.b).mod(this.p),n=r.modPow(this.pOverFour,this.p),i=n;return n.isEven()^!e&&(i=this.p.subtract(i)),o.fromAffine(this,t,i)},r.prototype.isInfinity=function(e){return!(e!==this.infinity)||0===e.z.signum()&&0!==e.y.signum()},r.prototype.isOnCurve=function(e){if(this.isInfinity(e))return!0;var t=e.affineX,r=e.affineY,n=this.a,i=this.b,a=this.p;if(0>t.signum()||0<=t.compareTo(a))return!1;if(0>r.signum()||0<=r.compareTo(a))return!1;var o=r.square().mod(a),s=t.pow(3).add(n.multiply(t)).add(i).mod(a);return o.equals(s)},r.prototype.validate=function(e){n(!this.isInfinity(e),"Point is at infinity"),n(this.isOnCurve(e),"Point is not on the curve");var t=e.multiply(this.n);return n(this.isInfinity(t),"Point is not a scalar multiple of G"),!0},t.exports=r},{"./point":69,assert:40,bigi:31}],66:[function(e,t){t.exports={secp128r1:{p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1:{p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1:{p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1:{p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1:{p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1:{p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1:{p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"}}},{}],67:[function(e,t){var r=e("./point"),n=e("./curve"),i=e("./names");t.exports={Curve:n,Point:r,getCurveByName:i}},{"./curve":65,"./names":68,"./point":69}],68:[function(e,t){var r=e("bigi"),i=e("./curves.json"),o=e("./curve");t.exports=function(e){var t=i[e];if(!t)return null;var s=new r(t.p,16),f=new r(t.a,16),a=new r(t.b,16),l=new r(t.n,16),n=new r(t.h,16),d=new r(t.Gx,16),u=new r(t.Gy,16);return new o(s,f,a,d,u,l,n)}},{"./curve":65,"./curves.json":66,bigi:31}],69:[function(e,t){function r(e,t,r,i){n.notStrictEqual(i,void 0,"Missing Z coordinate"),this.curve=e,this.x=t,this.y=r,this.z=i,this._zInv=null,this.compressed=!0}var n=e("assert"),i=e("safe-buffer").Buffer,a=e("bigi"),o=a.valueOf(3);Object.defineProperty(r.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(r.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(r.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),r.fromAffine=function(e,t,n){return new r(e,t,n,a.ONE)},r.prototype.equals=function(e){if(e===this)return!0;if(this.curve.isInfinity(this))return this.curve.isInfinity(e);if(this.curve.isInfinity(e))return this.curve.isInfinity(this);var t=e.y.multiply(this.z).subtract(this.y.multiply(e.z)).mod(this.curve.p);if(0!==t.signum())return!1;var r=e.x.multiply(this.z).subtract(this.x.multiply(e.z)).mod(this.curve.p);return 0===r.signum()},r.prototype.negate=function(){var e=this.curve.p.subtract(this.y);return new r(this.curve,this.x,e,this.z)},r.prototype.add=function(e){if(this.curve.isInfinity(this))return e;if(this.curve.isInfinity(e))return this;var t=this.x,n=this.y,i=e.x,a=e.y,s=a.multiply(this.z).subtract(n.multiply(e.z)).mod(this.curve.p),f=i.multiply(this.z).subtract(t.multiply(e.z)).mod(this.curve.p);if(0===f.signum())return 0===s.signum()?this.twice():this.curve.infinity;var l=f.square(),d=l.multiply(f),u=t.multiply(l),c=s.square().multiply(this.z),p=c.subtract(u.shiftLeft(1)).multiply(e.z).subtract(d).multiply(f).mod(this.curve.p),_=u.multiply(o).multiply(s).subtract(n.multiply(d)).subtract(c.multiply(s)).multiply(e.z).add(s.multiply(d)).mod(this.curve.p),g=d.multiply(this.z).multiply(e.z).mod(this.curve.p);return new r(this.curve,p,_,g)},r.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(0===this.y.signum())return this.curve.infinity;var e=this.x,t=this.y,n=t.multiply(this.z).mod(this.curve.p),i=n.multiply(t).mod(this.curve.p),s=this.curve.a,a=e.square().multiply(o);0!==s.signum()&&(a=a.add(this.z.square().multiply(s))),a=a.mod(this.curve.p);var f=a.square().subtract(e.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(n).mod(this.curve.p),l=a.multiply(o).multiply(e).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(a.pow(3)).mod(this.curve.p),d=n.pow(3).shiftLeft(3).mod(this.curve.p);return new r(this.curve,f,l,d)},r.prototype.multiply=function(t){if(this.curve.isInfinity(this))return this;if(0===t.signum())return this.curve.infinity;for(var r=t,e=r.multiply(o),n=this.negate(),a=this,s=e.bitLength()-2;0<s;--s){var f=e.testBit(s),l=r.testBit(s);a=a.twice(),f!==l&&(a=a.add(f?this:n))}return a},r.prototype.multiplyTwo=function(e,t,r){for(var n=l(e.bitLength(),r.bitLength())-1,a=this.curve.infinity,o=this.add(t);0<=n;){var s=e.testBit(n),f=r.testBit(n);a=a.twice(),s?f?a=a.add(o):a=a.add(this):f&&(a=a.add(t)),--n}return a},r.prototype.getEncoded=function(e){if(null==e&&(e=this.compressed),this.curve.isInfinity(this))return i.alloc(1,0);var t=this.affineX,r=this.affineY,n=this.curve.pLength,a;return e?(a=i.allocUnsafe(1+n),a.writeUInt8(r.isEven()?2:3,0)):(a=i.allocUnsafe(1+n+n),a.writeUInt8(4,0),r.toBuffer(n).copy(a,1+n)),t.toBuffer(n).copy(a,1),a},r.decodeFrom=function(e,t){var i=t.readUInt8(0),o=4!==i,f=s((e.p.bitLength()+7)/8),l=a.fromBuffer(t.slice(1,1+f)),d;if(o){n.equal(t.length,f+1,"Invalid sequence length"),n(2===i||3===i,"Invalid sequence tag");d=e.pointFromX(3===i,l)}else{n.equal(t.length,1+f+f,"Invalid sequence length");var u=a.fromBuffer(t.slice(1+f));d=r.fromAffine(e,l,u)}return d.compressed=o,d},r.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"},t.exports=r},{assert:40,bigi:31,"safe-buffer":97}],70:[function(e,t){function r(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=y(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}function n(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function a(e,t,r){if(t)e.call(r);else for(var n=e.length,a=b(e,n),o=0;o<n;++o)a[o].call(r)}function s(e,t,r,n){if(t)e.call(r,n);else for(var a=e.length,o=b(e,a),s=0;s<a;++s)o[s].call(r,n)}function f(e,t,r,n,a){if(t)e.call(r,n,a);else for(var o=e.length,s=b(e,o),f=0;f<o;++f)s[f].call(r,n,a)}function l(e,t,r,n,a,o){if(t)e.call(r,n,a,o);else for(var s=e.length,f=b(e,s),l=0;l<s;++l)f[l].call(r,n,a,o)}function d(e,t,r,n){if(t)e.apply(r,n);else for(var a=e.length,o=b(e,a),s=0;s<a;++s)o[s].apply(r,n)}function u(e,t,r,i){var a,o,s;if("function"!=typeof r)throw new TypeError("\"listener\" argument must be a function");if(o=e._events,o?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]):(o=e._events=y(null),e._eventsCount=0),!s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),!s.warned&&(a=n(e),a&&0<a&&s.length>a)){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" \""+(t+"\" listeners added. Use emitter.setMaxListeners() to increase limit."));f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",f.name,f.message)}return e}function c(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e);}}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=v.call(c,n);return i.listener=r,n.wrapFn=i,i}function _(e,t,r){var n=e._events;if(!n)return[];var i=n[t];return i?"function"==typeof i?r?[i.listener||i]:[i]:r?h(i):b(i,i.length):[]}function g(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function m(e,t){for(var r=t,a=r+1,o=e.length;a<o;r+=1,a+=1)e[r]=e[a];e.pop()}function b(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function h(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}var y=Object.create||function(e){var t=function(){};return t.prototype=e,new t},w=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},v=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0;var B=10,x;try{var k={};Object.defineProperty&&Object.defineProperty(k,"x",{value:0}),x=0===k.x}catch(e){x=!1}x?Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(e){if("number"!=typeof e||0>e||e!==e)throw new TypeError("\"defaultMaxListeners\" must be a positive number");B=e}}):r.defaultMaxListeners=B,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||isNaN(e))throw new TypeError("\"n\" argument must be a positive number");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return n(this)},r.prototype.emit=function(e){var t="error"===e,r,n,o,u,c,p;if(p=this._events,p)t=t&&null==p.error;else if(!t)return!1;if(t){if(1<arguments.length&&(r=arguments[1]),r instanceof Error)throw r;else{var _=new Error("Unhandled \"error\" event. ("+r+")");throw _.context=r,_}return!1}if(n=p[e],!n)return!1;var g="function"==typeof n;switch(o=arguments.length,o){case 1:a(n,g,this);break;case 2:s(n,g,this,arguments[1]);break;case 3:f(n,g,this,arguments[1],arguments[2]);break;case 4:l(n,g,this,arguments[1],arguments[2],arguments[3]);break;default:for(u=Array(o-1),c=1;c<o;c++)u[c-1]=arguments[c];d(n,g,this,u);}return!0},r.prototype.addListener=function(e,t){return u(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return u(this,e,t,!0)},r.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError("\"listener\" argument must be a function");return this.on(e,p(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError("\"listener\" argument must be a function");return this.prependListener(e,p(this,e,t)),this},r.prototype.removeListener=function(e,t){var r,n,a,o,s;if("function"!=typeof t)throw new TypeError("\"listener\" argument must be a function");if(n=this._events,!n)return this;if(r=n[e],!r)return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=y(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,o=r.length-1;0<=o;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,a=o;break}if(0>a)return this;0===a?r.shift():m(r,a),1===r.length&&(n[e]=r[0]),n.removeListener&&this.emit("removeListener",e,s||t)}return this},r.prototype.removeAllListeners=function(e){var t,r,n;if(r=this._events,!r)return this;if(!r.removeListener)return 0===arguments.length?(this._events=y(null),this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=y(null):delete r[e]),this;if(0===arguments.length){var a=w(r),o;for(n=0;n<a.length;++n)o=a[n],"removeListener"===o||this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=y(null),this._eventsCount=0,this}if(t=r[e],"function"==typeof t)this.removeListener(e,t);else if(t)for(n=t.length-1;0<=n;n--)this.removeListener(e,t[n]);return this},r.prototype.listeners=function(e){return _(this,e,!0)},r.prototype.rawListeners=function(e){return _(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},r.prototype.listenerCount=g,r.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]}},{}],71:[function(e,t){(function(r){'use strict';function n(e){i.call(this),this._block=new r(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var i=e("stream").Transform,a=e("inherits");a(n,i),n.prototype._transform=function(e,t,n){var i=null;try{"buffer"!==t&&(e=new r(e,t)),this.update(e)}catch(e){i=e}n(i)},n.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,t){if(!r.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=new r(e,t||"binary"));for(var n=this._block,a=0;this._blockOffset+e.length-a>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)n[o++]=e[a++];this._update(),this._blockOffset=0}for(;a<e.length;)n[this._blockOffset++]=e[a++];for(var s=0,f=8*e.length;0<f;++s)this._length[s]+=f,f=0|this._length[s]/4294967296,0<f&&(this._length[s]-=4294967296*f);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=n}).call(this,e("buffer").Buffer)},{buffer:45,inherits:73,stream:107}],72:[function(e,r,i){i.read=function(t,r,n,a,o){var f=8*o-a-1,l=(1<<f)-1,c=l>>1,p=-7,_=n?o-1:0,g=n?-1:1,d=t[r+_],b,h;for(_+=g,b=d&(1<<-p)-1,d>>=-p,p+=f;0<p;b=256*b+t[r+_],_+=g,p-=8);for(h=b&(1<<-p)-1,b>>=-p,p+=a;0<p;h=256*h+t[r+_],_+=g,p-=8);if(0===b)b=1-c;else{if(b===l)return h?NaN:(d?-1:1)*(1/0);h+=u(2,a),b-=c}return(d?-1:1)*h*u(2,b-a)},i.write=function(r,o,f,l,p,_){var g=8*_-p-1,b=(1<<g)-1,h=b>>1,y=23===p?u(2,-24)-u(2,-77):0,w=l?0:_-1,v=l?1:-1,d=0>o||0===o&&0>1/o?1:0,B,x,k;for(o=t(o),isNaN(o)||o===1/0?(x=isNaN(o)?1:0,B=b):(B=s(n(o)/a),1>o*(k=u(2,-B))&&(B--,k*=2),o+=1<=B+h?y/k:y*u(2,1-h),2<=o*k&&(B++,k/=2),B+h>=b?(x=0,B=b):1<=B+h?(x=(o*k-1)*u(2,p),B+=h):(x=o*u(2,h-1)*u(2,p),B=0));8<=p;r[f+w]=255&x,w+=v,x/=256,p-=8);for(B=B<<p|x,g+=p;0<g;r[f+w]=255&B,w+=v,B/=256,g-=8);r[f+w-v]|=128*d}},{}],73:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],74:[function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function n(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/t.exports=function(e){return null!=e&&(r(e)||n(e)||!!e._isBuffer)}},{}],75:[function(e,t){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],76:[function(e,t){(function(e){var r=null;"undefined"==typeof WebSocket?"undefined"==typeof MozWebSocket?"undefined"==typeof e?"undefined"==typeof window?"undefined"!=typeof self&&(r=self.WebSocket||self.MozWebSocket):r=window.WebSocket||window.MozWebSocket:r=e.WebSocket||e.MozWebSocket:r=MozWebSocket:r=WebSocket,t.exports=r}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],77:[function(e,t){/**
* @license long.js (c) 2013 Daniel Wirtz <[email protected]>
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/long.js for details
*/(function(r,n){"function"==typeof c&&c.amd?c([],n):"function"==typeof e&&"object"==typeof t&&t&&t.exports?t.exports=n():(r.dcodeIO=r.dcodeIO||{}).Long=n()})(this,function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}function r(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&256>e)&&(n=b[e],n))?n:(r=c(e,0>(0|e)?-1:0,!0),i&&(b[e]=r),r):(e|=0,(i=-128<=e&&128>e)&&(n=m[e],n))?n:(r=c(e,0>e?-1:0,!1),i&&(m[e]=r),r)}function d(e,t){if(isNaN(e)||!isFinite(e))return t?k:x;if(t){if(0>e)return k;if(e>=w)return L}else{if(e<=-v)return j;if(e+1>=v)return E}return 0>e?d(-e,t).neg():c(0|e%y,0|e/y,t)}function c(t,r,n){return new e(t,r,n)}function _(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return x;if("number"==typeof t?(r=t,t=!1):t=!!t,r=r||10,2>r||36<r)throw RangeError("radix");var n;if(0<(n=e.indexOf("-")))throw Error("interior hyphen");else if(0===n)return _(e.substring(1),t,r).neg();for(var a=d(h(r,8)),s=x,f=0;f<e.length;f+=8){var l=o(8,e.length-f),u=parseInt(e.substring(f,f+l),r);if(8>l){var c=d(h(r,l));s=s.mul(c).add(d(u))}else s=s.mul(a),s=s.add(d(u))}return s.unsigned=t,s}function g(t){return t instanceof e?t:"number"==typeof t?d(t):"string"==typeof t?_(t):c(t.low,t.high,t.unsigned)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var m={},b={};e.fromInt=r,e.fromNumber=d,e.fromBits=c;var h=u;e.fromString=_,e.fromValue=g;var y=4294967296,w=y*y,v=w/2,B=r(16777216),x=r(0);e.ZERO=x;var k=r(0,!0);e.UZERO=k;var S=r(1);e.ONE=S;var I=r(1,!0);e.UONE=I;var T=r(-1);e.NEG_ONE=T;var E=c(-1,2147483647,!1);e.MAX_VALUE=E;var L=c(-1,-1,!0);e.MAX_UNSIGNED_VALUE=L;var j=c(0,-2147483648,!1);e.MIN_VALUE=j;var A=e.prototype;return A.toInt=function(){return this.unsigned?this.low>>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*y+(this.low>>>0):this.high*y+(this.low>>>0)},A.toString=function(e){if(e=e||10,2>e||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(j)){var t=d(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=d(h(e,6),this.unsigned),a=this,o="";;){var s=a.div(i),f=a.sub(s.mul(i)).toInt()>>>0,l=f.toString(e);if(a=s,a.isZero())return l+o;for(;6>l.length;)l="0"+l;o=""+l+o}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(j)?64:this.neg().getNumBitsAbs();for(var e=0==this.high?this.low:this.high,t=31;0<t&&0==(e&1<<t);t--);return 0==this.high?t+1:t+33},A.isZero=function(){return 0===this.high&&0===this.low},A.isNegative=function(){return!this.unsigned&&0>this.high},A.isPositive=function(){return this.unsigned||0<=this.high},A.isOdd=function(){return 1==(1&this.low)},A.isEven=function(){return 0==(1&this.low)},A.equals=function(e){return t(e)||(e=g(e)),(this.unsigned===e.unsigned||1!=this.high>>>31||1!=e.high>>>31)&&this.high===e.high&&this.low===e.low},A.eq=A.equals,A.notEquals=function(e){return!this.eq(e)},A.neq=A.notEquals,A.lessThan=function(e){return 0>this.comp(e)},A.lt=A.lessThan,A.lessThanOrEqual=function(e){return 0>=this.comp(e)},A.lte=A.lessThanOrEqual,A.greaterThan=function(e){return 0<this.comp(e)},A.gt=A.greaterThan,A.greaterThanOrEqual=function(e){return 0<=this.comp(e)},A.gte=A.greaterThanOrEqual,A.compare=function(e){if(t(e)||(e=g(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(j)?j:this.not().add(S)},A.neg=A.negate,A.add=function(e){t(e)||(e=g(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,f=e.low>>>16,l=65535&e.low,d=0,u=0,p=0,_=0;return _+=a+l,p+=_>>>16,_&=65535,p+=i+f,u+=p>>>16,p&=65535,u+=n+s,d+=u>>>16,u&=65535,d+=r+o,d&=65535,c(p<<16|_,d<<16|u,this.unsigned)},A.subtract=function(e){return t(e)||(e=g(e)),this.add(e.neg())},A.sub=A.subtract,A.multiply=function(e){if(this.isZero())return x;if(t(e)||(e=g(e)),e.isZero())return x;if(this.eq(j))return e.isOdd()?j:x;if(e.eq(j))return this.isOdd()?j:x;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(B)&&e.lt(B))return d(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,f=e.low>>>16,l=65535&e.low,u=0,p=0,_=0,m=0;return m+=a*l,_+=m>>>16,m&=65535,_+=i*l,p+=_>>>16,_&=65535,_+=a*f,p+=_>>>16,_&=65535,p+=n*l,u+=p>>>16,p&=65535,p+=i*f,u+=p>>>16,p&=65535,p+=a*s,u+=p>>>16,p&=65535,u+=r*l+n*f+i*s+a*o,u&=65535,c(_<<16|m,u<<16|p,this.unsigned)},A.mul=A.multiply,A.divide=function(e){if(t(e)||(e=g(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?k:x;var r,i,o;if(!this.unsigned){if(this.eq(j)){if(e.eq(S)||e.eq(T))return j;if(e.eq(j))return S;var u=this.shr(1);return r=u.div(e).shl(1),r.eq(x)?e.isNegative()?S:T:(i=this.sub(e.mul(r)),o=r.add(i.div(e)),o)}if(e.eq(j))return this.unsigned?k:x;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=x}else{if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return k;if(e.gt(this.shru(1)))return I;o=k}for(i=this;i.gte(e);){r=l(1,s(i.toNumber()/e.toNumber()));for(var c=f(n(r)/a),p=48>=c?1:h(2,c-48),_=d(r),m=_.mul(e);m.isNegative()||m.gt(i);)r-=p,_=d(r,this.unsigned),m=_.mul(e);_.isZero()&&(_=S),o=o.add(_),i=i.sub(m)}return o},A.div=A.divide,A.modulo=function(e){return t(e)||(e=g(e)),this.sub(this.div(e).mul(e))},A.mod=A.modulo,A.not=function(){return c(~this.low,~this.high,this.unsigned)},A.and=function(e){return t(e)||(e=g(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},A.or=function(e){return t(e)||(e=g(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},A.xor=function(e){return t(e)||(e=g(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},A.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:32>e?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},A.shl=A.shiftLeft,A.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:32>e?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,0<=this.high?0:-1,this.unsigned)},A.shr=A.shiftRight,A.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),e&=63,0===e)return this;var r=this.high;if(32>e){var n=this.low;return c(n>>>e|r<<32-e,r>>>e,this.unsigned)}return 32===e?c(r,0,this.unsigned):c(r>>>e-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},A.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},A.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},A.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e})},{}],78:[function(e,t){(function(r){'use strict';function n(){u.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function i(e,t){return e<<t|e>>>32-t}function o(e,t,r,n,a,o,f){return 0|i(0|e+(t&r|~t&n)+a+o,f)+t}function s(e,t,r,n,a,o,f){return 0|i(0|e+(t&n|r&~n)+a+o,f)+t}function f(e,t,r,n,a,o,f){return 0|i(0|e+(t^r^n)+a+o,f)+t}function l(e,t,r,n,a,o,f){return 0|i(0|e+(r^(t|~n))+a+o,f)+t}var d=e("inherits"),u=e("hash-base"),c=Array(16);d(n,u),n.prototype._update=function(){for(var e=c,t=0;16>t;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,u=this._c,p=this._d;r=o(r,n,u,p,e[0],3614090360,7),p=o(p,r,n,u,e[1],3905402710,12),u=o(u,p,r,n,e[2],606105819,17),n=o(n,u,p,r,e[3],3250441966,22),r=o(r,n,u,p,e[4],4118548399,7),p=o(p,r,n,u,e[5],1200080426,12),u=o(u,p,r,n,e[6],2821735955,17),n=o(n,u,p,r,e[7],4249261313,22),r=o(r,n,u,p,e[8],1770035416,7),p=o(p,r,n,u,e[9],2336552879,12),u=o(u,p,r,n,e[10],4294925233,17),n=o(n,u,p,r,e[11],2304563134,22),r=o(r,n,u,p,e[12],1804603682,7),p=o(p,r,n,u,e[13],4254626195,12),u=o(u,p,r,n,e[14],2792965006,17),n=o(n,u,p,r,e[15],1236535329,22),r=s(r,n,u,p,e[1],4129170786,5),p=s(p,r,n,u,e[6],3225465664,9),u=s(u,p,r,n,e[11],643717713,14),n=s(n,u,p,r,e[0],3921069994,20),r=s(r,n,u,p,e[5],3593408605,5),p=s(p,r,n,u,e[10],38016083,9),u=s(u,p,r,n,e[15],3634488961,14),n=s(n,u,p,r,e[4],3889429448,20),r=s(r,n,u,p,e[9],568446438,5),p=s(p,r,n,u,e[14],3275163606,9),u=s(u,p,r,n,e[3],4107603335,14),n=s(n,u,p,r,e[8],1163531501,20),r=s(r,n,u,p,e[13],2850285829,5),p=s(p,r,n,u,e[2],4243563512,9),u=s(u,p,r,n,e[7],1735328473,14),n=s(n,u,p,r,e[12],2368359562,20),r=f(r,n,u,p,e[5],4294588738,4),p=f(p,r,n,u,e[8],2272392833,11),u=f(u,p,r,n,e[11],1839030562,16),n=f(n,u,p,r,e[14],4259657740,23),r=f(r,n,u,p,e[1],2763975236,4),p=f(p,r,n,u,e[4],1272893353,11),u=f(u,p,r,n,e[7],4139469664,16),n=f(n,u,p,r,e[10],3200236656,23),r=f(r,n,u,p,e[13],681279174,4),p=f(p,r,n,u,e[0],3936430074,11),u=f(u,p,r,n,e[3],3572445317,16),n=f(n,u,p,r,e[6],76029189,23),r=f(r,n,u,p,e[9],3654602809,4),p=f(p,r,n,u,e[12],3873151461,11),u=f(u,p,r,n,e[15],530742520,16),n=f(n,u,p,r,e[2],3299628645,23),r=l(r,n,u,p,e[0],4096336452,6),p=l(p,r,n,u,e[7],1126891415,10),u=l(u,p,r,n,e[14],2878612391,15),n=l(n,u,p,r,e[5],4237533241,21),r=l(r,n,u,p,e[12],1700485571,6),p=l(p,r,n,u,e[3],2399980690,10),u=l(u,p,r,n,e[10],4293915773,15),n=l(n,u,p,r,e[1],2240044497,21),r=l(r,n,u,p,e[8],1873313359,6),p=l(p,r,n,u,e[15],4264355552,10),u=l(u,p,r,n,e[6],2734768916,15),n=l(n,u,p,r,e[13],1309151649,21),r=l(r,n,u,p,e[4],4149444226,6),p=l(p,r,n,u,e[11],3174756917,10),u=l(u,p,r,n,e[2],718787259,15),n=l(n,u,p,r,e[9],3951481745,21),this._a=0|this._a+r,this._b=0|this._b+n,this._c=0|this._c+u,this._d=0|this._d+p},n.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new r(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=n}).call(this,e("buffer").Buffer)},{buffer:45,"hash-base":79,inherits:73}],79:[function(e,t){'use strict';function r(e,t){if(!a.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}function n(e){o.call(this),this._block=a.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var a=e("safe-buffer").Buffer,o=e("stream").Transform,s=e("inherits");s(n,o),n.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},n.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,t){if(r(e,"Data"),this._finalized)throw new Error("Digest already called");a.isBuffer(e)||(e=a.from(e,t));for(var n=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)n[s++]=e[o++];this._update(),this._blockOffset=0}for(;o<e.length;)n[this._blockOffset++]=e[o++];for(var f=0,l=8*e.length;0<l;++f)this._length[f]+=l,l=0|this._length[f]/4294967296,0<l&&(this._length[f]-=4294967296*l);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;4>r;++r)this._length[r]=0;return t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=n},{inherits:73,"safe-buffer":97,stream:107}],80:[function(e,t){/*
object-assign
(c) Sindre Sorhus
@license MIT
*/'use strict';function n(e){if(null===e||e===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;10>n;n++)t["_"+r(n)]=n;var a=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==a.join(""))return!1;var o={};return["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"].forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e){for(var t=n(e),r=1,f,l;r<arguments.length;r++){for(var d in f=Object(arguments[r]),f)o.call(f,d)&&(t[d]=f[d]);if(a){l=a(f);for(var u=0;u<l.length;u++)s.call(f,l[u])&&(t[l[u]]=f[l[u]])}}return t}},{}],81:[function(e,t){(function(e){'use strict';t.exports=e.version&&0!==e.version.indexOf("v0.")&&(0!==e.version.indexOf("v1.")||0===e.version.indexOf("v1.8."))?e:{nextTick:function(t,r,n,a){if("function"!=typeof t)throw new TypeError("\"callback\" argument must be a function");var o=arguments.length,s,f;switch(o){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,a)});default:for(s=Array(o-1),f=0;f<s.length;)s[f++]=arguments[f];return e.nextTick(function(){t.apply(null,s)});}}}}).call(this,e("_process"))},{_process:82}],82:[function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function a(t){if(c===setTimeout)return setTimeout(t,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(r){try{return c.call(null,t,0)}catch(r){return c.call(this,t,0)}}}function o(t){if(p===clearTimeout)return clearTimeout(t);if((p===n||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(r){try{return p.call(null,t)}catch(r){return p.call(this,t)}}}function s(){g&&b&&(g=!1,b.length?_=b.concat(_):m=-1,_.length&&f())}function f(){if(!g){var e=a(s);g=!0;for(var t=_.length;t;){for(b=_,_=[];++m<t;)b&&b[m].run();m=-1,t=_.length}b=null,g=!1,o(e)}}function l(e,t){this.fun=e,this.array=t}function d(){}var u=t.exports={},c,p;(function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(t){c=r}try{p="function"==typeof clearTimeout?clearTimeout:n}catch(t){p=n}})();var _=[],g=!1,m=-1,b;u.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];_.push(new l(e,t)),1!==_.length||g||a(f)},l.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=d,u.addListener=d,u.once=d,u.off=d,u.removeListener=d,u.removeAllListeners=d,u.emit=d,u.prependListener=d,u.prependOnceListener=d,u.listeners=function(){return[]},u.binding=function(){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],83:[function(e,t){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":84}],84:[function(e,t){'use strict';function r(e){return this instanceof r?void(f.call(this,e),l.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",n)):new r(e)}function n(){this.allowHalfOpen||this._writableState.ended||a.nextTick(i,this)}function i(e){e.end()}var a=e("process-nextick-args"),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=r;var s=e("core-util-is");s.inherits=e("inherits");var f=e("./_stream_readable"),l=e("./_stream_writable");s.inherits(r,f);for(var d=o(l.prototype),u=0,c;u<d.length;u++)c=d[u],r.prototype[c]||(r.prototype[c]=l.prototype[c]);Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),r.prototype._destroy=function(e,t){this.push(null),this.end(),a.nextTick(t,e)}},{"./_stream_readable":86,"./_stream_writable":88,"core-util-is":48,inherits:73,"process-nextick-args":81}],85:[function(e,t){'use strict';function r(e){return this instanceof r?void n.call(this,e):new r(e)}t.exports=r;var n=e("./_stream_transform"),i=e("core-util-is");i.inherits=e("inherits"),i.inherits(r,n),r.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":87,"core-util-is":48,inherits:73}],86:[function(e,t){(function(r,n){'use strict';function i(e){return P.from(e)}function a(e){return P.isBuffer(e)||e instanceof R}function o(e,t,r){return"function"==typeof e.prependListener?e.prependListener(t,r):void(e._events&&e._events[t]?q(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r))}function f(t,r){U=U||e("./_stream_duplex"),t=t||{};var n=r instanceof U;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:o,this.highWaterMark=s(this.highWaterMark),this.buffer=new K,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(!W&&(W=e("string_decoder/").StringDecoder),this.decoder=new W(t.encoding),this.encoding=t.encoding)}function l(t){return U=U||e("./_stream_duplex"),this instanceof l?void(this._readableState=new f(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),z.call(this)):new l(t)}function d(e,t,r,n,a){var o=e._readableState;if(null===t)o.reading=!1,m(e,o);else{var s;a||(s=c(o,t)),s?e.emit("error",s):o.objectMode||t&&0<t.length?("string"!=typeof t&&!o.objectMode&&Object.getPrototypeOf(t)!==P.prototype&&(t=i(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):u(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?u(e,o,t,!1):y(e,o)):u(e,o,t,!1))):!n&&(o.reading=!1)}return p(o)}function u(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&b(e)),y(e,t)}function c(e,t){var r;return a(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function p(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function _(e){return 8388608<=e?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function g(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=_(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function m(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,b(e)}}function b(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(H("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?C.nextTick(h,e):h(e))}function h(e){H("emit readable"),e.emit("readable"),S(e)}function y(e,t){t.readingMore||(t.readingMore=!0,C.nextTick(w,e,t))}function w(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(H("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function v(e){return function(){var t=e._readableState;H("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&M(e,"data")&&(t.flowing=!0,S(e))}}function B(e){H("readable nexttick read 0"),e.read(0)}function x(e,t){t.resumeScheduled||(t.resumeScheduled=!0,C.nextTick(k,e,t))}function k(e,t){t.reading||(H("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),S(e),t.flowing&&!t.reading&&e.read(0)}function S(e){var t=e._readableState;for(H("flow",t.flowing);t.flowing&&null!==e.read(););}function I(e,t){if(0===t.length)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=T(e,t.buffer,t.decoder),r}function T(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=r?E(e,t):L(e,t),n}function E(e,t){var r=t.head,i=1,a=r.data;for(e-=a.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(a+=s===o.length?o:o.slice(0,e),e-=s,0===e){s===o.length?(++i,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,a}function L(e,t){var r=P.allocUnsafe(e),i=t.head,a=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),e-=s,0===e){s===o.length?(++a,t.head=i.next?i.next:t.tail=null):(t.head=i,i.data=o.slice(s));break}++a}return t.length-=a,r}function j(e){var t=e._readableState;if(0<t.length)throw new Error("\"endReadable()\" called on non-empty stream");t.endEmitted||(t.ended=!0,C.nextTick(A,t,e))}function A(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}var C=e("process-nextick-args");t.exports=l;var q=e("isarray"),U;l.ReadableState=f;var D=e("events").EventEmitter,M=function(e,t){return e.listeners(t).length},z=e("./internal/streams/stream"),P=e("safe-buffer").Buffer,R=n.Uint8Array||function(){},N=e("core-util-is");N.inherits=e("inherits");var F=e("util"),H=void 0;H=F&&F.debuglog?F.debuglog("stream"):function(){};var K=e("./internal/streams/BufferList"),V=e("./internal/streams/destroy"),W;N.inherits(l,z);var Z=["error","close","destroy","pause","resume"];Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),l.prototype.destroy=V.destroy,l.prototype._undestroy=V.undestroy,l.prototype._destroy=function(e,t){this.push(null),t(e)},l.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:"string"==typeof e&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=P.from(e,t),t=""),n=!0),d(this,e,t,!1,n)},l.prototype.unshift=function(e){return d(this,e,null,!0,!1)},l.prototype.isPaused=function(){return!1===this._readableState.flowing},l.prototype.setEncoding=function(t){return W||(W=e("string_decoder/").StringDecoder),this._readableState.decoder=new W(t),this._readableState.encoding=t,this};l.prototype.read=function(e){H("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return H("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):b(this),null;if(e=g(e,t),0===e&&t.ended)return 0===t.length&&j(this),null;var i=t.needReadable;H("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,H("length less than watermark",i)),t.ended||t.reading?(i=!1,H("reading or ended",i)):i&&(H("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,!t.reading&&(e=g(r,t)));var a;return a=0<e?I(e,t):null,null===a?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(!t.ended&&(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},l.prototype._read=function(){this.emit("error",new Error("_read() is not implemented"))},l.prototype.pipe=function(e,t){function n(e,t){H("onunpipe"),e===c&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,a())}function i(){H("onend"),e.end()}function a(){H("cleanup"),e.removeListener("close",l),e.removeListener("finish",d),e.removeListener("drain",m),e.removeListener("error",f),e.removeListener("unpipe",n),c.removeListener("end",i),c.removeListener("end",u),c.removeListener("data",s),b=!0,p.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&m()}function s(t){H("ondata"),h=!1;var r=e.write(t);!1!==r||h||((1===p.pipesCount&&p.pipes===e||1<p.pipesCount&&-1!==O(p.pipes,e))&&!b&&(H("false write response, pause",c._readableState.awaitDrain),c._readableState.awaitDrain++,h=!0),c.pause())}function f(t){H("onerror",t),u(),e.removeListener("error",f),0===M(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",d),u()}function d(){H("onfinish"),e.removeListener("close",l),u()}function u(){H("unpipe"),c.unpipe(e)}var c=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=e;break;case 1:p.pipes=[p.pipes,e];break;default:p.pipes.push(e);}p.pipesCount+=1,H("pipe count=%d opts=%j",p.pipesCount,t);var _=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,g=_?i:u;p.endEmitted?C.nextTick(g):c.once("end",g),e.on("unpipe",n);var m=v(c);e.on("drain",m);var b=!1,h=!1;return c.on("data",s),o(e,"error",f),e.once("close",l),e.once("finish",d),e.emit("pipe",c),p.flowing||(H("pipe resume"),c.resume()),e},l.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<a;o++)n[o].emit("unpipe",this,r);return this}var s=O(t.pipes,e);return-1===s?this:(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},l.prototype.on=function(e,t){var r=z.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&b(this):C.nextTick(B,this))}return r},l.prototype.addListener=l.prototype.on,l.prototype.resume=function(){var e=this._readableState;return e.flowing||(H("resume"),e.flowing=!0,x(this,e)),this},l.prototype.pause=function(){return H("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(H("pause"),this._readableState.flowing=!1,this.emit("pause")),this},l.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var o in e.on("end",function(){if(H("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(n){if((H("wrapped data"),r.decoder&&(n=r.decoder.write(n)),!(r.objectMode&&(null===n||void 0===n)))&&(r.objectMode||n&&n.length)){var i=t.push(n);i||(a=!0,e.pause())}}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<Z.length;i++)e.on(Z[i],this.emit.bind(this,Z[i]));return this._read=function(t){H("wrapped _read",t),a&&(a=!1,e.resume())},this},Object.defineProperty(l.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),l._fromList=I}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./_stream_duplex":84,"./internal/streams/BufferList":89,"./internal/streams/destroy":90,"./internal/streams/stream":91,_process:82,"core-util-is":48,events:70,inherits:73,isarray:75,"process-nextick-args":81,"safe-buffer":97,"string_decoder/":108,util:39}],87:[function(e,t){'use strict';function r(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function n(e){return this instanceof n?void(o.call(this,e),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",i)):new n(e)}function i(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){a(e,t,r)}):a(this,null,null)}function a(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}t.exports=n;var o=e("./_stream_duplex"),s=e("core-util-is");s.inherits=e("inherits"),s.inherits(n,o),n.prototype.push=function(e,t){return this._transformState.needTransform=!1,o.prototype.push.call(this,e,t)},n.prototype._transform=function(){throw new Error("_transform() is not implemented")},n.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},n.prototype._read=function(){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},n.prototype._destroy=function(e,t){var r=this;o.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},{"./_stream_duplex":84,"core-util-is":48,inherits:73}],88:[function(e,t){(function(r,n,i){'use strict';function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){E(t,e)}}function o(e){return U.from(e)}function f(e){return U.isBuffer(e)||e instanceof D}function l(){}function d(t,r){A=A||e("./_stream_duplex"),t=t||{};var n=r instanceof A;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,o=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:f,this.highWaterMark=s(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){y(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function u(t){return A=A||e("./_stream_duplex"),z.call(u,this)||this instanceof A?void(this._writableState=new d(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),q.call(this)):new u(t)}function c(e,t){var r=new Error("write after end");e.emit("error",r),L.nextTick(t,r)}function p(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"!=typeof r&&void 0!==r&&!t.objectMode&&(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),L.nextTick(n,a),i=!1),i}function _(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=U.from(t,r)),t}function g(e,t,r,n,i,a){if(!r){var o=_(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,n,i,a);return f}function m(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function b(e,t,r,n,i){--t.pendingcb,r?(L.nextTick(i,n),L.nextTick(I,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),I(e,t))}function h(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function y(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(h(r),t)b(e,r,n,t,i);else{var a=x(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||B(e,r),n?j(w,e,r,a,i):w(e,r,a,i)}}function w(e,t,r,n){r||v(e,t),t.pendingcb--,n(),I(e,t)}function v(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function B(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,f=!0;r;)i[s]=r,r.isBuf||(f=!1),r=r.next,s+=1;i.allBuffers=f,m(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,d=r.encoding,u=r.callback,c=t.objectMode?1:l.length;if(m(e,t,!1,c,l,d,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),I(e,t)})}function S(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,L.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function I(e,t){var r=x(t);return r&&(S(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}function T(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?L.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function E(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}var L=e("process-nextick-args");t.exports=u;var j=!r.browser&&-1<["v0.10","v0.9."].indexOf(r.version.slice(0,5))?i:L.nextTick,A;u.WritableState=d;var O=e("core-util-is");O.inherits=e("inherits");var C={deprecate:e("util-deprecate")},q=e("./internal/streams/stream"),U=e("safe-buffer").Buffer,D=n.Uint8Array||function(){},M=e("./internal/streams/destroy");O.inherits(u,q),d.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(d.prototype,"buffer",{get:C.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var z;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(z=Function.prototype[Symbol.hasInstance],Object.defineProperty(u,Symbol.hasInstance,{value:function(e){return!!z.call(this,e)||!(this!==u)&&e&&e._writableState instanceof d}})):z=function(e){return e instanceof this},u.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},u.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&f(e);return a&&!U.isBuffer(e)&&(e=o(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":!t&&(t=n.defaultEncoding),"function"!=typeof r&&(r=l),n.ended?c(this,r):(a||p(this,n,e,r))&&(n.pendingcb++,i=g(this,n,a,e,t,r)),i},u.prototype.cork=function(){var e=this._writableState;e.corked++},u.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&B(this,e))},u.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),u.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},u.prototype._writev=null,u.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&e!==void 0&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||T(this,n,r)},Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),u.prototype.destroy=M.destroy,u.prototype._undestroy=M.undestroy,u.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,e("timers").setImmediate)},{"./_stream_duplex":84,"./internal/streams/destroy":90,"./internal/streams/stream":91,_process:82,"core-util-is":48,inherits:73,"process-nextick-args":81,"safe-buffer":97,timers:109,"util-deprecate":110}],89:[function(e,t){'use strict';function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,r){e.copy(t,r)}var o=e("safe-buffer").Buffer,s=e("util");t.exports=function(){function e(){r(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var t=o.allocUnsafe(e>>>0),r=this.head,n=0;r;)a(r.data,t,n),n+=r.data.length,r=r.next;return t},e}(),s&&s.inspect&&s.inspect.custom&&(t.exports.prototype[s.inspect.custom]=function(){var e=s.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":97,util:39}],90:[function(e,t){'use strict';function r(e,t){e.emit("error",t)}var n=e("process-nextick-args");t.exports={destroy:function(e,t){var i=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):e&&(!this._writableState||!this._writableState.errorEmitted)&&n.nextTick(r,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(r,i,e),i._writableState&&(i._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":81}],91:[function(e,t){t.exports=e("events").EventEmitter},{events:70}],92:[function(e,t){t.exports=e("./readable").PassThrough},{"./readable":93}],93:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js"),r.Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":84,"./lib/_stream_passthrough.js":85,"./lib/_stream_readable.js":86,"./lib/_stream_transform.js":87,"./lib/_stream_writable.js":88}],94:[function(e,t){t.exports=e("./readable").Transform},{"./readable":93}],95:[function(e,t){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":88}],96:[function(e,t){(function(r){'use strict';function n(){p.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function o(e,t){return e<<t|e>>>32-t}function s(t,r,n,i,a,e,f,l){return 0|o(0|t+(r^n^i)+e+f,l)+a}function f(t,r,n,i,a,e,f,l){return 0|o(0|t+(r&n|~r&i)+e+f,l)+a}function l(t,r,n,i,a,e,f,l){return 0|o(0|t+((r|~n)^i)+e+f,l)+a}function d(t,r,n,i,a,e,f,l){return 0|o(0|t+(r&i|n&~i)+e+f,l)+a}function u(t,r,n,i,a,e,f,l){return 0|o(0|t+(r^(n|~i))+e+f,l)+a}var c=e("inherits"),p=e("hash-base");c(n,p),n.prototype._update=function(){for(var e=Array(16),r=0;16>r;++r)e[r]=this._block.readInt32LE(4*r);var n=this._a,a=this._b,c=this._c,p=this._d,_=this._e;n=s(n,a,c,p,_,e[0],0,11),c=o(c,10),_=s(_,n,a,c,p,e[1],0,14),a=o(a,10),p=s(p,_,n,a,c,e[2],0,15),n=o(n,10),c=s(c,p,_,n,a,e[3],0,12),_=o(_,10),a=s(a,c,p,_,n,e[4],0,5),p=o(p,10),n=s(n,a,c,p,_,e[5],0,8),c=o(c,10),_=s(_,n,a,c,p,e[6],0,7),a=o(a,10),p=s(p,_,n,a,c,e[7],0,9),n=o(n,10),c=s(c,p,_,n,a,e[8],0,11),_=o(_,10),a=s(a,c,p,_,n,e[9],0,13),p=o(p,10),n=s(n,a,c,p,_,e[10],0,14),c=o(c,10),_=s(_,n,a,c,p,e[11],0,15),a=o(a,10),p=s(p,_,n,a,c,e[12],0,6),n=o(n,10),c=s(c,p,_,n,a,e[13],0,7),_=o(_,10),a=s(a,c,p,_,n,e[14],0,9),p=o(p,10),n=s(n,a,c,p,_,e[15],0,8),c=o(c,10),_=f(_,n,a,c,p,e[7],1518500249,7),a=o(a,10),p=f(p,_,n,a,c,e[4],1518500249,6),n=o(n,10),c=f(c,p,_,n,a,e[13],1518500249,8),_=o(_,10),a=f(a,c,p,_,n,e[1],1518500249,13),p=o(p,10),n=f(n,a,c,p,_,e[10],1518500249,11),c=o(c,10),_=f(_,n,a,c,p,e[6],1518500249,9),a=o(a,10),p=f(p,_,n,a,c,e[15],1518500249,7),n=o(n,10),c=f(c,p,_,n,a,e[3],1518500249,15),_=o(_,10),a=f(a,c,p,_,n,e[12],1518500249,7),p=o(p,10),n=f(n,a,c,p,_,e[0],1518500249,12),c=o(c,10),_=f(_,n,a,c,p,e[9],1518500249,15),a=o(a,10),p=f(p,_,n,a,c,e[5],1518500249,9),n=o(n,10),c=f(c,p,_,n,a,e[2],1518500249,11),_=o(_,10),a=f(a,c,p,_,n,e[14],1518500249,7),p=o(p,10),n=f(n,a,c,p,_,e[11],1518500249,13),c=o(c,10),_=f(_,n,a,c,p,e[8],1518500249,12),a=o(a,10),p=l(p,_,n,a,c,e[3],1859775393,11),n=o(n,10),c=l(c,p,_,n,a,e[10],1859775393,13),_=o(_,10),a=l(a,c,p,_,n,e[14],1859775393,6),p=o(p,10),n=l(n,a,c,p,_,e[4],1859775393,7),c=o(c,10),_=l(_,n,a,c,p,e[9],1859775393,14),a=o(a,10),p=l(p,_,n,a,c,e[15],1859775393,9),n=o(n,10),c=l(c,p,_,n,a,e[8],1859775393,13),_=o(_,10),a=l(a,c,p,_,n,e[1],1859775393,15),p=o(p,10),n=l(n,a,c,p,_,e[2],1859775393,14),c=o(c,10),_=l(_,n,a,c,p,e[7],1859775393,8),a=o(a,10),p=l(p,_,n,a,c,e[0],1859775393,13),n=o(n,10),c=l(c,p,_,n,a,e[6],1859775393,6),_=o(_,10),a=l(a,c,p,_,n,e[13],1859775393,5),p=o(p,10),n=l(n,a,c,p,_,e[11],1859775393,12),c=o(c,10),_=l(_,n,a,c,p,e[5],1859775393,7),a=o(a,10),p=l(p,_,n,a,c,e[12],1859775393,5),n=o(n,10),c=d(c,p,_,n,a,e[1],2400959708,11),_=o(_,10),a=d(a,c,p,_,n,e[9],2400959708,12),p=o(p,10),n=d(n,a,c,p,_,e[11],2400959708,14),c=o(c,10),_=d(_,n,a,c,p,e[10],2400959708,15),a=o(a,10),p=d(p,_,n,a,c,e[0],2400959708,14),n=o(n,10),c=d(c,p,_,n,a,e[8],2400959708,15),_=o(_,10),a=d(a,c,p,_,n,e[12],2400959708,9),p=o(p,10),n=d(n,a,c,p,_,e[4],2400959708,8),c=o(c,10),_=d(_,n,a,c,p,e[13],2400959708,9),a=o(a,10),p=d(p,_,n,a,c,e[3],2400959708,14),n=o(n,10),c=d(c,p,_,n,a,e[7],2400959708,5),_=o(_,10),a=d(a,c,p,_,n,e[15],2400959708,6),p=o(p,10),n=d(n,a,c,p,_,e[14],2400959708,8),c=o(c,10),_=d(_,n,a,c,p,e[5],2400959708,6),a=o(a,10),p=d(p,_,n,a,c,e[6],2400959708,5),n=o(n,10),c=d(c,p,_,n,a,e[2],2400959708,12),_=o(_,10),a=u(a,c,p,_,n,e[4],2840853838,9),p=o(p,10),n=u(n,a,c,p,_,e[0],2840853838,15),c=o(c,10),_=u(_,n,a,c,p,e[5],2840853838,5),a=o(a,10),p=u(p,_,n,a,c,e[9],2840853838,11),n=o(n,10),c=u(c,p,_,n,a,e[7],2840853838,6),_=o(_,10),a=u(a,c,p,_,n,e[12],2840853838,8),p=o(p,10),n=u(n,a,c,p,_,e[2],2840853838,13),c=o(c,10),_=u(_,n,a,c,p,e[10],2840853838,12),a=o(a,10),p=u(p,_,n,a,c,e[14],2840853838,5),n=o(n,10),c=u(c,p,_,n,a,e[1],2840853838,12),_=o(_,10),a=u(a,c,p,_,n,e[3],2840853838,13),p=o(p,10),n=u(n,a,c,p,_,e[8],2840853838,14),c=o(c,10),_=u(_,n,a,c,p,e[11],2840853838,11),a=o(a,10),p=u(p,_,n,a,c,e[6],2840853838,8),n=o(n,10),c=u(c,p,_,n,a,e[15],2840853838,5),_=o(_,10),a=u(a,c,p,_,n,e[13],2840853838,6),p=o(p,10);var g=this._a,m=this._b,b=this._c,h=this._d,y=this._e;g=u(g,m,b,h,y,e[5],1352829926,8),b=o(b,10),y=u(y,g,m,b,h,e[14],1352829926,9),m=o(m,10),h=u(h,y,g,m,b,e[7],1352829926,9),g=o(g,10),b=u(b,h,y,g,m,e[0],1352829926,11),y=o(y,10),m=u(m,b,h,y,g,e[9],1352829926,13),h=o(h,10),g=u(g,m,b,h,y,e[2],1352829926,15),b=o(b,10),y=u(y,g,m,b,h,e[11],1352829926,15),m=o(m,10),h=u(h,y,g,m,b,e[4],1352829926,5),g=o(g,10),b=u(b,h,y,g,m,e[13],1352829926,7),y=o(y,10),m=u(m,b,h,y,g,e[6],1352829926,7),h=o(h,10),g=u(g,m,b,h,y,e[15],1352829926,8),b=o(b,10),y=u(y,g,m,b,h,e[8],1352829926,11),m=o(m,10),h=u(h,y,g,m,b,e[1],1352829926,14),g=o(g,10),b=u(b,h,y,g,m,e[10],1352829926,14),y=o(y,10),m=u(m,b,h,y,g,e[3],1352829926,12),h=o(h,10),g=u(g,m,b,h,y,e[12],1352829926,6),b=o(b,10),y=d(y,g,m,b,h,e[6],1548603684,9),m=o(m,10),h=d(h,y,g,m,b,e[11],1548603684,13),g=o(g,10),b=d(b,h,y,g,m,e[3],1548603684,15),y=o(y,10),m=d(m,b,h,y,g,e[7],1548603684,7),h=o(h,10),g=d(g,m,b,h,y,e[0],1548603684,12),b=o(b,10),y=d(y,g,m,b,h,e[13],1548603684,8),m=o(m,10),h=d(h,y,g,m,b,e[5],1548603684,9),g=o(g,10),b=d(b,h,y,g,m,e[10],1548603684,11),y=o(y,10),m=d(m,b,h,y,g,e[14],1548603684,7),h=o(h,10),g=d(g,m,b,h,y,e[15],1548603684,7),b=o(b,10),y=d(y,g,m,b,h,e[8],1548603684,12),m=o(m,10),h=d(h,y,g,m,b,e[12],1548603684,7),g=o(g,10),b=d(b,h,y,g,m,e[4],1548603684,6),y=o(y,10),m=d(m,b,h,y,g,e[9],1548603684,15),h=o(h,10),g=d(g,m,b,h,y,e[1],1548603684,13),b=o(b,10),y=d(y,g,m,b,h,e[2],1548603684,11),m=o(m,10),h=l(h,y,g,m,b,e[15],1836072691,9),g=o(g,10),b=l(b,h,y,g,m,e[5],1836072691,7),y=o(y,10),m=l(m,b,h,y,g,e[1],1836072691,15),h=o(h,10),g=l(g,m,b,h,y,e[3],1836072691,11),b=o(b,10),y=l(y,g,m,b,h,e[7],1836072691,8),m=o(m,10),h=l(h,y,g,m,b,e[14],1836072691,6),g=o(g,10),b=l(b,h,y,g,m,e[6],1836072691,6),y=o(y,10),m=l(m,b,h,y,g,e[9],1836072691,14),h=o(h,10),g=l(g,m,b,h,y,e[11],1836072691,12),b=o(b,10),y=l(y,g,m,b,h,e[8],1836072691,13),m=o(m,10),h=l(h,y,g,m,b,e[12],1836072691,5),g=o(g,10),b=l(b,h,y,g,m,e[2],1836072691,14),y=o(y,10),m=l(m,b,h,y,g,e[10],1836072691,13),h=o(h,10),g=l(g,m,b,h,y,e[0],1836072691,13),b=o(b,10),y=l(y,g,m,b,h,e[4],1836072691,7),m=o(m,10),h=l(h,y,g,m,b,e[13],1836072691,5),g=o(g,10),b=f(b,h,y,g,m,e[8],2053994217,15),y=o(y,10),m=f(m,b,h,y,g,e[6],2053994217,5),h=o(h,10),g=f(g,m,b,h,y,e[4],2053994217,8),b=o(b,10),y=f(y,g,m,b,h,e[1],2053994217,11),m=o(m,10),h=f(h,y,g,m,b,e[3],2053994217,14),g=o(g,10),b=f(b,h,y,g,m,e[11],2053994217,14),y=o(y,10),m=f(m,b,h,y,g,e[15],2053994217,6),h=o(h,10),g=f(g,m,b,h,y,e[0],2053994217,14),b=o(b,10),y=f(y,g,m,b,h,e[5],2053994217,6),m=o(m,10),h=f(h,y,g,m,b,e[12],2053994217,9),g=o(g,10),b=f(b,h,y,g,m,e[2],2053994217,12),y=o(y,10),m=f(m,b,h,y,g,e[13],2053994217,9),h=o(h,10),g=f(g,m,b,h,y,e[9],2053994217,12),b=o(b,10),y=f(y,g,m,b,h,e[7],2053994217,5),m=o(m,10),h=f(h,y,g,m,b,e[10],2053994217,15),g=o(g,10),b=f(b,h,y,g,m,e[14],2053994217,8),y=o(y,10),m=s(m,b,h,y,g,e[12],0,8),h=o(h,10),g=s(g,m,b,h,y,e[15],0,5),b=o(b,10),y=s(y,g,m,b,h,e[10],0,12),m=o(m,10),h=s(h,y,g,m,b,e[4],0,9),g=o(g,10),b=s(b,h,y,g,m,e[1],0,12),y=o(y,10),m=s(m,b,h,y,g,e[5],0,5),h=o(h,10),g=s(g,m,b,h,y,e[8],0,14),b=o(b,10),y=s(y,g,m,b,h,e[7],0,6),m=o(m,10),h=s(h,y,g,m,b,e[6],0,8),g=o(g,10),b=s(b,h,y,g,m,e[2],0,13),y=o(y,10),m=s(m,b,h,y,g,e[13],0,6),h=o(h,10),g=s(g,m,b,h,y,e[14],0,5),b=o(b,10),y=s(y,g,m,b,h,e[0],0,15),m=o(m,10),h=s(h,y,g,m,b,e[3],0,13),g=o(g,10),b=s(b,h,y,g,m,e[9],0,11),y=o(y,10),m=s(m,b,h,y,g,e[11],0,11),h=o(h,10);var w=0|this._b+c+h;this._b=0|this._c+p+y,this._c=0|this._d+_+g,this._d=0|this._e+n+m,this._e=0|this._a+a+b,this._a=w},n.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=n}).call(this,e("buffer").Buffer)},{buffer:45,"hash-base":71,inherits:73}],97:[function(e,t,r){function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return o(e,t,r)}var a=e("buffer"),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=a:(n(a,r),r.Buffer=i),n(o,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0===t?n.fill(0):"string"==typeof r?n.fill(t,r):n.fill(t),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},{buffer:45}],98:[function(e,t){(function(r,n){!function(i){'use strict';function a(e,t){if(t=t||{type:"Array"},"undefined"!=typeof r&&"number"==typeof r.pid)return o(e,t);var n=window.crypto||window.msCrypto;if(!n)throw new Error("Your browser does not support window.crypto.");return s(e,t)}function o(t,r){var n=e("crypto"),a=n.randomBytes(t);switch(r.type){case"Array":return[].slice.call(a);case"Buffer":return a;case"Uint8Array":for(var o=new Uint8Array(t),s=0;s<t;++s)o[s]=a.readUInt8(s);return o;default:throw new Error(r.type+" is unsupported.");}}function s(e,t){var r=new Uint8Array(e),i=window.crypto||window.msCrypto;switch(i.getRandomValues(r),t.type){case"Array":return[].slice.call(r);case"Buffer":try{new n(1)}catch(t){throw new Error("Buffer not supported in this environment. Use Node.js or Browserify for browser support.")}return new n(r);case"Uint8Array":return r;default:throw new Error(t.type+" is unsupported.");}}"undefined"!=typeof c&&c.amd?c([],function(){return a}):"undefined"!=typeof t&&t.exports?t.exports=a:i.secureRandom=a,a.randomArray=function(e){return a(e,{type:"Array"})},a.randomUint8Array=function(e){return a(e,{type:"Uint8Array"})},a.randomBuffer=function(e){return a(e,{type:"Buffer"})}}(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:82,buffer:45,crypto:39}],99:[function(e,t){(function(e){function r(t,r){this._block=new e(t),this._finalSize=r,this._blockSize=t,this._len=0,this._s=0}r.prototype.update=function(r,n){"string"==typeof r&&(n=n||"utf8",r=new e(r,n));for(var a=this._len+=r.length,l=this._s||0,d=0,u=this._block;l<a;){for(var c=o(r.length,d+this._blockSize-l%this._blockSize),t=c-d,p=0;p<t;p++)u[l%this._blockSize+p]=r[p+d];l+=t,d+=t,0==l%this._blockSize&&this._update(u)}return this._s=l,this},r.prototype.digest=function(e){var t=8*this._len;this._block[this._len%this._blockSize]=128,this._block.fill(0,this._len%this._blockSize+1),t%(8*this._blockSize)>=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(t,this._blockSize-4);var r=this._update(this._block)||this._hash();return e?r.toString(e):r},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r}).call(this,e("buffer").Buffer)},{buffer:45}],100:[function(e,t,r){var r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":101,"./sha1":102,"./sha224":103,"./sha256":104,"./sha384":105,"./sha512":106}],101:[function(e,t){(function(r){function n(){this.init(),this._w=d,s.call(this,64,56)}function i(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var a=e("inherits"),s=e("./hash"),l=[1518500249,1859775393,-1894007588,-899497514],d=Array(80);a(n,s),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(r){for(var n=this._w,u=0|this._a,p=0|this._b,_=0|this._c,g=0|this._d,m=0|this._e,h=0;16>h;++h)n[h]=r.readInt32BE(4*h);for(;80>h;++h)n[h]=n[h-3]^n[h-8]^n[h-14]^n[h-16];for(var y=0;80>y;++y){var w=~~(y/20),s=0|i(u)+f(w,p,_,g)+m+n[y]+l[w];m=g,g=_,_=o(p),p=u,u=s}this._a=0|u+this._a,this._b=0|p+this._b,this._c=0|_+this._c,this._d=0|g+this._d,this._e=0|m+this._e},n.prototype._hash=function(){var e=new r(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":99,buffer:45,inherits:73}],102:[function(e,t){(function(r){function n(){this.init(),this._w=d,s.call(this,64,56)}function a(e){return e<<1|e>>>31}function o(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var i=e("inherits"),s=e("./hash"),u=[1518500249,1859775393,-1894007588,-899497514],d=Array(80);i(n,s),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(r){for(var n=this._w,p=0|this._a,_=0|this._b,g=0|this._c,m=0|this._d,h=0|this._e,y=0;16>y;++y)n[y]=r.readInt32BE(4*y);for(;80>y;++y)n[y]=a(n[y-3]^n[y-8]^n[y-14]^n[y-16]);for(var w=0;80>w;++w){var v=~~(w/20),s=0|o(p)+l(v,_,g,m)+h+n[w]+u[v];h=m,m=g,g=f(_),_=p,p=s}this._a=0|p+this._a,this._b=0|_+this._b,this._c=0|g+this._c,this._d=0|m+this._d,this._e=0|h+this._e},n.prototype._hash=function(){var e=new r(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":99,buffer:45,inherits:73}],103:[function(e,t){(function(r){function n(){this.init(),this._w=s,o.call(this,64,56)}var i=e("inherits"),a=e("./sha256"),o=e("./hash"),s=Array(64);i(n,a),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var e=new r(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":99,"./sha256":104,buffer:45,inherits:73}],104:[function(e,t){(function(r){function n(){this.init(),this._w=a,p.call(this,64,56)}function i(e,t,r){return r^e&(t^r)}function o(e,t,r){return e&t|r&(e|t)}function s(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function u(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var c=e("inherits"),p=e("./hash"),_=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=Array(64);c(n,p),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(t){for(var r=this._w,n=0|this._a,p=0|this._b,m=0|this._c,y=0|this._d,w=0|this._e,v=0|this._f,B=0|this._g,x=0|this._h,k=0;16>k;++k)r[k]=t.readInt32BE(4*k);for(;64>k;++k)r[k]=0|u(r[k-2])+r[k-7]+d(r[k-15])+r[k-16];for(var S=0;64>S;++S){var I=0|x+l(w)+i(w,v,B)+_[S]+r[S],T=0|s(n)+o(n,p,m);x=B,B=v,v=w,w=0|y+I,y=m,m=p,p=n,n=0|I+T}this._a=0|n+this._a,this._b=0|p+this._b,this._c=0|m+this._c,this._d=0|y+this._d,this._e=0|w+this._e,this._f=0|v+this._f,this._g=0|B+this._g,this._h=0|x+this._h},n.prototype._hash=function(){var e=new r(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":99,buffer:45,inherits:73}],105:[function(e,t){(function(r){function n(){this.init(),this._w=s,o.call(this,128,112)}var i=e("inherits"),a=e("./sha512"),o=e("./hash"),s=Array(160);i(n,a),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=new r(48);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":99,"./sha512":106,buffer:45,inherits:73}],106:[function(e,t){(function(r){function n(){this.init(),this._w=m,_.call(this,128,112)}function i(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function o(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function d(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function u(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function c(e,t){return e>>>0<t>>>0?1:0}var p=e("inherits"),_=e("./hash"),g=[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],m=Array(160);p(n,_),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,p=0|this._ch,_=0|this._dh,m=0|this._eh,b=0|this._fh,h=0|this._gh,y=0|this._hh,w=0|this._al,v=0|this._bl,B=0|this._cl,x=0|this._dl,k=0|this._el,S=0|this._fl,I=0|this._gl,T=0|this._hl,E=0;32>E;E+=2)t[E]=e.readInt32BE(4*E),t[E+1]=e.readInt32BE(4*E+4);for(;160>E;E+=2){var L=t[E-30],A=t[E-30+1],O=f(L,A),C=l(A,L);L=t[E-4],A=t[E-4+1];var q=d(L,A),U=u(A,L),D=t[E-14],M=t[E-14+1],z=t[E-32],P=t[E-32+1],R=0|C+M,N=0|O+D+c(R,C);R=0|R+U,N=0|N+q+c(R,U),R=0|R+P,N=0|N+z+c(R,P),t[E]=N,t[E+1]=R}for(var F=0;160>F;F+=2){N=t[F],R=t[F+1];var H=a(r,n,p),K=a(w,v,B),V=o(r,w),W=o(w,r),Z=s(m,k),G=s(k,m),Y=g[F],X=g[F+1],Q=i(m,b,h),J=i(k,S,I),$=0|T+G,ee=0|y+Z+c($,T);$=0|$+J,ee=0|ee+Q+c($,J),$=0|$+X,ee=0|ee+Y+c($,X),$=0|$+R,ee=0|ee+N+c($,R);var te=0|W+K,re=0|V+H+c(te,W);y=h,T=I,h=b,I=S,b=m,S=k,k=0|x+$,m=0|_+ee+c(k,x),_=p,x=B,p=n,B=v,n=r,v=w,w=0|$+te,r=0|ee+re+c(w,$)}this._al=0|this._al+w,this._bl=0|this._bl+v,this._cl=0|this._cl+B,this._dl=0|this._dl+x,this._el=0|this._el+k,this._fl=0|this._fl+S,this._gl=0|this._gl+I,this._hl=0|this._hl+T,this._ah=0|this._ah+r+c(this._al,w),this._bh=0|this._bh+n+c(this._bl,v),this._ch=0|this._ch+p+c(this._cl,B),this._dh=0|this._dh+_+c(this._dl,x),this._eh=0|this._eh+m+c(this._el,k),this._fh=0|this._fh+b+c(this._fl,S),this._gh=0|this._gh+h+c(this._gl,I),this._hh=0|this._hh+y+c(this._hl,T)},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=new r(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":99,buffer:45,inherits:73}],107:[function(e,t){function r(){n.call(this)}t.exports=r;var n=e("events").EventEmitter,i=e("inherits");i(r,n),r.Readable=e("readable-stream/readable.js"),r.Writable=e("readable-stream/writable.js"),r.Duplex=e("readable-stream/duplex.js"),r.Transform=e("readable-stream/transform.js"),r.PassThrough=e("readable-stream/passthrough.js"),r.Stream=r,r.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&l.pause&&l.pause()}function i(){l.readable&&l.resume&&l.resume()}function a(){d||(d=!0,e.end())}function o(){d||(d=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){l.removeListener("data",r),e.removeListener("drain",i),l.removeListener("end",a),l.removeListener("close",o),l.removeListener("error",s),e.removeListener("error",s),l.removeListener("end",f),l.removeListener("close",f),e.removeListener("close",f)}var l=this;l.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(l.on("end",a),l.on("close",o));var d=!1;return l.on("error",s),e.on("error",s),l.on("end",f),l.on("close",f),e.on("close",f),e.emit("pipe",l),e}},{events:70,inherits:73,"readable-stream/duplex.js":83,"readable-stream/passthrough.js":92,"readable-stream/readable.js":93,"readable-stream/transform.js":94,"readable-stream/writable.js":95}],108:[function(e,t,r){'use strict';function n(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0;}}function i(e){var t=n(e);if("string"!=typeof t&&(m.isEncoding===b||!b(e)))throw new Error("Unknown encoding: "+e);return t||e}function a(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=d,this.end=u,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=c,this.end=p,t=3;break;default:return this.write=_,void(this.end=g);}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(t)}function o(e){if(127>=e)return 0;return 6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function s(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);return 0<=i?(0<i&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=o(t[n]),0<=i)?(0<i&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=o(t[n]),0<=i?(0<i&&(2===i?i=0:e.lastNeed=i-3),i):0)}function f(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"\uFFFD";if(1<e.lastNeed&&1<t.length){if(128!=(192&t[1]))return e.lastNeed=1,"\uFFFD";if(2<e.lastNeed&&2<t.length&&128!=(192&t[2]))return e.lastNeed=2,"\uFFFD"}}function l(e){var t=this.lastTotal-this.lastNeed,n=f(this,e,t);return void 0===n?this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length):n}function d(e,t){if(0==(e.length-t)%2){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(55296<=r&&56319>=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function _(e){return e.toString(this.encoding)}function g(e){return e&&e.length?this.write(e):""}var m=e("safe-buffer").Buffer,b=m.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1;}};r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t},a.prototype.text=function(e,t){var r=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){return this.lastNeed<=e.length?(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length)}},{"safe-buffer":97}],109:[function(e,t,r){(function(t,n){function i(e,t){this._id=e,this._clearFn=t}var a=e("process/browser.js").nextTick,o=Function.prototype.apply,s=Array.prototype.slice,f={},l=0;r.setTimeout=function(){return new i(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new i(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=l++,n=!(2>arguments.length)&&s.call(arguments,1);return f[t]=!0,a(function(){f[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof n?n:function(e){delete f[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":82,timers:109}],110:[function(e,t){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===(r+"").toLowerCase()}t.exports=function(e,t){function n(){if(!i){if(r("throwDeprecation"))throw new Error(t);else r("traceDeprecation")?console.trace(t):console.warn(t);i=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var i=!1;return n}}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}]},{},[1])(1)});