PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/near-api-js/dist

Просмотр файла: near-api-js.min.js

(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (Buffer){(function (){
window.nearApi=require("./lib/browser-index"),window.Buffer=Buffer;

}).call(this)}).call(this,require("buffer").Buffer)
},{"./lib/browser-index":6,"buffer":41}],2:[function(require,module,exports){
(function (process,Buffer){(function (){
"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Account=void 0;const bn_js_1=__importDefault(require("bn.js")),depd_1=__importDefault(require("depd")),transaction_1=require("./transaction"),providers_1=require("./providers"),borsh_1=require("borsh"),key_pair_1=require("./utils/key_pair"),errors_1=require("./utils/errors"),rpc_errors_1=require("./utils/rpc_errors"),constants_1=require("./constants"),exponential_backoff_1=__importDefault(require("./utils/exponential-backoff")),TX_NONCE_RETRY_NUMBER=12,TX_NONCE_RETRY_WAIT=500,TX_NONCE_RETRY_WAIT_BACKOFF=1.5;function parseJsonFromRawResponse(t){return JSON.parse(Buffer.from(t).toString())}function bytesJsonStringify(t){return Buffer.from(JSON.stringify(t))}class Account{constructor(t,e){this.accessKeyByPublicKeyCache={},this.connection=t,this.accountId=e}get ready(){return depd_1.default("Account.ready()")("not needed anymore, always ready"),Promise.resolve()}async fetchState(){depd_1.default("Account.fetchState()")("use `Account.state()` instead")}async state(){return this.connection.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}printLogsAndFailures(t,e){if(!process.env.NEAR_NO_LOGS)for(const n of e)console.log(`Receipt${n.receiptIds.length>1?"s":""}: ${n.receiptIds.join(", ")}`),this.printLogs(t,n.logs,"\t"),n.failure&&console.warn(`\tFailure [${t}]: ${n.failure}`)}printLogs(t,e,n=""){if(!process.env.NEAR_NO_LOGS)for(const r of e)console.log(`${n}Log [${t}]: ${r}`)}async signTransaction(t,e){const n=await this.findAccessKey(t,e);if(!n)throw new providers_1.TypedError(`Can not sign transactions for account ${this.accountId} on network ${this.connection.networkId}, no matching key pair found in ${this.connection.signer}.`,"KeyNotFound");const{accessKey:r}=n,s=(await this.connection.provider.block({finality:"final"})).header.hash,i=++r.nonce;return await transaction_1.signTransaction(t,i,e,borsh_1.baseDecode(s),this.connection.signer,this.accountId,this.connection.networkId)}signAndSendTransaction(...t){return"string"==typeof t[0]?this.signAndSendTransactionV1(t[0],t[1]):this.signAndSendTransactionV2(t[0])}signAndSendTransactionV1(t,e){return depd_1.default("Account.signAndSendTransaction(receiverId, actions")("use `Account.signAndSendTransaction(SignAndSendTransactionOptions)` instead"),this.signAndSendTransactionV2({receiverId:t,actions:e})}async signAndSendTransactionV2({receiverId:t,actions:e,returnError:n}){let r,s;const i=await exponential_backoff_1.default(TX_NONCE_RETRY_WAIT,TX_NONCE_RETRY_NUMBER,TX_NONCE_RETRY_WAIT_BACKOFF,async()=>{[r,s]=await this.signTransaction(t,e);const n=s.transaction.publicKey;try{return await this.connection.provider.sendTransaction(s)}catch(e){if("InvalidNonce"===e.type)return errors_1.logWarning(`Retrying transaction ${t}:${borsh_1.baseEncode(r)} with new nonce.`),delete this.accessKeyByPublicKeyCache[n.toString()],null;if("Expired"===e.type)return errors_1.logWarning(`Retrying transaction ${t}:${borsh_1.baseEncode(r)} due to expired block hash`),null;throw e.context=new providers_1.ErrorContext(borsh_1.baseEncode(r)),e}});if(!i)throw new providers_1.TypedError("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");const a=[i.transaction_outcome,...i.receipts_outcome].reduce((t,e)=>e.outcome.logs.length||"object"==typeof e.outcome.status&&"object"==typeof e.outcome.status.Failure?t.concat({receiptIds:e.outcome.receipt_ids,logs:e.outcome.logs,failure:void 0!==e.outcome.status.Failure?rpc_errors_1.parseRpcError(e.outcome.status.Failure):null}):t,[]);if(this.printLogsAndFailures(s.transaction.receiverId,a),!n&&"object"==typeof i.status&&"object"==typeof i.status.Failure)throw i.status.Failure.error_message&&i.status.Failure.error_type?new providers_1.TypedError(`Transaction ${i.transaction_outcome.id} failed. ${i.status.Failure.error_message}`,i.status.Failure.error_type):rpc_errors_1.parseResultError(i);return i}async findAccessKey(t,e){const n=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);if(!n)return null;const r=this.accessKeyByPublicKeyCache[n.toString()];if(void 0!==r)return{publicKey:n,accessKey:r};try{const t=await this.connection.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:n.toString(),finality:"optimistic"});return this.accessKeyByPublicKeyCache[n.toString()]?{publicKey:n,accessKey:this.accessKeyByPublicKeyCache[n.toString()]}:(this.accessKeyByPublicKeyCache[n.toString()]=t,{publicKey:n,accessKey:t})}catch(t){if("AccessKeyDoesNotExist"==t.type)return null;throw t}}async createAndDeployContract(t,e,n,r){const s=transaction_1.fullAccessKey();return await this.signAndSendTransaction({receiverId:t,actions:[transaction_1.createAccount(),transaction_1.transfer(r),transaction_1.addKey(key_pair_1.PublicKey.from(e),s),transaction_1.deployContract(n)]}),new Account(this.connection,t)}async sendMoney(t,e){return this.signAndSendTransaction({receiverId:t,actions:[transaction_1.transfer(e)]})}async createAccount(t,e,n){const r=transaction_1.fullAccessKey();return this.signAndSendTransaction({receiverId:t,actions:[transaction_1.createAccount(),transaction_1.transfer(n),transaction_1.addKey(key_pair_1.PublicKey.from(e),r)]})}async deleteAccount(t){return this.signAndSendTransaction({receiverId:this.accountId,actions:[transaction_1.deleteAccount(t)]})}async deployContract(t){return this.signAndSendTransaction({receiverId:this.accountId,actions:[transaction_1.deployContract(t)]})}async functionCall(...t){return"string"==typeof t[0]?this.functionCallV1(t[0],t[1],t[2],t[3],t[4]):this.functionCallV2(t[0])}functionCallV1(t,e,n,r,s){return depd_1.default("Account.functionCall(contractId, methodName, args, gas, amount)")("use `Account.functionCall(FunctionCallOptions)` instead"),n=n||{},this.validateArgs(n),this.signAndSendTransaction({receiverId:t,actions:[transaction_1.functionCall(e,n,r||constants_1.DEFAULT_FUNCTION_CALL_GAS,s)]})}functionCallV2({contractId:t,methodName:e,args:n={},gas:r=constants_1.DEFAULT_FUNCTION_CALL_GAS,attachedDeposit:s,walletMeta:i,walletCallbackUrl:a,stringify:o}){this.validateArgs(n);const c=void 0===o?transaction_1.stringifyJsonOrBytes:o;return this.signAndSendTransaction({receiverId:t,actions:[transaction_1.functionCall(e,n,r,s,c)],walletMeta:i,walletCallbackUrl:a})}async addKey(t,e,n,r){let s;return n||(n=[]),Array.isArray(n)||(n=[n]),s=e?transaction_1.functionCallAccessKey(e,n,r):transaction_1.fullAccessKey(),this.signAndSendTransaction({receiverId:this.accountId,actions:[transaction_1.addKey(key_pair_1.PublicKey.from(t),s)]})}async deleteKey(t){return this.signAndSendTransaction({receiverId:this.accountId,actions:[transaction_1.deleteKey(key_pair_1.PublicKey.from(t))]})}async stake(t,e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[transaction_1.stake(e,key_pair_1.PublicKey.from(t))]})}validateArgs(t){if(!(void 0!==t.byteLength&&t.byteLength===t.length)&&(Array.isArray(t)||"object"!=typeof t))throw new errors_1.PositionalArgsError}async viewFunction(t,e,n={},{parse:r=parseJsonFromRawResponse,stringify:s=bytesJsonStringify}={}){this.validateArgs(n);const i=s(n).toString("base64"),a=await this.connection.provider.query({request_type:"call_function",account_id:t,method_name:e,args_base64:i,finality:"optimistic"});return a.logs&&this.printLogs(t,a.logs),a.result&&a.result.length>0&&r(Buffer.from(a.result))}async viewState(t,e={finality:"optimistic"}){const{values:n}=await this.connection.provider.query({request_type:"view_state",...e,account_id:this.accountId,prefix_base64:Buffer.from(t).toString("base64")});return n.map(({key:t,value:e})=>({key:Buffer.from(t,"base64"),value:Buffer.from(e,"base64")}))}async getAccessKeys(){const t=await this.connection.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:"optimistic"});return Array.isArray(t)?t:t.keys}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(t=>"FullAccess"!==t.access_key.permission).map(t=>{const e=t.access_key.permission;return{contractId:e.FunctionCall.receiver_id,amount:e.FunctionCall.allowance,publicKey:t.public_key}})}}async getAccountBalance(){const t=await this.connection.provider.experimental_protocolConfig({finality:"final"}),e=await this.state(),n=new bn_js_1.default(t.runtime_config.storage_amount_per_byte),r=new bn_js_1.default(e.storage_usage).mul(n),s=new bn_js_1.default(e.locked),i=new bn_js_1.default(e.amount).add(s),a=i.sub(bn_js_1.default.max(s,r));return{total:i.toString(),stateStaked:r.toString(),staked:s.toString(),available:a.toString()}}}exports.Account=Account;

}).call(this)}).call(this,require('_process'),require("buffer").Buffer)
},{"./constants":9,"./providers":18,"./transaction":23,"./utils/errors":25,"./utils/exponential-backoff":26,"./utils/key_pair":29,"./utils/rpc_errors":30,"_process":67,"bn.js":37,"borsh":38,"buffer":41,"depd":47}],3:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlAccountCreator=exports.LocalAccountCreator=exports.AccountCreator=void 0;const web_1=require("./utils/web");class AccountCreator{}exports.AccountCreator=AccountCreator;class LocalAccountCreator extends AccountCreator{constructor(t,c){super(),this.masterAccount=t,this.initialBalance=c}async createAccount(t,c){await this.masterAccount.createAccount(t,c,this.initialBalance)}}exports.LocalAccountCreator=LocalAccountCreator;class UrlAccountCreator extends AccountCreator{constructor(t,c){super(),this.connection=t,this.helperUrl=c}async createAccount(t,c){await web_1.fetchJson(`${this.helperUrl}/account`,JSON.stringify({newAccountId:t,newAccountPublicKey:c.toString()}))}}exports.UrlAccountCreator=UrlAccountCreator;

},{"./utils/web":32}],4:[function(require,module,exports){
(function (Buffer){(function (){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Account2FA=exports.AccountMultisig=exports.MULTISIG_CONFIRM_METHODS=exports.MULTISIG_CHANGE_METHODS=exports.MULTISIG_DEPOSIT=exports.MULTISIG_GAS=exports.MULTISIG_ALLOWANCE=exports.MULTISIG_STORAGE_KEY=void 0;const bn_js_1=__importDefault(require("bn.js")),depd_1=__importDefault(require("depd")),account_1=require("./account"),format_1=require("./utils/format"),key_pair_1=require("./utils/key_pair"),transaction_1=require("./transaction"),web_1=require("./utils/web");exports.MULTISIG_STORAGE_KEY="__multisigRequest",exports.MULTISIG_ALLOWANCE=new bn_js_1.default(format_1.parseNearAmount("1")),exports.MULTISIG_GAS=new bn_js_1.default("100000000000000"),exports.MULTISIG_DEPOSIT=new bn_js_1.default("0"),exports.MULTISIG_CHANGE_METHODS=["add_request","add_request_and_confirm","delete_request","confirm"],exports.MULTISIG_CONFIRM_METHODS=["confirm"];const storageFallback={[exports.MULTISIG_STORAGE_KEY]:null};class AccountMultisig extends account_1.Account{constructor(e,t,s){super(e,t),this.storage=s.storage,this.onAddRequestResult=s.onAddRequestResult}async signAndSendTransactionWithAccount(e,t){return super.signAndSendTransaction({receiverId:e,actions:t})}signAndSendTransaction(...e){return"string"==typeof e[0]?this._signAndSendTransaction({receiverId:e[0],actions:e[1]}):this._signAndSendTransaction(e[0])}async _signAndSendTransaction({receiverId:e,actions:t}){const{accountId:s}=this,n=Buffer.from(JSON.stringify({request:{receiver_id:e,actions:convertActions(t,s,e)}}));let i;try{i=await super.signAndSendTransaction({receiverId:s,actions:[transaction_1.functionCall("add_request_and_confirm",n,exports.MULTISIG_GAS,exports.MULTISIG_DEPOSIT)]})}catch(s){if(s.toString().includes("Account has too many active requests. Confirm or delete some"))return await this.deleteUnconfirmedRequests(),await this.signAndSendTransaction(e,t);throw s}if(!i.status)throw new Error("Request failed");const r={...i.status};if(!r.SuccessValue||"string"!=typeof r.SuccessValue)throw new Error("Request failed");return this.setRequest({accountId:s,actions:t,requestId:parseInt(Buffer.from(r.SuccessValue,"base64").toString("ascii"),10)}),this.onAddRequestResult&&await this.onAddRequestResult(i),this.deleteUnconfirmedRequests(),i}async deleteUnconfirmedRequests(){const e=await this.getRequestIds(),{requestId:t}=this.getRequest();for(const s of e)if(s!=t)try{await super.signAndSendTransaction({receiverId:this.accountId,actions:[transaction_1.functionCall("delete_request",{request_id:s},exports.MULTISIG_GAS,exports.MULTISIG_DEPOSIT)]})}catch(e){console.warn("Attempt to delete an earlier request before 15 minutes failed. Will try again.")}}async getRequestIds(){return this.viewFunction(this.accountId,"list_request_ids")}getRequest(){return this.storage?JSON.parse(this.storage.getItem(exports.MULTISIG_STORAGE_KEY)||"{}"):storageFallback[exports.MULTISIG_STORAGE_KEY]}setRequest(e){if(this.storage)return this.storage.setItem(exports.MULTISIG_STORAGE_KEY,JSON.stringify(e));storageFallback[exports.MULTISIG_STORAGE_KEY]=e}}exports.AccountMultisig=AccountMultisig;class Account2FA extends AccountMultisig{constructor(e,t,s){super(e,t,s),this.helperUrl="https://helper.testnet.near.org",this.helperUrl=s.helperUrl||this.helperUrl,this.storage=s.storage,this.sendCode=s.sendCode||this.sendCodeDefault,this.getCode=s.getCode||this.getCodeDefault,this.verifyCode=s.verifyCode||this.verifyCodeDefault,this.onConfirmResult=s.onConfirmResult}async signAndSendTransaction(...e){if("string"==typeof e[0]){return depd_1.default("Account.signAndSendTransaction(receiverId, actions")("use `Account2FA.signAndSendTransaction(SignAndSendTransactionOptions)` instead"),this.__signAndSendTransaction({receiverId:e[0],actions:e[1]})}return this.__signAndSendTransaction(e[0])}async __signAndSendTransaction({receiverId:e,actions:t}){await super.signAndSendTransaction({receiverId:e,actions:t}),await this.sendCode();const s=await this.promptAndVerify();return this.onConfirmResult&&await this.onConfirmResult(s),s}async deployMultisig(e){const{accountId:t}=this,s=(await this.getRecoveryMethods()).data.filter(({kind:e,publicKey:t})=>("phrase"===e||"ledger"===e)&&null!==t).map(e=>e.publicKey),n=(await this.getAccessKeys()).filter(({public_key:e,access_key:{permission:t}})=>"FullAccess"===t&&!s.includes(e)).map(e=>e.public_key).map(toPK),i=toPK((await this.postSignedJson("/2fa/getAccessKey",{accountId:t})).publicKey),r=Buffer.from(JSON.stringify({num_confirmations:2})),o=[...n.map(e=>transaction_1.deleteKey(e)),...n.map(e=>transaction_1.addKey(e,transaction_1.functionCallAccessKey(t,exports.MULTISIG_CHANGE_METHODS,null))),transaction_1.addKey(i,transaction_1.functionCallAccessKey(t,exports.MULTISIG_CONFIRM_METHODS,null)),transaction_1.deployContract(e)];return"11111111111111111111111111111111"===(await this.state()).code_hash&&o.push(transaction_1.functionCall("new",r,exports.MULTISIG_GAS,exports.MULTISIG_DEPOSIT)),console.log("deploying multisig contract for",t),await super.signAndSendTransactionWithAccount(t,o)}async disable(e){const{accountId:t}=this,s=(await this.getAccessKeys()).filter(({access_key:e})=>"FullAccess"!==e.permission).filter(({access_key:e})=>{const s=e.permission.FunctionCall;return s.receiver_id===t&&4===s.method_names.length&&s.method_names.includes("add_request_and_confirm")}),n=key_pair_1.PublicKey.from((await this.postSignedJson("/2fa/getAccessKey",{accountId:t})).publicKey),i=[transaction_1.deleteKey(n),...s.map(({public_key:e})=>transaction_1.deleteKey(key_pair_1.PublicKey.from(e))),...s.map(({public_key:e})=>transaction_1.addKey(key_pair_1.PublicKey.from(e),null)),transaction_1.deployContract(e)];return console.log("disabling 2fa for",t),await this.signAndSendTransaction({receiverId:t,actions:i})}async sendCodeDefault(){const{accountId:e}=this,{requestId:t}=this.getRequest(),s=await this.get2faMethod();return await this.postSignedJson("/2fa/send",{accountId:e,method:s,requestId:t}),t}async getCodeDefault(e){throw new Error('There is no getCode callback provided. Please provide your own in AccountMultisig constructor options. It has a parameter method where method.kind is "email" or "phone".')}async promptAndVerify(){const e=await this.get2faMethod(),t=await this.getCode(e);try{return await this.verifyCode(t)}catch(e){if(console.warn("Error validating security code:",e),e.toString().includes("invalid 2fa code provided")||e.toString().includes("2fa code not valid"))return await this.promptAndVerify();throw e}}async verifyCodeDefault(e){const{accountId:t}=this,s=this.getRequest();if(!s)throw new Error("no request pending");const{requestId:n}=s;return await this.postSignedJson("/2fa/verify",{accountId:t,securityCode:e,requestId:n})}async getRecoveryMethods(){const{accountId:e}=this;return{accountId:e,data:await this.postSignedJson("/account/recoveryMethods",{accountId:e})}}async get2faMethod(){let{data:e}=await this.getRecoveryMethods();if(e&&e.length&&(e=e.find(e=>0===e.kind.indexOf("2fa-"))),!e)return null;const{kind:t,detail:s}=e;return{kind:t,detail:s}}async signatureFor(){const{accountId:e}=this,t=(await this.connection.provider.block({finality:"final"})).header.height.toString(),s=await this.connection.signer.signMessage(Buffer.from(t),e,this.connection.networkId);return{blockNumber:t,blockNumberSignature:Buffer.from(s.signature).toString("base64")}}async postSignedJson(e,t){return await web_1.fetchJson(this.helperUrl+e,JSON.stringify({...t,...await this.signatureFor()}))}}exports.Account2FA=Account2FA;const toPK=e=>key_pair_1.PublicKey.from(e),convertPKForContract=e=>e.toString().replace("ed25519:",""),convertActions=(e,t,s)=>e.map(e=>{const n=e.enum,{gas:i,publicKey:r,methodName:o,args:a,deposit:c,accessKey:d,code:u}=e[n],l={type:n[0].toUpperCase()+n.substr(1),gas:i&&i.toString()||void 0,public_key:r&&convertPKForContract(r)||void 0,method_name:o,args:a&&Buffer.from(a).toString("base64")||void 0,code:u&&Buffer.from(u).toString("base64")||void 0,amount:c&&c.toString()||void 0,deposit:c&&c.toString()||"0",permission:void 0};if(d&&(s===t&&"fullAccess"!==d.permission.enum&&(l.permission={receiver_id:t,allowance:exports.MULTISIG_ALLOWANCE.toString(),method_names:exports.MULTISIG_CHANGE_METHODS}),"functionCall"===d.permission.enum)){const{receiverId:e,methodNames:t,allowance:s}=d.permission.functionCall;l.permission={receiver_id:e,allowance:s&&s.toString()||void 0,method_names:t}}return l});

}).call(this)}).call(this,require("buffer").Buffer)
},{"./account":2,"./transaction":23,"./utils/format":27,"./utils/key_pair":29,"./utils/web":32,"bn.js":37,"buffer":41,"depd":47}],5:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.connect=void 0;const near_1=require("./near");async function connect(e){return new near_1.Near(e)}exports.connect=connect;

},{"./near":17}],6:[function(require,module,exports){
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__exportStar=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||__createBinding(t,e,r)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.keyStores=__importStar(require("./key_stores/browser-index")),__exportStar(require("./common-index"),exports),__exportStar(require("./browser-connect"),exports),require("error-polyfill");

},{"./browser-connect":5,"./common-index":7,"./key_stores/browser-index":12,"error-polyfill":48}],7:[function(require,module,exports){
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t};Object.defineProperty(exports,"__esModule",{value:!0}),exports.WalletConnection=exports.WalletAccount=exports.ConnectedWalletAccount=exports.Near=exports.KeyPair=exports.Signer=exports.InMemorySigner=exports.Contract=exports.Connection=exports.Account=exports.multisig=exports.validators=exports.transactions=exports.utils=exports.providers=exports.accountCreator=void 0;const providers=__importStar(require("./providers"));exports.providers=providers;const utils=__importStar(require("./utils"));exports.utils=utils;const transactions=__importStar(require("./transaction"));exports.transactions=transactions;const validators=__importStar(require("./validators"));exports.validators=validators;const account_1=require("./account");Object.defineProperty(exports,"Account",{enumerable:!0,get:function(){return account_1.Account}});const multisig=__importStar(require("./account_multisig"));exports.multisig=multisig;const accountCreator=__importStar(require("./account_creator"));exports.accountCreator=accountCreator;const connection_1=require("./connection");Object.defineProperty(exports,"Connection",{enumerable:!0,get:function(){return connection_1.Connection}});const signer_1=require("./signer");Object.defineProperty(exports,"Signer",{enumerable:!0,get:function(){return signer_1.Signer}}),Object.defineProperty(exports,"InMemorySigner",{enumerable:!0,get:function(){return signer_1.InMemorySigner}});const contract_1=require("./contract");Object.defineProperty(exports,"Contract",{enumerable:!0,get:function(){return contract_1.Contract}});const key_pair_1=require("./utils/key_pair");Object.defineProperty(exports,"KeyPair",{enumerable:!0,get:function(){return key_pair_1.KeyPair}});const near_1=require("./near");Object.defineProperty(exports,"Near",{enumerable:!0,get:function(){return near_1.Near}});const wallet_account_1=require("./wallet-account");Object.defineProperty(exports,"ConnectedWalletAccount",{enumerable:!0,get:function(){return wallet_account_1.ConnectedWalletAccount}}),Object.defineProperty(exports,"WalletAccount",{enumerable:!0,get:function(){return wallet_account_1.WalletAccount}}),Object.defineProperty(exports,"WalletConnection",{enumerable:!0,get:function(){return wallet_account_1.WalletConnection}});

},{"./account":2,"./account_creator":3,"./account_multisig":4,"./connection":8,"./contract":10,"./near":17,"./providers":18,"./signer":22,"./transaction":23,"./utils":28,"./utils/key_pair":29,"./validators":33,"./wallet-account":34}],8:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Connection=void 0;const providers_1=require("./providers"),signer_1=require("./signer");function getProvider(e){switch(e.type){case void 0:return e;case"JsonRpcProvider":return new providers_1.JsonRpcProvider({...e.args});default:throw new Error(`Unknown provider type ${e.type}`)}}function getSigner(e){switch(e.type){case void 0:return e;case"InMemorySigner":return new signer_1.InMemorySigner(e.keyStore);default:throw new Error(`Unknown signer type ${e.type}`)}}class Connection{constructor(e,r,n){this.networkId=e,this.provider=r,this.signer=n}static fromConfig(e){const r=getProvider(e.provider),n=getSigner(e.signer);return new Connection(e.networkId,r,n)}}exports.Connection=Connection;

},{"./providers":18,"./signer":22}],9:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_FUNCTION_CALL_GAS=void 0;const bn_js_1=__importDefault(require("bn.js"));exports.DEFAULT_FUNCTION_CALL_GAS=new bn_js_1.default("30000000000000");

},{"bn.js":37}],10:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Contract=void 0;const bn_js_1=__importDefault(require("bn.js")),depd_1=__importDefault(require("depd")),providers_1=require("./providers"),errors_1=require("./utils/errors");function nameFunction(t,e){return{[t]:(...t)=>e(...t)}[t]}const isUint8Array=t=>t&&void 0!==t.byteLength&&t.byteLength===t.length,isObject=t=>"[object Object]"===Object.prototype.toString.call(t);class Contract{constructor(t,e,r){this.account=t,this.contractId=e;const{viewMethods:a=[],changeMethods:o=[]}=r;a.forEach(t=>{Object.defineProperty(this,t,{writable:!1,enumerable:!0,value:nameFunction(t,async(e={},r={},...a)=>{if(a.length||!isObject(e)&&!isUint8Array(e)||!isObject(r))throw new errors_1.PositionalArgsError;return this.account.viewFunction(this.contractId,t,e,r)})})}),o.forEach(t=>{Object.defineProperty(this,t,{writable:!1,enumerable:!0,value:nameFunction(t,async(...e)=>{if(e.length&&(e.length>3||!isObject(e[0])&&!isUint8Array(e[0])))throw new errors_1.PositionalArgsError;if(e.length>1||!e[0]||!e[0].args){return depd_1.default("contract.methodName(args, gas, amount)")("use `contract.methodName({ args, gas?, amount?, callbackUrl?, meta? })` instead"),this._changeMethod({methodName:t,args:e[0],gas:e[1],amount:e[2]})}return this._changeMethod({methodName:t,...e[0]})})})})}async _changeMethod({args:t,methodName:e,gas:r,amount:a,meta:o,callbackUrl:n}){validateBNLike({gas:r,amount:a});const s=await this.account.functionCall({contractId:this.contractId,methodName:e,args:t,gas:r,attachedDeposit:a,walletMeta:o,walletCallbackUrl:n});return providers_1.getTransactionLastResult(s)}}function validateBNLike(t){for(const e of Object.keys(t)){const r=t[e];if(r&&!bn_js_1.default.isBN(r)&&isNaN(r))throw new errors_1.ArgumentTypeError(e,"number, decimal string or BN",r)}}exports.Contract=Contract;

},{"./providers":18,"./utils/errors":25,"bn.js":37,"depd":47}],11:[function(require,module,exports){
module.exports={
    "schema": {
        "BadUTF16": {
            "name": "BadUTF16",
            "subtypes": [],
            "props": {}
        },
        "BadUTF8": {
            "name": "BadUTF8",
            "subtypes": [],
            "props": {}
        },
        "BalanceExceeded": {
            "name": "BalanceExceeded",
            "subtypes": [],
            "props": {}
        },
        "BreakpointTrap": {
            "name": "BreakpointTrap",
            "subtypes": [],
            "props": {}
        },
        "CacheError": {
            "name": "CacheError",
            "subtypes": [
                "ReadError",
                "WriteError",
                "DeserializationError",
                "SerializationError"
            ],
            "props": {}
        },
        "CallIndirectOOB": {
            "name": "CallIndirectOOB",
            "subtypes": [],
            "props": {}
        },
        "CannotAppendActionToJointPromise": {
            "name": "CannotAppendActionToJointPromise",
            "subtypes": [],
            "props": {}
        },
        "CannotReturnJointPromise": {
            "name": "CannotReturnJointPromise",
            "subtypes": [],
            "props": {}
        },
        "CodeDoesNotExist": {
            "name": "CodeDoesNotExist",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "CompilationError": {
            "name": "CompilationError",
            "subtypes": [
                "CodeDoesNotExist",
                "PrepareError",
                "WasmerCompileError"
            ],
            "props": {}
        },
        "ContractSizeExceeded": {
            "name": "ContractSizeExceeded",
            "subtypes": [],
            "props": {
                "limit": "",
                "size": ""
            }
        },
        "Deprecated": {
            "name": "Deprecated",
            "subtypes": [],
            "props": {
                "method_name": ""
            }
        },
        "Deserialization": {
            "name": "Deserialization",
            "subtypes": [],
            "props": {}
        },
        "DeserializationError": {
            "name": "DeserializationError",
            "subtypes": [],
            "props": {}
        },
        "EmptyMethodName": {
            "name": "EmptyMethodName",
            "subtypes": [],
            "props": {}
        },
        "FunctionCallError": {
            "name": "FunctionCallError",
            "subtypes": [
                "CompilationError",
                "LinkError",
                "MethodResolveError",
                "WasmTrap",
                "WasmUnknownError",
                "HostError",
                "EvmError"
            ],
            "props": {}
        },
        "GasExceeded": {
            "name": "GasExceeded",
            "subtypes": [],
            "props": {}
        },
        "GasInstrumentation": {
            "name": "GasInstrumentation",
            "subtypes": [],
            "props": {}
        },
        "GasLimitExceeded": {
            "name": "GasLimitExceeded",
            "subtypes": [],
            "props": {}
        },
        "GenericTrap": {
            "name": "GenericTrap",
            "subtypes": [],
            "props": {}
        },
        "GuestPanic": {
            "name": "GuestPanic",
            "subtypes": [],
            "props": {
                "panic_msg": ""
            }
        },
        "HostError": {
            "name": "HostError",
            "subtypes": [
                "BadUTF16",
                "BadUTF8",
                "GasExceeded",
                "GasLimitExceeded",
                "BalanceExceeded",
                "EmptyMethodName",
                "GuestPanic",
                "IntegerOverflow",
                "InvalidPromiseIndex",
                "CannotAppendActionToJointPromise",
                "CannotReturnJointPromise",
                "InvalidPromiseResultIndex",
                "InvalidRegisterId",
                "IteratorWasInvalidated",
                "MemoryAccessViolation",
                "InvalidReceiptIndex",
                "InvalidIteratorIndex",
                "InvalidAccountId",
                "InvalidMethodName",
                "InvalidPublicKey",
                "ProhibitedInView",
                "NumberOfLogsExceeded",
                "KeyLengthExceeded",
                "ValueLengthExceeded",
                "TotalLogLengthExceeded",
                "NumberPromisesExceeded",
                "NumberInputDataDependenciesExceeded",
                "ReturnedValueLengthExceeded",
                "ContractSizeExceeded",
                "Deprecated"
            ],
            "props": {}
        },
        "IllegalArithmetic": {
            "name": "IllegalArithmetic",
            "subtypes": [],
            "props": {}
        },
        "IncorrectCallIndirectSignature": {
            "name": "IncorrectCallIndirectSignature",
            "subtypes": [],
            "props": {}
        },
        "Instantiate": {
            "name": "Instantiate",
            "subtypes": [],
            "props": {}
        },
        "IntegerOverflow": {
            "name": "IntegerOverflow",
            "subtypes": [],
            "props": {}
        },
        "InternalMemoryDeclared": {
            "name": "InternalMemoryDeclared",
            "subtypes": [],
            "props": {}
        },
        "InvalidAccountId": {
            "name": "InvalidAccountId",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "InvalidIteratorIndex": {
            "name": "InvalidIteratorIndex",
            "subtypes": [],
            "props": {
                "iterator_index": ""
            }
        },
        "InvalidMethodName": {
            "name": "InvalidMethodName",
            "subtypes": [],
            "props": {}
        },
        "InvalidPromiseIndex": {
            "name": "InvalidPromiseIndex",
            "subtypes": [],
            "props": {
                "promise_idx": ""
            }
        },
        "InvalidPromiseResultIndex": {
            "name": "InvalidPromiseResultIndex",
            "subtypes": [],
            "props": {
                "result_idx": ""
            }
        },
        "InvalidPublicKey": {
            "name": "InvalidPublicKey",
            "subtypes": [],
            "props": {}
        },
        "InvalidReceiptIndex": {
            "name": "InvalidReceiptIndex",
            "subtypes": [],
            "props": {
                "receipt_index": ""
            }
        },
        "InvalidRegisterId": {
            "name": "InvalidRegisterId",
            "subtypes": [],
            "props": {
                "register_id": ""
            }
        },
        "IteratorWasInvalidated": {
            "name": "IteratorWasInvalidated",
            "subtypes": [],
            "props": {
                "iterator_index": ""
            }
        },
        "KeyLengthExceeded": {
            "name": "KeyLengthExceeded",
            "subtypes": [],
            "props": {
                "length": "",
                "limit": ""
            }
        },
        "LinkError": {
            "name": "LinkError",
            "subtypes": [],
            "props": {
                "msg": ""
            }
        },
        "Memory": {
            "name": "Memory",
            "subtypes": [],
            "props": {}
        },
        "MemoryAccessViolation": {
            "name": "MemoryAccessViolation",
            "subtypes": [],
            "props": {}
        },
        "MemoryOutOfBounds": {
            "name": "MemoryOutOfBounds",
            "subtypes": [],
            "props": {}
        },
        "MethodEmptyName": {
            "name": "MethodEmptyName",
            "subtypes": [],
            "props": {}
        },
        "MethodInvalidSignature": {
            "name": "MethodInvalidSignature",
            "subtypes": [],
            "props": {}
        },
        "MethodNotFound": {
            "name": "MethodNotFound",
            "subtypes": [],
            "props": {}
        },
        "MethodResolveError": {
            "name": "MethodResolveError",
            "subtypes": [
                "MethodEmptyName",
                "MethodUTF8Error",
                "MethodNotFound",
                "MethodInvalidSignature"
            ],
            "props": {}
        },
        "MethodUTF8Error": {
            "name": "MethodUTF8Error",
            "subtypes": [],
            "props": {}
        },
        "MisalignedAtomicAccess": {
            "name": "MisalignedAtomicAccess",
            "subtypes": [],
            "props": {}
        },
        "NumberInputDataDependenciesExceeded": {
            "name": "NumberInputDataDependenciesExceeded",
            "subtypes": [],
            "props": {
                "limit": "",
                "number_of_input_data_dependencies": ""
            }
        },
        "NumberOfLogsExceeded": {
            "name": "NumberOfLogsExceeded",
            "subtypes": [],
            "props": {
                "limit": ""
            }
        },
        "NumberPromisesExceeded": {
            "name": "NumberPromisesExceeded",
            "subtypes": [],
            "props": {
                "limit": "",
                "number_of_promises": ""
            }
        },
        "PrepareError": {
            "name": "PrepareError",
            "subtypes": [
                "Serialization",
                "Deserialization",
                "InternalMemoryDeclared",
                "GasInstrumentation",
                "StackHeightInstrumentation",
                "Instantiate",
                "Memory"
            ],
            "props": {}
        },
        "ProhibitedInView": {
            "name": "ProhibitedInView",
            "subtypes": [],
            "props": {
                "method_name": ""
            }
        },
        "ReadError": {
            "name": "ReadError",
            "subtypes": [],
            "props": {}
        },
        "ReturnedValueLengthExceeded": {
            "name": "ReturnedValueLengthExceeded",
            "subtypes": [],
            "props": {
                "length": "",
                "limit": ""
            }
        },
        "Serialization": {
            "name": "Serialization",
            "subtypes": [],
            "props": {}
        },
        "SerializationError": {
            "name": "SerializationError",
            "subtypes": [],
            "props": {
                "hash": ""
            }
        },
        "StackHeightInstrumentation": {
            "name": "StackHeightInstrumentation",
            "subtypes": [],
            "props": {}
        },
        "StackOverflow": {
            "name": "StackOverflow",
            "subtypes": [],
            "props": {}
        },
        "TotalLogLengthExceeded": {
            "name": "TotalLogLengthExceeded",
            "subtypes": [],
            "props": {
                "length": "",
                "limit": ""
            }
        },
        "Unreachable": {
            "name": "Unreachable",
            "subtypes": [],
            "props": {}
        },
        "ValueLengthExceeded": {
            "name": "ValueLengthExceeded",
            "subtypes": [],
            "props": {
                "length": "",
                "limit": ""
            }
        },
        "WasmTrap": {
            "name": "WasmTrap",
            "subtypes": [
                "Unreachable",
                "IncorrectCallIndirectSignature",
                "MemoryOutOfBounds",
                "CallIndirectOOB",
                "IllegalArithmetic",
                "MisalignedAtomicAccess",
                "BreakpointTrap",
                "StackOverflow",
                "GenericTrap"
            ],
            "props": {}
        },
        "WasmUnknownError": {
            "name": "WasmUnknownError",
            "subtypes": [],
            "props": {}
        },
        "WasmerCompileError": {
            "name": "WasmerCompileError",
            "subtypes": [],
            "props": {
                "msg": ""
            }
        },
        "WriteError": {
            "name": "WriteError",
            "subtypes": [],
            "props": {}
        },
        "AccessKeyNotFound": {
            "name": "AccessKeyNotFound",
            "subtypes": [],
            "props": {
                "account_id": "",
                "public_key": ""
            }
        },
        "AccountAlreadyExists": {
            "name": "AccountAlreadyExists",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "AccountDoesNotExist": {
            "name": "AccountDoesNotExist",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "ActionError": {
            "name": "ActionError",
            "subtypes": [
                "AccountAlreadyExists",
                "AccountDoesNotExist",
                "CreateAccountOnlyByRegistrar",
                "CreateAccountNotAllowed",
                "ActorNoPermission",
                "DeleteKeyDoesNotExist",
                "AddKeyAlreadyExists",
                "DeleteAccountStaking",
                "LackBalanceForState",
                "TriesToUnstake",
                "TriesToStake",
                "InsufficientStake",
                "FunctionCallError",
                "NewReceiptValidationError",
                "OnlyImplicitAccountCreationAllowed"
            ],
            "props": {
                "index": ""
            }
        },
        "ActionsValidationError": {
            "name": "ActionsValidationError",
            "subtypes": [
                "DeleteActionMustBeFinal",
                "TotalPrepaidGasExceeded",
                "TotalNumberOfActionsExceeded",
                "AddKeyMethodNamesNumberOfBytesExceeded",
                "AddKeyMethodNameLengthExceeded",
                "IntegerOverflow",
                "InvalidAccountId",
                "ContractSizeExceeded",
                "FunctionCallMethodNameLengthExceeded",
                "FunctionCallArgumentsLengthExceeded",
                "UnsuitableStakingKey",
                "FunctionCallZeroAttachedGas"
            ],
            "props": {}
        },
        "ActorNoPermission": {
            "name": "ActorNoPermission",
            "subtypes": [],
            "props": {
                "account_id": "",
                "actor_id": ""
            }
        },
        "AddKeyAlreadyExists": {
            "name": "AddKeyAlreadyExists",
            "subtypes": [],
            "props": {
                "account_id": "",
                "public_key": ""
            }
        },
        "AddKeyMethodNameLengthExceeded": {
            "name": "AddKeyMethodNameLengthExceeded",
            "subtypes": [],
            "props": {
                "length": "",
                "limit": ""
            }
        },
        "AddKeyMethodNamesNumberOfBytesExceeded": {
            "name": "AddKeyMethodNamesNumberOfBytesExceeded",
            "subtypes": [],
            "props": {
                "limit": "",
                "total_number_of_bytes": ""
            }
        },
        "BalanceMismatchError": {
            "name": "BalanceMismatchError",
            "subtypes": [],
            "props": {
                "final_accounts_balance": "",
                "final_postponed_receipts_balance": "",
                "incoming_receipts_balance": "",
                "incoming_validator_rewards": "",
                "initial_accounts_balance": "",
                "initial_postponed_receipts_balance": "",
                "new_delayed_receipts_balance": "",
                "other_burnt_amount": "",
                "outgoing_receipts_balance": "",
                "processed_delayed_receipts_balance": "",
                "slashed_burnt_amount": "",
                "tx_burnt_amount": ""
            }
        },
        "CostOverflow": {
            "name": "CostOverflow",
            "subtypes": [],
            "props": {}
        },
        "CreateAccountNotAllowed": {
            "name": "CreateAccountNotAllowed",
            "subtypes": [],
            "props": {
                "account_id": "",
                "predecessor_id": ""
            }
        },
        "CreateAccountOnlyByRegistrar": {
            "name": "CreateAccountOnlyByRegistrar",
            "subtypes": [],
            "props": {
                "account_id": "",
                "predecessor_id": "",
                "registrar_account_id": ""
            }
        },
        "DeleteAccountStaking": {
            "name": "DeleteAccountStaking",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "DeleteActionMustBeFinal": {
            "name": "DeleteActionMustBeFinal",
            "subtypes": [],
            "props": {}
        },
        "DeleteKeyDoesNotExist": {
            "name": "DeleteKeyDoesNotExist",
            "subtypes": [],
            "props": {
                "account_id": "",
                "public_key": ""
            }
        },
        "DepositWithFunctionCall": {
            "name": "DepositWithFunctionCall",
            "subtypes": [],
            "props": {}
        },
        "Expired": {
            "name": "Expired",
            "subtypes": [],
            "props": {}
        },
        "FunctionCallArgumentsLengthExceeded": {
            "name": "FunctionCallArgumentsLengthExceeded",
            "subtypes": [],
            "props": {
                "length": "",
                "limit": ""
            }
        },
        "FunctionCallMethodNameLengthExceeded": {
            "name": "FunctionCallMethodNameLengthExceeded",
            "subtypes": [],
            "props": {
                "length": "",
                "limit": ""
            }
        },
        "FunctionCallZeroAttachedGas": {
            "name": "FunctionCallZeroAttachedGas",
            "subtypes": [],
            "props": {}
        },
        "InsufficientStake": {
            "name": "InsufficientStake",
            "subtypes": [],
            "props": {
                "account_id": "",
                "minimum_stake": "",
                "stake": ""
            }
        },
        "InvalidAccessKeyError": {
            "name": "InvalidAccessKeyError",
            "subtypes": [
                "AccessKeyNotFound",
                "ReceiverMismatch",
                "MethodNameMismatch",
                "RequiresFullAccess",
                "NotEnoughAllowance",
                "DepositWithFunctionCall"
            ],
            "props": {}
        },
        "InvalidChain": {
            "name": "InvalidChain",
            "subtypes": [],
            "props": {}
        },
        "InvalidDataReceiverId": {
            "name": "InvalidDataReceiverId",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "InvalidNonce": {
            "name": "InvalidNonce",
            "subtypes": [],
            "props": {
                "ak_nonce": "",
                "tx_nonce": ""
            }
        },
        "InvalidPredecessorId": {
            "name": "InvalidPredecessorId",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "InvalidReceiverId": {
            "name": "InvalidReceiverId",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "InvalidSignature": {
            "name": "InvalidSignature",
            "subtypes": [],
            "props": {}
        },
        "InvalidSignerId": {
            "name": "InvalidSignerId",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "InvalidTxError": {
            "name": "InvalidTxError",
            "subtypes": [
                "InvalidAccessKeyError",
                "InvalidSignerId",
                "SignerDoesNotExist",
                "InvalidNonce",
                "InvalidReceiverId",
                "InvalidSignature",
                "NotEnoughBalance",
                "LackBalanceForState",
                "CostOverflow",
                "InvalidChain",
                "Expired",
                "ActionsValidation"
            ],
            "props": {}
        },
        "LackBalanceForState": {
            "name": "LackBalanceForState",
            "subtypes": [],
            "props": {
                "account_id": "",
                "amount": ""
            }
        },
        "MethodNameMismatch": {
            "name": "MethodNameMismatch",
            "subtypes": [],
            "props": {
                "method_name": ""
            }
        },
        "NotEnoughAllowance": {
            "name": "NotEnoughAllowance",
            "subtypes": [],
            "props": {
                "account_id": "",
                "allowance": "",
                "cost": "",
                "public_key": ""
            }
        },
        "NotEnoughBalance": {
            "name": "NotEnoughBalance",
            "subtypes": [],
            "props": {
                "balance": "",
                "cost": "",
                "signer_id": ""
            }
        },
        "OnlyImplicitAccountCreationAllowed": {
            "name": "OnlyImplicitAccountCreationAllowed",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "ReceiptValidationError": {
            "name": "ReceiptValidationError",
            "subtypes": [
                "InvalidPredecessorId",
                "InvalidReceiverId",
                "InvalidSignerId",
                "InvalidDataReceiverId",
                "ReturnedValueLengthExceeded",
                "NumberInputDataDependenciesExceeded",
                "ActionsValidation"
            ],
            "props": {}
        },
        "ReceiverMismatch": {
            "name": "ReceiverMismatch",
            "subtypes": [],
            "props": {
                "ak_receiver": "",
                "tx_receiver": ""
            }
        },
        "RequiresFullAccess": {
            "name": "RequiresFullAccess",
            "subtypes": [],
            "props": {}
        },
        "SignerDoesNotExist": {
            "name": "SignerDoesNotExist",
            "subtypes": [],
            "props": {
                "signer_id": ""
            }
        },
        "TotalNumberOfActionsExceeded": {
            "name": "TotalNumberOfActionsExceeded",
            "subtypes": [],
            "props": {
                "limit": "",
                "total_number_of_actions": ""
            }
        },
        "TotalPrepaidGasExceeded": {
            "name": "TotalPrepaidGasExceeded",
            "subtypes": [],
            "props": {
                "limit": "",
                "total_prepaid_gas": ""
            }
        },
        "TriesToStake": {
            "name": "TriesToStake",
            "subtypes": [],
            "props": {
                "account_id": "",
                "balance": "",
                "locked": "",
                "stake": ""
            }
        },
        "TriesToUnstake": {
            "name": "TriesToUnstake",
            "subtypes": [],
            "props": {
                "account_id": ""
            }
        },
        "TxExecutionError": {
            "name": "TxExecutionError",
            "subtypes": [
                "ActionError",
                "InvalidTxError"
            ],
            "props": {}
        },
        "UnsuitableStakingKey": {
            "name": "UnsuitableStakingKey",
            "subtypes": [],
            "props": {
                "public_key": ""
            }
        },
        "Closed": {
            "name": "Closed",
            "subtypes": [],
            "props": {}
        },
        "InternalError": {
            "name": "InternalError",
            "subtypes": [],
            "props": {}
        },
        "ServerError": {
            "name": "ServerError",
            "subtypes": [
                "TxExecutionError",
                "Timeout",
                "Closed",
                "InternalError"
            ],
            "props": {}
        },
        "Timeout": {
            "name": "Timeout",
            "subtypes": [],
            "props": {}
        }
    }
}

},{}],12:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MergeKeyStore=exports.BrowserLocalStorageKeyStore=exports.InMemoryKeyStore=exports.KeyStore=void 0;const keystore_1=require("./keystore");Object.defineProperty(exports,"KeyStore",{enumerable:!0,get:function(){return keystore_1.KeyStore}});const in_memory_key_store_1=require("./in_memory_key_store");Object.defineProperty(exports,"InMemoryKeyStore",{enumerable:!0,get:function(){return in_memory_key_store_1.InMemoryKeyStore}});const browser_local_storage_key_store_1=require("./browser_local_storage_key_store");Object.defineProperty(exports,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return browser_local_storage_key_store_1.BrowserLocalStorageKeyStore}});const merge_key_store_1=require("./merge_key_store");Object.defineProperty(exports,"MergeKeyStore",{enumerable:!0,get:function(){return merge_key_store_1.MergeKeyStore}});

},{"./browser_local_storage_key_store":13,"./in_memory_key_store":14,"./keystore":15,"./merge_key_store":16}],13:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BrowserLocalStorageKeyStore=void 0;const keystore_1=require("./keystore"),key_pair_1=require("../utils/key_pair"),LOCAL_STORAGE_KEY_PREFIX="near-api-js:keystore:";class BrowserLocalStorageKeyStore extends keystore_1.KeyStore{constructor(e=window.localStorage,t=LOCAL_STORAGE_KEY_PREFIX){super(),this.localStorage=e,this.prefix=t}async setKey(e,t,r){this.localStorage.setItem(this.storageKeyForSecretKey(e,t),r.toString())}async getKey(e,t){const r=this.localStorage.getItem(this.storageKeyForSecretKey(e,t));return r?key_pair_1.KeyPair.fromString(r):null}async removeKey(e,t){this.localStorage.removeItem(this.storageKeyForSecretKey(e,t))}async clear(){for(const e of this.storageKeys())e.startsWith(this.prefix)&&this.localStorage.removeItem(e)}async getNetworks(){const e=new Set;for(const t of this.storageKeys())if(t.startsWith(this.prefix)){const r=t.substring(this.prefix.length).split(":");e.add(r[1])}return Array.from(e.values())}async getAccounts(e){const t=new Array;for(const r of this.storageKeys())if(r.startsWith(this.prefix)){const s=r.substring(this.prefix.length).split(":");s[1]===e&&t.push(s[0])}return t}storageKeyForSecretKey(e,t){return`${this.prefix}${t}:${e}`}*storageKeys(){for(let e=0;e<this.localStorage.length;e++)yield this.localStorage.key(e)}}exports.BrowserLocalStorageKeyStore=BrowserLocalStorageKeyStore;

},{"../utils/key_pair":29,"./keystore":15}],14:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InMemoryKeyStore=void 0;const keystore_1=require("./keystore"),key_pair_1=require("../utils/key_pair");class InMemoryKeyStore extends keystore_1.KeyStore{constructor(){super(),this.keys={}}async setKey(e,t,r){this.keys[`${t}:${e}`]=r.toString()}async getKey(e,t){const r=this.keys[`${t}:${e}`];return r?key_pair_1.KeyPair.fromString(r):null}async removeKey(e,t){delete this.keys[`${t}:${e}`]}async clear(){this.keys={}}async getNetworks(){const e=new Set;return Object.keys(this.keys).forEach(t=>{const r=t.split(":");e.add(r[1])}),Array.from(e.values())}async getAccounts(e){const t=new Array;return Object.keys(this.keys).forEach(r=>{const s=r.split(":");s[s.length-1]===e&&t.push(s.slice(0,s.length-1).join(":"))}),t}toString(){return"InMemoryKeyStore"}}exports.InMemoryKeyStore=InMemoryKeyStore;

},{"../utils/key_pair":29,"./keystore":15}],15:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KeyStore=void 0;class KeyStore{}exports.KeyStore=KeyStore;

},{}],16:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MergeKeyStore=void 0;const keystore_1=require("./keystore");class MergeKeyStore extends keystore_1.KeyStore{constructor(e,t={writeKeyStoreIndex:0}){super(),this.options=t,this.keyStores=e}async setKey(e,t,r){await this.keyStores[this.options.writeKeyStoreIndex].setKey(e,t,r)}async getKey(e,t){for(const r of this.keyStores){const o=await r.getKey(e,t);if(o)return o}return null}async removeKey(e,t){for(const r of this.keyStores)await r.removeKey(e,t)}async clear(){for(const e of this.keyStores)await e.clear()}async getNetworks(){const e=new Set;for(const t of this.keyStores)for(const r of await t.getNetworks())e.add(r);return Array.from(e)}async getAccounts(e){const t=new Set;for(const r of this.keyStores)for(const o of await r.getAccounts(e))t.add(o);return Array.from(t)}toString(){return`MergeKeyStore(${this.keyStores.join(", ")})`}}exports.MergeKeyStore=MergeKeyStore;

},{"./keystore":15}],17:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Near=void 0;const bn_js_1=__importDefault(require("bn.js")),account_1=require("./account"),connection_1=require("./connection"),contract_1=require("./contract"),account_creator_1=require("./account_creator");class Near{constructor(n){if(this.config=n,this.connection=connection_1.Connection.fromConfig({networkId:n.networkId,provider:{type:"JsonRpcProvider",args:{url:n.nodeUrl,headers:n.headers}},signer:n.signer||{type:"InMemorySigner",keyStore:n.keyStore||n.deps.keyStore}}),n.masterAccount){const t=n.initialBalance?new bn_js_1.default(n.initialBalance):new bn_js_1.default("500000000000000000000000000");this.accountCreator=new account_creator_1.LocalAccountCreator(new account_1.Account(this.connection,n.masterAccount),t)}else n.helperUrl?this.accountCreator=new account_creator_1.UrlAccountCreator(this.connection,n.helperUrl):this.accountCreator=null}async account(n){return new account_1.Account(this.connection,n)}async createAccount(n,t){if(!this.accountCreator)throw new Error("Must specify account creator, either via masterAccount or helperUrl configuration settings.");return await this.accountCreator.createAccount(n,t),new account_1.Account(this.connection,n)}async loadContract(n,t){const e=new account_1.Account(this.connection,t.sender);return new contract_1.Contract(e,n,t)}async sendTokens(n,t,e){console.warn("near.sendTokens is deprecated. Use `yourAccount.sendMoney` instead.");const c=new account_1.Account(this.connection,t);return(await c.sendMoney(e,n)).transaction_outcome.id}}exports.Near=Near;

},{"./account":2,"./account_creator":3,"./connection":8,"./contract":10,"bn.js":37}],18:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ErrorContext=exports.TypedError=exports.getTransactionLastResult=exports.FinalExecutionStatusBasic=exports.JsonRpcProvider=exports.Provider=void 0;const provider_1=require("./provider");Object.defineProperty(exports,"Provider",{enumerable:!0,get:function(){return provider_1.Provider}}),Object.defineProperty(exports,"getTransactionLastResult",{enumerable:!0,get:function(){return provider_1.getTransactionLastResult}}),Object.defineProperty(exports,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return provider_1.FinalExecutionStatusBasic}});const json_rpc_provider_1=require("./json-rpc-provider");Object.defineProperty(exports,"JsonRpcProvider",{enumerable:!0,get:function(){return json_rpc_provider_1.JsonRpcProvider}}),Object.defineProperty(exports,"TypedError",{enumerable:!0,get:function(){return json_rpc_provider_1.TypedError}}),Object.defineProperty(exports,"ErrorContext",{enumerable:!0,get:function(){return json_rpc_provider_1.ErrorContext}});

},{"./json-rpc-provider":19,"./provider":20}],19:[function(require,module,exports){
(function (process,Buffer){(function (){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonRpcProvider=exports.ErrorContext=exports.TypedError=void 0;const depd_1=__importDefault(require("depd")),provider_1=require("./provider"),web_1=require("../utils/web"),errors_1=require("../utils/errors");Object.defineProperty(exports,"TypedError",{enumerable:!0,get:function(){return errors_1.TypedError}}),Object.defineProperty(exports,"ErrorContext",{enumerable:!0,get:function(){return errors_1.ErrorContext}});const borsh_1=require("borsh"),exponential_backoff_1=__importDefault(require("../utils/exponential-backoff")),rpc_errors_1=require("../utils/rpc_errors"),REQUEST_RETRY_NUMBER=12,REQUEST_RETRY_WAIT=500,REQUEST_RETRY_WAIT_BACKOFF=1.5;let _nextId=123;class JsonRpcProvider extends provider_1.Provider{constructor(e){if(super(),null!=e&&"object"==typeof e)this.connection=e;else{depd_1.default("JsonRpcProvider(url?: string)")("use `JsonRpcProvider(connectionInfo: ConnectionInfo)` instead"),this.connection={url:e}}}async status(){return this.sendJsonRpc("status",[])}async sendTransaction(e){const r=e.encode();return this.sendJsonRpc("broadcast_tx_commit",[Buffer.from(r).toString("base64")])}async sendTransactionAsync(e){const r=e.encode();return this.sendJsonRpc("broadcast_tx_async",[Buffer.from(r).toString("base64")])}async txStatus(e,r){return"string"==typeof e?this.txStatusString(e,r):this.txStatusUint8Array(e,r)}async txStatusUint8Array(e,r){return this.sendJsonRpc("tx",[borsh_1.baseEncode(e),r])}async txStatusString(e,r){return this.sendJsonRpc("tx",[e,r])}async txStatusReceipts(e,r){return this.sendJsonRpc("EXPERIMENTAL_tx_status",[borsh_1.baseEncode(e),r])}async query(...e){let r;if(1===e.length)r=await this.sendJsonRpc("query",e[0]);else{const[t,n]=e;r=await this.sendJsonRpc("query",[t,n])}if(r&&r.error)throw new errors_1.TypedError(`Querying ${e} failed: ${r.error}.\n${JSON.stringify(r,null,2)}`,rpc_errors_1.getErrorTypeFromErrorMessage(r.error));return r}async block(e){const{finality:r}=e;let{blockId:t}=e;if("object"!=typeof e){depd_1.default("JsonRpcProvider.block(blockId)")("use `block({ blockId })` or `block({ finality })` instead"),t=e}return this.sendJsonRpc("block",{block_id:t,finality:r})}async blockChanges(e){const{finality:r}=e,{blockId:t}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:t,finality:r})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_genesisConfig(){return depd_1.default("JsonRpcProvider.experimental_protocolConfig()")("use `experimental_protocolConfig({ sync_checkpoint: 'genesis' })` to fetch the up-to-date or genesis protocol config explicitly"),await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{sync_checkpoint:"genesis"})}async experimental_protocolConfig(e){return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",e)}async experimental_lightClientProof(e){return depd_1.default("JsonRpcProvider.experimental_lightClientProof(request)")("use `lightClientProof` instead"),await this.lightClientProof(e)}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}async accessKeyChanges(e,r){const{finality:t}=r,{blockId:n}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:n,finality:t})}async singleAccessKeyChanges(e,r){const{finality:t}=r,{blockId:n}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:n,finality:t})}async accountChanges(e,r){const{finality:t}=r,{blockId:n}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:n,finality:t})}async contractStateChanges(e,r,t=""){const{finality:n}=r,{blockId:o}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:t,block_id:o,finality:n})}async contractCodeChanges(e,r){const{finality:t}=r,{blockId:n}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:n,finality:t})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,r){const t=await exponential_backoff_1.default(REQUEST_RETRY_WAIT,REQUEST_RETRY_NUMBER,REQUEST_RETRY_WAIT_BACKOFF,async()=>{try{const t={method:e,params:r,id:_nextId++,jsonrpc:"2.0"},n=await web_1.fetchJson(this.connection,JSON.stringify(t));if(n.error){if("object"==typeof n.error.data){if("string"==typeof n.error.data.error_message&&"string"==typeof n.error.data.error_type)throw new errors_1.TypedError(n.error.data.error_message,n.error.data.error_type);throw rpc_errors_1.parseRpcError(n.error.data)}{const e=`[${n.error.code}] ${n.error.message}: ${n.error.data}`;if("Timeout"===n.error.data||e.includes("Timeout error")||e.includes("query has timed out"))throw new errors_1.TypedError(e,"TimeoutError");throw new errors_1.TypedError(e,rpc_errors_1.getErrorTypeFromErrorMessage(n.error.data))}}return n}catch(t){if("TimeoutError"===t.type)return process.env.NEAR_NO_LOGS||console.warn(`Retrying request to ${e} as it has timed out`,r),null;throw t}}),{result:n}=t;if(void 0===n)throw new errors_1.TypedError(`Exceeded ${REQUEST_RETRY_NUMBER} attempts for request to ${e}.`,"RetriesExceeded");return n}}exports.JsonRpcProvider=JsonRpcProvider;

}).call(this)}).call(this,require('_process'),require("buffer").Buffer)
},{"../utils/errors":25,"../utils/exponential-backoff":26,"../utils/rpc_errors":30,"../utils/web":32,"./provider":20,"_process":67,"borsh":38,"buffer":41,"depd":47}],20:[function(require,module,exports){
(function (Buffer){(function (){
"use strict";var ExecutionStatusBasic,FinalExecutionStatusBasic,IdType;Object.defineProperty(exports,"__esModule",{value:!0}),exports.getTransactionLastResult=exports.Provider=exports.IdType=exports.FinalExecutionStatusBasic=exports.ExecutionStatusBasic=void 0,function(t){t.Unknown="Unknown",t.Pending="Pending",t.Failure="Failure"}(ExecutionStatusBasic=exports.ExecutionStatusBasic||(exports.ExecutionStatusBasic={})),function(t){t.NotStarted="NotStarted",t.Started="Started",t.Failure="Failure"}(FinalExecutionStatusBasic=exports.FinalExecutionStatusBasic||(exports.FinalExecutionStatusBasic={})),function(t){t.Transaction="transaction",t.Receipt="receipt"}(IdType=exports.IdType||(exports.IdType={}));class Provider{}function getTransactionLastResult(t){if("object"==typeof t.status&&"string"==typeof t.status.SuccessValue){const e=Buffer.from(t.status.SuccessValue,"base64").toString();try{return JSON.parse(e)}catch(t){return e}}return null}exports.Provider=Provider,exports.getTransactionLastResult=getTransactionLastResult;

}).call(this)}).call(this,require("buffer").Buffer)
},{"buffer":41}],21:[function(require,module,exports){
module.exports={
    "GasLimitExceeded": "Exceeded the maximum amount of gas allowed to burn per contract",
    "MethodEmptyName": "Method name is empty",
    "WasmerCompileError": "Wasmer compilation error: {{msg}}",
    "GuestPanic": "Smart contract panicked: {{panic_msg}}",
    "Memory": "Error creating Wasm memory",
    "GasExceeded": "Exceeded the prepaid gas",
    "MethodUTF8Error": "Method name is not valid UTF8 string",
    "BadUTF16": "String encoding is bad UTF-16 sequence",
    "WasmTrap": "WebAssembly trap: {{msg}}",
    "GasInstrumentation": "Gas instrumentation failed or contract has denied instructions.",
    "InvalidPromiseIndex": "{{promise_idx}} does not correspond to existing promises",
    "InvalidPromiseResultIndex": "Accessed invalid promise result index: {{result_idx}}",
    "Deserialization": "Error happened while deserializing the module",
    "MethodNotFound": "Contract method is not found",
    "InvalidRegisterId": "Accessed invalid register id: {{register_id}}",
    "InvalidReceiptIndex": "VM Logic returned an invalid receipt index: {{receipt_index}}",
    "EmptyMethodName": "Method name is empty in contract call",
    "CannotReturnJointPromise": "Returning joint promise is currently prohibited",
    "StackHeightInstrumentation": "Stack instrumentation failed",
    "CodeDoesNotExist": "Cannot find contract code for account {{account_id}}",
    "MethodInvalidSignature": "Invalid method signature",
    "IntegerOverflow": "Integer overflow happened during contract execution",
    "MemoryAccessViolation": "MemoryAccessViolation",
    "InvalidIteratorIndex": "Iterator index {{iterator_index}} does not exist",
    "IteratorWasInvalidated": "Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",
    "InvalidAccountId": "VM Logic returned an invalid account id",
    "Serialization": "Error happened while serializing the module",
    "CannotAppendActionToJointPromise": "Actions can only be appended to non-joint promise.",
    "InternalMemoryDeclared": "Internal memory declaration has been found in the module",
    "Instantiate": "Error happened during instantiation",
    "ProhibitedInView": "{{method_name}} is not allowed in view calls",
    "InvalidMethodName": "VM Logic returned an invalid method name",
    "BadUTF8": "String encoding is bad UTF-8 sequence",
    "BalanceExceeded": "Exceeded the account balance",
    "LinkError": "Wasm contract link error: {{msg}}",
    "InvalidPublicKey": "VM Logic provided an invalid public key",
    "ActorNoPermission": "Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",
    "LackBalanceForState": "The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",
    "ReceiverMismatch": "Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",
    "CostOverflow": "Transaction gas or balance cost is too high",
    "InvalidSignature": "Transaction is not signed with the given public key",
    "AccessKeyNotFound": "Signer \"{{account_id}}\" doesn't have access key with the given public_key {{public_key}}",
    "NotEnoughBalance": "Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",
    "NotEnoughAllowance": "Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",
    "Expired": "Transaction has expired",
    "DeleteAccountStaking": "Account {{account_id}} is staking and can not be deleted",
    "SignerDoesNotExist": "Signer {{signer_id}} does not exist",
    "TriesToStake": "Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",
    "AddKeyAlreadyExists": "The public key {{public_key}} is already used for an existing access key",
    "InvalidSigner": "Invalid signer account ID {{signer_id}} according to requirements",
    "CreateAccountNotAllowed": "The new account_id {{account_id}} can't be created by {{predecessor_id}}",
    "RequiresFullAccess": "The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",
    "TriesToUnstake": "Account {{account_id}} is not yet staked, but tried to unstake",
    "InvalidNonce": "Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",
    "AccountAlreadyExists": "Can't create a new account {{account_id}}, because it already exists",
    "InvalidChain": "Transaction parent block hash doesn't belong to the current chain",
    "AccountDoesNotExist": "Can't complete the action because account {{account_id}} doesn't exist",
    "MethodNameMismatch": "Transaction method name {{method_name}} isn't allowed by the access key",
    "DeleteAccountHasRent": "Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",
    "DeleteAccountHasEnoughBalance": "Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",
    "InvalidReceiver": "Invalid receiver account ID {{receiver_id}} according to requirements",
    "DeleteKeyDoesNotExist": "Account {{account_id}} tries to remove an access key that doesn't exist",
    "Timeout": "Timeout exceeded",
    "Closed": "Connection closed"
}

},{}],22:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.InMemorySigner=exports.Signer=void 0;const js_sha256_1=__importDefault(require("js-sha256")),key_pair_1=require("./utils/key_pair"),in_memory_key_store_1=require("./key_stores/in_memory_key_store");class Signer{}exports.Signer=Signer;class InMemorySigner extends Signer{constructor(e){super(),this.keyStore=e}static async fromKeyPair(e,r,t){const n=new in_memory_key_store_1.InMemoryKeyStore;return await n.setKey(e,r,t),new InMemorySigner(n)}async createKey(e,r){const t=key_pair_1.KeyPair.fromRandom("ed25519");return await this.keyStore.setKey(r,e,t),t.getPublicKey()}async getPublicKey(e,r){const t=await this.keyStore.getKey(r,e);return null===t?null:t.getPublicKey()}async signMessage(e,r,t){const n=new Uint8Array(js_sha256_1.default.sha256.array(e));if(!r)throw new Error("InMemorySigner requires provided account id");const i=await this.keyStore.getKey(t,r);if(null===i)throw new Error(`Key for ${r} not found in ${t}`);return i.sign(n)}toString(){return`InMemorySigner(${this.keyStore})`}}exports.InMemorySigner=InMemorySigner;

},{"./key_stores/in_memory_key_store":14,"./utils/key_pair":29,"js-sha256":61}],23:[function(require,module,exports){
(function (Buffer){(function (){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.signTransaction=exports.createTransaction=exports.SCHEMA=exports.Action=exports.SignedTransaction=exports.Transaction=exports.Signature=exports.deleteAccount=exports.deleteKey=exports.addKey=exports.stake=exports.transfer=exports.functionCall=exports.stringifyJsonOrBytes=exports.deployContract=exports.createAccount=exports.DeleteAccount=exports.DeleteKey=exports.AddKey=exports.Stake=exports.Transfer=exports.FunctionCall=exports.DeployContract=exports.CreateAccount=exports.IAction=exports.functionCallAccessKey=exports.fullAccessKey=exports.AccessKey=exports.AccessKeyPermission=exports.FullAccessPermission=exports.FunctionCallPermission=void 0;const js_sha256_1=__importDefault(require("js-sha256")),enums_1=require("./utils/enums"),borsh_1=require("borsh"),key_pair_1=require("./utils/key_pair");class FunctionCallPermission extends enums_1.Assignable{}exports.FunctionCallPermission=FunctionCallPermission;class FullAccessPermission extends enums_1.Assignable{}exports.FullAccessPermission=FullAccessPermission;class AccessKeyPermission extends enums_1.Enum{}exports.AccessKeyPermission=AccessKeyPermission;class AccessKey extends enums_1.Assignable{}function fullAccessKey(){return new AccessKey({nonce:0,permission:new AccessKeyPermission({fullAccess:new FullAccessPermission({})})})}function functionCallAccessKey(e,s,t){return new AccessKey({nonce:0,permission:new AccessKeyPermission({functionCall:new FunctionCallPermission({receiverId:e,allowance:t,methodNames:s})})})}exports.AccessKey=AccessKey,exports.fullAccessKey=fullAccessKey,exports.functionCallAccessKey=functionCallAccessKey;class IAction extends enums_1.Assignable{}exports.IAction=IAction;class CreateAccount extends IAction{}exports.CreateAccount=CreateAccount;class DeployContract extends IAction{}exports.DeployContract=DeployContract;class FunctionCall extends IAction{}exports.FunctionCall=FunctionCall;class Transfer extends IAction{}exports.Transfer=Transfer;class Stake extends IAction{}exports.Stake=Stake;class AddKey extends IAction{}exports.AddKey=AddKey;class DeleteKey extends IAction{}exports.DeleteKey=DeleteKey;class DeleteAccount extends IAction{}function createAccount(){return new Action({createAccount:new CreateAccount({})})}function deployContract(e){return new Action({deployContract:new DeployContract({code:e})})}function stringifyJsonOrBytes(e){return void 0!==e.byteLength&&e.byteLength===e.length?e:Buffer.from(JSON.stringify(e))}function functionCall(e,s,t,n,c=stringifyJsonOrBytes){return new Action({functionCall:new FunctionCall({methodName:e,args:c(s),gas:t,deposit:n})})}function transfer(e){return new Action({transfer:new Transfer({deposit:e})})}function stake(e,s){return new Action({stake:new Stake({stake:e,publicKey:s})})}function addKey(e,s){return new Action({addKey:new AddKey({publicKey:e,accessKey:s})})}function deleteKey(e){return new Action({deleteKey:new DeleteKey({publicKey:e})})}function deleteAccount(e){return new Action({deleteAccount:new DeleteAccount({beneficiaryId:e})})}exports.DeleteAccount=DeleteAccount,exports.createAccount=createAccount,exports.deployContract=deployContract,exports.stringifyJsonOrBytes=stringifyJsonOrBytes,exports.functionCall=functionCall,exports.transfer=transfer,exports.stake=stake,exports.addKey=addKey,exports.deleteKey=deleteKey,exports.deleteAccount=deleteAccount;class Signature extends enums_1.Assignable{}exports.Signature=Signature;class Transaction extends enums_1.Assignable{encode(){return borsh_1.serialize(exports.SCHEMA,this)}static decode(e){return borsh_1.deserialize(exports.SCHEMA,Transaction,e)}}exports.Transaction=Transaction;class SignedTransaction extends enums_1.Assignable{encode(){return borsh_1.serialize(exports.SCHEMA,this)}static decode(e){return borsh_1.deserialize(exports.SCHEMA,SignedTransaction,e)}}exports.SignedTransaction=SignedTransaction;class Action extends enums_1.Enum{}function createTransaction(e,s,t,n,c,r){return new Transaction({signerId:e,publicKey:s,nonce:n,receiverId:t,actions:c,blockHash:r})}async function signTransactionObject(e,s,t,n){const c=borsh_1.serialize(exports.SCHEMA,e),r=new Uint8Array(js_sha256_1.default.sha256.array(c)),i=await s.signMessage(c,t,n);return[r,new SignedTransaction({transaction:e,signature:new Signature({keyType:e.publicKey.keyType,data:i.signature})})]}async function signTransaction(...e){if(e[0].constructor===Transaction){const[s,t,n,c]=e;return signTransactionObject(s,t,n,c)}{const[s,t,n,c,r,i,o]=e;return signTransactionObject(createTransaction(i,await r.getPublicKey(i,o),s,t,n,c),r,i,o)}}exports.Action=Action,exports.SCHEMA=new Map([[Signature,{kind:"struct",fields:[["keyType","u8"],["data",[64]]]}],[SignedTransaction,{kind:"struct",fields:[["transaction",Transaction],["signature",Signature]]}],[Transaction,{kind:"struct",fields:[["signerId","string"],["publicKey",key_pair_1.PublicKey],["nonce","u64"],["receiverId","string"],["blockHash",[32]],["actions",[Action]]]}],[key_pair_1.PublicKey,{kind:"struct",fields:[["keyType","u8"],["data",[32]]]}],[AccessKey,{kind:"struct",fields:[["nonce","u64"],["permission",AccessKeyPermission]]}],[AccessKeyPermission,{kind:"enum",field:"enum",values:[["functionCall",FunctionCallPermission],["fullAccess",FullAccessPermission]]}],[FunctionCallPermission,{kind:"struct",fields:[["allowance",{kind:"option",type:"u128"}],["receiverId","string"],["methodNames",["string"]]]}],[FullAccessPermission,{kind:"struct",fields:[]}],[Action,{kind:"enum",field:"enum",values:[["createAccount",CreateAccount],["deployContract",DeployContract],["functionCall",FunctionCall],["transfer",Transfer],["stake",Stake],["addKey",AddKey],["deleteKey",DeleteKey],["deleteAccount",DeleteAccount]]}],[CreateAccount,{kind:"struct",fields:[]}],[DeployContract,{kind:"struct",fields:[["code",["u8"]]]}],[FunctionCall,{kind:"struct",fields:[["methodName","string"],["args",["u8"]],["gas","u64"],["deposit","u128"]]}],[Transfer,{kind:"struct",fields:[["deposit","u128"]]}],[Stake,{kind:"struct",fields:[["stake","u128"],["publicKey",key_pair_1.PublicKey]]}],[AddKey,{kind:"struct",fields:[["publicKey",key_pair_1.PublicKey],["accessKey",AccessKey]]}],[DeleteKey,{kind:"struct",fields:[["publicKey",key_pair_1.PublicKey]]}],[DeleteAccount,{kind:"struct",fields:[["beneficiaryId","string"]]}]]),exports.createTransaction=createTransaction,exports.signTransaction=signTransaction;

}).call(this)}).call(this,require("buffer").Buffer)
},{"./utils/enums":24,"./utils/key_pair":29,"borsh":38,"buffer":41,"js-sha256":61}],24:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Assignable=exports.Enum=void 0;class Enum{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(s=>{this[s]=e[s],this.enum=s})}}exports.Enum=Enum;class Assignable{constructor(e){Object.keys(e).map(s=>{this[s]=e[s]})}}exports.Assignable=Assignable;

},{}],25:[function(require,module,exports){
(function (process){(function (){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.logWarning=exports.ErrorContext=exports.TypedError=exports.ArgumentTypeError=exports.PositionalArgsError=void 0;class PositionalArgsError extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}exports.PositionalArgsError=PositionalArgsError;class ArgumentTypeError extends Error{constructor(r,o,e){super(`Expected ${o} for '${r}' argument, but got '${JSON.stringify(e)}'`)}}exports.ArgumentTypeError=ArgumentTypeError;class TypedError extends Error{constructor(r,o,e){super(r),this.type=o||"UntypedError",this.context=e}}exports.TypedError=TypedError;class ErrorContext{constructor(r){this.transactionHash=r}}function logWarning(...r){process.env.NEAR_NO_LOGS||console.warn(...r)}exports.ErrorContext=ErrorContext,exports.logWarning=logWarning;

}).call(this)}).call(this,require('_process'))
},{"_process":67}],26:[function(require,module,exports){
"use strict";async function exponentialBackoff(e,t,n,o){let r=e;for(let e=0;e<t;e++){const e=await o();if(e)return e;await sleep(r),r*=n}return null}function sleep(e){return new Promise(t=>setTimeout(t,e))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exponentialBackoff;

},{}],27:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseNearAmount=exports.formatNearAmount=exports.NEAR_NOMINATION=exports.NEAR_NOMINATION_EXP=void 0;const bn_js_1=__importDefault(require("bn.js"));exports.NEAR_NOMINATION_EXP=24,exports.NEAR_NOMINATION=new bn_js_1.default("10",10).pow(new bn_js_1.default(exports.NEAR_NOMINATION_EXP,10));const ROUNDING_OFFSETS=[],BN10=new bn_js_1.default(10);for(let t=0,e=new bn_js_1.default(5);t<exports.NEAR_NOMINATION_EXP;t++,e=e.mul(BN10))ROUNDING_OFFSETS[t]=e;function formatNearAmount(t,e=exports.NEAR_NOMINATION_EXP){const r=new bn_js_1.default(t,10);if(e!==exports.NEAR_NOMINATION_EXP){const t=exports.NEAR_NOMINATION_EXP-e-1;t>0&&r.iadd(ROUNDING_OFFSETS[t])}const N=(t=r.toString()).substring(0,t.length-exports.NEAR_NOMINATION_EXP)||"0",n=t.substring(t.length-exports.NEAR_NOMINATION_EXP).padStart(exports.NEAR_NOMINATION_EXP,"0").substring(0,e);return trimTrailingZeroes(`${formatWithCommas(N)}.${n}`)}function parseNearAmount(t){if(!t)return null;const e=(t=cleanupAmount(t)).split("."),r=e[0],N=e[1]||"";if(e.length>2||N.length>exports.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);return trimLeadingZeroes(r+N.padEnd(exports.NEAR_NOMINATION_EXP,"0"))}function cleanupAmount(t){return t.replace(/,/g,"").trim()}function trimTrailingZeroes(t){return t.replace(/\.?0*$/,"")}function trimLeadingZeroes(t){return""===(t=t.replace(/^0+/,""))?"0":t}function formatWithCommas(t){const e=/(-?\d+)(\d{3})/;for(;e.test(t);)t=t.replace(e,"$1,$2");return t}exports.formatNearAmount=formatNearAmount,exports.parseNearAmount=parseNearAmount;

},{"bn.js":37}],28:[function(require,module,exports){
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.hasOwnProperty.call(e,t)&&__createBinding(r,e,t);return __setModuleDefault(r,e),r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.logWarning=exports.rpc_errors=exports.KeyPairEd25519=exports.KeyPair=exports.PublicKey=exports.format=exports.enums=exports.web=exports.serialize=exports.key_pair=void 0;const key_pair=__importStar(require("./key_pair"));exports.key_pair=key_pair;const serialize=__importStar(require("./serialize"));exports.serialize=serialize;const web=__importStar(require("./web"));exports.web=web;const enums=__importStar(require("./enums"));exports.enums=enums;const format=__importStar(require("./format"));exports.format=format;const rpc_errors=__importStar(require("./rpc_errors"));exports.rpc_errors=rpc_errors;const key_pair_1=require("./key_pair");Object.defineProperty(exports,"PublicKey",{enumerable:!0,get:function(){return key_pair_1.PublicKey}}),Object.defineProperty(exports,"KeyPair",{enumerable:!0,get:function(){return key_pair_1.KeyPair}}),Object.defineProperty(exports,"KeyPairEd25519",{enumerable:!0,get:function(){return key_pair_1.KeyPairEd25519}});const errors_1=require("./errors");Object.defineProperty(exports,"logWarning",{enumerable:!0,get:function(){return errors_1.logWarning}});

},{"./enums":24,"./errors":25,"./format":27,"./key_pair":29,"./rpc_errors":30,"./serialize":31,"./web":32}],29:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.KeyPairEd25519=exports.KeyPair=exports.PublicKey=exports.KeyType=void 0;const tweetnacl_1=__importDefault(require("tweetnacl")),serialize_1=require("./serialize"),enums_1=require("./enums");var KeyType;function key_type_to_str(e){switch(e){case KeyType.ED25519:return"ed25519";default:throw new Error(`Unknown key type ${e}`)}}function str_to_key_type(e){switch(e.toLowerCase()){case"ed25519":return KeyType.ED25519;default:throw new Error(`Unknown key type ${e}`)}}!function(e){e[e.ED25519=0]="ED25519"}(KeyType=exports.KeyType||(exports.KeyType={}));class PublicKey extends enums_1.Assignable{static from(e){return"string"==typeof e?PublicKey.fromString(e):e}static fromString(e){const t=e.split(":");if(1===t.length)return new PublicKey({keyType:KeyType.ED25519,data:serialize_1.base_decode(t[0])});if(2===t.length)return new PublicKey({keyType:str_to_key_type(t[0]),data:serialize_1.base_decode(t[1])});throw new Error("Invalid encoded key format, must be <curve>:<encoded key>")}toString(){return`${key_type_to_str(this.keyType)}:${serialize_1.base_encode(this.data)}`}verify(e,t){switch(this.keyType){case KeyType.ED25519:return tweetnacl_1.default.sign.detached.verify(e,t,this.data);default:throw new Error(`Unknown key type ${this.keyType}`)}}}exports.PublicKey=PublicKey;class KeyPair{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return KeyPairEd25519.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const t=e.split(":");if(1===t.length)return new KeyPairEd25519(t[0]);if(2!==t.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(t[0].toUpperCase()){case"ED25519":return new KeyPairEd25519(t[1]);default:throw new Error(`Unknown curve: ${t[0]}`)}}}exports.KeyPair=KeyPair;class KeyPairEd25519 extends KeyPair{constructor(e){super();const t=tweetnacl_1.default.sign.keyPair.fromSecretKey(serialize_1.base_decode(e));this.publicKey=new PublicKey({keyType:KeyType.ED25519,data:t.publicKey}),this.secretKey=e}static fromRandom(){const e=tweetnacl_1.default.sign.keyPair();return new KeyPairEd25519(serialize_1.base_encode(e.secretKey))}sign(e){return{signature:tweetnacl_1.default.sign.detached(e,serialize_1.base_decode(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.secretKey}`}getPublicKey(){return this.publicKey}}exports.KeyPairEd25519=KeyPairEd25519;

},{"./enums":24,"./serialize":31,"tweetnacl":74}],30:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getErrorTypeFromErrorMessage=exports.formatError=exports.parseResultError=exports.parseRpcError=exports.ServerError=void 0;const mustache_1=__importDefault(require("mustache")),rpc_error_schema_json_1=__importDefault(require("../generated/rpc_error_schema.json")),error_messages_json_1=__importDefault(require("../res/error_messages.json")),common_index_1=require("../common-index"),errors_1=require("../utils/errors"),mustacheHelpers={formatNear:()=>(r,e)=>common_index_1.utils.format.formatNearAmount(e(r))};class ServerError extends errors_1.TypedError{}exports.ServerError=ServerError;class ServerTransactionError extends ServerError{}function parseRpcError(r){const e={},t=walkSubtype(r,rpc_error_schema_json_1.default.schema,e,""),o=new ServerError(formatError(t,e),t);return Object.assign(o,e),o}function parseResultError(r){const e=parseRpcError(r.status.Failure),t=new ServerTransactionError;return Object.assign(t,e),t.type=e.type,t.message=e.message,t.transaction_outcome=r.transaction_outcome,t}function formatError(r,e){return"string"==typeof error_messages_json_1.default[r]?mustache_1.default.render(error_messages_json_1.default[r],{...e,...mustacheHelpers}):JSON.stringify(e)}function walkSubtype(r,e,t,o){let s,n,a;for(const t in e){if(isString(r[t]))return r[t];if(isObject(r[t]))s=r[t],n=e[t],a=t;else{if(!isObject(r.kind)||!isObject(r.kind[t]))continue;s=r.kind[t],n=e[t],a=t}}if(s&&n){for(const r of Object.keys(n.props))t[r]=s[r];return walkSubtype(s,e,t,a)}return t.kind=r,o}function getErrorTypeFromErrorMessage(r){switch(!0){case/^account .*? does not exist while viewing$/.test(r):case/^Account .*? doesn't exist$/.test(r):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(r):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(r):return"CodeDoesNotExist";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(r):return"InvalidNonce";default:return"UntypedError"}}function isObject(r){return"[object Object]"===Object.prototype.toString.call(r)}function isString(r){return"[object String]"===Object.prototype.toString.call(r)}exports.parseRpcError=parseRpcError,exports.parseResultError=parseResultError,exports.formatError=formatError,exports.getErrorTypeFromErrorMessage=getErrorTypeFromErrorMessage;

},{"../common-index":7,"../generated/rpc_error_schema.json":11,"../res/error_messages.json":21,"../utils/errors":25,"mustache":62}],31:[function(require,module,exports){
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var borsh_1=require("borsh");Object.defineProperty(exports,"base_encode",{enumerable:!0,get:function(){return borsh_1.baseEncode}}),Object.defineProperty(exports,"base_decode",{enumerable:!0,get:function(){return borsh_1.baseDecode}}),Object.defineProperty(exports,"serialize",{enumerable:!0,get:function(){return borsh_1.serialize}}),Object.defineProperty(exports,"deserialize",{enumerable:!0,get:function(){return borsh_1.deserialize}}),Object.defineProperty(exports,"BorshError",{enumerable:!0,get:function(){return borsh_1.BorshError}}),Object.defineProperty(exports,"BinaryWriter",{enumerable:!0,get:function(){return borsh_1.BinaryWriter}}),Object.defineProperty(exports,"BinaryReader",{enumerable:!0,get:function(){return borsh_1.BinaryReader}});

},{"borsh":38}],32:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.fetchJson=void 0;const http_errors_1=__importDefault(require("http-errors")),exponential_backoff_1=__importDefault(require("./exponential-backoff")),providers_1=require("../providers"),errors_1=require("./errors"),START_WAIT_TIME_MS=1e3,BACKOFF_MULTIPLIER=1.5,RETRY_NUMBER=10;async function fetchJson(e,r){let t={url:null};"string"==typeof e?t.url=e:t=e;const o=await exponential_backoff_1.default(START_WAIT_TIME_MS,RETRY_NUMBER,BACKOFF_MULTIPLIER,async()=>{try{const e=await fetch(t.url,{method:r?"POST":"GET",body:r||void 0,headers:{...t.headers,"Content-Type":"application/json"}});if(!e.ok){if(503===e.status)return errors_1.logWarning(`Retrying HTTP request for ${t.url} as it's not available now`),null;throw http_errors_1.default(e.status,await e.text())}return e}catch(e){if(e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))return errors_1.logWarning(`Retrying HTTP request for ${t.url} because of error: ${e}`),null;throw e}});if(!o)throw new providers_1.TypedError(`Exceeded ${RETRY_NUMBER} attempts for ${t.url}.`,"RetriesExceeded");return await o.json()}exports.fetchJson=fetchJson;

},{"../providers":18,"./errors":25,"./exponential-backoff":26,"http-errors":57}],33:[function(require,module,exports){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.diffEpochValidators=exports.findSeatPrice=void 0;const bn_js_1=__importDefault(require("bn.js")),depd_1=__importDefault(require("depd"));function findSeatPrice(e,t,a,r){if(r&&r<49)return findSeatPriceForProtocolBefore49(e,t);if(!a){depd_1.default("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),a=[1,6250]}return findSeatPriceForProtocolAfter49(e,t,a)}function findSeatPriceForProtocolBefore49(e,t){const a=e.map(e=>new bn_js_1.default(e.stake,10)).sort((e,t)=>e.cmp(t)),r=new bn_js_1.default(t),n=a.reduce((e,t)=>e.add(t));if(n.lt(r))throw new Error("Stakes are below seats");let o=new bn_js_1.default(1),d=n.add(new bn_js_1.default(1));for(;!o.eq(d.sub(new bn_js_1.default(1)));){const e=o.add(d).div(new bn_js_1.default(2));let t=!1,n=new bn_js_1.default(0);for(let d=0;d<a.length;++d)if((n=n.add(a[d].div(e))).gte(r)){o=e,t=!0;break}t||(d=e)}return o}function findSeatPriceForProtocolAfter49(e,t,a){if(2!=a.length)throw Error("minimumStakeRatio should have 2 elements");const r=e.map(e=>new bn_js_1.default(e.stake,10)).sort((e,t)=>e.cmp(t)),n=r.reduce((e,t)=>e.add(t));return e.length<t?n.mul(new bn_js_1.default(a[0])).div(new bn_js_1.default(a[1])):r[0].add(new bn_js_1.default(1))}function diffEpochValidators(e,t){const a=new Map;e.forEach(e=>a.set(e.account_id,e));const r=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!a.has(e.account_id)),removedValidators:e.filter(e=>!r.has(e.account_id)),changedValidators:t.filter(e=>a.has(e.account_id)&&a.get(e.account_id).stake!=e.stake).map(e=>({current:a.get(e.account_id),next:e}))}}exports.findSeatPrice=findSeatPrice,exports.diffEpochValidators=diffEpochValidators;

},{"bn.js":37,"depd":47}],34:[function(require,module,exports){
(function (Buffer){(function (){
"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConnectedWalletAccount=exports.WalletAccount=exports.WalletConnection=void 0;const depd_1=__importDefault(require("depd")),account_1=require("./account"),transaction_1=require("./transaction"),utils_1=require("./utils"),borsh_1=require("borsh"),borsh_2=require("borsh"),LOGIN_WALLET_URL_SUFFIX="/login/",MULTISIG_HAS_METHOD="add_request_and_confirm",LOCAL_STORAGE_KEY_SUFFIX="_wallet_auth_key",PENDING_ACCESS_KEY_PREFIX="pending_key";class WalletConnection{constructor(t,e){this._near=t;const a=e+LOCAL_STORAGE_KEY_SUFFIX,n=JSON.parse(window.localStorage.getItem(a));this._networkId=t.config.networkId,this._walletBaseUrl=t.config.walletUrl,e=e||t.config.contractName||"default",this._keyStore=t.connection.signer.keyStore,this._authData=n||{allKeys:[]},this._authDataKey=a,this.isSignedIn()||this._completeSignInWithAccessKey()}isSignedIn(){return!!this._authData.accountId}getAccountId(){return this._authData.accountId||""}async requestSignIn(t={},e,a,n){let s;if("string"==typeof t){depd_1.default("requestSignIn(contractId, title)")("`title` ignored; use `requestSignIn({ contractId, methodNames, successUrl, failureUrl })` instead"),s={contractId:t,successUrl:a,failureUrl:n}}else s=t;const c=new URL(window.location.href),i=new URL(this._walletBaseUrl+LOGIN_WALLET_URL_SUFFIX);if(i.searchParams.set("success_url",s.successUrl||c.href),i.searchParams.set("failure_url",s.failureUrl||c.href),s.contractId){const t=await this._near.account(s.contractId);await t.state(),i.searchParams.set("contract_id",s.contractId);const e=utils_1.KeyPair.fromRandom("ed25519");i.searchParams.set("public_key",e.getPublicKey().toString()),await this._keyStore.setKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+e.getPublicKey(),e)}s.methodNames&&s.methodNames.forEach(t=>{i.searchParams.append("methodNames",t)}),window.location.assign(i.toString())}async requestSignTransactions(...t){if(Array.isArray(t[0])){return depd_1.default("WalletConnection.requestSignTransactions(transactions, callbackUrl, meta)")("use `WalletConnection.requestSignTransactions(RequestSignTransactionsOptions)` instead"),this._requestSignTransactions({transactions:t[0],callbackUrl:t[1],meta:t[2]})}return this._requestSignTransactions(t[0])}async _requestSignTransactions({transactions:t,meta:e,callbackUrl:a}){const n=new URL(window.location.href),s=new URL("sign",this._walletBaseUrl);s.searchParams.set("transactions",t.map(t=>borsh_2.serialize(transaction_1.SCHEMA,t)).map(t=>Buffer.from(t).toString("base64")).join(",")),s.searchParams.set("callbackUrl",a||n.href),e&&s.searchParams.set("meta",e),window.location.assign(s.toString())}async _completeSignInWithAccessKey(){const t=new URL(window.location.href),e=t.searchParams.get("public_key")||"",a=(t.searchParams.get("all_keys")||"").split(","),n=t.searchParams.get("account_id")||"";n&&(this._authData={accountId:n,allKeys:a},window.localStorage.setItem(this._authDataKey,JSON.stringify(this._authData)),e&&await this._moveKeyFromTempToPermanent(n,e)),t.searchParams.delete("public_key"),t.searchParams.delete("all_keys"),t.searchParams.delete("account_id"),t.searchParams.delete("meta"),t.searchParams.delete("transactionHashes"),window.history.replaceState({},document.title,t.toString())}async _moveKeyFromTempToPermanent(t,e){const a=await this._keyStore.getKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+e);await this._keyStore.setKey(this._networkId,t,a),await this._keyStore.removeKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+e)}signOut(){this._authData={},window.localStorage.removeItem(this._authDataKey)}account(){return this._connectedAccount||(this._connectedAccount=new ConnectedWalletAccount(this,this._near.connection,this._authData.accountId)),this._connectedAccount}}exports.WalletConnection=WalletConnection,exports.WalletAccount=WalletConnection;class ConnectedWalletAccount extends account_1.Account{constructor(t,e,a){super(e,a),this.walletConnection=t}signAndSendTransaction(...t){return"string"==typeof t[0]?this._signAndSendTransaction({receiverId:t[0],actions:t[1]}):this._signAndSendTransaction(t[0])}async _signAndSendTransaction({receiverId:t,actions:e,walletMeta:a,walletCallbackUrl:n=window.location.href}){const s=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);let c=await this.accessKeyForTransaction(t,e,s);if(!c)throw new Error(`Cannot find matching key for transaction sent to ${t}`);if(s&&s.toString()===c.public_key)try{return await super.signAndSendTransaction({receiverId:t,actions:e})}catch(a){if("NotEnoughAllowance"!==a.type)throw a;c=await this.accessKeyForTransaction(t,e)}const i=await this.connection.provider.block({finality:"final"}),r=borsh_1.baseDecode(i.header.hash),o=utils_1.PublicKey.from(c.public_key),l=c.access_key.nonce+1,u=transaction_1.createTransaction(this.accountId,o,t,l,e,r);return await this.walletConnection.requestSignTransactions({transactions:[u],meta:a,callbackUrl:n}),new Promise((t,e)=>{setTimeout(()=>{e(new Error("Failed to redirect to sign transaction"))},1e3)})}async accessKeyMatchesTransaction(t,e,a){const{access_key:{permission:n}}=t;if("FullAccess"===n)return!0;if(n.FunctionCall){const{receiver_id:t,method_names:s}=n.FunctionCall;if(t===this.accountId&&s.includes(MULTISIG_HAS_METHOD))return!0;if(t===e){if(1!==a.length)return!1;const[{functionCall:t}]=a;return t&&(!t.deposit||"0"===t.deposit.toString())&&(0===s.length||s.includes(t.methodName))}}return!1}async accessKeyForTransaction(t,e,a){const n=await this.getAccessKeys();if(a){const s=n.find(t=>t.public_key.toString()===a.toString());if(s&&await this.accessKeyMatchesTransaction(s,t,e))return s}const s=this.walletConnection._authData.allKeys;for(const a of n)if(-1!==s.indexOf(a.public_key)&&await this.accessKeyMatchesTransaction(a,t,e))return a;return null}}exports.ConnectedWalletAccount=ConnectedWalletAccount;

}).call(this)}).call(this,require("buffer").Buffer)
},{"./account":2,"./transaction":23,"./utils":28,"borsh":38,"buffer":41,"depd":47}],35:[function(require,module,exports){
"use strict";var _Buffer=require("safe-buffer").Buffer;function base(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),o=0;o<e.length;o++)e[o]=255;for(var t=0;t<r.length;t++){var f=r.charAt(t),a=f.charCodeAt(0);if(255!==e[a])throw new TypeError(f+" is ambiguous");e[a]=t}var n=r.length,i=r.charAt(0),h=Math.log(n)/Math.log(256),u=Math.log(256)/Math.log(n);function c(r){if("string"!=typeof r)throw new TypeError("Expected String");if(0===r.length)return _Buffer.alloc(0);for(var o=0,t=0,f=0;r[o]===i;)t++,o++;for(var a=(r.length-o)*h+1>>>0,u=new Uint8Array(a);r[o];){var c=e[r.charCodeAt(o)];if(255===c)return;for(var l=0,v=a-1;(0!==c||l<f)&&-1!==v;v--,l++)c+=n*u[v]>>>0,u[v]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");f=l,o++}for(var w=a-f;w!==a&&0===u[w];)w++;var g=_Buffer.allocUnsafe(t+(a-w));g.fill(0,0,t);for(var s=t;w!==a;)g[s++]=u[w++];return g}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=_Buffer.from(e)),!_Buffer.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var o=0,t=0,f=0,a=e.length;f!==a&&0===e[f];)f++,o++;for(var h=(a-f)*u+1>>>0,c=new Uint8Array(h);f!==a;){for(var l=e[f],v=0,w=h-1;(0!==l||v<t)&&-1!==w;w--,v++)l+=256*c[w]>>>0,c[w]=l%n>>>0,l=l/n>>>0;if(0!==l)throw new Error("Non-zero carry");t=v,f++}for(var g=h-t;g!==h&&0===c[g];)g++;for(var s=i.repeat(o);g<h;++g)s+=r.charAt(c[g]);return s},decodeUnsafe:c,decode:function(r){var e=c(r);if(e)return e;throw new Error("Non-base"+n+" character")}}}module.exports=base;

},{"safe-buffer":68}],36:[function(require,module,exports){
"use strict";exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(o){var r=o.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=o.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function byteLength(o){var r=getLens(o),e=r[0],t=r[1];return 3*(e+t)/4-t}function _byteLength(o,r,e){return 3*(r+e)/4-e}function toByteArray(o){var r,e,t=getLens(o),n=t[0],u=t[1],p=new Arr(_byteLength(o,n,u)),a=0,h=u>0?n-4:n;for(e=0;e<h;e+=4)r=revLookup[o.charCodeAt(e)]<<18|revLookup[o.charCodeAt(e+1)]<<12|revLookup[o.charCodeAt(e+2)]<<6|revLookup[o.charCodeAt(e+3)],p[a++]=r>>16&255,p[a++]=r>>8&255,p[a++]=255&r;return 2===u&&(r=revLookup[o.charCodeAt(e)]<<2|revLookup[o.charCodeAt(e+1)]>>4,p[a++]=255&r),1===u&&(r=revLookup[o.charCodeAt(e)]<<10|revLookup[o.charCodeAt(e+1)]<<4|revLookup[o.charCodeAt(e+2)]>>2,p[a++]=r>>8&255,p[a++]=255&r),p}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,n=[],u=r;u<e;u+=3)t=(o[u]<<16&16711680)+(o[u+1]<<8&65280)+(255&o[u+2]),n.push(tripletToBase64(t));return n.join("")}function fromByteArray(o){for(var r,e=o.length,t=e%3,n=[],u=0,p=e-t;u<p;u+=16383)n.push(encodeChunk(o,u,u+16383>p?p:u+16383));return 1===t?(r=o[e-1],n.push(lookup[r>>2]+lookup[r<<4&63]+"==")):2===t&&(r=(o[e-2]<<8)+o[e-1],n.push(lookup[r>>10]+lookup[r>>4&63]+lookup[r<<2&63]+"=")),n.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;

},{}],37:[function(require,module,exports){
!function(t,i){"use strict";function r(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function h(t,i,r){if(h.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var e;"object"==typeof t?t.exports=h:i.BN=h,h.BN=h,h.wordSize=26;try{e="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(t){}function o(t,i){var n=t.charCodeAt(i);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+t)}function s(t,i,r){var n=o(t,r);return r-1>=i&&(n|=o(t,r-1)<<4),n}function u(t,i,n,h){for(var e=0,o=0,s=Math.min(t.length,n),u=i;u<s;u++){var a=t.charCodeAt(u)-48;e*=h,o=a>=49?a-49+10:a>=17?a-17+10:a,r(a>=0&&o<h,"Invalid character"),e+=o}return e}function a(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.red}if(h.isBN=function(t){return t instanceof h||null!==t&&"object"==typeof t&&t.constructor.wordSize===h.wordSize&&Array.isArray(t.words)},h.max=function(t,i){return t.cmp(i)>0?t:i},h.min=function(t,i){return t.cmp(i)<0?t:i},h.prototype._init=function(t,i,n){if("number"==typeof t)return this._initNumber(t,i,n);if("object"==typeof t)return this._initArray(t,i,n);"hex"===i&&(i=16),r(i===(0|i)&&i>=2&&i<=36);var h=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(h++,this.negative=1),h<t.length&&(16===i?this._parseHex(t,h,n):(this._parseBase(t,i,h),"le"===n&&this._initArray(this.toArray(),i,n)))},h.prototype._initNumber=function(t,i,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),i,n)},h.prototype._initArray=function(t,i,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var e,o,s=0;if("be"===n)for(h=t.length-1,e=0;h>=0;h-=3)o=t[h]|t[h-1]<<8|t[h-2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===n)for(h=0,e=0;h<t.length;h+=3)o=t[h]|t[h+1]<<8|t[h+2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this._strip()},h.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var h,e=0,o=0;if("be"===r)for(n=t.length-1;n>=i;n-=2)h=s(t,i,n)<<e,this.words[o]|=67108863&h,e>=18?(e-=18,o+=1,this.words[o]|=h>>>26):e+=8;else for(n=(t.length-i)%2==0?i+1:i;n<t.length;n+=2)h=s(t,i,n)<<e,this.words[o]|=67108863&h,e>=18?(e-=18,o+=1,this.words[o]|=h>>>26):e+=8;this._strip()},h.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var n=0,h=1;h<=67108863;h*=i)n++;n--,h=h/i|0;for(var e=t.length-r,o=e%n,s=Math.min(e,e-o)+r,a=0,l=r;l<s;l+=n)a=u(t,l,l+n,i),this.imuln(h),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a);if(0!==o){var m=1;for(a=u(t,l,t.length,i),l=0;l<o;l++)m*=i;this.imuln(m),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a)}this._strip()},h.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},h.prototype._move=function(t){a(t,this)},h.prototype.clone=function(){var t=new h(null);return this.copy(t),t},h.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},h.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},h.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{h.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){h.prototype.inspect=l}else h.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];h.prototype.toString=function(t,i){var n;if(i=0|i||1,16===(t=t||10)||"hex"===t){n="";for(var h=0,e=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<h|e)).toString(16);n=0!==(e=s>>>24-h&16777215)||o!==this.length-1?m[6-u.length]+u+n:u+n,(h+=2)>=26&&(h-=26,o--)}for(0!==e&&(n=e.toString(16)+n);n.length%i!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var a=f[t],l=d[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var M=p.modrn(l).toString(t);n=(p=p.idivn(l)).isZero()?M+n:m[a-M.length]+M+n}for(this.isZero()&&(n="0"+n);n.length%i!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},h.prototype.toJSON=function(){return this.toString(16,2)},e&&(h.prototype.toBuffer=function(t,i){return this.toArrayLike(e,t,i)}),h.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)};function p(t,i,r){r.negative=i.negative^t.negative;var n=t.length+i.length|0;r.length=n,n=n-1|0;var h=0|t.words[0],e=0|i.words[0],o=h*e,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var a=1;a<n;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(h=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}h.prototype.toArrayLike=function(t,i,n){this._strip();var h=this.byteLength(),e=n||Math.max(1,h);r(h<=e,"byte array longer than desired length"),r(e>0,"Requested array length <= 0");var o=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,e);return this["_toArrayLike"+("le"===i?"LE":"BE")](o,h),o},h.prototype._toArrayLikeLE=function(t,i){for(var r=0,n=0,h=0,e=0;h<this.length;h++){var o=this.words[h]<<e|n;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===e?(r<t.length&&(t[r++]=o>>24&255),n=0,e=0):(n=o>>>24,e+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},h.prototype._toArrayLikeBE=function(t,i){for(var r=t.length-1,n=0,h=0,e=0;h<this.length;h++){var o=this.words[h]<<e|n;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===e?(r>=0&&(t[r--]=o>>24&255),n=0,e=0):(n=o>>>24,e+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?h.prototype._countBits=function(t){return 32-Math.clz32(t)}:h.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},h.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},h.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},h.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},h.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},h.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},h.prototype.isNeg=function(){return 0!==this.negative},h.prototype.neg=function(){return this.clone().ineg()},h.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},h.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this._strip()},h.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},h.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},h.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},h.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this._strip()},h.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},h.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},h.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},h.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=i.words[n]^r.words[n];if(this!==i)for(;n<i.length;n++)this.words[n]=i.words[n];return this.length=i.length,this._strip()},h.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},h.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},h.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},h.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),n=t%26;this._expand(i),n>0&&i--;for(var h=0;h<i;h++)this.words[h]=67108863&~this.words[h];return n>0&&(this.words[h]=~this.words[h]&67108863>>26-n),this._strip()},h.prototype.notn=function(t){return this.clone().inotn(t)},h.prototype.setn=function(t,i){r("number"==typeof t&&t>=0);var n=t/26|0,h=t%26;return this._expand(n+1),this.words[n]=i?this.words[n]|1<<h:this.words[n]&~(1<<h),this._strip()},h.prototype.iadd=function(t){var i,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var h=0,e=0;e<n.length;e++)i=(0|r.words[e])+(0|n.words[e])+h,this.words[e]=67108863&i,h=i>>>26;for(;0!==h&&e<r.length;e++)i=(0|r.words[e])+h,this.words[e]=67108863&i,h=i>>>26;if(this.length=r.length,0!==h)this.words[this.length]=h,this.length++;else if(r!==this)for(;e<r.length;e++)this.words[e]=r.words[e];return this},h.prototype.add=function(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},h.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,h=this.cmp(t);if(0===h)return this.negative=0,this.length=1,this.words[0]=0,this;h>0?(r=this,n=t):(r=t,n=this);for(var e=0,o=0;o<n.length;o++)e=(i=(0|r.words[o])-(0|n.words[o])+e)>>26,this.words[o]=67108863&i;for(;0!==e&&o<r.length;o++)e=(i=(0|r.words[o])+e)>>26,this.words[o]=67108863&i;if(0===e&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},h.prototype.sub=function(t){return this.clone().isub(t)};var M=function(t,i,r){var n,h,e,o=t.words,s=i.words,u=r.words,a=0,l=0|o[0],m=8191&l,f=l>>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,S=0|o[5],x=8191&S,B=S>>>13,q=0|o[6],R=8191&q,Z=q>>>13,L=0|o[7],N=8191&L,I=L>>>13,E=0|o[8],z=8191&E,T=E>>>13,O=0|o[9],j=8191&O,K=O>>>13,P=0|s[0],F=8191&P,U=P>>>13,C=0|s[1],D=8191&C,H=C>>>13,J=0|s[2],G=8191&J,Q=J>>>13,V=0|s[3],W=8191&V,X=V>>>13,Y=0|s[4],$=8191&Y,tt=Y>>>13,it=0|s[5],rt=8191&it,nt=it>>>13,ht=0|s[6],et=8191&ht,ot=ht>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191&lt,ft=lt>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(n=Math.imul(m,F))|0)+((8191&(h=(h=Math.imul(m,U))+Math.imul(f,F)|0))<<13)|0;a=((e=Math.imul(f,U))+(h>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),h=(h=Math.imul(p,U))+Math.imul(M,F)|0,e=Math.imul(M,U);var gt=(a+(n=n+Math.imul(m,D)|0)|0)+((8191&(h=(h=h+Math.imul(m,H)|0)+Math.imul(f,D)|0))<<13)|0;a=((e=e+Math.imul(f,H)|0)+(h>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),h=(h=Math.imul(g,U))+Math.imul(c,F)|0,e=Math.imul(c,U),n=n+Math.imul(p,D)|0,h=(h=h+Math.imul(p,H)|0)+Math.imul(M,D)|0,e=e+Math.imul(M,H)|0;var ct=(a+(n=n+Math.imul(m,G)|0)|0)+((8191&(h=(h=h+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((e=e+Math.imul(f,Q)|0)+(h>>>13)|0)+(ct>>>26)|0,ct&=67108863,n=Math.imul(y,F),h=(h=Math.imul(y,U))+Math.imul(b,F)|0,e=Math.imul(b,U),n=n+Math.imul(g,D)|0,h=(h=h+Math.imul(g,H)|0)+Math.imul(c,D)|0,e=e+Math.imul(c,H)|0,n=n+Math.imul(p,G)|0,h=(h=h+Math.imul(p,Q)|0)+Math.imul(M,G)|0,e=e+Math.imul(M,Q)|0;var wt=(a+(n=n+Math.imul(m,W)|0)|0)+((8191&(h=(h=h+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((e=e+Math.imul(f,X)|0)+(h>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),h=(h=Math.imul(k,U))+Math.imul(A,F)|0,e=Math.imul(A,U),n=n+Math.imul(y,D)|0,h=(h=h+Math.imul(y,H)|0)+Math.imul(b,D)|0,e=e+Math.imul(b,H)|0,n=n+Math.imul(g,G)|0,h=(h=h+Math.imul(g,Q)|0)+Math.imul(c,G)|0,e=e+Math.imul(c,Q)|0,n=n+Math.imul(p,W)|0,h=(h=h+Math.imul(p,X)|0)+Math.imul(M,W)|0,e=e+Math.imul(M,X)|0;var yt=(a+(n=n+Math.imul(m,$)|0)|0)+((8191&(h=(h=h+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((e=e+Math.imul(f,tt)|0)+(h>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,F),h=(h=Math.imul(x,U))+Math.imul(B,F)|0,e=Math.imul(B,U),n=n+Math.imul(k,D)|0,h=(h=h+Math.imul(k,H)|0)+Math.imul(A,D)|0,e=e+Math.imul(A,H)|0,n=n+Math.imul(y,G)|0,h=(h=h+Math.imul(y,Q)|0)+Math.imul(b,G)|0,e=e+Math.imul(b,Q)|0,n=n+Math.imul(g,W)|0,h=(h=h+Math.imul(g,X)|0)+Math.imul(c,W)|0,e=e+Math.imul(c,X)|0,n=n+Math.imul(p,$)|0,h=(h=h+Math.imul(p,tt)|0)+Math.imul(M,$)|0,e=e+Math.imul(M,tt)|0;var bt=(a+(n=n+Math.imul(m,rt)|0)|0)+((8191&(h=(h=h+Math.imul(m,nt)|0)+Math.imul(f,rt)|0))<<13)|0;a=((e=e+Math.imul(f,nt)|0)+(h>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,F),h=(h=Math.imul(R,U))+Math.imul(Z,F)|0,e=Math.imul(Z,U),n=n+Math.imul(x,D)|0,h=(h=h+Math.imul(x,H)|0)+Math.imul(B,D)|0,e=e+Math.imul(B,H)|0,n=n+Math.imul(k,G)|0,h=(h=h+Math.imul(k,Q)|0)+Math.imul(A,G)|0,e=e+Math.imul(A,Q)|0,n=n+Math.imul(y,W)|0,h=(h=h+Math.imul(y,X)|0)+Math.imul(b,W)|0,e=e+Math.imul(b,X)|0,n=n+Math.imul(g,$)|0,h=(h=h+Math.imul(g,tt)|0)+Math.imul(c,$)|0,e=e+Math.imul(c,tt)|0,n=n+Math.imul(p,rt)|0,h=(h=h+Math.imul(p,nt)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,nt)|0;var _t=(a+(n=n+Math.imul(m,et)|0)|0)+((8191&(h=(h=h+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;a=((e=e+Math.imul(f,ot)|0)+(h>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(N,F),h=(h=Math.imul(N,U))+Math.imul(I,F)|0,e=Math.imul(I,U),n=n+Math.imul(R,D)|0,h=(h=h+Math.imul(R,H)|0)+Math.imul(Z,D)|0,e=e+Math.imul(Z,H)|0,n=n+Math.imul(x,G)|0,h=(h=h+Math.imul(x,Q)|0)+Math.imul(B,G)|0,e=e+Math.imul(B,Q)|0,n=n+Math.imul(k,W)|0,h=(h=h+Math.imul(k,X)|0)+Math.imul(A,W)|0,e=e+Math.imul(A,X)|0,n=n+Math.imul(y,$)|0,h=(h=h+Math.imul(y,tt)|0)+Math.imul(b,$)|0,e=e+Math.imul(b,tt)|0,n=n+Math.imul(g,rt)|0,h=(h=h+Math.imul(g,nt)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,nt)|0,n=n+Math.imul(p,et)|0,h=(h=h+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(a+(n=n+Math.imul(m,ut)|0)|0)+((8191&(h=(h=h+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((e=e+Math.imul(f,at)|0)+(h>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,F),h=(h=Math.imul(z,U))+Math.imul(T,F)|0,e=Math.imul(T,U),n=n+Math.imul(N,D)|0,h=(h=h+Math.imul(N,H)|0)+Math.imul(I,D)|0,e=e+Math.imul(I,H)|0,n=n+Math.imul(R,G)|0,h=(h=h+Math.imul(R,Q)|0)+Math.imul(Z,G)|0,e=e+Math.imul(Z,Q)|0,n=n+Math.imul(x,W)|0,h=(h=h+Math.imul(x,X)|0)+Math.imul(B,W)|0,e=e+Math.imul(B,X)|0,n=n+Math.imul(k,$)|0,h=(h=h+Math.imul(k,tt)|0)+Math.imul(A,$)|0,e=e+Math.imul(A,tt)|0,n=n+Math.imul(y,rt)|0,h=(h=h+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,nt)|0,n=n+Math.imul(g,et)|0,h=(h=h+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,n=n+Math.imul(p,ut)|0,h=(h=h+Math.imul(p,at)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,at)|0;var At=(a+(n=n+Math.imul(m,mt)|0)|0)+((8191&(h=(h=h+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((e=e+Math.imul(f,ft)|0)+(h>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,F),h=(h=Math.imul(j,U))+Math.imul(K,F)|0,e=Math.imul(K,U),n=n+Math.imul(z,D)|0,h=(h=h+Math.imul(z,H)|0)+Math.imul(T,D)|0,e=e+Math.imul(T,H)|0,n=n+Math.imul(N,G)|0,h=(h=h+Math.imul(N,Q)|0)+Math.imul(I,G)|0,e=e+Math.imul(I,Q)|0,n=n+Math.imul(R,W)|0,h=(h=h+Math.imul(R,X)|0)+Math.imul(Z,W)|0,e=e+Math.imul(Z,X)|0,n=n+Math.imul(x,$)|0,h=(h=h+Math.imul(x,tt)|0)+Math.imul(B,$)|0,e=e+Math.imul(B,tt)|0,n=n+Math.imul(k,rt)|0,h=(h=h+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,nt)|0,n=n+Math.imul(y,et)|0,h=(h=h+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,n=n+Math.imul(g,ut)|0,h=(h=h+Math.imul(g,at)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,at)|0,n=n+Math.imul(p,mt)|0,h=(h=h+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var St=(a+(n=n+Math.imul(m,pt)|0)|0)+((8191&(h=(h=h+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((e=e+Math.imul(f,Mt)|0)+(h>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,D),h=(h=Math.imul(j,H))+Math.imul(K,D)|0,e=Math.imul(K,H),n=n+Math.imul(z,G)|0,h=(h=h+Math.imul(z,Q)|0)+Math.imul(T,G)|0,e=e+Math.imul(T,Q)|0,n=n+Math.imul(N,W)|0,h=(h=h+Math.imul(N,X)|0)+Math.imul(I,W)|0,e=e+Math.imul(I,X)|0,n=n+Math.imul(R,$)|0,h=(h=h+Math.imul(R,tt)|0)+Math.imul(Z,$)|0,e=e+Math.imul(Z,tt)|0,n=n+Math.imul(x,rt)|0,h=(h=h+Math.imul(x,nt)|0)+Math.imul(B,rt)|0,e=e+Math.imul(B,nt)|0,n=n+Math.imul(k,et)|0,h=(h=h+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,n=n+Math.imul(y,ut)|0,h=(h=h+Math.imul(y,at)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,at)|0,n=n+Math.imul(g,mt)|0,h=(h=h+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var xt=(a+(n=n+Math.imul(p,pt)|0)|0)+((8191&(h=(h=h+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((e=e+Math.imul(M,Mt)|0)+(h>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(j,G),h=(h=Math.imul(j,Q))+Math.imul(K,G)|0,e=Math.imul(K,Q),n=n+Math.imul(z,W)|0,h=(h=h+Math.imul(z,X)|0)+Math.imul(T,W)|0,e=e+Math.imul(T,X)|0,n=n+Math.imul(N,$)|0,h=(h=h+Math.imul(N,tt)|0)+Math.imul(I,$)|0,e=e+Math.imul(I,tt)|0,n=n+Math.imul(R,rt)|0,h=(h=h+Math.imul(R,nt)|0)+Math.imul(Z,rt)|0,e=e+Math.imul(Z,nt)|0,n=n+Math.imul(x,et)|0,h=(h=h+Math.imul(x,ot)|0)+Math.imul(B,et)|0,e=e+Math.imul(B,ot)|0,n=n+Math.imul(k,ut)|0,h=(h=h+Math.imul(k,at)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,at)|0,n=n+Math.imul(y,mt)|0,h=(h=h+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var Bt=(a+(n=n+Math.imul(g,pt)|0)|0)+((8191&(h=(h=h+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((e=e+Math.imul(c,Mt)|0)+(h>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(j,W),h=(h=Math.imul(j,X))+Math.imul(K,W)|0,e=Math.imul(K,X),n=n+Math.imul(z,$)|0,h=(h=h+Math.imul(z,tt)|0)+Math.imul(T,$)|0,e=e+Math.imul(T,tt)|0,n=n+Math.imul(N,rt)|0,h=(h=h+Math.imul(N,nt)|0)+Math.imul(I,rt)|0,e=e+Math.imul(I,nt)|0,n=n+Math.imul(R,et)|0,h=(h=h+Math.imul(R,ot)|0)+Math.imul(Z,et)|0,e=e+Math.imul(Z,ot)|0,n=n+Math.imul(x,ut)|0,h=(h=h+Math.imul(x,at)|0)+Math.imul(B,ut)|0,e=e+Math.imul(B,at)|0,n=n+Math.imul(k,mt)|0,h=(h=h+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var qt=(a+(n=n+Math.imul(y,pt)|0)|0)+((8191&(h=(h=h+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((e=e+Math.imul(b,Mt)|0)+(h>>>13)|0)+(qt>>>26)|0,qt&=67108863,n=Math.imul(j,$),h=(h=Math.imul(j,tt))+Math.imul(K,$)|0,e=Math.imul(K,tt),n=n+Math.imul(z,rt)|0,h=(h=h+Math.imul(z,nt)|0)+Math.imul(T,rt)|0,e=e+Math.imul(T,nt)|0,n=n+Math.imul(N,et)|0,h=(h=h+Math.imul(N,ot)|0)+Math.imul(I,et)|0,e=e+Math.imul(I,ot)|0,n=n+Math.imul(R,ut)|0,h=(h=h+Math.imul(R,at)|0)+Math.imul(Z,ut)|0,e=e+Math.imul(Z,at)|0,n=n+Math.imul(x,mt)|0,h=(h=h+Math.imul(x,ft)|0)+Math.imul(B,mt)|0,e=e+Math.imul(B,ft)|0;var Rt=(a+(n=n+Math.imul(k,pt)|0)|0)+((8191&(h=(h=h+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((e=e+Math.imul(A,Mt)|0)+(h>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(j,rt),h=(h=Math.imul(j,nt))+Math.imul(K,rt)|0,e=Math.imul(K,nt),n=n+Math.imul(z,et)|0,h=(h=h+Math.imul(z,ot)|0)+Math.imul(T,et)|0,e=e+Math.imul(T,ot)|0,n=n+Math.imul(N,ut)|0,h=(h=h+Math.imul(N,at)|0)+Math.imul(I,ut)|0,e=e+Math.imul(I,at)|0,n=n+Math.imul(R,mt)|0,h=(h=h+Math.imul(R,ft)|0)+Math.imul(Z,mt)|0,e=e+Math.imul(Z,ft)|0;var Zt=(a+(n=n+Math.imul(x,pt)|0)|0)+((8191&(h=(h=h+Math.imul(x,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((e=e+Math.imul(B,Mt)|0)+(h>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,n=Math.imul(j,et),h=(h=Math.imul(j,ot))+Math.imul(K,et)|0,e=Math.imul(K,ot),n=n+Math.imul(z,ut)|0,h=(h=h+Math.imul(z,at)|0)+Math.imul(T,ut)|0,e=e+Math.imul(T,at)|0,n=n+Math.imul(N,mt)|0,h=(h=h+Math.imul(N,ft)|0)+Math.imul(I,mt)|0,e=e+Math.imul(I,ft)|0;var Lt=(a+(n=n+Math.imul(R,pt)|0)|0)+((8191&(h=(h=h+Math.imul(R,Mt)|0)+Math.imul(Z,pt)|0))<<13)|0;a=((e=e+Math.imul(Z,Mt)|0)+(h>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,ut),h=(h=Math.imul(j,at))+Math.imul(K,ut)|0,e=Math.imul(K,at),n=n+Math.imul(z,mt)|0,h=(h=h+Math.imul(z,ft)|0)+Math.imul(T,mt)|0,e=e+Math.imul(T,ft)|0;var Nt=(a+(n=n+Math.imul(N,pt)|0)|0)+((8191&(h=(h=h+Math.imul(N,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((e=e+Math.imul(I,Mt)|0)+(h>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(j,mt),h=(h=Math.imul(j,ft))+Math.imul(K,mt)|0,e=Math.imul(K,ft);var It=(a+(n=n+Math.imul(z,pt)|0)|0)+((8191&(h=(h=h+Math.imul(z,Mt)|0)+Math.imul(T,pt)|0))<<13)|0;a=((e=e+Math.imul(T,Mt)|0)+(h>>>13)|0)+(It>>>26)|0,It&=67108863;var Et=(a+(n=Math.imul(j,pt))|0)+((8191&(h=(h=Math.imul(j,Mt))+Math.imul(K,pt)|0))<<13)|0;return a=((e=Math.imul(K,Mt))+(h>>>13)|0)+(Et>>>26)|0,Et&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=St,u[10]=xt,u[11]=Bt,u[12]=qt,u[13]=Rt,u[14]=Zt,u[15]=Lt,u[16]=Nt,u[17]=It,u[18]=Et,0!==a&&(u[19]=a,r.length++),r};function v(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var n=0,h=0,e=0;e<r.length-1;e++){var o=h;h=0;for(var s=67108863&n,u=Math.min(e,i.length-1),a=Math.max(0,e-t.length+1);a<=u;a++){var l=e-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;s=67108863&(f=f+s|0),h+=(o=(o=o+(m/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[e]=s,n=o,o=h}return 0!==n?r.words[e]=n:r.length--,r._strip()}function g(t,i,r){return v(t,i,r)}function c(t,i){this.x=t,this.y=i}Math.imul||(M=p),h.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?M(this,t,i):r<63?p(this,t,i):r<1024?v(this,t,i):g(this,t,i)},c.prototype.makeRBT=function(t){for(var i=new Array(t),r=h.prototype._countBits(t)-1,n=0;n<t;n++)i[n]=this.revBin(n,r,t);return i},c.prototype.revBin=function(t,i,r){if(0===t||t===r-1)return t;for(var n=0,h=0;h<i;h++)n|=(1&t)<<i-h-1,t>>=1;return n},c.prototype.permute=function(t,i,r,n,h,e){for(var o=0;o<e;o++)n[o]=i[t[o]],h[o]=r[t[o]]},c.prototype.transform=function(t,i,r,n,h,e){this.permute(e,t,i,r,n,h);for(var o=1;o<h;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),a=Math.sin(2*Math.PI/s),l=0;l<h;l+=s)for(var m=u,f=a,d=0;d<o;d++){var p=r[l+d],M=n[l+d],v=r[l+d+o],g=n[l+d+o],c=m*v-f*g;g=m*g+f*v,v=c,r[l+d]=p+v,n[l+d]=M+g,r[l+d+o]=p-v,n[l+d+o]=M-g,d!==s&&(c=u*m-a*f,f=u*f+a*m,m=c)}},c.prototype.guessLen13b=function(t,i){var r=1|Math.max(i,t),n=1&r,h=0;for(r=r/2|0;r;r>>>=1)h++;return 1<<h+1+n},c.prototype.conjugate=function(t,i,r){if(!(r<=1))for(var n=0;n<r/2;n++){var h=t[n];t[n]=t[r-n-1],t[r-n-1]=h,h=i[n],i[n]=-i[r-n-1],i[r-n-1]=-h}},c.prototype.normalize13b=function(t,i){for(var r=0,n=0;n<i/2;n++){var h=8192*Math.round(t[2*n+1]/i)+Math.round(t[2*n]/i)+r;t[n]=67108863&h,r=h<67108864?0:h/67108864|0}return t},c.prototype.convert13b=function(t,i,n,h){for(var e=0,o=0;o<i;o++)e+=0|t[o],n[2*o]=8191&e,e>>>=13,n[2*o+1]=8191&e,e>>>=13;for(o=2*i;o<h;++o)n[o]=0;r(0===e),r(0==(-8192&e))},c.prototype.stub=function(t){for(var i=new Array(t),r=0;r<t;r++)i[r]=0;return i},c.prototype.mulp=function(t,i,r){var n=2*this.guessLen13b(t.length,i.length),h=this.makeRBT(n),e=this.stub(n),o=new Array(n),s=new Array(n),u=new Array(n),a=new Array(n),l=new Array(n),m=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(i.words,i.length,a,n),this.transform(o,e,s,u,n,h),this.transform(a,e,l,m,n,h);for(var d=0;d<n;d++){var p=s[d]*l[d]-u[d]*m[d];u[d]=s[d]*m[d]+u[d]*l[d],s[d]=p}return this.conjugate(s,u,n),this.transform(s,u,f,e,n,h),this.conjugate(f,e,n),this.normalize13b(f,n),r.negative=t.negative^i.negative,r.length=t.length+i.length,r._strip()},h.prototype.mul=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},h.prototype.mulf=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),g(this,t,i)},h.prototype.imul=function(t){return this.clone().mulTo(t,this)},h.prototype.imuln=function(t){var i=t<0;i&&(t=-t),r("number"==typeof t),r(t<67108864);for(var n=0,h=0;h<this.length;h++){var e=(0|this.words[h])*t,o=(67108863&e)+(67108863&n);n>>=26,n+=e/67108864|0,n+=o>>>26,this.words[h]=67108863&o}return 0!==n&&(this.words[h]=n,this.length++),i?this.ineg():this},h.prototype.muln=function(t){return this.clone().imuln(t)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var n=r/26|0,h=r%26;i[r]=t.words[n]>>>h&1}return i}(t);if(0===i.length)return new h(1);for(var r=this,n=0;n<i.length&&0===i[n];n++,r=r.sqr());if(++n<i.length)for(var e=r.sqr();n<i.length;n++,e=e.sqr())0!==i[n]&&(r=r.mul(e));return r},h.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var i,n=t%26,h=(t-n)/26,e=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(i=0;i<this.length;i++){var s=this.words[i]&e,u=(0|this.words[i])-s<<n;this.words[i]=u|o,o=s>>>26-n}o&&(this.words[i]=o,this.length++)}if(0!==h){for(i=this.length-1;i>=0;i--)this.words[i+h]=this.words[i];for(i=0;i<h;i++)this.words[i]=0;this.length+=h}return this._strip()},h.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},h.prototype.iushrn=function(t,i,n){var h;r("number"==typeof t&&t>=0),h=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<<e,u=n;if(h-=o,h=Math.max(0,h),u){for(var a=0;a<o;a++)u.words[a]=this.words[a];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,a=0;a<this.length;a++)this.words[a]=this.words[a+o];else this.words[0]=0,this.length=1;var l=0;for(a=this.length-1;a>=0&&(0!==l||a>=h);a--){var m=0|this.words[a];this.words[a]=l<<26-e|m>>>e,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},h.prototype.ishrn=function(t,i,n){return r(0===this.negative),this.iushrn(t,i,n)},h.prototype.shln=function(t){return this.clone().ishln(t)},h.prototype.ushln=function(t){return this.clone().iushln(t)},h.prototype.shrn=function(t){return this.clone().ishrn(t)},h.prototype.ushrn=function(t){return this.clone().iushrn(t)},h.prototype.testn=function(t){r("number"==typeof t&&t>=0);var i=t%26,n=(t-i)/26,h=1<<i;return!(this.length<=n)&&!!(this.words[n]&h)},h.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var i=t%26,n=(t-i)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==i&&n++,this.length=Math.min(n,this.length),0!==i){var h=67108863^67108863>>>i<<i;this.words[this.length-1]&=h}return this._strip()},h.prototype.maskn=function(t){return this.clone().imaskn(t)},h.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},h.prototype._iaddn=function(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},h.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this._strip()},h.prototype.addn=function(t){return this.clone().iaddn(t)},h.prototype.subn=function(t){return this.clone().isubn(t)},h.prototype.iabs=function(){return this.negative=0,this},h.prototype.abs=function(){return this.clone().iabs()},h.prototype._ishlnsubmul=function(t,i,n){var h,e,o=t.length+n;this._expand(o);var s=0;for(h=0;h<t.length;h++){e=(0|this.words[h+n])+s;var u=(0|t.words[h])*i;s=((e-=67108863&u)>>26)-(u/67108864|0),this.words[h+n]=67108863&e}for(;h<this.length-n;h++)s=(e=(0|this.words[h+n])+s)>>26,this.words[h+n]=67108863&e;if(0===s)return this._strip();for(r(-1===s),s=0,h=0;h<this.length;h++)s=(e=-(0|this.words[h])+s)>>26,this.words[h]=67108863&e;return this.negative=1,this._strip()},h.prototype._wordDiv=function(t,i){var r=(this.length,t.length),n=this.clone(),e=t,o=0|e.words[e.length-1];0!==(r=26-this._countBits(o))&&(e=e.ushln(r),n.iushln(r),o=0|e.words[e.length-1]);var s,u=n.length-e.length;if("mod"!==i){(s=new h(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a<s.length;a++)s.words[a]=0}var l=n.clone()._ishlnsubmul(e,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var m=u-1;m>=0;m--){var f=67108864*(0|n.words[e.length+m])+(0|n.words[e.length+m-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(e,f,m);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(e,1,m),n.isZero()||(n.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),n._strip(),"div"!==i&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},h.prototype.divmod=function(t,i,n){return r(!t.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(e=s.div.neg()),"div"!==i&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(t)),{div:e,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(e=s.div.neg()),{div:e,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new h(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new h(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new h(this.modrn(t.words[0]))}:this._wordDiv(t,i);var e,o,s},h.prototype.div=function(t){return this.divmod(t,"div",!1).div},h.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},h.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},h.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,n=t.ushrn(1),h=t.andln(1),e=r.cmp(n);return e<0||1===h&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},h.prototype.modrn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,h=0,e=this.length-1;e>=0;e--)h=(n*h+(0|this.words[e]))%t;return i?-h:h},h.prototype.modn=function(t){return this.modrn(t)},h.prototype.idivn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var n=0,h=this.length-1;h>=0;h--){var e=(0|this.words[h])+67108864*n;this.words[h]=e/t|0,n=e%t}return this._strip(),i?this.ineg():this},h.prototype.divn=function(t){return this.clone().idivn(t)},h.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var i=this,n=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new h(1),o=new h(0),s=new h(0),u=new h(1),a=0;i.isEven()&&n.isEven();)i.iushrn(1),n.iushrn(1),++a;for(var l=n.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(e.isOdd()||o.isOdd())&&(e.iadd(l),o.isub(m)),e.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(n.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.cmp(n)>=0?(i.isub(n),e.isub(s),o.isub(u)):(n.isub(i),s.isub(e),u.isub(o))}return{a:s,b:u,gcd:n.iushln(a)}},h.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var i=this,n=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,o=new h(1),s=new h(0),u=n.clone();i.cmpn(1)>0&&n.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var m=0,f=1;0==(n.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(n.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);i.cmp(n)>=0?(i.isub(n),o.isub(s)):(n.isub(i),s.isub(o))}return(e=0===i.cmpn(1)?o:s).cmpn(0)<0&&e.iadd(t),e},h.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var n=0;i.isEven()&&r.isEven();n++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var h=i.cmp(r);if(h<0){var e=i;i=r,r=e}else if(0===h||0===r.cmpn(1))break;i.isub(r)}return r.iushln(n)},h.prototype.invm=function(t){return this.egcd(t).a.umod(t)},h.prototype.isEven=function(){return 0==(1&this.words[0])},h.prototype.isOdd=function(){return 1==(1&this.words[0])},h.prototype.andln=function(t){return this.words[0]&t},h.prototype.bincn=function(t){r("number"==typeof t);var i=t%26,n=(t-i)/26,h=1<<i;if(this.length<=n)return this._expand(n+1),this.words[n]|=h,this;for(var e=h,o=n;0!==e&&o<this.length;o++){var s=0|this.words[o];e=(s+=e)>>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},h.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},h.prototype.cmpn=function(t){var i,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)i=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var h=0|this.words[0];i=h===t?0:h<t?-1:1}return 0!==this.negative?0|-i:i},h.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},h.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],h=0|t.words[r];if(n!==h){n<h?i=-1:n>h&&(i=1);break}}return i},h.prototype.gtn=function(t){return 1===this.cmpn(t)},h.prototype.gt=function(t){return 1===this.cmp(t)},h.prototype.gten=function(t){return this.cmpn(t)>=0},h.prototype.gte=function(t){return this.cmp(t)>=0},h.prototype.ltn=function(t){return-1===this.cmpn(t)},h.prototype.lt=function(t){return-1===this.cmp(t)},h.prototype.lten=function(t){return this.cmpn(t)<=0},h.prototype.lte=function(t){return this.cmp(t)<=0},h.prototype.eqn=function(t){return 0===this.cmpn(t)},h.prototype.eq=function(t){return 0===this.cmp(t)},h.red=function(t){return new S(t)},h.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},h.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(t){return this.red=t,this},h.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},h.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},h.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},h.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},h.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},h.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},h.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},h.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},h.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function y(t,i){this.name=t,this.p=new h(i,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var i=h._prime(t);this.m=i.p,this.prime=i}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new h(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var n=i<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,i){t.iushrn(this.n,0,i)},y.prototype.imulK=function(t){return t.imul(this.k)},n(b,y),b.prototype.split=function(t,i){for(var r=Math.min(t.length,9),n=0;n<r;n++)i.words[n]=t.words[n];if(i.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var h=t.words[9];for(i.words[i.length++]=4194303&h,n=10;n<t.length;n++){var e=0|t.words[n];t.words[n-10]=(4194303&e)<<4|h>>>22,h=e}h>>>=22,t.words[n-10]=h,0===h&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var n=0|t.words[r];i+=977*n,t.words[r]=67108863&i,i=64*n+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(_,y),n(k,y),n(A,y),A.prototype.imulK=function(t){for(var i=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+i,h=67108863&n;n>>>=26,t.words[r]=h,i=n}return 0!==i&&(t.words[t.length++]=i),t},h._prime=function(t){if(w[t])return w[t];var i;if("k256"===t)i=new b;else if("p224"===t)i=new _;else if("p192"===t)i=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new A}return w[t]=i,i},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,i){r(0==(t.negative|i.negative),"red works only with positives"),r(t.red&&t.red===i.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(a(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},S.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},S.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(r(i%2==1),3===i){var n=this.m.add(new h(1)).iushrn(2);return this.pow(t,n)}for(var e=this.m.subn(1),o=0;!e.isZero()&&0===e.andln(1);)o++,e.iushrn(1);r(!e.isZero());var s=new h(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new h(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,e),f=this.pow(t,e.addn(1).iushrn(1)),d=this.pow(t,e),p=o;0!==d.cmp(s);){for(var M=d,v=0;0!==M.cmp(s);v++)M=M.redSqr();r(v<p);var g=this.pow(m,new h(1).iushln(p-v-1));f=f.redMul(g),m=g.redSqr(),d=d.redMul(m),p=v}return f},S.prototype.invm=function(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},S.prototype.pow=function(t,i){if(i.isZero())return new h(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new h(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var e=r[0],o=0,s=0,u=i.bitLength()%26;for(0===u&&(u=26),n=i.length-1;n>=0;n--){for(var a=i.words[n],l=u-1;l>=0;l--){var m=a>>l&1;e!==r[0]&&(e=this.sqr(e)),0!==m||0!==o?(o<<=1,o|=m,(4===++s||0===n&&0===l)&&(e=this.mul(e,r[o]),s=0,o=0)):s=0}u=26}return e},S.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},S.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},h.mont=function(t){return new x(t)},n(x,S),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},x.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=r.isub(n).iushrn(this.shift),e=h;return h.cmp(this.m)>=0?e=h.isub(this.m):h.cmpn(0)<0&&(e=h.iadd(this.m)),e._forceRed(this)},x.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new h(0)._forceRed(this);var r=t.mul(i),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=r.isub(n).iushrn(this.shift),o=e;return e.cmp(this.m)>=0?o=e.isub(this.m):e.cmpn(0)<0&&(o=e.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this);

},{"buffer":39}],38:[function(require,module,exports){
(function (global,Buffer){(function (){
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),__decorate=this&&this.__decorate||function(e,r,t,i){var n,o=arguments.length,s=o<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,r,t,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(r,t,s):n(r,t))||s);return o>3&&s&&Object.defineProperty(r,t,s),s},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.hasOwnProperty.call(e,t)&&__createBinding(r,e,t);return __setModuleDefault(r,e),r},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.deserializeUnchecked=exports.deserialize=exports.serialize=exports.BinaryReader=exports.BinaryWriter=exports.BorshError=exports.baseDecode=exports.baseEncode=void 0;const bn_js_1=__importDefault(require("bn.js")),bs58_1=__importDefault(require("bs58")),encoding=__importStar(require("text-encoding-utf-8")),TextDecoder="function"!=typeof global.TextDecoder?encoding.TextDecoder:global.TextDecoder,textDecoder=new TextDecoder("utf-8",{fatal:!0});function baseEncode(e){return"string"==typeof e&&(e=Buffer.from(e,"utf8")),bs58_1.default.encode(Buffer.from(e))}function baseDecode(e){return Buffer.from(bs58_1.default.decode(e))}exports.baseEncode=baseEncode,exports.baseDecode=baseDecode;const INITIAL_LENGTH=1024;class BorshError extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}exports.BorshError=BorshError;class BinaryWriter{constructor(){this.buf=Buffer.alloc(INITIAL_LENGTH),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(INITIAL_LENGTH)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(INITIAL_LENGTH)]),this.length+=e.length}writeString(e){this.maybeResize();const r=Buffer.from(e,"utf8");this.writeU32(r.length),this.writeBuffer(r)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,r){this.maybeResize(),this.writeU32(e.length);for(const t of e)this.maybeResize(),r(t)}toArray(){return this.buf.subarray(0,this.length)}}function handlingRangeError(e,r,t){const i=t.value;t.value=function(...e){try{return i.apply(this,e)}catch(e){if(e instanceof RangeError){const r=e.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(r)>=0)throw new BorshError("Reached the end of buffer when deserializing")}throw e}}}exports.BinaryWriter=BinaryWriter;class BinaryReader{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new bn_js_1.default(e,"le")}readU128(){const e=this.readBuffer(16);return new bn_js_1.default(e,"le")}readU256(){const e=this.readBuffer(32);return new bn_js_1.default(e,"le")}readU512(){const e=this.readBuffer(64);return new bn_js_1.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new BorshError(`Expected buffer length ${e} isn't within bounds`);const r=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,r}readString(){const e=this.readU32(),r=this.readBuffer(e);try{return textDecoder.decode(r)}catch(e){throw new BorshError(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const r=this.readU32(),t=Array();for(let i=0;i<r;++i)t.push(e());return t}}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}function serializeField(e,r,t,i,n){try{if("string"==typeof i)n[`write${capitalizeFirstLetter(i)}`](t);else if(i instanceof Array)if("number"==typeof i[0]){if(t.length!==i[0])throw new BorshError(`Expecting byte array of length ${i[0]}, but got ${t.length} bytes`);n.writeFixedArray(t)}else if(2===i.length&&"number"==typeof i[1]){if(t.length!==i[1])throw new BorshError(`Expecting byte array of length ${i[1]}, but got ${t.length} bytes`);for(let r=0;r<i[1];r++)serializeField(e,null,t[r],i[0],n)}else n.writeArray(t,t=>{serializeField(e,r,t,i[0],n)});else if(void 0!==i.kind)switch(i.kind){case"option":null==t?n.writeU8(0):(n.writeU8(1),serializeField(e,r,t,i.type,n));break;default:throw new BorshError(`FieldType ${i} unrecognized`)}else serializeStruct(e,t,n)}catch(e){throw e instanceof BorshError&&e.addToFieldPath(r),e}}function serializeStruct(e,r,t){if("function"==typeof r.borshSerialize)return void r.borshSerialize(t);const i=e.get(r.constructor);if(!i)throw new BorshError(`Class ${r.constructor.name} is missing in schema`);if("struct"===i.kind)i.fields.map(([i,n])=>{serializeField(e,i,r[i],n,t)});else{if("enum"!==i.kind)throw new BorshError(`Unexpected schema kind: ${i.kind} for ${r.constructor.name}`);{const n=r[i.field];for(let o=0;o<i.values.length;++o){const[s,a]=i.values[o];if(s===n){t.writeU8(o),serializeField(e,s,r[s],a,t);break}}}}}function serialize(e,r,t=BinaryWriter){const i=new t;return serializeStruct(e,r,i),i.toArray()}function deserializeField(e,r,t,i){try{if("string"==typeof t)return i[`read${capitalizeFirstLetter(t)}`]();if(t instanceof Array){if("number"==typeof t[0])return i.readFixedArray(t[0]);if("number"==typeof t[1]){const r=[];for(let n=0;n<t[1];n++)r.push(deserializeField(e,null,t[0],i));return r}return i.readArray(()=>deserializeField(e,r,t[0],i))}if("option"===t.kind){return i.readU8()?deserializeField(e,r,t.type,i):void 0}return deserializeStruct(e,t,i)}catch(e){throw e instanceof BorshError&&e.addToFieldPath(r),e}}function deserializeStruct(e,r,t){if("function"==typeof r.borshDeserialize)return r.borshDeserialize(t);const i=e.get(r);if(!i)throw new BorshError(`Class ${r.name} is missing in schema`);if("struct"===i.kind){const i={};for(const[n,o]of e.get(r).fields)i[n]=deserializeField(e,n,o,t);return new r(i)}if("enum"===i.kind){const n=t.readU8();if(n>=i.values.length)throw new BorshError(`Enum index: ${n} is out of range`);const[o,s]=i.values[n];return new r({[o]:deserializeField(e,o,s,t)})}throw new BorshError(`Unexpected schema kind: ${i.kind} for ${r.constructor.name}`)}function deserialize(e,r,t,i=BinaryReader){const n=new i(t),o=deserializeStruct(e,r,n);if(n.offset<t.length)throw new BorshError(`Unexpected ${t.length-n.offset} bytes after deserialized data`);return o}function deserializeUnchecked(e,r,t,i=BinaryReader){return deserializeStruct(e,r,new i(t))}__decorate([handlingRangeError],BinaryReader.prototype,"readU8",null),__decorate([handlingRangeError],BinaryReader.prototype,"readU16",null),__decorate([handlingRangeError],BinaryReader.prototype,"readU32",null),__decorate([handlingRangeError],BinaryReader.prototype,"readU64",null),__decorate([handlingRangeError],BinaryReader.prototype,"readU128",null),__decorate([handlingRangeError],BinaryReader.prototype,"readU256",null),__decorate([handlingRangeError],BinaryReader.prototype,"readU512",null),__decorate([handlingRangeError],BinaryReader.prototype,"readString",null),__decorate([handlingRangeError],BinaryReader.prototype,"readFixedArray",null),__decorate([handlingRangeError],BinaryReader.prototype,"readArray",null),exports.BinaryReader=BinaryReader,exports.serialize=serialize,exports.deserialize=deserialize,exports.deserializeUnchecked=deserializeUnchecked;

}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
},{"bn.js":37,"bs58":40,"buffer":41,"text-encoding-utf-8":72}],39:[function(require,module,exports){

},{}],40:[function(require,module,exports){
var basex=require("base-x"),ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";module.exports=basex(ALPHABET);

},{"base-x":35}],41:[function(require,module,exports){
(function (Buffer){(function (){
"use strict";var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;function typedArraySupport(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=Buffer.prototype,t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return fromString(e,t);if(ArrayBuffer.isView(e))return fromArrayLike(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(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var f=fromObject(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|byteLength(e,t),n=createBuffer(r),f=n.write(e,t);return f!==r&&(n=n.slice(0,f)),n}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=Buffer.prototype,n}function fromObject(e){if(Buffer.isBuffer(e)){var t=0|checked(e.length),r=createBuffer(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}return void 0!==e.length?"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e):"Buffer"===e.type&&Array.isArray(e.data)?fromArrayLike(e.data):void 0}function checked(e){if(e>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(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 r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var f=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(f)return n?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),f=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,f){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=f?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(f)return-1;r=e.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,f);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,f){var i,o=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,r/=2}function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(f){var h=-1;for(i=r;i<u;i++)if(a(e,i)===a(t,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===s)return h*o}else-1!==h&&(i-=i-h),h=-1}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var c=!0,l=0;l<s;l++)if(a(e,i+l)!==a(t,l)){c=!1;break}if(c)return i}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;var f=e.length-r;n?(n=Number(n))>f&&(n=f):n=f;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(t.substr(2*o,2),16);if(numberIsNaN(u))return o;e[r+o]=u}return o}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?base64.fromByteArray(e):base64.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],f=t;f<r;){var i,o,u,s,a=e[f],h=null,c=a>239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=e[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=e[f+1],o=e[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=e[f+1],o=e[f+2],u=e[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c}return decodeCodePointsArray(n)}exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.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(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(e,t,r){return alloc(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,f=0,i=Math.min(r,n);f<i;++f)if(e[f]!==t[f]){r=e[f],n=t[f];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(e){switch(String(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}},Buffer.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Buffer.allocUnsafe(t),f=0;for(r=0;r<e.length;++r){var i=e[r];if(isInstance(i,Uint8Array)&&(i=Buffer.from(i)),!Buffer.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function(){var e="",t=exports.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},Buffer.prototype.compare=function(e,t,r,n,f){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),t<0||r>e.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&t>=r)return 0;if(n>=f)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(f>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),u=Math.min(i,o),s=this.slice(n,f),a=e.slice(t,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.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))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(127&e[f]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(e[f]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=t;i<r;++i)f+=toHex(e[i]);return f}function utf16leSlice(e,t,r){for(var n=e.slice(t,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,f,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,r,n,f,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=Buffer.prototype,n},Buffer.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n},Buffer.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],f=1;t>0&&(f*=256);)n+=this[e+--t]*f;return n},Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n>=(f*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,f=1,i=this[e+--n];n>0&&(f*=256);)i+=this[e+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[t]=255&e;++i<r&&(f*=256);)this[t+i]=e/f&255;return t+r},Buffer.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[t+f]=255&e;--f>=0&&(i*=256);)this[t+f]=e/i&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(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},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(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},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=0,o=1,u=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(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},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(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},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var f=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var i=f-1;i>=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return f},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var f=e.charCodeAt(0);("utf8"===n&&f<128||"latin1"===n)&&(e=f)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var o=Buffer.isBuffer(e)?e:Buffer.from(e,n),u=o.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%u]}return this};var INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(e){if((e=(e=e.split("=")[0]).trim().replace(INVALID_BASE64_RE,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){var r;t=t||1/0;for(var n=e.length,f=null,i=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!f){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(t-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function utf16leToBytes(e,t){for(var r,n,f,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(e){return base64.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var f=0;f<n&&!(f+r>=t.length||f>=e.length);++f)t[f+r]=e[f];return f}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}

}).call(this)}).call(this,require("buffer").Buffer)
},{"base64-js":36,"buffer":41,"ieee754":59}],42:[function(require,module,exports){
require(".").check("es5");

},{".":43}],43:[function(require,module,exports){
require("./lib/definitions"),module.exports=require("./lib");

},{"./lib":46,"./lib/definitions":45}],44:[function(require,module,exports){
var CapabilityDetector=function(){this.tests={},this.cache={}};CapabilityDetector.prototype={constructor:CapabilityDetector,define:function(t,i){if("string"!=typeof t||!(i instanceof Function))throw new Error("Invalid capability definition.");if(this.tests[t])throw new Error('Duplicated capability definition by "'+t+'".');this.tests[t]=i},check:function(t){if(!this.test(t))throw new Error('The current environment does not support "'+t+'", therefore we cannot continue.')},test:function(t){if(void 0!==this.cache[t])return this.cache[t];if(!this.tests[t])throw new Error('Unknown capability with name "'+t+'".');var i=this.tests[t];return this.cache[t]=!!i(),this.cache[t]}},module.exports=CapabilityDetector;

},{}],45:[function(require,module,exports){
var capability=require("."),define=capability.define,test=capability.test;define("strict mode",function(){return void 0===this}),define("arguments.callee.caller",function(){try{return function(){return arguments.callee.caller}()===arguments.callee}catch(e){return!1}}),define("es5",function(){return test("Array.prototype.forEach")&&test("Array.prototype.map")&&test("Function.prototype.bind")&&test("Object.create")&&test("Object.defineProperties")&&test("Object.defineProperty")&&test("Object.prototype.hasOwnProperty")}),define("Array.prototype.forEach",function(){return Array.prototype.forEach}),define("Array.prototype.map",function(){return Array.prototype.map}),define("Function.prototype.bind",function(){return Function.prototype.bind}),define("Object.create",function(){return Object.create}),define("Object.defineProperties",function(){return Object.defineProperties}),define("Object.defineProperty",function(){return Object.defineProperty}),define("Object.prototype.hasOwnProperty",function(){return Object.prototype.hasOwnProperty}),define("Error.captureStackTrace",function(){return Error.captureStackTrace}),define("Error.prototype.stack",function(){try{throw new Error}catch(e){return e.stack||e.stacktrace}});

},{".":46}],46:[function(require,module,exports){
var CapabilityDetector=require("./CapabilityDetector"),detector=new CapabilityDetector,capability=function(t){return detector.test(t)};capability.define=function(t,e){detector.define(t,e)},capability.check=function(t){detector.check(t)},capability.test=capability,module.exports=capability;

},{"./CapabilityDetector":44}],47:[function(require,module,exports){
"use strict";function depd(r){if(!r)throw new TypeError("argument namespace is required");function e(r){}return e._file=void 0,e._ignored=!0,e._namespace=r,e._traced=!1,e._warned=Object.create(null),e.function=wrapfunction,e.property=wrapproperty,e}function wrapfunction(r,e){if("function"!=typeof r)throw new TypeError("argument fn must be a function");return r}function wrapproperty(r,e,t){if(!r||"object"!=typeof r&&"function"!=typeof r)throw new TypeError("argument obj must be object");var o=Object.getOwnPropertyDescriptor(r,e);if(!o)throw new TypeError("must call property on owner object");if(!o.configurable)throw new TypeError("property must be configurable")}module.exports=depd;

},{}],48:[function(require,module,exports){
module.exports=require("./lib");

},{"./lib":49}],49:[function(require,module,exports){
require("capability/es5");var polyfill,capability=require("capability");polyfill=capability("Error.captureStackTrace")?require("./v8"):capability("Error.prototype.stack")?require("./non-v8/index"):require("./unsupported"),module.exports=polyfill();

},{"./non-v8/index":53,"./unsupported":55,"./v8":56,"capability":43,"capability/es5":42}],50:[function(require,module,exports){
var Class=require("o3").Class,abstractMethod=require("o3").abstractMethod,Frame=Class(Object,{prototype:{init:Class.prototype.merge,frameString:void 0,toString:function(){return this.frameString},functionValue:void 0,getThis:abstractMethod,getTypeName:abstractMethod,getFunction:function(){return this.functionValue},getFunctionName:abstractMethod,getMethodName:abstractMethod,getFileName:abstractMethod,getLineNumber:abstractMethod,getColumnNumber:abstractMethod,getEvalOrigin:abstractMethod,isTopLevel:abstractMethod,isEval:abstractMethod,isNative:abstractMethod,isConstructor:abstractMethod}});module.exports=Frame;

},{"o3":63}],51:[function(require,module,exports){
var Class=require("o3").Class,Frame=require("./Frame"),cache=require("u3").cache,FrameStringParser=Class(Object,{prototype:{stackParser:null,frameParser:null,locationParsers:null,constructor:function(e){Class.prototype.merge.call(this,e)},getFrames:function(e,r){for(var t=[],a=0,n=e.length;a<n;++a)t[a]=this.getFrame(e[a],r[a]);return t},getFrame:function(e,r){return new Frame({frameString:e,functionValue:r})}}});module.exports={getClass:cache(function(){return FrameStringParser}),getInstance:cache(function(){return new(this.getClass())})};

},{"./Frame":50,"o3":63,"u3":75}],52:[function(require,module,exports){
var Class=require("o3").Class,abstractMethod=require("o3").abstractMethod,eachCombination=require("u3").eachCombination,cache=require("u3").cache,capability=require("capability"),AbstractFrameStringSource=Class(Object,{prototype:{captureFrameStrings:function(r){var t=this.createError();r.unshift(this.captureFrameStrings),r.unshift(this.createError);var e=this.getFrameStrings(t).slice(r.length),a=[];if(capability("arguments.callee.caller")){var n=[this.createError,this.captureFrameStrings];try{for(var i=arguments.callee;i=i.caller;)n.push(i)}catch(r){}a=n.slice(r.length)}return{frameStrings:e,functionValues:a}},getFrameStrings:function(r){var t=r.message||"",e=r.name||"",a=this.getStackString(r);if(void 0!==a){var n=a.split("\n"),i=0,c=n.length;return this.hasHeader&&(i+=e.split("\n").length+t.split("\n").length-1),this.hasFooter&&(c-=1),n.slice(i,c)}},createError:abstractMethod,getStackString:abstractMethod,hasHeader:void 0,hasFooter:void 0}}),FrameStringSourceCalibrator=Class(Object,{prototype:{calibrateClass:function(r){return this.calibrateMethods(r)&&this.calibrateEnvelope(r)},calibrateMethods:function(r){try{eachCombination([[function(r){return new Error(r)},function(r){try{throw new Error(r)}catch(r){return r}}],[function(r){return r.stack},function(r){return r.stacktrace}]],function(r,t){if(t(r()))throw{getStackString:t,createError:r}})}catch(t){return Class.merge.call(r,{prototype:t}),!0}return!1},calibrateEnvelope:function(r){var t=(0,r.prototype.getStackString)((0,r.prototype.createError)("marker")).split("\n");return Class.merge.call(r,{prototype:{hasHeader:/marker/.test(t[0]),hasFooter:""===t[t.length-1]}}),!0}}});module.exports={getClass:cache(function(){var r;if(r)return r;if(r=Class(AbstractFrameStringSource,{}),!(new FrameStringSourceCalibrator).calibrateClass(r))throw new Error("Cannot read Error.prototype.stack in this environment.");return r}),getInstance:cache(function(){return new(this.getClass())})};

},{"capability":43,"o3":63,"u3":75}],53:[function(require,module,exports){
var FrameStringSource=require("./FrameStringSource"),FrameStringParser=require("./FrameStringParser"),cache=require("u3").cache,prepareStackTrace=require("../prepareStackTrace");module.exports=function(){return Error.captureStackTrace=function r(e,a){var t=[r];a&&t.push(a);var c=FrameStringSource.getInstance().captureFrameStrings(t);Object.defineProperties(e,{stack:{configurable:!0,get:cache(function(){var r=FrameStringParser.getInstance().getFrames(c.frameStrings,c.functionValues);return(Error.prepareStackTrace||prepareStackTrace)(e,r,void 0)})},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})},Error.getStackTrace=function(r){if(r.cachedStack)return r.stack;var e,a=FrameStringSource.getInstance().getFrameStrings(r),t=[];a?t=FrameStringParser.getInstance().getFrames(a,[]):e=["The stack is not readable by unthrown errors in this environment."];var c=(Error.prepareStackTrace||prepareStackTrace)(r,t,e);if(a)try{Object.defineProperties(r,{stack:{configurable:!0,writable:!0,enumerable:!1,value:c},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})}catch(r){}return c},{prepareStackTrace:prepareStackTrace}};

},{"../prepareStackTrace":54,"./FrameStringParser":51,"./FrameStringSource":52,"u3":75}],54:[function(require,module,exports){
var prepareStackTrace=function(r,a,e){var n="";if(n+=r.name||"Error",n+=": "+(r.message||""),e instanceof Array)for(var t in e){n+="\n   # "+e[t]}for(var o in a){n+="\n   at "+a[o].toString()}return n};module.exports=prepareStackTrace;

},{}],55:[function(require,module,exports){
var cache=require("u3").cache,prepareStackTrace=require("./prepareStackTrace");module.exports=function(){return Error.captureStackTrace=function(e,r){Object.defineProperties(e,{stack:{configurable:!0,get:cache(function(){return(Error.prepareStackTrace||prepareStackTrace)(e,[])})},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})},Error.getStackTrace=function(e){if(e.cachedStack)return e.stack;var r=(Error.prepareStackTrace||prepareStackTrace)(e,[]);try{Object.defineProperties(e,{stack:{configurable:!0,writable:!0,enumerable:!1,value:r},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})}catch(e){}return r},{prepareStackTrace:prepareStackTrace}};

},{"./prepareStackTrace":54,"u3":75}],56:[function(require,module,exports){
var prepareStackTrace=require("./prepareStackTrace");module.exports=function(){return Error.getStackTrace=function(r){return r.stack},{prepareStackTrace:prepareStackTrace}};

},{"./prepareStackTrace":54}],57:[function(require,module,exports){
"use strict";var deprecate=require("depd")("http-errors"),setPrototypeOf=require("setprototypeof"),statuses=require("statuses"),inherits=require("inherits"),toIdentifier=require("toidentifier");function codeClass(r){return Number(String(r).charAt(0)+"00")}function createError(){for(var r,e,t=500,o={},s=0;s<arguments.length;s++){var a=arguments[s];if(a instanceof Error)t=(r=a).status||r.statusCode||t;else switch(typeof a){case"string":e=a;break;case"number":t=a,0!==s&&deprecate("non-first-argument status code; replace with createError("+a+", ...)");break;case"object":o=a}}"number"==typeof t&&(t<400||t>=600)&&deprecate("non-error status code; use only 4xx or 5xx status codes"),("number"!=typeof t||!statuses[t]&&(t<400||t>=600))&&(t=500);var n=createError[t]||createError[codeClass(t)];for(var u in r||(r=n?new n(e):new Error(e||statuses[t]),Error.captureStackTrace(r,createError)),n&&r instanceof n&&r.status===t||(r.expose=t<500,r.status=r.statusCode=t),o)"status"!==u&&"statusCode"!==u&&(r[u]=o[u]);return r}function createHttpErrorConstructor(){function r(){throw new TypeError("cannot construct abstract class")}return inherits(r,Error),r}function createClientErrorConstructor(r,e,t){var o=toClassName(e);function s(r){var e=null!=r?r:statuses[t],a=new Error(e);return Error.captureStackTrace(a,s),setPrototypeOf(a,s.prototype),Object.defineProperty(a,"message",{enumerable:!0,configurable:!0,value:e,writable:!0}),Object.defineProperty(a,"name",{enumerable:!1,configurable:!0,value:o,writable:!0}),a}return inherits(s,r),nameFunc(s,o),s.prototype.status=t,s.prototype.statusCode=t,s.prototype.expose=!0,s}function createIsHttpErrorFunction(r){return function(e){return!(!e||"object"!=typeof e)&&(e instanceof r||e instanceof Error&&"boolean"==typeof e.expose&&"number"==typeof e.statusCode&&e.status===e.statusCode)}}function createServerErrorConstructor(r,e,t){var o=toClassName(e);function s(r){var e=null!=r?r:statuses[t],a=new Error(e);return Error.captureStackTrace(a,s),setPrototypeOf(a,s.prototype),Object.defineProperty(a,"message",{enumerable:!0,configurable:!0,value:e,writable:!0}),Object.defineProperty(a,"name",{enumerable:!1,configurable:!0,value:o,writable:!0}),a}return inherits(s,r),nameFunc(s,o),s.prototype.status=t,s.prototype.statusCode=t,s.prototype.expose=!1,s}function nameFunc(r,e){var t=Object.getOwnPropertyDescriptor(r,"name");t&&t.configurable&&(t.value=e,Object.defineProperty(r,"name",t))}function populateConstructorExports(r,e,t){e.forEach(function(e){var o,s=toIdentifier(statuses[e]);switch(codeClass(e)){case 400:o=createClientErrorConstructor(t,s,e);break;case 500:o=createServerErrorConstructor(t,s,e)}o&&(r[e]=o,r[s]=o)}),r["I'mateapot"]=deprecate.function(r.ImATeapot,'"I\'mateapot"; use "ImATeapot" instead')}function toClassName(r){return"Error"!==r.substr(-5)?r+"Error":r}module.exports=createError,module.exports.HttpError=createHttpErrorConstructor(),module.exports.isHttpError=createIsHttpErrorFunction(module.exports.HttpError),populateConstructorExports(module.exports,statuses.codes,module.exports.HttpError);

},{"depd":58,"inherits":60,"setprototypeof":69,"statuses":71,"toidentifier":73}],58:[function(require,module,exports){
"use strict";function depd(r){if(!r)throw new TypeError("argument namespace is required");function e(r){}return e._file=void 0,e._ignored=!0,e._namespace=r,e._traced=!1,e._warned=Object.create(null),e.function=wrapfunction,e.property=wrapproperty,e}function wrapfunction(r,e){if("function"!=typeof r)throw new TypeError("argument fn must be a function");return r}function wrapproperty(r,e,t){if(!r||"object"!=typeof r&&"function"!=typeof r)throw new TypeError("argument obj must be object");var o=Object.getOwnPropertyDescriptor(r,e);if(!o)throw new TypeError("must call property on owner object");if(!o.configurable)throw new TypeError("property must be configurable")}module.exports=depd;

},{}],59:[function(require,module,exports){
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};

},{}],60:[function(require,module,exports){
"function"==typeof Object.create?module.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(t,e){if(e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}};

},{}],61:[function(require,module,exports){
(function (process,global){(function (){
!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD="function"==typeof define&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,h){return function(r){return new Sha256(h,!0).update(r)[t]()}},createMethod=function(t){var h=createOutputMethod("hex",t);NODE_JS&&(h=nodeWrap(h,t)),h.create=function(){return new Sha256(t)},h.update=function(t){return h.create().update(t)};for(var r=0;r<OUTPUT_TYPES.length;++r){var e=OUTPUT_TYPES[r];h[e]=createOutputMethod(e,t)}return h},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"==typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(null==t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,h){return function(r,e){return new HmacSha256(r,h,!0).update(e)[t]()}},createHmacMethod=function(t){var h=createHmacOutputMethod("hex",t);h.create=function(h){return new HmacSha256(h,t)},h.update=function(t,r){return h.create(t).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var e=OUTPUT_TYPES[r];h[e]=createHmacOutputMethod(e,t)}return h};function Sha256(t,h){h?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,h,r){var e,s=typeof t;if("string"===s){var i,o=[],a=t.length,H=0;for(e=0;e<a;++e)(i=t.charCodeAt(e))<128?o[H++]=i:i<2048?(o[H++]=192|i>>6,o[H++]=128|63&i):i<55296||i>=57344?(o[H++]=224|i>>12,o[H++]=128|i>>6&63,o[H++]=128|63&i):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++e)),o[H++]=240|i>>18,o[H++]=128|i>>12&63,o[H++]=128|i>>6&63,o[H++]=128|63&i);t=o}else{if("object"!==s)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(h,!0).update(t).array());var n=[],S=[];for(e=0;e<64;++e){var c=t[e]||0;n[e]=92^c,S[e]=54^c}Sha256.call(this,h,r),this.update(S),this.oKeyPad=n,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(t){if(!this.finalized){var h,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);h=!0}for(var e,s,i=0,o=t.length,a=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),h)for(s=this.start;i<o&&s<64;++i)a[s>>2]|=t[i]<<SHIFT[3&s++];else for(s=this.start;i<o&&s<64;++i)(e=t.charCodeAt(i))<128?a[s>>2]|=e<<SHIFT[3&s++]:e<2048?(a[s>>2]|=(192|e>>6)<<SHIFT[3&s++],a[s>>2]|=(128|63&e)<<SHIFT[3&s++]):e<55296||e>=57344?(a[s>>2]|=(224|e>>12)<<SHIFT[3&s++],a[s>>2]|=(128|e>>6&63)<<SHIFT[3&s++],a[s>>2]|=(128|63&e)<<SHIFT[3&s++]):(e=65536+((1023&e)<<10|1023&t.charCodeAt(++i)),a[s>>2]|=(240|e>>18)<<SHIFT[3&s++],a[s>>2]|=(128|e>>12&63)<<SHIFT[3&s++],a[s>>2]|=(128|e>>6&63)<<SHIFT[3&s++],a[s>>2]|=(128|63&e)<<SHIFT[3&s++]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=a[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,h=this.lastByteIndex;t[16]=this.block,t[h>>2]|=EXTRA[3&h],this.block=t[16],h>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,h,r,e,s,i,o,a,H,n=this.h0,S=this.h1,c=this.h2,f=this.h3,A=this.h4,R=this.h5,u=this.h6,_=this.h7,E=this.blocks;for(t=16;t<64;++t)h=((s=E[t-15])>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,r=((s=E[t-2])>>>17|s<<15)^(s>>>19|s<<13)^s>>>10,E[t]=E[t-16]+h+E[t-7]+r<<0;for(H=S&c,t=0;t<64;t+=4)this.first?(this.is224?(i=300032,_=(s=E[0]-1413257819)-150054599<<0,f=s+24177077<<0):(i=704751109,_=(s=E[0]-210244248)-1521486534<<0,f=s+143694565<<0),this.first=!1):(h=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),e=(i=n&S)^n&c^H,_=f+(s=_+(r=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&R^~A&u)+K[t]+E[t])<<0,f=s+(h+e)<<0),h=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),e=(o=f&n)^f&S^i,u=c+(s=u+(r=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&A^~_&R)+K[t+1]+E[t+1])<<0,h=((c=s+(h+e)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),e=(a=c&f)^c&n^o,R=S+(s=R+(r=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&_^~u&A)+K[t+2]+E[t+2])<<0,h=((S=s+(h+e)<<0)>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),e=(H=S&c)^S&f^a,A=n+(s=A+(r=(R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7))+(R&u^~R&_)+K[t+3]+E[t+3])<<0,n=s+(h+e)<<0;this.h0=this.h0+n<<0,this.h1=this.h1+S<<0,this.h2=this.h2+c<<0,this.h3=this.h3+f<<0,this.h4=this.h4+A<<0,this.h5=this.h5+R<<0,this.h6=this.h6+u<<0,this.h7=this.h7+_<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,h=this.h1,r=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,a=this.h7,H=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[15&h]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o];return this.is224||(H+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),H},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,h=this.h1,r=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,a=this.h7,H=[t>>24&255,t>>16&255,t>>8&255,255&t,h>>24&255,h>>16&255,h>>8&255,255&h,r>>24&255,r>>16&255,r>>8&255,255&r,e>>24&255,e>>16&255,e>>8&255,255&e,s>>24&255,s>>16&255,s>>8&255,255&s,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o];return this.is224||H.push(a>>24&255,a>>16&255,a>>8&255,255&a),H},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),h=new DataView(t);return h.setUint32(0,this.h0),h.setUint32(4,this.h1),h.setUint32(8,this.h2),h.setUint32(12,this.h3),h.setUint32(16,this.h4),h.setUint32(20,this.h5),h.setUint32(24,this.h6),this.is224||h.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))}();

}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"_process":67}],62:[function(require,module,exports){
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Mustache=t()}(this,function(){"use strict";var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"==typeof e&&t in e}var o=RegExp.prototype.test;var a=/\S/;function s(e){return!function(e,t){return o.call(e,t)}(a,e)}var c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};var p=/\s*/,u=/\s+/,l=/\s*=/,h=/\s*\}/,f=/#|\^|\/|>|\{|&|=|!/;function g(e){this.string=e,this.tail=e,this.pos=0}function d(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function v(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}g.prototype.eos=function(){return""===this.tail},g.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},g.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},d.prototype.push=function(e){return new d(e,this)},d.prototype.lookup=function(e){var t,r,o,a=this.cache;if(a.hasOwnProperty(e))t=a[e];else{for(var s,c,p,u=this,l=!1;u;){if(e.indexOf(".")>0)for(s=u.view,c=e.split("."),p=0;null!=s&&p<c.length;)p===c.length-1&&(l=i(s,c[p])||(r=s,o=c[p],null!=r&&"object"!=typeof r&&r.hasOwnProperty&&r.hasOwnProperty(o))),s=s[c[p++]];else s=u.view[e],l=i(u.view,e);if(l){t=s;break}u=u.parent}a[e]=t}return n(t)&&(t=t.call(this.view)),t},v.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},v.prototype.parse=function(e,n){var i=this.templateCache,o=e+":"+(n||y.tags).join(":"),a=void 0!==i,c=a?i.get(o):void 0;return null==c&&(c=function(e,n){if(!e)return[];var i,o,a,c=!1,d=[],v=[],w=[],m=!1,b=!1,C="",k=0;function x(){if(m&&!b)for(;w.length;)delete v[w.pop()];else w=[];m=!1,b=!1}function E(e){if("string"==typeof e&&(e=e.split(u,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);i=new RegExp(r(e[0])+"\\s*"),o=new RegExp("\\s*"+r(e[1])),a=new RegExp("\\s*"+r("}"+e[1]))}E(n||y.tags);for(var T,j,U,S,P,V,O=new g(e);!O.eos();){if(T=O.pos,U=O.scanUntil(i))for(var A=0,I=U.length;A<I;++A)s(S=U.charAt(A))?(w.push(v.length),C+=S):(b=!0,c=!0,C+=" "),v.push(["text",S,T,T+1]),T+=1,"\n"===S&&(x(),C="",k=0,c=!1);if(!O.scan(i))break;if(m=!0,j=O.scan(f)||"name",O.scan(p),"="===j?(U=O.scanUntil(l),O.scan(l),O.scanUntil(o)):"{"===j?(U=O.scanUntil(a),O.scan(h),O.scanUntil(o),j="&"):U=O.scanUntil(o),!O.scan(o))throw new Error("Unclosed tag at "+O.pos);if(P=">"==j?[j,U,T,O.pos,C,k,c]:[j,U,T,O.pos],k++,v.push(P),"#"===j||"^"===j)d.push(P);else if("/"===j){if(!(V=d.pop()))throw new Error('Unopened section "'+U+'" at '+T);if(V[1]!==U)throw new Error('Unclosed section "'+V[1]+'" at '+T)}else"name"===j||"{"===j||"&"===j?b=!0:"="===j&&E(U)}if(x(),V=d.pop())throw new Error('Unclosed section "'+V[1]+'" at '+O.pos);return function(e){for(var t,n=[],r=n,i=[],o=0,a=e.length;o<a;++o)switch((t=e[o])[0]){case"#":case"^":r.push(t),i.push(t),r=t[4]=[];break;case"/":i.pop()[5]=t[2],r=i.length>0?i[i.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],i=0,o=e.length;i<o;++i)(t=e[i])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}(v))}(e,n),a&&i.set(o,c)),c},v.prototype.render=function(e,t,n,r){var i=this.getConfigTags(r),o=this.parse(e,i),a=t instanceof d?t:new d(t,void 0);return this.renderTokens(o,a,n,e,r)},v.prototype.renderTokens=function(e,t,n,r,i){for(var o,a,s,c="",p=0,u=e.length;p<u;++p)s=void 0,"#"===(a=(o=e[p])[0])?s=this.renderSection(o,t,n,r,i):"^"===a?s=this.renderInverted(o,t,n,r,i):">"===a?s=this.renderPartial(o,t,n,i):"&"===a?s=this.unescapedValue(o,t):"name"===a?s=this.escapedValue(o,t,i):"text"===a&&(s=this.rawValue(o)),void 0!==s&&(c+=s);return c},v.prototype.renderSection=function(e,r,i,o,a){var s=this,c="",p=r.lookup(e[1]);if(p){if(t(p))for(var u=0,l=p.length;u<l;++u)c+=this.renderTokens(e[4],r.push(p[u]),i,o,a);else if("object"==typeof p||"string"==typeof p||"number"==typeof p)c+=this.renderTokens(e[4],r.push(p),i,o,a);else if(n(p)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(p=p.call(r.view,o.slice(e[3],e[5]),function(e){return s.render(e,r,i,a)}))&&(c+=p)}else c+=this.renderTokens(e[4],r,i,o,a);return c}},v.prototype.renderInverted=function(e,n,r,i,o){var a=n.lookup(e[1]);if(!a||t(a)&&0===a.length)return this.renderTokens(e[4],n,r,i,o)},v.prototype.indentPartial=function(e,t,n){for(var r=t.replace(/[^ \t]/g,""),i=e.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!n)&&(i[o]=r+i[o]);return i.join("\n")},v.prototype.renderPartial=function(e,t,r,i){if(r){var o=this.getConfigTags(i),a=n(r)?r(e[1]):r[e[1]];if(null!=a){var s=e[6],c=e[5],p=e[4],u=a;0==c&&p&&(u=this.indentPartial(a,p,s));var l=this.parse(u,o);return this.renderTokens(l,t,r,u,i)}}},v.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},v.prototype.escapedValue=function(e,t,n){var r=this.getConfigEscape(n)||y.escape,i=t.lookup(e[1]);if(null!=i)return"number"==typeof i&&r===y.escape?String(i):r(i)},v.prototype.rawValue=function(e){return e[1]},v.prototype.getConfigTags=function(e){return t(e)?e:e&&"object"==typeof e?e.tags:void 0},v.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!t(e)?e.escape:void 0};var y={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){w.templateCache=e},get templateCache(){return w.templateCache}},w=new v;return y.clearCache=function(){return w.clearCache()},y.parse=function(e,t){return w.parse(e,t)},y.render=function(e,n,r,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(t(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return w.render(e,n,r,i)},y.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return c[e]})},y.Scanner=g,y.Context=d,y.Writer=v,y});

},{}],63:[function(require,module,exports){
require("capability/es5"),module.exports=require("./lib");

},{"./lib":66,"capability/es5":42}],64:[function(require,module,exports){
var Class=function(){var t=Object.create({Source:Object,config:{},buildArgs:[]});function o(o){var r="config";if(o instanceof Function)r="Source";else if(o instanceof Array)r="buildArgs";else{if(!(o instanceof Object))throw new Error("Invalid configuration option.");r="config"}if(t.hasOwnProperty(r))throw new Error("Duplicated configuration option: "+r+".");t[r]=o}for(var r=0,e=arguments.length;r<e;++r)o(arguments[r]);var n=t.Source,s=t.config,i=t.buildArgs;return(n.extend||Class.extend).call(n,s,i)};Class.factory=function(){return function(){this.build instanceof Function&&this.build.apply(this,arguments),this.init instanceof Function&&this.init.apply(this,arguments)}},Class.extend=function(t,o){var r;return t||(t={}),t.prototype instanceof Object&&t.prototype.constructor!==Object?r=t.prototype.constructor:t.factory instanceof Function&&(r=t.factory.call(this)),((r=(this.clone||Class.clone).call(this,r,o)).merge||Class.merge).call(r,t),r},Class.prototype.extend=function(t,o){var r=(this.clone||Class.prototype.clone).apply(this,o);return(r.merge||Class.prototype.merge).call(r,t),r},Class.clone=function(t,o){for(var r in t instanceof Function||(t=(this.factory||Class.factory).call(this)),t.prototype=(this.prototype.clone||Class.prototype.clone).apply(this.prototype,o||[]),t.prototype.constructor=t,this)"prototype"!==r&&(t[r]=this[r]);return t},Class.prototype.clone=function(){var t=Object.create(this);return t.build instanceof Function&&t.build.apply(t,arguments),t},Class.merge=function(t){for(var o in t)"prototype"!==o&&(this[o]=t[o]);return t.prototype instanceof Object&&(this.prototype.merge||Class.prototype.merge).call(this.prototype,t.prototype),this},Class.prototype.merge=function(t){for(var o in t)"constructor"!==o&&(this[o]=t[o]);return this},Class.absorb=function(t){for(var o in t)"prototype"===o||void 0!==this[o]&&this[o]!==Function.prototype[o]||(this[o]=t[o]);return t.prototype instanceof Object&&(this.prototype.absorb||Class.prototype.absorb).call(this.prototype,t.prototype),this},Class.prototype.absorb=function(t){for(var o in t)"constructor"===o||void 0!==this[o]&&this[o]!==Object.prototype[o]||(this[o]=t[o]);return this},Class.getAncestor=function(){if(this!==this.prototype.constructor)return this.prototype.constructor},Class.newInstance=function(){var t=Object.create(this.prototype);return this.apply(t,arguments),t},module.exports=Class;

},{}],65:[function(require,module,exports){
module.exports=function(){throw new Error("Not implemented.")};

},{}],66:[function(require,module,exports){
module.exports={Class:require("./Class"),abstractMethod:require("./abstractMethod")};

},{"./Class":64,"./abstractMethod":65}],67:[function(require,module,exports){
var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};

},{}],68:[function(require,module,exports){
var buffer=require("buffer"),Buffer=buffer.Buffer;function copyProps(f,e){for(var r in f)e[r]=f[r]}function SafeBuffer(f,e,r){return Buffer(f,e,r)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(Buffer.prototype),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(f,e,r){if("number"==typeof f)throw new TypeError("Argument must not be a number");return Buffer(f,e,r)},SafeBuffer.alloc=function(f,e,r){if("number"!=typeof f)throw new TypeError("Argument must be a number");var u=Buffer(f);return void 0!==e?"string"==typeof r?u.fill(e,r):u.fill(e):u.fill(0),u},SafeBuffer.allocUnsafe=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return Buffer(f)},SafeBuffer.allocUnsafeSlow=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(f)};

},{"buffer":41}],69:[function(require,module,exports){
"use strict";function setProtoOf(t,r){return t.__proto__=r,t}function mixinProperties(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o]);return t}module.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?setProtoOf:mixinProperties);

},{}],70:[function(require,module,exports){
module.exports={
  "100": "Continue",
  "101": "Switching Protocols",
  "102": "Processing",
  "103": "Early Hints",
  "200": "OK",
  "201": "Created",
  "202": "Accepted",
  "203": "Non-Authoritative Information",
  "204": "No Content",
  "205": "Reset Content",
  "206": "Partial Content",
  "207": "Multi-Status",
  "208": "Already Reported",
  "226": "IM Used",
  "300": "Multiple Choices",
  "301": "Moved Permanently",
  "302": "Found",
  "303": "See Other",
  "304": "Not Modified",
  "305": "Use Proxy",
  "306": "(Unused)",
  "307": "Temporary Redirect",
  "308": "Permanent Redirect",
  "400": "Bad Request",
  "401": "Unauthorized",
  "402": "Payment Required",
  "403": "Forbidden",
  "404": "Not Found",
  "405": "Method Not Allowed",
  "406": "Not Acceptable",
  "407": "Proxy Authentication Required",
  "408": "Request Timeout",
  "409": "Conflict",
  "410": "Gone",
  "411": "Length Required",
  "412": "Precondition Failed",
  "413": "Payload Too Large",
  "414": "URI Too Long",
  "415": "Unsupported Media Type",
  "416": "Range Not Satisfiable",
  "417": "Expectation Failed",
  "418": "I'm a teapot",
  "421": "Misdirected Request",
  "422": "Unprocessable Entity",
  "423": "Locked",
  "424": "Failed Dependency",
  "425": "Unordered Collection",
  "426": "Upgrade Required",
  "428": "Precondition Required",
  "429": "Too Many Requests",
  "431": "Request Header Fields Too Large",
  "451": "Unavailable For Legal Reasons",
  "500": "Internal Server Error",
  "501": "Not Implemented",
  "502": "Bad Gateway",
  "503": "Service Unavailable",
  "504": "Gateway Timeout",
  "505": "HTTP Version Not Supported",
  "506": "Variant Also Negotiates",
  "507": "Insufficient Storage",
  "508": "Loop Detected",
  "509": "Bandwidth Limit Exceeded",
  "510": "Not Extended",
  "511": "Network Authentication Required"
}

},{}],71:[function(require,module,exports){
"use strict";var codes=require("./codes.json");function populateStatusesMap(t,s){var r=[];return Object.keys(s).forEach(function(e){var a=s[e],u=Number(e);t[u]=a,t[a]=u,t[a.toLowerCase()]=u,r.push(u)}),r}function status(t){if("number"==typeof t){if(!status[t])throw new Error("invalid status code: "+t);return t}if("string"!=typeof t)throw new TypeError("code must be a number or string");var s=parseInt(t,10);if(!isNaN(s)){if(!status[s])throw new Error("invalid status code: "+s);return s}if(!(s=status[t.toLowerCase()]))throw new Error('invalid status message: "'+t+'"');return s}module.exports=status,status.STATUS_CODES=codes,status.codes=populateStatusesMap(status,codes),status.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},status.empty={204:!0,205:!0,304:!0},status.retry={502:!0,503:!0,504:!0};

},{"./codes.json":70}],72:[function(require,module,exports){
"use strict";function inRange(e,r,n){return r<=e&&e<=n}function ToDictionary(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function stringToCodePoints(e){for(var r=String(e),n=r.length,t=0,i=[];t<n;){var o=r.charCodeAt(t);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(t===n-1)i.push(65533);else{var s=e.charCodeAt(t+1);if(56320<=s&&s<=57343){var a=1023&o,f=1023&s;i.push(65536+(a<<10)+f),t+=1}else i.push(65533)}t+=1}return i}function codePointsToString(e){for(var r="",n=0;n<e.length;++n){var t=e[n];t<=65535?r+=String.fromCharCode(t):(t-=65536,r+=String.fromCharCode(55296+(t>>10),56320+(1023&t)))}return r}var end_of_stream=-1;function Stream(e){this.tokens=[].slice.call(e)}Stream.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():end_of_stream},prepend:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.unshift(r.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.push(r.shift());else this.tokens.push(e)}};var finished=-1;function decoderError(e,r){if(e)throw TypeError("Decoder error");return r||65533}var DEFAULT_ENCODING="utf-8";function TextDecoder(e,r){if(!(this instanceof TextDecoder))return new TextDecoder(e,r);if((e=void 0!==e?String(e).toLowerCase():DEFAULT_ENCODING)!==DEFAULT_ENCODING)throw new Error("Encoding not supported. Only utf-8 is supported");r=ToDictionary(r),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(r.fatal),this._ignoreBOM=Boolean(r.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function TextEncoder(e,r){if(!(this instanceof TextEncoder))return new TextEncoder(e,r);if((e=void 0!==e?String(e).toLowerCase():DEFAULT_ENCODING)!==DEFAULT_ENCODING)throw new Error("Encoding not supported. Only utf-8 is supported");r=ToDictionary(r),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(r.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function UTF8Decoder(e){var r=e.fatal,n=0,t=0,i=0,o=128,s=191;this.handler=function(e,a){if(a===end_of_stream&&0!==i)return i=0,decoderError(r);if(a===end_of_stream)return finished;if(0===i){if(inRange(a,0,127))return a;if(inRange(a,194,223))i=1,n=a-192;else if(inRange(a,224,239))224===a&&(o=160),237===a&&(s=159),i=2,n=a-224;else{if(!inRange(a,240,244))return decoderError(r);240===a&&(o=144),244===a&&(s=143),i=3,n=a-240}return n<<=6*i,null}if(!inRange(a,o,s))return n=i=t=0,o=128,s=191,e.prepend(a),decoderError(r);if(o=128,s=191,n+=a-128<<6*(i-(t+=1)),t!==i)return null;var f=n;return n=i=t=0,f}}function UTF8Encoder(e){e.fatal;this.handler=function(e,r){if(r===end_of_stream)return finished;if(inRange(r,0,127))return r;var n,t;inRange(r,128,2047)?(n=1,t=192):inRange(r,2048,65535)?(n=2,t=224):inRange(r,65536,1114111)&&(n=3,t=240);for(var i=[(r>>6*n)+t];n>0;){var o=r>>6*(n-1);i.push(128|63&o),n-=1}return i}}TextDecoder.prototype={decode:function(e,r){var n;n="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),r=ToDictionary(r),this._streaming||(this._decoder=new UTF8Decoder({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(r.stream);for(var t,i=new Stream(n),o=[];!i.endOfStream()&&(t=this._decoder.handler(i,i.read()))!==finished;)null!==t&&(Array.isArray(t)?o.push.apply(o,t):o.push(t));if(!this._streaming){do{if((t=this._decoder.handler(i,i.read()))===finished)break;null!==t&&(Array.isArray(t)?o.push.apply(o,t):o.push(t))}while(!i.endOfStream());this._decoder=null}return o.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===o[0]?(this._BOMseen=!0,o.shift()):this._BOMseen=!0)),codePointsToString(o)}},TextEncoder.prototype={encode:function(e,r){e=e?String(e):"",r=ToDictionary(r),this._streaming||(this._encoder=new UTF8Encoder(this._options)),this._streaming=Boolean(r.stream);for(var n,t=[],i=new Stream(stringToCodePoints(e));!i.endOfStream()&&(n=this._encoder.handler(i,i.read()))!==finished;)Array.isArray(n)?t.push.apply(t,n):t.push(n);if(!this._streaming){for(;(n=this._encoder.handler(i,i.read()))!==finished;)Array.isArray(n)?t.push.apply(t,n):t.push(n);this._encoder=null}return new Uint8Array(t)}},exports.TextEncoder=TextEncoder,exports.TextDecoder=TextDecoder;

},{}],73:[function(require,module,exports){
"use strict";function toIdentifier(e){return e.split(" ").map(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}module.exports=toIdentifier;

},{}],74:[function(require,module,exports){
!function(r){"use strict";var t=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t<r.length;t++)n[t]=r[t];return n},n=function(){throw new Error("no PRNG")},e=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var i=t(),h=t([1]),a=t([56129,1]),f=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),s=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),c=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),y=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function l(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function w(r,t,n,e,o){var i,h=0;for(i=0;i<o;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function v(r,t,n,e){return w(r,t,n,e,16)}function p(r,t,n,e){return w(r,t,n,e,32)}function b(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,v=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,A=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=i,d=h,E=a,x=f,M=s,m=u,B=c,S=y,k=l,K=w,Y=v,L=p,T=b,z=g,R=A,P=_,N=0;N<20;N+=2)U^=(o=(T^=(o=(k^=(o=(M^=(o=U+T|0)<<7|o>>>25)+U|0)<<9|o>>>23)+M|0)<<13|o>>>19)+k|0)<<18|o>>>14,m^=(o=(d^=(o=(z^=(o=(K^=(o=m+d|0)<<7|o>>>25)+m|0)<<9|o>>>23)+K|0)<<13|o>>>19)+z|0)<<18|o>>>14,Y^=(o=(B^=(o=(E^=(o=(R^=(o=Y+B|0)<<7|o>>>25)+Y|0)<<9|o>>>23)+R|0)<<13|o>>>19)+E|0)<<18|o>>>14,P^=(o=(L^=(o=(S^=(o=(x^=(o=P+L|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+S|0)<<18|o>>>14,U^=(o=(x^=(o=(E^=(o=(d^=(o=U+x|0)<<7|o>>>25)+U|0)<<9|o>>>23)+d|0)<<13|o>>>19)+E|0)<<18|o>>>14,m^=(o=(M^=(o=(S^=(o=(B^=(o=m+M|0)<<7|o>>>25)+m|0)<<9|o>>>23)+B|0)<<13|o>>>19)+S|0)<<18|o>>>14,Y^=(o=(K^=(o=(k^=(o=(L^=(o=Y+K|0)<<7|o>>>25)+Y|0)<<9|o>>>23)+L|0)<<13|o>>>19)+k|0)<<18|o>>>14,P^=(o=(R^=(o=(z^=(o=(T^=(o=P+R|0)<<7|o>>>25)+P|0)<<9|o>>>23)+T|0)<<13|o>>>19)+z|0)<<18|o>>>14;U=U+i|0,d=d+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,k=k+l|0,K=K+w|0,Y=Y+v|0,L=L+p|0,T=T+b|0,z=z+g|0,R=R+A|0,P=P+_|0,r[0]=U>>>0&255,r[1]=U>>>8&255,r[2]=U>>>16&255,r[3]=U>>>24&255,r[4]=d>>>0&255,r[5]=d>>>8&255,r[6]=d>>>16&255,r[7]=d>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=k>>>0&255,r[33]=k>>>8&255,r[34]=k>>>16&255,r[35]=k>>>24&255,r[36]=K>>>0&255,r[37]=K>>>8&255,r[38]=K>>>16&255,r[39]=K>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=L>>>0&255,r[45]=L>>>8&255,r[46]=L>>>16&255,r[47]=L>>>24&255,r[48]=T>>>0&255,r[49]=T>>>8&255,r[50]=T>>>16&255,r[51]=T>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}(r,t,n,e)}function g(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,v=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,A=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=0;U<20;U+=2)i^=(o=(b^=(o=(l^=(o=(s^=(o=i+b|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+l|0)<<18|o>>>14,u^=(o=(h^=(o=(g^=(o=(w^=(o=u+h|0)<<7|o>>>25)+u|0)<<9|o>>>23)+w|0)<<13|o>>>19)+g|0)<<18|o>>>14,v^=(o=(c^=(o=(a^=(o=(A^=(o=v+c|0)<<7|o>>>25)+v|0)<<9|o>>>23)+A|0)<<13|o>>>19)+a|0)<<18|o>>>14,_^=(o=(p^=(o=(y^=(o=(f^=(o=_+p|0)<<7|o>>>25)+_|0)<<9|o>>>23)+f|0)<<13|o>>>19)+y|0)<<18|o>>>14,i^=(o=(f^=(o=(a^=(o=(h^=(o=i+f|0)<<7|o>>>25)+i|0)<<9|o>>>23)+h|0)<<13|o>>>19)+a|0)<<18|o>>>14,u^=(o=(s^=(o=(y^=(o=(c^=(o=u+s|0)<<7|o>>>25)+u|0)<<9|o>>>23)+c|0)<<13|o>>>19)+y|0)<<18|o>>>14,v^=(o=(w^=(o=(l^=(o=(p^=(o=v+w|0)<<7|o>>>25)+v|0)<<9|o>>>23)+p|0)<<13|o>>>19)+l|0)<<18|o>>>14,_^=(o=(A^=(o=(g^=(o=(b^=(o=_+A|0)<<7|o>>>25)+_|0)<<9|o>>>23)+b|0)<<13|o>>>19)+g|0)<<18|o>>>14;r[0]=i>>>0&255,r[1]=i>>>8&255,r[2]=i>>>16&255,r[3]=i>>>24&255,r[4]=u>>>0&255,r[5]=u>>>8&255,r[6]=u>>>16&255,r[7]=u>>>24&255,r[8]=v>>>0&255,r[9]=v>>>8&255,r[10]=v>>>16&255,r[11]=v>>>24&255,r[12]=_>>>0&255,r[13]=_>>>8&255,r[14]=_>>>16&255,r[15]=_>>>24&255,r[16]=c>>>0&255,r[17]=c>>>8&255,r[18]=c>>>16&255,r[19]=c>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=l>>>0&255,r[25]=l>>>8&255,r[26]=l>>>16&255,r[27]=l>>>24&255,r[28]=w>>>0&255,r[29]=w>>>8&255,r[30]=w>>>16&255,r[31]=w>>>24&255}(r,t,n,e)}var A=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(r,t,n,e,o,i,h){var a,f,s=new Uint8Array(16),u=new Uint8Array(64);for(f=0;f<16;f++)s[f]=0;for(f=0;f<8;f++)s[f]=i[f];for(;o>=64;){for(b(u,s,h,A),f=0;f<64;f++)r[t+f]=n[e+f]^u[f];for(a=1,f=8;f<16;f++)a=a+(255&s[f])|0,s[f]=255&a,a>>>=8;o-=64,t+=64,e+=64}if(o>0)for(b(u,s,h,A),f=0;f<o;f++)r[t+f]=n[e+f]^u[f];return 0}function U(r,t,n,e,o){var i,h,a=new Uint8Array(16),f=new Uint8Array(64);for(h=0;h<16;h++)a[h]=0;for(h=0;h<8;h++)a[h]=e[h];for(;n>=64;){for(b(f,a,o,A),h=0;h<64;h++)r[t+h]=f[h];for(i=1,h=8;h<16;h++)i=i+(255&a[h])|0,a[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(b(f,a,o,A),h=0;h<n;h++)r[t+h]=f[h];return 0}function d(r,t,n,e,o){var i=new Uint8Array(32);g(i,e,o,A);for(var h=new Uint8Array(8),a=0;a<8;a++)h[a]=e[a+16];return U(r,t,n,h,i)}function E(r,t,n,e,o,i,h){var a=new Uint8Array(32);g(a,i,h,A);for(var f=new Uint8Array(8),s=0;s<8;s++)f[s]=i[s+16];return _(r,t,n,e,o,f,a)}var x=function(r){var t,n,e,o,i,h,a,f;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&r[0]|(255&r[1])<<8,this.r[0]=8191&t,n=255&r[2]|(255&r[3])<<8,this.r[1]=8191&(t>>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};function M(r,t,n,e,o,i){var h=new x(i);return h.update(n,e,o),h.finish(r,t),0}function m(r,t,n,e,o,i){var h=new Uint8Array(16);return M(h,0,n,e,o,i),v(r,t,h,0)}function B(r,t,n,e,o){var i;if(n<32)return-1;for(E(r,0,t,0,n,e,o),M(r,16,r,32,n-32,r),i=0;i<16;i++)r[i]=0;return 0}function S(r,t,n,e,o){var i,h=new Uint8Array(32);if(n<32)return-1;if(d(h,0,32,e,o),0!==m(t,16,t,32,n-32,h))return-1;for(E(r,0,t,0,n,e,o),i=0;i<32;i++)r[i]=0;return 0}function k(r,t){var n;for(n=0;n<16;n++)r[n]=0|t[n]}function K(r){var t,n,e=1;for(t=0;t<16;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function Y(r,t,n){for(var e,o=~(n-1),i=0;i<16;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function L(r,n){var e,o,i,h=t(),a=t();for(e=0;e<16;e++)a[e]=n[e];for(K(a),K(a),K(a),o=0;o<2;o++){for(h[0]=a[0]-65517,e=1;e<15;e++)h[e]=a[e]-65535-(h[e-1]>>16&1),h[e-1]&=65535;h[15]=a[15]-32767-(h[14]>>16&1),i=h[15]>>16&1,h[14]&=65535,Y(a,h,1-i)}for(e=0;e<16;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function T(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return L(n,r),L(e,t),p(n,0,e,0)}function z(r){var t=new Uint8Array(32);return L(t,r),1&t[0]}function R(r,t){var n;for(n=0;n<16;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function P(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function N(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function O(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,v=0,p=0,b=0,g=0,A=0,_=0,U=0,d=0,E=0,x=0,M=0,m=0,B=0,S=0,k=0,K=0,Y=0,L=0,T=0,z=0,R=0,P=n[0],N=n[1],O=n[2],C=n[3],F=n[4],I=n[5],Z=n[6],G=n[7],q=n[8],D=n[9],V=n[10],X=n[11],j=n[12],H=n[13],J=n[14],Q=n[15];i+=(e=t[0])*P,h+=e*N,a+=e*O,f+=e*C,s+=e*F,u+=e*I,c+=e*Z,y+=e*G,l+=e*q,w+=e*D,v+=e*V,p+=e*X,b+=e*j,g+=e*H,A+=e*J,_+=e*Q,h+=(e=t[1])*P,a+=e*N,f+=e*O,s+=e*C,u+=e*F,c+=e*I,y+=e*Z,l+=e*G,w+=e*q,v+=e*D,p+=e*V,b+=e*X,g+=e*j,A+=e*H,_+=e*J,U+=e*Q,a+=(e=t[2])*P,f+=e*N,s+=e*O,u+=e*C,c+=e*F,y+=e*I,l+=e*Z,w+=e*G,v+=e*q,p+=e*D,b+=e*V,g+=e*X,A+=e*j,_+=e*H,U+=e*J,d+=e*Q,f+=(e=t[3])*P,s+=e*N,u+=e*O,c+=e*C,y+=e*F,l+=e*I,w+=e*Z,v+=e*G,p+=e*q,b+=e*D,g+=e*V,A+=e*X,_+=e*j,U+=e*H,d+=e*J,E+=e*Q,s+=(e=t[4])*P,u+=e*N,c+=e*O,y+=e*C,l+=e*F,w+=e*I,v+=e*Z,p+=e*G,b+=e*q,g+=e*D,A+=e*V,_+=e*X,U+=e*j,d+=e*H,E+=e*J,x+=e*Q,u+=(e=t[5])*P,c+=e*N,y+=e*O,l+=e*C,w+=e*F,v+=e*I,p+=e*Z,b+=e*G,g+=e*q,A+=e*D,_+=e*V,U+=e*X,d+=e*j,E+=e*H,x+=e*J,M+=e*Q,c+=(e=t[6])*P,y+=e*N,l+=e*O,w+=e*C,v+=e*F,p+=e*I,b+=e*Z,g+=e*G,A+=e*q,_+=e*D,U+=e*V,d+=e*X,E+=e*j,x+=e*H,M+=e*J,m+=e*Q,y+=(e=t[7])*P,l+=e*N,w+=e*O,v+=e*C,p+=e*F,b+=e*I,g+=e*Z,A+=e*G,_+=e*q,U+=e*D,d+=e*V,E+=e*X,x+=e*j,M+=e*H,m+=e*J,B+=e*Q,l+=(e=t[8])*P,w+=e*N,v+=e*O,p+=e*C,b+=e*F,g+=e*I,A+=e*Z,_+=e*G,U+=e*q,d+=e*D,E+=e*V,x+=e*X,M+=e*j,m+=e*H,B+=e*J,S+=e*Q,w+=(e=t[9])*P,v+=e*N,p+=e*O,b+=e*C,g+=e*F,A+=e*I,_+=e*Z,U+=e*G,d+=e*q,E+=e*D,x+=e*V,M+=e*X,m+=e*j,B+=e*H,S+=e*J,k+=e*Q,v+=(e=t[10])*P,p+=e*N,b+=e*O,g+=e*C,A+=e*F,_+=e*I,U+=e*Z,d+=e*G,E+=e*q,x+=e*D,M+=e*V,m+=e*X,B+=e*j,S+=e*H,k+=e*J,K+=e*Q,p+=(e=t[11])*P,b+=e*N,g+=e*O,A+=e*C,_+=e*F,U+=e*I,d+=e*Z,E+=e*G,x+=e*q,M+=e*D,m+=e*V,B+=e*X,S+=e*j,k+=e*H,K+=e*J,Y+=e*Q,b+=(e=t[12])*P,g+=e*N,A+=e*O,_+=e*C,U+=e*F,d+=e*I,E+=e*Z,x+=e*G,M+=e*q,m+=e*D,B+=e*V,S+=e*X,k+=e*j,K+=e*H,Y+=e*J,L+=e*Q,g+=(e=t[13])*P,A+=e*N,_+=e*O,U+=e*C,d+=e*F,E+=e*I,x+=e*Z,M+=e*G,m+=e*q,B+=e*D,S+=e*V,k+=e*X,K+=e*j,Y+=e*H,L+=e*J,T+=e*Q,A+=(e=t[14])*P,_+=e*N,U+=e*O,d+=e*C,E+=e*F,x+=e*I,M+=e*Z,m+=e*G,B+=e*q,S+=e*D,k+=e*V,K+=e*X,Y+=e*j,L+=e*H,T+=e*J,z+=e*Q,_+=(e=t[15])*P,h+=38*(d+=e*O),a+=38*(E+=e*C),f+=38*(x+=e*F),s+=38*(M+=e*I),u+=38*(m+=e*Z),c+=38*(B+=e*G),y+=38*(S+=e*q),l+=38*(k+=e*D),w+=38*(K+=e*V),v+=38*(Y+=e*X),p+=38*(L+=e*j),b+=38*(T+=e*H),g+=38*(z+=e*J),A+=38*(R+=e*Q),i=(e=(i+=38*(U+=e*N))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),i=(e=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=v,r[11]=p,r[12]=b,r[13]=g,r[14]=A,r[15]=_}function C(r,t){O(r,t,t)}function F(r,n){var e,o=t();for(e=0;e<16;e++)o[e]=n[e];for(e=253;e>=0;e--)C(o,o),2!==e&&4!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}function I(r,n){var e,o=t();for(e=0;e<16;e++)o[e]=n[e];for(e=250;e>=0;e--)C(o,o),1!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}function Z(r,n,e){var o,i,h=new Uint8Array(32),f=new Float64Array(80),s=t(),u=t(),c=t(),y=t(),l=t(),w=t();for(i=0;i<31;i++)h[i]=n[i];for(h[31]=127&n[31]|64,h[0]&=248,R(f,e),i=0;i<16;i++)u[i]=f[i],y[i]=s[i]=c[i]=0;for(s[0]=y[0]=1,i=254;i>=0;--i)Y(s,u,o=h[i>>>3]>>>(7&i)&1),Y(c,y,o),P(l,s,c),N(s,s,c),P(c,u,y),N(u,u,y),C(y,l),C(w,s),O(s,c,s),O(c,u,l),P(l,s,c),N(s,s,c),C(u,s),N(c,y,w),O(s,c,a),P(s,s,y),O(c,c,s),O(s,y,w),O(y,u,f),C(u,l),Y(s,u,o),Y(c,y,o);for(i=0;i<16;i++)f[i+16]=s[i],f[i+32]=c[i],f[i+48]=u[i],f[i+64]=y[i];var v=f.subarray(32),p=f.subarray(16);return F(v,v),O(p,p,v),L(r,p),0}function G(r,t){return Z(r,t,o)}function q(r,t){return n(t,32),G(r,t)}function D(r,t,n){var o=new Uint8Array(32);return Z(o,n,t),g(r,e,o,A)}x.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,v,p,b,g,A,_,U,d=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],k=this.h[6],K=this.h[7],Y=this.h[8],L=this.h[9],T=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],N=this.r[4],O=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],Z=this.r[9];n>=16;)y=c=0,y+=(E+=8191&(e=255&r[t+0]|(255&r[t+1])<<8))*T,y+=(x+=8191&(e>>>13|(o=255&r[t+2]|(255&r[t+3])<<8)<<3))*(5*Z),y+=(M+=8191&(o>>>10|(i=255&r[t+4]|(255&r[t+5])<<8)<<6))*(5*I),y+=(m+=8191&(i>>>7|(h=255&r[t+6]|(255&r[t+7])<<8)<<9))*(5*F),c=(y+=(B+=8191&(h>>>4|(a=255&r[t+8]|(255&r[t+9])<<8)<<12))*(5*C))>>>13,y&=8191,y+=(S+=a>>>1&8191)*(5*O),y+=(k+=8191&(a>>>14|(f=255&r[t+10]|(255&r[t+11])<<8)<<2))*(5*N),y+=(K+=8191&(f>>>11|(s=255&r[t+12]|(255&r[t+13])<<8)<<5))*(5*P),y+=(Y+=8191&(s>>>8|(u=255&r[t+14]|(255&r[t+15])<<8)<<8))*(5*R),l=c+=(y+=(L+=u>>>5|d)*(5*z))>>>13,l+=E*z,l+=x*T,l+=M*(5*Z),l+=m*(5*I),c=(l+=B*(5*F))>>>13,l&=8191,l+=S*(5*C),l+=k*(5*O),l+=K*(5*N),l+=Y*(5*P),c+=(l+=L*(5*R))>>>13,l&=8191,w=c,w+=E*R,w+=x*z,w+=M*T,w+=m*(5*Z),c=(w+=B*(5*I))>>>13,w&=8191,w+=S*(5*F),w+=k*(5*C),w+=K*(5*O),w+=Y*(5*N),v=c+=(w+=L*(5*P))>>>13,v+=E*P,v+=x*R,v+=M*z,v+=m*T,c=(v+=B*(5*Z))>>>13,v&=8191,v+=S*(5*I),v+=k*(5*F),v+=K*(5*C),v+=Y*(5*O),p=c+=(v+=L*(5*N))>>>13,p+=E*N,p+=x*P,p+=M*R,p+=m*z,c=(p+=B*T)>>>13,p&=8191,p+=S*(5*Z),p+=k*(5*I),p+=K*(5*F),p+=Y*(5*C),b=c+=(p+=L*(5*O))>>>13,b+=E*O,b+=x*N,b+=M*P,b+=m*R,c=(b+=B*z)>>>13,b&=8191,b+=S*T,b+=k*(5*Z),b+=K*(5*I),b+=Y*(5*F),g=c+=(b+=L*(5*C))>>>13,g+=E*C,g+=x*O,g+=M*N,g+=m*P,c=(g+=B*R)>>>13,g&=8191,g+=S*z,g+=k*T,g+=K*(5*Z),g+=Y*(5*I),A=c+=(g+=L*(5*F))>>>13,A+=E*F,A+=x*C,A+=M*O,A+=m*N,c=(A+=B*P)>>>13,A&=8191,A+=S*R,A+=k*z,A+=K*T,A+=Y*(5*Z),_=c+=(A+=L*(5*I))>>>13,_+=E*I,_+=x*F,_+=M*C,_+=m*O,c=(_+=B*N)>>>13,_&=8191,_+=S*P,_+=k*R,_+=K*z,_+=Y*T,U=c+=(_+=L*(5*Z))>>>13,U+=E*Z,U+=x*I,U+=M*F,U+=m*C,c=(U+=B*O)>>>13,U&=8191,U+=S*N,U+=k*P,U+=K*R,U+=Y*z,E=y=8191&(c=(c=((c+=(U+=L*T)>>>13)<<2)+c|0)+(y&=8191)|0),x=l+=c>>>=13,M=w&=8191,m=v&=8191,B=p&=8191,S=b&=8191,k=g&=8191,K=A&=8191,Y=_&=8191,L=U&=8191,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=k,this.h[7]=K,this.h[8]=Y,this.h[9]=L},x.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;i<10;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;i<10;i++)h[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},x.prototype.update=function(r,t,n){var e,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),e=0;e<o;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;e<n;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var V=B,X=S;var j=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function H(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,v,p,b,g,A,_,U,d,E,x,M,m,B,S,k,K=new Int32Array(16),Y=new Int32Array(16),L=r[0],T=r[1],z=r[2],R=r[3],P=r[4],N=r[5],O=r[6],C=r[7],F=t[0],I=t[1],Z=t[2],G=t[3],q=t[4],D=t[5],V=t[6],X=t[7],H=0;e>=128;){for(d=0;d<16;d++)E=8*d+H,K[d]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[d]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(d=0;d<80;d++)if(o=L,i=T,h=z,a=R,f=P,s=N,u=O,C,y=F,l=I,w=Z,v=G,p=q,b=D,g=V,X,m=65535&(M=X),B=M>>>16,S=65535&(x=C),k=x>>>16,m+=65535&(M=(q>>>14|P<<18)^(q>>>18|P<<14)^(P>>>9|q<<23)),B+=M>>>16,S+=65535&(x=(P>>>14|q<<18)^(P>>>18|q<<14)^(q>>>9|P<<23)),k+=x>>>16,m+=65535&(M=q&D^~q&V),B+=M>>>16,S+=65535&(x=P&N^~P&O),k+=x>>>16,x=j[2*d],m+=65535&(M=j[2*d+1]),B+=M>>>16,S+=65535&x,k+=x>>>16,x=K[d%16],B+=(M=Y[d%16])>>>16,S+=65535&x,k+=x>>>16,S+=(B+=(m+=65535&M)>>>16)>>>16,m=65535&(M=U=65535&m|B<<16),B=M>>>16,S=65535&(x=_=65535&S|(k+=S>>>16)<<16),k=x>>>16,m+=65535&(M=(F>>>28|L<<4)^(L>>>2|F<<30)^(L>>>7|F<<25)),B+=M>>>16,S+=65535&(x=(L>>>28|F<<4)^(F>>>2|L<<30)^(F>>>7|L<<25)),k+=x>>>16,B+=(M=F&I^F&Z^I&Z)>>>16,S+=65535&(x=L&T^L&z^T&z),k+=x>>>16,c=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(k+=S>>>16)<<16,A=65535&m|B<<16,m=65535&(M=v),B=M>>>16,S=65535&(x=a),k=x>>>16,B+=(M=U)>>>16,S+=65535&(x=_),k+=x>>>16,T=o,z=i,R=h,P=a=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(k+=S>>>16)<<16,N=f,O=s,C=u,L=c,I=y,Z=l,G=w,q=v=65535&m|B<<16,D=p,V=b,X=g,F=A,d%16==15)for(E=0;E<16;E++)x=K[E],m=65535&(M=Y[E]),B=M>>>16,S=65535&x,k=x>>>16,x=K[(E+9)%16],m+=65535&(M=Y[(E+9)%16]),B+=M>>>16,S+=65535&x,k+=x>>>16,_=K[(E+1)%16],m+=65535&(M=((U=Y[(E+1)%16])>>>1|_<<31)^(U>>>8|_<<24)^(U>>>7|_<<25)),B+=M>>>16,S+=65535&(x=(_>>>1|U<<31)^(_>>>8|U<<24)^_>>>7),k+=x>>>16,_=K[(E+14)%16],B+=(M=((U=Y[(E+14)%16])>>>19|_<<13)^(_>>>29|U<<3)^(U>>>6|_<<26))>>>16,S+=65535&(x=(_>>>19|U<<13)^(U>>>29|_<<3)^_>>>6),k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,K[E]=65535&S|k<<16,Y[E]=65535&m|B<<16;m=65535&(M=F),B=M>>>16,S=65535&(x=L),k=x>>>16,x=r[0],B+=(M=t[0])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[0]=L=65535&S|k<<16,t[0]=F=65535&m|B<<16,m=65535&(M=I),B=M>>>16,S=65535&(x=T),k=x>>>16,x=r[1],B+=(M=t[1])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[1]=T=65535&S|k<<16,t[1]=I=65535&m|B<<16,m=65535&(M=Z),B=M>>>16,S=65535&(x=z),k=x>>>16,x=r[2],B+=(M=t[2])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[2]=z=65535&S|k<<16,t[2]=Z=65535&m|B<<16,m=65535&(M=G),B=M>>>16,S=65535&(x=R),k=x>>>16,x=r[3],B+=(M=t[3])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[3]=R=65535&S|k<<16,t[3]=G=65535&m|B<<16,m=65535&(M=q),B=M>>>16,S=65535&(x=P),k=x>>>16,x=r[4],B+=(M=t[4])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[4]=P=65535&S|k<<16,t[4]=q=65535&m|B<<16,m=65535&(M=D),B=M>>>16,S=65535&(x=N),k=x>>>16,x=r[5],B+=(M=t[5])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[5]=N=65535&S|k<<16,t[5]=D=65535&m|B<<16,m=65535&(M=V),B=M>>>16,S=65535&(x=O),k=x>>>16,x=r[6],B+=(M=t[6])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[6]=O=65535&S|k<<16,t[6]=V=65535&m|B<<16,m=65535&(M=X),B=M>>>16,S=65535&(x=C),k=x>>>16,x=r[7],B+=(M=t[7])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[7]=C=65535&S|k<<16,t[7]=X=65535&m|B<<16,H+=128,e-=128}return e}function J(r,t,n){var e,o=new Int32Array(8),i=new Int32Array(8),h=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,H(o,i,t,n),n%=128,e=0;e<n;e++)h[e]=t[a-n+e];for(h[n]=128,h[(n=256-128*(n<112?1:0))-9]=0,l(h,n-8,a/536870912|0,a<<3),H(o,i,h,n),e=0;e<8;e++)l(r,8*e,o[e],i[e]);return 0}function Q(r,n){var e=t(),o=t(),i=t(),h=t(),a=t(),f=t(),u=t(),c=t(),y=t();N(e,r[1],r[0]),N(y,n[1],n[0]),O(e,e,y),P(o,r[0],r[1]),P(y,n[0],n[1]),O(o,o,y),O(i,r[3],n[3]),O(i,i,s),O(h,r[2],n[2]),P(h,h,h),N(a,o,e),N(f,h,i),P(u,h,i),P(c,o,e),O(r[0],a,f),O(r[1],c,u),O(r[2],u,f),O(r[3],a,c)}function W(r,t,n){var e;for(e=0;e<4;e++)Y(r[e],t[e],n)}function $(r,n){var e=t(),o=t(),i=t();F(i,n[2]),O(e,n[0],i),O(o,n[1],i),L(r,o),r[31]^=z(e)<<7}function rr(r,t,n){var e,o;for(k(r[0],i),k(r[1],h),k(r[2],h),k(r[3],i),o=255;o>=0;--o)W(r,t,e=n[o/8|0]>>(7&o)&1),Q(t,r),Q(r,r),W(r,t,e)}function tr(r,n){var e=[t(),t(),t(),t()];k(e[0],u),k(e[1],c),k(e[2],h),O(e[3],u,c),rr(r,e,n)}function nr(r,e,o){var i,h=new Uint8Array(64),a=[t(),t(),t(),t()];for(o||n(e,32),J(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64,tr(a,h),$(r,a),i=0;i<32;i++)e[i+32]=r[i];return 0}var er=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function or(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o<i;++o)t[o]+=n-16*t[e]*er[o-(e-32)],n=Math.floor((t[o]+128)/256),t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*er[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*er[o];for(e=0;e<32;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function ir(r){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=r[t];for(t=0;t<64;t++)r[t]=0;or(r,n)}function hr(r,n,e,o){var i,h,a=new Uint8Array(64),f=new Uint8Array(64),s=new Uint8Array(64),u=new Float64Array(64),c=[t(),t(),t(),t()];J(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(i=0;i<e;i++)r[64+i]=n[i];for(i=0;i<32;i++)r[32+i]=a[32+i];for(J(s,r.subarray(32),e+32),ir(s),tr(c,s),$(r,c),i=32;i<64;i++)r[i]=o[i];for(J(f,r,e+64),ir(f),i=0;i<64;i++)u[i]=0;for(i=0;i<32;i++)u[i]=s[i];for(i=0;i<32;i++)for(h=0;h<32;h++)u[i+h]+=f[i]*a[h];return or(r.subarray(32),u),y}function ar(r,n,e,o){var a,s=new Uint8Array(32),u=new Uint8Array(64),c=[t(),t(),t(),t()],l=[t(),t(),t(),t()];if(e<64)return-1;if(function(r,n){var e=t(),o=t(),a=t(),s=t(),u=t(),c=t(),l=t();return k(r[2],h),R(r[1],n),C(a,r[1]),O(s,a,f),N(a,a,r[2]),P(s,r[2],s),C(u,s),C(c,u),O(l,c,u),O(e,l,a),O(e,e,s),I(e,e),O(e,e,a),O(e,e,s),O(e,e,s),O(r[0],e,s),C(o,r[0]),O(o,o,s),T(o,a)&&O(r[0],r[0],y),C(o,r[0]),O(o,o,s),T(o,a)?-1:(z(r[0])===n[31]>>7&&N(r[0],i,r[0]),O(r[3],r[0],r[1]),0)}(l,o))return-1;for(a=0;a<e;a++)r[a]=n[a];for(a=0;a<32;a++)r[a+32]=o[a];if(J(u,r,e),ir(u),rr(c,l,u),tr(l,n.subarray(32)),Q(c,l),$(s,c),e-=64,p(n,0,s,0)){for(a=0;a<e;a++)r[a]=0;return-1}for(a=0;a<e;a++)r[a]=n[a+64];return e}var fr=32,sr=24,ur=32,cr=32,yr=sr;function lr(r,t){if(r.length!==fr)throw new Error("bad key size");if(t.length!==sr)throw new Error("bad nonce size")}function wr(){for(var r=0;r<arguments.length;r++)if(!(arguments[r]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function vr(r){for(var t=0;t<r.length;t++)r[t]=0}r.lowlevel={crypto_core_hsalsa20:g,crypto_stream_xor:E,crypto_stream:d,crypto_stream_salsa20_xor:_,crypto_stream_salsa20:U,crypto_onetimeauth:M,crypto_onetimeauth_verify:m,crypto_verify_16:v,crypto_verify_32:p,crypto_secretbox:B,crypto_secretbox_open:S,crypto_scalarmult:Z,crypto_scalarmult_base:G,crypto_box_beforenm:D,crypto_box_afternm:V,crypto_box:function(r,t,n,e,o,i){var h=new Uint8Array(32);return D(h,o,i),V(r,t,n,e,h)},crypto_box_open:function(r,t,n,e,o,i){var h=new Uint8Array(32);return D(h,o,i),X(r,t,n,e,h)},crypto_box_keypair:q,crypto_hash:J,crypto_sign:hr,crypto_sign_keypair:nr,crypto_sign_open:ar,crypto_secretbox_KEYBYTES:fr,crypto_secretbox_NONCEBYTES:sr,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:ur,crypto_box_SECRETKEYBYTES:cr,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:yr,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:f,L:er,pack25519:L,unpack25519:R,M:O,A:P,S:C,Z:N,pow2523:I,add:Q,set25519:k,modL:or,scalarmult:rr,scalarbase:tr},r.randomBytes=function(r){var t=new Uint8Array(r);return n(t,r),t},r.secretbox=function(r,t,n){wr(r,t,n),lr(n,t);for(var e=new Uint8Array(32+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+32]=r[i];return B(o,e,e.length,t,n),o.subarray(16)},r.secretbox.open=function(r,t,n){wr(r,t,n),lr(n,t);for(var e=new Uint8Array(16+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+16]=r[i];return e.length<32?null:0!==S(o,e,e.length,t,n)?null:o.subarray(32)},r.secretbox.keyLength=fr,r.secretbox.nonceLength=sr,r.secretbox.overheadLength=16,r.scalarMult=function(r,t){if(wr(r,t),32!==r.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return Z(n,r,t),n},r.scalarMult.base=function(r){if(wr(r),32!==r.length)throw new Error("bad n size");var t=new Uint8Array(32);return G(t,r),t},r.scalarMult.scalarLength=32,r.scalarMult.groupElementLength=32,r.box=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox(t,n,i)},r.box.before=function(r,t){wr(r,t),function(r,t){if(r.length!==ur)throw new Error("bad public key size");if(t.length!==cr)throw new Error("bad secret key size")}(r,t);var n=new Uint8Array(32);return D(n,r,t),n},r.box.after=r.secretbox,r.box.open=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox.open(t,n,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(ur),t=new Uint8Array(cr);return q(r,t),{publicKey:r,secretKey:t}},r.box.keyPair.fromSecretKey=function(r){if(wr(r),r.length!==cr)throw new Error("bad secret key size");var t=new Uint8Array(ur);return G(t,r),{publicKey:t,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=ur,r.box.secretKeyLength=cr,r.box.sharedKeyLength=32,r.box.nonceLength=yr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,t){if(wr(r,t),64!==t.length)throw new Error("bad secret key size");var n=new Uint8Array(64+r.length);return hr(n,r,r.length,t),n},r.sign.open=function(r,t){if(wr(r,t),32!==t.length)throw new Error("bad public key size");var n=new Uint8Array(r.length),e=ar(n,r,r.length,t);if(e<0)return null;for(var o=new Uint8Array(e),i=0;i<o.length;i++)o[i]=n[i];return o},r.sign.detached=function(t,n){for(var e=r.sign(t,n),o=new Uint8Array(64),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached.verify=function(r,t,n){if(wr(r,t,n),64!==t.length)throw new Error("bad signature size");if(32!==n.length)throw new Error("bad public key size");var e,o=new Uint8Array(64+r.length),i=new Uint8Array(64+r.length);for(e=0;e<64;e++)o[e]=t[e];for(e=0;e<r.length;e++)o[e+64]=r[e];return ar(i,o,o.length,n)>=0},r.sign.keyPair=function(){var r=new Uint8Array(32),t=new Uint8Array(64);return nr(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(wr(r),64!==r.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),n=0;n<t.length;n++)t[n]=r[32+n];return{publicKey:t,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(wr(r),32!==r.length)throw new Error("bad seed size");for(var t=new Uint8Array(32),n=new Uint8Array(64),e=0;e<32;e++)n[e]=r[e];return nr(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=32,r.sign.secretKeyLength=64,r.sign.seedLength=32,r.sign.signatureLength=64,r.hash=function(r){wr(r);var t=new Uint8Array(64);return J(t,r,r.length),t},r.hash.hashLength=64,r.verify=function(r,t){return wr(r,t),0!==r.length&&0!==t.length&&(r.length===t.length&&0===w(r,0,t,0,r.length))},r.setPRNG=function(r){n=r},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){r.setPRNG(function(r,n){var e,o=new Uint8Array(n);for(e=0;e<n;e+=65536)t.getRandomValues(o.subarray(e,e+Math.min(n-e,65536)));for(e=0;e<n;e++)r[e]=o[e];vr(o)})}else"undefined"!=typeof require&&(t=require("crypto"))&&t.randomBytes&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;e<n;e++)r[e]=o[e];vr(o)})}()}("undefined"!=typeof module&&module.exports?module.exports:self.nacl=self.nacl||{});

},{"crypto":39}],75:[function(require,module,exports){
module.exports=require("./lib");

},{"./lib":78}],76:[function(require,module,exports){
var cache=function(n){var c,t=!1;return n instanceof Function||(t=!0,c=n,n=null),function(){return t||(t=!0,c=n.apply(this,arguments),n=null),c}};module.exports=cache;

},{}],77:[function(require,module,exports){
module.exports=function l(e,n,t){if(t||(t=[]),t.length<e.length){var g=e[t.length];for(var h in g)t[t.length]=g[h],l(e,n,t),--t.length}else n.apply(null,t)};

},{}],78:[function(require,module,exports){
module.exports={cache:require("./cache"),eachCombination:require("./eachCombination")};

},{"./cache":76,"./eachCombination":77}]},{},[1]);

Выполнить команду


Для локальной разработки. Не используйте в интернете!